if (w == NULL)
return FALSE;
- for (tmp = w->parent; tmp; tmp = tmp->parent)
+ for (tmp = gtk_widget_get_parent (w); tmp; tmp = gtk_widget_get_parent (tmp))
{
if (GTK_IS_COMBO_BOX (tmp))
return TRUE;
dc = get_window_dc (style, window, state, &dc_info, area->x, area->y, area->width,
area->height, &rect);
- border = (GTK_TOGGLE_BUTTON (widget->parent)->
+ border = (GTK_TOGGLE_BUTTON (gtk_widget_get_parent (widget))->
active ? DFCS_PUSHED | DFCS_FLAT : 0);
InflateRect (&rect, 1, 1);
}
}
/* probably a gtk combo box on a toolbar */
- else if (0 /* widget->parent && GTK_IS_BUTTON
- (widget->parent) */ )
+ else if (0 /* gtk_widget_get_parent (widget) && GTK_IS_BUTTON
+ (gtk_widget_get_parent (widget)) */ )
{
+ GtkAllocation allocation;
+
+ gtk_widget_get_allocation (widget, &allocation);
if (xp_theme_draw
(window, XP_THEME_ELEMENT_COMBOBUTTON, style, x - 3,
- widget->allocation.y + 1, width + 5,
- widget->allocation.height - 4, state, area))
+ allocation.y + 1, width + 5,
+ allocation.height - 4, state, area))
{
return;
}
if (GTK_IS_TOOLBAR (wid) || GTK_IS_HANDLE_BOX (wid))
return TRUE;
else
- wid = wid->parent;
+ wid = gtk_widget_get_parent (wid);
}
return FALSE;
if (GTK_IS_MENU_TOOL_BUTTON (wid))
return TRUE;
else
- wid = wid->parent;
+ wid = gtk_widget_get_parent (wid);
}
return FALSE;
}
}
else if (state_type == GTK_STATE_ACTIVE)
{
- if (is_toggled && !is_menu_tool_button_child (widget->parent))
+ if (is_toggled && !is_menu_tool_button_child (gtk_widget_get_parent (widget)))
{
SetTextColor (dc, GetSysColor (COLOR_3DHILIGHT));
SetBkColor (dc, GetSysColor (COLOR_BTNFACE));
if (detail &&
(!strcmp (detail, "button") || !strcmp (detail, "buttondefault")))
{
- if (GTK_IS_TREE_VIEW (widget->parent))
+ if (GTK_IS_TREE_VIEW (gtk_widget_get_parent (widget)))
{
if (xp_theme_draw
(window, XP_THEME_ELEMENT_LIST_HEADER, style, x, y,
release_window_dc (&dc_info);
}
}
- else if (is_toolbar_child (widget->parent)
+ else if (is_toolbar_child (gtk_widget_get_parent (widget))
|| (!GTK_IS_BUTTON (widget) ||
(GTK_RELIEF_NONE == gtk_button_get_relief (GTK_BUTTON (widget)))))
{
if (detail && !strcmp (detail, "optionmenutab"))
{
+ GtkAllocation allocation;
+
+ gtk_widget_get_allocation (widget, &allocation);
if (xp_theme_draw (window, XP_THEME_ELEMENT_COMBOBUTTON,
- style, x - 5, widget->allocation.y + 1,
- width + 10, widget->allocation.height - 2,
+ style, x - 5, allocation.y + 1,
+ width + 10, allocation.height - 2,
state, area))
{
return;
GdkRectangle draw_rect, clip_rect;
GdkPixbufRotation rotation = GDK_PIXBUF_ROTATE_NONE;
cairo_t *cr;
+ GtkAllocation allocation;
+
+ gtk_widget_get_allocation (widget, &allocation);
if (gap_side == GTK_POS_TOP)
{
}
/* If we are currently drawing the right-most tab, and if that tab is the selected tab... */
- widget_right = widget->allocation.x + widget->allocation.width - border_width - 2;
+ widget_right = allocation.x + allocation.width - border_width - 2;
if (draw_rect.x + draw_rect.width >= widget_right)
{
}
/* If we are currently drawing the right-most tab, and if that tab is the selected tab... */
- widget_right = widget->allocation.x + widget->allocation.width - border_width - 2;
+ widget_right = allocation.x + allocation.width - border_width - 2;
if (draw_rect.x + draw_rect.width >= widget_right)
{
}
/* If we are currently drawing the bottom-most tab, and if that tab is the selected tab... */
- widget_bottom = widget->allocation.x + widget->allocation.height - border_width - 2;
+ widget_bottom = allocation.x + allocation.height - border_width - 2;
if (draw_rect.y + draw_rect.height >= widget_bottom)
{
}
/* If we are currently drawing the bottom-most tab, and if that tab is the selected tab... */
- widget_bottom = widget->allocation.x + widget->allocation.height - border_width - 2;
+ widget_bottom = allocation.x + allocation.height - border_width - 2;
if (draw_rect.y + draw_rect.height >= widget_bottom)
{
// pixel at the top. There may be a better solution than this if someone
// has time to discover it.
if (gap_side == GTK_POS_BOTTOM && state_type == GTK_STATE_NORMAL
- && x == widget->allocation.x)
+ && x == allocation.x)
{
int rowstride = gdk_pixbuf_get_rowstride (pixbuf);
int n_channels = gdk_pixbuf_get_n_channels (pixbuf);
{
return;
}
- if (GTK_IS_TREE_VIEW (widget->parent) /* list view bheader */)
+ if (GTK_IS_TREE_VIEW (gtk_widget_get_parent (widget)) /* list view bheader */)
{
return;
}
*/
if (xp_theme_is_active () && detail && !strcmp (detail, "label"))
{
- if (widget->parent != NULL)
+ if (gtk_widget_get_parent (widget) != NULL)
{
- if (GTK_IS_NOTEBOOK (widget->parent))
+ if (GTK_IS_NOTEBOOK (gtk_widget_get_parent (widget)))
{
int side;
- notebook = GTK_NOTEBOOK (widget->parent);
+ notebook = GTK_NOTEBOOK (gtk_widget_get_parent (widget));
side = gtk_notebook_get_tab_pos (notebook);
if (side == GTK_POS_TOP || side == GTK_POS_BOTTOM)