From 20801a94aaba0002a8adb7df3829494e4164d5bf Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Thu, 9 Aug 2001 23:37:56 +0000 Subject: Add the menu items using the EShellUserCreatableItemsHandler. * e-shell-view.c (e_shell_view_construct): Add the menu items using the EShellUserCreatableItemsHandler. * e-shell-user-creatable-items-handler.c: New. * e-shell-user-creatable-items-handler.h: New. * e-shell.c: New member `user_creatable_items_handler' in `EShellPrivate'. (init): Initialize to NULL. (destroy): Unref. (e_shell_construct): Create here. (e_shell_get_user_creatable_items_handler): New accessor. (setup_components): Add the registered components to the user_creatable_items_handler. * evolution-test-component.c (factory_fn): Add a couple sample user-creatable items. (user_create_new_item_callback): New callback for the "user_create_new_item" signal on the EvolutionShellComponent. (factory_fn): Connect. * e-shell.c (e_shell_get_component_registry): New. * evolution-shell-component.c: New enum value `USER_CREATE_NEW_ITEM'. New member `user_create_item_types' in `_EvolutionShellComponentPrivate'. (init): Init to NULL. (impl_destroy): Free it. (user_creatable_item_type_free): New helper function. (user_creatable_item_type_new): New helper function. (impl_userCreateNewItem): New, implementation for ::userCreateNewItem. (class_init): Install the "user_create_new_item" signal and the userCreateNewItem impl. (impl__get_external_uri_schemas): Renamed from `impl_ShellComponent__get_external_uri_schemas'. (impl___get_supported_types): Renamed from `impl_ShellComponent__get_supported_types'. (impl__get_user_creatable_item_types): New, implementation for the `user_creatable_item_types' attribute. (class_init): Install it. (evolution_shell_component_add_user_creatable_item): New. * evolution-shell-component.h: Added signal `user_create_new_item'. * Evolution-ShellComponent.idl: Added typedefs `UserCreatableItemType', `UserCreatableItemTypeList'. New attribute `user_creatable_item_types'. (userCreateNewItem): New. svn path=/trunk/; revision=11849 --- shell/evolution-shell-component.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'shell/evolution-shell-component.h') diff --git a/shell/evolution-shell-component.h b/shell/evolution-shell-component.h index de48b84108..69a17f69a9 100644 --- a/shell/evolution-shell-component.h +++ b/shell/evolution-shell-component.h @@ -43,6 +43,7 @@ extern "C" { #define EVOLUTION_IS_SHELL_COMPONENT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), EVOLUTION_TYPE_SHELL_COMPONENT)) #define EVOLUTION_SHELL_COMPONENT_POPUP_PLACEHOLDER "/popups/FolderPopup/ComponentPlaceholder" + typedef struct _EvolutionShellComponent EvolutionShellComponent; typedef struct _EvolutionShellComponentPrivate EvolutionShellComponentPrivate; @@ -138,6 +139,9 @@ struct _EvolutionShellComponentClass { void (* handle_external_uri) (EvolutionShellComponent *shell_component, const char *uri); + + void (* user_create_new_item) (EvolutionShellComponent *shell_component, + const char *id); }; @@ -163,6 +167,12 @@ EvolutionShellComponent *evolution_shell_component_new (const EvolutionSh void *closure); EvolutionShellClient *evolution_shell_component_get_owner (EvolutionShellComponent *shell_component); +void evolution_shell_component_add_user_creatable_item (EvolutionShellComponent *shell_component, + const char *id, + const char *description, + const char *menu_description, + char menu_shortcut); + #ifdef cplusplus } #endif /* cplusplus */ -- cgit v1.2.3