[gimp] Build with GSEAL_ENABLE and #undef it where accessors are missing
- From: Michael Natterer <mitch src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gimp] Build with GSEAL_ENABLE and #undef it where accessors are missing
- Date: Sat, 17 Oct 2009 18:32:25 +0000 (UTC)
commit 018e8b0d29d9733c3bff1a9d6a7b79e7cde6ccb9
Author: Michael Natterer <mitch gimp org>
Date: Sat Oct 17 20:31:57 2009 +0200
Build with GSEAL_ENABLE and #undef it where accessors are missing
plug-ins/common/animation-play.c | 2 +
plug-ins/common/curve-bend.c | 2 +-
plug-ins/common/file-png.c | 2 +-
plug-ins/common/filter-pack.c | 10 +-
plug-ins/common/gee-zoom.c | 2 +-
plug-ins/common/gee.c | 2 +-
plug-ins/common/iwarp.c | 17 +-
plug-ins/flame/flame.c | 4 +-
plug-ins/help-browser/dialog.c | 4 +-
plug-ins/ifs-compose/ifs-compose.c | 276 +++++++++++++++++-------------
plug-ins/imagemap/imap_edit_area_info.c | 62 ++++---
plug-ins/imagemap/imap_grid.c | 9 +-
plug-ins/imagemap/imap_preview.c | 2 +-
plug-ins/imagemap/imap_settings.c | 4 +-
plug-ins/imagemap/imap_statusbar.c | 4 +-
plug-ins/print/print-preview.c | 77 +++++----
plug-ins/pygimp/gimpui.override | 4 +-
plug-ins/script-fu/script-fu-console.c | 2 +
plug-ins/script-fu/script-fu-interface.c | 9 +-
19 files changed, 278 insertions(+), 216 deletions(-)
---
diff --git a/plug-ins/common/animation-play.c b/plug-ins/common/animation-play.c
index aca9e16..2bb7fbb 100644
--- a/plug-ins/common/animation-play.c
+++ b/plug-ins/common/animation-play.c
@@ -34,6 +34,8 @@
#include <string.h>
+#undef GSEAL_ENABLE
+
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
diff --git a/plug-ins/common/curve-bend.c b/plug-ins/common/curve-bend.c
index 71e1216..8ed7751 100644
--- a/plug-ins/common/curve-bend.c
+++ b/plug-ins/common/curve-bend.c
@@ -1131,7 +1131,7 @@ do_dialog (GimpDrawable *drawable)
cd->preview_image_id = p_create_pv_image(drawable, &cd->preview_layer_id1);
cd->preview_layer_id2 = -1;
- if (!GTK_WIDGET_VISIBLE (cd->shell))
+ if (! gtk_widget_get_visible (cd->shell))
gtk_widget_show (cd->shell);
bender_update (cd, UP_GRAPH | UP_DRAW | UP_PREVIEW_EXPOSE);
diff --git a/plug-ins/common/file-png.c b/plug-ins/common/file-png.c
index 7192fd1..7f7c86f 100644
--- a/plug-ins/common/file-png.c
+++ b/plug-ins/common/file-png.c
@@ -2021,7 +2021,7 @@ load_gui_defaults (PngSaveGui *pg)
load_defaults ();
#define SET_ACTIVE(field) \
- if (GTK_WIDGET_IS_SENSITIVE (pg->field)) \
+ if (gtk_widget_is_sensitive (pg->field)) \
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (pg->field), pngvals.field)
SET_ACTIVE (interlaced);
diff --git a/plug-ins/common/filter-pack.c b/plug-ins/common/filter-pack.c
index 3e3c014..15564df 100644
--- a/plug-ins/common/filter-pack.c
+++ b/plug-ins/common/filter-pack.c
@@ -660,7 +660,7 @@ fp_change_current_range (GtkWidget *widget,
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
{
fp_refresh_previews (fpvals.visible_frames);
- if (AW.window && GTK_WIDGET_VISIBLE (AW.window))
+ if (AW.window && gtk_widget_get_visible (AW.window))
fp_create_smoothness_graph (AW.aliasing_preview);
}
}
@@ -816,7 +816,7 @@ fp_change_current_pixels_by (GtkWidget *widget,
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
{
fp_refresh_previews (fpvals.visible_frames);
- if (AW.window && GTK_WIDGET_VISIBLE (AW.window) && AW.range_preview)
+ if (AW.window && gtk_widget_get_visible (AW.window) && AW.range_preview)
fp_range_preview_spill (AW.range_preview,fpvals.value_by);
}
}
@@ -998,7 +998,7 @@ fp_show_hide_frame (GtkWidget *button,
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
{
- if (!GTK_WIDGET_VISIBLE (frame))
+ if (! gtk_widget_get_visible (frame))
{
gtk_widget_show (frame);
@@ -1016,7 +1016,7 @@ fp_show_hide_frame (GtkWidget *button,
}
else
{
- if (GTK_WIDGET_VISIBLE (frame))
+ if (gtk_widget_get_visible (frame))
{
gtk_widget_hide (frame);
@@ -1170,7 +1170,7 @@ fp_scale_update (GtkAdjustment *adjustment,
fp_create_nudge (nudgeArray);
fp_refresh_previews (fpvals.visible_frames);
- if (AW.window != NULL && GTK_WIDGET_VISIBLE (AW.window))
+ if (AW.window != NULL && gtk_widget_get_visible (AW.window))
fp_create_smoothness_graph (AW.aliasing_preview);
prevValue = gtk_adjustment_get_value (adjustment);
diff --git a/plug-ins/common/gee-zoom.c b/plug-ins/common/gee-zoom.c
index 3c68b80..a542b52 100644
--- a/plug-ins/common/gee-zoom.c
+++ b/plug-ins/common/gee-zoom.c
@@ -452,7 +452,7 @@ render_frame (void)
GdkModifierType mask;
gint pixels;
- if (! GTK_WIDGET_DRAWABLE (drawing_area))
+ if (! gtk_widget_is_drawable (drawing_area))
return;
style = gtk_widget_get_style (drawing_area);
diff --git a/plug-ins/common/gee.c b/plug-ins/common/gee.c
index c901d21..b7f8e77 100644
--- a/plug-ins/common/gee.c
+++ b/plug-ins/common/gee.c
@@ -251,7 +251,7 @@ do_fun (void)
static void
show (void)
{
- if (GTK_WIDGET_DRAWABLE (drawing_area))
+ if (gtk_widget_is_drawable (drawing_area))
{
GtkStyle *style = gtk_widget_get_style (drawing_area);
diff --git a/plug-ins/common/iwarp.c b/plug-ins/common/iwarp.c
index 56af218..aacf3f6 100644
--- a/plug-ins/common/iwarp.c
+++ b/plug-ins/common/iwarp.c
@@ -1730,19 +1730,22 @@ iwarp_event_callback (GtkWidget *widget,
static gboolean
iwarp_resize_idle (GtkWidget *widget)
{
- GimpVector2 *new_deform_vectors;
- gint old_preview_width, old_preview_height;
- gint new_preview_width, new_preview_height;
- gint x, y;
- gdouble new2old;
+ GtkAllocation allocation;
+ GimpVector2 *new_deform_vectors;
+ gint old_preview_width, old_preview_height;
+ gint new_preview_width, new_preview_height;
+ gint x, y;
+ gdouble new2old;
resize_idle = 0;
+ gtk_widget_get_allocation (widget, &allocation);
+
old_preview_width = preview_width;
old_preview_height = preview_height;
- max_current_preview_width = widget->allocation.width;
- max_current_preview_height = widget->allocation.height;
+ max_current_preview_width = allocation.width;
+ max_current_preview_height = allocation.height;
/* preview width and height get updated here: */
iwarp_preview_init ();
diff --git a/plug-ins/flame/flame.c b/plug-ins/flame/flame.c
index 16cbc22..0972e70 100644
--- a/plug-ins/flame/flame.c
+++ b/plug-ins/flame/flame.c
@@ -452,10 +452,10 @@ file_response_callback (GtkFileChooser *chooser,
gtk_widget_destroy (GTK_WIDGET (chooser));
- if (! GTK_WIDGET_SENSITIVE (load_button))
+ if (! gtk_widget_get_sensitive (load_button))
gtk_widget_set_sensitive (load_button, TRUE);
- if (! GTK_WIDGET_SENSITIVE (save_button))
+ if (! gtk_widget_get_sensitive (save_button))
gtk_widget_set_sensitive (save_button, TRUE);
}
diff --git a/plug-ins/help-browser/dialog.c b/plug-ins/help-browser/dialog.c
index 19fc30d..5a53e6c 100644
--- a/plug-ins/help-browser/dialog.c
+++ b/plug-ins/help-browser/dialog.c
@@ -978,7 +978,7 @@ update_actions (void)
action = gtk_ui_manager_get_action (ui_manager,
"/ui/help-browser-popup/show-index");
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
- GTK_WIDGET_VISIBLE (sidebar));
+ gtk_widget_get_visible (sidebar));
}
static void
@@ -1021,7 +1021,7 @@ dialog_unmap (GtkWidget *window,
gtk_window_get_size (GTK_WINDOW (window), &data.width, &data.height);
data.paned_position = gtk_paned_get_position (GTK_PANED (paned));
- data.show_index = GTK_WIDGET_VISIBLE (sidebar);
+ data.show_index = gtk_widget_get_visible (sidebar);
data.zoom = (view ?
webkit_web_view_get_zoom_level (WEBKIT_WEB_VIEW (view)) : 1.0);
diff --git a/plug-ins/ifs-compose/ifs-compose.c b/plug-ins/ifs-compose/ifs-compose.c
index 972a5a3..531a7c2 100644
--- a/plug-ins/ifs-compose/ifs-compose.c
+++ b/plug-ins/ifs-compose/ifs-compose.c
@@ -34,6 +34,8 @@
#include <glib/gstdio.h>
+#undef GSEAL_ENABLE
+
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
@@ -1498,10 +1500,14 @@ static gboolean
design_area_expose (GtkWidget *widget,
GdkEventExpose *event)
{
- GtkStyle *style = gtk_widget_get_style (widget);
- PangoLayout *layout;
- gint i;
- gint cx, cy;
+ GtkStyle *style = gtk_widget_get_style (widget);
+ GtkStateType state = gtk_widget_get_state (widget);
+ GtkAllocation allocation;
+ PangoLayout *layout;
+ gint i;
+ gint cx, cy;
+
+ gtk_widget_get_allocation (widget, &allocation);
if (!ifsDesign->selected_gc)
{
@@ -1512,7 +1518,7 @@ design_area_expose (GtkWidget *widget,
}
gdk_draw_rectangle (ifsDesign->pixmap,
- style->bg_gc[widget->state],
+ style->bg_gc[state],
TRUE,
event->area.x,
event->area.y,
@@ -1520,13 +1526,13 @@ design_area_expose (GtkWidget *widget,
/* draw an indicator for the center */
- cx = ifsvals.center_x * widget->allocation.width;
- cy = ifsvals.center_y * widget->allocation.width;
+ cx = ifsvals.center_x * allocation.width;
+ cy = ifsvals.center_y * allocation.width;
gdk_draw_line (ifsDesign->pixmap,
- style->fg_gc[widget->state],
+ style->fg_gc[state],
cx - 10, cy, cx + 10, cy);
gdk_draw_line (ifsDesign->pixmap,
- style->fg_gc[widget->state],
+ style->fg_gc[state],
cx, cy - 10, cx, cy + 10);
layout = gtk_widget_create_pango_layout (widget, NULL);
@@ -1534,10 +1540,10 @@ design_area_expose (GtkWidget *widget,
for (i = 0; i < ifsvals.num_elements; i++)
{
aff_element_draw (elements[i], element_selected[i],
- widget->allocation.width,
- widget->allocation.height,
+ allocation.width,
+ allocation.height,
ifsDesign->pixmap,
- style->fg_gc[widget->state],
+ style->fg_gc[state],
ifsDesign->selected_gc,
layout);
}
@@ -1545,7 +1551,7 @@ design_area_expose (GtkWidget *widget,
g_object_unref (layout);
gdk_draw_drawable (gtk_widget_get_window (widget),
- style->fg_gc[GTK_WIDGET_STATE (widget)],
+ style->fg_gc[state],
ifsDesign->pixmap,
event->area.x, event->area.y,
event->area.x, event->area.y,
@@ -1558,24 +1564,28 @@ static gboolean
design_area_configure (GtkWidget *widget,
GdkEventConfigure *event)
{
- gint i;
- gdouble width = widget->allocation.width;
- gdouble height = widget->allocation.height;
+ GtkAllocation allocation;
+ gint i;
+
+ gtk_widget_get_allocation (widget, &allocation);
for (i = 0; i < ifsvals.num_elements; i++)
- aff_element_compute_trans (elements[i],width, height,
- ifsvals.center_x, ifsvals.center_y);
+ aff_element_compute_trans (elements[i],
+ allocation.width, allocation.height,
+ ifsvals.center_x, ifsvals.center_y);
+
for (i = 0; i < ifsvals.num_elements; i++)
- aff_element_compute_boundary (elements[i],width, height,
- elements, ifsvals.num_elements);
+ aff_element_compute_boundary (elements[i],
+ allocation.width, allocation.height,
+ elements, ifsvals.num_elements);
if (ifsDesign->pixmap)
{
g_object_unref (ifsDesign->pixmap);
}
ifsDesign->pixmap = gdk_pixmap_new (gtk_widget_get_window (widget),
- widget->allocation.width,
- widget->allocation.height,
+ allocation.width,
+ allocation.height,
-1); /* Is this correct? */
return FALSE;
@@ -1585,9 +1595,11 @@ static gint
design_area_button_press (GtkWidget *widget,
GdkEventButton *event)
{
- gdouble width = ifsDesign->area->allocation.width;
- gint i;
- gint old_current;
+ GtkAllocation allocation;
+ gint i;
+ gint old_current;
+
+ gtk_widget_get_allocation (ifsDesign->area, &allocation);
gtk_widget_grab_focus (widget);
@@ -1660,8 +1672,8 @@ design_area_button_press (GtkWidget *widget,
}
ifsDesign->op_xcenter /= ifsDesign->num_selected;
ifsDesign->op_ycenter /= ifsDesign->num_selected;
- ifsDesign->op_x = (gdouble)event->x / width;
- ifsDesign->op_y = (gdouble)event->y / width;
+ ifsDesign->op_x = (gdouble)event->x / allocation.width;
+ ifsDesign->op_y = (gdouble)event->y / allocation.width;
ifsDesign->op_center_x = ifsvals.center_x;
ifsDesign->op_center_y = ifsvals.center_y;
}
@@ -1693,52 +1705,54 @@ static gint
design_area_motion (GtkWidget *widget,
GdkEventMotion *event)
{
- gint i;
- gdouble xo;
- gdouble yo;
- gdouble xn;
- gdouble yn;
- gdouble width = ifsDesign->area->allocation.width;
- gdouble height = ifsDesign->area->allocation.height;
-
- Aff2 trans, t1, t2, t3;
+ GtkAllocation allocation;
+ gint i;
+ gdouble xo;
+ gdouble yo;
+ gdouble xn;
+ gdouble yn;
+ Aff2 trans, t1, t2, t3;
if (! (ifsDesign->button_state & GDK_BUTTON1_MASK))
return FALSE;
+ gtk_widget_get_allocation (ifsDesign->area, &allocation);
+
xo = (ifsDesign->op_x - ifsDesign->op_xcenter);
yo = (ifsDesign->op_y - ifsDesign->op_ycenter);
- xn = (gdouble) event->x / width - ifsDesign->op_xcenter;
- yn = (gdouble) event->y / width - ifsDesign->op_ycenter;
+ xn = (gdouble) event->x / allocation.width - ifsDesign->op_xcenter;
+ yn = (gdouble) event->y / allocation.width - ifsDesign->op_ycenter;
switch (ifsDesign->op)
{
case OP_ROTATE:
- aff2_translate (&t1,-ifsDesign->op_xcenter*width,
- -ifsDesign->op_ycenter*width);
+ aff2_translate (&t1,-ifsDesign->op_xcenter * allocation.width,
+ -ifsDesign->op_ycenter * allocation.width);
aff2_scale (&t2,
sqrt((SQR(xn)+SQR(yn))/(SQR(xo)+SQR(yo))),
0);
aff2_compose (&t3, &t2, &t1);
aff2_rotate (&t1, - atan2(yn, xn) + atan2(yo, xo));
aff2_compose (&t2, &t1, &t3);
- aff2_translate (&t3, ifsDesign->op_xcenter*width,
- ifsDesign->op_ycenter*width);
+ aff2_translate (&t3, ifsDesign->op_xcenter * allocation.width,
+ ifsDesign->op_ycenter * allocation.width);
aff2_compose (&trans, &t3, &t2);
break;
case OP_STRETCH:
- aff2_translate (&t1,-ifsDesign->op_xcenter*width,
- -ifsDesign->op_ycenter*width);
+ aff2_translate (&t1,-ifsDesign->op_xcenter * allocation.width,
+ -ifsDesign->op_ycenter * allocation.width);
aff2_compute_stretch (&t2, xo, yo, xn, yn);
aff2_compose (&t3, &t2, &t1);
- aff2_translate (&t1, ifsDesign->op_xcenter*width,
- ifsDesign->op_ycenter*width);
+ aff2_translate (&t1, ifsDesign->op_xcenter * allocation.width,
+ ifsDesign->op_ycenter * allocation.width);
aff2_compose (&trans, &t1, &t3);
break;
case OP_TRANSLATE:
- aff2_translate (&trans,(xn-xo)*width,(yn-yo)*width);
+ aff2_translate (&trans,
+ (xn-xo) * allocation.width,
+ (yn-yo) * allocation.width);
break;
}
@@ -1752,11 +1766,11 @@ design_area_motion (GtkWidget *widget,
aff2_compose (&t2, &trans, &ifsD->selected_orig[i].trans);
aff2_compose (&elements[i]->trans, &t2, &t1);
- cx = ifsDesign->op_center_x * width;
- cy = ifsDesign->op_center_y * width;
+ cx = ifsDesign->op_center_x * allocation.width;
+ cy = ifsDesign->op_center_y * allocation.width;
aff2_apply (&trans, cx, cy, &cx, &cy);
- ifsvals.center_x = cx / width;
- ifsvals.center_y = cy / width;
+ ifsvals.center_x = cx / allocation.width;
+ ifsvals.center_y = cy / allocation.width;
}
else
{
@@ -1765,9 +1779,10 @@ design_area_motion (GtkWidget *widget,
}
aff_element_decompose_trans (elements[i],&elements[i]->trans,
- width, height, ifsvals.center_x,
- ifsvals.center_y);
- aff_element_compute_trans (elements[i],width, height,
+ allocation.width, allocation.height,
+ ifsvals.center_x, ifsvals.center_y);
+ aff_element_compute_trans (elements[i],
+ allocation.width, allocation.height,
ifsvals.center_x, ifsvals.center_y);
}
@@ -1783,12 +1798,14 @@ design_area_motion (GtkWidget *widget,
static void
design_area_redraw (void)
{
- gdouble width = ifsDesign->area->allocation.width;
- gdouble height = ifsDesign->area->allocation.height;
- gint i;
+ GtkAllocation allocation;
+ gint i;
+
+ gtk_widget_get_allocation (ifsDesign->area, &allocation);
for (i = 0; i < ifsvals.num_elements; i++)
- aff_element_compute_boundary (elements[i],width, height,
+ aff_element_compute_boundary (elements[i],
+ allocation.width, allocation.height,
elements, ifsvals.num_elements);
gtk_widget_queue_draw (ifsDesign->area);
@@ -1861,13 +1878,14 @@ undo_update (gint el)
static void
undo_exchange (gint el)
{
- gint i;
- AffElement **telements;
- gboolean *tselected;
- IfsComposeVals tifsvals;
- gint tcurrent;
- gdouble width = ifsDesign->area->allocation.width;
- gdouble height = ifsDesign->area->allocation.height;
+ GtkAllocation allocation;
+ gint i;
+ AffElement **telements;
+ gboolean *tselected;
+ IfsComposeVals tifsvals;
+ gint tcurrent;
+
+ gtk_widget_get_allocation (ifsDesign->area, &allocation);
/* swap the arrays and values*/
telements = elements;
@@ -1894,8 +1912,9 @@ undo_exchange (gint el)
undo_ring[el].elements[i] = NULL;
}
else
- aff_element_compute_trans (elements[i],width, height,
- ifsvals.center_x, ifsvals.center_y);
+ aff_element_compute_trans (elements[i],
+ allocation.width, allocation.height,
+ ifsvals.center_x, ifsvals.center_y);
set_current_element (ifsD->current_element);
@@ -1945,15 +1964,14 @@ design_area_select_all_callback (GtkWidget *widget,
static void
val_changed_update (void)
{
- AffElement *cur;
- gdouble width;
- gdouble height;
+ GtkAllocation allocation;
+ AffElement *cur;
if (ifsD->in_update)
return;
- width = ifsDesign->area->allocation.width;
- height = ifsDesign->area->allocation.height;
+ gtk_widget_get_allocation (ifsDesign->area, &allocation);
+
cur = elements[ifsD->current_element];
undo_begin ();
@@ -1961,8 +1979,9 @@ val_changed_update (void)
cur->v = ifsD->current_vals;
cur->v.theta *= G_PI/180.0;
- aff_element_compute_trans (cur, width, height,
- ifsvals.center_x, ifsvals.center_y);
+ aff_element_compute_trans (cur,
+ allocation.width, allocation.height,
+ ifsvals.center_x, ifsvals.center_y);
aff_element_compute_color_trans (cur);
design_area_redraw ();
@@ -2144,11 +2163,11 @@ static void
value_pair_update (ValuePair *value_pair)
{
if (value_pair->type == VALUE_PAIR_INT)
- gtk_adjustment_set_value (GTK_ADJUSTMENT (value_pair->adjustment),
- *value_pair->data.i);
+ gtk_adjustment_set_value (GTK_ADJUSTMENT (value_pair->adjustment),
+ *value_pair->data.i);
else
- gtk_adjustment_set_value (GTK_ADJUSTMENT (value_pair->adjustment),
- *value_pair->data.d);
+ gtk_adjustment_set_value (GTK_ADJUSTMENT (value_pair->adjustment),
+ *value_pair->data.d);
}
@@ -2201,12 +2220,13 @@ recompute_center_cb (GtkWidget *widget,
static void
recompute_center (gboolean save_undo)
{
- gint i;
- gdouble x, y;
- gdouble center_x = 0.0;
- gdouble center_y = 0.0;
- gdouble width = ifsDesign->area->allocation.width;
- gdouble height = ifsDesign->area->allocation.height;
+ GtkAllocation allocation;
+ gint i;
+ gdouble x, y;
+ gdouble center_x = 0.0;
+ gdouble center_y = 0.0;
+
+ gtk_widget_get_allocation (ifsDesign->area, &allocation);
if (save_undo)
undo_begin ();
@@ -2233,11 +2253,12 @@ recompute_center (gboolean save_undo)
ifsvals.center_x, ifsvals.center_y);
}
- if (width > 1 && height > 1)
+ if (allocation.width > 1 && allocation.height > 1)
{
for (i = 0; i < ifsvals.num_elements; i++)
- aff_element_compute_trans (elements[i],width, height,
- ifsvals.center_x, ifsvals.center_y);
+ aff_element_compute_trans (elements[i],
+ allocation.width, allocation.height,
+ ifsvals.center_x, ifsvals.center_y);
design_area_redraw ();
update_values ();
}
@@ -2247,14 +2268,15 @@ static void
flip_check_button_callback (GtkWidget *widget,
gpointer data)
{
- guint i;
- gdouble width = ifsDesign->area->allocation.width;
- gdouble height = ifsDesign->area->allocation.height;
- gboolean active;
+ GtkAllocation allocation;
+ guint i;
+ gboolean active;
if (ifsD->in_update)
return;
+ gtk_widget_get_allocation (ifsDesign->area, &allocation);
+
active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
undo_begin ();
@@ -2264,7 +2286,8 @@ flip_check_button_callback (GtkWidget *widget,
{
undo_update (i);
elements[i]->v.flip = active;
- aff_element_compute_trans (elements[i], width, height,
+ aff_element_compute_trans (elements[i],
+ allocation.width, allocation.height,
ifsvals.center_x, ifsvals.center_y);
}
}
@@ -2397,9 +2420,10 @@ static void
ifsfile_replace_ifsvals (IfsComposeVals *new_ifsvals,
AffElement **new_elements)
{
- gdouble width = ifsDesign->area->allocation.width;
- gdouble height = ifsDesign->area->allocation.height;
- guint i;
+ GtkAllocation allocation;
+ guint i;
+
+ gtk_widget_get_allocation (ifsDesign->area, &allocation);
for (i = 0; i < ifsvals.num_elements; i++)
aff_element_free (elements[i]);
@@ -2409,7 +2433,8 @@ ifsfile_replace_ifsvals (IfsComposeVals *new_ifsvals,
elements = new_elements;
for (i = 0; i < ifsvals.num_elements; i++)
{
- aff_element_compute_trans (elements[i], width, height,
+ aff_element_compute_trans (elements[i],
+ allocation.width, allocation.height,
ifsvals.center_x, ifsvals.center_y);
aff_element_compute_color_trans (elements[i]);
}
@@ -2573,17 +2598,19 @@ static void
ifs_compose_new_callback (GtkAction *action,
gpointer data)
{
- GimpRGB color;
- gdouble width = ifsDesign->area->allocation.width;
- gdouble height = ifsDesign->area->allocation.height;
- gint i;
- AffElement *elem;
+ GtkAllocation allocation;
+ GimpRGB color;
+ gint i;
+ AffElement *elem;
+
+ gtk_widget_get_allocation (ifsDesign->area, &allocation);
undo_begin ();
gimp_context_get_foreground (&color);
- elem = aff_element_new (0.5, 0.5 * height / width, &color,
+ elem = aff_element_new (0.5, 0.5 * allocation.height / allocation.width,
+ &color,
++count_for_naming);
ifsvals.num_elements++;
@@ -2600,8 +2627,9 @@ ifs_compose_new_callback (GtkAction *action,
ifsD->selected_orig = g_realloc (ifsD->selected_orig,
ifsvals.num_elements * sizeof(AffElement));
- aff_element_compute_trans (elem, width, height,
- ifsvals.center_x, ifsvals.center_y);
+ aff_element_compute_trans (elem,
+ allocation.width, allocation.height,
+ ifsvals.center_x, ifsvals.center_y);
design_area_redraw ();
@@ -2660,35 +2688,37 @@ ifs_compose_options_callback (GtkAction *action,
static gint
preview_idle_render (gpointer data)
{
- gint width = ifsD->preview_width;
- gint height = ifsD->preview_height;
- gint iterations = PREVIEW_RENDER_CHUNK;
- gint i;
+ GtkAllocation allocation;
+ gint iterations = PREVIEW_RENDER_CHUNK;
+ gint i;
+
+ gtk_widget_get_allocation (ifsDesign->area, &allocation);
if (iterations > ifsD->preview_iterations)
iterations = ifsD->preview_iterations;
for (i = 0; i < ifsvals.num_elements; i++)
- aff_element_compute_trans (elements[i], width, height,
- ifsvals.center_x, ifsvals.center_y);
+ aff_element_compute_trans (elements[i],
+ allocation.width, allocation.height,
+ ifsvals.center_x, ifsvals.center_y);
- ifs_render (elements, ifsvals.num_elements, width, height,
- iterations,&ifsvals, 0, height,
- ifsD->preview_data, NULL, NULL, TRUE);
+ ifs_render (elements, ifsvals.num_elements,
+ allocation.width, allocation.height,
+ iterations,&ifsvals, 0, allocation.height,
+ ifsD->preview_data, NULL, NULL, TRUE);
for (i = 0; i < ifsvals.num_elements; i++)
aff_element_compute_trans (elements[i],
- ifsDesign->area->allocation.width,
- ifsDesign->area->allocation.height,
- ifsvals.center_x, ifsvals.center_y);
+ allocation.width, allocation.height,
+ ifsvals.center_x, ifsvals.center_y);
ifsD->preview_iterations -= iterations;
gimp_preview_area_draw (GIMP_PREVIEW_AREA (ifsD->preview),
- 0, 0, width, height,
+ 0, 0, allocation.width, allocation.height,
GIMP_RGB_IMAGE,
ifsD->preview_data,
- width * 3);
+ allocation.width * 3);
return (ifsD->preview_iterations != 0);
}
@@ -2743,9 +2773,10 @@ ifs_compose_response (GtkWidget *widget,
case RESPONSE_RESET:
{
- gint i;
- gdouble width = ifsDesign->area->allocation.width;
- gdouble height = ifsDesign->area->allocation.height;
+ GtkAllocation allocation;
+ gint i;
+
+ gtk_widget_get_allocation (ifsDesign->area, &allocation);
undo_begin ();
for (i = 0; i < ifsvals.num_elements; i++)
@@ -2756,7 +2787,8 @@ ifs_compose_response (GtkWidget *widget,
ifs_compose_preview ();
for (i = 0; i < ifsvals.num_elements; i++)
- aff_element_compute_trans (elements[i], width, height,
+ aff_element_compute_trans (elements[i],
+ allocation.width, allocation.height,
ifsvals.center_x, ifsvals.center_y);
design_area_redraw ();
diff --git a/plug-ins/imagemap/imap_edit_area_info.c b/plug-ins/imagemap/imap_edit_area_info.c
index 430e08b..7b4e8a6 100644
--- a/plug-ins/imagemap/imap_edit_area_info.c
+++ b/plug-ins/imagemap/imap_edit_area_info.c
@@ -82,32 +82,42 @@ url_changed(GtkWidget *widget, gpointer data)
static void
set_url(GtkWidget *widget, AreaInfoDialog_t *param, const gchar *prefix)
{
- if (callback_lock) {
- callback_lock = FALSE;
- } else {
- if (GTK_WIDGET_STATE(widget) & GTK_STATE_SELECTED) {
- char *p;
- gchar *url = g_strdup(gtk_entry_get_text(GTK_ENTRY(param->url)));
-
- p = strstr(url, "//"); /* 'http://' */
- if (p) {
- p += 2;
- } else {
- p = strchr(url, ':'); /* 'mailto:' */
- if (p) {
- p++;
- if (*p == '/') /* 'file:/' */
- p++;
- } else {
- p = url;
- }
- }
- p = g_strconcat(prefix, p, NULL);
- gtk_entry_set_text(GTK_ENTRY(param->url), p);
- g_free(p);
- g_free(url);
- }
- }
+ if (callback_lock)
+ {
+ callback_lock = FALSE;
+ }
+ else
+ {
+ if (gtk_widget_get_state (widget) & GTK_STATE_SELECTED)
+ {
+ char *p;
+ gchar *url = g_strdup(gtk_entry_get_text(GTK_ENTRY(param->url)));
+
+ p = strstr(url, "//"); /* 'http://' */
+ if (p)
+ {
+ p += 2;
+ }
+ else
+ {
+ p = strchr(url, ':'); /* 'mailto:' */
+ if (p)
+ {
+ p++;
+ if (*p == '/') /* 'file:/' */
+ p++;
+ }
+ else
+ {
+ p = url;
+ }
+ }
+ p = g_strconcat(prefix, p, NULL);
+ gtk_entry_set_text(GTK_ENTRY(param->url), p);
+ g_free(p);
+ g_free(url);
+ }
+ }
gtk_widget_grab_focus(param->url);
}
diff --git a/plug-ins/imagemap/imap_grid.c b/plug-ins/imagemap/imap_grid.c
index 348b3ed..3803139 100644
--- a/plug-ins/imagemap/imap_grid.c
+++ b/plug-ins/imagemap/imap_grid.c
@@ -106,10 +106,11 @@ snap_toggled_cb(GtkWidget *widget, gpointer data)
static void
type_toggled_cb(GtkWidget *widget, gpointer data)
{
- if (GTK_WIDGET_STATE(widget) & GTK_STATE_SELECTED) {
- grid_type = GPOINTER_TO_INT (data);
- redraw_preview();
- }
+ if (gtk_widget_get_state (widget) & GTK_STATE_SELECTED)
+ {
+ grid_type = GPOINTER_TO_INT (data);
+ redraw_preview();
+ }
}
static void
diff --git a/plug-ins/imagemap/imap_preview.c b/plug-ins/imagemap/imap_preview.c
index 8154d82..6d1d55a 100644
--- a/plug-ins/imagemap/imap_preview.c
+++ b/plug-ins/imagemap/imap_preview.c
@@ -465,7 +465,7 @@ make_preview (GimpDrawable *drawable)
/* Create button with arrow */
button = gtk_button_new();
- GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS);
+ gtk_widget_set_can_focus (button, FALSE);
gtk_table_attach(GTK_TABLE(table), button, 0, 1, 0, 1, GTK_FILL, GTK_FILL,
0, 0);
gtk_widget_set_events(button,
diff --git a/plug-ins/imagemap/imap_settings.c b/plug-ins/imagemap/imap_settings.c
index ab31199..7b012eb 100644
--- a/plug-ins/imagemap/imap_settings.c
+++ b/plug-ins/imagemap/imap_settings.c
@@ -75,8 +75,8 @@ settings_ok_cb(gpointer data)
static void
type_toggled_cb(GtkWidget *widget, gpointer data)
{
- if (GTK_WIDGET_STATE(widget) & GTK_STATE_SELECTED)
- _map_format = (MapFormat_t) data;
+ if (gtk_widget_get_state (widget) & GTK_STATE_SELECTED)
+ _map_format = (MapFormat_t) data;
}
static SettingsDialog_t*
diff --git a/plug-ins/imagemap/imap_statusbar.c b/plug-ins/imagemap/imap_statusbar.c
index ba37814..05634ae 100644
--- a/plug-ins/imagemap/imap_statusbar.c
+++ b/plug-ins/imagemap/imap_statusbar.c
@@ -56,7 +56,7 @@ make_statusbar(GtkWidget *main_vbox, GtkWidget *window)
statusbar->xy = gtk_entry_new();
gtk_widget_set_size_request(statusbar->xy, 96, -1);
gtk_editable_set_editable(GTK_EDITABLE(statusbar->xy), FALSE);
- GTK_WIDGET_UNSET_FLAGS(statusbar->xy, GTK_CAN_FOCUS);
+ gtk_widget_set_can_focus (statusbar->xy, FALSE);
gtk_box_pack_start(GTK_BOX(hbox), statusbar->xy, FALSE, FALSE, 0);
gtk_widget_show(statusbar->xy);
@@ -69,7 +69,7 @@ make_statusbar(GtkWidget *main_vbox, GtkWidget *window)
statusbar->dimension = gtk_entry_new();
gtk_widget_set_size_request(statusbar->dimension, 96, -1);
gtk_editable_set_editable(GTK_EDITABLE(statusbar->dimension), FALSE);
- GTK_WIDGET_UNSET_FLAGS(statusbar->dimension, GTK_CAN_FOCUS);
+ gtk_widget_set_can_focus (statusbar->dimension, FALSE);
gtk_box_pack_start(GTK_BOX(hbox), statusbar->dimension, FALSE, FALSE, 0);
gtk_widget_show(statusbar->dimension);
diff --git a/plug-ins/print/print-preview.c b/plug-ins/print/print-preview.c
index 0533f68..410c1a0 100644
--- a/plug-ins/print/print-preview.c
+++ b/plug-ins/print/print-preview.c
@@ -407,17 +407,20 @@ static gboolean
print_preview_expose_event (GtkWidget *widget,
GdkEventExpose *event)
{
- PrintPreview *preview = PRINT_PREVIEW (widget);
- GtkStyle *style = gtk_widget_get_style (widget);
- cairo_t *cr;
- gdouble paper_width;
- gdouble paper_height;
- gdouble left_margin;
- gdouble right_margin;
- gdouble top_margin;
- gdouble bottom_margin;
- gdouble scale;
- gint border;
+ PrintPreview *preview = PRINT_PREVIEW (widget);
+ GtkStyle *style = gtk_widget_get_style (widget);
+ GtkAllocation allocation;
+ cairo_t *cr;
+ gdouble paper_width;
+ gdouble paper_height;
+ gdouble left_margin;
+ gdouble right_margin;
+ gdouble top_margin;
+ gdouble bottom_margin;
+ gdouble scale;
+ gint border;
+
+ gtk_widget_get_allocation (widget, &allocation);
border = gtk_container_get_border_width (GTK_CONTAINER (widget)) + 1;
@@ -431,12 +434,12 @@ print_preview_expose_event (GtkWidget *widget,
cr = gdk_cairo_create (gtk_widget_get_window (widget));
cairo_translate (cr,
- widget->allocation.x + border,
- widget->allocation.y + border);
+ allocation.x + border,
+ allocation.y + border);
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
{
- gint width = widget->allocation.width - 2 * border;
+ gint width = allocation.width - 2 * border;
cairo_translate (cr, width - scale * paper_width, 0);
}
@@ -459,7 +462,7 @@ print_preview_expose_event (GtkWidget *widget,
scale * (paper_width - left_margin - right_margin),
scale * (paper_height - top_margin - bottom_margin));
- gdk_cairo_set_source_color (cr, &style->mid[widget->state]);
+ gdk_cairo_set_source_color (cr, &style->mid[gtk_widget_get_state (widget)]);
cairo_stroke (cr);
cairo_translate (cr,
@@ -482,8 +485,8 @@ print_preview_expose_event (GtkWidget *widget,
{
preview->thumbnail =
print_preview_get_thumbnail (preview->drawable,
- MIN (widget->allocation.width, 1024),
- MIN (widget->allocation.height, 1024));
+ MIN (allocation.width, 1024),
+ MIN (allocation.height, 1024));
}
if (preview->thumbnail != NULL)
@@ -657,13 +660,16 @@ print_preview_is_inside (PrintPreview *preview,
gdouble x,
gdouble y)
{
- GtkWidget *widget = GTK_WIDGET (preview);
- gdouble left_margin;
- gdouble right_margin;
- gdouble top_margin;
- gdouble bottom_margin;
- gdouble scale;
- gint border;
+ GtkWidget *widget = GTK_WIDGET (preview);
+ GtkAllocation allocation;
+ gdouble left_margin;
+ gdouble right_margin;
+ gdouble top_margin;
+ gdouble bottom_margin;
+ gdouble scale;
+ gint border;
+
+ gtk_widget_get_allocation (widget, &allocation);
border = gtk_container_get_border_width (GTK_CONTAINER (widget)) + 1;
@@ -675,7 +681,7 @@ print_preview_is_inside (PrintPreview *preview,
{
gdouble paper_width;
gdouble paper_height;
- gint width = widget->allocation.width - 2 * border;
+ gint width = allocation.width - 2 * border;
print_preview_get_page_size (preview, &paper_width, &paper_height);
@@ -705,7 +711,7 @@ print_preview_set_inside (PrintPreview *preview,
preview->inside = inside;
- if (GTK_WIDGET_DRAWABLE (widget))
+ if (gtk_widget_is_drawable (widget))
gdk_window_set_cursor (gtk_widget_get_window (widget),
inside ? preview->cursor : NULL);
@@ -716,19 +722,22 @@ print_preview_set_inside (PrintPreview *preview,
static gdouble
print_preview_get_scale (PrintPreview *preview)
{
- GtkWidget *widget = GTK_WIDGET (preview);
- gdouble paper_width;
- gdouble paper_height;
- gdouble scale_x;
- gdouble scale_y;
- gint border;
+ GtkWidget *widget = GTK_WIDGET (preview);
+ GtkAllocation allocation;
+ gdouble paper_width;
+ gdouble paper_height;
+ gdouble scale_x;
+ gdouble scale_y;
+ gint border;
+
+ gtk_widget_get_allocation (widget, &allocation);
border = gtk_container_get_border_width (GTK_CONTAINER (widget)) + 1;
print_preview_get_page_size (preview, &paper_width, &paper_height);
- scale_x = (gdouble) (widget->allocation.width - 2 * border) / paper_width;
- scale_y = (gdouble) (widget->allocation.height - 2 * border) / paper_height;
+ scale_x = (gdouble) (allocation.width - 2 * border) / paper_width;
+ scale_y = (gdouble) (allocation.height - 2 * border) / paper_height;
return MIN (scale_x, scale_y);
}
diff --git a/plug-ins/pygimp/gimpui.override b/plug-ins/pygimp/gimpui.override
index 63a4ea0..9334795 100644
--- a/plug-ins/pygimp/gimpui.override
+++ b/plug-ins/pygimp/gimpui.override
@@ -1009,8 +1009,8 @@ _wrap_gimp_color_scale_new(PyGObject *self, PyObject *args, PyObject *kwargs)
scale->channel = channel;
range = GTK_RANGE(scale);
- range->orientation = orientation;
- range->flippable = (orientation == GTK_ORIENTATION_HORIZONTAL);
+ gtk_orientable_set_orientation (GTK_ORIENTABLE (range), orientation);
+ gtk_range_set_flippable (range, orientation == GTK_ORIENTATION_HORIZONTAL);
return 0;
}
diff --git a/plug-ins/script-fu/script-fu-console.c b/plug-ins/script-fu/script-fu-console.c
index f44dd62..e76186c 100644
--- a/plug-ins/script-fu/script-fu-console.c
+++ b/plug-ins/script-fu/script-fu-console.c
@@ -22,6 +22,8 @@
#include <glib/gstdio.h>
+#undef GSEAL_ENABLE
+
#include "libgimp/gimp.h"
#include "libgimp/gimpui.h"
diff --git a/plug-ins/script-fu/script-fu-interface.c b/plug-ins/script-fu/script-fu-interface.c
index b289f66..724384f 100644
--- a/plug-ins/script-fu/script-fu-interface.c
+++ b/plug-ins/script-fu/script-fu-interface.c
@@ -721,7 +721,11 @@ script_fu_response (GtkWidget *widget,
gint response_id,
SFScript *script)
{
- if (! GTK_WIDGET_SENSITIVE (GTK_DIALOG (sf_interface->dialog)->action_area))
+ GtkWidget *action_area;
+
+ action_area = gtk_dialog_get_action_area (GTK_DIALOG (sf_interface->dialog));
+
+ if (! gtk_widget_is_sensitive (action_area))
return;
switch (response_id)
@@ -732,8 +736,7 @@ script_fu_response (GtkWidget *widget,
case GTK_RESPONSE_OK:
gtk_widget_set_sensitive (sf_interface->table, FALSE);
- gtk_widget_set_sensitive (GTK_DIALOG (sf_interface->dialog)->action_area,
- FALSE);
+ gtk_widget_set_sensitive (action_area, FALSE);
script_fu_ok (script);
gtk_widget_destroy (sf_interface->dialog);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]