evolution r36533 - in branches/kill-bonobo: addressbook/gui/widgets calendar/modules doc/reference/shell doc/reference/shell/tmpl shell shell/test



Author: mbarnes
Date: Wed Oct  1 18:58:37 2008
New Revision: 36533
URL: http://svn.gnome.org/viewvc/evolution?rev=36533&view=rev

Log:
Add more EShell API documentation.


Modified:
   branches/kill-bonobo/addressbook/gui/widgets/e-addressbook-view.c
   branches/kill-bonobo/calendar/modules/e-cal-shell-view-private.c
   branches/kill-bonobo/calendar/modules/e-memo-shell-view-private.c
   branches/kill-bonobo/calendar/modules/e-task-shell-view-private.c
   branches/kill-bonobo/doc/reference/shell/eshell-sections.txt
   branches/kill-bonobo/doc/reference/shell/tmpl/e-shell-view.sgml
   branches/kill-bonobo/doc/reference/shell/tmpl/eshell-unused.sgml
   branches/kill-bonobo/shell/e-shell-sidebar.c
   branches/kill-bonobo/shell/e-shell-taskbar.c
   branches/kill-bonobo/shell/e-shell-view.c
   branches/kill-bonobo/shell/e-shell-view.h
   branches/kill-bonobo/shell/test/e-test-shell-view.c

