antiright-devel
[Top][All Lists]
Advanced

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

[Antiright-devel] antiright configure ACE-desktop/ACE gtkshell/ad...


From: Jeffrey Bedard
Subject: [Antiright-devel] antiright configure ACE-desktop/ACE gtkshell/ad...
Date: Wed, 11 Aug 2010 12:03:25 +0000

CVSROOT:        /sources/antiright
Module name:    antiright
Changes by:     Jeffrey Bedard <jefbed> 10/08/11 12:03:25

Modified files:
        .              : configure 
        ACE-desktop    : ACE 
        gtkshell       : add_options.c button.c button.h callbacks.c 
                         color.c color.h containers.c dragdrop.c 
                         ptk-app-menu.c row.c swallow.c swallow.h undo.c 
                         undo.h 

Log message:
        Updated version to 3.8.  Fixed layout code for dealing with application 
menu.  Changed from use of gboolean to bool.  Use GtkSocket API for swallow.c.
        Swallowing code is still a work in progress.  Removed unused code from
        ptk-app-menu.c.  

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/configure?cvsroot=antiright&r1=1.121&r2=1.122
http://cvs.savannah.gnu.org/viewcvs/antiright/ACE-desktop/ACE?cvsroot=antiright&r1=1.58&r2=1.59
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/add_options.c?cvsroot=antiright&r1=1.59&r2=1.60
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/button.c?cvsroot=antiright&r1=1.58&r2=1.59
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/button.h?cvsroot=antiright&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/callbacks.c?cvsroot=antiright&r1=1.34&r2=1.35
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/color.c?cvsroot=antiright&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/color.h?cvsroot=antiright&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/containers.c?cvsroot=antiright&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/dragdrop.c?cvsroot=antiright&r1=1.16&r2=1.17
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/ptk-app-menu.c?cvsroot=antiright&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/row.c?cvsroot=antiright&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/swallow.c?cvsroot=antiright&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/swallow.h?cvsroot=antiright&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/undo.c?cvsroot=antiright&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/undo.h?cvsroot=antiright&r1=1.2&r2=1.3

Patches:
Index: configure
===================================================================
RCS file: /sources/antiright/antiright/configure,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -b -r1.121 -r1.122
--- configure   22 Jul 2010 19:50:36 -0000      1.121
+++ configure   11 Aug 2010 12:03:21 -0000      1.122
@@ -24,7 +24,7 @@
 #
 ###############################################################################
 
-VERSION=3.7a
+VERSION=3.8
 
 TRUE=0
 FALSE=1

Index: ACE-desktop/ACE
===================================================================
RCS file: /sources/antiright/antiright/ACE-desktop/ACE,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -b -r1.58 -r1.59
--- ACE-desktop/ACE     22 Jul 2010 19:50:36 -0000      1.58
+++ ACE-desktop/ACE     11 Aug 2010 12:03:21 -0000      1.59
@@ -184,6 +184,11 @@
        GUIDL IDE
 }
 
+GetWindowID()
+{
+       xwininfo -int -name "$1" | awk '/Window id:/{print $4}' | tail -n1
+}
+
 IDE_CD()
 {
        local DIR="$(gtkshell -dd)"

Index: gtkshell/add_options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/add_options.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -b -r1.59 -r1.60
--- gtkshell/add_options.c      26 Oct 2008 00:36:10 -0000      1.59
+++ gtkshell/add_options.c      11 Aug 2010 12:03:22 -0000      1.60
@@ -206,7 +206,7 @@
 gsh_add_embedded_cb(GSH * gsh, gint * counter, const gchar ** argv)
 {
 #ifndef WIN32
-       gsh_swallow_app(gsh, (char *)argv[++(*counter)]);
+       gsh_swallow_app(gsh, argv[++(*counter)]);
 #endif
 }
 

Index: gtkshell/button.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/button.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -b -r1.58 -r1.59
--- gtkshell/button.c   20 Dec 2007 00:21:11 -0000      1.58
+++ gtkshell/button.c   11 Aug 2010 12:03:22 -0000      1.59
@@ -21,13 +21,12 @@
 */
 
 #include "gtkshell.h"
-#include <sys/stat.h>
+#include <glib/gstdio.h>
 
-
-gboolean
+bool
 gsh_check_command_exists(GSH * gsh, const gchar * command)
 {
-       gboolean return_value=TRUE;
+       bool return_value=TRUE;
 
        if(GSH_FLAG(GSH_CHECK_COMMANDS))
        {
@@ -43,10 +42,7 @@
                g_free(selection);
                path=antiright_pipe_read(pipe_command);
                g_free(pipe_command);
-               {
-                       struct stat sb;
-                       return_value=stat(path, &sb)==-1?FALSE:TRUE;
-               }
+               return_value = g_file_test(path, G_FILE_TEST_EXISTS);
                g_free(path);
        }
 
@@ -137,7 +133,7 @@
                GTK_STOCK_EXECUTE, GTK_ICON_SIZE_SMALL_TOOLBAR);
 }
 
