From 53b09036ada8e234c95d1944d81a4743fe5cc6fb Mon Sep 17 00:00:00 2001 From: nobody Date: Fri, 9 Mar 2001 00:45:08 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'E_TREE_REWORK_BASE'. svn path=/tags/E_TREE_REWORK_BASE/; revision=8613 --- art/splash.png | Bin 142757 -> 128794 bytes calendar/gui/Evolution-Composer.h | 353 ----------- calendar/gui/alarm-notify/alarm-notify-dialog.c | 226 ------- calendar/gui/alarm-notify/alarm-notify-dialog.h | 45 -- calendar/gui/alarm-notify/alarm-notify.glade | 228 ------- calendar/gui/evolution-calendar-control.c | 201 ------ filter/filter-driver.c | 778 ----------------------- filter/filter-message-search.c | 806 ------------------------ ui/evolution-addressbook.h | 25 - ui/evolution-message-composer.h | 53 -- 10 files changed, 2715 deletions(-) delete mode 100644 calendar/gui/Evolution-Composer.h delete mode 100644 calendar/gui/alarm-notify/alarm-notify-dialog.c delete mode 100644 calendar/gui/alarm-notify/alarm-notify-dialog.h delete mode 100644 calendar/gui/alarm-notify/alarm-notify.glade delete mode 100644 calendar/gui/evolution-calendar-control.c delete mode 100644 filter/filter-driver.c delete mode 100644 filter/filter-message-search.c delete mode 100644 ui/evolution-addressbook.h delete mode 100644 ui/evolution-message-composer.h diff --git a/art/splash.png b/art/splash.png index fa76359778..6f4ab5b3e5 100644 Binary files a/art/splash.png and b/art/splash.png differ diff --git a/calendar/gui/Evolution-Composer.h b/calendar/gui/Evolution-Composer.h deleted file mode 100644 index 557a8dcdd4..0000000000 --- a/calendar/gui/Evolution-Composer.h +++ /dev/null @@ -1,353 +0,0 @@ -/* - * This file was generated by orbit-idl - DO NOT EDIT! - */ - -#include -#define ORBIT_IDL_SERIAL 9 -#include - -#ifndef Evolution_Composer_H -#define Evolution_Composer_H 1 -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/** typedefs **/ -#include -# 13 "/usr/share/idl/Bonobo.idl" -#if !defined(ORBIT_DECL_GNOME_Evolution_Composer) && !defined(_GNOME_Evolution_Composer_defined) -#define ORBIT_DECL_GNOME_Evolution_Composer 1 -#define _GNOME_Evolution_Composer_defined 1 -#define GNOME_Evolution_Composer__free CORBA_Object__free - typedef CORBA_Object GNOME_Evolution_Composer; - extern CORBA_unsigned_long GNOME_Evolution_Composer__classid; -#if !defined(TC_IMPL_TC_GNOME_Evolution_Composer_0) -#define TC_IMPL_TC_GNOME_Evolution_Composer_0 'E' -#define TC_IMPL_TC_GNOME_Evolution_Composer_1 'v' -#define TC_IMPL_TC_GNOME_Evolution_Composer_2 'o' -#define TC_IMPL_TC_GNOME_Evolution_Composer_3 'l' -#define TC_IMPL_TC_GNOME_Evolution_Composer_4 'u' -#define TC_IMPL_TC_GNOME_Evolution_Composer_5 't' -#define TC_IMPL_TC_GNOME_Evolution_Composer_6 'i' -#define TC_IMPL_TC_GNOME_Evolution_Composer_7 'o' -#define TC_IMPL_TC_GNOME_Evolution_Composer_8 'n' -#define TC_IMPL_TC_GNOME_Evolution_Composer_9 '_' -#define TC_IMPL_TC_GNOME_Evolution_Composer_10 'C' -#define TC_IMPL_TC_GNOME_Evolution_Composer_11 'o' -#define TC_IMPL_TC_GNOME_Evolution_Composer_12 'm' -#define TC_IMPL_TC_GNOME_Evolution_Composer_13 'p' -#define TC_IMPL_TC_GNOME_Evolution_Composer_14 'o' -#define TC_IMPL_TC_GNOME_Evolution_Composer_15 's' -#define TC_IMPL_TC_GNOME_Evolution_Composer_16 'e' -#define TC_IMPL_TC_GNOME_Evolution_Composer_17 'r' - extern const struct CORBA_TypeCode_struct - TC_GNOME_Evolution_Composer_struct; -#define TC_GNOME_Evolution_Composer ((CORBA_TypeCode)&TC_GNOME_Evolution_Composer_struct) -#endif -#endif -#if !defined(_GNOME_Evolution_Composer_Recipient_defined) -#define _GNOME_Evolution_Composer_Recipient_defined 1 - typedef struct - { - CORBA_char *name; - CORBA_char *address; - } - GNOME_Evolution_Composer_Recipient; - -#if !defined(TC_IMPL_TC_GNOME_Evolution_Composer_Recipient_0) -#define TC_IMPL_TC_GNOME_Evolution_Composer_Recipient_0 'E' -#define TC_IMPL_TC_GNOME_Evolution_Composer_Recipient_1 'v' -#define TC_IMPL_TC_GNOME_Evolution_Composer_Recipient_2 'o' -#define TC_IMPL_TC_GNOME_Evolution_Composer_Recipient_3 'l' -#define TC_IMPL_TC_GNOME_Evolution_Composer_Recipient_4 'u' -#define TC_IMPL_TC_GNOME_Evolution_Composer_Recipient_5 't' -#define TC_IMPL_TC_GNOME_Evolution_Composer_Recipient_6 'i' -#define TC_IMPL_TC_GNOME_Evolution_Composer_Recipient_7 'o' -#define TC_IMPL_TC_GNOME_Evolution_Composer_Recipient_8 'n' -#define TC_IMPL_TC_GNOME_Evolution_Composer_Recipient_9 '_' -#define TC_IMPL_TC_GNOME_Evolution_Composer_Recipient_10 'C' -#define TC_IMPL_TC_GNOME_Evolution_Composer_Recipient_11 'o' -#define TC_IMPL_TC_GNOME_Evolution_Composer_Recipient_12 'm' -#define TC_IMPL_TC_GNOME_Evolution_Composer_Recipient_13 'p' -#define TC_IMPL_TC_GNOME_Evolution_Composer_Recipient_14 'o' -#define TC_IMPL_TC_GNOME_Evolution_Composer_Recipient_15 's' -#define TC_IMPL_TC_GNOME_Evolution_Composer_Recipient_16 'e' -#define TC_IMPL_TC_GNOME_Evolution_Composer_Recipient_17 'r' - extern const struct CORBA_TypeCode_struct - TC_GNOME_Evolution_Composer_Recipient_struct; -#define TC_GNOME_Evolution_Composer_Recipient ((CORBA_TypeCode)&TC_GNOME_Evolution_Composer_Recipient_struct) -#endif - extern GNOME_Evolution_Composer_Recipient - *GNOME_Evolution_Composer_Recipient__alloc(void); - extern gpointer GNOME_Evolution_Composer_Recipient__free(gpointer mem, - gpointer dat, - CORBA_boolean free_strings); /* ORBit internal use */ -#endif -#if !defined(ORBIT_DECL_CORBA_sequence_GNOME_Evolution_Composer_Recipient) && !defined(_CORBA_sequence_GNOME_Evolution_Composer_Recipient_defined) -#define ORBIT_DECL_CORBA_sequence_GNOME_Evolution_Composer_Recipient 1 -#define _CORBA_sequence_GNOME_Evolution_Composer_Recipient_defined 1 -#define ORBIT_IMPL_CORBA_sequence_GNOME_Evolution_Composer_Recipient_0 'E' -#define ORBIT_IMPL_CORBA_sequence_GNOME_Evolution_Composer_Recipient_1 'v' -#define ORBIT_IMPL_CORBA_sequence_GNOME_Evolution_Composer_Recipient_2 'o' -#define ORBIT_IMPL_CORBA_sequence_GNOME_Evolution_Composer_Recipient_3 'l' -#define ORBIT_IMPL_CORBA_sequence_GNOME_Evolution_Composer_Recipient_4 'u' -#define ORBIT_IMPL_CORBA_sequence_GNOME_Evolution_Composer_Recipient_5 't' -#define ORBIT_IMPL_CORBA_sequence_GNOME_Evolution_Composer_Recipient_6 'i' -#define ORBIT_IMPL_CORBA_sequence_GNOME_Evolution_Composer_Recipient_7 'o' -#define ORBIT_IMPL_CORBA_sequence_GNOME_Evolution_Composer_Recipient_8 'n' -#define ORBIT_IMPL_CORBA_sequence_GNOME_Evolution_Composer_Recipient_9 '_' -#define ORBIT_IMPL_CORBA_sequence_GNOME_Evolution_Composer_Recipient_10 'C' -#define ORBIT_IMPL_CORBA_sequence_GNOME_Evolution_Composer_Recipient_11 'o' -#define ORBIT_IMPL_CORBA_sequence_GNOME_Evolution_Composer_Recipient_12 'm' -#define ORBIT_IMPL_CORBA_sequence_GNOME_Evolution_Composer_Recipient_13 'p' -#define ORBIT_IMPL_CORBA_sequence_GNOME_Evolution_Composer_Recipient_14 'o' -#define ORBIT_IMPL_CORBA_sequence_GNOME_Evolution_Composer_Recipient_15 's' -#define ORBIT_IMPL_CORBA_sequence_GNOME_Evolution_Composer_Recipient_16 'e' -#define ORBIT_IMPL_CORBA_sequence_GNOME_Evolution_Composer_Recipient_17 'r' - typedef struct - { - CORBA_unsigned_long _maximum, - _length; - GNOME_Evolution_Composer_Recipient *_buffer; - CORBA_boolean _release; - } - CORBA_sequence_GNOME_Evolution_Composer_Recipient; -#if !defined(TC_IMPL_TC_CORBA_sequence_GNOME_Evolution_Composer_Recipient_0) -#define TC_IMPL_TC_CORBA_sequence_GNOME_Evolution_Composer_Recipient_0 'E' -#define TC_IMPL_TC_CORBA_sequence_GNOME_Evolution_Composer_Recipient_1 'v' -#define TC_IMPL_TC_CORBA_sequence_GNOME_Evolution_Composer_Recipient_2 'o' -#define TC_IMPL_TC_CORBA_sequence_GNOME_Evolution_Composer_Recipient_3 'l' -#define TC_IMPL_TC_CORBA_sequence_GNOME_Evolution_Composer_Recipient_4 'u' -#define TC_IMPL_TC_CORBA_sequence_GNOME_Evolution_Composer_Recipient_5 't' -#define TC_IMPL_TC_CORBA_sequence_GNOME_Evolution_Composer_Recipient_6 'i' -#define TC_IMPL_TC_CORBA_sequence_GNOME_Evolution_Composer_Recipient_7 'o' -#define TC_IMPL_TC_CORBA_sequence_GNOME_Evolution_Composer_Recipient_8 'n' -#define TC_IMPL_TC_CORBA_sequence_GNOME_Evolution_Composer_Recipient_9 '_' -#define TC_IMPL_TC_CORBA_sequence_GNOME_Evolution_Composer_Recipient_10 'C' -#define TC_IMPL_TC_CORBA_sequence_GNOME_Evolution_Composer_Recipient_11 'o' -#define TC_IMPL_TC_CORBA_sequence_GNOME_Evolution_Composer_Recipient_12 'm' -#define TC_IMPL_TC_CORBA_sequence_GNOME_Evolution_Composer_Recipient_13 'p' -#define TC_IMPL_TC_CORBA_sequence_GNOME_Evolution_Composer_Recipient_14 'o' -#define TC_IMPL_TC_CORBA_sequence_GNOME_Evolution_Composer_Recipient_15 's' -#define TC_IMPL_TC_CORBA_sequence_GNOME_Evolution_Composer_Recipient_16 'e' -#define TC_IMPL_TC_CORBA_sequence_GNOME_Evolution_Composer_Recipient_17 'r' - extern const struct CORBA_TypeCode_struct - TC_CORBA_sequence_GNOME_Evolution_Composer_Recipient_struct; -#define TC_CORBA_sequence_GNOME_Evolution_Composer_Recipient ((CORBA_TypeCode)&TC_CORBA_sequence_GNOME_Evolution_Composer_Recipient_struct) -#endif - extern CORBA_sequence_GNOME_Evolution_Composer_Recipient - *CORBA_sequence_GNOME_Evolution_Composer_Recipient__alloc(void); - extern gpointer - CORBA_sequence_GNOME_Evolution_Composer_Recipient__free(gpointer mem, - gpointer dat, - CORBA_boolean free_strings); /* ORBit internal use */ - GNOME_Evolution_Composer_Recipient - *CORBA_sequence_GNOME_Evolution_Composer_Recipient_allocbuf - (CORBA_unsigned_long len); -#endif -#if !defined(_GNOME_Evolution_Composer_RecipientList_defined) -#define _GNOME_Evolution_Composer_RecipientList_defined 1 - typedef CORBA_sequence_GNOME_Evolution_Composer_Recipient - GNOME_Evolution_Composer_RecipientList; -#if !defined(TC_IMPL_TC_GNOME_Evolution_Composer_RecipientList_0) -#define TC_IMPL_TC_GNOME_Evolution_Composer_RecipientList_0 'E' -#define TC_IMPL_TC_GNOME_Evolution_Composer_RecipientList_1 'v' -#define TC_IMPL_TC_GNOME_Evolution_Composer_RecipientList_2 'o' -#define TC_IMPL_TC_GNOME_Evolution_Composer_RecipientList_3 'l' -#define TC_IMPL_TC_GNOME_Evolution_Composer_RecipientList_4 'u' -#define TC_IMPL_TC_GNOME_Evolution_Composer_RecipientList_5 't' -#define TC_IMPL_TC_GNOME_Evolution_Composer_RecipientList_6 'i' -#define TC_IMPL_TC_GNOME_Evolution_Composer_RecipientList_7 'o' -#define TC_IMPL_TC_GNOME_Evolution_Composer_RecipientList_8 'n' -#define TC_IMPL_TC_GNOME_Evolution_Composer_RecipientList_9 '_' -#define TC_IMPL_TC_GNOME_Evolution_Composer_RecipientList_10 'C' -#define TC_IMPL_TC_GNOME_Evolution_Composer_RecipientList_11 'o' -#define TC_IMPL_TC_GNOME_Evolution_Composer_RecipientList_12 'm' -#define TC_IMPL_TC_GNOME_Evolution_Composer_RecipientList_13 'p' -#define TC_IMPL_TC_GNOME_Evolution_Composer_RecipientList_14 'o' -#define TC_IMPL_TC_GNOME_Evolution_Composer_RecipientList_15 's' -#define TC_IMPL_TC_GNOME_Evolution_Composer_RecipientList_16 'e' -#define TC_IMPL_TC_GNOME_Evolution_Composer_RecipientList_17 'r' - extern const struct CORBA_TypeCode_struct - TC_GNOME_Evolution_Composer_RecipientList_struct; -#define TC_GNOME_Evolution_Composer_RecipientList ((CORBA_TypeCode)&TC_GNOME_Evolution_Composer_RecipientList_struct) -#endif - extern GNOME_Evolution_Composer_RecipientList - *GNOME_Evolution_Composer_RecipientList__alloc(void); - extern gpointer GNOME_Evolution_Composer_RecipientList__free(gpointer mem, - gpointer dat, - CORBA_boolean free_strings); /* ORBit internal use */ -#endif -#define ex_GNOME_Evolution_Composer_CouldNotParse "IDL:GNOME/Evolution/Composer/CouldNotParse:1.0" - void _ORBIT_GNOME_Evolution_Composer_CouldNotParse_demarshal(GIOPRecvBuffer - * - _ORBIT_recv_buffer, - CORBA_Environment - * ev); - void _ORBIT_GNOME_Evolution_Composer_CouldNotParse_marshal(GIOPSendBuffer * - _ORBIT_send_buffer, - CORBA_Environment - * ev); -#if !defined(_GNOME_Evolution_Composer_CouldNotParse_defined) -#define _GNOME_Evolution_Composer_CouldNotParse_defined 1 - typedef struct - { - int dummy; - } - GNOME_Evolution_Composer_CouldNotParse; - -#if !defined(TC_IMPL_TC_GNOME_Evolution_Composer_CouldNotParse_0) -#define TC_IMPL_TC_GNOME_Evolution_Composer_CouldNotParse_0 'E' -#define TC_IMPL_TC_GNOME_Evolution_Composer_CouldNotParse_1 'v' -#define TC_IMPL_TC_GNOME_Evolution_Composer_CouldNotParse_2 'o' -#define TC_IMPL_TC_GNOME_Evolution_Composer_CouldNotParse_3 'l' -#define TC_IMPL_TC_GNOME_Evolution_Composer_CouldNotParse_4 'u' -#define TC_IMPL_TC_GNOME_Evolution_Composer_CouldNotParse_5 't' -#define TC_IMPL_TC_GNOME_Evolution_Composer_CouldNotParse_6 'i' -#define TC_IMPL_TC_GNOME_Evolution_Composer_CouldNotParse_7 'o' -#define TC_IMPL_TC_GNOME_Evolution_Composer_CouldNotParse_8 'n' -#define TC_IMPL_TC_GNOME_Evolution_Composer_CouldNotParse_9 '_' -#define TC_IMPL_TC_GNOME_Evolution_Composer_CouldNotParse_10 'C' -#define TC_IMPL_TC_GNOME_Evolution_Composer_CouldNotParse_11 'o' -#define TC_IMPL_TC_GNOME_Evolution_Composer_CouldNotParse_12 'm' -#define TC_IMPL_TC_GNOME_Evolution_Composer_CouldNotParse_13 'p' -#define TC_IMPL_TC_GNOME_Evolution_Composer_CouldNotParse_14 'o' -#define TC_IMPL_TC_GNOME_Evolution_Composer_CouldNotParse_15 's' -#define TC_IMPL_TC_GNOME_Evolution_Composer_CouldNotParse_16 'e' -#define TC_IMPL_TC_GNOME_Evolution_Composer_CouldNotParse_17 'r' - extern const struct CORBA_TypeCode_struct - TC_GNOME_Evolution_Composer_CouldNotParse_struct; -#define TC_GNOME_Evolution_Composer_CouldNotParse ((CORBA_TypeCode)&TC_GNOME_Evolution_Composer_CouldNotParse_struct) -#endif -#define GNOME_Evolution_Composer_CouldNotParse__alloc() NULL - extern gpointer GNOME_Evolution_Composer_CouldNotParse__free(gpointer mem, - gpointer dat, - CORBA_boolean free_strings); /* ORBit internal use */ -#endif - -/** POA structures **/ - typedef struct - { - void *_private; - void (*setHeaders) (PortableServer_Servant _servant, - const GNOME_Evolution_Composer_RecipientList * to, - const GNOME_Evolution_Composer_RecipientList * cc, - const GNOME_Evolution_Composer_RecipientList * bcc, - const CORBA_char * subject, CORBA_Environment * ev); - void (*setBodyText) (PortableServer_Servant _servant, - const CORBA_char * body, CORBA_Environment * ev); - void (*attachMIME) (PortableServer_Servant _servant, - const CORBA_char * data, CORBA_Environment * ev); - void (*attachData) (PortableServer_Servant _servant, - const CORBA_char * content_type, - const CORBA_char * filename, - const CORBA_char * description, - const CORBA_boolean show_inline, - const CORBA_char * data, CORBA_Environment * ev); - void (*show) (PortableServer_Servant _servant, CORBA_Environment * ev); - } - POA_GNOME_Evolution_Composer__epv; - typedef struct - { - PortableServer_ServantBase__epv *_base_epv; - POA_Bonobo_Unknown__epv *Bonobo_Unknown_epv; - POA_GNOME_Evolution_Composer__epv *GNOME_Evolution_Composer_epv; - } - POA_GNOME_Evolution_Composer__vepv; - typedef struct - { - void *_private; - POA_GNOME_Evolution_Composer__vepv *vepv; - } - POA_GNOME_Evolution_Composer; - extern void POA_GNOME_Evolution_Composer__init(PortableServer_Servant - servant, - CORBA_Environment * ev); - extern void POA_GNOME_Evolution_Composer__fini(PortableServer_Servant - servant, - CORBA_Environment * ev); - -/** prototypes **/ -#define GNOME_Evolution_Composer_ref Bonobo_Unknown_ref -#define GNOME_Evolution_Composer_unref Bonobo_Unknown_unref -#define GNOME_Evolution_Composer_queryInterface Bonobo_Unknown_queryInterface - void GNOME_Evolution_Composer_setHeaders(GNOME_Evolution_Composer _obj, - const - GNOME_Evolution_Composer_RecipientList - * to, - const - GNOME_Evolution_Composer_RecipientList - * cc, - const - GNOME_Evolution_Composer_RecipientList - * bcc, const CORBA_char * subject, - CORBA_Environment * ev); - void GNOME_Evolution_Composer_setBodyText(GNOME_Evolution_Composer _obj, - const CORBA_char * body, - CORBA_Environment * ev); - void GNOME_Evolution_Composer_attachMIME(GNOME_Evolution_Composer _obj, - const CORBA_char * data, - CORBA_Environment * ev); - void GNOME_Evolution_Composer_attachData(GNOME_Evolution_Composer _obj, - const CORBA_char * content_type, - const CORBA_char * filename, - const CORBA_char * description, - const CORBA_boolean show_inline, - const CORBA_char * data, - CORBA_Environment * ev); - void GNOME_Evolution_Composer_show(GNOME_Evolution_Composer _obj, - CORBA_Environment * ev); - - void - _ORBIT_skel_GNOME_Evolution_Composer_setHeaders - (POA_GNOME_Evolution_Composer * _ORBIT_servant, - GIOPRecvBuffer * _ORBIT_recv_buffer, CORBA_Environment * ev, - void (*_impl_setHeaders) (PortableServer_Servant _servant, - const GNOME_Evolution_Composer_RecipientList - * to, - const GNOME_Evolution_Composer_RecipientList - * cc, - const GNOME_Evolution_Composer_RecipientList - * bcc, const CORBA_char * subject, - CORBA_Environment * ev)); - void - _ORBIT_skel_GNOME_Evolution_Composer_setBodyText - (POA_GNOME_Evolution_Composer * _ORBIT_servant, - GIOPRecvBuffer * _ORBIT_recv_buffer, CORBA_Environment * ev, - void (*_impl_setBodyText) (PortableServer_Servant _servant, - const CORBA_char * body, - CORBA_Environment * ev)); - void - _ORBIT_skel_GNOME_Evolution_Composer_attachMIME - (POA_GNOME_Evolution_Composer * _ORBIT_servant, - GIOPRecvBuffer * _ORBIT_recv_buffer, CORBA_Environment * ev, - void (*_impl_attachMIME) (PortableServer_Servant _servant, - const CORBA_char * data, - CORBA_Environment * ev)); - void - _ORBIT_skel_GNOME_Evolution_Composer_attachData - (POA_GNOME_Evolution_Composer * _ORBIT_servant, - GIOPRecvBuffer * _ORBIT_recv_buffer, CORBA_Environment * ev, - void (*_impl_attachData) (PortableServer_Servant _servant, - const CORBA_char * content_type, - const CORBA_char * filename, - const CORBA_char * description, - const CORBA_boolean show_inline, - const CORBA_char * data, - CORBA_Environment * ev)); - void _ORBIT_skel_GNOME_Evolution_Composer_show(POA_GNOME_Evolution_Composer - * _ORBIT_servant, - GIOPRecvBuffer * - _ORBIT_recv_buffer, - CORBA_Environment * ev, - void (*_impl_show) - (PortableServer_Servant - _servant, - CORBA_Environment * ev)); -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -#undef ORBIT_IDL_SERIAL diff --git a/calendar/gui/alarm-notify/alarm-notify-dialog.c b/calendar/gui/alarm-notify/alarm-notify-dialog.c deleted file mode 100644 index fbd8c1f097..0000000000 --- a/calendar/gui/alarm-notify/alarm-notify-dialog.c +++ /dev/null @@ -1,226 +0,0 @@ -/* Evolution calendar - alarm notification dialog - * - * Copyright (C) 2000 Helix Code, Inc. - * Copyright (C) 2000 Ximian, Inc. - * - * Author: Federico Mena-Quintero - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - */ - -#include -#include -#include -#include "alarm-notify-dialog.h" - - - -/* The useful contents of the alarm notify dialog */ -typedef struct { - GladeXML *xml; - - GtkWidget *dialog; - GtkWidget *close; - GtkWidget *snooze; - GtkWidget *edit; - GtkWidget *heading; - GtkWidget *summary; - GtkWidget *snooze_time; - - AlarmNotifyFunc func; - gpointer func_data; -} AlarmNotify; - - - -/* Callback used when the notify dialog is destroyed */ -static void -dialog_destroy_cb (GtkObject *object, gpointer data) -{ - AlarmNotify *an; - - an = data; - gtk_object_unref (GTK_OBJECT (an->xml)); - g_free (an); -} - -/* Delete_event handler for the alarm notify dialog */ -static gint -delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data) -{ - AlarmNotify *an; - - an = data; - g_assert (an->func != NULL); - - (* an->func) (ALARM_NOTIFY_CLOSE, -1, an->func_data); - - gtk_widget_destroy (widget); - return TRUE; -} - -/* Callback for the close button */ -static void -close_clicked_cb (GtkWidget *widget, gpointer data) -{ - AlarmNotify *an; - - an = data; - g_assert (an->func != NULL); - - (* an->func) (ALARM_NOTIFY_CLOSE, -1, an->func_data); - - gtk_widget_destroy (an->dialog); -} - -/* Callback for the snooze button */ -static void -snooze_clicked_cb (GtkWidget *widget, gpointer data) -{ - AlarmNotify *an; - int snooze_time; - - an = data; - g_assert (an->func != NULL); - - snooze_time = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (an->snooze_time)); - (* an->func) (ALARM_NOTIFY_SNOOZE, snooze_time, an->func_data); - - gtk_widget_destroy (an->dialog); -} - -/* Callback for the edit button */ -static void -edit_clicked_cb (GtkWidget *widget, gpointer data) -{ - AlarmNotify *an; - - an = data; - g_assert (an->func != NULL); - - (* an->func) (ALARM_NOTIFY_EDIT, -1, an->func_data); - - gtk_widget_destroy (an->dialog); -} - -/** - * alarm_notify_dialog: - * @trigger: Trigger time for the alarm. - * @occur: Occurrence time for the event. - * @comp: Calendar component object which corresponds to the alarm. - * @func: Function to be called when a dialog action is invoked. - * @func_data: Closure data for @func. - * - * Runs the alarm notification dialog. The specified @func will be used to - * notify the client about result of the actions in the dialog. - * - * Return value: TRUE on success, FALSE if the dialog could not be created. - **/ -gboolean -alarm_notify_dialog (time_t trigger, time_t occur, CalComponent *comp, - AlarmNotifyFunc func, gpointer func_data) -{ - AlarmNotify *an; - char buf[256]; - struct tm tm_trigger; - struct tm tm_occur; - CalComponentText summary; - - g_return_val_if_fail (trigger != -1, FALSE); - g_return_val_if_fail (occur != -1, FALSE); - g_return_val_if_fail (comp != NULL, FALSE); - g_return_val_if_fail (IS_CAL_COMPONENT (comp), FALSE); - g_return_val_if_fail (func != NULL, FALSE); - - an = g_new0 (AlarmNotify, 1); - - an->func = func; - an->func_data = func_data; - - an->xml = glade_xml_new (EVOLUTION_GLADEDIR "/alarm-notify.glade", NULL); - if (!an->xml) { - g_message ("alarm_notify_dialog(): Could not load the Glade XML file!"); - g_free (an); - return FALSE; - } - - an->dialog = glade_xml_get_widget (an->xml, "alarm-notify"); - an->close = glade_xml_get_widget (an->xml, "close"); - an->snooze = glade_xml_get_widget (an->xml, "snooze"); - an->edit = glade_xml_get_widget (an->xml, "edit"); - an->heading = glade_xml_get_widget (an->xml, "heading"); - an->summary = glade_xml_get_widget (an->xml, "summary"); - an->snooze_time = glade_xml_get_widget (an->xml, "snooze-time"); - - if (!(an->dialog && an->close && an->snooze && an->edit && an->heading && an->summary - && an->snooze_time)) { - g_message ("alarm_notify_dialog(): Could not find all widgets in Glade file!"); - gtk_object_unref (GTK_OBJECT (an->xml)); - g_free (an); - return FALSE; - } - - gtk_object_set_data (GTK_OBJECT (an->dialog), "alarm-notify", an); - gtk_signal_connect (GTK_OBJECT (an->dialog), "destroy", - GTK_SIGNAL_FUNC (dialog_destroy_cb), an); - - /* Title */ - - /* FIXME: use am_pm_flag or 24-hour time */ - - tm_trigger = *localtime (&trigger); - strftime (buf, sizeof (buf), _("Alarm on %A %b %d %Y %H:%M"), &tm_trigger); - gtk_window_set_title (GTK_WINDOW (an->dialog), buf); - - /* Heading */ - - tm_occur = *localtime (&occur); - strftime (buf, sizeof (buf), - _("Notification about your appointment on %A %b %d %Y %H:%M"), - &tm_occur); - gtk_label_set_text (GTK_LABEL (an->heading), buf); - - /* Summary */ - - cal_component_get_summary (comp, &summary); - - if (summary.value) - gtk_label_set_text (GTK_LABEL (an->summary), summary.value); - else - gtk_label_set_text (GTK_LABEL (an->summary), _("No summary available.")); - - /* Connect actions */ - - gtk_signal_connect (GTK_OBJECT (an->dialog), "delete_event", - GTK_SIGNAL_FUNC (delete_event_cb), - an); - - gtk_signal_connect (GTK_OBJECT (an->close), "clicked", - GTK_SIGNAL_FUNC (close_clicked_cb), - an); - - gtk_signal_connect (GTK_OBJECT (an->snooze), "clicked", - GTK_SIGNAL_FUNC (snooze_clicked_cb), - an); - - gtk_signal_connect (GTK_OBJECT (an->edit), "clicked", - GTK_SIGNAL_FUNC (edit_clicked_cb), - an); - - /* Run! */ - - gtk_widget_show (an->dialog); - return TRUE; -} diff --git a/calendar/gui/alarm-notify/alarm-notify-dialog.h b/calendar/gui/alarm-notify/alarm-notify-dialog.h deleted file mode 100644 index f2c938c495..0000000000 --- a/calendar/gui/alarm-notify/alarm-notify-dialog.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Evolution calendar - alarm notification dialog - * - * Copyright (C) 2000 Helix Code, Inc. - * Copyright (C) 2000 Ximian, Inc. - * - * Author: Federico Mena-Quintero - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef ALARM_NOTIFY_DIALOG_H -#define ALARM_NOTIFY_DIALOG_H - -#include -#include -#include - - - -typedef enum { - ALARM_NOTIFY_CLOSE, - ALARM_NOTIFY_SNOOZE, - ALARM_NOTIFY_EDIT -} AlarmNotifyResult; - -typedef void (* AlarmNotifyFunc) (AlarmNotifyResult result, int snooze_mins, gpointer data); - -gboolean alarm_notify_dialog (time_t trigger, time_t occur, CalComponent *comp, - AlarmNotifyFunc func, gpointer func_data); - - - -#endif diff --git a/calendar/gui/alarm-notify/alarm-notify.glade b/calendar/gui/alarm-notify/alarm-notify.glade deleted file mode 100644 index 41718d0572..0000000000 --- a/calendar/gui/alarm-notify/alarm-notify.glade +++ /dev/null @@ -1,228 +0,0 @@ - - - - - Evolution Calendar - evolution-calendar - - src - pixmaps - C - True - True - False - True - True - True - True - interface.c - interface.h - callbacks.c - callbacks.h - support.c - support.h - - - - GtkWindow - alarm-notify - True - - GTK_WINDOW_DIALOG - GTK_WIN_POS_CENTER - False - False - False - False - - - GtkVBox - vbox2 - 4 - True - False - 4 - - - GtkHBox - hbox3 - True - False - 8 - - 0 - True - True - - - - GtkVBox - vbox5 - True - False - 4 - - 0 - True - True - - - - GtkLabel - heading - True - - GTK_JUSTIFY_LEFT - True - 0 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkLabel - summary - True - - GTK_JUSTIFY_LEFT - True - 0 - 0.5 - 0 - 0 - - 0 - False - False - - - - - - GtkVBox - vbox4 - True - False - 4 - - 0 - True - True - - - - GtkButton - close - True - True - - - 0 - False - False - - - - - GtkButton - snooze - True - True - - - 0 - False - False - - - - - GtkButton - edit - True - True - - - 0 - False - False - - - - - - - GtkHSeparator - hseparator1 - True - - 0 - True - True - - - - - GtkHBox - hbox4 - True - False - 4 - - 0 - True - True - - - - GtkLabel - label4 - True - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkSpinButton - snooze-time - True - True - 1 - 0 - False - GTK_UPDATE_ALWAYS - False - False - 5 - 1 - 1440 - 1 - 5 - 5 - - 0 - False - False - - - - - - - diff --git a/calendar/gui/evolution-calendar-control.c b/calendar/gui/evolution-calendar-control.c deleted file mode 100644 index 7ebe2b5f8e..0000000000 --- a/calendar/gui/evolution-calendar-control.c +++ /dev/null @@ -1,201 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ - -#include -#include -#include -#include -#include -#include - -#ifdef USING_OAF -#include -#else -#include -#endif - -#include -#include -#include -#include - -#define PROPERTY_CALENDAR_URI "folder_uri" - -#define PROPERTY_CALENDAR_URI_IDX 1 - -#ifdef USING_OAF -#define CONTROL_FACTORY_ID "OAFIID:control-factory:calendar:f4f90989-0f50-4af2-ad94-8bbdf331f0bc" -#else -#define CONTROL_FACTORY_ID "control-factory:calendar" -#endif - -CORBA_Environment ev; -CORBA_ORB orb; - - -static void -control_activate_cb (BonoboControl *control, - gboolean activate, - gpointer user_data) -{ - if (activate) - calendar_control_activate (control, user_data); - else - calendar_control_deactivate (control); -} - - - -static void -init_bonobo (int *argc, char **argv) -{ -#ifdef USING_OAF - /* FIXME: VERSION instead of "0.0". */ - gnome_init_with_popt_table ("evolution-calendar", "0.0", - *argc, argv, oaf_popt_options, - 0, NULL); - oaf_init (*argc, argv); -#else - gnome_CORBA_init_with_popt_table ( - "evolution-calendar", "0.0", - argc, argv, NULL, 0, NULL, GNORBA_INIT_SERVER_FUNC, &ev); -#endif - - if (bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE) - g_error (_("Could not initialize Bonobo")); - - glade_gnome_init (); -} - - - -static void -get_prop (BonoboPropertyBag *bag, - BonoboArg *arg, - guint arg_id, - gpointer user_data) -{ - /*GnomeCalendar *gcal = user_data;*/ - - switch (arg_id) { - - case PROPERTY_CALENDAR_URI_IDX: - /* - if (fb && fb->uri) - BONOBO_ARG_SET_STRING (arg, fb->uri); - else - BONOBO_ARG_SET_STRING (arg, ""); - */ - break; - - default: - g_warning ("Unhandled arg %d\n", arg_id); - } -} - -static void -set_prop (BonoboPropertyBag *bag, - const BonoboArg *arg, - guint arg_id, - gpointer user_data) -{ - GnomeCalendar *gcal = user_data; - char *filename; - - switch (arg_id) { - - case PROPERTY_CALENDAR_URI_IDX: - printf ("set_prop: '%s'\n", BONOBO_ARG_GET_STRING (arg)); - filename = g_strdup_printf ("%s/calendar.vcf", - BONOBO_ARG_GET_STRING (arg)); - calendar_set_uri (gcal, filename); - g_free (filename); - break; - - default: - g_warning ("Unhandled arg %d\n", arg_id); - break; - } -} - - -static void -calendar_properties_init (GnomeCalendar *gcal) -{ - gcal->properties = bonobo_property_bag_new (get_prop, set_prop, gcal); - - bonobo_property_bag_add (gcal->properties, - PROPERTY_CALENDAR_URI, - PROPERTY_CALENDAR_URI_IDX, - BONOBO_ARG_STRING, - NULL, - _("The URI that the calendar will display"), - 0); - - bonobo_control_set_property_bag (gcal->control, gcal->properties); -} - - - -static BonoboObject * -calendar_control_factory (BonoboGenericFactory *Factory, void *closure) -{ - BonoboControl *control; - - /* Create the control. */ - GnomeCalendar *cal = new_calendar (full_name, NULL, NULL, 0); - - gtk_widget_show (GTK_WIDGET (cal)); - - control = bonobo_control_new (GTK_WIDGET (cal)); - cal->control = control; - - calendar_properties_init (cal); - - gtk_signal_connect (GTK_OBJECT (control), "activate", - control_activate_cb, cal); - - return BONOBO_OBJECT (control); -} - - -static void -calendar_control_factory_init (void) -{ - static BonoboGenericFactory *factory = NULL; - - if (factory != NULL) - return; - - puts ("XXXXXX - initializing calendar factory!!!"); - - factory = bonobo_generic_factory_new (CONTROL_FACTORY_ID, calendar_control_factory, NULL); - - if (factory == NULL) - g_error ("I could not register a Calendar control factory."); -} - - -int -main (int argc, char **argv) -{ - init_bonobo (&argc, argv); - glade_gnome_init (); - alarm_init (); - e_cursors_init (); - - init_calendar (); - - //g_log_set_always_fatal ((GLogLevelFlags) 0xFFFF); - g_log_set_always_fatal (G_LOG_LEVEL_ERROR | - G_LOG_LEVEL_CRITICAL | - G_LOG_LEVEL_WARNING); - - CORBA_exception_init (&ev); - - calendar_control_factory_init (); - component_factory_init (); - - bonobo_main (); - - return 0; -} diff --git a/filter/filter-driver.c b/filter/filter-driver.c deleted file mode 100644 index bc941a9c01..0000000000 --- a/filter/filter-driver.c +++ /dev/null @@ -1,778 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Copyright (C) 2000 Helix Code Inc. - * - * Authors: Michael Zucchi - * Jeffrey Stedfast - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "filter-driver.h" -#include "filter-message-search.h" - -#include -#include -#include -#include - -#include - -#include -#include - -#include -#include "filter-context.h" -#include "filter-filter.h" -#include "e-util/e-sexp.h" -#include "e-util/e-memory.h" - -#define d(x) - -/* type of status for a log report */ -enum filter_log_t { - FILTER_LOG_NONE, - FILTER_LOG_START, /* start of new log entry */ - FILTER_LOG_ACTION, /* an action performed */ - FILTER_LOG_END, /* end of log */ -}; - -struct _FilterDriverPrivate { - GHashTable *globals; /* global variables */ - - CamelFolder *defaultfolder; /* defualt folder */ - - FDStatusFunc *statusfunc; /* status callback */ - void *statusdata; /* status callback data */ - - FilterContext *context; - - /* for callback */ - FilterGetFolderFunc get_folder; - void *data; - - /* run-time data */ - GHashTable *folders; /* folders that message has been copied to */ - GHashTable *forwards; /* addresses that have been forwarded the message */ - - gboolean terminated; /* message processing was terminated */ - gboolean deleted; /* message was marked for deletion */ - gboolean copied; /* message was copied to some folder or another */ - - CamelMimeMessage *message; /* input message */ - CamelMessageInfo *info; /* message summary info */ - - FILE *logfile; /* log file */ - - CamelException *ex; - - /* evaluator */ - ESExp *eval; -}; - -#define _PRIVATE(o) (((FilterDriver *)(o))->priv) - -static void filter_driver_class_init (FilterDriverClass *klass); -static void filter_driver_init (FilterDriver *obj); -static void filter_driver_finalise (GtkObject *obj); - -static void filter_driver_log (FilterDriver *driver, enum filter_log_t status, const char *desc, ...); - -static CamelFolder *open_folder (FilterDriver *d, const char *folder_url); -static int close_folders (FilterDriver *d); - -static ESExpResult *do_delete (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterDriver *); -static ESExpResult *mark_forward (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterDriver *); -static ESExpResult *do_copy (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterDriver *); -static ESExpResult *do_move (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterDriver *); -static ESExpResult *do_stop (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterDriver *); -static ESExpResult *do_colour (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterDriver *); -static ESExpResult *do_score (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterDriver *); -static ESExpResult *do_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterDriver *); - -/* these are our filter actions - each must have a callback */ -static struct { - char *name; - ESExpFunc *func; - int type; /* set to 1 if a function can perform shortcut evaluation, or - doesn't execute everything, 0 otherwise */ -} symbols[] = { - { "delete", (ESExpFunc *) do_delete, 0 }, - { "forward-to", (ESExpFunc *) mark_forward, 0 }, - { "copy-to", (ESExpFunc *) do_copy, 0 }, - { "move-to", (ESExpFunc *) do_move, 0 }, - { "stop", (ESExpFunc *) do_stop, 0 }, - { "set-colour", (ESExpFunc *) do_colour, 0 }, - { "set-score", (ESExpFunc *) do_score, 0 }, - { "set-system-flag", (ESExpFunc *) do_flag, 0 } -}; - -static GtkObjectClass *filter_driver_parent; - -enum SIGNALS { - LAST_SIGNAL -}; - -static guint signals[LAST_SIGNAL] = { 0 }; - -guint -filter_driver_get_type (void) -{ - static guint type = 0; - - if (!type) { - GtkTypeInfo type_info = { - "FilterDriver", - sizeof (FilterDriver), - sizeof (FilterDriverClass), - (GtkClassInitFunc) filter_driver_class_init, - (GtkObjectInitFunc) filter_driver_init, - (GtkArgSetFunc) NULL, - (GtkArgGetFunc) NULL - }; - - type = gtk_type_unique (gtk_object_get_type (), &type_info); - } - - return type; -} - -static void -filter_driver_class_init (FilterDriverClass *klass) -{ - GtkObjectClass *object_class = (GtkObjectClass *) klass; - - filter_driver_parent = gtk_type_class (gtk_object_get_type ()); - - object_class->finalize = filter_driver_finalise; - - gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); -} - -static void -filter_driver_init (FilterDriver *obj) -{ - struct _FilterDriverPrivate *p; - int i; - - p = _PRIVATE (obj) = g_malloc0 (sizeof (*p)); - - p->eval = e_sexp_new (); - /* Load in builtin symbols */ - for (i = 0; i < sizeof (symbols) / sizeof (symbols[0]); i++) { - if (symbols[i].type == 1) { - e_sexp_add_ifunction (p->eval, 0, symbols[i].name, (ESExpIFunc *)symbols[i].func, obj); - } else { - e_sexp_add_function (p->eval, 0, symbols[i].name, symbols[i].func, obj); - } - } - - p->globals = g_hash_table_new (g_str_hash, g_str_equal); - - p->folders = g_hash_table_new (g_str_hash, g_str_equal); -} - -static void -free_hash_strings (void *key, void *value, void *data) -{ - g_free (key); - g_free (value); -} - -static void -filter_driver_finalise (GtkObject *obj) -{ - FilterDriver *driver = (FilterDriver *) obj; - struct _FilterDriverPrivate *p = _PRIVATE (driver); - - /* close all folders that were opened for appending */ - close_folders (driver); - g_hash_table_destroy (p->folders); - - g_hash_table_foreach (p->globals, free_hash_strings, driver); - g_hash_table_destroy (p->globals); - - e_sexp_unref(p->eval); - - if (p->defaultfolder) - camel_object_unref (CAMEL_OBJECT (p->defaultfolder)); - - g_free (p); - - ((GtkObjectClass *)(filter_driver_parent))->finalize (GTK_OBJECT (obj)); -} - -/** - * filter_driver_new: - * @system: path to system rules - * @user: path to user rules - * @get_folder: function to call to fetch folders - * - * Create a new FilterDriver object. - * - * Return value: A new FilterDriver widget. - **/ -FilterDriver * -filter_driver_new (FilterContext *context, FilterGetFolderFunc get_folder, void *data) -{ - FilterDriver *new; - struct _FilterDriverPrivate *p; - - new = FILTER_DRIVER (gtk_type_new (filter_driver_get_type ())); - p = _PRIVATE (new); - - p->get_folder = get_folder; - p->data = data; - p->context = context; - gtk_object_ref (GTK_OBJECT (context)); - - return new; -} - -void -filter_driver_set_logfile (FilterDriver *d, FILE *logfile) -{ - struct _FilterDriverPrivate *p = _PRIVATE (d); - - p->logfile = logfile; -} - -void -filter_driver_set_status_func (FilterDriver *d, FDStatusFunc *func, void *data) -{ - struct _FilterDriverPrivate *p = _PRIVATE (d); - - p->statusfunc = func; - p->statusdata = data; -} - -void -filter_driver_set_default_folder (FilterDriver *d, CamelFolder *def) -{ - struct _FilterDriverPrivate *p = _PRIVATE (d); - - if (p->defaultfolder) - camel_object_unref (CAMEL_OBJECT (p->defaultfolder)); - - p->defaultfolder = def; - - if (p->defaultfolder) - camel_object_ref (CAMEL_OBJECT (p->defaultfolder)); -} - -static void -report_status (FilterDriver *driver, enum filter_status_t status, const char *desc, ...) -{ - /* call user-defined status report function */ - struct _FilterDriverPrivate *p = _PRIVATE (driver); - va_list ap; - char *str; - - if (p->statusfunc) { - va_start (ap, desc); - str = g_strdup_vprintf (desc, ap); - p->statusfunc (driver, status, str, p->statusdata); - g_free (str); - } -} - - -#if 0 -void -filter_driver_set_global (FilterDriver *d, const char *name, const char *value) -{ - struct _FilterDriverPrivate *p = _PRIVATE (d); - char *oldkey, *oldvalue; - - if (g_hash_table_lookup_extended (p->globals, name, (void *)&oldkey, (void *)&oldvalue)) { - g_free (oldvalue); - g_hash_table_insert (p->globals, oldkey, g_strdup (value)); - } else { - g_hash_table_insert (p->globals, g_strdup (name), g_strdup (value)); - } -} -#endif - -static ESExpResult * -do_delete (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterDriver *driver) -{ - struct _FilterDriverPrivate *p = _PRIVATE (driver); - - d(fprintf (stderr, "doing delete\n")); - p->deleted = TRUE; - filter_driver_log (driver, FILTER_LOG_ACTION, "Delete"); - - return NULL; -} - -static ESExpResult * -mark_forward (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterDriver *driver) -{ - /*struct _FilterDriverPrivate *p = _PRIVATE (driver);*/ - - d(fprintf (stderr, "marking message for forwarding\n")); - /* FIXME: do stuff here */ - filter_driver_log (driver, FILTER_LOG_ACTION, "Forward"); - - return NULL; -} - -static ESExpResult * -do_copy (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterDriver *driver) -{ - struct _FilterDriverPrivate *p = _PRIVATE (driver); - int i; - - d(fprintf (stderr, "copying message...\n")); - - for (i = 0; i < argc; i++) { - if (argv[i]->type == ESEXP_RES_STRING) { - /* open folders we intent to copy to */ - char *folder = argv[i]->value.string; - char *service_url; - CamelFolder *outbox; - - outbox = open_folder (driver, folder); - if (!outbox) - continue; - - p->copied = TRUE; - camel_folder_append_message (outbox, p->message, p->info, p->ex); - - service_url = camel_service_get_url (CAMEL_SERVICE (camel_folder_get_parent_store (outbox))); - filter_driver_log (driver, FILTER_LOG_ACTION, "Copy to folder %s", service_url); - g_free (service_url); - } - } - - return NULL; -} - -static ESExpResult * -do_move (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterDriver *driver) -{ - struct _FilterDriverPrivate *p = _PRIVATE (driver); - int i; - - d(fprintf (stderr, "moving message...\n")); - - for (i = 0; i < argc; i++) { - if (argv[i]->type == ESEXP_RES_STRING) { - /* open folders we intent to move to */ - char *folder = argv[i]->value.string; - char *service_url; - CamelFolder *outbox; - - outbox = open_folder (driver, folder); - if (!outbox) - continue; - - p->copied = TRUE; - p->deleted = TRUE; /* a 'move' is a copy & delete */ - - camel_folder_append_message (outbox, p->message, p->info, p->ex); - - service_url = camel_service_get_url (CAMEL_SERVICE (camel_folder_get_parent_store (outbox))); - filter_driver_log (driver, FILTER_LOG_ACTION, "Move to folder %s", service_url); - g_free (service_url); - } - } - - return NULL; -} - -static ESExpResult * -do_stop (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterDriver *driver) -{ - struct _FilterDriverPrivate *p = _PRIVATE (driver); - - filter_driver_log (driver, FILTER_LOG_ACTION, "Stopped processing"); - d(fprintf (stderr, "terminating message processing\n")); - p->terminated = TRUE; - - return NULL; -} - -static ESExpResult * -do_colour (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterDriver *driver) -{ - struct _FilterDriverPrivate *p = _PRIVATE (driver); - - d(fprintf (stderr, "setting colour tag\n")); - if (argc > 0 && argv[0]->type == ESEXP_RES_STRING) { - camel_tag_set (&p->info->user_tags, "colour", argv[0]->value.string); - filter_driver_log (driver, FILTER_LOG_ACTION, "Set colour to %s", argv[0]->value.string); - } - - return NULL; -} - -static ESExpResult * -do_score (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterDriver *driver) -{ - struct _FilterDriverPrivate *p = _PRIVATE (driver); - - d(fprintf (stderr, "setting score tag\n")); - if (argc > 0 && argv[0]->type == ESEXP_RES_INT) { - char *value; - - value = g_strdup_printf ("%d", argv[0]->value.number); - camel_tag_set (&p->info->user_tags, "score", value); - filter_driver_log (driver, FILTER_LOG_ACTION, "Set score to %d", argv[0]->value.number); - g_free (value); - } - - return NULL; -} - -static ESExpResult * -do_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterDriver *driver) -{ - struct _FilterDriverPrivate *p = _PRIVATE (driver); - - d(fprintf (stderr, "setting flag\n")); - if (argc == 1 && argv[0]->type == ESEXP_RES_STRING) { - p->info->flags |= camel_system_flag (argv[0]->value.string) | CAMEL_MESSAGE_FOLDER_FLAGGED; - filter_driver_log (driver, FILTER_LOG_ACTION, "Set %s flag", argv[0]->value.string); - } - - return NULL; -} - -static CamelFolder * -open_folder (FilterDriver *driver, const char *folder_url) -{ - struct _FilterDriverPrivate *p = _PRIVATE (driver); - CamelFolder *camelfolder; - - /* we have a lookup table of currently open folders */ - camelfolder = g_hash_table_lookup (p->folders, folder_url); - if (camelfolder) - return camelfolder; - - camelfolder = p->get_folder (driver, folder_url, p->data); - - if (camelfolder) { - g_hash_table_insert (p->folders, g_strdup (folder_url), camelfolder); - camel_folder_freeze (camelfolder); - } - - return camelfolder; -} - -static void -close_folder (void *key, void *value, void *data) -{ - CamelFolder *folder = value; - FilterDriver *driver = data; - struct _FilterDriverPrivate *p = _PRIVATE (driver); - - g_free (key); - camel_folder_sync (folder, FALSE, p->ex); - camel_folder_thaw (folder); - camel_object_unref (CAMEL_OBJECT (folder)); -} - -/* flush/close all folders */ -static int -close_folders (FilterDriver *driver) -{ - struct _FilterDriverPrivate *p = _PRIVATE (driver); - - g_hash_table_foreach (p->folders, close_folder, driver); - g_hash_table_destroy (p->folders); - p->folders = g_hash_table_new (g_str_hash, g_str_equal); - - /* FIXME: status from driver */ - return 0; -} - -#if 0 -static void -free_key (gpointer key, gpointer value, gpointer user_data) -{ - g_free (key); -} -#endif - - -static void -filter_driver_log (FilterDriver *driver, enum filter_log_t status, const char *desc, ...) -{ - struct _FilterDriverPrivate *p = _PRIVATE (driver); - - if (p->logfile) { - char *str = NULL; - - if (desc) { - va_list ap; - - va_start (ap, desc); - str = g_strdup_vprintf (desc, ap); - } - - switch (status) { - case FILTER_LOG_START: { - /* write log header */ - const char *subject = NULL; - char *fromstr; - const CamelInternetAddress *from; - char date[50]; - time_t t; - - /* FIXME: does this need locking? Probably */ - - from = camel_mime_message_get_from (p->message); - fromstr = camel_address_format((CamelAddress *)from); - subject = camel_mime_message_get_subject (p->message); - - time (&t); - strftime (date, 49, "%a, %d %b %Y %H:%M:%S", localtime (&t)); - fprintf (p->logfile, "Applied filter \"%s\" to message from %s - \"%s\" at %s\n", - str, fromstr ? fromstr : "unknown", subject ? subject : "", date); - g_free(fromstr); - break; - } - case FILTER_LOG_ACTION: - fprintf (p->logfile, "Action: %s\n", str); - break; - case FILTER_LOG_END: - fprintf (p->logfile, "\n"); - break; - default: - /* nothing else is loggable */ - break; - } - - g_free (str); - } -} - - -/* will filter only an mbox - is more efficient as it doesn't need to open the folder through camel directly */ -void -filter_driver_filter_mbox (FilterDriver *driver, const char *mbox, const char *source, CamelException *ex) -{ - struct _FilterDriverPrivate *p = _PRIVATE (driver); - CamelMimeParser *mp = NULL; - char *source_url = NULL; - int fd = -1; - int i = 0; - struct stat st; - - fd = open (mbox, O_RDONLY); - if (fd == -1) { - camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, "Unable to open spool folder"); - goto fail; - } - /* to get the filesize */ - fstat (fd, &st); - - mp = camel_mime_parser_new (); - camel_mime_parser_scan_from (mp, TRUE); - if (camel_mime_parser_init_with_fd (mp, fd) == -1) { - camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, "Unable to process spool folder"); - goto fail; - } - fd = -1; - - source_url = g_strdup_printf ("file://%s", mbox); - - while (camel_mime_parser_step (mp, 0, 0) == HSCAN_FROM) { - CamelMimeMessage *msg; - int pc = 0; - - if (st.st_size > 0) - pc = (int)(100.0 * ((double)camel_mime_parser_tell (mp) / (double)st.st_size)); - - report_status (driver, FILTER_STATUS_START, "Getting message %d (%d%% of file)", i, pc); - - msg = camel_mime_message_new (); - if (camel_mime_part_construct_from_parser (CAMEL_MIME_PART (msg), mp) == -1) { - report_status (driver, FILTER_STATUS_END, "Failed message %d", i); - camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, "Cannot open message"); - camel_object_unref (CAMEL_OBJECT (msg)); - goto fail; - } - - filter_driver_filter_message (driver, msg, NULL, source_url, source, ex); - camel_object_unref (CAMEL_OBJECT (msg)); - if (camel_exception_is_set (ex)) { - report_status (driver, FILTER_STATUS_END, "Failed message %d", i); - goto fail; - } - - report_status (driver, FILTER_STATUS_END, "Finished message %d", i); - i++; - - /* skip over the FROM_END state */ - camel_mime_parser_step (mp, 0, 0); - } - - if (p->defaultfolder) - camel_folder_sync (p->defaultfolder, FALSE, ex); - -fail: - g_free (source_url); - if (fd != -1) - close (fd); - if (mp) - camel_object_unref (CAMEL_OBJECT (mp)); -} - -/* will filter a folder */ -void -filter_driver_filter_folder (FilterDriver *driver, CamelFolder *folder, const char *source, - GPtrArray *uids, gboolean remove, CamelException *ex) -{ - struct _FilterDriverPrivate *p = _PRIVATE (driver); - int i; - int freeuids = FALSE; - CamelMimeMessage *message; - const CamelMessageInfo *info; - char *source_url, *service_url; - - service_url = camel_service_get_url (CAMEL_SERVICE (camel_folder_get_parent_store (folder))); - source_url = g_strdup_printf ("%s%s", service_url, camel_folder_get_full_name (folder)); - g_free (service_url); - - if (uids == NULL) { - uids = camel_folder_get_uids (folder); - freeuids = TRUE; - } - - for (i = 0; i < uids->len; i++) { - report_status (driver, FILTER_STATUS_START, "Getting message %d of %d", i+1, uids->len); - - message = camel_folder_get_message (folder, uids->pdata[i], ex); - if (camel_exception_is_set (ex)) { - report_status (driver, FILTER_STATUS_END, "Failed at message %d of %d", i+1, uids->len); - break; - } - - if (camel_folder_has_summary_capability (folder)) - info = camel_folder_get_message_info (folder, uids->pdata[i]); - else - info = NULL; - - filter_driver_filter_message (driver, message, (CamelMessageInfo *)info, source_url, source, ex); - if (camel_exception_is_set (ex)) { - report_status (driver, FILTER_STATUS_END, "Failed at message %d of %d", i+1, uids->len); - break; - } - - if (remove) - camel_folder_set_message_flags (folder, uids->pdata[i], - CAMEL_MESSAGE_DELETED, CAMEL_MESSAGE_DELETED); - - camel_object_unref (CAMEL_OBJECT (message)); - } - - if (freeuids) - camel_folder_free_uids (folder, uids); - - if (p->defaultfolder) - camel_folder_sync (p->defaultfolder, FALSE, ex); - - g_free (source_url); -} - -void -filter_driver_filter_message (FilterDriver *driver, CamelMimeMessage *message, CamelMessageInfo *info, - const char *source_url, const char *source, CamelException *ex) -{ - struct _FilterDriverPrivate *p = _PRIVATE (driver); - ESExpResult *r; - GString *fsearch, *faction; - FilterFilter *rule; - gboolean freeinfo = FALSE; - gboolean filtered = FALSE; - - if (info == NULL) { - struct _header_raw *h = CAMEL_MIME_PART (message)->headers; - - info = camel_message_info_new_from_header (h); - freeinfo = TRUE; - } else { - if (info->flags & CAMEL_MESSAGE_DELETED) - return; - } - - p->ex = ex; - p->terminated = FALSE; - p->deleted = FALSE; - p->copied = FALSE; - p->message = message; - p->info = info; - - fsearch = g_string_new (""); - faction = g_string_new (""); - - rule = NULL; - while ((rule = (FilterFilter *)rule_context_next_rule ((RuleContext *)p->context, (FilterRule *)rule, source))) { - gboolean matched; - - g_string_truncate (fsearch, 0); - g_string_truncate (faction, 0); - - filter_rule_build_code (FILTER_RULE (rule), fsearch); - filter_filter_build_action (rule, faction); - - d(fprintf (stderr, "applying rule %s\n action %s\n", fsearch->str, faction->str)); - - matched = filter_message_search (p->message, p->info, source_url, fsearch->str, p->ex); - - if (matched) { - filtered = TRUE; - filter_driver_log (driver, FILTER_LOG_START, FILTER_RULE (rule)->name); -#ifndef NO_WARNINGS -#warning "Must check expression parsed and executed properly?" -#endif - /* perform necessary filtering actions */ - e_sexp_input_text (p->eval, faction->str, strlen (faction->str)); - e_sexp_parse (p->eval); - r = e_sexp_eval (p->eval); - e_sexp_result_free (r); - if (p->terminated) - break; - } - } - - g_string_free (fsearch, TRUE); - g_string_free (faction, TRUE); - - /* *Now* we can set the DELETED flag... */ - if (p->deleted) - info->flags = info->flags | CAMEL_MESSAGE_DELETED | CAMEL_MESSAGE_FOLDER_FLAGGED; - - /* Logic: if !Moved and there exists a default folder... */ - if (!(p->copied && p->deleted) && p->defaultfolder) { - /* copy it to the default inbox */ - filtered = TRUE; - filter_driver_log (driver, FILTER_LOG_ACTION, "Copy to default folder"); - camel_folder_append_message (p->defaultfolder, p->message, p->info, p->ex); - } - - if (freeinfo) - camel_message_info_free (info); - - if (filtered) - filter_driver_log (driver, FILTER_LOG_END, NULL); -} diff --git a/filter/filter-message-search.c b/filter/filter-message-search.c deleted file mode 100644 index 415bdb170c..0000000000 --- a/filter/filter-message-search.c +++ /dev/null @@ -1,806 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast - * - * Copyright 2000 Helix Code, Inc. (www.helixcode.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "filter-message-search.h" -#include -#include -#include -#include -#include - -typedef struct { - CamelMimeMessage *message; - CamelMessageInfo *info; - const char *source; - CamelException *ex; -} FilterMessageSearch; - -/* ESExp callbacks */ -static ESExpResult *header_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms); -static ESExpResult *header_matches (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms); -static ESExpResult *header_starts_with (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms); -static ESExpResult *header_ends_with (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms); -static ESExpResult *header_exists (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms); -static ESExpResult *header_soundex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms); -static ESExpResult *header_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms); -static ESExpResult *header_full_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms); -static ESExpResult *match_all (struct _ESExp *f, int argc, struct _ESExpTerm **argv, FilterMessageSearch *fms); -static ESExpResult *body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms); -static ESExpResult *body_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms); -static ESExpResult *user_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms); -static ESExpResult *user_tag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms); -static ESExpResult *system_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms); -static ESExpResult *get_sent_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms); -static ESExpResult *get_received_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms); -static ESExpResult *get_current_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms); -static ESExpResult *get_score (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms); -static ESExpResult *get_source (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms); - -/* builtin functions */ -static struct { - char *name; - ESExpFunc *func; - int type; /* set to 1 if a function can perform shortcut evaluation, or - doesn't execute everything, 0 otherwise */ -} symbols[] = { - { "match-all", (ESExpFunc *) match_all, 0 }, - { "body-contains", (ESExpFunc *) body_contains, 0 }, - { "body-regex", (ESExpFunc *) body_regex, 0 }, - { "header-contains", (ESExpFunc *) header_contains, 0 }, - { "header-matches", (ESExpFunc *) header_matches, 0 }, - { "header-starts-with", (ESExpFunc *) header_starts_with, 0 }, - { "header-ends-with", (ESExpFunc *) header_ends_with, 0 }, - { "header-exists", (ESExpFunc *) header_exists, 0 }, - { "header-soundex", (ESExpFunc *) header_soundex, 0 }, - { "header-regex", (ESExpFunc *) header_regex, 0 }, - { "header-full-regex", (ESExpFunc *) header_full_regex, 0 }, - { "user-tag", (ESExpFunc *) user_tag, 0 }, - { "user-flag", (ESExpFunc *) user_flag, 0 }, - { "system-flag", (ESExpFunc *) system_flag, 0 }, - { "get-sent-date", (ESExpFunc *) get_sent_date, 0 }, - { "get-received-date", (ESExpFunc *) get_received_date, 0 }, - { "get-current-date", (ESExpFunc *) get_current_date, 0 }, - { "get-score", (ESExpFunc *) get_score, 0 }, - { "get-source", (ESExpFunc *) get_source, 0 }, -}; - -static ESExpResult * -header_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) -{ - gboolean matched = FALSE; - ESExpResult *r; - - if (argc == 2) { - char *header = (argv[0])->value.string; - char *match = (argv[1])->value.string; - const char *contents; - - contents = camel_medium_get_header (CAMEL_MEDIUM (fms->message), header); - - if (contents) { - if (e_utf8_strstrcase (contents, match)) - matched = TRUE; - } - } - - r = e_sexp_result_new (ESEXP_RES_BOOL); - r->value.bool = matched; - - return r; -} - -static ESExpResult * -header_matches (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) -{ - gboolean matched = FALSE; - ESExpResult *r; - - if (argc == 2) { - char *header = (argv[0])->value.string; - char *match = (argv[1])->value.string; - const char *contents; - - contents = camel_medium_get_header (CAMEL_MEDIUM (fms->message), header); - - if (contents) { - /* danw says to use search-engine style matching... - * This means that if the search match string is - * lowercase then compare case-insensitive else - * compare case-sensitive. */ - gboolean is_lowercase = TRUE; - char *c; - - /* remove any leading white space... */ - for ( ; *contents && isspace (*contents); contents++); - - for (c = match; *c; c++) { - if (isalpha (*c) && isupper (*c)) { - is_lowercase = FALSE; - break; - } - } - - if (is_lowercase) { - if (!g_strcasecmp (contents, match)) - matched = TRUE; - } else { - if (!strcmp (contents, match)) - matched = TRUE; - } - } - } - - r = e_sexp_result_new (ESEXP_RES_BOOL); - r->value.bool = matched; - - return r; -} - -static ESExpResult * -header_starts_with (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) -{ - gboolean matched = FALSE; - ESExpResult *r; - - if (argc == 2) { - char *header = (argv[0])->value.string; - char *match = (argv[1])->value.string; - const char *contents; - - contents = camel_medium_get_header (CAMEL_MEDIUM (fms->message), header); - - if (contents && strlen (contents) >= strlen (match)) { - /* danw says to use search-engine style matching... - * This means that if the search match string is - * lowercase then compare case-insensitive else - * compare case-sensitive. */ - gboolean is_lowercase = TRUE; - char *c; - - /* remove any leading white space... */ - for ( ; *contents && isspace (*contents); contents++); - - for (c = match; *c; c++) { - if (isalpha (*c) && isupper (*c)) { - is_lowercase = FALSE; - break; - } - } - - if (is_lowercase) { - if (!g_strncasecmp (contents, match, strlen (match))) - matched = TRUE; - } else { - if (!strncmp (contents, match, strlen (match))) - matched = TRUE; - } - } - } - - r = e_sexp_result_new (ESEXP_RES_BOOL); - r->value.bool = matched; - - return r; -} - -static ESExpResult * -header_ends_with (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) -{ - gboolean matched = FALSE; - ESExpResult *r; - - if (argc == 2) { - char *header = (argv[0])->value.string; - char *match = (argv[1])->value.string; - const char *contents; - - contents = camel_medium_get_header (CAMEL_MEDIUM (fms->message), header); - - if (contents && strlen (contents) >= strlen (match)) { - /* danw says to use search-engine style matching... - * This means that if the search match string is - * lowercase then compare case-insensitive else - * compare case-sensitive. */ - gboolean is_lowercase = TRUE; - char *c, *end; - - /* remove any leading white space... */ - for ( ; *contents && isspace (*contents); contents++); - - for (c = match; *c; c++) { - if (isalpha (*c) && isupper (*c)) { - is_lowercase = FALSE; - break; - } - } - - end = (char *) contents + strlen (contents) - strlen (match); - - if (is_lowercase) { - if (!g_strcasecmp (end, match)) - matched = TRUE; - } else { - if (!strcmp (end, match)) - matched = TRUE; - } - } - } - - r = e_sexp_result_new (ESEXP_RES_BOOL); - r->value.bool = matched; - - return r; -} - -static ESExpResult * -header_exists (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) -{ - gboolean matched = FALSE; - ESExpResult *r; - - if (argc == 1) { - char *header = (argv[0])->value.string; - const char *contents; - - contents = camel_medium_get_header (CAMEL_MEDIUM (fms->message), header); - - if (contents) - matched = TRUE; - } - - r = e_sexp_result_new (ESEXP_RES_BOOL); - r->value.bool = matched; - - return r; -} - -static unsigned char soundex_table[256] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 49, 50, 51, 0, 49, 50, 0, 0, 50, 50, 52, 53, 53, 0, - 49, 50, 54, 50, 51, 0, 49, 0, 50, 0, 50, 0, 0, 0, 0, 0, - 0, 0, 49, 50, 51, 0, 49, 50, 0, 0, 50, 50, 52, 53, 53, 0, - 49, 50, 54, 50, 51, 0, 49, 0, 50, 0, 50, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -}; - -static void -soundexify (const gchar *sound, gchar code[5]) -{ - guchar *c, last = '\0'; - gint n; - - for (c = (guchar *) sound; *c && !isalpha (*c); c++); - code[0] = toupper (*c); - memset (code + 1, '0', 3); - for (n = 1; *c && n < 5; c++) { - guchar ch = soundex_table[*c]; - - if (ch && ch != last) { - code[n++] = ch; - last = ch; - } - } - code[4] = '\0'; -} - -static gint -soundexcmp (const gchar *sound1, const gchar *sound2) -{ - gchar code1[5], code2[5]; - - soundexify (sound1, code1); - soundexify (sound2, code2); - - return strcmp (code1, code2); -} - -static ESExpResult * -header_soundex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) -{ - gboolean matched = FALSE; - ESExpResult *r; - - if (argc == 2) { - char *header = (argv[0])->value.string; - char *match = (argv[1])->value.string; - const char *contents; - - contents = camel_medium_get_header (CAMEL_MEDIUM (fms->message), header); - - if (contents) { - /* remove any leading white space... */ - for ( ; *contents && isspace (*contents); contents++); - - if (!soundexcmp (contents, match)) - matched = TRUE; - } - } - - r = e_sexp_result_new (ESEXP_RES_BOOL); - r->value.bool = matched; - - return r; -} - -static ESExpResult * -header_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) -{ - gboolean matched = FALSE; - ESExpResult *r; - - if (argc == 2) { - char *header = (argv[0])->value.string; - char *match = (argv[1])->value.string; - regex_t regexpat; /* regex patern */ - regmatch_t *fltmatch; - gint regerr = 0; - size_t reglen = 0; - gchar *regmsg; - const char *contents; - - contents = camel_medium_get_header (CAMEL_MEDIUM (fms->message), header); - - regerr = regcomp (®expat, match, REG_EXTENDED | REG_NEWLINE | REG_ICASE); - if (regerr) { - /* regerror gets called twice to get the full error string - length to do proper posix error reporting */ - reglen = regerror (regerr, ®expat, 0, 0); - regmsg = g_malloc0 (reglen + 1); - regerror (regerr, ®expat, regmsg, reglen); - camel_exception_setv (fms->ex, CAMEL_EXCEPTION_SYSTEM, - _("Failed to perform regex search on message header: %s"), - regmsg); - g_free (regmsg); - regfree (®expat); - } else { - if (contents) { - fltmatch = g_new0 (regmatch_t, regexpat.re_nsub); - - if (!regexec (®expat, contents, regexpat.re_nsub, fltmatch, 0)) - matched = TRUE; - - g_free (fltmatch); - regfree (®expat); - } - } - } - - r = e_sexp_result_new (ESEXP_RES_BOOL); - r->value.bool = matched; - - return r; -} - -static gchar * -get_full_header (CamelMimeMessage *message) -{ - CamelMimePart *mp = CAMEL_MIME_PART (message); - GString *str = g_string_new (""); - char *ret; - struct _header_raw *h; - - for (h = mp->headers; h; h = h->next) { - if (h->value != NULL) - g_string_sprintfa (str, "%s%s%s\n", h->name, - isspace (h->value[0]) ? ":" : ": ", h->value); - } - - ret = str->str; - g_string_free (str, FALSE); - - return ret; -} - -static ESExpResult * -header_full_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) -{ - gboolean matched = FALSE; - ESExpResult *r; - - if (argc == 1) { - char *match = (argv[0])->value.string; - regex_t regexpat; /* regex patern */ - regmatch_t *fltmatch; - gint regerr = 0; - size_t reglen = 0; - gchar *regmsg; - char *contents; - - contents = get_full_header (fms->message); - - regerr = regcomp (®expat, match, REG_EXTENDED | REG_NEWLINE | REG_ICASE); - if (regerr) { - /* regerror gets called twice to get the full error string - length to do proper posix error reporting */ - reglen = regerror (regerr, ®expat, 0, 0); - regmsg = g_malloc0 (reglen + 1); - regerror (regerr, ®expat, regmsg, reglen); - camel_exception_setv (fms->ex, CAMEL_EXCEPTION_SYSTEM, - _("Failed to perform regex search on message header: %s"), - regmsg); - g_free (regmsg); - regfree (®expat); - } else { - if (contents) { - fltmatch = g_new0 (regmatch_t, regexpat.re_nsub); - - if (!regexec (®expat, contents, regexpat.re_nsub, fltmatch, 0)) - matched = TRUE; - - g_free (fltmatch); - regfree (®expat); - } - } - g_free (contents); - } - - r = e_sexp_result_new (ESEXP_RES_BOOL); - r->value.bool = matched; - - return r; -} - -static ESExpResult * -match_all (struct _ESExp *f, int argc, struct _ESExpTerm **argv, FilterMessageSearch *fms) -{ - /* match-all: when dealing with single messages is a no-op */ - ESExpResult *r; - - r = e_sexp_result_new (ESEXP_RES_BOOL); - if (argv[0]->type == ESEXP_RES_BOOL) - r->value.bool = argv[0]->value.bool; - else - r->value.bool = FALSE; - - return r; -} - -static gboolean -mime_part_matches (CamelMimePart *mime_part, const char *match, gboolean regex, CamelException *ex) -{ - CamelStream *stream; - GByteArray *array; - char *text; - regex_t regexpat; /* regex patern */ - regmatch_t *fltmatch; - gint regerr = 0; - size_t reglen = 0; - gchar *regmsg; - gboolean matched = FALSE; - - array = g_byte_array_new (); - stream = camel_stream_mem_new_with_byte_array (array); - camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (mime_part), stream); - camel_object_unref (CAMEL_OBJECT (stream)); - - g_byte_array_append (array, "", 1); - - text = array->data; - - if (regex) { - regerr = regcomp (®expat, match, REG_EXTENDED | REG_NEWLINE | REG_ICASE); - if (regerr) { - /* regerror gets called twice to get the full error string - length to do proper posix error reporting */ - reglen = regerror (regerr, ®expat, 0, 0); - regmsg = g_malloc0 (reglen + 1); - regerror (regerr, ®expat, regmsg, reglen); - camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, - "Failed to perform regex search on message body: %s", - regmsg); - g_free (regmsg); - regfree (®expat); - } else { - fltmatch = g_new0 (regmatch_t, regexpat.re_nsub); - - if (!regexec (®expat, text, regexpat.re_nsub, fltmatch, 0)) - matched = TRUE; - - g_free (fltmatch); - regfree (®expat); - } - } else { - if (strstr (text, match)) - matched = TRUE; - } - - g_byte_array_free (array, TRUE); - - return matched; -} - -static gboolean -handle_multipart (CamelMultipart *multipart, const char *match, gboolean regex, CamelException *ex) -{ - gboolean matched = FALSE; - int i, nparts; - - nparts = camel_multipart_get_number (multipart); - - for (i = 0; i < nparts && !matched; i++) { - CamelContentType *content; - CamelMimePart *mime_part; - - mime_part = camel_multipart_get_part (multipart, i); - content = camel_mime_part_get_content_type (mime_part); - - if (header_content_type_is (content, "text", "*")) { - /* we only want to match text parts */ - matched = mime_part_matches (mime_part, match, regex, ex); - - if (camel_exception_is_set (ex)) - break; - } else if (header_content_type_is (content, "multipart", "*")) { - CamelDataWrapper *wrapper; - CamelMultipart *mpart; - - wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (mime_part)); - mpart = CAMEL_MULTIPART (wrapper); - - matched = handle_multipart (mpart, match, regex, ex); - - if (camel_exception_is_set (ex)) - break; - } - } - - return matched; -} - -static ESExpResult * -body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) -{ - gboolean matched = FALSE; - ESExpResult *r; - - if (argc > 0) { - CamelContentType *content; - char *match; - - match = (*argv)->value.string; - - content = camel_mime_part_get_content_type (CAMEL_MIME_PART (fms->message)); - - if (header_content_type_is (content, "multipart", "*")) { - CamelDataWrapper *wrapper; - CamelMultipart *multipart; - - wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (CAMEL_MIME_PART (fms->message))); - multipart = CAMEL_MULTIPART (wrapper); - - matched = handle_multipart (multipart, match, FALSE, fms->ex); - } else { - /* single-part message so just search the entire message */ - matched = mime_part_matches (CAMEL_MIME_PART (fms->message), match, FALSE, fms->ex); - } - } - - r = e_sexp_result_new (ESEXP_RES_BOOL); - r->value.bool = matched; - - return r; -} - -static ESExpResult * -body_regex (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) -{ - gboolean matched = FALSE; - ESExpResult *r; - - if (argc > 0) { - CamelContentType *content; - char *match; - - match = (*argv)->value.string; - - content = camel_mime_part_get_content_type (CAMEL_MIME_PART (fms->message)); - - if (header_content_type_is (content, "multipart", "*")) { - CamelDataWrapper *wrapper; - CamelMultipart *multipart; - - wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (CAMEL_MIME_PART (fms->message))); - multipart = CAMEL_MULTIPART (wrapper); - - matched = handle_multipart (multipart, match, TRUE, fms->ex); - } else { - /* single-part message so just search the entire message */ - matched = mime_part_matches (CAMEL_MIME_PART (fms->message), match, TRUE, fms->ex); - } - } - - r = e_sexp_result_new (ESEXP_RES_BOOL); - r->value.bool = matched; - - return r; -} - -static ESExpResult * -user_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) -{ - ESExpResult *r; - gboolean truth = FALSE; - int i; - - /* performs an OR of all words */ - for (i = 0; i < argc && !truth; i++) { - if (argv[i]->type == ESEXP_RES_STRING - && camel_flag_get (&fms->info->user_flags, argv[i]->value.string)) { - truth = TRUE; - break; - } - } - - r = e_sexp_result_new (ESEXP_RES_BOOL); - r->value.bool = truth; - - return r; -} - -static ESExpResult * -system_flag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) -{ - ESExpResult *r; - gboolean truth = FALSE; - - if (argc == 1) - truth = camel_system_flag_get (fms->info->flags, argv[0]->value.string); - - r = e_sexp_result_new (ESEXP_RES_BOOL); - r->value.bool = truth; - - return r; -} - -static ESExpResult * -user_tag (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) -{ - ESExpResult *r; - const char *tag; - - tag = camel_tag_get (&fms->info->user_tags, argv[0]->value.string); - - r = e_sexp_result_new (ESEXP_RES_STRING); - r->value.string = g_strdup (tag ? tag : ""); - - return r; -} - -static ESExpResult * -get_sent_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) -{ - ESExpResult *r; - - r = e_sexp_result_new(ESEXP_RES_INT); - r->value.number = camel_mime_message_get_date(fms->message, NULL); - - return r; -} - -static ESExpResult * -get_received_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) -{ - ESExpResult *r; - - r = e_sexp_result_new(ESEXP_RES_INT); - r->value.number = camel_mime_message_get_date_received(fms->message, NULL); - - return r; -} - -static ESExpResult * -get_current_date (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) -{ - ESExpResult *r; - - r = e_sexp_result_new (ESEXP_RES_INT); - r->value.number = time (NULL); - - return r; -} - -static ESExpResult * -get_score (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) -{ - ESExpResult *r; - const char *tag; - - tag = camel_tag_get (&fms->info->user_tags, "score"); - - r = e_sexp_result_new (ESEXP_RES_INT); - if (tag) - r->value.number = atoi (tag); - else - r->value.number = 0; - - return r; -} - -static ESExpResult * -get_source (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) -{ - ESExpResult *r; - - r = e_sexp_result_new (ESEXP_RES_STRING); - r->value.string = g_strdup (fms->source); - - return r; -} - -gboolean -filter_message_search (CamelMimeMessage *message, CamelMessageInfo *info, - const char *source, const char *expression, CamelException *ex) -{ - FilterMessageSearch *fms; - ESExp *sexp; - ESExpResult *result; - gboolean retval; - int i; - - fms = g_new (FilterMessageSearch, 1); - fms->message = message; - fms->info = info; - fms->source = source; - fms->ex = ex; - - sexp = e_sexp_new (); - - for (i = 0; i < sizeof (symbols) / sizeof (symbols[0]); i++) { - if (symbols[i].type == 1) { - e_sexp_add_ifunction (sexp, 0, symbols[i].name, - (ESExpIFunc *)symbols[i].func, fms); - } else { - e_sexp_add_function (sexp, 0, symbols[i].name, - symbols[i].func, fms); - } - } - - e_sexp_input_text (sexp, expression, strlen (expression)); - e_sexp_parse (sexp); - result = e_sexp_eval (sexp); - - g_free (fms); - - if (result->type == ESEXP_RES_BOOL) - retval = result->value.bool; - else - retval = FALSE; - - e_sexp_unref(sexp); - e_sexp_result_free (result); - - return retval; -} diff --git a/ui/evolution-addressbook.h b/ui/evolution-addressbook.h deleted file mode 100644 index 3128ccfb83..0000000000 --- a/ui/evolution-addressbook.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * This file is autogenerated from evolution-addressbook.xml, do not edit - * - * This file contains translatable strings generated by - * bonobo-ui-extract. Add this file to your project's - * POTFILES.in. DO NOT compile it as part of your application. - */ - -gchar *s = N_("_Print Contacts..."); -gchar *s = N_("As _Table"); -gchar *s = N_("_New Contact"); -gchar *s = N_("_Tools"); -gchar *s = N_("_Search for contacts"); -gchar *s = N_("New"); -gchar *s = N_("Create a new contact"); -gchar *s = N_("Find"); -gchar *s = N_("Find a contact"); -gchar *s = N_("Print"); -gchar *s = N_("Print contacts"); -gchar *s = N_("Delete"); -gchar *s = N_("Delete a contact"); -gchar *s = N_("View All"); -gchar *s = N_("View all contacts"); -gchar *s = N_("Stop"); -gchar *s = N_("Stop Loading"); diff --git a/ui/evolution-message-composer.h b/ui/evolution-message-composer.h deleted file mode 100644 index bcc259c4d5..0000000000 --- a/ui/evolution-message-composer.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * This file is autogenerated from evolution-message-composer.xml, do not edit - * - * This file contains translatable strings generated by - * bonobo-ui-extract. Add this file to your project's - * POTFILES.in. DO NOT compile it as part of your application. - */ - -gchar *s = N_("Open"); -gchar *s = N_("Open a file"); -gchar *s = N_("Save"); -gchar *s = N_("Save the current file"); -gchar *s = N_("Save As"); -gchar *s = N_("Save the current file with a different name"); -gchar *s = N_("Close"); -gchar *s = N_("Close the current file"); -gchar *s = N_("Save in folder..."); -gchar *s = N_("Save the message in a specified folder"); -gchar *s = N_("Insert text file..."); -gchar *s = N_("Insert a file as text into the message"); -gchar *s = N_("Send"); -gchar *s = N_("Send the message now"); -gchar *s = N_("Send _later"); -gchar *s = N_("Send the message later"); -gchar *s = N_("Attach"); -gchar *s = N_("Attach a file"); -gchar *s = N_("HTML"); -gchar *s = N_("Send the mail in HTML format"); -gchar *s = N_("Show attachments"); -gchar *s = N_("Show / hide attachments"); -gchar *s = N_("_File"); -gchar *s = N_("_Open..."); -gchar *s = N_("_Save"); -gchar *s = N_("Save _As..."); -gchar *s = N_("Save in _folder... (FIXME)"); -gchar *s = N_("_Insert text file... (FIXME)"); -gchar *s = N_("Send"); -gchar *s = N_("Send _Later"); -gchar *s = N_("_Close"); -gchar *s = N_("_Edit"); -gchar *s = N_("F_ormat"); -gchar *s = N_("_View"); -gchar *s = N_("Show _attachments"); -gchar *s = N_("_Help"); -gchar *s = N_("_About..."); -gchar *s = N_("_Debug"); -gchar *s = N_("Send this message now"); -gchar *s = N_("Bold"); -gchar *s = N_("Sets something as bold"); - - - - -- cgit v1.2.3