Modified: branches/kill-bonobo/addressbook/gui/widgets/e-addressbook-view.c
==============================================================================
--- branches/kill-bonobo/addressbook/gui/widgets/e-addressbook-view.c	(original)
+++ branches/kill-bonobo/addressbook/gui/widgets/e-addressbook-view.c	Wed Oct  1 18:58:37 2008
@@ -854,9 +854,11 @@
 {
 	EActivity *activity;
 	EShellView *shell_view;
+	EShellModule *shell_module;
 
 	activity = view->priv->activity;
 	shell_view = e_addressbook_view_get_shell_view (view);
+	shell_module = e_shell_view_get_shell_module (shell_view);
 
 	if (status == NULL || *status == '\0') {
 		if (activity != NULL) {
@@ -868,7 +870,7 @@
 	} else if (activity == NULL) {
 		activity = e_activity_new (status);
 		view->priv->activity = activity;
-		e_shell_view_add_activity (shell_view, activity);
+		e_shell_module_add_activity (shell_module, activity);
 
 	} else
 		e_activity_set_primary_text (activity, status);

Modified: branches/kill-bonobo/calendar/modules/e-cal-shell-view-private.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-cal-shell-view-private.c	(original)
+++ branches/kill-bonobo/calendar/modules/e-cal-shell-view-private.c	Wed Oct  1 18:58:37 2008
@@ -172,11 +172,13 @@
 {
 	EActivity *activity;
 	EShellView *shell_view;
+	EShellModule *shell_module;
 
 	g_return_if_fail (E_IS_CAL_SHELL_VIEW (cal_shell_view));
 
 	activity = cal_shell_view->priv->activity;
 	shell_view = E_SHELL_VIEW (cal_shell_view);
+	shell_module = e_shell_view_get_shell_module (shell_view);
 
 	if (status_message == NULL || *status_message == '\0') {
 		if (activity != NULL) {
@@ -187,7 +189,7 @@
 
 	} else if (activity == NULL) {
 		activity = e_activity_new (status_message);
-		e_shell_view_add_activity (shell_view, activity);
+		e_shell_module_add_activity (shell_module, activity);
 
 	} else
 		e_activity_set_primary_text (activity, status_message);

Modified: branches/kill-bonobo/calendar/modules/e-memo-shell-view-private.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-memo-shell-view-private.c	(original)
+++ branches/kill-bonobo/calendar/modules/e-memo-shell-view-private.c	Wed Oct  1 18:58:37 2008
@@ -448,11 +448,13 @@
 {
 	EActivity *activity;
 	EShellView *shell_view;
+	EShellModule *shell_module;
 
 	g_return_if_fail (E_IS_MEMO_SHELL_VIEW (memo_shell_view));
 
 	activity = memo_shell_view->priv->activity;
 	shell_view = E_SHELL_VIEW (memo_shell_view);
+	shell_module = e_shell_view_get_shell_module (shell_view);
 
 	if (status_message == NULL || *status_message == '\0') {
 		if (activity != NULL) {
@@ -463,7 +465,7 @@
 
 	} else if (activity == NULL) {
 		activity = e_activity_new (status_message);
-		e_shell_view_add_activity (shell_view, activity);
+		e_shell_module_add_activity (shell_module, activity);
 
 	} else
 		e_activity_set_primary_text (activity, status_message);

Modified: branches/kill-bonobo/calendar/modules/e-task-shell-view-private.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-task-shell-view-private.c	(original)
+++ branches/kill-bonobo/calendar/modules/e-task-shell-view-private.c	Wed Oct  1 18:58:37 2008
@@ -427,11 +427,13 @@
 {
 	EActivity *activity;
 	EShellView *shell_view;
+	EShellModule *shell_module;
 
 	g_return_if_fail (E_IS_TASK_SHELL_VIEW (task_shell_view));
 
 	activity = task_shell_view->priv->activity;
 	shell_view = E_SHELL_VIEW (task_shell_view);
+	shell_module = e_shell_view_get_shell_module (shell_view);
 
 	if (status_message == NULL || *status_message == '\0') {
 		if (activity != NULL) {
@@ -442,7 +444,7 @@
 
 	} else if (activity == NULL) {
 		activity = e_activity_new (status_message);
-		e_shell_view_add_activity (shell_view, activity);
+		e_shell_module_add_activity (shell_module, activity);
 
 	} else
 		e_activity_set_primary_text (activity, status_message);

Modified: branches/kill-bonobo/doc/reference/shell/eshell-sections.txt
==============================================================================
--- branches/kill-bonobo/doc/reference/shell/eshell-sections.txt	(original)
+++ branches/kill-bonobo/doc/reference/shell/eshell-sections.txt	Wed Oct  1 18:58:37 2008
@@ -23,10 +23,11 @@
 E_SHELL
 E_IS_SHELL
 E_TYPE_SHELL
-e_shell_get_type
 E_SHELL_CLASS
 E_IS_SHELL_CLASS
 E_SHELL_GET_CLASS
+EShellClass
+e_shell_get_type
 <SUBSECTION Private>
 EShellPrivate
 </SECTION>
@@ -35,6 +36,7 @@
 <FILE>e-shell-view</FILE>
 <TITLE>EShellView</TITLE>
 EShellView
+EShellViewClass
 e_shell_view_get_name
 e_shell_view_get_action
 e_shell_view_get_title
@@ -42,7 +44,6 @@
 e_shell_view_get_view_id
 e_shell_view_set_view_id
 e_shell_view_is_active
-e_shell_view_add_activity
 e_shell_view_get_page_num
 e_shell_view_get_size_group
 e_shell_view_get_shell_content
@@ -56,10 +57,10 @@
 E_SHELL_VIEW
 E_IS_SHELL_VIEW
 E_TYPE_SHELL_VIEW
-e_shell_view_get_type
 E_SHELL_VIEW_CLASS
 E_IS_SHELL_VIEW_CLASS
 E_SHELL_VIEW_GET_CLASS
+e_shell_view_get_type
 <SUBSECTION Private>
 EShellViewPrivate
 </SECTION>
@@ -79,10 +80,11 @@
 E_SHELL_SWITCHER
 E_IS_SHELL_SWITCHER
 E_TYPE_SHELL_SWITCHER
-e_shell_switcher_get_type
 E_SHELL_SWITCHER_CLASS
 E_IS_SHELL_SWITCHER_CLASS
 E_SHELL_SWITCHER_GET_CLASS
+EShellSwitcherClass
+e_shell_switcher_get_type
 <SUBSECTION Private>
 EShellSwitcherPrivate
 E_SHELL_SWITCHER_DEFAULT_TOOLBAR_STYLE
@@ -97,10 +99,11 @@
 E_SHELL_SIDEBAR
 E_IS_SHELL_SIDEBAR
 E_TYPE_SHELL_SIDEBAR
-e_shell_sidebar_get_type
 E_SHELL_SIDEBAR_CLASS
 E_IS_SHELL_SIDEBAR_CLASS
 E_SHELL_SIDEBAR_GET_CLASS
+EShellSidebarClass
+e_shell_sidebar_get_type
 <SUBSECTION Private>
 EShellSidebarPrivate
 </SECTION>
@@ -114,10 +117,11 @@
 E_SHELL_TASKBAR
 E_IS_SHELL_TASKBAR
 E_TYPE_SHELL_TASKBAR
-e_shell_taskbar_get_type
 E_SHELL_TASKBAR_CLASS
 E_IS_SHELL_TASKBAR_CLASS
 E_SHELL_TASKBAR_GET_CLASS
+EShellTaskbarClass
+e_shell_taskbar_get_type
 <SUBSECTION Private>
 EShellTaskbarPrivate
 </SECTION>
@@ -142,10 +146,11 @@
 E_SHELL_MODULE
 E_IS_SHELL_MODULE
 E_TYPE_SHELL_MODULE
-e_shell_module_get_type
 E_SHELL_MODULE_CLASS
 E_IS_SHELL_MODULE_CLASS
 E_SHELL_MODULE_GET_CLASS
+EShellModuleClass
+e_shell_module_get_type
 <SUBSECTION Private>
 EShellModulePrivate
 </SECTION>
@@ -159,10 +164,11 @@
 E_SHELL_CONTENT
 E_IS_SHELL_CONTENT
 E_TYPE_SHELL_CONTENT
-e_shell_content_get_type
 E_SHELL_CONTENT_CLASS
 E_IS_SHELL_CONTENT_CLASS
 E_SHELL_CONTENT_GET_CLASS
+EShellContentClass
+e_shell_content_get_type
 <SUBSECTION Private>
 EShellContentPrivate
 </SECTION>
@@ -188,10 +194,11 @@
 E_SHELL_WINDOW
 E_IS_SHELL_WINDOW
 E_TYPE_SHELL_WINDOW
-e_shell_window_get_type
 E_SHELL_WINDOW_CLASS
 E_IS_SHELL_WINDOW_CLASS
 E_SHELL_WINDOW_GET_CLASS
+EShellWindowClass
+e_shell_window_get_type
 <SUBSECTION Private>
 EShellWindowPrivate
 E_SHELL_WINDOW_ACTION

Modified: branches/kill-bonobo/doc/reference/shell/tmpl/e-shell-view.sgml
==============================================================================
--- branches/kill-bonobo/doc/reference/shell/tmpl/e-shell-view.sgml	(original)
+++ branches/kill-bonobo/doc/reference/shell/tmpl/e-shell-view.sgml	Wed Oct  1 18:58:37 2008
@@ -77,6 +77,24 @@
 
 </para>
 
+<!-- ##### STRUCT EShellViewClass ##### -->
+<para>
+
+</para>
+
+ parent_class: 
+ label: 
+ icon_name: 
+ ui_definition: 
+ search_options: 
+ type_module: 
+ view_collection: 
+ new_shell_content: 
+ new_shell_sidebar: 
+ new_shell_taskbar: 
+ toggled: 
+ update_actions: 
+
 <!-- ##### FUNCTION e_shell_view_get_name ##### -->
 <para>
 
@@ -140,15 +158,6 @@
 @Returns: 
 
 
-<!-- ##### FUNCTION e_shell_view_add_activity ##### -->
-<para>
-
-</para>
-
- shell_view: 
- activity: 
-
-
 <!-- ##### FUNCTION e_shell_view_get_page_num ##### -->
 <para>
 

Modified: branches/kill-bonobo/doc/reference/shell/tmpl/eshell-unused.sgml
==============================================================================
--- branches/kill-bonobo/doc/reference/shell/tmpl/eshell-unused.sgml	(original)
+++ branches/kill-bonobo/doc/reference/shell/tmpl/eshell-unused.sgml	Wed Oct  1 18:58:37 2008
@@ -5,3 +5,11 @@
 
 @window: 
 
+<!-- ##### FUNCTION e_shell_view_add_activity ##### -->
+<para>
+
+</para>
+
+ shell_view: 
+ activity: 
+

Modified: branches/kill-bonobo/shell/e-shell-sidebar.c
==============================================================================
--- branches/kill-bonobo/shell/e-shell-sidebar.c	(original)
+++ branches/kill-bonobo/shell/e-shell-sidebar.c	Wed Oct  1 18:58:37 2008
@@ -331,6 +331,11 @@
 	container_class->remove = shell_sidebar_remove;
 	container_class->forall = shell_sidebar_forall;
 
+	/**
+	 * EShellTaskbar:primary-text
+	 *
+	 * The primary text is displayed in bold at the top of the sidebar.
+	 **/
 	g_object_class_install_property (
 		object_class,
 		PROP_PRIMARY_TEXT,
@@ -341,6 +346,12 @@
 			NULL,
 			G_PARAM_READWRITE));
 
+	/**
+	 * EShellTaskbar:secondary-text
+	 *
+	 * The secondary text is displayed in a smaller font at the top of
+	 * the sidebar.
+	 **/
 	g_object_class_install_property (
 		object_class,
 		PROP_SECONDARY_TEXT,
@@ -351,6 +362,11 @@
 			NULL,
 			G_PARAM_READWRITE));
 
+	/**
+	 * EShellSidebar:shell-view
+	 *
+	 * The #EShellView to which the sidebar widget belongs.
+	 **/
 	g_object_class_install_property (
 		object_class,
 		PROP_SHELL_VIEW,
@@ -411,6 +427,12 @@
 	return type;
 }
 
+/**
+ * e_shell_sidebar_new:
+ * @shell_view: an #EShellView
+ *
+ * Creates a new #EShellSidebar instance belonging to @shell_view.
+ **/
 GtkWidget *
 e_shell_sidebar_new (EShellView *shell_view)
 {
@@ -421,6 +443,14 @@
 		"shell-view", shell_view, NULL);
 }
 
+/**
+ * e_shell_sidebar_get_shell_view:
+ * @shell_sidebar: an #EShellSidebar
+ *
+ * Returns the #EShellView that was passed to e_shell_sidebar_new().
+ *
+ * Returns: the #EShellView to which @shell_sidebar belongs
+ **/
 EShellView *
 e_shell_sidebar_get_shell_view (EShellSidebar *shell_sidebar)
 {
@@ -429,6 +459,18 @@
 	return E_SHELL_VIEW (shell_sidebar->priv->shell_view);
 }
 
+/**
+ * e_shell_sidebar_get_primary_text:
+ * @shell_sidebar: an #EShellSidebar
+ *
+ * Returns the primary text for @shell_sidebar.
+ *
+ * The primary text is displayed in bold at the top of the sidebar.  It
+ * defaults to the shell view's label (as seen on the switcher button),
+ * but typically shows the name of the selected item in the sidebar.
+ *
+ * Returns: the primary text for @shell_sidebar
+ **/
 const gchar *
 e_shell_sidebar_get_primary_text (EShellSidebar *shell_sidebar)
 {
@@ -437,6 +479,16 @@
 	return shell_sidebar->priv->primary_text;
 }
 
+/**
+ * e_shell_sidebar_set_primary_text:
+ * @shell_sidebar: an #EShellSidebar
+ *
+ * Sets the primary text for @shell_sidebar.
+ *
+ * The primary text is displayed in bold at the top of the sidebar.  It
+ * defaults to the shell view's label (as seen on the switcher button),
+ * but typically shows the name of the selected item in the sidebar.
+ **/
 void
 e_shell_sidebar_set_primary_text (EShellSidebar *shell_sidebar,
                                   const gchar *primary_text)
@@ -461,6 +513,19 @@
 	g_object_notify (G_OBJECT (shell_sidebar), "primary-text");
 }
 
+/**
+ * e_shell_sidebar_get_secondary_text:
+ * @shell_sidebar: an #EShellSidebar
+ *
+ * Returns the secondary text for @shell_sidebar.
+ *
+ * The secondary text is displayed in a smaller font at the top of the
+ * sidebar.  It typically shows information about the contents of the
+ * selected sidebar item, such as total number of items, number of
+ * selected items, etc.
+ *
+ * Returns: the secondary text for @shell_sidebar
+ **/ 
 const gchar *
 e_shell_sidebar_get_secondary_text (EShellSidebar *shell_sidebar)
 {
@@ -469,6 +534,17 @@
 	return shell_sidebar->priv->secondary_text;
 }
 
+/**
+ * e_shell_sidebar_set_secondary_text:
+ * @shell_sidebar: an #EShellSidebar
+ *
+ * Sets the secondary text for @shell_sidebar.
+ *
+ * The secondary text is displayed in a smaller font at the top of the
+ * sidebar.  It typically shows information about the contents of the
+ * selected sidebar item, such as total number of items, number of
+ * selected items, etc.
+ **/
 void
 e_shell_sidebar_set_secondary_text (EShellSidebar *shell_sidebar,
                                     const gchar *secondary_text)

Modified: branches/kill-bonobo/shell/e-shell-taskbar.c
==============================================================================
--- branches/kill-bonobo/shell/e-shell-taskbar.c	(original)
+++ branches/kill-bonobo/shell/e-shell-taskbar.c	Wed Oct  1 18:58:37 2008
@@ -225,6 +225,11 @@
 	object_class->finalize = shell_taskbar_finalize;
 	object_class->constructed = shell_taskbar_constructed;
 
+	/**
+	 * EShellTaskbar:message
+	 *
+	 * The message to display in the taskbar.
+	 **/
 	g_object_class_install_property (
 		object_class,
 		PROP_MESSAGE,
@@ -236,6 +241,11 @@
 			G_PARAM_READWRITE |
 			G_PARAM_CONSTRUCT));
 
+	/**
+	 * EShellTaskbar:shell-view
+	 *
+	 * The #EShellView to which the taskbar widget belongs.
+	 **/
 	g_object_class_install_property (
 		object_class,
 		PROP_SHELL_VIEW,
@@ -311,6 +321,14 @@
 	return type;
 }
 
+/**
+ * e_shell_taskbar_new:
+ * @shell_view: an #EShellView
+ *
+ * Creates a new #EShellTaskbar instance belonging to @shell_view.
+ *
+ * Returns: a new #EShellTaskbar instance
+ **/
 GtkWidget *
 e_shell_taskbar_new (EShellView *shell_view)
 {
@@ -320,6 +338,14 @@
 		E_TYPE_SHELL_TASKBAR, "shell-view", shell_view, NULL);
 }
 
+/**
+ * e_shell_taskbar_get_shell_view:
+ * @shell_taskbar: an #EShellTaskbar
+ *
+ * Returns the #EShellView that was passed to e_shell_taskbar_new().
+ *
+ * Returns: the #EShellView to which @shell_taskbar belongs
+ **/
 EShellView *
 e_shell_taskbar_get_shell_view (EShellTaskbar *shell_taskbar)
 {
@@ -328,6 +354,16 @@
 	return shell_taskbar->priv->shell_view;
 }
 
+/**
+ * e_shell_taskbar_get_message:
+ * @shell_taskbar: an #EShellTaskbar
+ *
+ * Returns the message currently shown in the taskbar, or an empty string
+ * if no message is shown.  Taskbar messages are used primarily for menu
+ * tooltips.
+ *
+ * Returns: the current taskbar message
+ **/
 const gchar *
 e_shell_taskbar_get_message (EShellTaskbar *shell_taskbar)
 {
@@ -340,6 +376,15 @@
 	return gtk_label_get_text (GTK_LABEL (label));
 }
 
+/**
+ * e_shell_taskbar_set_message:
+ * @shell_taskbar: an #EShellTaskbar
+ * @message: the message to show
+ *
+ * Shows a message in the taskbar.  If @message is %NULL or an empty string,
+ * the taskbar message is cleared.  Taskbar messages are used primarily for
+ * menu tooltips.
+ **/
 void
 e_shell_taskbar_set_message (EShellTaskbar *shell_taskbar,
                              const gchar *message)
@@ -359,6 +404,13 @@
 	g_object_notify (G_OBJECT (shell_taskbar), "message");
 }
 
+/**
+ * e_shell_taskbar_unset_message:
+ * @shell_taskbar: an #EShellTaskbar
+ *
+ * This is equivalent to passing a %NULL message to
+ * e_shell_taskbar_set_message().
+ **/
 void
 e_shell_taskbar_unset_message (EShellTaskbar *shell_taskbar)
 {

Modified: branches/kill-bonobo/shell/e-shell-view.c
==============================================================================
--- branches/kill-bonobo/shell/e-shell-view.c	(original)
+++ branches/kill-bonobo/shell/e-shell-view.c	Wed Oct  1 18:58:37 2008
@@ -374,6 +374,11 @@
 
 	class->toggled = shell_view_toggled;
 
+	/**
+	 * EShellView:action:
+	 *
+	 * The #GtkRadioAction registered with #EShellSwitcher.
+	 **/
 	g_object_class_install_property (
 		object_class,
 		PROP_ACTION,
@@ -385,6 +390,11 @@
 			G_PARAM_READWRITE |
 			G_PARAM_CONSTRUCT_ONLY));
 
+	/**
+	 * EShellView:page-num
+	 *
+	 * The #GtkNotebook page number of the shell view.
+	 **/
 	g_object_class_install_property (
 		object_class,
 		PROP_PAGE_NUM,
@@ -398,6 +408,12 @@
 			G_PARAM_READWRITE |
 			G_PARAM_CONSTRUCT_ONLY));
 
