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 /e-util | |
parent | 08de5e9e147248b84bc1fa618f7cc9d892ddb136 (diff) | |
download | gsoc2013-evolution-6baf4d9bcc8fac7d3ac4442ffa54138f9670b20f.tar.gz 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 'e-util')
-rw-r--r-- | e-util/ChangeLog | 10 | ||||
-rw-r--r-- | e-util/e-bit-array.c | 13 | ||||
-rw-r--r-- | e-util/e-sorter-array.c | 11 | ||||
-rw-r--r-- | e-util/e-sorter.c | 10 | ||||
-rw-r--r-- | e-util/e-text-event-processor-emacs-like.c | 12 | ||||
-rw-r--r-- | e-util/e-text-event-processor.c | 12 | ||||
-rw-r--r-- | e-util/e-util.h | 24 |
7 files changed, 21 insertions, 71 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog index b28edc8806..4e9a519b24 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,13 @@ +2007-07-27 Hiroyuki Ikezoe <poincare@ikezoe.net> + + * e-util.h: Remove E_MAKE_TYPE macro. + + * e-text-event-processor.c: + * e-sorter.c: + * e-text-event-processor-emacs-like.c: + * e-sorter-array.c: + * e-bit-array.c: Use G_DEFINE_TYPE instead of E_MAKE_TYPE. + 2007-07-26 Sankar P <psankar@novell.com> * e-plugin.c: (e_plugin_configure), (epl_configure), diff --git a/e-util/e-bit-array.c b/e-util/e-bit-array.c index 8fa7af134e..07728b4134 100644 --- a/e-util/e-bit-array.c +++ b/e-util/e-bit-array.c @@ -28,8 +28,6 @@ #include "e-bit-array.h" #include "e-util.h" -#define PARENT_TYPE G_TYPE_OBJECT - #define ONES ((guint32) 0xffffffff) #define BOX(n) ((n) / 32) @@ -38,7 +36,7 @@ #define BITMASK_LEFT(n) ((((n) % 32) == 0) ? 0 : (ONES << (32 - ((n) % 32)))) #define BITMASK_RIGHT(n) ((guint32)(((guint32) ONES) >> ((n) % 32))) -static GObjectClass *parent_class; +G_DEFINE_TYPE (EBitArray, e_bit_array, G_TYPE_OBJECT) static void e_bit_array_insert_real(EBitArray *eba, int row) @@ -151,8 +149,8 @@ eba_dispose (GObject *object) g_free(eba->data); eba->data = NULL; - if (G_OBJECT_CLASS (parent_class)->dispose) - (* G_OBJECT_CLASS (parent_class)->dispose) (object); + if (G_OBJECT_CLASS (e_bit_array_parent_class)->dispose) + (* G_OBJECT_CLASS (e_bit_array_parent_class)->dispose) (object); } /** @@ -411,16 +409,11 @@ e_bit_array_class_init (EBitArrayClass *klass) { GObjectClass *object_class; - parent_class = g_type_class_ref (PARENT_TYPE); - object_class = G_OBJECT_CLASS(klass); object_class->dispose = eba_dispose; } -E_MAKE_TYPE(e_bit_array, "EBitArray", EBitArray, - e_bit_array_class_init, e_bit_array_init, PARENT_TYPE) - EBitArray * e_bit_array_new (int count) { diff --git a/e-util/e-sorter-array.c b/e-util/e-sorter-array.c index 0f103a339a..894798f393 100644 --- a/e-util/e-sorter-array.c +++ b/e-util/e-sorter-array.c @@ -31,11 +31,9 @@ #define d(x) -#define PARENT_TYPE E_SORTER_TYPE - #define INCREMENT_AMOUNT 100 -static ESorterClass *parent_class; +G_DEFINE_TYPE (ESorterArray, e_sorter_array, E_SORTER_TYPE) static void esa_sort (ESorterArray *esa); static void esa_backsort (ESorterArray *esa); @@ -237,12 +235,10 @@ e_sorter_array_new (ECompareRowsFunc compare, gpointer closure) } static void -esa_class_init (ESorterArrayClass *klass) +e_sorter_array_class_init (ESorterArrayClass *klass) { ESorterClass *sorter_class = E_SORTER_CLASS(klass); - parent_class = g_type_class_ref (PARENT_TYPE); - sorter_class->model_to_sorted = esa_model_to_sorted ; sorter_class->sorted_to_model = esa_sorted_to_model ; sorter_class->get_model_to_sorted_array = esa_get_model_to_sorted_array ; @@ -251,7 +247,7 @@ esa_class_init (ESorterArrayClass *klass) } static void -esa_init (ESorterArray *esa) +e_sorter_array_init (ESorterArray *esa) { esa->rows = 0; esa->compare = NULL; @@ -260,4 +256,3 @@ esa_init (ESorterArray *esa) esa->backsorted = NULL; } -E_MAKE_TYPE(e_sorter_array, "ESorterArray", ESorterArray, esa_class_init, esa_init, PARENT_TYPE) diff --git a/e-util/e-sorter.c b/e-util/e-sorter.c index 4ac07809be..624cf7660b 100644 --- a/e-util/e-sorter.c +++ b/e-util/e-sorter.c @@ -33,7 +33,7 @@ #define PARENT_TYPE G_TYPE_OBJECT -static GObjectClass *parent_class; +G_DEFINE_TYPE (ESorter, e_sorter, G_TYPE_OBJECT) static gint es_model_to_sorted (ESorter *es, int row); static gint es_sorted_to_model (ESorter *es, int row); @@ -42,10 +42,8 @@ static void es_get_sorted_to_model_array (ESorter *es, int **array, int *count); static gboolean es_needs_sorting(ESorter *es); static void -es_class_init (ESorterClass *klass) +e_sorter_class_init (ESorterClass *klass) { - parent_class = g_type_class_ref (PARENT_TYPE); - klass->model_to_sorted = es_model_to_sorted; klass->sorted_to_model = es_sorted_to_model; klass->get_model_to_sorted_array = es_get_model_to_sorted_array; @@ -54,12 +52,10 @@ es_class_init (ESorterClass *klass) } static void -es_init (ESorter *es) +e_sorter_init (ESorter *es) { } -E_MAKE_TYPE(e_sorter, "ESorter", ESorter, es_class_init, es_init, PARENT_TYPE) - ESorter * e_sorter_new (void) { diff --git a/e-util/e-text-event-processor-emacs-like.c b/e-util/e-text-event-processor-emacs-like.c index b04ae724f5..a5935fde06 100644 --- a/e-util/e-text-event-processor-emacs-like.c +++ b/e-util/e-text-event-processor-emacs-like.c @@ -34,8 +34,7 @@ static void e_text_event_processor_emacs_like_init (ETextEventProcessorEmacsLik static void e_text_event_processor_emacs_like_class_init (ETextEventProcessorEmacsLikeClass *klass); static gint e_text_event_processor_emacs_like_event (ETextEventProcessor *tep, ETextEventProcessorEvent *event); -#define PARENT_TYPE E_TEXT_EVENT_PROCESSOR_TYPE -static ETextEventProcessorClass *parent_class = NULL; +G_DEFINE_TYPE (ETextEventProcessorEmacsLike, e_text_event_processor_emacs_like, E_TEXT_EVENT_PROCESSOR_TYPE) /* The arguments we take */ enum { @@ -103,13 +102,6 @@ static const ETextEventProcessorCommand alt_keys[26] = }; -E_MAKE_TYPE (e_text_event_processor_emacs_like, - "ETextEventProcessorEmacsLike", - ETextEventProcessorEmacsLike, - e_text_event_processor_emacs_like_class_init, - e_text_event_processor_emacs_like_init, - PARENT_TYPE) - static void e_text_event_processor_emacs_like_class_init (ETextEventProcessorEmacsLikeClass *klass) { @@ -117,8 +109,6 @@ e_text_event_processor_emacs_like_class_init (ETextEventProcessorEmacsLikeClass processor_class = (ETextEventProcessorClass*) klass; - parent_class = g_type_class_ref (PARENT_TYPE); - processor_class->event = e_text_event_processor_emacs_like_event; } diff --git a/e-util/e-text-event-processor.c b/e-util/e-text-event-processor.c index c5dc27cc7d..9f9ca211d2 100644 --- a/e-util/e-text-event-processor.c +++ b/e-util/e-text-event-processor.c @@ -41,9 +41,6 @@ static void e_text_event_processor_get_property (GObject *object, GValue *value, GParamSpec *pspec); -#define PARENT_TYPE G_TYPE_OBJECT -static GObjectClass *parent_class = NULL; - /* The arguments we take */ enum { PROP_0, @@ -57,12 +54,7 @@ enum { static guint e_tep_signals[E_TEP_LAST_SIGNAL] = { 0 }; -E_MAKE_TYPE (e_text_event_processor, - "ETextEventProcessor", - ETextEventProcessor, - e_text_event_processor_class_init, - e_text_event_processor_init, - PARENT_TYPE) +G_DEFINE_TYPE (ETextEventProcessor, e_text_event_processor, G_TYPE_OBJECT) static void e_text_event_processor_class_init (ETextEventProcessorClass *klass) @@ -71,8 +63,6 @@ e_text_event_processor_class_init (ETextEventProcessorClass *klass) object_class = (GObjectClass*) klass; - parent_class = g_type_class_ref (PARENT_TYPE); - object_class->set_property = e_text_event_processor_set_property; object_class->get_property = e_text_event_processor_get_property; diff --git a/e-util/e-util.h b/e-util/e-util.h index 2cbae35cb8..ce2c685372 100644 --- a/e-util/e-util.h +++ b/e-util/e-util.h @@ -37,30 +37,6 @@ extern "C" { #include <e-util/e-util-marshal.h> -#define E_MAKE_TYPE(l,str,t,ci,i,parent) \ -GType l##_get_type(void)\ -{\ - static GType type = 0; \ - if (!type){ \ - static GTypeInfo const object_info = { \ - sizeof (t##Class), \ - \ - (GBaseInitFunc) NULL, \ - (GBaseFinalizeFunc) NULL, \ - \ - (GClassInitFunc) ci, \ - (GClassFinalizeFunc) NULL, \ - NULL, /* class_data */ \ - \ - sizeof (t), \ - 0, /* n_preallocs */ \ - (GInstanceInitFunc) i, \ - }; \ - type = g_type_register_static (parent, str, &object_info, 0); \ - } \ - return type; \ -} - typedef enum { E_FOCUS_NONE, E_FOCUS_CURRENT, |