[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Antiright-devel] antiright ACE-desktop/guidl/IDE.gdl doc/gtkshel...
From: |
Jeffrey Bedard |
Subject: |
[Antiright-devel] antiright ACE-desktop/guidl/IDE.gdl doc/gtkshel... |
Date: |
Fri, 27 Apr 2007 02:02:07 +0000 |
CVSROOT: /sources/antiright
Module name: antiright
Changes by: Jeffrey Bedard <jefbed> 07/04/27 02:02:06
Modified files:
ACE-desktop/guidl: IDE.gdl
doc : gtkshell.1
gtkshell : add_options.c button.c button.h guidl.lex
guidl.y guidl_util.c guidl_util.h
guidl_widgets.c label.c label.h
libantiright : Makefile library.h macros.h pipe.c pipe.h
Removed files:
gtkshell : guidltest
Log message:
Added command-generated buttons and labels to command line argument
syntax to ensure that system buttons and labels can be defined using
the widget dictionary in GUIDL. Switch to const gchar * type where
appropriate. Removed unneeded tokens and rules from guidl grammar.
Updated manual page.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/ACE-desktop/guidl/IDE.gdl?cvsroot=antiright&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/antiright/doc/gtkshell.1?cvsroot=antiright&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/add_options.c?cvsroot=antiright&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/button.c?cvsroot=antiright&r1=1.26&r2=1.27
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/button.h?cvsroot=antiright&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl.lex?cvsroot=antiright&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl.y?cvsroot=antiright&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_util.c?cvsroot=antiright&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_util.h?cvsroot=antiright&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidl_widgets.c?cvsroot=antiright&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/label.c?cvsroot=antiright&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/label.h?cvsroot=antiright&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/guidltest?cvsroot=antiright&r1=1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/antiright/libantiright/Makefile?cvsroot=antiright&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/antiright/libantiright/library.h?cvsroot=antiright&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/antiright/libantiright/macros.h?cvsroot=antiright&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/antiright/libantiright/pipe.c?cvsroot=antiright&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/antiright/libantiright/pipe.h?cvsroot=antiright&r1=1.5&r2=1.6
Patches:
Index: ACE-desktop/guidl/IDE.gdl
===================================================================
RCS file: /sources/antiright/antiright/ACE-desktop/guidl/IDE.gdl,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- ACE-desktop/guidl/IDE.gdl 26 Apr 2007 23:12:03 -0000 1.11
+++ ACE-desktop/guidl/IDE.gdl 27 Apr 2007 02:02:06 -0000 1.12
@@ -7,7 +7,7 @@
option "rows" 3;
-add system label "pwd";
+add "system label" "pwd";
option "terminal font" "Mono 12";
option "terminal width" 80;
Index: doc/gtkshell.1
===================================================================
RCS file: /sources/antiright/antiright/doc/gtkshell.1,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- doc/gtkshell.1 16 Mar 2007 00:39:31 -0000 1.8
+++ doc/gtkshell.1 27 Apr 2007 02:02:06 -0000 1.9
@@ -4,11 +4,15 @@
gtkshell \- invocation configurable GUI shell
.SH SYNOPSIS
.B gtkshell
-.B [[-a[[e
+.B [[-a[[c[bl]
+command
+.B ][e
file
.B ][l
label
-.B ]PT[t
+.B ]PS[s
+command
+.B ]T[t
command
.B ]u[[l
command
@@ -22,11 +26,21 @@
message
.B ]]] [-f
file
-.B ] [-o[Eefghn[r
+.B ] [-o[DEeFfghLln[r
rows
-.B ][u
+.B ][T
+title
+.B ][t[[w
+width
+.B ][h
+height
+.B ][f
+font
+.B ][s
+size
+.B ]]][u
miliseconds
-.B ]]]] [-p] [
+.B ]]]] [
command
.B ] [
command
@@ -59,6 +73,14 @@
the first item if followed by '::'. Menu items take the same form as command
buttons, and they are separated by '::'.
.TP
+.B \-acb command
+Add a button with its command and label initialized by the execution of
+.B command.
+.TP
+.B \-acl command
+Add a label with its text being the result of
+.B command.
+.TP
.B \-ae file
Adds a text viewer widget, showing
.B file
@@ -73,6 +95,13 @@
Adds a text area with contents derived from a pipe. The output of a command
piped into gtkshell with this option will be shown in a text area.
.TP
+.B \-aS
+Add a separator.
+.TP
+.B \-as command
+Adds a terminal widget running
+.B command.
+.TP
.B \-aT
Adds an empty text area.
.B \-at [command]
@@ -156,7 +185,16 @@
as its text.
.TP
.B \-f file
-Parses a file in the GUIDL format.
+Parses a file in the GUIDL format. If
+.B file
+is
+.I -
+, the input file will be a standard input pipe.
+.TP
+.B \-oD
+Do not use dummy argument
+.I guidl
+for GUIDL parsed input.
.TP
.B \-oE
Make a text entry only print the text to standard output, rather than executing
@@ -166,6 +204,9 @@
Make command execution callbacks exit on activation. This includes buttons and
text fields.
.TP
+.B \-oF
+Do not use base frame.
+.TP
.B \-of
Use framed labels.
.TP
@@ -175,7 +216,13 @@
for primary application window.
.TP
.B \-oh
-Use vertical labels, i.e., with a vertical horizontal base for text direction.
+Use vertical labels, with a vertical horizontal base for text direction.
+.TP
+.B \-oL
+Use expanded labels, which grow with window size changes.
+.TP
+.B \-ol
+Do not use expanded labels.
.TP
.B \-on
Use undecorated main window.
@@ -185,11 +232,23 @@
.B number
rows in grid layout.
.TP
+.B \-oT title
+Set the window title to
+.B title.
+.TP
+.B \-otf font
+Set the font to use with the terminal widget.
+.TP
+.B \-oth height
+Set the height of the terminal widget.
+.TP
+.B \-ots size
+Set the font size of the terminal widget.
+.B \-otw width
+Set the width of the terminal widget.
+.TP
.B \-ou miliseconds
Specify refresh frequency of updater widgets.
-.TP
-.B \-p
-Parses piped input in the GUIDL format.
.SH AUTHORS
gtkshell was written by Jeffrey Bedard <address@hidden>.
Index: gtkshell/add_options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/add_options.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- gtkshell/add_options.c 1 Apr 2007 05:34:56 -0000 1.20
+++ gtkshell/add_options.c 27 Apr 2007 02:02:06 -0000 1.21
@@ -50,6 +50,7 @@
add_piped_generic(struct GSH * gsh, void (*add)(struct GSH *, gchar *))
{
gchar *output;
+
output=antiright_read_file(stdin);
(*add)(gsh, output);
g_free(output);
@@ -69,12 +70,40 @@
gtk_widget_show(separator);
}
+static void
+generic_commanded_add(struct GSH * gsh, const gchar * command,
+ GtkWidget * (*add)(struct GSH *,
+ const gchar * ))
+{
+ gchar * result;
+
+ result=antiright_pipe_read(command);
+ (*add)(gsh, result);
+ g_free(result);
+}
+
void
gsh_handle_add_arguments(struct GSH * gsh, int argc, char **argv, int *counter)
{
g_assert(strlen(argv[(*counter)]) > 1);
switch (argv[(*counter)][2])
{
+ case 'c':
+ if(!argv[*counter] || !argv[(*counter)+1])
+ break;
+ gsh_count(argc, counter);
+ switch(argv[(*counter)-1][3])
+ {
+ case 'b':
+ generic_commanded_add(gsh, argv[*counter],
+ &gsh_add_button);
+ break;
+ case 'l':
+ generic_commanded_add(gsh, argv[*counter],
+ &gsh_add_label);
+ break;
+ }
+ break;
case 'e':
gsh_count(argc, counter);
gsh_text_editor(gsh, argv[*counter]);
Index: gtkshell/button.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/button.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- gtkshell/button.c 24 Apr 2007 21:54:21 -0000 1.26
+++ gtkshell/button.c 27 Apr 2007 02:02:06 -0000 1.27
@@ -23,7 +23,7 @@
#include "gtkshell.h"
static void
-create_label_in_menu_item(GtkWidget * widget, char * formatted)
+create_label_in_menu_item(GtkWidget * widget, const gchar * formatted)
{
GtkWidget * label;
@@ -33,27 +33,24 @@
}
static void
-setup_label(GtkWidget *widget, char *command)
+setup_label(GtkWidget *widget, const gchar *command)
{
gchar *formatted;
formatted = antiright_beautified_label(command);
-
if(GTK_IS_MENU_ITEM(widget))
create_label_in_menu_item(widget, formatted);
else
gtk_button_set_label(GTK_BUTTON(widget), formatted);
-
free(formatted);
}
static void
-setup_callback(struct GSH * gsh, char * command)
+setup_callback(struct GSH * gsh, const gchar * command)
{
struct GSH_CBData * cb;
cb = gsh_new_GSH_CBData(gsh, g_strdup(command));
-
if(GTK_IS_MENU_ITEM(gsh->button)) /* menu item button */
(void) g_signal_connect(G_OBJECT(gsh->button),
"activate", G_CALLBACK(gsh_system_cb), cb);
@@ -71,12 +68,11 @@
gsh->button = gtk_button_new();
else
gsh->button = gtk_menu_item_new();
-
gtk_widget_show(gsh->button);
}
static void
-setup_command_button(struct GSH * gsh, char * command)
+setup_command_button(struct GSH * gsh, const gchar * command)
{
setup_label(gsh->button, command);
gsh_setup_drag_drop(gsh, gsh->button);
@@ -84,7 +80,7 @@
}
void
-gsh_command_button(struct GSH * gsh, char *command)
+gsh_command_button(struct GSH * gsh, const gchar *command)
{
ARPASSERT(gsh);
@@ -93,29 +89,35 @@
gsh_manage_unexpanded(gsh, gsh->button);
}
-
void
-gsh_new_button(struct GSH * gsh, gchar * string)
+gsh_new_button(struct GSH * gsh, const gchar * string)
{
gchar **pair;
pair=g_strsplit(string, ",", 2);
-
-
if(ARPBOOL(pair[0]) && ARPBOOL(pair[1]))
{
gchar * command;
if(ar_asprintf(&command, "%s", pair[0]) != -1)
+ {
gsh_image_button(gsh, command, pair[1]);
- else
+ g_free(command);
+ }
+ else /* Allocation was unsuccessful. */
ARWARN("cannot create button");
}
else
gsh_command_button(gsh, string);
-
g_strfreev(pair);
}
-
+/* This is just a wrapper around gsh_new_button(), to
+ follow the convention of returning a created widget. */
+GtkWidget *
+gsh_add_button(struct GSH * gsh, const gchar * string)
+{
+ gsh_new_button(gsh, string);
+ return gsh->button;
+}
Index: gtkshell/button.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/button.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- gtkshell/button.h 6 Apr 2007 15:05:28 -0000 1.6
+++ gtkshell/button.h 27 Apr 2007 02:02:06 -0000 1.7
@@ -24,9 +24,12 @@
#define GSH_BUTTON_H
void
-gsh_command_button(struct GSH * gsh, char *command);
+gsh_command_button(struct GSH * gsh, const gchar *command);
void
-gsh_new_button(struct GSH * gsh, gchar * string);
+gsh_new_button(struct GSH * gsh, const gchar * string);
+
+GtkWidget *
+gsh_add_button(struct GSH * gsh, const gchar * string);
#endif
Index: gtkshell/guidl.lex
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/guidl.lex,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- gtkshell/guidl.lex 16 Apr 2007 02:23:29 -0000 1.9
+++ gtkshell/guidl.lex 27 Apr 2007 02:02:06 -0000 1.10
@@ -14,13 +14,10 @@
, return COMMA;
; return END;
option return OPTION;
-button return BUTTON;
-label return LABEL;
add return ADD;
buttons return BUTTONS;
echo return TOKEN_ECHO;
dialog return DIALOG;
-system return SYSTEM;
[ \t\n] /* ignore */;
"//".*$ /* comment */;
Index: gtkshell/guidl.y
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/guidl.y,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- gtkshell/guidl.y 24 Apr 2007 19:31:47 -0000 1.17
+++ gtkshell/guidl.y 27 Apr 2007 02:02:06 -0000 1.18
@@ -55,9 +55,9 @@
gchar * string;
gint number;
}
-%token IFS SC COMMA OPTION LABEL
-%token BUTTON END ADD BUTTONS
-%token DIALOG SYSTEM TOKEN_ECHO
+%token IFS SC COMMA OPTION
+%token END ADD BUTTONS
+%token DIALOG TOKEN_ECHO
%token <string> STRING
%token <number> NUM
%%
@@ -124,18 +124,6 @@
gsh_guidl_widget($2, NULL);
}
|
-ADD BUTTON button
-|
-ADD SYSTEM BUTTON STRING
-{
- gsh_add_system_button($4);
-}
-|
-ADD SYSTEM LABEL STRING
-{
- gsh_add_system_label($4);
-}
-|
ADD BUTTONS buttons
;
Index: gtkshell/guidl_util.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/guidl_util.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- gtkshell/guidl_util.c 16 Apr 2007 01:50:31 -0000 1.9
+++ gtkshell/guidl_util.c 27 Apr 2007 02:02:06 -0000 1.10
@@ -76,33 +76,6 @@
}
void
-gsh_add_system_button(gchar * command)
-{
- /* Adds a button containing the output of
- * a command specified by STRING. */
- gchar * output;
-
- output=antiright_pipe_read(command);
- g_free(command);
- gsh_append_arg(output);
- g_free(output);
-}
-
-void
-gsh_add_system_label(gchar * command)
-{
- /* Adds a label containing the output of
- * a command specified by STRING. */
-
- gchar * output;
-
- output=antiright_pipe_read(command);
- g_free(command);
- gsh_guidl_add("-al", output);
- /* OUTPUT is freed in gsh_guidl_add(). */
-}
-
-void
gsh_append_arg(gchar * arg)
{
check_gsh_guidl_env();
Index: gtkshell/guidl_util.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/guidl_util.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- gtkshell/guidl_util.h 16 Apr 2007 01:50:31 -0000 1.5
+++ gtkshell/guidl_util.h 27 Apr 2007 02:02:06 -0000 1.6
@@ -43,12 +43,6 @@
void
gsh_setup_GDLDictionaries(struct GDLDictionaries * dictionaries);
-void
-gsh_add_system_button(gchar * command);
-
-void
-gsh_add_system_label(gchar * command);
-
int
yylex();
Index: gtkshell/guidl_widgets.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/guidl_widgets.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- gtkshell/guidl_widgets.c 16 Apr 2007 02:23:29 -0000 1.2
+++ gtkshell/guidl_widgets.c 27 Apr 2007 02:02:06 -0000 1.3
@@ -39,6 +39,8 @@
DEF("row", "-ar");
DEF("viewer", "-ae");
DEF("text", "-aT");
+ DEF("system label", "-acl");
+ DEF("system button", "-acb");
}
static void
Index: gtkshell/label.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/label.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- gtkshell/label.c 19 Mar 2007 10:18:25 -0000 1.14
+++ gtkshell/label.c 27 Apr 2007 02:02:06 -0000 1.15
@@ -1,6 +1,6 @@
/*
AntiRight
- (c) 2002-2006 Jeffrey Bedard
+ (c) 2002-2007 Jeffrey Bedard
address@hidden
This file is part of AntiRight.
@@ -37,7 +37,7 @@
}
GtkWidget *
-gsh_add_label(struct GSH * gsh, char *text)
+gsh_add_label(struct GSH * gsh, const gchar *text)
{
GtkWidget *label;
GtkWidget *to_be_managed;
@@ -76,7 +76,7 @@
}
void
-gsh_set_label(GtkWidget *label, char *text)
+gsh_set_label(GtkWidget *label, const gchar *text)
{
ARPASSERT(label);
/* Text is not checked, as empty labels are allowed. */
Index: gtkshell/label.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/label.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- gtkshell/label.h 28 Feb 2007 03:53:51 -0000 1.5
+++ gtkshell/label.h 27 Apr 2007 02:02:06 -0000 1.6
@@ -1,6 +1,6 @@
/*
AntiRight
- (c) 2002-2006 Jeffrey Bedard
+ (c) 2002-2007 Jeffrey Bedard
address@hidden
This file is part of AntiRight.
@@ -24,9 +24,9 @@
#define GSH_LABEL_H
GtkWidget *
- gsh_add_label(struct GSH * gsh, char *text);
+gsh_add_label(struct GSH * gsh, const gchar *text);
void
- gsh_set_label(GtkWidget *label, char *text);
+gsh_set_label(GtkWidget *label, const gchar *text);
#endif
Index: libantiright/Makefile
===================================================================
RCS file: /sources/antiright/antiright/libantiright/Makefile,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- libantiright/Makefile 16 Apr 2007 01:19:51 -0000 1.7
+++ libantiright/Makefile 27 Apr 2007 02:02:06 -0000 1.8
@@ -5,7 +5,7 @@
all: libantiright.a
-objects=pipe.o string.o system.o util.o tuple.o
+objects=pipe.o string.o system.o util.o tuple.o vector.o
libantiright.a: ${objects}
ar rcs libantiright.a ${objects}
Index: libantiright/library.h
===================================================================
RCS file: /sources/antiright/antiright/libantiright/library.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- libantiright/library.h 16 Apr 2007 01:19:51 -0000 1.15
+++ libantiright/library.h 27 Apr 2007 02:02:06 -0000 1.16
@@ -35,6 +35,7 @@
#include "system.h"
#include "util.h"
#include "tuple.h"
+#include "vector.h"
#include "macros.h"
Index: libantiright/macros.h
===================================================================
RCS file: /sources/antiright/antiright/libantiright/macros.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- libantiright/macros.h 19 Mar 2007 07:09:30 -0000 1.1
+++ libantiright/macros.h 27 Apr 2007 02:02:06 -0000 1.2
@@ -63,5 +63,10 @@
ARWARN("NULL data passed, operation not performed"); \
else
+#define ARMETHOD(class, method, ...)\
+ class->method(class, __VA_ARGS__)
+
+#define $ ARMETHOD
+
#endif /* not LIBAR_MACROS_H */
Index: libantiright/pipe.c
===================================================================
RCS file: /sources/antiright/antiright/libantiright/pipe.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- libantiright/pipe.c 2 Apr 2007 18:31:41 -0000 1.8
+++ libantiright/pipe.c 27 Apr 2007 02:02:06 -0000 1.9
@@ -30,6 +30,7 @@
gchar buffer[BUFSIZ];
gchar *text;
size_t total, read;
+
total=0;
read=0;
ar_asprintf(&text, "\0");
@@ -40,6 +41,7 @@
ARPASSERT(text);
g_strlcat(text, buffer, total);
}
+
return text;
}
@@ -57,8 +59,8 @@
}
/* Make sure that you free the returned string. */
-char *
-antiright_pipe_read(char *command_string)
+gchar *
+antiright_pipe_read(const gchar *command_string)
{
/* Declare. */
char *text;
Index: libantiright/pipe.h
===================================================================
RCS file: /sources/antiright/antiright/libantiright/pipe.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- libantiright/pipe.h 2 Apr 2007 18:31:41 -0000 1.5
+++ libantiright/pipe.h 27 Apr 2007 02:02:06 -0000 1.6
@@ -20,8 +20,9 @@
#ifndef LIBAR_PIPE_H
#define LIBAR_PIPE_H
-char *
-antiright_pipe_read(char *command_string);
+
+gchar *
+antiright_pipe_read(const gchar *command_string);
gchar *
antiright_read_file(FILE *file);
Index: gtkshell/guidltest
===================================================================
RCS file: gtkshell/guidltest
diff -N gtkshell/guidltest
--- gtkshell/guidltest 24 Apr 2007 00:17:02 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,7 +0,0 @@
-option "rows" 5;
-option "horizontal_labels";
-
-add button "test_button";
-add label "test label";
-add updating label "date";
-
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Antiright-devel] antiright ACE-desktop/guidl/IDE.gdl doc/gtkshel...,
Jeffrey Bedard <=