diff options
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/e-day-view-config.c | 19 | ||||
-rw-r--r-- | calendar/gui/e-day-view-main-item.c | 17 | ||||
-rw-r--r-- | calendar/gui/e-day-view-time-item.c | 17 | ||||
-rw-r--r-- | calendar/gui/e-day-view-top-item.c | 18 | ||||
-rw-r--r-- | calendar/gui/e-day-view.c | 27 |
5 files changed, 35 insertions, 63 deletions
diff --git a/calendar/gui/e-day-view-config.c b/calendar/gui/e-day-view-config.c index 4b53f1a350..d2843ed042 100644 --- a/calendar/gui/e-day-view-config.c +++ b/calendar/gui/e-day-view-config.c @@ -30,14 +30,14 @@ struct _EDayViewConfigPrivate { GList *notifications; }; -static GObjectClass *parent_class = NULL; - /* Property IDs */ enum props { PROP_0, PROP_VIEW, }; +G_DEFINE_TYPE (EDayViewConfig, e_day_view_config, G_TYPE_OBJECT); + static void e_day_view_config_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { @@ -86,8 +86,8 @@ e_day_view_config_dispose (GObject *object) e_day_view_config_set_view (view_config, NULL); - if (G_OBJECT_CLASS (parent_class)->dispose) - G_OBJECT_CLASS (parent_class)->dispose (object); + if (G_OBJECT_CLASS (e_day_view_config_parent_class)->dispose) + G_OBJECT_CLASS (e_day_view_config_parent_class)->dispose (object); } static void @@ -100,8 +100,8 @@ e_day_view_config_finalize (GObject *object) g_free (priv); - if (G_OBJECT_CLASS (parent_class)->finalize) - G_OBJECT_CLASS (parent_class)->finalize (object); + if (G_OBJECT_CLASS (e_day_view_config_parent_class)->finalize) + G_OBJECT_CLASS (e_day_view_config_parent_class)->finalize (object); } static void @@ -110,8 +110,6 @@ e_day_view_config_class_init (EDayViewConfigClass *klass) GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GParamSpec *spec; - parent_class = g_type_class_peek_parent (klass); - /* Method override */ gobject_class->set_property = e_day_view_config_set_property; gobject_class->get_property = e_day_view_config_get_property; @@ -124,15 +122,12 @@ e_day_view_config_class_init (EDayViewConfigClass *klass) } static void -e_day_view_config_init (EDayViewConfig *view_config, EDayViewConfigClass *klass) +e_day_view_config_init (EDayViewConfig *view_config) { view_config->priv = g_new0 (EDayViewConfigPrivate, 1); } -E_MAKE_TYPE (e_day_view_config, "EDayViewConfig", EDayViewConfig, e_day_view_config_class_init, - e_day_view_config_init, G_TYPE_OBJECT); - EDayViewConfig * e_day_view_config_new (EDayView *day_view) { diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c index a63a4da13c..4aaf02fcfb 100644 --- a/calendar/gui/e-day-view-main-item.c +++ b/calendar/gui/e-day-view-main-item.c @@ -27,15 +27,15 @@ * data in the main Day/Work Week display. */ +#ifdef HAVE_CONFIG_H #include <config.h> +#endif + #include "e-util/e-categories-config.h" #include "e-day-view-layout.h" #include "e-day-view-main-item.h" #include "ea-calendar.h" -static void e_day_view_main_item_class_init (EDayViewMainItemClass *class); -static void e_day_view_main_item_init (EDayViewMainItem *dvtitem); - static void e_day_view_main_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id); static void e_day_view_main_item_update (GnomeCanvasItem *item, @@ -74,16 +74,13 @@ static void e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, int width, int height, gint day, gint event_num); -static GnomeCanvasItemClass *parent_class; - /* The arguments we take */ enum { ARG_0, ARG_DAY_VIEW }; -E_MAKE_TYPE (e_day_view_main_item, "EDayViewMainItem", EDayViewMainItem, - e_day_view_main_item_class_init, e_day_view_main_item_init, GNOME_TYPE_CANVAS_ITEM); +G_DEFINE_TYPE (EDayViewMainItem, e_day_view_main_item, GNOME_TYPE_CANVAS_ITEM); static void e_day_view_main_item_class_init (EDayViewMainItemClass *class) @@ -91,8 +88,6 @@ e_day_view_main_item_class_init (EDayViewMainItemClass *class) GtkObjectClass *object_class; GnomeCanvasItemClass *item_class; - parent_class = g_type_class_peek_parent (class); - object_class = (GtkObjectClass *) class; item_class = (GnomeCanvasItemClass *) class; @@ -143,8 +138,8 @@ e_day_view_main_item_update (GnomeCanvasItem *item, ArtSVP *clip_path, int flags) { - 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_day_view_main_item_parent_class)->update) + (* GNOME_CANVAS_ITEM_CLASS (e_day_view_main_item_parent_class)->update) (item, affine, clip_path, flags); /* The item covers the entire canvas area. */ item->x1 = 0; diff --git a/calendar/gui/e-day-view-time-item.c b/calendar/gui/e-day-view-time-item.c index d70b0fd861..db4b66e54b 100644 --- a/calendar/gui/e-day-view-time-item.c +++ b/calendar/gui/e-day-view-time-item.c @@ -27,7 +27,10 @@ * the EDayView. */ +#ifdef HAVE_CONFIG_H #include <config.h> +#endif + #include <string.h> #include <glib.h> #include <gtk/gtksignal.h> @@ -59,8 +62,6 @@ #define E_DVTMI_LARGE_HOUR_Y_PAD 1 #define E_DVTMI_SMALL_FONT_Y_PAD 1 -static void e_day_view_time_item_class_init (EDayViewTimeItemClass *class); -static void e_day_view_time_item_init (EDayViewTimeItem *dvtmitem); static void e_day_view_time_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id); @@ -95,17 +96,13 @@ static gint e_day_view_time_item_convert_position_to_row (EDayViewTimeItem *dvtm gint y); -static GnomeCanvasItemClass *parent_class; - - /* The arguments we take */ enum { ARG_0, ARG_DAY_VIEW }; -E_MAKE_TYPE (e_day_view_time_item, "EDayViewTimeItem", EDayViewTimeItem, - e_day_view_time_item_class_init, e_day_view_time_item_init, GNOME_TYPE_CANVAS_ITEM); +G_DEFINE_TYPE (EDayViewTimeItem, e_day_view_time_item, GNOME_TYPE_CANVAS_ITEM); static void e_day_view_time_item_class_init (EDayViewTimeItemClass *class) @@ -113,8 +110,6 @@ e_day_view_time_item_class_init (EDayViewTimeItemClass *class) GtkObjectClass *object_class; GnomeCanvasItemClass *item_class; - parent_class = g_type_class_peek_parent (class); - object_class = (GtkObjectClass *) class; item_class = (GnomeCanvasItemClass *) class; @@ -162,8 +157,8 @@ e_day_view_time_item_update (GnomeCanvasItem *item, ArtSVP *clip_path, int flags) { - 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_day_view_time_item_parent_class)->update) + (* GNOME_CANVAS_ITEM_CLASS (e_day_view_time_item_parent_class)->update) (item, affine, clip_path, flags); /* The item covers the entire canvas area. */ item->x1 = 0; diff --git a/calendar/gui/e-day-view-top-item.c b/calendar/gui/e-day-view-top-item.c index c15278a3c8..c84ed2859c 100644 --- a/calendar/gui/e-day-view-top-item.c +++ b/calendar/gui/e-day-view-top-item.c @@ -25,17 +25,16 @@ * EDayViewTopItem - displays the top part of the Day/Work Week calendar view. */ +#ifdef HAVE_CONFIG_H #include <config.h> +#endif + #include <glib.h> #include <libgnome/gnome-i18n.h> -#include <gal/util/e-util.h> #include "e-util/e-categories-config.h" #include <libecal/e-cal-time-util.h> #include "e-day-view-top-item.h" -static void e_day_view_top_item_class_init (EDayViewTopItemClass *class); -static void e_day_view_top_item_init (EDayViewTopItem *dvtitem); - static void e_day_view_top_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id); @@ -73,16 +72,13 @@ static gint e_day_view_top_item_event (GnomeCanvasItem *item, GdkEvent *event); -static GnomeCanvasItemClass *parent_class; - /* The arguments we take */ enum { ARG_0, ARG_DAY_VIEW }; -E_MAKE_TYPE (e_day_view_top_item, "EDayViewTopItem", EDayViewTopItem, e_day_view_top_item_class_init, - e_day_view_top_item_init, GNOME_TYPE_CANVAS_ITEM); +G_DEFINE_TYPE (EDayViewTopItem, e_day_view_top_item, GNOME_TYPE_CANVAS_ITEM); static void e_day_view_top_item_class_init (EDayViewTopItemClass *class) @@ -90,8 +86,6 @@ e_day_view_top_item_class_init (EDayViewTopItemClass *class) GtkObjectClass *object_class; GnomeCanvasItemClass *item_class; - parent_class = g_type_class_peek_parent (class); - object_class = (GtkObjectClass *) class; item_class = (GnomeCanvasItemClass *) class; @@ -139,8 +133,8 @@ e_day_view_top_item_update (GnomeCanvasItem *item, ArtSVP *clip_path, int flags) { - 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_day_view_top_item_parent_class)->update) + (* GNOME_CANVAS_ITEM_CLASS (e_day_view_top_item_parent_class)->update) (item, affine, clip_path, flags); /* The item covers the entire canvas area. */ item->x1 = 0; diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 89cacdd655..bd43acdabd 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -47,7 +47,6 @@ #include <gal/widgets/e-popup-menu.h> #include <gal/widgets/e-gui-utils.h> #include <gal/widgets/e-unicode.h> -#include <gal/util/e-util.h> #include <libgnomecanvas/gnome-canvas-rect-ellipse.h> #include <libgnome/gnome-i18n.h> #include <libgnome/gnome-exec.h> @@ -122,8 +121,6 @@ static GtkTargetEntry target_table[] = { }; static guint n_targets = sizeof(target_table) / sizeof(target_table[0]); -static void e_day_view_class_init (EDayViewClass *class); -static void e_day_view_init (EDayView *day_view); static void e_day_view_destroy (GtkObject *object); static void e_day_view_realize (GtkWidget *widget); static void e_day_view_unrealize (GtkWidget *widget); @@ -441,10 +438,7 @@ static void e_day_view_queue_layout (EDayView *day_view); static void e_day_view_cancel_layout (EDayView *day_view); static gboolean e_day_view_layout_timeout_cb (gpointer data); -static GtkTableClass *parent_class; - -E_MAKE_TYPE (e_day_view, "EDayView", EDayView, e_day_view_class_init, - e_day_view_init, e_calendar_view_get_type ()); +G_DEFINE_TYPE (EDayView, e_day_view, E_TYPE_CALENDAR_VIEW); static void e_day_view_class_init (EDayViewClass *class) @@ -453,7 +447,6 @@ e_day_view_class_init (EDayViewClass *class) GtkWidgetClass *widget_class; ECalendarViewClass *view_class; - parent_class = g_type_class_peek_parent (class); object_class = (GtkObjectClass *) class; widget_class = (GtkWidgetClass *) class; view_class = (ECalendarViewClass *) class; @@ -1137,7 +1130,7 @@ e_day_view_destroy (GtkObject *object) } } - GTK_OBJECT_CLASS (parent_class)->destroy (object); + GTK_OBJECT_CLASS (e_day_view_parent_class)->destroy (object); } @@ -1149,8 +1142,8 @@ e_day_view_realize (GtkWidget *widget) gboolean success[E_DAY_VIEW_COLOR_LAST]; gint nfailed; - if (GTK_WIDGET_CLASS (parent_class)->realize) - (*GTK_WIDGET_CLASS (parent_class)->realize)(widget); + if (GTK_WIDGET_CLASS (e_day_view_parent_class)->realize) + (*GTK_WIDGET_CLASS (e_day_view_parent_class)->realize)(widget); day_view = E_DAY_VIEW (widget); day_view->main_gc = gdk_gc_new (widget->window); @@ -1293,8 +1286,8 @@ e_day_view_unrealize (GtkWidget *widget) g_object_unref (day_view->meeting_icon); day_view->meeting_icon = NULL; - if (GTK_WIDGET_CLASS (parent_class)->unrealize) - (*GTK_WIDGET_CLASS (parent_class)->unrealize)(widget); + if (GTK_WIDGET_CLASS (e_day_view_parent_class)->unrealize) + (*GTK_WIDGET_CLASS (e_day_view_parent_class)->unrealize)(widget); } @@ -1317,8 +1310,8 @@ e_day_view_style_set (GtkWidget *widget, PangoFontMetrics *font_metrics; PangoLayout *layout; - if (GTK_WIDGET_CLASS (parent_class)->style_set) - (*GTK_WIDGET_CLASS (parent_class)->style_set)(widget, previous_style); + if (GTK_WIDGET_CLASS (e_day_view_parent_class)->style_set) + (*GTK_WIDGET_CLASS (e_day_view_parent_class)->style_set)(widget, previous_style); day_view = E_DAY_VIEW (widget); @@ -1476,7 +1469,7 @@ e_day_view_size_allocate (GtkWidget *widget, GtkAllocation *allocation) #endif day_view = E_DAY_VIEW (widget); - (*GTK_WIDGET_CLASS (parent_class)->size_allocate) (widget, allocation); + (*GTK_WIDGET_CLASS (e_day_view_parent_class)->size_allocate) (widget, allocation); e_day_view_recalc_cell_sizes (day_view); @@ -4889,7 +4882,7 @@ e_day_view_key_press (GtkWidget *widget, GdkEventKey *event) /* if not handled, try key bindings */ if (!handled) - handled = GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event); + handled = GTK_WIDGET_CLASS (e_day_view_parent_class)->key_press_event (widget, event); return handled; } |