+	/**
+	 * EShellView:title
+	 *
+	 * The title of the shell view.  Also serves as the #EShellWindow
+	 * title when the shell view is active.
+	 **/
 	g_object_class_install_property (
 		object_class,
 		PROP_TITLE,
@@ -408,6 +424,12 @@
 			NULL,
 			G_PARAM_READWRITE));
 
+	/**
+	 * EShellView:shell-content
+	 *
+	 * The content widget appears in an #EShellWindow<!-- -->'s
+	 * right pane.
+	 **/
 	g_object_class_install_property (
 		object_class,
 		PROP_SHELL_CONTENT,
@@ -419,6 +441,12 @@
 			E_TYPE_SHELL_CONTENT,
 			G_PARAM_READABLE));
 
+	/**
+	 * EShellView:shell-sidebar
+	 *
+	 * The sidebar widget appears in an #EShellWindow<!-- -->'s
+	 * left pane.
+	 **/
 	g_object_class_install_property (
 		object_class,
 		PROP_SHELL_SIDEBAR,
@@ -430,6 +458,11 @@
 			E_TYPE_SHELL_SIDEBAR,
 			G_PARAM_READABLE));
 
+	/**
+	 * EShellView:shell-taskbar
+	 *
+	 * The taskbar widget appears at the bottom of an #EShellWindow.
+	 **/
 	g_object_class_install_property (
 		object_class,
 		PROP_SHELL_TASKBAR,
@@ -441,6 +474,11 @@
 			E_TYPE_SHELL_TASKBAR,
 			G_PARAM_READABLE));
 
