antiright-devel
[Top][All Lists]
Advanced

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

[Antiright-devel] antiright ACE-desktop/guidl/IDE.gdl gtkshell/ad...


From: Jeffrey Bedard
Subject: [Antiright-devel] antiright ACE-desktop/guidl/IDE.gdl gtkshell/ad...
Date: Thu, 03 May 2007 21:23:07 +0000

CVSROOT:        /sources/antiright
Module name:    antiright
Changes by:     Jeffrey Bedard <jefbed> 07/05/03 21:23:07

Modified files:
        ACE-desktop/guidl: IDE.gdl 
        gtkshell       : add_options.c containers.c gtkshell.c 
                         gtkshell.h init.c init.h options.c row.c row.h 
Added files:
        gtkshell       : row_struct.h 

Log message:
        Began setting up and using methods for GSHRows row manager class.  

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/ACE-desktop/guidl/IDE.gdl?cvsroot=antiright&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/add_options.c?cvsroot=antiright&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/containers.c?cvsroot=antiright&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/gtkshell.c?cvsroot=antiright&r1=1.29&r2=1.30
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/gtkshell.h?cvsroot=antiright&r1=1.38&r2=1.39
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/init.c?cvsroot=antiright&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/init.h?cvsroot=antiright&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/options.c?cvsroot=antiright&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/row.c?cvsroot=antiright&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/row.h?cvsroot=antiright&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/row_struct.h?cvsroot=antiright&rev=1.1

Patches:
Index: ACE-desktop/guidl/IDE.gdl
===================================================================
RCS file: /sources/antiright/antiright/ACE-desktop/guidl/IDE.gdl,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- ACE-desktop/guidl/IDE.gdl   30 Apr 2007 18:15:22 -0000      1.13
+++ ACE-desktop/guidl/IDE.gdl   3 May 2007 21:23:07 -0000       1.14
@@ -21,6 +21,7 @@
 add "terminal" "$SHELL";
 option "rows" 16;
 
+option "no fill";
 add buttons
        "cd `gtkshell -dd` && ACE -A IDE & # CD",
        "make", 
@@ -30,7 +31,6 @@
        "gshterm -e cvs commit # CVS_Commit",
        "gshterm -e cvs -q -z3 update -dP # CVS_Update";
 
-option "no fill";
 add "label" "     TODO:     ";
 option "fill";
 add "text";

Index: gtkshell/add_options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/add_options.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- gtkshell/add_options.c      3 May 2007 20:49:20 -0000       1.25
+++ gtkshell/add_options.c      3 May 2007 21:23:07 -0000       1.26
@@ -116,7 +116,7 @@
                break;
 
        case 'r': /* Force creation of a new row.  */
-               gsh_new_row(gsh);
+               $(gsh->rows, new);
                break;
 
        case 'S': /* Add a separator.  */

Index: gtkshell/containers.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/containers.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- gtkshell/containers.c       2 May 2007 14:55:31 -0000       1.11
+++ gtkshell/containers.c       3 May 2007 21:23:07 -0000       1.12
@@ -63,7 +63,7 @@
 {
        gsh->rows->h = gtk_hbox_new(FALSE, 2);
        gtk_widget_show(gsh->rows->h);
-       gsh_new_row(gsh);
+       $(gsh->rows, new);
 }
 
 void

Index: gtkshell/gtkshell.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/gtkshell.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- gtkshell/gtkshell.c 3 May 2007 20:49:20 -0000       1.29
+++ gtkshell/gtkshell.c 3 May 2007 21:23:07 -0000       1.30
@@ -23,56 +23,6 @@
 
 #include "gtkshell.h"
 
-static void
-setup_quit_signal(GtkWidget * window, const gchar * signal)
-{
-       (void) g_signal_connect(window, signal, 
-                       G_CALLBACK(gtk_main_quit), NULL);
-}
-
-static void
-setup_quit_signals(GtkWidget * window)
-{
-       setup_quit_signal(window, "delete-event");
-       setup_quit_signal(window, "destroy");
-}
-
-static GtkWidget *
-gsh_create_main_window()
-{
-       GtkWidget *window;
-
-       window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-       setup_quit_signals(window);
-
-       return (window);
-}
-
-static void
-gsh_delete_GSH_Rows(struct GSH_Rows * rows)
-{
-       g_free(rows);
-}
-
-static void
-gsh_setup_GSH_Rows(struct GSH_Rows * rows)
-{
-       rows->current = 1;
-       /* Use an arbitrary, though reasonable, initial number of rows.  */
-       rows->total = 8;
-       rows->delete = &gsh_delete_GSH_Rows;
-}
-
-struct GSH_Rows *
-gsh_new_GSH_Rows()
-{
-       struct GSH_Rows * rows;
-
-       rows=xmalloc(sizeof(struct GSH_Rows));
-       gsh_setup_GSH_Rows(rows);
-
-       return rows;
-}
 
        
 static void
