[gimp/gtk3-port: 221/236] plug-ins: port filter-pack to GTK+ 3.0, still some warnings left
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 221/236] plug-ins: port filter-pack to GTK+ 3.0, still some warnings left
- Date: Wed, 21 Sep 2011 23:17:26 +0000 (UTC)
commit 562e11da6d15e8839684074512656faeb866e4dd
Author: Michael Natterer <mitch gimp org>
Date: Sun Feb 27 15:40:12 2011 +0100
plug-ins: port filter-pack to GTK+ 3.0, still some warnings left
plug-ins/common/filter-pack.c | 36 ++++++++++++++++++++----------------
1 files changed, 20 insertions(+), 16 deletions(-)
---
diff --git a/plug-ins/common/filter-pack.c b/plug-ins/common/filter-pack.c
index 3bb03a6..17c5161 100644
--- a/plug-ins/common/filter-pack.c
+++ b/plug-ins/common/filter-pack.c
@@ -189,6 +189,9 @@ static GtkWidget * fp_create_show (void);
static GtkWidget * fp_create_msnls (GtkWidget *parent);
static GtkWidget * fp_create_pixels_select_by (void);
static void update_range_labels (void);
+static gboolean fp_range_draw (GtkWidget *widget,
+ cairo_t *cr,
+ FPValues *current);
static gboolean fp_range_change_events (GtkWidget *widget,
GdkEvent *event,
FPValues *current);
@@ -1373,6 +1376,9 @@ fp_advanced_dialog (GtkWidget *parent)
gtk_widget_show (AW.aliasing_graph);
gtk_widget_set_events (AW.aliasing_graph, RANGE_ADJUST_MASK);
+ g_signal_connect (AW.aliasing_graph, "draw",
+ G_CALLBACK (fp_range_draw),
+ &fpvals);
g_signal_connect (AW.aliasing_graph, "event",
G_CALLBACK (fp_range_change_events),
&fpvals);
@@ -1440,11 +1446,12 @@ fp_advanced_dialog (GtkWidget *parent)
}
static void
-slider_erase (GdkWindow *window,
+slider_erase (GtkWidget *widget,
int xpos)
{
- gdk_window_clear_area (window, MARGIN + xpos - (RANGE_HEIGHT - 1) / 2, 0,
- RANGE_HEIGHT, RANGE_HEIGHT);
+ gtk_widget_queue_draw_area (widget,
+ MARGIN + xpos - (RANGE_HEIGHT - 1) / 2, 0,
+ RANGE_HEIGHT, RANGE_HEIGHT);
}
static void
@@ -1465,11 +1472,12 @@ draw_slider (cairo_t *cr,
cairo_stroke (cr);
}
-static void
-draw_it (GtkWidget *widget)
+static gboolean
+fp_range_draw (GtkWidget *widget,
+ cairo_t *cr,
+ FPValues *current)
{
GtkStyle *style = gtk_widget_get_style (AW.aliasing_graph);
- cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (AW.aliasing_graph));
cairo_translate (cr, 0.5, 0.5);
cairo_set_line_width (cr, 1.0);
@@ -1489,13 +1497,13 @@ draw_it (GtkWidget *widget)
&style->dark[GTK_STATE_SELECTED],
fpvals.offset);
- cairo_destroy (cr);
+ return FALSE;
}
static gboolean
fp_range_change_events (GtkWidget *widget,
GdkEvent *event,
- FPValues *current)
+ FPValues *current)
{
GdkEventButton *bevent;
GdkEventMotion *mevent;
@@ -1505,10 +1513,6 @@ fp_range_change_events (GtkWidget *widget,
switch (event->type)
{
- case GDK_EXPOSE:
- draw_it (NULL);
- break;
-
case GDK_BUTTON_PRESS:
bevent= (GdkEventButton *) event;
@@ -1527,11 +1531,11 @@ fp_range_change_events (GtkWidget *widget,
else
new = &fpvals.offset;
- slider_erase (gtk_widget_get_window (AW.aliasing_graph), *new);
+ slider_erase (AW.aliasing_graph, *new);
*new = bevent->x;
}
- draw_it (NULL);
+ gtk_widget_queue_draw (widget);
fp_range_preview_spill (AW.range_preview, fpvals.value_by);
update_range_labels ();
@@ -1548,9 +1552,9 @@ fp_range_change_events (GtkWidget *widget,
if (x >= 0 && x < 256)
{
- slider_erase (gtk_widget_get_window (AW.aliasing_graph), *new);
+ slider_erase (AW.aliasing_graph, *new);
*new = x;
- draw_it (NULL);
+ gtk_widget_queue_draw (widget);
fp_range_preview_spill (AW.range_preview, fpvals.value_by);
update_range_labels ();
fp_create_smoothness_graph (AW.aliasing_preview);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]