[evolution/kill-bonobo: 42/43] Use the proper idiom for loading types in a GTypeModule.



commit 5eb12906c4242a576ad6fac4d229f096d3aab17a
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sun May 10 13:18:28 2009 -0400

    Use the proper idiom for loading types in a GTypeModule.
    
    Also, combine calendar, memo, and task backends into a single module,
    similar to how it worked under Bonobo.
---
 addressbook/gui/component/Makefile.am              |   47 +++++++-------
 addressbook/gui/component/e-book-shell-backend.c   |   67 ++++++++------------
 addressbook/gui/component/e-book-shell-backend.h   |    7 +-
 addressbook/gui/component/e-book-shell-content.c   |   46 +++++++-------
 addressbook/gui/component/e-book-shell-content.h   |   34 ++++++-----
 addressbook/gui/component/e-book-shell-sidebar.c   |   43 +++++++------
 addressbook/gui/component/e-book-shell-sidebar.h   |   10 ++-
 .../gui/component/e-book-shell-view-private.c      |    6 +-
 .../gui/component/e-book-shell-view-private.h      |    2 +-
 addressbook/gui/component/e-book-shell-view.c      |   45 +++++++-------
 addressbook/gui/component/e-book-shell-view.h      |    9 +--
 .../gui/component/evolution-module-addressbook.c   |   35 ++++++----
 calendar/Makefile.am                               |    2 +-
 calendar/{modules => module}/Makefile.am           |   32 +++-------
 calendar/{modules => module}/e-cal-shell-backend.c |   63 +++++++-----------
 calendar/{modules => module}/e-cal-shell-backend.h |    7 +-
 calendar/{modules => module}/e-cal-shell-content.c |   45 +++++++-------
 calendar/{modules => module}/e-cal-shell-content.h |   26 +++++---
 calendar/{modules => module}/e-cal-shell-migrate.c |    0
 calendar/{modules => module}/e-cal-shell-migrate.h |    0
 .../{modules => module}/e-cal-shell-settings.c     |    0
 .../{modules => module}/e-cal-shell-settings.h     |    0
 calendar/{modules => module}/e-cal-shell-sidebar.c |   43 +++++++------
 calendar/{modules => module}/e-cal-shell-sidebar.h |   23 ++++---
 .../{modules => module}/e-cal-shell-view-actions.c |    0
 .../{modules => module}/e-cal-shell-view-actions.h |    0
 .../{modules => module}/e-cal-shell-view-memopad.c |    0
 .../{modules => module}/e-cal-shell-view-private.c |    0
 .../{modules => module}/e-cal-shell-view-private.h |    0
 .../{modules => module}/e-cal-shell-view-taskpad.c |    0
 calendar/{modules => module}/e-cal-shell-view.c    |   45 +++++++-------
 calendar/{modules => module}/e-cal-shell-view.h    |   11 +--
 .../{modules => module}/e-memo-shell-backend.c     |   61 +++++++-----------
 .../{modules => module}/e-memo-shell-backend.h     |    7 +-
 .../{modules => module}/e-memo-shell-content.c     |   43 +++++++------
 .../{modules => module}/e-memo-shell-content.h     |   20 +++---
 .../{modules => module}/e-memo-shell-migrate.c     |    0
 .../{modules => module}/e-memo-shell-migrate.h     |    0
 .../{modules => module}/e-memo-shell-sidebar.c     |   43 +++++++------
 .../{modules => module}/e-memo-shell-sidebar.h     |   15 +++--
 .../e-memo-shell-view-actions.c                    |    0
 .../e-memo-shell-view-actions.h                    |    0
 .../e-memo-shell-view-private.c                    |    0
 .../e-memo-shell-view-private.h                    |    0
 calendar/{modules => module}/e-memo-shell-view.c   |   47 +++++++-------
 calendar/{modules => module}/e-memo-shell-view.h   |    7 +-
 .../{modules => module}/e-task-shell-backend.c     |   63 +++++++-----------
 .../{modules => module}/e-task-shell-backend.h     |    7 +-
 .../{modules => module}/e-task-shell-content.c     |   43 +++++++------
 .../{modules => module}/e-task-shell-content.h     |   20 +++---
 .../{modules => module}/e-task-shell-migrate.c     |    0
 .../{modules => module}/e-task-shell-migrate.h     |    0
 .../{modules => module}/e-task-shell-sidebar.c     |   43 +++++++------
 .../{modules => module}/e-task-shell-sidebar.h     |   18 +++--
 .../e-task-shell-view-actions.c                    |    0
 .../e-task-shell-view-actions.h                    |    0
 .../e-task-shell-view-private.c                    |    2 +-
 .../e-task-shell-view-private.h                    |    0
 calendar/{modules => module}/e-task-shell-view.c   |   47 +++++++-------
 calendar/{modules => module}/e-task-shell-view.h   |    7 +-
 calendar/module/evolution-module-calendar.c        |   65 +++++++++++++++++++
 configure.in                                       |    2 +-
 mail/Makefile.am                                   |    5 +-
 mail/e-mail-shell-backend.c                        |   56 ++++++----------
 mail/e-mail-shell-backend.h                        |    7 +-
 mail/e-mail-shell-content.c                        |   62 +++++++++---------
 mail/e-mail-shell-content.h                        |   30 +++++----
 mail/e-mail-shell-sidebar.c                        |   43 +++++++------
 mail/e-mail-shell-sidebar.h                        |    6 +-
 mail/e-mail-shell-view-private.c                   |    2 +-
 mail/e-mail-shell-view.c                           |   45 +++++++-------
 mail/e-mail-shell-view.h                           |   10 +--
 .../evolution-module-mail.c                        |   35 ++++++----
 shell/test/Makefile.am                             |    9 ++-
 shell/test/e-test-shell-backend.c                  |   61 +++++++-----------
 shell/test/e-test-shell-backend.h                  |   10 ++--
 shell/test/e-test-shell-view.c                     |   49 +++++++-------
 shell/test/e-test-shell-view.h                     |    9 +--
 .../test/evolution-module-test.c                   |   31 +++++----
 79 files changed, 846 insertions(+), 832 deletions(-)

diff --git a/addressbook/gui/component/Makefile.am b/addressbook/gui/component/Makefile.am
index 4f89f82..e48ef46 100644
--- a/addressbook/gui/component/Makefile.am
+++ b/addressbook/gui/component/Makefile.am
@@ -20,35 +20,36 @@ INCLUDES =							\
 	$(LDAP_CFLAGS)						\
 	$(EVOLUTION_ADDRESSBOOK_CFLAGS)
 
-module_LTLIBRARIES = libevolution-module-contacts.la
-
-libevolution_module_contacts_la_SOURCES = 	\
-	addressbook-config.c		\
-	addressbook-config.h		\
-	autocompletion-config.c		\
-	autocompletion-config.h		\
-	eab-composer-util.c		\
-	eab-composer-util.h		\
-	e-book-shell-backend.c		\
-	e-book-shell-backend.h		\
-	e-book-shell-content.c		\
-	e-book-shell-content.h		\
-	e-book-shell-migrate.c		\
-	e-book-shell-migrate.h		\
-	e-book-shell-sidebar.c		\
-	e-book-shell-sidebar.h		\
-	e-book-shell-view.c		\
-	e-book-shell-view.h		\
-	e-book-shell-view-actions.c	\
-	e-book-shell-view-actions.h	\
-	e-book-shell-view-private.c	\
+module_LTLIBRARIES = libevolution-module-addressbook.la
+
+libevolution_module_addressbook_la_SOURCES = \
+	evolution-module-addressbook.c				\
+	addressbook-config.c					\
+	addressbook-config.h					\
+	autocompletion-config.c					\
+	autocompletion-config.h					\
+	eab-composer-util.c					\
+	eab-composer-util.h					\
+	e-book-shell-backend.c					\
+	e-book-shell-backend.h					\
+	e-book-shell-content.c					\
+	e-book-shell-content.h					\
+	e-book-shell-migrate.c					\
+	e-book-shell-migrate.h					\
+	e-book-shell-sidebar.c					\
+	e-book-shell-sidebar.h					\
+	e-book-shell-view.c					\
+	e-book-shell-view.h					\
+	e-book-shell-view-actions.c				\
+	e-book-shell-view-actions.h				\
+	e-book-shell-view-private.c				\
 	e-book-shell-view-private.h
 
 if ENABLE_SMIME
 SMIME_LIB=$(top_builddir)/smime/gui/libevolution-smime.la
 endif
 
-libevolution_module_contacts_la_LIBADD =							\
+libevolution_module_addressbook_la_LIBADD =						\
 	$(SMIME_LIB)									\
 	$(top_builddir)/e-util/libeutil.la						\
 	$(top_builddir)/composer/libcomposer.la					\
@@ -70,7 +71,7 @@ libevolution_module_contacts_la_LIBADD =							\
 	$(EVOLUTION_ADDRESSBOOK_LIBS) $(LDAP_LIBS)
 
 
-libevolution_module_contacts_la_LDFLAGS = \
+libevolution_module_addressbook_la_LDFLAGS = \
 	-module -avoid-version $(NO_UNDEFINED)
 
 # GConf schemas
diff --git a/addressbook/gui/component/e-book-shell-backend.c b/addressbook/gui/component/e-book-shell-backend.c
index 3e104c3..fd86d57 100644
--- a/addressbook/gui/component/e-book-shell-backend.c
+++ b/addressbook/gui/component/e-book-shell-backend.c
@@ -39,9 +39,9 @@
 #include "addressbook/gui/contact-list-editor/e-contact-list-editor.h"
 #include "addressbook/importers/evolution-addressbook-importers.h"
 
-#include <eab-config.h>
-#include <addressbook-config.h>
-#include <autocompletion-config.h>
+#include "eab-config.h"
+#include "addressbook-config.h"
+#include "autocompletion-config.h"
 
 #include "e-book-shell-migrate.h"
 #include "e-book-shell-view.h"
@@ -67,12 +67,8 @@ enum {
 	PROP_SOURCE_LIST
 };
 
-/* Module Entry Points */
-void e_module_load (GTypeModule *type_module);
-void e_module_unload (GTypeModule *type_module);
-
-GType e_book_shell_backend_type = 0;
 static gpointer parent_class;
+static GType book_shell_backend_type;
 
 static void
 book_shell_backend_ensure_sources (EShellBackend *shell_backend)
@@ -544,29 +540,30 @@ book_shell_backend_init (EBookShellBackend *book_shell_backend)
 }
 
 GType
-e_book_shell_backend_get_type (GTypeModule *type_module)
+e_book_shell_backend_get_type (void)
 {
-	if (e_book_shell_backend_type == 0) {
-		const GTypeInfo type_info = {
-			sizeof (EBookShellBackendClass),
-			(GBaseInitFunc) NULL,
-			(GBaseFinalizeFunc) NULL,
-			(GClassInitFunc) book_shell_backend_class_init,
-			(GClassFinalizeFunc) NULL,
-			NULL,  /* class_data */
-			sizeof (EBookShellBackend),
-			0,     /* n_preallocs */
-			(GInstanceInitFunc) book_shell_backend_init,
-			NULL   /* value_table */
-		};
-
-		e_book_shell_backend_type =
-			g_type_module_register_type (
-				type_module, E_TYPE_SHELL_BACKEND,
-				"EBookShellBackend", &type_info, 0);
-	}
+	return book_shell_backend_type;
+}
 
-	return e_book_shell_backend_type;
+void
+e_book_shell_backend_register_type (GTypeModule *type_module)
+{
+	const GTypeInfo type_info = {
+		sizeof (EBookShellBackendClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) book_shell_backend_class_init,
+		(GClassFinalizeFunc) NULL,
+		NULL,  /* class_data */
+		sizeof (EBookShellBackend),
+		0,     /* n_preallocs */
+		(GInstanceInitFunc) book_shell_backend_init,
+		NULL   /* value_table */
+	};
+
+	book_shell_backend_type = g_type_module_register_type (
+		type_module, E_TYPE_SHELL_BACKEND,
+		"EBookShellBackend", &type_info, 0);
 }
 
 ESourceList *
@@ -577,15 +574,3 @@ e_book_shell_backend_get_source_list (EBookShellBackend *book_shell_backend)
 
 	return book_shell_backend->priv->source_list;
 }
-
-void
-e_module_load (GTypeModule *type_module)
-{
-	e_book_shell_backend_get_type (type_module);
-	e_book_shell_view_get_type (type_module);
-}
-
-void
-e_module_unload (GTypeModule *type_module)
-{
-}
diff --git a/addressbook/gui/component/e-book-shell-backend.h b/addressbook/gui/component/e-book-shell-backend.h
index 9a5e744..c3fde1c 100644
--- a/addressbook/gui/component/e-book-shell-backend.h
+++ b/addressbook/gui/component/e-book-shell-backend.h
@@ -27,7 +27,7 @@
 
 /* Standard GObject macros */
 #define E_TYPE_BOOK_SHELL_BACKEND \
-	(e_book_shell_backend_type)
+	(e_book_shell_backend_get_type ())
 #define E_BOOK_SHELL_BACKEND(obj) \
 	(G_TYPE_CHECK_INSTANCE_CAST \
 	((obj), E_TYPE_BOOK_SHELL_BACKEND, EBookShellBackend))
@@ -46,8 +46,6 @@
 
 G_BEGIN_DECLS
 
-extern GType e_book_shell_backend_type;
-
 typedef struct _EBookShellBackend EBookShellBackend;
 typedef struct _EBookShellBackendClass EBookShellBackendClass;
 typedef struct _EBookShellBackendPrivate EBookShellBackendPrivate;
@@ -61,7 +59,8 @@ struct _EBookShellBackendClass {
 	EShellBackendClass parent_class;
 };
 
-GType		e_book_shell_backend_get_type
+GType		e_book_shell_backend_get_type	(void);
+void		e_book_shell_backend_register_type
 					(GTypeModule *type_module);
 ESourceList *	e_book_shell_backend_get_source_list
 					(EBookShellBackend *book_shell_backend);
diff --git a/addressbook/gui/component/e-book-shell-content.c b/addressbook/gui/component/e-book-shell-content.c
index 8830c79..7f7b948 100644
--- a/addressbook/gui/component/e-book-shell-content.c
+++ b/addressbook/gui/component/e-book-shell-content.c
@@ -22,7 +22,8 @@
 #include "e-book-shell-content.h"
 
 #include <glib/gi18n.h>
