Merge resolution

This commit is contained in:
Alexia Death 2009-10-17 21:42:02 +03:00
commit 210a4b5044
128 changed files with 15901 additions and 3458 deletions
INSTALL
app
configure.ac
libgimp
libgimpwidgets

View File

@ -43,8 +43,8 @@ header files installed.
git://git.gnome.org/babl
git://git.gnome.org/gegl
4. You need to have installed GTK+ version 2.16.6 or newer.
GIMP also need a recent versions of GLib (>= 2.20.0) and
4. You need to have installed GTK+ version 2.18.1 or newer.
GIMP also need a recent versions of GLib (>= 2.22.0) and
Pango (>= 1.20.1). Sources for these can be grabbed from
ftp://ftp.gtk.org/.

View File

@ -552,7 +552,7 @@ gradient_editor_actions_update (GimpActionGroup *group,
* insensitive. prevents the gradient from being modified while a
* dialog is running. bug #161411 --mitch
*/
if (! GTK_WIDGET_SENSITIVE (editor))
if (! gtk_widget_is_sensitive (GTK_WIDGET (editor)))
editable = FALSE;
if (! editable)

View File

@ -41,7 +41,7 @@ window_close_cmd_callback (GtkAction *action,
GtkWidget *widget;
return_if_no_widget (widget, data);
if (! GTK_WIDGET_TOPLEVEL (widget))
if (! gtk_widget_is_toplevel (widget))
widget = gtk_widget_get_toplevel (widget);
if (widget && gtk_widget_get_window (widget));
@ -136,7 +136,7 @@ window_move_to_screen_cmd_callback (GtkAction *action,
GdkScreen *screen;
return_if_no_widget (widget, data);
if (! GTK_WIDGET_TOPLEVEL (widget))
if (! gtk_widget_is_toplevel (widget))
widget = gtk_widget_get_toplevel (widget);
screen = g_object_get_data (G_OBJECT (current), "screen");

View File

@ -262,20 +262,23 @@ about_dialog_anim_expose (GtkWidget *widget,
GdkEventExpose *event,
GimpAboutDialog *dialog)
{
GtkStyle *style = gtk_widget_get_style (widget);
GdkGC *text_gc;
gint x, y;
gint width, height;
GtkStyle *style = gtk_widget_get_style (widget);
GtkAllocation allocation;
GdkGC *text_gc;
gint x, y;
gint width, height;
if (! dialog->visible)
return FALSE;
gtk_widget_get_allocation (widget, &allocation);
text_gc = style->text_gc[GTK_STATE_NORMAL];
pango_layout_get_pixel_size (dialog->layout, &width, &height);
x = (widget->allocation.width - width) / 2;
y = (widget->allocation.height - height) / 2;
x = (allocation.width - width) / 2;
y = (allocation.height - height) / 2;
if (dialog->textrange[1] > 0)
{

View File

@ -444,7 +444,7 @@ dialogs_get_toolbox (void)
list;
list = g_list_next (list))
{
if (GTK_WIDGET_TOPLEVEL (list->data))
if (gtk_widget_is_toplevel (list->data))
return list->data;
}

View File

@ -190,7 +190,8 @@ file_open_location_response (GtkDialog *dialog,
box = gimp_progress_box_new ();
gtk_container_set_border_width (GTK_CONTAINER (box), 12);
gtk_box_pack_end (GTK_BOX (dialog->vbox), box, FALSE, FALSE, 0);
gtk_box_pack_end (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
box, FALSE, FALSE, 0);
g_object_set_data (G_OBJECT (dialog), "progress-box", box);

View File

@ -417,6 +417,7 @@ dialog_info_update (GimpModuleDB *db,
gchar *location = NULL;
gboolean iter_valid;
gint i;
gboolean show_error;
for (iter_valid = gtk_tree_model_get_iter_first (model, &iter);
iter_valid;
@ -473,17 +474,12 @@ dialog_info_update (GimpModuleDB *db,
gtk_label_set_text (GTK_LABEL (dialog->label[i]),
text[i] ? text[i] : "--");
if (module->state == GIMP_MODULE_STATE_ERROR && module->last_module_error)
{
gtk_label_set_text (GTK_LABEL (dialog->error_label),
module->last_module_error);
gtk_widget_show (dialog->error_box);
}
else
{
gtk_label_set_text (GTK_LABEL (dialog->error_label), NULL);
gtk_widget_hide (dialog->error_box);
}
/* Show errors */
show_error = (module->state == GIMP_MODULE_STATE_ERROR &&
module->last_module_error);
gtk_label_set_text (GTK_LABEL (dialog->error_label),
show_error ? module->last_module_error : NULL);
gtk_widget_set_visible (dialog->error_box, show_error);
}
static void

View File

@ -734,7 +734,7 @@ palette_import_image_add (GimpContainer *container,
GimpImage *image,
ImportDialog *dialog)
{
if (! GTK_WIDGET_IS_SENSITIVE (dialog->image_radio))
if (! gtk_widget_is_sensitive (dialog->image_radio))
{
gtk_widget_set_sensitive (dialog->image_radio, TRUE);
gimp_context_set_image (dialog->context, image);
@ -868,8 +868,6 @@ palette_import_make_palette (ImportDialog *dialog)
dialog->palette = palette;
}
if (dialog->palette && dialog->palette->n_colors > 0)
gtk_widget_hide (dialog->no_colors_label);
else
gtk_widget_show (dialog->no_colors_label);
gtk_widget_set_visible (dialog->no_colors_label,
dialog->palette && dialog->palette->n_colors > 0);
}

View File

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

View File

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

View File

@ -17,6 +17,8 @@
#include "config.h"
#undef GSEAL_ENABLE
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"
@ -181,8 +183,7 @@ gimp_canvas_init (GimpCanvas *canvas)
GtkWidget *widget = GTK_WIDGET (canvas);
gint i;
GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS);
gtk_widget_set_can_focus (widget, TRUE);
gtk_widget_set_extension_events (widget, GDK_EXTENSION_EVENTS_ALL);
for (i = 0; i < GIMP_CANVAS_NUM_STYLES; i++)
@ -234,15 +235,18 @@ static void
gimp_canvas_realize (GtkWidget *widget)
{
GimpCanvas *canvas = GIMP_CANVAS (widget);
GtkAllocation allocation;
GdkWindowAttr attributes;
gint attributes_mask;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
attributes.x = widget->allocation.x;
attributes.y = widget->allocation.y;
attributes.width = widget->allocation.width;
attributes.height = widget->allocation.height;
gtk_widget_get_allocation (widget, &allocation);
attributes.x = allocation.x;
attributes.y = allocation.y;
attributes.width = allocation.width;
attributes.height = allocation.height;
attributes.window_type = GDK_WINDOW_CHILD;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
@ -252,12 +256,15 @@ gimp_canvas_realize (GtkWidget *widget)
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);
gtk_widget_set_window (widget,
gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask));
gdk_window_set_user_data (gtk_widget_get_window (widget), widget);
widget->style = gtk_style_attach (widget->style, widget->window);
gtk_style_set_background (widget->style, gtk_widget_get_window (widget),
widget->style = gtk_style_attach (gtk_widget_get_style (widget),
gtk_widget_get_window (widget));
gtk_style_set_background (gtk_widget_get_style (widget),
gtk_widget_get_window (widget),
GTK_STATE_NORMAL);
canvas->stipple[0] =
@ -302,7 +309,7 @@ static void
gimp_canvas_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
{
widget->allocation = *allocation;
gtk_widget_set_allocation (widget, allocation);
if (GTK_WIDGET_REALIZED (widget))
gdk_window_move_resize (gtk_widget_get_window (widget),
@ -351,7 +358,7 @@ gimp_canvas_gc_new (GimpCanvas *canvas,
GdkColor fg = { 0, 0, 0, 0 };
GdkColor bg = { 0, 0, 0, 0 };
if (! GTK_WIDGET_REALIZED (canvas))
if (! GTK_WIDGET_REALIZED (GTK_WIDGET (canvas)))
return NULL;
switch (style)
@ -921,22 +928,26 @@ void
gimp_canvas_draw_drop_zone (GimpCanvas *canvas,
cairo_t *cr)
{
GtkWidget *widget = GTK_WIDGET (canvas);
GtkStyle *style = gtk_widget_get_style (widget);
gdouble wilber_width;
gdouble wilber_height;
gdouble width;
gdouble height;
gdouble side;
gdouble factor;
GtkWidget *widget = GTK_WIDGET (canvas);
GtkStyle *style = gtk_widget_get_style (widget);
GtkStateType state = gtk_widget_get_state (widget);
GtkAllocation allocation;
gdouble wilber_width;
gdouble wilber_height;
gdouble width;
gdouble height;
gdouble side;
gdouble factor;
gtk_widget_get_allocation (widget, &allocation);
gimp_cairo_wilber_get_size (cr, &wilber_width, &wilber_height);
wilber_width /= 2;
wilber_height /= 2;
side = MIN (MIN (widget->allocation.width, widget->allocation.height),
MAX (widget->allocation.width, widget->allocation.height) / 2);
side = MIN (MIN (allocation.width, allocation.height),
MAX (allocation.width, allocation.height) / 2);
width = MAX (wilber_width, side);
height = MAX (wilber_height, side);
@ -949,12 +960,12 @@ gimp_canvas_draw_drop_zone (GimpCanvas *canvas,
*/
gimp_cairo_wilber (cr,
- wilber_width * 0.6,
widget->allocation.height / factor - wilber_height * 1.1);
allocation.height / factor - wilber_height * 1.1);
cairo_set_source_rgba (cr,
style->fg[widget->state].red / 65535.0,
style->fg[widget->state].green / 65535.0,
style->fg[widget->state].blue / 65535.0,
style->fg[state].red / 65535.0,
style->fg[state].green / 65535.0,
style->fg[state].blue / 65535.0,
0.15);
cairo_fill (cr);
}

View File

@ -246,7 +246,7 @@ gimp_displays_get_num_visible (Gimp *gimp)
GimpDisplay *display = list->data;
GimpDisplayShell *shell = gimp_display_get_shell (display);
if (GTK_WIDGET_DRAWABLE (shell))
if (gtk_widget_is_drawable (GTK_WIDGET (shell)))
{
GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (shell));

View File

@ -177,24 +177,12 @@ gimp_display_shell_set_show_rulers (GimpDisplayShell *shell,
table = GTK_TABLE (gtk_widget_get_parent (GTK_WIDGET (shell->canvas)));
if (show)
{
gtk_widget_show (shell->origin);
gtk_widget_show (shell->hrule);
gtk_widget_show (shell->vrule);
gtk_widget_set_visible (shell->origin, show);
gtk_widget_set_visible (shell->hrule, show);
gtk_widget_set_visible (shell->vrule, show);
gtk_table_set_col_spacing (table, 0, 1);
gtk_table_set_row_spacing (table, 0, 1);
}
else
{
gtk_widget_hide (shell->origin);
gtk_widget_hide (shell->hrule);
gtk_widget_hide (shell->vrule);
gtk_table_set_col_spacing (table, 0, 0);
gtk_table_set_row_spacing (table, 0, 0);
}
gtk_table_set_col_spacing (table, 0, show ? 1 : 0);
gtk_table_set_row_spacing (table, 0, show ? 1 : 0);
appearance_set_action_active (shell, "view-show-rulers", show);
}
@ -228,28 +216,14 @@ gimp_display_shell_set_show_scrollbars (GimpDisplayShell *shell,
parent = gtk_widget_get_parent (shell->hsb);
vbox = GTK_BOX (gtk_widget_get_parent (parent));
if (show)
{
gtk_widget_show (shell->nav_ebox);
gtk_widget_show (shell->hsb);
gtk_widget_show (shell->vsb);
gtk_widget_show (shell->quick_mask_button);
gtk_widget_show (shell->zoom_button);
gtk_widget_set_visible (shell->nav_ebox, show);
gtk_widget_set_visible (shell->hsb, show);
gtk_widget_set_visible (shell->vsb, show);
gtk_widget_set_visible (shell->quick_mask_button, show);
gtk_widget_set_visible (shell->zoom_button, show);
gtk_box_set_spacing (hbox, 1);
gtk_box_set_spacing (vbox, 1);
}
else
{
gtk_widget_hide (shell->nav_ebox);
gtk_widget_hide (shell->hsb);
gtk_widget_hide (shell->vsb);
gtk_widget_hide (shell->quick_mask_button);
gtk_widget_hide (shell->zoom_button);
gtk_box_set_spacing (hbox, 0);
gtk_box_set_spacing (vbox, 0);
}
gtk_box_set_spacing (hbox, show ? 1 : 0);
gtk_box_set_spacing (vbox, show ? 1 : 0);
appearance_set_action_active (shell, "view-show-scrollbars", show);
}

View File

@ -17,6 +17,8 @@
#include "config.h"
#undef GSEAL_ENABLE
#include <stdlib.h>
#include <gegl.h>
@ -231,16 +233,19 @@ gimp_display_shell_canvas_realize (GtkWidget *canvas,
{
GimpCanvasPaddingMode padding_mode;
GimpRGB padding_color;
GtkAllocation allocation;
gtk_widget_grab_focus (shell->canvas);
gimp_display_shell_get_padding (shell, &padding_mode, &padding_color);
gimp_display_shell_set_padding (shell, padding_mode, &padding_color);
gtk_widget_get_allocation (canvas, &allocation);
gimp_display_shell_title_update (shell);
shell->disp_width = canvas->allocation.width;
shell->disp_height = canvas->allocation.height;
shell->disp_width = allocation.width;
shell->disp_height = allocation.height;
/* set up the scrollbar observers */
g_signal_connect (shell->hsbdata, "value-changed",
@ -661,7 +666,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
/* If the device (and maybe the tool) has changed, update the new
* tool's state
*/
if (device_changed && GTK_WIDGET_HAS_FOCUS (canvas))
if (device_changed && gtk_widget_has_focus (canvas))
{
gimp_display_shell_update_focus (shell, &image_coords, state);
}
@ -783,7 +788,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
* canvas immediately, therefore we do this before logging
* the BUTTON_PRESS.
*/
if (! GTK_WIDGET_HAS_FOCUS (canvas))
if (! gtk_widget_has_focus (canvas))
gtk_widget_grab_focus (canvas);
GIMP_LOG (TOOL_EVENTS, "event (display %p): BUTTON_PRESS (%d @ %0.0f:%0.0f)",
@ -795,7 +800,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
*
* this happens in "click to focus" mode.
*/
if (! GTK_WIDGET_HAS_FOCUS (canvas))
if (! gtk_widget_has_focus (canvas))
{
/* do the things a FOCUS_IN event would do and set a flag
* preventing it from doing the same.
@ -1750,7 +1755,7 @@ gimp_display_shell_ruler_button_press (GtkWidget *widget,
if (active_tool)
{
if (! GTK_WIDGET_HAS_FOCUS (shell->canvas))
if (! gtk_widget_has_focus (shell->canvas))
{
gimp_display_shell_update_focus (shell, NULL, event->state);

View File

@ -236,7 +236,7 @@ gimp_display_shell_real_set_cursor (GimpDisplayShell *shell,
{
shell->current_cursor = cursor_type;
if (GTK_WIDGET_DRAWABLE (shell->canvas))
if (gtk_widget_is_drawable (shell->canvas))
gdk_window_set_cursor (gtk_widget_get_window (shell->canvas), NULL);
return;

View File

@ -17,6 +17,8 @@
#include "config.h"
#undef GSEAL_ENABLE
#include <string.h>
#include <gegl.h>
@ -902,15 +904,13 @@ gimp_display_shell_new (GimpDisplay *display,
shell->hsbdata = GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, image_width,
1, 1, image_width));
shell->hsb = gtk_hscrollbar_new (shell->hsbdata);
GTK_WIDGET_UNSET_FLAGS (shell->hsb, GTK_CAN_FOCUS);
gtk_widget_set_can_focus (shell->hsb, FALSE);
/* the vertical scrollbar */
shell->vsbdata = GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, image_height,
1, 1, image_height));
shell->vsb = gtk_vscrollbar_new (shell->vsbdata);
GTK_WIDGET_UNSET_FLAGS (shell->vsb, GTK_CAN_FOCUS);
gtk_widget_set_can_focus (shell->vsb, FALSE);
/* create the contents of the inner_table ********************************/
@ -1025,7 +1025,7 @@ gimp_display_shell_new (GimpDisplay *display,
"width-request", 18,
"height-request", 18,
NULL);
GTK_WIDGET_UNSET_FLAGS (shell->zoom_button, GTK_CAN_FOCUS);
gtk_widget_set_can_focus (shell->zoom_button, FALSE);
gtk_image = gtk_image_new_from_stock (GIMP_STOCK_ZOOM_FOLLOW_WINDOW,
GTK_ICON_SIZE_MENU);
@ -1049,7 +1049,7 @@ gimp_display_shell_new (GimpDisplay *display,
"width-request", 18,
"height-request", 18,
NULL);
GTK_WIDGET_UNSET_FLAGS (shell->quick_mask_button, GTK_CAN_FOCUS);
gtk_widget_set_can_focus (shell->quick_mask_button, FALSE);
gtk_image = gtk_image_new_from_stock (GIMP_STOCK_QUICK_MASK_OFF,
GTK_ICON_SIZE_MENU);

View File

@ -17,6 +17,8 @@
#include "config.h"
#undef GSEAL_ENABLE
#include <gegl.h>
#include <gtk/gtk.h>
@ -419,12 +421,15 @@ gimp_image_window_configure_event (GtkWidget *widget,
GdkEventConfigure *event)
{
GimpImageWindow *window = GIMP_IMAGE_WINDOW (widget);
GtkAllocation allocation;
gint current_width;
gint current_height;
gtk_widget_get_allocation (widget, &allocation);
/* Grab the size before we run the parent implementation */
current_width = widget->allocation.width;
current_height = widget->allocation.height;
current_width = allocation.width;
current_height = allocation.height;
/* Run the parent implementation */
if (GTK_WIDGET_CLASS (parent_class)->configure_event)
@ -736,10 +741,7 @@ gimp_image_window_set_show_menubar (GimpImageWindow *window,
private = GIMP_IMAGE_WINDOW_GET_PRIVATE (window);
if (show)
gtk_widget_show (private->menubar);
else
gtk_widget_hide (private->menubar);
gtk_widget_set_visible (private->menubar, show);
}
gboolean
@ -751,7 +753,7 @@ gimp_image_window_get_show_menubar (GimpImageWindow *window)
private = GIMP_IMAGE_WINDOW_GET_PRIVATE (window);
return GTK_WIDGET_VISIBLE (private->menubar);
return gtk_widget_get_visible (private->menubar);
}
void
@ -764,16 +766,8 @@ gimp_image_window_set_show_docks (GimpImageWindow *window,
private = GIMP_IMAGE_WINDOW_GET_PRIVATE (window);
if (show)
{
gtk_widget_show (private->left_docks);
gtk_widget_show (private->right_docks);
}
else
{
gtk_widget_hide (private->left_docks);
gtk_widget_hide (private->right_docks);
}
gtk_widget_set_visible (private->left_docks, show);
gtk_widget_set_visible (private->right_docks, show);
}
gboolean
@ -785,8 +779,8 @@ gimp_image_window_get_show_docks (GimpImageWindow *window)
private = GIMP_IMAGE_WINDOW_GET_PRIVATE (window);
return (GTK_WIDGET_VISIBLE (private->left_docks) &&
GTK_WIDGET_VISIBLE (private->right_docks));
return (gtk_widget_get_visible (private->left_docks) &&
gtk_widget_get_visible (private->right_docks));
}
gboolean
@ -809,6 +803,7 @@ gimp_image_window_shrink_wrap (GimpImageWindow *window,
GimpDisplayShell *active_shell;
GimpImage *image;
GtkWidget *widget;
GtkAllocation allocation;
GdkScreen *screen;
GdkRectangle rect;
gint monitor;
@ -834,6 +829,8 @@ gimp_image_window_shrink_wrap (GimpImageWindow *window,
widget = GTK_WIDGET (window);
screen = gtk_widget_get_screen (widget);
gtk_widget_get_allocation (widget, &allocation);
monitor = gdk_screen_get_monitor_at_window (screen,
gtk_widget_get_window (widget));
gdk_screen_get_monitor_geometry (screen, monitor, &rect);
@ -854,14 +851,30 @@ gimp_image_window_shrink_wrap (GimpImageWindow *window,
* the normal approach to border size, so special case that.
*/
if (disp_width > 1 || !active_shell->vsb)
border_width = widget->allocation.width - disp_width;
{
border_width = allocation.width - disp_width;
}
else
border_width = widget->allocation.width - disp_width + active_shell->vsb->allocation.width;
{
GtkAllocation vsb_allocation;
gtk_widget_get_allocation (active_shell->vsb, &vsb_allocation);
border_width = allocation.width - disp_width + vsb_allocation.width;
}
if (disp_height > 1 || !active_shell->hsb)
border_height = widget->allocation.height - disp_height;
{
border_height = allocation.height - disp_height;
}
else
border_height = widget->allocation.height - disp_height + active_shell->hsb->allocation.height;
{
GtkAllocation hsb_allocation;
gtk_widget_get_allocation (active_shell->hsb, &hsb_allocation);
border_height = allocation.height - disp_height + hsb_allocation.height;
}
max_auto_width = (rect.width - border_width) * 0.75;
@ -898,20 +911,24 @@ gimp_image_window_shrink_wrap (GimpImageWindow *window,
if (resize)
{
GimpStatusbar *statusbar = gimp_display_shell_get_statusbar (active_shell);
gint statusbar_width;
if (width < GTK_WIDGET (statusbar)->requisition.width)
width = GTK_WIDGET (statusbar)->requisition.width;
gtk_widget_get_size_request (GTK_WIDGET (statusbar),
&statusbar_width, NULL);
if (width < statusbar_width)
width = statusbar_width;
width = width + border_width;
height = height + border_height;
if (grow_only)
{
if (width < widget->allocation.width)
width = widget->allocation.width;
if (width < allocation.width)
width = allocation.width;
if (height < widget->allocation.height)
height = widget->allocation.height;
if (height < allocation.height)
height = allocation.height;
}
gtk_window_resize (GTK_WINDOW (window), width, height);
@ -1072,8 +1089,12 @@ gimp_image_window_image_notify (GimpDisplay *display,
}
else
{
width = GTK_WIDGET (window)->allocation.width;
height = GTK_WIDGET (window)->allocation.height;
GtkAllocation allocation;
gtk_widget_get_allocation (GTK_WIDGET (window), &allocation);
width = allocation.width;
height = allocation.height;
}
gimp_dialog_factory_add_foreign (private->display_factory,

View File

@ -19,6 +19,8 @@
#include <string.h>
#undef GSEAL_ENABLE
#include <gegl.h>
#include <gtk/gtk.h>
@ -194,7 +196,7 @@ gimp_statusbar_init (GimpStatusbar *statusbar)
statusbar->unit_combo = gimp_unit_combo_box_new_with_model (store);
g_object_unref (store);
GTK_WIDGET_UNSET_FLAGS (statusbar->unit_combo, GTK_CAN_FOCUS);
gtk_widget_set_can_focus (statusbar->unit_combo, FALSE);
g_object_set (statusbar->unit_combo, "focus-on-click", FALSE, NULL);
gtk_box_pack_start (GTK_BOX (hbox), statusbar->unit_combo, FALSE, FALSE, 0);
gtk_widget_show (statusbar->unit_combo);
@ -204,7 +206,7 @@ gimp_statusbar_init (GimpStatusbar *statusbar)
statusbar);
statusbar->scale_combo = gimp_scale_combo_box_new ();
GTK_WIDGET_UNSET_FLAGS (statusbar->scale_combo, GTK_CAN_FOCUS);
gtk_widget_set_can_focus (statusbar->scale_combo, FALSE);
g_object_set (statusbar->scale_combo, "focus-on-click", FALSE, NULL);
gtk_box_pack_start (GTK_BOX (hbox), statusbar->scale_combo, FALSE, FALSE, 0);
gtk_widget_show (statusbar->scale_combo);
@ -235,12 +237,12 @@ gimp_statusbar_init (GimpStatusbar *statusbar)
/* don't show the progress bar */
statusbar->cancel_button = gtk_button_new ();
gtk_widget_set_can_focus (statusbar->cancel_button, FALSE);
gtk_button_set_relief (GTK_BUTTON (statusbar->cancel_button),
GTK_RELIEF_NONE);
gtk_widget_set_sensitive (statusbar->cancel_button, FALSE);
gtk_box_pack_start (GTK_BOX (hbox),
statusbar->cancel_button, FALSE, FALSE, 0);
GTK_WIDGET_UNSET_FLAGS (statusbar->cancel_button, GTK_CAN_FOCUS);
/* don't show the cancel button */
image = gtk_image_new_from_stock (GTK_STOCK_CANCEL, GTK_ICON_SIZE_MENU);
@ -371,13 +373,13 @@ gimp_statusbar_progress_start (GimpProgress *progress,
*/
gtk_container_resize_children (GTK_CONTAINER (statusbar));
if (! GTK_WIDGET_VISIBLE (statusbar))
if (! gtk_widget_get_visible (GTK_WIDGET (statusbar)))
{
gtk_widget_show (GTK_WIDGET (statusbar));
statusbar->progress_shown = TRUE;
}
if (GTK_WIDGET_DRAWABLE (bar))
if (gtk_widget_is_drawable (bar))
gdk_window_process_updates (gtk_widget_get_window (bar), TRUE);
gimp_statusbar_override_window_title (statusbar);
@ -439,7 +441,7 @@ gimp_statusbar_progress_set_text (GimpProgress *progress,
gimp_statusbar_replace (statusbar, "progress", NULL, "%s", message);
if (GTK_WIDGET_DRAWABLE (bar))
if (gtk_widget_is_drawable (bar))
gdk_window_process_updates (gtk_widget_get_window (bar), TRUE);
gimp_statusbar_override_window_title (statusbar);
@ -454,18 +456,21 @@ gimp_statusbar_progress_set_value (GimpProgress *progress,
if (statusbar->progress_active)
{
GtkWidget *bar = statusbar->progressbar;
GtkWidget *bar = statusbar->progressbar;
GtkAllocation allocation;
gtk_widget_get_allocation (bar, &allocation);
statusbar->progress_value = percentage;
/* only update the progress bar if this causes a visible change */
if (fabs (bar->allocation.width *
if (fabs (allocation.width *
(percentage -
gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (bar)))) > 1.0)
{
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (bar), percentage);
if (GTK_WIDGET_DRAWABLE (bar))
if (gtk_widget_is_drawable (bar))
gdk_window_process_updates (gtk_widget_get_window (bar), TRUE);
}
}
@ -477,9 +482,7 @@ gimp_statusbar_progress_get_value (GimpProgress *progress)
GimpStatusbar *statusbar = GIMP_STATUSBAR (progress);
if (statusbar->progress_active)
{
return statusbar->progress_value;
}
return statusbar->progress_value;
return 0.0;
}
@ -495,7 +498,7 @@ gimp_statusbar_progress_pulse (GimpProgress *progress)
gtk_progress_bar_pulse (GTK_PROGRESS_BAR (bar));
if (GTK_WIDGET_DRAWABLE (bar))
if (gtk_widget_is_drawable (bar))
gdk_window_process_updates (gtk_widget_get_window (bar), TRUE);
}
}
@ -524,11 +527,14 @@ gimp_statusbar_progress_message (GimpProgress *progress,
if (pango_layout_get_line_count (layout) == 1)
{
gint width;
GtkAllocation label_allocation;
gint width;
gtk_widget_get_allocation (label, &label_allocation);
pango_layout_get_pixel_size (layout, &width, NULL);
if (width < label->allocation.width)
if (width < label_allocation.width)
{
if (stock_id)
{
@ -541,7 +547,7 @@ gimp_statusbar_progress_message (GimpProgress *progress,
g_object_unref (pixbuf);
handle_msg = (width < label->allocation.width);
handle_msg = (width < label_allocation.width);
}
else
{
@ -704,7 +710,7 @@ gimp_statusbar_get_visible (GimpStatusbar *statusbar)
if (statusbar->progress_shown)
return FALSE;
return GTK_WIDGET_VISIBLE (statusbar);
return gtk_widget_get_visible (GTK_WIDGET (statusbar));
}
void
@ -722,10 +728,7 @@ gimp_statusbar_set_visible (GimpStatusbar *statusbar,
}
}
if (visible)
gtk_widget_show (GTK_WIDGET (statusbar));
else
gtk_widget_hide (GTK_WIDGET (statusbar));
gtk_widget_set_visible (GTK_WIDGET (statusbar), visible);
}
void

View File

@ -1,2 +0,0 @@
1 ICON "wilber.ico"
2 ICON "fileicon.ico"

View File

@ -258,8 +258,8 @@ static gchar *
gui_sanity_check (void)
{
#define GTK_REQUIRED_MAJOR 2
#define GTK_REQUIRED_MINOR 16
#define GTK_REQUIRED_MICRO 6
#define GTK_REQUIRED_MINOR 18
#define GTK_REQUIRED_MICRO 1
const gchar *mismatch = gtk_check_version (GTK_REQUIRED_MAJOR,
GTK_REQUIRED_MINOR,

View File

@ -302,17 +302,18 @@ gimp_heal_laplace_iteration (gdouble *matrix,
gdouble *solution,
guchar *mask)
{
gint rowstride = width * depth;
gint i, j, k;
gdouble tmp, diff;
gdouble err = 0.0;
const gint rowstride = width * depth;
gint i, j, k;
gdouble tmp, diff;
gdouble err = 0.0;
for (i = 0; i < height; i++)
{
for (j = 0; j < width; j++)
{
if ((0 == *mask) || (i == 0) || (i == (height - 1)) ||
(j == 0) || (j == (height - 1)))
if ((0 == *mask) ||
(i == 0) || (i == (height - 1)) ||
(j == 0) || (j == (width - 1)))
{
/* do nothing at the boundary or outside mask */
for (k = 0; k < depth; k++)

View File

@ -120,7 +120,7 @@ static gchar *
sanity_check_glib (void)
{
#define GLIB_REQUIRED_MAJOR 2
#define GLIB_REQUIRED_MINOR 20
#define GLIB_REQUIRED_MINOR 22
#define GLIB_REQUIRED_MICRO 0
const gchar *mismatch = glib_check_version (GLIB_REQUIRED_MAJOR,

View File

@ -397,8 +397,8 @@ gimp_color_picker_tool_info_update (GimpColorPickerTool *picker_tool,
gimp_color_frame_set_color (GIMP_COLOR_FRAME (picker_tool->color_frame2),
sample_type, color, color_index);
if (GTK_WIDGET_VISIBLE (picker_tool->dialog))
gdk_window_show (picker_tool->dialog->window);
if (gtk_widget_get_visible (picker_tool->dialog))
gdk_window_show (gtk_widget_get_window (picker_tool->dialog));
else
gtk_widget_show (picker_tool->dialog);
}

View File

@ -860,10 +860,15 @@ gimp_levels_tool_config_notify (GObject *object,
! strcmp (pspec->name, "low-input") ||
! strcmp (pspec->name, "high-input"))
{
tool->low_input->upper = 255;
tool->high_input->lower = 0;
tool->gamma_linear->lower = 0;
tool->gamma_linear->upper = 255;
g_object_freeze_notify (G_OBJECT (tool->low_input));
g_object_freeze_notify (G_OBJECT (tool->high_input));
g_object_freeze_notify (G_OBJECT (tool->gamma_linear));
gtk_adjustment_set_upper (tool->low_input, 255);
gtk_adjustment_set_lower (tool->high_input, 0);
gtk_adjustment_set_lower (tool->gamma_linear, 0);
gtk_adjustment_set_upper (tool->gamma_linear, 255);
gtk_adjustment_set_value (tool->low_input,
config->low_input[config->channel] * 255.0);
@ -872,13 +877,19 @@ gimp_levels_tool_config_notify (GObject *object,
gtk_adjustment_set_value (tool->high_input,
config->high_input[config->channel] * 255.0);
tool->low_input->upper = gtk_adjustment_get_value (tool->high_input);
tool->high_input->lower = gtk_adjustment_get_value (tool->low_input);
tool->gamma_linear->lower = gtk_adjustment_get_value (tool->low_input);
tool->gamma_linear->upper = gtk_adjustment_get_value (tool->high_input);
gtk_adjustment_changed (tool->low_input);
gtk_adjustment_changed (tool->high_input);
gtk_adjustment_changed (tool->gamma_linear);
gtk_adjustment_set_upper (tool->low_input,
gtk_adjustment_get_value (tool->high_input));
gtk_adjustment_set_lower (tool->high_input,
gtk_adjustment_get_value (tool->low_input));
gtk_adjustment_set_lower (tool->gamma_linear,
gtk_adjustment_get_value (tool->low_input));
gtk_adjustment_set_upper (tool->gamma_linear,
gtk_adjustment_get_value (tool->high_input));
g_object_thaw_notify (G_OBJECT (tool->low_input));
g_object_thaw_notify (G_OBJECT (tool->high_input));
g_object_thaw_notify (G_OBJECT (tool->gamma_linear));
levels_update_input_bar (tool);
}
@ -1055,10 +1066,8 @@ levels_low_input_changed (GtkAdjustment *adjustment,
GimpLevelsConfig *config = tool->config;
gint value = ROUND (gtk_adjustment_get_value (adjustment));
tool->high_input->lower = value;
tool->gamma_linear->lower = value;
gtk_adjustment_changed (tool->high_input);
gtk_adjustment_changed (tool->gamma_linear);
gtk_adjustment_set_lower (tool->high_input, value);
gtk_adjustment_set_lower (tool->gamma_linear, value);
if (config->low_input[config->channel] != value / 255.0)
{
@ -1094,10 +1103,8 @@ levels_high_input_changed (GtkAdjustment *adjustment,
GimpLevelsConfig *config = tool->config;
gint value = ROUND (gtk_adjustment_get_value (adjustment));
tool->low_input->upper = value;
tool->gamma_linear->upper = value;
gtk_adjustment_changed (tool->low_input);
gtk_adjustment_changed (tool->gamma_linear);
gtk_adjustment_set_upper (tool->low_input, value);
gtk_adjustment_set_upper (tool->gamma_linear, value);
if (config->high_input[config->channel] != value / 255.0)
{

View File

@ -978,8 +978,8 @@ gimp_measure_tool_dialog_update (GimpMeasureTool *measure,
gtk_label_set_text (GTK_LABEL (measure->unit_label[3]), NULL);
}
if (GTK_WIDGET_VISIBLE (measure->dialog))
gdk_window_show (measure->dialog->window);
if (gtk_widget_get_visible (measure->dialog))
gdk_window_show (gtk_widget_get_window (measure->dialog));
else
gtk_widget_show (measure->dialog);
}

View File

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

View File

@ -148,6 +148,12 @@ gimp_cell_renderer_dashes_get_size (GtkCellRenderer *cell,
gint *width,
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 (x_offset)
@ -155,16 +161,16 @@ gimp_cell_renderer_dashes_get_size (GtkCellRenderer *cell,
gdouble align;
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 = MAX (*x_offset, 0) + cell->xpad;
*x_offset = MAX (*x_offset, 0) + xpad;
}
if (y_offset)
{
*y_offset = cell->yalign * (cell_area->height - DASHES_HEIGHT);
*y_offset = MAX (*y_offset, 0) + cell->ypad;
*y_offset = yalign * (cell_area->height - DASHES_HEIGHT);
*y_offset = MAX (*y_offset, 0) + ypad;
}
}
else
@ -176,8 +182,8 @@ gimp_cell_renderer_dashes_get_size (GtkCellRenderer *cell,
*y_offset = 0;
}
*width = DASHES_WIDTH + 2 * cell->xpad;
*height = DASHES_HEIGHT + 2 * cell->ypad;
*width = DASHES_WIDTH + 2 * xpad;
*height = DASHES_HEIGHT + 2 * ypad;
}
static void
@ -192,36 +198,39 @@ gimp_cell_renderer_dashes_render (GtkCellRenderer *cell,
GimpCellRendererDashes *dashes = GIMP_CELL_RENDERER_DASHES (cell);
GtkStyle *style = gtk_widget_get_style (widget);
GtkStateType state;
gint xpad, ypad;
cairo_t *cr;
gint width;
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;
}
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;
else
state = GTK_STATE_ACTIVE;
}
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;
}
else
{
if (GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE)
state = GTK_STATE_INSENSITIVE;
else
if (gtk_widget_is_sensitive (widget))
state = GTK_STATE_NORMAL;
else
state = GTK_STATE_INSENSITIVE;
}
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);
@ -235,7 +244,7 @@ gimp_cell_renderer_dashes_render (GtkCellRenderer *cell,
if (dashes->segments[index])
{
cairo_rectangle (cr,
cell_area->x + cell->xpad + x, y,
cell_area->x + xpad + x, y,
MIN (BLOCK_WIDTH, width - x), DASHES_HEIGHT);
}
}

View File

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

View File

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

View File

@ -271,11 +271,18 @@ gimp_color_frame_expose (GtkWidget *widget,
if (frame->has_number)
{
GtkStyle *style = gtk_widget_get_style (widget);
cairo_t *cr;
gchar buf[8];
gint w, h;
gdouble scale;
GtkStyle *style = gtk_widget_get_style (widget);
GtkAllocation allocation;
GtkAllocation menu_allocation;
GtkAllocation color_area_allocation;
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));
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_get_pixel_size (frame->number_layout, &w, &h);
scale = ((gdouble) (widget->allocation.height -
frame->menu->allocation.height -
frame->color_area->allocation.height) /
scale = ((gdouble) (allocation.height -
menu_allocation.height -
color_area_allocation.height) /
(gdouble) h);
cairo_scale (cr, scale, scale);
cairo_move_to (cr,
(widget->allocation.x +
widget->allocation.width / 2.0) / scale - w / 2.0,
(widget->allocation.y +
widget->allocation.height / 2.0 +
frame->menu->allocation.height / 2.0 +
frame->color_area->allocation.height / 2.0) / scale - h / 2.0);
(allocation.x +
allocation.width / 2.0) / scale - w / 2.0,
(allocation.y +
allocation.height / 2.0 +
menu_allocation.height / 2.0 +
color_area_allocation.height / 2.0) / scale - h / 2.0);
pango_cairo_show_layout (cr, frame->number_layout);
cairo_fill (cr);

View File

@ -17,6 +17,8 @@
#include "config.h"
#undef GSEAL_ENABLE
#include <string.h>
/* 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);
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);
}
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);
}
@ -406,17 +408,20 @@ static void
gimp_combo_tag_entry_get_arrow_rect (GimpComboTagEntry *entry,
GdkRectangle *arrow_rect)
{
GtkWidget *widget = GTK_WIDGET (entry);
GtkStyle *style = gtk_widget_get_style (widget);
GtkWidget *widget = GTK_WIDGET (entry);
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)
arrow_rect->x = style->xthickness;
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->width = 12;
arrow_rect->height = widget->allocation.height - style->ythickness * 2;
arrow_rect->height = allocation.height - style->ythickness * 2;
}
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));
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);
}

View File

@ -207,7 +207,7 @@ gimp_container_grid_view_init (GimpContainerGridView *grid_view)
G_CALLBACK (gimp_container_grid_view_button_press),
grid_view);
GTK_WIDGET_SET_FLAGS (grid_view, GTK_CAN_FOCUS);
gtk_widget_set_can_focus (GTK_WIDGET (grid_view), TRUE);
}
GtkWidget *
@ -287,7 +287,7 @@ gimp_container_grid_view_move_cursor (GimpContainerGridView *grid_view,
GimpContainer *container;
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;
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);
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));
return TRUE;
@ -354,24 +354,27 @@ gimp_container_grid_view_menu_position (GtkMenu *menu,
{
GimpContainerGridView *grid_view = GIMP_CONTAINER_GRID_VIEW (data);
GtkWidget *widget;
GtkAllocation allocation;
if (grid_view->selected_item)
widget = GTK_WIDGET (grid_view->selected_item);
else
widget = GTK_WIDGET (grid_view->wrap_box);
gtk_widget_get_allocation (widget, &allocation);
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;
*y += widget->allocation.y;
*x += allocation.x;
*y += allocation.y;
}
if (grid_view->selected_item)
{
*x += widget->allocation.width / 2;
*y += widget->allocation.height / 2;
*x += allocation.width / 2;
*y += allocation.height / 2;
}
else
{
@ -553,7 +556,7 @@ gimp_container_grid_view_item_selected (GtkWidget *widget,
{
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));
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)
{
GtkAllocation allocation;
gtk_widget_get_allocation (widget, &allocation);
/* the event was on the popup, which can either be really on the
* popup or outside gimp (owner_events == TRUE, see map())
*/
if (bevent->x < 0 ||
bevent->y < 0 ||
bevent->x > widget->allocation.width ||
bevent->y > widget->allocation.height)
if (bevent->x < 0 ||
bevent->y < 0 ||
bevent->x > allocation.width ||
bevent->y > allocation.height)
{
/* the event was outsde gimp */
@ -392,6 +396,7 @@ gimp_container_popup_show (GimpContainerPopup *popup,
{
GdkScreen *screen;
GtkRequisition requisition;
GtkAllocation allocation;
GdkRectangle rect;
gint monitor;
gint orig_x;
@ -403,12 +408,14 @@ gimp_container_popup_show (GimpContainerPopup *popup,
g_return_if_fail (GTK_IS_WIDGET (widget));
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);
if (GTK_WIDGET_NO_WINDOW (widget))
if (! gtk_widget_get_has_window (widget))
{
orig_x += widget->allocation.x;
orig_y += widget->allocation.y;
orig_x += allocation.x;
orig_y += allocation.y;
}
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)
{
x = orig_x + widget->allocation.width - requisition.width;
x = orig_x + allocation.width - requisition.width;
if (x < rect.x)
x -= widget->allocation.width - requisition.width;
x -= allocation.width - requisition.width;
}
else
{
x = orig_x;
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)
y = orig_y - requisition.height;
@ -476,20 +483,20 @@ void
gimp_container_popup_set_view_size (GimpContainerPopup *popup,
gint view_size)
{
GtkWidget *scrolled_win;
GtkWidget *viewport;
gint viewport_width;
GtkWidget *scrolled_win;
GtkWidget *viewport;
GtkAllocation allocation;
g_return_if_fail (GIMP_IS_CONTAINER_POPUP (popup));
scrolled_win = GIMP_CONTAINER_BOX (popup->editor->view)->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,
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)
{

View File

@ -232,10 +232,13 @@ gimp_container_tree_view_drag_motion (GtkWidget *widget,
guint time,
GimpContainerTreeView *tree_view)
{
GtkAllocation allocation;
GtkTreePath *path;
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;
@ -247,7 +250,7 @@ gimp_container_tree_view_drag_motion (GtkWidget *widget,
else
{
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);

View File

@ -318,14 +318,17 @@ gimp_container_tree_view_menu_position (GtkMenu *menu,
{
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (data);
GtkWidget *widget = GTK_WIDGET (tree_view->view);
GtkAllocation allocation;
GtkTreeIter selected_iter;
gtk_widget_get_allocation (widget, &allocation);
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;
*y += widget->allocation.y;
*x += allocation.x;
*y += allocation.y;
}
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);
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;
}
else
@ -972,19 +975,22 @@ gimp_container_tree_view_find_click_cell (GtkWidget *widget,
gint start;
gint width;
if (renderer->visible &&
if (gtk_cell_renderer_get_visible (renderer) &&
gtk_tree_view_column_cell_get_position (column, renderer,
&start, &width))
{
gint xpad, ypad;
gint x;
gtk_cell_renderer_get_padding (renderer, &xpad, &ypad);
if (rtl)
x = column_area->x + column_area->width - start - width;
else
x = start + column_area->x;
if (tree_x >= x + renderer->xpad &&
tree_x < x + width - renderer->xpad)
if (tree_x >= x + xpad &&
tree_x < x + width - xpad)
{
return renderer;
}
@ -1005,7 +1011,7 @@ gimp_container_tree_view_button_press (GtkWidget *widget,
tree_view->priv->dnd_renderer = NULL;
if (! GTK_WIDGET_HAS_FOCUS (widget))
if (! gtk_widget_has_focus (widget))
gtk_widget_grab_focus (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,
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));
}

View File

@ -452,7 +452,7 @@ gimp_controller_list_row_activated (GtkTreeView *tv,
GtkTreeViewColumn *column,
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));
}
@ -495,7 +495,7 @@ gimp_controller_list_activate_item (GimpContainerView *view,
gpointer insert_data,
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));
}

View File

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

View File

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

View File

@ -20,6 +20,8 @@
#include "config.h"
#undef GSEAL_ENABLE
#include <gtk/gtk.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,
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));
}
}

View File

@ -416,11 +416,9 @@ gimp_device_status_update (GimpDeviceStatus *status)
{
GimpDeviceStatusEntry *entry = list->data;
if (entry->device_info->device &&
entry->device_info->device == status->current_device)
gtk_widget_show (entry->arrow);
else
gtk_widget_hide (entry->arrow);
gtk_widget_set_visible (entry->arrow,
entry->device_info->device &&
entry->device_info->device == status->current_device);
}
}

View File

@ -171,7 +171,7 @@ gimp_dialog_factory_dispose (GObject *object)
{
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));
break;
@ -582,7 +582,7 @@ gimp_dialog_factory_dialog_new_internal (GimpDialogFactory *factory,
if (! dialog)
return NULL;
if (GTK_WIDGET_TOPLEVEL (dialog))
if (gtk_widget_is_toplevel (dialog))
{
gtk_window_set_screen (GTK_WINDOW (dialog), screen);
@ -836,7 +836,7 @@ gimp_dialog_factory_add_dialog (GimpDialogFactory *factory,
dialog))
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 */
{
@ -878,7 +878,7 @@ gimp_dialog_factory_add_dialog (GimpDialogFactory *factory,
if (toplevel &&
gimp_session_info_is_session_managed (current_info) &&
! GTK_WIDGET_VISIBLE (dialog))
! gtk_widget_get_visible (dialog))
{
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 (identifier != NULL);
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);
@ -1117,7 +1117,7 @@ void
gimp_dialog_factory_hide_dialog (GtkWidget *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))
{
@ -1521,11 +1521,11 @@ gimp_dialog_factories_hide_foreach (gconstpointer key,
{
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;
if (GTK_WIDGET_VISIBLE (widget))
if (gtk_widget_get_visible (widget))
{
visibility = GIMP_DIALOG_VISIBILITY_VISIBLE;
@ -1558,7 +1558,7 @@ gimp_dialog_factories_show_foreach (gconstpointer key,
{
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;
@ -1566,7 +1566,7 @@ gimp_dialog_factories_show_foreach (gconstpointer key,
GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget),
GIMP_DIALOG_VISIBILITY_KEY));
if (! GTK_WIDGET_VISIBLE (widget) &&
if (! gtk_widget_get_visible (widget) &&
visibility == GIMP_DIALOG_VISIBILITY_VISIBLE)
{
GIMP_LOG (WM, "Showing '%s' [%p]",
@ -1578,7 +1578,7 @@ gimp_dialog_factories_show_foreach (gconstpointer key,
*/
gtk_widget_show (widget);
if (GTK_WIDGET_VISIBLE (widget))
if (gtk_widget_get_visible (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;
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))
{
@ -1634,7 +1634,7 @@ gimp_dialog_factories_unset_busy_foreach (gconstpointer key,
{
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))
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)
{
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;
}

View File

@ -20,6 +20,8 @@
#include "config.h"
#undef GSEAL_ENABLE
#include <string.h>
#include <gtk/gtk.h>
@ -182,7 +184,7 @@ gimp_dockable_init (GimpDockable *dockable)
dockable->menu_button = gtk_button_new ();
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_button_set_relief (GTK_BUTTON (dockable->menu_button), GTK_RELIEF_NONE);
gtk_widget_show (dockable->menu_button);
@ -319,7 +321,7 @@ gimp_dockable_size_request (GtkWidget *widget,
requisition->width = 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);
@ -329,7 +331,7 @@ gimp_dockable_size_request (GtkWidget *widget,
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);
@ -354,7 +356,7 @@ gimp_dockable_size_allocate (GtkWidget *widget,
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);
@ -373,7 +375,7 @@ gimp_dockable_size_allocate (GtkWidget *widget,
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.y = allocation->y + border_width;
@ -544,7 +546,7 @@ static gboolean
gimp_dockable_expose_event (GtkWidget *widget,
GdkEventExpose *event)
{
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
GimpDockable *dockable = GIMP_DOCKABLE (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),
(dockable->blink_counter & 1) ?
GTK_STATE_SELECTED : widget->state, TRUE,
GTK_STATE_SELECTED : gtk_widget_get_state (widget),
TRUE,
&expose_area, widget, NULL,
text_x, text_y, dockable->title_layout);
}
@ -1059,7 +1062,7 @@ gimp_dockable_blink_cancel (GimpDockable *dockable)
static void
gimp_dockable_cursor_setup (GimpDockable *dockable)
{
if (! GTK_WIDGET_REALIZED (dockable))
if (! GTK_WIDGET_REALIZED (GTK_WIDGET (dockable)))
return;
if (! dockable->title_window)
@ -1102,7 +1105,7 @@ gimp_dockable_get_title_area (GimpDockable *dockable,
static void
gimp_dockable_clear_title_area (GimpDockable *dockable)
{
if (GTK_WIDGET_DRAWABLE (dockable))
if (gtk_widget_is_drawable (GTK_WIDGET (dockable)))
{
GdkRectangle area;
@ -1310,7 +1313,7 @@ gimp_dockable_title_changed (GimpDocked *docked,
dockable->title_layout = NULL;
}
if (GTK_WIDGET_DRAWABLE (dockable))
if (gtk_widget_is_drawable (GTK_WIDGET (dockable)))
{
GdkRectangle area;

View File

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

View File

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

View File

@ -392,12 +392,7 @@ gimp_editor_set_show_button_bar (GimpDocked *docked,
editor->show_button_bar = show;
if (editor->button_box)
{
if (show)
gtk_widget_show (editor->button_box);
else
gtk_widget_hide (editor->button_box);
}
gtk_widget_set_visible (editor->button_box, show);
}
}

View File

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

View File

@ -20,6 +20,8 @@
#include "config.h"
#undef GSEAL_ENABLE
#include <string.h>
#include <gtk/gtk.h>
@ -86,7 +88,7 @@ gimp_fg_bg_view_class_init (GimpFgBgViewClass *klass)
static void
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;
}
@ -213,7 +215,7 @@ gimp_fg_bg_view_expose (GtkWidget *widget,
gint rect_w, rect_h;
GimpRGB color;
if (! GTK_WIDGET_DRAWABLE (widget))
if (! gtk_widget_is_drawable (widget))
return FALSE;
x = widget->allocation.x;

View File

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

View File

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

View File

@ -17,6 +17,8 @@
#include "config.h"
#undef GSEAL_ENABLE
#include <gegl.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 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))
editor->bg_histogram = gimp_histogram_duplicate (editor->histogram);

View File

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

View File

@ -459,10 +459,7 @@ gimp_menu_dock_set_show_image_menu (GimpMenuDock *menu_dock,
parent = gtk_widget_get_parent (menu_dock->image_combo);
if (show)
gtk_widget_show (parent);
else
gtk_widget_hide (parent);
gtk_widget_set_visible (parent, show);
menu_dock->show_image_menu = show ? TRUE : FALSE;
}

View File

@ -20,6 +20,8 @@
#include "config.h"
#undef GSEAL_ENABLE
#include <gtk/gtk.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);
if (box->image && GTK_WIDGET_VISIBLE (box->image))
if (box->image && gtk_widget_get_visible (box->image))
{
GtkRequisition child_requisition;
gint border_width;
@ -266,7 +268,7 @@ gimp_message_box_size_allocate (GtkWidget *widget,
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;
GtkAllocation child_allocation;

View File

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

View File

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

View File

@ -20,6 +20,8 @@
#include "config.h"
#undef GSEAL_ENABLE
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
@ -152,7 +154,7 @@ gimp_palette_view_class_init (GimpPaletteViewClass *klass)
static void
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->dnd_entry = NULL;
@ -165,7 +167,7 @@ gimp_palette_view_expose (GtkWidget *widget,
GimpPaletteView *pal_view = GIMP_PALETTE_VIEW (widget);
GimpView *view = GIMP_VIEW (widget);
if (! GTK_WIDGET_DRAWABLE (widget))
if (! gtk_widget_is_drawable (widget))
return FALSE;
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);
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);
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);
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);

View File

@ -20,6 +20,8 @@
#include "config.h"
#undef GSEAL_ENABLE
#include <gtk/gtk.h>
#include "libgimpmath/gimpmath.h"
@ -130,7 +132,7 @@ gimp_progress_box_progress_start (GimpProgress *progress,
box->cancelable = cancelable;
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),
TRUE);
@ -175,7 +177,7 @@ gimp_progress_box_progress_set_text (GimpProgress *progress,
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),
TRUE);
}
@ -198,7 +200,7 @@ gimp_progress_box_progress_set_value (GimpProgress *progress,
{
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),
TRUE);
}
@ -226,7 +228,7 @@ gimp_progress_box_progress_pulse (GimpProgress *progress)
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),
TRUE);
}

View File

@ -20,6 +20,8 @@
#include "config.h"
#undef GSEAL_ENABLE
#include <gtk/gtk.h>
#include "widgets-types.h"
@ -161,7 +163,7 @@ gimp_scale_button_image_expose (GtkWidget *widget,
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);
for ( ; i < steps; i++)

View File

@ -564,7 +564,7 @@ gimp_session_info_read_geometry (GimpSessionInfo *info)
switch (visibility)
{
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;
case GIMP_DIALOG_VISIBILITY_INVISIBLE:

View File

@ -249,7 +249,7 @@ gimp_settings_box_constructor (GType type,
gtk_widget_show (hbox2);
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_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0);
gtk_widget_show (button);
@ -265,7 +265,7 @@ gimp_settings_box_constructor (GType type,
box);
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_box_pack_start (GTK_BOX (hbox2), button, FALSE, FALSE, 0);
gtk_widget_show (button);

View File

@ -17,6 +17,8 @@
#include "config.h"
#undef GSEAL_ENABLE
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"
@ -341,8 +343,10 @@ gimp_stroke_editor_paint_button (GtkWidget *widget,
GtkAllocation *alloc = &widget->allocation;
gint w = MIN (alloc->width, alloc->height) * 2 / 3;
gtk_paint_arrow (style, gtk_widget_get_window (widget),
widget->state, GTK_SHADOW_IN,
gtk_paint_arrow (style,
gtk_widget_get_window (widget),
gtk_widget_get_state (widget),
GTK_SHADOW_IN,
&event->area, widget, NULL,
data ? GTK_ARROW_LEFT : GTK_ARROW_RIGHT, TRUE,
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_strstrip (text);
if (! GTK_WIDGET_HAS_FOCUS (GTK_WIDGET (entry))
if (! gtk_widget_has_focus (GTK_WIDGET (entry))
&& strlen (text) == 0)
{
gimp_tag_entry_toggle_desc (tag_entry, TRUE);

View File

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

View File

@ -17,6 +17,8 @@
#include "config.h"
#undef GSEAL_ENABLE
#include <string.h>
#include <gtk/gtk.h>
@ -512,18 +514,19 @@ gimp_toolbox_expose_event (GtkWidget *widget,
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,
&toolbox->p->header->allocation,
&clip_rect))
{
GtkStyle *style = gtk_widget_get_style (widget);
cairo_t *cr;
gint header_height;
gint header_width;
gdouble wilber_width;
gdouble wilber_height;
gdouble factor;
GtkStyle *style = gtk_widget_get_style (widget);
GtkStateType state = gtk_widget_get_state (widget);
cairo_t *cr;
gint header_height;
gint header_width;
gdouble wilber_width;
gdouble wilber_height;
gdouble factor;
cr = gdk_cairo_create (gtk_widget_get_window (widget));
gdk_cairo_rectangle (cr, &clip_rect);
@ -543,9 +546,9 @@ gimp_toolbox_expose_event (GtkWidget *widget,
(header_height / factor - wilber_height) / 2.0);
cairo_set_source_rgba (cr,
style->fg[widget->state].red / 65535.0,
style->fg[widget->state].green / 65535.0,
style->fg[widget->state].blue / 65535.0,
style->fg[state].red / 65535.0,
style->fg[state].green / 65535.0,
style->fg[state].blue / 65535.0,
0.10);
cairo_fill (cr);
@ -923,10 +926,7 @@ toolbox_tool_visible_notify (GimpToolInfo *tool_info,
GParamSpec *pspec,
GtkWidget *button)
{
if (tool_info->visible)
gtk_widget_show (button);
else
gtk_widget_hide (button);
gtk_widget_set_visible (button, tool_info->visible);
}
static void

View File

@ -324,7 +324,7 @@ static void
gimp_tool_options_editor_save_clicked (GtkWidget *widget,
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,
"/tool-options-popup/Save");

View File

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

View File

@ -20,6 +20,8 @@
#include "config.h"
#undef GSEAL_ENABLE
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
@ -111,7 +113,7 @@ gimp_view_popup_show (GtkWidget *widget,
popup->button_x = bevent->x;
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_y += widget->allocation.y;

View File

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

View File

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

View File

@ -20,6 +20,8 @@
#include "config.h"
#undef GSEAL_ENABLE
#include <errno.h>
#include <fcntl.h>
#include <string.h>
@ -147,6 +149,7 @@ gimp_button_menu_position (GtkWidget *button,
GdkRectangle rect;
gint monitor;
g_return_if_fail (GTK_IS_WIDGET (button));
g_return_if_fail (GTK_WIDGET_REALIZED (button));
g_return_if_fail (GTK_IS_MENU (menu));
g_return_if_fail (x != NULL);
@ -174,7 +177,7 @@ gimp_button_menu_position (GtkWidget *button,
gtk_menu_set_screen (menu, screen);
if (GTK_WIDGET_NO_WINDOW (button))
if (! gtk_widget_get_has_window (button))
*x += button->allocation.x;
switch (position)
@ -196,7 +199,7 @@ gimp_button_menu_position (GtkWidget *button,
break;
}
if (GTK_WIDGET_NO_WINDOW (button))
if (! gtk_widget_get_has_window (button))
*y += button->allocation.y;
*y += button->allocation.height / 2;
@ -823,12 +826,12 @@ gimp_window_get_native (GtkWindow *window)
#endif
#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)));
#endif
#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)));
#endif
@ -864,7 +867,7 @@ gimp_window_set_transient_for (GtkWindow *window,
if (! parent)
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)),
parent);
@ -1002,10 +1005,8 @@ gimp_toggle_button_set_visible (GtkToggleButton *toggle,
g_return_if_fail (GTK_IS_TOGGLE_BUTTON (toggle));
g_return_if_fail (GTK_IS_WIDGET (widget));
if (gtk_toggle_button_get_active (toggle))
gtk_widget_show (widget);
else
gtk_widget_hide (widget);
gtk_widget_set_visible (widget,
gtk_toggle_button_get_active (toggle));
}
static gboolean

View File

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

View File

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

View File

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

View File

@ -42,8 +42,8 @@ m4_define([gimp_full_name], [GNU Image Manipulation Program])
# required versions of other packages
m4_define([babl_required_version], [0.1.0])
m4_define([gegl_required_version], [0.1.0])
m4_define([glib_required_version], [2.20.0])
m4_define([gtk_required_version], [2.16.6])
m4_define([glib_required_version], [2.22.0])
m4_define([gtk_required_version], [2.18.1])
m4_define([gdk_pixbuf_required_version], [gtk_required_version])
m4_define([cairo_required_version], [1.6.0])
m4_define([pangocairo_required_version], [1.20.1])
@ -1864,7 +1864,7 @@ AC_SUBST(MIME_TYPES)
# Disable deprecated APIs
#########################
CPPFLAGS="${CPPFLAGS} -DGIMP_DISABLE_DEPRECATED -DBABL_DISABLE_DEPRECATED"
CPPFLAGS="${CPPFLAGS} -DGIMP_DISABLE_DEPRECATED -DBABL_DISABLE_DEPRECATED -DGSEAL_ENABLE"
if test "x$have_glib_2_23" != "xyes"; then
CPPFLAGS="${CPPFLAGS} -DG_DISABLE_DEPRECATED"

View File

@ -734,20 +734,23 @@ gimp_brush_select_preview_update (GtkWidget *preview,
const guchar *mask_data)
{
GimpPreviewArea *area = GIMP_PREVIEW_AREA (preview);
GtkAllocation allocation;
gint x, y;
gint width, height;
width = MIN (brush_width, preview->allocation.width);
height = MIN (brush_height, preview->allocation.height);
gtk_widget_get_allocation (preview, &allocation);
x = ((preview->allocation.width - width) / 2);
y = ((preview->allocation.height - height) / 2);
width = MIN (brush_width, allocation.width);
height = MIN (brush_height, allocation.height);
x = ((allocation.width - width) / 2);
y = ((allocation.height - height) / 2);
if (x || y)
gimp_preview_area_fill (area,
0, 0,
preview->allocation.width,
preview->allocation.height,
allocation.width,
allocation.height,
0xFF, 0xFF, 0xFF);
gimp_brush_select_preview_draw (area,

View File

@ -531,7 +531,7 @@ gimp_gradient_select_preview_expose (GtkWidget *widget,
guchar *buf = ((y / GIMP_CHECK_SIZE_SM) & 1) ? odd : even;
gdk_draw_rgb_image_dithalign (gtk_widget_get_window (widget),
style->fg_gc[widget->state],
style->fg_gc[gtk_widget_get_state (widget)],
event->area.x, y,
event->area.width, 1,
GDK_RGB_DITHER_MAX,

View File

@ -21,6 +21,8 @@
#include "config.h"
#undef GSEAL_ENABLE
#include <gtk/gtk.h>
#ifdef GDK_WINDOWING_WIN32
@ -107,7 +109,7 @@ gimp_progress_bar_start (const gchar *message,
gtk_progress_bar_set_text (GTK_PROGRESS_BAR (bar), message ? message : " ");
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (bar), 0.0);
if (GTK_WIDGET_DRAWABLE (bar))
if (gtk_widget_is_drawable (GTK_WIDGET (bar)))
while (gtk_events_pending ())
gtk_main_iteration ();
}
@ -120,7 +122,7 @@ gimp_progress_bar_end (gpointer user_data)
gtk_progress_bar_set_text (GTK_PROGRESS_BAR (bar), " ");
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (bar), 0.0);
if (GTK_WIDGET_DRAWABLE (bar))
if (gtk_widget_is_drawable (GTK_WIDGET (bar)))
while (gtk_events_pending ())
gtk_main_iteration ();
}
@ -133,7 +135,7 @@ gimp_progress_bar_set_text (const gchar *message,
gtk_progress_bar_set_text (GTK_PROGRESS_BAR (bar), message ? message : " ");
if (GTK_WIDGET_DRAWABLE (bar))
if (gtk_widget_is_drawable (GTK_WIDGET (bar)))
while (gtk_events_pending ())
gtk_main_iteration ();
}
@ -149,7 +151,7 @@ gimp_progress_bar_set_value (gdouble percentage,
else
gtk_progress_bar_pulse (GTK_PROGRESS_BAR (bar));
if (GTK_WIDGET_DRAWABLE (bar))
if (gtk_widget_is_drawable (GTK_WIDGET (bar)))
while (gtk_events_pending ())
gtk_main_iteration ();
}
@ -161,7 +163,7 @@ gimp_progress_bar_pulse (gpointer user_data)
gtk_progress_bar_pulse (GTK_PROGRESS_BAR (bar));
if (GTK_WIDGET_DRAWABLE (bar))
if (gtk_widget_is_drawable (GTK_WIDGET (bar)))
while (gtk_events_pending ())
gtk_main_iteration ();
}
@ -178,12 +180,12 @@ gimp_window_get_native (GtkWindow *window)
#endif
#ifdef GDK_WINDOWING_WIN32
if (window && GTK_WIDGET_REALIZED (window))
if (window && GTK_WIDGET_REALIZED (GTK_WIDGET (window)))
return GDK_WINDOW_HWND (gtk_widget_get_window (GTK_WIDGET (window)));
#endif
#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)));
#endif

View File

@ -18,6 +18,8 @@
#include "config.h"
#undef GSEAL_ENABLE
#include <gtk/gtk.h>
#include "libgimpmodule/gimpmodule.h"
@ -290,7 +292,7 @@ gimp_window_set_transient_for (GtkWindow *window,
if (! parent)
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)),
parent);

View File

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

View File

@ -177,24 +177,29 @@ gimp_cell_renderer_color_get_size (GtkCellRenderer *cell,
GimpCellRendererColor *color = GIMP_CELL_RENDERER_COLOR (cell);
gint calc_width;
gint calc_height;
gfloat xalign;
gfloat yalign;
gint xpad;
gint ypad;
gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (widget),
color->size, &calc_width, &calc_height);
gtk_cell_renderer_get_alignment (cell, &xalign, &yalign);
gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
if (cell_area && calc_width > 0 && calc_height > 0)
{
if (x_offset)
{
*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));
*x_offset = MAX (*x_offset, 0) + cell->xpad;
*x_offset = MAX (*x_offset, 0) + xpad;
}
if (y_offset)
{
*y_offset = (cell->yalign *
(cell_area->height - calc_height));
*y_offset = MAX (*y_offset, 0) + cell->ypad;
*y_offset = (yalign * (cell_area->height - calc_height));
*y_offset = MAX (*y_offset, 0) + ypad;
}
}
else
@ -206,9 +211,9 @@ gimp_cell_renderer_color_get_size (GtkCellRenderer *cell,
}
if (width)
*width = calc_width + 2 * cell->xpad;
*width = calc_width + 2 * xpad;
if (height)
*height = calc_height + 2 * cell->ypad;
*height = calc_height + 2 * ypad;
}
static void
@ -222,6 +227,8 @@ gimp_cell_renderer_color_render (GtkCellRenderer *cell,
{
GimpCellRendererColor *color = GIMP_CELL_RENDERER_COLOR (cell);
GdkRectangle rect;
gint xpad;
gint ypad;
gimp_cell_renderer_color_get_size (cell, widget, cell_area,
&rect.x,
@ -229,10 +236,12 @@ gimp_cell_renderer_color_render (GtkCellRenderer *cell,
&rect.width,
&rect.height);
rect.x += cell_area->x + cell->xpad;
rect.y += cell_area->y + cell->ypad;
rect.width -= 2 * cell->xpad;
rect.height -= 2 * cell->ypad;
gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
rect.x += cell_area->x + xpad;
rect.y += cell_area->y + ypad;
rect.width -= 2 * xpad;
rect.height -= 2 * ypad;
if (rect.width > 2 && rect.height > 2)
{
@ -273,8 +282,8 @@ gimp_cell_renderer_color_render (GtkCellRenderer *cell,
rect.x + 0.5, rect.y + 0.5,
rect.width - 1, rect.height - 1);
if (! cell->sensitive ||
GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE)
if (! gtk_cell_renderer_get_sensitive (cell) ||
! gtk_widget_is_sensitive (widget))
{
state = GTK_STATE_INSENSITIVE;
}

View File

@ -224,6 +224,10 @@ gimp_cell_renderer_toggle_get_size (GtkCellRenderer *cell,
gint calc_height;
gint pixbuf_width;
gint pixbuf_height;
gfloat xalign;
gfloat yalign;
gint xpad;
gint ypad;
if (! toggle->stock_id)
{
@ -235,6 +239,9 @@ gimp_cell_renderer_toggle_get_size (GtkCellRenderer *cell,
return;
}
gtk_cell_renderer_get_alignment (cell, &xalign, &yalign);
gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
if (! toggle->pixbuf)
gimp_cell_renderer_toggle_create_pixbuf (toggle, widget);
@ -242,9 +249,9 @@ gimp_cell_renderer_toggle_get_size (GtkCellRenderer *cell,
pixbuf_height = gdk_pixbuf_get_height (toggle->pixbuf);
calc_width = (pixbuf_width +
(gint) cell->xpad * 2 + style->xthickness * 2);
(gint) xpad * 2 + style->xthickness * 2);
calc_height = (pixbuf_height +
(gint) cell->ypad * 2 + style->ythickness * 2);
(gint) ypad * 2 + style->ythickness * 2);
if (width)
*width = calc_width;
@ -257,14 +264,14 @@ gimp_cell_renderer_toggle_get_size (GtkCellRenderer *cell,
if (x_offset)
{
*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));
*x_offset = MAX (*x_offset, 0);
}
if (y_offset)
{
*y_offset = cell->yalign * (cell_area->height - calc_height);
*y_offset = yalign * (cell_area->height - calc_height);
*y_offset = MAX (*y_offset, 0);
}
}
@ -285,6 +292,8 @@ gimp_cell_renderer_toggle_render (GtkCellRenderer *cell,
GdkRectangle draw_rect;
GtkStateType state;
gboolean active;
gint xpad;
gint ypad;
if (! toggle->stock_id)
{
@ -301,10 +310,12 @@ gimp_cell_renderer_toggle_render (GtkCellRenderer *cell,
&toggle_rect.width,
&toggle_rect.height);
toggle_rect.x += cell_area->x + cell->xpad;
toggle_rect.y += cell_area->y + cell->ypad;
toggle_rect.width -= cell->xpad * 2;
toggle_rect.height -= cell->ypad * 2;
gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
toggle_rect.x += cell_area->x + xpad;
toggle_rect.y += cell_area->y + ypad;
toggle_rect.width -= xpad * 2;
toggle_rect.height -= ypad * 2;
if (toggle_rect.width <= 0 || toggle_rect.height <= 0)
return;
@ -314,14 +325,14 @@ gimp_cell_renderer_toggle_render (GtkCellRenderer *cell,
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;
else
state = GTK_STATE_ACTIVE;
}
else
{
if (GTK_CELL_RENDERER_TOGGLE (cell)->activatable)
if (gtk_cell_renderer_toggle_get_activatable (GTK_CELL_RENDERER_TOGGLE (cell)))
state = GTK_STATE_NORMAL;
else
state = GTK_STATE_INSENSITIVE;
@ -372,7 +383,7 @@ gimp_cell_renderer_toggle_activate (GtkCellRenderer *cell,
{
GtkCellRendererToggle *toggle = GTK_CELL_RENDERER_TOGGLE (cell);
if (toggle->activatable)
if (gtk_cell_renderer_toggle_get_activatable (toggle))
{
GdkModifierType state = 0;

View File

@ -335,7 +335,7 @@ gimp_chain_line_class_init (GimpChainLineClass *klass)
static void
gimp_chain_line_init (GimpChainLine *line)
{
GTK_WIDGET_SET_FLAGS (line, GTK_NO_WINDOW);
gtk_widget_set_has_window (GTK_WIDGET (line), FALSE);
}
static GtkWidget *
@ -355,14 +355,17 @@ gimp_chain_line_expose_event (GtkWidget *widget,
GdkEventExpose *event)
{
GimpChainLine *line = ((GimpChainLine *) widget);
GtkAllocation allocation;
GdkPoint points[3];
GdkPoint buf;
GtkShadowType shadow;
GimpChainPosition position;
gtk_widget_get_allocation (widget, &allocation);
#define SHORT_LINE 4
points[0].x = widget->allocation.x + widget->allocation.width / 2;
points[0].y = widget->allocation.y + widget->allocation.height / 2;
points[0].x = allocation.x + allocation.width / 2;
points[0].y = allocation.y + allocation.height / 2;
position = line->position;
@ -392,8 +395,8 @@ gimp_chain_line_expose_event (GtkWidget *widget,
points[1].y = points[0].y;
points[2].x = points[1].x;
points[2].y = (line->which == 1 ?
widget->allocation.y + widget->allocation.height - 1 :
widget->allocation.y);
allocation.y + allocation.height - 1 :
allocation.y);
shadow = GTK_SHADOW_ETCHED_IN;
break;
@ -403,8 +406,8 @@ gimp_chain_line_expose_event (GtkWidget *widget,
points[1].y = points[0].y;
points[2].x = points[1].x;
points[2].y = (line->which == 1 ?
widget->allocation.y + widget->allocation.height - 1 :
widget->allocation.y);
allocation.y + allocation.height - 1 :
allocation.y);
shadow = GTK_SHADOW_ETCHED_OUT;
break;
@ -413,8 +416,8 @@ gimp_chain_line_expose_event (GtkWidget *widget,
points[1].x = points[0].x;
points[1].y = points[0].y - SHORT_LINE;
points[2].x = (line->which == 1 ?
widget->allocation.x + widget->allocation.width - 1 :
widget->allocation.x);
allocation.x + allocation.width - 1 :
allocation.x);
points[2].y = points[1].y;
shadow = GTK_SHADOW_ETCHED_OUT;
break;
@ -424,8 +427,8 @@ gimp_chain_line_expose_event (GtkWidget *widget,
points[1].x = points[0].x;
points[1].y = points[0].y + SHORT_LINE;
points[2].x = (line->which == 1 ?
widget->allocation.x + widget->allocation.width - 1 :
widget->allocation.x);
allocation.x + allocation.width - 1 :
allocation.x);
points[2].y = points[1].y;
shadow = GTK_SHADOW_ETCHED_IN;
break;

View File

@ -289,11 +289,11 @@ gimp_color_area_size_allocate (GtkWidget *widget,
if (GTK_WIDGET_CLASS (parent_class)->size_allocate)
GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation);
if (widget->allocation.width != area->width ||
widget->allocation.height != area->height)
if (allocation->width != area->width ||
allocation->height != area->height)
{
area->width = widget->allocation.width;
area->height = widget->allocation.height;
area->width = allocation->width;
area->height = allocation->height;
area->rowstride = (area->width * 3 + 3) & ~0x3;
@ -308,7 +308,7 @@ static void
gimp_color_area_state_changed (GtkWidget *widget,
GtkStateType previous_state)
{
if (widget->state == GTK_STATE_INSENSITIVE ||
if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE ||
previous_state == GTK_STATE_INSENSITIVE)
{
GIMP_COLOR_AREA (widget)->needs_render = TRUE;
@ -326,7 +326,7 @@ gimp_color_area_expose (GtkWidget *widget,
GtkStyle *style = gtk_widget_get_style (widget);
guchar *buf;
if (! area->buf || ! GTK_WIDGET_DRAWABLE (widget))
if (! area->buf || ! gtk_widget_is_drawable (widget))
return FALSE;
if (area->needs_render)
@ -348,7 +348,7 @@ gimp_color_area_expose (GtkWidget *widget,
if (area->draw_border)
gdk_draw_rectangle (gtk_widget_get_window (widget),
style->fg_gc[widget->state],
style->fg_gc[gtk_widget_get_state (widget)],
FALSE,
0, 0,
area->width - 1, area->height - 1);
@ -645,7 +645,7 @@ gimp_color_area_render (GimpColorArea *area)
return;
_gimp_color_area_render_buf (GTK_WIDGET (area),
! GTK_WIDGET_IS_SENSITIVE (area),
! gtk_widget_is_sensitive (GTK_WIDGET (area)),
area->type,
area->buf,
area->width, area->height, area->rowstride,

View File

@ -455,7 +455,7 @@ gimp_color_button_state_changed (GtkWidget *widget,
{
g_return_if_fail (GIMP_IS_COLOR_BUTTON (widget));
if (! GTK_WIDGET_IS_SENSITIVE (widget) && GIMP_COLOR_BUTTON (widget)->dialog)
if (! gtk_widget_is_sensitive (widget) && GIMP_COLOR_BUTTON (widget)->dialog)
gtk_widget_hide (GIMP_COLOR_BUTTON (widget)->dialog);
if (GTK_WIDGET_CLASS (parent_class)->state_changed)

View File

@ -24,6 +24,8 @@
#include <string.h>
#undef GSEAL_ENABLE
#include <gtk/gtk.h>
#include "libgimpcolor/gimpcolor.h"
@ -76,12 +78,13 @@ gimp_color_scale_init (GimpColorScale *scale)
{
GtkRange *range = GTK_RANGE (scale);
GTK_SCALE (scale)->draw_value = FALSE;
range->slider_size_fixed = TRUE;
range->flippable = TRUE;
/* range->update_policy = GTK_UPDATE_DELAYED; */
gtk_range_set_flippable (GTK_RANGE (scale), TRUE);
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
scale->channel = GIMP_COLOR_SELECTOR_VALUE;
scale->needs_render = TRUE;
@ -124,7 +127,7 @@ gimp_color_scale_size_allocate (GtkWidget *widget,
"trough-border", &trough_border,
NULL);
if (GTK_WIDGET_CAN_FOCUS (widget))
if (gtk_widget_get_can_focus (widget))
{
gint focus_padding = 0;
@ -175,7 +178,7 @@ static void
gimp_color_scale_state_changed (GtkWidget *widget,
GtkStateType previous_state)
{
if (widget->state == GTK_STATE_INSENSITIVE ||
if (gtk_widget_get_state (widget) == GTK_STATE_INSENSITIVE ||
previous_state == GTK_STATE_INSENSITIVE)
{
GIMP_COLOR_SCALE (widget)->needs_render = TRUE;
@ -239,6 +242,7 @@ gimp_color_scale_expose (GtkWidget *widget,
GtkRange *range = GTK_RANGE (widget);
GtkStyle *style = gtk_widget_get_style (widget);
GdkWindow *window = gtk_widget_get_window (widget);
GtkAllocation allocation;
GdkRectangle expose_area; /* Relative to widget->allocation */
GdkRectangle area;
gint focus = 0;
@ -247,7 +251,7 @@ gimp_color_scale_expose (GtkWidget *widget,
gint x, y;
gint w, h;
if (! scale->buf || ! GTK_WIDGET_DRAWABLE (widget))
if (! scale->buf || ! gtk_widget_is_drawable (widget))
return FALSE;
/* This is ugly as it relies heavily on GTK+ internals, but I see no
@ -266,7 +270,7 @@ gimp_color_scale_expose (GtkWidget *widget,
"trough-border", &trough_border,
NULL);
if (GTK_WIDGET_CAN_FOCUS (widget))
if (gtk_widget_get_can_focus (widget))
{
gint focus_padding = 0;
@ -277,20 +281,22 @@ gimp_color_scale_expose (GtkWidget *widget,
focus += focus_padding;
}
x = widget->allocation.x + range->range_rect.x + focus;
y = widget->allocation.y + range->range_rect.y + focus;
gtk_widget_get_allocation (widget, &allocation);
x = allocation.x + range->range_rect.x + focus;
y = allocation.y + range->range_rect.y + focus;
w = range->range_rect.width - 2 * focus;
h = range->range_rect.height - 2 * focus;
slider_size = range->min_slider_size / 2;
expose_area = event->area;
expose_area.x -= widget->allocation.x;
expose_area.y -= widget->allocation.y;
expose_area.x -= allocation.x;
expose_area.y -= allocation.y;
if (gdk_rectangle_intersect (&expose_area, &range->range_rect, &area))
{
gboolean sensitive = (GTK_WIDGET_STATE (widget) != GTK_STATE_INSENSITIVE);
gboolean sensitive = gtk_widget_is_sensitive (widget);
if (scale->needs_render)
{
@ -302,8 +308,8 @@ gimp_color_scale_expose (GtkWidget *widget,
scale->needs_render = FALSE;
}
area.x += widget->allocation.x;
area.y += widget->allocation.y;
area.x += allocation.x;
area.y += allocation.y;
gtk_paint_box (style, window,
sensitive ? GTK_STATE_ACTIVE : GTK_STATE_INSENSITIVE,
@ -345,18 +351,18 @@ gimp_color_scale_expose (GtkWidget *widget,
gdk_gc_set_clip_rectangle (style->black_gc, NULL);
}
if (GTK_WIDGET_IS_SENSITIVE (widget) && GTK_WIDGET_HAS_FOCUS (range))
gtk_paint_focus (style, window, GTK_WIDGET_STATE (widget),
if (gtk_widget_has_focus (widget))
gtk_paint_focus (style, window, gtk_widget_get_state (widget),
&area, widget, "trough",
widget->allocation.x + range->range_rect.x,
widget->allocation.y + range->range_rect.y,
allocation.x + range->range_rect.x,
allocation.y + range->range_rect.y,
range->range_rect.width,
range->range_rect.height);
switch (gtk_orientable_get_orientation (GTK_ORIENTABLE (range)))
{
case GTK_ORIENTATION_HORIZONTAL:
area.x = widget->allocation.x + range->slider_start;
area.x = allocation.x + range->slider_start;
area.y = y + trough_border;
area.width = 2 * slider_size + 1;
area.height = h - 2 * trough_border;
@ -364,7 +370,7 @@ gimp_color_scale_expose (GtkWidget *widget,
case GTK_ORIENTATION_VERTICAL:
area.x = x + trough_border;
area.y = widget->allocation.y + range->slider_start;
area.y = allocation.y + range->slider_start;
area.width = w - 2 * trough_border;
area.height = 2 * slider_size + 1;
break;
@ -374,7 +380,7 @@ gimp_color_scale_expose (GtkWidget *widget,
{
GdkGC *gc;
gc = (GTK_WIDGET_IS_SENSITIVE (widget) ?
gc = (gtk_widget_is_sensitive (widget) ?
style->black_gc :
style->dark_gc[GTK_STATE_INSENSITIVE]);
@ -396,7 +402,7 @@ gimp_color_scale_expose (GtkWidget *widget,
gdk_gc_set_clip_rectangle (gc, NULL);
gc = (GTK_WIDGET_IS_SENSITIVE (widget) ?
gc = (gtk_widget_is_sensitive (widget) ?
style->white_gc :
style->light_gc[GTK_STATE_INSENSITIVE]);
@ -441,7 +447,8 @@ gimp_color_scale_new (GtkOrientation orientation,
scale->channel = channel;
GTK_RANGE (scale)->flippable = (orientation == GTK_ORIENTATION_HORIZONTAL);
gtk_range_set_flippable (GTK_RANGE (scale),
orientation == GTK_ORIENTATION_HORIZONTAL);
return GTK_WIDGET (scale);
}
@ -496,16 +503,23 @@ gimp_color_scale_set_color (GimpColorScale *scale,
static gboolean
should_invert (GtkRange *range)
{
gboolean inverted = gtk_range_get_inverted (range);
gboolean flippable = gtk_range_get_flippable (range);
if (gtk_orientable_get_orientation (GTK_ORIENTABLE (range)) ==
GTK_ORIENTATION_HORIZONTAL)
return
(range->inverted && !range->flippable) ||
(range->inverted && range->flippable &&
gtk_widget_get_direction (GTK_WIDGET (range)) == GTK_TEXT_DIR_LTR) ||
(!range->inverted && range->flippable &&
gtk_widget_get_direction (GTK_WIDGET (range)) == GTK_TEXT_DIR_RTL);
{
return
(inverted && !flippable) ||
(inverted && flippable &&
gtk_widget_get_direction (GTK_WIDGET (range)) == GTK_TEXT_DIR_LTR) ||
(!inverted && flippable &&
gtk_widget_get_direction (GTK_WIDGET (range)) == GTK_TEXT_DIR_RTL);
}
else
return range->inverted;
{
return inverted;
}
}
static void

View File

@ -207,12 +207,7 @@ gimp_color_scales_togg_visible (GimpColorSelector *selector,
gint i;
for (i = 0; i < 6; i++)
{
if (visible)
gtk_widget_show (scales->toggles[i]);
else
gtk_widget_hide (scales->toggles[i]);
}
gtk_widget_set_visible (scales->toggles[i], visible);
}
static void
@ -236,18 +231,9 @@ gimp_color_scales_set_show_alpha (GimpColorSelector *selector,
show_alpha ? 3 : 0);
}
if (show_alpha)
{
gtk_widget_show (label);
gtk_widget_show (scale);
gtk_widget_show (spin);
}
else
{
gtk_widget_hide (label);
gtk_widget_hide (scale);
gtk_widget_hide (spin);
}
gtk_widget_set_visible (label, show_alpha);
gtk_widget_set_visible (scale, show_alpha);
gtk_widget_set_visible (spin, show_alpha);
}
static void

View File

@ -373,10 +373,7 @@ gimp_color_select_togg_visible (GimpColorSelector *selector,
{
GimpColorSelect *select = GIMP_COLOR_SELECT (selector);
if (visible)
gtk_widget_show (select->toggle_box);
else
gtk_widget_hide (select->toggle_box);
gtk_widget_set_visible (select->toggle_box, visible);
}
static void
@ -646,8 +643,8 @@ gimp_color_select_xy_events (GtkWidget *widget,
GdkEvent *event,
GimpColorSelect *select)
{
gint width, height;
gint x, y;
GtkAllocation allocation;
gint x, y;
switch (event->type)
{
@ -704,13 +701,12 @@ gimp_color_select_xy_events (GtkWidget *widget,
gimp_color_select_draw_xy_marker (select, NULL);
width = select->xy_color->allocation.width;
height = select->xy_color->allocation.height;
gtk_widget_get_allocation (select->xy_color, &allocation);
if (width > 1 && height > 1)
if (allocation.width > 1 && allocation.height > 1)
{
select->pos[0] = (x * 255) / (width - 1);
select->pos[1] = 255 - (y * 255) / (height - 1);
select->pos[0] = (x * 255) / (allocation.width - 1);
select->pos[1] = 255 - (y * 255) / (allocation.height - 1);
}
select->pos[0] = CLAMP (select->pos[0], 0, 255);
@ -752,8 +748,8 @@ gimp_color_select_z_events (GtkWidget *widget,
GdkEvent *event,
GimpColorSelect *select)
{
gint height;
gint z;
GtkAllocation allocation;
gint z;
switch (event->type)
{
@ -807,10 +803,10 @@ gimp_color_select_z_events (GtkWidget *widget,
gimp_color_select_draw_z_marker (select, NULL);
height = select->z_color->allocation.height;
gtk_widget_get_allocation (select->z_color, &allocation);
if (height > 1)
select->pos[2] = 255 - (z * 255) / (height - 1);
if (allocation.height > 1)
select->pos[2] = 255 - (z * 255) / (allocation.height - 1);
select->pos[2] = CLAMP (select->pos[2], 0, 255);
@ -830,12 +826,15 @@ gimp_color_select_image_fill (GtkWidget *preview,
const GimpHSV *hsv,
const GimpRGB *rgb)
{
GtkAllocation allocation;
ColorSelectFill csf;
gtk_widget_get_allocation (preview, &allocation);
csf.update = update_procs[fill_type];
csf.width = preview->allocation.width;
csf.height = preview->allocation.height;
csf.width = allocation.width;
csf.height = allocation.height;
csf.hsv = *hsv;
csf.rgb = *rgb;
@ -859,17 +858,20 @@ static void
gimp_color_select_draw_z_marker (GimpColorSelect *select,
GdkRectangle *clip)
{
gint width;
gint height;
gint y;
gint minx;
gint miny;
GtkAllocation allocation;
gint width;
gint height;
gint y;
gint minx;
gint miny;
if (! select->gc)
return;
width = select->z_color->allocation.width;
height = select->z_color->allocation.height;
gtk_widget_get_allocation (select->z_color, &allocation);
width = allocation.width;
height = allocation.height;
if (width < 1 || height < 1)
return;
@ -900,16 +902,19 @@ static void
gimp_color_select_draw_xy_marker (GimpColorSelect *select,
GdkRectangle *clip)
{
gint width;
gint height;
gint x, y;
gint minx, miny;
GtkAllocation allocation;
gint width;
gint height;
gint x, y;
gint minx, miny;
if (! select->gc)
return;
width = select->xy_color->allocation.width;
height = select->xy_color->allocation.height;
gtk_widget_get_allocation (select->xy_color, &allocation);
width = allocation.width;
height = allocation.height;
if (width < 1 || height < 1)
return;

View File

@ -23,6 +23,8 @@
#include <string.h>
#undef GSEAL_ENABLE
#include <gtk/gtk.h>
#include "gimpwidgetstypes.h"
@ -103,7 +105,7 @@ gimp_frame_size_request (GtkWidget *widget,
GtkRequisition child_requisition;
gint border_width;
if (label_widget && GTK_WIDGET_VISIBLE (label_widget))
if (label_widget && gtk_widget_get_visible (label_widget))
{
gtk_widget_size_request (label_widget, requisition);
}
@ -115,7 +117,7 @@ gimp_frame_size_request (GtkWidget *widget,
requisition->height += gimp_frame_get_label_spacing (frame);
if (child && GTK_WIDGET_VISIBLE (child))
if (child && gtk_widget_get_visible (child))
{
gint indent = gimp_frame_get_indent (widget);
@ -140,14 +142,14 @@ gimp_frame_size_allocate (GtkWidget *widget,
GtkWidget *label_widget = gtk_frame_get_label_widget (frame);
GtkWidget *child = gtk_bin_get_child (GTK_BIN (widget));
widget->allocation = *allocation;
gtk_widget_set_allocation (widget, allocation);
gimp_frame_child_allocate (frame, &frame->child_allocation);
if (child && GTK_WIDGET_VISIBLE (child))
if (child && gtk_widget_get_visible (child))
gtk_widget_size_allocate (child, &frame->child_allocation);
if (label_widget && GTK_WIDGET_VISIBLE (label_widget))
if (label_widget && gtk_widget_get_visible (label_widget))
{
GtkAllocation label_allocation;
GtkRequisition label_requisition;
@ -173,14 +175,16 @@ gimp_frame_child_allocate (GtkFrame *frame,
{
GtkWidget *widget = GTK_WIDGET (frame);
GtkWidget *label_widget = gtk_frame_get_label_widget (frame);
GtkAllocation *allocation = &widget->allocation;
GtkAllocation allocation;
gint border_width;
gint spacing = 0;
gint indent = gimp_frame_get_indent (widget);
gtk_widget_get_allocation (widget, &allocation);
border_width = gtk_container_get_border_width (GTK_CONTAINER (frame));
if (label_widget && GTK_WIDGET_VISIBLE (label_widget))
if (label_widget && gtk_widget_get_visible (label_widget))
{
GtkRequisition child_requisition;
@ -197,13 +201,13 @@ gimp_frame_child_allocate (GtkFrame *frame,
child_allocation->y = border_width + spacing;
child_allocation->width = MAX (1,
allocation->width - 2 * border_width - indent);
allocation.width - 2 * border_width - indent);
child_allocation->height = MAX (1,
allocation->height -
allocation.height -
child_allocation->y - border_width);
child_allocation->x += allocation->x;
child_allocation->y += allocation->y;
child_allocation->x += allocation.x;
child_allocation->y += allocation.y;
}
static void
@ -221,7 +225,7 @@ static gboolean
gimp_frame_expose_event (GtkWidget *widget,
GdkEventExpose *event)
{
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
GtkWidgetClass *widget_class = g_type_class_peek_parent (parent_class);
@ -307,7 +311,7 @@ gimp_frame_get_label_spacing (GtkFrame *frame)
GtkWidget *label_widget = gtk_frame_get_label_widget (frame);
gint spacing = 0;
if ((label_widget && GTK_WIDGET_VISIBLE (label_widget)) ||
if ((label_widget && gtk_widget_get_visible (label_widget)) ||
(g_object_get_data (G_OBJECT (frame), GIMP_FRAME_IN_EXPANDER_KEY)))
{
gtk_widget_style_get (GTK_WIDGET (frame),

View File

@ -391,10 +391,13 @@ gimp_offset_area_expose_event (GtkWidget *widget,
GimpOffsetArea *area = GIMP_OFFSET_AREA (widget);
GtkStyle *style = gtk_widget_get_style (widget);
GdkWindow *window = gtk_widget_get_window (widget);
GtkAllocation allocation;
GdkPixbuf *pixbuf;
gint w, h;
gint x, y;
gtk_widget_get_allocation (widget, &allocation);
x = (area->display_ratio_x *
((area->orig_width <= area->width) ?
area->offset_x :
@ -438,7 +441,7 @@ gimp_offset_area_expose_event (GtkWidget *widget,
else
{
x = -1;
w = widget->allocation.width + 2;
w = allocation.width + 2;
}
if (area->orig_height > area->height)
@ -449,7 +452,7 @@ gimp_offset_area_expose_event (GtkWidget *widget,
else
{
y = -1;
h = widget->allocation.height + 2;
h = allocation.height + 2;
}
w = MAX (w, 1);

View File

@ -384,14 +384,15 @@ void
gimp_option_menu_set_history (GtkOptionMenu *option_menu,
gpointer item_data)
{
GList *children;
GList *list;
gint history = 0;
g_return_if_fail (GTK_IS_OPTION_MENU (option_menu));
for (list = GTK_MENU_SHELL (option_menu->menu)->children;
list;
list = g_list_next (list))
children = gtk_container_get_children (GTK_CONTAINER (option_menu->menu));
for (list = children; list; list = g_list_next (list))
{
GtkWidget *menu_item = GTK_WIDGET (list->data);
@ -407,6 +408,8 @@ gimp_option_menu_set_history (GtkOptionMenu *option_menu,
if (list)
gtk_option_menu_set_history (option_menu, history);
g_list_free (children);
}
/**
@ -446,14 +449,15 @@ gimp_option_menu_set_sensitive (GtkOptionMenu *option_menu,
GimpOptionMenuSensitivityCallback callback,
gpointer callback_data)
{
GList *children;
GList *list;
g_return_if_fail (GTK_IS_OPTION_MENU (option_menu));
g_return_if_fail (callback != NULL);
for (list = GTK_MENU_SHELL (option_menu->menu)->children;
list;
list = g_list_next (list))
children = gtk_container_get_children (GTK_CONTAINER (option_menu->menu));
for (list = children; list; list = g_list_next (list))
{
GtkWidget *menu_item = GTK_WIDGET (list->data);
@ -468,6 +472,8 @@ gimp_option_menu_set_sensitive (GtkOptionMenu *option_menu,
gtk_widget_set_sensitive (menu_item, sensitive);
}
}
g_list_free (children);
}
/**
@ -489,14 +495,15 @@ gimp_int_option_menu_set_sensitive (GtkOptionMenu *option
GimpIntOptionMenuSensitivityCallback callback,
gpointer callback_data)
{
GList *children;
GList *list;
g_return_if_fail (GTK_IS_OPTION_MENU (option_menu));
g_return_if_fail (callback != NULL);
for (list = GTK_MENU_SHELL (option_menu->menu)->children;
list;
list = g_list_next (list))
children = gtk_container_get_children (GTK_CONTAINER (option_menu->menu));
for (list = children; list; list = g_list_next (list))
{
GtkWidget *menu_item = GTK_WIDGET (list->data);
@ -511,6 +518,8 @@ gimp_int_option_menu_set_sensitive (GtkOptionMenu *option
gtk_widget_set_sensitive (menu_item, sensitive);
}
}
g_list_free (children);
}

View File

@ -21,6 +21,8 @@
#include "config.h"
#undef GSEAL_ENABLE
#include <stdio.h>
#include <gtk/gtk.h>
@ -102,10 +104,12 @@ gimp_pixmap_set (GimpPixmap *pixmap,
}
else
{
GTK_WIDGET (pixmap)->requisition.width =
width + GTK_MISC (pixmap)->xpad * 2;
GTK_WIDGET (pixmap)->requisition.height =
height + GTK_MISC (pixmap)->ypad * 2;
gint xpad, ypad;
gtk_misc_get_padding (GTK_MISC (pixmap), &xpad, &ypad);
GTK_WIDGET (pixmap)->requisition.width = width + xpad * 2;
GTK_WIDGET (pixmap)->requisition.height = height + ypad * 2;
}
}
}

View File

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

View File

@ -220,14 +220,17 @@ gimp_preview_area_expose (GtkWidget *widget,
GdkEventExpose *event)
{
GimpPreviewArea *area = GIMP_PREVIEW_AREA (widget);
GtkAllocation allocation;
GdkRectangle rect;
GdkRectangle render;
if (! area->buf)
return FALSE;
rect.x = (widget->allocation.width - area->width) / 2;
rect.y = (widget->allocation.height - area->height) / 2;
gtk_widget_get_allocation (widget, &allocation);
rect.x = (allocation.width - area->width) / 2;
rect.y = (allocation.height - area->height) / 2;
rect.width = area->width;
rect.height = area->height;
@ -239,7 +242,7 @@ gimp_preview_area_expose (GtkWidget *widget,
guchar *buf = area->buf + x * 3 + y * area->rowstride;
gdk_draw_rgb_image_dithalign (gtk_widget_get_window (widget),
style->fg_gc[widget->state],
style->fg_gc[gtk_widget_get_state (widget)],
render.x,
render.y,
render.width,
@ -261,10 +264,13 @@ gimp_preview_area_queue_draw (GimpPreviewArea *area,
gint width,
gint height)
{
GtkWidget *widget = GTK_WIDGET (area);
GtkWidget *widget = GTK_WIDGET (area);
GtkAllocation allocation;
x += (widget->allocation.width - area->width) / 2;
y += (widget->allocation.height - area->height) / 2;
gtk_widget_get_allocation (widget, &allocation);
x += (allocation.width - area->width) / 2;
y += (allocation.height - area->height) / 2;
gtk_widget_queue_draw_area (widget, x, y, width, height);
}

View File

@ -20,6 +20,8 @@
#include <string.h>
#undef GSEAL_ENABLE
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"
@ -496,16 +498,19 @@ static void
gimp_ruler_realize (GtkWidget *widget)
{
GimpRuler *ruler = GIMP_RULER (widget);
GtkAllocation allocation;
GdkWindowAttr attributes;
gint attributes_mask;
GTK_WIDGET_SET_FLAGS (ruler, GTK_REALIZED);
gtk_widget_get_allocation (widget, &allocation);
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x;
attributes.y = widget->allocation.y;
attributes.width = widget->allocation.width;
attributes.height = widget->allocation.height;
attributes.x = allocation.x;
attributes.y = allocation.y;
attributes.width = allocation.width;
attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.colormap = gtk_widget_get_colormap (widget);
@ -516,12 +521,15 @@ gimp_ruler_realize (GtkWidget *widget)
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);
gdk_window_set_user_data (widget->window, ruler);
gtk_widget_set_window (widget,
gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask));
gdk_window_set_user_data (gtk_widget_get_window (widget), ruler);
widget->style = gtk_style_attach (widget->style, widget->window);
gtk_style_set_background (gtk_widget_get_style (widget), widget->window,
widget->style = gtk_style_attach (gtk_widget_get_style (widget),
gtk_widget_get_window (widget));
gtk_style_set_background (gtk_widget_get_style (widget),
gtk_widget_get_window (widget),
GTK_STATE_ACTIVE);
gimp_ruler_make_pixmap (ruler);
@ -560,7 +568,7 @@ gimp_ruler_size_allocate (GtkWidget *widget,
{
GimpRuler *ruler = GIMP_RULER (widget);
widget->allocation = *allocation;
gtk_widget_set_allocation (widget, allocation);
if (GTK_WIDGET_REALIZED (widget))
{
@ -624,11 +632,13 @@ gimp_ruler_motion_notify (GtkWidget *widget,
{
GimpRuler *ruler = GIMP_RULER (widget);
GimpRulerPrivate *priv = GIMP_RULER_GET_PRIVATE (ruler);
GtkAllocation allocation;
gdouble lower;
gdouble upper;
gdk_event_request_motions (event);
gtk_widget_get_allocation (widget, &allocation);
gimp_ruler_get_range (ruler, &lower, &upper, NULL);
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
@ -636,14 +646,14 @@ gimp_ruler_motion_notify (GtkWidget *widget,
gimp_ruler_set_position (ruler,
lower +
(upper - lower) * event->x /
widget->allocation.width);
allocation.width);
}
else
{
gimp_ruler_set_position (ruler,
lower +
(upper - lower) * event->y /
widget->allocation.height);
allocation.height);
}
return FALSE;
@ -653,10 +663,13 @@ static gboolean
gimp_ruler_expose (GtkWidget *widget,
GdkEventExpose *event)
{
if (GTK_WIDGET_DRAWABLE (widget))
if (gtk_widget_is_drawable (widget))
{
GimpRuler *ruler = GIMP_RULER (widget);
GimpRulerPrivate *priv = GIMP_RULER_GET_PRIVATE (ruler);
GtkAllocation allocation;
gtk_widget_get_allocation (widget, &allocation);
gimp_ruler_draw_ticks (ruler);
@ -664,8 +677,8 @@ gimp_ruler_expose (GtkWidget *widget,
priv->non_gr_exp_gc,
priv->backing_store,
0, 0, 0, 0,
widget->allocation.width,
widget->allocation.height);
allocation.width,
allocation.height);
gimp_ruler_draw_pos (ruler);
}
@ -679,6 +692,8 @@ gimp_ruler_draw_ticks (GimpRuler *ruler)
GtkWidget *widget = GTK_WIDGET (ruler);
GtkStyle *style = gtk_widget_get_style (widget);
GimpRulerPrivate *priv = GIMP_RULER_GET_PRIVATE (ruler);
GtkStateType state = gtk_widget_get_state (widget);
GtkAllocation allocation;
cairo_t *cr;
gint i;
gint width, height;
@ -699,9 +714,11 @@ gimp_ruler_draw_ticks (GimpRuler *ruler)
PangoLayout *layout;
PangoRectangle logical_rect, ink_rect;
if (! GTK_WIDGET_DRAWABLE (widget))
if (! gtk_widget_is_drawable (widget))
return;
gtk_widget_get_allocation (widget, &allocation);
xthickness = style->xthickness;
ythickness = style->ythickness;
@ -713,13 +730,13 @@ gimp_ruler_draw_ticks (GimpRuler *ruler)
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
{
width = widget->allocation.width;
height = widget->allocation.height - ythickness * 2;
width = allocation.width;
height = allocation.height - ythickness * 2;
}
else
{
width = widget->allocation.height;
height = widget->allocation.width - ythickness * 2;
width = allocation.height;
height = allocation.width - ythickness * 2;
}
gtk_paint_box (style, priv->backing_store,
@ -728,17 +745,17 @@ gimp_ruler_draw_ticks (GimpRuler *ruler)
priv->orientation == GTK_ORIENTATION_HORIZONTAL ?
"hruler" : "vruler",
0, 0,
widget->allocation.width, widget->allocation.height);
allocation.width, allocation.height);
cr = gdk_cairo_create (priv->backing_store);
gdk_cairo_set_source_color (cr, &style->fg[widget->state]);
gdk_cairo_set_source_color (cr, &style->fg[state]);
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
{
cairo_rectangle (cr,
xthickness,
height + ythickness,
widget->allocation.width - 2 * xthickness,
allocation.width - 2 * xthickness,
1);
}
else
@ -747,7 +764,7 @@ gimp_ruler_draw_ticks (GimpRuler *ruler)
height + xthickness,
ythickness,
1,
widget->allocation.height - 2 * ythickness);
allocation.height - 2 * ythickness);
}
gimp_ruler_get_range (ruler, &lower, &upper, &max_size);
@ -847,7 +864,7 @@ gimp_ruler_draw_ticks (GimpRuler *ruler)
gtk_paint_layout (style,
priv->backing_store,
GTK_WIDGET_STATE (widget),
state,
FALSE,
NULL,
widget,
@ -867,7 +884,7 @@ gimp_ruler_draw_ticks (GimpRuler *ruler)
gtk_paint_layout (style,
priv->backing_store,
GTK_WIDGET_STATE (widget),
state,
FALSE,
NULL,
widget,
@ -892,22 +909,26 @@ gimp_ruler_draw_pos (GimpRuler *ruler)
GtkWidget *widget = GTK_WIDGET (ruler);
GtkStyle *style = gtk_widget_get_style (widget);
GimpRulerPrivate *priv = GIMP_RULER_GET_PRIVATE (ruler);
GtkStateType state = gtk_widget_get_state (widget);
GtkAllocation allocation;
gint x, y;
gint width, height;
gint bs_width, bs_height;
gint xthickness;
gint ythickness;
if (! GTK_WIDGET_DRAWABLE (ruler))
if (! gtk_widget_is_drawable (widget))
return;
gtk_widget_get_allocation (widget, &allocation);
xthickness = style->xthickness;
ythickness = style->ythickness;
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
{
width = widget->allocation.width;
height = widget->allocation.height - ythickness * 2;
width = allocation.width;
height = allocation.height - ythickness * 2;
bs_width = height / 2 + 2;
bs_width |= 1; /* make sure it's odd */
@ -915,8 +936,8 @@ gimp_ruler_draw_pos (GimpRuler *ruler)
}
else
{
width = widget->allocation.width - xthickness * 2;
height = widget->allocation.height;
width = allocation.width - xthickness * 2;
height = allocation.height;
bs_height = width / 2 + 2;
bs_height |= 1; /* make sure it's odd */
@ -959,7 +980,7 @@ gimp_ruler_draw_pos (GimpRuler *ruler)
y = ROUND ((position - lower) * increment) + (ythickness - bs_height) / 2 - 1;
}
gdk_cairo_set_source_color (cr, &style->fg[widget->state]);
gdk_cairo_set_source_color (cr, &style->fg[state]);
cairo_move_to (cr, x, y);
@ -988,22 +1009,25 @@ gimp_ruler_make_pixmap (GimpRuler *ruler)
{
GtkWidget *widget = GTK_WIDGET (ruler);
GimpRulerPrivate *priv = GIMP_RULER_GET_PRIVATE (ruler);
GtkAllocation allocation;
gint width;
gint height;
gtk_widget_get_allocation (widget, &allocation);
if (priv->backing_store)
{
gdk_drawable_get_size (priv->backing_store, &width, &height);
if ((width == widget->allocation.width) &&
(height == widget->allocation.height))
if ((width == allocation.width) &&
(height == allocation.height))
return;
g_object_unref (priv->backing_store);
}
priv->backing_store = gdk_pixmap_new (gtk_widget_get_window (widget),
widget->allocation.width,
widget->allocation.height,
allocation.width,
allocation.height,
-1);
if (!priv->non_gr_exp_gc)

View File

@ -20,6 +20,8 @@
#include "config.h"
#undef GSEAL_ENABLE
#include <gtk/gtk.h>
#include "libgimpmath/gimpmath.h"
@ -306,10 +308,8 @@ gimp_scrolled_preview_area_size_allocate (GtkWidget *widget,
switch (priv->hscr_policy)
{
case GTK_POLICY_AUTOMATIC:
if (width > GIMP_PREVIEW (preview)->width)
gtk_widget_show (preview->hscr);
else
gtk_widget_hide (preview->hscr);
gtk_widget_set_visible (preview->hscr,
width > GIMP_PREVIEW (preview)->width);
break;
case GTK_POLICY_ALWAYS:
@ -326,10 +326,8 @@ gimp_scrolled_preview_area_size_allocate (GtkWidget *widget,
switch (priv->vscr_policy)
{
case GTK_POLICY_AUTOMATIC:
if (height > GIMP_PREVIEW (preview)->height)
gtk_widget_show (preview->vscr);
else
gtk_widget_hide (preview->vscr);
gtk_widget_set_visible (preview->vscr,
height > GIMP_PREVIEW (preview)->height);
break;
case GTK_POLICY_ALWAYS:
@ -341,16 +339,10 @@ gimp_scrolled_preview_area_size_allocate (GtkWidget *widget,
break;
}
if (GTK_WIDGET_VISIBLE (preview->vscr) &&
GTK_WIDGET_VISIBLE (preview->hscr) &&
GIMP_PREVIEW_GET_CLASS (preview)->draw_thumb)
{
gtk_widget_show (preview->nav_icon);
}
else
{
gtk_widget_hide (preview->nav_icon);
}
gtk_widget_set_visible (preview->nav_icon,
GTK_WIDGET_VISIBLE (preview->vscr) &&
GTK_WIDGET_VISIBLE (preview->hscr) &&
GIMP_PREVIEW_GET_CLASS (preview)->draw_thumb);
gimp_scrolled_preview_thaw (preview);
}
@ -674,18 +666,21 @@ gimp_scrolled_preview_nav_popup_event (GtkWidget *widget,
GdkEventMotion *mevent = (GdkEventMotion *) event;
GtkAdjustment *hadj;
GtkAdjustment *vadj;
GtkAllocation allocation;
gint cx, cy;
gdouble x, y;
hadj = gtk_range_get_adjustment (GTK_RANGE (preview->hscr));
vadj = gtk_range_get_adjustment (GTK_RANGE (preview->vscr));
gtk_widget_get_allocation (widget, &allocation);
gtk_widget_get_pointer (widget, &cx, &cy);
x = cx * (gtk_adjustment_get_upper (hadj) -
gtk_adjustment_get_lower (hadj)) / widget->allocation.width;
gtk_adjustment_get_lower (hadj)) / allocation.width;
y = cy * (gtk_adjustment_get_upper (vadj) -
gtk_adjustment_get_lower (vadj)) / widget->allocation.height;
gtk_adjustment_get_lower (vadj)) / allocation.height;
x += (gtk_adjustment_get_lower (hadj) -
gtk_adjustment_get_page_size (hadj) / 2);
@ -723,11 +718,14 @@ gimp_scrolled_preview_nav_popup_expose (GtkWidget *widget,
GimpScrolledPreview *preview)
{
GtkAdjustment *adj;
GtkAllocation allocation;
cairo_t *cr;
gdouble x, y;
gdouble w, h;
adj = gtk_range_get_adjustment (GTK_RANGE (preview->hscr));
adj = gtk_range_get_adjustment (GTK_RANGE (preview->hscr));
gtk_widget_get_allocation (widget, &allocation);
x = (gtk_adjustment_get_value (adj) /
(gtk_adjustment_get_upper (adj) -
@ -748,10 +746,10 @@ gimp_scrolled_preview_nav_popup_expose (GtkWidget *widget,
if (w >= 1.0 && h >= 1.0)
return FALSE;
x = floor (x * (gdouble) widget->allocation.width);
y = floor (y * (gdouble) widget->allocation.height);
w = MAX (1, ceil (w * (gdouble) widget->allocation.width));
h = MAX (1, ceil (h * (gdouble) widget->allocation.height));
x = floor (x * (gdouble) allocation.width);
y = floor (y * (gdouble) allocation.height);
w = MAX (1, ceil (w * (gdouble) allocation.width));
h = MAX (1, ceil (h * (gdouble) allocation.height));
cr = gdk_cairo_create (gtk_widget_get_window (widget));
@ -759,7 +757,7 @@ gimp_scrolled_preview_nav_popup_expose (GtkWidget *widget,
cairo_clip (cr);
cairo_rectangle (cr,
0, 0, widget->allocation.width, widget->allocation.height);
0, 0, allocation.width, allocation.height);
cairo_rectangle (cr, x, y, w, h);

View File

@ -24,6 +24,8 @@
#include <string.h>
#undef GSEAL_ENABLE
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"
@ -472,20 +474,30 @@ gimp_size_entry_attach_label (GimpSizeEntry *gse,
if (column == 0)
{
GtkTableChild *child;
GList *list;
GList *children;
GList *list;
for (list = GTK_TABLE (gse)->children; list; list = g_list_next (list))
children = gtk_container_get_children (GTK_CONTAINER (gse));
for (list = children; list; list = g_list_next (list))
{
child = (GtkTableChild *) list->data;
GtkWidget *child = list->data;
gint left_attach;
gint top_attach;
if (child->left_attach == 1 && child->top_attach == row)
gtk_container_child_get (GTK_CONTAINER (gse), child,
"left-attach", &left_attach,
"top-attach", &top_attach,
NULL);
if (left_attach == 1 && top_attach == row)
{
gtk_label_set_mnemonic_widget (GTK_LABEL (label),
child->widget);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), child);
break;
}
}
g_list_free (children);
}
gtk_misc_set_alignment (GTK_MISC (label), alignment, 0.5);
@ -798,7 +810,7 @@ gimp_size_entry_value_callback (GtkWidget *widget,
gsef = (GimpSizeEntryField *) data;
new_value = GTK_ADJUSTMENT (widget)->value;
new_value = gtk_adjustment_get_value (GTK_ADJUSTMENT (widget));
if (gsef->value != new_value)
gimp_size_entry_update_value (gsef, new_value);
@ -1054,7 +1066,7 @@ gimp_size_entry_refval_callback (GtkWidget *widget,
gsef = (GimpSizeEntryField *) data;
new_refval = GTK_ADJUSTMENT (widget)->value;
new_refval = gtk_adjustment_get_value (GTK_ADJUSTMENT (widget));
if (gsef->refval != new_refval)
gimp_size_entry_update_refval (gsef, new_refval);
@ -1343,10 +1355,7 @@ gimp_size_entry_show_unit_menu (GimpSizeEntry *gse,
{
g_return_if_fail (GIMP_IS_SIZE_ENTRY (gse));
if (show)
gtk_widget_show (gse->unitmenu);
else
gtk_widget_hide (gse->unitmenu);
gtk_widget_set_visible (gse->unitmenu, show);
}

Some files were not shown because too many files have changed in this diff Show More