OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_GTK_GTK_FLOATING_CONTAINER_H_ | 5 #ifndef CHROME_BROWSER_GTK_GTK_FLOATING_CONTAINER_H_ |
6 #define CHROME_BROWSER_GTK_GTK_FLOATING_CONTAINER_H_ | 6 #define CHROME_BROWSER_GTK_GTK_FLOATING_CONTAINER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <gdk/gdk.h> | 9 #include <gdk/gdk.h> |
10 #include <gtk/gtk.h> | 10 #include <gtk/gtk.h> |
11 | 11 |
12 // A specialized container, which is a cross between a GtkBin and a | 12 // A specialized container, which is a cross between a GtkBin and a |
13 // GtkFixed. This container dervies from GtkBin and the implementation of | 13 // GtkFixed. This container dervies from GtkBin and the implementation of |
14 // gtk_container_add() is the same: only one GtkWidget can be added through | 14 // gtk_container_add() is the same: only one GtkWidget can be added through |
15 // that interface. The GtkBin portion contains normal content and is given the | 15 // that interface. The GtkBin portion contains normal content and is given the |
16 // same allocation that this container has. | 16 // same allocation that this container has. |
17 // | 17 // |
18 // In addition, any number of widgets can be added through the | 18 // In addition, any number of widgets can be added through the |
19 // gtk_floating_container_add_floating() method, which provides functionality | 19 // gtk_floating_container_add_floating() method, which provides functionality |
20 // similar to a GtkFixed. Unlike a GtkFixed, coordinates are not set when you | 20 // similar to a GtkFixed. Unlike a GtkFixed, coordinates are not set when you |
21 // gtk_fixed_put(). The location of the floating widgets is determined while | 21 // gtk_fixed_put(). The location of the floating widgets is determined while |
22 // running the "set-floating-position" signal, which is emitted during this | 22 // running the "set-floating-position" signal, which is emitted during this |
23 // container's "size-allocate" handler. | 23 // container's "size-allocate" handler. |
24 // | 24 // |
25 // The "set-floating-position" signal is (semi-)mandatory if you want widgets | 25 // The "set-floating-position" signal is (semi-)mandatory if you want widgets |
26 // placed anywhere other than the origin and should have the following | 26 // placed anywhere other than the origin and should have the following |
27 // signature: | 27 // signature: |
28 // | 28 // |
29 // void (*set_floating_position)(GtkFloatingContainer* container, | 29 // void (*set_floating_position)(GtkFloatingContainer* container, |
30 // GtkAllocation* allocation); | 30 // GtkAllocation* allocation, |
| 31 // gpointer userdata); |
31 // | 32 // |
32 // Your handler should, for each floating widget, set the "x" and "y" child | 33 // Your handler should, for each floating widget, set the "x" and "y" child |
33 // properties. | 34 // properties. |
34 | 35 |
35 G_BEGIN_DECLS | 36 G_BEGIN_DECLS |
36 | 37 |
37 #define GTK_TYPE_FLOATING_CONTAINER \ | 38 #define GTK_TYPE_FLOATING_CONTAINER \ |
38 (gtk_floating_container_get_type()) | 39 (gtk_floating_container_get_type()) |
39 #define GTK_FLOATING_CONTAINER(obj) \ | 40 #define GTK_FLOATING_CONTAINER(obj) \ |
40 (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_FLOATING_CONTAINER, \ | 41 (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_FLOATING_CONTAINER, \ |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 GType gtk_floating_container_get_type() G_GNUC_CONST; | 78 GType gtk_floating_container_get_type() G_GNUC_CONST; |
78 GtkWidget* gtk_floating_container_new(); | 79 GtkWidget* gtk_floating_container_new(); |
79 void gtk_floating_container_add_floating(GtkFloatingContainer* container, | 80 void gtk_floating_container_add_floating(GtkFloatingContainer* container, |
80 GtkWidget* widget); | 81 GtkWidget* widget); |
81 // Use gtk_container_remove to remove all widgets; both widgets added with | 82 // Use gtk_container_remove to remove all widgets; both widgets added with |
82 // gtk_container_add() and gtk_floating_container_add_floating(). | 83 // gtk_container_add() and gtk_floating_container_add_floating(). |
83 | 84 |
84 G_END_DECLS | 85 G_END_DECLS |
85 | 86 |
86 #endif // CHROME_BROWSER_GTK_GTK_FLOATING_CONTAINER_H_ | 87 #endif // CHROME_BROWSER_GTK_GTK_FLOATING_CONTAINER_H_ |
OLD | NEW |