antiright-devel
[Top][All Lists]
Advanced

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

[Antiright-devel] antiright configure gtkshell/Makefile gtkshell/...


From: Jeffrey Bedard
Subject: [Antiright-devel] antiright configure gtkshell/Makefile gtkshell/...
Date: Fri, 13 Aug 2010 20:22:23 +0000

CVSROOT:        /sources/antiright
Module name:    antiright
Changes by:     Jeffrey Bedard <jefbed> 10/08/13 20:22:23

Modified files:
        .              : configure 
        gtkshell       : Makefile add_options.c arguments.c button.c 
                         callbacks.c clock.c command_shell.c 
                         dialog_options.c dragdrop.c form.c guidl.lex 
                         guidl.y guidl_util.c guidl_util.h macros.h 
                         module_includes.h options.c options.h 
                         terminal_options.c text.c tree.c undo.c 
                         update_manager.c 
        libantiright   : arguments.c macros.h util.h 
Removed files:
        gtkshell       : quickstart.c quickstart.h 

Log message:
        Conducted various code cleanups.  Removed UNUSED macro, in favor of 
setting
        unused attribute.  Removed several macro definitions in favor of static
        methods and inlining.  Fixed parallel make.  Test for gdb in configure
        when -d option is specified.  

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/configure?cvsroot=antiright&r1=1.122&r2=1.123
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/Makefile?cvsroot=antiright&r1=1.60&r2=1.61
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/add_options.c?cvsroot=antiright&r1=1.60&r2=1.61
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/arguments.c?cvsroot=antiright&r1=1.33&r2=1.34
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/button.c?cvsroot=antiright&r1=1.59&r2=1.60
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/callbacks.c?cvsroot=antiright&r1=1.35&r2=1.36
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/clock.c?cvsroot=antiright&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/command_shell.c?cvsroot=antiright&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/dialog_options.c?cvsroot=antiright&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/dragdrop.c?cvsroot=antiright&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/form.c?cvsroot=antiright&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl.lex?cvsroot=antiright&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl.y?cvsroot=antiright&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_util.c?cvsroot=antiright&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_util.h?cvsroot=antiright&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/macros.h?cvsroot=antiright&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/module_includes.h?cvsroot=antiright&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/options.c?cvsroot=antiright&r1=1.45&r2=1.46
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/options.h?cvsroot=antiright&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/terminal_options.c?cvsroot=antiright&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/text.c?cvsroot=antiright&r1=1.44&r2=1.45
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/tree.c?cvsroot=antiright&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/undo.c?cvsroot=antiright&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/update_manager.c?cvsroot=antiright&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/quickstart.c?cvsroot=antiright&r1=1.2&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/quickstart.h?cvsroot=antiright&r1=1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/libantiright/arguments.c?cvsroot=antiright&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/antiright/libantiright/macros.h?cvsroot=antiright&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/antiright/libantiright/util.h?cvsroot=antiright&r1=1.13&r2=1.14

Patches:
Index: configure
===================================================================
RCS file: /sources/antiright/antiright/configure,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -b -r1.122 -r1.123
--- configure   11 Aug 2010 12:03:21 -0000      1.122
+++ configure   13 Aug 2010 20:22:20 -0000      1.123
@@ -32,9 +32,17 @@
 for ARG in $@; do
        if [ "$ARG" = "-d" ]; then
                echo 'Configuring with debug options...'
-               CFLAGS="$CFLAGS -g3 -Wall -W -Wno-unused-variable"
-               CFLAGS="$CFLAGS -Wno-unused -DDEBUG"
+               CFLAGS="-g3 -Wdisabled-optimization -DDEBUG"
+               CFLAGS="$CFLAGS -Wunreachable-code"
                DEFS="$DEFS -DGC_DEBUG"
+               echo -n 'Checking for gdb...'
+               if [ "`which gdb`" != "" ]; then
+                       CFLAGS="$CFLAGS -ggdb"
+                       echo found
+               else
+                       echo not found
+               fi
+
        elif [ "$ARG" = "-l" ]; then
                PREFIX=/usr/local/packages/antiright
        elif [ "$ARG" = "-s" ]; then

Index: gtkshell/Makefile
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/Makefile,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -b -r1.60 -r1.61
--- gtkshell/Makefile   2 Nov 2008 19:30:15 -0000       1.60
+++ gtkshell/Makefile   13 Aug 2010 20:22:21 -0000      1.61
@@ -38,7 +38,7 @@
        guidl_util.o about_dialog.o init.o guidl_dialog.o guidl_dictionary.o\
        guidl_options.o guidl_widgets.o update_manager.o pane.o\
        command_shell.o app_mode.o clock.o tree.o form.o dialog.o swallow.o\
-       GSHWidget.o quickstart.o undo.o color.o add_options.o option_options.o\
+       GSHWidget.o undo.o color.o add_options.o option_options.o\
        ptk-app-menu.o
 
 program=main.o 
@@ -49,14 +49,16 @@
        INSTALLPROG=install -s
 endif
 
-all: y.tab.c gtkshell
+all: 
+       $(MAKE) y.tab.c
+       $(MAKE) gtkshell
 
-gtkshell: y.tab.h $(objects) $(program)
+gtkshell: $(objects) $(program)
        ar rcs libgtkshell.a $(objects)
        cc -o gtkshell $(program) $(GTKFLAGS)
 
 lex.yy.c: guidl.lex
-       $(LEX) -l -o lex.yy.c guidl.lex
+       $(LEX) -o lex.yy.c guidl.lex
 
 y.tab.h: lex.yy.c guidl.y
        $(YACC) -d -o y.tab.c guidl.y

Index: gtkshell/add_options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/add_options.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -b -r1.60 -r1.61
--- gtkshell/add_options.c      11 Aug 2010 12:03:22 -0000      1.60
+++ gtkshell/add_options.c      13 Aug 2010 20:22:21 -0000      1.61
@@ -23,7 +23,10 @@
 #include "gtkshell.h"
 
 void
-gsh_add_window_cb(GSH * gsh, gint * counter, const gchar ** argv)
+gsh_add_window_cb(
+       GSH * gsh, 
+       gint * counter __attribute__ ((unused)), 
+       const gchar ** argv __attribute__ ((unused)))
 {
        /* This is duplicate functionlity, as same can be
           done with '---' argument.  */
@@ -34,7 +37,10 @@
 }
 
 void
-gsh_add_applet_clock_cb(GSH * gsh, gint * counter, const gchar ** argv)
+gsh_add_applet_clock_cb(
+       GSH * gsh, 
+       gint * counter __attribute__ ((unused)), 
+       const gchar ** argv __attribute__ ((unused)))
 {
        $(gsh, manage, gsh_clock_new(gsh));
 }
@@ -84,7 +90,10 @@
 }
 
 void
-gsh_add_piped_text_cb(GSH * gsh, gint * counter, const gchar ** argv)
+gsh_add_piped_text_cb(
+       GSH * gsh, 
+       gint * counter __attribute__ ((unused)), 
+       const gchar ** argv __attribute__ ((unused)))
 {
        gchar * piped;
        
@@ -94,7 +103,10 @@
 }
 
 void
-gsh_add_piped_label_cb(GSH * gsh, gint * counter, const gchar ** argv)
+gsh_add_piped_label_cb(
+       GSH * gsh, 
+       gint * counter __attribute__ ((unused)), 
+       const gchar ** argv __attribute__ ((unused)))
 {
        gchar * piped;
 
@@ -102,7 +114,7 @@
        $(gsh, add.label, piped);
        g_free(piped);
 }
