[gimp/gtk3-port: 81/226] plug-ins: port some more plug-ins to GTK+ 3.0
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gtk3-port: 81/226] plug-ins: port some more plug-ins to GTK+ 3.0
- Date: Sun, 23 Nov 2014 18:06:29 +0000 (UTC)
commit bf8e7f7e199dc0f4539a6042eb8a20fb67237c10
Author: Michael Natterer <mitch gimp org>
Date: Tue Oct 26 15:22:34 2010 +0200
plug-ins: port some more plug-ins to GTK+ 3.0
plug-ins/maze/maze-dialog.c | 2 +-
plug-ins/pagecurl/pagecurl.c | 18 +++++++++---------
plug-ins/print/print-preview.c | 19 ++++++-------------
.../selection-to-path/selection-to-path-dialog.c | 16 ++++++++--------
4 files changed, 24 insertions(+), 31 deletions(-)
---
diff --git a/plug-ins/maze/maze-dialog.c b/plug-ins/maze/maze-dialog.c
index b7b0d89..cf9b0e6 100644
--- a/plug-ins/maze/maze-dialog.c
+++ b/plug-ins/maze/maze-dialog.c
@@ -588,7 +588,7 @@ entscale_int_new (GtkWidget *table,
constraint_val = ( *intvar < min ? min : *intvar > max ? max : *intvar );
userdata->adjustment = adjustment =
- GTK_ADJUSTMENT (gtk_adjustment_new (constraint_val, min, max, 1.0, 1.0, 0.0));
+ gtk_adjustment_new (constraint_val, min, max, 1.0, 1.0, 0.0);
scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, adjustment);
gtk_widget_set_size_request (scale, ENTSCALE_INT_SCALE_WIDTH, -1);
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
diff --git a/plug-ins/pagecurl/pagecurl.c b/plug-ins/pagecurl/pagecurl.c
index af942d0..16f526e 100644
--- a/plug-ins/pagecurl/pagecurl.c
+++ b/plug-ins/pagecurl/pagecurl.c
@@ -427,15 +427,15 @@ dialog (void)
/* Missing options: Color-dialogs? / own curl layer ? / transparency
to original drawable / Warp-curl (unsupported yet) */
- GtkWidget *dialog;
- GtkWidget *hbox;
- GtkWidget *vbox;
- GtkWidget *table;
- GtkWidget *frame;
- GtkWidget *button;
- GtkWidget *combo;
- GtkObject *adjustment;
- gboolean run;
+ GtkWidget *dialog;
+ GtkWidget *hbox;
+ GtkWidget *vbox;
+ GtkWidget *table;
+ GtkWidget *frame;
+ GtkWidget *button;
+ GtkWidget *combo;
+ GtkAdjustment *adjustment;
+ gboolean run;
gimp_ui_init (PLUG_IN_BINARY, FALSE);
diff --git a/plug-ins/print/print-preview.c b/plug-ins/print/print-preview.c
index 3e58f55..028a9a9 100644
--- a/plug-ins/print/print-preview.c
+++ b/plug-ins/print/print-preview.c
@@ -80,8 +80,8 @@ static void print_preview_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void print_preview_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
-static gboolean print_preview_expose_event (GtkWidget *widget,
- GdkEventExpose *event);
+static gboolean print_preview_draw (GtkWidget *widget,
+ cairo_t *cr);
static gboolean print_preview_button_press_event (GtkWidget *widget,
GdkEventButton *event);
static gboolean print_preview_button_release_event (GtkWidget *widget,
@@ -182,7 +182,7 @@ print_preview_class_init (PrintPreviewClass *klass)
widget_class->unrealize = print_preview_unrealize;
widget_class->size_request = print_preview_size_request;
widget_class->size_allocate = print_preview_size_allocate;
- widget_class->expose_event = print_preview_expose_event;
+ widget_class->draw = print_preview_draw;
widget_class->button_press_event = print_preview_button_press_event;
widget_class->button_release_event = print_preview_button_release_event;
widget_class->motion_notify_event = print_preview_motion_notify_event;
@@ -398,13 +398,12 @@ print_preview_leave_notify_event (GtkWidget *widget,
}
static gboolean
-print_preview_expose_event (GtkWidget *widget,
- GdkEventExpose *event)
+print_preview_draw (GtkWidget *widget,
+ cairo_t *cr)
{
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;
@@ -425,11 +424,7 @@ print_preview_expose_event (GtkWidget *widget,
scale = print_preview_get_scale (preview);
- cr = gdk_cairo_create (gtk_widget_get_window (widget));
-
- cairo_translate (cr,
- allocation.x + border,
- allocation.y + border);
+ cairo_translate (cr, border, border);
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
{
@@ -501,8 +496,6 @@ print_preview_expose_event (GtkWidget *widget,
cairo_fill (cr);
}
- cairo_destroy (cr);
-
return FALSE;
}
diff --git a/plug-ins/selection-to-path/selection-to-path-dialog.c
b/plug-ins/selection-to-path/selection-to-path-dialog.c
index e65a0d3..557bc31 100644
--- a/plug-ins/selection-to-path/selection-to-path-dialog.c
+++ b/plug-ins/selection-to-path/selection-to-path-dialog.c
@@ -48,13 +48,13 @@ static GSList * adjust_widgets = NULL;
void
reset_adv_dialog (void)
{
- GSList *list;
- GtkObject *widget;
- gdouble *value;
+ GSList *list;
+ GObject *widget;
+ gdouble *value;
for (list = adjust_widgets; list; list = g_slist_next (list))
{
- widget = GTK_OBJECT (list->data);
+ widget = G_OBJECT (list->data);
value = (gdouble *) g_object_get_data (G_OBJECT (widget),
"default_value");
@@ -84,10 +84,10 @@ def_val (gdouble default_value)
GtkWidget *
dialog_create_selection_area (SELVALS *sels)
{
- GtkWidget *table;
- GtkWidget *check;
- GtkObject *adj;
- gint row;
+ GtkWidget *table;
+ GtkWidget *check;
+ GtkAdjustment *adj;
+ gint row;
table = gtk_table_new (20, 3, FALSE);
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]