+	/**
+	 * EShellView:shell-window
+	 *
+	 * The #EShellWindow to which the shell view belongs.
+	 **/
 	g_object_class_install_property (
 		object_class,
 		PROP_SHELL_WINDOW,
@@ -452,6 +490,11 @@
 			G_PARAM_READWRITE |
 			G_PARAM_CONSTRUCT_ONLY));
 
+	/**
+	 * EShellView:view-id
+	 *
+	 * The current #GalView ID.
+	 **/
 	g_object_class_install_property (
 		object_class,
 		PROP_VIEW_ID,
@@ -462,6 +505,20 @@
 			NULL,
 			G_PARAM_READWRITE));
 
+	/**
+	 * EShellView::toggled
+	 * @shell_view: the #EShellView which emitted the signal
+	 *
+	 * Emitted when @shell_view is activated or deactivated.
+	 * Use e_shell_view_is_active() to find out which event has
+	 * occurred.  The shell view being deactivated is always
+	 * notified before the shell view being activated.
+	 *
+	 * By default, #EShellView adds the UI definition file
+	 * given in the <structfield>ui_definition</structfield>
+	 * field of #EShellViewClass on activation, and removes the
+	 * UI definition on deactivation.
+	 **/
 	signals[TOGGLED] = g_signal_new (
 		"toggled",
 		G_OBJECT_CLASS_TYPE (object_class),
@@ -471,6 +528,18 @@
 		g_cclosure_marshal_VOID__VOID,
 		G_TYPE_NONE, 0);
 