-
+#if 0
 void
 gsh_add_quickstart_cb(GSH * gsh, gint * counter, const gchar ** argv)
 {
@@ -117,15 +129,21 @@
 #else /* ! GSH_USE_QUICKSTART */
 #endif /* GSH_USE_QUICKSTART */
 }
-
+#endif
 void
-gsh_add_row_cb(GSH * gsh, gint * counter, const gchar ** argv)
+gsh_add_row_cb(
+       GSH * gsh, 
+       gint * counter __attribute__ ((unused)), 
+       const gchar ** argv __attribute__ ((unused)))
 {
        $(gsh->rows, new);
 }
 
 void
-gsh_add_separator_cb(GSH * gsh, gint * counter, const gchar ** argv)
+gsh_add_separator_cb(
+       GSH * gsh, 
+       gint * counter __attribute__ ((unused)), 
+       const gchar ** argv __attribute__ ((unused)))
 {
        $(gsh, manage, ((gsh->rows->total==1) 
                ? gtk_vseparator_new() : gtk_hseparator_new()));
@@ -185,7 +203,10 @@
 }
 
 void
-gsh_add_text_cb(GSH * gsh, gint * counter, const gchar ** argv)
+gsh_add_text_cb(
+       GSH * gsh, 
+       gint * counter __attribute__ ((unused)), 
+       const gchar ** argv __attribute__ ((unused)))
 {
        gsh_text_area(gsh);
 }

Index: gtkshell/arguments.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/arguments.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- gtkshell/arguments.c        13 Dec 2007 17:20:24 -0000      1.33
+++ gtkshell/arguments.c        13 Aug 2010 20:22:21 -0000      1.34
@@ -100,7 +100,7 @@
 
        for (counter = 1; counter < argc; counter++)
                (argv[counter][0] == '-') ?
-                       gsh_handle_switch_argument(gsh, argc, argv, &counter)
+                       gsh_handle_switch_argument(gsh, argv, &counter)
                        : button_parse(gsh, argv[counter]);
 #ifdef LIBGC
        GC_gcollect();

Index: gtkshell/button.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/button.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -b -r1.59 -r1.60
--- gtkshell/button.c   11 Aug 2010 12:03:22 -0000      1.59
+++ gtkshell/button.c   13 Aug 2010 20:22:21 -0000      1.60
@@ -28,23 +28,30 @@
 {
        bool return_value=TRUE;
 
+#ifndef WIN32
        if(GSH_FLAG(GSH_CHECK_COMMANDS))
        {
                const gchar * without_first_word=strchr(command, ' ');
                const unsigned int space_position=strlen(command)
                        -(without_first_word?strlen(without_first_word):0);
-               gchar * selection=g_strdup(command);
                gchar * path;
+               {
                gchar * pipe_command;
+                       {
+                               gchar * selection=g_strdup(command);
 
                selection[space_position]='\0';
-               ar_asprintf(&pipe_command, "which %s", selection);
+                               ar_asprintf(&pipe_command, 
+                                       "which %s", selection);
                g_free(selection);
+                       }
                path=antiright_pipe_read(pipe_command);
                g_free(pipe_command);
+               }
                return_value = g_file_test(path, G_FILE_TEST_EXISTS);
                g_free(path);
        }
+#endif /* !WIN32 */
 
        return return_value;
 }
@@ -168,15 +175,14 @@
        GtkWidget * toolbutton;
 
        /* FIXME:  change to use the gtk tool_button widget.  */
-       toolitem=GTK_WIDGET(gtk_tool_item_new());
-       toolbutton=gtk_button_new_with_label(command);
-       GSHCA(toolitem, toolbutton);
-       common_button_setup(gsh, toolbutton, command);
-       GSHCA(gsh->widgets.app.toolbar, toolitem);
+       GSH_SHOW_CREATE(toolitem, tool_item);
+       GSH_SHOW_CREATE(toolbutton, button);
        setup_label_for_toolbutton(toolbutton, command);
+       common_button_setup(gsh, toolbutton, command);
        gtk_button_set_relief(GTK_BUTTON(toolbutton), GTK_RELIEF_NONE);
-       gtk_widget_show(toolbutton);
-       gtk_widget_show(toolitem);
+       GSHCA(toolitem, toolbutton);
+       GSHCA(gsh->widgets.app.toolbar, toolitem);
+
 }
 
 static void

Index: gtkshell/callbacks.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/callbacks.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -b -r1.35 -r1.36
--- gtkshell/callbacks.c        11 Aug 2010 12:03:23 -0000      1.35
+++ gtkshell/callbacks.c        13 Aug 2010 20:22:21 -0000      1.36
@@ -120,14 +120,9 @@
 }
 
 static void
-gsh_system_cb(GtkWidget *widget, gpointer data)
+gsh_system_cb(GtkWidget *widget __attribute__((unused)), gpointer data)
 {
-#ifdef DEBUG
-       ARBUG("system_cb");
-#endif /* DEBUG */
-       UNUSED(widget);
-
-       ARWIFNP(data)
+       if(data)
        {
                struct GSHCBData *cb = data;
                if(!test_special_command(cb))
@@ -158,11 +153,6 @@
 {
        struct GSHCBData *cb;
 
-#ifdef DEBUG
-       ARPASSERT(widget);
-       ARPASSERT(data);
-#endif /* DEBUG */
-
        /* Convert to dereferencable form.  */
        cb = (struct GSHCBData *) data;
 
@@ -176,10 +166,6 @@
                /* Get the text from the widget.  */
                input = gtk_combo_box_get_active_text(
                                GTK_COMBO_BOX(combo_box));
-#ifdef DEBUG
-               /* Check return value INPUT.  */
-               ARPASSERT(input);
-#endif /* DEBUG */
                exec_and_test_print(cb, input);
                /* Determine whether or not to exit 
                   because of this callback.  */
@@ -190,15 +176,6 @@
        }
 }
 
-/* Assign the function pointers for GSHCBData's methods.  */
-static void
-assign_GSHCBData_methods(struct GSHCBData * cb)
-{
-       cb->delete=&gsh_delete_GSHCBData;
-       cb->entry=&gsh_entry_cb;
-       cb->system=&gsh_system_cb;
-}
-
 /* GSHCBData Constructor */
 struct GSHCBData *
 gsh_new_GSHCBData(struct GSH * gsh, gpointer data)
@@ -210,8 +187,10 @@
        /* Store constructor arguments.  */
        cb->gsh=gsh;
        cb->data=data;
-       /* Set up methods.  */
-       assign_GSHCBData_methods(cb);
+       /* Assign the function pointers for GSHCBData's methods.  */
+       cb->delete=&gsh_delete_GSHCBData;
+       cb->entry=&gsh_entry_cb;
+       cb->system=&gsh_system_cb;
 
        return cb;
 }

Index: gtkshell/clock.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/clock.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- gtkshell/clock.c    30 Jul 2010 17:47:01 -0000      1.12
+++ gtkshell/clock.c    13 Aug 2010 20:22:21 -0000      1.13
@@ -58,7 +58,8 @@
 }
 
 static void
-update_clock(const gchar * command, gpointer clock_pointer)
+update_clock(const gchar * command __attribute__ ((unused)), 
+       gpointer clock_pointer)
 {
        struct GSHClockData * clock = (struct GSHClockData*)clock_pointer;
        gchar time_string[GSH_CLOCK_TIME_STRING_SIZE];

Index: gtkshell/command_shell.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/command_shell.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- gtkshell/command_shell.c    11 Jun 2007 21:32:39 -0000      1.4
+++ gtkshell/command_shell.c    13 Aug 2010 20:22:21 -0000      1.5
@@ -45,7 +45,7 @@
 }
 
 static void
