[libgda] GdaBrowser: initial hacking guide
- From: Vivien Malerba <vivien src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [libgda] GdaBrowser: initial hacking guide
- Date: Sun, 30 Aug 2009 20:44:31 +0000 (UTC)
commit e53d32127f318fec188d1d2fb5e4458468fb08e4
Author: Vivien Malerba <malerba gnome-db org>
Date: Sun Aug 30 22:30:58 2009 +0200
GdaBrowser: initial hacking guide
configure.in | 1 +
control-center/cc-gray-bar.c | 14 +-
tools/browser/Makefile.am | 5 +-
tools/browser/browser-connection.c | 35 +++-
tools/browser/browser-core.c | 44 ++-
tools/browser/browser-core.h | 1 +
tools/browser/browser-favorites.c | 38 +++-
tools/browser/browser-favorites.h | 15 +
tools/browser/browser-page.c | 26 ++-
tools/browser/browser-perspective.c | 20 ++-
tools/browser/browser-window.c | 45 +++-
tools/browser/canvas/browser-canvas-item.c | 3 +-
tools/browser/doc/.gitignore | 31 +++
tools/browser/doc/Makefile.am | 76 ++++++
tools/browser/doc/UILayout.png | Bin 0 -> 92440 bytes
tools/browser/doc/fdl-appendix.sgml | 1 +
tools/browser/doc/gda-browser-docs.sgml | 149 +++++++++++
tools/browser/doc/gda-browser-sections.txt | 316 +++++++++++++++++++++++
tools/browser/doc/tmpl/browser-connection.sgml | 137 ++++++++++
tools/browser/doc/tmpl/browser-core.sgml | 167 ++++++++++++
tools/browser/doc/tmpl/browser-favorites.sgml | 134 ++++++++++
tools/browser/doc/tmpl/browser-page.sgml | 108 ++++++++
tools/browser/doc/tmpl/browser-perspective.sgml | 96 +++++++
tools/browser/doc/tmpl/browser-window.sgml | 82 ++++++
tools/browser/doc/tmpl/cc-gray-bar.sgml | 114 ++++++++
tools/browser/main.c | 19 ++
26 files changed, 1628 insertions(+), 49 deletions(-)
---
diff --git a/configure.in b/configure.in
index 0b7cbb5..79f1b94 100644
--- a/configure.in
+++ b/configure.in
@@ -1730,6 +1730,7 @@ tools/browser/common/Makefile
tools/browser/schema-browser/Makefile
tools/browser/dummy-perspective/Makefile
tools/browser/canvas/Makefile
+tools/browser/doc/Makefile
tools/binreloc/Makefile
testing/Makefile
tests/Makefile
diff --git a/control-center/cc-gray-bar.c b/control-center/cc-gray-bar.c
index b98142d..e93fc0a 100644
--- a/control-center/cc-gray-bar.c
+++ b/control-center/cc-gray-bar.c
@@ -351,11 +351,11 @@ cc_gray_bar_get_type (void)
/**
* cc_gray_bar_new
- * @label:
+ * @label: a string label
*
+ * Creates a new #CcGrayBar with a single label.
*
- *
- * Returns:
+ * Returns: a new widget
*/
GtkWidget *
cc_gray_bar_new (const gchar *label)
@@ -369,7 +369,7 @@ cc_gray_bar_new (const gchar *label)
/**
* cc_gray_bar_get_text
- * @bar: A #CcGrayBar widget.
+ * @bar: a #CcGrayBar widget.
*
* Get the text being displayed in the given gray bar widget. This
* does not include any embedded underlines indicating mnemonics or
@@ -391,8 +391,8 @@ cc_gray_bar_get_text (CcGrayBar *bar)
/**
* cc_gray_bar_set_text
- * @bar: A #CcGrayBar widget
- * @text:
+ * @bar: a #CcGrayBar widget
+ * @text: a string
*
* Set the text displayed in the given gray bar widget. This can include
* embedded underlines indicating mnemonics or Pango markup.
@@ -408,7 +408,7 @@ cc_gray_bar_set_text (CcGrayBar *bar, const gchar *text)
/**
* cc_gray_set_icon_from_file
- * @bar: A #CcGrayBar widget.
+ * @bar: a #CcGrayBar widget.
* @file: filename.
*
* Set the icon displayed in the given gray bar widget. This can include
diff --git a/tools/browser/Makefile.am b/tools/browser/Makefile.am
index 0bf5503..ed53931 100644
--- a/tools/browser/Makefile.am
+++ b/tools/browser/Makefile.am
@@ -6,6 +6,7 @@ if HAVE_GOOCANVAS
SUBDIRS+=canvas
noinst_PROGRAMS=canvas-example
endif
+SUBDIRS+= . doc
AM_CPPFLAGS = \
-I$(top_srcdir) \
@@ -37,6 +38,8 @@ libbrowser_la_SOURCES=\
login-dialog.h \
support.c \
support.h \
+ browser-core.c \
+ browser-core.h \
browser-page.c \
browser-page.h \
browser-perspective.c \
@@ -59,8 +62,6 @@ libbrowser_la_SOURCES=\
browser-stock-icons.h
gda_browser_4_0_SOURCES=\
- browser-core.c \
- browser-core.h \
main.c
$(OBJECTS): marshal.c marshal.h
diff --git a/tools/browser/browser-connection.c b/tools/browser/browser-connection.c
index 45959ce..bbae519 100644
--- a/tools/browser/browser-connection.c
+++ b/tools/browser/browser-connection.c
@@ -393,10 +393,14 @@ check_for_wrapper_result (BrowserConnection *bcnc)
/**
* browser_connection_new
+ * @cnc: a #GdaConnection
*
- * Creates a new #BrowserConnection object
+ * Creates a new #BrowserConnection object wrapping @cnc. The browser_core_take_connection() method
+ * must be called on the new object to mahe it managed by the browser.
*
- * Returns: the new object
+ * To close the new connection, use browser_core_close_connection().
+ *
+ * Returns: a new object
*/
BrowserConnection*
browser_connection_new (GdaConnection *cnc)
@@ -472,6 +476,9 @@ browser_connection_new (GdaConnection *cnc)
/**
* browser_connection_get_name
+ * @bcnc: a #BrowserConnection
+ *
+ * Returns: @bcnc's name
*/
const gchar *
browser_connection_get_name (BrowserConnection *bcnc)
@@ -482,6 +489,11 @@ browser_connection_get_name (BrowserConnection *bcnc)
/**
* browser_connection_get_information
+ * @bcnc: a #BrowserConnection
+ *
+ * Get some information about the connection
+ *
+ * Returns: a pointer to the associated #GdaDsnInfo
*/
const GdaDsnInfo *
browser_connection_get_information (BrowserConnection *bcnc)
@@ -528,6 +540,10 @@ browser_connection_get_information (BrowserConnection *bcnc)
* @bcnc: a #BrowserConnection
* @out_reason: a pointer to store a copy of the reason @bcnc is busy (will be set
* to %NULL if @bcnc is not busy)
+ *
+ * Tells if @bcnc is currently busy or not.
+ *
+ * Returns: %TRUE if @bcnc is busy
*/
gboolean
browser_connection_is_busy (BrowserConnection *bcnc, gchar **out_reason)
@@ -547,6 +563,9 @@ browser_connection_is_busy (BrowserConnection *bcnc, gchar **out_reason)
/**
* browser_connection_update_meta_data
+ * @bcnc: a #BrowserConnection
+ *
+ * Make @bcnc update its meta store in the background.
*/
void
browser_connection_update_meta_data (BrowserConnection *bcnc)
@@ -578,7 +597,9 @@ browser_connection_update_meta_data (BrowserConnection *bcnc)
/**
* browser_connection_get_meta_struct
+ * @bcnc: a #BrowserConnection
*
+ * Get the #GdaMetaStruct maintained up to date by @bcnc.
*
* Returns: a #GdaMetaStruct, the caller does not have any reference to it.
*/
@@ -591,9 +612,9 @@ browser_connection_get_meta_struct (BrowserConnection *bcnc)
/**
* browser_connection_get_meta_store
+ * @bcnc: a #BrowserConnection
*
- *
- * Returns: a #GdaMetaStore, the caller does not have any reference to it.
+ * Returns: @bcnc's #GdaMetaStore, the caller does not have any reference to it.
*/
GdaMetaStore *
browser_connection_get_meta_store (BrowserConnection *bcnc)
@@ -604,6 +625,7 @@ browser_connection_get_meta_store (BrowserConnection *bcnc)
/**
* browser_connection_get_dictionary_file
+ * @bcnc: a #BrowserConnection
*
* Returns: the dictionary file name used by @bcnc, or %NULL
*/
@@ -616,8 +638,11 @@ browser_connection_get_dictionary_file (BrowserConnection *bcnc)
/**
* browser_connection_get_favorites
+ * @bcnc: a #BrowserConnection
+ *
+ * Get @bcnc's favorites handler
*
- * Get the favorites handler
+ * Returns: the #BrowserFavorites used by @bcnc
*/
BrowserFavorites *
browser_connection_get_favorites (BrowserConnection *bcnc)
diff --git a/tools/browser/browser-core.c b/tools/browser/browser-core.c
index 46dcd22..f1f5921 100644
--- a/tools/browser/browser-core.c
+++ b/tools/browser/browser-core.c
@@ -23,10 +23,6 @@
#include "browser-window.h"
#include "browser-connection.h"
-/* Perspectives' factories */
-#include "schema-browser/perspective-main.h"
-#include "dummy-perspective/perspective-main.h"
-
/*
* Main static functions
*/
@@ -113,19 +109,20 @@ browser_core_class_init (BrowserCoreClass *klass)
object_class->dispose = browser_core_dispose;
}
+BrowserCoreInitFactories browser_core_init_factories = NULL;
+
static void
browser_core_init (BrowserCore *bcore)
{
bcore->priv = g_new0 (BrowserCorePrivate, 1);
bcore->priv->factories = NULL;
- bcore->priv->factories = g_slist_append (bcore->priv->factories,
- schema_browser_perspective_get_factory ());
- /* set default perspective */
- bcore->priv->default_factory = (BrowserPerspectiveFactory*) bcore->priv->factories->data;
+ if (browser_core_init_factories)
+ bcore->priv->factories = browser_core_init_factories ();
- bcore->priv->factories = g_slist_append (bcore->priv->factories,
- dummy_perspective_get_factory ());
+ /* set default perspective */
+ if (bcore->priv->factories)
+ bcore->priv->default_factory = (BrowserPerspectiveFactory*) bcore->priv->factories->data;
bcore->priv->windows = NULL;
}
@@ -134,6 +131,8 @@ browser_core_init (BrowserCore *bcore)
* browser_core_exists
*
* Tells if a #BrowserCore has already been created
+ *
+ * Returns: %TRUE if the #BrowserCore singleton has already been created
*/
gboolean
browser_core_exists (void)
@@ -142,7 +141,7 @@ browser_core_exists (void)
}
/**
- * browser_core_new
+ * browser_core_get
*
* Returns a #BrowserCore object which holds the browser's configuration. This is
* a singleton factory.
@@ -192,7 +191,8 @@ browser_core_dispose (GObject *object)
* browser_core_take_window
* @bwin: a #BrowserWindow
*
- * Makes sure @bwin is handled by the #BrowserCore object, reference to @bwin is stolen here
+ * Makes sure @bwin is handled by the #BrowserCore object, reference to @bwin is stolen here.
+ * This method should be called after a #BrowserWindow has been created to have it managed properly.
*/
void
browser_core_take_window (BrowserWindow *bwin)
@@ -206,6 +206,8 @@ browser_core_take_window (BrowserWindow *bwin)
/**
* browser_core_close_window
* @bwin: a #BrowserWindow
+ *
+ * Requests that @bwin be closed.
*/
void
browser_core_close_window (BrowserWindow *bwin)
@@ -227,7 +229,8 @@ browser_core_close_window (BrowserWindow *bwin)
/**
* browser_core_get_windows
*
- * Get a list of #BrowserWindow
+ * Get a list of #BrowserWindow mananged by the browser (windows must have been
+ * declared using browser_core_take_window()).
*
* Returns: a new list, free it with g_slist_free()
*/
@@ -243,7 +246,6 @@ browser_core_get_windows (void)
/**
* browser_core_take_connection
- * @bdata: a #BrowserData pointer, or %NULL
* @bcnc: a #BrowserConnection
*
* Makes sure @bcnc is handled by @dbata, reference to @bcnc is stolen here
@@ -260,6 +262,9 @@ browser_core_take_connection (BrowserConnection *bcnc)
/**
* browser_core_close_connection
+ * @bcnc: a #BrowserConnection
+ *
+ * Requests that @bcnc be closed.
*/
void
browser_core_close_connection (BrowserConnection *bcnc)
@@ -291,6 +296,11 @@ browser_core_get_connections (void)
/**
* browser_core_get_default_factory
+ *
+ * Get the default #BrowserPerspectiveFactory used when making new #BrowserWindow if none
+ * is provided when calling browser_window_new().
+ *
+ * Returns: the default #BrowserPerspectiveFactory
*/
BrowserPerspectiveFactory *
browser_core_get_default_factory (void)
@@ -301,6 +311,10 @@ browser_core_get_default_factory (void)
/**
* browser_core_set_default_factory
+ * @factory: the name of a #BrowserPerspectiveFactory
+ *
+ * Sets the default #BrowserPerspectiveFactory used when making new #BrowserWindow if none
+ * is provided when calling browser_window_new().
*/
void
browser_core_set_default_factory (const gchar *factory)
@@ -337,7 +351,7 @@ browser_core_get_factories (void)
/**
* browser_core_quit
*
- * Quits the browser after having made some cleanings
+ * Quits the browser after having made some clean-ups
*/
void
browser_core_quit (void)
diff --git a/tools/browser/browser-core.h b/tools/browser/browser-core.h
index 0378c66..78cd6ae 100644
--- a/tools/browser/browser-core.h
+++ b/tools/browser/browser-core.h
@@ -33,6 +33,7 @@ G_BEGIN_DECLS
typedef struct _BrowserCoreClass BrowserCoreClass;
typedef struct _BrowserCorePrivate BrowserCorePrivate;
+typedef GSList *(*BrowserCoreInitFactories) (void);
/* struct for the object's data */
struct _BrowserCore
diff --git a/tools/browser/browser-favorites.c b/tools/browser/browser-favorites.c
index f77c4b6..e721924 100644
--- a/tools/browser/browser-favorites.c
+++ b/tools/browser/browser-favorites.c
@@ -483,10 +483,12 @@ favorites_reorder (BrowserFavorites *bfav, gint order_key, gint id, gint new_pos
*
* Add a new favorite, or replace an existing one.
* NOTE:
- * - if @fav->id is < 0 then it's either an update or an insert (depending if fav->contents exists)
- * and if it's not it is an UPDATE
- * - @fav->type can't be 0
- * - @fav->contents can't be %NULL
+ * <itemizedlist>
+ * <listitem><para>if @fav->id is < 0 then it's either an update or an insert (depending if fav->contents exists)
+ * and if it's not it is an UPDATE </para></listitem>
+ * <listitem><para>@fav->type can't be 0</para></listitem>
+ * <listitem><para>@fav->contents can't be %NULL</para></listitem>
+ * </itemizedlist>
*
* On success @fav->id contains the favorite's ID, otherwise it will contain -1.
*
@@ -714,6 +716,10 @@ browser_favorites_add (BrowserFavorites *bfav, guint session_id,
/**
* browser_favorites_free_list
+ * @fav_list: a list of #BrowserFavoritesAttributes
+ *
+ * Frees all the #BrowserFavoritesAttributes of the @fav_list list, and frees the list
+ * itself.
*/
void
browser_favorites_free_list (GSList *fav_list)
@@ -731,6 +737,9 @@ browser_favorites_free_list (GSList *fav_list)
/**
* browser_favorites_reset_attributes
+ * @fav: a pointer to a #BrowserFavoritesAttributes
+ *
+ * Resets @fav with empty attributes; it does not free @fav.
*/
void
browser_favorites_reset_attributes (BrowserFavoritesAttributes *fav)
@@ -743,6 +752,13 @@ browser_favorites_reset_attributes (BrowserFavoritesAttributes *fav)
/**
* browser_favorites_list
+ * @bfav: a #BrowserFavorites
+ * @session_id: 0 for now
+ * @type: filter the type of attributes to be listed
+ * @order_key: a key to order the listed favorites, such as #ORDER_KEY_SCHEMA
+ * @error: a place to store errors, or %NULL
+ *
+ * Extract some favorites.
*
* Returns: a new list of #BrowserFavoritesAttributes pointers. The list has to
* be freed using browser_favorites_free_list()
@@ -900,6 +916,14 @@ browser_favorites_list (BrowserFavorites *bfav, guint session_id, BrowserFavorit
/**
* browser_favorites_delete_favorite
+ * @bfav: a #BrowserFavorites
+ * @session_id: 0 for now
+ * @fav: a pointer to a #BrowserFavoritesAttributes definting which favorite to delete
+ * @error: a place to store errors, or %NULL
+ *
+ * Delete a favorite
+ *
+ * Returns: %TRUE if no error occurred.
*/
gboolean
browser_favorites_delete (BrowserFavorites *bfav, guint session_id,
@@ -1003,9 +1027,15 @@ browser_favorites_delete (BrowserFavorites *bfav, guint session_id,
/**
* browser_favorites_get
+ * @bfav: a #BrowserFavorites
+ * @fav_id: the favorite's ID
+ * @out_fav: a #BrowserFavoritesAttributes to be filled with the favorite's attributes
+ * @error: a place to store errors, or %NULL
*
* Get all the information about a favorite from its id: fills the @out_fav
* pointed structure.
+ *
+ * Retuns: %TRUE if no error occurred.
*/
gboolean
browser_favorites_get (BrowserFavorites *bfav, gint fav_id,
diff --git a/tools/browser/browser-favorites.h b/tools/browser/browser-favorites.h
index a810b6b..6609bec 100644
--- a/tools/browser/browser-favorites.h
+++ b/tools/browser/browser-favorites.h
@@ -35,12 +35,27 @@ typedef struct _BrowserFavorites BrowserFavorites;
typedef struct _BrowserFavoritesClass BrowserFavoritesClass;
typedef struct _BrowserFavoritesPrivate BrowserFavoritesPrivate;
+/**
+ * BrowserFavoritesType:
+ * @BROWSER_FAVORITES_TABLES: a database's table favorite
+ * @BROWSER_FAVORITES_DIAGRAMS: a diagram favorite
+ *
+ * Enum to identify favorite's types.
+ */
typedef enum {
BROWSER_FAVORITES_TABLES = 1 << 0,
BROWSER_FAVORITES_DIAGRAMS = 1 << 1
} BrowserFavoritesType;
#define BROWSER_FAVORITES_NB_TYPES 2
+/**
+ * BrowserFavoritesAttributes:
+ * @id: the favorite ID, or <0 if not saved
+ * @type: the favorite's type
+ * @name: the favorite's name
+ * @descr: the favorite's description
+ * @contents: the favorite's contents, depending on the favorite type
+ */
typedef struct {
gint id;
BrowserFavoritesType type;
diff --git a/tools/browser/browser-page.c b/tools/browser/browser-page.c
index c29ac9b..5e580ce 100644
--- a/tools/browser/browser-page.c
+++ b/tools/browser/browser-page.c
@@ -68,8 +68,9 @@ browser_page_class_init (gpointer g_class)
/**
* browser_page_get_actions_group
- * @page:
- * @instance: a GtkWidget which has been returned by a previous call to browser_page_create()
+ * @page: an object implementing the #BrowserPage interface
+ *
+ * Get the #GtkActionGroup from a @page to represent its specific actions.
*
* Returns: a new #GtkActionGroup
*/
@@ -86,7 +87,13 @@ browser_page_get_actions_group (BrowserPage *page)
/**
* browser_page_get_actions_ui
+ * @page: an object implementing the #BrowserPage interface
+ *
+ * Get the UI definition from @page to represent how its specific actions (obtained
+ * using browser_page_get_actions_group()) are to be integrated in a #BrowserWindow's menu
+ * and toolbar.
*
+ * Returns: a read-only string
*/
const gchar *
browser_page_get_actions_ui (BrowserPage *page)
@@ -101,8 +108,13 @@ browser_page_get_actions_ui (BrowserPage *page)
/**
* browser_page_get_perspective
+ * @page: an object implementing the #BrowserPage interface
+ *
+ * Finds the BrowserPerspective in which @page is. Note that the #BrowserPerspective may
+ * have changed since a previous call as users are allowed to do some drag and drop between
+ * browser's windows which contain different #BrowserPerspective objects.
*
- * Finds the BrowserPerspective in which @page is.
+ * Returns: the #BrowserPerspective
*/
BrowserPerspective *
browser_page_get_perspective (BrowserPage *page)
@@ -116,6 +128,14 @@ browser_page_get_perspective (BrowserPage *page)
/**
* browser_page_get_tab_label
+ * @page: an object implementing the #BrowserPage interface
+ * @out_close_button: a place holder to hold a pointer to a close button
+ *
+ * Get a new widget to be packed in a notebook's tab label.
+ *
+ * If @out_close_button is not %NULL, then the implementation may decide to add
+ * a button to close the tab; if @out_close_button is %NULL, then it should not add
+ * any close button.
*
* Returns: a new #GtkWidget, or %NULL
*/
diff --git a/tools/browser/browser-perspective.c b/tools/browser/browser-perspective.c
index 55f0eae..040ed0a 100644
--- a/tools/browser/browser-perspective.c
+++ b/tools/browser/browser-perspective.c
@@ -68,8 +68,9 @@ browser_perspective_class_init (gpointer g_class)
/**
* browser_perspective_get_actions_group
- * @pers:
- * @instance: a GtkWidget which has been returned by a previous call to browser_perspective_create()
+ * @pers: an object implementing the #BrowserPerspective interface
+ *
+ * Get the #GtkActionGroup from a @pers to represent its specific actions.
*
* Returns: a new #GtkActionGroup
*/
@@ -86,7 +87,13 @@ browser_perspective_get_actions_group (BrowserPerspective *pers)
/**
* browser_perspective_get_actions_ui
+ * @pers: an object implementing the #BrowserPerspective interface
+ *
+ * Get the UI definition from a perspective to represent how its specific actions (obtained
+ * using browser_perspective_get_actions_group()) are to be integrated in a #BrowserWindow's menu
+ * and toolbar.
*
+ * Returns: a read-only string
*/
const gchar *
browser_perspective_get_actions_ui (BrowserPerspective *pers)
@@ -99,6 +106,15 @@ browser_perspective_get_actions_ui (BrowserPerspective *pers)
return NULL;
}
+/**
+ * browser_perspective_page_tab_label_change
+ * @pers: an object implementing the #BrowserPerspective interface
+ * @page: an object implementing the #BrowserPage interface
+ *
+ * When @pers organizes its contents as pages in a notebook, each page may
+ * request that the tab's label may be changed, and the purpose of this method
+ * is to request that @pers update the tab's label associated to @page.
+ */
void
browser_perspective_page_tab_label_change (BrowserPerspective *pers, BrowserPage *page)
{
diff --git a/tools/browser/browser-window.c b/tools/browser/browser-window.c
index 3631581..fd444db 100644
--- a/tools/browser/browser-window.c
+++ b/tools/browser/browser-window.c
@@ -47,8 +47,8 @@ typedef struct {
gchar *customized_ui;
} PerspectiveData;
#define PERSPECTIVE_DATA(x) ((PerspectiveData*)(x))
-PerspectiveData *perspective_data_new (BrowserWindow *bwin, BrowserPerspectiveFactory *factory);
-void perspective_data_free (PerspectiveData *pers);
+static PerspectiveData *perspective_data_new (BrowserWindow *bwin, BrowserPerspectiveFactory *factory);
+static void perspective_data_free (PerspectiveData *pers);
/*
* Main static functions
@@ -253,10 +253,17 @@ static const gchar *ui_actions_info =
/**
* browser_window_new
- * @bcnc:
- * @factory: may be %NULL
+ * @bcnc: a #BrowserConnection
+ * @factory: a #BrowserPerspectiveFactory, may be %NULL
*
- * Creates a new #BrowserWindow object, and displays it
+ * Creates a new #BrowserWindow window for the @bcnc connection, and displays it.
+ * If @factory is not %NULL, then the new window will show the perspective corresponding
+ * to @factory. If it's %NULL, then the default #BrowserPerspectiveFactory will be used,
+ * see browser_core_get_default_factory().
+ *
+ * Don't forget to call browser_core_take_window() to have the new window correctly
+ * managed by the browser. Similarly, to close the window, use browser_core_close_window()
+ * and not simply gtk_widget_destroy().
*
* Returns: the new object
*/
@@ -792,6 +799,9 @@ about_cb (GtkAction *action, BrowserWindow *bwin)
/**
* browser_window_get_connection
+ * @bwin: a #BrowserWindow
+ *
+ * Returns: the #BrowserConnection used in @bwin
*/
BrowserConnection *
browser_window_get_connection (BrowserWindow *bwin)
@@ -801,7 +811,7 @@ browser_window_get_connection (BrowserWindow *bwin)
}
-/**
+/*
* perspective_data_new
* @bwin: a #BrowserWindow in which the perspective will be
* @factory: a #BrowserPerspectiveFactory, or %NULL
@@ -810,7 +820,7 @@ browser_window_get_connection (BrowserWindow *bwin)
*
* Returns: a new #PerspectiveData
*/
-PerspectiveData *
+static PerspectiveData *
perspective_data_new (BrowserWindow *bwin, BrowserPerspectiveFactory *factory)
{
PerspectiveData *pers;
@@ -827,10 +837,10 @@ perspective_data_new (BrowserWindow *bwin, BrowserPerspectiveFactory *factory)
return pers;
}
-/**
+/*
* perspective_data_free
*/
-void
+static void
perspective_data_free (PerspectiveData *pers)
{
if (pers->perspective_widget)
@@ -843,6 +853,13 @@ perspective_data_free (PerspectiveData *pers)
/**
* browser_window_push_status
+ * @bwin: a #BrowserWindow
+ * @context: textual description of what context the new message is being used in
+ * @text: textual message
+ *
+ * Pushes a new message onto @bwin's statusbar's stack.
+ *
+ * Returns: the message ID, see gtk_statusbar_push().
*/
guint
browser_window_push_status (BrowserWindow *bwin, const gchar *context, const gchar *text)
@@ -859,6 +876,10 @@ browser_window_push_status (BrowserWindow *bwin, const gchar *context, const gch
/**
* browser_window_pop_status
+ * @bwin: a #BrowserWindow
+ * @context: textual description of what context the message is being used in
+ *
+ * Removes the first message in the @bwin's statusbar's stack with the given context.
*/
void
browser_window_pop_status (BrowserWindow *bwin, const gchar *context)
@@ -873,7 +894,11 @@ browser_window_pop_status (BrowserWindow *bwin, const gchar *context)
}
/**
- * browser_window_push_perspective_ui
+ * browser_window_customize_perspective_ui
+ * @bwin: a #BrowserWindow
+ * @bpers: the #BrowserPerspective concerned
+ * @actions_group: a #GtkActionGroup object, or %NULL
+ * @ui_info: a merge UI string, or %NULL. See gtk_ui_manager_add_ui_from_string()
*
* Customizes a UI specific to the @bpers perspective. Any
* previous customization is removed, replaced by the new requested one.
diff --git a/tools/browser/canvas/browser-canvas-item.c b/tools/browser/canvas/browser-canvas-item.c
index ceeb275..70ac16e 100644
--- a/tools/browser/canvas/browser-canvas-item.c
+++ b/tools/browser/canvas/browser-canvas-item.c
@@ -21,6 +21,7 @@
#include <gtk/gtk.h>
#include <libgda/libgda.h>
#include "browser-canvas-item.h"
+#include "browser-canvas.h"
#include "../dnd.h"
static void browser_canvas_item_class_init (BrowserCanvasItemClass * class);
@@ -62,7 +63,7 @@ enum
PROP_TOOLTIP_TEXT
};
-static gint browser_canvas_item_signals[LAST_SIGNAL] = { 0, 0, 0, 0 };
+static gint browser_canvas_item_signals[LAST_SIGNAL] = { 0, 0 };
/* get a pointer to the parents to be able to call their destructor */
static GObjectClass *base_parent_class = NULL;
diff --git a/tools/browser/doc/.gitignore b/tools/browser/doc/.gitignore
new file mode 100644
index 0000000..68af5f6
--- /dev/null
+++ b/tools/browser/doc/.gitignore
@@ -0,0 +1,31 @@
+html
+xml
+html-build.stamp
+html.stamp
+gda-browser-decl-list.txt
+gda-browser-decl.txt
+gda-browser-undocumented.txt
+gda-browser-unused.txt
+gda-browser.args
+gda-browser.hierarchy
+gda-browser.signals
+scan-build.stamp
+sgml-build.stamp
+sgml.stamp
+tmpl-build.stamp
+tmpl.stamp
+.libs
+gda-browser.prerequisites
+gda-browser-decl.txt.bak
+gda-browser.interfaces
+gda-browser-decl-list.txt.bak
+libgda.types
+gda-browser.types
+gda-browser-overrides.txt
+gda-browser-doc.pdf
+pdf-build.stamp
+gda-browser-undeclared.txt
+gda-browser-unused.sgml
+version.xml
+*.bak
+gda-browser-sections.sgml
diff --git a/tools/browser/doc/Makefile.am b/tools/browser/doc/Makefile.am
new file mode 100644
index 0000000..a1d1019
--- /dev/null
+++ b/tools/browser/doc/Makefile.am
@@ -0,0 +1,76 @@
+## Process this file with automake to produce Makefile.in
+
+AUTOMAKE_OPTIONS = 1.6
+
+# The name of the module.
+DOC_MODULE=gda-browser
+
+# The top-level SGML file.
+DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
+
+# Extra options to supply to gtkdoc-scan
+SCAN_OPTIONS=--deprecated-guards="GDA_DISABLE_DEPRECATED"
+
+# Extra options to pass to gtkdoc-scangobj
+SCANGOBJ_OPTIONS=
+
+# The directory containing the source code. Relative to $(srcdir)
+DOC_SOURCE_DIR=../
+
+# Used for dependencies.
+HFILE_GLOB=
+CFILE_GLOB=
+
+# Header files to ignore when scanning
+IGNORE_HFILES= marshal.h canvas dummy-perspective schema-browser
+
+# CFLAGS and LDFLAGS for compiling scan program. Only needed
+# if $(DOC_MODULE).types is non-empty.
+GTKDOC_CFLAGS = -I$(top_srcdir) \
+ -I$(top_builddir) \
+ -I$(top_srcdir)/libgda/sqlite \
+ -I$(top_builddir)/libgda/sqlite \
+ -I$(top_srcdir)/libgda-report \
+ -I$(top_srcdir)/libgda \
+ -I$(top_srcdir)/tools/browser \
+ $(LIBGDA_CFLAGS) \
+ $(GTK_CFLAGS) \
+ -DGETTEXT_PACKAGE=\""$(GETTEXT_PACKAGE)"\"
+
+GTKDOC_LIBS = $(top_builddir)/tools/browser/libbrowser.la \
+ $(top_builddir)/tools/browser/common/libcommon.la \
+ $(top_builddir)/libgda/libgda-4.0.la \
+ $(top_builddir)/libgda-ui/libgda-ui-4.0.la \
+ $(LIBGDA_LIBS) \
+ $(GTK_LIBS)
+
+# Extra options to supply to gtkdoc-mkdb
+MKDB_OPTIONS=--sgml-mode --output-format=xml --ignore-files="binreloc"
+
+# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE)
+content_files = fdl-appendix.sgml
+
+# Images to copy into HTML directory
+HTML_IMAGES = UILayout.png
+
+# Extra options to supply to gtkdoc-fixref
+FIXXREF_OPTIONS=
+
+include $(top_srcdir)/gtk-doc.make
+
+
+# Files not to distribute
+# for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types
+# for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt
+DISTCLEANFILES = $(DOC_MODULE)-doc.pdf gda-browser.types gda-browser-sections.txt
+
+DOC_STAMPS += pdf-build.stamp
+CLEANFILES += $(DOC_STAMPS)
+
+# Create the PDF
+PDF: pdf-build.stamp
+pdf-build.stamp:
+ if test -f $(srcdir)/$(DOC_MAIN_SGML_FILE); then \
+ dblatex $(srcdir)/$(DOC_MAIN_SGML_FILE) -o $(DOC_MODULE)-doc.pdf ; \
+ fi
+ touch pdf-build.stamp
diff --git a/tools/browser/doc/UILayout.png b/tools/browser/doc/UILayout.png
new file mode 100644
index 0000000..10103f6
Binary files /dev/null and b/tools/browser/doc/UILayout.png differ
diff --git a/tools/browser/doc/fdl-appendix.sgml b/tools/browser/doc/fdl-appendix.sgml
new file mode 120000
index 0000000..1fa1718
--- /dev/null
+++ b/tools/browser/doc/fdl-appendix.sgml
@@ -0,0 +1 @@
+../../../doc/C/fdl-appendix.sgml
\ No newline at end of file
diff --git a/tools/browser/doc/gda-browser-docs.sgml b/tools/browser/doc/gda-browser-docs.sgml
new file mode 100644
index 0000000..0645633
--- /dev/null
+++ b/tools/browser/doc/gda-browser-docs.sgml
@@ -0,0 +1,149 @@
+<?xml version="1.0"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
+<!ENTITY nbsp " ">
+<!ENTITY LIBGDA "<application>Libgda</application>">
+<!ENTITY GNOMEDB "<application>GNOME-DB</application>">
+<!ENTITY fdl-appendix SYSTEM "fdl-appendix.sgml">
+<!ENTITY BrowserCore SYSTEM "xml/browser-core.xml">
+<!ENTITY BrowserWindow SYSTEM "xml/browser-window.xml">
+<!ENTITY BrowserConnection SYSTEM "xml/browser-connection.xml">
+<!ENTITY BrowserFavorites SYSTEM "xml/browser-favorites.xml">
+<!ENTITY BrowserPage SYSTEM "xml/browser-page.xml">
+<!ENTITY BrowserPerspective SYSTEM "xml/browser-perspective.xml">
+<!ENTITY CCGrayBar SYSTEM "xml/cc-gray-bar.xml">
+]>
+
+<book id="index">
+ <bookinfo>
+ <title>GdaBrowser hacking manual</title>
+ <authorgroup>
+ <author>
+ <firstname>Vivien</firstname>
+ <surname>Malerba</surname>
+ <affiliation>
+ <address><email>malerba gnome-db org</email></address>
+ </affiliation>
+ <contrib>Current maintainer
+ </contrib>
+ </author>
+ </authorgroup>
+ <date>August 2009</date>
+ <copyright>
+ <year>2009</year>
+ <holder>The GNOME Foundation</holder>
+ </copyright>
+ <abstract>
+ <para>
+ Abstract blah.
+ </para>
+ </abstract>
+ <legalnotice id="legalnotice">
+ <para>
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the <link linkend="fdl"><citetitle>GNU
+ Free Documentation License</citetitle></link>, Version 1.1 or any later
+ version published by the Free Software Foundation with no Invariant
+ Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the
+ license can be found in <link linkend="fdl">the appendix</link>.
+ </para>
+ <para>
+ Many of the names used by companies to distinguish their products and
+ services are claimed as trademarks. Where those names appear in any
+ GNOME documentation, and those trademarks are made aware to the members
+ of the GNOME Documentation Project, the names have been printed in caps
+ or initial caps.
+ </para>
+ </legalnotice>
+ </bookinfo>
+
+ <part id="part_begin">
+ <title>Getting started</title>
+ <chapter id="why">
+ <title>Purpose</title>
+ <para>
+ The purpose of this documentation is to provide reference material to anyone
+ wishing to add some features to the Gda browser graphical tool.
+ </para>
+ </chapter>
+
+ <chapter id="prog_struct">
+ <title>Program's structure</title>
+ <para>
+ The GdaBrowser's structure is organized around the following parts:
+ <itemizedlist>
+ <listitem><para>one or more connections, represented by
+ <link linkend="BrowserConnection">BrowserConnection</link> objects</para></listitem>
+ <listitem><para>one or more windows, represented by
+ <link linkend="BrowserWindow">BrowserWindow</link> objects. Each window uses exactly
+ one connection, and several windows using the same connection can be created</para></listitem>
+ <listitem><para>a single instance of a <link linkend="BrowserCore">BrowserCore</link> object which
+ holds all the global information of the browser, and manages connections and windows</para></listitem>
+ <listitem><para>Window can be used for diverse activities graphically represented by "perspectives", thus
+ each window can switch its display between various perspectives, identified by widgets
+ implementing the <link linkend="BrowserPerspective">BrowserPerspective</link> interface.</para></listitem>
+ </itemizedlist>
+ </para>
+ </chapter>
+
+ <chapter id="code_orga">
+ <title>Code organization</title>
+ <para>
+ TODO.
+ </para>
+ </chapter>
+ </part>
+
+ <part id="part_api">
+ <title>API reference</title>
+
+ <chapter id="core">
+ <title>Core objects</title>
+ <para>
+ This section is a reference to all the core objects of the Gda browser,
+ which can be used in any extension.
+ </para>
+ &BrowserCore;
+ &BrowserConnection;
+ &BrowserFavorites;
+ </chapter>
+
+ <chapter id="windows">
+ <title>Browser windows</title>
+ <para>
+ This section is a reference to all the widgets used in a browser top level window.
+ The following picture shows such a window and how the widgets listed here are packed: the
+ top level window beign a #BrowserWindow in which some #BrowserPerspective widgets are packed
+ (along with a menubar and a statusbar). Each #BrowserPerspective widget packs some specific
+ widgets and optionally some #BrowserPage widgets. The #BrowserPerspective and
+ #BrowserPage are interfaces so no limitation is imposed on the widgets implementing them.
+ <mediaobject>
+ <imageobject role="html">
+ <imagedata fileref="UILayout.png" format="PNG"/>
+ </imageobject>
+ <textobject>
+ <phrase>Typical Gda browser's top level window</phrase>
+ </textobject>
+ </mediaobject>
+ </para>
+ &BrowserWindow;
+ &BrowserPerspective;
+ &BrowserPage;
+ </chapter>
+
+ <chapter id="extrawidgets">
+ <title>Extra widgets</title>
+ <para>
+ This section is a reference to all the extra widgets used in the Gda browser,
+ which can be used in any extension.
+ </para>
+ &CCGrayBar;
+ </chapter>
+ </part>
+
+ <part id="part_index">
+ <title>Appendix</title>
+ &fdl-appendix;
+ </part>
+</book>
+
diff --git a/tools/browser/doc/gda-browser-sections.txt b/tools/browser/doc/gda-browser-sections.txt
new file mode 100644
index 0000000..8032f8c
--- /dev/null
+++ b/tools/browser/doc/gda-browser-sections.txt
@@ -0,0 +1,316 @@
+<SECTION>
+<FILE>browser-core</FILE>
+BrowserCorePrivate
+BrowserCoreInitFactories
+<TITLE>BrowserCore</TITLE>
+BrowserCore
+browser_core_exists
+browser_core_get
+browser_core_take_window
+browser_core_get_windows
+browser_core_close_window
+browser_core_take_connection
+browser_core_get_connections
+browser_core_close_connection
+browser_core_quit
+BrowserPerspectiveFactory
+BROWSER_PERSPECTIVE_FACTORY
+browser_core_get_default_factory
+browser_core_set_default_factory
+browser_core_get_factories
+<SUBSECTION Standard>
+BROWSER_CORE
+BROWSER_IS_CORE
+BROWSER_TYPE_CORE
+browser_core_get_type
+BROWSER_CORE_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>browser-spinner</FILE>
+BrowserSpinnerPriv
+<TITLE>BrowserSpinner</TITLE>
+BrowserSpinner
+browser_spinner_new
+browser_spinner_start
+browser_spinner_stop
+browser_spinner_set_size
+<SUBSECTION Standard>
+BROWSER_SPINNER
+BROWSER_IS_SPINNER
+BROWSER_TYPE_SPINNER
+browser_spinner_get_type
+BROWSER_SPINNER_CLASS
+BROWSER_IS_SPINNER_CLASS
+BROWSER_SPINNER_GET_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>auth-dialog</FILE>
+AuthDialogPrivate
+auth_dialog_error_quark
+AUTH_DIALOG_ERROR
+AuthDialogError
+<TITLE>AuthDialog</TITLE>
+AuthDialog
+AuthDialogConnection
+auth_dialog_new
+auth_dialog_add_cnc_string
+auth_dialog_run
+auth_dialog_get_connections
+<SUBSECTION Standard>
+AUTH_DIALOG
+AUTH_IS_DIALOG
+AUTH_TYPE_DIALOG
+auth_dialog_get_type
+AUTH_DIALOG_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>browser-favorites</FILE>
+BrowserFavoritesPrivate
+BrowserFavoritesType
+<TITLE>BrowserFavorites</TITLE>
+BrowserFavorites
+BrowserFavoritesAttributes
+ORDER_KEY_SCHEMA
+browser_favorites_add
+browser_favorites_list
+browser_favorites_delete
+browser_favorites_free_list
+browser_favorites_reset_attributes
+browser_favorites_get
+<SUBSECTION Standard>
+BROWSER_FAVORITES
+BROWSER_IS_FAVORITES
+BROWSER_TYPE_FAVORITES
+browser_favorites_get_type
+BROWSER_FAVORITES_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>browser-connections-list</FILE>
+BrowserConnectionsListPrivate
+<TITLE>BrowserConnectionsList</TITLE>
+BrowserConnectionsList
+browser_connections_list_show
+<SUBSECTION Standard>
+BROWSER_CONNECTIONS_LIST
+BROWSER_IS_CONNECTIONS_LIST
+BROWSER_TYPE_CONNECTIONS_LIST
+browser_connections_list_get_type
+BROWSER_CONNECTIONS_LIST_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>login-dialog</FILE>
+LoginDialogPrivate
+login_dialog_error_quark
+LOGIN_DIALOG_ERROR
+LoginDialogError
+<TITLE>LoginDialog</TITLE>
+LoginDialog
+login_dialog_new
+login_dialog_run
+<SUBSECTION Standard>
+LOGIN_DIALOG
+LOGIN_IS_DIALOG
+LOGIN_TYPE_DIALOG
+login_dialog_get_type
+LOGIN_DIALOG_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>browser-variable</FILE>
+BrowserVariablePrivate
+<TITLE>BrowserVariable</TITLE>
+BrowserVariable
+browser_variable_new
+<SUBSECTION Standard>
+BROWSER_VARIABLE
+BROWSER_IS_VARIABLE
+BROWSER_TYPE_VARIABLE
+browser_variable_get_type
+BROWSER_VARIABLE_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>browser-connection</FILE>
+BrowserConnectionPrivate
+<TITLE>BrowserConnection</TITLE>
+BrowserConnection
+browser_connection_new
+browser_connection_get_name
+browser_connection_get_information
+browser_connection_is_busy
+browser_connection_update_meta_data
+browser_connection_get_meta_struct
+browser_connection_get_meta_store
+browser_connection_get_dictionary_file
+browser_connection_get_favorites
+<SUBSECTION Standard>
+BROWSER_CONNECTION
+BROWSER_IS_CONNECTION
+BROWSER_TYPE_CONNECTION
+browser_connection_get_type
+BROWSER_CONNECTION_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>browser-window</FILE>
+BrowserWindowPrivate
+<TITLE>BrowserWindow</TITLE>
+BrowserWindow
+browser_window_new
+browser_window_get_connection
+browser_window_push_status
+browser_window_pop_status
+browser_window_customize_perspective_ui
+<SUBSECTION Standard>
+BROWSER_WINDOW
+BROWSER_IS_WINDOW
+BROWSER_TYPE_WINDOW
+browser_window_get_type
+BROWSER_WINDOW_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>cc-gray-bar</FILE>
+CcGrayBarPrivate
+<TITLE>CcGrayBar</TITLE>
+CcGrayBar
+cc_gray_bar_new
+cc_gray_bar_get_text
+cc_gray_bar_set_text
+cc_gray_bar_set_icon_from_pixbuf
+cc_gray_bar_set_icon_from_file
+cc_gray_bar_set_icon_from_stock
+cc_gray_bar_set_show_icon
+cc_gray_bar_get_show_icon
+<SUBSECTION Standard>
+CC_GRAY_BAR
+CC_IS_GRAY_BAR
+CC_TYPE_GRAY_BAR
+cc_gray_bar_get_type
+CC_GRAY_BAR_CLASS
+CC_IS_GRAY_BAR_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>browser-perspective</FILE>
+BROWSER_PERSPECTIVE_TYPE
+BROWSER_PERSPECTIVE
+IS_BROWSER_PERSPECTIVE
+BROWSER_PERSPECTIVE_GET_CLASS
+BrowserPerspectiveIface
+browser_perspective_get_type
+browser_perspective_get_actions_group
+browser_perspective_get_actions_ui
+browser_perspective_page_tab_label_change
+</SECTION>
+
+<SECTION>
+<FILE>decl</FILE>
+BrowserCore
+BrowserVariable
+BrowserConnection
+BrowserWindow
+BrowserData
+BrowserPerspectiveIface
+BrowserPerspective
+BrowserPageIface
+BrowserPage
+</SECTION>
+
+<SECTION>
+<FILE>browser-page</FILE>
+BROWSER_PAGE_TYPE
+BROWSER_PAGE
+IS_BROWSER_PAGE
+BROWSER_PAGE_GET_CLASS
+BrowserPageIface
+browser_page_get_type
+browser_page_get_actions_group
+browser_page_get_actions_ui
+browser_page_get_perspective
+browser_page_get_tab_label
+</SECTION>
+
+<SECTION>
+<FILE>mgr-favorites</FILE>
+MGR_FAVORITES_TYPE
+MGR_FAVORITES
+MGR_FAVORITES_CLASS
+IS_MGR_FAVORITES
+IS_MGR_FAVORITES_CLASS
+MgrFavoritesPriv
+<TITLE>MgrFavorites</TITLE>
+MgrFavorites
+mgr_favorites_get_type
+mgr_favorites_new
+MGR_FAVORITES_CONTENTS_ATT_NAME
+MGR_FAVORITES_ID_ATT_NAME
+MGR_FAVORITES_TYPE_ATT_NAME
+</SECTION>
+
+<SECTION>
+<FILE>dnd</FILE>
+</SECTION>
+
+<SECTION>
+<FILE>browser-stock-icons</FILE>
+BROWSER_STOCK_HISTORY
+BROWSER_STOCK_BOOKMARKS
+STOCK_NEW_WINDOW
+STOCK_ADD_BOOKMARK
+STOCK_PRINT_SETUP
+browser_stock_icons_init
+</SECTION>
+
+<SECTION>
+<FILE>support</FILE>
+browser_connection_open
+browser_connection_close
+browser_show_error
+browser_make_tab_label_with_stock
+browser_make_tab_label_with_pixbuf
+browser_find_parent_widget
+BrowserIconType
+browser_get_pixbuf_icon
+</SECTION>
+
+<SECTION>
+<FILE>objects-cloud</FILE>
+OBJECTS_CLOUD_TYPE
+OBJECTS_CLOUD
+OBJECTS_CLOUD_CLASS
+IS_OBJECTS_CLOUD
+IS_OBJECTS_CLOUD_CLASS
+ObjectsCloudPrivate
+ObjectsCloudObjType
+<TITLE>ObjectsCloud</TITLE>
+ObjectsCloud
+objects_cloud_get_type
+objects_cloud_new
+objects_cloud_set_meta_struct
+objects_cloud_show_schemas
+objects_cloud_filter
+objects_cloud_create_filter
+</SECTION>
+
+<SECTION>
+<FILE>popup-container</FILE>
+POPUP_CONTAINER_TYPE
+POPUP_CONTAINER
+POPUP_CONTAINER_CLASS
+IS_POPUP_CONTAINER
+IS_POPUP_CONTAINER_CLASS
+PopupContainerPrivate
+PopupContainerPositionFunc
+<TITLE>PopupContainer</TITLE>
+PopupContainer
+popup_container_get_type
+popup_container_new
+popup_container_new_with_func
+</SECTION>
+
diff --git a/tools/browser/doc/tmpl/browser-connection.sgml b/tools/browser/doc/tmpl/browser-connection.sgml
new file mode 100644
index 0000000..92e7c21
--- /dev/null
+++ b/tools/browser/doc/tmpl/browser-connection.sgml
@@ -0,0 +1,137 @@
+<!-- ##### SECTION Title ##### -->
+BrowserConnection
+
+<!-- ##### SECTION Short_Description ##### -->
+An opened connection
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+ The #BrowserConnection object wraps a #GdaConnection with some
+ additionnal features.
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### STRUCT BrowserConnectionPrivate ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### STRUCT BrowserConnection ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SIGNAL BrowserConnection::busy ##### -->
+<para>
+
+</para>
+
+ browserconnection: the object which received the signal.
+ arg1:
+ arg2:
+
+<!-- ##### SIGNAL BrowserConnection::favorites-changed ##### -->
+<para>
+
+</para>
+
+ browserconnection: the object which received the signal.
+
+<!-- ##### SIGNAL BrowserConnection::meta-changed ##### -->
+<para>
+
+</para>
+
+ browserconnection: the object which received the signal.
+ arg1:
+
+<!-- ##### FUNCTION browser_connection_new ##### -->
+<para>
+
+</para>
+
+ cnc:
+ Returns:
+
+
+<!-- ##### FUNCTION browser_connection_get_name ##### -->
+<para>
+
+</para>
+
+ bcnc:
+ Returns:
+
+
+<!-- ##### FUNCTION browser_connection_get_information ##### -->
+<para>
+
+</para>
+
+ bcnc:
+ Returns:
+
+
+<!-- ##### FUNCTION browser_connection_is_busy ##### -->
+<para>
+
+</para>
+
+ bcnc:
+ out_reason:
+ Returns:
+
+
+<!-- ##### FUNCTION browser_connection_update_meta_data ##### -->
+<para>
+
+</para>
+
+ bcnc:
+
+
+<!-- ##### FUNCTION browser_connection_get_meta_struct ##### -->
+<para>
+
+</para>
+
+ bcnc:
+ Returns:
+
+
+<!-- ##### FUNCTION browser_connection_get_meta_store ##### -->
+<para>
+
+</para>
+
+ bcnc:
+ Returns:
+
+
+<!-- ##### FUNCTION browser_connection_get_dictionary_file ##### -->
+<para>
+
+</para>
+
+ bcnc:
+ Returns:
+
+
+<!-- ##### FUNCTION browser_connection_get_favorites ##### -->
+<para>
+
+</para>
+
+ bcnc:
+ Returns:
+
+
diff --git a/tools/browser/doc/tmpl/browser-core.sgml b/tools/browser/doc/tmpl/browser-core.sgml
new file mode 100644
index 0000000..fc91e9b
--- /dev/null
+++ b/tools/browser/doc/tmpl/browser-core.sgml
@@ -0,0 +1,167 @@
+<!-- ##### SECTION Title ##### -->
+BrowserCore
+
+<!-- ##### SECTION Short_Description ##### -->
+Singleton holding the global browser information
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+ A single instance of a #BrowserCore is created when the browser is started,
+ accessible using browser_core_get().
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### STRUCT BrowserCorePrivate ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### USER_FUNCTION BrowserCoreInitFactories ##### -->
+<para>
+
+</para>
+
+ Returns:
+
+
+<!-- ##### STRUCT BrowserCore ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SIGNAL BrowserCore::connection-added ##### -->
+<para>
+
+</para>
+
+ browsercore: the object which received the signal.
+ arg1:
+
+<!-- ##### SIGNAL BrowserCore::connection-removed ##### -->
+<para>
+
+</para>
+
+ browsercore: the object which received the signal.
+ arg1:
+
+<!-- ##### FUNCTION browser_core_exists ##### -->
+<para>
+
+</para>
+
+ Returns:
+
+
+<!-- ##### FUNCTION browser_core_get ##### -->
+<para>
+
+</para>
+
+ Returns:
+
+
+<!-- ##### FUNCTION browser_core_take_window ##### -->
+<para>
+
+</para>
+
+ bwin:
+
+
+<!-- ##### FUNCTION browser_core_get_windows ##### -->
+<para>
+
+</para>
+
+ Returns:
+
+
+<!-- ##### FUNCTION browser_core_close_window ##### -->
+<para>
+
+</para>
+
+ bwin:
+
+
+<!-- ##### FUNCTION browser_core_take_connection ##### -->
+<para>
+
+</para>
+
+ bcnc:
+
+
+<!-- ##### FUNCTION browser_core_get_connections ##### -->
+<para>
+
+</para>
+
+ Returns:
+
+
+<!-- ##### FUNCTION browser_core_close_connection ##### -->
+<para>
+
+</para>
+
+ bcnc:
+
+
+<!-- ##### FUNCTION browser_core_quit ##### -->
+<para>
+
+</para>
+
+
+
+<!-- ##### STRUCT BrowserPerspectiveFactory ##### -->
+<para>
+
+</para>
+
+ perspective_name:
+ perspective_create:
+
+<!-- ##### MACRO BROWSER_PERSPECTIVE_FACTORY ##### -->
+<para>
+
+</para>
+
+ x:
+
+
+<!-- ##### FUNCTION browser_core_get_default_factory ##### -->
+<para>
+
+</para>
+
+ Returns:
+
+
+<!-- ##### FUNCTION browser_core_set_default_factory ##### -->
+<para>
+
+</para>
+
+ factory:
+
+
+<!-- ##### FUNCTION browser_core_get_factories ##### -->
+<para>
+
+</para>
+
+ Returns:
+
+
diff --git a/tools/browser/doc/tmpl/browser-favorites.sgml b/tools/browser/doc/tmpl/browser-favorites.sgml
new file mode 100644
index 0000000..e976124
--- /dev/null
+++ b/tools/browser/doc/tmpl/browser-favorites.sgml
@@ -0,0 +1,134 @@
+<!-- ##### SECTION Title ##### -->
+BrowserFavorites
+
+<!-- ##### SECTION Short_Description ##### -->
+Favorites management
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+ Each connection uses a single #BrowserFavorites object to manage its favorites,
+ see browser_connection_get_favorites().
+</para>
+<para>
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### STRUCT BrowserFavoritesPrivate ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### ENUM BrowserFavoritesType ##### -->
+<para>
+
+</para>
+
+ BROWSER_FAVORITES_TABLES:
+ BROWSER_FAVORITES_DIAGRAMS:
+
+<!-- ##### STRUCT BrowserFavorites ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SIGNAL BrowserFavorites::favorites-changed ##### -->
+<para>
+
+</para>
+
+ browserfavorites: the object which received the signal.
+
+<!-- ##### STRUCT BrowserFavoritesAttributes ##### -->
+<para>
+
+</para>
+
+ id:
+ type:
+ name:
+ descr:
+ contents:
+
+<!-- ##### MACRO ORDER_KEY_SCHEMA ##### -->
+<para>
+
+</para>
+
+
+
+<!-- ##### FUNCTION browser_favorites_add ##### -->
+<para>
+
+</para>
+
+ bfav:
+ session_id:
+ fav:
+ order_key:
+ pos:
+ error:
+ Returns:
+
+
+<!-- ##### FUNCTION browser_favorites_list ##### -->
+<para>
+
+</para>
+
+ bfav:
+ session_id:
+ type:
+ order_key:
+ error:
+ Returns:
+
+
+<!-- ##### FUNCTION browser_favorites_delete ##### -->
+<para>
+
+</para>
+
+ bfav:
+ session_id:
+ fav:
+ error:
+ Returns:
+
+
+<!-- ##### FUNCTION browser_favorites_free_list ##### -->
+<para>
+
+</para>
+
+ fav_list:
+
+
+<!-- ##### FUNCTION browser_favorites_reset_attributes ##### -->
+<para>
+
+</para>
+
+ fav:
+
+
+<!-- ##### FUNCTION browser_favorites_get ##### -->
+<para>
+
+</para>
+
+ bfav:
+ fav_id:
+ out_fav:
+ error:
+ Returns:
+
+
diff --git a/tools/browser/doc/tmpl/browser-page.sgml b/tools/browser/doc/tmpl/browser-page.sgml
new file mode 100644
index 0000000..7669264
--- /dev/null
+++ b/tools/browser/doc/tmpl/browser-page.sgml
@@ -0,0 +1,108 @@
+<!-- ##### SECTION Title ##### -->
+BrowserPage
+
+<!-- ##### SECTION Short_Description ##### -->
+A "page" within a #BrowserPerspective widget
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+ Some widgets packed within a #BrowserPerspective can implement
+ the #BrowserPage interface to specify their specific actions and menu and
+ toolbar customizations. When they are packed in a notebook, they can also
+ request some specific tab labels.
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### MACRO BROWSER_PAGE_TYPE ##### -->
+<para>
+
+</para>
+
+
+
+<!-- ##### MACRO BROWSER_PAGE ##### -->
+<para>
+
+</para>
+
+ obj:
+
+
+<!-- ##### MACRO IS_BROWSER_PAGE ##### -->
+<para>
+
+</para>
+
+ obj:
+
+
+<!-- ##### MACRO BROWSER_PAGE_GET_CLASS ##### -->
+<para>
+
+</para>
+
+ obj:
+
+
+<!-- ##### STRUCT BrowserPageIface ##### -->
+<para>
+
+</para>
+
+ g_iface:
+ i_get_actions_group:
+ i_get_actions_ui:
+ i_get_tab_label:
+
+<!-- ##### FUNCTION browser_page_get_type ##### -->
+<para>
+
+</para>
+
+ Returns:
+
+
+<!-- ##### FUNCTION browser_page_get_actions_group ##### -->
+<para>
+
+</para>
+
+ page:
+ Returns:
+
+
+<!-- ##### FUNCTION browser_page_get_actions_ui ##### -->
+<para>
+
+</para>
+
+ page:
+ Returns:
+
+
+<!-- ##### FUNCTION browser_page_get_perspective ##### -->
+<para>
+
+</para>
+
+ page:
+ Returns:
+
+
+<!-- ##### FUNCTION browser_page_get_tab_label ##### -->
+<para>
+
+</para>
+
+ page:
+ out_close_button:
+ Returns:
+
+
diff --git a/tools/browser/doc/tmpl/browser-perspective.sgml b/tools/browser/doc/tmpl/browser-perspective.sgml
new file mode 100644
index 0000000..cc0a1e4
--- /dev/null
+++ b/tools/browser/doc/tmpl/browser-perspective.sgml
@@ -0,0 +1,96 @@
+<!-- ##### SECTION Title ##### -->
+BrowserPerspective
+
+<!-- ##### SECTION Short_Description ##### -->
+A "perspective" in a #BrowserWindow window
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+ #BrowserPerspective is an interface used by the #BrowserWindow object to switch
+ between the activities ("perspectives"); it requires the #GtkWidget.
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### MACRO BROWSER_PERSPECTIVE_TYPE ##### -->
+<para>
+
+</para>
+
+
+
+<!-- ##### MACRO BROWSER_PERSPECTIVE ##### -->
+<para>
+
+</para>
+
+ obj:
+
+
+<!-- ##### MACRO IS_BROWSER_PERSPECTIVE ##### -->
+<para>
+
+</para>
+
+ obj:
+
+
+<!-- ##### MACRO BROWSER_PERSPECTIVE_GET_CLASS ##### -->
+<para>
+
+</para>
+
+ obj:
+
+
+<!-- ##### STRUCT BrowserPerspectiveIface ##### -->
+<para>
+
+</para>
+
+ g_iface:
+ i_get_actions_group:
+ i_get_actions_ui:
+ i_page_tab_label_change:
+
+<!-- ##### FUNCTION browser_perspective_get_type ##### -->
+<para>
+
+</para>
+
+ Returns:
+
+
+<!-- ##### FUNCTION browser_perspective_get_actions_group ##### -->
+<para>
+
+</para>
+
+ perspective:
+ Returns:
+
+
+<!-- ##### FUNCTION browser_perspective_get_actions_ui ##### -->
+<para>
+
+</para>
+
+ perspective:
+ Returns:
+
+
+<!-- ##### FUNCTION browser_perspective_page_tab_label_change ##### -->
+<para>
+
+</para>
+
+ perspective:
+ page:
+
+
diff --git a/tools/browser/doc/tmpl/browser-window.sgml b/tools/browser/doc/tmpl/browser-window.sgml
new file mode 100644
index 0000000..26f2c57
--- /dev/null
+++ b/tools/browser/doc/tmpl/browser-window.sgml
@@ -0,0 +1,82 @@
+<!-- ##### SECTION Title ##### -->
+BrowserWindow
+
+<!-- ##### SECTION Short_Description ##### -->
+Top level browser window
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+ Each top level browser window is represented by a #BrowserWindow object, and uses
+ a single #BrowserConnection connection object.
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### STRUCT BrowserWindowPrivate ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### STRUCT BrowserWindow ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### FUNCTION browser_window_new ##### -->
+<para>
+
+</para>
+
+ bcnc:
+ factory:
+ Returns:
+
+
+<!-- ##### FUNCTION browser_window_get_connection ##### -->
+<para>
+
+</para>
+
+ bwin:
+ Returns:
+
+
+<!-- ##### FUNCTION browser_window_push_status ##### -->
+<para>
+
+</para>
+
+ bwin:
+ context:
+ text:
+ Returns:
+
+
+<!-- ##### FUNCTION browser_window_pop_status ##### -->
+<para>
+
+</para>
+
+ bwin:
+ context:
+
+
+<!-- ##### FUNCTION browser_window_customize_perspective_ui ##### -->
+<para>
+
+</para>
+
+ bwin:
+ bpers:
+ actions_group:
+ ui_info:
+
+
diff --git a/tools/browser/doc/tmpl/cc-gray-bar.sgml b/tools/browser/doc/tmpl/cc-gray-bar.sgml
new file mode 100644
index 0000000..4e2e377
--- /dev/null
+++ b/tools/browser/doc/tmpl/cc-gray-bar.sgml
@@ -0,0 +1,114 @@
+<!-- ##### SECTION Title ##### -->
+CcGrayBar
+
+<!-- ##### SECTION Short_Description ##### -->
+A title bar
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+ The #CcGrayBar widget is a styled title bar used in the GdaBrowser.
+</para>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### STRUCT CcGrayBarPrivate ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### STRUCT CcGrayBar ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### ARG CcGrayBar:show-icon ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG CcGrayBar:text ##### -->
+<para>
+
+</para>
+
+<!-- ##### FUNCTION cc_gray_bar_new ##### -->
+<para>
+
+</para>
+
+ label:
+ Returns:
+
+
+<!-- ##### FUNCTION cc_gray_bar_get_text ##### -->
+<para>
+
+</para>
+
+ bar:
+ Returns:
+
+
+<!-- ##### FUNCTION cc_gray_bar_set_text ##### -->
+<para>
+
+</para>
+
+ bar:
+ text:
+
+
+<!-- ##### FUNCTION cc_gray_bar_set_icon_from_pixbuf ##### -->
+<para>
+
+</para>
+
+ bar:
+ pixbuf:
+
+
+<!-- ##### FUNCTION cc_gray_bar_set_icon_from_file ##### -->
+<para>
+
+</para>
+
+ bar:
+ file:
+
+
+<!-- ##### FUNCTION cc_gray_bar_set_icon_from_stock ##### -->
+<para>
+
+</para>
+
+ bar:
+ stock_id:
+ size:
+
+
+<!-- ##### FUNCTION cc_gray_bar_set_show_icon ##### -->
+<para>
+
+</para>
+
+ bar:
+ show:
+
+
+<!-- ##### FUNCTION cc_gray_bar_get_show_icon ##### -->
+<para>
+
+</para>
+
+ bar:
+ Returns:
+
+
diff --git a/tools/browser/main.c b/tools/browser/main.c
index 7d584a0..1505276 100644
--- a/tools/browser/main.c
+++ b/tools/browser/main.c
@@ -31,6 +31,22 @@
#include "auth-dialog.h"
#include "browser-stock-icons.h"
+/* Perspectives' factories */
+#include "schema-browser/perspective-main.h"
+#include "dummy-perspective/perspective-main.h"
+
+
+extern BrowserCoreInitFactories browser_core_init_factories;
+
+GSList *
+main_browser_core_init_factories (void)
+{
+ GSList *factories = NULL;
+ factories = g_slist_append (factories, schema_browser_perspective_get_factory ());
+ factories = g_slist_append (factories, dummy_perspective_get_factory ());
+ return factories;
+}
+
/* options */
gchar *perspective = NULL;
@@ -47,6 +63,9 @@ main (int argc, char *argv[])
GError *error = NULL;
gboolean have_loop = FALSE;
+ /* set factories function */
+ browser_core_init_factories = main_browser_core_init_factories;
+
context = g_option_context_new (_("[DSN|connection string]..."));
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
g_option_context_set_ignore_unknown_options (context, TRUE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]