[Top][All Lists]
[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: |
Sun, 06 May 2007 05:00:11 +0000 |
CVSROOT: /sources/antiright
Module name: antiright
Changes by: Jeffrey Bedard <jefbed> 07/05/06 05:00:11
Modified files:
. : configure
ACE-desktop/guidl: IDE.gdl
gtkshell : containers.c gtkshell.c gtkshell.h
guidl_dialog.c guidl_dialog.h
guidl_dictionary.c guidl_dictionary.h
guidl_options.c guidl_options.h guidl_widgets.c
guidl_widgets.h macros.h menu.c
option_options.c options.c updated_label.c
Log message:
Use generic macros for guidl item addition function definition.
Added application mode support, which provides for a menubar and
status bar around the main interface.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/configure?cvsroot=antiright&r1=1.90&r2=1.91
http://cvs.savannah.gnu.org/viewcvs/antiright/ACE-desktop/guidl/IDE.gdl?cvsroot=antiright&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/containers.c?cvsroot=antiright&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/gtkshell.c?cvsroot=antiright&r1=1.32&r2=1.33
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/gtkshell.h?cvsroot=antiright&r1=1.41&r2=1.42
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_dialog.c?cvsroot=antiright&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_dialog.h?cvsroot=antiright&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_dictionary.c?cvsroot=antiright&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_dictionary.h?cvsroot=antiright&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_options.c?cvsroot=antiright&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_options.h?cvsroot=antiright&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_widgets.c?cvsroot=antiright&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_widgets.h?cvsroot=antiright&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/macros.h?cvsroot=antiright&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/menu.c?cvsroot=antiright&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/option_options.c?cvsroot=antiright&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/options.c?cvsroot=antiright&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/updated_label.c?cvsroot=antiright&r1=1.16&r2=1.17
Patches:
Index: configure
===================================================================
RCS file: /sources/antiright/antiright/configure,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -b -r1.90 -r1.91
--- configure 3 May 2007 03:42:30 -0000 1.90
+++ configure 6 May 2007 05:00:11 -0000 1.91
@@ -47,11 +47,7 @@
done
# For development branch
-CFLAGS="$CFLAGS -Wall -W -W"
-CFLAGS="$CFLAGS -Wwrite-strings "
-CFLAGS="$CFLAGS -Wsign-compare -Wunreachable-code"
-CFLAGS="$CFLAGS -Wmissing-noreturn -Wmissing-declarations"
-
+CFLAGS="$CFLAGS -Wall"
DEFS="$DEFS -DPACKAGE_STRING='\"AntiRight_$VERSION\"'"
Index: ACE-desktop/guidl/IDE.gdl
===================================================================
RCS file: /sources/antiright/antiright/ACE-desktop/guidl/IDE.gdl,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- ACE-desktop/guidl/IDE.gdl 4 May 2007 01:03:25 -0000 1.15
+++ ACE-desktop/guidl/IDE.gdl 6 May 2007 05:00:11 -0000 1.16
@@ -7,6 +7,12 @@
option "rows" 4;
+option "application";
+add buttons
+ "File::Exit",
+ "Edit::EMPTY",
+ "Help::About";
+
option "no fill";
add "system label" "pwd";
option "fill";
Index: gtkshell/containers.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/containers.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- gtkshell/containers.c 5 May 2007 23:38:07 -0000 1.15
+++ gtkshell/containers.c 6 May 2007 05:00:11 -0000 1.16
@@ -67,6 +67,12 @@
void
gsh_setup_base_container(struct GSH * gsh)
{
+ if(gsh->widgets.app_frame)
+ {
+ gtk_container_add(GTK_CONTAINER(gsh->widgets.app_frame),
+ gsh->rows->h);
+ gsh->rows->h=gsh->widgets.app_row;
+ }
if (GSH_FLAG(GSH_SCROLL))
gsh_setup_scrolled_window(gsh);
else if (!GSH_FLAG(GSH_NO_BASE_FRAME))
Index: gtkshell/gtkshell.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/gtkshell.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- gtkshell/gtkshell.c 5 May 2007 23:38:07 -0000 1.32
+++ gtkshell/gtkshell.c 6 May 2007 05:00:11 -0000 1.33
@@ -55,6 +55,8 @@
gsh->add.button=&gsh_add_button;
gsh->add.label=&gsh_add_label;
$(gsh, add.window);
+ gsh->widgets.menu_bar=NULL;
+ gsh->widgets.app_frame=NULL;
}
struct GSH *
Index: gtkshell/gtkshell.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/gtkshell.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -b -r1.41 -r1.42
--- gtkshell/gtkshell.h 5 May 2007 23:38:07 -0000 1.41
+++ gtkshell/gtkshell.h 6 May 2007 05:00:11 -0000 1.42
@@ -59,6 +59,10 @@
GtkWidget * window;
GtkWidget * scrolled_window;
GtkWidget * button;
+ GtkWidget * menu_bar;
+ GtkWidget * status_bar;
+ GtkWidget * app_frame;
+ GtkWidget * app_row;
} widgets;
/* member classes */
Index: gtkshell/guidl_dialog.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/guidl_dialog.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- gtkshell/guidl_dialog.c 3 May 2007 22:55:10 -0000 1.7
+++ gtkshell/guidl_dialog.c 6 May 2007 05:00:11 -0000 1.8
@@ -20,11 +20,11 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
+#define DICT gsh_guidl_env->dictionaries->dialog
#include "gtkshell.h"
extern struct GDLEnvironment * gsh_guidl_env;
-#define DICT gsh_guidl_env->dictionaries->dialogs
#define DEF(a, b) GSH_GUIDL_DEFINE(DICT, a, b)
static void
@@ -43,11 +43,5 @@
DEF("error", "-de");
}
-void
-gsh_guidl_dialog(gchar * dialog_type, gchar * argument)
-{
- GSH_GUIDL_CHECK_DICTIONARY(dialogs);
- $(gsh_guidl_env, add, $(gsh_guidl_env->dictionaries->dialogs,
- find, dialog_type), argument);
-}
+GSH_GUIDL_ITEM_FUNC(dialog, DICT);
Index: gtkshell/guidl_dialog.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/guidl_dialog.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- gtkshell/guidl_dialog.h 13 Apr 2007 03:59:00 -0000 1.1
+++ gtkshell/guidl_dialog.h 6 May 2007 05:00:11 -0000 1.2
@@ -23,7 +23,6 @@
#ifndef GSH_GUIDL_DIALOG_H
#define GSH_GUIDL_DIALOG_H
-void
-gsh_guidl_dialog(gchar * dialog_type, gchar * argument);
+GSH_GUIDL_ITEM_HEAD(dialog);
#endif /* GSH_GUIDL_DIALOG_H */
Index: gtkshell/guidl_dictionary.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/guidl_dictionary.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- gtkshell/guidl_dictionary.c 3 May 2007 03:42:31 -0000 1.3
+++ gtkshell/guidl_dictionary.c 6 May 2007 05:00:11 -0000 1.4
@@ -22,6 +22,8 @@
#include "gtkshell.h"
+extern struct GDLEnvironment * gsh_guidl_env;
+
#define GSH_DELETE_DICTIONARY(base, dict)\
{\
if(base->dict != NULL)\
@@ -34,9 +36,9 @@
static void
gsh_delete_GDLDictionaries_contents(struct GDLDictionaries * dictionaries)
{
- GSH_DELETE_DICTIONARY(dictionaries, widgets);
- GSH_DELETE_DICTIONARY(dictionaries, options);
- GSH_DELETE_DICTIONARY(dictionaries, dialogs);
+ GSH_DELETE_DICTIONARY(dictionaries, widget);
+ GSH_DELETE_DICTIONARY(dictionaries, option);
+ GSH_DELETE_DICTIONARY(dictionaries, dialog);
}
static void
@@ -49,9 +51,9 @@
static void
gsh_GDLDictionaries_setup(struct GDLDictionaries * dictionaries)
{
- dictionaries->widgets=NULL;
- dictionaries->options=NULL;
- dictionaries->dialogs=NULL;
+ dictionaries->widget=NULL;
+ dictionaries->option=NULL;
+ dictionaries->dialog=NULL;
dictionaries->delete=&gsh_delete_GDLDictionaries;
}
@@ -66,3 +68,11 @@
return dictionaries;
}
+void
+gsh_guidl_generic_item(gchar * item, gchar * argument,
+ struct ARTupleVector * dict)
+{
+ $(gsh_guidl_env, add, $(dict, find, item), argument);
+ g_free(item);
+}
+
Index: gtkshell/guidl_dictionary.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/guidl_dictionary.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- gtkshell/guidl_dictionary.h 28 Apr 2007 22:26:23 -0000 1.2
+++ gtkshell/guidl_dictionary.h 6 May 2007 05:00:11 -0000 1.3
@@ -25,22 +25,41 @@
struct GDLDictionaries
{
- struct ARTupleVector * widgets;
- struct ARTupleVector * dialogs;
- struct ARTupleVector * options;
+ struct ARTupleVector * widget;
+ struct ARTupleVector * dialog;
+ struct ARTupleVector * option;
void (*delete)(struct GDLDictionaries *);
};
-#define GSH_GUIDL_CHECK_DICTIONARY(dict)\
+#define GSH_GUIDL_CHECK_DICTIONARY(dict, setup)\
{\
- if(gsh_guidl_env->dictionaries->dict==NULL)\
- setup_dictionary();\
+ if(!dict)\
+ setup();\
}
#define GSH_GUIDL_DEFINE(dict, a, b)\
$(dict, add, (gchar *)a, (gchar *)b)
+#define GSH_GUIDL_ITEM(item, arg, dict, setup)\
+{\
+ GSH_GUIDL_CHECK_DICTIONARY(dict, setup);\
+ gsh_guidl_generic_item(item, arg, dict);\
+}
+
+#define GSH_GUIDL_ITEM_FUNC(type, dict)\
+void gsh_guidl_ ##type (gchar * item, gchar * arg)\
+{\
+ GSH_GUIDL_ITEM(item, arg, dict, setup_dictionary);\
+}
+
+#define GSH_GUIDL_ITEM_HEAD(type)\
+void gsh_guidl_ ##type (gchar * item, gchar * arg);
+
struct GDLDictionaries *
gsh_new_GDLDictionaries();
+void
+gsh_guidl_generic_item(gchar * item, gchar * argument,
+ struct ARTupleVector * dict);
+
#endif /* GSH_GUIDL_DICTIONARY_H */
Index: gtkshell/guidl_options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/guidl_options.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- gtkshell/guidl_options.c 3 May 2007 22:55:10 -0000 1.5
+++ gtkshell/guidl_options.c 6 May 2007 05:00:11 -0000 1.6
@@ -20,11 +20,11 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
+#define DICT gsh_guidl_env->dictionaries->option
#include "gtkshell.h"
extern struct GDLEnvironment * gsh_guidl_env;
-#define DICT gsh_guidl_env->dictionaries->options
#define DEF(a, b) GSH_GUIDL_DEFINE(DICT, a, b);
static void
@@ -45,17 +45,8 @@
DEF("terminal height", "-oth");
DEF("rows", "-or");
DEF("update frequency", "-ou");
+ DEF("application", "-oa");
}
-void
-gsh_guidl_option(gchar * option, gchar * argument)
-{
- GSH_GUIDL_CHECK_DICTIONARY(options);
-#ifdef DEBUG
- ARPASSERT(gsh_guidl_env->dictionaries->options);
-#endif /* DEBUG */
- $(gsh_guidl_env, add, $(gsh_guidl_env->dictionaries->options, find,
- option), argument);
- g_free(option);
-}
+GSH_GUIDL_ITEM_FUNC(option, DICT);
Index: gtkshell/guidl_options.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/guidl_options.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- gtkshell/guidl_options.h 24 Apr 2007 00:17:02 -0000 1.1
+++ gtkshell/guidl_options.h 6 May 2007 05:00:11 -0000 1.2
@@ -23,7 +23,6 @@
#ifndef GSH_GUIDL_OPTIONS_H
#define GSH_GUIDL_OPTIONS_H
-void
-gsh_guidl_option(gchar * option, gchar * argument);
+GSH_GUIDL_ITEM_HEAD(option);
#endif /* GSH_GUIDL_OPTIONS_H */
Index: gtkshell/guidl_widgets.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/guidl_widgets.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- gtkshell/guidl_widgets.c 4 May 2007 00:59:58 -0000 1.7
+++ gtkshell/guidl_widgets.c 6 May 2007 05:00:11 -0000 1.8
@@ -20,11 +20,11 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
+#define DICT gsh_guidl_env->dictionaries->widget
#include "gtkshell.h"
extern struct GDLEnvironment * gsh_guidl_env;
-#define DICT gsh_guidl_env->dictionaries->widgets
#define DEF(a, b)\
GSH_GUIDL_DEFINE(DICT, a, b)
@@ -32,7 +32,7 @@
static void
setup_dictionary()
{
- gsh_guidl_env->dictionaries->widgets=ARNEW(ar, ARTupleVector);
+ DICT=ARNEW(ar, ARTupleVector);
DEF("label", "-al");
DEF("prompt", "-at");
DEF("terminal", "-as");
@@ -48,12 +48,5 @@
DEF("vertical pane", "-ab");
}
-void
-gsh_guidl_widget(gchar * widget, gchar * argument)
-{
- GSH_GUIDL_CHECK_DICTIONARY(widgets);
- $(gsh_guidl_env, add, ($(gsh_guidl_env->dictionaries->widgets,
- find, widget)), argument);
- g_free(widget);
-}
+GSH_GUIDL_ITEM_FUNC(widget, DICT);
Index: gtkshell/guidl_widgets.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/guidl_widgets.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- gtkshell/guidl_widgets.h 16 Apr 2007 01:50:31 -0000 1.1
+++ gtkshell/guidl_widgets.h 6 May 2007 05:00:11 -0000 1.2
@@ -23,7 +23,6 @@
#ifndef GSH_GUIDL_WIDGETS_H
#define GSH_GUIDL_WIDGETS_H
-void
-gsh_guidl_widget(gchar * widget, gchar * argument);
+GSH_GUIDL_ITEM_HEAD(widget);
#endif /* GSH_GUIDL_WIDGETS_H */
Index: gtkshell/macros.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/macros.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- gtkshell/macros.h 2 May 2007 14:55:31 -0000 1.5
+++ gtkshell/macros.h 6 May 2007 05:00:11 -0000 1.6
@@ -34,6 +34,7 @@
#define GSH_NO_BASE_FRAME 128
#define GSH_NO_EXPAND 256
#define GSH_GUIDL_NO_DUMMY 512
+#define GSH_APP_MODE 1024
typedef guint Bitmask;
Index: gtkshell/menu.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/menu.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- gtkshell/menu.c 4 May 2007 00:59:58 -0000 1.7
+++ gtkshell/menu.c 6 May 2007 05:00:11 -0000 1.8
@@ -33,7 +33,6 @@
pair=g_strsplit(string, ",", 2);
#ifdef DEBUG
- ARPASSERT(command);
ARPASSERT(pair[0]);
#endif /* DEBUG */
@@ -48,7 +47,6 @@
static void
add_menu_items(struct GSH * gsh, GtkWidget * menu, gchar **tokens)
{
- gint i;
GtkWidget * old_row;
/* Set gsh->rows->v to a row within a menu.
@@ -58,22 +56,54 @@
old_row=gsh->rows->v;
gsh->rows->v=menu;
+ {
+ guint i;
+
for(i=1; ARPBOOL(tokens[i]); i++)
menuitem_parse(gsh, tokens[i]);
+ }
gsh->rows->v=old_row;
}
+static void
+setup_app_mode(struct GSH * gsh)
+{
+ GtkWidget * app_row;
+ GtkWidget * status_frame;
+ GtkWidget * status_bar;
+
+ gtk_widget_show(app_row = gtk_vbox_new(FALSE, 1));
+ gsh->widgets.app_row=app_row;
+ gtk_container_add(GTK_CONTAINER(app_row), gsh->widgets.menu_bar);
+ gtk_widget_show(gsh->widgets.app_frame=gtk_frame_new(NULL));
+ gtk_container_add(GTK_CONTAINER(app_row), gsh->widgets.app_frame);
+ gtk_widget_show(status_frame=gtk_frame_new(NULL));
+ gtk_frame_set_shadow_type(GTK_FRAME(status_frame), GTK_SHADOW_IN);
+ gtk_container_add(GTK_CONTAINER(app_row), status_frame);
+ gtk_widget_show(status_bar=gtk_label_new("status"));
+ gtk_container_add(GTK_CONTAINER(status_frame), status_bar);
+}
+
+static void
+manage_menu_bar(struct GSH * gsh)
+{
+ if(GSH_FLAG(GSH_APP_MODE))
+ setup_app_mode(gsh);
+ else
+ gsh_manage(gsh, gsh->widgets.menu_bar);
+}
+
static GtkWidget *
add_menu_bar(struct GSH * gsh)
{
- GtkWidget * menu_bar;
-
- menu_bar = gtk_menu_bar_new();
- gtk_widget_show(menu_bar);
- gsh_manage(gsh, menu_bar);
+ if(!gsh->widgets.menu_bar)
+ {
+ gtk_widget_show(gsh->widgets.menu_bar=gtk_menu_bar_new());
+ manage_menu_bar(gsh);
+ }
- return menu_bar;
+ return gsh->widgets.menu_bar;
}
static GtkWidget *
Index: gtkshell/option_options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/option_options.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- gtkshell/option_options.c 5 May 2007 23:38:07 -0000 1.24
+++ gtkshell/option_options.c 6 May 2007 05:00:11 -0000 1.25
@@ -50,6 +50,12 @@
{
switch (argv[(*counter)][2])
{
+ case 'a':
+ /* Run in application mode. Here, a menu bar and status
+ bar encloses the application. This option may also affect
+ other gtkshell properties in the future. */
+ GSH_SET(GSH_APP_MODE);
+ break;
case 'D':
/* Do not insert the dummy "guidl" string before the
arguments passed by means of a guidl definition.
Index: gtkshell/options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/options.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- gtkshell/options.c 4 May 2007 00:59:58 -0000 1.21
+++ gtkshell/options.c 6 May 2007 05:00:11 -0000 1.22
@@ -62,7 +62,7 @@
guidl_handler_for_file(struct GSH * gsh, const gchar * filename)
{
/* If the argument is "-", use stdin for yyin. */
- if(strcmp("-", filename))
+ if(strcmp("-", filename)) /* Otherwise, use FILENAME. */
yyin=fopen(filename, "r");
common_guidl_handler(gsh);
}
Index: gtkshell/updated_label.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/updated_label.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- gtkshell/updated_label.c 3 May 2007 22:55:10 -0000 1.16
+++ gtkshell/updated_label.c 6 May 2007 05:00:11 -0000 1.17
@@ -23,7 +23,7 @@
#include "gtkshell.h"
static void
-gsh_check_results(char **results)
+gsh_check_results(gchar **results)
{
/*
@@ -37,8 +37,8 @@
if (*results[0] == '\0')
{
- free(*results);
- asprintf(results, "(empty)");
+ g_free(*results);
+ *results=g_strdup("(empty)");
}
}
- [Antiright-devel] antiright configure ACE-desktop/guidl/IDE.gdl g...,
Jeffrey Bedard <=