[Xfce4-commits] r25806 - xfcalendar/trunk/src
Author: juha Date: 2007-06-12 19:47:31 + (Tue, 12 Jun 2007) New Revision: 25806 Modified: xfcalendar/trunk/src/ical-code.c xfcalendar/trunk/src/reminder.c xfcalendar/trunk/src/reminder.h Log: fixed compatibility core dump caused by new procedure alarm used common code for alarms in ical Modified: xfcalendar/trunk/src/ical-code.c === --- xfcalendar/trunk/src/ical-code.c2007-06-12 19:14:56 UTC (rev 25805) +++ xfcalendar/trunk/src/ical-code.c2007-06-12 19:47:31 UTC (rev 25806) @@ -64,6 +64,8 @@ #include appointment.h #include parameters.h +static void xfical_alarm_build_list_internal(gboolean first_list_today); + /* #define ORAGE_DEBUG 1 */ @@ -1130,357 +1132,6 @@ return(appt); } -static void alarm_free(gpointer galarm, gpointer dummy) -{ -#undef P_N -#define P_N alarm_free: -alarm_struct *alarm = (alarm_struct *)galarm;; - -#ifdef ORAGE_DEBUG -g_print(P_N \n); -#endif -g_string_free(alarm-uid, TRUE); -g_free(alarm-alarm_time); -if (alarm-title != NULL) -g_string_free(alarm-title, TRUE); -if (alarm-description != NULL) -g_string_free(alarm-description, TRUE); -if (alarm-sound != NULL) -g_string_free(alarm-sound, TRUE); -g_free(alarm); -} - -static gint alarm_order(gconstpointer a, gconstpointer b) -{ -#undef P_N -#define P_N alarm_order: -struct icaltimetype t1, t2; - -#ifdef ORAGE_DEBUG -g_print(P_N \n); -#endif -t1=icaltime_from_string(((alarm_struct *)a)-alarm_time); -t2=icaltime_from_string(((alarm_struct *)b)-alarm_time); - -return(icaltime_compare(t1, t2)); -} - -/* -static void alarm_add(icalproperty_status action - , char *uid, char *file_type, char *title, char *description - , char *sound, gint repeat_cnt, gint repeat_delay - , struct icaltimetype alarm_time, struct icaltimetype event_time) -{ -#undef P_N -#define P_N alarm_add: -alarm_struct *new_alarm; - -#ifdef ORAGE_DEBUG -g_print(P_N \n); -#endif -new_alarm = g_new(alarm_struct, 1); -new_alarm-uid = g_string_new(file_type); -new_alarm-uid = g_string_append(new_alarm-uid, uid); -new_alarm-title = g_string_new(title); -new_alarm-alarm_time = g_strdup(icaltime_as_ical_string(alarm_time)); -new_alarm-event_time = g_strdup(icaltime_as_ical_string(event_time)); -new_alarm-description = g_string_new(description); -new_alarm-sound = g_string_new(sound); -new_alarm-repeat_cnt = repeat_cnt; -new_alarm-repeat_delay = repeat_delay; -if (description != NULL) -new_alarm-display = TRUE; -else -new_alarm-display = FALSE; -if (sound != NULL) -new_alarm-audio = TRUE; -else -new_alarm-audio = FALSE; - -g_par.alarm_list = g_list_append(g_par.alarm_list, new_alarm); -} -*/ - -/* let's find the trigger and check that it is active. - * return new alarm struct if alarm is active and NULL if it is not - * FIXME: We assume all alarms have similar trigger, which - * may not be true for other that Orage appointments - */ -static alarm_struct *process_alarm_trigger(icalcomponent *c -, icalcomponent *ca, struct icaltimetype cur_time, int *cnt_repeat) -{ -#undef P_N -#define P_N process_alarm_trigger: -icalproperty *p; -struct icaltriggertype trg; -icalparameter *trg_related_par; -icalparameter_related rel; -struct icalrecurrencetype rrule; -icalrecur_iterator* ri; -xfical_period per; -struct icaltimetype alarm_time, next_time; -gboolean trg_active = FALSE; -alarm_struct *new_alarm;; - -#ifdef ORAGE_DEBUG -g_print(P_N \n); -#endif -p = icalcomponent_get_first_property(ca, ICAL_TRIGGER_PROPERTY); -if (!p) { -g_warning(P_N Trigger not found); -return(NULL); -} -trg = icalproperty_get_trigger(p); -trg_related_par = icalproperty_get_first_parameter(p -, ICAL_RELATED_PARAMETER); -if (trg_related_par) -rel = icalparameter_get_related(trg_related_par); -else -rel = ICAL_RELATED_START; -per = get_period(c); -if (icaltime_is_date(per.stime)) { -/* HACK: convert to local time so that we can use time arithmetic - * when counting alarm time. */ -per.stime.is_date = 0; -per.stime.is_utc= cur_time.is_utc; -per.stime.is_daylight = cur_time.is_daylight; -per.stime.zone = cur_time.zone; -per.stime.hour = 0; -per.stime.minute= 0; -per.stime.second= 0; -} -if (rel == ICAL_RELATED_END) -alarm_time = icaltime_add(per.etime, trg.duration); -else /* default is ICAL_RELATED_START */ -alarm_time = icaltime_add(per.stime, trg.duration); -if (icaltime_compare(cur_time, alarm_time) = 0) { /* active */ -trg_active = TRUE; -} -else if ((p = icalcomponent_get_first_property(c -, ICAL_RRULE_PROPERTY))
[Xfce4-commits] r25807 - xfwm4/trunk/src
Author: olivier Date: 2007-06-12 23:03:09 + (Tue, 12 Jun 2007) New Revision: 25807 Modified: xfwm4/trunk/src/client.c xfwm4/trunk/src/client.h xfwm4/trunk/src/compositor.c xfwm4/trunk/src/compositor.h xfwm4/trunk/src/display.c xfwm4/trunk/src/display.h xfwm4/trunk/src/event_filter.c xfwm4/trunk/src/event_filter.h xfwm4/trunk/src/events.c xfwm4/trunk/src/events.h xfwm4/trunk/src/focus.c xfwm4/trunk/src/focus.h xfwm4/trunk/src/frame.c xfwm4/trunk/src/frame.h xfwm4/trunk/src/hints.c xfwm4/trunk/src/hints.h xfwm4/trunk/src/icons.c xfwm4/trunk/src/icons.h xfwm4/trunk/src/keyboard.c xfwm4/trunk/src/keyboard.h xfwm4/trunk/src/main.c xfwm4/trunk/src/menu.c xfwm4/trunk/src/menu.h xfwm4/trunk/src/misc.c xfwm4/trunk/src/misc.h xfwm4/trunk/src/mypixmap.c xfwm4/trunk/src/mypixmap.h xfwm4/trunk/src/mywindow.c xfwm4/trunk/src/mywindow.h xfwm4/trunk/src/netwm.c xfwm4/trunk/src/netwm.h xfwm4/trunk/src/parserc.c xfwm4/trunk/src/parserc.h xfwm4/trunk/src/placement.c xfwm4/trunk/src/placement.h xfwm4/trunk/src/poswin.c xfwm4/trunk/src/poswin.h xfwm4/trunk/src/screen.c xfwm4/trunk/src/screen.h xfwm4/trunk/src/session.c xfwm4/trunk/src/session.h xfwm4/trunk/src/settings.c xfwm4/trunk/src/settings.h xfwm4/trunk/src/spinning_cursor.c xfwm4/trunk/src/spinning_cursor.h xfwm4/trunk/src/stacking.c xfwm4/trunk/src/stacking.h xfwm4/trunk/src/startup_notification.c xfwm4/trunk/src/startup_notification.h xfwm4/trunk/src/tabwin.c xfwm4/trunk/src/tabwin.h xfwm4/trunk/src/transients.c xfwm4/trunk/src/transients.h xfwm4/trunk/src/ui_style.c xfwm4/trunk/src/ui_style.h xfwm4/trunk/src/wireframe.c xfwm4/trunk/src/wireframe.h xfwm4/trunk/src/workspaces.c xfwm4/trunk/src/workspaces.h Log: Rework a bit the code for hilight and frame drawing Modified: xfwm4/trunk/src/client.c === --- xfwm4/trunk/src/client.c2007-06-12 19:47:31 UTC (rev 25806) +++ xfwm4/trunk/src/client.c2007-06-12 23:03:09 UTC (rev 25807) @@ -15,7 +15,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. oroborus - (c) 2001 Ken Lynch -xfwm4- (c) 2002-2006 Olivier Fourdan +xfwm4- (c) 2002-2007 Olivier Fourdan */ @@ -1580,6 +1580,7 @@ DisplayInfo *display_info; gint size; GdkPixbuf *icon; +int i; g_return_if_fail (c != NULL); g_return_if_fail (c-window != None); @@ -1589,26 +1590,24 @@ screen_info = c-screen_info; display_info = screen_info-display_info; -xfwmPixmapFree (c-appmenu[ACTIVE]); -xfwmPixmapFree (c-appmenu[INACTIVE]); -xfwmPixmapFree (c-appmenu[PRESSED]); -xfwmPixmapFree (c-appmenu[PRELIGHT]); +for (i = 0; i STATE_TOGGLED; i++) +{ +xfwmPixmapFree (c-appmenu[i]); +} -if (screen_info-buttons[MENU_BUTTON][ACTIVE].pixmap == None) +if (xfwmPixmapNone(screen_info-buttons[MENU_BUTTON][ACTIVE])) { /* The current theme has no menu button */ return; } -xfwmPixmapDuplicate (screen_info-buttons[MENU_BUTTON][ACTIVE], - c-appmenu[ACTIVE]); -xfwmPixmapDuplicate (screen_info-buttons[MENU_BUTTON][INACTIVE], - c-appmenu[INACTIVE]); -xfwmPixmapDuplicate (screen_info-buttons[MENU_BUTTON][PRESSED], - c-appmenu[PRESSED]); -xfwmPixmapDuplicate (screen_info-buttons[MENU_BUTTON][PRELIGHT], - c-appmenu[PRELIGHT]); - +for (i = 0; i STATE_TOGGLED; i++) +{ +if (!xfwmPixmapNone(screen_info-buttons[MENU_BUTTON][i])) +{ +xfwmPixmapDuplicate (screen_info-buttons[MENU_BUTTON][i], c-appmenu[i]); +} +} size = MIN (screen_info-buttons[MENU_BUTTON][ACTIVE].width, screen_info-buttons[MENU_BUTTON][ACTIVE].height); @@ -1616,11 +1615,13 @@ { icon = getAppIcon (display_info, c-window, size, size); -xfwmPixmapRenderGdkPixbuf (c-appmenu[ACTIVE], icon); -xfwmPixmapRenderGdkPixbuf (c-appmenu[INACTIVE], icon); -xfwmPixmapRenderGdkPixbuf (c-appmenu[PRESSED], icon); -xfwmPixmapRenderGdkPixbuf (c-appmenu[PRELIGHT], icon); - +for (i = 0; i STATE_TOGGLED; i++) +{ +if (!xfwmPixmapNone(c-appmenu[i])) +{ +xfwmPixmapRenderGdkPixbuf (c-appmenu[i], icon); +} +} g_object_unref (icon); } } @@ -2005,39 +2006,39 @@ xfwmWindowCreate (screen_info, c-visual, c-depth, c-frame, c-sides[SIDE_LEFT], NoEventMask, -myDisplayGetCursorResize(screen_info-display_info, +myDisplayGetCursorResize(screen_info-display_info, CORNER_COUNT + SIDE_LEFT)); xfwmWindowCreate (screen_info, c-visual, c-depth, c-frame, -c-sides[SIDE_RIGHT], NoEventMask, -