-run_command_cb(GtkWidget * widget, gpointer data)
+run_command_cb(GtkWidget * widget __attribute__ ((unused)), gpointer data)
 {
        GSHCommandShell * this;
        GtkEntry * entry;

Index: gtkshell/dialog_options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/dialog_options.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- gtkshell/dialog_options.c   13 Dec 2007 17:20:24 -0000      1.25
+++ gtkshell/dialog_options.c   13 Aug 2010 20:22:21 -0000      1.26
@@ -23,25 +23,37 @@
 #include "gtkshell.h"
 
 void
-gsh_dialog_about_cb(GSH * gsh, gint * counter, const gchar ** argv)
+gsh_dialog_about_cb(
+       GSH * gsh __attribute__ ((unused)), 
+       gint * counter __attribute__ ((unused)), 
+       const gchar ** argv __attribute__ ((unused)))
 {
        gsh_about_dialog();
 }
  
 void
-gsh_dialog_color_cb(GSH * gsh, gint * counter, const gchar ** argv)
+gsh_dialog_color_cb(
+       GSH * gsh, 
+       gint * counter __attribute__ ((unused)), 
+       const gchar ** argv __attribute__ ((unused)))
 {
        GSH_COLOR_DIALOG(gsh);
 }
  
 void
-gsh_dialog_folder_cb(GSH * gsh, gint * counter, const gchar ** argv)
+gsh_dialog_folder_cb(
+       GSH * gsh, 
+       gint * counter __attribute__ ((unused)), 
+       const gchar ** argv __attribute__ ((unused)))
 {
        GSH_FOLDER_CREATE_DIALOG(gsh);
 }
  
 void
-gsh_dialog_folder_open_cb(GSH * gsh, gint * counter, const gchar ** argv)
+gsh_dialog_folder_open_cb(
+       GSH * gsh, 
+       gint * counter __attribute__ ((unused)), 
+       const gchar ** argv __attribute__ ((unused)))
 {
        GSH_FOLDER_OPEN_DIALOG(gsh);
 }
@@ -53,13 +65,19 @@
 }
  
 void
-gsh_dialog_font_cb(GSH * gsh, gint * counter, const gchar ** argv)
+gsh_dialog_font_cb(
+       GSH * gsh, 
+       gint * counter __attribute__ ((unused)), 
+       const gchar ** argv __attribute__ ((unused)))
 {
        GSH_FONT_DIALOG(gsh);
 }
  
 void
-gsh_dialog_file_cb(GSH * gsh, gint * counter, const gchar ** argv)
+gsh_dialog_file_cb(
+       GSH * gsh, 
+       gint * counter __attribute__ ((unused)), 
+       const gchar ** argv __attribute__ ((unused)))
 {
        GSH_FILE_OPEN_DIALOG(gsh);
 }
@@ -77,7 +95,10 @@
 }
  
 void
-gsh_dialog_save_cb(GSH * gsh, gint * counter, const gchar ** argv)
+gsh_dialog_save_cb(
+       GSH * gsh, 
+       gint * counter __attribute__ ((unused)), 
+       const gchar ** argv __attribute__ ((unused)))
 {
        GSH_FILE_SAVE_DIALOG(gsh);
 }

Index: gtkshell/dragdrop.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/dragdrop.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- gtkshell/dragdrop.c 11 Aug 2010 12:03:23 -0000      1.17
+++ gtkshell/dragdrop.c 13 Aug 2010 20:22:21 -0000      1.18
@@ -37,15 +37,14 @@
 
 
 static void
-drag_received(GtkWidget *widget, GdkDragContext * context, gint x,
-             gint y, GtkSelectionData * selection, guint target_type,
-             guint time, gpointer data)
+drag_received(GtkWidget *widget, GdkDragContext * context, 
+       gint x __attribute__ ((unused)),
+       gint y __attribute__ ((unused)), 
+       GtkSelectionData * selection, guint target_type, guint time, 
+       gpointer data __attribute__ ((unused)))
 {
        bool drag_status;
 
-       UNUSED(x);
-       UNUSED(y);
-       UNUSED(data);
        switch (target_type)
        {
        case TARGET_STRING:
@@ -64,14 +63,14 @@
 }
 
 static bool
-drag_drop(GtkWidget *widget, GdkDragContext * context, gint x,
-         gint y, guint time, gpointer data)
+drag_drop(GtkWidget *widget, GdkDragContext * context, 
+       gint x __attribute__ ((unused)),
+       gint y __attribute__ ((unused)),
+       guint time, 
+       gpointer data __attribute__ ((unused)))
 {
        GdkAtom target_type;
 
-       UNUSED(x);
-       UNUSED(y);
-       UNUSED(data);
        target_type =
                GDK_POINTER_TO_ATOM(g_list_nth_data(context->targets,
                                                    TARGET_STRING));
@@ -86,34 +85,20 @@
 }
 
 static void
-drag_data_get(GtkWidget *widget, GdkDragContext * context,
-             GtkSelectionData * selection, guint target_type,
-             guint time, gpointer data)
+drag_data_get(GtkWidget *widget, 
+       GdkDragContext * context __attribute__ ((unused)),
+       GtkSelectionData * selection, 
+       guint target_type __attribute__ ((unused)),
+       guint time __attribute__ ((unused)), 
+       gpointer data __attribute__ ((unused)))
 {
        const gchar *source_data;
 
-       UNUSED(context);
-       UNUSED(target_type);
-       UNUSED(time);
-       UNUSED(data);
        source_data = gtk_button_get_label(GTK_BUTTON(widget));
        gtk_selection_data_set(selection, selection->target, sizeof(gchar),
                         (guchar *) source_data, strlen(source_data));
 }
 
-/* Use to set icon.  */
-#if 0 /* Unused */
-/*static void
-drag_begin(GtkWidget *widget, GdkDragContext * context, gpointer data)
-{
-}
-
-static void
-drag_end(GtkWidget *widget, GdkDragContext * context, gpointer data)
-{
-}*/
-#endif /* 0 */
-
 void
 gsh_setup_drag_drop(struct GSH * gsh, GtkWidget *widget)
 {

Index: gtkshell/form.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/form.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- gtkshell/form.c     9 Jul 2007 02:12:25 -0000       1.1
+++ gtkshell/form.c     13 Aug 2010 20:22:21 -0000      1.2
@@ -23,7 +23,8 @@
 #include "gtkshell.h"
 
 static void
-test_checked(gpointer element_data, gpointer user_data)
+test_checked(gpointer element_data, 
+       gpointer user_data __attribute__ ((unused)))
 {
        GtkWidget * radio_button;
 
@@ -33,7 +34,7 @@
 }
 
 static void
-submit_cb(GtkWidget * button, gpointer cb_data)
+submit_cb(GtkWidget * button __attribute__ ((unused)), gpointer cb_data)
 {
        GtkWidget * radio_base = (GtkWidget *)cb_data;
        GSList * radio_group;

Index: gtkshell/guidl.lex
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/guidl.lex,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- gtkshell/guidl.lex  25 Jul 2007 01:58:18 -0000      1.15
+++ gtkshell/guidl.lex  13 Aug 2010 20:22:21 -0000      1.16
@@ -68,6 +68,6 @@
                        /* Else, leave command for parser.  */
                        g_free(result); /* Cleanup.  */
                }
-[ \t\n]                /* ignore */;
-"//".*$                /* comment */;
+[ \t\n]                ; /* ignore */
+"//".*$                ; /* comment */
 %%

Index: gtkshell/guidl.y
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/guidl.y,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- gtkshell/guidl.y    11 Jun 2007 21:32:40 -0000      1.23
+++ gtkshell/guidl.y    13 Aug 2010 20:22:21 -0000      1.24
@@ -139,7 +139,7 @@
 button:
 STRING
 {
-       $(gsh_guidl_env->args, add, $1);
+       $(gsh_guidl_env->args, add, ($1));
        g_free($1);
 }
 ;

Index: gtkshell/guidl_util.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/guidl_util.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- gtkshell/guidl_util.c       25 Jul 2007 04:42:39 -0000      1.23
+++ gtkshell/guidl_util.c       13 Aug 2010 20:22:21 -0000      1.24
@@ -44,13 +44,11 @@
 gsh_delete_GDLEnvironment(struct GDLEnvironment * env)
 {
        ARDELETE(env->dictionaries);
-       /* Command line arguments should remain intact for updater widgets.  */
-/*     ARDELETE(env->args); */
+       /* Command line arguments (env->args) should remain 
+        * intact for updater widgets.  */
        free_option_args(env->args);
 }
 
-#define APPEND_ARG(env, arg) $(env->args, add, arg)
-
 static void
 gsh_GDLEnvironment_add(struct GDLEnvironment * env, 
                       const gchar * switches, gchar * argument)
@@ -59,34 +57,22 @@
           switch translation) is required.  */ 
        if(switches)
        {
-#ifdef DEBUG
-       ARPASSERT(env);
-#endif /* DEBUG */
-               APPEND_ARG(env, switches);
+               $(env->args, add, switches);
                if(argument)
                {
-                       APPEND_ARG(env, argument);
+                       $(env->args, add, argument);
                        g_free(argument);
                }
        }
 }
 
