aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--shell/Evolution.idl32
-rw-r--r--shell/Makefile.am18
-rw-r--r--shell/e-shell-view-menu.c227
-rw-r--r--shell/e-shell-view-menu.h6
-rw-r--r--shell/e-shell-view.c66
-rw-r--r--shell/e-shell-view.h34
-rw-r--r--shell/e-shell.c201
-rw-r--r--shell/e-shell.h31
-rw-r--r--shell/main.c52
9 files changed, 627 insertions, 40 deletions
diff --git a/shell/Evolution.idl b/shell/Evolution.idl
new file mode 100644
index 0000000000..936f60633e
--- /dev/null
+++ b/shell/Evolution.idl
@@ -0,0 +1,32 @@
+/*
+ * CORBA interface for the Evolution shell
+ *
+ * Authors:
+ * Miguel de Icaza (miguel@kernel.org)
+ *
+ * (C) 2000 Helix Code, Inc.
+ */
+#include <bonobo.idl>
+
+module GNOME {
+
+ module Evolution {
+
+ interface Shell : GNOME::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
index 03848c6110..18e0cce064 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -9,6 +9,12 @@ INCLUDES = \
-I$(srcdir)/../widgets \
$(BONOBO_GNOME_CFLAGS)
+EVOLUTION_CORBA_GENERATED = \
+ Evolution.h \
+ Evolution-common.c \
+ Evolution-skels.c \
+ Evolution-stubs.c
+
evolution_SOURCES = \
main.c \
e-folder.c \
@@ -18,11 +24,21 @@ evolution_SOURCES = \
e-init.c \
e-init.h \
e-shell.c \
- e-shell.h
+ e-shell.h \
+ e-shell-view.c \
+ e-shell-view.h \
+ e-shell-view-menu.c \
+ e-shell-view-menu.h \
+ $(EVOLUTION_CORBA_GENERATED)
+
+Evolution-impl.o: Evolution.h
+$(EVOOLUTION_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 \ No newline at end of file
diff --git a/shell/e-shell-view-menu.c b/shell/e-shell-view-menu.c
new file mode 100644
index 0000000000..41129ec5f3
--- /dev/null
+++ b/shell/e-shell-view-menu.c
@@ -0,0 +1,227 @@
+/*
+ * 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 <config.h>
+#include <gnome.h>
+#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)
+{
+ GnomeUIHandlerMenuItem *list;
+
+ eshell_view->uih = gnome_ui_handler_new ();
+ gnome_ui_handler_set_app (eshell_view->uih, GNOME_APP (eshell_view));
+ gnome_ui_handler_create_menubar (eshell_view->uih);
+
+ list = gnome_ui_handler_menu_parse_uiinfo_list_with_data (esv_menu, eshell_view);
+ gnome_ui_handler_menu_add_list (eshell_view->uih, "/", list);
+ gnome_ui_handler_menu_free_list (list);
+}
diff --git a/shell/e-shell-view-menu.h b/shell/e-shell-view-menu.h
new file mode 100644
index 0000000000..f198efb806
--- /dev/null
+++ b/shell/e-shell-view-menu.h
@@ -0,0 +1,6 @@
+#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
new file mode 100644
index 0000000000..f57a6add3a
--- /dev/null
+++ b/shell/e-shell-view.c
@@ -0,0 +1,66 @@
+/*
+ * E-shell-view.c: Implements a Shell View of Evolution
+ *
+ * Authors:
+ * Miguel de Icaza (miguel@helixcode.com)
+ *
+ * (C) 2000 Helix Code, Inc.
+ */
+#include <config.h>
+#include <gnome.h>
+#include "e-util/e-util.h"
+#include "e-shell-view.h"
+#include "e-shell-view-menu.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);
+}
+
+GtkWidget *
+e_shell_view_new (EShell *eshell)
+{
+ EShellView *eshell_view;
+
+ eshell_view = gtk_type_new (e_shell_view_get_type ());
+
+ gnome_app_construct (GNOME_APP (eshell_view), "Evolution", "Evolution");
+ e_shell_view_setup_menus (eshell_view);
+
+ e_shell_register_view (eshell, eshell_view);
+
+ return (GtkWidget *) eshell_view;
+}
+
+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
new file mode 100644
index 0000000000..c5d3b797b5
--- /dev/null
+++ b/shell/e-shell-view.h
@@ -0,0 +1,34 @@
+#ifndef E_SHELL_VIEW_H
+#define E_SHELL_VIEW_H
+
+#include <bonobo/gnome-object.h>
+#include <bonobo/gnome-ui-handler.h>
+#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 */
+ GnomeUIHandler *uih;
+};
+
+typedef struct {
+ GnomeAppClass parent_class;
+} EShellViewClass;
+
+GtkWidget *e_shell_view_new (EShell *eshell);
+GtkType e_shell_view_get_type (void);
+
+void e_shell_view_new_folder (EShellView *esv);
+void e_shell_view_new_shortcut (EShellView *esv);
+
+#endif /* E_SHELL_VIEW_H */
diff --git a/shell/e-shell.c b/shell/e-shell.c
index 805d207406..b066985b1c 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -8,7 +8,8 @@
* (C) 2000 Helix Code, Inc.
*/
#include <config.h>
-#include "Shell.h"
+#include <gtk/gtkmain.h>
+#include "Evolution.h"
#include "e-util/e-util.h"
#include "e-shell.h"
@@ -19,6 +20,108 @@ POA_GNOME_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 GNOME_Evolution_Shell_NewType type,
+ CORBA_Environment *ev)
+{
+ EShell *eshell = E_SHELL (gnome_object_from_servant (servant));
+
+ switch (type){
+ case GNOME_Evolution_Shell_APPOINTMENT:
+ e_shell_new_appointment (eshell);
+ break;
+
+ case GNOME_Evolution_Shell_MEETING_REQUEST:
+ e_shell_new_meeting_request (eshell);
+ break;
+
+ case GNOME_Evolution_Shell_TASK:
+ e_shell_new_task (eshell);
+ break;
+
+ case GNOME_Evolution_Shell_TASK_REQUEST:
+ e_shell_new_task_request (eshell);
+ break;
+
+ case GNOME_Evolution_Shell_CONTACT:
+ e_shell_new_contact (eshell);
+ break;
+
+ case GNOME_Evolution_Shell_MAIL_MESSAGE:
+ e_shell_new_mail_message (eshell);
+ break;
+
+ case GNOME_Evolution_Shell_DISTRIBUTION_LIST:
+ e_shell_new_distribution_list (eshell);
+ break;
+
+ case GNOME_Evolution_Shell_JOURNAL_ENTRY:
+ e_shell_new_journal_entry (eshell);
+ break;
+
+ case GNOME_Evolution_Shell_NOTE:
+ e_shell_new_note (eshell);
+ break;
+
+ default:
+ }
+}
+
static POA_GNOME_Evolution_Shell__epv *
e_shell_get_epv (void)
{
@@ -26,6 +129,8 @@ e_shell_get_epv (void)
epv = g_new0 (POA_GNOME_Evolution_Shell__epv, 1);
+ epv->new = EShell_cmd_new;
+
return epv;
}
@@ -39,11 +144,6 @@ init_e_shell_corba_class (void)
static void
e_shell_destroy (GtkObject *object)
{
- EShell *eshell = E_SHELL (object);
-
- if (eshell->base_uri)
- g_free (eshell->base_uri);
-
GTK_OBJECT_CLASS (e_shell_parent_class)->destroy (object);
}
@@ -57,47 +157,102 @@ e_shell_class_init (GtkObjectClass *object_class)
}
static void
-e_shell_init (GtkObject *object)
+e_shell_destroy_views (EShell *eshell)
{
+ GSList *l;
+
+ for (l = eshell->views; l; l = l->next){
+ EShellView *view = l->data;
+
+ gtk_object_destroy (GTK_OBJECT (view));
+ }
}
void
-e_shell_set_base_uri (EShell *eshell, const char *base_uri)
+e_shell_quit (EShell *eshell)
{
g_return_if_fail (eshell != NULL);
- g_return_if_fail (!E_IS_SHELL (eshell));
- g_return_if_fail (base_uri != NULL);
+ g_return_if_fail (E_IS_SHELL (eshell));
- if (eshell->base_uri)
- g_free (eshell->base_uri);
+ e_shell_destroy_views (eshell);
- eshell->base_uri = g_strdup (base_uri);
+ gtk_main_quit ();
+}
+
+static CORBA_Object
+create_corba_eshell (GnomeObject *object)
+{
+ POA_GNOME_Evolution_Shell *servant;
+ CORBA_Environment ev;
+
+ servant = (POA_GNOME_Evolution_Shell *)g_new0 (GnomeObjectServant, 1);
+ servant->vepv = &eshell_vepv;
+
+ CORBA_exception_init (&ev);
+
+ POA_GNOME_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 gnome_object_activate_servant (object, servant);
}
-const char *
-e_shell_get_base_uri (EShell *eshell)
+static void
+e_shell_init (GtkObject *object)
{
- g_return_val_if_fail (eshell != NULL, NULL);
- g_return_val_if_fail (!E_IS_SHELL (eshell), NULL);
+}
- return eshell->base_uri;
+static void
+e_shell_construct (EShell *eshell, GNOME_Evolution_Shell corba_eshell)
+{
+ gnome_object_construct (GNOME_OBJECT (eshell), corba_eshell);
}
EShell *
-e_shell_new (const char *base_uri)
+e_shell_new (void)
{
+ GNOME_Evolution_Shell corba_eshell;
EShell *eshell;
- g_return_val_if_fail (base_uri != NULL, NULL);
-
eshell = gtk_type_new (e_shell_get_type ());
- e_shell_set_base_uri (eshell, base_uri);
+ corba_eshell = create_corba_eshell (GNOME_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
index dd408f40dd..c8d59d31b7 100644
--- a/shell/e-shell.h
+++ b/shell/e-shell.h
@@ -2,6 +2,7 @@
#define E_SHELL_H
#include <bonobo/gnome-object.h>
+#include "evolution.h"
#define E_SHELL_GOAD_ID "GOADID:GNOME:Evolution:Shell:1.0"
#define E_SHELL_FACTORY_GOAD_ID "GOADID:GNOME:Evolution:ShellFactory:1.0"
@@ -12,18 +13,34 @@
#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))
-typedef struct {
+struct _EShell {
GnomeObject base_object;
- char *base_uri;
-} EShell;
+ /* A list of EShellViews */
+ GSList *views;
+};
typedef struct {
- GnomeObjectClass *parent_class;
+ GnomeObjectClass parent_class;
} EShellClass;
-EShell *e_shell_new (const char *base_uri);
-void e_shell_set_base_uri (EShell *eshell, const char *base_uri);
-const char *e_shell_get_base_uri (EShell *eshell);
+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/main.c b/shell/main.c
index 76375375dd..97a5987049 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -13,47 +13,81 @@
#include <e-util/e-cursors.h>
#include <glade/glade.h>
#include <glade/glade-xml.h>
+#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 }
};
-int
-main (int argc, char *argv [])
+static void
+corba_init (int *argc, char *argv [])
{
CORBA_Environment ev;
- bindtextdomain (PACKAGE, EVOLUTION_LOCALEDIR);
- textdomain (PACKAGE);
-
CORBA_exception_init (&ev);
gnome_CORBA_init_with_popt_table (
- "Evolution", VERSION, &argc, argv,
+ "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"));
- return 0;
+ exit (1);
}
+}
+static void
+gui_init (void)
+{
e_cursors_init ();
glade_gnome_init ();
bonobo_activate ();
+}
- gtk_main ();
-
+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));
+
+ 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;
}