antiright-devel
[Top][All Lists]
Advanced

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

[Antiright-devel] antiright configure ACE-desktop/guidl/IDE.gdl g...


From: Jeffrey Bedard
Subject: [Antiright-devel] antiright configure ACE-desktop/guidl/IDE.gdl g...
Date: Sat, 21 Apr 2007 22:21:57 +0000

CVSROOT:        /sources/antiright
Module name:    antiright
Changes by:     Jeffrey Bedard <jefbed> 07/04/21 22:21:57

Modified files:
        .              : configure 
        ACE-desktop/guidl: IDE.gdl 
        gtkshell       : arguments.c macros.h option_options.c options.c 

Log message:
        Branched 3.3, version of current is now 3.4-alpha.
        Switched interface definitions to new widget addition format.
        Added option to not insert dummy "guidl" argument when
        parsing interface definitions.  Refactored/split out some
        code in argument handler and guidl option handler sections.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/configure?cvsroot=antiright&r1=1.88&r2=1.89
http://cvs.savannah.gnu.org/viewcvs/antiright/ACE-desktop/guidl/IDE.gdl?cvsroot=antiright&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/arguments.c?cvsroot=antiright&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/macros.h?cvsroot=antiright&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/option_options.c?cvsroot=antiright&r1=1.19&r2=1.20
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/options.c?cvsroot=antiright&r1=1.15&r2=1.16

Patches:
Index: configure
===================================================================
RCS file: /sources/antiright/antiright/configure,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -b -r1.88 -r1.89
--- configure   13 Apr 2007 03:14:12 -0000      1.88
+++ configure   21 Apr 2007 22:21:57 -0000      1.89
@@ -24,7 +24,7 @@
 #
 ###############################################################################
 
-VERSION=3.3-alpha
+VERSION=3.4-alpha
 
 USE_DISTCC=YES
 USE_CCACHE=YES

Index: ACE-desktop/guidl/IDE.gdl
===================================================================
RCS file: /sources/antiright/antiright/ACE-desktop/guidl/IDE.gdl,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- ACE-desktop/guidl/IDE.gdl   16 Apr 2007 02:23:29 -0000      1.9
+++ ACE-desktop/guidl/IDE.gdl   21 Apr 2007 22:21:57 -0000      1.10
@@ -2,6 +2,9 @@
 // This is an IDE, particularly suited for development
 // of AntiRight.  It is a combination of useful functionality
 // into one app, rather than a reinvention of such.
+
+option "title" "IDE";
+
 option "rows" 2;
 
 option "terminal font" "Mono 12";

Index: gtkshell/arguments.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/arguments.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- gtkshell/arguments.c        9 Apr 2007 20:25:15 -0000       1.18
+++ gtkshell/arguments.c        21 Apr 2007 22:21:57 -0000      1.19
@@ -25,29 +25,44 @@
 
 #define SPLIT_ALL -1
 
-/* Decide whether to use a regular button or a menu button.  */
 static void
-button_parse(struct GSH * gsh, const gchar * string)
+test_button_or_menubutton(struct GSH * gsh, 
+                         const gchar * string,
+                         gchar ** tokens)
 {
-       gchar **tokens;
-
-       tokens=g_strsplit(string, "::", SPLIT_ALL);
        if(ARPBOOL(tokens[1]))
                menubutton_parse(gsh, tokens);
        else
                gsh_new_button(gsh, (char *)string);
+}
 
+/* Decide whether to use a regular button or a menu button.  */
+static void
+button_parse(struct GSH * gsh, const gchar * string)
+{
+       gchar **tokens;
+
+       tokens=g_strsplit(string, "::", SPLIT_ALL);
+       test_button_or_menubutton(gsh, string, tokens);
        g_strfreev(tokens);
 }
 