-#define CONSTRUCT_MEMBER_CLASSES(env)\
-{\
-       env->args=ARNEW(ar, ARArguments);\
-       env->dictionaries=ARNEW(gsh, GDLDictionaries);\
-}
-
-#define ASSIGN_METHODS(env)\
-{\
-       env->delete=&gsh_delete_GDLEnvironment;\
-       env->add=&gsh_GDLEnvironment_add;\
-}
-
-#define SETUP_GDLENVIRONMENT(env)\
-{\
-       CONSTRUCT_MEMBER_CLASSES(env);\
-       ASSIGN_METHODS(env);\
+static void
+setup_GDLEnvironment(struct GDLEnvironment * env)
+{
+       env->args=ARNEW(ar, ARArguments);
+       env->dictionaries=ARNEW(gsh, GDLDictionaries);
+       env->delete=&gsh_delete_GDLEnvironment;
+       env->add=&gsh_GDLEnvironment_add;
 }
 
 struct GDLEnvironment *
@@ -95,7 +81,7 @@
        struct GDLEnvironment * env;
 
        env = xmalloc(sizeof(struct GDLEnvironment));
-       SETUP_GDLENVIRONMENT(env);
+       setup_GDLEnvironment(env);
 
        return env;
 }

Index: gtkshell/guidl_util.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/guidl_util.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- gtkshell/guidl_util.h       11 Jun 2007 21:32:42 -0000      1.11
+++ gtkshell/guidl_util.h       13 Aug 2010 20:22:22 -0000      1.12
@@ -44,3 +44,4 @@
 yyparse();
 
 #endif /* not GSH_GUIDL_UTIL_H */
+

Index: gtkshell/macros.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/macros.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- gtkshell/macros.h   20 Dec 2007 15:09:12 -0000      1.19
+++ gtkshell/macros.h   13 Aug 2010 20:22:22 -0000      1.20
@@ -68,7 +68,7 @@
 
 /* Create and show a widget at the same time.  */
 #define GSH_SHOW_CREATE(var, type, ...)\
-       gtk_widget_show(var=gtk_##type##_new(__VA_ARGS__))
+       gtk_widget_show(var=GTK_WIDGET(gtk_##type##_new(__VA_ARGS__)))
 
 #define GSHCONNECT(widget, signal, cb, cbdata)\
        g_signal_connect(G_OBJECT(widget), signal, G_CALLBACK(cb), cbdata);

Index: gtkshell/module_includes.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/module_includes.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- gtkshell/module_includes.h  21 Jul 2010 13:50:40 -0000      1.15
+++ gtkshell/module_includes.h  13 Aug 2010 20:22:22 -0000      1.16
@@ -62,7 +62,6 @@
 #include "dialog.h"
 #include "swallow.h"
 #include "GSHWidget.h"
-#include "quickstart.h"
 #include "color.h"
 #include "ptk-app-menu.h"
 

Index: gtkshell/options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/options.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -b -r1.45 -r1.46
--- gtkshell/options.c  30 Jul 2010 18:16:09 -0000      1.45
+++ gtkshell/options.c  13 Aug 2010 20:22:22 -0000      1.46
@@ -1,6 +1,6 @@
 /*
   AntiRight
-  (c) 2002-2008 Jeffrey Bedard
+  (c) 2002-2010 Jeffrey Bedard
   address@hidden
 
   This file is part of AntiRight.
@@ -99,11 +99,15 @@
        gsh_handle_##type##_arguments(gsh, argc, argv, counter)
 
 
+#ifdef DEBUG
 /* This exists for testing new code.  */
 static void
-test_cb(GSH * gsh, gint * counter, const gchar ** argv)
+test_cb(GSH * gsh __attribute__ ((unused)), 
+       gint * counter __attribute__ ((unused)), 
+       const gchar ** argv __attribute__ ((unused)))
 {
 }
+#endif
 
 
 static void
@@ -141,7 +145,6 @@
        ARTDEF("-al",   gsh_add_label_cb, "add label");
        ARTDEF("-aP",   gsh_add_piped_text_cb, "add piped text from stdin");
        ARTDEF("-ap",   gsh_add_piped_label_cb, "add piped label from stdin");
-       ARTDEF("-aQ",   gsh_add_quickstart_cb, "add quickstart");
        ARTDEF("-ar",   gsh_add_row_cb, "add new row");
        ARTDEF("-aS",   gsh_add_separator_cb, "add separator");
        ARTDEF("-as",   gsh_add_shell_cb, "add terminal (VTE)");
@@ -198,8 +201,10 @@
        ARTDEF("-ds", gsh_dialog_save_cb, "show save dialog");
        ARTDEF("-dw", gsh_dialog_warning_cb, "show warning dialog");
 
+#ifdef DEBUG
        /* Test */
        ARTDEF("-t", test_cb, "run test code");
+#endif
 
        /* GUIDL file */
        ARTDEF("-f", guidl_file_cb, "open GUIDL file");
@@ -208,7 +213,7 @@
 }
 
 void
-gsh_handle_switch_argument(GSH * gsh, const gint argc, const gchar ** argv,
+gsh_handle_switch_argument(GSH * gsh, const gchar ** argv,
        gint * counter)
 {
        void (*callback)(GSH *, gint *, const gchar **)=NULL;

Index: gtkshell/options.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/options.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- gtkshell/options.h  13 Dec 2007 17:20:25 -0000      1.10
+++ gtkshell/options.h  13 Aug 2010 20:22:22 -0000      1.11
@@ -39,7 +39,7 @@
 #endif /* DEBUG */
 
 void
-gsh_handle_switch_argument(GSH * gsh, const gint argc, const gchar **argv, 
+gsh_handle_switch_argument(GSH * gsh, const gchar **argv, 
        gint *counter);
 
 #endif /* not GSH_OPTIONS_H */

Index: gtkshell/terminal_options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/terminal_options.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- gtkshell/terminal_options.c 20 Dec 2007 15:09:12 -0000      1.10
+++ gtkshell/terminal_options.c 13 Aug 2010 20:22:22 -0000      1.11
@@ -46,21 +46,24 @@
 
 void
 gsh_option_terminal_transparent_cb(GSH * gsh, 
-       gint * counter, const gchar ** argv)
+       gint * counter __attribute__ ((unused)), 
+       const gchar ** argv __attribute__ ((unused)))
 {
        GSH_SET(GSH_TERM_TRANSPARENT);
 }
 
 void
 gsh_option_terminal_not_transparent_cb(GSH * gsh, 
-       gint * counter, const gchar ** argv)
+       gint * counter __attribute__ ((unused)), 
+       const gchar ** argv __attribute__ ((unused)))
 {
        GSH_UNSET(GSH_TERM_TRANSPARENT);
 }
 
 void
 gsh_option_terminal_not_tab_cb(GSH * gsh, 
-       gint * counter, const gchar ** argv)
+       gint * counter __attribute__ ((unused)), 
+       const gchar ** argv __attribute__ ((unused)))
 {
        gsh->terminal=NULL;
 }

Index: gtkshell/text.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/text.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -b -r1.44 -r1.45
--- gtkshell/text.c     10 Dec 2007 15:13:24 -0000      1.44
+++ gtkshell/text.c     13 Aug 2010 20:22:22 -0000      1.45
@@ -29,7 +29,7 @@
 #define ADD_ENTRY(widget, str)\
        gtk_combo_box_prepend_text(GTK_COMBO_BOX(widget), str)
 
-/* Some sample entries to use when history is not usefu, such as a
+/* Some sample entries to use when history is not useful, such as a
  * dialog presentation of this field, where the window displaying the
  * field closes on the first activation.  */
 static void
@@ -41,27 +41,18 @@
        ADD_ENTRY(widget, "ACE");
 }
 
-#ifdef DEBUG
-#define VALIDATE_ENTRY_PARAMETERS(gsh, entry, command)\
-{\
-       ARPASSERT(gsh);\
-       ARPASSERT(entry);\
-       ARPASSERT(command);\
-}
-#else /* not DEBUG */
-#define VALIDATE_ENTRY_PARAMETERS(gsh, entry, command) /* undefined */
-#endif /* DEBUG */
-
 static void
 setup_entry_cb(struct GSH * gsh, GtkWidget * entry, const gchar * command)
 {
-
        struct GSHCBData * cb;
 
-       VALIDATE_ENTRY_PARAMETERS(gsh, entry, command);
-       cb=ARNEW(gsh, GSHCBData, gsh, (gpointer)(command ? command : "echo"));
+       if(gsh && entry && command)
+       {
+               cb=ARNEW(gsh, GSHCBData, gsh, 
+                       (gpointer)(command ? command : "echo"));
        g_signal_connect(G_OBJECT(gtk_bin_get_child(GTK_BIN(entry))), 
                "activate", G_CALLBACK(cb->entry), (gpointer)cb);
+       }
 }
 
 GtkWidget *
@@ -114,7 +105,7 @@
        GtkWidget * scroller;
 
        GSH_SHOW_CREATE(scroller, scrolled_window, NULL, NULL);
-       gtk_container_add(GTK_CONTAINER(scroller), text);
+       GSHCA(scroller, text);
        $(gsh, manage, scroller);
 }
 