+	/**
+	 * EShellView::update-actions
+	 * @shell_view: the #EShellView which emitted the signal
+	 *
+	 * #EShellView subclasses should override the
+	 * <structfield>update_actions</structfield> method in
+	 * #EShellViewClass to update sensitivities, labels, or any
+	 * other aspect of the #GtkAction<!-- -->s they have registered.
+	 *
+	 * Plugins can also connect to this signal to be notified
+	 * when to update their own #GtkAction<!-- -->s.
+	 **/
 	signals[UPDATE_ACTIONS] = g_signal_new (
 		"update-actions",
 		G_OBJECT_CLASS_TYPE (object_class),
@@ -523,6 +592,16 @@
 	return type;
 }
 
+/**
+ * e_shell_view_get_name:
+ * @shell_view: an #EShellView
+ *
+ * Returns the view name for @shell_view, which is also the name of
+ * the corresponding #EShellModule (see the <structfield>name</structfield>
+ * field in #EShellModuleInfo).
+ *
+ * Returns: the view name for @shell_view
+ **/
 const gchar *
 e_shell_view_get_name (EShellView *shell_view)
 {
@@ -537,6 +616,20 @@
 	return g_object_get_data (G_OBJECT (action), "view-name");
 }
 
+/**
+ * e_shell_view_get_action:
+ * @shell_view: an #EShellView
+ *
+ * Returns the switcher action for @shell_view.
+ *
+ * An #EShellWindow creates a #GtkRadioAction for each #EShellView class
+ * it instantiates.  This action gets passed to the #EShellSwitcher, which
+ * displays a button that proxies the action.  The icon at the top of the
+ * sidebar also proxies the action.  When @shell_view is active, the
+ * action's icon becomes the #EShellWindow icon.
+ *
+ * Returns: the switcher action for @shell_view
+ **/
 GtkAction *
 e_shell_view_get_action (EShellView *shell_view)
 {
@@ -545,6 +638,15 @@
 	return shell_view->priv->action;
 }
 