+static void
+test_option_or_argument(struct GSH * gsh, 
+                       int argc, char ** argv, 
+                       int *counter)
+{
+       if (argv[*counter][0] == '-')
+               gsh_handle_switch_arguments(gsh, argc, argv, counter);
+       else
+               button_parse(gsh, argv[*counter]);
+}
+
 void
 gsh_parse_arguments(struct GSH * gsh, int argc, char **argv)
 {
        int counter;
 
        for (counter = 1; counter < argc; counter++)
-               if (argv[counter][0] == '-')
-                       gsh_handle_switch_arguments(gsh, argc, argv, &counter);
-               else
-                       button_parse(gsh, argv[counter]);
+               test_option_or_argument(gsh, argc, argv, &counter);
 }

Index: gtkshell/macros.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/macros.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- gtkshell/macros.h   19 Mar 2007 10:18:25 -0000      1.2
+++ gtkshell/macros.h   21 Apr 2007 22:21:57 -0000      1.3
@@ -33,6 +33,7 @@
 #define GSH_MENU_BUTTON                64
 #define GSH_NO_BASE_FRAME      128
 #define GSH_NO_LABEL_EXPAND    256
+#define GSH_GUIDL_NO_DUMMY     512
 
 typedef guint Bitmask;
 

Index: gtkshell/option_options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/option_options.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- gtkshell/option_options.c   1 Apr 2007 17:50:42 -0000       1.19
+++ gtkshell/option_options.c   21 Apr 2007 22:21:57 -0000      1.20
@@ -50,6 +50,15 @@
 {
        switch (argv[(*counter)][2])
        {
+       case 'D':
+               /* Do not insert the dummy "guidl" string before the
+                  arguments passed by means of a guidl definition.  
+                  It is not necessary to include this as an option
+                  within the guidl description itself, as the dummy
+                  option is inserted prior to parsing.  */
+               GSH_SET(GSH_GUIDL_NO_DUMMY);
+               break;
+
        case 'E':               /* Make a text entry simply print the
                                 * text.  */
                GSH_SET(GSH_PROMPT_ECHOES);

Index: gtkshell/options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/options.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- gtkshell/options.c  16 Apr 2007 01:19:51 -0000      1.15
+++ gtkshell/options.c  21 Apr 2007 22:21:57 -0000      1.16
@@ -49,8 +49,15 @@
 static void
 common_guidl_handler(struct GSH * gsh)
 {
+       if(gsh_guidl_env == NULL)
        gsh_guidl_env=gsh_new_GDLEnvironment();
+
+       /* Determine whether or not to include an initial
+          dummy argument.  Needed as argv[0] is skipped
+          by the command line handling code. */
+       if(!GSH_FLAG(GSH_GUIDL_NO_DUMMY))
        gsh_append_arg((char*)"guidl");
+
        yyparse();
 #ifdef DEBUG
        print_arguments(gsh_guidl_env->args.argc, gsh_guidl_env->args.argv);
@@ -59,7 +66,15 @@
                            gsh_guidl_env->args.argv);
        gsh_delete_GDLEnvironment(gsh_guidl_env);
        gsh_guidl_env=NULL;
-       /* Free parse memory in main.  */
+}
+
+static void
+guidl_handler_for_file(struct GSH * gsh, const gchar * filename)
+{
+       /* If the argument is "-", use stdin for yyin.  */
+       if(strcmp("-", filename))
+               yyin=fopen(filename, "r");
+       common_guidl_handler(gsh);
 }
 
 void
@@ -77,15 +92,11 @@
                break;
        case 'f':
                gsh_count(argc, counter);
-               yyin=fopen(argv[*counter], "r");
-               common_guidl_handler(gsh);
+               guidl_handler_for_file(gsh, argv[*counter]);
                break;
        case 'o':
                gsh_handle_option_arguments(gsh, argc, argv, counter);
                break;
-       case 'p': /* Handle piped in GUIDL input.  */
-               common_guidl_handler(gsh);
-               break;
        default:
                g_warning("%s:  %s undefined\n", argv[0], argv[(*counter)]);
        }




reply via email to

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