From 0597b877c5bf4d21ac4048742ddf6b11e24877ba Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 18 Jul 2008 16:23:26 +0000 Subject: ** Fixes bug #542125 2008-07-18 Matthew Barnes ** Fixes bug #542125 ** This set of changes migrates CompEditor, CompEditorPage and the various subclasses from using BonoboUI to GtkUIManager for menus and toolbars. It also substantially cleans up the code and streamlines the CompEditorPage API, making more effective use of GObject properties. Core changes: * gui/dialogs/comp-editor-page.c: * gui/dialogs/comp-editor-page.h: * gui/dialogs/comp-editor.c: * gui/dialogs/comp-editor.h: * gui/dialogs/event-editor.c: * gui/dialogs/event-editor.h: * gui/dialogs/event-page.c: * gui/dialogs/event-page.h: * gui/dialogs/memo-editor.c: * gui/dialogs/memo-editor.h: * gui/dialogs/memo-page.c: * gui/dialogs/memo-page.h: * gui/dialogs/recurrence-page.c: * gui/dialogs/recurrence-page.h: * gui/dialogs/schedule-page.c: * gui/dialogs/schedule-page.h: * gui/dialogs/task-details-page.c: * gui/dialogs/task-details-page.h: * gui/dialogs/task-editor.c: * gui/dialogs/task-editor.h: * gui/dialogs/task-page.c: * gui/dialogs/task-page.h: Supporting changes: * gui/calendar-component.c: * gui/comp-editor-factory.c: * gui/e-cal-popup.c: * gui/e-calendar-table.c: * gui/e-calendar-view.c: * gui/e-comp-editor-registry.c: * gui/e-memo-table.c: * gui/e-tasks.c: * gui/gnome-cal.c: * gui/memos-component.c: * gui/tasks-component.c: * gui/dialogs/alarm-dialog.c: * gui/dialogs/comp-editor-util.c: * art/Makefile.am: Move query-free-busy.png to data/icons. svn path=/trunk/; revision=35753 --- calendar/gui/dialogs/comp-editor-page.h | 123 +++++++++++++++----------------- 1 file changed, 57 insertions(+), 66 deletions(-) (limited to 'calendar/gui/dialogs/comp-editor-page.h') diff --git a/calendar/gui/dialogs/comp-editor-page.h b/calendar/gui/dialogs/comp-editor-page.h index 950b38fd6a..736ca1c8dc 100644 --- a/calendar/gui/dialogs/comp-editor-page.h +++ b/calendar/gui/dialogs/comp-editor-page.h @@ -26,15 +26,33 @@ #include #include +/* Standard GObject macros */ +#define TYPE_COMP_EDITOR_PAGE \ + (comp_editor_page_get_type ()) +#define COMP_EDITOR_PAGE(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), TYPE_COMP_EDITOR_PAGE, CompEditorPage)) +#define COMP_EDITOR_PAGE_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), TYPE_COMP_EDITOR_PAGE, CompEditorPageClass)) +#define IS_COMP_EDITOR_PAGE(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), TYPE_COMP_EDITOR_PAGE)) +#define IS_COMP_EDITOR_PAGE_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((obj), TYPE_COMP_EDITOR_PAGE)) +#define COMP_EDITOR_PAGE_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), TYPE_COMP_EDITOR_PAGE, CompEditorPageClass)) + G_BEGIN_DECLS - +/* Use a forward declaration to avoid a circular reference. */ +struct _CompEditor; -#define TYPE_COMP_EDITOR_PAGE (comp_editor_page_get_type ()) -#define COMP_EDITOR_PAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_COMP_EDITOR_PAGE, CompEditorPage)) -#define COMP_EDITOR_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_COMP_EDITOR_PAGE, CompEditorPageClass)) -#define IS_COMP_EDITOR_PAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_COMP_EDITOR_PAGE)) -#define IS_COMP_EDITOR_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), TYPE_COMP_EDITOR_PAGE)) +typedef struct _CompEditorPage CompEditorPage; +typedef struct _CompEditorPageClass CompEditorPageClass; +typedef struct _CompEditorPagePrivate CompEditorPagePrivate; typedef struct { ECalComponentDateTime *start; @@ -43,45 +61,25 @@ typedef struct { struct icaltimetype *complete; } CompEditorPageDates; -typedef enum { - COMP_EDITOR_PAGE_NEW_ITEM = 1<<0, - COMP_EDITOR_PAGE_MEETING = 1<<1, - COMP_EDITOR_PAGE_DELEGATE = 1<<2, - COMP_EDITOR_PAGE_USER_ORG = 1<<3, - COMP_EDITOR_PAGE_IS_ASSIGNED = 1<<4, - COMP_EDITOR_PAGE_IS_SHARED = 1<<5 -} CompEditorPageFlags; - -typedef struct { +struct _CompEditorPage { GObject object; - /* Some of the pages need the ECal to access timezone data. Also, - * the event page needs to know it to fill the source option menu. */ - ECal *client; - /* The GtkAccelGroup for the page. We install this when the page is mapped, and uninstall when it is unmapped. libglade would do this normally, but we create our pages individually so have to do it ourselves. */ GtkAccelGroup *accel_group; - CompEditorPageFlags flags; + CompEditorPagePrivate *priv; +}; -} CompEditorPage; - -typedef struct { +struct _CompEditorPageClass { GObjectClass parent_class; /* Notification signals */ - void (* changed) (CompEditorPage *page); - void (* needs_send) (CompEditorPage *page); - - void (* summary_changed) (CompEditorPage *page, const char *summary); void (* dates_changed) (CompEditorPage *page, const char *dates); - void (* client_changed) (CompEditorPage *page, ECal *client); - void (* focus_in) (CompEditorPage *page, GtkWidget *widget); - void (* focus_out) (CompEditorPage *page, GtkWidget *widget); + /* Virtual methods */ GtkWidget *(* get_widget) (CompEditorPage *page); @@ -91,42 +89,35 @@ typedef struct { gboolean (* fill_component) (CompEditorPage *page, ECalComponent *comp); gboolean (* fill_timezones) (CompEditorPage *page, GHashTable *timezones); - void (* set_summary) (CompEditorPage *page, const char *summary); void (* set_dates) (CompEditorPage *page, CompEditorPageDates *dates); -} CompEditorPageClass; - -GType comp_editor_page_get_type (void); -GtkWidget *comp_editor_page_get_widget (CompEditorPage *page); -void comp_editor_page_focus_main_widget (CompEditorPage *page); -void comp_editor_page_unset_focused_widget (CompEditorPage *page, GtkWidget *widget); -void comp_editor_page_set_focused_widget (CompEditorPage *page, GtkWidget *widget); -gboolean comp_editor_page_fill_widgets (CompEditorPage *page, - ECalComponent *comp); -gboolean comp_editor_page_fill_component (CompEditorPage *page, - ECalComponent *comp); -gboolean comp_editor_page_fill_timezones (CompEditorPage *page, - GHashTable *timezones); -void comp_editor_page_set_e_cal (CompEditorPage *page, - ECal *client); -void comp_editor_page_set_summary (CompEditorPage *page, - const char *summary); -void comp_editor_page_set_dates (CompEditorPage *page, - CompEditorPageDates *dates); -void comp_editor_page_notify_changed (CompEditorPage *page); -void comp_editor_page_notify_needs_send (CompEditorPage *page); -void comp_editor_page_notify_summary_changed (CompEditorPage *page, - const char *summary); -void comp_editor_page_notify_dates_changed (CompEditorPage *page, - CompEditorPageDates *dates); -void comp_editor_page_notify_client_changed (CompEditorPage *page, - ECal *client); -void comp_editor_page_display_validation_error (CompEditorPage *page, - const char *msg, - GtkWidget *field); - - - +}; + +GType comp_editor_page_get_type (void); +struct _CompEditor * + comp_editor_page_get_editor (CompEditorPage *page); +GtkWidget * comp_editor_page_get_widget (CompEditorPage *page); +gboolean comp_editor_page_get_updating (CompEditorPage *page); +void comp_editor_page_set_updating (CompEditorPage *page, + gboolean updating); +void comp_editor_page_changed (CompEditorPage *page); +void comp_editor_page_focus_main_widget + (CompEditorPage *page); +gboolean comp_editor_page_fill_widgets (CompEditorPage *page, + ECalComponent *comp); +gboolean comp_editor_page_fill_component (CompEditorPage *page, + ECalComponent *comp); +gboolean comp_editor_page_fill_timezones (CompEditorPage *page, + GHashTable *timezones); +void comp_editor_page_set_dates (CompEditorPage *page, + CompEditorPageDates *dates); +void comp_editor_page_notify_dates_changed + (CompEditorPage *page, + CompEditorPageDates *dates); +void comp_editor_page_display_validation_error + (CompEditorPage *page, + const char *msg, + GtkWidget *field); G_END_DECLS -#endif +#endif /* COMP_EDITOR_PAGE_H */ -- cgit