aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/gnome-cal.h
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@helixcode.com>2000-09-08 14:39:05 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2000-09-08 14:39:05 +0800
commita38d76bc2e91964b73ffac3efcb043db54bf2189 (patch)
tree8ed2564db7ff3ff60a50b162fc3a75039e322d3e /calendar/gui/gnome-cal.h
parent0a8b44f162e3d1db26967e972b99a39e174369e6 (diff)
downloadgsoc2013-evolution-a38d76bc2e91964b73ffac3efcb043db54bf2189.tar.gz
gsoc2013-evolution-a38d76bc2e91964b73ffac3efcb043db54bf2189.tar.zst
gsoc2013-evolution-a38d76bc2e91964b73ffac3efcb043db54bf2189.zip
Fall equinox cleanup!
2000-09-08 Federico Mena Quintero <federico@helixcode.com> Fall equinox cleanup! OK, I know the equinox is not here yet, but weather has changed enough to warrant it. Sigh. This place is definitely not the tropics. * gui/gnome-cal.c (obj_updated_cb): Renamed from gnome_calendar_object_updated_cb(); fixed prototype. (obj_removed_cb): Renamed from gnome_calendar_object_removed_cb(); fixed prototype. (GnomeCalendarPrivate): Moved all the GnomeCalendar fields to a private structure so I don't have to rebuild the whole calendar GUI directory every time something changes in the object. (GnomeCalendarPrivate): Removed the property bag and the control fields; they are local to the control-factory now. (gnome_calendar_update_view_buttons): Remove the ignore_view_button_clicks mess and just block the signal. (gnome_calendar_set_view): Added a "focus" argument to indicate whether we want the main widget in the specified view to grab the focus. (gnome_calendar_set_view_internal): Handle the focus argument here. (gnome_calendar_set_view_buttons): Temporary hack to notify the calendar about its buttons. (gnome_calendar_get_selected_time_range): New function. (gnome_calendar_get_cal_client): New function. * gui/control-factory.c (calendar_properties_init): Keep the property bag local to here; it does not need to be in the calendar object yet. (control_factory_fn): Renamed from control_factory(). Just use control_factory_new_control(). (control_factory_new_control): Moved the stuff over from create_control(), and keep the control local to here. Check the return value of bonobo_control_new(). * gui/calendar-commands.c (show_day_view_clicked): Remove the ignore_view_button_clicks mess. (new_calendar): Removed the useless "page" argument. (calendar_control_activate): Use gnome_calendar_set_view_buttons() for now. svn path=/trunk/; revision=5255
Diffstat (limited to 'calendar/gui/gnome-cal.h')
-rw-r--r--calendar/gui/gnome-cal.h118
1 files changed, 35 insertions, 83 deletions
diff --git a/calendar/gui/gnome-cal.h b/calendar/gui/gnome-cal.h
index a3a171701f..6201c0d524 100644
--- a/calendar/gui/gnome-cal.h
+++ b/calendar/gui/gnome-cal.h
@@ -20,87 +20,27 @@ BEGIN_GNOME_DECLS
-/* These must match the page numbers in the GtkNotebook. */
-typedef enum {
- GNOME_CALENDAR_VIEW_DAY = 0,
- GNOME_CALENDAR_VIEW_WORK_WEEK = 1,
- GNOME_CALENDAR_VIEW_WEEK = 2,
- GNOME_CALENDAR_VIEW_MONTH = 3,
-
- GNOME_CALENDAR_VIEW_NOT_SET = 9
-} GnomeCalendarViewType;
-
-
-#define GNOME_CALENDAR(obj) GTK_CHECK_CAST(obj, gnome_calendar_get_type(), GnomeCalendar)
-#define GNOME_CALENDAR_CLASS(class) GTK_CHECK_CAST_CLASS(class, gnome_calendar_get_type(), GnomeCalendarClass)
-#define GNOME_IS_CALENDAR(obj) GTK_CHECK_TYPE(obj, gnome_calendar_get_type())
-
-typedef struct {
- GtkVBox vbox;
-
- CalClient *client;
-
- BonoboPropertyBag *properties;
- BonoboControl *control;
-
- GHashTable *object_editor_hash;
-
- /* This is the last selection explicitly selected by the user. We try
- to keep it the same when we switch views, but we may have to alter
- it depending on the view (e.g. the week views only select days, so
- any times are lost. */
- time_t selection_start_time;
- time_t selection_end_time;
-
- GtkWidget *hpane;
- GtkWidget *notebook;
- GtkWidget *vpane;
- ECalendar *date_navigator;
- GtkWidget *todo;
-
- GtkWidget *day_view;
- GtkWidget *work_week_view;
- GtkWidget *week_view;
- GtkWidget *month_view;
-
- /* These are the toolbar radio buttons for switching views. */
- GtkWidget *day_button;
- GtkWidget *work_week_button;
- GtkWidget *week_button;
- GtkWidget *month_button;
-
- /* This is the view currently shown. We use it to keep track of the
- positions of the panes. range_selected is TRUE if a range of dates
- was selected in the date navigator to show the view. */
- GnomeCalendarViewType current_view_type;
- gboolean range_selected;
-
- /* These are the saved positions of the panes. They are multiples of
- calendar month widths & heights in the date navigator, so that they
- will work OK after theme changes. */
- gfloat hpane_pos;
- gfloat vpane_pos;
- gfloat hpane_pos_month_view;
- gfloat vpane_pos_month_view;
-
- /* This is TRUE when we just want to set the state of the toolbar
- radio buttons without causing any related code to be executed.
- The "clicked" signal handlers just return when this is set. */
- gboolean ignore_view_button_clicks;
-
- /* The signal handler id for our GtkCalendar "day_selected" handler. */
- guint day_selected_id;
-
- /* Alarm ID for the midnight refresh function */
- gpointer midnight_alarm_refresh_id;
-
- /* UID->alarms hash */
- GHashTable *alarms;
-} GnomeCalendar;
-
-typedef struct {
+#define GNOME_TYPE_CALENDAR (gnome_calendar_get_type ())
+#define GNOME_CALENDAR(obj) (GTK_CHECK_CAST ((obj), GNOME_TYPE_CALENDAR, GnomeCalendar))
+#define GNOME_CALENDAR_CLASS(klass) (GTK_CHECK_CAST_CLASS ((klass), GNOME_TYPE_CALENDAR, \
+ GnomeCalendarClass))
+#define GNOME_IS_CALENDAR(obj) (GTK_CHECK_TYPE ((obj), GNOME_TYPE_CALENDAR))
+#define GNOME_IS_CALENDAR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GNOME_TYPE_CALENDAR))
+
+typedef struct _GnomeCalendar GnomeCalendar;
+typedef struct _GnomeCalendarClass GnomeCalendarClass;
+typedef struct _GnomeCalendarPrivate GnomeCalendarPrivate;
+
+struct _GnomeCalendar {
+ GtkVBox vbox;
+
+ /* Private data */
+ GnomeCalendarPrivate *priv;
+};
+
+struct _GnomeCalendarClass {
GtkVBoxClass parent_class;
-} GnomeCalendarClass;
+};
typedef enum {
@@ -108,10 +48,12 @@ typedef enum {
CALENDAR_OPEN_OR_CREATE
} GnomeCalendarOpenMode;
-guint gnome_calendar_get_type (void);
+GtkType gnome_calendar_get_type (void);
GtkWidget *gnome_calendar_construct (GnomeCalendar *gcal);
-GtkWidget *gnome_calendar_new (char *title);
+GtkWidget *gnome_calendar_new (void);
+
+CalClient *gnome_calendar_get_cal_client (GnomeCalendar *gcal);
int gnome_calendar_open (GnomeCalendar *gcal,
char *file,
@@ -133,11 +75,15 @@ void gnome_calendar_tag_calendar (GnomeCalendar *gcal,
char *gnome_calendar_get_current_view_name (GnomeCalendar *gcal);
void gnome_calendar_set_view (GnomeCalendar *gcal,
char *page_name,
- gboolean reset_range_shown);
+ gboolean reset_range_shown,
+ gboolean focus);
void gnome_calendar_set_selected_time_range (GnomeCalendar *gcal,
time_t start_time,
time_t end_time);
+void gnome_calendar_get_selected_time_range (GnomeCalendar *gcal,
+ time_t *start_time,
+ time_t *end_time);
void gnome_calendar_edit_object (GnomeCalendar *gcal,
CalComponent *comp);
@@ -165,6 +111,12 @@ void gnome_calendar_colors_changed (GnomeCalendar *gcal);
void gnome_calendar_todo_properties_changed (GnomeCalendar *gcal);
+void gnome_calendar_set_view_buttons (GnomeCalendar *gcal,
+ GtkWidget *day_button,
+ GtkWidget *work_week_button,
+ GtkWidget *week_button,
+ GtkWidget *month_button);
+
/* This makes the appropriate radio button in the toolbar active.
It sets the ignore_view_button_clicks flag so the "clicked" signal handlers
just return without doing anything. */