Index: gtkshell/tree.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/tree.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- gtkshell/tree.c     2 Oct 2007 14:35:37 -0000       1.3
+++ gtkshell/tree.c     13 Aug 2010 20:22:22 -0000      1.4
@@ -88,7 +88,8 @@
                -1, name, renderer, "text", id, NULL)
 
 static void
-selection_handler(GtkTreeSelection * selection, gpointer data)
+selection_handler(GtkTreeSelection * selection, 
+       gpointer data __attribute__ ((unused)))
 {
        GtkTreeModel * model;
        GtkTreeIter iter;
@@ -111,7 +112,7 @@
 }
 
 GtkWidget *
-gsh_tree_view_new(GSH * gsh, const gchar * input)
+gsh_tree_view_new(GSH * gsh __attribute__ ((unused)), const gchar * input)
 {
        GtkTreeModel * model;
        GtkCellRenderer * renderer;

Index: gtkshell/undo.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/undo.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- gtkshell/undo.c     11 Aug 2010 12:03:24 -0000      1.5
+++ gtkshell/undo.c     13 Aug 2010 20:22:22 -0000      1.6
@@ -28,15 +28,11 @@
 #define DV(x) x
 #endif /* ! DEBUG */
 
-static GtkTextView * gsh_undo_text_view;
-
 /* BEGIN -- view.c extracts */
 static gint keyval;
 
-#define SCROLL_TO_CURSOR(buffer, within_margin)\
-       gtk_text_view_scroll_to_mark(gsh_undo_text_view,\
-               gtk_text_buffer_get_insert(buffer),\
-               within_margin, FALSE, 0, 0);
+#define SENSITIZE(widget) gtk_widget_set_sensitive(widget, TRUE);
+#define DESENSITIZE(widget) gtk_widget_set_sensitive(widget, FALSE);
 
 /* END - view.c extracts */
 
@@ -56,27 +52,48 @@
        DEL
 };
 
-static GtkWidget *undo_w = NULL;
-static GtkWidget *redo_w = NULL;
-static GList *undo_list = NULL;
-static GList *redo_list = NULL;
-static GString *undo_gstr;
-static UndoInfo *ui_tmp;
-static guint modified_step;
-static guint prev_keyval;
-static bool seq_reserve = FALSE;
-
-static void 
-undo_flush_temporal_buffer(void);
+static struct {
+       struct {
+               GtkWidget * undo;
+               GtkWidget * redo;
+               GtkTextView * text;
+       } widgets;
+
+       struct {
+               GList * undo;
+               GList * redo;
+       } lists;
+
+       struct {
+               guint modified_step;
+               guint prev_keyval;
+               bool seq_reserve;
+       } values;
+
+       GString * undo_gstr;
+
+       UndoInfo * ui_tmp;
+} undo;
+
+
+static inline void
+scroll_to_cursor(GtkTextBuffer * buffer)
+{
+       gtk_text_view_scroll_to_mark(undo.widgets.text,
+               gtk_text_buffer_get_insert(buffer),
+               0.05, FALSE, 0, 0);
+}
 
 static GList 
 *undo_clear_info_list(GList *info_list)
 {
-       while (g_list_length(info_list)) {
+       while (g_list_length(info_list)) 
+       {
                g_free(((UndoInfo *)info_list->data)->str);
                g_free(info_list->data);
                info_list = g_list_delete_link(info_list, info_list);
        }
+
        return info_list;
 }
 
@@ -89,22 +106,20 @@
        ui->command = command;
        ui->start = start;
        ui->end = end;
-       ui->seq = seq_reserve;
+       ui->seq = undo.values.seq_reserve;
        ui->str = str;
        
-       seq_reserve = FALSE;
+       undo.values.seq_reserve = FALSE;
        
-       undo_list = g_list_append(undo_list, ui);
+       undo.lists.undo = g_list_append(undo.lists.undo, ui);
 DV(g_print("undo_cb: %d %s (%d-%d)\n", command, str, start, end));
 }
 
-
-
 static void 
 undo_set_sequency(bool seq)
 {
-       if (g_list_length(undo_list))
-               ((UndoInfo *)g_list_last(undo_list)->data)->seq = seq;
+       if (g_list_length(undo.lists.undo))
+               ((UndoInfo *)g_list_last(undo.lists.undo)->data)->seq = seq;
 DV(g_print("<undo_set_sequency: %d>\n", seq)); 
 }
 