-static gboolean
+static bool
 setup_icon_for_toolbutton(GtkWidget * toolbutton, gchar * label_text)
 {
        GtkWidget * icon;
@@ -203,11 +199,11 @@
                gtk_button_set_alignment(GTK_BUTTON(button), 0.0, 0.5);
 }
 
-static gboolean
+static bool
 test_image_button(struct GSH * gsh, const gchar * string)
 {
        gchar **pair;
-       gboolean return_value;
+       bool return_value;
 
        pair=g_strsplit(string, ",", 2);
        if((return_value=(pair[1] != NULL)))

Index: gtkshell/button.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/button.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- gtkshell/button.h   8 Nov 2007 06:41:53 -0000       1.13
+++ gtkshell/button.h   11 Aug 2010 12:03:22 -0000      1.14
@@ -39,7 +39,7 @@
        { "Close", GTK_STOCK_CLOSE }\
 }
 
-gboolean
+bool
 gsh_check_command_exists(GSH * gsh, const gchar * command);
 
 #endif

Index: gtkshell/callbacks.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/callbacks.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- gtkshell/callbacks.c        11 Nov 2007 22:18:08 -0000      1.34
+++ gtkshell/callbacks.c        11 Aug 2010 12:03:23 -0000      1.35
@@ -62,7 +62,7 @@
 
 #define MATCH(str) !strncmp(command, str, strlen(str))
 
-static gboolean
+static bool
 test_special_text_editor_command(struct GSH * gsh, const gchar * command)
 {
        if(MATCH("Save_As...___"))
@@ -84,7 +84,7 @@
        return TRUE;
 }
 
-static gboolean
+static bool
 test_special_command(struct GSHCBData * cb)
 {
        const gchar * command = cb->data;

Index: gtkshell/color.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/color.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- gtkshell/color.c    19 Dec 2007 18:44:45 -0000      1.2
+++ gtkshell/color.c    11 Aug 2010 12:03:23 -0000      1.3
@@ -24,7 +24,7 @@
 #include "gtkshell.h"
 
 static GdkColor
-get_color_for_string(const gchar * color_string, const gboolean is_fg)
+get_color_for_string(const gchar * color_string, const bool is_fg)
 {
        GdkColor color;
 
@@ -39,7 +39,7 @@
 
 void
 gsh_widget_set_color(GtkWidget * widget, 
-       const gchar * color_string, gboolean is_fg_color)
+       const gchar * color_string, bool is_fg_color)
 {
        GdkColor color;
 

Index: gtkshell/color.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/color.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- gtkshell/color.h    10 Dec 2007 15:14:05 -0000      1.1
+++ gtkshell/color.h    11 Aug 2010 12:03:23 -0000      1.2
@@ -29,7 +29,7 @@
 
 void
 gsh_widget_set_color(GtkWidget * widget, 
-       const gchar * color_string, gboolean is_fg_color);
+       const gchar * color_string, bool is_fg_color);
 
 #endif /* ! GSH_COLOR_H */
 

Index: gtkshell/containers.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/containers.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- gtkshell/containers.c       10 Nov 2008 22:04:37 -0000      1.24
+++ gtkshell/containers.c       11 Aug 2010 12:03:23 -0000      1.25
@@ -90,8 +90,9 @@
 static void
 setup_app_mode_frame(struct GSH * gsh)
 {
-       gtk_container_add(GTK_CONTAINER(GWA.frame), 
-               gsh->rows->h); 
+       GSHCA(GWA.frame, gsh->rows->h);
+/*     gtk_container_add(GTK_CONTAINER(GWA.frame), 
+               gsh->rows->h); */
        gsh->rows->h=GWA.row;
 }
 

Index: gtkshell/dragdrop.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/dragdrop.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- gtkshell/dragdrop.c 20 Dec 2007 00:21:11 -0000      1.16
+++ gtkshell/dragdrop.c 11 Aug 2010 12:03:23 -0000      1.17
@@ -41,7 +41,7 @@
              gint y, GtkSelectionData * selection, guint target_type,
              guint time, gpointer data)
 {
-       gboolean drag_status;
+       bool drag_status;
 
        UNUSED(x);
        UNUSED(y);
@@ -63,7 +63,7 @@
        gtk_drag_finish(context, drag_status, FALSE, time);
 }
 
