1 typedef void *gpointer;
2 typedef struct _GList GList;
3 typedef struct _FOO FOO;
4 typedef void (*GClassInitFunc) (gpointer g_class, gpointer class_data);
5 typedef void (*GInstanceInitFunc) (FOO * instance, gpointer g_class);
6 typedef enum { FFFFFFF } MOO;
7 typedef struct _GdkRectangle GdkRectangle;
20 GTK_POS_RIGHT, GTK_POS_TOP, GTK_POS_BOTTOM
22 typedef struct _GtkObject GtkObject;
26 typedef struct _GtkWidget GtkWidget;
28 GTK_TOPLEVEL = 1 << 4, GTK_NO_WINDOW = 1 << 5, GTK_REALIZED =
29 1 << 6, GTK_MAPPED = 1 << 7, GTK_VISIBLE = 1 << 8, GTK_SENSITIVE =
30 1 << 9, GTK_PARENT_SENSITIVE = 1 << 10, GTK_CAN_FOCUS =
31 1 << 11, GTK_HAS_FOCUS = 1 << 12, GTK_CAN_DEFAULT =
32 1 << 13, GTK_HAS_DEFAULT = 1 << 14, GTK_HAS_GRAB =
33 1 << 15, GTK_RC_STYLE = 1 << 16, GTK_COMPOSITE_CHILD =
34 1 << 17, GTK_NO_REPARENT = 1 << 18, GTK_APP_PAINTABLE =
35 1 << 19, GTK_RECEIVES_DEFAULT = 1 << 20, GTK_DOUBLE_BUFFERED =
36 1 << 21, GTK_NO_SHOW_ALL = 1 << 22
38 typedef struct _GtkRequisition GtkRequisition;
39 typedef GdkRectangle GtkAllocation;
40 struct _GtkRequisition {
48 GTK_NOTEBOOK_TAB_FIRST, GTK_NOTEBOOK_TAB_LAST
50 typedef struct _GtkNotebook GtkNotebook;
51 typedef struct _GtkNotebookClass GtkNotebookClass;
52 typedef struct _GtkNotebookPage GtkNotebookPage;
54 GtkNotebookPage *cur_page;
55 unsigned int show_tabs:1;
56 unsigned int homogeneous:1;
58 struct _GtkNotebookClass {
59 int(*focus_tab) (GtkNotebook * notebook, GtkNotebookTab type);
65 DRAG_OPERATION_NONE, DRAG_OPERATION_REORDER, DRAG_OPERATION_DETACH
66 } GtkNotebookDragOperation;
67 struct _GtkNotebookPage {
69 unsigned int expand:1;
71 GtkRequisition requisition;
72 GtkAllocation allocation;
74 typedef struct _GtkNotebookPrivate GtkNotebookPrivate;
75 struct _GtkNotebookPrivate {
76 GtkNotebookDragOperation operation;
79 GtkNotebookPage *detached_tab;
81 int gtk_notebook_focus_tab(GtkNotebook * notebook,
83 void gtk_notebook_switch_focus_tab(GtkNotebook * notebook,
85 void gtk_notebook_init(GtkNotebook * self);
86 void gtk_notebook_class_init(GtkNotebookClass * klass);
87 void gtk_notebook_class_intern_init(gpointer klass)
89 gtk_notebook_class_init((GtkNotebookClass *) klass);
91 unsigned int IA__gtk_notebook_get_type(void)
93 unsigned int g_define_type_id;
94 unsigned int g_define_type_id__volatile;
95 if (g_once_init_enter(&g_define_type_id__volatile))
97 g_type_register_static_simple((IA__gtk_container_get_type
99 g_intern_static_string
101 sizeof(GtkNotebookClass),
103 gtk_notebook_class_intern_init,
109 void gtk_notebook_class_init(GtkNotebookClass * class)
112 int gtk_notebook_focus_tab(GtkNotebook * notebook,
116 int gtk_notebook_calculate_tabs_allocation(GtkNotebook * notebook,
121 int * remaining_space,
125 GtkNotebookPrivate *priv;
126 GtkNotebookPage *page;
127 int allocate_at_bottom;
139 GtkAllocation child_allocation;
140 while (*children && *children != last_child) {
142 (((GtkNotebookPage *) (page))->tab_label->parent ==
143 ((GtkWidget *) (notebook))))
148 notebook->homogeneous)
150 tab_extra_space = *remaining_space / *expanded_tabs;
151 *remaining_space -= tab_extra_space;
156 child_allocation.width =
157 page->requisition.width + tab_overlap +
164 if (!allocate_at_bottom) {
168 left_x = priv->drag_window_x =
177 notebook->cur_page->pack ==
185 left_x = priv->drag_window_x =
187 anchor += tab_overlap;
191 if (allocate_at_bottom)
192 anchor -= child_allocation.width;
194 priv->operation == DRAG_OPERATION_REORDER
196 page->pack == notebook->cur_page->pack
198 if (!allocate_at_bottom
201 anchor + child_allocation.width / 2)
209 right_x >= anchor + child_allocation.width / 2
211 right_x <= anchor + child_allocation.width
218 child_allocation.x = anchor;
223 child_allocation.height =
224 page->requisition.height + tab_overlap +
229 priv->drag_window_x = child_allocation.x;
230 priv->drag_window_y = top_y;
232 priv->operation == DRAG_OPERATION_REORDER
234 page->pack == notebook->cur_page->pack
243 child_allocation.height / 2
253 (page == priv->detached_tab && priv->operation == DRAG_OPERATION_DETACH)
255 (page == notebook->cur_page
256 && priv->operation == DRAG_OPERATION_REORDER)
258 page->allocation.x = 0;
260 if (page != notebook->cur_page) {
263 page->allocation.y += ythickness;
265 page->allocation.height =
267 (page->allocation.height -
268 ythickness)) ? (1) : (page->allocation.
273 page->allocation.x += xthickness;
275 page->allocation.width =
277 (page->allocation.width -
278 xthickness)) ? (1) : (page->allocation.
286 if (priv->operation != DRAG_OPERATION_REORDER
287 || (priv->operation == DRAG_OPERATION_REORDER
288 && page != notebook->cur_page))
289 if (!allocate_at_bottom)
291 child_allocation.width -
295 if (priv->operation != DRAG_OPERATION_REORDER
296 || (priv->operation == DRAG_OPERATION_REORDER
297 && page != notebook->cur_page))
298 if (priv->operation == DRAG_OPERATION_REORDER)
300 notebook->cur_page->pack
301 && !allocate_at_bottom
303 anchor + child_allocation.height / 2
305 anchor + child_allocation.height)
312 IA__gtk_widget_set_child_visible(page->tab_label,
316 void gtk_notebook_pages_allocate(GtkNotebook * notebook)
319 void gtk_notebook_switch_focus_tab(GtkNotebook * notebook,