[gimp/gtk3-port: 36/247] app: port to GtkWidget::draw()
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 36/247] app: port to GtkWidget::draw()
- Date: Sat, 5 Mar 2011 20:35:13 +0000 (UTC)
commit 3f07a95c19a184b3e56b6cf2d00b5fa6d06576ed
Author: Michael Natterer <mitch gimp org>
Date: Fri Oct 15 13:44:42 2010 +0200
app: port to GtkWidget::draw()
app/widgets/gimpdasheditor.c | 16 +++++-----------
1 files changed, 5 insertions(+), 11 deletions(-)
---
diff --git a/app/widgets/gimpdasheditor.c b/app/widgets/gimpdasheditor.c
index c135348..439a347 100644
--- a/app/widgets/gimpdasheditor.c
+++ b/app/widgets/gimpdasheditor.c
@@ -60,8 +60,8 @@ static void gimp_dash_editor_get_property (GObject *object,
static void gimp_dash_editor_size_request (GtkWidget *widget,
GtkRequisition *requisition);
-static gboolean gimp_dash_editor_expose (GtkWidget *widget,
- GdkEventExpose *event);
+static gboolean gimp_dash_editor_draw (GtkWidget *widget,
+ cairo_t *cr);
static gboolean gimp_dash_editor_button_press (GtkWidget *widget,
GdkEventButton *bevent);
static gboolean gimp_dash_editor_button_release (GtkWidget *widget,
@@ -93,7 +93,7 @@ gimp_dash_editor_class_init (GimpDashEditorClass *klass)
object_class->set_property = gimp_dash_editor_set_property;
widget_class->size_request = gimp_dash_editor_size_request;
- widget_class->expose_event = gimp_dash_editor_expose;
+ widget_class->draw = gimp_dash_editor_draw;
widget_class->button_press_event = gimp_dash_editor_button_press;
widget_class->button_release_event = gimp_dash_editor_button_release;
widget_class->motion_notify_event = gimp_dash_editor_motion_notify;
@@ -233,12 +233,11 @@ gimp_dash_editor_size_request (GtkWidget *widget,
}
static gboolean
-gimp_dash_editor_expose (GtkWidget *widget,
- GdkEventExpose *event)
+gimp_dash_editor_draw (GtkWidget *widget,
+ cairo_t *cr)
{
GimpDashEditor *editor = GIMP_DASH_EDITOR (widget);
GtkStyle *style = gtk_widget_get_style (widget);
- cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (widget));
GtkAllocation allocation;
gint x;
gint w, h;
@@ -247,9 +246,6 @@ gimp_dash_editor_expose (GtkWidget *widget,
update_blocksize (editor);
- gdk_cairo_rectangle (cr, &event->area);
- cairo_clip (cr);
-
/* draw the background */
gdk_cairo_set_source_color (cr, &style->base[GTK_STATE_NORMAL]);
@@ -337,8 +333,6 @@ gimp_dash_editor_expose (GtkWidget *widget,
cairo_set_line_width (cr, 1.0);
cairo_stroke (cr);
- cairo_destroy (cr);
-
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]