Commit 210a4b50 authored by Alexia Death's avatar Alexia Death

Merge resolution

parents 4e018eaa 7ce6757a
......@@ -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/.
......
......@@ -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)
......
......@@ -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");
......
......@@ -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)
{
......
......@@ -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;
}
......
......@@ -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);
......
......@@ -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
......
......@@ -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);
}
......@@ -19,6 +19,8 @@
#include <string.h>
#undef GSEAL_ENABLE
#include <gtk/gtk.h>
#include "libgimpmath/gimpmath.h"
......
......@@ -17,6 +17,8 @@
#include "config.h"
#undef GSEAL_ENABLE
#include <gtk/gtk.h>
#include "libgimpmath/gimpmath.h"
......
......@@ -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);
}
......
......@@ -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));
......
......@@ -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_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_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, show ? 1 : 0);
gtk_box_set_spacing (vbox, show ? 1 : 0);
appearance_set_action_active (shell, "view-show-scrollbars", show);
}
......
......@@ -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);
......
......@@ -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;
......
......@@ -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);
......
......@@ -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;