[nautilus-actions] base-window-class.h: removed file



commit 38943848066ae6b24e8223ef587847d4275f5b69
Author: Pierre Wieser <pwieser trychlos org>
Date:   Fri Jan 21 23:12:51 2011 +0100

    base-window-class.h: removed file
    
    + src/nact/base-window.h:
    + src/nact/Makefile.am: Updated accordingly.

 ChangeLog                    |    5 +
 src/nact/Makefile.am         |    1 -
 src/nact/base-window-class.h |  193 ------------------------------------------
 src/nact/base-window.h       |  164 ++++++++++++++++++++++++++++++++++-
 4 files changed, 165 insertions(+), 198 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8ed4dde..41c4eec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-01-21 Pierre Wieser <pwieser trychlos org>
 
+	* src/nact/base-window-class.h: Removed file.
+
+	* src/nact/base-window.h:
+	* src/nact/Makefile.am: Updated accordingly.
+
 	* src/utils/na-gconf2key.sh.in:
 	Get ride of possible error messages when forcing gconfd-2 synchro.
 
diff --git a/src/nact/Makefile.am b/src/nact/Makefile.am
index 775de0c..a48f588 100644
--- a/src/nact/Makefile.am
+++ b/src/nact/Makefile.am
@@ -61,7 +61,6 @@ nautilus_actions_config_tool_SOURCES = \
 	base-keysyms.h										\
 	base-window.c										\
 	base-window.h										\
-	base-window-class.h									\
 	egg-desktop-file.c									\
 	egg-desktop-file.h									\
 	egg-sm-client.c										\
diff --git a/src/nact/base-window.h b/src/nact/base-window.h
index dd54c09..a31a2fc 100644
--- a/src/nact/base-window.h
+++ b/src/nact/base-window.h
@@ -32,19 +32,173 @@
 #define __BASE_WINDOW_H__
 
 /**
- * SECTION: base_window
- * @short_description: #BaseWindow public function declaration.
- * @include: nact/base-window.h
+ * SECTION: base-window
+ * @title: BaseWindow
+ * @short_description: the BaseWindow base window class definition
+ * @include: base-window.h
  *
  * This is a base class which encapsulates a Gtk+ windows.
  * It works together with the BaseApplication class to run a Gtk+
  * application.
+ *
+ * Note that two properties of #BaseApplication may be overriden on a
+ * per-#BaseWindow basis. These are :
+ *
+ * - the #GtkBuilder UI manager
+ *   the application has one global UI manager, but each window may
+ *   have its own, provided that it is willing to reallocate a new
+ *   one each time the window is opened.
+ *
+ *   Cf. http://bugzilla.gnome.org/show_bug.cgi?id=589746 against
+ *   Gtk+ 2.16 : a GtkFileChooserWidget embedded in a GtkAssistant is
+ *   not displayed when run more than once. As a work-around, reload
+ *   the XML ui each time we run an assistant !
+ *
+ * - the filename which handled the window XML definition
+ *   the application provides with one global default file, but each
+ *   window may decide to provide its own.
+ *
+ *   Cf. http://bugzilla.gnome.org/show_bug.cgi?id=579345 against
+ *   GtkBuilder : duplicate ids are no more allowed in a file. But we
+ *   require this ability to have the same widget definition
+ *   (ActionsList) in main window and export assistant.
+ *   As a work-around, we have XML definition of export assistant in
+ *   its own file.
+ *   Another work-around could have be to let the IActionsList
+ *   interface asks from the actual widget name to its implementor...
+ *
+ *   Sharing a same XML UI definition file implies sharing the same builder.
  */
 
-#include "base-window-class.h"
+#include "base-application.h"
 
 G_BEGIN_DECLS
 