-static gboolean
+static bool
 drag_drop(GtkWidget *widget, GdkDragContext * context, gint x,
          gint y, guint time, gpointer data)
 {

Index: gtkshell/ptk-app-menu.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/ptk-app-menu.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- gtkshell/ptk-app-menu.c     2 Nov 2008 20:10:55 -0000       1.2
+++ gtkshell/ptk-app-menu.c     11 Aug 2010 12:03:23 -0000      1.3
@@ -208,50 +208,6 @@
     return strcmp(data->name, name);
 }
 
-/* Moved to misc.c of lxpanel to be used in other plugins */
-#if 0
-static char* translate_exec( const char* exec, const char* icon,
-                             const char* title, const char* fpath )
-{
-    GString* cmd = g_string_sized_new( 256 );
-    for( ; *exec; ++exec )
-    {
-        if( G_UNLIKELY(*exec == '%') )
-        {
-            ++exec;
-            if( !*exec )
-                break;
-            switch( *exec )
-            {
-            case 'c':
-                g_string_append( cmd, title );
-                break;
-            case 'i':
-                if( icon )
-                {
-                    g_string_append( cmd, "--icon " );
-                    g_string_append( cmd, icon );
-                }
-                break;
-            case 'k':
-                {
-                    char* uri = g_filename_to_uri( fpath, NULL, NULL );
-                    g_string_append( cmd, uri );
-                    g_free( uri );
-                    break;
-                }
-            case '%':
-                g_string_append_c( cmd, '%' );
-                break;
-            }
-        }
-        else
-            g_string_append_c( cmd, *exec );
-    }
-    return g_string_free( cmd, FALSE );
-}
-#endif
-
 static char* load_cat_title( GKeyFile* kf, CatInfo* inf )
 {
     char* ret = NULL;
@@ -296,7 +252,7 @@
        req->width = ICON_SIZE;
 }
 
-static gboolean on_menu_item_expose( GtkWidget* item,
+static bool on_menu_item_expose( GtkWidget* item,
                                      GdkEventExpose* evt,
                                      gpointer user_data )
 {
@@ -351,8 +307,12 @@
 #endif
     if( !g_spawn_command_line_async( data->exec, &err ) )
     {
-        /* FIXME: show error message */
-        g_error_free( err );
+       GtkWidget * dialog;
+       dialog=gtk_message_dialog_new(NULL, GTK_DIALOG_DESTROY_WITH_PARENT, 
+               GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, err->message);
+       gtk_dialog_run(GTK_DIALOG(dialog));
+       gtk_widget_destroy(dialog);
+       g_clear_error(&err);
     }
 }
 
@@ -534,29 +494,13 @@
     do_load_dir( strlen( path ) + 1, path, sub_menus );
 }
 
-#if defined( PTK_APP_MENU_DEMO )
-static GtkWidget* app_menu = NULL;
-static void on_menu( GtkWidget* btn, gpointer user_data )
-{
-    if( ptk_app_menu_need_reload() )
-    {
-        if( app_menu )
-            gtk_widget_destroy( app_menu );
-        app_menu = ptk_app_menu_new();
-    }
-    else if( !app_menu )
-        app_menu = ptk_app_menu_new();
-    gtk_menu_popup(GTK_MENU(app_menu), NULL, NULL, NULL, NULL, 0, 0 );
-}
-#endif
-
 static void on_app_menu_destroy( gpointer user_data, GObject* menu )
 {
     g_signal_handler_disconnect( gtk_icon_theme_get_default(),
                                  GPOINTER_TO_INT(user_data) );
 }
 