@@ -97,12 +47,12 @@
        gsh->geometry = (gchar *)NULL;
        gsh->bflags = 0;
        gsh->update = ARNEW(gsh, GSHUpdateManager);
-       gsh->rows = ARNEW(gsh, GSH_Rows);
+       gsh->rows = ARNEW(gsh, GSHRows);
        gsh->terminal = ARNEW(gsh, GSH_Terminal);
        gsh->delete = &gsh_delete_GSH;
        gsh->parse = &gsh_parse_arguments;
        gsh->finalize = &gsh_GSH_finalize;
-       gsh->init = &gsh_GSH_init;
+       gsh->init = &gsh_setup_containers;
        gsh->window = (*(gsh->new_window = &gsh_GSH_new_window))(gsh);
        gsh->add_button=&gsh_add_button;
        gsh->add_label=&gsh_add_label;

Index: gtkshell/gtkshell.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/gtkshell.h,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -b -r1.38 -r1.39
--- gtkshell/gtkshell.h 3 May 2007 20:49:20 -0000       1.38
+++ gtkshell/gtkshell.h 3 May 2007 21:23:07 -0000       1.39
@@ -41,18 +41,7 @@
 
 #include "macros.h"
 
-struct GSH_Rows
-{
-       GtkWidget *h;
-       GtkWidget *v;
-       unsigned int current;
-       unsigned int total;
-       void (*delete)(struct GSH_Rows *);
-};
-
-struct GSH_Rows *
-gsh_new_GSH_Rows();
-
+#include "row_struct.h"
 #include "terminal_struct.h"
 #include "updated.h"
 #include "update_manager_struct.h"