+/**
+ * e_shell_view_get_title:
+ * @shell_view: an #EShellView
+ *
+ * Returns the title for @shell_view.  When @shell_view is active, the
+ * shell view's title becomes the #EShellWindow title.
+ *
+ * Returns: the title for @shell_view
+ **/
 const gchar *
 e_shell_view_get_title (EShellView *shell_view)
 {
@@ -553,6 +655,14 @@
 	return shell_view->priv->title;
 }
 
+/**
+ * e_shell_view_set_title:
+ * @shell_view: an #EShellView
+ * @title: a title for @shell_view
+ *
+ * Sets the title for @shell_view.  When @shell_view is active, the
+ * shell view's title becomes the #EShellWindow title.
+ **/
 void
 e_shell_view_set_title (EShellView *shell_view,
                         const gchar *title)
@@ -571,6 +681,19 @@
 	g_object_notify (G_OBJECT (shell_view), "title");
 }
 
+/**
+ * e_shell_view_get_view_id:
+ * @shell_view: an #EShellView
+ *
+ * Returns the ID of the currently selected #GalView.
+ *
+ * #EShellView subclasses are responsible for keeping this property in
+ * sync with their #GalViewInstance.  #EShellView itself just provides
+ * a place to store the view ID, and emits a #GObject::notify signal
+ * when the property changes.
+ *
+ * Returns: the ID of the current #GalView
+ **/
 const gchar *
 e_shell_view_get_view_id (EShellView *shell_view)
 {
@@ -579,6 +702,18 @@
 	return shell_view->priv->view_id;
 }
 
+/**
+ * e_shell_view_set_view_id:
+ * @shell_view: an #EShellView
+ * @view_id: a #GalView ID
+ *
+ * Selects the #GalView whose ID is equal to @view_id.
+ *
+ * #EShellView subclasses are responsible for keeping this property in
+ * sync with their #GalViewInstance.  #EShellView itself just provides
+ * a place to store the view ID, and emits a #GObject::notify signal
+ * when the property changes.
+ **/
 void
 e_shell_view_set_view_id (EShellView *shell_view,
                           const gchar *view_id)
@@ -594,6 +729,14 @@
 	g_object_notify (G_OBJECT (shell_view), "view-id");
 }
 
+/**
+ * e_shell_view_get_shell_window:
+ * @shell_view: an #EShellView
+ *
+ * Returns the #EShellWindow to which @shell_view belongs.
+ *
+ * Returns: the #EShellWindow to which @shell_view belongs
+ **/
 EShellWindow *
 e_shell_view_get_shell_window (EShellView *shell_view)
 {
@@ -602,6 +745,14 @@
 	return E_SHELL_WINDOW (shell_view->priv->shell_window);
 }
 
+/**
+ * e_shell_view_get_shell_module:
+ * @shell_view: an #EShellView
+ *
+ * Returns the corresponding #EShellModule for @shell_view.
+ *
+ * Returns: the corresponding #EShellModule for @shell_view
+ **/
 EShellModule *
 e_shell_view_get_shell_module (EShellView *shell_view)
 {
@@ -611,13 +762,26 @@
 
 	/* Calling this function during the shell view's instance
 	 * initialization function will return the wrong result,
-	 * so catch that and emit a warning. */
+	 * so watch for that and emit a warning. */
 	shell_view_class = E_SHELL_VIEW_GET_CLASS (shell_view);
 	g_return_val_if_fail (E_IS_SHELL_VIEW_CLASS (shell_view_class), NULL);
 
 	return E_SHELL_MODULE (shell_view_class->type_module);
 }
 
+/**
+ * e_shell_view_is_active:
+ * @shell_view: an #EShellView
+ *
+ * Returns %TRUE if @shell_view is active.  That is, if it's currently
+ * visible in its #EShellWindow.  An #EShellWindow can only display one
+ * shell view at a time.
+ *
+ * Technically this just checks the #GtkToggleAction:active property of
+ * the shell view's switcher action.  See e_shell_view_get_action().
+ *
+ * Returns: %TRUE if @shell_view is active
+ **/
 gboolean
 e_shell_view_is_active (EShellView *shell_view)
 {
@@ -630,19 +794,16 @@
 	return gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
 }
 
-void
-e_shell_view_add_activity (EShellView *shell_view,
-                           EActivity *activity)
-{
-	EShellModule *shell_module;
-
-	g_return_if_fail (E_IS_SHELL_VIEW (shell_view));
-	g_return_if_fail (E_IS_ACTIVITY (activity));
-
-	shell_module = e_shell_view_get_shell_module (shell_view);
-	e_shell_module_add_activity (shell_module, activity);
-}
-
+/**
+ * e_shell_view_get_page_num:
+ * @shell_view: an #EShellView
+ *
+ * This function is only interesting to #EShellWindow.  It returns the
+ * #GtkNotebook page number for @shell_view.  The rest of the application
+ * should have no need for this.
+ *
+ * Returns: the notebook page number for @shell_view
+ **/
 gint
 e_shell_view_get_page_num (EShellView *shell_view)
 {
@@ -651,6 +812,16 @@
 	return shell_view->priv->page_num;
 }
 
+/**
+ * e_shell_view_get_size_group:
+ * @shell_view: an #EShellView
+ *
+ * Returns a #GtkSizeGroup that #EShellContent and #EShellSidebar use
+ * to keep the search bar and sidebar banner vertically aligned.  The
+ * rest of the application should have no need for this.
+ *
+ * Returns: a #GtkSizeGroup for internal use
+ **/
 GtkSizeGroup *
 e_shell_view_get_size_group (EShellView *shell_view)
 {
@@ -659,6 +830,19 @@
 	return shell_view->priv->size_group;
 }
 
+/**
+ * e_shell_view_get_shell_content:
+ * @shell_view: an #EShellView
+ *
+ * Returns the #EShellContent instance for @shell_view.
+ *
+ * By default, #EShellView creates a plain #EShellContent during
+ * initialization.  But #EShellView subclasses can override the
+ * <structfield>new_shell_content</structfield> factory method
+ * in #EShellViewClass to create a custom #EShellContent.
+ *
+ * Returns: the #EShellContent instance for @shell_view
+ **/
 EShellContent *
 e_shell_view_get_shell_content (EShellView *shell_view)
 {
@@ -667,6 +851,19 @@
 	return E_SHELL_CONTENT (shell_view->priv->shell_content);
 }
 
+/**
+ * e_shell_view_get_shell_sidebar:
+ * @shell_view: an #EShellView
+ *
+ * Returns the #EShellSidebar instance for @shell_view.
+ *
+ * By default, #EShellView creates a plain #EShellSidebar during
+ * initialization.  But #EShellView subclasses can override the
+ * <structfield>new_shell_sidebar</structfield> factory method
+ * in #EShellViewClass to create a custom #EShellSidebar.
+ *
+ * Returns: the #EShellSidebar instance for @shell_view
+ **/
 EShellSidebar *
 e_shell_view_get_shell_sidebar (EShellView *shell_view)
 {
@@ -675,6 +872,19 @@
 	return E_SHELL_SIDEBAR (shell_view->priv->shell_sidebar);
 }
 
+/**
+ * e_shell_view_get_shell_taskbar:
+ * @shell_view: an #EShellView
+ *
+ * Returns the #EShellTaskbar instance for @shell_view.
+ *
+ * By default, #EShellView creates a plain #EShellTaskbar during
+ * initialization.  But #EShellView subclasses can override the
+ * <structfield>new_shell_taskbar</structfield> factory method
+ * in #EShellViewClass to create a custom #EShellTaskbar.
+ *
+ * Returns: the #EShellTaskbar instance for @shell_view
+ **/
 EShellTaskbar *
 e_shell_view_get_shell_taskbar (EShellView *shell_view)
 {
@@ -683,6 +893,20 @@
 	return E_SHELL_TASKBAR (shell_view->priv->shell_taskbar);
 }
 
