aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-week-view.h
diff options
context:
space:
mode:
authorDamon Chaplin <damon@helixcode.com>2000-11-29 08:19:44 +0800
committerDamon Chaplin <damon@src.gnome.org>2000-11-29 08:19:44 +0800
commite1635ef07ac4dbbb2511a01ed32ef096399d11fb (patch)
treeb2dd3c3596335e2ad97bfd863fb54242beadf467 /calendar/gui/e-week-view.h
parent2eabc063bc04b4c2cd74b6829f939b036f937792 (diff)
downloadgsoc2013-evolution-e1635ef07ac4dbbb2511a01ed32ef096399d11fb.tar
gsoc2013-evolution-e1635ef07ac4dbbb2511a01ed32ef096399d11fb.tar.gz
gsoc2013-evolution-e1635ef07ac4dbbb2511a01ed32ef096399d11fb.tar.bz2
gsoc2013-evolution-e1635ef07ac4dbbb2511a01ed32ef096399d11fb.tar.lz
gsoc2013-evolution-e1635ef07ac4dbbb2511a01ed32ef096399d11fb.tar.xz
gsoc2013-evolution-e1635ef07ac4dbbb2511a01ed32ef096399d11fb.tar.zst
gsoc2013-evolution-e1635ef07ac4dbbb2511a01ed32ef096399d11fb.zip
finished 12-hour support and tried to tidy up & comment the drawing code
2000-11-28 Damon Chaplin <damon@helixcode.com> * gui/e-day-view*.[hc]: * gui/e-week-view*.[hc]: finished 12-hour support and tried to tidy up & comment the drawing code in places. Also fixed a couple of bugs I spotted. All the options on the 'Calendar' page should now work. svn path=/trunk/; revision=6706
Diffstat (limited to 'calendar/gui/e-week-view.h')
-rw-r--r--calendar/gui/e-week-view.h47
1 files changed, 38 insertions, 9 deletions
diff --git a/calendar/gui/e-week-view.h b/calendar/gui/e-week-view.h
index ccd11bf84a..aa9ba05fb9 100644
--- a/calendar/gui/e-week-view.h
+++ b/calendar/gui/e-week-view.h
@@ -41,30 +41,38 @@ extern "C" {
but we allow 6 for longer selections. */
#define E_WEEK_VIEW_MAX_WEEKS 6
-/* The size of the reminder & recurrence icons, and padding around them. */
+/* The size of the reminder & recurrence icons, and padding around them.
+ X_PAD is the padding between icons. R_PAD is the padding on the right of
+ the last icon, before the event text. */
#define E_WEEK_VIEW_ICON_WIDTH 16
#define E_WEEK_VIEW_ICON_HEIGHT 16
#define E_WEEK_VIEW_ICON_X_PAD 0
#define E_WEEK_VIEW_ICON_Y_PAD 0
+#define E_WEEK_VIEW_ICON_R_PAD 2
-/* The space on the left & right of the event. (The triangle to indicate the
- event continues is displayed in this space). */
+/* The space on the left & right outside of the event. (The triangle to
+ indicate the event continues is displayed in this space). */
#define E_WEEK_VIEW_EVENT_L_PAD 2
-#define E_WEEK_VIEW_EVENT_R_PAD 3
+#define E_WEEK_VIEW_EVENT_R_PAD 2
/* The vertical spacing between rows of events. */
#define E_WEEK_VIEW_EVENT_Y_SPACING 1
-/* The size of the border around the event. */
+/* The size of the border around long events. */
#define E_WEEK_VIEW_EVENT_BORDER_WIDTH 1
#define E_WEEK_VIEW_EVENT_BORDER_HEIGHT 1
-/* The padding on each side of the event text. */
-#define E_WEEK_VIEW_EVENT_TEXT_X_PAD 4
+/* The padding on the top and bottom of the event text. */
#define E_WEEK_VIEW_EVENT_TEXT_Y_PAD 1
-/* The space on the right of the time string, if it is shown. */
-#define E_WEEK_VIEW_EVENT_TIME_R_PAD 2
+/* The space between the start and end times. */
+#define E_WEEK_VIEW_EVENT_TIME_SPACING 2
+
+/* The space between the time and the event text or icons. */
+#define E_WEEK_VIEW_EVENT_TIME_X_PAD 2
+
+/* The space between the borders of long events and any text of icons. */
+#define E_WEEK_VIEW_EVENT_EDGE_X_PAD 2
/* The padding above and on the right of the date string at the top of each
cell. */
@@ -213,6 +221,9 @@ struct _EWeekView
/* The first day of the week, 0 (Monday) to 6 (Sunday). */
gint week_start_day;
+ /* Whether we use 12-hour of 24-hour format. */
+ gboolean use_24_hour_format;
+
/* The first day of the week we display, 0 (Monday) to 6 (Sunday).
This will usually be week_start_day, but if the weekend is
compressed, and week_start_day is Sunday we have to use Saturday. */
@@ -315,6 +326,12 @@ struct _EWeekView
/* The last mouse position when dragging, in the entire canvas. */
gint drag_event_x;
gint drag_event_y;
+
+ /* "am" and "pm" in the current locale, and their widths. */
+ gchar *am_string;
+ gchar *pm_string;
+ gint am_string_width;
+ gint pm_string_width;
};
struct _EWeekViewClass
@@ -377,6 +394,11 @@ gint e_week_view_get_week_start_day (EWeekView *week_view);
void e_week_view_set_week_start_day (EWeekView *week_view,
gint week_start_day);
+/* Whether we use 12-hour or 24-hour format. */
+gboolean e_week_view_get_24_hour_format (EWeekView *week_view);
+void e_week_view_set_24_hour_format (EWeekView *week_view,
+ gboolean use_24_hour);
+
/*
@@ -406,6 +428,13 @@ void e_week_view_show_popup_menu (EWeekView *week_view,
GdkEventButton *event,
gint event_num);
+void e_week_view_convert_time_to_display (EWeekView *week_view,
+ gint hour,
+ gint *display_hour,
+ gchar **suffix,
+ gint *suffix_width);
+gint e_week_view_get_time_string_width (EWeekView *week_view);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */