[nautilus-actions] BaseWindow::runtime_init_toplevel() is renamed as initialize_base_window()



commit ef1a36454f2404d38906c361c24310bea6db7c45
Author: Pierre Wieser <pwieser trychlos org>
Date:   Sun Jan 23 00:19:06 2011 +0100

    BaseWindow::runtime_init_toplevel() is renamed as initialize_base_window()

 ChangeLog              |    5 ++
 src/nact/base-window.c |  130 +++++++++++++++++++++++------------------------
 src/nact/base-window.h |   10 ++--
 3 files changed, 73 insertions(+), 72 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 737e57c..f3423f8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,11 @@
 
 	* src/nact/base-window.c:
 	* src/nact/base-window.h
+	(runtime_init_toplevel): Renamed as initialize_base_window().
+	(class_init): Fix cclosure_marshall for signals without argument.
+
+	* src/nact/base-window.c:
+	* src/nact/base-window.h
 	(get_toplevel_name, get_ui_filename): Removed virtual functions.
 
 	* src/nact/nact-add-capability-dialog.c:
diff --git a/src/nact/base-window.c b/src/nact/base-window.c
index d95ac1e..57f6a45 100644
--- a/src/nact/base-window.c
+++ b/src/nact/base-window.c
@@ -124,12 +124,13 @@ static gboolean         is_gtk_toplevel_initialized( const BaseWindow *window, G
 static void             set_gtk_toplevel_initialized( const BaseWindow *window, GtkWindow *gtk_toplevel, gboolean init );
 static void             on_initialize_gtk_toplevel_class_handler( BaseWindow *window, GtkWindow *toplevel );
 static void             do_initialize_gtk_toplevel( BaseWindow *window, GtkWindow *toplevel );
-static void             on_initialize_base_window_class_handler( BaseWindow *window, gpointer user_data );
-static void             do_initialize_base_window( BaseWindow *window, gpointer user_data );
-static void             on_all_widgets_showed_class_handler( BaseWindow *window, gpointer user_data );
 
 /* run
  */
+static void             on_initialize_base_window_class_handler( BaseWindow *window );
+static void             do_initialize_base_window( BaseWindow *window );
+static void             on_all_widgets_showed_class_handler( BaseWindow *window );
+
 static gboolean         is_main_window( BaseWindow *window );
 
 static gboolean         on_delete_event( GtkWidget *widget, GdkEvent *event, BaseWindow *window );
@@ -245,7 +246,7 @@ class_init( BaseWindowClass *klass )
 	klass->private = g_new0( BaseWindowClassPrivate, 1 );
 
 	klass->initialize_gtk_toplevel = do_initialize_gtk_toplevel;
-	klass->runtime_init_toplevel = do_initialize_base_window;
+	klass->initialize_base_window = do_initialize_base_window;
 	klass->all_widgets_showed = NULL;
 	klass->dialog_response = window_do_dialog_response;
 	klass->delete_event = window_do_delete_event;
@@ -288,10 +289,9 @@ class_init( BaseWindowClass *klass )
 				G_CALLBACK( on_initialize_base_window_class_handler ),
 				NULL,
 				NULL,
-				g_cclosure_marshal_VOID__POINTER,
+				g_cclosure_marshal_VOID__VOID,
 				G_TYPE_NONE,
-				1,
-				G_TYPE_POINTER );
+				0 );
 
 	/**
 	 * nact-signal-base-window-all-widgets-showed:
@@ -311,10 +311,9 @@ class_init( BaseWindowClass *klass )
 				G_CALLBACK( on_all_widgets_showed_class_handler ),
 				NULL,
 				NULL,
-				g_cclosure_marshal_VOID__POINTER,
+				g_cclosure_marshal_VOID__VOID,
 				G_TYPE_NONE,
-				1,
-				G_TYPE_POINTER );
+				0 );
 }
 
 static void
@@ -726,60 +725,6 @@ do_initialize_gtk_toplevel( BaseWindow *window, GtkWindow *toplevel )
 	}
 }
 
-/*
- * default class handler for "nact-signal-base-window-runtime-init" message
- * -> does nothing here
- */
-static void
-on_initialize_base_window_class_handler( BaseWindow *window, gpointer user_data )
-{
-	static const gchar *thisfn = "base_window_on_initialize_base_window_class_handler";
-
-	g_return_if_fail( BASE_IS_WINDOW( window ));
-
-	g_debug( "%s: window=%p, user_data=%p", thisfn, ( void * ) window, ( void * ) user_data );
-
-	if( !window->private->dispose_has_run ){
-
-		if( BASE_WINDOW_GET_CLASS( window )->runtime_init_toplevel ){
-			BASE_WINDOW_GET_CLASS( window )->runtime_init_toplevel( window, user_data );
-		}
-	}
-}
-
-static void
-do_initialize_base_window( BaseWindow *window, gpointer user_data )
-{
-	static const gchar *thisfn = "base_window_do_initialize_base_window";
-
-	g_return_if_fail( BASE_IS_WINDOW( window ));
-
-	g_debug( "%s: window=%p, user_data=%p, parent_window=%p",
-			thisfn, ( void * ) window, ( void * ) user_data, ( void * ) window->private->parent );
-
-	if( !window->private->dispose_has_run ){
-
-		base_iprefs_position_window( window );
-	}
-}
-
-static void
-on_all_widgets_showed_class_handler( BaseWindow *window, gpointer user_data )
-{
-	static const gchar *thisfn = "base_window_on_all_widgets_showed_class_handler";
-
-	g_return_if_fail( BASE_IS_WINDOW( window ));
-
-	g_debug( "%s: window=%p, user_data=%p", thisfn, ( void * ) window, ( void * ) user_data );
-
-	if( !window->private->dispose_has_run ){
-
-		if( BASE_WINDOW_GET_CLASS( window )->all_widgets_showed ){
-			BASE_WINDOW_GET_CLASS( window )->all_widgets_showed( window, user_data );
-		}
-	}
-}
-
 /**
  * base_window_run:
  * @window: this #BaseWindow object.
@@ -811,10 +756,10 @@ base_window_run( BaseWindow *window )
 			g_return_val_if_fail( GTK_IS_WINDOW( window->private->gtk_toplevel ), BASE_EXIT_CODE_START_FAIL );
 
 			g_debug( "%s: window=%p", thisfn, ( void * ) window );
-			g_signal_emit_by_name( window, BASE_SIGNAL_INITIALIZE_WINDOW, NULL );
+			g_signal_emit_by_name( window, BASE_SIGNAL_INITIALIZE_WINDOW );
 
 			gtk_widget_show_all( GTK_WIDGET( window->private->gtk_toplevel ));
-			g_signal_emit_by_name( window, BASE_SIGNAL_ALL_WIDGETS_SHOWED, NULL );
+			g_signal_emit_by_name( window, BASE_SIGNAL_ALL_WIDGETS_SHOWED );
 
 			if( is_main_window( window )){
 				if( GTK_IS_DIALOG( window->private->gtk_toplevel )){
@@ -844,6 +789,59 @@ base_window_run( BaseWindow *window )
 	return( run_ok ? BASE_EXIT_CODE_OK : BASE_EXIT_CODE_MAIN_WINDOW );
 }
 
+/*
+ * default class handler for "nact-signal-base-window-runtime-init" message
+ * -> does nothing here
+ */
+static void
+on_initialize_base_window_class_handler( BaseWindow *window )
+{
+	static const gchar *thisfn = "base_window_on_initialize_base_window_class_handler";
+
+	g_return_if_fail( BASE_IS_WINDOW( window ));
+
+	g_debug( "%s: window=%p", thisfn, ( void * ) window );
+
+	if( !window->private->dispose_has_run ){
+
+		if( BASE_WINDOW_GET_CLASS( window )->initialize_base_window ){
+			BASE_WINDOW_GET_CLASS( window )->initialize_base_window( window );
+		}
+	}
+}
+
+static void
+do_initialize_base_window( BaseWindow *window )
+{
+	static const gchar *thisfn = "base_window_do_initialize_base_window";
+
+	g_return_if_fail( BASE_IS_WINDOW( window ));
+
+	g_debug( "%s: window=%p", thisfn, ( void * ) window );
+
+	if( !window->private->dispose_has_run ){
+
+		base_iprefs_position_window( window );
+	}
+}
+
+static void
+on_all_widgets_showed_class_handler( BaseWindow *window )
+{
+	static const gchar *thisfn = "base_window_on_all_widgets_showed_class_handler";
+
+	g_return_if_fail( BASE_IS_WINDOW( window ));
+
+	g_debug( "%s: window=%p", thisfn, ( void * ) window );
+
+	if( !window->private->dispose_has_run ){
+
+		if( BASE_WINDOW_GET_CLASS( window )->all_widgets_showed ){
+			BASE_WINDOW_GET_CLASS( window )->all_widgets_showed( window );
+		}
+	}
+}
+
 static gboolean
 is_main_window( BaseWindow *window )
 {
diff --git a/src/nact/base-window.h b/src/nact/base-window.h
index 0feeaee..ea5a6ac 100644
--- a/src/nact/base-window.h
+++ b/src/nact/base-window.h
@@ -95,7 +95,7 @@ typedef struct _BaseWindowClassPrivate  BaseWindowClassPrivate;
 /**
  * BaseWindowClass:
  * @initialize_gtk_toplevel: initialize the toplevel GtkWindow
- * @runtime_init_toplevel:   initialize the BaseWindow
+ * @initialize_base_window:  initialize the BaseWindow
  * @all_widgets_showed:      all widgets have been showed
  * @dialog_response:
  * @delete_event:
@@ -128,9 +128,8 @@ typedef struct {
 	void     ( *initialize_gtk_toplevel )( BaseWindow *window, GtkWindow *toplevel );
 
 	/**
-	 * runtime_init_toplevel:
+	 * initialize_base_window:
 	 * @window: this #BaseWindow instance.
-	 * @user_data: not used
 	 *
 	 * Invoked after the GtkWindow toplevel has been initialized, before
 	 * actually dsplaying the widget, and after all connected handlers
@@ -142,12 +141,11 @@ typedef struct {
 	 * The BaseWindow base class implementation of this method, which is
 	 * so called last, reset last size and position of the window.
 	 */
-	void     ( *runtime_init_toplevel )  ( BaseWindow *window, gpointer user_data );
+	void     ( *initialize_base_window ) ( BaseWindow *window );
 
 	/**
 	 * all_widgets_showed:
 	 * @window: this #BaseWindow instance.
-	 * @user_data: not used
 	 *
 	 * Invoked at the end of initialization process, after all connected
 	 * handlers have themselves run.
@@ -155,7 +153,7 @@ typedef struct {
 	 * The derived class should invoke the virtual method of its parent class
 	 * at the end of its processing.
 	 */
-	void     ( *all_widgets_showed )   ( BaseWindow *window, gpointer user_data );
+	void     ( *all_widgets_showed )     ( BaseWindow *window );
 
 	/**
 	 * dialog_response:



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