[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Antiright-devel] antiright ACE-desktop/guidl/IDE.gdl gtkshell/ar... [an
From: |
Jeffrey Bedard |
Subject: |
[Antiright-devel] antiright ACE-desktop/guidl/IDE.gdl gtkshell/ar... [antiright-3-3] |
Date: |
Sat, 21 Apr 2007 22:19:22 +0000 |
CVSROOT: /sources/antiright
Module name: antiright
Branch: antiright-3-3
Changes by: Jeffrey Bedard <jefbed> 07/04/21 22:19:22
Modified files:
ACE-desktop/guidl: IDE.gdl
gtkshell : arguments.c macros.h option_options.c options.c
Log message:
Added option for removal of dummy guidl argument.
Split out guidl argument handler and menubutton/button
argument handler code to static subroutines.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/ACE-desktop/guidl/IDE.gdl?cvsroot=antiright&only_with_tag=antiright-3-3&r1=1.9&r2=1.9.2.1
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/arguments.c?cvsroot=antiright&only_with_tag=antiright-3-3&r1=1.18&r2=1.18.4.1
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/macros.h?cvsroot=antiright&only_with_tag=antiright-3-3&r1=1.2&r2=1.2.4.1
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/option_options.c?cvsroot=antiright&only_with_tag=antiright-3-3&r1=1.19&r2=1.19.4.1
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/options.c?cvsroot=antiright&only_with_tag=antiright-3-3&r1=1.15&r2=1.15.2.1
Patches:
Index: ACE-desktop/guidl/IDE.gdl
===================================================================
RCS file: /sources/antiright/antiright/ACE-desktop/guidl/IDE.gdl,v
retrieving revision 1.9
retrieving revision 1.9.2.1
diff -u -b -r1.9 -r1.9.2.1
--- ACE-desktop/guidl/IDE.gdl 16 Apr 2007 02:23:29 -0000 1.9
+++ ACE-desktop/guidl/IDE.gdl 21 Apr 2007 22:19:21 -0000 1.9.2.1
@@ -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.18.4.1
diff -u -b -r1.18 -r1.18.4.1
--- gtkshell/arguments.c 9 Apr 2007 20:25:15 -0000 1.18
+++ gtkshell/arguments.c 21 Apr 2007 22:19:21 -0000 1.18.4.1
@@ -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.2.4.1
diff -u -b -r1.2 -r1.2.4.1
--- gtkshell/macros.h 19 Mar 2007 10:18:25 -0000 1.2
+++ gtkshell/macros.h 21 Apr 2007 22:19:21 -0000 1.2.4.1
@@ -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.19.4.1
diff -u -b -r1.19 -r1.19.4.1
--- gtkshell/option_options.c 1 Apr 2007 17:50:42 -0000 1.19
+++ gtkshell/option_options.c 21 Apr 2007 22:19:21 -0000 1.19.4.1
@@ -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.15.2.1
diff -u -b -r1.15 -r1.15.2.1
--- gtkshell/options.c 16 Apr 2007 01:19:51 -0000 1.15
+++ gtkshell/options.c 21 Apr 2007 22:19:21 -0000 1.15.2.1
@@ -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)]);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Antiright-devel] antiright ACE-desktop/guidl/IDE.gdl gtkshell/ar... [antiright-3-3],
Jeffrey Bedard <=