Build with GSEAL_ENABLE and #undef it where accessors are missing

This commit is contained in:
Michael Natterer 2009-10-17 20:20:39 +02:00
parent 6608d66cde
commit 1a23b9ecf2
49 changed files with 313 additions and 191 deletions

View File

@ -188,11 +188,15 @@ gimp_blob_editor_expose (GtkWidget *widget,
{ {
GimpBlobEditor *editor = GIMP_BLOB_EDITOR (widget); GimpBlobEditor *editor = GIMP_BLOB_EDITOR (widget);
GtkStyle *style = gtk_widget_get_style (widget); GtkStyle *style = gtk_widget_get_style (widget);
GtkStateType state = gtk_widget_get_state (widget);
GtkAllocation allocation;
cairo_t *cr; cairo_t *cr;
GdkRectangle rect; GdkRectangle rect;
gint r0; gint r0;
r0 = MIN (widget->allocation.width, widget->allocation.height) / 2; gtk_widget_get_allocation (widget, &allocation);
r0 = MIN (allocation.width, allocation.height) / 2;
if (r0 < 2) if (r0 < 2)
return TRUE; return TRUE;
@ -200,18 +204,18 @@ gimp_blob_editor_expose (GtkWidget *widget,
cr = gdk_cairo_create (gtk_widget_get_window (widget)); cr = gdk_cairo_create (gtk_widget_get_window (widget));
gimp_blob_editor_draw_blob (editor, cr, gimp_blob_editor_draw_blob (editor, cr,
widget->allocation.width / 2.0, allocation.width / 2.0,
widget->allocation.height / 2.0, allocation.height / 2.0,
0.9 * r0); 0.9 * r0);
gimp_blob_editor_get_handle (editor, &rect); gimp_blob_editor_get_handle (editor, &rect);
cairo_rectangle (cr, cairo_rectangle (cr,
rect.x + 0.5, rect.y + 0.5, rect.width - 1, rect.width - 1); rect.x + 0.5, rect.y + 0.5, rect.width - 1, rect.width - 1);
gdk_cairo_set_source_color (cr, &style->light[widget->state]); gdk_cairo_set_source_color (cr, &style->light[state]);
cairo_fill_preserve (cr); cairo_fill_preserve (cr);
gdk_cairo_set_source_color (cr, &style->dark[widget->state]); gdk_cairo_set_source_color (cr, &style->dark[state]);
cairo_set_line_width (cr, 1); cairo_set_line_width (cr, 1);
cairo_stroke (cr); cairo_stroke (cr);
@ -257,12 +261,15 @@ gimp_blob_editor_motion_notify (GtkWidget *widget,
if (editor->active) if (editor->active)
{ {
gint x; GtkAllocation allocation;
gint y; gint x;
gint rsquare; gint y;
gint rsquare;
x = event->x - widget->allocation.width / 2; gtk_widget_get_allocation (widget, &allocation);
y = event->y - widget->allocation.height / 2;
x = event->x - allocation.width / 2;
y = event->y - allocation.height / 2;
rsquare = SQR (x) + SQR (y); rsquare = SQR (x) + SQR (y);
@ -272,7 +279,7 @@ gimp_blob_editor_motion_notify (GtkWidget *widget,
gdouble angle; gdouble angle;
gdouble aspect; gdouble aspect;
r0 = MIN (widget->allocation.width, widget->allocation.height) / 2; r0 = MIN (allocation.width, allocation.height) / 2;
angle = atan2 (y, x); angle = atan2 (y, x);
aspect = 10.0 * sqrt ((gdouble) rsquare / (r0 * r0)) / 0.85; aspect = 10.0 * sqrt ((gdouble) rsquare / (r0 * r0)) / 0.85;
@ -293,16 +300,19 @@ static void
gimp_blob_editor_get_handle (GimpBlobEditor *editor, gimp_blob_editor_get_handle (GimpBlobEditor *editor,
GdkRectangle *rect) GdkRectangle *rect)
{ {
GtkWidget *widget = GTK_WIDGET (editor); GtkWidget *widget = GTK_WIDGET (editor);
gint x, y; GtkAllocation allocation;
gint r; gint x, y;
gint r;
r = MIN (widget->allocation.width, widget->allocation.height) / 2; gtk_widget_get_allocation (widget, &allocation);
x = (widget->allocation.width / 2 + r = MIN (allocation.width, allocation.height) / 2;
x = (allocation.width / 2 +
0.85 * r *editor->aspect / 10.0 * cos (editor->angle)); 0.85 * r *editor->aspect / 10.0 * cos (editor->angle));
y = (widget->allocation.height / 2 + y = (allocation.height / 2 +
0.85 * r * editor->aspect / 10.0 * sin (editor->angle)); 0.85 * r * editor->aspect / 10.0 * sin (editor->angle));
rect->x = x - 5; rect->x = x - 5;
@ -374,6 +384,6 @@ gimp_blob_editor_draw_blob (GimpBlobEditor *editor,
g_free (blob); g_free (blob);
gdk_cairo_set_source_color (cr, &style->fg[widget->state]); gdk_cairo_set_source_color (cr, &style->fg[gtk_widget_get_state (widget)]);
cairo_fill (cr); cairo_fill (cr);
} }

View File

@ -148,6 +148,12 @@ gimp_cell_renderer_dashes_get_size (GtkCellRenderer *cell,
gint *width, gint *width,
gint *height) gint *height)
{ {
gfloat xalign, yalign;
gint xpad, ypad;
gtk_cell_renderer_get_alignment (cell, &xalign, &yalign);
gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
if (cell_area) if (cell_area)
{ {
if (x_offset) if (x_offset)
@ -155,16 +161,16 @@ gimp_cell_renderer_dashes_get_size (GtkCellRenderer *cell,
gdouble align; gdouble align;
align = ((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ? align = ((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ?
1.0 - cell->xalign : cell->xalign); 1.0 - xalign : xalign);
*x_offset = align * (cell_area->width - DASHES_WIDTH); *x_offset = align * (cell_area->width - DASHES_WIDTH);
*x_offset = MAX (*x_offset, 0) + cell->xpad; *x_offset = MAX (*x_offset, 0) + xpad;
} }
if (y_offset) if (y_offset)
{ {
*y_offset = cell->yalign * (cell_area->height - DASHES_HEIGHT); *y_offset = yalign * (cell_area->height - DASHES_HEIGHT);
*y_offset = MAX (*y_offset, 0) + cell->ypad; *y_offset = MAX (*y_offset, 0) + ypad;
} }
} }
else else
@ -176,8 +182,8 @@ gimp_cell_renderer_dashes_get_size (GtkCellRenderer *cell,
*y_offset = 0; *y_offset = 0;
} }
*width = DASHES_WIDTH + 2 * cell->xpad; *width = DASHES_WIDTH + 2 * xpad;
*height = DASHES_HEIGHT + 2 * cell->ypad; *height = DASHES_HEIGHT + 2 * ypad;
} }
static void static void
@ -192,36 +198,39 @@ gimp_cell_renderer_dashes_render (GtkCellRenderer *cell,
GimpCellRendererDashes *dashes = GIMP_CELL_RENDERER_DASHES (cell); GimpCellRendererDashes *dashes = GIMP_CELL_RENDERER_DASHES (cell);
GtkStyle *style = gtk_widget_get_style (widget); GtkStyle *style = gtk_widget_get_style (widget);
GtkStateType state; GtkStateType state;
gint xpad, ypad;
cairo_t *cr; cairo_t *cr;
gint width; gint width;
gint x, y; gint x, y;
if (! cell->sensitive) gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
if (! gtk_cell_renderer_get_sensitive (cell))
{ {
state = GTK_STATE_INSENSITIVE; state = GTK_STATE_INSENSITIVE;
} }
else if ((flags & GTK_CELL_RENDERER_SELECTED) == GTK_CELL_RENDERER_SELECTED) else if ((flags & GTK_CELL_RENDERER_SELECTED) == GTK_CELL_RENDERER_SELECTED)
{ {
if (GTK_WIDGET_HAS_FOCUS (widget)) if (gtk_widget_has_focus (widget))
state = GTK_STATE_SELECTED; state = GTK_STATE_SELECTED;
else else
state = GTK_STATE_ACTIVE; state = GTK_STATE_ACTIVE;
} }
else if ((flags & GTK_CELL_RENDERER_PRELIT) == GTK_CELL_RENDERER_PRELIT && else if ((flags & GTK_CELL_RENDERER_PRELIT) == GTK_CELL_RENDERER_PRELIT &&
GTK_WIDGET_STATE (widget) == GTK_STATE_PRELIGHT) gtk_widget_get_state (widget) == GTK_STATE_PRELIGHT)
{ {
state = GTK_STATE_PRELIGHT; state = GTK_STATE_PRELIGHT;
} }
else else
{ {
if (GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE) if (gtk_widget_is_sensitive (widget))
state = GTK_STATE_INSENSITIVE;
else
state = GTK_STATE_NORMAL; state = GTK_STATE_NORMAL;
else
state = GTK_STATE_INSENSITIVE;
} }
y = cell_area->y + (cell_area->height - DASHES_HEIGHT) / 2; y = cell_area->y + (cell_area->height - DASHES_HEIGHT) / 2;
width = cell_area->width - 2 * cell->xpad; width = cell_area->width - 2 * xpad;
cr = gdk_cairo_create (window); cr = gdk_cairo_create (window);
@ -235,7 +244,7 @@ gimp_cell_renderer_dashes_render (GtkCellRenderer *cell,
if (dashes->segments[index]) if (dashes->segments[index])
{ {
cairo_rectangle (cr, cairo_rectangle (cr,
cell_area->x + cell->xpad + x, y, cell_area->x + xpad + x, y,
MIN (BLOCK_WIDTH, width - x), DASHES_HEIGHT); MIN (BLOCK_WIDTH, width - x), DASHES_HEIGHT);
} }
} }

View File

@ -198,11 +198,16 @@ gimp_cell_renderer_viewable_get_size (GtkCellRenderer *cell,
gint *height) gint *height)
{ {
GimpCellRendererViewable *cellviewable; GimpCellRendererViewable *cellviewable;
gfloat xalign, yalign;
gint xpad, ypad;
gint view_width = 0; gint view_width = 0;
gint view_height = 0; gint view_height = 0;
gint calc_width; gint calc_width;
gint calc_height; gint calc_height;
gtk_cell_renderer_get_alignment (cell, &xalign, &yalign);
gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
cellviewable = GIMP_CELL_RENDERER_VIEWABLE (cell); cellviewable = GIMP_CELL_RENDERER_VIEWABLE (cell);
if (cellviewable->renderer) if (cellviewable->renderer)
@ -213,8 +218,8 @@ gimp_cell_renderer_viewable_get_size (GtkCellRenderer *cell,
2 * cellviewable->renderer->border_width); 2 * cellviewable->renderer->border_width);
} }
calc_width = (gint) cell->xpad * 2 + view_width; calc_width = (gint) xpad * 2 + view_width;
calc_height = (gint) cell->ypad * 2 + view_height; calc_height = (gint) ypad * 2 + view_height;
if (x_offset) *x_offset = 0; if (x_offset) *x_offset = 0;
if (y_offset) *y_offset = 0; if (y_offset) *y_offset = 0;
@ -224,15 +229,14 @@ gimp_cell_renderer_viewable_get_size (GtkCellRenderer *cell,
if (x_offset) if (x_offset)
{ {
*x_offset = (((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ? *x_offset = (((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ?
1.0 - cell->xalign : cell->xalign) * 1.0 - xalign : xalign) *
(cell_area->width - calc_width - 2 * cell->xpad)); (cell_area->width - calc_width - 2 * xpad));
*x_offset = (MAX (*x_offset, 0) + cell->xpad); *x_offset = (MAX (*x_offset, 0) + xpad);
} }
if (y_offset) if (y_offset)
{ {
*y_offset = (cell->yalign * *y_offset = (yalign * (cell_area->height - calc_height - 2 * ypad));
(cell_area->height - calc_height - 2 * cell->ypad)); *y_offset = (MAX (*y_offset, 0) + ypad);
*y_offset = (MAX (*y_offset, 0) + cell->ypad);
} }
} }

View File

@ -153,18 +153,21 @@ static gboolean
gimp_color_bar_expose (GtkWidget *widget, gimp_color_bar_expose (GtkWidget *widget,
GdkEventExpose *event) GdkEventExpose *event)
{ {
GimpColorBar *bar = GIMP_COLOR_BAR (widget); GimpColorBar *bar = GIMP_COLOR_BAR (widget);
GtkStyle *style = gtk_widget_get_style (widget); GtkStyle *style = gtk_widget_get_style (widget);
guchar *buf; GtkAllocation allocation;
guchar *b; guchar *buf;
gint x, y; guchar *b;
gint width, height; gint x, y;
gint i, j; gint width, height;
gint i, j;
gtk_widget_get_allocation (widget, &allocation);
x = y = gtk_container_get_border_width (GTK_CONTAINER (bar)); x = y = gtk_container_get_border_width (GTK_CONTAINER (bar));
width = widget->allocation.width - 2 * x; width = allocation.width - 2 * x;
height = widget->allocation.height - 2 * y; height = allocation.height - 2 * y;
if (width < 1 || height < 1) if (width < 1 || height < 1)
return TRUE; return TRUE;
@ -205,7 +208,7 @@ gimp_color_bar_expose (GtkWidget *widget,
} }
gdk_draw_rgb_image (gtk_widget_get_window (widget), style->black_gc, gdk_draw_rgb_image (gtk_widget_get_window (widget), style->black_gc,
widget->allocation.x + x, widget->allocation.y + y, allocation.x + x, allocation.y + y,
width, height, width, height,
GDK_RGB_DITHER_NORMAL, GDK_RGB_DITHER_NORMAL,
buf, 3 * width); buf, 3 * width);

View File

@ -271,11 +271,18 @@ gimp_color_frame_expose (GtkWidget *widget,
if (frame->has_number) if (frame->has_number)
{ {
GtkStyle *style = gtk_widget_get_style (widget); GtkStyle *style = gtk_widget_get_style (widget);
cairo_t *cr; GtkAllocation allocation;
gchar buf[8]; GtkAllocation menu_allocation;
gint w, h; GtkAllocation color_area_allocation;
gdouble scale; cairo_t *cr;
gchar buf[8];
gint w, h;
gdouble scale;
gtk_widget_get_allocation (widget, &allocation);
gtk_widget_get_allocation (frame->menu, &menu_allocation);
gtk_widget_get_allocation (frame->color_area, &color_area_allocation);
cr = gdk_cairo_create (gtk_widget_get_window (widget)); cr = gdk_cairo_create (gtk_widget_get_window (widget));
gdk_cairo_set_source_color (cr, &style->light[GTK_STATE_NORMAL]); gdk_cairo_set_source_color (cr, &style->light[GTK_STATE_NORMAL]);
@ -288,20 +295,20 @@ gimp_color_frame_expose (GtkWidget *widget,
pango_layout_set_text (frame->number_layout, buf, -1); pango_layout_set_text (frame->number_layout, buf, -1);
pango_layout_get_pixel_size (frame->number_layout, &w, &h); pango_layout_get_pixel_size (frame->number_layout, &w, &h);
scale = ((gdouble) (widget->allocation.height - scale = ((gdouble) (allocation.height -
frame->menu->allocation.height - menu_allocation.height -
frame->color_area->allocation.height) / color_area_allocation.height) /
(gdouble) h); (gdouble) h);
cairo_scale (cr, scale, scale); cairo_scale (cr, scale, scale);
cairo_move_to (cr, cairo_move_to (cr,
(widget->allocation.x + (allocation.x +
widget->allocation.width / 2.0) / scale - w / 2.0, allocation.width / 2.0) / scale - w / 2.0,
(widget->allocation.y + (allocation.y +
widget->allocation.height / 2.0 + allocation.height / 2.0 +
frame->menu->allocation.height / 2.0 + menu_allocation.height / 2.0 +
frame->color_area->allocation.height / 2.0) / scale - h / 2.0); color_area_allocation.height / 2.0) / scale - h / 2.0);
pango_cairo_show_layout (cr, frame->number_layout); pango_cairo_show_layout (cr, frame->number_layout);
cairo_fill (cr); cairo_fill (cr);

View File

@ -17,6 +17,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include <string.h> #include <string.h>
/* FIXME: #undef GTK_DISABLE_DEPRECATED */ /* FIXME: #undef GTK_DISABLE_DEPRECATED */

View File

@ -217,12 +217,14 @@ gimp_combo_tag_entry_expose_event (GtkWidget *widget,
gdk_drawable_get_size (GDK_DRAWABLE (event->window), &window_width, &window_height); gdk_drawable_get_size (GDK_DRAWABLE (event->window), &window_width, &window_height);
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
{ {
gdk_draw_rectangle (event->window, style->base_gc[widget->state], gdk_draw_rectangle (event->window,
style->base_gc[gtk_widget_get_state (widget)],
TRUE, 0, 0, 14, window_height); TRUE, 0, 0, 14, window_height);
} }
else else
{ {
gdk_draw_rectangle (event->window, style->base_gc[widget->state], gdk_draw_rectangle (event->window,
style->base_gc[gtk_widget_get_state (widget)],
TRUE, window_width - 14, 0, 14, window_height); TRUE, window_width - 14, 0, 14, window_height);
} }
@ -406,17 +408,20 @@ static void
gimp_combo_tag_entry_get_arrow_rect (GimpComboTagEntry *entry, gimp_combo_tag_entry_get_arrow_rect (GimpComboTagEntry *entry,
GdkRectangle *arrow_rect) GdkRectangle *arrow_rect)
{ {
GtkWidget *widget = GTK_WIDGET (entry); GtkWidget *widget = GTK_WIDGET (entry);
GtkStyle *style = gtk_widget_get_style (widget); GtkStyle *style = gtk_widget_get_style (widget);
GtkAllocation allocation;
gtk_widget_get_allocation (widget, &allocation);
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
arrow_rect->x = style->xthickness; arrow_rect->x = style->xthickness;
else else
arrow_rect->x = widget->allocation.width - 16 - style->xthickness * 2; arrow_rect->x = allocation.width - 16 - style->xthickness * 2;
arrow_rect->y = 0; arrow_rect->y = 0;
arrow_rect->width = 12; arrow_rect->width = 12;
arrow_rect->height = widget->allocation.height - style->ythickness * 2; arrow_rect->height = allocation.height - style->ythickness * 2;
} }
static gboolean static gboolean

View File

@ -83,7 +83,7 @@ gimp_container_box_init (GimpContainerBox *box)
sb = gtk_scrolled_window_get_vscrollbar (GTK_SCROLLED_WINDOW (box->scrolled_win)); sb = gtk_scrolled_window_get_vscrollbar (GTK_SCROLLED_WINDOW (box->scrolled_win));
GTK_WIDGET_UNSET_FLAGS (sb, GTK_CAN_FOCUS); gtk_widget_set_can_focus (sb, FALSE);
gimp_container_view_set_dnd_widget (view, box->scrolled_win); gimp_container_view_set_dnd_widget (view, box->scrolled_win);
} }

View File

@ -207,7 +207,7 @@ gimp_container_grid_view_init (GimpContainerGridView *grid_view)
G_CALLBACK (gimp_container_grid_view_button_press), G_CALLBACK (gimp_container_grid_view_button_press),
grid_view); grid_view);
GTK_WIDGET_SET_FLAGS (grid_view, GTK_CAN_FOCUS); gtk_widget_set_can_focus (GTK_WIDGET (grid_view), TRUE);
} }
GtkWidget * GtkWidget *
@ -287,7 +287,7 @@ gimp_container_grid_view_move_cursor (GimpContainerGridView *grid_view,
GimpContainer *container; GimpContainer *container;
GimpViewable *item; GimpViewable *item;
if (! GTK_WIDGET_HAS_FOCUS (GTK_WIDGET (grid_view)) || count == 0) if (! gtk_widget_has_focus (GTK_WIDGET (grid_view)) || count == 0)
return FALSE; return FALSE;
container = gimp_container_view_get_container (view); container = gimp_container_view_get_container (view);
@ -321,7 +321,7 @@ gimp_container_grid_view_focus (GtkWidget *widget,
{ {
GimpContainerGridView *view = GIMP_CONTAINER_GRID_VIEW (widget); GimpContainerGridView *view = GIMP_CONTAINER_GRID_VIEW (widget);
if (GTK_WIDGET_CAN_FOCUS (widget) && ! GTK_WIDGET_HAS_FOCUS (widget)) if (gtk_widget_get_can_focus (widget) && ! gtk_widget_has_focus (widget))
{ {
gtk_widget_grab_focus (GTK_WIDGET (widget)); gtk_widget_grab_focus (GTK_WIDGET (widget));
return TRUE; return TRUE;
@ -354,24 +354,27 @@ gimp_container_grid_view_menu_position (GtkMenu *menu,
{ {
GimpContainerGridView *grid_view = GIMP_CONTAINER_GRID_VIEW (data); GimpContainerGridView *grid_view = GIMP_CONTAINER_GRID_VIEW (data);
GtkWidget *widget; GtkWidget *widget;
GtkAllocation allocation;
if (grid_view->selected_item) if (grid_view->selected_item)
widget = GTK_WIDGET (grid_view->selected_item); widget = GTK_WIDGET (grid_view->selected_item);
else else
widget = GTK_WIDGET (grid_view->wrap_box); widget = GTK_WIDGET (grid_view->wrap_box);
gtk_widget_get_allocation (widget, &allocation);
gdk_window_get_origin (gtk_widget_get_window (widget), x, y); gdk_window_get_origin (gtk_widget_get_window (widget), x, y);
if (GTK_WIDGET_NO_WINDOW (widget)) if (! gtk_widget_get_has_window (widget))
{ {
*x += widget->allocation.x; *x += allocation.x;
*y += widget->allocation.y; *y += allocation.y;
} }
if (grid_view->selected_item) if (grid_view->selected_item)
{ {
*x += widget->allocation.width / 2; *x += allocation.width / 2;
*y += widget->allocation.height / 2; *y += allocation.height / 2;
} }
else else
{ {
@ -553,7 +556,7 @@ gimp_container_grid_view_item_selected (GtkWidget *widget,
{ {
if (bevent->type == GDK_BUTTON_PRESS && bevent->button == 1) if (bevent->type == GDK_BUTTON_PRESS && bevent->button == 1)
{ {
if (GTK_WIDGET_CAN_FOCUS (data) && ! GTK_WIDGET_HAS_FOCUS (data)) if (gtk_widget_get_can_focus (data) && ! gtk_widget_has_focus (data))
gtk_widget_grab_focus (GTK_WIDGET (data)); gtk_widget_grab_focus (GTK_WIDGET (data));
gimp_container_view_item_selected (GIMP_CONTAINER_VIEW (data), gimp_container_view_item_selected (GIMP_CONTAINER_VIEW (data),

View File

@ -220,13 +220,17 @@ gimp_container_popup_button_press (GtkWidget *widget,
if (event_widget == widget) if (event_widget == widget)
{ {
GtkAllocation allocation;
gtk_widget_get_allocation (widget, &allocation);
/* the event was on the popup, which can either be really on the /* the event was on the popup, which can either be really on the
* popup or outside gimp (owner_events == TRUE, see map()) * popup or outside gimp (owner_events == TRUE, see map())
*/ */
if (bevent->x < 0 || if (bevent->x < 0 ||
bevent->y < 0 || bevent->y < 0 ||
bevent->x > widget->allocation.width || bevent->x > allocation.width ||
bevent->y > widget->allocation.height) bevent->y > allocation.height)
{ {
/* the event was outsde gimp */ /* the event was outsde gimp */
@ -392,6 +396,7 @@ gimp_container_popup_show (GimpContainerPopup *popup,
{ {
GdkScreen *screen; GdkScreen *screen;
GtkRequisition requisition; GtkRequisition requisition;
GtkAllocation allocation;
GdkRectangle rect; GdkRectangle rect;
gint monitor; gint monitor;
gint orig_x; gint orig_x;
@ -403,12 +408,14 @@ gimp_container_popup_show (GimpContainerPopup *popup,
g_return_if_fail (GTK_IS_WIDGET (widget)); g_return_if_fail (GTK_IS_WIDGET (widget));
gtk_widget_size_request (GTK_WIDGET (popup), &requisition); gtk_widget_size_request (GTK_WIDGET (popup), &requisition);
gtk_widget_get_allocation (widget, &allocation);
gdk_window_get_origin (gtk_widget_get_window (widget), &orig_x, &orig_y); gdk_window_get_origin (gtk_widget_get_window (widget), &orig_x, &orig_y);
if (GTK_WIDGET_NO_WINDOW (widget)) if (! gtk_widget_get_has_window (widget))
{ {
orig_x += widget->allocation.x; orig_x += allocation.x;
orig_y += widget->allocation.y; orig_y += allocation.y;
} }
screen = gtk_widget_get_screen (widget); screen = gtk_widget_get_screen (widget);
@ -418,20 +425,20 @@ gimp_container_popup_show (GimpContainerPopup *popup,
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
{ {
x = orig_x + widget->allocation.width - requisition.width; x = orig_x + allocation.width - requisition.width;
if (x < rect.x) if (x < rect.x)
x -= widget->allocation.width - requisition.width; x -= allocation.width - requisition.width;
} }
else else
{ {
x = orig_x; x = orig_x;
if (x + requisition.width > rect.x + rect.width) if (x + requisition.width > rect.x + rect.width)
x += widget->allocation.width - requisition.width; x += allocation.width - requisition.width;
} }
y = orig_y + widget->allocation.height; y = orig_y + allocation.height;
if (y + requisition.height > rect.y + rect.height) if (y + requisition.height > rect.y + rect.height)
y = orig_y - requisition.height; y = orig_y - requisition.height;
@ -476,20 +483,20 @@ void
gimp_container_popup_set_view_size (GimpContainerPopup *popup, gimp_container_popup_set_view_size (GimpContainerPopup *popup,
gint view_size) gint view_size)
{ {
GtkWidget *scrolled_win; GtkWidget *scrolled_win;
GtkWidget *viewport; GtkWidget *viewport;
gint viewport_width; GtkAllocation allocation;
g_return_if_fail (GIMP_IS_CONTAINER_POPUP (popup)); g_return_if_fail (GIMP_IS_CONTAINER_POPUP (popup));
scrolled_win = GIMP_CONTAINER_BOX (popup->editor->view)->scrolled_win; scrolled_win = GIMP_CONTAINER_BOX (popup->editor->view)->scrolled_win;
viewport = gtk_bin_get_child (GTK_BIN (scrolled_win)); viewport = gtk_bin_get_child (GTK_BIN (scrolled_win));
viewport_width = viewport->allocation.width; gtk_widget_get_allocation (viewport, &allocation);
view_size = CLAMP (view_size, GIMP_VIEW_SIZE_TINY, view_size = CLAMP (view_size, GIMP_VIEW_SIZE_TINY,
MIN (GIMP_VIEW_SIZE_GIGANTIC, MIN (GIMP_VIEW_SIZE_GIGANTIC,
viewport_width - 2 * popup->view_border_width)); allocation.width - 2 * popup->view_border_width));
if (view_size != popup->view_size) if (view_size != popup->view_size)
{ {

View File

@ -232,10 +232,13 @@ gimp_container_tree_view_drag_motion (GtkWidget *widget,
guint time, guint time,
GimpContainerTreeView *tree_view) GimpContainerTreeView *tree_view)
{ {
GtkAllocation allocation;
GtkTreePath *path; GtkTreePath *path;
GtkTreeViewDropPosition drop_pos; GtkTreeViewDropPosition drop_pos;
if (y < SCROLL_DISTANCE || y > (widget->allocation.height - SCROLL_DISTANCE)) gtk_widget_get_allocation (widget, &allocation);
if (y < SCROLL_DISTANCE || y > (allocation.height - SCROLL_DISTANCE))
{ {
gint distance; gint distance;
@ -247,7 +250,7 @@ gimp_container_tree_view_drag_motion (GtkWidget *widget,
else else
{ {
tree_view->priv->scroll_dir = GDK_SCROLL_DOWN; tree_view->priv->scroll_dir = GDK_SCROLL_DOWN;
distance = MAX (widget->allocation.height - y, 1); distance = MAX (allocation.height - y, 1);
} }
tree_view->priv->scroll_timeout_interval = SCROLL_INTERVAL * ABS (distance); tree_view->priv->scroll_timeout_interval = SCROLL_INTERVAL * ABS (distance);

View File

@ -318,14 +318,17 @@ gimp_container_tree_view_menu_position (GtkMenu *menu,
{ {
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (data); GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (data);
GtkWidget *widget = GTK_WIDGET (tree_view->view); GtkWidget *widget = GTK_WIDGET (tree_view->view);
GtkAllocation allocation;
GtkTreeIter selected_iter; GtkTreeIter selected_iter;
gtk_widget_get_allocation (widget, &allocation);
gdk_window_get_origin (gtk_widget_get_window (widget), x, y); gdk_window_get_origin (gtk_widget_get_window (widget), x, y);
if (GTK_WIDGET_NO_WINDOW (widget)) if (! gtk_widget_get_has_window (widget))
{ {
*x += widget->allocation.x; *x += allocation.x;
*y += widget->allocation.y; *y += allocation.y;
} }
if (gtk_tree_selection_get_selected (tree_view->priv->selection, NULL, if (gtk_tree_selection_get_selected (tree_view->priv->selection, NULL,
@ -341,9 +344,9 @@ gimp_container_tree_view_menu_position (GtkMenu *menu,
gtk_tree_path_free (path); gtk_tree_path_free (path);
center = cell_rect.y + cell_rect.height / 2; center = cell_rect.y + cell_rect.height / 2;
center = CLAMP (center, 0, widget->allocation.height); center = CLAMP (center, 0, allocation.height);
*x += widget->allocation.width / 2; *x += allocation.width / 2;
*y += center; *y += center;
} }
else else
@ -972,19 +975,22 @@ gimp_container_tree_view_find_click_cell (GtkWidget *widget,
gint start; gint start;
gint width; gint width;
if (renderer->visible && if (gtk_cell_renderer_get_visible (renderer) &&
gtk_tree_view_column_cell_get_position (column, renderer, gtk_tree_view_column_cell_get_position (column, renderer,
&start, &width)) &start, &width))
{ {
gint xpad, ypad;
gint x; gint x;
gtk_cell_renderer_get_padding (renderer, &xpad, &ypad);
if (rtl) if (rtl)
x = column_area->x + column_area->width - start - width; x = column_area->x + column_area->width - start - width;
else else
x = start + column_area->x; x = start + column_area->x;
if (tree_x >= x + renderer->xpad && if (tree_x >= x + xpad &&
tree_x < x + width - renderer->xpad) tree_x < x + width - xpad)
{ {
return renderer; return renderer;
} }
@ -1005,7 +1011,7 @@ gimp_container_tree_view_button_press (GtkWidget *widget,
tree_view->priv->dnd_renderer = NULL; tree_view->priv->dnd_renderer = NULL;
if (! GTK_WIDGET_HAS_FOCUS (widget)) if (! gtk_widget_has_focus (widget))
gtk_widget_grab_focus (widget); gtk_widget_grab_focus (widget);
if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget), if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget),

View File

@ -554,7 +554,7 @@ gimp_controller_editor_row_activated (GtkTreeView *tv,
GtkTreeViewColumn *column, GtkTreeViewColumn *column,
GimpControllerEditor *editor) GimpControllerEditor *editor)
{ {
if (GTK_WIDGET_IS_SENSITIVE (editor->edit_button)) if (gtk_widget_is_sensitive (editor->edit_button))
gtk_button_clicked (GTK_BUTTON (editor->edit_button)); gtk_button_clicked (GTK_BUTTON (editor->edit_button));
} }

View File

@ -452,7 +452,7 @@ gimp_controller_list_row_activated (GtkTreeView *tv,
GtkTreeViewColumn *column, GtkTreeViewColumn *column,
GimpControllerList *list) GimpControllerList *list)
{ {
if (GTK_WIDGET_IS_SENSITIVE (list->add_button)) if (gtk_widget_is_sensitive (list->add_button))
gtk_button_clicked (GTK_BUTTON (list->add_button)); gtk_button_clicked (GTK_BUTTON (list->add_button));
} }
@ -495,7 +495,7 @@ gimp_controller_list_activate_item (GimpContainerView *view,
gpointer insert_data, gpointer insert_data,
GimpControllerList *list) GimpControllerList *list)
{ {
if (GTK_WIDGET_IS_SENSITIVE (list->edit_button)) if (gtk_widget_is_sensitive (list->edit_button))
gtk_button_clicked (GTK_BUTTON (list->edit_button)); gtk_button_clicked (GTK_BUTTON (list->edit_button));
} }

View File

@ -17,6 +17,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "widgets-types.h" #include "widgets-types.h"

View File

@ -17,6 +17,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include <string.h> #include <string.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
@ -129,8 +131,7 @@ gimp_curve_view_init (GimpCurveView *view)
view->cursor_x = -1.0; view->cursor_x = -1.0;
view->cursor_y = -1.0; view->cursor_y = -1.0;
GTK_WIDGET_SET_FLAGS (view, GTK_CAN_FOCUS); gtk_widget_set_can_focus (GTK_WIDGET (view), TRUE);
gtk_widget_add_events (GTK_WIDGET (view), gtk_widget_add_events (GTK_WIDGET (view),
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_RELEASE_MASK |
@ -592,7 +593,7 @@ gimp_curve_view_button_press (GtkWidget *widget,
break; break;
} }
if (! GTK_WIDGET_HAS_FOCUS (widget)) if (! gtk_widget_has_focus (widget))
gtk_widget_grab_focus (widget); gtk_widget_grab_focus (widget);
return TRUE; return TRUE;

View File

@ -20,6 +20,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "libgimpmath/gimpmath.h" #include "libgimpmath/gimpmath.h"

View File

@ -362,7 +362,8 @@ gimp_data_factory_view_activate_item (GimpContainerEditor *editor,
if (data && gimp_data_factory_view_have (view, if (data && gimp_data_factory_view_have (view,
GIMP_OBJECT (data))) GIMP_OBJECT (data)))
{ {
if (view->priv->edit_button && GTK_WIDGET_SENSITIVE (view->priv->edit_button)) if (view->priv->edit_button &&
gtk_widget_is_sensitive (view->priv->edit_button))
gtk_button_clicked (GTK_BUTTON (view->priv->edit_button)); gtk_button_clicked (GTK_BUTTON (view->priv->edit_button));
} }
} }

View File

@ -171,7 +171,7 @@ gimp_dialog_factory_dispose (GObject *object)
{ {
for (list = factory->open_dialogs; list; list = g_list_next (list)) for (list = factory->open_dialogs; list; list = g_list_next (list))
{ {
if (GTK_WIDGET_TOPLEVEL (list->data)) if (gtk_widget_is_toplevel (list->data))
{ {
gtk_widget_destroy (GTK_WIDGET (list->data)); gtk_widget_destroy (GTK_WIDGET (list->data));
break; break;
@ -582,7 +582,7 @@ gimp_dialog_factory_dialog_new_internal (GimpDialogFactory *factory,
if (! dialog) if (! dialog)
return NULL; return NULL;
if (GTK_WIDGET_TOPLEVEL (dialog)) if (gtk_widget_is_toplevel (dialog))
{ {
gtk_window_set_screen (GTK_WINDOW (dialog), screen); gtk_window_set_screen (GTK_WINDOW (dialog), screen);
@ -836,7 +836,7 @@ gimp_dialog_factory_add_dialog (GimpDialogFactory *factory,
dialog)) dialog))
return; return;
toplevel = GTK_WIDGET_TOPLEVEL (dialog); toplevel = gtk_widget_is_toplevel (dialog);
if (entry) /* dialog is a toplevel (but not a GimpDockWindow) or a GimpDockable */ if (entry) /* dialog is a toplevel (but not a GimpDockWindow) or a GimpDockable */
{ {
@ -878,7 +878,7 @@ gimp_dialog_factory_add_dialog (GimpDialogFactory *factory,
if (toplevel && if (toplevel &&
gimp_session_info_is_session_managed (current_info) && gimp_session_info_is_session_managed (current_info) &&
! GTK_WIDGET_VISIBLE (dialog)) ! gtk_widget_get_visible (dialog))
{ {
gimp_session_info_apply_geometry (current_info); gimp_session_info_apply_geometry (current_info);
} }
@ -994,7 +994,7 @@ gimp_dialog_factory_add_foreign (GimpDialogFactory *factory,
g_return_if_fail (GIMP_IS_DIALOG_FACTORY (factory)); g_return_if_fail (GIMP_IS_DIALOG_FACTORY (factory));
g_return_if_fail (identifier != NULL); g_return_if_fail (identifier != NULL);
g_return_if_fail (GTK_IS_WIDGET (dialog)); g_return_if_fail (GTK_IS_WIDGET (dialog));
g_return_if_fail (GTK_WIDGET_TOPLEVEL (dialog)); g_return_if_fail (gtk_widget_is_toplevel (dialog));
dialog_factory = gimp_dialog_factory_from_widget (dialog, &entry); dialog_factory = gimp_dialog_factory_from_widget (dialog, &entry);
@ -1117,7 +1117,7 @@ void
gimp_dialog_factory_hide_dialog (GtkWidget *dialog) gimp_dialog_factory_hide_dialog (GtkWidget *dialog)
{ {
g_return_if_fail (GTK_IS_WIDGET (dialog)); g_return_if_fail (GTK_IS_WIDGET (dialog));
g_return_if_fail (GTK_WIDGET_TOPLEVEL (dialog)); g_return_if_fail (gtk_widget_is_toplevel (dialog));
if (! gimp_dialog_factory_from_widget (dialog, NULL)) if (! gimp_dialog_factory_from_widget (dialog, NULL))
{ {
@ -1521,11 +1521,11 @@ gimp_dialog_factories_hide_foreach (gconstpointer key,
{ {
GtkWidget *widget = list->data; GtkWidget *widget = list->data;
if (GTK_IS_WIDGET (widget) && GTK_WIDGET_TOPLEVEL (widget)) if (GTK_IS_WIDGET (widget) && gtk_widget_is_toplevel (widget))
{ {
GimpDialogVisibilityState visibility = GIMP_DIALOG_VISIBILITY_UNKNOWN; GimpDialogVisibilityState visibility = GIMP_DIALOG_VISIBILITY_UNKNOWN;
if (GTK_WIDGET_VISIBLE (widget)) if (gtk_widget_get_visible (widget))
{ {
visibility = GIMP_DIALOG_VISIBILITY_VISIBLE; visibility = GIMP_DIALOG_VISIBILITY_VISIBLE;
@ -1558,7 +1558,7 @@ gimp_dialog_factories_show_foreach (gconstpointer key,
{ {
GtkWidget *widget = list->data; GtkWidget *widget = list->data;
if (GTK_IS_WIDGET (widget) && GTK_WIDGET_TOPLEVEL (widget)) if (GTK_IS_WIDGET (widget) && gtk_widget_is_toplevel (widget))
{ {
GimpDialogVisibilityState visibility; GimpDialogVisibilityState visibility;
@ -1566,7 +1566,7 @@ gimp_dialog_factories_show_foreach (gconstpointer key,
GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget),
GIMP_DIALOG_VISIBILITY_KEY)); GIMP_DIALOG_VISIBILITY_KEY));
if (! GTK_WIDGET_VISIBLE (widget) && if (! gtk_widget_get_visible (widget) &&
visibility == GIMP_DIALOG_VISIBILITY_VISIBLE) visibility == GIMP_DIALOG_VISIBILITY_VISIBLE)
{ {
GIMP_LOG (WM, "Showing '%s' [%p]", GIMP_LOG (WM, "Showing '%s' [%p]",
@ -1578,7 +1578,7 @@ gimp_dialog_factories_show_foreach (gconstpointer key,
*/ */
gtk_widget_show (widget); gtk_widget_show (widget);
if (GTK_WIDGET_VISIBLE (widget)) if (gtk_widget_get_visible (widget))
gdk_window_raise (gtk_widget_get_window (widget)); gdk_window_raise (gtk_widget_get_window (widget));
} }
} }
@ -1598,7 +1598,7 @@ gimp_dialog_factories_set_busy_foreach (gconstpointer key,
{ {
GtkWidget *widget = list->data; GtkWidget *widget = list->data;
if (GTK_IS_WIDGET (widget) && GTK_WIDGET_TOPLEVEL (widget)) if (GTK_IS_WIDGET (widget) && gtk_widget_is_toplevel (widget))
{ {
if (!display || display != gtk_widget_get_display (widget)) if (!display || display != gtk_widget_get_display (widget))
{ {
@ -1634,7 +1634,7 @@ gimp_dialog_factories_unset_busy_foreach (gconstpointer key,
{ {
GtkWidget *widget = list->data; GtkWidget *widget = list->data;
if (GTK_IS_WIDGET (widget) && GTK_WIDGET_TOPLEVEL (widget)) if (GTK_IS_WIDGET (widget) && gtk_widget_is_toplevel (widget))
{ {
if (gtk_widget_get_window (widget)) if (gtk_widget_get_window (widget))
gdk_window_set_cursor (gtk_widget_get_window (widget), NULL); gdk_window_set_cursor (gtk_widget_get_window (widget), NULL);
@ -1650,7 +1650,7 @@ gimp_dialog_factory_get_toolbox (GimpDialogFactory *toolbox_factory)
for (list = toolbox_factory->open_dialogs; list; list = list->next) for (list = toolbox_factory->open_dialogs; list; list = list->next)
{ {
if (GTK_IS_WIDGET (list->data) && GTK_WIDGET_TOPLEVEL (list->data)) if (GTK_IS_WIDGET (list->data) && gtk_widget_is_toplevel (list->data))
return list->data; return list->data;
} }

View File

@ -20,6 +20,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include <string.h> #include <string.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
@ -182,7 +184,7 @@ gimp_dockable_init (GimpDockable *dockable)
dockable->menu_button = gtk_button_new (); dockable->menu_button = gtk_button_new ();
gtk_widget_pop_composite_child (); gtk_widget_pop_composite_child ();
GTK_WIDGET_UNSET_FLAGS (dockable->menu_button, GTK_CAN_FOCUS); gtk_widget_set_can_focus (dockable->menu_button, FALSE);
gtk_widget_set_parent (dockable->menu_button, GTK_WIDGET (dockable)); gtk_widget_set_parent (dockable->menu_button, GTK_WIDGET (dockable));
gtk_button_set_relief (GTK_BUTTON (dockable->menu_button), GTK_RELIEF_NONE); gtk_button_set_relief (GTK_BUTTON (dockable->menu_button), GTK_RELIEF_NONE);
gtk_widget_show (dockable->menu_button); gtk_widget_show (dockable->menu_button);
@ -319,7 +321,7 @@ gimp_dockable_size_request (GtkWidget *widget,
requisition->width = border_width * 2; requisition->width = border_width * 2;
requisition->height = border_width * 2; requisition->height = border_width * 2;
if (dockable->menu_button && GTK_WIDGET_VISIBLE (dockable->menu_button)) if (dockable->menu_button && gtk_widget_get_visible (dockable->menu_button))
{ {
gtk_widget_size_request (dockable->menu_button, &child_requisition); gtk_widget_size_request (dockable->menu_button, &child_requisition);
@ -329,7 +331,7 @@ gimp_dockable_size_request (GtkWidget *widget,
requisition->height += child_requisition.height; requisition->height += child_requisition.height;
} }
if (child && GTK_WIDGET_VISIBLE (child)) if (child && gtk_widget_get_visible (child))
{ {
gtk_widget_size_request (child, &child_requisition); gtk_widget_size_request (child, &child_requisition);
@ -354,7 +356,7 @@ gimp_dockable_size_allocate (GtkWidget *widget,
border_width = gtk_container_get_border_width (container); border_width = gtk_container_get_border_width (container);
if (dockable->menu_button && GTK_WIDGET_VISIBLE (dockable->menu_button)) if (dockable->menu_button && gtk_widget_get_visible (dockable->menu_button))
{ {
gtk_widget_size_request (dockable->menu_button, &button_requisition); gtk_widget_size_request (dockable->menu_button, &button_requisition);
@ -373,7 +375,7 @@ gimp_dockable_size_allocate (GtkWidget *widget,
gtk_widget_size_allocate (dockable->menu_button, &child_allocation); gtk_widget_size_allocate (dockable->menu_button, &child_allocation);
} }
if (child && GTK_WIDGET_VISIBLE (child)) if (child && gtk_widget_get_visible (child))
{ {
child_allocation.x = allocation->x + border_width; child_allocation.x = allocation->x + border_width;
child_allocation.y = allocation->y + border_width; child_allocation.y = allocation->y + border_width;
@ -544,7 +546,7 @@ static gboolean
gimp_dockable_expose_event (GtkWidget *widget, gimp_dockable_expose_event (GtkWidget *widget,
GdkEventExpose *event) GdkEventExpose *event)
{ {
if (GTK_WIDGET_DRAWABLE (widget)) if (gtk_widget_is_drawable (widget))
{ {
GimpDockable *dockable = GIMP_DOCKABLE (widget); GimpDockable *dockable = GIMP_DOCKABLE (widget);
GtkStyle *style = gtk_widget_get_style (widget); GtkStyle *style = gtk_widget_get_style (widget);
@ -592,7 +594,8 @@ gimp_dockable_expose_event (GtkWidget *widget,
gtk_paint_layout (style, gtk_widget_get_window (widget), gtk_paint_layout (style, gtk_widget_get_window (widget),
(dockable->blink_counter & 1) ? (dockable->blink_counter & 1) ?
GTK_STATE_SELECTED : widget->state, TRUE, GTK_STATE_SELECTED : gtk_widget_get_state (widget),
TRUE,
&expose_area, widget, NULL, &expose_area, widget, NULL,
text_x, text_y, dockable->title_layout); text_x, text_y, dockable->title_layout);
} }
@ -1059,7 +1062,7 @@ gimp_dockable_blink_cancel (GimpDockable *dockable)
static void static void
gimp_dockable_cursor_setup (GimpDockable *dockable) gimp_dockable_cursor_setup (GimpDockable *dockable)
{ {
if (! GTK_WIDGET_REALIZED (dockable)) if (! GTK_WIDGET_REALIZED (GTK_WIDGET (dockable)))
return; return;
if (! dockable->title_window) if (! dockable->title_window)
@ -1102,7 +1105,7 @@ gimp_dockable_get_title_area (GimpDockable *dockable,
static void static void
gimp_dockable_clear_title_area (GimpDockable *dockable) gimp_dockable_clear_title_area (GimpDockable *dockable)
{ {
if (GTK_WIDGET_DRAWABLE (dockable)) if (gtk_widget_is_drawable (GTK_WIDGET (dockable)))
{ {
GdkRectangle area; GdkRectangle area;
@ -1310,7 +1313,7 @@ gimp_dockable_title_changed (GimpDocked *docked,
dockable->title_layout = NULL; dockable->title_layout = NULL;
} }
if (GTK_WIDGET_DRAWABLE (dockable)) if (gtk_widget_is_drawable (GTK_WIDGET (dockable)))
{ {
GdkRectangle area; GdkRectangle area;

View File

@ -20,6 +20,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include <string.h> #include <string.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>

View File

@ -20,6 +20,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h" #include "libgimpwidgets/gimpwidgets.h"

View File

@ -20,6 +20,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include <string.h> #include <string.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
@ -293,7 +295,7 @@ gimp_fg_bg_editor_expose (GtkWidget *widget,
gint rect_w, rect_h; gint rect_w, rect_h;
GimpRGB color; GimpRGB color;
if (! GTK_WIDGET_DRAWABLE (widget)) if (! gtk_widget_is_drawable (widget))
return FALSE; return FALSE;
width = widget->allocation.width; width = widget->allocation.width;

View File

@ -20,6 +20,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include <string.h> #include <string.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
@ -86,7 +88,7 @@ gimp_fg_bg_view_class_init (GimpFgBgViewClass *klass)
static void static void
gimp_fg_bg_view_init (GimpFgBgView *view) gimp_fg_bg_view_init (GimpFgBgView *view)
{ {
GTK_WIDGET_SET_FLAGS (view, GTK_NO_WINDOW); gtk_widget_set_has_window (GTK_WIDGET (view), FALSE);
view->context = NULL; view->context = NULL;
} }
@ -213,7 +215,7 @@ gimp_fg_bg_view_expose (GtkWidget *widget,
gint rect_w, rect_h; gint rect_w, rect_h;
GimpRGB color; GimpRGB color;
if (! GTK_WIDGET_DRAWABLE (widget)) if (! gtk_widget_is_drawable (widget))
return FALSE; return FALSE;
x = widget->allocation.x; x = widget->allocation.x;

View File

@ -44,6 +44,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View File

@ -17,6 +17,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "libgimpmath/gimpmath.h" #include "libgimpmath/gimpmath.h"
@ -155,7 +157,7 @@ gimp_handle_bar_expose (GtkWidget *widget,
width = widget->allocation.width - 2 * x; width = widget->allocation.width - 2 * x;
height = widget->allocation.height - 2 * y; height = widget->allocation.height - 2 * y;
if (GTK_WIDGET_NO_WINDOW (widget)) if (! gtk_widget_get_has_window (widget))
{ {
x += widget->allocation.x; x += widget->allocation.x;
y += widget->allocation.y; y += widget->allocation.y;

View File

@ -17,6 +17,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include <gegl.h> #include <gegl.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
@ -397,7 +399,8 @@ gimp_histogram_editor_frozen_update (GimpHistogramEditor *editor,
* is shown. So don't slow down painting by doing something that * is shown. So don't slow down painting by doing something that
* is not even seen by the user. * is not even seen by the user.
*/ */
if (! editor->bg_histogram && GTK_WIDGET_DRAWABLE (editor)) if (! editor->bg_histogram &&
gtk_widget_is_drawable (GTK_WIDGET (editor)))
{ {
if (gimp_histogram_editor_validate (editor)) if (gimp_histogram_editor_validate (editor))
editor->bg_histogram = gimp_histogram_duplicate (editor->histogram); editor->bg_histogram = gimp_histogram_duplicate (editor->histogram);

View File

@ -17,6 +17,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "libgimpmath/gimpmath.h" #include "libgimpmath/gimpmath.h"

View File

@ -20,6 +20,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h" #include "libgimpwidgets/gimpwidgets.h"
@ -239,7 +241,7 @@ gimp_message_box_size_request (GtkWidget *widget,
GTK_WIDGET_CLASS (parent_class)->size_request (widget, requisition); GTK_WIDGET_CLASS (parent_class)->size_request (widget, requisition);
if (box->image && GTK_WIDGET_VISIBLE (box->image)) if (box->image && gtk_widget_get_visible (box->image))
{ {
GtkRequisition child_requisition; GtkRequisition child_requisition;
gint border_width; gint border_width;
@ -266,7 +268,7 @@ gimp_message_box_size_allocate (GtkWidget *widget,
rtl = (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL); rtl = (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL);
if (box->image) if (box->image && gtk_widget_get_visible (box->image))
{ {
GtkRequisition child_requisition; GtkRequisition child_requisition;
GtkAllocation child_allocation; GtkAllocation child_allocation;

View File

@ -23,6 +23,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include <gegl.h> #include <gegl.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
@ -155,10 +157,11 @@ gimp_navigation_view_class_init (GimpNavigationViewClass *klass)
static void static void
gimp_navigation_view_init (GimpNavigationView *view) gimp_navigation_view_init (GimpNavigationView *view)
{ {
GTK_WIDGET_SET_FLAGS (view, GTK_CAN_FOCUS); gtk_widget_set_can_focus (GTK_WIDGET (view), TRUE);
gtk_widget_add_events (GTK_WIDGET (view),
GDK_POINTER_MOTION_MASK |
GDK_KEY_PRESS_MASK);
gtk_widget_add_events (GTK_WIDGET (view), (GDK_POINTER_MOTION_MASK |
GDK_KEY_PRESS_MASK));
view->x = 0.0; view->x = 0.0;
view->y = 0.0; view->y = 0.0;
view->width = 0.0; view->width = 0.0;
@ -188,7 +191,7 @@ static gboolean
gimp_navigation_view_expose (GtkWidget *widget, gimp_navigation_view_expose (GtkWidget *widget,
GdkEventExpose *event) GdkEventExpose *event)
{ {
if (GTK_WIDGET_DRAWABLE (widget)) if (gtk_widget_is_drawable (widget))
{ {
cairo_t *cr; cairo_t *cr;

View File

@ -17,6 +17,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include <string.h> #include <string.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
@ -199,7 +201,7 @@ gimp_palette_editor_init (GimpPaletteEditor *editor)
g_signal_connect (eventbox, "button-press-event", g_signal_connect (eventbox, "button-press-event",
G_CALLBACK (palette_editor_eventbox_button_press), G_CALLBACK (palette_editor_eventbox_button_press),
editor); editor);
g_signal_connect (eventbox->parent, "size-allocate", g_signal_connect (gtk_widget_get_parent (eventbox), "size-allocate",
G_CALLBACK (palette_editor_viewport_size_allocate), G_CALLBACK (palette_editor_viewport_size_allocate),
editor); editor);

View File

@ -20,6 +20,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
@ -152,7 +154,7 @@ gimp_palette_view_class_init (GimpPaletteViewClass *klass)
static void static void
gimp_palette_view_init (GimpPaletteView *view) gimp_palette_view_init (GimpPaletteView *view)
{ {
GTK_WIDGET_SET_FLAGS (view, GTK_CAN_FOCUS); gtk_widget_set_can_focus (GTK_WIDGET (view), TRUE);
view->selected = NULL; view->selected = NULL;
view->dnd_entry = NULL; view->dnd_entry = NULL;
@ -165,7 +167,7 @@ gimp_palette_view_expose (GtkWidget *widget,
GimpPaletteView *pal_view = GIMP_PALETTE_VIEW (widget); GimpPaletteView *pal_view = GIMP_PALETTE_VIEW (widget);
GimpView *view = GIMP_VIEW (widget); GimpView *view = GIMP_VIEW (widget);
if (! GTK_WIDGET_DRAWABLE (widget)) if (! gtk_widget_is_drawable (widget))
return FALSE; return FALSE;
GTK_WIDGET_CLASS (parent_class)->expose_event (widget, eevent); GTK_WIDGET_CLASS (parent_class)->expose_event (widget, eevent);
@ -215,7 +217,7 @@ gimp_palette_view_button_press (GtkWidget *widget,
GimpPaletteView *view = GIMP_PALETTE_VIEW (widget); GimpPaletteView *view = GIMP_PALETTE_VIEW (widget);
GimpPaletteEntry *entry; GimpPaletteEntry *entry;
if (GTK_WIDGET_CAN_FOCUS (widget) && ! GTK_WIDGET_HAS_FOCUS (widget)) if (gtk_widget_get_can_focus (widget) && ! gtk_widget_has_focus (widget))
gtk_widget_grab_focus (widget); gtk_widget_grab_focus (widget);
entry = gimp_palette_view_find_entry (view, bevent->x, bevent->y); entry = gimp_palette_view_find_entry (view, bevent->x, bevent->y);
@ -288,7 +290,7 @@ gimp_palette_view_focus (GtkWidget *widget,
palette = GIMP_PALETTE (GIMP_VIEW (view)->renderer->viewable); palette = GIMP_PALETTE (GIMP_VIEW (view)->renderer->viewable);
if (GTK_WIDGET_CAN_FOCUS (widget) && ! GTK_WIDGET_HAS_FOCUS (widget)) if (gtk_widget_get_can_focus (widget) && ! gtk_widget_has_focus (widget))
{ {
gtk_widget_grab_focus (widget); gtk_widget_grab_focus (widget);

View File

@ -20,6 +20,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "libgimpmath/gimpmath.h" #include "libgimpmath/gimpmath.h"
@ -130,7 +132,7 @@ gimp_progress_box_progress_start (GimpProgress *progress,
box->cancelable = cancelable; box->cancelable = cancelable;
box->value = 0.0; box->value = 0.0;
if (GTK_WIDGET_DRAWABLE (box->progress)) if (gtk_widget_is_drawable (box->progress))
gdk_window_process_updates (gtk_widget_get_window (box->progress), gdk_window_process_updates (gtk_widget_get_window (box->progress),
TRUE); TRUE);
@ -175,7 +177,7 @@ gimp_progress_box_progress_set_text (GimpProgress *progress,
gtk_label_set_text (GTK_LABEL (box->label), message); gtk_label_set_text (GTK_LABEL (box->label), message);
if (GTK_WIDGET_DRAWABLE (box->progress)) if (gtk_widget_is_drawable (box->progress))
gdk_window_process_updates (gtk_widget_get_window (box->progress), gdk_window_process_updates (gtk_widget_get_window (box->progress),
TRUE); TRUE);
} }
@ -198,7 +200,7 @@ gimp_progress_box_progress_set_value (GimpProgress *progress,
{ {
gtk_progress_bar_set_fraction (bar, box->value); gtk_progress_bar_set_fraction (bar, box->value);
if (GTK_WIDGET_DRAWABLE (box->progress)) if (gtk_widget_is_drawable (box->progress))
gdk_window_process_updates (gtk_widget_get_window (box->progress), gdk_window_process_updates (gtk_widget_get_window (box->progress),
TRUE); TRUE);
} }
@ -226,7 +228,7 @@ gimp_progress_box_progress_pulse (GimpProgress *progress)
gtk_progress_bar_pulse (bar); gtk_progress_bar_pulse (bar);
if (GTK_WIDGET_DRAWABLE (box->progress)) if (gtk_widget_is_drawable (box->progress))
gdk_window_process_updates (gtk_widget_get_window (box->progress), gdk_window_process_updates (gtk_widget_get_window (box->progress),
TRUE); TRUE);
} }

View File

@ -20,6 +20,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "widgets-types.h" #include "widgets-types.h"
@ -161,7 +163,7 @@ gimp_scale_button_image_expose (GtkWidget *widget,
cairo_line_to (cr, i, i + 0.5); cairo_line_to (cr, i, i + 0.5);
} }
gdk_cairo_set_source_color (cr, &style->fg[widget->state]); gdk_cairo_set_source_color (cr, &style->fg[gtk_widget_get_state (widget)]);
cairo_stroke (cr); cairo_stroke (cr);
for ( ; i < steps; i++) for ( ; i < steps; i++)

View File

@ -564,7 +564,7 @@ gimp_session_info_read_geometry (GimpSessionInfo *info)
switch (visibility) switch (visibility)
{ {
case GIMP_DIALOG_VISIBILITY_UNKNOWN: case GIMP_DIALOG_VISIBILITY_UNKNOWN:
info->p->open = GTK_WIDGET_VISIBLE (info->p->widget); info->p->open = gtk_widget_get_visible (info->p->widget);
break; break;
case GIMP_DIALOG_VISIBILITY_INVISIBLE: case GIMP_DIALOG_VISIBILITY_INVISIBLE:

View File

@ -249,7 +249,7 @@ gimp_settings_box_constructor (GType type,
gtk_widget_show (hbox2); gtk_widget_show (hbox2);
button = gtk_button_new (); button = gtk_button_new ();
GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS); gtk_widget_set_can_focus (button, FALSE);
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0);
gtk_widget_show (button); gtk_widget_show (button);
@ -265,7 +265,7 @@ gimp_settings_box_constructor (GType type,
box); box);
button = gtk_button_new (); button = gtk_button_new ();
GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_FOCUS); gtk_widget_set_can_focus (button, FALSE);
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0);
gtk_widget_show (button); gtk_widget_show (button);

View File

@ -17,6 +17,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h" #include "libgimpbase/gimpbase.h"
@ -341,8 +343,10 @@ gimp_stroke_editor_paint_button (GtkWidget *widget,
GtkAllocation *alloc = &widget->allocation; GtkAllocation *alloc = &widget->allocation;
gint w = MIN (alloc->width, alloc->height) * 2 / 3; gint w = MIN (alloc->width, alloc->height) * 2 / 3;
gtk_paint_arrow (style, gtk_widget_get_window (widget), gtk_paint_arrow (style,
widget->state, GTK_SHADOW_IN, gtk_widget_get_window (widget),
gtk_widget_get_state (widget),
GTK_SHADOW_IN,
&event->area, widget, NULL, &event->area, widget, NULL,
data ? GTK_ARROW_LEFT : GTK_ARROW_RIGHT, TRUE, data ? GTK_ARROW_LEFT : GTK_ARROW_RIGHT, TRUE,
alloc->x + (alloc->width - w) / 2, alloc->x + (alloc->width - w) / 2,

View File

@ -402,7 +402,7 @@ gimp_tag_entry_changed (GtkEntry *entry)
text = g_strdup (gtk_entry_get_text (entry)); text = g_strdup (gtk_entry_get_text (entry));
text = g_strstrip (text); text = g_strstrip (text);
if (! GTK_WIDGET_HAS_FOCUS (GTK_WIDGET (entry)) if (! gtk_widget_has_focus (GTK_WIDGET (entry))
&& strlen (text) == 0) && strlen (text) == 0)
{ {
gimp_tag_entry_toggle_desc (tag_entry, TRUE); gimp_tag_entry_toggle_desc (tag_entry, TRUE);

View File

@ -20,6 +20,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View File

@ -17,6 +17,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include <string.h> #include <string.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
@ -512,18 +514,19 @@ gimp_toolbox_expose_event (GtkWidget *widget,
GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event); GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event);
if (GTK_WIDGET_VISIBLE (toolbox->p->header) && if (gtk_widget_get_visible (toolbox->p->header) &&
gdk_rectangle_intersect (&event->area, gdk_rectangle_intersect (&event->area,
&toolbox->p->header->allocation, &toolbox->p->header->allocation,
&clip_rect)) &clip_rect))
{ {
GtkStyle *style = gtk_widget_get_style (widget); GtkStyle *style = gtk_widget_get_style (widget);
cairo_t *cr; GtkStateType state = gtk_widget_get_state (widget);
gint header_height; cairo_t *cr;
gint header_width; gint header_height;
gdouble wilber_width; gint header_width;
gdouble wilber_height; gdouble wilber_width;
gdouble factor; gdouble wilber_height;
gdouble factor;
cr = gdk_cairo_create (gtk_widget_get_window (widget)); cr = gdk_cairo_create (gtk_widget_get_window (widget));
gdk_cairo_rectangle (cr, &clip_rect); gdk_cairo_rectangle (cr, &clip_rect);
@ -543,9 +546,9 @@ gimp_toolbox_expose_event (GtkWidget *widget,
(header_height / factor - wilber_height) / 2.0); (header_height / factor - wilber_height) / 2.0);
cairo_set_source_rgba (cr, cairo_set_source_rgba (cr,
style->fg[widget->state].red / 65535.0, style->fg[state].red / 65535.0,
style->fg[widget->state].green / 65535.0, style->fg[state].green / 65535.0,
style->fg[widget->state].blue / 65535.0, style->fg[state].blue / 65535.0,
0.10); 0.10);
cairo_fill (cr); cairo_fill (cr);

View File

@ -324,7 +324,7 @@ static void
gimp_tool_options_editor_save_clicked (GtkWidget *widget, gimp_tool_options_editor_save_clicked (GtkWidget *widget,
GimpToolOptionsEditor *editor) GimpToolOptionsEditor *editor)
{ {
if (GTK_WIDGET_SENSITIVE (editor->restore_button) /* evil but correct */) if (gtk_widget_get_sensitive (editor->restore_button) /* evil but correct */)
{ {
gimp_tool_options_editor_menu_popup (editor, widget, gimp_tool_options_editor_menu_popup (editor, widget,
"/tool-options-popup/Save"); "/tool-options-popup/Save");

View File

@ -20,6 +20,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include <string.h> #include <string.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>

View File

@ -20,6 +20,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h" #include "libgimpwidgets/gimpwidgets.h"
@ -111,7 +113,7 @@ gimp_view_popup_show (GtkWidget *widget,
popup->button_x = bevent->x; popup->button_x = bevent->x;
popup->button_y = bevent->y; popup->button_y = bevent->y;
if (GTK_WIDGET_NO_WINDOW (widget)) if (! gtk_widget_get_has_window (widget))
{ {
popup->button_x += widget->allocation.x; popup->button_x += widget->allocation.x;
popup->button_y += widget->allocation.y; popup->button_y += widget->allocation.y;

View File

@ -20,6 +20,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include <string.h> #include <string.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
@ -161,12 +163,12 @@ gimp_view_class_init (GimpViewClass *klass)
static void static void
gimp_view_init (GimpView *view) gimp_view_init (GimpView *view)
{ {
GTK_WIDGET_SET_FLAGS (view, GTK_NO_WINDOW); gtk_widget_set_has_window (GTK_WIDGET (view), FALSE);
gtk_widget_add_events (GTK_WIDGET (view),
gtk_widget_add_events (GTK_WIDGET (view), (GDK_BUTTON_PRESS_MASK | GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_ENTER_NOTIFY_MASK | GDK_ENTER_NOTIFY_MASK |
GDK_LEAVE_NOTIFY_MASK)); GDK_LEAVE_NOTIFY_MASK);
view->event_window = NULL; view->event_window = NULL;
view->viewable = NULL; view->viewable = NULL;
@ -383,7 +385,7 @@ static gboolean
gimp_view_expose_event (GtkWidget *widget, gimp_view_expose_event (GtkWidget *widget,
GdkEventExpose *event) GdkEventExpose *event)
{ {
if (GTK_WIDGET_DRAWABLE (widget)) if (gtk_widget_is_drawable (widget))
{ {
gimp_view_renderer_draw (GIMP_VIEW (widget)->renderer, gimp_view_renderer_draw (GIMP_VIEW (widget)->renderer,
gtk_widget_get_window (widget), widget, gtk_widget_get_window (widget), widget,

View File

@ -589,7 +589,7 @@ gimp_view_renderer_draw (GimpViewRenderer *renderer,
if (G_UNLIKELY (renderer->context == NULL)) if (G_UNLIKELY (renderer->context == NULL))
g_warning ("%s: renderer->context is NULL", G_STRFUNC); g_warning ("%s: renderer->context is NULL", G_STRFUNC);
if (! GTK_WIDGET_DRAWABLE (widget)) if (! gtk_widget_is_drawable (widget))
return; return;
if (! gdk_rectangle_intersect ((GdkRectangle *) draw_area, if (! gdk_rectangle_intersect ((GdkRectangle *) draw_area,

View File

@ -20,6 +20,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <string.h> #include <string.h>
@ -147,6 +149,7 @@ gimp_button_menu_position (GtkWidget *button,
GdkRectangle rect; GdkRectangle rect;
gint monitor; gint monitor;
g_return_if_fail (GTK_IS_WIDGET (button));
g_return_if_fail (GTK_WIDGET_REALIZED (button)); g_return_if_fail (GTK_WIDGET_REALIZED (button));
g_return_if_fail (GTK_IS_MENU (menu)); g_return_if_fail (GTK_IS_MENU (menu));
g_return_if_fail (x != NULL); g_return_if_fail (x != NULL);
@ -174,7 +177,7 @@ gimp_button_menu_position (GtkWidget *button,
gtk_menu_set_screen (menu, screen); gtk_menu_set_screen (menu, screen);
if (GTK_WIDGET_NO_WINDOW (button)) if (! gtk_widget_get_has_window (button))
*x += button->allocation.x; *x += button->allocation.x;
switch (position) switch (position)
@ -196,7 +199,7 @@ gimp_button_menu_position (GtkWidget *button,
break; break;
} }
if (GTK_WIDGET_NO_WINDOW (button)) if (! gtk_widget_get_has_window (button))
*y += button->allocation.y; *y += button->allocation.y;
*y += button->allocation.height / 2; *y += button->allocation.height / 2;
@ -823,12 +826,12 @@ gimp_window_get_native (GtkWindow *window)
#endif #endif
#ifdef GDK_WINDOWING_WIN32 #ifdef GDK_WINDOWING_WIN32
if (window && GTK_WIDGET_REALIZED (window)) if (window && GTK_WIDGET_REALIZED (GTK_WIDGET (window)))
return (GdkNativeWindow) GDK_WINDOW_HWND (gtk_widget_get_window (GTK_WIDGET (window))); return (GdkNativeWindow) GDK_WINDOW_HWND (gtk_widget_get_window (GTK_WIDGET (window)));
#endif #endif
#ifdef GDK_WINDOWING_X11 #ifdef GDK_WINDOWING_X11
if (window && GTK_WIDGET_REALIZED (window)) if (window && GTK_WIDGET_REALIZED (GTK_WIDGET (window)))
return GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (window))); return GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (window)));
#endif #endif
@ -864,7 +867,7 @@ gimp_window_set_transient_for (GtkWindow *window,
if (! parent) if (! parent)
return; return;
if (GTK_WIDGET_REALIZED (window)) if (GTK_WIDGET_REALIZED (GTK_WIDGET (window)))
gdk_window_set_transient_for (gtk_widget_get_window (GTK_WIDGET (window)), gdk_window_set_transient_for (gtk_widget_get_window (GTK_WIDGET (window)),
parent); parent);

View File

@ -21,6 +21,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include "gtkhwrapbox.h" #include "gtkhwrapbox.h"
#include "libgimpmath/gimpmath.h" #include "libgimpmath/gimpmath.h"

View File

@ -21,6 +21,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include "gtkvwrapbox.h" #include "gtkvwrapbox.h"
#include "libgimpmath/gimpmath.h" #include "libgimpmath/gimpmath.h"

View File

@ -21,6 +21,8 @@
#include "config.h" #include "config.h"
#undef GSEAL_ENABLE
#include "gtkwrapbox.h" #include "gtkwrapbox.h"