@@ -61,7 +50,7 @@
 {
        GtkWidget *window;
        GtkWidget *scrolled_window;
-       struct GSH_Rows * rows;
+       struct GSHRows * rows;
        struct GSHUpdateManager * update;
        struct GSH_Terminal * terminal;
        GtkWidget *button;

Index: gtkshell/init.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/init.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- gtkshell/init.c     2 May 2007 14:55:31 -0000       1.3
+++ gtkshell/init.c     3 May 2007 21:23:07 -0000       1.4
@@ -22,11 +22,29 @@
 
 #include "gtkshell.h"
 
-void
-gsh_GSH_init(struct GSH * gsh)
+static void
+setup_quit_signal(GtkWidget * window, const gchar * signal)
 {
-       /* Initialize toplevel child containers, with parenting delayed.  */
-       gsh_setup_containers(gsh);
+       (void) g_signal_connect(window, signal, 
+                       G_CALLBACK(gtk_main_quit), NULL);
+}
+
+static void
+setup_quit_signals(GtkWidget * window)
+{
+       setup_quit_signal(window, "delete-event");
+       setup_quit_signal(window, "destroy");
+}
+
+GtkWidget *
+gsh_create_main_window()
+{
+       GtkWidget *window;
+
+       window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+       setup_quit_signals(window);
+
+       return (window);
 }
 
 void

Index: gtkshell/init.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/init.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- gtkshell/init.h     2 May 2007 14:55:31 -0000       1.2
+++ gtkshell/init.h     3 May 2007 21:23:07 -0000       1.3
@@ -23,8 +23,8 @@
 #ifndef GSH_INIT_H
 #define GSH_INIT_H
 
-void
-gsh_GSH_init(struct GSH * gsh);
+GtkWidget *
+gsh_create_main_window();
 
 void
 gsh_GSH_finalize(struct GSH * gsh);

Index: gtkshell/options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/options.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- gtkshell/options.c  3 May 2007 03:42:31 -0000       1.19
+++ gtkshell/options.c  3 May 2007 21:23:07 -0000       1.20
@@ -81,7 +81,7 @@
 gsh_handle_switch_arguments(struct GSH * gsh, int argc,
                            char **argv, int *counter)
 {
-       gsh_check_row(gsh);
+       $(gsh->rows, check);
        switch (argv[*counter][1])
        {
        case 'a':

Index: gtkshell/row.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/row.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- gtkshell/row.c      2 May 2007 14:55:31 -0000       1.19
+++ gtkshell/row.c      3 May 2007 21:23:07 -0000       1.20
@@ -23,6 +23,50 @@
 #include "gtkshell.h"
 
 static void
+gsh_GSHRows_new(struct GSHRows * this)
+{
+       gtk_container_add(GTK_CONTAINER(this->h), 
+               this->v=gtk_vbox_new(FALSE, 2));
+       gtk_widget_show(this->v);
+       this->current = 1;
+}
+
+static void
+gsh_GSHRows_check(struct GSHRows * this)
+{
+       if(this->current > this->total)
+               $(this, new);
+}
+
+static void
+gsh_delete_GSHRows(struct GSHRows * rows)
+{
+       g_free(rows);
+}
+
+static void
+gsh_setup_GSHRows(struct GSHRows * rows)
+{
+       rows->current = 1;
+       /* Use an arbitrary, though reasonable, initial number of rows.  */
+       rows->total = 8;
+       rows->delete = &gsh_delete_GSHRows;
+       rows->new=&gsh_GSHRows_new;
+       rows->check=&gsh_GSHRows_check;
+}
+
+struct GSHRows *
+gsh_new_GSHRows()
+{
+       struct GSHRows * rows;
+
+       rows=xmalloc(sizeof(struct GSHRows));
+       gsh_setup_GSHRows(rows);
+
+       return rows;
+}
+
+static void
 gsh_manage_generic(struct GSH * gsh, GtkWidget *widget)
 {
        gtk_widget_show(widget);
@@ -46,7 +90,7 @@
 {
        if(test_manage_menu_item(gsh->rows->v, widget))
                return;
-       gsh_check_row(gsh);
+       $(gsh->rows, check);
        gtk_container_add(GTK_CONTAINER(gsh->rows->v), widget);
        gsh_manage_generic(gsh, widget);
 }
@@ -72,7 +116,7 @@
 static void
 manage_unexpanded(struct GSH * gsh, GtkWidget * widget)
 {
-       gsh_check_row(gsh);
+       $(gsh->rows, check);
        gtk_box_pack_start(GTK_BOX(gsh->rows->v), widget,
                           FALSE, FALSE, 0);
        gsh_manage_generic(gsh, widget);
@@ -87,18 +131,3 @@
                manage_normal(gsh, widget);
 }
 
-void
-gsh_new_row(struct GSH * gsh)
-{
-       GtkWidget * column = gsh->rows->v = gtk_vbox_new(FALSE, 2);
-       gtk_container_add(GTK_CONTAINER(gsh->rows->h), column);
-       gtk_widget_show(column);
-       gsh->rows->current = 1;
-}
-
-void
-gsh_check_row(struct GSH * gsh)
-{
-       if (gsh->rows->current > gsh->rows->total)
-               gsh_new_row(gsh);
-}

Index: gtkshell/row.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/row.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- gtkshell/row.h      30 Apr 2007 18:15:22 -0000      1.8
+++ gtkshell/row.h      3 May 2007 21:23:07 -0000       1.9
@@ -27,9 +27,9 @@
 gsh_manage(struct GSH * gsh, GtkWidget *widget);
 
 void
-gsh_new_row(struct GSH * gsh);
-
-void
 gsh_check_row(struct GSH * gsh);
 
+struct GSHRows *
+gsh_new_GSHRows();
+
 #endif                         /* GSH_ROW_H */

Index: gtkshell/row_struct.h
===================================================================
RCS file: gtkshell/row_struct.h
diff -N gtkshell/row_struct.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ gtkshell/row_struct.h       3 May 2007 21:23:07 -0000       1.1
@@ -0,0 +1,37 @@
+/*
+  AntiRight
+  (c) 2002-2007 Jeffrey Bedard
+  address@hidden
+
+  This file is part of AntiRight.
+
+  AntiRight is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  AntiRight is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with AntiRight; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
+*/
+
+#ifndef GSH_ROW_STRUCT_H
+#define GSH_ROW_STRUCT_H
+
+struct GSHRows
+{
+       GtkWidget *h;
+       GtkWidget *v;
+       unsigned int current;
+       unsigned int total;
+       void (*delete)(struct GSHRows *);
+       void (*new)(struct GSHRows *);
+       void (*check)(struct GSHRows *);
+};
+
+#endif /* GSH_ROW_STRUCT */




reply via email to

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