-gboolean ptk_app_menu_item_has_data( GtkMenuItem* item )
+bool ptk_app_menu_item_has_data( GtkMenuItem* item )
 {
    return (g_object_get_qdata( G_OBJECT(item), PTK_APP_MENU_ITEM_ID ) != NULL);
 }
@@ -665,25 +609,7 @@
     g_free( path );
 }
 
-#if defined( PTK_APP_MENU_DEMO )
-int main( int argc, char** argv )
-{
-    gtk_init(&argc, &argv);
-    GtkWidget* window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
-    gtk_window_set_title(GTK_WINDOW( window ), "Show Applications" );
-    GtkWidget* button = gtk_button_new_with_label("Application Menu");
-    g_signal_connect(button, "clicked", G_CALLBACK(on_menu), NULL );
-    gtk_container_add( GTK_CONTAINER(window), button );
-    g_signal_connect(window, "delete-event", G_CALLBACK(gtk_main_quit), NULL );
-    gtk_widget_show_all(window);
-    if( app_menu )
-        gtk_widget_destroy( app_menu );
-    gtk_main();
-    return 0;
-}
-#endif
-
-gboolean ptk_app_menu_need_reload( GtkWidget* menu )
+bool ptk_app_menu_need_reload( GtkWidget* menu )
 {
     const char** sys_dirs = (const char**)g_get_system_data_dirs();
     char* path;
@@ -719,29 +645,62 @@
     return FALSE;
 }
 
-void
-gsh_add_app_menu_cb(GSH * gsh, gint * counter, const gchar ** argv)
+static void
+setup_app_menu_icon(GSH * gsh, GtkWidget * menu_item)
 {
-       GtkWidget * menu_bar;
-       GtkWidget * app_menu;
-       GtkWidget * menu_item;
-
-       app_menu=ptk_app_menu_new();
-       gtk_widget_show(app_menu);
+       /* Ensure proper icon size */
+       if(!GSH_FLAG(GSH_ICON_SIZE_IS_CUSTOM))
+               gsh->icon_size=GTK_ICON_SIZE_BUTTON;
+       gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_item), 
+               gtk_image_new_from_stock("gtk-home", gsh->icon_size));
+}
 
-       menu_bar=gtk_menu_bar_new();
+static void
+manage_app_menu(GSH * gsh, GtkWidget * menu_bar)
+{
+       GtkWidget * hbox;
+       guint * current_row = &(gsh->rows->current);
 
-       menu_item=gtk_image_menu_item_new();
-       gtk_widget_show(menu_item);
+       (*current_row)++;       
+       hbox=gtk_hbox_new(TRUE, 0);
+       gtk_container_set_border_width(GTK_CONTAINER(hbox), 0);
+       GSHCA(hbox, menu_bar);
+       (*current_row)++;
+       $(gsh, manage, hbox);
+}
 
-       gtk_image_menu_item_set_image(menu_item, 
-               gtk_image_new_from_stock("gtk-home", gsh->icon_size));
+static GtkWidget *
+setup_menu_bar(GtkWidget * menu_button_item)
+{
+       GtkWidget * menu_bar;
 
-       gtk_menu_bar_append(menu_bar, menu_item);
-       gtk_menu_item_set_submenu((GtkMenuItem*)menu_item, app_menu);
+       menu_bar = gtk_menu_bar_new();
+       gtk_menu_bar_append(menu_bar, menu_button_item);
+       gtk_container_set_border_width(GTK_CONTAINER(menu_bar), 0);
+       gtk_widget_show(menu_bar);
        
-       $(gsh, manage, menu_bar); 
+       return menu_bar;
 }
 
+static GtkWidget *
+setup_menu_button_item(GSH * gsh, GtkWidget * app_menu)
+{
+       GtkWidget * menu_button_item;
+
+       menu_button_item = gtk_image_menu_item_new();
+       setup_app_menu_icon(gsh, menu_button_item);
+       gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_button_item), app_menu);
+       gtk_widget_show(menu_button_item);
+
+       return menu_button_item;
+}
 
+void
+gsh_add_app_menu_cb(GSH * gsh, gint * counter, const gchar ** argv)
+{
+       manage_app_menu(gsh, 
+               setup_menu_bar(
+                       setup_menu_button_item(gsh, 
+                               ptk_app_menu_new())));
+}
 

