[gimp] Build with GSEAL_ENABLE
- From: Michael Natterer <mitch src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gimp] Build with GSEAL_ENABLE
- Date: Sat, 17 Oct 2009 16:58:47 +0000 (UTC)
commit 11039a0436b014b70c97b948604d7795dc368d9d
Author: Michael Natterer <mitch gimp org>
Date: Sat Oct 17 18:58:28 2009 +0200
Build with GSEAL_ENABLE
modules/color-selector-water.c | 50 ++++++++++++++++++++++++---------------
modules/display-filter-lcms.c | 2 +-
2 files changed, 32 insertions(+), 20 deletions(-)
---
diff --git a/modules/color-selector-water.c b/modules/color-selector-water.c
index 431e157..e265656 100644
--- a/modules/color-selector-water.c
+++ b/modules/color-selector-water.c
@@ -203,17 +203,23 @@ static void
select_area_expose (GtkWidget *widget,
GdkEventExpose *event)
{
- GtkStyle *style = gtk_widget_get_style (widget);
- gdouble width = widget->allocation.width;
- gdouble height = widget->allocation.height;
- gdouble dx = 1.0 / width;
- gdouble dy = 1.0 / height;
- guchar *buf = g_alloca (3 * event->area.width * event->area.height);
- guchar *dest = buf;
- gdouble y;
- gint i, j;
-
- for (j = 0, y = event->area.y / height; j < event->area.height; j++, y += dy)
+ GtkStyle *style = gtk_widget_get_style (widget);
+ GtkAllocation allocation;
+ gdouble dx;
+ gdouble dy;
+ guchar *buf = g_alloca (3 * event->area.width * event->area.height);
+ guchar *dest = buf;
+ gdouble y;
+ gint i, j;
+
+ gtk_widget_get_allocation (widget, &allocation);
+
+ dx = 1.0 / allocation.width;
+ dy = 1.0 / allocation.height;
+
+ for (j = 0, y = event->area.y / allocation.height;
+ j < event->area.height;
+ j++, y += dy)
{
guchar *d = dest;
@@ -246,7 +252,7 @@ select_area_expose (GtkWidget *widget,
}
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, event->area.y,
event->area.width, event->area.height,
GDK_RGB_DITHER_MAX,
@@ -310,10 +316,13 @@ button_press_event (GtkWidget *widget,
GdkEventButton *event,
ColorselWater *water)
{
- gboolean erase;
+ GtkAllocation allocation;
+ gboolean erase;
- water->last_x = event->x / widget->allocation.width;
- water->last_y = event->y / widget->allocation.height;
+ gtk_widget_get_allocation (widget, &allocation);
+
+ water->last_x = event->x / allocation.width;
+ water->last_y = event->y / allocation.height;
erase = (event->button != 1);
/* FIXME: (event->source == GDK_SOURCE_ERASER) */
@@ -333,11 +342,14 @@ motion_notify_event (GtkWidget *widget,
GdkEventMotion *event,
ColorselWater *water)
{
+ GtkAllocation allocation;
GdkTimeCoord **coords;
gint nevents;
gint i;
gboolean erase;
+ gtk_widget_get_allocation (widget, &allocation);
+
if (event->state & (GDK_BUTTON1_MASK |
GDK_BUTTON2_MASK |
GDK_BUTTON3_MASK |
@@ -376,8 +388,8 @@ motion_notify_event (GtkWidget *widget,
GDK_AXIS_PRESSURE, &pressure);
draw_brush (water, widget, erase,
- x / widget->allocation.width,
- y / widget->allocation.height, pressure);
+ x / allocation.width,
+ y / allocation.height, pressure);
}
g_free (coords);
@@ -389,8 +401,8 @@ motion_notify_event (GtkWidget *widget,
gdk_event_get_axis ((GdkEvent *) event, GDK_AXIS_PRESSURE, &pressure);
draw_brush (water, widget, erase,
- event->x / widget->allocation.width,
- event->y / widget->allocation.height, pressure);
+ event->x / allocation.width,
+ event->y / allocation.height, pressure);
}
}
diff --git a/modules/display-filter-lcms.c b/modules/display-filter-lcms.c
index 0be1a47..5cd5da3 100644
--- a/modules/display-filter-lcms.c
+++ b/modules/display-filter-lcms.c
@@ -426,7 +426,7 @@ cdisplay_lcms_get_screen (CdisplayLcms *lcms,
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
- if (GTK_IS_WIDGET (managed) && GTK_WIDGET_DRAWABLE (managed))
+ if (GTK_IS_WIDGET (managed) && gtk_widget_is_drawable (GTK_WIDGET (managed)))
{
GtkWidget *widget = GTK_WIDGET (managed);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]