aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/alarm-notify
diff options
context:
space:
mode:
authorSeth Alves <alves@src.gnome.org>2000-03-06 08:10:24 +0800
committerSeth Alves <alves@src.gnome.org>2000-03-06 08:10:24 +0800
commit34eff34dd935025d733904b03b20c764637d688a (patch)
treee9fd8dde3aac89e40d54cc030c1d0ddd823b2d52 /calendar/gui/alarm-notify
parent70108e31eafba17f63a04375d7e4c51c7d1c35eb (diff)
downloadgsoc2013-evolution-34eff34dd935025d733904b03b20c764637d688a.tar
gsoc2013-evolution-34eff34dd935025d733904b03b20c764637d688a.tar.gz
gsoc2013-evolution-34eff34dd935025d733904b03b20c764637d688a.tar.bz2
gsoc2013-evolution-34eff34dd935025d733904b03b20c764637d688a.tar.lz
gsoc2013-evolution-34eff34dd935025d733904b03b20c764637d688a.tar.xz
gsoc2013-evolution-34eff34dd935025d733904b03b20c764637d688a.tar.zst
gsoc2013-evolution-34eff34dd935025d733904b03b20c764637d688a.zip
stubs for client side access to alarm structures. this will probably
* cal-client/cal-client-alarm.c: stubs for client side access to alarm structures. this will probably change, since i don't know what i'm doing. * cal-util/alarm-enums.h: enums for alarms needed by both the client and the server * remaining source files in calendar/... have been moved to calendar/gui. * gui/alarm.c: start to decouple the view from the model in the alarm editing code svn path=/trunk/; revision=2062
Diffstat (limited to 'calendar/gui/alarm-notify')
-rw-r--r--calendar/gui/alarm-notify/alarm.c17
-rw-r--r--calendar/gui/alarm-notify/alarm.h23
2 files changed, 26 insertions, 14 deletions
diff --git a/calendar/gui/alarm-notify/alarm.c b/calendar/gui/alarm-notify/alarm.c
index b720d7a4e5..826effcbf0 100644
--- a/calendar/gui/alarm-notify/alarm.c
+++ b/calendar/gui/alarm-notify/alarm.c
@@ -11,8 +11,8 @@
#include <fcntl.h>
#include <signal.h>
#include <sys/time.h>
-#include "pcs/calobj.h"
#include "alarm.h"
+#include "cal-util/alarm-enums.h"
/* The pipes used to notify about an alarm */
int alarm_pipes [2];
@@ -26,7 +26,7 @@ typedef struct {
time_t activation_time;
AlarmFunction fn;
void *closure;
- CalendarAlarm *alarm;
+ CalendarAlarmUI *alarm;
} AlarmRecord;
enum DebugAction {
@@ -36,7 +36,7 @@ enum DebugAction {
};
void debug_alarm (AlarmRecord* ar, enum DebugAction action);
-void calendar_notify (time_t time, CalendarAlarm *which, void *data);
+void calendar_notify (time_t time, CalendarAlarmUI *which, void *data);
extern int debug_alarms;
/*
@@ -125,11 +125,11 @@ alarm_compare_by_time (gconstpointer a, gconstpointer b)
* Returns TRUE if the alarm was scheduled.
*/
gboolean
-alarm_add (CalendarAlarm *alarm, AlarmFunction fn, void *closure)
+alarm_add (CalendarAlarmUI *alarm, AlarmFunction fn, void *closure)
{
time_t now = time (NULL);
AlarmRecord *ar;
- time_t alarm_time = alarm->trigger;
+ time_t alarm_time = cal_client_alarm_get_trigger (alarm->alarm_handle);
ar = g_new0 (AlarmRecord, 1);
ar->activation_time = alarm_time;
@@ -215,7 +215,7 @@ void
debug_alarm (AlarmRecord* ar, enum DebugAction action)
{
time_t now = time (NULL);
- iCalObject *ico = ar->closure;
+ /* iCalObject *ico = ar->closure; */
printf ("%s", ctime(&now));
switch (action) {
case ALARM_ADDED:
@@ -230,8 +230,8 @@ debug_alarm (AlarmRecord* ar, enum DebugAction action)
}
if (ar->fn!=&calendar_notify) return;
- printf ("--- Summary: %s\n", ico->summary);
- switch (ar->alarm->type) {
+ /* printf ("--- Summary: %s\n", ico->summary);*/
+ switch (cal_client_alarm_get_type (ar->alarm->alarm_handle)) {
case ALARM_MAIL:
printf ("--- Type: Mail\n");
break;
@@ -247,4 +247,3 @@ debug_alarm (AlarmRecord* ar, enum DebugAction action)
}
}
-
diff --git a/calendar/gui/alarm-notify/alarm.h b/calendar/gui/alarm-notify/alarm.h
index 6bb5c1afa5..7e16952240 100644
--- a/calendar/gui/alarm-notify/alarm.h
+++ b/calendar/gui/alarm-notify/alarm.h
@@ -2,12 +2,25 @@
#define ALARM_H
#include <time.h>
-#include "pcs/calobj.h"
+#include "cal-client/cal-client-alarm.h"
-typedef void (*AlarmFunction)(time_t time, CalendarAlarm *which, void *closuse);
+typedef struct {
+ /* Widgets */
+ void *w_count; /* A GtkEntry */
+ void *w_enabled; /* A GtkChecButton */
+ void *w_timesel; /* A GtkMenu */
+ void *w_entry; /* A GnomeEntryFile/GtkEntry for PROGRAM/MAIL */
+ void *w_label;
-void alarm_init (void);
-gboolean alarm_add (CalendarAlarm *alarm, AlarmFunction fn, void *closure);
-int alarm_kill (void *closure);
+ AlarmHandle alarm_handle; /* something that hooks to the server */
+} CalendarAlarmUI;
+
+typedef void (*AlarmFunction) (time_t time,
+ CalendarAlarmUI *which,
+ void *closuse);
+
+void alarm_init (void);
+gboolean alarm_add (CalendarAlarmUI *alarm, AlarmFunction fn, void *closure);
+int alarm_kill (void *closure);
#endif