diff options
author | Hiroyuki Ikezoe <poincare@ikezoe.net> | 2007-07-28 05:14:15 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2007-07-28 05:14:15 +0800 |
commit | 6baf4d9bcc8fac7d3ac4442ffa54138f9670b20f (patch) | |
tree | 64868338277e36a40c6b37106dfb8112fc278264 /widgets/misc | |
parent | 08de5e9e147248b84bc1fa618f7cc9d892ddb136 (diff) | |
download | gsoc2013-evolution-6baf4d9bcc8fac7d3ac4442ffa54138f9670b20f.tar gsoc2013-evolution-6baf4d9bcc8fac7d3ac4442ffa54138f9670b20f.tar.gz gsoc2013-evolution-6baf4d9bcc8fac7d3ac4442ffa54138f9670b20f.tar.bz2 gsoc2013-evolution-6baf4d9bcc8fac7d3ac4442ffa54138f9670b20f.tar.lz gsoc2013-evolution-6baf4d9bcc8fac7d3ac4442ffa54138f9670b20f.tar.xz gsoc2013-evolution-6baf4d9bcc8fac7d3ac4442ffa54138f9670b20f.tar.zst gsoc2013-evolution-6baf4d9bcc8fac7d3ac4442ffa54138f9670b20f.zip |
Remove E_MAKE_TYPE macro.
2007-07-27 Hiroyuki Ikezoe <poincare@ikezoe.net>
* e-util/e-util.h: Remove E_MAKE_TYPE macro.
* e-util/e-bit-array.c:
* e-util/e-sorter-array.c:
* e-util/e-sorter.c:
* e-util/e-text-event-processor-emacs-like.c:
* e-util/e-text-event-processor.c:
* widgets/menus/gal-define-views-dialog.c:
* widgets/menus/gal-define-views-model.c:
* widgets/menus/gal-view-collection.c:
* widgets/menus/gal-view-etable.c:
* widgets/menus/gal-view-factory-etable.c:
* widgets/menus/gal-view-factory.c:
* widgets/menus/gal-view-instance-save-as-dialog.c:
* widgets/menus/gal-view-instance.c:
* widgets/menus/gal-view-new-dialog.c:
* widgets/menus/gal-view.c:
* widgets/misc/e-canvas-background.c:
* widgets/misc/e-canvas-vbox.c:
* widgets/misc/e-canvas.c:
* widgets/misc/e-printable.c:
* widgets/misc/e-reflow-model.c:
* widgets/misc/e-reflow.c:
* widgets/misc/e-selection-model-array.c:
* widgets/misc/e-selection-model-simple.c:
* widgets/misc/e-selection-model.c:
* widgets/table/e-cell-checkbox.c:
* widgets/table/e-cell-combo.c:
* widgets/table/e-cell-date.c:
* widgets/table/e-cell-float.c:
* widgets/table/e-cell-hbox.c:
* widgets/table/e-cell-number.c:
* widgets/table/e-cell-pixbuf.c:
* widgets/table/e-cell-popup.c:
* widgets/table/e-cell-progress.c:
* widgets/table/e-cell-size.c:
* widgets/table/e-cell-spin-button.c:
* widgets/table/e-cell-text.c:
* widgets/table/e-cell-toggle.c:
* widgets/table/e-cell-tree.c:
* widgets/table/e-cell-vbox.c:
* widgets/table/e-cell.c:
* widgets/table/e-table-click-to-add.c:
* widgets/table/e-table-col.c:
* widgets/table/e-table-column-specification.c:
* widgets/table/e-table-column.c:
* widgets/table/e-table-config-field.c:
* widgets/table/e-table-config.c:
* widgets/table/e-table-extras.c:
* widgets/table/e-table-field-chooser-dialog.c:
* widgets/table/e-table-field-chooser-item.c:
* widgets/table/e-table-field-chooser.c:
* widgets/table/e-table-group-container.c:
* widgets/table/e-table-group-leaf.c:
* widgets/table/e-table-group.c:
* widgets/table/e-table-header-item.c:
* widgets/table/e-table-header.c:
* widgets/table/e-table-item.c:
* widgets/table/e-table-memory-callbacks.c:
* widgets/table/e-table-memory-store.c:
* widgets/table/e-table-memory.c:
* widgets/table/e-table-model.c:
* widgets/table/e-table-one.c:
* widgets/table/e-table-scrolled.c:
* widgets/table/e-table-search.c:
* widgets/table/e-table-selection-model.c:
* widgets/table/e-table-simple.c:
* widgets/table/e-table-sort-info.c:
* widgets/table/e-table-sorted-variable.c:
* widgets/table/e-table-sorted.c:
* widgets/table/e-table-sorter.c:
* widgets/table/e-table-specification.c:
* widgets/table/e-table-state.c:
* widgets/table/e-table-subset-variable.c:
* widgets/table/e-table-subset.c:
* widgets/table/e-table-without.c:
* widgets/table/e-table.c:
* widgets/table/e-tree-memory-callbacks.c:
* widgets/table/e-tree-memory.c:
* widgets/table/e-tree-model.c:
* widgets/table/e-tree-scrolled.c:
* widgets/table/e-tree-selection-model.c:
* widgets/table/e-tree-simple.c:
* widgets/table/e-tree-sorted-variable.c:
* widgets/table/e-tree-sorted.c:
* widgets/table/e-tree-table-adapter.c:
* widgets/table/e-tree.c:
* widgets/text/e-completion-callbacks.c:
* widgets/text/e-completion-view.c:
* widgets/text/e-completion.c:
* widgets/text/e-entry.c:
* widgets/text/e-table-text-model.c:
* widgets/text/e-text-model-uri.c:
* widgets/text/e-text-model.c:
* widgets/text/e-text.c:
Use G_DEFINE_TYPE instead of E_MAKE_TYPE.
svn path=/trunk/; revision=33864
Diffstat (limited to 'widgets/misc')
-rw-r--r-- | widgets/misc/e-canvas-background.c | 40 | ||||
-rw-r--r-- | widgets/misc/e-canvas-vbox.c | 22 | ||||
-rw-r--r-- | widgets/misc/e-canvas.c | 24 | ||||
-rw-r--r-- | widgets/misc/e-printable.c | 22 | ||||
-rw-r--r-- | widgets/misc/e-reflow-model.c | 14 | ||||
-rw-r--r-- | widgets/misc/e-reflow.c | 37 | ||||
-rw-r--r-- | widgets/misc/e-selection-model-array.c | 12 | ||||
-rw-r--r-- | widgets/misc/e-selection-model-simple.c | 9 | ||||
-rw-r--r-- | widgets/misc/e-selection-model.c | 13 |
9 files changed, 61 insertions, 132 deletions
diff --git a/widgets/misc/e-canvas-background.c b/widgets/misc/e-canvas-background.c index 02f8f1675c..334b01f232 100644 --- a/widgets/misc/e-canvas-background.c +++ b/widgets/misc/e-canvas-background.c @@ -38,7 +38,9 @@ #include "e-canvas-background.h" -#define PARENT_OBJECT_TYPE gnome_canvas_item_get_type () +/* workaround for avoiding API broken */ +#define ecb_get_type e_canvas_background_get_type +G_DEFINE_TYPE (ECanvasBackground, ecb, GNOME_TYPE_CANVAS_ITEM) #define d(x) @@ -55,8 +57,6 @@ struct _ECanvasBackgroundPrivate { guint needs_redraw : 1; }; -static GnomeCanvasItemClass *parent_class; - enum { STYLE_SET, LAST_SIGNAL @@ -131,8 +131,8 @@ ecb_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags) ArtPoint o1, o2; ECanvasBackground *ecb = E_CANVAS_BACKGROUND (item); - if (GNOME_CANVAS_ITEM_CLASS (parent_class)->update) - GNOME_CANVAS_ITEM_CLASS (parent_class)->update (item, affine, clip_path, flags); + if (GNOME_CANVAS_ITEM_CLASS (ecb_parent_class)->update) + GNOME_CANVAS_ITEM_CLASS (ecb_parent_class)->update (item, affine, clip_path, flags); o1.x = item->x1; o1.y = item->y1; @@ -191,8 +191,8 @@ ecb_dispose (GObject *object) ecb->priv = NULL; } - if (G_OBJECT_CLASS (parent_class)->dispose) - G_OBJECT_CLASS (parent_class)->dispose (object); + if (G_OBJECT_CLASS (ecb_parent_class)->dispose) + G_OBJECT_CLASS (ecb_parent_class)->dispose (object); } static void @@ -316,10 +316,8 @@ ecb_get_property (GObject *object, } static void -ecb_init (GnomeCanvasItem *item) +ecb_init (ECanvasBackground *ecb) { - ECanvasBackground *ecb = E_CANVAS_BACKGROUND (item); - ecb->priv = g_new (ECanvasBackgroundPrivate, 1); ecb->priv->color.pixel = 0; @@ -339,8 +337,8 @@ ecb_realize (GnomeCanvasItem *item) { ECanvasBackground *ecb = E_CANVAS_BACKGROUND (item); - if (GNOME_CANVAS_ITEM_CLASS (parent_class)->realize) - GNOME_CANVAS_ITEM_CLASS (parent_class)->realize (item); + if (GNOME_CANVAS_ITEM_CLASS (ecb_parent_class)->realize) + GNOME_CANVAS_ITEM_CLASS (ecb_parent_class)->realize (item); ecb->priv->gc = gdk_gc_new (item->canvas->layout.bin_window); get_color (ecb); @@ -361,8 +359,8 @@ ecb_unrealize (GnomeCanvasItem *item) g_object_unref (ecb->priv->gc); ecb->priv->gc = NULL; - if (GNOME_CANVAS_ITEM_CLASS (parent_class)->unrealize) - GNOME_CANVAS_ITEM_CLASS (parent_class)->unrealize (item); + if (GNOME_CANVAS_ITEM_CLASS (ecb_parent_class)->unrealize) + GNOME_CANVAS_ITEM_CLASS (ecb_parent_class)->unrealize (item); } static void @@ -433,12 +431,10 @@ ecb_style_set (ECanvasBackground *ecb, GtkStyle *previous_style) } static void -ecb_class_init (GObjectClass *object_class) +ecb_class_init (ECanvasBackgroundClass *ecb_class) { - GnomeCanvasItemClass *item_class = (GnomeCanvasItemClass *) object_class; - ECanvasBackgroundClass *ecb_class = (ECanvasBackgroundClass *) object_class; - - parent_class = g_type_class_ref (PARENT_OBJECT_TYPE); + GnomeCanvasItemClass *item_class = GNOME_CANVAS_ITEM_CLASS (ecb_class); + GObjectClass *object_class = G_OBJECT_CLASS (ecb_class); object_class->dispose = ecb_dispose; object_class->set_property = ecb_set_property; @@ -517,9 +513,3 @@ ecb_class_init (GObjectClass *object_class) G_TYPE_NONE, 1, GTK_TYPE_STYLE); } -E_MAKE_TYPE (e_canvas_background, - "ECanvasBackground", - ECanvasBackground, - ecb_class_init, - ecb_init, - PARENT_OBJECT_TYPE) diff --git a/widgets/misc/e-canvas-vbox.c b/widgets/misc/e-canvas-vbox.c index 20562bc039..a53da60710 100644 --- a/widgets/misc/e-canvas-vbox.c +++ b/widgets/misc/e-canvas-vbox.c @@ -50,9 +50,6 @@ static void e_canvas_vbox_real_add_item(ECanvasVbox *e_canvas_vbox, GnomeCanvasI static void e_canvas_vbox_real_add_item_start(ECanvasVbox *e_canvas_vbox, GnomeCanvasItem *item); static void e_canvas_vbox_resize_children (GnomeCanvasItem *item); -#define PARENT_TYPE GNOME_TYPE_CANVAS_GROUP -static GnomeCanvasGroupClass *parent_class = NULL; - /* The arguments we take */ enum { PROP_0, @@ -62,12 +59,7 @@ enum { PROP_SPACING }; -E_MAKE_TYPE (e_canvas_vbox, - "ECanvasVbox", - ECanvasVbox, - e_canvas_vbox_class_init, - e_canvas_vbox_init, - PARENT_TYPE) +G_DEFINE_TYPE (ECanvasVbox, e_canvas_vbox, GNOME_TYPE_CANVAS_GROUP) static void e_canvas_vbox_class_init (ECanvasVboxClass *klass) @@ -78,8 +70,6 @@ e_canvas_vbox_class_init (ECanvasVboxClass *klass) object_class = (GObjectClass*) klass; item_class = (GnomeCanvasItemClass *) klass; - parent_class = g_type_class_ref (PARENT_TYPE); - klass->add_item = e_canvas_vbox_real_add_item; klass->add_item_start = e_canvas_vbox_real_add_item_start; @@ -206,7 +196,7 @@ e_canvas_vbox_dispose (GObject *object) vbox->items = NULL; } - G_OBJECT_CLASS(parent_class)->dispose (object); + G_OBJECT_CLASS(e_canvas_vbox_parent_class)->dispose (object); } static gint @@ -239,8 +229,8 @@ e_canvas_vbox_event (GnomeCanvasItem *item, GdkEvent *event) break; } if (!return_val) { - if (GNOME_CANVAS_ITEM_CLASS(parent_class)->event) - return GNOME_CANVAS_ITEM_CLASS (parent_class)->event (item, event); + if (GNOME_CANVAS_ITEM_CLASS(e_canvas_vbox_parent_class)->event) + return GNOME_CANVAS_ITEM_CLASS (e_canvas_vbox_parent_class)->event (item, event); } return return_val; @@ -249,8 +239,8 @@ e_canvas_vbox_event (GnomeCanvasItem *item, GdkEvent *event) static void e_canvas_vbox_realize (GnomeCanvasItem *item) { - if (GNOME_CANVAS_ITEM_CLASS(parent_class)->realize) - (* GNOME_CANVAS_ITEM_CLASS(parent_class)->realize) (item); + if (GNOME_CANVAS_ITEM_CLASS(e_canvas_vbox_parent_class)->realize) + (* GNOME_CANVAS_ITEM_CLASS(e_canvas_vbox_parent_class)->realize) (item); e_canvas_vbox_resize_children(item); e_canvas_item_request_reflow(item); diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c index dee5d27b6d..be6ae0d93c 100644 --- a/widgets/misc/e-canvas.c +++ b/widgets/misc/e-canvas.c @@ -53,9 +53,6 @@ static void e_canvas_style_set (GtkWidget *widget, static int emit_event (GnomeCanvas *canvas, GdkEvent *event); -#define PARENT_TYPE GNOME_TYPE_CANVAS -static GnomeCanvasClass *parent_class = NULL; - #define d(x) enum { @@ -65,12 +62,7 @@ enum { static guint e_canvas_signals [LAST_SIGNAL] = { 0, }; -E_MAKE_TYPE (e_canvas, - "ECanvas", - ECanvas, - e_canvas_class_init, - e_canvas_init, - PARENT_TYPE) +G_DEFINE_TYPE (ECanvas, e_canvas, GNOME_TYPE_CANVAS) static void e_canvas_class_init (ECanvasClass *klass) @@ -81,8 +73,6 @@ e_canvas_class_init (ECanvasClass *klass) object_class = (GObjectClass*) klass; widget_class = (GtkWidgetClass *) klass; - parent_class = g_type_class_ref (PARENT_TYPE); - object_class->dispose = e_canvas_dispose; widget_class->key_press_event = e_canvas_key; @@ -146,8 +136,8 @@ e_canvas_dispose (GObject *object) e_canvas_hide_tooltip(canvas); - if ((G_OBJECT_CLASS (parent_class))->dispose) - (*(G_OBJECT_CLASS (parent_class))->dispose) (object); + if ((G_OBJECT_CLASS (e_canvas_parent_class))->dispose) + (*(G_OBJECT_CLASS (e_canvas_parent_class))->dispose) (object); } GtkWidget * @@ -683,8 +673,8 @@ e_canvas_realize (GtkWidget *widget) { ECanvas *ecanvas = E_CANVAS (widget); - if (GTK_WIDGET_CLASS (parent_class)->realize) - (* GTK_WIDGET_CLASS (parent_class)->realize) (widget); + if (GTK_WIDGET_CLASS (e_canvas_parent_class)->realize) + (* GTK_WIDGET_CLASS (e_canvas_parent_class)->realize) (widget); gdk_window_set_back_pixmap (GTK_LAYOUT (widget)->bin_window, NULL, FALSE); @@ -703,8 +693,8 @@ e_canvas_unrealize (GtkWidget *widget) gtk_im_context_set_client_window (ecanvas->im_context, NULL); - if (GTK_WIDGET_CLASS (parent_class)->unrealize) - (* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget); + if (GTK_WIDGET_CLASS (e_canvas_parent_class)->unrealize) + (* GTK_WIDGET_CLASS (e_canvas_parent_class)->unrealize) (widget); } static void diff --git a/widgets/misc/e-printable.c b/widgets/misc/e-printable.c index b9d9221404..3792c79711 100644 --- a/widgets/misc/e-printable.c +++ b/widgets/misc/e-printable.c @@ -34,10 +34,7 @@ #define EP_CLASS(e) ((EPrintableClass *)((GtkObject *)e)->klass) -#define PARENT_TYPE GTK_TYPE_OBJECT - - -static GtkObjectClass *e_printable_parent_class; +G_DEFINE_TYPE (EPrintable, e_printable, GTK_TYPE_OBJECT) enum { PRINT_PAGE, @@ -51,10 +48,9 @@ enum { static guint e_printable_signals [LAST_SIGNAL] = { 0, }; static void -e_printable_class_init (GtkObjectClass *object_class) +e_printable_class_init (EPrintableClass *klass) { - EPrintableClass *klass = E_PRINTABLE_CLASS(object_class); - e_printable_parent_class = g_type_class_ref (PARENT_TYPE); + GObjectClass *object_class = G_OBJECT_CLASS (klass); e_printable_signals [PRINT_PAGE] = g_signal_new ("print_page", @@ -111,13 +107,11 @@ e_printable_class_init (GtkObjectClass *object_class) klass->will_fit = NULL; } - -E_MAKE_TYPE (e_printable, - "EPrintable", - EPrintable, - e_printable_class_init, - NULL, - PARENT_TYPE) +static void +e_printable_init (EPrintable *e_printable) +{ + /* nothing to do */ +} EPrintable * e_printable_new(void) diff --git a/widgets/misc/e-reflow-model.c b/widgets/misc/e-reflow-model.c index a96b17fc68..09630133e1 100644 --- a/widgets/misc/e-reflow-model.c +++ b/widgets/misc/e-reflow-model.c @@ -29,15 +29,13 @@ #include "e-reflow-model.h" -#define PARENT_TYPE G_TYPE_OBJECT +G_DEFINE_TYPE (EReflowModel, e_reflow_model, G_TYPE_OBJECT) #define d(x) d(static gint depth = 0;) -static GObjectClass *e_reflow_model_parent_class; - enum { MODEL_CHANGED, COMPARISON_CHANGED, @@ -153,10 +151,9 @@ e_reflow_model_reincarnate (EReflowModel *e_reflow_model, int n, GnomeCanvasItem } static void -e_reflow_model_class_init (GObjectClass *object_class) +e_reflow_model_class_init (EReflowModelClass *klass) { - EReflowModelClass *klass = E_REFLOW_MODEL_CLASS(object_class); - e_reflow_model_parent_class = g_type_class_ref (PARENT_TYPE); + GObjectClass *object_class = G_OBJECT_CLASS (klass); e_reflow_model_signals [MODEL_CHANGED] = g_signal_new ("model_changed", @@ -217,13 +214,10 @@ e_reflow_model_class_init (GObjectClass *object_class) } static void -e_reflow_model_init (GObject *object) +e_reflow_model_init (EReflowModel *e_reflow_model) { } -E_MAKE_TYPE(e_reflow_model, "EReflowModel", EReflowModel, - e_reflow_model_class_init, e_reflow_model_init, PARENT_TYPE) - #if d(!)0 static void print_tabs (void) diff --git a/widgets/misc/e-reflow.c b/widgets/misc/e-reflow.c index 594ea1f87b..abae2d54d2 100644 --- a/widgets/misc/e-reflow.c +++ b/widgets/misc/e-reflow.c @@ -56,8 +56,7 @@ static void e_reflow_resize_children (GnomeCanvasItem *item); #define E_REFLOW_BORDER_WIDTH 7 #define E_REFLOW_FULL_GUTTER (E_REFLOW_DIVIDER_WIDTH + E_REFLOW_BORDER_WIDTH * 2) -#define PARENT_TYPE GNOME_TYPE_CANVAS_GROUP -static GnomeCanvasGroupClass *parent_class = NULL; +G_DEFINE_TYPE (EReflow, e_reflow, GNOME_TYPE_CANVAS_GROUP) /* The arguments we take */ enum { @@ -825,7 +824,7 @@ e_reflow_dispose (GObject *object) reflow->sorter = NULL; } - G_OBJECT_CLASS(parent_class)->dispose (object); + G_OBJECT_CLASS(e_reflow_parent_class)->dispose (object); } static void @@ -838,8 +837,8 @@ e_reflow_realize (GnomeCanvasItem *item) reflow = E_REFLOW (item); - if (GNOME_CANVAS_ITEM_CLASS(parent_class)->realize) - (* GNOME_CANVAS_ITEM_CLASS(parent_class)->realize) (item); + if (GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->realize) + (* GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->realize) (item); reflow->arrow_cursor = gdk_cursor_new (GDK_SB_H_DOUBLE_ARROW); reflow->default_cursor = gdk_cursor_new (GDK_LEFT_PTR); @@ -893,8 +892,8 @@ e_reflow_unrealize (GnomeCanvasItem *item) disconnect_set_adjustment (reflow); disconnect_adjustment (reflow); - if (GNOME_CANVAS_ITEM_CLASS(parent_class)->unrealize) - (* GNOME_CANVAS_ITEM_CLASS(parent_class)->unrealize) (item); + if (GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->unrealize) + (* GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->unrealize) (item); } static gboolean @@ -1108,8 +1107,8 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) } if (return_val) return return_val; - else if (GNOME_CANVAS_ITEM_CLASS( parent_class )->event) - return (* GNOME_CANVAS_ITEM_CLASS( parent_class )->event) (item, event); + else if (GNOME_CANVAS_ITEM_CLASS( e_reflow_parent_class )->event) + return (* GNOME_CANVAS_ITEM_CLASS( e_reflow_parent_class )->event) (item, event); else return FALSE; } @@ -1123,8 +1122,8 @@ static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int i; double column_width; - if (GNOME_CANVAS_ITEM_CLASS(parent_class)->draw) - GNOME_CANVAS_ITEM_CLASS(parent_class)->draw (item, drawable, x, y, width, height); + if (GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->draw) + GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->draw (item, drawable, x, y, width, height); column_width = reflow->column_width; running_width = E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH; x_rect = running_width; @@ -1196,8 +1195,8 @@ e_reflow_update (GnomeCanvasItem *item, double affine[6], ArtSVP *clip_path, gin reflow = E_REFLOW (item); - if (GNOME_CANVAS_ITEM_CLASS(parent_class)->update) - GNOME_CANVAS_ITEM_CLASS(parent_class)->update (item, affine, clip_path, flags); + if (GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->update) + GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->update (item, affine, clip_path, flags); x0 = item->x1; y0 = item->y1; @@ -1280,8 +1279,8 @@ e_reflow_point (GnomeCanvasItem *item, *actual_item = NULL; - if (GNOME_CANVAS_ITEM_CLASS(parent_class)->point) - distance = GNOME_CANVAS_ITEM_CLASS(parent_class)->point (item, x, y, cx, cy, actual_item); + if (GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->point) + distance = GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->point (item, x, y, cx, cy, actual_item); if ((int) (distance * item->canvas->pixels_per_unit + 0.5) <= item->canvas->close_enough && *actual_item) return distance; @@ -1407,8 +1406,6 @@ e_reflow_class_init (EReflowClass *klass) object_class = (GObjectClass*) klass; item_class = (GnomeCanvasItemClass *) klass; - parent_class = g_type_class_ref (PARENT_TYPE); - object_class->set_property = e_reflow_set_property; object_class->get_property = e_reflow_get_property; object_class->dispose = e_reflow_dispose; @@ -1546,9 +1543,3 @@ e_reflow_init (EReflow *reflow) e_canvas_item_set_reflow_callback(GNOME_CANVAS_ITEM(reflow), e_reflow_reflow); } -E_MAKE_TYPE (e_reflow, - "EReflow", - EReflow, - e_reflow_class_init, - e_reflow_init, - PARENT_TYPE) diff --git a/widgets/misc/e-selection-model-array.c b/widgets/misc/e-selection-model-array.c index 3f91ba42cc..f73a67faf2 100644 --- a/widgets/misc/e-selection-model-array.c +++ b/widgets/misc/e-selection-model-array.c @@ -30,9 +30,7 @@ #include "e-selection-model-array.h" -#define PARENT_TYPE e_selection_model_get_type () - -static ESelectionModelClass *parent_class; +G_DEFINE_TYPE (ESelectionModelArray, e_selection_model_array, e_selection_model_get_type()) enum { PROP_0, @@ -142,8 +140,8 @@ esma_dispose (GObject *object) esma->eba = NULL; } - if (G_OBJECT_CLASS (parent_class)->dispose) - (* G_OBJECT_CLASS (parent_class)->dispose) (object); + if (G_OBJECT_CLASS (e_selection_model_array_parent_class)->dispose) + (* G_OBJECT_CLASS (e_selection_model_array_parent_class)->dispose) (object); } static void @@ -513,8 +511,6 @@ e_selection_model_array_class_init (ESelectionModelArrayClass *klass) GObjectClass *object_class; ESelectionModelClass *esm_class; - parent_class = g_type_class_ref (PARENT_TYPE); - object_class = G_OBJECT_CLASS(klass); esm_class = E_SELECTION_MODEL_CLASS(klass); @@ -557,5 +553,3 @@ e_selection_model_array_class_init (ESelectionModelArrayClass *klass) G_PARAM_READWRITE)); } -E_MAKE_TYPE(e_selection_model_array, "ESelectionModelArray", ESelectionModelArray, - e_selection_model_array_class_init, e_selection_model_array_init, PARENT_TYPE) diff --git a/widgets/misc/e-selection-model-simple.c b/widgets/misc/e-selection-model-simple.c index ad33815135..e023f3cb89 100644 --- a/widgets/misc/e-selection-model-simple.c +++ b/widgets/misc/e-selection-model-simple.c @@ -28,10 +28,6 @@ #include "e-selection-model-array.h" #include "e-selection-model-simple.h" -#define PARENT_TYPE e_selection_model_array_get_type () - -static ESelectionModelArray *parent_class; - static gint esms_get_row_count (ESelectionModelArray *esma); static void @@ -45,15 +41,12 @@ e_selection_model_simple_class_init (ESelectionModelSimpleClass *klass) { ESelectionModelArrayClass *esma_class; - parent_class = g_type_class_ref (PARENT_TYPE); - esma_class = E_SELECTION_MODEL_ARRAY_CLASS(klass); esma_class->get_row_count = esms_get_row_count; } -E_MAKE_TYPE(e_selection_model_simple, "ESelectionModelSimple", ESelectionModelSimple, - e_selection_model_simple_class_init, e_selection_model_simple_init, PARENT_TYPE) +G_DEFINE_TYPE (ESelectionModelSimple, e_selection_model_simple, e_selection_model_array_get_type()) /** * e_selection_model_simple_new diff --git a/widgets/misc/e-selection-model.c b/widgets/misc/e-selection-model.c index 21eba118f2..5c24d44f49 100644 --- a/widgets/misc/e-selection-model.c +++ b/widgets/misc/e-selection-model.c @@ -31,9 +31,7 @@ #include "e-selection-model.h" -#define PARENT_TYPE G_TYPE_OBJECT - -static GObjectClass *e_selection_model_parent_class; +G_DEFINE_TYPE (ESelectionModel, e_selection_model, G_TYPE_OBJECT) enum { CURSOR_CHANGED, @@ -79,8 +77,8 @@ esm_dispose (GObject *object) drop_sorter(esm); - if (e_selection_model_parent_class->dispose) - (* e_selection_model_parent_class->dispose) (object); + if (G_OBJECT_CLASS (e_selection_model_parent_class)->dispose) + (* G_OBJECT_CLASS (e_selection_model_parent_class)->dispose) (object); } static void @@ -142,8 +140,6 @@ e_selection_model_class_init (ESelectionModelClass *klass) { GObjectClass *object_class; - e_selection_model_parent_class = g_type_class_ref (PARENT_TYPE); - object_class = G_OBJECT_CLASS(klass); object_class->dispose = esm_dispose; @@ -233,9 +229,6 @@ e_selection_model_class_init (ESelectionModelClass *klass) G_PARAM_READWRITE)); } -E_MAKE_TYPE(e_selection_model, "ESelectionModel", ESelectionModel, - e_selection_model_class_init, e_selection_model_init, PARENT_TYPE) - /** * e_selection_model_is_row_selected * @selection: #ESelectionModel to check |