+#define BASE_WINDOW_TYPE                ( base_window_get_type())
+#define BASE_WINDOW( object )           ( G_TYPE_CHECK_INSTANCE_CAST( object, BASE_WINDOW_TYPE, BaseWindow ))
+#define BASE_WINDOW_CLASS( klass )      ( G_TYPE_CHECK_CLASS_CAST( klass, BASE_WINDOW_TYPE, BaseWindowClass ))
+#define BASE_IS_WINDOW( object )        ( G_TYPE_CHECK_INSTANCE_TYPE( object, BASE_WINDOW_TYPE ))
+#define BASE_IS_WINDOW_CLASS( klass )   ( G_TYPE_CHECK_CLASS_TYPE(( klass ), BASE_WINDOW_TYPE ))
+#define BASE_WINDOW_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), BASE_WINDOW_TYPE, BaseWindowClass ))
+
+typedef struct _BaseWindowPrivate       BaseWindowPrivate;
+
+typedef struct {
+	/*< private >*/
+	GObject            parent;
+	BaseWindowPrivate *private;
+}
+	BaseWindow;
+
+typedef struct _BaseWindowClassPrivate  BaseWindowClassPrivate;
+
+/**
+ * BaseWindowClass:
+ * @initial_load_toplevel:
+ * @runtime_init_toplevel:
+ * @all_widgets_showed:
+ * @dialog_response:
+ * @delete_event:
+ * @get_toplevel_name:
+ * @get_iprefs_window_id:
+ * @get_ui_filename:
+ * @is_willing_to_quit:
+ *
+ * This defines the virtual method a derived class may, should or must implement.
+ */
+typedef struct {
+	/*< private >*/
+	GObjectClass            parent;
+	BaseWindowClassPrivate *private;
+
+	/*< public >*/
+	/**
+	 * initial_load_toplevel:
+	 * @window: this #BaseWindow instance.
+	 */
+	void              ( *initial_load_toplevel )( BaseWindow *window, gpointer user_data );
+
+	/**
+	 * runtime_init_toplevel:
+	 * @window: this #BaseWindow instance.
+	 */
+	void              ( *runtime_init_toplevel )( BaseWindow *window, gpointer user_data );
+
+	/**
+	 * all_widgets_showed:
+	 * @window: this #BaseWindow instance.
+	 */
+	void              ( *all_widgets_showed )   ( BaseWindow *window, gpointer user_data );
+
+	/**
+	 * dialog_response:
+	 * @window: this #BaseWindow instance.
+	 */
+	gboolean          ( *dialog_response )      ( GtkDialog *dialog, gint code, BaseWindow *window );
+
+	/**
+	 * delete_event:
+	 * @window: this #BaseWindow instance.
+	 *
+	 * The #BaseWindow class connects to the "delete-event" signal,
+	 * and transforms it into a virtual function. The derived class
+	 * can so implement the virtual function, without having to take
+	 * care of the signal itself.
+	 */
+	gboolean          ( *delete_event )         ( BaseWindow *window, GtkWindow *toplevel, GdkEvent *event );
+
+	/**
+	 * window_get_toplevel_name:
+	 * @window: this #BaseWindow instance.
+	 *
+	 * Pure virtual function.
+	 */
+	gchar *           ( *get_toplevel_name )    ( const BaseWindow *window );
+
+	/**
+	 * get_iprefs_window_id:
+	 * @window: this #BaseWindow instance.
+	 *
+	 * Asks the derived class for the string which must be used to
+	 * store last size and position of the window in GConf preferences.
+	 *
+	 * This delegates to #BaseWindow-derived classes the NactIPrefs
+	 * interface virtual function.
+	 */
+	gchar *           ( *get_iprefs_window_id ) ( const BaseWindow *window );
+
+	/**
+	 * get_ui_filename:
+	 * @window: this #BaseWindow instance.
+	 *
+	 * Asks the derived class for the filename of the XML definition of
+	 * the user interface for this window. This XML definition must be
+	 * suitable in order to be loaded via GtkBuilder.
+	 *
+	 * Defaults to application UI filename.
+	 *
+	 * Returns: the filename of the XML definition, to be g_free() by
+	 * the caller.
+	 */
+	gchar *           ( *get_ui_filename )      ( const BaseWindow *window );
+
+	/**
+	 * is_willing_to_quit:
+	 * @window: this #BaseWindow instance.
+	 *
+	 * Asks the derived class for the filename of the XML definition of
+	 * the user interface for this window. This XML definition must be
+	 * suitable in order to be loaded via GtkBuilder.
+	 *
+	 * Defaults to application UI filename.
+	 *
+	 * Returns: the filename of the XML definition, to be g_free() by
+	 * the caller.
+	 */
+	gboolean          ( *is_willing_to_quit )   ( const BaseWindow *window );
+}
+	BaseWindowClass;
+
 /**
  * Properties defined by the BaseWindow class.
  * They should be provided at object instanciation time.
@@ -75,6 +229,8 @@ G_BEGIN_DECLS
 #define BASE_WINDOW_SIGNAL_RUNTIME_INIT				"nact-base-window-runtime-init"
 #define BASE_WINDOW_SIGNAL_ALL_WIDGETS_SHOWED		"nact-base-window-all-widgets-showed"
 
+GType base_window_get_type( void );
+
 gboolean         base_window_init( BaseWindow *window );
 int              base_window_run( BaseWindow *window );
 



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