From ba0bc7dff09ade6b8014183c44c4c44b42ed1396 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Fri, 26 Nov 2004 15:15:36 +0000 Subject: test prog 2004-11-26 JP Rosevear * test-info-label.c: test prog * e-url-entry.c: get image directly from icon factory * e-combo-button.c: ditto; convert to G_DEFINE_TYPE * e-activity-handler.c: convert to G_DEFINE_TYPE * e-task-widget.c: ditto * e-task-bar.c: ditto * e-multi-config-dialog.c: ditto * e-dropdown-button.c: ditto * e-cell-renderer-combo.c: ditto * e-cell-date-edit.c: ditto * e-calendar.c: ditto * e-calendar-item.c: ditto * Makefile.am: don't build the title bar, build an info label test program svn path=/trunk/; revision=27999 --- widgets/misc/e-cell-renderer-combo.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'widgets/misc/e-cell-renderer-combo.c') diff --git a/widgets/misc/e-cell-renderer-combo.c b/widgets/misc/e-cell-renderer-combo.c index 8ead96c4e8..562d940582 100644 --- a/widgets/misc/e-cell-renderer-combo.c +++ b/widgets/misc/e-cell-renderer-combo.c @@ -20,11 +20,13 @@ * Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H #include +#endif + #include #include #include -#include #include "e-combo-cell-editable.h" #include "e-cell-renderer-combo.h" @@ -40,7 +42,7 @@ struct _ECellRendererComboPriv { GList *list; }; -static GtkCellRendererTextClass *parent_class; +G_DEFINE_TYPE (ECellRendererCombo, e_cell_renderer_combo, GTK_TYPE_CELL_RENDERER_TEXT) static void ecrc_editing_done (GtkCellEditable *editable, ECellRendererCombo *cell) @@ -88,8 +90,8 @@ ecrc_get_size (GtkCellRenderer *cell, GtkWidget *widget, GdkRectangle *cell_area GtkWidget *btn; GtkRequisition req; - if (GTK_CELL_RENDERER_CLASS (parent_class)->get_size) - GTK_CELL_RENDERER_CLASS (parent_class)->get_size (cell, widget, cell_area, x_offset, y_offset, width, height); + if (GTK_CELL_RENDERER_CLASS (e_cell_renderer_combo_parent_class)->get_size) + GTK_CELL_RENDERER_CLASS (e_cell_renderer_combo_parent_class)->get_size (cell, widget, cell_area, x_offset, y_offset, width, height); btn = gtk_button_new (); gtk_container_add (GTK_CONTAINER (btn), gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE)); @@ -141,24 +143,22 @@ ecrc_finalize (GObject *obj) g_free (cell->priv); - if (G_OBJECT_CLASS (parent_class)->finalize) - G_OBJECT_CLASS (parent_class)->finalize (obj); + if (G_OBJECT_CLASS (e_cell_renderer_combo_parent_class)->finalize) + G_OBJECT_CLASS (e_cell_renderer_combo_parent_class)->finalize (obj); } static void -ecrc_init (ECellRendererCombo *cell) +e_cell_renderer_combo_init (ECellRendererCombo *cell) { cell->priv = g_new0 (ECellRendererComboPriv, 1); } static void -ecrc_class_init (ECellRendererComboClass *class) +e_cell_renderer_combo_class_init (ECellRendererComboClass *class) { GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS (class); GObjectClass *obj_class = G_OBJECT_CLASS (class); - parent_class = GTK_CELL_RENDERER_TEXT_CLASS (g_type_class_peek_parent (class)); - obj_class->get_property = ecrc_get_prop; obj_class->set_property = ecrc_set_prop; obj_class->finalize = ecrc_finalize; @@ -170,8 +170,6 @@ ecrc_class_init (ECellRendererComboClass *class) g_param_spec_pointer ("list", "List", "List of items to popup.", G_PARAM_READWRITE)); } -E_MAKE_TYPE (e_cell_renderer_combo, "ECellRendererCombo", ECellRendererCombo, ecrc_class_init, ecrc_init, GTK_TYPE_CELL_RENDERER_TEXT) - GtkCellRenderer * e_cell_renderer_combo_new (void) { -- cgit