Sawfish-capplet Patch



Hi All,

I have attached the patch to bring up sawfish capplet
in  gnome2.  Please review it and send ur comments.

John, can you give your comments on this?

Thanks


--- sawfish/configure.in	Fri Feb 22 10:10:50 2002
+++ sawfish_wip/configure.in	Fri Feb 22 08:53:05 2002
@@ -208,23 +208,27 @@ AC_ARG_ENABLE(capplet,
   --disable-capplet	  Don't built the capplet], [],
  [enable_capplet=yes])
 
-if test "$enable_capplet" = "yes"; then
-  AC_MSG_CHECKING([for GNOME control center config])
-  GNOME_CC_CFLAGS="`(gnome-config --cflags capplet) 2>/dev/null`"
-  GNOME_CC_LIBS="`(gnome-config --libs capplet) 2>/dev/null`"
-  if test $? -ne 0; then
-    AC_MSG_RESULT([no])
-    AC_MSG_WARN([Can't run "gnome-config capplet", not building capplet])
-  else
-    AC_MSG_RESULT([yes])
-    dnl XXX this is bogus!
-    GNOME_CC_CFLAGS="`gnome-config --cflags gnome capplet`"
-    GNOME_CC_LIBS="`gnome-config --libs gnome capplet`"
-    AC_SUBST(GNOME_CC_CFLAGS)
-    AC_SUBST(GNOME_CC_LIBS)
-    add_subdir "capplet"
-  fi
-fi
+ if test "$enable_capplet" = "yes"; then
+
+	AC_MSG_CHECKING([for GNOME control center config])
+	add_subdir "capplet"
+
+dnl  AC_MSG_CHECKING([for GNOME control center config])
+dnl  GNOME_CC_CFLAGS="`(gnome-config --cflags capplet) 2>/dev/null`"
+dnl   GNOME_CC_LIBS="`(gnome-config --libs capplet) 2>/dev/null`"
+dnl   if test $? -ne 0; then
+dnl     AC_MSG_RESULT([no])
+dnl     AC_MSG_WARN([Can't run "gnome-config capplet", not building capplet])
+dnl   else
+dnl     AC_MSG_RESULT([yes])
+dnl     dnl XXX this is bogus!
+dnl     GNOME_CC_CFLAGS="`gnome-config --cflags gnome capplet`"
+dnl     GNOME_CC_LIBS="`gnome-config --libs gnome capplet`"
+dnl     AC_SUBST(GNOME_CC_CFLAGS)
+dnl     AC_SUBST(GNOME_CC_LIBS)
+dnl     add_subdir "capplet"
+dnl   fi
+ fi
 
 AC_ARG_ENABLE(themer,
  [  --enable-themer	  Build the sawfish-themer program [default]
--- sawfish/ChangeLog	Fri Feb 22 10:10:50 2002
+++ sawfish_wip/ChangeLog	Fri Feb 22 10:09:38 2002
@@ -1,3 +1,10 @@
+2002-02-22  JeyaSudha <jeyasudha duriapandy wipro com>
+	
+	Removing the libcapplet stuff for sawfish-capplet
+	
+	* configure.in : removed the gnome-config --libs capplet and 
+	gnome-config --cflags capplet 
+
 2002-02-12  John Harper  <jsh unfactored org>
 
 	* po/sawfish.pot: committed an updated version
--- sawfish/capplet/ChangeLog	Fri Feb 22 10:10:50 2002
+++ sawfish_wip/capplet/ChangeLog	Fri Feb 22 10:10:16 2002
@@ -1,3 +1,14 @@
+2002-02-22 JeyaSudha <jeyasudha duraipandy wipro com>
+
+	Changes made to bring up sawfish-capplet in Gnome2 	
+	
+	* sawmill-capplet.c : Removed the libcapplet library calls.
+	In a gtk dialog widget get the sawfish-ui and display it.
+	Instead of gnome_capplet_init, gnome_program_init is used.
+	
+	* Makefile.in : Added the gnome2 libraries and headerfiles
+			
+
 2001-08-31  John Harper  <jsh pixelslut com>
 
 	Fixed 4235 (error in sawfish-ui -> sawfish-capplet livelocks):
--- sawfish/capplet/Makefile.in	Fri Feb 22 10:10:50 2002
+++ sawfish_wip/capplet/Makefile.in	Fri Feb 22 08:54:55 2002
@@ -26,6 +26,11 @@ top_srcdir= top_srcdir@
 srcdir= srcdir@
 VPATH= srcdir@:@top_srcdir@
 
+ GNOME_CC_CFLAGS=-I/opt/gnome-2.0/include/gtk-2.0 -I/opt/gnome-2.0/lib/gtk-2.0/include -I/opt/gnome-2.0/include/atk-1.0 -I/opt/gnome-2.0/include/pango-1.0 -I/opt/gnome-2.0/include/freetype2 -I/opt/gnome-2.0/include/glib-2.0 -I/opt/gnome-2.0/lib/glib-2.0/include -I/opt/gnome-2.0/include/gconf/2 -I/opt/gnome-2.0/include/libgnomeui-2.0 -I/opt/gnome-2.0/include/libgnome-2.0 -I/opt/gnome-2.0/include/libart-2.0 -I/opt/gnome-2.0/include/libbonoboui-2.0 -I/opt/gnome-2.0/include/libbonobo-2.0 -I/opt/gnome-2.0/include/gnome-vfs-2.0 -I/opt/gnome-2.0/lib/gnome-vfs-2.0/include -I/opt/gnome-2.0/include/bonobo-activation-2.0 -I/opt/gnome-2.0/include/libxml2 -I/opt/gnome-2.0/include/libglade-2.0 -I/opt/gnome-2.0/include/orbit-2.0 -I/opt/gnome-2.0/include/linc-1.0 -I/opt/gnome-2.0/include/libgnomecanvas-2.0 
+
+GNOME_CC_LIBS=-rdynamic          -L/opt/gnome-2.0/lib -L/usr/X11R6/lib -lgnomeui-2 -lSM -lICE -lgnome-2 -lgnomevfs-2 -lbonoboui-2 -lbonobo-2 -lbonobo-activation -lart_lgpl_2 -lpangoft2 -lglade-2.0 -lgtk-x11-1.3 -lxml2 -lz -lgdk-x11-1.3 -latk -lgdk_pixbuf-1.3 -lpangox -lpangoxft -lXft -lXrender -lXext -lX11 -lfreetype -lpango -lgconf-2 -lgnomecanvas-2 -lORBit-2 -lgthread-1.3 -lpthread -lgobject-1.3 -lgmodule-1.3 -ldl -lglib-1.3 -lm -llinc 
+
+
 override CFLAGS += $(GNOME_CC_CFLAGS)
 override LIBS += $(GNOME_CC_LIBS)
 
--- sawfish/capplet/sawmill-capplet.c	Fri Feb 22 10:10:50 2002
+++ sawfish_wip/capplet/sawmill-capplet.c	Fri Feb 22 08:55:06 2002
@@ -39,12 +39,14 @@
 # include <sys/wait.h>
 #endif
 
-#include <capplet-widget.h>
 #include <gdk/gdkx.h>
+#include <gtk/gtk.h>
+#include <gnome.h>
 
 static GtkWidget *ui_socket;
 static GtkWidget *capplet;
 
+
 static int ui_pid;
 static int ui_stdin[2];
 static int ui_stdout[2];
@@ -140,7 +142,6 @@ ui_output_callback (gpointer data, gint 
 	switch (out)
 	{
 	case 'c':
-	    capplet_widget_state_changed (CAPPLET_WIDGET (capplet), TRUE);
 	    break;
 
 	case 'g':			/* group doesn't exist */
@@ -178,14 +179,12 @@ sawmill_revert (void)
 static void
 sawmill_ok (void)
 {
-    gtk_container_remove (GTK_CONTAINER (capplet), ui_socket);
     ui_command ("ok\n");
 }
 
 static void
 sawmill_cancel (void)
 {
-    gtk_container_remove (GTK_CONTAINER (capplet), ui_socket);
     ui_command ("cancel\n");
 }
 
@@ -205,8 +204,7 @@ sawmill_running_p (void)
 static void
 sawmill_setup (void)
 {
-    capplet = capplet_widget_new ();
-
+    capplet = gtk_dialog_new();
     if (!sawmill_running_p ())
     {
 	GtkWidget *label = gtk_label_new (_("Sawfish isn't running"));
@@ -214,22 +212,9 @@ sawmill_setup (void)
 	return;
     }
 
-    gtk_signal_connect (GTK_OBJECT (capplet), "help",
-			GTK_SIGNAL_FUNC (sawmill_help), NULL);
-    gtk_signal_connect (GTK_OBJECT (capplet), "try",
-			GTK_SIGNAL_FUNC (sawmill_apply), NULL);
-    gtk_signal_connect (GTK_OBJECT (capplet), "revert",
-			GTK_SIGNAL_FUNC (sawmill_revert), NULL);
-    gtk_signal_connect (GTK_OBJECT (capplet), "ok",
-			GTK_SIGNAL_FUNC (sawmill_ok), NULL);
-    gtk_signal_connect (GTK_OBJECT (capplet), "cancel",
-			GTK_SIGNAL_FUNC (sawmill_cancel), NULL);
-
     ui_socket = gtk_socket_new ();
-    gtk_container_add (GTK_CONTAINER (capplet), ui_socket);
-
-    /* show this here so the widget gets realized */
-    gtk_widget_show_all (capplet);
+    gtk_container_add (GTK_CONTAINER ((GTK_DIALOG(capplet))->vbox), ui_socket);
+   
 
     /* now fork the sawmill-ui script */
     pipe (ui_stdin);
@@ -250,15 +235,12 @@ sawmill_setup (void)
 	close (ui_stdin[1]);
 	close (ui_stdout[0]);
 	close (ui_stdout[1]);
-	sprintf (buf, "%ld", (long)GDK_WINDOW_XWINDOW (ui_socket->window));
 	i = 0;
 	argv[i++] = "sawfish-ui";
 	if (!no_flatten)
 	    argv[i++] = "--flatten";
 	else
 	    argv[i++] = "--single-level";
-	argv[i++] = "--socket-id";
-	argv[i++] = buf;
 	if (group != 0)
 	{
 	    argv[i++] = "--group";
@@ -277,7 +259,6 @@ sawmill_setup (void)
     }
 }
 
-
 /* entry point */
 
 int
@@ -293,8 +274,8 @@ main (int argc, char **argv)
 	  0, "Sawfish customization group", "GROUP" },
 	{ "sawfish-group", 0, POPT_ARG_STRING, &group,
 	  0, "Sawfish customization group", "GROUP" },
-	{ "sawfish-no-flatten", 0, POPT_ARG_NONE, &no_flatten,
-	  0, "Don't flatten group trees", 0 },
+//	{ "sawfish-no-flatten", 0, POPT_ARG_NONE, &no_flatten,
+	//  0, "Don't flatten group trees", 0 },
 	{ 0, 0, 0, 0, 0 }
     };
 
@@ -302,16 +283,7 @@ main (int argc, char **argv)
     bindtextdomain (PACKAGE, GNOMELOCALEDIR);
     textdomain (PACKAGE);
 #endif
-
-    init_results = gnome_capplet_init("sawfish-properties", SAWFISH_VERSION,
-				      argc, argv, options, 0, NULL);
-
-    if (init_results < 0) {
-	g_warning ("an initialization error occurred while "
-		   "starting 'sawfish-properties-capplet'.\n"
-		   "aborting...\n");
-	exit (1);
-    }
+	gnome_program_init("sawfish-properties", SAWFISH_VERSION, LIBGNOMEUI_MODULE, argc, argv, GNOME_PARAM_POPT_TABLE, options, NULL);
 
     client = gnome_master_client ();
     flags = gnome_client_get_flags(client);
@@ -342,12 +314,9 @@ main (int argc, char **argv)
 	token = 1;
 #endif
 
-    if (init_results != 1) {
 	sawmill_setup ();
-	gtk_widget_show_all (capplet);
-	capplet_gtk_main ();
+	gtk_main ();
 	if (ui_pid != 0)
 	    waitpid (ui_pid, 0, 0);
-    }
     return 0;
 }


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