From 906f93a130d8d670c4b5213c2c2bf03c47c02337 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 21 Mar 2010 22:22:57 -0400 Subject: Demonstrate extending the EExtension API. Introduce e_extensible_list_extensions(), which provides extensible objects access to their own extensions, or a subset of them. Convert EShellBackend to an abstract EExtension subtype. EShell will load its extensions with e_extensible_load_extensions(), and then obtain a list of EShellBackend extensions as follows: shell_backends = e_extensible_list_extensions ( E_EXTENSIBLE (shell), E_TYPE_SHELL_BACKEND); Because EShellBackend is abstract, its GType is skipped while traversing the GType hierarchy to find EShell extensions. --- shell/e-shell-backend.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'shell/e-shell-backend.h') diff --git a/shell/e-shell-backend.h b/shell/e-shell-backend.h index df4abc8104..055a2a3322 100644 --- a/shell/e-shell-backend.h +++ b/shell/e-shell-backend.h @@ -24,6 +24,7 @@ #include #include +#include /* Standard GObject macros */ #define E_TYPE_SHELL_BACKEND \ @@ -60,7 +61,7 @@ typedef struct _EShellBackendPrivate EShellBackendPrivate; * functions below. **/ struct _EShellBackend { - GObject parent; + EExtension parent; EShellBackendPrivate *priv; }; @@ -94,7 +95,7 @@ struct _EShellBackend { * #EShellBackendClass contains a number of important settings for subclasses. **/ struct _EShellBackendClass { - GObjectClass parent_class; + EExtensionClass parent_class; GType shell_view_type; -- cgit v1.2.3