[gimp/gtk3-port: 113/246] 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: 113/246] plug-ins: port some more plug-ins to GTK+ 3.0
- Date: Mon, 28 Feb 2011 15:25:34 +0000 (UTC)
commit 54f132ed6210f1851b174be16119e03da891f810
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 | 16 +++++-----
plug-ins/pagecurl/pagecurl.c | 18 ++++++------
plug-ins/print/print-page-layout.c | 28 ++++++++++----------
plug-ins/print/print-preview.c | 19 ++++---------
.../selection-to-path/selection-to-path-dialog.c | 16 +++++-----
5 files changed, 45 insertions(+), 52 deletions(-)
---
diff --git a/plug-ins/maze/maze-dialog.c b/plug-ins/maze/maze-dialog.c
index a7b6e40..233911b 100644
--- a/plug-ins/maze/maze-dialog.c
+++ b/plug-ins/maze/maze-dialog.c
@@ -56,7 +56,7 @@ typedef void (* EntscaleIntCallback) (gint value,
typedef struct
{
- GtkObject *adjustment;
+ GtkAdjustment *adjustment;
GtkWidget *entry;
gboolean constraint;
EntscaleIntCallback callback;
@@ -562,12 +562,12 @@ entscale_int_new (GtkWidget *table,
gpointer call_data)
{
EntscaleIntData *userdata;
- GtkWidget *hbox;
- GtkWidget *label;
- GtkWidget *entry;
- GtkWidget *scale;
- GtkObject *adjustment;
- gint constraint_val;
+ GtkWidget *hbox;
+ GtkWidget *label;
+ GtkWidget *entry;
+ GtkWidget *scale;
+ GtkAdjustment *adjustment;
+ gint constraint_val;
userdata = g_new (EntscaleIntData, 1);
@@ -589,7 +589,7 @@ entscale_int_new (GtkWidget *table,
userdata->adjustment = adjustment =
gtk_adjustment_new (constraint_val, min, max, 1.0, 1.0, 0.0);
- scale = gtk_hscale_new (GTK_ADJUSTMENT (adjustment));
+ scale = gtk_hscale_new (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 3f587e7..85a415b 100644
--- a/plug-ins/pagecurl/pagecurl.c
+++ b/plug-ins/pagecurl/pagecurl.c
@@ -424,15 +424,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-page-layout.c b/plug-ins/print/print-page-layout.c
index e883927..97bca5b 100644
--- a/plug-ins/print/print-page-layout.c
+++ b/plug-ins/print/print-page-layout.c
@@ -40,10 +40,10 @@ typedef struct
GtkWidget *center_combo;
GtkWidget *area_label;
GtkWidget *preview;
- GtkObject *left_adj;
- GtkObject *right_adj;
- GtkObject *top_adj;
- GtkObject *bottom_adj;
+ GtkAdjustment *left_adj;
+ GtkAdjustment *right_adj;
+ GtkAdjustment *top_adj;
+ GtkAdjustment *bottom_adj;
} PrintSizeInfo;
enum
@@ -212,16 +212,16 @@ print_size_frame (PrintData *data,
GtkSizeGroup *label_group,
GtkSizeGroup *entry_group)
{
- GtkWidget *entry;
- GtkWidget *height;
- GtkWidget *vbox;
- GtkWidget *hbox;
- GtkWidget *chain;
- GtkWidget *frame;
- GtkWidget *label;
- GtkObject *adj;
- gdouble image_width;
- gdouble image_height;
+ GtkWidget *entry;
+ GtkWidget *height;
+ GtkWidget *vbox;
+ GtkWidget *hbox;
+ GtkWidget *chain;
+ GtkWidget *frame;
+ GtkWidget *label;
+ GtkAdjustment *adj;
+ gdouble image_width;
+ gdouble image_height;
image_width = (info.image_width *
gimp_unit_get_factor (data->unit) / data->xres);
diff --git a/plug-ins/print/print-preview.c b/plug-ins/print/print-preview.c
index d538483..fb27667 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;
@@ -404,13 +404,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;
@@ -431,11 +430,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)
{
@@ -507,8 +502,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 4470dc0..8fa401a 100644
--- a/plug-ins/selection-to-path/selection-to-path-dialog.c
+++ b/plug-ins/selection-to-path/selection-to-path-dialog.c
@@ -47,13 +47,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");
@@ -83,10 +83,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]