+/**
+ * e_shell_view_update_actions:
+ * @shell_view: an #EShellView
+ *
+ * Emits the #EShellView::update-actions signal.
+ *
+ * #EShellView subclasses should implement the
+ * <structfield>update_actions</structfield> method in #EShellViewClass
+ * to update the various #GtkAction<!-- -->s based on the current
+ * #EShellSidebar and #EShellContent selections.  The
+ * #EShellView::update-actions signal is typically emitted just before
+ * showing a popup menu or just after the user selects an item in the
+ * shell view.
+ **/
 void
 e_shell_view_update_actions (EShellView *shell_view)
 {

Modified: branches/kill-bonobo/shell/e-shell-view.h
==============================================================================
--- branches/kill-bonobo/shell/e-shell-view.h	(original)
+++ branches/kill-bonobo/shell/e-shell-view.h	Wed Oct  1 18:58:37 2008
@@ -35,7 +35,6 @@
 #include <shell/e-shell-taskbar.h>
 #include <shell/e-shell-window.h>
 
-#include <widgets/misc/e-activity.h>
 #include <widgets/menus/gal-view-collection.h>
 
 /* Standard GObject macros */
@@ -74,6 +73,47 @@
 	EShellViewPrivate *priv;
 };
 
+/**
+ * EShellViewClass:
+ * @parent_class:	The parent class structure.
+ * @label:		The initial value for the switcher action's
+ * 			#GtkAction:label property.  See
+ * 			e_shell_view_get_action().
+ * @icon_name:		The initial value for the switcher action's
+ * 			#GtkAction:icon-name property.  See
+ * 			e_shell_view_get_action().
+ * @ui_definition:	Base name of the UI definintion file to add
+ * 			when the shell view is activated.
+ * @search_options:	Widget path in the UI definition to the search
+ * 			options popup menu.  The menu gets shown when the
+ * 			user clicks the "find" icon in the search entry.
+ * @type_module:	The corresponding #GTypeModule for this shell
+ * 			view.  Subclasses are responsible for setting
+ * 			this.  An easy way do so is to pass it to the
+ * 			shell view's #GClassInitFunc via the
+ * 			<structfield>class_data</structfield> field in
+ * 			#GTypeInfo.
+ * @view_collection:	A unique #GalViewCollection instance is created
+ * 			for each subclass and shared across all instances
+ * 			of that subclass.  That much is done automatically
+ * 			for subclasses, but subclasses are still responsible
+ * 			for adding the appropriate #GalView factories to the
+ * 			view collection.
+ * @new_shell_content:	Factory method for the shell view's #EShellContent.
+ * 			See e_shell_view_get_shell_content().
+ * @new_shell_sidebar:	Factory method for the shell view's #EShellSidebar.
+ * 			See e_shell_view_get_shell_sidebar().
+ * @new_shell_taskbar:	Factory method for the shell view's #EShellTaskbar.
+ * 			See e_shell_view_get_shell_taskbar().
+ * @toggled:		Class method for the #EShellView::toggled signal.
+ * 			Subclasses should rarely need to override the
+ * 			default behavior.
+ * @update_actions:	Class method for the #EShellView::update_actions
+ * 			signal.  There is no default behavior; subclasses
+ * 			should override this.
+ *
+ * #EShellViewClass contains a number of important settings for subclasses.
+ **/
 struct _EShellViewClass {
 	GObjectClass parent_class;
 
@@ -84,7 +124,7 @@
 	/* Base name of the UI definition file. */
 	const gchar *ui_definition;
 
-	/* Widget path to the search entry popup menu. */
+	/* Widget path to the search options popup menu. */
 	const gchar *search_options;
 
 	/* Subclasses should set this via the "class_data" field in
@@ -114,8 +154,6 @@
 void		e_shell_view_set_view_id	(EShellView *shell_view,
 						 const gchar *view_id);
 gboolean	e_shell_view_is_active		(EShellView *shell_view);
-void		e_shell_view_add_activity	(EShellView *shell_view,
-						 EActivity *activity);
 gint		e_shell_view_get_page_num	(EShellView *shell_view);
 GtkSizeGroup *	e_shell_view_get_size_group	(EShellView *shell_view);
 EShellContent *	e_shell_view_get_shell_content	(EShellView *shell_view);

Modified: branches/kill-bonobo/shell/test/e-test-shell-view.c
==============================================================================
--- branches/kill-bonobo/shell/test/e-test-shell-view.c	(original)
+++ branches/kill-bonobo/shell/test/e-test-shell-view.c	Wed Oct  1 18:58:37 2008
@@ -70,6 +70,7 @@
 	ETestShellViewPrivate *priv;
 	EShellContent *shell_content;
 	EShellSidebar *shell_sidebar;
+	EShellModule *shell_module;
 	EShellView *shell_view;
 	EActivity *activity;
 	GtkWidget *widget;
@@ -80,6 +81,7 @@
 	priv = E_TEST_SHELL_VIEW_GET_PRIVATE (object);
 
 	shell_view = E_SHELL_VIEW (object);
+	shell_module = e_shell_view_get_shell_module (shell_view);
 	shell_content = e_shell_view_get_shell_content (shell_view);
 	shell_sidebar = e_shell_view_get_shell_sidebar (shell_view);
 
@@ -93,7 +95,7 @@
 
 	activity = e_activity_new ("Test Activity");
 	e_activity_set_cancellable (activity, TRUE);
-	e_shell_view_add_activity (shell_view, activity);
+	e_shell_module_add_activity (shell_module, activity);
 	priv->activity = activity;
 }
 



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