aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/print.c
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/print.c
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/print.c')
-rw-r--r--calendar/gui/print.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/calendar/gui/print.c b/calendar/gui/print.c
index 99d60f3c92..0bb4e73f35 100644
--- a/calendar/gui/print.c
+++ b/calendar/gui/print.c
@@ -338,6 +338,7 @@ print_month_small (GnomePrintContext *pc, GnomeCalendar *gcal,
time_t month, double left, double right, double top, double bottom,
int titleflags, time_t greystart, time_t greyend, int bordertitle)
{
+ CalClient *client;
GnomeFont *font, *font_bold, *font_normal;
time_t now, next;
int x, y;
@@ -348,6 +349,8 @@ print_month_small (GnomePrintContext *pc, GnomeCalendar *gcal,
double xpad, ypad, size;
char *daynames[] = { _("Su"), _("Mo"), _("Tu"), _("We"), _("Th"), _("Fr"), _("Sa") };
+ client = gnome_calendar_get_cal_client (gcal);
+
xpad = (right-left)/7;
ypad = (top-bottom)/8.3;
if (xpad>ypad)
@@ -394,7 +397,9 @@ print_month_small (GnomePrintContext *pc, GnomeCalendar *gcal,
sprintf(buf, "%d", day);
/* this is a slow messy way to do this ... but easy ... */
- uids = cal_client_get_objects_in_range (gcal->client, CALOBJ_TYPE_EVENT, now, time_day_end (now));
+ uids = cal_client_get_objects_in_range (client,
+ CALOBJ_TYPE_EVENT,
+ now, time_day_end (now));
font = uids ? font_bold : font_normal;
cal_obj_uid_list_free (uids);
@@ -559,6 +564,7 @@ static void
print_day_details (GnomePrintContext *pc, GnomeCalendar *gcal, time_t whence,
double left, double right, double top, double bottom)
{
+ CalClient *client;
struct pdinfo pdi;
time_t start, end;
GList *l;
@@ -568,6 +574,8 @@ print_day_details (GnomePrintContext *pc, GnomeCalendar *gcal, time_t whence,
double width=40, slot_width;
char buf[20];
+ client = gnome_calendar_get_cal_client (gcal);
+
yinc = (top-bottom)/24;
/* fill static detail */
@@ -611,7 +619,7 @@ print_day_details (GnomePrintContext *pc, GnomeCalendar *gcal, time_t whence,
start = time_day_begin(whence);
end = time_day_end(start);
- cal_client_generate_instances (gcal->client, CALOBJ_TYPE_EVENT, start, end,
+ cal_client_generate_instances (client, CALOBJ_TYPE_EVENT, start, end,
print_day_details_cb, &pdi);
num_slots = g_list_length (pdi.slots);
@@ -687,6 +695,7 @@ print_day_summary (GnomePrintContext *pc, GnomeCalendar *gcal, time_t whence,
double left, double right, double top, double bottom,
double size, int totime, int titleformat)
{
+ CalClient *client;
struct psinfo psi;
time_t start, end;
GList *l;
@@ -696,6 +705,8 @@ print_day_summary (GnomePrintContext *pc, GnomeCalendar *gcal, time_t whence,
double margin;
struct tm tm;
+ client = gnome_calendar_get_cal_client (gcal);
+
/* fill static detail */
font_summary = gnome_font_new_closest ("Times", GNOME_FONT_BOOK, 0, size);
@@ -710,7 +721,7 @@ print_day_summary (GnomePrintContext *pc, GnomeCalendar *gcal, time_t whence,
titled_box (pc, buf, font_summary, ALIGN_RIGHT | ALIGN_BORDER,
&left, &right, &top, &bottom, 0.0);
- cal_client_generate_instances (gcal->client, CALOBJ_TYPE_EVENT, start, end,
+ cal_client_generate_instances (client, CALOBJ_TYPE_EVENT, start, end,
print_day_summary_cb, &psi);
inc = size*0.3;
incsmall = size*0.2;
@@ -924,11 +935,14 @@ static void
print_todo_details (GnomePrintContext *pc, GnomeCalendar *gcal, time_t start, time_t end,
double left, double right, double top, double bottom)
{
+ CalClient *client;
struct ptinfo pti;
GList *l;
GnomeFont *font_summary;
double y, yend, x, xend;
+ client = gnome_calendar_get_cal_client (gcal);
+
font_summary = gnome_font_new_closest ("Times", GNOME_FONT_BOOK, 0, 10);
gnome_print_setrgbcolor (pc, 0, 0, 0);
@@ -940,7 +954,7 @@ print_todo_details (GnomePrintContext *pc, GnomeCalendar *gcal, time_t start, ti
y = top - 3;
yend = bottom - 2;
- cal_client_generate_instances (gcal->client, CALOBJ_TYPE_TODO, start, end,
+ cal_client_generate_instances (client, CALOBJ_TYPE_TODO, start, end,
print_todo_details_cb, &pti);
for (l = pti.todos; l; l = l->next) {