-#include <e-util/gconf-bridge.h>
+
+#include "e-util/gconf-bridge.h"
 
 #define E_BOOK_SHELL_CONTENT_GET_PRIVATE(obj) \
 	(G_TYPE_INSTANCE_GET_PRIVATE \
@@ -42,6 +43,7 @@ enum {
 };
 
 static gpointer parent_class;
+static GType book_shell_view_type;
 
 static void
 book_shell_content_send_message_cb (EBookShellContent *book_shell_content,
@@ -296,28 +298,28 @@ book_shell_content_init (EBookShellContent *book_shell_content)
 GType
 e_book_shell_content_get_type (void)
 {
-	static GType type = 0;
-
-	if (G_UNLIKELY (type == 0)) {
-		static const GTypeInfo type_info = {
-			sizeof (EBookShellContentClass),
-			(GBaseInitFunc) NULL,
-			(GBaseFinalizeFunc) NULL,
-			(GClassInitFunc) book_shell_content_class_init,
-			(GClassFinalizeFunc) NULL,
-			NULL,  /* class_data */
-			sizeof (EBookShellContent),
-			0,     /* n_preallocs */
-			(GInstanceInitFunc) book_shell_content_init,
-			NULL   /* value_table */
-		};
-
-		type = g_type_register_static (
-			E_TYPE_SHELL_CONTENT, "EBookShellContent",
-			&type_info, 0);
-	}
+	return book_shell_view_type;
+}
 
-	return type;
+void
+e_book_shell_content_register_type (GTypeModule *type_module)
+{
+	static const GTypeInfo type_info = {
+		sizeof (EBookShellContentClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) book_shell_content_class_init,
+		(GClassFinalizeFunc) NULL,
+		NULL,  /* class_data */
+		sizeof (EBookShellContent),
+		0,     /* n_preallocs */
+		(GInstanceInitFunc) book_shell_content_init,
+		NULL   /* value_table */
+	};
+
+	book_shell_view_type = g_type_module_register_type (
+		type_module, E_TYPE_SHELL_CONTENT,
+		"EBookShellContent", &type_info, 0);
 }
 
 GtkWidget *
diff --git a/addressbook/gui/component/e-book-shell-content.h b/addressbook/gui/component/e-book-shell-content.h
index e8fe856..a8f8271 100644
--- a/addressbook/gui/component/e-book-shell-content.h
+++ b/addressbook/gui/component/e-book-shell-content.h
@@ -77,29 +77,33 @@ struct _EBookShellContentClass {
 };
 
 GType		e_book_shell_content_get_type	(void);
-GtkWidget *	e_book_shell_content_new	(EShellView *shell_view);
-void		e_book_shell_content_insert_view(EBookShellContent *book_shell_content,
-						 EAddressbookView *addressbook_view);
-void		e_book_shell_content_remove_view(EBookShellContent *book_shell_content,
-						 EAddressbookView *addressbook_view);
+void		e_book_shell_content_register_type
+					(GTypeModule *type_module);
+GtkWidget *	e_book_shell_content_new(EShellView *shell_view);
+void		e_book_shell_content_insert_view
+					(EBookShellContent *book_shell_content,
+					 EAddressbookView *addressbook_view);
+void		e_book_shell_content_remove_view
+					(EBookShellContent *book_shell_content,
+					 EAddressbookView *addressbook_view);
 EAddressbookView *
 		e_book_shell_content_get_current_view
-						(EBookShellContent *book_shell_content);
+					(EBookShellContent *book_shell_content);
 void		e_book_shell_content_set_current_view
-						(EBookShellContent *book_shell_content,
-						 EAddressbookView *addressbook_view);
+					(EBookShellContent *book_shell_content,
+					 EAddressbookView *addressbook_view);
 EContact *	e_book_shell_content_get_preview_contact
-						(EBookShellContent *book_shell_content);
+					(EBookShellContent *book_shell_content);
 void		e_book_shell_content_set_preview_contact
-						(EBookShellContent *book_shell_content,
-						 EContact *preview_contact);
+					(EBookShellContent *book_shell_content,
+					 EContact *preview_contact);
 gboolean	e_book_shell_content_get_preview_visible
-						(EBookShellContent *book_shell_content);
+					(EBookShellContent *book_shell_content);
 void		e_book_shell_content_set_preview_visible
-						(EBookShellContent *book_shell_content,
-						 gboolean preview_visible);
+					(EBookShellContent *book_shell_content,
+					 gboolean preview_visible);
 void		e_book_shell_content_clipboard_copy
-						(EBookShellContent *book_shell_content);
+					(EBookShellContent *book_shell_content);
 
 G_END_DECLS
 
diff --git a/addressbook/gui/component/e-book-shell-sidebar.c b/addressbook/gui/component/e-book-shell-sidebar.c
index f804b5a..2a784e3 100644
--- a/addressbook/gui/component/e-book-shell-sidebar.c
+++ b/addressbook/gui/component/e-book-shell-sidebar.c
@@ -42,6 +42,7 @@ enum {
 };
 
 static gpointer parent_class;
+static GType book_shell_sidebar_type;
 
 static void
 book_shell_sidebar_get_property (GObject *object,
@@ -187,28 +188,28 @@ book_shell_sidebar_init (EBookShellSidebar *book_shell_sidebar)
 GType
 e_book_shell_sidebar_get_type (void)
 {
-	static GType type = 0;
-
-	if (G_UNLIKELY (type == 0)) {
-		static const GTypeInfo type_info = {
-			sizeof (EBookShellSidebarClass),
-			(GBaseInitFunc) NULL,
-			(GBaseFinalizeFunc) NULL,
-			(GClassInitFunc) book_shell_sidebar_class_init,
-			(GClassFinalizeFunc) NULL,
-			NULL,  /* class_data */
-			sizeof (EBookShellSidebar),
-			0,     /* n_preallocs */
-			(GInstanceInitFunc) book_shell_sidebar_init,
-			NULL   /* value_table */
-		};
-
-		type = g_type_register_static (
-			E_TYPE_SHELL_SIDEBAR, "EBookShellSidebar",
-			&type_info, 0);
-	}
+	return book_shell_sidebar_type;
+}
 
-	return type;
+void
+e_book_shell_sidebar_register_type (GTypeModule *type_module)
+{
+	static const GTypeInfo type_info = {
+		sizeof (EBookShellSidebarClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) book_shell_sidebar_class_init,
+		(GClassFinalizeFunc) NULL,
+		NULL,  /* class_data */
+		sizeof (EBookShellSidebar),
+		0,     /* n_preallocs */
+		(GInstanceInitFunc) book_shell_sidebar_init,
+		NULL   /* value_table */
+	};
+
+	book_shell_sidebar_type = g_type_module_register_type (
+		type_module, E_TYPE_SHELL_SIDEBAR,
+		"EBookShellSidebar", &type_info, 0);
 }
 
 GtkWidget *
diff --git a/addressbook/gui/component/e-book-shell-sidebar.h b/addressbook/gui/component/e-book-shell-sidebar.h
index 159c9c7..e2523f5 100644
--- a/addressbook/gui/component/e-book-shell-sidebar.h
+++ b/addressbook/gui/component/e-book-shell-sidebar.h
@@ -24,8 +24,8 @@
 
 #include <libedataserverui/e-source-selector.h>
 
-#include <e-shell-sidebar.h>
-#include <e-shell-view.h>
+#include <shell/e-shell-sidebar.h>
+#include <shell/e-shell-view.h>
 
 /* Standard GObject macros */
 #define E_TYPE_BOOK_SHELL_SIDEBAR \
@@ -67,10 +67,12 @@ struct _EBookShellSidebarClass {
 };
 
 GType		e_book_shell_sidebar_get_type	(void);
-GtkWidget *	e_book_shell_sidebar_new	(EShellView *shell_view);
+void		e_book_shell_sidebar_register_type
+					(GTypeModule *type_module);
+GtkWidget *	e_book_shell_sidebar_new(EShellView *shell_view);
 ESourceSelector *
 		e_book_shell_sidebar_get_selector
-						(EBookShellSidebar *book_shell_sidebar);
+					(EBookShellSidebar *book_shell_sidebar);
 
 G_END_DECLS
 
diff --git a/addressbook/gui/component/e-book-shell-view-private.c b/addressbook/gui/component/e-book-shell-view-private.c
index 5f9bb4c..cdb8c8f 100644
--- a/addressbook/gui/component/e-book-shell-view-private.c
+++ b/addressbook/gui/component/e-book-shell-view-private.c
@@ -21,10 +21,10 @@
 
 #include "e-book-shell-view-private.h"
 
-#include <gal-view-factory-etable.h>
-#include <gal-view-factory-minicard.h>
+#include "widgets/menus/gal-view-factory-etable.h"
+#include "addressbook/gui/widgets/gal-view-factory-minicard.h"
 
-#include <addressbook.h>
+#include "addressbook.h"
 
 static void
 open_contact (EBookShellView *book_shell_view,
diff --git a/addressbook/gui/component/e-book-shell-view-private.h b/addressbook/gui/component/e-book-shell-view-private.h
index f93b720..628c1c2 100644
--- a/addressbook/gui/component/e-book-shell-view-private.h
+++ b/addressbook/gui/component/e-book-shell-view-private.h
@@ -35,7 +35,7 @@
 #include "e-util/gconf-bridge.h"
 #include "shell/e-shell-content.h"
 #include "shell/e-shell-sidebar.h"
-#include "widgets/misc/e-popup-action.h"
+#include "misc/e-popup-action.h"
 
 #include "addressbook/gui/contact-editor/e-contact-editor.h"
 #include "addressbook/gui/contact-list-editor/e-contact-list-editor.h"
diff --git a/addressbook/gui/component/e-book-shell-view.c b/addressbook/gui/component/e-book-shell-view.c
index 7520c1e..44c06be 100644
--- a/addressbook/gui/component/e-book-shell-view.c
+++ b/addressbook/gui/component/e-book-shell-view.c
@@ -21,8 +21,8 @@
 
 #include "e-book-shell-view-private.h"
 
-GType e_book_shell_view_type = 0;
 static gpointer parent_class;
+static GType book_shell_view_type;
 
 static void
 book_shell_view_source_list_changed_cb (EBookShellView *book_shell_view,
@@ -291,27 +291,28 @@ book_shell_view_init (EBookShellView *book_shell_view,
 }
 
 GType
-e_book_shell_view_get_type (GTypeModule *type_module)
+e_book_shell_view_get_type (void)
 {
-	if (e_book_shell_view_type == 0) {
-		const GTypeInfo type_info = {
-			sizeof (EBookShellViewClass),
-			(GBaseInitFunc) NULL,
-			(GBaseFinalizeFunc) NULL,
-			(GClassInitFunc) book_shell_view_class_init,
-			(GClassFinalizeFunc) NULL,
-			NULL,  /* class_data */
-			sizeof (EBookShellView),
-			0,     /* n_preallocs */
-			(GInstanceInitFunc) book_shell_view_init,
-			NULL   /* value_table */
-		};
-
-		e_book_shell_view_type =
-			g_type_module_register_type (
-				type_module, E_TYPE_SHELL_VIEW,
-				"EBookShellView", &type_info, 0);
-	}
+	return book_shell_view_type;
+}
 
-	return e_book_shell_view_type;
+void
+e_book_shell_view_register_type (GTypeModule *type_module)
+{
+	const GTypeInfo type_info = {
+		sizeof (EBookShellViewClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) book_shell_view_class_init,
+		(GClassFinalizeFunc) NULL,
+		NULL,  /* class_data */
+		sizeof (EBookShellView),
+		0,     /* n_preallocs */
+		(GInstanceInitFunc) book_shell_view_init,
+		NULL   /* value_table */
+	};
+
+	book_shell_view_type = g_type_module_register_type (
+		type_module, E_TYPE_SHELL_VIEW,
+		"EBookShellView", &type_info, 0);
 }
diff --git a/addressbook/gui/component/e-book-shell-view.h b/addressbook/gui/component/e-book-shell-view.h
index c0b5a44..3cefba8 100644
--- a/addressbook/gui/component/e-book-shell-view.h
+++ b/addressbook/gui/component/e-book-shell-view.h
@@ -22,11 +22,11 @@
 #ifndef E_BOOK_SHELL_VIEW_H
 #define E_BOOK_SHELL_VIEW_H
 
-#include <e-shell-view.h>
+#include <shell/e-shell-view.h>
 
 /* Standard GObject macros */
 #define E_TYPE_BOOK_SHELL_VIEW \
-	(e_book_shell_view_type)
+	(e_book_shell_view_get_type ())
 #define E_BOOK_SHELL_VIEW(obj) \
 	(G_TYPE_CHECK_INSTANCE_CAST \
 	((obj), E_TYPE_BOOK_SHELL_VIEW, EBookShellView))
@@ -45,8 +45,6 @@
 
 G_BEGIN_DECLS
 
-extern GType e_book_shell_view_type;
-
 typedef struct _EBookShellView EBookShellView;
 typedef struct _EBookShellViewClass EBookShellViewClass;
 typedef struct _EBookShellViewPrivate EBookShellViewPrivate;
@@ -60,7 +58,8 @@ struct _EBookShellViewClass {
 	EShellViewClass parent_class;
 };
 
-GType		e_book_shell_view_get_type	(GTypeModule *type_module);
+GType		e_book_shell_view_get_type	(void);
+void		e_book_shell_view_register_type	(GTypeModule *type_module);
 
 G_END_DECLS
 
diff --git a/calendar/modules/e-cal-shell-migrate.h b/addressbook/gui/component/evolution-module-addressbook.c
similarity index 53%
copy from calendar/modules/e-cal-shell-migrate.h
copy to addressbook/gui/component/evolution-module-addressbook.c
index 44cbf68..fb33f7d 100644
--- a/calendar/modules/e-cal-shell-migrate.h
+++ b/addressbook/gui/component/evolution-module-addressbook.c
@@ -1,5 +1,5 @@
 /*
- * e-cal-shell-backend-migrate.h
+ * evolution-module-addressbook.c
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -19,20 +19,27 @@
  *
  */
 
-#ifndef E_CAL_SHELL_BACKEND_MIGRATE_H
-#define E_CAL_SHELL_BACKEND_MIGRATE_H
+#include "e-book-shell-backend.h"
+#include "e-book-shell-content.h"
+#include "e-book-shell-sidebar.h"
+#include "e-book-shell-view.h"
 
-#include <glib.h>
-#include <shell/e-shell-backend.h>
+/* Module Entry Points */
+void e_module_load (GTypeModule *type_module);
+void e_module_unload (GTypeModule *type_module);
 
-G_BEGIN_DECLS
+void
+e_module_load (GTypeModule *type_module)
+{
+	/* Register dynamically loaded types. */
 
-gboolean	e_cal_shell_backend_migrate	(EShellBackend *shell_backend,
-						 gint major,
-						 gint minor,
-						 gint micro,
-						 GError **error);
+	e_book_shell_backend_register_type (type_module);
+	e_book_shell_content_register_type (type_module);
+	e_book_shell_sidebar_register_type (type_module);
+	e_book_shell_view_register_type (type_module);
+}
 
-G_END_DECLS
-
-#endif /* E_CAL_SHELL_BACKEND_MIGRATE_H */
+void
+e_module_unload (GTypeModule *type_module)
+{
+}
diff --git a/calendar/Makefile.am b/calendar/Makefile.am
index 20f45f6..5da5338 100644
--- a/calendar/Makefile.am
+++ b/calendar/Makefile.am
@@ -4,7 +4,7 @@ else
 CONDUIT_DIR =
 endif
 
-SUBDIRS = idl common importers gui $(CONDUIT_DIR) modules
+SUBDIRS = idl common importers gui $(CONDUIT_DIR) module
 
 error_DATA = calendar.error
 errordir = $(privdatadir)/errors
diff --git a/calendar/modules/Makefile.am b/calendar/module/Makefile.am
similarity index 71%
rename from calendar/modules/Makefile.am
rename to calendar/module/Makefile.am
index f96ea2b..ca2a4b4 100644
--- a/calendar/modules/Makefile.am
+++ b/calendar/module/Makefile.am
@@ -5,16 +5,11 @@ INCLUDES =						\
 	-DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\"	\
 	$(EVOLUTION_CALENDAR_CFLAGS)
 
-#module_LTLIBRARIES =					\
-#	libevolution-module-memos.la			\
-#	libevolution-module-tasks.la
-
 module_LTLIBRARIES =					\
-	libevolution-module-calendars.la		\
-	libevolution-module-memos.la			\
-	libevolution-module-tasks.la
+	libevolution-module-calendar.la
 
-libevolution_module_calendars_la_SOURCES =		\
+libevolution_module_calendar_la_SOURCES =		\
+	evolution-module-calendar.c			\
 	e-cal-shell-backend.c				\
 	e-cal-shell-backend.h				\
 	e-cal-shell-content.c				\
@@ -32,9 +27,7 @@ libevolution_module_calendars_la_SOURCES =		\
 	e-cal-shell-view-memopad.c			\
 	e-cal-shell-view-private.c			\
 	e-cal-shell-view-private.h			\
-	e-cal-shell-view-taskpad.c
-
-libevolution_module_memos_la_SOURCES =			\
+	e-cal-shell-view-taskpad.c			\
 	e-memo-shell-backend.c				\
 	e-memo-shell-backend.h				\
 	e-memo-shell-content.c				\
@@ -48,9 +41,7 @@ libevolution_module_memos_la_SOURCES =			\
 	e-memo-shell-view-actions.c			\
 	e-memo-shell-view-actions.h			\
 	e-memo-shell-view-private.c			\
-	e-memo-shell-view-private.h
-
-libevolution_module_tasks_la_SOURCES =			\
+	e-memo-shell-view-private.h			\
 	e-task-shell-backend.c				\
 	e-task-shell-backend.h				\
 	e-task-shell-content.c				\
@@ -69,19 +60,12 @@ libevolution_module_tasks_la_SOURCES =			\
 # Removed from all three
 #	$(top_builddir)/a11y/calendar/libevolution-calendar-a11y.la
 
-libevolution_module_calendars_la_LIBADD =		\
+libevolution_module_calendar_la_LIBADD =		\
 	$(WIN32_BOOTSTRAP_LIBS)				\
 	$(top_builddir)/shell/libeshell.la		\
 	$(top_builddir)/calendar/gui/libcal-gui.la	\
 	$(top_builddir)/mail/libevolution-module-mail.la \
 	$(top_builddir)/addressbook/gui/contact-editor/libecontacteditor.la
 
-libevolution_module_memos_la_LIBADD =			\
-	$(WIN32_BOOTSTRAP_LIBS)				\
-	$(top_builddir)/shell/libeshell.la		\
-	$(top_builddir)/calendar/gui/libcal-gui.la
-
-libevolution_module_tasks_la_LIBADD =			\
-	$(WIN32_BOOTSTRAP_LIBS)				\
-	$(top_builddir)/shell/libeshell.la		\
-	$(top_builddir)/calendar/gui/libcal-gui.la
+libevolution_module_calendar_la_LDFLAGS =		\
+	-module -avoid-version $(NO_UNDEFINED)
diff --git a/calendar/modules/e-cal-shell-backend.c b/calendar/module/e-cal-shell-backend.c
similarity index 94%
rename from calendar/modules/e-cal-shell-backend.c
rename to calendar/module/e-cal-shell-backend.c
index c6d84f0..9c38555 100644
--- a/calendar/modules/e-cal-shell-backend.c
+++ b/calendar/module/e-cal-shell-backend.c
@@ -45,9 +45,9 @@
 #include "calendar/gui/dialogs/event-editor.h"
 #include "calendar/importers/evolution-calendar-importer.h"
 
-#include "e-cal-shell-view.h"
 #include "e-cal-shell-migrate.h"
 #include "e-cal-shell-settings.h"
+#include "e-cal-shell-view.h"
 
 #define E_CAL_SHELL_BACKEND_GET_PRIVATE(obj) \
 	(G_TYPE_INSTANCE_GET_PRIVATE \
@@ -67,12 +67,8 @@ enum {
 	PROP_SOURCE_LIST
 };
 
-/* Module Entry Point */
-void e_module_load (GTypeModule *type_module);
-void e_module_unload (GTypeModule *type_module);
-
-GType e_cal_shell_backend_type = 0;
 static gpointer parent_class;
+static GType cal_shell_backend_type;
 
 static void
 cal_shell_backend_ensure_sources (EShellBackend *shell_backend)
@@ -634,29 +630,30 @@ cal_shell_backend_init (ECalShellBackend *cal_shell_backend)
 }
 
 GType
-e_cal_shell_backend_get_type (GTypeModule *type_module)
+e_cal_shell_backend_get_type (void)
 {
-	if (e_cal_shell_backend_type == 0) {
-		const GTypeInfo type_info = {
-			sizeof (ECalShellBackendClass),
-			(GBaseInitFunc) NULL,
-			(GBaseFinalizeFunc) NULL,
-			(GClassInitFunc) cal_shell_backend_class_init,
-			(GClassFinalizeFunc) NULL,
-			NULL,  /* class_data */
-			sizeof (ECalShellBackend),
-			0,     /* n_preallocs */
-			(GInstanceInitFunc) cal_shell_backend_init,
-			NULL   /* value_table */
-		};
-
-		e_cal_shell_backend_type =
-			g_type_module_register_type (
-				type_module, E_TYPE_SHELL_BACKEND,
-				"ECalShellBackend", &type_info, 0);
-	}
+	return cal_shell_backend_type;
+}
 
-	return e_cal_shell_backend_type;
+void
+e_cal_shell_backend_register_type (GTypeModule *type_module)
+{
+	const GTypeInfo type_info = {
+		sizeof (ECalShellBackendClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) cal_shell_backend_class_init,
+		(GClassFinalizeFunc) NULL,
+		NULL,  /* class_data */
+		sizeof (ECalShellBackend),
+		0,     /* n_preallocs */
+		(GInstanceInitFunc) cal_shell_backend_init,
+		NULL   /* value_table */
+	};
+
+	cal_shell_backend_type = g_type_module_register_type (
+		type_module, E_TYPE_SHELL_BACKEND,
+		"ECalShellBackend", &type_info, 0);
 }
 
 ESourceList *
@@ -667,15 +664,3 @@ e_cal_shell_backend_get_source_list (ECalShellBackend *cal_shell_backend)
 
 	return cal_shell_backend->priv->source_list;
 }
-
-void
-e_module_load (GTypeModule *type_module)
-{
-	e_cal_shell_backend_get_type (type_module);
-	e_cal_shell_view_get_type (type_module);
-}
-
-void
-e_module_unload (GTypeModule *type_module)
-{
-}
diff --git a/calendar/modules/e-cal-shell-backend.h b/calendar/module/e-cal-shell-backend.h
similarity index 94%
rename from calendar/modules/e-cal-shell-backend.h
rename to calendar/module/e-cal-shell-backend.h
index 5e17600..434c87b 100644
--- a/calendar/modules/e-cal-shell-backend.h
+++ b/calendar/module/e-cal-shell-backend.h
@@ -27,7 +27,7 @@
 
 /* Standard GObject macros */
 #define E_TYPE_CAL_SHELL_BACKEND \
-	(e_cal_shell_backend_type)
+	(e_cal_shell_backend_get_type ())
 #define E_CAL_SHELL_BACKEND(obj) \
 	(G_TYPE_CHECK_INSTANCE_CAST \
 	((obj), E_TYPE_CAL_SHELL_BACKEND, ECalShellBackend))
@@ -46,8 +46,6 @@
 
 G_BEGIN_DECLS
 
-extern GType e_cal_shell_backend_type;
-
 typedef struct _ECalShellBackend ECalShellBackend;
 typedef struct _ECalShellBackendClass ECalShellBackendClass;
 typedef struct _ECalShellBackendPrivate ECalShellBackendPrivate;
@@ -61,7 +59,8 @@ struct _ECalShellBackendClass {
 	EShellBackendClass parent_class;
 };
 
-GType		e_cal_shell_backend_get_type
+GType		e_cal_shell_backend_get_type	(void);
+void		e_cal_shell_backend_register_type
 					(GTypeModule *type_module);
 ESourceList *	e_cal_shell_backend_get_source_list
 					(ECalShellBackend *cal_shell_backend);
diff --git a/calendar/modules/e-cal-shell-content.c b/calendar/module/e-cal-shell-content.c
similarity index 97%
rename from calendar/modules/e-cal-shell-content.c
rename to calendar/module/e-cal-shell-content.c
index 5a73ed6..7f750f5 100644
--- a/calendar/modules/e-cal-shell-content.c
+++ b/calendar/module/e-cal-shell-content.c
@@ -1,5 +1,5 @@
 /*
- * e-cal-shell-content.h
+ * e-cal-shell-content.c
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -80,6 +80,7 @@ typedef enum {
 } FocusLocation;
 
 static gpointer parent_class;
+static GType cal_shell_content_type;
 
 static void
 cal_shell_content_display_view_cb (ECalShellContent *cal_shell_content,
@@ -593,28 +594,28 @@ cal_shell_content_init (ECalShellContent *cal_shell_content)
 GType
 e_cal_shell_content_get_type (void)
 {
-	static GType type = 0;
-
-	if (G_UNLIKELY (type == 0)) {
-		static const GTypeInfo type_info = {
-			sizeof (ECalShellContentClass),
-			(GBaseInitFunc) NULL,
-			(GBaseFinalizeFunc) NULL,
-			(GClassInitFunc) cal_shell_content_class_init,
-			(GClassFinalizeFunc) NULL,
-			NULL,  /* class_data */
-			sizeof (ECalShellContent),
-			0,     /* n_preallocs */
-			(GInstanceInitFunc) cal_shell_content_init,
-			NULL   /* value_table */
-		};
-
-		type = g_type_register_static (
-			E_TYPE_SHELL_CONTENT, "ECalShellContent",
-			&type_info, 0);
-	}
+	return cal_shell_content_type;
+}
 
-	return type;
+void
+e_cal_shell_content_register_type (GTypeModule *type_module)
+{
+	static const GTypeInfo type_info = {
+		sizeof (ECalShellContentClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) cal_shell_content_class_init,
+		(GClassFinalizeFunc) NULL,
+		NULL,  /* class_data */
+		sizeof (ECalShellContent),
+		0,     /* n_preallocs */
+		(GInstanceInitFunc) cal_shell_content_init,
+		NULL   /* value_table */
+	};
+
+	cal_shell_content_type = g_type_module_register_type (
+		type_module, E_TYPE_SHELL_CONTENT,
+		"ECalShellContent", &type_info, 0);
 }
 
 GtkWidget *
diff --git a/calendar/modules/e-cal-shell-content.h b/calendar/module/e-cal-shell-content.h
similarity index 82%
rename from calendar/modules/e-cal-shell-content.h
rename to calendar/module/e-cal-shell-content.h
index f199be3..6b86179 100644
--- a/calendar/modules/e-cal-shell-content.h
+++ b/calendar/module/e-cal-shell-content.h
@@ -27,7 +27,7 @@
 
 #include <calendar/gui/e-memo-table.h>
 #include <calendar/gui/gnome-cal.h>
-#include <widgets/menus/gal-view-instance.h>
+#include <menus/gal-view-instance.h>
 
 /* Standard GObject macros */
 #define E_TYPE_CAL_SHELL_CONTENT \
@@ -78,26 +78,30 @@ struct _ECalShellContentClass {
 };
 
 GType		e_cal_shell_content_get_type	(void);
+void		e_cal_shell_content_register_type
+					(GTypeModule *type_module);
 GtkWidget *	e_cal_shell_content_new	(EShellView *shell_view);
-GnomeCalendar *	e_cal_shell_content_get_calendar(ECalShellContent *cal_shell_content);
+GnomeCalendar *	e_cal_shell_content_get_calendar
+					(ECalShellContent *cal_shell_content);
 EMemoTable *	e_cal_shell_content_get_memo_table
-						(ECalShellContent *cal_shell_content);
+					(ECalShellContent *cal_shell_content);
 ECalendarTable *e_cal_shell_content_get_task_table
-						(ECalShellContent *cal_shell_content);
-icaltimezone *	e_cal_shell_content_get_timezone(ECalShellContent *cal_shell_content);
+					(ECalShellContent *cal_shell_content);
+icaltimezone *	e_cal_shell_content_get_timezone
+					(ECalShellContent *cal_shell_content);
 GalViewInstance *
 		e_cal_shell_content_get_view_instance
-						(ECalShellContent *cal_shell_content);
+					(ECalShellContent *cal_shell_content);
 void		e_cal_shell_content_copy_clipboard
-						(ECalShellContent *cal_shell_content);
+					(ECalShellContent *cal_shell_content);
 void		e_cal_shell_content_cut_clipboard
-						(ECalShellContent *cal_shell_content);
+					(ECalShellContent *cal_shell_content);
 void		e_cal_shell_content_paste_clipboard
-						(ECalShellContent *cal_shell_content);
+					(ECalShellContent *cal_shell_content);
 void		e_cal_shell_content_delete_selection
-						(ECalShellContent *cal_shell_content);
+					(ECalShellContent *cal_shell_content);
 void		e_cal_shell_content_delete_selected_occurrence
-						(ECalShellContent *cal_shell_content);
+					(ECalShellContent *cal_shell_content);
 
 G_END_DECLS
 
diff --git a/calendar/modules/e-cal-shell-migrate.c b/calendar/module/e-cal-shell-migrate.c
similarity index 100%
rename from calendar/modules/e-cal-shell-migrate.c
rename to calendar/module/e-cal-shell-migrate.c
diff --git a/calendar/modules/e-cal-shell-migrate.h b/calendar/module/e-cal-shell-migrate.h
similarity index 100%
copy from calendar/modules/e-cal-shell-migrate.h
copy to calendar/module/e-cal-shell-migrate.h
diff --git a/calendar/modules/e-cal-shell-settings.c b/calendar/module/e-cal-shell-settings.c
similarity index 100%
rename from calendar/modules/e-cal-shell-settings.c
rename to calendar/module/e-cal-shell-settings.c
diff --git a/calendar/modules/e-cal-shell-settings.h b/calendar/module/e-cal-shell-settings.h
similarity index 100%
rename from calendar/modules/e-cal-shell-settings.h
rename to calendar/module/e-cal-shell-settings.h
diff --git a/calendar/modules/e-cal-shell-sidebar.c b/calendar/module/e-cal-shell-sidebar.c
similarity index 96%
rename from calendar/modules/e-cal-shell-sidebar.c
rename to calendar/module/e-cal-shell-sidebar.c
index b338c98..4c37c82 100644
--- a/calendar/modules/e-cal-shell-sidebar.c
+++ b/calendar/module/e-cal-shell-sidebar.c
@@ -65,6 +65,7 @@ enum {
 
 static gpointer parent_class;
 static guint signals[LAST_SIGNAL];
+static GType cal_shell_sidebar_type;
 
 static void
 cal_shell_sidebar_emit_client_added (ECalShellSidebar *cal_shell_sidebar,
@@ -616,28 +617,28 @@ cal_shell_sidebar_init (ECalShellSidebar *cal_shell_sidebar)
 GType
 e_cal_shell_sidebar_get_type (void)
 {
-	static GType type = 0;
-
-	if (G_UNLIKELY (type == 0)) {
-		static const GTypeInfo type_info = {
-			sizeof (ECalShellSidebarClass),
-			(GBaseInitFunc) NULL,
-			(GBaseFinalizeFunc) NULL,
-			(GClassInitFunc) cal_shell_sidebar_class_init,
-			(GClassFinalizeFunc) NULL,
-			NULL,  /* class_data */
-			sizeof (ECalShellSidebar),
-			0,     /* n_preallocs */
-			(GInstanceInitFunc) cal_shell_sidebar_init,
-			NULL   /* value_table */
-		};
-
-		type = g_type_register_static (
-			E_TYPE_SHELL_SIDEBAR, "ECalShellSidebar",
-			&type_info, 0);
-	}
+	return cal_shell_sidebar_type;
+}
 
-	return type;
+void
+e_cal_shell_sidebar_register_type (GTypeModule *type_module)
+{
+	static const GTypeInfo type_info = {
+		sizeof (ECalShellSidebarClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) cal_shell_sidebar_class_init,
+		(GClassFinalizeFunc) NULL,
+		NULL,  /* class_data */
+		sizeof (ECalShellSidebar),
+		0,     /* n_preallocs */
+		(GInstanceInitFunc) cal_shell_sidebar_init,
+		NULL   /* value_table */
+	};
+
+	cal_shell_sidebar_type = g_type_module_register_type (
+		type_module, E_TYPE_SHELL_SIDEBAR,
+		"ECalShellSidebar", &type_info, 0);
 }
 
 GtkWidget *
diff --git a/calendar/modules/e-cal-shell-sidebar.h b/calendar/module/e-cal-shell-sidebar.h
similarity index 83%
rename from calendar/modules/e-cal-shell-sidebar.h
rename to calendar/module/e-cal-shell-sidebar.h
index d77482e..d4e881a 100644
--- a/calendar/modules/e-cal-shell-sidebar.h
+++ b/calendar/module/e-cal-shell-sidebar.h
@@ -27,7 +27,7 @@
 
 #include <shell/e-shell-sidebar.h>
 #include <shell/e-shell-view.h>
-#include <widgets/misc/e-calendar.h>
+#include <misc/e-calendar.h>
 
 /* Standard GObject macros */
 #define E_TYPE_CAL_SHELL_SIDEBAR \
@@ -79,17 +79,22 @@ struct _ECalShellSidebarClass {
 };
 
 GType		e_cal_shell_sidebar_get_type	(void);
-GtkWidget *	e_cal_shell_sidebar_new		(EShellView *shell_view);
-GList *		e_cal_shell_sidebar_get_clients	(ECalShellSidebar *cal_shell_sidebar);
+void		e_cal_shell_sidebar_register_type
+					(GTypeModule *type_module);
+GtkWidget *	e_cal_shell_sidebar_new	(EShellView *shell_view);
+GList *		e_cal_shell_sidebar_get_clients
+					(ECalShellSidebar *cal_shell_sidebar);
 ECalendar *	e_cal_shell_sidebar_get_mini_calendar
-						(ECalShellSidebar *cal_shell_sidebar);
+					(ECalShellSidebar *cal_shell_sidebar);
 ESourceSelector *
-		e_cal_shell_sidebar_get_selector(ECalShellSidebar *cal_shell_sidebar);
-void		e_cal_shell_sidebar_add_source	(ECalShellSidebar *cal_shell_sidebar,
-						 ESource *source);
+		e_cal_shell_sidebar_get_selector
+					(ECalShellSidebar *cal_shell_sidebar);
+void		e_cal_shell_sidebar_add_source
+					(ECalShellSidebar *cal_shell_sidebar,
+					 ESource *source);
 void		e_cal_shell_sidebar_remove_source
-						(ECalShellSidebar *cal_shell_sidebar,
-						 ESource *source);
+					(ECalShellSidebar *cal_shell_sidebar,
+					 ESource *source);
 
 G_END_DECLS
 
diff --git a/calendar/modules/e-cal-shell-view-actions.c b/calendar/module/e-cal-shell-view-actions.c
similarity index 100%
rename from calendar/modules/e-cal-shell-view-actions.c
rename to calendar/module/e-cal-shell-view-actions.c
diff --git a/calendar/modules/e-cal-shell-view-actions.h b/calendar/module/e-cal-shell-view-actions.h
similarity index 100%
rename from calendar/modules/e-cal-shell-view-actions.h
rename to calendar/module/e-cal-shell-view-actions.h
diff --git a/calendar/modules/e-cal-shell-view-memopad.c b/calendar/module/e-cal-shell-view-memopad.c
similarity index 100%
rename from calendar/modules/e-cal-shell-view-memopad.c
rename to calendar/module/e-cal-shell-view-memopad.c
diff --git a/calendar/modules/e-cal-shell-view-private.c b/calendar/module/e-cal-shell-view-private.c
similarity index 100%
rename from calendar/modules/e-cal-shell-view-private.c
rename to calendar/module/e-cal-shell-view-private.c
diff --git a/calendar/modules/e-cal-shell-view-private.h b/calendar/module/e-cal-shell-view-private.h
similarity index 100%
rename from calendar/modules/e-cal-shell-view-private.h
rename to calendar/module/e-cal-shell-view-private.h
diff --git a/calendar/modules/e-cal-shell-view-taskpad.c b/calendar/module/e-cal-shell-view-taskpad.c
similarity index 100%
rename from calendar/modules/e-cal-shell-view-taskpad.c
rename to calendar/module/e-cal-shell-view-taskpad.c
diff --git a/calendar/modules/e-cal-shell-view.c b/calendar/module/e-cal-shell-view.c
similarity index 90%
rename from calendar/modules/e-cal-shell-view.c
rename to calendar/module/e-cal-shell-view.c
index 1e494ed..593b955 100644
--- a/calendar/modules/e-cal-shell-view.c
+++ b/calendar/module/e-cal-shell-view.c
@@ -21,8 +21,8 @@
 
 #include "e-cal-shell-view-private.h"
 
-GType e_cal_shell_view_type = 0;
 static gpointer parent_class;
+static GType cal_shell_view_type;
 
 static void
 cal_shell_view_dispose (GObject *object)
@@ -190,29 +190,30 @@ cal_shell_view_init (ECalShellView *cal_shell_view,
 }
 
 GType
-e_cal_shell_view_get_type (GTypeModule *type_module)
+e_cal_shell_view_get_type (void)
 {
-	if (e_cal_shell_view_type == 0) {
-		const GTypeInfo type_info = {
-			sizeof (ECalShellViewClass),
-			(GBaseInitFunc) NULL,
-			(GBaseFinalizeFunc) NULL,
-			(GClassInitFunc) cal_shell_view_class_init,
-			(GClassFinalizeFunc) NULL,
-			type_module,
-			sizeof (ECalShellView),
-			0,    /* n_preallocs */
-			(GInstanceInitFunc) cal_shell_view_init,
-			NULL  /* value_table */
-		};
-
-		e_cal_shell_view_type =
-			g_type_module_register_type (
-				type_module, E_TYPE_SHELL_VIEW,
-				"ECalShellView", &type_info, 0);
-	}
+	return cal_shell_view_type;
+}
 
-	return e_cal_shell_view_type;
+void
+e_cal_shell_view_register_type (GTypeModule *type_module)
+{
+	const GTypeInfo type_info = {
+		sizeof (ECalShellViewClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) cal_shell_view_class_init,
+		(GClassFinalizeFunc) NULL,
+		type_module,
+		sizeof (ECalShellView),
+		0,    /* n_preallocs */
+		(GInstanceInitFunc) cal_shell_view_init,
+		NULL  /* value_table */
+	};
+
+	cal_shell_view_type = g_type_module_register_type (
+		type_module, E_TYPE_SHELL_VIEW,
+		"ECalShellView", &type_info, 0);
 }
 
 GnomeCalendar *
diff --git a/calendar/modules/e-cal-shell-view.h b/calendar/module/e-cal-shell-view.h
similarity index 89%
rename from calendar/modules/e-cal-shell-view.h
rename to calendar/module/e-cal-shell-view.h
index cdbd938..42fddec 100644
--- a/calendar/modules/e-cal-shell-view.h
+++ b/calendar/module/e-cal-shell-view.h
@@ -28,7 +28,7 @@
 
 /* Standard GObject macros */
 #define E_TYPE_CAL_SHELL_VIEW \
-	(e_cal_shell_view_type)
+	(e_cal_shell_view_get_type ())
 #define E_CAL_SHELL_VIEW(obj) \
 	(G_TYPE_CHECK_INSTANCE_CAST \
 	((obj), E_TYPE_CAL_SHELL_VIEW, ECalShellView))
@@ -47,8 +47,6 @@
 
 G_BEGIN_DECLS
 
-extern GType e_cal_shell_view_type;
-
 typedef struct _ECalShellView ECalShellView;
 typedef struct _ECalShellViewClass ECalShellViewClass;
 typedef struct _ECalShellViewPrivate ECalShellViewPrivate;
@@ -62,10 +60,9 @@ struct _ECalShellViewClass {
 	EShellViewClass parent_class;
 };
 
-GType		e_cal_shell_view_get_type
-					(GTypeModule *type_module);
-GnomeCalendar *	e_cal_shell_view_get_calendar
-					(ECalShellView *cal_shell_view);
+GType		e_cal_shell_view_get_type	(void);
+void		e_cal_shell_view_register_type	(GTypeModule *type_module);
+GnomeCalendar *	e_cal_shell_view_get_calendar	(ECalShellView *cal_shell_view);
 
 G_END_DECLS
 
diff --git a/calendar/modules/e-memo-shell-backend.c b/calendar/module/e-memo-shell-backend.c
similarity index 93%
rename from calendar/modules/e-memo-shell-backend.c
rename to calendar/module/e-memo-shell-backend.c
index 130b418..1748308 100644
--- a/calendar/modules/e-memo-shell-backend.c
+++ b/calendar/module/e-memo-shell-backend.c
@@ -58,12 +58,8 @@ enum {
 	PROP_SOURCE_LIST
 };
 
-/* Module Entry Point */
-void e_module_load (GTypeModule *type_module);
-void e_module_unload (GTypeModule *type_module);
-
-GType e_memo_shell_backend_type = 0;
 static gpointer parent_class;
+static GType memo_shell_backend_type;
 
 static void
 memo_module_ensure_sources (EShellBackend *shell_backend)
@@ -590,29 +586,30 @@ memo_shell_backend_init (EMemoShellBackend *memo_shell_backend)
 }
 
 GType
-e_memo_shell_backend_get_type (GTypeModule *type_module)
+e_memo_shell_backend_get_type (void)
 {
-	if (e_memo_shell_backend_type == 0) {
-		const GTypeInfo type_info = {
-			sizeof (EMemoShellBackendClass),
-			(GBaseInitFunc) NULL,
-			(GBaseFinalizeFunc) NULL,
-			(GClassInitFunc) memo_shell_backend_class_init,
-			(GClassFinalizeFunc) NULL,
-			NULL,  /* class_data */
-			sizeof (EMemoShellBackend),
-			0,     /* n_preallocs */
-			(GInstanceInitFunc) memo_shell_backend_init,
-			NULL   /* value_table */
-		};
-
-		e_memo_shell_backend_type =
-			g_type_module_register_type (
-				type_module, E_TYPE_SHELL_BACKEND,
-				"EMemoShellBackend", &type_info, 0);
-	}
+	return memo_shell_backend_type;
+}
 
-	return e_memo_shell_backend_type;
+void
+e_memo_shell_backend_register_type (GTypeModule *type_module)
+{
+	const GTypeInfo type_info = {
+		sizeof (EMemoShellBackendClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) memo_shell_backend_class_init,
+		(GClassFinalizeFunc) NULL,
+		NULL,  /* class_data */
+		sizeof (EMemoShellBackend),
+		0,     /* n_preallocs */
+		(GInstanceInitFunc) memo_shell_backend_init,
+		NULL   /* value_table */
+	};
+
+	memo_shell_backend_type = g_type_module_register_type (
+		type_module, E_TYPE_SHELL_BACKEND,
+		"EMemoShellBackend", &type_info, 0);
 }
 
 ESourceList *
@@ -623,15 +620,3 @@ e_memo_shell_backend_get_source_list (EMemoShellBackend *memo_shell_backend)
 
 	return memo_shell_backend->priv->source_list;
 }
-
-void
-e_module_load (GTypeModule *type_module)
-{
-	e_memo_shell_backend_get_type (type_module);
-	e_memo_shell_view_get_type (type_module);
-}
-
-void
-e_module_unload (GTypeModule *type_module)
-{
-}
diff --git a/calendar/modules/e-memo-shell-backend.h b/calendar/module/e-memo-shell-backend.h
similarity index 94%
rename from calendar/modules/e-memo-shell-backend.h
rename to calendar/module/e-memo-shell-backend.h
index 3a8b06a..0ffc222 100644
--- a/calendar/modules/e-memo-shell-backend.h
+++ b/calendar/module/e-memo-shell-backend.h
@@ -27,7 +27,7 @@
 
 /* Standard GObject macros */
 #define E_TYPE_MEMO_SHELL_BACKEND \
-	(e_memo_shell_backend_type)
+	(e_memo_shell_backend_get_type ())
 #define E_MEMO_SHELL_BACKEND(obj) \
 	(G_TYPE_CHECK_INSTANCE_CAST \
 	((obj), E_TYPE_MEMO_SHELL_BACKEND, EMemoShellBackend))
@@ -46,8 +46,6 @@
 
 G_BEGIN_DECLS
 
-extern GType e_memo_shell_backend_type;
-
 typedef struct _EMemoShellBackend EMemoShellBackend;
 typedef struct _EMemoShellBackendClass EMemoShellBackendClass;
 typedef struct _EMemoShellBackendPrivate EMemoShellBackendPrivate;
@@ -61,7 +59,8 @@ struct _EMemoShellBackendClass {
 	EShellBackendClass parent_class;
 };
 
-GType		e_memo_shell_backend_get_type
+GType		e_memo_shell_backend_get_type	(void);
+void		e_memo_shell_backend_register_type
 					(GTypeModule *type_module);
 ESourceList *	e_memo_shell_backend_get_source_list
 					(EMemoShellBackend *memo_shell_backend);
diff --git a/calendar/modules/e-memo-shell-content.c b/calendar/module/e-memo-shell-content.c
similarity index 96%
rename from calendar/modules/e-memo-shell-content.c
rename to calendar/module/e-memo-shell-content.c
index 006e988..4e06448 100644
--- a/calendar/modules/e-memo-shell-content.c
+++ b/calendar/module/e-memo-shell-content.c
@@ -74,6 +74,7 @@ static GtkTargetEntry drag_types[] = {
 };
 
 static gpointer parent_class;
+static GType memo_shell_content_type;
 
 static void
 memo_shell_content_display_view_cb (EMemoShellContent *memo_shell_content,
@@ -568,28 +569,28 @@ memo_shell_content_init (EMemoShellContent *memo_shell_content)
 GType
 e_memo_shell_content_get_type (void)
 {
-	static GType type = 0;
-
-	if (G_UNLIKELY (type == 0)) {
-		static const GTypeInfo type_info = {
-			sizeof (EMemoShellContentClass),
-			(GBaseInitFunc) NULL,
-			(GBaseFinalizeFunc) NULL,
-			(GClassInitFunc) memo_shell_content_class_init,
-			(GClassFinalizeFunc) NULL,
-			NULL,  /* class_data */
-			sizeof (EMemoShellContent),
-			0,     /* n_preallocs */
-			(GInstanceInitFunc) memo_shell_content_init,
-			NULL   /* value_table */
-		};
-
-		type = g_type_register_static (
-			E_TYPE_SHELL_CONTENT, "EMemoShellContent",
-			&type_info, 0);
-	}
+	return memo_shell_content_type;
+}
 
-	return type;
+void
+e_memo_shell_content_register_type (GTypeModule *type_module)
+{
+	static const GTypeInfo type_info = {
+		sizeof (EMemoShellContentClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) memo_shell_content_class_init,
+		(GClassFinalizeFunc) NULL,
+		NULL,  /* class_data */
+		sizeof (EMemoShellContent),
+		0,     /* n_preallocs */
+		(GInstanceInitFunc) memo_shell_content_init,
+		NULL   /* value_table */
+	};
+
+	memo_shell_content_type = g_type_module_register_type (
+		type_module, E_TYPE_SHELL_CONTENT,
+		"EMemoShellContent", &type_info, 0);
 }
 
 GtkWidget *
diff --git a/calendar/modules/e-memo-shell-content.h b/calendar/module/e-memo-shell-content.h
similarity index 84%
rename from calendar/modules/e-memo-shell-content.h
rename to calendar/module/e-memo-shell-content.h
index 9edb986..ace932c 100644
--- a/calendar/modules/e-memo-shell-content.h
+++ b/calendar/module/e-memo-shell-content.h
@@ -28,7 +28,7 @@
 #include <calendar/gui/e-memo-table.h>
 #include <calendar/gui/e-cal-component-preview.h>
 
-#include <widgets/menus/gal-view-instance.h>
+#include <menus/gal-view-instance.h>
 
 /* Standard GObject macros */
 #define E_TYPE_MEMO_SHELL_CONTENT \
@@ -72,22 +72,24 @@ struct _EMemoShellContentClass {
 };
 
 GType		e_memo_shell_content_get_type	(void);
-GtkWidget *	e_memo_shell_content_new	(EShellView *shell_view);
+void		e_memo_shell_content_register_type
+					(GTypeModule *type_module);
+GtkWidget *	e_memo_shell_content_new(EShellView *shell_view);
 ECalModel *	e_memo_shell_content_get_memo_model
-						(EMemoShellContent *memo_shell_conent);
+					(EMemoShellContent *memo_shell_conent);
 ECalComponentPreview *
 		e_memo_shell_content_get_memo_preview
-						(EMemoShellContent *memo_shell_content);
+					(EMemoShellContent *memo_shell_content);
 EMemoTable *	e_memo_shell_content_get_memo_table
-						(EMemoShellContent *memo_shell_content);
+					(EMemoShellContent *memo_shell_content);
 GalViewInstance *
 		e_memo_shell_content_get_view_instance
-						(EMemoShellContent *memo_shell_content);
+					(EMemoShellContent *memo_shell_content);
 gboolean	e_memo_shell_content_get_preview_visible
-						(EMemoShellContent *memo_shell_content);
+					(EMemoShellContent *memo_shell_content);
 void		e_memo_shell_content_set_preview_visible
-						(EMemoShellContent *memo_shell_content,
-						 gboolean preview_visible);
+					(EMemoShellContent *memo_shell_content,
+					 gboolean preview_visible);
 
 G_END_DECLS
 
diff --git a/calendar/modules/e-memo-shell-migrate.c b/calendar/module/e-memo-shell-migrate.c
similarity index 100%
rename from calendar/modules/e-memo-shell-migrate.c
rename to calendar/module/e-memo-shell-migrate.c
diff --git a/calendar/modules/e-memo-shell-migrate.h b/calendar/module/e-memo-shell-migrate.h
similarity index 100%
rename from calendar/modules/e-memo-shell-migrate.h
rename to calendar/module/e-memo-shell-migrate.h
diff --git a/calendar/modules/e-memo-shell-sidebar.c b/calendar/module/e-memo-shell-sidebar.c
similarity index 96%
rename from calendar/modules/e-memo-shell-sidebar.c
rename to calendar/module/e-memo-shell-sidebar.c
index db3c75c..5d5c6a7 100644
--- a/calendar/modules/e-memo-shell-sidebar.c
+++ b/calendar/module/e-memo-shell-sidebar.c
@@ -60,6 +60,7 @@ enum {
 
 static gpointer parent_class;
 static guint signals[LAST_SIGNAL];
+static GType memo_shell_sidebar_type;
 
 static void
 memo_shell_sidebar_emit_client_added (EMemoShellSidebar *memo_shell_sidebar,
@@ -597,28 +598,28 @@ memo_shell_sidebar_init (EMemoShellSidebar *memo_shell_sidebar)
 GType
 e_memo_shell_sidebar_get_type (void)
 {
-	static GType type = 0;
-
-	if (G_UNLIKELY (type == 0)) {
-		static const GTypeInfo type_info = {
-			sizeof (EMemoShellSidebarClass),
-			(GBaseInitFunc) NULL,
-			(GBaseFinalizeFunc) NULL,
-			(GClassInitFunc) memo_shell_sidebar_class_init,
-			(GClassFinalizeFunc) NULL,
-			NULL,  /* class_data */
-			sizeof (EMemoShellSidebar),
-			0,     /* n_preallocs */
-			(GInstanceInitFunc) memo_shell_sidebar_init,
-			NULL   /* value_table */
-		};
-
-		type = g_type_register_static (
-			E_TYPE_SHELL_SIDEBAR, "EMemoShellSidebar",
-			&type_info, 0);
-	}
+	return memo_shell_sidebar_type;
+}
 
-	return type;
+void
+e_memo_shell_sidebar_register_type (GTypeModule *type_module)
+{
+	static const GTypeInfo type_info = {
+		sizeof (EMemoShellSidebarClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) memo_shell_sidebar_class_init,
+		(GClassFinalizeFunc) NULL,
+		NULL,  /* class_data */
+		sizeof (EMemoShellSidebar),
+		0,     /* n_preallocs */
+		(GInstanceInitFunc) memo_shell_sidebar_init,
+		NULL   /* value_table */
+	};
+
+	memo_shell_sidebar_type = g_type_module_register_type (
+		type_module, E_TYPE_SHELL_SIDEBAR,
+		"EMemoShellSidebar", &type_info, 0);
 }
 
 GtkWidget *
diff --git a/calendar/modules/e-memo-shell-sidebar.h b/calendar/module/e-memo-shell-sidebar.h
similarity index 88%
rename from calendar/modules/e-memo-shell-sidebar.h
rename to calendar/module/e-memo-shell-sidebar.h
index 50ece79..9a30b91 100644
--- a/calendar/modules/e-memo-shell-sidebar.h
+++ b/calendar/module/e-memo-shell-sidebar.h
@@ -77,15 +77,18 @@ struct _EMemoShellSidebarClass {
 };
 
 GType		e_memo_shell_sidebar_get_type	(void);
-GtkWidget *	e_memo_shell_sidebar_new	(EShellView *shell_view);
+void		e_memo_shell_sidebar_register_type
+					(GTypeModule *type_module);
+GtkWidget *	e_memo_shell_sidebar_new(EShellView *shell_view);
 ESourceSelector *
 		e_memo_shell_sidebar_get_selector
-						(EMemoShellSidebar *memo_shell_sidebar);
-void		e_memo_shell_sidebar_add_source	(EMemoShellSidebar *memo_shell_sidebar,
-						 ESource *source);
+					(EMemoShellSidebar *memo_shell_sidebar);
+void		e_memo_shell_sidebar_add_source
+					(EMemoShellSidebar *memo_shell_sidebar,
+					 ESource *source);
 void		e_memo_shell_sidebar_remove_source
-						(EMemoShellSidebar *memo_shell_sidebar,
-						 ESource *source);
+					(EMemoShellSidebar *memo_shell_sidebar,
+					 ESource *source);
 
 G_END_DECLS
 
diff --git a/calendar/modules/e-memo-shell-view-actions.c b/calendar/module/e-memo-shell-view-actions.c
similarity index 100%
rename from calendar/modules/e-memo-shell-view-actions.c
rename to calendar/module/e-memo-shell-view-actions.c
diff --git a/calendar/modules/e-memo-shell-view-actions.h b/calendar/module/e-memo-shell-view-actions.h
similarity index 100%
rename from calendar/modules/e-memo-shell-view-actions.h
rename to calendar/module/e-memo-shell-view-actions.h
diff --git a/calendar/modules/e-memo-shell-view-private.c b/calendar/module/e-memo-shell-view-private.c
similarity index 100%
rename from calendar/modules/e-memo-shell-view-private.c
rename to calendar/module/e-memo-shell-view-private.c
diff --git a/calendar/modules/e-memo-shell-view-private.h b/calendar/module/e-memo-shell-view-private.h
similarity index 100%
rename from calendar/modules/e-memo-shell-view-private.h
rename to calendar/module/e-memo-shell-view-private.h
diff --git a/calendar/modules/e-memo-shell-view.c b/calendar/module/e-memo-shell-view.c
similarity index 90%
rename from calendar/modules/e-memo-shell-view.c
rename to calendar/module/e-memo-shell-view.c
index 78c594d..22c4472 100644
--- a/calendar/modules/e-memo-shell-view.c
+++ b/calendar/module/e-memo-shell-view.c
@@ -21,8 +21,8 @@
 
 #include "e-memo-shell-view-private.h"
 
-GType e_memo_shell_view_type = 0;
 static gpointer parent_class;
+static GType memo_shell_view_type;
 
 static void
 memo_shell_view_dispose (GObject *object)
@@ -195,27 +195,28 @@ memo_shell_view_init (EMemoShellView *memo_shell_view,
 }
 
 GType
-e_memo_shell_view_get_type (GTypeModule *type_module)
+e_memo_shell_view_get_type (void)
 {
-	if (e_memo_shell_view_type == 0) {
-		const GTypeInfo type_info = {
-			sizeof (EMemoShellViewClass),
-			(GBaseInitFunc) NULL,
-			(GBaseFinalizeFunc) NULL,
-			(GClassInitFunc) memo_shell_view_class_init,
-			(GClassFinalizeFunc) NULL,
-			type_module,
-			sizeof (EMemoShellView),
-			0,    /* n_preallocs */
-			(GInstanceInitFunc) memo_shell_view_init,
-			NULL  /* value_table */
-		};
-
-		e_memo_shell_view_type =
-			g_type_module_register_type (
-				type_module, E_TYPE_SHELL_VIEW,
-				"EMemoShellView", &type_info, 0);
-	}
-
-	return e_memo_shell_view_type;
+	return memo_shell_view_type;
+}
+
+void
+e_memo_shell_view_register_type (GTypeModule *type_module)
+{
+	const GTypeInfo type_info = {
+		sizeof (EMemoShellViewClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) memo_shell_view_class_init,
+		(GClassFinalizeFunc) NULL,
+		type_module,
+		sizeof (EMemoShellView),
+		0,    /* n_preallocs */
+		(GInstanceInitFunc) memo_shell_view_init,
+		NULL  /* value_table */
+	};
+
+	memo_shell_view_type = g_type_module_register_type (
+		type_module, E_TYPE_SHELL_VIEW,
+		"EMemoShellView", &type_info, 0);
 }
diff --git a/calendar/modules/e-memo-shell-view.h b/calendar/module/e-memo-shell-view.h
similarity index 93%
rename from calendar/modules/e-memo-shell-view.h
rename to calendar/module/e-memo-shell-view.h
index 72b9564..0cbaa7b 100644
--- a/calendar/modules/e-memo-shell-view.h
+++ b/calendar/module/e-memo-shell-view.h
@@ -27,7 +27,7 @@
 
 /* Standard GObject macros */
 #define E_TYPE_MEMO_SHELL_VIEW \
-	(e_memo_shell_view_type)
+	(e_memo_shell_view_get_type ())
 #define E_MEMO_SHELL_VIEW(obj) \
 	(G_TYPE_CHECK_INSTANCE_CAST \
 	((obj), E_TYPE_MEMO_SHELL_VIEW, EMemoShellView))
@@ -46,8 +46,6 @@
 
 G_BEGIN_DECLS
 
-extern GType e_memo_shell_view_type;
-
 typedef struct _EMemoShellView EMemoShellView;
 typedef struct _EMemoShellViewClass EMemoShellViewClass;
 typedef struct _EMemoShellViewPrivate EMemoShellViewPrivate;
@@ -61,7 +59,8 @@ struct _EMemoShellViewClass {
 	EShellViewClass parent_class;
 };
 
-GType		e_memo_shell_view_get_type	(GTypeModule *type_module);
+GType		e_memo_shell_view_get_type	(void);
+void		e_memo_shell_view_register_type	(GTypeModule *type_module);
 
 G_END_DECLS
 
diff --git a/calendar/modules/e-task-shell-backend.c b/calendar/module/e-task-shell-backend.c
similarity index 93%
rename from calendar/modules/e-task-shell-backend.c
rename to calendar/module/e-task-shell-backend.c
index 3298764..a9bc2d9 100644
--- a/calendar/modules/e-task-shell-backend.c
+++ b/calendar/module/e-task-shell-backend.c
@@ -39,7 +39,9 @@
 #include "calendar/gui/dialogs/calendar-setup.h"
 #include "calendar/gui/dialogs/task-editor.h"
 
+#include "e-task-shell-content.h"
 #include "e-task-shell-migrate.h"
+#include "e-task-shell-sidebar.h"
 #include "e-task-shell-view.h"
 
 #define E_TASK_SHELL_BACKEND_GET_PRIVATE(obj) \
@@ -58,12 +60,8 @@ enum {
 	PROP_SOURCE_LIST
 };
 
-/* Module Entry Point */
-void e_module_load (GTypeModule *type_module);
-void e_module_unload (GTypeModule *type_module);
-
-GType e_task_shell_backend_type = 0;
 static gpointer parent_class;
+static GType task_shell_backend_type;
 
 static void
 task_module_ensure_sources (EShellBackend *shell_backend)
@@ -596,29 +594,30 @@ task_shell_backend_init (ETaskShellBackend *task_shell_backend)
 }
 
 GType
-e_task_shell_backend_get_type (GTypeModule *type_module)
+e_task_shell_backend_get_type (void)
 {
-	if (e_task_shell_backend_type == 0) {
-		const GTypeInfo type_info = {
-			sizeof (ETaskShellBackendClass),
-			(GBaseInitFunc) NULL,
-			(GBaseFinalizeFunc) NULL,
-			(GClassInitFunc) task_shell_backend_class_init,
-			(GClassFinalizeFunc) NULL,
-			NULL,  /* class_data */
-			sizeof (ETaskShellBackend),
-			0,     /* n_preallocs */
-			(GInstanceInitFunc) task_shell_backend_init,
-			NULL   /* value_table */
-		};
-
-		e_task_shell_backend_type =
-			g_type_module_register_type (
-				type_module, E_TYPE_SHELL_BACKEND,
-				"ETaskShellBackend", &type_info, 0);
-	}
+	return task_shell_backend_type;
+}
 
-	return e_task_shell_backend_type;
+void
+e_task_shell_backend_register_type (GTypeModule *type_module)
+{
+	const GTypeInfo type_info = {
+		sizeof (ETaskShellBackendClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) task_shell_backend_class_init,
+		(GClassFinalizeFunc) NULL,
+		NULL,  /* class_data */
+		sizeof (ETaskShellBackend),
+		0,     /* n_preallocs */
+		(GInstanceInitFunc) task_shell_backend_init,
+		NULL   /* value_table */
+	};
+
+	task_shell_backend_type = g_type_module_register_type (
+		type_module, E_TYPE_SHELL_BACKEND,
+		"ETaskShellBackend", &type_info, 0);
 }
 
 ESourceList *
@@ -629,15 +628,3 @@ e_task_shell_backend_get_source_list (ETaskShellBackend *task_shell_backend)
 
 	return task_shell_backend->priv->source_list;
 }
-
-void
-e_module_load (GTypeModule *type_module)
-{
-	e_task_shell_backend_get_type (type_module);
-	e_task_shell_view_get_type (type_module);
-}
-
-void
-e_module_unload (GTypeModule *type_module)
-{
-}
diff --git a/calendar/modules/e-task-shell-backend.h b/calendar/module/e-task-shell-backend.h
similarity index 94%
rename from calendar/modules/e-task-shell-backend.h
rename to calendar/module/e-task-shell-backend.h
index 7326ea9..edb56f2 100644
--- a/calendar/modules/e-task-shell-backend.h
+++ b/calendar/module/e-task-shell-backend.h
@@ -27,7 +27,7 @@
 
 /* Standard GObject macros */
 #define E_TYPE_TASK_SHELL_BACKEND \
-	(e_task_shell_backend_type)
+	(e_task_shell_backend_get_type ())
 #define E_TASK_SHELL_BACKEND(obj) \
 	(G_TYPE_CHECK_INSTANCE_CAST \
 	((obj), E_TYPE_TASK_SHELL_BACKEND, ETaskShellBackend))
@@ -46,8 +46,6 @@
 
 G_BEGIN_DECLS
 
-extern GType e_task_shell_backend_type;
-
 typedef struct _ETaskShellBackend ETaskShellBackend;
 typedef struct _ETaskShellBackendClass ETaskShellBackendClass;
 typedef struct _ETaskShellBackendPrivate ETaskShellBackendPrivate;
@@ -61,7 +59,8 @@ struct _ETaskShellBackendClass {
 	EShellBackendClass parent_class;
 };
 
-GType		e_task_shell_backend_get_type
+GType		e_task_shell_backend_get_type	(void);
+void		e_task_shell_backend_register_type
 					(GTypeModule *type_module);
 ESourceList *	e_task_shell_backend_get_source_list
 					(ETaskShellBackend *task_shell_backend);
diff --git a/calendar/modules/e-task-shell-content.c b/calendar/module/e-task-shell-content.c
similarity index 96%
rename from calendar/modules/e-task-shell-content.c
rename to calendar/module/e-task-shell-content.c
index 5e98bf2..280bc7c 100644
--- a/calendar/modules/e-task-shell-content.c
+++ b/calendar/module/e-task-shell-content.c
@@ -75,6 +75,7 @@ static GtkTargetEntry drag_types[] = {
 };
 
 static gpointer parent_class;
+static GType task_shell_content_type;
 
 static void
 task_shell_content_display_view_cb (ETaskShellContent *task_shell_content,
@@ -592,28 +593,28 @@ task_shell_content_init (ETaskShellContent *task_shell_content)
 GType
 e_task_shell_content_get_type (void)
 {
-	static GType type = 0;
-
-	if (G_UNLIKELY (type == 0)) {
-		static const GTypeInfo type_info = {
-			sizeof (ETaskShellContentClass),
-			(GBaseInitFunc) NULL,
-			(GBaseFinalizeFunc) NULL,
-			(GClassInitFunc) task_shell_content_class_init,
-			(GClassFinalizeFunc) NULL,
-			NULL,  /* class_data */
-			sizeof (ETaskShellContent),
-			0,     /* n_preallocs */
-			(GInstanceInitFunc) task_shell_content_init,
-			NULL   /* value_table */
-		};
-
-		type = g_type_register_static (
-			E_TYPE_SHELL_CONTENT, "ETaskShellContent",
-			&type_info, 0);
-	}
+	return task_shell_content_type;
+}
 
-	return type;
+void
+e_task_shell_content_register_type (GTypeModule *type_module)
+{
+	static const GTypeInfo type_info = {
+		sizeof (ETaskShellContentClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) task_shell_content_class_init,
+		(GClassFinalizeFunc) NULL,
+		NULL,  /* class_data */
+		sizeof (ETaskShellContent),
+		0,     /* n_preallocs */
+		(GInstanceInitFunc) task_shell_content_init,
+		NULL   /* value_table */
+	};
+
+	task_shell_content_type = g_type_module_register_type (
+		type_module, E_TYPE_SHELL_CONTENT,
+		"ETaskShellContent", &type_info, 0);
 }
 
 GtkWidget *
diff --git a/calendar/modules/e-task-shell-content.h b/calendar/module/e-task-shell-content.h
similarity index 85%
rename from calendar/modules/e-task-shell-content.h
rename to calendar/module/e-task-shell-content.h
index e6f64f7..e749d61 100644
--- a/calendar/modules/e-task-shell-content.h
+++ b/calendar/module/e-task-shell-content.h
@@ -29,7 +29,7 @@
 #include <calendar/gui/e-calendar-table.h>
 #include <calendar/gui/e-cal-component-preview.h>
 
-#include <widgets/menus/gal-view-instance.h>
+#include <menus/gal-view-instance.h>
 
 /* Standard GObject macros */
 #define E_TYPE_TASK_SHELL_CONTENT \
@@ -76,22 +76,24 @@ struct _ETaskShellContentClass {
 };
 
 GType		e_task_shell_content_get_type	(void);
-GtkWidget *	e_task_shell_content_new	(EShellView *shell_view);
+void		e_task_shell_content_register_type
+					(GTypeModule *type_module);
+GtkWidget *	e_task_shell_content_new(EShellView *shell_view);
 ECalModel *	e_task_shell_content_get_task_model
-						(ETaskShellContent *task_shell_content);
+					(ETaskShellContent *task_shell_content);
 ECalComponentPreview *
 		e_task_shell_content_get_task_preview
-						(ETaskShellContent *task_shell_content);
+					(ETaskShellContent *task_shell_content);
 ECalendarTable *e_task_shell_content_get_task_table
-						(ETaskShellContent *task_shell_content);
+					(ETaskShellContent *task_shell_content);
 GalViewInstance *
 		e_task_shell_content_get_view_instance
-						(ETaskShellContent *task_shell_content);
+					(ETaskShellContent *task_shell_content);
 gboolean	e_task_shell_content_get_preview_visible
-						(ETaskShellContent *task_shell_content);
+					(ETaskShellContent *task_shell_content);
 void		e_task_shell_content_set_preview_visible
-						(ETaskShellContent *task_shell_content,
-						 gboolean preview_visible);
+					(ETaskShellContent *task_shell_content,
+					 gboolean preview_visible);
 
 G_END_DECLS
 
diff --git a/calendar/modules/e-task-shell-migrate.c b/calendar/module/e-task-shell-migrate.c
similarity index 100%
rename from calendar/modules/e-task-shell-migrate.c
rename to calendar/module/e-task-shell-migrate.c
diff --git a/calendar/modules/e-task-shell-migrate.h b/calendar/module/e-task-shell-migrate.h
similarity index 100%
rename from calendar/modules/e-task-shell-migrate.h
rename to calendar/module/e-task-shell-migrate.h
diff --git a/calendar/modules/e-task-shell-sidebar.c b/calendar/module/e-task-shell-sidebar.c
similarity index 96%
rename from calendar/modules/e-task-shell-sidebar.c
rename to calendar/module/e-task-shell-sidebar.c
index df6ae4e..f23a2be 100644
--- a/calendar/modules/e-task-shell-sidebar.c
+++ b/calendar/module/e-task-shell-sidebar.c
@@ -60,6 +60,7 @@ enum {
 
 static gpointer parent_class;
 static guint signals[LAST_SIGNAL];
+static GType task_shell_sidebar_type;
 
 static void
 task_shell_sidebar_emit_client_added (ETaskShellSidebar *task_shell_sidebar,
@@ -562,28 +563,28 @@ task_shell_sidebar_init (ETaskShellSidebar *task_shell_sidebar)
 GType
 e_task_shell_sidebar_get_type (void)
 {
-	static GType type = 0;
-
-	if (G_UNLIKELY (type == 0)) {
-		static const GTypeInfo type_info = {
-			sizeof (ETaskShellSidebarClass),
-			(GBaseInitFunc) NULL,
-			(GBaseFinalizeFunc) NULL,
-			(GClassInitFunc) task_shell_sidebar_class_init,
-			(GClassFinalizeFunc) NULL,
-			NULL,  /* class_data */
-			sizeof (ETaskShellSidebar),
-			0,     /* n_preallocs */
-			(GInstanceInitFunc) task_shell_sidebar_init,
-			NULL   /* value_table */
-		};
-
-		type = g_type_register_static (
-			E_TYPE_SHELL_SIDEBAR, "ETaskShellSidebar",
-			&type_info, 0);
-	}
+	return task_shell_sidebar_type;
+}
 
-	return type;
+void
+e_task_shell_sidebar_register_type (GTypeModule *type_module)
+{
+	static const GTypeInfo type_info = {
+		sizeof (ETaskShellSidebarClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) task_shell_sidebar_class_init,
+		(GClassFinalizeFunc) NULL,
+		NULL,  /* class_data */
+		sizeof (ETaskShellSidebar),
+		0,     /* n_preallocs */
+		(GInstanceInitFunc) task_shell_sidebar_init,
+		NULL   /* value_table */
+	};
+
+	task_shell_sidebar_type = g_type_module_register_type (
+		type_module, E_TYPE_SHELL_SIDEBAR,
+		"ETaskShellSidebar", &type_info, 0);
 }
 
 GtkWidget *
diff --git a/calendar/modules/e-task-shell-sidebar.h b/calendar/module/e-task-shell-sidebar.h
similarity index 85%
rename from calendar/modules/e-task-shell-sidebar.h
rename to calendar/module/e-task-shell-sidebar.h
index 2d8fcea..a6d7241 100644
--- a/calendar/modules/e-task-shell-sidebar.h
+++ b/calendar/module/e-task-shell-sidebar.h
@@ -77,16 +77,20 @@ struct _ETaskShellSidebarClass {
 };
 
 GType		e_task_shell_sidebar_get_type	(void);
-GtkWidget *	e_task_shell_sidebar_new	(EShellView *shell_view);
-GList *		e_task_shell_sidebar_get_clients(ETaskShellSidebar *task_shell_sidebar);
+void		e_task_shell_sidebar_register_type
+					(GTypeModule *type_module);
+GtkWidget *	e_task_shell_sidebar_new(EShellView *shell_view);
+GList *		e_task_shell_sidebar_get_clients
+					(ETaskShellSidebar *task_shell_sidebar);
 ESourceSelector *
 		e_task_shell_sidebar_get_selector
-						(ETaskShellSidebar *task_shell_sidebar);
-void		e_task_shell_sidebar_add_source	(ETaskShellSidebar *task_shell_sidebar,
-						 ESource *source);
+					(ETaskShellSidebar *task_shell_sidebar);
+void		e_task_shell_sidebar_add_source
+					(ETaskShellSidebar *task_shell_sidebar,
+					 ESource *source);
 void		e_task_shell_sidebar_remove_source
-						(ETaskShellSidebar *task_shell_sidebar,
-						 ESource *source);
+					(ETaskShellSidebar *task_shell_sidebar,
+					 ESource *source);
 
 G_END_DECLS
 
diff --git a/calendar/modules/e-task-shell-view-actions.c b/calendar/module/e-task-shell-view-actions.c
similarity index 100%
rename from calendar/modules/e-task-shell-view-actions.c
rename to calendar/module/e-task-shell-view-actions.c
diff --git a/calendar/modules/e-task-shell-view-actions.h b/calendar/module/e-task-shell-view-actions.h
similarity index 100%
rename from calendar/modules/e-task-shell-view-actions.h
rename to calendar/module/e-task-shell-view-actions.h
diff --git a/calendar/modules/e-task-shell-view-private.c b/calendar/module/e-task-shell-view-private.c
similarity index 99%
rename from calendar/modules/e-task-shell-view-private.c
rename to calendar/module/e-task-shell-view-private.c
index 926ace8..58bda3d 100644
--- a/calendar/modules/e-task-shell-view-private.c
+++ b/calendar/module/e-task-shell-view-private.c
@@ -21,7 +21,7 @@
 
 #include "e-task-shell-view-private.h"
 
-#include <widgets/menus/gal-view-factory-etable.h>
+#include "widgets/menus/gal-view-factory-etable.h"
 
 static void
 task_shell_view_config_hide_completed_tasks_changed_cb (GConfClient *client,
diff --git a/calendar/modules/e-task-shell-view-private.h b/calendar/module/e-task-shell-view-private.h
similarity index 100%
rename from calendar/modules/e-task-shell-view-private.h
rename to calendar/module/e-task-shell-view-private.h
diff --git a/calendar/modules/e-task-shell-view.c b/calendar/module/e-task-shell-view.c
similarity index 91%
rename from calendar/modules/e-task-shell-view.c
rename to calendar/module/e-task-shell-view.c
index 5869be7..d2f7899 100644
--- a/calendar/modules/e-task-shell-view.c
+++ b/calendar/module/e-task-shell-view.c
@@ -21,8 +21,8 @@
 
 #include "e-task-shell-view-private.h"
 
-GType e_task_shell_view_type = 0;
 static gpointer parent_class;
+static GType task_shell_view_type;
 
 static void
 task_shell_view_dispose (GObject *object)
@@ -228,27 +228,28 @@ task_shell_view_init (ETaskShellView *task_shell_view,
 }
 
 GType
-e_task_shell_view_get_type (GTypeModule *type_module)
+e_task_shell_view_get_type (void)
 {
-	if (e_task_shell_view_type == 0) {
-		const GTypeInfo type_info = {
-			sizeof (ETaskShellViewClass),
-			(GBaseInitFunc) NULL,
-			(GBaseFinalizeFunc) NULL,
-			(GClassInitFunc) task_shell_view_class_init,
-			(GClassFinalizeFunc) NULL,
-			type_module,
-			sizeof (ETaskShellView),
-			0,    /* n_preallocs */
-			(GInstanceInitFunc) task_shell_view_init,
-			NULL  /* value_table */
-		};
-
-		e_task_shell_view_type =
-			g_type_module_register_type (
-				type_module, E_TYPE_SHELL_VIEW,
-				"ETaskShellView", &type_info, 0);
-	}
-
-	return e_task_shell_view_type;
+	return task_shell_view_type;
+}
+
+void
+e_task_shell_view_register_type (GTypeModule *type_module)
+{
+	const GTypeInfo type_info = {
+		sizeof (ETaskShellViewClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) task_shell_view_class_init,
+		(GClassFinalizeFunc) NULL,
+		type_module,
+		sizeof (ETaskShellView),
+		0,    /* n_preallocs */
+		(GInstanceInitFunc) task_shell_view_init,
+		NULL  /* value_table */
+	};
+
+	task_shell_view_type = g_type_module_register_type (
+		type_module, E_TYPE_SHELL_VIEW,
+		"ETaskShellView", &type_info, 0);
 }
diff --git a/calendar/modules/e-task-shell-view.h b/calendar/module/e-task-shell-view.h
similarity index 93%
rename from calendar/modules/e-task-shell-view.h
rename to calendar/module/e-task-shell-view.h
index c94864b..8dca041 100644
--- a/calendar/modules/e-task-shell-view.h
+++ b/calendar/module/e-task-shell-view.h
@@ -27,7 +27,7 @@
 
 /* Standard GObject macros */
 #define E_TYPE_TASK_SHELL_VIEW \
-	(e_task_shell_view_type)
+	(e_task_shell_view_get_type ())
 #define E_TASK_SHELL_VIEW(obj) \
 	(G_TYPE_CHECK_INSTANCE_CAST \
 	((obj), E_TYPE_TASK_SHELL_VIEW, ETaskShellView))
@@ -46,8 +46,6 @@
 
 G_BEGIN_DECLS
 
-extern GType e_task_shell_view_type;
-
 typedef struct _ETaskShellView ETaskShellView;
 typedef struct _ETaskShellViewClass ETaskShellViewClass;
 typedef struct _ETaskShellViewPrivate ETaskShellViewPrivate;
@@ -61,7 +59,8 @@ struct _ETaskShellViewClass {
 	EShellViewClass parent_class;
 };
 
-GType		e_task_shell_view_get_type	(GTypeModule *type_module);
+GType		e_task_shell_view_get_type	(void);
+void		e_task_shell_view_register_type	(GTypeModule *type_module);
 
 G_END_DECLS
 
diff --git a/calendar/module/evolution-module-calendar.c b/calendar/module/evolution-module-calendar.c
new file mode 100644
index 0000000..b1d5f97
--- /dev/null
+++ b/calendar/module/evolution-module-calendar.c
@@ -0,0 +1,65 @@
+/*
+ * evolution-module-calendar.c
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>  
+ *
+ *
+ * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
+ *
+ */
+
+#include "e-cal-shell-backend.h"
+#include "e-cal-shell-content.h"
+#include "e-cal-shell-sidebar.h"
+#include "e-cal-shell-view.h"
+
+#include "e-memo-shell-backend.h"
+#include "e-memo-shell-content.h"
+#include "e-memo-shell-sidebar.h"
+#include "e-memo-shell-view.h"
+
+#include "e-task-shell-backend.h"
+#include "e-task-shell-content.h"
+#include "e-task-shell-sidebar.h"
+#include "e-task-shell-view.h"
+
+/* Module Entry Points */
+void e_module_load (GTypeModule *type_module);
+void e_module_unload (GTypeModule *type_module);
+
+void
+e_module_load (GTypeModule *type_module)
+{
+	/* Register dynamically loaded types. */
+
+	e_cal_shell_backend_register_type (type_module);
+	e_cal_shell_content_register_type (type_module);
+	e_cal_shell_sidebar_register_type (type_module);
+	e_cal_shell_view_register_type (type_module);
+
+	e_memo_shell_backend_register_type (type_module);
+	e_memo_shell_content_register_type (type_module);
+	e_memo_shell_sidebar_register_type (type_module);
+	e_memo_shell_view_register_type (type_module);
+
+	e_task_shell_backend_register_type (type_module);
+	e_task_shell_content_register_type (type_module);
+	e_task_shell_sidebar_register_type (type_module);
+	e_task_shell_view_register_type (type_module);
+}
+
+void
+e_module_unload (GTypeModule *type_module)
+{
+}
diff --git a/configure.in b/configure.in
index 8ad2503..b174c9e 100644
--- a/configure.in
+++ b/configure.in
@@ -2084,7 +2084,7 @@ calendar/conduits/memo/Makefile
 calendar/gui/Makefile
 calendar/gui/alarm-notify/Makefile
 calendar/gui/dialogs/Makefile
-calendar/modules/Makefile
+calendar/module/Makefile
 composer/Makefile
 mail/Makefile
 mail/default/Makefile
diff --git a/mail/Makefile.am b/mail/Makefile.am
index e290e4c..11ee7f5 100644
--- a/mail/Makefile.am
+++ b/mail/Makefile.am
@@ -35,6 +35,7 @@ module_LTLIBRARIES =					\
 	libevolution-module-mail.la
 
 libevolution_module_mail_la_SOURCES =			\
+	evolution-module-mail.c				\
 	e-attachment-handler-mail.c			\
 	e-attachment-handler-mail.h			\
 	e-mail-attachment-bar.c				\
@@ -208,8 +209,8 @@ endif
 #	$(REGEX_LIBS)						\
 #	$(THREADS_LIBS)
 
-#libevolution_mail_la_LDFLAGS = 			\
-#	-avoid-version -module $(NO_UNDEFINED)
+libevolution_module_mail_la_LDFLAGS = 			\
+	-avoid-version -module $(NO_UNDEFINED)
 
 #libevolution_mail_la_DEPENDENCIES = em-filter-i18n.h
 
diff --git a/mail/e-mail-shell-backend.c b/mail/e-mail-shell-backend.c
index 0d0521e..8b5f654 100644
--- a/mail/e-mail-shell-backend.c
+++ b/mail/e-mail-shell-backend.c
@@ -38,6 +38,7 @@
 
 #include "e-mail-shell-migrate.h"
 #include "e-mail-shell-settings.h"
+#include "e-mail-shell-sidebar.h"
 #include "e-mail-shell-view.h"
 
 #include "e-attachment-handler-mail.h"
@@ -104,12 +105,8 @@ struct _EMailShellBackendPrivate {
 	guint mail_sync_timeout_source_id;
 };
 
-/* Module Entry Points */
-void e_module_load (GTypeModule *type_module);
-void e_module_unload (GTypeModule *type_module);
-
-GType e_mail_shell_backend_type = 0;
 static gpointer parent_class;
+static GType mail_shell_backend_type;
 
 /* The array elements correspond to EMailFolderType. */
 static struct {
@@ -1031,41 +1028,30 @@ mail_shell_backend_init (EMailShellBackend *mail_shell_backend)
 }
 
 GType
-e_mail_shell_backend_get_type (GTypeModule *type_module)
-{
-	if (e_mail_shell_backend_type == 0) {
-		const GTypeInfo type_info = {
-			sizeof (EMailShellBackendClass),
-			(GBaseInitFunc) NULL,
-			(GBaseFinalizeFunc) NULL,
-			(GClassInitFunc) mail_shell_backend_class_init,
-			(GClassFinalizeFunc) NULL,
-			NULL,  /* class_data */
-			sizeof (EMailShellBackend),
-			0,     /* n_preallocs */
-			(GInstanceInitFunc) mail_shell_backend_init,
-			NULL   /* value_table */
-		};
-
-		e_mail_shell_backend_type =
-			g_type_module_register_type (
-				type_module, E_TYPE_SHELL_BACKEND,
-				"EMailShellBackend", &type_info, 0);
-	}
-
-	return e_mail_shell_backend_type;
-}
-
-void
-e_module_load (GTypeModule *type_module)
+e_mail_shell_backend_get_type (void)
 {
-	e_mail_shell_backend_get_type (type_module);
-	e_mail_shell_view_get_type (type_module);
+	return mail_shell_backend_type;
 }
 
 void
-e_module_unload (GTypeModule *type_module)
+e_mail_shell_backend_register_type (GTypeModule *type_module)
 {
+	const GTypeInfo type_info = {
+		sizeof (EMailShellBackendClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) mail_shell_backend_class_init,
+		(GClassFinalizeFunc) NULL,
+		NULL,  /* class_data */
+		sizeof (EMailShellBackend),
+		0,     /* n_preallocs */
+		(GInstanceInitFunc) mail_shell_backend_init,
+		NULL   /* value_table */
+	};
+
+	mail_shell_backend_type = g_type_module_register_type (
+		type_module, E_TYPE_SHELL_BACKEND,
+		"EMailShellBackend", &type_info, 0);
 }
 
 /******************************** Public API *********************************/
diff --git a/mail/e-mail-shell-backend.h b/mail/e-mail-shell-backend.h
index fdf8ec6..7521559 100644
--- a/mail/e-mail-shell-backend.h
+++ b/mail/e-mail-shell-backend.h
@@ -31,7 +31,7 @@
 
 /* Standard GObject macros */
 #define E_TYPE_MAIL_SHELL_BACKEND \
-	(e_mail_shell_backend_type)
+	(e_mail_shell_backend_get_type ())
 #define E_MAIL_SHELL_BACKEND(obj) \
 	(G_TYPE_CHECK_INSTANCE_CAST \
 	((obj), E_TYPE_MAIL_SHELL_BACKEND, EMailShellBackend))
@@ -50,8 +50,6 @@
 
 G_BEGIN_DECLS
 
-extern GType e_mail_shell_backend_type;
-
 typedef struct _EMailShellBackend EMailShellBackend;
 typedef struct _EMailShellBackendClass EMailShellBackendClass;
 typedef struct _EMailShellBackendPrivate EMailShellBackendPrivate;
@@ -83,7 +81,8 @@ struct _EMFolderTreeModel;
  *     directory and local folders is too much of a pain for now. */
 extern EMailShellBackend *global_mail_shell_backend;
 
-GType		e_mail_shell_backend_get_type
+GType		e_mail_shell_backend_get_type	(void);
+void		e_mail_shell_backend_register_type
 					(GTypeModule *type_module);
 CamelFolder *	e_mail_shell_backend_get_folder
 					(EMailShellBackend *mail_shell_backend,
diff --git a/mail/e-mail-shell-content.c b/mail/e-mail-shell-content.c
index 50bf047..de07873 100644
--- a/mail/e-mail-shell-content.c
+++ b/mail/e-mail-shell-content.c
@@ -78,6 +78,7 @@ enum {
 };
 
 static gpointer parent_class;
+static GType mail_shell_content_type;
 
 static void
 mail_shell_content_etree_unfreeze (MessageList *message_list,
@@ -677,37 +678,38 @@ mail_shell_content_init (EMailShellContent *mail_shell_content)
 GType
 e_mail_shell_content_get_type (void)
 {
-	static GType type = 0;
-
-	if (G_UNLIKELY (type == 0)) {
-		static const GTypeInfo type_info = {
-			sizeof (EMailShellContentClass),
-			(GBaseInitFunc) NULL,
-			(GBaseFinalizeFunc) NULL,
-			(GClassInitFunc) mail_shell_content_class_init,
-			(GClassFinalizeFunc) NULL,
-			NULL,  /* class_data */
-			sizeof (EMailShellContent),
-			0,     /* n_preallocs */
-			(GInstanceInitFunc) mail_shell_content_init,
-			NULL   /* value_table */
-		};
-
-		static const GInterfaceInfo iface_info = {
-			(GInterfaceInitFunc) mail_shell_content_iface_init,
-			(GInterfaceFinalizeFunc) NULL,
-			NULL  /* interface_data */
-		};
-
-		type = g_type_register_static (
-			E_TYPE_SHELL_CONTENT, "EMailShellContent",
-			&type_info, 0);
-
-		g_type_add_interface_static (
-			type, E_TYPE_MAIL_READER, &iface_info);
-	}
+	return mail_shell_content_type;
+}
 
-	return type;
+void
+e_mail_shell_content_register_type (GTypeModule *type_module)
+{
+	static const GTypeInfo type_info = {
+		sizeof (EMailShellContentClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) mail_shell_content_class_init,
+		(GClassFinalizeFunc) NULL,
+		NULL,  /* class_data */
+		sizeof (EMailShellContent),
+		0,     /* n_preallocs */
+		(GInstanceInitFunc) mail_shell_content_init,
+		NULL   /* value_table */
+	};
+
+	static const GInterfaceInfo iface_info = {
+		(GInterfaceInitFunc) mail_shell_content_iface_init,
+		(GInterfaceFinalizeFunc) NULL,
+		NULL  /* interface_data */
+	};
+
+	mail_shell_content_type = g_type_module_register_type (
+		type_module, E_TYPE_SHELL_CONTENT,
+		"EMailShellContent", &type_info, 0);
+
+	g_type_module_add_interface (
+		type_module, mail_shell_content_type,
+		E_TYPE_MAIL_READER, &iface_info);
 }
 
 GtkWidget *
diff --git a/mail/e-mail-shell-content.h b/mail/e-mail-shell-content.h
index 485a9a8..2c5da1b 100644
--- a/mail/e-mail-shell-content.h
+++ b/mail/e-mail-shell-content.h
@@ -25,7 +25,7 @@
 #include <shell/e-shell-content.h>
 #include <shell/e-shell-view.h>
 
-#include "em-format-html-display.h"
+#include <mail/em-format-html-display.h>
 
 /* Standard GObject macros */
 #define E_TYPE_MAIL_SHELL_CONTENT \
@@ -62,30 +62,32 @@ struct _EMailShellContentClass {
 };
 
 GType		e_mail_shell_content_get_type	(void);
-GtkWidget *	e_mail_shell_content_new	(EShellView *shell_view);
+void		e_mail_shell_content_register_type
+					(GTypeModule *type_module);
+GtkWidget *	e_mail_shell_content_new(EShellView *shell_view);
 gboolean	e_mail_shell_content_get_preview_visible
-						(EMailShellContent *mail_shell_content);
+					(EMailShellContent *mail_shell_content);
 void		e_mail_shell_content_set_preview_visible
-						(EMailShellContent *mail_shell_content,
+					(EMailShellContent *mail_shell_content,
 						 gboolean preview_visible);
 gboolean	e_mail_shell_content_get_show_deleted
-						(EMailShellContent *mail_shell_content);
+					(EMailShellContent *mail_shell_content);
 void		e_mail_shell_content_set_show_deleted
-						(EMailShellContent *mail_shell_content,
-						 gboolean show_deleted);
+					(EMailShellContent *mail_shell_content,
+					 gboolean show_deleted);
 gboolean	e_mail_shell_content_get_vertical_view
-						(EMailShellContent *mail_shell_content);
+					(EMailShellContent *mail_shell_content);
 void		e_mail_shell_content_set_vertical_view
-						(EMailShellContent *mail_shell_content,
-						 gboolean vertical_view);
+					(EMailShellContent *mail_shell_content,
+					 gboolean vertical_view);
 GalViewInstance *
 		e_mail_shell_content_get_view_instance
-						(EMailShellContent *mail_shell_content);
+					(EMailShellContent *mail_shell_content);
 void		e_mail_shell_content_set_search_strings
-						(EMailShellContent *mail_shell_content,
-						 GSList *search_strings);
+					(EMailShellContent *mail_shell_content,
+					 GSList *search_strings);
 void		e_mail_shell_content_update_view_instance
-						(EMailShellContent *mail_shell_content);
+					(EMailShellContent *mail_shell_content);
 
 G_END_DECLS
 
diff --git a/mail/e-mail-shell-sidebar.c b/mail/e-mail-shell-sidebar.c
index 0429cda..6f6bdf7 100644
--- a/mail/e-mail-shell-sidebar.c
+++ b/mail/e-mail-shell-sidebar.c
@@ -43,6 +43,7 @@ enum {
 };
 
 static gpointer parent_class;
+static GType mail_shell_sidebar_type;
 
 static void
 mail_shell_sidebar_selection_changed_cb (EShellSidebar *shell_sidebar,
@@ -302,28 +303,28 @@ mail_shell_sidebar_init (EMailShellSidebar *mail_shell_sidebar)
 GType
 e_mail_shell_sidebar_get_type (void)
 {
-	static GType type = 0;
-
-	if (G_UNLIKELY (type == 0)) {
-		static const GTypeInfo type_info = {
-			sizeof (EMailShellSidebarClass),
-			(GBaseInitFunc) NULL,
-			(GBaseFinalizeFunc) NULL,
-			(GClassInitFunc) mail_shell_sidebar_class_init,
-			(GClassFinalizeFunc) NULL,
-			NULL,  /* class_data */
-			sizeof (EMailShellSidebar),
-			0,     /* n_preallocs */
-			(GInstanceInitFunc) mail_shell_sidebar_init,
-			NULL   /* value_table */
-		};
-
-		type = g_type_register_static (
-			E_TYPE_SHELL_SIDEBAR, "EMailShellSidebar",
-			&type_info, 0);
-	}
+	return mail_shell_sidebar_type;
+}
 
-	return type;
+void
+e_mail_shell_sidebar_register_type (GTypeModule *type_module)
+{
+	static const GTypeInfo type_info = {
+		sizeof (EMailShellSidebarClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) mail_shell_sidebar_class_init,
+		(GClassFinalizeFunc) NULL,
+		NULL,  /* class_data */
+		sizeof (EMailShellSidebar),
+		0,     /* n_preallocs */
+		(GInstanceInitFunc) mail_shell_sidebar_init,
+		NULL   /* value_table */
+	};
+
+	mail_shell_sidebar_type = g_type_module_register_type (
+		type_module, E_TYPE_SHELL_SIDEBAR,
+		"EMailShellSidebar", &type_info, 0);
 }
 
 GtkWidget *
diff --git a/mail/e-mail-shell-sidebar.h b/mail/e-mail-shell-sidebar.h
index e53c803..5075225 100644
--- a/mail/e-mail-shell-sidebar.h
+++ b/mail/e-mail-shell-sidebar.h
@@ -70,9 +70,11 @@ struct _EMailShellSidebarClass {
 };
 
 GType		e_mail_shell_sidebar_get_type	(void);
-GtkWidget *	e_mail_shell_sidebar_new	(EShellView *shell_view);
+void		e_mail_shell_sidebar_register_type
+					(GTypeModule *type_module);
+GtkWidget *	e_mail_shell_sidebar_new(EShellView *shell_view);
 EMFolderTree *	e_mail_shell_sidebar_get_folder_tree
-						(EMailShellSidebar *mail_shell_sidebar);
+					(EMailShellSidebar *mail_shell_sidebar);
 
 G_END_DECLS
 
diff --git a/mail/e-mail-shell-view-private.c b/mail/e-mail-shell-view-private.c
index 615001e..552ff1a 100644
--- a/mail/e-mail-shell-view-private.c
+++ b/mail/e-mail-shell-view-private.c
@@ -21,7 +21,7 @@
 
 #include "e-mail-shell-view-private.h"
 
-#include <widgets/menus/gal-view-factory-etable.h>
+#include "widgets/menus/gal-view-factory-etable.h"
 
 static void
 mail_shell_view_folder_tree_selected_cb (EMailShellView *mail_shell_view,
diff --git a/mail/e-mail-shell-view.c b/mail/e-mail-shell-view.c
index 6f4e6f9..f58d1f6 100644
--- a/mail/e-mail-shell-view.c
+++ b/mail/e-mail-shell-view.c
@@ -21,8 +21,8 @@
 
 #include "e-mail-shell-view-private.h"
 
-GType e_mail_shell_view_type = 0;
 static gpointer parent_class;
+static GType mail_shell_view_type;
 
 static void
 mail_shell_view_dispose (GObject *object)
@@ -233,27 +233,28 @@ mail_shell_view_init (EMailShellView *mail_shell_view,
 }
 
 GType
-e_mail_shell_view_get_type (GTypeModule *type_module)
+e_mail_shell_view_get_type (void)
 {
-	if (e_mail_shell_view_type == 0) {
-		const GTypeInfo type_info = {
-			sizeof (EMailShellViewClass),
-			(GBaseInitFunc) NULL,
-			(GBaseFinalizeFunc) NULL,
-			(GClassInitFunc) mail_shell_view_class_init,
-			(GClassFinalizeFunc) NULL,
-			NULL,  /* class_data */
-			sizeof (EMailShellView),
-			0,     /* n_preallocs */
-			(GInstanceInitFunc) mail_shell_view_init,
-			NULL   /* value_table */
-		};
-
-		e_mail_shell_view_type =
-			g_type_module_register_type (
-				type_module, E_TYPE_SHELL_VIEW,
-				"EMailShellView", &type_info, 0);
-	}
+	return mail_shell_view_type;
+}
 
-	return e_mail_shell_view_type;
+void
+e_mail_shell_view_register_type (GTypeModule *type_module)
+{
+	const GTypeInfo type_info = {
+		sizeof (EMailShellViewClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) mail_shell_view_class_init,
+		(GClassFinalizeFunc) NULL,
+		NULL,  /* class_data */
+		sizeof (EMailShellView),
+		0,     /* n_preallocs */
+		(GInstanceInitFunc) mail_shell_view_init,
+		NULL   /* value_table */
+	};
+
+	mail_shell_view_type = g_type_module_register_type (
+		type_module, E_TYPE_SHELL_VIEW,
+		"EMailShellView", &type_info, 0);
 }
diff --git a/mail/e-mail-shell-view.h b/mail/e-mail-shell-view.h
index 2c5a364..2bc7695 100644
--- a/mail/e-mail-shell-view.h
+++ b/mail/e-mail-shell-view.h
@@ -24,12 +24,9 @@
 
 #include <shell/e-shell-view.h>
 
-#include <e-mail-shell-content.h>
-#include <e-mail-shell-sidebar.h>
-
 /* Standard GObject macros */
 #define E_TYPE_MAIL_SHELL_VIEW \
-	(e_mail_shell_view_type)
+	(e_mail_shell_view_get_type ())
 #define E_MAIL_SHELL_VIEW(obj) \
 	(G_TYPE_CHECK_INSTANCE_CAST \
 	((obj), E_TYPE_MAIL_SHELL_VIEW, EMailShellView))
@@ -48,8 +45,6 @@
 
 G_BEGIN_DECLS
 
-extern GType e_mail_shell_view_type;
-
 typedef struct _EMailShellView EMailShellView;
 typedef struct _EMailShellViewClass EMailShellViewClass;
 typedef struct _EMailShellViewPrivate EMailShellViewPrivate;
@@ -63,7 +58,8 @@ struct _EMailShellViewClass {
 	EShellViewClass parent_class;
 };
 
-GType		e_mail_shell_view_get_type
+GType		e_mail_shell_view_get_type	(void);
+void		e_mail_shell_view_register_type
 					(GTypeModule *type_module);
 gboolean	e_mail_shell_view_get_show_deleted
 					(EMailShellView *mail_shell_view);
diff --git a/calendar/modules/e-cal-shell-migrate.h b/mail/evolution-module-mail.c
similarity index 54%
copy from calendar/modules/e-cal-shell-migrate.h
copy to mail/evolution-module-mail.c
index 44cbf68..6f6c956 100644
--- a/calendar/modules/e-cal-shell-migrate.h
+++ b/mail/evolution-module-mail.c
@@ -1,5 +1,5 @@
 /*
- * e-cal-shell-backend-migrate.h
+ * evolution-module-mail.c
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -19,20 +19,27 @@
  *
  */
 
-#ifndef E_CAL_SHELL_BACKEND_MIGRATE_H
-#define E_CAL_SHELL_BACKEND_MIGRATE_H
+#include "e-mail-shell-backend.h"
+#include "e-mail-shell-content.h"
+#include "e-mail-shell-sidebar.h"
+#include "e-mail-shell-view.h"
 
-#include <glib.h>
-#include <shell/e-shell-backend.h>
+/* Module Entry Points */
+void e_module_load (GTypeModule *type_module);
+void e_module_unload (GTypeModule *type_module);
 
-G_BEGIN_DECLS
+void
+e_module_load (GTypeModule *type_module)
+{
+	/* Register dynamically loaded types. */
 
-gboolean	e_cal_shell_backend_migrate	(EShellBackend *shell_backend,
-						 gint major,
-						 gint minor,
-						 gint micro,
-						 GError **error);
+	e_mail_shell_backend_register_type (type_module);
+	e_mail_shell_content_register_type (type_module);
+	e_mail_shell_sidebar_register_type (type_module);
+	e_mail_shell_view_register_type (type_module);
+}
 
-G_END_DECLS
-
-#endif /* E_CAL_SHELL_BACKEND_MIGRATE_H */
+void
+e_module_unload (GTypeModule *type_module)
+{
+}
diff --git a/shell/test/Makefile.am b/shell/test/Makefile.am
index 3b98d1b..7982e29 100644
--- a/shell/test/Makefile.am
+++ b/shell/test/Makefile.am
@@ -1,4 +1,4 @@
-module_LTLIBRARIES = libevolution-test.la
+module_LTLIBRARIES = libevolution-module-test.la
 
 INCLUDES =					\
 	-I$(top_srcdir)/shell			\
@@ -9,17 +9,18 @@ INCLUDES =					\
 	-DG_LOG_DOMAIN=\"evolution-test\"	\
 	$(EVOLUTION_TEST_CFLAGS)
 
-libevolution_test_la_SOURCES =			\
+libevolution_module_test_la_SOURCES =		\
+	evolution-module-test.c			\
 	e-test-shell-backend.c			\
 	e-test-shell-backend.h			\
 	e-test-shell-view.c			\
 	e-test-shell-view.h
 
-libevolution_test_la_LIBADD =			\
+libevolution_module_test_la_LIBADD =		\
 	$(top_builddir)/shell/libeshell.la	\
 	$(EVOLUTION_TEST_LIBS)
 
-libevolution_test_la_LDFLAGS =			\
+libevolution_module_test_la_LDFLAGS =		\
 	-avoid-version -module $(NO_UNDEFINED)
 
 -include $(top_srcdir)/git.mk
diff --git a/shell/test/e-test-shell-backend.c b/shell/test/e-test-shell-backend.c
index cdceb60..0fc6c20 100644
--- a/shell/test/e-test-shell-backend.c
+++ b/shell/test/e-test-shell-backend.c
@@ -23,8 +23,8 @@
 
 #include <glib/gi18n.h>
 
-#include <e-shell.h>
-#include <e-shell-window.h>
+#include "shell/e-shell.h"
+#include "shell/e-shell-window.h"
 
 #include "e-test-shell-view.h"
 
@@ -36,12 +36,8 @@ struct _ETestShellBackendPrivate {
 	gint placeholder;
 };
 
-/* Module Entry Point */
-void e_module_load (GTypeModule *type_module);
-void e_module_unload (GTypeModule *type_module);
-
-GType e_test_shell_backend_type = 0;
 static gpointer parent_class;
+static GType test_shell_backend_type;
 
 static void
 action_test_item_new_cb (GtkAction *action,
@@ -217,39 +213,28 @@ test_shell_backend_init (ETestShellBackend *test_shell_backend)
 }
 
 GType
-e_test_shell_backend_get_type (GTypeModule *type_module)
-{
-	if (e_test_shell_backend_type == 0) {
-		const GTypeInfo type_info = {
-			sizeof (ETestShellBackendClass),
-			(GBaseInitFunc) NULL,
-			(GBaseFinalizeFunc) NULL,
-			(GClassInitFunc) test_shell_backend_class_init,
-			(GClassFinalizeFunc) NULL,
-			NULL,  /* class_data */
-			sizeof (ETestShellBackend),
-			0,     /* n_preallocs */
-			(GInstanceInitFunc) test_shell_backend_init,
-			NULL   /* value_table */
-		};
-
-		e_test_shell_backend_type =
-			g_type_module_register_type (
-				type_module, E_TYPE_SHELL_BACKEND,
-				"ETestShellBackend", &type_info, 0);
-	}
-
-	return e_test_shell_backend_type;
-}
-
-void
-e_module_load (GTypeModule *type_module)
+e_test_shell_backend_get_type (void)
 {
-	e_test_shell_backend_get_type (type_module);
-	e_test_shell_view_get_type (type_module);
+	return test_shell_backend_type;
 }
 
 void
-e_module_unload (GTypeModule *type_module)
-{
+e_test_shell_backend_register_type (GTypeModule *type_module)
+{
+	const GTypeInfo type_info = {
+		sizeof (ETestShellBackendClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) test_shell_backend_class_init,
+		(GClassFinalizeFunc) NULL,
+		NULL,  /* class_data */
+		sizeof (ETestShellBackend),
+		0,     /* n_preallocs */
+		(GInstanceInitFunc) test_shell_backend_init,
+		NULL   /* value_table */
+	};
+
+	test_shell_backend_type = g_type_module_register_type (
+		type_module, E_TYPE_SHELL_BACKEND,
+		"ETestShellBackend", &type_info, 0);
 }
diff --git a/shell/test/e-test-shell-backend.h b/shell/test/e-test-shell-backend.h
index ccb04be..0768e48 100644
--- a/shell/test/e-test-shell-backend.h
+++ b/shell/test/e-test-shell-backend.h
@@ -1,5 +1,5 @@
 /*
- * e-test-shell-backend.c
+ * e-test-shell-backend.h
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -26,7 +26,7 @@
 
 /* Standard GObject macros */
 #define E_TYPE_TEST_SHELL_BACKEND \
-	(e_test_shell_backend_type)
+	(e_test_shell_backend_get_type ())
 #define E_TEST_SHELL_BACKEND(obj) \
 	(G_TYPE_CHECK_INSTANCE_CAST \
 	((obj), E_TYPE_TEST_SHELL_BACKEND, ETestShellBackend))
@@ -45,8 +45,6 @@
 
 G_BEGIN_DECLS
 
-extern GType e_test_shell_backend_type;
-
 typedef struct _ETestShellBackend ETestShellBackend;
 typedef struct _ETestShellBackendClass ETestShellBackendClass;
 typedef struct _ETestShellBackendPrivate ETestShellBackendPrivate;
@@ -60,7 +58,9 @@ struct _ETestShellBackendClass {
 	EShellBackendClass parent_class;
 };
 
-GType		e_test_shell_backend_get_type	(GTypeModule *type_module);
+GType		e_test_shell_backend_get_type	(void);
+void		e_test_shell_backend_register_type
+						(GTypeModule *type_module);
 
 G_END_DECLS
 
diff --git a/shell/test/e-test-shell-view.c b/shell/test/e-test-shell-view.c
index a7326af..f05abff 100644
--- a/shell/test/e-test-shell-view.c
+++ b/shell/test/e-test-shell-view.c
@@ -21,8 +21,8 @@
 
 #include "e-test-shell-view.h"
 
-#include <e-shell-content.h>
-#include <e-shell-sidebar.h>
+#include "shell/e-shell-content.h"
+#include "shell/e-shell-sidebar.h"
 
 #define E_TEST_SHELL_VIEW_GET_PRIVATE(obj) \
 	(G_TYPE_INSTANCE_GET_PRIVATE \
@@ -32,8 +32,8 @@ struct _ETestShellViewPrivate {
 	EActivity *activity;
 };
 
-GType e_test_shell_view_type = 0;
 static gpointer parent_class;
+static GType test_shell_view_type;
 
 static void
 test_shell_view_toggled (EShellView *shell_view)
@@ -128,27 +128,28 @@ test_shell_view_init (ETestShellView *test_shell_view)
 }
 
 GType
-e_test_shell_view_get_type (GTypeModule *type_module)
+e_test_shell_view_get_type (void)
 {
-	if (e_test_shell_view_type == 0) {
-		const GTypeInfo type_info = {
-			sizeof (ETestShellViewClass),
-			(GBaseInitFunc) NULL,
-			(GBaseFinalizeFunc) NULL,
-			(GClassInitFunc) test_shell_view_class_init,
-			(GClassFinalizeFunc) NULL,
-			type_module,
-			sizeof (ETestShellView),
-			0,    /* n_preallocs */
-			(GInstanceInitFunc) test_shell_view_init,
-			NULL  /* value_table */
-		};
-
-		e_test_shell_view_type =
-			g_type_module_register_type (
-				type_module, E_TYPE_SHELL_VIEW,
-				"ETestShellView", &type_info, 0);
-	}
+	return test_shell_view_type;
+}
 
-	return e_test_shell_view_type;
+void
+e_test_shell_view_register_type (GTypeModule *type_module)
+{
+	const GTypeInfo type_info = {
+		sizeof (ETestShellViewClass),
+		(GBaseInitFunc) NULL,
+		(GBaseFinalizeFunc) NULL,
+		(GClassInitFunc) test_shell_view_class_init,
+		(GClassFinalizeFunc) NULL,
+		type_module,
+		sizeof (ETestShellView),
+		0,    /* n_preallocs */
+		(GInstanceInitFunc) test_shell_view_init,
+		NULL  /* value_table */
+	};
+
+	test_shell_view_type = g_type_module_register_type (
+		type_module, E_TYPE_SHELL_VIEW,
+		"ETestShellView", &type_info, 0);
 }
diff --git a/shell/test/e-test-shell-view.h b/shell/test/e-test-shell-view.h
index df1098a..b84fba9 100644
--- a/shell/test/e-test-shell-view.h
+++ b/shell/test/e-test-shell-view.h
@@ -22,11 +22,11 @@
 #ifndef E_TEST_SHELL_VIEW_H
 #define E_TEST_SHELL_VIEW_H
 
-#include <e-shell-view.h>
+#include <shell/e-shell-view.h>
 
 /* Standard GObject macros */
 #define E_TYPE_TEST_SHELL_VIEW \
-	(e_test_shell_view_type)
+	(e_test_shell_view_get_type ())
 #define E_TEST_SHELL_VIEW(obj) \
 	(G_TYPE_CHECK_INSTANCE_CAST \
 	((obj), E_TYPE_TEST_SHELL_VIEW, ETestShellView))
@@ -45,8 +45,6 @@
 
 G_BEGIN_DECLS
 
-extern GType e_test_shell_view_type;
-
 typedef struct _ETestShellView ETestShellView;
 typedef struct _ETestShellViewClass ETestShellViewClass;
 typedef struct _ETestShellViewPrivate ETestShellViewPrivate;
@@ -60,7 +58,8 @@ struct _ETestShellViewClass {
 	EShellViewClass parent_class;
 };
 
-GType		e_test_shell_view_get_type	(GTypeModule *type_module);
+GType		e_test_shell_view_get_type	(void);
+void		e_test_shell_view_register_type	(GTypeModule *type_module);
 
 G_END_DECLS
 
diff --git a/calendar/modules/e-cal-shell-migrate.h b/shell/test/evolution-module-test.c
similarity index 61%
rename from calendar/modules/e-cal-shell-migrate.h
rename to shell/test/evolution-module-test.c
index 44cbf68..5f3bb26 100644
--- a/calendar/modules/e-cal-shell-migrate.h
+++ b/shell/test/evolution-module-test.c
@@ -1,5 +1,5 @@
 /*
- * e-cal-shell-backend-migrate.h
+ * evolution-module-test.c
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -19,20 +19,23 @@
  *
  */
 
-#ifndef E_CAL_SHELL_BACKEND_MIGRATE_H
-#define E_CAL_SHELL_BACKEND_MIGRATE_H
+#include "e-test-shell-backend.h"
+#include "e-test-shell-view.h"
 
-#include <glib.h>
-#include <shell/e-shell-backend.h>
+/* Module Entry Points */
+void e_module_load (GTypeModule *type_module);
+void e_module_unload (GTypeModule *type_module);
 
-G_BEGIN_DECLS
+void
+e_module_load (GTypeModule *type_module)
+{
+	/* Register dynamically loaded types. */
 
-gboolean	e_cal_shell_backend_migrate	(EShellBackend *shell_backend,
-						 gint major,
-						 gint minor,
-						 gint micro,
-						 GError **error);
+	e_test_shell_backend_register_type (type_module);
+	e_test_shell_view_register_type (type_module);
+}
 
-G_END_DECLS
-
-#endif /* E_CAL_SHELL_BACKEND_MIGRATE_H */
+void
+e_module_unload (GTypeModule *type_module)
+{
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]