From 4369c400fc801eef03a6fdda2b5256972f018246 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Fri, 22 Dec 2000 17:29:39 +0000 Subject: Alarm trigger queueing for the GUI part. 2000-12-21 Federico Mena Quintero Alarm trigger queueing for the GUI part. * gui/alarm-notify.[ch]: New files with the high-level alarm notification system; mostly moved over from gnome-cal.c. The low-level timer stuff is still in alarm.[ch]. * gui/alarm-notify.c (alarm_notify_init): New function to initialize the alarm notification system. (alarm_notify_done): New function to shut down the alarm notification system. (alarm_notify_add_client): New function to start monitoring a calendar client for alarm notification. (alarm_notify_remove_client): New function to stop monitoring a client. * gui/alarm.h (AlarmDestroyNotify): Also pass in the alarm ID so the callback may know which ID is being destroyed. * gui/alarm.c (clear_itimer): New function. (pop_alarm): Use clear_itimer(). (alarm_done): New function to shut down the timer system. (alarm_add): Add some preconditions. Do not call the destroy notification function if we could not create the alarm. (alarm_ready): Pass the alarm ID to the destroy notify function. (alarm_remove): Likewise. Also, add some preconditions. * gui/gnome-cal.c: Removed the alarm notification functions from here since they are now in alarm-notify.c. (gnome_calendar_construct): Register the client with alarm_notify_add_client(). (gnome_calendar_destroy): Use alarm_notify_remove_client() to unregister the client. (obj_updated_cb): Do not do any alarm-related stuff. (obj_removed_cb): Likewise. * gui/main.c (main): Shut down the alarm timer system. (main): Initialize and shut down the alarm notification system. * gui/Makefile.am (evolution_calendar_SOURCES): Added alarm-notify.[ch] to the list of sources. * gui/calendar-model.c (calendar_model_set_cal_client): Only connect to the "cal_loaded" signal if the client is not already loaded. * gui/e-day-view.c (e_day_view_set_cal_client): Likewise. * gui/e-week-view.c (e_week_view_set_cal_client): Likewise. * gui/e-itip-control.c (update_calendar): Connect to "cal_loaded" before issuing the load request. svn path=/trunk/; revision=7130 --- calendar/gui/alarm-notify/alarm-queue.h | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 calendar/gui/alarm-notify/alarm-queue.h (limited to 'calendar/gui/alarm-notify/alarm-queue.h') diff --git a/calendar/gui/alarm-notify/alarm-queue.h b/calendar/gui/alarm-notify/alarm-queue.h new file mode 100644 index 0000000000..f386a56ae4 --- /dev/null +++ b/calendar/gui/alarm-notify/alarm-queue.h @@ -0,0 +1,35 @@ +/* Evolution calendar - Alarm notification engine + * + * Copyright (C) 2000 Helix Code, Inc. + * + * Authors: Federico Mena-Quintero + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef ALARM_NOTIFY_H +#define ALARM_NOTIFY_H + +#include + + +void alarm_notify_init (void); +void alarm_notify_done (void); + +void alarm_notify_add_client (CalClient *client); +void alarm_notify_remove_client (CalClient *client); + + +#endif -- cgit v1.2.3