aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/ChangeLog196
-rw-r--r--calendar/Makefile.am143
-rw-r--r--calendar/TODO9
-rw-r--r--calendar/cal-util/calobj.c83
-rw-r--r--calendar/calendar.c218
-rw-r--r--calendar/calobj.c83
-rw-r--r--calendar/doc/C/Makefile.am6
-rw-r--r--calendar/eventedit.c18
-rw-r--r--calendar/gncal.desktop12
-rw-r--r--calendar/gnome-cal.c54
-rw-r--r--calendar/gnome-cal.h2
-rw-r--r--calendar/gui/Makefile.am143
-rw-r--r--calendar/gui/calendar.c218
-rw-r--r--calendar/gui/eventedit.c18
-rw-r--r--calendar/gui/gncal.desktop12
-rw-r--r--calendar/gui/gnome-cal.c54
-rw-r--r--calendar/gui/gnome-cal.h2
-rw-r--r--calendar/gui/main.c59
-rw-r--r--calendar/gui/main.h3
-rw-r--r--calendar/gui/month-view.c3
-rw-r--r--calendar/gui/prop.c2
-rw-r--r--calendar/main.c59
-rw-r--r--calendar/main.h3
-rw-r--r--calendar/month-view.c3
-rw-r--r--calendar/pcs/calobj.c83
-rw-r--r--calendar/prop.c2
-rw-r--r--libversit/port.h22
-rw-r--r--libversit/vcc.c197
-rw-r--r--libversit/vcc.y2
-rw-r--r--macros/ChangeLog45
-rw-r--r--widgets/misc/e-colors.c73
-rw-r--r--widgets/misc/e-colors.h14
-rw-r--r--widgets/misc/e-cursors.c41
-rw-r--r--widgets/misc/e-cursors.h41
-rw-r--r--widgets/misc/pixmaps/cursor_cross.xpm38
-rw-r--r--widgets/misc/pixmaps/cursor_zoom_in.xpm37
-rw-r--r--widgets/misc/pixmaps/cursor_zoom_out.xpm37
37 files changed, 380 insertions, 1655 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 1dcc43d0fb..18e35995c8 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -21,55 +21,17 @@
* calobj.c (ical_object_generate_events): Get rid of pointers to
values returned from localtime, as it uses a static buffer.
-
-1999-09-26 Eskil Olsen <deity@eskil.dk>
- * corba-cal.c: the g_free that was commented out since glib said
- was a duplicate free, was supposed to be a free.
-
- * GnomeCal.idl/corba-cal.c: added a get_object_id_list and a
- get_objects_by_id_list. Latter is not done.
-
- * calendar-conduit.c: rewrote the way the conduit iterates over
- records. It no longers fetches all entries (since that didn't work
- with more then 285 entries. It now fetches the id list, and gets
- each record. (will be using get_objects_by_id_list to get records
- in amounts of 10 or so later, to reduce amount of corba calls).
-
- * calendar-conduit.c: now sets alarm parameters when transferring
- from gnomecal to pilot.
-
-1999-09-23 Eskil Olsen <deity@eskil.dk>
-
- * calendar-conduit.c: better merge of summary/description
- when doing ical_from_remote (update_record), also handles
- import from gnomecal to pilot better, and on both ways, repeat
- events are much better now.
-
-1999-09-22 Eskil Olsen <deity@eskil.dk>
-
- * corba-cal.c: commented out a g_free that glib reported
- as being a duplicate free.
- * calendar-conduit.c: got gnomecal->pilot up and runnning.
-
-1999-02-06 Lauris Kaplinski <lauris@ariman.ee>
-
- * gncal.desktop: Added Estonian translations.
-
+
1999-09-14 Federico Mena Quintero <federico@redhat.com>
* gncal-full-day.c (child_popup_menu): Set the data pointers for
all the items.
-1999-09-14 Kjartan Maraas <kmaraas@online.no>
+1999-09-13 Kjartan Maraas <kmaraas@online.no>
- * doc/C/gnomecal.sgml: Merge from gnome-pim-1-0. Synced with newest
- user-guide.
+ * doc/C/gnomecal.sgml: Updated and synced with the latest
+ version of gnome-users-guide. (1.0.6)
-1999-09-01 Miguel de Icaza <miguel@gnu.org>
-
- * eventedit.c (ee_create_buttons): Make the OK button the default
- button per Russell's suggestion.
-
1999-08-30 Miguel de Icaza <miguel@nuclecu.unam.mx>
* calendar.c (calendar_object_changed): Modify the
@@ -77,141 +39,71 @@
(calendar_add_object): Ditto.
Closes bug #676
-
+
* main.c (save_calendar_cmd): Fix problem in which we warned the
user about the calendar being modified the first time the calendar
was used.
-1999-08-22 Tomas Ogren <stric@ing.umu.se>
-
- * gnomecal.gnorba: "GenericFactoy" is wrong...
-
-1999-08-15 Miguel de Icaza <miguel@gnu.org>
-
- * calobj.c (ical_gen_uid): Fix the hostname part.
-
-1999-08-07 Peter Teichman <pat4@acpub.duke.edu>
-
- * calendar-pilot-sync.c (sync_pilot): sync correctly for objects
- created on the pilot, but not dirty (because they have been synced
- with some other program in the past)
-
-1999-07-30 Miguel de Icaza <miguel@gnu.org>
-
- * month-view.c (month_view_init): Release points here.
-
-1999-08-02 Peter Teichman <pat4@acpub.duke.edu>
-
- * Makefile.am (libcalendar_conduit_la_LDFLAGS):
- libcalendar_conduit now installs
-
- * calendar-pilot-sync.c (sync_pilot): do deletion of appointments
- correctly, when they are deleted on the pilot
- (conduit_free_Appointment): protect against double-freeing parts
- of the Appointment structure
- (update_record): all-day events from the pilot are handled a bit
- more reasonably
-
-1999-08-01 Peter Teichman <pat4@acpub.duke.edu>
-
- * calendar-pilot-sync.c (sync_object_to_pilot): The multi-day
- appointment corruption bug is dead. Whoo!
-
-1999-07-31 Peter Teichman <pat4@acpub.duke.edu>
-
- * Makefile.am: fixed this up slightly with respect to pilot conduits
-
-1999-07-30 Jonathan Blandford <jrb@redhat.com>
-
- * Makefile.am (libcalendar_conduit_la_LIBADD): More autoconf-stuff
-
-1999-07-29 Jonathan Blandford <jrb@redhat.com>
-
- * gnome-cal.c (setup_widgets): Add scrolling to the yearview.
-
-1999-07-28 Miguel de Icaza <miguel@gnu.org>
-
- * calendar-pilot-sync.c: (sync_object_to_pilot): If the enddate is
- not set, set the repeatForever to 1. This fixes all of the
- birthdays problems I had.
-
- Make the code not take arguments
- (sync_cal_to_pilot): Nice event update information
-
- * calendar.c (calendar_new): Add Event UID hash table.
- (calendar_add_object): Add events to the hash table here.
- (calendar_remove_object): Remove events here.
- (calendar_object_find_event): Use the hash table here.
-
- * main.c (save_calendar_cmd): The object is already destroyed by
- gnome_dialog_run.
+1999-04-27 Federico Mena Quintero <federico@nuclecu.unam.mx>
- * calendar-pilot-sync.c (sync_object_to_pilot): Do not turn
- archived bit on.
+ * gnome-month-item.c (gnome_month_item_set_arg): Fixed cut&paste
+ bug for day fontsets.
- * calobj.c (ical_gen_uid): Use the hostname, not the domain name.
- (ical_gen_uid): Add a serial number. Isodates can be small.
+1999-05-26 Russell Steinthal <steintr@condor.penguinpowered.com>
- * corba-cal.c (cal_repo_update_pilot_id): New method to update the
- pilot status.
- (cal_repo_get_updated_objects): New method. Returns a list of
- modified and not-sycned objects
+ * gncal-todo.c main.c main.h prop.c: Added support for priorities
+ for todo items. Doesn't do much, but you can set them and sort by
+ them. (Use the properties box to enable them; should they be on
+ by default?)
- * calendar-pilot-sync.c (sync_cal_to_pilot): New function to sync
- from the GnomeCalendar to the pilot.
- (sync_object_to_pilot): Sync a single event to the pilot.
- (try_alarm): Alarm syncing code.
+1999-05-25 Miguel de Icaza <miguel@nuclecu.unam.mx>
-1999-07-27 Miguel de Icaza <miguel@gnu.org>
+ * main.c (parse_an_arg): Added missing break here. It was causing
+ core dumps when invoked with --userfile.
- * calendar-pilot-sync.c: New file. Implements PalmPilot
- syncronization with the Gnome Calendar.
-
- * calobj.c (ical_object_new_from_string): New function. Creates
- an iCalObject from a vCalendar string that is supposed to contain
- only one vEvent.
+ * gnome-cal.c (gnome_calendar_set_view): Add some assertions here,
+ to pin point the bug reported on gnome-list.
- * calendar.c:
- (calendar_save): Split this routine in two.
+ * calobj.c (load_recurrence): Make intervals always exist. a 0
+ interval is wrong.
- * gnome-cal.c (gnome_calendar_new): Create the corba server here.
+1999-05-25 Federico Mena Quintero <federico@nuclecu.unam.mx>
- * main.c: Include gnorba.h, and corba-cal-factory.h here
- (close_cmd): Kill the calendar server on shutdown.
+ * year-view.c: Removed unused macro CALENDAR_HEIGHT.
- * calobj.c (load_recur_yearly_day): Added a fixme comment. WE
- need to handle intervals in the years.
+1999-05-25 Federico Mena Quintero <federico@nuclecu.unam.mx>
- * calendar.c (calendar_object_find_in_list, calendar_object_find,
- calendar_object_find_todo, calendar_object_find_event): New
- functions for looking up information.
+ * year-view.c (idle_handler): Set the canvas scroll region here,
+ not in size_allocate(). Also, use the correct width and height
+ based on the allocation and the precomputed minimum width/height
+ values.
- * main.c (gnome_calendar_locate): New function.
+ * gnome-cal.c (setup_widgets): Set the scrollbar policy of the
+ scrolled window.
- * corba-cal.c (calendar_create_object): New file. Implements the
- corba server.
+ * main.c (setup_appbar): Use the correct type for the appbar.
- * calendar.c (calendar_object_changed): Flag pilot-status as changed.
+ * gncal-day-view.c: Removed unused function switch_to_day().
- * calobj.c (ical_object_to_vobject): Save pilot information for syncing.
- (ical_object_create_from_vobject): Load syncing information for
- pilot. Do it in a way compatible with KOrganizer.
+ * gncal-day-panel.c (calendar_day_selected): Removed unused variable.
-1999-07-26 Miguel de Icaza <miguel@gnu.org>
+1999-05-25 Nat Friedman <nat@nat.org>
- * calobj.c (ical_object_create_from_vobject): Generate unique IDs
- on Vevents we load that lack it. WE need this for the old
- gnome calendar generated files (ie, before now :-).
+ * doc/C/gnomecal.sgml: Fixed a typo.
- Required to sync with the Palm
+ * gnome-cal.c (setup_widgets): Added a scrolled window widget into
+ which the year view is placed.
-1999-07-26 Miguel de Icaza <miguel@gnu.org>
+ * year-view.c (CALENDAR_HEIGHT): The height of the total year view
+ inside the scrolled window.
+ (idle_handler): Set the height of the year view to
+ CALENDAR_HEIGHT.
+ (year_view_size_allocate): Set the scroll region of the year view
+ canvas to allocation->width, CALENDAR_HEIGHT.
- * calobj.c (ical_object_create_from_vobject): Generate unique IDs
- on Vevents we load that lack it. WE need this for the old
- gnome calendar generated files (ie, before now :-).
+1999-04-25 Miguel de Icaza <miguel@nuclecu.unam.mx>
- Required to sync with the Palm
+ * main.c (dump_todo): Add --todo flag to dump the todo contents.
1999-07-19 Matt Martin <matt@abacusnet.net>
diff --git a/calendar/Makefile.am b/calendar/Makefile.am
index 5ed3d8fbae..b340b03a9d 100644
--- a/calendar/Makefile.am
+++ b/calendar/Makefile.am
@@ -1,48 +1,15 @@
SUBDIRS = doc
-idldir = $(datadir)/idl
-idl_DATA = GnomeCal.idl
-
-gnorbadir = $(sysconfdir)/CORBA/servers
-gnorba_DATA = gnomecal.gnorba
-
help_base = $(datadir)/gnome/help/cal
-if HAVE_GNOME_PILOT
-bin_PROGRAMS = gnomecal todo-conduit-control-applet calendar-conduit-control-appleta calendar-pilot-sync
-else
-bin_PROGRAMS = gnomecal
-endif
-
-INCLUDES = \
+INCLUDES = \
-I$(includedir) \
$(GNOME_INCLUDEDIR) \
- $(GNOME_CONDUIT_INCLUDEDIR) \
- $(PISOCK_INCLUDEDIR) \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\"
-GNOMECAL_CORBA_GENERATED = \
- GnomeCal.h \
- GnomeCal.c \
- GnomeCal-common.c \
- GnomeCal-skels.c \
- GnomeCal-stubs.c
-
-$(GNOMECAL_CORBA_GENERATED): my_gnomecal_idl
-
-my_gnomecal_idl: GnomeCal.idl
- orbit-idl $(srcdir)/GnomeCal.idl
- touch my_gnomecal_idl
-
-corba-cal.c \
-corba-cal.h \
-corba-cal-factory.c \
-corba-cal-factory.h: GnomeCal.h
+bin_PROGRAMS = gnomecal
gnomecal_SOURCES = \
- GnomeCal-common.c \
- GnomeCal-skels.c \
- GnomeCal.h \
alarm.c \
alarm.h \
calendar.c \
@@ -52,10 +19,6 @@ gnomecal_SOURCES = \
eventedit.c \
eventedit.h \
getdate.y \
- corba-cal.c \
- corba-cal.h \
- corba-cal-factory.c \
- corba-cal-factory.h \
gncal-day-panel.c \
gncal-day-panel.h \
gncal-day-view.c \
@@ -92,114 +55,21 @@ gnomecal_SOURCES = \
year-view.c \
year-view.h
-calendar_pilot_sync_SOURCES = \
- GnomeCal-common.c \
- GnomeCal-stubs.c \
- alarm.c \
- calendar-pilot-sync.c \
- calobj.c \
- calobj.h \
- calendar.c \
- calendar.h \
- timeutil.c \
- timeutil.h
-
LINK_FLAGS = \
$(GNOME_LIBDIR) \
$(GNOMEGNORBA_LIBS) \
- $(INTLLIBS) \
- ../libversit/libversit.la
-
-calendar_pilot_sync_LDADD = \
- $(PISOCK_LIBS) \
- $(LINK_FLAGS)
+ $(INTLLIBS) ../libversit/libversit.a
-if HAVE_GNOME_PILOT
-#calendar_conduit
-calendar_conduitsdir=$(libdir)/gnome-pilot/conduits
-
-calendar_conduits_LTLIBRARIES = libcalendar_conduit.la
-
-libcalendar_conduit_la_SOURCES = \
- calendar-conduit.c \
- calobj.c \
- alarm.c \
- GnomeCal-common.c \
- GnomeCal-stubs.c \
- calendar.c \
- timeutil.c
-
-libcalendar_conduit_la_LDFLAGS = \
- -rpath $(libdir)
-
-libcalendar_conduit_la_LIBADD = \
- ../libversit/libversit.la \
- $(PISOCK_LIBS) \
- $(GNOME_LIBDIR) \
- $(GNOME_LIBS)
-
-calendar_conduit_control_applet_SOURCES = \
- calendar-conduit-control-applet.c
-
-calendar_conduit_control_applet_LDADD = \
- $(CAPPLET_LIBS) \
- $(GNOME_LIBDIR) \
- $(GNOME_CAPPLET_LIBS) \
- $(PISOCK_LIBS) \
- $(GNOMEUI_LIBS) \
- $(PISOCK_LIBS) \
- $(GNOME_PILOT_LIBS) \
- $(INTLLIBS)
-
-#todo_conduit
-todo_conduitsdir=$(libdir)/gnome-pilot/conduits
-
-todo_conduits_LTLIBRARIES = libtodo_conduit.la
-
-libtodo_conduit_la_LDFLAGS = \
- -rpath $(libdir)
-
-libtodo_conduit_la_LIBADD = \
- $(GNOME_LIBDIR) \
- $(GNOME_LIBS)
-
-libtodo_conduit_la_SOURCES = \
- todo-conduit.c
-
-todo_conduit_control_applet_SOURCES = \
- todo-conduit-control-applet.c
-
-todo_conduit_control_applet_LDADD = \
- $(CAPPLET_LIBS) \
- $(GNOME_LIBDIR) \
- $(GNOME_CAPPLET_LIBS) \
- $(PISOCK_LIBS) \
- $(GNOMEUI_LIBS) \
- $(PISOCK_LIBS) \
- $(GNOME_PILOT_LIBS) \
- $(INTLLIBS)
-endif # HAVE_GNOME_PILOT
+#gncal_LDADD = $(LINK_FLAGS)
gnomecal_LDADD = $(LINK_FLAGS)
-if HAVE_GNOME_PILOT
-ccenterdir = $(datadir)/control-center
-Rootdir = $(ccenterdir)
-PalmPilotdir = $(ccenterdir)/Peripherals/PalmPilot
-Conduitsdir = $(PalmPilotdir)/Conduits
-
-Conduits_DATA = \
- calendar-conduit-control-applet.desktop \
- todo-conduit-control-applet.desktop
-endif
-
EXTRA_DIST = \
gncal.desktop \
bell.xpm \
- recur.xpm \
- $(idl_DATA) \
- $(gnorba_DATA)
+ recur.xpm
+
Productivitydir = $(datadir)/gnome/apps/Applications
@@ -207,4 +77,3 @@ Productivity_DATA = gncal.desktop
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(help_base)/C
- $(mkinstalldirs) $(Conduitsdir)
diff --git a/calendar/TODO b/calendar/TODO
index 2dbd29cdbb..5271b15909 100644
--- a/calendar/TODO
+++ b/calendar/TODO
@@ -1,12 +1,3 @@
-Pilot:
-
-* Better support for untimed events (we have none now).
-
-* Hash objects based on their UIDs.
-
-* Add placeholders for deleted events, so that we can kill those
- when syncing to the pilot.
-
BUGS:
- Recurrence end date is wrong. An event that repeats daily will not
diff --git a/calendar/cal-util/calobj.c b/calendar/cal-util/calobj.c
index 806c27d8ff..87133f7fab 100644
--- a/calendar/cal-util/calobj.c
+++ b/calendar/cal-util/calobj.c
@@ -18,28 +18,23 @@
static char *
ical_gen_uid (void)
{
- static char *hostname;
+ static char *domain;
time_t t = time (NULL);
- static int serial;
- if (!hostname){
+ if (!domain){
char buffer [128];
- if ((gethostname (buffer, sizeof (buffer)-1) == 0) &&
- (buffer [0] != 0))
- hostname = g_strdup (buffer);
- else
- hostname = g_strdup ("localhost");
+ getdomainname (buffer, sizeof (buffer)-1);
+ domain = g_strdup (domain);
}
return g_strdup_printf (
- "%s-%d-%d-%d-%d@%s",
+ "%s-%d-%d-%d@%s",
isodate_from_time_t (t),
getpid (),
getgid (),
getppid (),
- serial++,
- hostname);
+ domain);
}
iCalObject *
@@ -52,9 +47,6 @@ ical_object_new (void)
ico->seq = -1;
ico->dtstamp = time (NULL);
ico->uid = ical_gen_uid ();
-
- ico->pilot_id = 0;
- ico->pilot_status = ICAL_PILOT_SYNC_MOD;
return ico;
}
@@ -380,8 +372,6 @@ load_recur_yearly_day (iCalObject *o, char **str)
{
/* Skip as we do not support multiple days and we do expect
* the dtstart to agree with the value on this field
- *
- * FIXME: we should support every-n-years
*/
skip_numbers (str);
}
@@ -595,10 +585,8 @@ ical_object_create_from_vobject (VObject *o, const char *object_name)
if (has (o, VCUniqueStringProp)){
ical->uid = g_strdup (str_val (vo));
free (the_str);
- } else {
- ical->uid = ical_gen_uid ();
}
-
+
/* seq */
if (has (o, VCSequenceProp)){
ical->seq = atoi (str_val (vo));
@@ -792,22 +780,6 @@ ical_object_create_from_vobject (VObject *o, const char *object_name)
}
free (the_str);
}
-
- /*
- * Pilot
- */
- if (has (o, XPilotIdProp)){
- ical->pilot_id = atoi (str_val (vo));
- free (the_str);
- } else
- ical->pilot_id = 0;
-
- if (has (o, XPilotStatusProp)){
- ical->pilot_status = atoi (str_val (vo));
- free (the_str);
- } else
- ical->pilot_status = ICAL_PILOT_SYNC_MOD;
-
return ical;
}
@@ -1073,17 +1045,6 @@ ical_object_to_vobject (iCalObject *ical)
addPropValue (alarm, VCProcedureNameProp, ical->palarm.data);
if ((alarm = save_alarm (o, &ical->malarm, ical)))
addPropValue (alarm, VCEmailAddressProp, ical->malarm.data);
-
- /* Pilot */
- {
- char buffer [20];
-
- sprintf (buffer, "%d", ical->pilot_id);
- addPropValue (o, XPilotIdProp, buffer);
- sprintf (buffer, "%d", ical->pilot_status);
- addPropValue (o, XPilotStatusProp, buffer);
- }
-
return o;
}
@@ -1463,33 +1424,3 @@ alarm_compute_offset (CalendarAlarm *a)
}
return a->offset;
}
-
-iCalObject *
-ical_object_new_from_string (const char *vcal_string)
-{
- iCalObject *ical = NULL;
- VObject *cal, *event;
- VObjectIterator i;
- const char *object_name;
-
- cal = Parse_MIME (vcal_string, strlen (vcal_string));
-
- initPropIterator (&i, cal);
-
- while (moreIteration (&i)){
- event = nextVObject (&i);
-
- object_name = vObjectName (event);
-
- if (strcmp (object_name, VCEventProp) == 0){
- ical = ical_object_create_from_vobject (event, object_name);
- break;
- }
- }
-
- cleanVObject (cal);
- cleanStrTbl ();
-
- return ical;
-}
-
diff --git a/calendar/calendar.c b/calendar/calendar.c
index cffd2476c4..af0f0b1d36 100644
--- a/calendar/calendar.c
+++ b/calendar/calendar.c
@@ -4,7 +4,7 @@
* This keeps track of a given calendar. Eventually this will abtract everything
* related to getting calendars/saving calendars locally or to a remote Calendar Service
*
- * Copyright (C) 1998, 1999 the Free Software Foundation
+ * Copyright (C) 1998 the Free Software Foundation
*
* Authors:
* Miguel de Icaza (miguel@gnu.org)
@@ -12,8 +12,6 @@
*
*/
-#include <gnome.h>
-#include <stdio.h>
#include <config.h>
#include <unistd.h>
#include <sys/stat.h>
@@ -40,8 +38,6 @@ calendar_new (char *title)
cal->title = g_strdup (title);
- cal->event_hash = g_hash_table_new (g_str_hash, g_str_equal);
-
calendar_init_alarms (cal);
return cal;
@@ -76,7 +72,7 @@ add_object_alarms (iCalObject *obj, time_t start, time_t end, void *closure)
#define max(a,b) ((a > b) ? a : b)
-static void
+void
ical_object_try_alarms (iCalObject *obj)
{
int ao, po, od, mo;
@@ -97,14 +93,9 @@ ical_object_try_alarms (iCalObject *obj)
void
calendar_add_object (Calendar *cal, iCalObject *obj)
{
- g_return_if_fail (cal != NULL);
- g_return_if_fail (obj != NULL);
- g_return_if_fail (obj->uid != NULL);
-
obj->new = 0;
switch (obj->type){
case ICAL_EVENT:
- g_hash_table_insert (cal->event_hash, obj->uid, obj);
cal->events = g_list_prepend (cal->events, obj);
ical_object_try_alarms (obj);
#ifdef DEBUGGING_MAIL_ALARM
@@ -142,7 +133,6 @@ calendar_remove_object (Calendar *cal, iCalObject *obj)
switch (obj->type){
case ICAL_EVENT:
cal->events = g_list_remove (cal->events, obj);
- g_hash_table_remove (cal->event_hash, obj->uid);
break;
case ICAL_TODO:
@@ -171,8 +161,6 @@ calendar_destroy (Calendar *cal)
g_list_foreach (cal->journal, (GFunc) ical_object_destroy, NULL);
g_list_free (cal->journal);
- g_hash_table_destroy (cal->event_hash);
-
if (cal->title)
g_free (cal->title);
if (cal->filename)
@@ -181,6 +169,17 @@ calendar_destroy (Calendar *cal)
g_free (cal);
}
+char *
+ice (time_t t)
+{
+ static char buffer [100];
+ struct tm tm;
+
+ tm = *localtime (&t);
+ sprintf (buffer, "%d/%d/%d", tm.tm_mday, tm.tm_mon, tm.tm_year);
+ return buffer;
+}
+
void
calendar_iterate_on_objects (GList *objects, time_t start, time_t end, calendarfn cb, void *closure)
{
@@ -324,43 +323,19 @@ calendar_load (Calendar *cal, char *fname)
return NULL;
}
-/*
- * calendar_load_from_memory:
- * @cal: calendar on which we load the information
- * @buffer: A buffer that contains a vCalendar file
- *
- * Loads the information from the vCalendar information in @buffer
- * into the Calendar
- */
-char *
-calendar_load_from_memory (Calendar *cal, const char *buffer)
-{
- VObject *vcal;
-
- g_return_val_if_fail (buffer != NULL, NULL);
-
- cal->filename = g_strdup ("memory-based-calendar");
- vcal = Parse_MIME (buffer, strlen (buffer));
- if (!vcal)
- return "Could not load the calendar";
-
- cal->file_time = time (NULL);
- calendar_load_from_vobject (cal, vcal);
- cleanVObject (vcal);
- cleanStrTbl ();
-
- return NULL;
-}
-
-static VObject *
-vcalendar_create_from_calendar (Calendar *cal)
+void
+calendar_save (Calendar *cal, char *fname)
{
VObject *vcal;
GList *l;
time_t now = time (NULL);
+ struct stat s;
struct tm tm;
- /* WE call localtime for the side effect of setting tzname */
+ if (fname == NULL)
+ fname = cal->filename;
+
+ /* We call localtime for the side effect of setting tzname */
tm = *localtime (&now);
vcal = newVObject (VCCalProp);
@@ -391,25 +366,6 @@ vcalendar_create_from_calendar (Calendar *cal)
addVObjectProp (vcal, obj);
}
- cleanVObject (vcal);
- cleanStrTbl ();
-
- return vcal;
-}
-
-void
-calendar_save (Calendar *cal, char *fname)
-{
- VObject *vcal;
- FILE *fp;
- GtkWidget *dlg;
- struct stat s;
- int status;
-
- if (fname == NULL)
- fname = cal->filename;
-
- vcal = vcalendar_create_from_calendar (cal);
if (g_file_exists (fname)){
char *backup_name = g_strconcat (fname, "~", NULL);
@@ -419,43 +375,13 @@ calendar_save (Calendar *cal, char *fname)
rename (fname, backup_name);
g_free (backup_name);
}
+ writeVObjectToFile (fname, vcal);
- fp = fopen(fname,"w");
- if (fp) {
- writeVObject(fp, vcal);
- fclose(fp);
- if (strcmp(cal->filename, fname)) {
- if (cal->filename)
- g_free (cal->filename);
- cal->filename = g_strdup (fname);
- }
- status = stat (fname, &s);
- cal->file_time = s.st_mtime;
- } else {
- dlg = gnome_message_box_new(_("Failed to save calendar!"),
- GNOME_MESSAGE_BOX_ERROR, "Ok", NULL);
- gtk_widget_show(dlg);
- }
-
- cleanVObject (vcal);
- cleanStrTbl ();
-}
-
-char *
-calendar_get_as_vcal_string (Calendar *cal)
-{
- VObject *vcal;
- char *result;
+ stat (fname, &s);
+ cal->file_time = s.st_mtime;
- g_return_val_if_fail (cal != NULL, NULL);
-
- vcal = vcalendar_create_from_calendar (cal);
- result = writeMemVObject (NULL, 0, vcal);
-
cleanVObject (vcal);
cleanStrTbl ();
-
- return result;
}
static gint
@@ -516,8 +442,6 @@ calendar_object_changed (Calendar *cal, iCalObject *obj, int flags)
while (alarm_kill (obj))
;
ical_object_try_alarms (obj);
-
- obj->pilot_status = ICAL_PILOT_SYNC_MOD;
}
static void
@@ -544,99 +468,3 @@ calendar_init_alarms (Calendar *cal)
alarm_add (&day_change_alarm, calendar_day_change, cal);
}
-static iCalObject *
-calendar_object_find_in_list (Calendar *cal, GList *list, const char *uid)
-{
- GList *l;
-
- for (l = list; l; l = l->next){
- iCalObject *obj = l->data;
-
- if (strcmp (obj->uid, uid) == 0)
- return obj;
- }
-
- return NULL;
-}
-
-iCalObject *
-calendar_object_find_event (Calendar *cal, const char *uid)
-{
- g_return_val_if_fail (cal != NULL, NULL);
- g_return_val_if_fail (uid != NULL, NULL);
-
- return g_hash_table_lookup (cal->event_hash, uid);
-}
-
-iCalObject *
-calendar_object_find_todo (Calendar *cal, const char *uid)
-{
- g_return_val_if_fail (cal != NULL, NULL);
- g_return_val_if_fail (uid != NULL, NULL);
-
- return calendar_object_find_in_list (cal, cal->todo, uid);
-}
-
-iCalObject *
-calendar_object_find (Calendar *cal, const char *uid)
-{
- iCalObject *obj;
-
- g_return_val_if_fail (cal != NULL, NULL);
- g_return_val_if_fail (uid != NULL, NULL);
-
- obj = calendar_object_find_in_list (cal, cal->todo, uid);
-
- if (obj == NULL)
- obj = calendar_object_find_in_list (cal, cal->events, uid);
-
- return obj;
-}
-
-iCalObject *
-calendar_object_find_by_pilot (Calendar *cal, int pilot_id)
-{
- GList *l;
-
- g_return_val_if_fail (cal != NULL, NULL);
-
- for (l = cal->events; l; l = l->next){
- iCalObject *obj = l->data;
-
- if (obj->pilot_id == pilot_id)
- return obj;
- }
-
- for (l = cal->todo; l; l = l->next){
- iCalObject *obj = l->data;
-
- if (obj->pilot_id == pilot_id)
- return obj;
- }
-
- return NULL;
-}
-
-/*
- * calendar_string_from_object:
- *
- * Returns the iCalObject @object armored around a vCalendar
- * object as a string.
- */
-char *
-calendar_string_from_object (iCalObject *object)
-{
- Calendar *cal;
- char *str;
-
- g_return_val_if_fail (object != NULL, NULL);
-
- cal = calendar_new ("Temporal");
- calendar_add_object (cal, object);
- str = calendar_get_as_vcal_string (cal);
- calendar_remove_object (cal, object);
-
- calendar_destroy (cal);
-
- return str;
-}
diff --git a/calendar/calobj.c b/calendar/calobj.c
index 806c27d8ff..87133f7fab 100644
--- a/calendar/calobj.c
+++ b/calendar/calobj.c
@@ -18,28 +18,23 @@
static char *
ical_gen_uid (void)
{
- static char *hostname;
+ static char *domain;
time_t t = time (NULL);
- static int serial;
- if (!hostname){
+ if (!domain){
char buffer [128];
- if ((gethostname (buffer, sizeof (buffer)-1) == 0) &&
- (buffer [0] != 0))
- hostname = g_strdup (buffer);
- else
- hostname = g_strdup ("localhost");
+ getdomainname (buffer, sizeof (buffer)-1);
+ domain = g_strdup (domain);
}
return g_strdup_printf (
- "%s-%d-%d-%d-%d@%s",
+ "%s-%d-%d-%d@%s",
isodate_from_time_t (t),
getpid (),
getgid (),
getppid (),
- serial++,
- hostname);
+ domain);
}
iCalObject *
@@ -52,9 +47,6 @@ ical_object_new (void)
ico->seq = -1;
ico->dtstamp = time (NULL);
ico->uid = ical_gen_uid ();
-
- ico->pilot_id = 0;
- ico->pilot_status = ICAL_PILOT_SYNC_MOD;
return ico;
}
@@ -380,8 +372,6 @@ load_recur_yearly_day (iCalObject *o, char **str)
{
/* Skip as we do not support multiple days and we do expect
* the dtstart to agree with the value on this field
- *
- * FIXME: we should support every-n-years
*/
skip_numbers (str);
}
@@ -595,10 +585,8 @@ ical_object_create_from_vobject (VObject *o, const char *object_name)
if (has (o, VCUniqueStringProp)){
ical->uid = g_strdup (str_val (vo));
free (the_str);
- } else {
- ical->uid = ical_gen_uid ();
}
-
+
/* seq */
if (has (o, VCSequenceProp)){
ical->seq = atoi (str_val (vo));
@@ -792,22 +780,6 @@ ical_object_create_from_vobject (VObject *o, const char *object_name)
}
free (the_str);
}
-
- /*
- * Pilot
- */
- if (has (o, XPilotIdProp)){
- ical->pilot_id = atoi (str_val (vo));
- free (the_str);
- } else
- ical->pilot_id = 0;
-
- if (has (o, XPilotStatusProp)){
- ical->pilot_status = atoi (str_val (vo));
- free (the_str);
- } else
- ical->pilot_status = ICAL_PILOT_SYNC_MOD;
-
return ical;
}
@@ -1073,17 +1045,6 @@ ical_object_to_vobject (iCalObject *ical)
addPropValue (alarm, VCProcedureNameProp, ical->palarm.data);
if ((alarm = save_alarm (o, &ical->malarm, ical)))
addPropValue (alarm, VCEmailAddressProp, ical->malarm.data);
-
- /* Pilot */
- {
- char buffer [20];
-
- sprintf (buffer, "%d", ical->pilot_id);
- addPropValue (o, XPilotIdProp, buffer);
- sprintf (buffer, "%d", ical->pilot_status);
- addPropValue (o, XPilotStatusProp, buffer);
- }
-
return o;
}
@@ -1463,33 +1424,3 @@ alarm_compute_offset (CalendarAlarm *a)
}
return a->offset;
}
-
-iCalObject *
-ical_object_new_from_string (const char *vcal_string)
-{
- iCalObject *ical = NULL;
- VObject *cal, *event;
- VObjectIterator i;
- const char *object_name;
-
- cal = Parse_MIME (vcal_string, strlen (vcal_string));
-
- initPropIterator (&i, cal);
-
- while (moreIteration (&i)){
- event = nextVObject (&i);
-
- object_name = vObjectName (event);
-
- if (strcmp (object_name, VCEventProp) == 0){
- ical = ical_object_create_from_vobject (event, object_name);
- break;
- }
- }
-
- cleanVObject (cal);
- cleanStrTbl ();
-
- return ical;
-}
-
diff --git a/calendar/doc/C/Makefile.am b/calendar/doc/C/Makefile.am
index fbd3b63acf..be6533d715 100644
--- a/calendar/doc/C/Makefile.am
+++ b/calendar/doc/C/Makefile.am
@@ -27,13 +27,13 @@ dist-hook:
-cp images/*.gif images/*.jpg $(distdir)/images
install-data-local: gnomecal.html
- $(mkinstalldirs) $(DESTDIR)$(gnomecal_helpdir)/images
+ $(mkinstalldirs) $(gnomecal_helpdir)/images
-for file in $(srcdir)/gnomecal/*.html $(srcdir)/gnomecal/*.css; do \
basefile=`basename $$file`; \
- $(INSTALL_DATA) $(srcdir)/$$file $(DESTDIR)$(gnomecal_helpdir)/$$basefile; \
+ $(INSTALL_DATA) $(srcdir)/$$file $(gnomecal_helpdir)/$$basefile; \
done
-for file in $(srcdir)/images/*.jpg $(srcdir)/images/*.gif; do \
- $(INSTALL_DATA) $(srcdir)/$$file $(DESTDIR)$(gnomecal_helpdir)/images;\
+ $(INSTALL_DATA) $(srcdir)/$$file $(gnomecal_helpdir)/images;\
done
gnomecal.ps: gnomecal.sgml
diff --git a/calendar/eventedit.c b/calendar/eventedit.c
index 926bb6f09c..8b7baa6a75 100644
--- a/calendar/eventedit.c
+++ b/calendar/eventedit.c
@@ -59,6 +59,15 @@ event_editor_class_init (EventEditorClass *class)
object_class->destroy = event_editor_destroy;
}
+GtkWidget *
+adjust (GtkWidget *w, gfloat x, gfloat y, gfloat xs, gfloat ys)
+{
+ GtkWidget *a = gtk_alignment_new (x, y, xs, ys);
+
+ gtk_container_add (GTK_CONTAINER (a), w);
+ return a;
+}
+
static GtkWidget *
make_spin_button (int val, int low, int high)
{
@@ -423,7 +432,7 @@ ee_classification_widgets (EventEditor *ee)
* Retrieves the information from the CalendarAlarm widgets and stores them
* on the CalendarAlarm generic values
*/
-static void
+void
ee_store_alarm (CalendarAlarm *alarm, enum AlarmType type)
{
GtkWidget *item;
@@ -1469,6 +1478,7 @@ static void
event_editor_init (EventEditor *ee)
{
ee->ical = 0;
+ gtk_window_set_title (GTK_WINDOW (ee), _("Create new appointment"));
gnome_dialog_set_close (GNOME_DIALOG(ee), TRUE);
}
@@ -1501,12 +1511,6 @@ event_editor_new (GnomeCalendar *gcal, iCalObject *ical)
if (ical == 0){
ical = ical_new ("", user_name, "");
ical->new = 1;
- }
-
- if (ical->new){
- gtk_window_set_title (GTK_WINDOW (ee), _("Create new appointment"));
- } else {
- gtk_window_set_title (GTK_WINDOW (ee), _("Edit appointment"));
}
ical->user_data = ee; /* so that the world can know we are editing it */
diff --git a/calendar/gncal.desktop b/calendar/gncal.desktop
index df48de0a33..b42f006ec8 100644
--- a/calendar/gncal.desktop
+++ b/calendar/gncal.desktop
@@ -3,28 +3,20 @@ Name=Calendar
Name[da]=Kalender
Name[de]=Kalender
Name[es]=Calendario
-Name[et]=Kalender
-Name[fi]=Kalenteri
Name[fr]=Calendrier
-Name[ja]=¥«¥ì¥ó¥À¡¼
Name[ko]=´Þ·Â
Name[no]=Kalender
Name[pt]=Agenda
-Name[pt_BR]=Calendário
-Name[ru]=ëÁÌÅÎÄÁÒØ
+Name[pl]=Terminarz
Comment=Calendar application
Comment[da]=Gnome Kalender
Comment[de]=Gnome Kalender
Comment[es]=Calendario de Gnome
-Comment[et]=GNOME kalender
-Comment[fi]=GNOME-kalenteri
Comment[fr]=Calendrier GNOME
-Comment[ja]=GNOME¥«¥ì¥ó¥À¡¼
Comment[ko]=±×³ð ´Þ·Â
Comment[no]=Gnome Kalender
Comment[pt]=Agenda Gnome
-Comment[pt_BR]=Calendário GNOME
-Comment[ru]=ëÁÌÅÎÄÁÒØ Gnome
+Comment[pl]=Terminarz GNOME
Exec=gnomecal
Icon=gnome-calendar.png
Terminal=0
diff --git a/calendar/gnome-cal.c b/calendar/gnome-cal.c
index 88e2f0bdce..d0aabd388e 100644
--- a/calendar/gnome-cal.c
+++ b/calendar/gnome-cal.c
@@ -18,7 +18,6 @@
#include "year-view.h"
#include "timeutil.h"
#include "main.h"
-#include "corba-cal.h"
GnomeApp *parent_class;
@@ -45,10 +44,11 @@ gnome_calendar_get_type (void)
static void
setup_widgets (GnomeCalendar *gcal)
{
+ GtkWidget *sw;
time_t now;
now = time (NULL);
-
+
gcal->notebook = gtk_notebook_new ();
gcal->day_view = gncal_day_panel_new (gcal, now);
gcal->week_view = gncal_week_view_new (gcal, now);
@@ -60,13 +60,11 @@ setup_widgets (GnomeCalendar *gcal)
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (gcal->year_view_sw), gcal->year_view);
- GTK_LAYOUT (gcal->year_view)->vadjustment->step_increment = 10.0;
- gtk_adjustment_changed (GTK_ADJUSTMENT (GTK_LAYOUT (gcal->year_view)->vadjustment));
gtk_notebook_append_page (GTK_NOTEBOOK (gcal->notebook), gcal->day_view, gtk_label_new (_("Day View")));
gtk_notebook_append_page (GTK_NOTEBOOK (gcal->notebook), gcal->week_view, gtk_label_new (_("Week View")));
gtk_notebook_append_page (GTK_NOTEBOOK (gcal->notebook), gcal->month_view, gtk_label_new (_("Month View")));
- gtk_notebook_append_page (GTK_NOTEBOOK (gcal->notebook), gcal->year_view_sw, gtk_label_new (_("Year View")));
+ gtk_notebook_append_page (GTK_NOTEBOOK (gcal->notebook), gcal->year_view_sw, gtk_label_new (_("Year View")));
gtk_widget_show_all (gcal->notebook);
@@ -134,7 +132,7 @@ gnome_calendar_direction (GnomeCalendar *gcal, int direction)
{
GtkWidget *cp = get_current_page (gcal);
time_t new_time;
-
+
if (cp == gcal->day_view)
new_time = time_add_day (time_day_begin (gcal->current_display), 1 * direction);
else if (cp == gcal->week_view)
@@ -185,7 +183,7 @@ gnome_calendar_goto_today (GnomeCalendar *gcal)
{
g_return_if_fail (gcal != NULL);
g_return_if_fail (GNOME_IS_CALENDAR (gcal));
-
+
gnome_calendar_goto (gcal, time (NULL));
}
@@ -197,7 +195,7 @@ gnome_calendar_set_view (GnomeCalendar *gcal, char *page_name)
g_return_if_fail (gcal != NULL);
g_return_if_fail (GNOME_IS_CALENDAR (gcal));
g_return_if_fail (page_name != NULL);
-
+
if (strcmp (page_name, "dayview") == 0)
page = 0;
@@ -216,21 +214,19 @@ gnome_calendar_new (char *title)
GtkWidget *retval;
GnomeCalendar *gcal;
GnomeApp *app;
-
+
retval = gtk_type_new (gnome_calendar_get_type ());
app = GNOME_APP (retval);
gcal = GNOME_CALENDAR (retval);
-
+
app->name = g_strdup ("calendar");
app->prefix = g_strconcat ("/", app->name, "/", NULL);
-
+
gtk_window_set_title(GTK_WINDOW(retval), title);
gcal->current_display = time_day_begin (time (NULL));
gcal->cal = calendar_new (title);
setup_widgets (gcal);
- gnome_calendar_create_corba_server (gcal);
-
return retval;
}
@@ -251,7 +247,7 @@ gnome_calendar_load (GnomeCalendar *gcal, char *file)
g_return_val_if_fail (gcal != NULL, 0);
g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), 0);
g_return_val_if_fail (file != NULL, 0);
-
+
if ((r = calendar_load (gcal->cal, file)) != NULL){
printf ("Error loading calendar: %s\n", r);
return 0;
@@ -319,12 +315,12 @@ execute (char *command, int close_standard)
struct sigaction ignore, save_intr, save_quit;
int status = 0, i;
pid_t pid;
-
+
ignore.sa_handler = SIG_IGN;
sigemptyset (&ignore.sa_mask);
ignore.sa_flags = 0;
-
- sigaction (SIGINT, &ignore, &save_intr);
+
+ sigaction (SIGINT, &ignore, &save_intr);
sigaction (SIGQUIT, &ignore, &save_quit);
if ((pid = fork ()) < 0){
@@ -337,16 +333,16 @@ execute (char *command, int close_standard)
const int top = max_open_files ();
sigaction (SIGINT, &save_intr, NULL);
sigaction (SIGQUIT, &save_quit, NULL);
-
+
for (i = (close_standard ? 0 : 3); i < top; i++)
close (i);
-
+
/* FIXME: As an excercise to the reader, copy the
* code from mc to setup shell properly instead of
* /bin/sh. Yes, this comment is larger than a cut and paste.
*/
execl ("/bin/sh", "/bin/sh", "-c", command, (char *) 0);
-
+
_exit (127);
} else {
_exit (127);
@@ -363,7 +359,7 @@ mail_notify (char *mail_address, char *text, time_t app_time)
pid_t pid;
int p [2];
char *command;
-
+
pipe (p);
pid = fork ();
if (pid == 0){
@@ -398,7 +394,7 @@ static gint
start_beeping (gpointer data)
{
gdk_beep ();
-
+
return TRUE;
}
@@ -407,7 +403,7 @@ calendar_notify (time_t time, CalendarAlarm *which, void *data)
{
iCalObject *ico = data;
guint tag;
-
+
if (&ico->aalarm == which){
time_t app = ico->dalarm.trigger + ico->dalarm.offset;
GtkWidget *w;
@@ -464,11 +460,11 @@ mark_gtk_calendar_day (iCalObject *obj, time_t start, time_t end, void *c)
tm_s = *localtime (&start);
day_end = time_day_end (end);
-
+
for (t = start; t <= day_end; t += 60*60*24){
time_t new = mktime (&tm_s);
struct tm tm_day;
-
+
tm_day = *localtime (&new);
gtk_calendar_mark_day (gtk_cal, tm_day.tm_mday);
tm_s.tm_mday++;
@@ -541,14 +537,14 @@ gnome_calendar_colors_changed (GnomeCalendar *gcal)
todo_list_properties_changed (GNCAL_DAY_PANEL (gcal->day_view));
}
-void
-gnome_calendar_todo_properties_changed (GnomeCalendar *gcal)
+void
+gnome_calendar_todo_properties_changed (GnomeCalendar *gcal)
{
g_return_if_fail (gcal != NULL);
g_return_if_fail (GNOME_IS_CALENDAR (gcal));
-
+
/* FIXME: add day and week view when they are done */
-
+
todo_style_changed = 1;
todo_list_properties_changed (GNCAL_DAY_PANEL (gcal->day_view));
}
diff --git a/calendar/gnome-cal.h b/calendar/gnome-cal.h
index da53f29882..ae4e5292da 100644
--- a/calendar/gnome-cal.h
+++ b/calendar/gnome-cal.h
@@ -63,8 +63,6 @@ void gnome_calendar_object_changed (GnomeCalendar *gcal,
iCalObject *obj,
int flags);
-GnomeCalendar *gnome_calendar_locate (const char *pathname);
-
/* Notifies the calendar that the time format has changed and it must update all its views */
void gnome_calendar_time_format_changed (GnomeCalendar *gcal);
diff --git a/calendar/gui/Makefile.am b/calendar/gui/Makefile.am
index 5ed3d8fbae..b340b03a9d 100644
--- a/calendar/gui/Makefile.am
+++ b/calendar/gui/Makefile.am
@@ -1,48 +1,15 @@
SUBDIRS = doc
-idldir = $(datadir)/idl
-idl_DATA = GnomeCal.idl
-
-gnorbadir = $(sysconfdir)/CORBA/servers
-gnorba_DATA = gnomecal.gnorba
-
help_base = $(datadir)/gnome/help/cal
-if HAVE_GNOME_PILOT
-bin_PROGRAMS = gnomecal todo-conduit-control-applet calendar-conduit-control-appleta calendar-pilot-sync
-else
-bin_PROGRAMS = gnomecal
-endif
-
-INCLUDES = \
+INCLUDES = \
-I$(includedir) \
$(GNOME_INCLUDEDIR) \
- $(GNOME_CONDUIT_INCLUDEDIR) \
- $(PISOCK_INCLUDEDIR) \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\"
-GNOMECAL_CORBA_GENERATED = \
- GnomeCal.h \
- GnomeCal.c \
- GnomeCal-common.c \
- GnomeCal-skels.c \
- GnomeCal-stubs.c
-
-$(GNOMECAL_CORBA_GENERATED): my_gnomecal_idl
-
-my_gnomecal_idl: GnomeCal.idl
- orbit-idl $(srcdir)/GnomeCal.idl
- touch my_gnomecal_idl
-
-corba-cal.c \
-corba-cal.h \
-corba-cal-factory.c \
-corba-cal-factory.h: GnomeCal.h
+bin_PROGRAMS = gnomecal
gnomecal_SOURCES = \
- GnomeCal-common.c \
- GnomeCal-skels.c \
- GnomeCal.h \
alarm.c \
alarm.h \
calendar.c \
@@ -52,10 +19,6 @@ gnomecal_SOURCES = \
eventedit.c \
eventedit.h \
getdate.y \
- corba-cal.c \
- corba-cal.h \
- corba-cal-factory.c \
- corba-cal-factory.h \
gncal-day-panel.c \
gncal-day-panel.h \
gncal-day-view.c \
@@ -92,114 +55,21 @@ gnomecal_SOURCES = \
year-view.c \
year-view.h
-calendar_pilot_sync_SOURCES = \
- GnomeCal-common.c \
- GnomeCal-stubs.c \
- alarm.c \
- calendar-pilot-sync.c \
- calobj.c \
- calobj.h \
- calendar.c \
- calendar.h \
- timeutil.c \
- timeutil.h
-
LINK_FLAGS = \
$(GNOME_LIBDIR) \
$(GNOMEGNORBA_LIBS) \
- $(INTLLIBS) \
- ../libversit/libversit.la
-
-calendar_pilot_sync_LDADD = \
- $(PISOCK_LIBS) \
- $(LINK_FLAGS)
+ $(INTLLIBS) ../libversit/libversit.a
-if HAVE_GNOME_PILOT
-#calendar_conduit
-calendar_conduitsdir=$(libdir)/gnome-pilot/conduits
-
-calendar_conduits_LTLIBRARIES = libcalendar_conduit.la
-
-libcalendar_conduit_la_SOURCES = \
- calendar-conduit.c \
- calobj.c \
- alarm.c \
- GnomeCal-common.c \
- GnomeCal-stubs.c \
- calendar.c \
- timeutil.c
-
-libcalendar_conduit_la_LDFLAGS = \
- -rpath $(libdir)
-
-libcalendar_conduit_la_LIBADD = \
- ../libversit/libversit.la \
- $(PISOCK_LIBS) \
- $(GNOME_LIBDIR) \
- $(GNOME_LIBS)
-
-calendar_conduit_control_applet_SOURCES = \
- calendar-conduit-control-applet.c
-
-calendar_conduit_control_applet_LDADD = \
- $(CAPPLET_LIBS) \
- $(GNOME_LIBDIR) \
- $(GNOME_CAPPLET_LIBS) \
- $(PISOCK_LIBS) \
- $(GNOMEUI_LIBS) \
- $(PISOCK_LIBS) \
- $(GNOME_PILOT_LIBS) \
- $(INTLLIBS)
-
-#todo_conduit
-todo_conduitsdir=$(libdir)/gnome-pilot/conduits
-
-todo_conduits_LTLIBRARIES = libtodo_conduit.la
-
-libtodo_conduit_la_LDFLAGS = \
- -rpath $(libdir)
-
-libtodo_conduit_la_LIBADD = \
- $(GNOME_LIBDIR) \
- $(GNOME_LIBS)
-
-libtodo_conduit_la_SOURCES = \
- todo-conduit.c
-
-todo_conduit_control_applet_SOURCES = \
- todo-conduit-control-applet.c
-
-todo_conduit_control_applet_LDADD = \
- $(CAPPLET_LIBS) \
- $(GNOME_LIBDIR) \
- $(GNOME_CAPPLET_LIBS) \
- $(PISOCK_LIBS) \
- $(GNOMEUI_LIBS) \
- $(PISOCK_LIBS) \
- $(GNOME_PILOT_LIBS) \
- $(INTLLIBS)
-endif # HAVE_GNOME_PILOT
+#gncal_LDADD = $(LINK_FLAGS)
gnomecal_LDADD = $(LINK_FLAGS)
-if HAVE_GNOME_PILOT
-ccenterdir = $(datadir)/control-center
-Rootdir = $(ccenterdir)
-PalmPilotdir = $(ccenterdir)/Peripherals/PalmPilot
-Conduitsdir = $(PalmPilotdir)/Conduits
-
-Conduits_DATA = \
- calendar-conduit-control-applet.desktop \
- todo-conduit-control-applet.desktop
-endif
-
EXTRA_DIST = \
gncal.desktop \
bell.xpm \
- recur.xpm \
- $(idl_DATA) \
- $(gnorba_DATA)
+ recur.xpm
+
Productivitydir = $(datadir)/gnome/apps/Applications
@@ -207,4 +77,3 @@ Productivity_DATA = gncal.desktop
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(help_base)/C
- $(mkinstalldirs) $(Conduitsdir)
diff --git a/calendar/gui/calendar.c b/calendar/gui/calendar.c
index cffd2476c4..af0f0b1d36 100644
--- a/calendar/gui/calendar.c
+++ b/calendar/gui/calendar.c
@@ -4,7 +4,7 @@
* This keeps track of a given calendar. Eventually this will abtract everything
* related to getting calendars/saving calendars locally or to a remote Calendar Service
*
- * Copyright (C) 1998, 1999 the Free Software Foundation
+ * Copyright (C) 1998 the Free Software Foundation
*
* Authors:
* Miguel de Icaza (miguel@gnu.org)
@@ -12,8 +12,6 @@
*
*/
-#include <gnome.h>
-#include <stdio.h>
#include <config.h>
#include <unistd.h>
#include <sys/stat.h>
@@ -40,8 +38,6 @@ calendar_new (char *title)
cal->title = g_strdup (title);
- cal->event_hash = g_hash_table_new (g_str_hash, g_str_equal);
-
calendar_init_alarms (cal);
return cal;
@@ -76,7 +72,7 @@ add_object_alarms (iCalObject *obj, time_t start, time_t end, void *closure)
#define max(a,b) ((a > b) ? a : b)
-static void
+void
ical_object_try_alarms (iCalObject *obj)
{
int ao, po, od, mo;
@@ -97,14 +93,9 @@ ical_object_try_alarms (iCalObject *obj)
void
calendar_add_object (Calendar *cal, iCalObject *obj)
{
- g_return_if_fail (cal != NULL);
- g_return_if_fail (obj != NULL);
- g_return_if_fail (obj->uid != NULL);
-
obj->new = 0;
switch (obj->type){
case ICAL_EVENT:
- g_hash_table_insert (cal->event_hash, obj->uid, obj);
cal->events = g_list_prepend (cal->events, obj);
ical_object_try_alarms (obj);
#ifdef DEBUGGING_MAIL_ALARM
@@ -142,7 +133,6 @@ calendar_remove_object (Calendar *cal, iCalObject *obj)
switch (obj->type){
case ICAL_EVENT:
cal->events = g_list_remove (cal->events, obj);
- g_hash_table_remove (cal->event_hash, obj->uid);
break;
case ICAL_TODO:
@@ -171,8 +161,6 @@ calendar_destroy (Calendar *cal)
g_list_foreach (cal->journal, (GFunc) ical_object_destroy, NULL);
g_list_free (cal->journal);
- g_hash_table_destroy (cal->event_hash);
-
if (cal->title)
g_free (cal->title);
if (cal->filename)
@@ -181,6 +169,17 @@ calendar_destroy (Calendar *cal)
g_free (cal);
}
+char *
+ice (time_t t)
+{
+ static char buffer [100];
+ struct tm tm;
+
+ tm = *localtime (&t);
+ sprintf (buffer, "%d/%d/%d", tm.tm_mday, tm.tm_mon, tm.tm_year);
+ return buffer;
+}
+
void
calendar_iterate_on_objects (GList *objects, time_t start, time_t end, calendarfn cb, void *closure)
{
@@ -324,43 +323,19 @@ calendar_load (Calendar *cal, char *fname)
return NULL;
}
-/*
- * calendar_load_from_memory:
- * @cal: calendar on which we load the information
- * @buffer: A buffer that contains a vCalendar file
- *
- * Loads the information from the vCalendar information in @buffer
- * into the Calendar
- */
-char *
-calendar_load_from_memory (Calendar *cal, const char *buffer)
-{
- VObject *vcal;
-
- g_return_val_if_fail (buffer != NULL, NULL);
-
- cal->filename = g_strdup ("memory-based-calendar");
- vcal = Parse_MIME (buffer, strlen (buffer));
- if (!vcal)
- return "Could not load the calendar";
-
- cal->file_time = time (NULL);
- calendar_load_from_vobject (cal, vcal);
- cleanVObject (vcal);
- cleanStrTbl ();
-
- return NULL;
-}
-
-static VObject *
-vcalendar_create_from_calendar (Calendar *cal)
+void
+calendar_save (Calendar *cal, char *fname)
{
VObject *vcal;
GList *l;
time_t now = time (NULL);
+ struct stat s;
struct tm tm;
- /* WE call localtime for the side effect of setting tzname */
+ if (fname == NULL)
+ fname = cal->filename;
+
+ /* We call localtime for the side effect of setting tzname */
tm = *localtime (&now);
vcal = newVObject (VCCalProp);
@@ -391,25 +366,6 @@ vcalendar_create_from_calendar (Calendar *cal)
addVObjectProp (vcal, obj);
}
- cleanVObject (vcal);
- cleanStrTbl ();
-
- return vcal;
-}
-
-void
-calendar_save (Calendar *cal, char *fname)
-{
- VObject *vcal;
- FILE *fp;
- GtkWidget *dlg;
- struct stat s;
- int status;
-
- if (fname == NULL)
- fname = cal->filename;
-
- vcal = vcalendar_create_from_calendar (cal);
if (g_file_exists (fname)){
char *backup_name = g_strconcat (fname, "~", NULL);
@@ -419,43 +375,13 @@ calendar_save (Calendar *cal, char *fname)
rename (fname, backup_name);
g_free (backup_name);
}
+ writeVObjectToFile (fname, vcal);
- fp = fopen(fname,"w");
- if (fp) {
- writeVObject(fp, vcal);
- fclose(fp);
- if (strcmp(cal->filename, fname)) {
- if (cal->filename)
- g_free (cal->filename);
- cal->filename = g_strdup (fname);
- }
- status = stat (fname, &s);
- cal->file_time = s.st_mtime;
- } else {
- dlg = gnome_message_box_new(_("Failed to save calendar!"),
- GNOME_MESSAGE_BOX_ERROR, "Ok", NULL);
- gtk_widget_show(dlg);
- }
-
- cleanVObject (vcal);
- cleanStrTbl ();
-}
-
-char *
-calendar_get_as_vcal_string (Calendar *cal)
-{
- VObject *vcal;
- char *result;
+ stat (fname, &s);
+ cal->file_time = s.st_mtime;
- g_return_val_if_fail (cal != NULL, NULL);
-
- vcal = vcalendar_create_from_calendar (cal);
- result = writeMemVObject (NULL, 0, vcal);
-
cleanVObject (vcal);
cleanStrTbl ();
-
- return result;
}
static gint
@@ -516,8 +442,6 @@ calendar_object_changed (Calendar *cal, iCalObject *obj, int flags)
while (alarm_kill (obj))
;
ical_object_try_alarms (obj);
-
- obj->pilot_status = ICAL_PILOT_SYNC_MOD;
}
static void
@@ -544,99 +468,3 @@ calendar_init_alarms (Calendar *cal)
alarm_add (&day_change_alarm, calendar_day_change, cal);
}
-static iCalObject *
-calendar_object_find_in_list (Calendar *cal, GList *list, const char *uid)
-{
- GList *l;
-
- for (l = list; l; l = l->next){
- iCalObject *obj = l->data;
-
- if (strcmp (obj->uid, uid) == 0)
- return obj;
- }
-
- return NULL;
-}
-
-iCalObject *
-calendar_object_find_event (Calendar *cal, const char *uid)
-{
- g_return_val_if_fail (cal != NULL, NULL);
- g_return_val_if_fail (uid != NULL, NULL);
-
- return g_hash_table_lookup (cal->event_hash, uid);
-}
-
-iCalObject *
-calendar_object_find_todo (Calendar *cal, const char *uid)
-{
- g_return_val_if_fail (cal != NULL, NULL);
- g_return_val_if_fail (uid != NULL, NULL);
-
- return calendar_object_find_in_list (cal, cal->todo, uid);
-}
-
-iCalObject *
-calendar_object_find (Calendar *cal, const char *uid)
-{
- iCalObject *obj;
-
- g_return_val_if_fail (cal != NULL, NULL);
- g_return_val_if_fail (uid != NULL, NULL);
-
- obj = calendar_object_find_in_list (cal, cal->todo, uid);
-
- if (obj == NULL)
- obj = calendar_object_find_in_list (cal, cal->events, uid);
-
- return obj;
-}
-
-iCalObject *
-calendar_object_find_by_pilot (Calendar *cal, int pilot_id)
-{
- GList *l;
-
- g_return_val_if_fail (cal != NULL, NULL);
-
- for (l = cal->events; l; l = l->next){
- iCalObject *obj = l->data;
-
- if (obj->pilot_id == pilot_id)
- return obj;
- }
-
- for (l = cal->todo; l; l = l->next){
- iCalObject *obj = l->data;
-
- if (obj->pilot_id == pilot_id)
- return obj;
- }
-
- return NULL;
-}
-
-/*
- * calendar_string_from_object:
- *
- * Returns the iCalObject @object armored around a vCalendar
- * object as a string.
- */
-char *
-calendar_string_from_object (iCalObject *object)
-{
- Calendar *cal;
- char *str;
-
- g_return_val_if_fail (object != NULL, NULL);
-
- cal = calendar_new ("Temporal");
- calendar_add_object (cal, object);
- str = calendar_get_as_vcal_string (cal);
- calendar_remove_object (cal, object);
-
- calendar_destroy (cal);
-
- return str;
-}
diff --git a/calendar/gui/eventedit.c b/calendar/gui/eventedit.c
index 926bb6f09c..8b7baa6a75 100644
--- a/calendar/gui/eventedit.c
+++ b/calendar/gui/eventedit.c
@@ -59,6 +59,15 @@ event_editor_class_init (EventEditorClass *class)
object_class->destroy = event_editor_destroy;
}
+GtkWidget *
+adjust (GtkWidget *w, gfloat x, gfloat y, gfloat xs, gfloat ys)
+{
+ GtkWidget *a = gtk_alignment_new (x, y, xs, ys);
+
+ gtk_container_add (GTK_CONTAINER (a), w);
+ return a;
+}
+
static GtkWidget *
make_spin_button (int val, int low, int high)
{
@@ -423,7 +432,7 @@ ee_classification_widgets (EventEditor *ee)
* Retrieves the information from the CalendarAlarm widgets and stores them
* on the CalendarAlarm generic values
*/
-static void
+void
ee_store_alarm (CalendarAlarm *alarm, enum AlarmType type)
{
GtkWidget *item;
@@ -1469,6 +1478,7 @@ static void
event_editor_init (EventEditor *ee)
{
ee->ical = 0;
+ gtk_window_set_title (GTK_WINDOW (ee), _("Create new appointment"));
gnome_dialog_set_close (GNOME_DIALOG(ee), TRUE);
}
@@ -1501,12 +1511,6 @@ event_editor_new (GnomeCalendar *gcal, iCalObject *ical)
if (ical == 0){
ical = ical_new ("", user_name, "");
ical->new = 1;
- }
-
- if (ical->new){
- gtk_window_set_title (GTK_WINDOW (ee), _("Create new appointment"));
- } else {
- gtk_window_set_title (GTK_WINDOW (ee), _("Edit appointment"));
}
ical->user_data = ee; /* so that the world can know we are editing it */
diff --git a/calendar/gui/gncal.desktop b/calendar/gui/gncal.desktop
index df48de0a33..b42f006ec8 100644
--- a/calendar/gui/gncal.desktop
+++ b/calendar/gui/gncal.desktop
@@ -3,28 +3,20 @@ Name=Calendar
Name[da]=Kalender
Name[de]=Kalender
Name[es]=Calendario
-Name[et]=Kalender
-Name[fi]=Kalenteri
Name[fr]=Calendrier
-Name[ja]=¥«¥ì¥ó¥À¡¼
Name[ko]=´Þ·Â
Name[no]=Kalender
Name[pt]=Agenda
-Name[pt_BR]=Calendário
-Name[ru]=ëÁÌÅÎÄÁÒØ
+Name[pl]=Terminarz
Comment=Calendar application
Comment[da]=Gnome Kalender
Comment[de]=Gnome Kalender
Comment[es]=Calendario de Gnome
-Comment[et]=GNOME kalender
-Comment[fi]=GNOME-kalenteri
Comment[fr]=Calendrier GNOME
-Comment[ja]=GNOME¥«¥ì¥ó¥À¡¼
Comment[ko]=±×³ð ´Þ·Â
Comment[no]=Gnome Kalender
Comment[pt]=Agenda Gnome
-Comment[pt_BR]=Calendário GNOME
-Comment[ru]=ëÁÌÅÎÄÁÒØ Gnome
+Comment[pl]=Terminarz GNOME
Exec=gnomecal
Icon=gnome-calendar.png
Terminal=0
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 88e2f0bdce..d0aabd388e 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -18,7 +18,6 @@
#include "year-view.h"
#include "timeutil.h"
#include "main.h"
-#include "corba-cal.h"
GnomeApp *parent_class;
@@ -45,10 +44,11 @@ gnome_calendar_get_type (void)
static void
setup_widgets (GnomeCalendar *gcal)
{
+ GtkWidget *sw;
time_t now;
now = time (NULL);
-
+
gcal->notebook = gtk_notebook_new ();
gcal->day_view = gncal_day_panel_new (gcal, now);
gcal->week_view = gncal_week_view_new (gcal, now);
@@ -60,13 +60,11 @@ setup_widgets (GnomeCalendar *gcal)
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (gcal->year_view_sw), gcal->year_view);
- GTK_LAYOUT (gcal->year_view)->vadjustment->step_increment = 10.0;
- gtk_adjustment_changed (GTK_ADJUSTMENT (GTK_LAYOUT (gcal->year_view)->vadjustment));
gtk_notebook_append_page (GTK_NOTEBOOK (gcal->notebook), gcal->day_view, gtk_label_new (_("Day View")));
gtk_notebook_append_page (GTK_NOTEBOOK (gcal->notebook), gcal->week_view, gtk_label_new (_("Week View")));
gtk_notebook_append_page (GTK_NOTEBOOK (gcal->notebook), gcal->month_view, gtk_label_new (_("Month View")));
- gtk_notebook_append_page (GTK_NOTEBOOK (gcal->notebook), gcal->year_view_sw, gtk_label_new (_("Year View")));
+ gtk_notebook_append_page (GTK_NOTEBOOK (gcal->notebook), gcal->year_view_sw, gtk_label_new (_("Year View")));
gtk_widget_show_all (gcal->notebook);
@@ -134,7 +132,7 @@ gnome_calendar_direction (GnomeCalendar *gcal, int direction)
{
GtkWidget *cp = get_current_page (gcal);
time_t new_time;
-
+
if (cp == gcal->day_view)
new_time = time_add_day (time_day_begin (gcal->current_display), 1 * direction);
else if (cp == gcal->week_view)
@@ -185,7 +183,7 @@ gnome_calendar_goto_today (GnomeCalendar *gcal)
{
g_return_if_fail (gcal != NULL);
g_return_if_fail (GNOME_IS_CALENDAR (gcal));
-
+
gnome_calendar_goto (gcal, time (NULL));
}
@@ -197,7 +195,7 @@ gnome_calendar_set_view (GnomeCalendar *gcal, char *page_name)
g_return_if_fail (gcal != NULL);
g_return_if_fail (GNOME_IS_CALENDAR (gcal));
g_return_if_fail (page_name != NULL);
-
+
if (strcmp (page_name, "dayview") == 0)
page = 0;
@@ -216,21 +214,19 @@ gnome_calendar_new (char *title)
GtkWidget *retval;
GnomeCalendar *gcal;
GnomeApp *app;
-
+
retval = gtk_type_new (gnome_calendar_get_type ());
app = GNOME_APP (retval);
gcal = GNOME_CALENDAR (retval);
-
+
app->name = g_strdup ("calendar");
app->prefix = g_strconcat ("/", app->name, "/", NULL);
-
+
gtk_window_set_title(GTK_WINDOW(retval), title);
gcal->current_display = time_day_begin (time (NULL));
gcal->cal = calendar_new (title);
setup_widgets (gcal);
- gnome_calendar_create_corba_server (gcal);
-
return retval;
}
@@ -251,7 +247,7 @@ gnome_calendar_load (GnomeCalendar *gcal, char *file)
g_return_val_if_fail (gcal != NULL, 0);
g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), 0);
g_return_val_if_fail (file != NULL, 0);
-
+
if ((r = calendar_load (gcal->cal, file)) != NULL){
printf ("Error loading calendar: %s\n", r);
return 0;
@@ -319,12 +315,12 @@ execute (char *command, int close_standard)
struct sigaction ignore, save_intr, save_quit;
int status = 0, i;
pid_t pid;
-
+
ignore.sa_handler = SIG_IGN;
sigemptyset (&ignore.sa_mask);
ignore.sa_flags = 0;
-
- sigaction (SIGINT, &ignore, &save_intr);
+
+ sigaction (SIGINT, &ignore, &save_intr);
sigaction (SIGQUIT, &ignore, &save_quit);
if ((pid = fork ()) < 0){
@@ -337,16 +333,16 @@ execute (char *command, int close_standard)
const int top = max_open_files ();
sigaction (SIGINT, &save_intr, NULL);
sigaction (SIGQUIT, &save_quit, NULL);
-
+
for (i = (close_standard ? 0 : 3); i < top; i++)
close (i);
-
+
/* FIXME: As an excercise to the reader, copy the
* code from mc to setup shell properly instead of
* /bin/sh. Yes, this comment is larger than a cut and paste.
*/
execl ("/bin/sh", "/bin/sh", "-c", command, (char *) 0);
-
+
_exit (127);
} else {
_exit (127);
@@ -363,7 +359,7 @@ mail_notify (char *mail_address, char *text, time_t app_time)
pid_t pid;
int p [2];
char *command;
-
+
pipe (p);
pid = fork ();
if (pid == 0){
@@ -398,7 +394,7 @@ static gint
start_beeping (gpointer data)
{
gdk_beep ();
-
+
return TRUE;
}
@@ -407,7 +403,7 @@ calendar_notify (time_t time, CalendarAlarm *which, void *data)
{
iCalObject *ico = data;
guint tag;
-
+
if (&ico->aalarm == which){
time_t app = ico->dalarm.trigger + ico->dalarm.offset;
GtkWidget *w;
@@ -464,11 +460,11 @@ mark_gtk_calendar_day (iCalObject *obj, time_t start, time_t end, void *c)
tm_s = *localtime (&start);
day_end = time_day_end (end);
-
+
for (t = start; t <= day_end; t += 60*60*24){
time_t new = mktime (&tm_s);
struct tm tm_day;
-
+
tm_day = *localtime (&new);
gtk_calendar_mark_day (gtk_cal, tm_day.tm_mday);
tm_s.tm_mday++;
@@ -541,14 +537,14 @@ gnome_calendar_colors_changed (GnomeCalendar *gcal)
todo_list_properties_changed (GNCAL_DAY_PANEL (gcal->day_view));
}
-void
-gnome_calendar_todo_properties_changed (GnomeCalendar *gcal)
+void
+gnome_calendar_todo_properties_changed (GnomeCalendar *gcal)
{
g_return_if_fail (gcal != NULL);
g_return_if_fail (GNOME_IS_CALENDAR (gcal));
-
+
/* FIXME: add day and week view when they are done */
-
+
todo_style_changed = 1;
todo_list_properties_changed (GNCAL_DAY_PANEL (gcal->day_view));
}
diff --git a/calendar/gui/gnome-cal.h b/calendar/gui/gnome-cal.h
index da53f29882..ae4e5292da 100644
--- a/calendar/gui/gnome-cal.h
+++ b/calendar/gui/gnome-cal.h
@@ -63,8 +63,6 @@ void gnome_calendar_object_changed (GnomeCalendar *gcal,
iCalObject *obj,
int flags);
-GnomeCalendar *gnome_calendar_locate (const char *pathname);
-
/* Notifies the calendar that the time format has changed and it must update all its views */
void gnome_calendar_time_format_changed (GnomeCalendar *gcal);
diff --git a/calendar/gui/main.c b/calendar/gui/main.c
index 6689ca80cb..51fe74e5cb 100644
--- a/calendar/gui/main.c
+++ b/calendar/gui/main.c
@@ -9,7 +9,6 @@
#include <config.h>
#include <gnome.h>
-#include <libgnorba/gnorba.h>
#include <pwd.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -22,7 +21,7 @@
#include "gnome-cal.h"
#include "main.h"
#include "timeutil.h"
-#include "corba-cal-factory.h"
+
#define COOKIE_USER_HOME_DIR ((char *) -1)
@@ -68,6 +67,8 @@ int active_calendars = 0;
/* A list of all of the calendars started */
GList *all_calendars = NULL;
+static void new_calendar (char *full_name, char *calendar_file, char *geometry, char *view, gboolean hidden);
+
/* For dumping part of a calendar */
static time_t from_t, to_t;
@@ -203,29 +204,10 @@ display_objedit_today (GtkWidget *widget, GnomeCalendar *gcal)
gtk_widget_show (ee);
}
-GnomeCalendar *
-gnome_calendar_locate (const char *pathname)
-{
- GList *l;
-
- if (pathname == NULL || pathname [0] == 0)
- pathname = user_calendar_file;
-
- for (l = all_calendars; l; l = l->next){
- GnomeCalendar *gcal = l->data;
-
- if (strcmp (gcal->cal->filename, pathname) == 0){
- return gcal;
- }
- }
- return NULL;
-}
-
static void
close_cmd (GtkWidget *widget, GnomeCalendar *gcal)
{
all_calendars = g_list_remove (all_calendars, gcal);
-
if (gcal->cal->modified){
if (!gcal->cal->filename)
save_calendar_cmd (widget, gcal);
@@ -236,10 +218,8 @@ close_cmd (GtkWidget *widget, GnomeCalendar *gcal)
gtk_widget_destroy (GTK_WIDGET (gcal));
active_calendars--;
- if (active_calendars == 0){
- unregister_calendar_services ();
+ if (active_calendars == 0)
gtk_main_quit ();
- }
}
void
@@ -368,14 +348,15 @@ static void
save_ok (GtkWidget *widget, GtkFileSelection *fs)
{
GnomeCalendar *gcal;
- gchar *fname;
gcal = GNOME_CALENDAR (gtk_object_get_user_data (GTK_OBJECT (fs)));
gtk_window_set_wmclass (GTK_WINDOW (gcal), "gnomecal", "gnomecal");
- fname = g_strdup (gtk_file_selection_get_filename (fs));
- calendar_save (gcal->cal, fname);
- g_free(fname);
+ if (gcal->cal->filename)
+ g_free (gcal->cal->filename);
+
+ gcal->cal->filename = g_strdup (gtk_file_selection_get_filename (fs));
+ calendar_save (gcal->cal, gcal->cal->filename);
gtk_main_quit ();
}
@@ -445,6 +426,7 @@ save_calendar_cmd (GtkWidget *widget, void *data)
g_free (str);
gnome_dialog_set_default (GNOME_DIALOG (box), 1);
b = gnome_dialog_run (GNOME_DIALOG (box));
+ gtk_object_destroy (GTK_OBJECT (box));
if (b != 0)
return;
@@ -575,7 +557,7 @@ calendar_close_event (GtkWidget *widget, GdkEvent *event, GnomeCalendar *gcal)
return TRUE;
}
-GnomeCalendar *
+static void
new_calendar (char *full_name, char *calendar_file, char *geometry, char *page, gboolean hidden)
{
GtkWidget *toplevel;
@@ -583,8 +565,7 @@ new_calendar (char *full_name, char *calendar_file, char *geometry, char *page,
int xpos, ypos, width, height;
/* i18n: This "%s%s" indicates possession. Languages where the order is
- * the inverse should translate it to "%2$s%1$s".
- */
+ the inverse should translate it to "%2$s%1$s". */
g_snprintf(title, 128, _("%s%s"), full_name, _("'s calendar"));
toplevel = gnome_calendar_new (title);
@@ -631,8 +612,6 @@ new_calendar (char *full_name, char *calendar_file, char *geometry, char *page,
}
gtk_widget_show (toplevel);
-
- return GNOME_CALENDAR (toplevel);
}
static void
@@ -866,23 +845,13 @@ int
main(int argc, char *argv[])
{
GnomeClient *client;
- CORBA_Environment ev;
bindtextdomain (PACKAGE, GNOMELOCALEDIR);
textdomain (PACKAGE);
- CORBA_exception_init (&ev);
-
- gnome_CORBA_init_with_popt_table (
- "calendar", VERSION, &argc, argv,
- options, 0, NULL, GNORBA_INIT_SERVER_FUNC, &ev);
+ gnome_init_with_popt_table ("calendar", VERSION, argc, argv,
+ options, 0, NULL);
- orb = gnome_CORBA_ORB ();
- poa = (PortableServer_POA)CORBA_ORB_resolve_initial_references (orb, "RootPOA", &ev);
- if (ev._major == CORBA_NO_EXCEPTION){
- init_corba_server ();
- }
-
if (show_events)
dump_events ();
if (show_todo)
diff --git a/calendar/gui/main.h b/calendar/gui/main.h
index 584ce2e83c..96ffcaf33d 100644
--- a/calendar/gui/main.h
+++ b/calendar/gui/main.h
@@ -75,7 +75,4 @@ char *color_spec_from_prop (ColorProp propnum);
void save_default_calendar (GnomeCalendar *gcal);
-GnomeCalendar *new_calendar (char *full_name, char *calendar_file,
- char *geometry, char *page, gboolean hidden);
-
#endif
diff --git a/calendar/gui/month-view.c b/calendar/gui/month-view.c
index 5df7b7a23d..d227e6a4f3 100644
--- a/calendar/gui/month-view.c
+++ b/calendar/gui/month-view.c
@@ -477,8 +477,7 @@ month_view_init (MonthView *mv)
"clip", TRUE,
NULL);
}
- gnome_canvas_points_free (points);
-
+
mv->old_current_index = -1;
}
diff --git a/calendar/gui/prop.c b/calendar/gui/prop.c
index 129407293b..c58d685dc5 100644
--- a/calendar/gui/prop.c
+++ b/calendar/gui/prop.c
@@ -562,7 +562,7 @@ build_list_options_frame(void)
{
GtkWidget *frame;
GtkWidget *vbox;
- frame = gtk_frame_new (_("Show on TODO List:"));
+ frame = gtk_frame_new (_("Show on To Do List:"));
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (frame), vbox);
diff --git a/calendar/main.c b/calendar/main.c
index 6689ca80cb..51fe74e5cb 100644
--- a/calendar/main.c
+++ b/calendar/main.c
@@ -9,7 +9,6 @@
#include <config.h>
#include <gnome.h>
-#include <libgnorba/gnorba.h>
#include <pwd.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -22,7 +21,7 @@
#include "gnome-cal.h"
#include "main.h"
#include "timeutil.h"
-#include "corba-cal-factory.h"
+
#define COOKIE_USER_HOME_DIR ((char *) -1)
@@ -68,6 +67,8 @@ int active_calendars = 0;
/* A list of all of the calendars started */
GList *all_calendars = NULL;
+static void new_calendar (char *full_name, char *calendar_file, char *geometry, char *view, gboolean hidden);
+
/* For dumping part of a calendar */
static time_t from_t, to_t;
@@ -203,29 +204,10 @@ display_objedit_today (GtkWidget *widget, GnomeCalendar *gcal)
gtk_widget_show (ee);
}
-GnomeCalendar *
-gnome_calendar_locate (const char *pathname)
-{
- GList *l;
-
- if (pathname == NULL || pathname [0] == 0)
- pathname = user_calendar_file;
-
- for (l = all_calendars; l; l = l->next){
- GnomeCalendar *gcal = l->data;
-
- if (strcmp (gcal->cal->filename, pathname) == 0){
- return gcal;
- }
- }
- return NULL;
-}
-
static void
close_cmd (GtkWidget *widget, GnomeCalendar *gcal)
{
all_calendars = g_list_remove (all_calendars, gcal);
-
if (gcal->cal->modified){
if (!gcal->cal->filename)
save_calendar_cmd (widget, gcal);
@@ -236,10 +218,8 @@ close_cmd (GtkWidget *widget, GnomeCalendar *gcal)
gtk_widget_destroy (GTK_WIDGET (gcal));
active_calendars--;
- if (active_calendars == 0){
- unregister_calendar_services ();
+ if (active_calendars == 0)
gtk_main_quit ();
- }
}
void
@@ -368,14 +348,15 @@ static void
save_ok (GtkWidget *widget, GtkFileSelection *fs)
{
GnomeCalendar *gcal;
- gchar *fname;
gcal = GNOME_CALENDAR (gtk_object_get_user_data (GTK_OBJECT (fs)));
gtk_window_set_wmclass (GTK_WINDOW (gcal), "gnomecal", "gnomecal");
- fname = g_strdup (gtk_file_selection_get_filename (fs));
- calendar_save (gcal->cal, fname);
- g_free(fname);
+ if (gcal->cal->filename)
+ g_free (gcal->cal->filename);
+
+ gcal->cal->filename = g_strdup (gtk_file_selection_get_filename (fs));
+ calendar_save (gcal->cal, gcal->cal->filename);
gtk_main_quit ();
}
@@ -445,6 +426,7 @@ save_calendar_cmd (GtkWidget *widget, void *data)
g_free (str);
gnome_dialog_set_default (GNOME_DIALOG (box), 1);
b = gnome_dialog_run (GNOME_DIALOG (box));
+ gtk_object_destroy (GTK_OBJECT (box));
if (b != 0)
return;
@@ -575,7 +557,7 @@ calendar_close_event (GtkWidget *widget, GdkEvent *event, GnomeCalendar *gcal)
return TRUE;
}
-GnomeCalendar *
+static void
new_calendar (char *full_name, char *calendar_file, char *geometry, char *page, gboolean hidden)
{
GtkWidget *toplevel;
@@ -583,8 +565,7 @@ new_calendar (char *full_name, char *calendar_file, char *geometry, char *page,
int xpos, ypos, width, height;
/* i18n: This "%s%s" indicates possession. Languages where the order is
- * the inverse should translate it to "%2$s%1$s".
- */
+ the inverse should translate it to "%2$s%1$s". */
g_snprintf(title, 128, _("%s%s"), full_name, _("'s calendar"));
toplevel = gnome_calendar_new (title);
@@ -631,8 +612,6 @@ new_calendar (char *full_name, char *calendar_file, char *geometry, char *page,
}
gtk_widget_show (toplevel);
-
- return GNOME_CALENDAR (toplevel);
}
static void
@@ -866,23 +845,13 @@ int
main(int argc, char *argv[])
{
GnomeClient *client;
- CORBA_Environment ev;
bindtextdomain (PACKAGE, GNOMELOCALEDIR);
textdomain (PACKAGE);
- CORBA_exception_init (&ev);
-
- gnome_CORBA_init_with_popt_table (
- "calendar", VERSION, &argc, argv,
- options, 0, NULL, GNORBA_INIT_SERVER_FUNC, &ev);
+ gnome_init_with_popt_table ("calendar", VERSION, argc, argv,
+ options, 0, NULL);
- orb = gnome_CORBA_ORB ();
- poa = (PortableServer_POA)CORBA_ORB_resolve_initial_references (orb, "RootPOA", &ev);
- if (ev._major == CORBA_NO_EXCEPTION){
- init_corba_server ();
- }
-
if (show_events)
dump_events ();
if (show_todo)
diff --git a/calendar/main.h b/calendar/main.h
index 584ce2e83c..96ffcaf33d 100644
--- a/calendar/main.h
+++ b/calendar/main.h
@@ -75,7 +75,4 @@ char *color_spec_from_prop (ColorProp propnum);
void save_default_calendar (GnomeCalendar *gcal);
-GnomeCalendar *new_calendar (char *full_name, char *calendar_file,
- char *geometry, char *page, gboolean hidden);
-
#endif
diff --git a/calendar/month-view.c b/calendar/month-view.c
index 5df7b7a23d..d227e6a4f3 100644
--- a/calendar/month-view.c
+++ b/calendar/month-view.c
@@ -477,8 +477,7 @@ month_view_init (MonthView *mv)
"clip", TRUE,
NULL);
}
- gnome_canvas_points_free (points);
-
+
mv->old_current_index = -1;
}
diff --git a/calendar/pcs/calobj.c b/calendar/pcs/calobj.c
index 806c27d8ff..87133f7fab 100644
--- a/calendar/pcs/calobj.c
+++ b/calendar/pcs/calobj.c
@@ -18,28 +18,23 @@
static char *
ical_gen_uid (void)
{
- static char *hostname;
+ static char *domain;
time_t t = time (NULL);
- static int serial;
- if (!hostname){
+ if (!domain){
char buffer [128];
- if ((gethostname (buffer, sizeof (buffer)-1) == 0) &&
- (buffer [0] != 0))
- hostname = g_strdup (buffer);
- else
- hostname = g_strdup ("localhost");
+ getdomainname (buffer, sizeof (buffer)-1);
+ domain = g_strdup (domain);
}
return g_strdup_printf (
- "%s-%d-%d-%d-%d@%s",
+ "%s-%d-%d-%d@%s",
isodate_from_time_t (t),
getpid (),
getgid (),
getppid (),
- serial++,
- hostname);
+ domain);
}
iCalObject *
@@ -52,9 +47,6 @@ ical_object_new (void)
ico->seq = -1;
ico->dtstamp = time (NULL);
ico->uid = ical_gen_uid ();
-
- ico->pilot_id = 0;
- ico->pilot_status = ICAL_PILOT_SYNC_MOD;
return ico;
}
@@ -380,8 +372,6 @@ load_recur_yearly_day (iCalObject *o, char **str)
{
/* Skip as we do not support multiple days and we do expect
* the dtstart to agree with the value on this field
- *
- * FIXME: we should support every-n-years
*/
skip_numbers (str);
}
@@ -595,10 +585,8 @@ ical_object_create_from_vobject (VObject *o, const char *object_name)
if (has (o, VCUniqueStringProp)){
ical->uid = g_strdup (str_val (vo));
free (the_str);
- } else {
- ical->uid = ical_gen_uid ();
}
-
+
/* seq */
if (has (o, VCSequenceProp)){
ical->seq = atoi (str_val (vo));
@@ -792,22 +780,6 @@ ical_object_create_from_vobject (VObject *o, const char *object_name)
}
free (the_str);
}
-
- /*
- * Pilot
- */
- if (has (o, XPilotIdProp)){
- ical->pilot_id = atoi (str_val (vo));
- free (the_str);
- } else
- ical->pilot_id = 0;
-
- if (has (o, XPilotStatusProp)){
- ical->pilot_status = atoi (str_val (vo));
- free (the_str);
- } else
- ical->pilot_status = ICAL_PILOT_SYNC_MOD;
-
return ical;
}
@@ -1073,17 +1045,6 @@ ical_object_to_vobject (iCalObject *ical)
addPropValue (alarm, VCProcedureNameProp, ical->palarm.data);
if ((alarm = save_alarm (o, &ical->malarm, ical)))
addPropValue (alarm, VCEmailAddressProp, ical->malarm.data);
-
- /* Pilot */
- {
- char buffer [20];
-
- sprintf (buffer, "%d", ical->pilot_id);
- addPropValue (o, XPilotIdProp, buffer);
- sprintf (buffer, "%d", ical->pilot_status);
- addPropValue (o, XPilotStatusProp, buffer);
- }
-
return o;
}
@@ -1463,33 +1424,3 @@ alarm_compute_offset (CalendarAlarm *a)
}
return a->offset;
}
-
-iCalObject *
-ical_object_new_from_string (const char *vcal_string)
-{
- iCalObject *ical = NULL;
- VObject *cal, *event;
- VObjectIterator i;
- const char *object_name;
-
- cal = Parse_MIME (vcal_string, strlen (vcal_string));
-
- initPropIterator (&i, cal);
-
- while (moreIteration (&i)){
- event = nextVObject (&i);
-
- object_name = vObjectName (event);
-
- if (strcmp (object_name, VCEventProp) == 0){
- ical = ical_object_create_from_vobject (event, object_name);
- break;
- }
- }
-
- cleanVObject (cal);
- cleanStrTbl ();
-
- return ical;
-}
-
diff --git a/calendar/prop.c b/calendar/prop.c
index 129407293b..c58d685dc5 100644
--- a/calendar/prop.c
+++ b/calendar/prop.c
@@ -562,7 +562,7 @@ build_list_options_frame(void)
{
GtkWidget *frame;
GtkWidget *vbox;
- frame = gtk_frame_new (_("Show on TODO List:"));
+ frame = gtk_frame_new (_("Show on To Do List:"));
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (frame), vbox);
diff --git a/libversit/port.h b/libversit/port.h
index 1768beebd8..63a4021334 100644
--- a/libversit/port.h
+++ b/libversit/port.h
@@ -43,16 +43,18 @@ DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable.
#if defined(__CPLUSPLUS__) || defined(__cplusplus)
extern "C" {
#endif
-
-/* some of these #defines are commented out because */
-/* Visual C++ sets them on the compiler command line instead */
-/* #define _DEBUG */
-/* #define WIN32 */
-/* #define WIN16 */
-/* #define _WINDOWS */
-/* #define __MWERKS__ */
-/* #define INCLUDEMFC */
+#if 0
+ some of these #defines are commented out because
+ Visual C++ sets them on the compiler command line instead
+
+#define _DEBUG
+#define WIN32
+#define WIN16
+#define _WINDOWS
+#define __MWERKS__
+#define INCLUDEMFC
+#endif
#define vCardClipboardFormat "+//ISBN 1-887687-00-9::versit::PDI//vCard"
#define vCalendarClipboardFormat "+//ISBN 1-887687-00-9::versit::PDI//vCalendar"
@@ -85,4 +87,4 @@ For example:
}
#endif
-#endif /* __PORT_H__ */
+#endif // __PORT_H__
diff --git a/libversit/vcc.c b/libversit/vcc.c
index 1caadc3cb4..3c54822138 100644
--- a/libversit/vcc.c
+++ b/libversit/vcc.c
@@ -1,28 +1,28 @@
/* A Bison parser, made from vcc.y
- by GNU Bison version 1.25
+ by GNU Bison version 1.27
*/
#define YYBISON 1 /* Identify Bison output. */
-#define EQ 258
-#define COLON 259
-#define DOT 260
-#define SEMICOLON 261
-#define SPACE 262
-#define HTAB 263
-#define LINESEP 264
-#define NEWLINE 265
-#define BEGIN_VCARD 266
-#define END_VCARD 267
-#define BEGIN_VCAL 268
-#define END_VCAL 269
-#define BEGIN_VEVENT 270
-#define END_VEVENT 271
-#define BEGIN_VTODO 272
-#define END_VTODO 273
-#define ID 274
-#define STRING 275
+#define EQ 257
+#define COLON 258
+#define DOT 259
+#define SEMICOLON 260
+#define SPACE 261
+#define HTAB 262
+#define LINESEP 263
+#define NEWLINE 264
+#define BEGIN_VCARD 265
+#define END_VCARD 266
+#define BEGIN_VCAL 267
+#define END_VCAL 268
+#define BEGIN_VEVENT 269
+#define END_VEVENT 270
+#define BEGIN_VTODO 271
+#define END_VTODO 272
+#define ID 273
+#define STRING 274
#line 1 "vcc.y"
@@ -217,7 +217,7 @@ typedef union {
#define YYFLAG -32768
#define YYNTBASE 21
-#define YYTRANSLATE(x) ((unsigned)(x) <= 275 ? yytranslate[x] : 51)
+#define YYTRANSLATE(x) ((unsigned)(x) <= 274 ? yytranslate[x] : 51)
static const char yytranslate[] = { 0,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -245,9 +245,9 @@ static const char yytranslate[] = { 0,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 1, 2, 3, 4, 5,
- 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20
+ 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
+ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20
};
#if YYDEBUG != 0
@@ -369,7 +369,8 @@ static const short yycheck[] = { 7,
41, 11, 57, 23
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
-#line 3 "/usr/share/misc/bison.simple"
+#line 3 "/usr/lib/bison.simple"
+/* This file comes from bison-1.27. */
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
@@ -386,46 +387,66 @@ static const short yycheck[] = { 7,
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. */
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
This special exception was added by the Free Software Foundation
in version 1.24 of Bison. */
-#ifndef alloca
+/* This is the parser code that is written into each bison parser
+ when the %semantic_parser declaration is not specified in the grammar.
+ It was written by Richard Stallman by simplifying the hairy parser
+ used when %semantic_parser is specified. */
+
+#ifndef YYSTACK_USE_ALLOCA
+#ifdef alloca
+#define YYSTACK_USE_ALLOCA
+#else /* alloca not defined */
#ifdef __GNUC__
+#define YYSTACK_USE_ALLOCA
#define alloca __builtin_alloca
#else /* not GNU C. */
-#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
+#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
+#define YYSTACK_USE_ALLOCA
#include <alloca.h>
#else /* not sparc */
-#if defined (MSDOS) && !defined (__TURBOC__)
+/* We think this test detects Watcom and Microsoft C. */
+/* This used to test MSDOS, but that is a bad idea
+ since that symbol is in the user namespace. */
+#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
+#if 0 /* No need for malloc.h, which pollutes the namespace;
+ instead, just don't use alloca. */
#include <malloc.h>
+#endif
#else /* not MSDOS, or __TURBOC__ */
#if defined(_AIX)
-#include <malloc.h>
+/* I don't know what this was needed for, but it pollutes the namespace.
+ So I turned it off. rms, 2 May 1997. */
+/* #include <malloc.h> */
#pragma alloca
-#else /* not MSDOS, __TURBOC__, or _AIX */
-#ifdef __hpux
-#ifdef __cplusplus
-extern "C" {
-void *alloca (unsigned int);
-};
-#else /* not __cplusplus */
-void *alloca ();
-#endif /* not __cplusplus */
+#define YYSTACK_USE_ALLOCA
+#else /* not MSDOS, or __TURBOC__, or _AIX */
+#if 0
+#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
+ and on HPUX 10. Eventually we can turn this on. */
+#define YYSTACK_USE_ALLOCA
+#define alloca __builtin_alloca
#endif /* __hpux */
+#endif
#endif /* not _AIX */
#endif /* not MSDOS, or __TURBOC__ */
-#endif /* not sparc. */
-#endif /* not GNU C. */
-#endif /* alloca not defined. */
+#endif /* not sparc */
+#endif /* not GNU C */
+#endif /* alloca not defined */
+#endif /* YYSTACK_USE_ALLOCA not defined */
-/* This is the parser code that is written into each bison parser
- when the %semantic_parser declaration is not specified in the grammar.
- It was written by Richard Stallman by simplifying the hairy parser
- used when %semantic_parser is specified. */
+#ifdef YYSTACK_USE_ALLOCA
+#define YYSTACK_ALLOC alloca
+#else
+#define YYSTACK_ALLOC malloc
+#endif
/* Note: there must be only one dollar sign in this file.
It is replaced by the list of actions, each action
@@ -435,8 +456,8 @@ void *alloca ();
#define yyclearin (yychar = YYEMPTY)
#define YYEMPTY -2
#define YYEOF 0
-#define YYACCEPT return(0)
-#define YYABORT return(1)
+#define YYACCEPT goto yyacceptlab
+#define YYABORT goto yyabortlab
#define YYERROR goto yyerrlab1
/* Like YYERROR except do call yyerror.
This remains here temporarily to ease the
@@ -517,12 +538,12 @@ int yydebug; /* nonzero means print parse trace */
#ifndef YYMAXDEPTH
#define YYMAXDEPTH 10000
#endif
-
-/* Prevent warning if -Wstrict-prototypes. */
-#ifdef __GNUC__
-int yyparse (void);
-#endif
+/* Define __yy_memcpy. Note that the size argument
+ should be passed with type unsigned int, because that is what the non-GCC
+ definitions require. With GCC, __builtin_memcpy takes an arg
+ of type size_t, but it can handle unsigned int. */
+
#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
#else /* not GNU C or C++ */
@@ -534,7 +555,7 @@ static void
__yy_memcpy (to, from, count)
char *to;
char *from;
- int count;
+ unsigned int count;
{
register char *f = from;
register char *t = to;
@@ -549,10 +570,10 @@ __yy_memcpy (to, from, count)
/* This is the most reliable way to avoid incompatibilities
in available built-in functions on various systems. */
static void
-__yy_memcpy (char *to, char *from, int count)
+__yy_memcpy (char *to, char *from, unsigned int count)
{
- register char *f = from;
register char *t = to;
+ register char *f = from;
register int i = count;
while (i-- > 0)
@@ -562,7 +583,7 @@ __yy_memcpy (char *to, char *from, int count)
#endif
#endif
-#line 196 "/usr/share/misc/bison.simple"
+#line 216 "/usr/lib/bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *.
@@ -583,6 +604,15 @@ __yy_memcpy (char *to, char *from, int count)
#define YYPARSE_PARAM_DECL
#endif /* not YYPARSE_PARAM */
+/* Prevent warning if -Wstrict-prototypes. */
+#ifdef __GNUC__
+#ifdef YYPARSE_PARAM
+int yyparse (void *);
+#else
+int yyparse (void);
+#endif
+#endif
+
int
yyparse(YYPARSE_PARAM_ARG)
YYPARSE_PARAM_DECL
@@ -611,6 +641,7 @@ yyparse(YYPARSE_PARAM_ARG)
#endif
int yystacksize = YYINITDEPTH;
+ int yyfree_stacks = 0;
#ifdef YYPURE
int yychar;
@@ -695,18 +726,32 @@ yynewstate:
if (yystacksize >= YYMAXDEPTH)
{
yyerror("parser stack overflow");
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
+#endif
+ }
return 2;
}
yystacksize *= 2;
if (yystacksize > YYMAXDEPTH)
yystacksize = YYMAXDEPTH;
- yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
- __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp));
- yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
- __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp));
+#ifndef YYSTACK_USE_ALLOCA
+ yyfree_stacks = 1;
+#endif
+ yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
+ __yy_memcpy ((char *)yyss, (char *)yyss1,
+ size * (unsigned int) sizeof (*yyssp));
+ yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
+ __yy_memcpy ((char *)yyvs, (char *)yyvs1,
+ size * (unsigned int) sizeof (*yyvsp));
#ifdef YYLSP_NEEDED
- yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
- __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp));
+ yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
+ __yy_memcpy ((char *)yyls, (char *)yyls1,
+ size * (unsigned int) sizeof (*yylsp));
#endif
#endif /* no yyoverflow */
@@ -1027,7 +1072,7 @@ case 46:
break;}
}
/* the action file gets copied in in place of this dollarsign */
-#line 498 "/usr/share/misc/bison.simple"
+#line 542 "/usr/lib/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
@@ -1222,6 +1267,30 @@ yyerrhandle:
yystate = yyn;
goto yynewstate;
+
+ yyacceptlab:
+ /* YYACCEPT comes here. */
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
+#endif
+ }
+ return 0;
+
+ yyabortlab:
+ /* YYABORT comes here. */
+ if (yyfree_stacks)
+ {
+ free (yyss);
+ free (yyvs);
+#ifdef YYLSP_NEEDED
+ free (yyls);
+#endif
+ }
+ return 1;
}
#line 373 "vcc.y"
@@ -1645,7 +1714,7 @@ void initLex(const char *inputstring, unsigned long inputlen, CFile *inputfile)
void initLex(const char *inputstring, unsigned long inputlen, FILE *inputfile)
#endif
{
- /* initialize lex mode stack */
+ /* initialize lex mode stack */
lexBuf.lexModeStack[lexBuf.lexModeStackTop=0] = L_NORMAL;
/* iniatialize lex buffer. */
diff --git a/libversit/vcc.y b/libversit/vcc.y
index 7dde971f35..a187560e70 100644
--- a/libversit/vcc.y
+++ b/libversit/vcc.y
@@ -791,7 +791,7 @@ void initLex(const char *inputstring, unsigned long inputlen, CFile *inputfile)
void initLex(const char *inputstring, unsigned long inputlen, FILE *inputfile)
#endif
{
- /* initialize lex mode stack */
+ /* initialize lex mode stack */
lexBuf.lexModeStack[lexBuf.lexModeStackTop=0] = L_NORMAL;
/* iniatialize lex buffer. */
diff --git a/macros/ChangeLog b/macros/ChangeLog
index 74dfc3cca3..8f978ebc58 100644
--- a/macros/ChangeLog
+++ b/macros/ChangeLog
@@ -1,48 +1,3 @@
-1999-09-26 Jody Goldberg <jgoldberg@home.com>
-
- * compiler-flags.m4 : Remove -Wpointer-arith. It generates large
- numbers of warnings under glibc2.1.2 with a recent egcs release.
- The glibc maintainers have suggested removing this flag because it
- is useless.
-
-1999-09-01 Havoc Pennington <hp@pobox.com>
-
- * gnome-xml-check.m4: If you're going to AC_PATH_PROG then use the
- prog you find :-)
-
-1999-08-02 Peter Teichman <pat4@acpub.duke.edu>
-
- * removed gnome-conduit-check.m4 - it should be distributed with
- gnome-pilot
-
-1999-07-30 Peter Teichman <pat4@acpub.duke.edu>
-
- * gnome-conduit-check.m4: added new file of checks. anything that
- provides a pilot conduit is going to want this
-
-1999-07-07 Tuomas J. Lukka <lukka@iki.fi>
- * gnome-x-checks.m4: add a comment on how to get gtk-1.3 and
- glib 1.3 from CVS
-
-1999-07-06 Tuomas J. Lukka <lukka@iki.fi>
-
- * gnome-x-checks.m4: forbid compiling with Gtk-1.3 for now.
- gnome only works with 1.2 so far.
-
-1999-07-05 Raja R Harinath <harinath@cs.umn.edu>
-
- * gnome.m4: Make "extra library" message slightly easier to read.
-
-Sat Jun 26 01:47:53 1999 Tim Janik <timj@gtk.org>
-
- * compiler-flags.m4: give -Wunused to gcc instead of -Wno-unused.
-
-1999-06-11 Tuomas J. Lukka <lukka@iki.fi>
-
- * gnome-guile-checks.m4: Debian has qt_null in -lqthreads but
- no main. Changed both checks for 'main' to qt_null.
- I hope this is correct - it shouldn't break anything.
-
1999-05-11 Raja R Harinath <harinath@cs.umn.edu>
* Makefile.am (MACROS): Add `gnome-bonobo-check.m4'.
diff --git a/widgets/misc/e-colors.c b/widgets/misc/e-colors.c
deleted file mode 100644
index 3c8c3055fa..0000000000
--- a/widgets/misc/e-colors.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * color.c: Color allocation on the Gnumeric spreadsheet
- *
- * Author:
- * Miguel de Icaza (miguel@kernel.org)
- *
- * We keep our own color context, as the color allocation might take place
- * before any of our Canvases are realized.
- */
-#include <config.h>
-#include <gnome.h>
-#include "color.h"
-
-static int color_inited;
-static GdkColorContext *gnumeric_color_context;
-
-/* Public colors: shared by all of our items in Gnumeric */
-GdkColor gs_white, gs_black, gs_light_gray, gs_dark_gray, gs_red;
-
-int
-color_alloc (gushort red, gushort green, gushort blue)
-{
- int failed;
-
- if (!color_inited)
- color_init ();
-
- return gdk_color_context_get_pixel (gnumeric_color_context,
- red, green, blue, &failed);
-}
-
-void
-color_alloc_gdk (GdkColor *c)
-{
- int failed;
-
- g_return_if_fail (c != NULL);
-
- c->pixel = gdk_color_context_get_pixel (gnumeric_color_context, c->red, c->green, c->blue, &failed);
-}
-
-void
-color_alloc_name (const char *name, GdkColor *c)
-{
- int failed;
-
- g_return_if_fail (name != NULL);
- g_return_if_fail (c != NULL);
-
- gdk_color_parse (name, c);
- c->pixel = 0;
- c->pixel = gdk_color_context_get_pixel (gnumeric_color_context, c->red, c->green, c->blue, &failed);
-}
-
-void
-color_init (void)
-{
- GdkColormap *colormap = gtk_widget_get_default_colormap ();
-
- /* Initialize the color context */
- gnumeric_color_context = gdk_color_context_new (
- gtk_widget_get_default_visual (), colormap);
-
- /* Allocate the default colors */
- gdk_color_white (colormap, &gs_white);
- gdk_color_black (colormap, &gs_black);
-
- color_alloc_name ("gray78", &gs_light_gray);
- color_alloc_name ("gray20", &gs_dark_gray);
- color_alloc_name ("red", &gs_red);
-
- color_inited = 1;
-}
diff --git a/widgets/misc/e-colors.h b/widgets/misc/e-colors.h
deleted file mode 100644
index b2755a5c6a..0000000000
--- a/widgets/misc/e-colors.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef GNUMERIC_COLOR_H
-#define GNUMERIC_COLOR_H
-
-void color_init (void);
-
-/* Return the pixel value for the given red, green and blue */
-int color_alloc (gushort red, gushort green, gushort blue);
-void color_alloc_name (const char *name, GdkColor *color);
-void color_alloc_gdk (GdkColor *color);
-
-/* Colors used by any GnumericSheet item */
-extern GdkColor gs_white, gs_light_gray, gs_dark_gray, gs_black, gs_red;
-
-#endif /* GNUMERIC_COLOR_H */
diff --git a/widgets/misc/e-cursors.c b/widgets/misc/e-cursors.c
deleted file mode 100644
index b94c54bc73..0000000000
--- a/widgets/misc/e-cursors.c
+++ /dev/null
@@ -1,41 +0,0 @@
-#ifndef GNUMERIC_CURSORS_H
-#define GNUMERIC_CURSORS_H
-
-typedef struct {
- GdkCursor *cursor;
- int hot_x, hot_y;
- char **xpm;
-} GnumericCursorDef;
-
-#define GNUMERIC_CURSOR_FAT_CROSS 0
-#define GNUMERIC_CURSOR_THIN_CROSS 1
-#define GNUMERIC_CURSOR_ARROW 2
-#define GNUMERIC_CURSOR_MOVE 3
-#define GNUMERIC_CURSOR_ZOOM_IN 4
-#define GNUMERIC_CURSOR_ZOOM_OUT 5
-#define GNUMERIC_CURSOR_SIZE_X 6
-#define GNUMERIC_CURSOR_SIZE_Y 7
-#define GNUMERIC_CURSOR_SIZE_TL 8
-#define GNUMERIC_CURSOR_SIZE_TR 9
-#define GNUMERIC_CURSOR_PRESS 10
-
-extern GnumericCursorDef gnumeric_cursors [];
-
-void cursors_init (void);
-void cursors_shutdown (void);
-
-#define cursor_set(win,c) \
-G_STMT_START { \
- if (win) \
- gdk_window_set_cursor (win, gnumeric_cursors [c].cursor); \
-} G_STMT_END
-
-#define cursor_set_widget(w,c) \
-G_STMT_START { \
- if (GTK_WIDGET (w)->window) \
- gdk_window_set_cursor (GTK_WIDGET (w)->window, gnumeric_cursors [c].cursor); \
-} G_STMT_END
-
-
-#endif /* GNUMERIC_CURSORS_H */
-
diff --git a/widgets/misc/e-cursors.h b/widgets/misc/e-cursors.h
deleted file mode 100644
index b94c54bc73..0000000000
--- a/widgets/misc/e-cursors.h
+++ /dev/null
@@ -1,41 +0,0 @@
-#ifndef GNUMERIC_CURSORS_H
-#define GNUMERIC_CURSORS_H
-
-typedef struct {
- GdkCursor *cursor;
- int hot_x, hot_y;
- char **xpm;
-} GnumericCursorDef;
-
-#define GNUMERIC_CURSOR_FAT_CROSS 0
-#define GNUMERIC_CURSOR_THIN_CROSS 1
-#define GNUMERIC_CURSOR_ARROW 2
-#define GNUMERIC_CURSOR_MOVE 3
-#define GNUMERIC_CURSOR_ZOOM_IN 4
-#define GNUMERIC_CURSOR_ZOOM_OUT 5
-#define GNUMERIC_CURSOR_SIZE_X 6
-#define GNUMERIC_CURSOR_SIZE_Y 7
-#define GNUMERIC_CURSOR_SIZE_TL 8
-#define GNUMERIC_CURSOR_SIZE_TR 9
-#define GNUMERIC_CURSOR_PRESS 10
-
-extern GnumericCursorDef gnumeric_cursors [];
-
-void cursors_init (void);
-void cursors_shutdown (void);
-
-#define cursor_set(win,c) \
-G_STMT_START { \
- if (win) \
- gdk_window_set_cursor (win, gnumeric_cursors [c].cursor); \
-} G_STMT_END
-
-#define cursor_set_widget(w,c) \
-G_STMT_START { \
- if (GTK_WIDGET (w)->window) \
- gdk_window_set_cursor (GTK_WIDGET (w)->window, gnumeric_cursors [c].cursor); \
-} G_STMT_END
-
-
-#endif /* GNUMERIC_CURSORS_H */
-
diff --git a/widgets/misc/pixmaps/cursor_cross.xpm b/widgets/misc/pixmaps/cursor_cross.xpm
deleted file mode 100644
index f00e57f78c..0000000000
--- a/widgets/misc/pixmaps/cursor_cross.xpm
+++ /dev/null
@@ -1,38 +0,0 @@
-/* XPM */
-static char * cursor_cross_xpm[] = {
-"32 32 3 1",
-" c None",
-". c #000000",
-"+ c #FFFFFF",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ....... ",
-" .+++++.. ",
-" .+++++.. ",
-" .+++++.. ",
-" .+++++.. ",
-" ......+++++...... ",
-" .+++++++++++++++.. ",
-" .+++++++++++++++.. ",
-" .+++++++++++++++.. ",
-" .+++++++++++++++.. ",
-" .+++++++++++++++.. ",
-" ......+++++....... ",
-" .+++++....... ",
-" .+++++.. ",
-" .+++++.. ",
-" .+++++.. ",
-" ........ ",
-" ....... ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" "};
diff --git a/widgets/misc/pixmaps/cursor_zoom_in.xpm b/widgets/misc/pixmaps/cursor_zoom_in.xpm
deleted file mode 100644
index 1caf9e3e2a..0000000000
--- a/widgets/misc/pixmaps/cursor_zoom_in.xpm
+++ /dev/null
@@ -1,37 +0,0 @@
-/* XPM */
-static char * cursor_zoom_in_xpm[] = {
-"32 32 2 1",
-" c None",
-". c #000000",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ...... ",
-" .. .. ",
-" .. .. ",
-" . . ",
-" . ... . ",
-" . ... . ",
-" . ....... . ",
-" . ....... . ",
-" . ... . ",
-" . ... .. ",
-" .. . . ",
-" .. . . . ",
-" ........ . . ",
-" ..... . . . ",
-" . . . ",
-" . . . ",
-" . . . ",
-" . . . ",
-" . . ",
-" . . ",
-" .. ",
-" ",
-" ",
-" ",
-" ",
-" "};
diff --git a/widgets/misc/pixmaps/cursor_zoom_out.xpm b/widgets/misc/pixmaps/cursor_zoom_out.xpm
deleted file mode 100644
index af1b698521..0000000000
--- a/widgets/misc/pixmaps/cursor_zoom_out.xpm
+++ /dev/null
@@ -1,37 +0,0 @@
-/* XPM */
-static char * cursor_zoom_out_xpm[] = {
-"32 32 2 1",
-" c None",
-". c #000000",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ",
-" ...... ",
-" .. .. ",
-" .. .. ",
-" . . ",
-" . . ",
-" . . ",
-" . ....... . ",
-" . ....... . ",
-" . . ",
-" . .. ",
-" .. . . ",
-" .. . . . ",
-" ........ . . ",
-" ..... . . . ",
-" . . . ",
-" . . . ",
-" . . . ",
-" . . . ",
-" . . ",
-" . . ",
-" .. ",
-" ",
-" ",
-" ",
-" ",
-" "};