From 2b80feefead30f2b24a3c51c4b52373c5faacbac Mon Sep 17 00:00:00 2001 From: nobody Date: Wed, 16 Feb 2000 23:51:01 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'GNOME_CORE_1_1_4'. svn path=/tags/GNOME_CORE_1_1_4/; revision=1807 --- shell/.cvsignore | 9 - shell/Evolution.idl | 28 --- shell/Makefile.am | 46 ----- shell/Shell.idl | 19 -- shell/e-folder-mail.c | 36 ---- shell/e-folder-mail.h | 28 --- shell/e-folder.c | 246 ------------------------- shell/e-folder.h | 82 --------- shell/e-init.c | 34 ---- shell/e-init.h | 8 - shell/e-shell-shortcut.c | 318 -------------------------------- shell/e-shell-shortcut.h | 11 -- shell/e-shell-view-menu.c | 227 ----------------------- shell/e-shell-view-menu.h | 6 - shell/e-shell-view.c | 148 --------------- shell/e-shell-view.h | 50 ----- shell/e-shell.c | 348 ----------------------------------- shell/e-shell.h | 60 ------ shell/e-shortcut.c | 451 ---------------------------------------------- shell/e-shortcut.h | 102 ----------- shell/evolution.h | 7 - shell/main.c | 96 ---------- 22 files changed, 2360 deletions(-) delete mode 100644 shell/.cvsignore delete mode 100644 shell/Evolution.idl delete mode 100644 shell/Makefile.am delete mode 100644 shell/Shell.idl delete mode 100644 shell/e-folder-mail.c delete mode 100644 shell/e-folder-mail.h delete mode 100644 shell/e-folder.c delete mode 100644 shell/e-folder.h delete mode 100644 shell/e-init.c delete mode 100644 shell/e-init.h delete mode 100644 shell/e-shell-shortcut.c delete mode 100644 shell/e-shell-shortcut.h delete mode 100644 shell/e-shell-view-menu.c delete mode 100644 shell/e-shell-view-menu.h delete mode 100644 shell/e-shell-view.c delete mode 100644 shell/e-shell-view.h delete mode 100644 shell/e-shell.c delete mode 100644 shell/e-shell.h delete mode 100644 shell/e-shortcut.c delete mode 100644 shell/e-shortcut.h delete mode 100644 shell/evolution.h delete mode 100644 shell/main.c (limited to 'shell') diff --git a/shell/.cvsignore b/shell/.cvsignore deleted file mode 100644 index f15acb65be..0000000000 --- a/shell/.cvsignore +++ /dev/null @@ -1,9 +0,0 @@ -.deps -.libs -Shell-stubs.c -Shell-skels.c -Shell-common.c -Shell.h -evolution -Makefile.in -Makefile diff --git a/shell/Evolution.idl b/shell/Evolution.idl deleted file mode 100644 index 51b083c5d7..0000000000 --- a/shell/Evolution.idl +++ /dev/null @@ -1,28 +0,0 @@ -/* - * CORBA interface for the Evolution shell - * - * Authors: - * Miguel de Icaza (miguel@kernel.org) - * - * (C) 2000 Helix Code, Inc. - */ -#include - -module Evolution { - interface Shell : Bonobo::Unknown { - enum NewType { - APPOINTMENT, - MEETING_REQUEST, - TASK, - TASK_REQUEST, - CONTACT, - MAIL_MESSAGE, - DISTRIBUTION_LIST, - JOURNAL_ENTRY, - NOTE - }; - - void new (in NewType type); - }; -}; - diff --git a/shell/Makefile.am b/shell/Makefile.am deleted file mode 100644 index 56341d0042..0000000000 --- a/shell/Makefile.am +++ /dev/null @@ -1,46 +0,0 @@ - -bin_PROGRAMS = evolution - -INCLUDES = \ - -DEVOLUTION_VERSION=\""$(VERSION)"\" \ - -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \ - -DEVOLUTION_ICONSDIR=\""$(iconsdir)"\" \ - -DEVOLUTION_LOCALEDIR=\""$(datadir)/locale"\" \ - -I$(srcdir)/../widgets \ - $(BONOBO_GNOME_CFLAGS) - -EVOLUTION_CORBA_GENERATED = \ - Evolution.h \ - Evolution-common.c \ - Evolution-skels.c \ - Evolution-stubs.c - -evolution_SOURCES = \ - $(EVOLUTION_CORBA_GENERATED) \ - main.c \ - e-folder.c \ - e-folder.h \ - e-init.c \ - e-init.h \ - e-shell.c \ - e-shell.h \ - e-shell-shortcut.c \ - e-shell-shortcut.h \ - e-shell-view.c \ - e-shell-view.h \ - e-shell-view-menu.c \ - e-shell-view-menu.h \ - e-shortcut.c \ - e-shortcut.h - -Evolution-impl.o: Evolution.h - -$(EVOLUTION_CORBA_GENERATED): Evolution.idl - orbit-idl -I`$(GNOME_CONFIG) --datadir`/idl -I$(srcdir) $(srcdir)/Evolution.idl - -evolution_LDADD = \ - ../widgets/shortcut-bar/libshortcut-bar.a \ - ../e-util/libeutil.a \ - $(BONOBO_GNOME_LIBS) - -EXTRA_DIST = Evolution.idl diff --git a/shell/Shell.idl b/shell/Shell.idl deleted file mode 100644 index 0d615b6b3b..0000000000 --- a/shell/Shell.idl +++ /dev/null @@ -1,19 +0,0 @@ -/* - * CORBA interface for the Evolution shell - * - * Authors: - * Miguel de Icaza (miguel@kernel.org) - * - * (C) 2000 Helix Code, Inc. - */ -#include - -module GNOME { - - module Evolution { - - interface Shell : GNOME::Unknown { - - }; - }; -}; diff --git a/shell/e-folder-mail.c b/shell/e-folder-mail.c deleted file mode 100644 index 9765b7d946..0000000000 --- a/shell/e-folder-mail.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * e-folder-mail.c: Mail folder - * - * Author: - * Miguel de Icaza (miguel@helixcode.com) - * - * (C) 2000 Helix Code, Inc. - */ -#include -#include -#include -#include -#include "e-util/e-util.h" -#include "e-folder-mail.h" - -#define PARENT_TYPE e_folder_get_type () - -static void -e_folder_mail_init (GtkObject *object) -{ -} - -E_MAKE_TYPE (e_folder_mail, "EFolderMail", EFolderMail, e_folder_mail_class_init, e_folder_mail_init, PARENT_TYPE) - -EFolder * -e_folder_mail_new (const char *uri, const char *name, const char *desc, - const char *home_page, const char *view_name) -{ - EFolderMail *efm = gtk_type_new (e_folder_mail_get_type ()); - - e_folder_construct (E_FOLDER (efm), E_FOLDER_MAIL, uri, name, desc, home_page, view_name); - - return E_FOLDER (efm); -} - - diff --git a/shell/e-folder-mail.h b/shell/e-folder-mail.h deleted file mode 100644 index 76098c6182..0000000000 --- a/shell/e-folder-mail.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef _E_FOLDER_MAIL_H_ -#define _E_FOLDER_MAIL_H_ - -#include "e-folder.h" - -#define E_FOLDER_MAIL_TYPE (e_folder_mail_get_type ()) -#define E_FOLDER_MAIL(o) (GTK_CHECK_CAST ((o), E_FOLDER_MAIL_TYPE, EFolderMail)) -#define E_FOLDER_MAIL_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_FOLDER_MAIL_TYPE, EFolderMailClass)) -#define E_IS_FOLDER_MAIL(o) (GTK_CHECK_TYPE ((o), E_FOLDER_MAIL_TYPE)) -#define E_IS_FOLDER_MAIL_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_FOLDER_MAIL_TYPE)) - -typedef struct { - EFolder parent; -} EFolderMail; - -typedef struct { - EFolderClass parent; -} EFolderMailClass; - -GtkType e_folder_mail_get_type (void); -EFolder *e_folder_mail_new (const char *uri, const char *name, const char *desc, - const char *home_page, const char *view_name); - -#endif /* _E_FOLDER_MAIL_H_ */ - - - - diff --git a/shell/e-folder.c b/shell/e-folder.c deleted file mode 100644 index 8a7d5dfe6b..0000000000 --- a/shell/e-folder.c +++ /dev/null @@ -1,246 +0,0 @@ -/* - * e-folder.c: Abstract class for Evolution folders - * - * Author: - * Miguel de Icaza (miguel@helixcode.com) - * - * (C) 2000 Helix Code, Inc. - */ -#include -#include -#include -#include "e-util/e-util.h" -#include "e-folder.h" - -#define PARENT_TYPE gtk_object_get_type () - -static GtkObjectClass *parent_class; - -#define EFC(o) E_FOLDER_CLASS (GTK_OBJECT (o)->klass) - -enum { - CHANGED, - LAST_SIGNAL -}; -static guint efolder_signals [LAST_SIGNAL] = { 0, }; - -static void -e_folder_destroy (GtkObject *object) -{ - EFolder *efolder = E_FOLDER (object); - - if (efolder->uri) - g_free (efolder->uri); - - if (efolder->desc) - g_free (efolder->desc); - - if (efolder->home_page) - g_free (efolder->home_page); - - parent_class->destroy (object); -} - -static void -e_folder_class_init (GtkObjectClass *object_class) -{ - parent_class = gtk_type_class (PARENT_TYPE); - - object_class->destroy = e_folder_destroy; - - efolder_signals [CHANGED] = - gtk_signal_new ("changed", - GTK_RUN_LAST, - object_class->type, - GTK_SIGNAL_OFFSET (EFolderClass, changed), - gtk_marshal_NONE__NONE, - GTK_TYPE_NONE, - 0); - /* Register our signals */ - gtk_object_class_add_signals ( - object_class, efolder_signals, LAST_SIGNAL); -} - -static void -e_folder_init (GtkObject *object) -{ -} - -E_MAKE_TYPE (e_folder, "EFolder", EFolder, e_folder_class_init, e_folder_init, PARENT_TYPE) - -void -e_folder_set_uri (EFolder *efolder, const char *uri) -{ - g_return_if_fail (efolder != NULL); - g_return_if_fail (E_IS_FOLDER (efolder)); - g_return_if_fail (uri != NULL); - - if (efolder->uri) - g_free (efolder->uri); - - efolder->uri = g_strdup (uri); -} - -const char * -e_folder_get_uri (EFolder *efolder) -{ - g_return_val_if_fail (efolder != NULL, NULL); - g_return_val_if_fail (E_IS_FOLDER (efolder), NULL); - - return efolder->uri; -} - -void -e_folder_set_description (EFolder *efolder, const char *desc) -{ - g_return_if_fail (efolder != NULL); - g_return_if_fail (E_IS_FOLDER (efolder)); - g_return_if_fail (desc != NULL); - - if (efolder->desc) - g_free (efolder->desc); - - efolder->desc = g_strdup (desc); -} - -const char * -e_folder_get_description (EFolder *efolder) -{ - g_return_val_if_fail (efolder != NULL, NULL); - g_return_val_if_fail (E_IS_FOLDER (efolder), NULL); - - return efolder->desc; -} - -void -e_folder_set_home_page (EFolder *efolder, const char *home_page) -{ - g_return_if_fail (efolder != NULL); - g_return_if_fail (E_IS_FOLDER (efolder)); - g_return_if_fail (home_page != NULL); - - if (efolder->home_page) - g_free (efolder->home_page); - - efolder->home_page = g_strdup (home_page); -} - -const char * -e_folder_get_home_page (EFolder *efolder) -{ - g_return_val_if_fail (efolder != NULL, NULL); - g_return_val_if_fail (E_IS_FOLDER (efolder), NULL); - - return efolder->home_page; -} - -const char * -e_folder_get_type_name (EFolder *efolder) -{ - g_return_val_if_fail (efolder != NULL, NULL); - g_return_val_if_fail (E_IS_FOLDER (efolder), NULL); - - switch (efolder->type){ - case E_FOLDER_MAIL: - return _("A folder containing mail items"); - - case E_FOLDER_CONTACTS: - return _("A folder containing contacts"); - - case E_FOLDER_CALENDAR: - return _("A folder containing calendar entries"); - - case E_FOLDER_TASKS: - return _("A folder containing tasks"); - - default: - g_assert_not_reached (); - } - - return NULL; -} - -void -e_folder_construct (EFolder *efolder, EFolderType type, - const char *uri, const char *name, - const char *desc, const char *home_page, - const char *view_name) -{ - g_return_if_fail (efolder != NULL); - g_return_if_fail (E_IS_FOLDER (efolder)); - - /* EFolders are self-owned */ - GTK_OBJECT_UNSET_FLAGS (GTK_OBJECT (efolder), GTK_FLOATING); - - if (uri) - efolder->uri = g_strdup (uri); - if (name) - efolder->name = g_strdup (name); - if (desc) - efolder->desc = g_strdup (desc); - if (home_page) - efolder->home_page = g_strdup (home_page); - if (view_name) - efolder->view_name = g_strdup (view_name); - - efolder->type = type; -} - -EFolder * -e_folder_new (EFolderType type, - const char *uri, const char *name, - const char *desc, const char *home_page, - const char *view_name) -{ - EFolder *efolder; - - efolder = gtk_type_new (e_folder_get_type ()); - - e_folder_construct (efolder, type, uri, name, desc, home_page, view_name); - return efolder; -} - -const char * -e_folder_get_name (EFolder *efolder) -{ - g_return_val_if_fail (efolder != NULL, NULL); - g_return_val_if_fail (E_IS_FOLDER (efolder), NULL); - - return efolder->name; -} - -void -e_folder_set_name (EFolder *efolder, const char *name) -{ - g_return_if_fail (efolder != NULL); - g_return_if_fail (E_IS_FOLDER (efolder)); - - if (efolder->name) - g_free (efolder->name); - - efolder->name = g_strdup (name); -} - -const char * -e_folder_get_view_name (EFolder *efolder) -{ - g_return_val_if_fail (efolder != NULL, NULL); - g_return_val_if_fail (E_IS_FOLDER (efolder), NULL); - - return efolder->view_name; -} - -void -e_folder_set_view_name (EFolder *efolder, const char *view_name) -{ - g_return_if_fail (efolder != NULL); - g_return_if_fail (E_IS_FOLDER (efolder)); - - if (efolder->view_name) - g_free (efolder->view_name); - - efolder->view_name = g_strdup (view_name); - - gtk_signal_emit (GTK_OBJECT (efolder), - efolder_signals [CHANGED]); -} diff --git a/shell/e-folder.h b/shell/e-folder.h deleted file mode 100644 index d262859c3d..0000000000 --- a/shell/e-folder.h +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef _E_FOLDER_H_ -#define _E_FOLDER_H_ - -#include -#include - -#define E_FOLDER_TYPE (e_folder_get_type ()) -#define E_FOLDER(o) (GTK_CHECK_CAST ((o), E_FOLDER_TYPE, EFolder)) -#define E_FOLDER_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_FOLDER_TYPE, EFolderClass)) -#define E_IS_FOLDER(o) (GTK_CHECK_TYPE ((o), E_FOLDER_TYPE)) -#define E_IS_FOLDER_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_FOLDER_TYPE)) - -typedef enum { - E_FOLDER_DND_AS_FORWARD, - E_FOLDER_DND_AS_MOVE_COPY -} EFolderDragDropAction; - -typedef enum { - E_FOLDER_MAIL, - E_FOLDER_CONTACTS, - E_FOLDER_CALENDAR, - E_FOLDER_TASKS, - E_FOLDER_OTHER -} EFolderType; - -typedef struct { - GtkObject parent_object; - - EFolderType type; - - /* - * General properties - */ - char *uri; /* Location */ - char *name; /* Short name */ - char *desc; /* Full description */ - char *home_page; /* Home page for this folder */ - - /* - * Administration properties - */ - char *view_name; /* View name */ -} EFolder; - -typedef struct { - GtkObjectClass parent_class; - - /* - * Notifies views of visible changes in the Efolder - */ - void (*changed) (EFolder *efolder); -} EFolderClass; - -GtkType e_folder_get_type (void); -void e_folder_construct (EFolder *efolder, EFolderType type, - const char *uri, const char *name, - const char *desc, const char *home_page, - const char *view_name); -EFolder *e_folder_new (EFolderType type, - const char *uri, const char *name, - const char *desc, const char *home_page, - const char *view_name); - -void e_folder_set_uri (EFolder *efolder, const char *uri); -const char *e_folder_get_uri (EFolder *efolder); - -void e_folder_set_description (EFolder *efolder, const char *desc); -const char *e_folder_get_description (EFolder *efolder); - -void e_folder_set_home_page (EFolder *efolder, const char *desc); -const char *e_folder_get_home_page (EFolder *efolder); - -const char *e_folder_get_name (EFolder *efolder); -void e_folder_set_name (EFolder *efolder, const char *name); - -const char *e_folder_get_view_name (EFolder *efolder); -void e_folder_set_view_name (EFolder *efolder, const char *view_name); - -const char *e_folder_get_type_name (EFolder *efolder); - -#endif /* _E_FOLDER_H_ */ - diff --git a/shell/e-init.c b/shell/e-init.c deleted file mode 100644 index 34ccdbcfc3..0000000000 --- a/shell/e-init.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * e-init.c: Initializes Evolution for first time users - * - */ -#include -#include -#include "e-init.h" -#include -#include -#include -#include -#include "e-util/e-gui-utils.h" - -char *evolution_base_dir; - -static void -e_init_local (void) -{ - evolution_base_dir = g_concat_dir_and_file (g_get_home_dir (), "Evolution"); - - if (g_file_exists (evolution_base_dir)) - return; - - if (-1 == mkdir (evolution_base_dir, 0755)){ - e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, _("Evolution can not create its local folders")); - exit (0); - } -} - -void -e_init (void) -{ - e_init_local (); -} diff --git a/shell/e-init.h b/shell/e-init.h deleted file mode 100644 index 5684f87b44..0000000000 --- a/shell/e-init.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef E_INIT_H -#define E_INIT_H - -extern char *evolution_base_dir; - -void e_init (void); - -#endif /* E_INIT_H */ diff --git a/shell/e-shell-shortcut.c b/shell/e-shell-shortcut.c deleted file mode 100644 index 56671dccd3..0000000000 --- a/shell/e-shell-shortcut.c +++ /dev/null @@ -1,318 +0,0 @@ -/* - * e-shell-shortcut.c: Handles events from the shortcut bar widget on the - * e-shell-view - * - * Authors: - * Damon Chaplin (damon@gtk.org) - * Miguel de Icaza (miguel@kernel.org) - * - * (C) 1999, 2000 Helix Code, Inc. - */ -#include -#include -#include "shortcut-bar/e-shortcut-bar.h" -#include "e-shell-shortcut.h" -#include "e-shell-view.h" - -#define SMALL_ICONS 1 -#define LARGE_ICONS 2 - -typedef struct { - EShellView *eshell_view; - EShortcutGroup *sg; -} closure_group_t; - -static void -set_large_icons (GtkMenuItem *menu_item, closure_group_t *closure) -{ - e_shortcut_group_set_view_type (closure->sg, E_ICON_BAR_LARGE_ICONS); -} - -static void -set_small_icons (GtkMenu *menu_item, closure_group_t *closure) -{ - e_shortcut_group_set_view_type (closure->sg, E_ICON_BAR_SMALL_ICONS); -} - -static void -add_group (GtkMenu *menu, closure_group_t *closure) -{ - int group_num; - GtkWidget *entry; - - group_num = e_shortcut_bar_model_add_group (closure->eshell_view->eshell->shortcut_bar); - - /* - * FIXME: Figure out why this does not quite work - */ - entry = gtk_entry_new (); - gtk_widget_show (entry); - - e_group_bar_set_group_button_label ( - E_GROUP_BAR (closure->eshell_view->shortcut_bar), - group_num, - entry); -} - -static void -remove_group (GtkMenuItem *menu_item, closure_group_t *closure) -{ - e_shortcut_bar_model_remove_group (closure->eshell_view->eshell->shortcut_bar, closure->sg); -} - -static void -do_rename (GtkEntry *entry, EShortcutGroup *sg) -{ - e_shortcut_group_rename (sg, gtk_entry_get_text (entry)); -} - -static void -rename_group (GtkMenuItem *menu_item, closure_group_t *closure) -{ - GtkWidget *entry; - int item; - - item = e_group_num_from_group_ptr (closure->eshell_view->eshell->shortcut_bar, closure->sg); - e_shortcut_group_rename (closure->sg, "Ren Test"); - - return; - - entry = gtk_entry_new (); - gtk_widget_show (entry); - gtk_widget_grab_focus (entry); - - gtk_signal_connect (GTK_OBJECT (entry), "activate", GTK_SIGNAL_FUNC (do_rename), closure->sg); - - e_group_bar_set_group_button_label (E_GROUP_BAR (closure->eshell_view->shortcut_bar), item, entry); -} - -static void -add_shortcut (GtkMenu *menu, closure_group_t *closure) -{ -} - -static struct { - char *label; - int flags; - GtkSignalFunc callback; -} shortcut_menu [] = { - { N_("Large Icons"), SMALL_ICONS, GTK_SIGNAL_FUNC (set_large_icons) }, - { N_("Small Icons"), LARGE_ICONS, GTK_SIGNAL_FUNC (set_small_icons) }, - { NULL, 0, NULL }, - { N_("Add New Group"), 0, GTK_SIGNAL_FUNC (add_group) }, - { N_("Remove Group"), 0, GTK_SIGNAL_FUNC (remove_group) }, - { N_("Rename Group"), 0, GTK_SIGNAL_FUNC (rename_group) }, - { NULL, 0, NULL }, - { N_("Add Shortcut"), 0, GTK_SIGNAL_FUNC (add_shortcut) }, -}; - -#define ELEMENTS(x) (sizeof (x) / sizeof (x[0])) - -static void -shortcut_bar_show_standard_popup (EShellView *eshell_view, GdkEvent *event, EShortcutGroup *shortcut_group) -{ - GtkWidget *menu, *menuitem; - int i; - closure_group_t closure; - - menu = gtk_menu_new (); - - closure.sg = shortcut_group; - closure.eshell_view = eshell_view; - - for (i = 0; i < ELEMENTS (shortcut_menu); i++){ - gboolean disable = FALSE; - - if (shortcut_menu [i].flags & SMALL_ICONS) - if (shortcut_group->type != E_ICON_BAR_SMALL_ICONS) - disable = TRUE; - - if (shortcut_menu [i].flags & LARGE_ICONS) - if (shortcut_group->type != E_ICON_BAR_LARGE_ICONS) - disable = TRUE; - - if (shortcut_menu [i].label == NULL){ - menuitem = gtk_menu_item_new (); - gtk_widget_set_sensitive (menuitem, FALSE); - } else - menuitem = gtk_menu_item_new_with_label (_(shortcut_menu [i].label)); - - if (disable) - gtk_widget_set_sensitive (menuitem, FALSE); - - gtk_widget_show (menuitem); - gtk_menu_append (GTK_MENU (menu), menuitem); - - gtk_signal_connect ( - GTK_OBJECT (menuitem), "activate", - shortcut_menu [i].callback, &closure); - } - - gtk_signal_connect (GTK_OBJECT (menu), "deactivate", - GTK_SIGNAL_FUNC (gtk_main_quit), NULL); - - gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, - event->button.button, event->button.time); - - gtk_main (); - - gtk_object_destroy (GTK_OBJECT (menu)); -} - -typedef struct { - EShellView *eshell_view; - EShortcutGroup *sg; - EShortcut *shortcut; -} closure_context_t; - -static void -shortcut_open (GtkMenuItem *menuitem, closure_context_t *closure) -{ - e_shell_view_set_view (closure->eshell_view, closure->shortcut->efolder); -} - -static void -shortcut_open_new_window (GtkMenuItem *menuitem, closure_context_t *closure) -{ - GtkWidget *toplevel; - - toplevel = e_shell_view_new (closure->eshell_view->eshell, closure->shortcut->efolder, FALSE); - gtk_widget_show (toplevel); -} - -static void -shortcut_remove (GtkMenuItem *menuitem, closure_context_t *closure) -{ - e_shortcut_group_remove (closure->sg, closure->shortcut); -} - -static void -shortcut_rename (GtkMenuItem *menuitem, closure_context_t *closure) -{ - printf ("Implement: %s %s\n", __FILE__, __FUNCTION__); -} - -static void -shortcut_properties (GtkMenuItem *menuitem, closure_context_t *closure) -{ - printf ("Implement: %s %s\n", __FILE__, __FUNCTION__); -} - -#define NOT_IMPLEMENTED 1 -static struct { - char *label; - char *stock_id; - int flags; - GtkSignalFunc callback; -} context_shortcut_menu [] = { - { N_("Open Folder"), GNOME_STOCK_MENU_OPEN, 0, GTK_SIGNAL_FUNC (shortcut_open) }, - { N_("Open in New Window"), NULL, 0, GTK_SIGNAL_FUNC (shortcut_open_new_window) }, - { N_("Advanced Find"), NULL, NOT_IMPLEMENTED, NULL }, - { NULL, }, - { N_("Remove From Shortcut Bar"), NULL, 0, GTK_SIGNAL_FUNC (shortcut_remove) }, - { N_("Rename Shortcut"), NULL, 0, GTK_SIGNAL_FUNC (shortcut_rename) }, - { NULL, }, - { N_("Properties"), NULL, 0, GTK_SIGNAL_FUNC (shortcut_properties) }, -}; - -static void -shortcut_bar_show_context_popup (EShellView *eshell_view, GdkEvent *event, - EShortcutGroup *shortcut_group, EShortcut *shortcut) -{ - closure_context_t closure; - GtkWidget *menu, *menuitem; - int i; - gboolean disable; - - menu = gtk_menu_new (); - - closure.eshell_view = eshell_view; - closure.sg = shortcut_group; - closure.shortcut = shortcut; - - for (i = 0; i < ELEMENTS (context_shortcut_menu); i++){ - disable = FALSE; - - if (context_shortcut_menu [i].flags & NOT_IMPLEMENTED) - disable = TRUE; - - if (context_shortcut_menu [i].label == NULL){ - menuitem = gtk_menu_item_new (); - gtk_widget_set_sensitive (menuitem, FALSE); - } else { - GtkWidget *label; - - if (context_shortcut_menu [i].stock_id){ - GtkWidget *stock; - - menuitem = gtk_pixmap_menu_item_new (); - stock = gnome_stock_pixmap_widget ( - menu, - context_shortcut_menu [i].stock_id); - if (stock){ - gtk_widget_show (stock); - gtk_pixmap_menu_item_set_pixmap ( - GTK_PIXMAP_MENU_ITEM (menuitem), stock); - } - } else - menuitem = gtk_menu_item_new (); - - label = gtk_label_new (_(context_shortcut_menu [i].label)); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_widget_show (label); - gtk_container_add (GTK_CONTAINER (menuitem), label); - } - - if (disable) - gtk_widget_set_sensitive (menuitem, FALSE); - - gtk_widget_show (menuitem); - gtk_menu_append (GTK_MENU (menu), menuitem); - - gtk_signal_connect ( - GTK_OBJECT (menuitem), "activate", - context_shortcut_menu [i].callback, &closure); - } - - gtk_signal_connect (GTK_OBJECT (menu), "deactivate", - GTK_SIGNAL_FUNC (gtk_main_quit), NULL); - - gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, - event->button.button, event->button.time); - - gtk_main (); - - gtk_object_destroy (GTK_OBJECT (menu)); -} - -void -shortcut_bar_item_selected (EShortcutBar *e_shortcut_bar, - GdkEvent *event, gint group_num, gint item_num, - EShellView *eshell_view) -{ - EShortcut *shortcut; - EShortcutGroup *shortcut_group; - EShortcutBarModel *shortcut_bar = eshell_view->eshell->shortcut_bar; - - shortcut_group = e_shortcut_group_from_pos (shortcut_bar, group_num); - if (shortcut_group == NULL) - return; - - shortcut = e_shortcut_from_pos (shortcut_group, item_num); - - if (shortcut == NULL) - return; - - if (event->button.button == 1) { - e_shell_view_set_view (eshell_view, shortcut->efolder); - } else if (event->button.button == 3) { - - if (shortcut == NULL) - shortcut_bar_show_standard_popup ( - eshell_view, event, shortcut_group); - else - shortcut_bar_show_context_popup ( - eshell_view, event, shortcut_group, shortcut); - } -} - diff --git a/shell/e-shell-shortcut.h b/shell/e-shell-shortcut.h deleted file mode 100644 index 2f526be6ab..0000000000 --- a/shell/e-shell-shortcut.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef E_SHELL_SHORTCUT_H -#define E_SHELL_SHORTCUT_H - -#include "e-shell-view.h" - - -void shortcut_bar_item_selected (EShortcutBar *shortcut_bar, - GdkEvent *event, gint group_num, gint item_num, - EShellView *eshell_view); - -#endif /* E_SHELL_SHORTCUT_H */ diff --git a/shell/e-shell-view-menu.c b/shell/e-shell-view-menu.c deleted file mode 100644 index 8e8231d774..0000000000 --- a/shell/e-shell-view-menu.c +++ /dev/null @@ -1,227 +0,0 @@ -/* - * E-shell-view-menu.c: Controls the shell view's menus. - * - * This file provides API entry points for changing and updating - * the menus to reflect the status of Evolution. - * - * Authors: - * Miguel de Icaza (miguel@helixcode.com) - * - * (C) 2000 Helix Code, Inc. - */ - -#include -#include -#include "e-shell-view.h" -#include "e-shell-view-menu.h" - -static void -esv_cmd_new_folder (GtkWidget *widget, EShellView *esv) -{ - e_shell_view_new_folder (esv); -} - -static void -esv_cmd_new_shortcut (GtkWidget *widget, EShellView *esv) -{ - e_shell_view_new_shortcut (esv); -} - -static void -esv_cmd_new_mail_message (GtkWidget *widget, EShellView *esv) -{ - e_shell_new_mail_message (esv->eshell); -} - -static void -esv_cmd_new_meeting_request (GtkWidget *widget, EShellView *esv) -{ - e_shell_new_meeting_request (esv->eshell); -} - -static void -esv_cmd_new_contact (GtkWidget *widget, EShellView *esv) -{ - e_shell_new_contact (esv->eshell); -} - -static void -esv_cmd_new_task (GtkWidget *widget, EShellView *esv) -{ - e_shell_new_task (esv->eshell); -} - -static void -esv_cmd_new_task_request (GtkWidget *widget, EShellView *esv) -{ - e_shell_new_task_request (esv->eshell); -} - -static void -esv_cmd_new_journal_entry (GtkWidget *widget, EShellView *esv) -{ - e_shell_new_journal_entry (esv->eshell); -} - -static void -esv_cmd_new_note (GtkWidget *widget, EShellView *esv) -{ - e_shell_new_note (esv->eshell); -} - -static void -esv_cmd_open_selected_items (GtkWidget *widget, EShellView *esv) -{ - printf ("Unimplemented open selected items\n"); -} - -static void -esv_cmd_save_as (GtkWidget *widget, EShellView *esv) -{ -} - -static void -quit_cmd (GtkWidget *widget, EShellView *esv) -{ - e_shell_quit (esv->eshell); -} - -static void -esv_cmd_close_open_items (GtkWidget *widget, EShellView *esv) -{ - printf ("Unimplemented function"); -} - -/* - * Fixme - * - * This menu is actually pretty dynamic, it changes de values of various entries - * depending on the current data being displayed - * - * This is currently only a placeholder. We need to figure what to do about this. - */ -static GnomeUIInfo esv_menu_file_new [] = { - - { GNOME_APP_UI_ITEM, N_("_Folder"), - NULL, esv_cmd_new_folder, NULL, - NULL, 0, 0, 'e', GDK_CONTROL_MASK | GDK_SHIFT_MASK }, - - { GNOME_APP_UI_ITEM, N_("Evolution _Bar Shortcut"), - NULL, esv_cmd_new_shortcut, NULL, - NULL, 0, 0, 'e', GDK_CONTROL_MASK | GDK_SHIFT_MASK }, - - GNOMEUIINFO_SEPARATOR, - - { GNOME_APP_UI_ITEM, N_("_Mail message"), - N_("Composes a new mail message"), esv_cmd_new_mail_message, NULL, - NULL, 0, 0, 'n', GDK_CONTROL_MASK | GDK_SHIFT_MASK }, - { GNOME_APP_UI_ITEM, N_("_Appointment"), - N_("Composes a new mail message"), esv_cmd_new_mail_message, NULL, - NULL, 0, 0, 'a', GDK_CONTROL_MASK | GDK_SHIFT_MASK }, - { GNOME_APP_UI_ITEM, N_("Meeting Re_quest"), NULL, - esv_cmd_new_meeting_request, NULL, - NULL, 0, 0, 'q', GDK_CONTROL_MASK | GDK_SHIFT_MASK }, - { GNOME_APP_UI_ITEM, N_("_Contact"), NULL, - esv_cmd_new_contact, NULL, - NULL, 0, 0, 'c', GDK_CONTROL_MASK | GDK_SHIFT_MASK }, - { GNOME_APP_UI_ITEM, N_("_Task"), NULL, - esv_cmd_new_task, NULL, - NULL, 0, 0, 'k', GDK_CONTROL_MASK | GDK_SHIFT_MASK }, - { GNOME_APP_UI_ITEM, N_("Task _Request"), NULL, - esv_cmd_new_task_request, NULL, - NULL, 0, 0, 'u', GDK_CONTROL_MASK | GDK_SHIFT_MASK }, - { GNOME_APP_UI_ITEM, N_("_Journal Entry"), NULL, - esv_cmd_new_journal_entry, NULL, - NULL, 0, 0, 'j', GDK_CONTROL_MASK | GDK_SHIFT_MASK }, - { GNOME_APP_UI_ITEM, N_("_Note"), NULL, - esv_cmd_new_note, NULL, - NULL, 0, 0, 'o', GDK_CONTROL_MASK | GDK_SHIFT_MASK }, - - GNOMEUIINFO_SEPARATOR, - - GNOMEUIINFO_END -}; - -static GnomeUIInfo esv_menu_file_open [] = { - { GNOME_APP_UI_ITEM, N_("_Selected Items"), NULL, - esv_cmd_open_selected_items, NULL, - NULL, 0, 0, 'o', GDK_CONTROL_MASK }, - - GNOMEUIINFO_END -}; - -static GnomeUIInfo esv_menu_folder [] = { - { GNOME_APP_UI_ITEM, N_("_New Folder"), NULL, - esv_cmd_new_folder, NULL, - NULL, 0, 0, 'e', GDK_CONTROL_MASK | GDK_SHIFT_MASK }, - - GNOMEUIINFO_END -}; - -static GnomeUIInfo esv_menu_file [] = { - GNOMEUIINFO_SUBTREE_STOCK (N_("_New"), esv_menu_file_new, GNOME_STOCK_MENU_NEW), - GNOMEUIINFO_SUBTREE_STOCK (N_("_Open"), esv_menu_file_open, GNOME_STOCK_MENU_NEW), - GNOMEUIINFO_ITEM_NONE (N_("Clos_e All Items"), N_("Closes all the open items"), esv_cmd_close_open_items), - GNOMEUIINFO_SEPARATOR, - - GNOMEUIINFO_MENU_SAVE_AS_ITEM (esv_cmd_save_as, NULL), - - GNOMEUIINFO_SEPARATOR, - - GNOMEUIINFO_SUBTREE (N_("_Folder"), esv_menu_folder), - - GNOMEUIINFO_SEPARATOR, - - GNOMEUIINFO_MENU_EXIT_ITEM(quit_cmd, NULL), - - GNOMEUIINFO_END -}; - -static GnomeUIInfo esv_menu_edit [] = { - GNOMEUIINFO_END -}; - -static GnomeUIInfo esv_menu_view [] = { - GNOMEUIINFO_END -}; - -static GnomeUIInfo esv_menu_tools [] = { - GNOMEUIINFO_END -}; - -static GnomeUIInfo esv_menu_actions [] = { - GNOMEUIINFO_END -}; - -static GnomeUIInfo esv_menu [] = { - GNOMEUIINFO_MENU_FILE_TREE (esv_menu_file), - GNOMEUIINFO_MENU_EDIT_TREE (esv_menu_edit), - GNOMEUIINFO_MENU_VIEW_TREE (esv_menu_view), - - /* FIXME: add Favorites here */ - - { GNOME_APP_UI_SUBTREE, N_("_Tools"), NULL, esv_menu_tools }, - { GNOME_APP_UI_SUBTREE, N_("_Actions"), NULL, esv_menu_actions }, -#warning Should provide a help menu here; Bonobo needs it - GNOMEUIINFO_END -}; - -/* - * Sets up the menus for the EShellView. - * - * Creates the Bonobo UI Handler, and then loads the menus from our - * GnomeUIInfo definitions - */ -void -e_shell_view_setup_menus (EShellView *eshell_view) -{ - BonoboUIHandlerMenuItem *list; - - eshell_view->uih = bonobo_ui_handler_new (); - bonobo_ui_handler_set_app (eshell_view->uih, GNOME_APP (eshell_view)); - bonobo_ui_handler_create_menubar (eshell_view->uih); - - list = bonobo_ui_handler_menu_parse_uiinfo_list_with_data (esv_menu, eshell_view); - bonobo_ui_handler_menu_add_list (eshell_view->uih, "/", list); - bonobo_ui_handler_menu_free_list (list); -} diff --git a/shell/e-shell-view-menu.h b/shell/e-shell-view-menu.h deleted file mode 100644 index f198efb806..0000000000 --- a/shell/e-shell-view-menu.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef E_SHELL_VIEW_MENU_H -#define E_SHELL_VIEW_MENU_H - -void e_shell_view_setup_menus (EShellView *eshell_view); - -#endif /* E_SHELL_VIEW_MENU_H */ diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c deleted file mode 100644 index bdbc34238b..0000000000 --- a/shell/e-shell-view.c +++ /dev/null @@ -1,148 +0,0 @@ -/* - * E-shell-view.c: Implements a Shell View of Evolution - * - * Authors: - * Miguel de Icaza (miguel@helixcode.com) - * - * (C) 2000 Helix Code, Inc. - */ -#include -#include -#include "shortcut-bar/e-shortcut-bar.h" -#include "e-util/e-util.h" -#include "e-shell-view.h" -#include "e-shell-view-menu.h" -#include "e-shell-shortcut.h" - -#define PARENT_TYPE gnome_app_get_type () - -static GtkObjectClass *parent_class; - -static void -esv_destroy (GtkObject *object) -{ - EShellView *eshell_view = E_SHELL_VIEW (object); - - e_shell_unregister_view (eshell_view->eshell, eshell_view); - - parent_class->destroy (object); -} - -static void -e_shell_view_class_init (GtkObjectClass *object_class) -{ - object_class->destroy = esv_destroy; - - parent_class = gtk_type_class (PARENT_TYPE); -} - -static void -e_shell_view_setup (EShellView *eshell_view) -{ - /* - * FIXME, should load the config if (load_config).... - */ - gtk_window_set_default_size (GTK_WINDOW (eshell_view), 600, 400); -} - -static void -e_shell_view_setup_shortcut_display (EShellView *eshell_view) -{ - eshell_view->shortcut_bar = e_shortcut_bar_view_new (eshell_view->eshell->shortcut_bar); - - eshell_view->shortcut_hpaned = gtk_hpaned_new (); - gtk_widget_show (eshell_view->shortcut_hpaned); - gtk_paned_set_position (GTK_PANED (eshell_view->shortcut_hpaned), 100); - - gtk_paned_pack1 (GTK_PANED (eshell_view->shortcut_hpaned), - eshell_view->shortcut_bar, FALSE, TRUE); - gtk_widget_show (eshell_view->shortcut_bar); - - gnome_app_set_contents (GNOME_APP (eshell_view), eshell_view->shortcut_hpaned); - - gtk_signal_connect ( - GTK_OBJECT (eshell_view->shortcut_bar), "item_selected", - GTK_SIGNAL_FUNC (shortcut_bar_item_selected), eshell_view); -} - -static GtkWidget * -get_view (EFolder *efolder) -{ - GtkWidget *w; - char buffer [80]; - - sprintf (buffer, "I am the view for %s\n", - e_folder_get_description (efolder)); - - w = gtk_label_new (buffer); - - gtk_widget_show (w); - - return w; -} - -void -e_shell_view_set_view (EShellView *eshell_view, EFolder *efolder) -{ - GtkWidget *w = get_view (efolder); - - if (eshell_view->contents){ - gtk_widget_destroy (eshell_view->contents); - } - - eshell_view->contents = w; - - if (eshell_view->shortcut_displayed){ - gtk_paned_pack2 (GTK_PANED (eshell_view->shortcut_hpaned), - eshell_view->contents, FALSE, TRUE); - } else { - gnome_app_set_contents (GNOME_APP (eshell_view), eshell_view->contents); - } -} - -GtkWidget * -e_shell_view_new (EShell *eshell, EFolder *efolder, gboolean show_shortcut_bar) -{ - EShellView *eshell_view; - - eshell_view = gtk_type_new (e_shell_view_get_type ()); - - gnome_app_construct (GNOME_APP (eshell_view), "Evolution", "Evolution"); - - eshell_view->eshell = eshell; - e_shell_view_setup (eshell_view); - e_shell_view_setup_menus (eshell_view); - - e_shell_register_view (eshell, eshell_view); - eshell_view->shortcut_displayed = show_shortcut_bar; - e_shell_view_setup_shortcut_display (eshell_view); - - e_shell_view_set_view (eshell_view, efolder); - - return (GtkWidget *) eshell_view; -} - -void -e_shell_view_display_shortcut_bar (EShellView *eshell_view, gboolean display) -{ - g_return_if_fail (eshell_view != NULL); - g_return_if_fail (E_IS_SHELL_VIEW (eshell_view)); - - g_error ("Switching code for the shortcut bar is not written yet"); -} - -E_MAKE_TYPE (e_shell_view, "EShellView", EShellView, e_shell_view_class_init, NULL, PARENT_TYPE); - -void -e_shell_view_new_folder (EShellView *esv) -{ - g_return_if_fail (esv != NULL); - g_return_if_fail (E_IS_SHELL_VIEW (esv)); -} - -void -e_shell_view_new_shortcut (EShellView *esv) -{ - g_return_if_fail (esv != NULL); - g_return_if_fail (E_IS_SHELL_VIEW (esv)); -} diff --git a/shell/e-shell-view.h b/shell/e-shell-view.h deleted file mode 100644 index 5f5c5d39c6..0000000000 --- a/shell/e-shell-view.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef E_SHELL_VIEW_H -#define E_SHELL_VIEW_H - -#include -#include -#include "e-shell.h" - -#define E_SHELL_VIEW_TYPE (e_shell_view_get_type ()) -#define E_SHELL_VIEW(o) (GTK_CHECK_CAST ((o), E_SHELL_VIEW_TYPE, EShellView)) -#define E_SHELL_VIEW_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_SHELL_VIEW_TYPE, EShellViewClass)) -#define E_IS_SHELL_VIEW(o) (GTK_CHECK_TYPE ((o), E_SHELL_VIEW_TYPE)) -#define E_IS_SHELL_VIEW_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_SHELL_VIEW_TYPE)) - -struct _EShellView { - GnomeApp parent; - - /* Pointer to our model */ - EShell *eshell; - - /* Our user interface handler */ - BonoboUIHandler *uih; - - - EFolder *efolder; -/* - * - */ - char shortcut_displayed; - GtkWidget *shortcut_hpaned; - GtkWidget *shortcut_bar; - GtkWidget *contents; -}; - -typedef struct { - GnomeAppClass parent_class; -} EShellViewClass; - -GtkWidget *e_shell_view_new (EShell *eshell, EFolder *folder, - gboolean show_shortcut_bar); -GtkType e_shell_view_get_type (void); - -void e_shell_view_new_folder (EShellView *esv); -void e_shell_view_new_shortcut (EShellView *esv); - -void e_shell_view_set_view (EShellView *eshell_view, - EFolder *efolder); - -void e_shell_view_display_shortcut_bar (EShellView *eshell_view, gboolean display); - -#endif /* E_SHELL_VIEW_H */ diff --git a/shell/e-shell.c b/shell/e-shell.c deleted file mode 100644 index cd4be67bc6..0000000000 --- a/shell/e-shell.c +++ /dev/null @@ -1,348 +0,0 @@ -/* - * E-shell.c: Shell object for Evolution - * - * Authors: - * Miguel de Icaza (miguel@helixcode.com) - * - * (C) 1999 Miguel de Icaza - * (C) 2000 Helix Code, Inc. - */ -#include -#include -#include -#include "Evolution.h" -#include "e-util/e-util.h" -#include "e-shell.h" - -#define PARENT_TYPE (bonobo_object_get_type ()) - -static BonoboObjectClass *e_shell_parent_class; -POA_Evolution_Shell__vepv eshell_vepv; - -GtkType e_shell_get_type (void); - -void -e_shell_new_appointment (EShell *eshell) -{ - printf ("Unimplemented function invoked: %s\n", __FUNCTION__); -} - -void -e_shell_new_meeting_request (EShell *eshell) -{ - printf ("Unimplemented function invoked: %s\n", __FUNCTION__); -} - -void -e_shell_new_task (EShell *eshell) -{ - printf ("Unimplemented function invoked: %s\n", __FUNCTION__); -} - -void -e_shell_new_task_request (EShell *eshell) -{ - printf ("Unimplemented function invoked: %s\n", __FUNCTION__); -} - -void -e_shell_new_contact (EShell *eshell) -{ - printf ("Unimplemented function invoked: %s\n", __FUNCTION__); -} - -void -e_shell_new_mail_message (EShell *eshell) -{ - printf ("Unimplemented function invoked: %s\n", __FUNCTION__); -} - -void -e_shell_new_distribution_list (EShell *eshell) -{ - printf ("Unimplemented function invoked: %s\n", __FUNCTION__); -} - -void -e_shell_new_journal_entry (EShell *eshell) -{ - printf ("Unimplemented function invoked: %s\n", __FUNCTION__); -} - -void -e_shell_new_note (EShell *eshell) -{ - printf ("Unimplemented function invoked: %s\n", __FUNCTION__); -} - -static void -EShell_cmd_new (PortableServer_Servant servant, - const Evolution_Shell_NewType type, - CORBA_Environment *ev) -{ - EShell *eshell = E_SHELL (bonobo_object_from_servant (servant)); - - switch (type){ - case Evolution_Shell_APPOINTMENT: - e_shell_new_appointment (eshell); - break; - - case Evolution_Shell_MEETING_REQUEST: - e_shell_new_meeting_request (eshell); - break; - - case Evolution_Shell_TASK: - e_shell_new_task (eshell); - break; - - case Evolution_Shell_TASK_REQUEST: - e_shell_new_task_request (eshell); - break; - - case Evolution_Shell_CONTACT: - e_shell_new_contact (eshell); - break; - - case Evolution_Shell_MAIL_MESSAGE: - e_shell_new_mail_message (eshell); - break; - - case Evolution_Shell_DISTRIBUTION_LIST: - e_shell_new_distribution_list (eshell); - break; - - case Evolution_Shell_JOURNAL_ENTRY: - e_shell_new_journal_entry (eshell); - break; - - case Evolution_Shell_NOTE: - e_shell_new_note (eshell); - break; - - default: - } -} - -static POA_Evolution_Shell__epv * -e_shell_get_epv (void) -{ - POA_Evolution_Shell__epv *epv; - - epv = g_new0 (POA_Evolution_Shell__epv, 1); - - epv->new = EShell_cmd_new; - - return epv; -} - -static void -init_e_shell_corba_class (void) -{ - eshell_vepv.Bonobo_Unknown_epv = bonobo_object_get_epv (); - eshell_vepv.Evolution_Shell_epv = e_shell_get_epv (); -} - -static void -es_destroy_default_folders (EShell *eshell) -{ - gtk_object_unref (GTK_OBJECT (eshell->default_folders.inbox)); - gtk_object_unref (GTK_OBJECT (eshell->default_folders.outbox)); - gtk_object_unref (GTK_OBJECT (eshell->default_folders.drafts)); - gtk_object_unref (GTK_OBJECT (eshell->default_folders.calendar)); - gtk_object_unref (GTK_OBJECT (eshell->default_folders.tasks)); -} - -static void -e_shell_destroy (GtkObject *object) -{ - EShell *eshell = E_SHELL (object); - - gtk_object_unref (GTK_OBJECT (eshell->shortcut_bar)); - es_destroy_default_folders (eshell); - - GTK_OBJECT_CLASS (e_shell_parent_class)->destroy (object); -} - -static void -e_shell_class_init (GtkObjectClass *object_class) -{ - e_shell_parent_class = gtk_type_class (PARENT_TYPE); - init_e_shell_corba_class (); - - object_class->destroy = e_shell_destroy; -} - -static void -e_shell_destroy_views (EShell *eshell) -{ - - /* - * Notice that eshell->views is updated by the various views - * during unregistration - */ - while (eshell->views){ - EShellView *view = eshell->views->data; - - gtk_object_destroy (GTK_OBJECT (view)); - } -} - -void -e_shell_quit (EShell *eshell) -{ - g_return_if_fail (eshell != NULL); - g_return_if_fail (E_IS_SHELL (eshell)); - - e_shell_destroy_views (eshell); - - gtk_main_quit (); -} - -static CORBA_Object -create_corba_eshell (BonoboObject *object) -{ - POA_Evolution_Shell *servant; - CORBA_Environment ev; - - servant = (POA_Evolution_Shell *)g_new0 (BonoboObjectServant, 1); - servant->vepv = &eshell_vepv; - - CORBA_exception_init (&ev); - - POA_Evolution_Shell__init ((PortableServer_Servant) servant, &ev); - if (ev._major != CORBA_NO_EXCEPTION){ - CORBA_exception_free (&ev); - g_free (servant); - return CORBA_OBJECT_NIL; - } - - CORBA_exception_free (&ev); - - return bonobo_object_activate_servant (object, servant); -} - -static void -e_shell_setup_default_folders (EShell *eshell) -{ - eshell->default_folders.summary = e_folder_new ( - E_FOLDER_MAIL, "internal:summary", _("Today"), _("Executive Summary"), - NULL, "internal:"); - eshell->default_folders.inbox = e_folder_new ( - E_FOLDER_MAIL, "internal:inbox", _("Inbox"), _("New mail messages"), - NULL, "internal:mail_view"); - eshell->default_folders.outbox = e_folder_new ( - E_FOLDER_MAIL, "internal:outbox", _("Sent messages"), _("Sent mail messages"), - NULL, "internal:mail_view"); - eshell->default_folders.drafts = e_folder_new ( - E_FOLDER_MAIL, "internal:drafts", _("Drafts"), _("Draft mail messages"), - NULL, "internal:mail_view"); - eshell->default_folders.calendar = e_folder_new ( - E_FOLDER_CALENDAR, "internal:personal_calendar", _("Calendar"), _("Your calendar"), - NULL, "internal:calendar_daily"); - eshell->default_folders.contacts = e_folder_new ( - E_FOLDER_CONTACTS, "internal:personal_contacts", _("Contacts"), _("Your contacts list"), - NULL, "internal:contact_view"); - eshell->default_folders.tasks = e_folder_new ( - E_FOLDER_TASKS, "internal:personal_calendar", _("Tasks"), _("Tasks list"), - NULL, "internal:tasks_view"); -} - -static EShortcutGroup * -setup_main_shortcuts (EShell *eshell) -{ - EShortcutGroup *m; - - m = e_shortcut_group_new (_("Main Shortcuts"), FALSE); - e_shortcut_group_append (m, e_shortcut_new (eshell->default_folders.summary)); - e_shortcut_group_append (m, e_shortcut_new (eshell->default_folders.inbox)); - e_shortcut_group_append (m, e_shortcut_new (eshell->default_folders.calendar)); - e_shortcut_group_append (m, e_shortcut_new (eshell->default_folders.contacts)); - e_shortcut_group_append (m, e_shortcut_new (eshell->default_folders.tasks)); - - return m; -} - -static EShortcutGroup * -setup_secondary_shortcuts (EShell *eshell) -{ - EShortcutGroup *sec; - - sec = e_shortcut_group_new (_("Other Shortcuts"), TRUE); - - e_shortcut_group_append (sec, e_shortcut_new (eshell->default_folders.drafts)); - e_shortcut_group_append (sec, e_shortcut_new (eshell->default_folders.outbox)); - - return sec; -} - -static void -e_shell_setup_default_shortcuts (EShell *eshell) -{ - eshell->shortcut_bar = e_shortcut_bar_model_new (); - e_shortcut_bar_model_append ( - eshell->shortcut_bar, - setup_main_shortcuts (eshell)); - e_shortcut_bar_model_append ( - eshell->shortcut_bar, - setup_secondary_shortcuts (eshell)); -} - -static void -e_shell_init (GtkObject *object) -{ - EShell *eshell = E_SHELL (object); - - e_shell_setup_default_folders (eshell); - e_shell_setup_default_shortcuts (eshell); -} - -static void -e_shell_construct (EShell *eshell, Evolution_Shell corba_eshell) -{ - bonobo_object_construct (BONOBO_OBJECT (eshell), corba_eshell); -} - -EShell * -e_shell_new (void) -{ - Evolution_Shell corba_eshell; - EShell *eshell; - - eshell = gtk_type_new (e_shell_get_type ()); - - corba_eshell = create_corba_eshell (BONOBO_OBJECT (eshell)); - if (corba_eshell == CORBA_OBJECT_NIL){ - gtk_object_destroy (GTK_OBJECT (eshell)); - return NULL; - } - - e_shell_construct (eshell, corba_eshell); - - return eshell; -} - -void -e_shell_register_view (EShell *eshell, EShellView *eshell_view) -{ - g_return_if_fail (eshell != NULL); - g_return_if_fail (E_IS_SHELL (eshell)); - g_return_if_fail (eshell_view != NULL); - - eshell->views = g_slist_prepend (eshell->views, eshell_view); -} - -void -e_shell_unregister_view (EShell *eshell, EShellView *eshell_view) -{ - g_return_if_fail (eshell != NULL); - g_return_if_fail (E_IS_SHELL (eshell)); - g_return_if_fail (eshell_view != NULL); - - eshell->views = g_slist_remove (eshell->views, eshell_view); -} - -E_MAKE_TYPE (e_shell, "EShell", EShell, e_shell_class_init, e_shell_init, PARENT_TYPE); - - - - diff --git a/shell/e-shell.h b/shell/e-shell.h deleted file mode 100644 index 64de044fb4..0000000000 --- a/shell/e-shell.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef E_SHELL_H -#define E_SHELL_H - -#include -#include "evolution.h" -#include "e-folder.h" -#include "e-shortcut.h" - -#define E_SHELL_GOAD_ID "GOADID:GNOME:Evolution:Shell:1.0" -#define E_SHELL_FACTORY_GOAD_ID "GOADID:GNOME:Evolution:ShellFactory:1.0" - -#define E_SHELL_TYPE (e_shell_get_type ()) -#define E_SHELL(o) (GTK_CHECK_CAST ((o), E_SHELL_TYPE, EShell)) -#define E_SHELL_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_SHELL_TYPE, EShellClass)) -#define E_IS_SHELL(o) (GTK_CHECK_TYPE ((o), E_SHELL_TYPE)) -#define E_IS_SHELL_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_SHELL_TYPE)) - -struct _EShell { - BonoboObject base_object; - - /* A list of EShellViews */ - GSList *views; - - struct { - EFolder *inbox; - EFolder *outbox; - EFolder *drafts; - EFolder *calendar; - EFolder *tasks; - EFolder *summary; - EFolder *contacts; - } default_folders; - - EShortcutBarModel *shortcut_bar; -}; - -typedef struct { - BonoboObjectClass parent_class; -} EShellClass; - -EShell *e_shell_new (void); -void e_shell_register_view (EShell *eshell, EShellView *eshell_view); -void e_shell_unregister_view (EShell *eshell, EShellView *eshell_view); - -/* - * New - */ -void e_shell_new_appointment (EShell *eshell); -void e_shell_new_meeting_request (EShell *eshell); -void e_shell_new_task (EShell *eshell); -void e_shell_new_task_request (EShell *eshell); -void e_shell_new_contact (EShell *eshell); -void e_shell_new_mail_message (EShell *eshell); -void e_shell_new_distribution_list (EShell *eshell); -void e_shell_new_journal_entry (EShell *eshell); -void e_shell_new_note (EShell *eshell); - -void e_shell_quit (EShell *eshell); - -#endif /* EVOLUTION_SHELL_H */ diff --git a/shell/e-shortcut.c b/shell/e-shortcut.c deleted file mode 100644 index 767f9e4067..0000000000 --- a/shell/e-shortcut.c +++ /dev/null @@ -1,451 +0,0 @@ -/* - * Shortcut.c: implements shortcuts and shortcut group models - * - * Author: - * Miguel de Icaza (miguel@kernel.org) - * - * (C) 2000 Helix Code, Inc. - * - */ -#include -#include -#include -#include -#include "e-util/e-util.h" -#include "e-shortcut.h" -#include "shortcut-bar/e-shortcut-bar.h" -#include "shortcut-bar/e-clipped-label.h" - -#define SHORTCUT_PARENT_TYPE gtk_object_get_type () -#define SHORTCUT_BAR_MODEL_PARENT_TYPE gtk_object_get_type () -#define SHORTCUT_GROUP_PARENT_TYPE gtk_object_get_type () - -static GtkObjectClass *shortcut_parent_class; -static GtkObjectClass *shortcut_group_parent_class; -static GtkObjectClass *shortcut_bar_model_parent_class; - -enum { - STRUCTURE_CHANGED, - LAST_SIGNAL -}; - -static void -es_destroy (GtkObject *object) -{ - EShortcut *ef = E_SHORTCUT (object); - - gtk_object_unref (GTK_OBJECT (ef->efolder)); - - shortcut_parent_class->destroy (object); -} - -static void -e_shortcut_class_init (GtkObjectClass *object_class) -{ - object_class->destroy = es_destroy; - shortcut_parent_class = gtk_type_class (SHORTCUT_PARENT_TYPE); -} - -static void -esg_destroy (GtkObject *object) -{ - EShortcutGroup *efg = E_SHORTCUT_GROUP (object); - const int shortcut_count = efg->shortcuts->len; - int i; - - g_free (efg->title); - - for (i = 0; i < shortcut_count; i++){ - EShortcut *es = g_array_index (efg->shortcuts, EShortcut *, i); - - gtk_object_unref (GTK_OBJECT (es)); - } - - g_array_free (efg->shortcuts, TRUE); - efg->model = NULL; - - shortcut_group_parent_class->destroy (object); -} - -static void -e_shortcut_group_class_init (GtkObjectClass *object_class) -{ - object_class->destroy = esg_destroy; - shortcut_parent_class = gtk_type_class (SHORTCUT_GROUP_PARENT_TYPE); -} - -static void -e_shortcut_group_init (GtkObject *object) -{ - EShortcutGroup *esg = E_SHORTCUT_GROUP (object); - - GTK_OBJECT_UNSET_FLAGS (GTK_OBJECT (object), GTK_FLOATING); - - esg->shortcuts = g_array_new (FALSE, FALSE, sizeof (EShortcut *)); -} - -EShortcut * -e_shortcut_new (EFolder *efolder) -{ - EShortcut *shortcut = gtk_type_new (e_shortcut_get_type ()); - - shortcut->efolder = efolder; - gtk_object_ref (GTK_OBJECT (efolder)); - - return shortcut; -} - -EShortcutGroup * -e_shortcut_group_new (const char *title, EIconBarViewType type) -{ - EShortcutGroup *shortcut_group = gtk_type_new (e_shortcut_group_get_type ()); - - shortcut_group->title = g_strdup (title); - shortcut_group->type = type; - return shortcut_group; -} - -void -e_shortcut_group_append (EShortcutGroup *sg, EShortcut *shortcut) -{ - g_return_if_fail (sg != NULL); - g_return_if_fail (E_IS_SHORTCUT_GROUP (sg)); - g_return_if_fail (shortcut != NULL); - g_return_if_fail (E_IS_SHORTCUT (shortcut)); - - gtk_object_ref (GTK_OBJECT (shortcut)); - gtk_object_sink (GTK_OBJECT (shortcut)); - - g_array_append_val (sg->shortcuts, shortcut); - - /* FIXME: Broadcast change */ -} - -void -e_shortcut_group_remove (EShortcutGroup *sg, EShortcut *shortcut) -{ - g_return_if_fail (sg != NULL); - g_return_if_fail (E_IS_SHORTCUT_GROUP (sg)); - g_return_if_fail (shortcut != NULL); - g_return_if_fail (E_IS_SHORTCUT (sg)); - - { - const int len = sg->shortcuts->len; - int i; - - for (i = 0; i < len; i++){ - EShortcut *es = g_array_index (sg->shortcuts, EShortcut *, i); - - if (es == shortcut){ - g_array_remove_index (sg->shortcuts, i); - /* FIXME: Broadcast change */ - return; - } - } - } -} - -void -e_shortcut_group_move (EShortcutGroup *sg, int from, int to) -{ - EShortcut *t; - - g_return_if_fail (sg != NULL); - g_return_if_fail (E_IS_SHORTCUT_GROUP (sg)); - - g_return_if_fail (from < sg->shortcuts->len); - g_return_if_fail (to < sg->shortcuts->len); - g_return_if_fail (from >= 0); - g_return_if_fail (to >= 0); - - if (from == to) - return; - - t = g_array_index (sg->shortcuts, EShortcut *, from); - g_array_index (sg->shortcuts, EShortcut *, from) = - g_array_index (sg->shortcuts, EShortcut *, to); - g_array_index (sg->shortcuts, EShortcut *, to) = t; - - /* FIXME: Broadcast change */ -} - -void -e_shortcut_group_rename (EShortcutGroup *sg, const char *text) -{ - GSList *l; - int id; - - g_return_if_fail (sg != NULL); - g_return_if_fail (E_IS_SHORTCUT_GROUP (sg)); - - id = e_group_num_from_group_ptr (sg->model, sg); - for (l = sg->model->views; l; l = l->next){ - EShortcutBar *shortcut_bar = l->data; - GtkWidget *label; - - label = e_clipped_label_new (text); - - gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5); - gtk_widget_show (label); - - e_group_bar_set_group_button_label ( - E_GROUP_BAR (shortcut_bar), id, label); - } -} - -static void -esb_destroy (GtkObject *object) -{ - EShortcutBarModel *esb = E_SHORTCUT_BAR_MODEL (object); - const int count = esb->groups->len; - int i; - - for (i = 0; i < count; i++){ - EShortcutGroup *esg = g_array_index (esb->groups, EShortcutGroup *, i); - - gtk_object_destroy (GTK_OBJECT (esg)); - } - - g_array_free (esb->groups, TRUE); - shortcut_bar_model_parent_class->destroy (object); -} - -static void -e_shortcut_bar_model_class_init (GtkObjectClass *object_class) -{ - object_class->destroy = esb_destroy; - shortcut_bar_model_parent_class = gtk_type_class (SHORTCUT_BAR_MODEL_PARENT_TYPE); -} - -static void -e_shortcut_bar_model_init (GtkObject *object) -{ - EShortcutBarModel *esb = E_SHORTCUT_BAR_MODEL (object); - - /* The shortcut bar model is self owned */ - GTK_OBJECT_UNSET_FLAGS (object, GTK_FLOATING); - - esb->groups = g_array_new (FALSE, FALSE, sizeof (EShortcutGroup *)); -} - -EShortcutBarModel * -e_shortcut_bar_model_new (void) -{ - EShortcutBarModel *bm; - - bm = gtk_type_new (e_shortcut_bar_model_get_type ()); - - return bm; -} - -void -e_shortcut_bar_model_append (EShortcutBarModel *bm, EShortcutGroup *sg) -{ - g_return_if_fail (bm != NULL); - g_return_if_fail (sg != NULL); - g_return_if_fail (E_IS_SHORTCUT_BAR_MODEL (bm)); - g_return_if_fail (E_IS_SHORTCUT_GROUP (sg)); - - gtk_object_ref (GTK_OBJECT (sg)); - gtk_object_sink (GTK_OBJECT (sg)); - - sg->model = bm; - - g_array_append_val (bm->groups, sg); -} - -EShortcutGroup * -e_shortcut_group_from_pos (EShortcutBarModel *bm, int group_num) -{ - EShortcutGroup *group; - - if (group_num == -1) - return NULL; - - group = g_array_index (bm->groups, EShortcutGroup *, group_num); - return group; -} - -EShortcut * -e_shortcut_from_pos (EShortcutGroup *group, int item_num) -{ - EShortcut *shortcut; - - g_return_val_if_fail (group != NULL, NULL); - g_return_val_if_fail (E_IS_SHORTCUT_GROUP (group), NULL); - - if (item_num == -1) - return NULL; - - g_return_val_if_fail (item_num < group->shortcuts->len, NULL); - - shortcut = g_array_index (group->shortcuts, EShortcut *, item_num); - return shortcut; -} - -static void -populate_group (EShortcutBarModel *bm, EShortcutGroup *esg, EShortcutBar *shortcut_bar) -{ - int group_num, i; - const int items = esg->shortcuts->len; - - group_num = e_shortcut_bar_add_group (shortcut_bar, esg->title); - e_shortcut_bar_set_view_type (shortcut_bar, group_num, esg->type); - - for (i = 0; i < items; i++){ - EShortcut *shortcut = E_SHORTCUT (g_array_index (esg->shortcuts, EShortcut *, i)); - EFolder *folder = shortcut->efolder; - char *type = NULL; - - switch (folder->type){ - case E_FOLDER_MAIL: - type = "folder:"; - break; - - case E_FOLDER_CONTACTS: - type = "contacts:"; - break; - - case E_FOLDER_CALENDAR: - type = "calendar:"; - break; - - case E_FOLDER_TASKS: - type = "todo:"; - break; - - case E_FOLDER_OTHER: - type = "file:"; - break; - - default: - g_assert_not_reached (); - } - - e_shortcut_bar_add_item (shortcut_bar, group_num, type, folder->name); - } -} - -static void -populate_from_model (EShortcutBarModel *bm, EShortcutBar *shortcut_bar) -{ - const int groups = bm->groups->len; - int i; - - for (i = 0; i < groups; i++){ - EShortcutGroup *esg; - - esg = g_array_index (bm->groups, EShortcutGroup *, i); - - populate_group (bm, esg, shortcut_bar); - } - -} - -static void -view_destroyed (EShortcutBar *shortcut_bar, EShortcutBarModel *bm) -{ - bm->views = g_slist_remove (bm->views, shortcut_bar); -} - -GtkWidget * -e_shortcut_bar_view_new (EShortcutBarModel *bm) -{ - GtkWidget *shortcut_bar; - - gtk_widget_push_visual (gdk_rgb_get_visual ()); - gtk_widget_push_colormap (gdk_rgb_get_cmap ()); - - shortcut_bar = e_shortcut_bar_new (); - - gtk_widget_pop_visual (); - gtk_widget_pop_colormap (); - - populate_from_model (bm, E_SHORTCUT_BAR (shortcut_bar)); - - bm->views = g_slist_prepend (bm->views, shortcut_bar); - gtk_signal_connect (GTK_OBJECT (shortcut_bar), "destroy", GTK_SIGNAL_FUNC (view_destroyed), bm); - - return shortcut_bar; -} - -int -e_group_num_from_group_ptr (EShortcutBarModel *bm, EShortcutGroup *group) -{ - const int n = bm->groups->len; - int i; - - for (i = 0; i < n; i++) - if (g_array_index (bm->groups, EShortcutGroup *, i) == group) - return i; - return -1; -} - -/* - * Sets the view mode in all the views - */ -void -e_shortcut_group_set_view_type (EShortcutGroup *group, EIconBarViewType type) -{ - GSList *l; - int group_num; - - g_return_if_fail (group != NULL); - g_return_if_fail (E_IS_SHORTCUT_GROUP (group)); - - group_num = e_group_num_from_group_ptr (group->model, group); - - g_assert (group_num != -1); - - group->type = type; - - for (l = group->model->views; l ; l = l->next){ - EShortcutBar *shortcut_bar = l->data; - - e_shortcut_bar_set_view_type (shortcut_bar, group_num, type); - } -} - -gint -e_shortcut_bar_model_add_group (EShortcutBarModel *model) -{ - int id = -1; - GSList *l = NULL; - - g_return_val_if_fail (model != NULL, -1); - g_return_val_if_fail (E_IS_SHORTCUT_BAR_MODEL (model), -1); - - for (l = model->views; l; l = l->next){ - EShortcutBar *shortcut_bar = l->data; - - id = e_shortcut_bar_add_group (shortcut_bar, _("New group")); - } - - return id; -} - -void -e_shortcut_bar_model_remove_group (EShortcutBarModel *model, EShortcutGroup *sg) -{ - GSList *l = NULL; - int group_num; - - g_return_if_fail (model != NULL); - g_return_if_fail (E_IS_SHORTCUT_BAR_MODEL (model)); - g_return_if_fail (sg != NULL); - g_return_if_fail (E_IS_SHORTCUT_GROUP (sg)); - - group_num = e_group_num_from_group_ptr (model, sg); - - for (l = model->views; l; l = l->next){ - EShortcutBar *shortcut_bar = l->data; - - e_shortcut_bar_remove_group (shortcut_bar, group_num); - } - -} - -E_MAKE_TYPE (e_shortcut, "EShortcut", EShortcut, e_shortcut_class_init, NULL, SHORTCUT_PARENT_TYPE); -E_MAKE_TYPE (e_shortcut_group, "EShortcutGroup", EShortcutGroup, e_shortcut_group_class_init, e_shortcut_group_init, SHORTCUT_GROUP_PARENT_TYPE); -E_MAKE_TYPE (e_shortcut_bar_model, "EShortcutBarModel", EShortcutBarModel, e_shortcut_bar_model_class_init, e_shortcut_bar_model_init, SHORTCUT_BAR_MODEL_PARENT_TYPE); - diff --git a/shell/e-shortcut.h b/shell/e-shortcut.h deleted file mode 100644 index e7dde69124..0000000000 --- a/shell/e-shortcut.h +++ /dev/null @@ -1,102 +0,0 @@ -#ifndef SHELL_SHORTCUT_H -#define SHELL_SHORTCUT_H - -#include -#include "e-folder.h" -#include "shortcut-bar/e-icon-bar.h" - -typedef struct _EShortcut EShortcut; -typedef struct _EShortcutGroup EShortcutGroup; -typedef struct _EShortcutBarModel EShortcutBarModel; - -#define E_SHORTCUT_TYPE (e_shortcut_get_type ()) -#define E_SHORTCUT(o) (GTK_CHECK_CAST ((o), E_SHORTCUT_TYPE, EShortcut)) -#define E_SHORTCUT_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_SHORTCUT_TYPE, EShortcutClass)) -#define E_IS_SHORTCUT(o) (GTK_CHECK_TYPE ((o), E_SHORTCUT_TYPE)) -#define E_IS_SHORTCUT_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_SHORTCUT_TYPE)) - -struct _EShortcut { - GtkObject object; - EFolder *efolder; -}; - -typedef struct { - GtkObjectClass parent_class; -} EShortcutClass; - -#define E_SHORTCUT_GROUP_TYPE (e_shortcut_group_get_type ()) -#define E_SHORTCUT_GROUP(o) (GTK_CHECK_CAST ((o), E_SHORTCUT_GROUP_TYPE, EShortcutGroup)) -#define E_SHORTCUT_GROUP_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_SHORTCUT_GROUP_TYPE, EShortcutGroupClass)) -#define E_IS_SHORTCUT_GROUP(o) (GTK_CHECK_TYPE ((o), E_SHORTCUT_GROUP_TYPE)) -#define E_IS_SHORTCUT_GROUP_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_SHORTCUT_GROUP_TYPE)) - -struct _EShortcutGroup { - GtkObject object; - EShortcutBarModel *model; - char *group_name; - GArray *shortcuts; - char *title; - EIconBarViewType type; -}; - -typedef struct { - GtkObjectClass parent_class; -} EShortcutGroupClass; - -GtkType e_shortcut_get_type (void); -EShortcut *e_shortcut_new (EFolder *efolder); - -GtkType e_shortcut_group_get_type (void); -EShortcutGroup *e_shortcut_group_new (const char *name, EIconBarViewType type); -void e_shortcut_group_append (EShortcutGroup *sg, EShortcut *shortcut); -void e_shortcut_group_destroy (EShortcutGroup *sg); -void e_shortcut_group_remove (EShortcutGroup *sg, EShortcut *shortcut); -void e_shortcut_group_move (EShortcutGroup *sg, int from, int to); -void e_shortcut_group_set_view_type (EShortcutGroup *sg, EIconBarViewType type); -void e_shortcut_group_rename (EShortcutGroup *sg, const char *text); - -#define E_SHORTCUT_BAR_MODEL_TYPE (e_shortcut_bar_model_get_type ()) -#define E_SHORTCUT_BAR_MODEL(o) (GTK_CHECK_CAST ((o), E_SHORTCUT_BAR_MODEL_TYPE, EShortcutBarModel)) -#define E_SHORTCUT_BAR_MODEL_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_SHORTCUT_BAR_MODEL_TYPE, EShortcutBarMNodelClass)) -#define E_IS_SHORTCUT_BAR_MODEL(o) (GTK_CHECK_TYPE ((o), E_SHORTCUT_BAR_MODEL_TYPE)) -#define E_IS_SHORTCUT_BAR_MODEL_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_SHORTCUT_BAR_MODEL_TYPE)) - -struct _EShortcutBarModel { - GtkObject object; - - GArray *groups; - GSList *views; -}; - -typedef struct { - GtkObjectClass object_class; -} EShortcutBarModelClass; - -GtkType e_shortcut_bar_model_get_type (void); -EShortcutBarModel *e_shortcut_bar_model_new (void); -void e_shortcut_bar_model_append (EShortcutBarModel *shortcut_bar, - EShortcutGroup *group); -int e_shortcut_bar_model_add_group (EShortcutBarModel *shortcut_bar); -void e_shortcut_bar_model_remove_group - (EShortcutBarModel *model, - EShortcutGroup *sg); - -/* Ugly api name */ -int e_group_num_from_group_ptr (EShortcutBarModel *bm, - EShortcutGroup *group); - -/* - * Produces a new view of the Shortcut Bar model - */ -GtkWidget *e_shortcut_bar_view_new (EShortcutBarModel *bm); - -/* - * Locating objects - */ -EShortcutGroup *e_shortcut_group_from_pos (EShortcutBarModel *bm, - int group_num); -EShortcut *e_shortcut_from_pos (EShortcutGroup *group, - int item_num); - -#endif - diff --git a/shell/evolution.h b/shell/evolution.h deleted file mode 100644 index 11e5b342f9..0000000000 --- a/shell/evolution.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _EVOLUTION_H_ -#define _EVOLUTION_H_ - -typedef struct _EShell EShell; -typedef struct _EShellView EShellView; - -#endif diff --git a/shell/main.c b/shell/main.c deleted file mode 100644 index 1d6d8bed7c..0000000000 --- a/shell/main.c +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Main evolution shell application - * - * Authors: - * Miguel de Icaza (miguel@helixcode.com) - * - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include "e-shell.h" -#include "e-shell-view.h" - -int shell_debugging = 0; - -poptContext ctx; - -EShell *eshell; - -const struct poptOption shell_popt_options [] = { - { "debug", '\0', POPT_ARG_INT, &shell_debugging, 0, - N_("Enables some debugging functions"), N_("LEVEL") }, - { NULL, '\0', 0, NULL, 0 } -}; - -static void -corba_init (int *argc, char *argv []) -{ - CORBA_Environment ev; - - CORBA_exception_init (&ev); - gnome_CORBA_init_with_popt_table ( - "Evolution", VERSION, argc, argv, - shell_popt_options, 0, &ctx, GNORBA_INIT_SERVER_FUNC, &ev); - CORBA_exception_free (&ev); - - if (bonobo_init (gnome_CORBA_ORB (), NULL, NULL) == FALSE){ - e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, - _("Failed to initialize the Bonobo component system")); - exit (1); - } -} - -static void -gui_init (void) -{ - e_cursors_init (); - - glade_gnome_init (); - - bonobo_activate (); -} - -static void -gui_shutdown (void) -{ - /* shutdown */ - e_cursors_shutdown (); -} - -static void -evolution_boot (void) -{ - EShellView *e_shell_view; - - eshell = e_shell_new (); - e_shell_view = E_SHELL_VIEW ( - e_shell_view_new (eshell, - eshell->default_folders.inbox, - TRUE)); - - gtk_widget_show (GTK_WIDGET (e_shell_view)); -} - -int -main (int argc, char *argv []) -{ - bindtextdomain (PACKAGE, EVOLUTION_LOCALEDIR); - textdomain (PACKAGE); - - corba_init (&argc, argv); - gui_init (); - - evolution_boot (); - - gtk_main (); - - gui_shutdown (); - - return 0; -} -- cgit v1.2.3