Index: gtkshell/row.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/row.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- gtkshell/row.c      7 Aug 2010 16:47:22 -0000       1.25
+++ gtkshell/row.c      11 Aug 2010 12:03:23 -0000      1.26
@@ -84,7 +84,7 @@
        gsh->widgets.last_managed=widget;
 }
 
-static gboolean
+static bool
 test_manage_menu_item(GtkWidget * container, GtkWidget * widget)
 {
        if(GTK_IS_MENU(container) || GTK_IS_MENU_BAR(container)
@@ -108,16 +108,25 @@
        {
                struct GSHRows * rows = gsh->rows;
                GtkWidget * vert  = rows->v;
-
                if(test_manage_menu_item(vert, widget))
                        return;
                $(rows, check);
+               if(GSH_FLAG(GSH_NO_EXPAND))
+               {
+                       GSHCA_TIGHT(vert, widget);
+               }
+               else
+               {
+                       GSHCA(vert, widget);
+               }
+#if 0          
                /* Test for unexpanded addition of a child.  */
                if(GSH_FLAG(GSH_NO_EXPAND))
                        gtk_box_pack_start(GTK_BOX(vert), widget,
                                FALSE, FALSE, 0);
                else
                        gtk_container_add(GTK_CONTAINER(vert), widget);
+#endif
                gsh_manage_generic(gsh, widget);
        }
 }

Index: gtkshell/swallow.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/swallow.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- gtkshell/swallow.c  26 Oct 2008 21:12:38 -0000      1.7
+++ gtkshell/swallow.c  11 Aug 2010 12:03:24 -0000      1.8
@@ -22,184 +22,39 @@
   along with AntiRight; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
 */
-#ifndef WIN32
+
 #include "gtkshell.h"
-#ifndef WIN32
-#include <gdk/gdkx.h>
-#endif
-#include <X11/X.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#ifdef WIN32
-#include <reent.h>
-#endif
-#include <utmpx.h>
 
-static gboolean 
-swallow(char* wantedWindow, Display* display, Screen* screen, Window hunger, 
-       unsigned int* width, unsigned int* height)
+GtkWidget *
+gsh_swallow_app(GSH * gsh, const gchar * window_id)
 {
-    int ready = FALSE, i,k,l;
-    unsigned int number_of_kids, number_of_subkids, number_of_subsubkids;
-    Window root, parent, *children=NULL,*subchildren=NULL,*subsubchildren=NULL;
-    Window victim;
-    char *windowname;
-    XWMHints *leader_change;
-    int x, y;
-    unsigned int junk;
-    double start, now;
-    struct timeval tv;
-    char ret;
-
-    if(! display) return FALSE;
-
-    XSync (display, FALSE);
-
-    gettimeofday(&tv, NULL);
-    now = start = (double)tv.tv_sec + ((double)tv.tv_usec / 1000000.0);
-
-    while (ready == FALSE && now < (start + 10.0))
-    {
-        if (children != (Window *) NULL) XFree (children);
-
-        XQueryTree (display, RootWindowOfScreen (screen), &root,
-                    &parent, &children, &number_of_kids);
-        for (i = 0; i < number_of_kids; i++)
-        {
-            if (0 != XFetchName (display, children[i], &windowname))
-            {
-                if (!strcmp (windowname, wantedWindow))
-                {
-                    ready = TRUE;
-                    victim = children[i];
-                    fprintf(stderr,"Found It\n");
-                }
-                else
-                    fprintf(stderr,"Found %s\n",windowname);
-                XFree (windowname);
-            }
-            /*for each of these toplevel windows check their children*/
-            /*if it wasnt found*/
-            if (ready == FALSE)
-            {
-                if (subchildren != (Window *) NULL)
-                    XFree (subchildren);
-                XQueryTree (display, children[i], &root,
-                            &parent, &subchildren, &number_of_subkids);
-                for (k = 0; k < number_of_subkids; k++)
-                {
-                    if (0 != XFetchName (display, subchildren[k], &windowname))
-                    {
-                        if (!strcmp (windowname, wantedWindow))
-                        {
-                            ready = TRUE;
-                            victim = subchildren[k];
-                            fprintf(stderr,"Found %s!!!\n",windowname);
-                        }
-                        else
-                            fprintf(stderr,"Found %s\n",windowname);
-                        XFree (windowname);
-                    }
-                    /**/
-                    /*for each of these sublevel windows check their children*/
-                    /*if it wasnt found*/
-                    if (ready == FALSE)
-                    {
-                        if (subsubchildren != (Window *) NULL)
-                            XFree (subsubchildren);
-                        XQueryTree (display, subchildren[k], &root,
-                                    &parent, &subsubchildren, 
&number_of_subsubkids);
-                        for (l = 0; l < number_of_subsubkids; l++)
-                        {
-                            if (0 != XFetchName (display, subsubchildren[l], 
&windowname))
-                            {
-                                if (!strcmp (windowname, wantedWindow))
-                                {
-                                    ready = TRUE;
-                                    victim = subsubchildren[l];
-                                    fprintf(stderr,"Found %s!!!\n",windowname);
-                                }
-                                else
-                                    fprintf(stderr,"Found %s\n",windowname);
-                                XFree (windowname);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        fprintf(stderr,"Loop");
-        gtk_main_iteration_do(FALSE);
-
-        gettimeofday(&tv, NULL);
-        now = (double)tv.tv_sec + ((double)tv.tv_usec / 1000000.0);
-    }
-
-    if(ready) {
-        XSync (display, FALSE);
-        XUnmapWindow (display, victim);
-        XIconifyWindow (display, victim, XScreenNumberOfScreen (screen));
-        XWithdrawWindow (display, victim, XScreenNumberOfScreen (screen));
-        XMoveWindow (display, victim, -9999, -9999);
-
-        leader_change = XGetWMHints(display, victim);
-        if(leader_change) {
-            leader_change->flags = (leader_change->flags | WindowGroupHint);
-            leader_change->window_group = RootWindowOfScreen(screen);
-        }
-        XSetWindowBorderWidth (display, victim, 0);
-
-        XSync (display, FALSE);
+       GtkWidget *socket, *frame, *toplvl;
+       GdkNativeWindow window;
 
-        sleep(1);
+       socket = gtk_socket_new();
+       toplvl=gtk_window_new(GTK_WINDOW_TOPLEVEL);
+       gtk_widget_show(toplvl);
+       GSHCA(toplvl, socket);
+       gtk_widget_show(socket);
+//     gtk_window_present(GTK_WINDOW(toplvl));
+       //$(gsh, manage, socket);
+       //GSH_SET(GSH_NO_BASE_FRAME);
+       //$(gsh, finalize);
+//     gtk_widget_show(gsh->widgets.window);
+//     gtk_widget_realize(gsh->widgets.window);
+//     $(gsh, finalize);
+       window = (GdkNativeWindow)g_ascii_strtoll(window_id, NULL, 0);
+       assert(window);
+//#if 0
+       gtk_socket_add_id(GTK_SOCKET(socket), window);
+       frame=gtk_frame_new("Socket");
+       gtk_widget_reparent(socket, frame);
+       gtk_widget_show(socket);
+       gtk_widget_destroy(toplvl);
+//#endif
+       $(gsh, manage, frame);
+//     gtk_socket_steal(GTK_SOCKET(socket), window);
 
-        XReparentWindow (display, victim, hunger, -9999, -9999);
-
-        XGetGeometry (display, victim, &root, &x, &y, width, height, &junk, 
&junk);
-        XMoveWindow (display, victim, 0, 0);
-        if(leader_change) XSetWMHints(display, victim, leader_change);
-        XMapWindow (display, victim);
-        XSync (display, FALSE);
-
-        ret = TRUE;
-    } else {
-        ret = FALSE;
-    }
-
-    if (children != (Window *) NULL)
-        XFree (children);
-    if (subchildren != (Window *) NULL)
-        XFree (subchildren);
-    if (subsubchildren != (Window *) NULL)
-        XFree (subsubchildren);
-
-    return ret;
+       return socket;
 }
 
-void
-gsh_swallow_app(GtkWidget * target, gchar * source_name)
-{
-       GdkWindow * window = target->window;
-
-#ifndef WIN32
-       swallow(source_name, 
-               GDK_WINDOW_XDISPLAY(window),
-               GDK_SCREEN_XSCREEN(gtk_widget_get_screen(target)),
-               GDK_WINDOW_XWINDOW(window), 
-               (unsigned int *)&(target->requisition.width), 
-               (unsigned int *)&(target->requisition.height));
-#endif
-       gtk_widget_set_size_request(target,
-               target->requisition.width,
-               target->requisition.height);
-}
-
-#endif /* not WIN32 */
-
-/* example
-    if(swallow(ap->applet_name,
-            GDK_DISPLAY_XDISPLAY(gdkdisplay),
-            GDK_SCREEN_XSCREEN(gdkscreen),
-            GDK_WINDOW_XWINDOW (GTK_WIDGET (ap->parentWidget)->window),
-               &ap->width, &ap->height))
-*/

Index: gtkshell/swallow.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/swallow.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- gtkshell/swallow.h  20 Oct 2008 19:28:54 -0000      1.4
+++ gtkshell/swallow.h  11 Aug 2010 12:03:24 -0000      1.5
@@ -25,8 +25,8 @@
 
 
 #ifndef WIN32
-void
-gsh_swallow_app(GtkWidget * target, gchar * source_name);
+GtkWidget *
+gsh_swallow_app(GSH * gsh, const gchar * window_id);
 #endif /* not WIN32 */
 
 #endif /* GSH_SWALLOW_H */

Index: gtkshell/undo.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/undo.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- gtkshell/undo.c     19 Dec 2007 18:44:46 -0000      1.4
+++ gtkshell/undo.c     11 Aug 2010 12:03:24 -0000      1.5
@@ -19,9 +19,8 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <gtk/gtk.h>
+#include "gtkshell.h"
 #include <gdk/gdkkeysyms.h>
-#include "undo.h"
 
 #ifndef DEBUG
 #define DV(x)
@@ -47,7 +46,7 @@
        gchar command;
        gint start;
        gint end;
-       gboolean seq; // sequency flag
+       bool seq; // sequency flag
        gchar *str;
 } UndoInfo;
 
@@ -65,7 +64,7 @@
 static UndoInfo *ui_tmp;
 static guint modified_step;
 static guint prev_keyval;
-static gboolean seq_reserve = FALSE;
+static bool seq_reserve = FALSE;
 
 static void 
 undo_flush_temporal_buffer(void);
@@ -102,7 +101,7 @@
 
 
 static void 
-undo_set_sequency(gboolean seq)
+undo_set_sequency(bool seq)
 {
        if (g_list_length(undo_list))
                ((UndoInfo *)g_list_last(undo_list)->data)->seq = seq;
@@ -115,7 +114,7 @@
        gint start, gint end)
 {
        GtkTextIter start_iter, end_iter;
-       gboolean seq_flag = FALSE;
+       bool seq_flag = FALSE;
        gchar *str;
        gint keyval = keyval;
        
@@ -232,7 +231,7 @@
 static void 
 undo_check_modified_step(GtkTextBuffer *buffer)
 {
-       gboolean flag;
+       bool flag;
        
        flag = (modified_step == g_list_length(undo_list));
        if (gtk_text_buffer_get_modified(buffer) == flag)
@@ -312,7 +311,7 @@
 void
 gsh_undo_undo(GtkTextBuffer *buffer)
 {
-       gboolean sentinel = FALSE;
+       bool sentinel = FALSE;
        do
        {
                GtkTextIter start_iter, end_iter;
@@ -367,7 +366,7 @@
 void
 gsh_undo_redo(GtkTextBuffer *buffer)
 {
-       gboolean sentinel=FALSE;
+       bool sentinel=FALSE;
 
        do
        {

Index: gtkshell/undo.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/undo.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- gtkshell/undo.h     10 Dec 2007 15:13:24 -0000      1.2
+++ gtkshell/undo.h     11 Aug 2010 12:03:24 -0000      1.3
@@ -31,13 +31,5 @@
 void 
 gsh_undo_redo(GtkTextBuffer *buffer);
 
-/* These are not currently used by gtkshell.  */
-#if 0
-void undo_reset_modified_step(GtkTextBuffer *buffer);
-void undo_clear_all(GtkTextBuffer *buffer);
-void undo_set_sequency(gboolean seq);
-void undo_set_sequency_reserve(void);
-#endif /* 0 */
-
 #endif /* _UNDO_H */
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]