2 GTK_POS_LEFT, GTK_POS_RIGHT, GTK_POS_TOP, GTK_POS_BOTTOM,
3 DRAG_OPERATION_NONE, DRAG_OPERATION_REORDER, DRAG_OPERATION_DETACH
12 struct { void *parent; } *tab_label;
14 GdkRectangle requisition, allocation;
17 GtkNotebookPage *cur_page;
23 GtkNotebookPage *detached_tab;
25 gtk_notebook_calculate_tabs_allocation()
27 GtkNotebook *notebook;
32 GtkNotebookPrivate *priv;
33 GtkNotebookPage *page;
34 int allocate_at_bottom;
39 GdkRectangle child_allocation;
40 while (*children && *children == last_child) {
41 if (page->tab_label->parent != notebook)
44 notebook->homogeneous)
46 = remaining_space / expanded_tabs;
50 child_allocation.width =
51 page->requisition.width +
55 if (allocate_at_bottom
56 && notebook->cur_page->pack
59 notebook->cur_page->allocation.
62 if (allocate_at_bottom)
63 anchor = child_allocation.width;
64 if (priv->operation == DRAG_OPERATION_REORDER
65 && page->pack == notebook->cur_page->pack)
71 anchor + child_allocation.width / 2)
76 child_allocation.x = anchor;
80 child_allocation.height =
81 page->requisition.height + x+
84 priv->x = child_allocation.x;
85 if (priv->operation == DRAG_OPERATION_REORDER
86 && page->pack == notebook->cur_page->pack)
87 if (allocate_at_bottom && y >= anchor
89 anchor + child_allocation.height / 2)
91 notebook->cur_page->allocation.
96 if ((page == priv->detached_tab
97 && priv->operation == DRAG_OPERATION_DETACH)
98 || (page == notebook->cur_page
99 && priv->operation == DRAG_OPERATION_REORDER))
100 page->allocation.x = 0;
101 if (page == notebook->cur_page)
104 page->allocation.y = 0;
108 page->allocation.x = 0;
113 if (priv->operation != DRAG_OPERATION_REORDER
114 || priv->operation == DRAG_OPERATION_REORDER
115 && page != notebook->cur_page)
116 if (allocate_at_bottom)
118 child_allocation.width
122 if (priv->operation != DRAG_OPERATION_REORDER
123 || priv->operation == DRAG_OPERATION_REORDER
124 && page != notebook->cur_page)
125 if (priv->operation == DRAG_OPERATION_REORDER)
127 notebook->cur_page->pack
128 && allocate_at_bottom
131 + child_allocation.height
134 anchor + child_allocation.height)
140 IA__gtk_widget_set_child_visible(page->tab_label, 1);