@@ -116,32 +131,33 @@
        GtkTextIter start_iter, end_iter;
        bool seq_flag = FALSE;
        gchar *str;
-       gint keyval = keyval;
+       gint keyval=0;
        
        gtk_text_buffer_get_iter_at_offset(buffer, &start_iter, start);
        gtk_text_buffer_get_iter_at_offset(buffer, &end_iter, end);
        str = gtk_text_buffer_get_text(buffer, &start_iter, &end_iter, FALSE);
        
-       if (undo_gstr->len) {
-               if ((end - start == 1) && (command == ui_tmp->command)) {
+       if (undo.undo_gstr->len) {
+               if ((end - start == 1) && (command == undo.ui_tmp->command)) {
                        switch (keyval) {
                        case GDK_BackSpace:
-                               if (end == ui_tmp->start)
+                               if (end == undo.ui_tmp->start)
                                        seq_flag = TRUE;
                                break;
                        case GDK_Delete:
-                               if (start == ui_tmp->start)
+                               if (start == undo.ui_tmp->start)
                                        seq_flag = TRUE;
                                break;
                        case GDK_Tab:
                        case GDK_space:
-                               if (start == ui_tmp->end)
+                               if (start == undo.ui_tmp->end)
                                        seq_flag = TRUE;
                                break;
                        default:
-                               if (start == ui_tmp->end)
-                                       if (keyval && keyval < 0xF000)
-                                               switch (prev_keyval) {
+                               if((undo.ui_tmp->end==start) 
+                                       && keyval && keyval < 0xF000)
+                                       switch(undo.values.prev_keyval) 
+                                       {
                                                case GDK_Return:
                                                case GDK_Tab:
                                                case GDK_space:
@@ -154,47 +170,50 @@
                if (seq_flag) {
                        switch (command) {
                        case BS:
-                               undo_gstr = g_string_prepend(undo_gstr, str);
-                               ui_tmp->start--;
+                               undo.undo_gstr 
+                                       = g_string_prepend(undo.undo_gstr, str);
+                               undo.ui_tmp->start--;
                                break;
                        default:
-                               undo_gstr = g_string_append(undo_gstr, str);
-                               ui_tmp->end++;
-                       }
-                       redo_list = undo_clear_info_list(redo_list);
-                       prev_keyval = keyval;
-                       gtk_widget_set_sensitive(undo_w, TRUE);
-                       gtk_widget_set_sensitive(redo_w, FALSE);
+                               undo.undo_gstr 
+                                       = g_string_append(undo.undo_gstr, str);
+                               undo.ui_tmp->end++;
+                       }
+                       undo.lists.redo=undo_clear_info_list(undo.lists.redo);
+                       undo.values.prev_keyval = keyval;
+                       SENSITIZE(undo.widgets.undo);
+                       DESENSITIZE(undo.widgets.redo);
+
                        return;
                }
-               undo_append_undo_info(ui_tmp->command, 
-                       ui_tmp->start, ui_tmp->end, 
-                       g_strdup(undo_gstr->str));
-               undo_gstr = g_string_erase(undo_gstr, 0, -1);
+               undo_append_undo_info(undo.ui_tmp->command, 
+                       undo.ui_tmp->start, undo.ui_tmp->end, 
+                       g_strdup(undo.undo_gstr->str));
+               undo.undo_gstr = g_string_erase(undo.undo_gstr, 0, -1);
        }
        
-       if (!keyval && prev_keyval)
+       if (!keyval && undo.values.prev_keyval)
                undo_set_sequency(TRUE);
        
        if (end - start == 1 && ((keyval && keyval < 0xF000) 
                || keyval == GDK_BackSpace || keyval == GDK_Delete 
                || keyval == GDK_Tab)) 
        {
-               ui_tmp->command = command;
-               ui_tmp->start = start;
-               ui_tmp->end = end;
-               undo_gstr = g_string_erase(undo_gstr, 0, -1);
-               g_string_append(undo_gstr, str);
+               undo.ui_tmp->command = command;
+               undo.ui_tmp->start = start;
+               undo.ui_tmp->end = end;
+               undo.undo_gstr = g_string_erase(undo.undo_gstr, 0, -1);
+               g_string_append(undo.undo_gstr, str);
        } 
        else 
                undo_append_undo_info(command, start, 
                        end, g_strdup(str));
        
-       redo_list = undo_clear_info_list(redo_list);
-       prev_keyval = keyval;
+       undo.lists.redo= undo_clear_info_list(undo.lists.redo);
+       undo.values.prev_keyval = keyval;
        keyval=0;
-       gtk_widget_set_sensitive(undo_w, TRUE);
-       gtk_widget_set_sensitive(redo_w, FALSE);
+       SENSITIZE(undo.widgets.undo);
+       DESENSITIZE(undo.widgets.redo);
 }
 
 static void 
@@ -233,7 +252,7 @@
 {
        bool flag;
        
-       flag = (modified_step == g_list_length(undo_list));
+       flag = (undo.values.modified_step == g_list_length(undo.lists.undo));
        if (gtk_text_buffer_get_modified(buffer) == flag)
                gtk_text_buffer_set_modified(buffer, !flag);
 }
@@ -259,17 +278,20 @@
 DV(g_print("end-user-action(block_func)\n"));
 }
 
-void 
-gsh_undo_init(GtkWidget *view, 
-       GtkWidget *undo_button, 
-       GtkWidget *redo_button)
+static void 
+undo_flush_temporal_buffer(void)
 {
-       GtkTextBuffer *buffer = GTK_TEXT_VIEW(view)->buffer;
-        
-       undo_w = undo_button;
-       redo_w = redo_button;
-       gsh_undo_text_view=GTK_TEXT_VIEW(view);
+       if (undo.undo_gstr->len) {
+               undo_append_undo_info(undo.ui_tmp->command,
+                       undo.ui_tmp->start, undo.ui_tmp->end, 
+                       g_strdup(undo.undo_gstr->str));
+               undo.undo_gstr = g_string_erase(undo.undo_gstr, 0, -1);
+       }
+}
        
+static void
+setup_signals(GtkTextBuffer * buffer)
+{
        g_signal_connect_after(G_OBJECT(buffer), "insert-text",
                G_CALLBACK(cb_insert_text), NULL);
        g_signal_connect(G_OBJECT(buffer), "delete-range",
@@ -278,35 +300,42 @@
                G_CALLBACK(cb_begin_user_action), NULL);
        g_signal_connect(G_OBJECT(buffer), "end-user-action",
                G_CALLBACK(cb_end_user_action), NULL);
+}
+
+void 
+gsh_undo_init(GtkWidget *view, 
+       GtkWidget *undo_button, 
+       GtkWidget *redo_button)
+{
+       GtkTextBuffer *buffer = GTK_TEXT_VIEW(view)->buffer;
+       
+               undo.widgets.undo=undo_button;
+       undo.widgets.redo=redo_button;
+       undo.lists.undo=NULL;
+       undo.lists.redo=NULL;
+       undo.widgets.text=GTK_TEXT_VIEW(view);
+       undo.values.seq_reserve=FALSE;
+       setup_signals(buffer);
        cb_end_user_action(buffer);
        
-       ui_tmp = g_malloc(sizeof(UndoInfo));
-       undo_gstr = g_string_new("");
+       undo.ui_tmp = g_malloc(sizeof(UndoInfo));
+       undo.undo_gstr = g_string_new("");
 
        /* Clear undo history and state.  */
-       undo_list = undo_clear_info_list(undo_list);
-       redo_list = undo_clear_info_list(redo_list);
+       undo.lists.undo= undo_clear_info_list(undo.lists.undo);
+       undo.lists.redo= undo_clear_info_list(undo.lists.redo);
        /* Reset modified step.  */
        undo_flush_temporal_buffer();
-       modified_step = g_list_length(undo_list);
+       undo.values.modified_step = g_list_length(undo.lists.undo);
        /* Set widget receptiveness.  */
-       gtk_widget_set_sensitive(undo_w, FALSE);
-       gtk_widget_set_sensitive(redo_w, FALSE);
+       DESENSITIZE(undo.widgets.undo);
+       DESENSITIZE(undo.widgets.redo);
        
-       ui_tmp->command = INS;
-       undo_gstr = g_string_erase(undo_gstr, 0, -1);
-       prev_keyval = 0;
+       undo.ui_tmp->command = INS;
+       undo.undo_gstr = g_string_erase(undo.undo_gstr, 0, -1);
+       undo.values.prev_keyval = 0;
 }
 
-static void 
-undo_flush_temporal_buffer(void)
-{
-       if (undo_gstr->len) {
-               undo_append_undo_info(ui_tmp->command,
-                       ui_tmp->start, ui_tmp->end, g_strdup(undo_gstr->str));
-               undo_gstr = g_string_erase(undo_gstr, 0, -1);
-       }
-}
 
 void
 gsh_undo_undo(GtkTextBuffer *buffer)
@@ -319,43 +348,43 @@
 
                sentinel=FALSE; 
                undo_flush_temporal_buffer();
-               if (g_list_length(undo_list)) 
+               if (g_list_length(undo.lists.undo)) 
                {
-                       ui = g_list_last(undo_list)->data;
+                       ui = g_list_last(undo.lists.undo)->data;
                        gtk_text_buffer_get_iter_at_offset(buffer, 
                                &start_iter, ui->start);
-                       switch (ui->command) 
+                       if(ui->command == INS)
                        {
-                       case INS:
                                gtk_text_buffer_get_iter_at_offset(buffer, 
                                        &end_iter, ui->end);
                                gtk_text_buffer_delete(buffer, 
                                        &start_iter, &end_iter);
-                               break;
-                       default:
+                       }
+                       else
+                       {
                                gtk_text_buffer_insert(buffer, 
                                        &start_iter, ui->str, -1);
                }
-               redo_list = g_list_append(redo_list, ui);
-               undo_list = g_list_delete_link(undo_list, 
-                       g_list_last(undo_list));
-DV(g_print("cb_edit_undo: undo left = %d, redo left = %d\n",
-g_list_length(undo_list), g_list_length(redo_list)));
-               if (g_list_length(undo_list)) 
+                       undo.lists.redo= g_list_append(undo.lists.redo, ui);
+                       undo.lists.undo= g_list_delete_link(undo.lists.undo, 
+                       g_list_last(undo.lists.undo));
+                       if (g_list_length(undo.lists.undo)) 
                {
-                       if (((UndoInfo *)g_list_last(undo_list)->data)->seq)
+                               if (((UndoInfo *)g_list_last(undo.lists.undo)
+                                       ->data)->seq)
                                sentinel=TRUE;
                } 
                else
-                       gtk_widget_set_sensitive(undo_w, FALSE);
+                               DESENSITIZE(undo.widgets.undo);
                if(!sentinel)
                {
-                       gtk_widget_set_sensitive(redo_w, TRUE);
+                               SENSITIZE(undo.widgets.redo);
                        if(ui->command == DEL)
-                               gtk_text_buffer_get_iter_at_offset(buffer, 
-                                       &start_iter, ui->start);
-                       gtk_text_buffer_place_cursor(buffer, &start_iter);
-                       SCROLL_TO_CURSOR(buffer, 0.05);
+                                       gtk_text_buffer_get_iter_at_offset(
+                                               buffer, &start_iter, ui->start);
+                               gtk_text_buffer_place_cursor(
+                                       buffer, &start_iter);
+                               scroll_to_cursor(buffer);
                }
        }
                if(!sentinel)
@@ -374,28 +403,30 @@
                UndoInfo *ri;
 
                sentinel=FALSE;
-               if (g_list_length(redo_list)) 
+               if (g_list_length(undo.lists.redo)) 
                {
-                       ri = g_list_last(redo_list)->data;
+                       ri = g_list_last(undo.lists.redo)->data;
                        gtk_text_buffer_get_iter_at_offset(buffer, 
                                &start_iter, ri->start);
-                       switch (ri->command) {
-                       case INS:
+                       if(ri->command==INS)
+                       {
                                gtk_text_buffer_insert(buffer, 
                                        &start_iter, ri->str, -1);
-                               break;
-                       default:
+                       }
+                       else
+                       {
                                gtk_text_buffer_get_iter_at_offset(buffer, 
                                        &end_iter, ri->end);
                                gtk_text_buffer_delete(buffer, 
                                        &start_iter, &end_iter);
                        }
-                       undo_list = g_list_append(undo_list, ri);
-                       redo_list = g_list_delete_link(redo_list, 
-                               g_list_last(redo_list));
+                       undo.lists.undo= g_list_append(undo.lists.undo, ri);
+                       undo.lists.redo= g_list_delete_link(undo.lists.redo, 
+                               g_list_last(undo.lists.redo));
                        DV(g_print("cb_edit_redo: undo left = %d, "
-                               "redo left = %d\n", g_list_length(undo_list), 
-                               g_list_length(redo_list)));
+                               "redo left = %d\n", 
+                               g_list_length(undo.lists.undo), 
+                               g_list_length(undo.lists.redo)));
                        if (ri->seq) 
                        {
                                undo_set_sequency(TRUE);
@@ -403,13 +434,15 @@
                        }
                        else
                        {
-                               if (!g_list_length(redo_list))
-                                       gtk_widget_set_sensitive(redo_w, 
+                               if (!g_list_length(undo.lists.redo))
+                                       gtk_widget_set_sensitive(
+                                               undo.widgets.redo, 
                                                FALSE);
-                               gtk_widget_set_sensitive(undo_w, TRUE);
+                               gtk_widget_set_sensitive(
+                                       undo.widgets.undo, TRUE);
                                gtk_text_buffer_place_cursor(buffer, 
                                        &start_iter);
-                               SCROLL_TO_CURSOR(buffer, 0.05);
+                               scroll_to_cursor(buffer);
                        }
                }
                if(!sentinel)

Index: gtkshell/update_manager.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/update_manager.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- gtkshell/update_manager.c   19 Dec 2007 18:44:46 -0000      1.11
+++ gtkshell/update_manager.c   13 Aug 2010 20:22:23 -0000      1.12
@@ -23,108 +23,61 @@
 #include "gtkshell.h"
 
 static void
-gsh_update_each(gpointer data, gpointer user_data)
+gsh_update_each(gpointer data, gpointer user_data __attribute__ ((unused)))
 {
-       struct GSHUpdatedWidget *item;
-
-       UNUSED(user_data);
-       /*
-        * Ensure that the argument containing the structure is not
-        * empty.
-        */
-#ifdef DEBUG
-       ARWIFNP(data)
-       {
-#endif /* DEBUG */
-
-               /*
-                * Assign data to structure and call function pointer
-                * with parameters.
-                */
-               item = (struct GSHUpdatedWidget *) data;
-#ifdef DEBUG
-               ARPASSERT(item->update);
-#endif /* DEBUG */
-               $(item, update);
-#ifdef DEBUG
-       }
-#endif /* DEBUG */
+       if(data)
+               $(((struct GSHUpdatedWidget *)data), update);
 }
 
 static gint
 gsh_perform_updates(gpointer data)
 {
-       struct GSHUpdateManager * updaters;
-
-#ifdef DEBUG
-       ARBUG("gsh_perform_updates()");
-#endif                         /* DEBUG */
-
-       updaters = (struct GSHUpdateManager *) data;
-
-       
-#ifdef DEBUG
-       if (updaters && updaters->list)
-#endif /* DEBUG */
-               g_slist_foreach(updaters->list, gsh_update_each, NULL);
-#ifdef DEBUG
-       else
+       if(data)
        {
-               ARWARN("data invalid, operation not performed.");
-               return FALSE;
-       }
-#endif /* DEBUG */
-
+               g_slist_foreach(((struct GSHUpdateManager *)data)->list, 
+                       gsh_update_each, NULL);
        return TRUE;
+       }
+       return FALSE;
 }
 
 static void
 gsh_GSHUpdateManager_start(struct GSHUpdateManager * updaters)
 {
-#ifdef DEBUG
-       ARBUG("gsh_start_updates()");
-#endif                         /* DEBUG */
+       if(updaters)
+       {
        if(updaters->updating)
                return;
        else
                updaters->updating=TRUE;
-#ifdef DEBUG
-       ARWIFNP (updaters)
-       {
-#endif /* DEBUG */
-               (void) gsh_perform_updates(updaters);
+               gsh_perform_updates(updaters);
                (void) g_timeout_add(updaters->period, gsh_perform_updates,
                                     updaters);
-#ifdef DEBUG
        }
-#endif /* DEBUG */
 }
 
 static void
 gsh_GSHUpdateManager_add(struct GSHUpdateManager * updaters, 
        struct GSHUpdatedWidget * item)
 {
-
-#ifdef DEBUG
-       ARBUG("gsh_append_updater()");
-
-       if (ARPBOOL(updaters) && ARPBOOL(item))
-#endif                         /* DEBUG */
+       if(updaters)
+       {
+               if(item)
+               {
                updaters->list = g_slist_prepend(updaters->list, item);
+               }
        /* Begin updating, if necessary.  */
        gsh_GSHUpdateManager_start(updaters);
-#ifdef DEBUG
-       ARBUG("end gsh_append_updater()");
-#endif                         /* DEBUG */
+       }
 }
 
 
 static void
-gsh_delete_each_updater(gpointer data, gpointer user_data)
+gsh_delete_each_updater(gpointer data, 
+       gpointer user_data __attribute__ ((unused)))
 {
        struct GSHUpdatedWidget * item;
 
-       UNUSED(user_data);
        item=(struct GSHUpdatedWidget *)data;
        $(item, delete);
 }

Index: libantiright/arguments.c
===================================================================
RCS file: /sources/antiright/antiright/libantiright/arguments.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- libantiright/arguments.c    15 Dec 2007 02:55:36 -0000      1.3
+++ libantiright/arguments.c    13 Aug 2010 20:22:23 -0000      1.4
@@ -97,3 +97,4 @@
 
        return args;
 }
+

Index: libantiright/macros.h
===================================================================
RCS file: /sources/antiright/antiright/libantiright/macros.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- libantiright/macros.h       20 Dec 2007 00:21:12 -0000      1.10
+++ libantiright/macros.h       13 Aug 2010 20:22:23 -0000      1.11
@@ -1,6 +1,6 @@
 /*
   AntiRight
-  (c) 2007 Jeffrey Bedard
+  (c) 2007-2010 Jeffrey Bedard
   address@hidden
 
   This file is part of AntiRight.
@@ -26,8 +26,12 @@
 #define ARBUGPARAM(message) \
        "%s:%d: %s", __FILE__, __LINE__, message
 
+#ifdef DEBUG
 #define ARBUG(message) \
        g_debug(ARBUGPARAM(message))
+#else /* ! DEBUG */
+#define ARBUG(message)
+#endif /* DEBUG */
 
 #define ARWARN(message) \
        g_warning(ARBUGPARAM(message))

Index: libantiright/util.h
===================================================================
RCS file: /sources/antiright/antiright/libantiright/util.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- libantiright/util.h 14 May 2007 18:06:35 -0000      1.13
+++ libantiright/util.h 13 Aug 2010 20:22:23 -0000      1.14
@@ -32,8 +32,6 @@
 void
 xfree(gpointer data);
 
-#define UNUSED(arg) /* undefined. */
-
 typedef void(*ARActionFunction)(gint *, gchar **);
 
 struct ARFunctionDictionary

Index: gtkshell/quickstart.c
===================================================================
RCS file: gtkshell/quickstart.c
diff -N gtkshell/quickstart.c
--- gtkshell/quickstart.c       10 Dec 2007 15:13:24 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,53 +0,0 @@
-
-#include "gtkshell.h"
-
-#ifdef GSH_USE_QUICKSTART
-
-static void
-add_launcher(GSHQuickStart * this,
-       GSH * gsh, const gchar * command, const gchar * icon_name)
-{
-       GtkWidget * button;
-
-       gsh_image_button(gsh, (gchar *)command, (gchar *)icon_name);
-       button=gsh->widgets.button;
-       gsh_reparent_widget(button, gtk_widget_get_parent(button),
-               this->__last_was_row1 ? this->__row2 : this->__row1);
-       this->__last_was_row1=!this->__last_was_row1;
-}
-
-static void
-delete(GSHQuickStart * this)
-{
-       gtk_widget_destroy(this->__column);
-       g_free(this);
-}
-
-static GtkWidget *
-getColumn(GSHQuickStart * this)
-{
-       return this->__column;
-}
-
-GSHQuickStart *
-gsh_new_GSHQuickStart()
-{
-       GSHQuickStart * quickstart=g_malloc(sizeof(GSHQuickStart));
-       GtkWidget * column=quickstart->__column=gtk_vbox_new(TRUE, 0);
-       GtkWidget * row1=quickstart->__row1=gtk_hbox_new(TRUE, 0);
-       GtkWidget * row2=quickstart->__row2=gtk_hbox_new(TRUE, 0);
-
-       GSHCA(column, row1);
-       GSHCA(column, row2);
-       gtk_widget_show(row1);
-       gtk_widget_show(row2);
-       gtk_widget_show(column);
-       quickstart->__last_was_row1=FALSE;
-       quickstart->add=add_launcher;
-       quickstart->delete=delete;
-       quickstart->getColumn=getColumn;
-
-       return quickstart;
-}
-
-#endif /* GSH_USE_QUICKSTART */

Index: gtkshell/quickstart.h
===================================================================
RCS file: gtkshell/quickstart.h
diff -N gtkshell/quickstart.h
--- gtkshell/quickstart.h       25 Oct 2007 01:07:43 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,18 +0,0 @@
-#ifndef GSH_QUICKSTART_H
-#define GSH_QUICKSTART_H
-#include "gtkshell.h"
-struct GSHQuickStart 
-{
-       void (*add)(struct GSHQuickStart *, GSH *, 
-               const gchar *, const gchar *);
-       void (*delete)(struct GSHQuickStart *); 
-       GtkWidget * (*getColumn)(struct GSHQuickStart *);
-       GtkWidget * __row1;
-       GtkWidget * __row2;
-       GtkWidget * __column;
-       gboolean __last_was_row1;
-};
-typedef struct GSHQuickStart GSHQuickStart;
-GSHQuickStart *
-gsh_new_GSHQuickStart();
-#endif /* GSH_QUICKSTART_H */



reply via email to

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