8 GTK_POS_LEFT, GTK_POS_RIGHT, GTK_POS_TOP, GTK_POS_BOTTOM
16 GdkRectangle requisition, allocation;
19 GtkNotebookPage *cur_page;
23 DRAG_OPERATION_NONE, DRAG_OPERATION_REORDER, DRAG_OPERATION_DETACH
29 GtkNotebookPage *detached_tab;
31 gtk_notebook_calculate_tabs_allocation()
33 GtkNotebook * notebook;
35 void* last_child; int showarrow;
37 int *expanded_tabs; int min; int max;
38 GtkNotebookPrivate *priv;
39 GtkNotebookPage *page;
40 int allocate_at_bottom;
52 GdkRectangle child_allocation;
53 while (*children && *children != last_child) {
54 if (page->tab_label->parent != notebook)
56 if (*expanded_tabs && notebook->homogeneous) {
57 tab_extra_space = *remaining_space / *expanded_tabs;
58 *remaining_space -= tab_extra_space;
63 child_allocation.width =
64 page->requisition.width + tab_overlap +
66 if (gap_left && packing_changed) {
67 if (allocate_at_bottom) {
68 left_x = priv->x = anchor;
70 notebook->cur_page->allocation.
72 if (notebook->cur_page->pack
73 && right_x > anchor) {
81 if (allocate_at_bottom)
82 anchor -= child_allocation.width;
83 if (priv->operation == DRAG_OPERATION_REORDER
84 && page->pack == notebook->cur_page->pack) {
85 if (!allocate_at_bottom
88 anchor + child_allocation.width / 2)
93 else if (allocate_at_bottom
96 child_allocation.width / 2
99 child_allocation.width)
105 child_allocation.x = anchor;
110 child_allocation.height =
111 page->requisition.height + tab_overlap +
113 if (packing_changed) {
114 priv->x = child_allocation.x;
116 if (priv->operation == DRAG_OPERATION_REORDER
117 && page->pack == notebook->cur_page->pack) {
118 if (!allocate_at_bottom
122 child_allocation.height / 2)
130 if ((page == priv->detached_tab
131 && priv->operation == DRAG_OPERATION_DETACH)
132 || (page == notebook->cur_page
133 && priv->operation == DRAG_OPERATION_REORDER)) {
134 page->allocation.x = 0;
136 if (page != notebook->cur_page) {
139 page->allocation.y += ythickness;
141 page->allocation.height =
143 page->allocation.height -
144 ythickness ? 1 : page->allocation.height -
148 page->allocation.x += xthickness;
150 page->allocation.width =
152 page->allocation.width -
153 xthickness ? 1 : page->allocation.width -
160 if (priv->operation != DRAG_OPERATION_REORDER
161 || priv->operation == DRAG_OPERATION_REORDER
162 && page != notebook->cur_page)
163 if (!allocate_at_bottom)
165 child_allocation.width -
169 if (priv->operation != DRAG_OPERATION_REORDER
170 || priv->operation == DRAG_OPERATION_REORDER
171 && page != notebook->cur_page)
172 if (priv->operation == DRAG_OPERATION_REORDER)
174 notebook->cur_page->pack
175 && !allocate_at_bottom
177 anchor + child_allocation.height / 2
179 anchor + child_allocation.height)
186 IA__gtk_widget_set_child_visible(page->tab_label, 1);