antiright-devel
[Top][All Lists]
Advanced

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

[Antiright-devel] antiright ACE-desktop/ACE ACE-desktop/ACE.1 ACE...


From: Jeffrey Bedard
Subject: [Antiright-devel] antiright ACE-desktop/ACE ACE-desktop/ACE.1 ACE...
Date: Fri, 02 Mar 2007 03:56:07 +0000

CVSROOT:        /sources/antiright
Module name:    antiright
Changes by:     Jeffrey Bedard <jefbed> 07/03/02 03:56:07

Modified files:
        ACE-desktop    : ACE ACE.1 Makefile 
        gtkshell       : Makefile add_options.c button.c button.h 
                         callbacks.c containers.c dragdrop.c geometry.c 
                         gtkshell.c gtkshell.h label.c main.c 
                         option_options.c text.c updated_options.c 
        libantiright   : pipe.c pipe.h util.h 

Log message:
        Replaced GSH_Flags with gsh->bflags, which stores bitmasks.
        Added pipe opening support for label and text area.  Added generic
        file open function to libantiright.  Used to implement text viewer
        and antiright_pipe_read.  Added generic bitmasks to util.h.  
        Added GSH_ bitmask definitions to gtkshell.h.  Invert meaning of
        scrolling flag.  Updated ACE.1 manual page.  Specifically install
        manual pages in ACE-desktop Makefile, rather than using shell
        metacharacter.  

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/ACE-desktop/ACE?cvsroot=antiright&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/antiright/ACE-desktop/ACE.1?cvsroot=antiright&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/antiright/ACE-desktop/Makefile?cvsroot=antiright&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/Makefile?cvsroot=antiright&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/add_options.c?cvsroot=antiright&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/button.c?cvsroot=antiright&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/button.h?cvsroot=antiright&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/callbacks.c?cvsroot=antiright&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/containers.c?cvsroot=antiright&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/dragdrop.c?cvsroot=antiright&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/geometry.c?cvsroot=antiright&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/gtkshell.c?cvsroot=antiright&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/gtkshell.h?cvsroot=antiright&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/label.c?cvsroot=antiright&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/main.c?cvsroot=antiright&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/option_options.c?cvsroot=antiright&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/text.c?cvsroot=antiright&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/updated_options.c?cvsroot=antiright&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/antiright/libantiright/pipe.c?cvsroot=antiright&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/antiright/libantiright/pipe.h?cvsroot=antiright&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/antiright/libantiright/util.h?cvsroot=antiright&r1=1.5&r2=1.6

Patches:
Index: ACE-desktop/ACE
===================================================================
RCS file: /sources/antiright/antiright/ACE-desktop/ACE,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- ACE-desktop/ACE     1 Mar 2007 06:18:28 -0000       1.20
+++ ACE-desktop/ACE     2 Mar 2007 03:56:07 -0000       1.21
@@ -46,7 +46,7 @@
 Prepare_Temp()
 {
        rm -f $1
-       touch $1
+       touch $Secure1
        chmod og-rwx $1
        chmod u+x $1
        trap "rm -f $@" EXIT QUIT
@@ -401,11 +401,11 @@
 }
 Diff()
 {
-       local file_a="$($ARSHELL -al 'Select the first file.' -al FIXME)"
+       local file_a="$($ARSHELL -df)"
        if [ "$file_a" = "" ]; then
                exit
        fi
-       local file_b="$($ARSHELL -al 'Select the second file.' -al FIXME)"
+       local file_b="$($ARSHELL -df)"
        if [ "$file_b" = "" ]; then
                exit
        fi
@@ -415,7 +415,7 @@
 }
 Message()
 {
-    $ARSHELL -al $1 -oe 'echo Dismiss' > /dev/null
+    $ARSHELL -di $1
 }
 
 set_value()
@@ -490,7 +490,7 @@
 }
 Monitoring_Panel()
 {
-       exec $ARSHELL -or 5 \
+       exec $ARSHELL -or 4 \
                "$ARSHELL -aul 'ps xau' & # Processes"\
                "$ARSHELL -aul who & # Users"\
                "$ARSHELL -aul df & # Disks"\
@@ -501,7 +501,7 @@
 }
 Administration_Panel()
 {
-    exec $ARSHELL -or 3 \
+    exec $ARSHELL -or 4 \
        'ACE -A Secure_Permissions'\
        'ACE Root_Shell'\
        'ACE -A Monitoring_Panel'\

Index: ACE-desktop/ACE.1
===================================================================
RCS file: /sources/antiright/antiright/ACE-desktop/ACE.1,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- ACE-desktop/ACE.1   3 Feb 2007 20:11:14 -0000       1.1
+++ ACE-desktop/ACE.1   2 Mar 2007 03:56:07 -0000       1.2
@@ -7,55 +7,69 @@
 .SH DESCRIPTION
 .PP
 .I ACE
-is the main component of the AntiRight desktop environment.  It is a script 
which defines the function of arshell instances.  It makes use of a 
configuration lookup mechanism to use user configurable bindings where 
appropriate.  Due to the scripted nature, the desktop environment behavior can 
be carried across different graphical user interfaces by simply changing the 
arshell program.  Since the arshell program event loop is maintained by 
arshell, which is typically written in C, speed is not an issue.  This is 
despite the scripted nature of the environment.  The ACE script can easily be 
modified to change the environment, greatly easing development time.
-.PP
-To start the environment, simply invoke ACE with no options.  A panel will 
appear.  On this panel one can launch the calculator, the CD player, the file 
manager, the sticky note utility, the desk bar/pager, the text editor, the load 
meter/system monitor, the terminal, the browser, the image editor, the mail 
utility, the background selection utility, the configuration utility, and the 
run dialog.  All button bindings are configurable through the settings utility. 
 For example, one can change the default browser, which is a lynx instance in 
an xterm, to dillo or mozilla.  The view menu allows one to access other 
panels, including other instances of the current panel.  The view menu contains 
an
-.I ACE Panel
-button, which launches an instance of the main panel, an
-.I Administration Panel
-button, a
-.I File System Panel
-button, a
-.I Network Panel
-button, and a
-.I Themes Panel
-button.
-.PP
-The
+is the main component of the AntiRight desktop environment.  
+It is a script which defines the function of gtkshell instances.  
+It makes use of a configuration lookup mechanism to use user configurable 
+bindings where appropriate.  Due to the scripted nature, 
+the desktop environment behavior can be carried across different 
+graphical user interfaces by simply changing the gtkshell program.  
+Since the gtkshell program event loop is maintained by gtkshell, 
+which is typically written in C, speed is not an issue.  
+This is despite the scripted nature of the environment.  
+The ACE script can easily be modified to change the environment, 
+greatly easing development time.
+.PP
+To start the environment, simply invoke ACE with no options.  
+A panel will appear.  On this panel one can launch the calculator, 
+the CD player, the file manager, the sticky note utility, the calendar, 
+the text editor, the load meter/system monitor, the terminal, the browser, 
+the image editor, the mail utility, the background selection utility, the 
+configuration utility, and the run dialog.  All button bindings are 
+configurable through the settings utility.  For example, one can change 
+the default browser, which is a lynx instance in an xterm, to dillo, firefox 
or 
+mozilla.  The view menu allows one to access other panels, including 
+other instances of the current panel.  The
 .I Administration Panel
 contains a 
-.I Fix File Permissions
+.I Secure Permissions
 button, a 
 .I Root Shell
 button, a 
-.I See All Processes
-button, a 
-.I See All Users 
-button, a 
-.I See Disk Info 
-button, a 
-.I See Open Ports
-button, a 
-.I See User Processes
-button, and a 
-.I System Monitor
-button. The
-.I Fix File Permissions
-button changes the permissions of all the files in a user's home directory so 
that others and group members cannot read, write, or execute them.  This is a 
needed action in maintaining personal privacy and security.  The
+.I Monitoring Panel
+button, and a button for launching operating system specific features.
+.pp
+The
+.I Secure Permissions
+button changes the permissions of all the files in a user's home 
+directory so that others and group members cannot read, write, or 
+execute them.  This is a needed action in maintaining personal privacy
+and security.  Before these actions are performed, the user will be
+prompted.  
+.pp
+The
 .I Root Shell
-button launches an instance of su in an xterm window.  Entering the root 
password will give the user a root shell.  The
-.I See All Processes
-button lists all processes in an arshell work area.  The ps command used is ps 
xau.  If such a command does not work, modify the ACE script such that it 
executes ps -A.  The
-.I See All Users
-button lists the users, as reported by the who command, in an arshell work 
area.  The
-.I See Disk Info
-button pipes the results of the df command into an arshell work area.  The
-.I See Open Ports
-button runs a portscan of the local host and pipes the results into an arshell 
work area.  This requires the nmap utility.  The
+button launches an instance of su in a terminal window.  Entering 
+the root password will give the user a root shell.  
+.pp
+The monitoring panel contains launchers for commands that allow you
+to monitor system activity.  
+The
+.I Processes
+button lists all processes in an gtkshell work area.  The ps command used 
+is ps xau.  If such a command does not work due to platform-dependent command
+syntax, modify the ACE script such that it executes ps -A.  The
+.I Users
+button lists the users, as reported by the who command, in an gtkshell work 
+area.  The
+.I Disks
+button pipes the results of the df command into an gtkshell work area. The
 .I See User Processes
-button allows the user to view detailed information about his or her 
processes.  The results of the ps u command are piped into an arshell work 
area.  The
+button allows the user to view detailed information about his or her 
+processes.  The results of the ps u command are piped into an gtkshell
+work area.  The
 .I System Monitor
-button launches the configured system monitor.  By default, this is an 
instance of top in an xterm.  
+button launches the configured system monitor.  By default, this is 
+an instance of top in an xterm.  
 .PP
 The
 .I File System Panel
@@ -65,17 +79,26 @@
 .I Unmount File System
 button, a
 .I Show Free Space
-button, and a
+button, a
 .I Show All File Systems
+button, and a
+.I Diff
 button.  The
 .I Mount File System
-button launches a dialog in which the filesystem to be mounted can be entered. 
 Simply type the filesystem name and press enter.  The
+button launches a dialog in which the filesystem to be mounted can be 
+entered.  Simply type the filesystem name and press enter.  The
 .I Unmount File System
-button launches a dialog in which the filesystem to be unmounted can be 
entered.  The
+button launches a dialog in which the filesystem to be unmounted can be 
+entered.  The
 .I Show Free Space
-button pipes the output of the df command into an arshell work area.  This 
shows detailed disk usage information.  The
+button pipes the output of the df command into an gtkshell work area.  
+This shows detailed disk usage information.  The
 .I Show All File Systems
-button launches an instance of arshell in which the work area displays the 
contents of /etc/fstab.
+button launches an instance of gtkshell in which the work area displays 
+the contents of /etc/fstab. The
+.I Diff
+button allows you to compare two files using the diff utility.  Input and
+output are through gtkshell.
 .PP
 The
 .I Network Panel
@@ -93,15 +116,18 @@
 .I SFTP
 button, a
 .I PPP On
-button, and a
+button, a
 .I PPP Off
+button, and a
+.I See Open Ports
 button.  The
 .I Open Display
 button allows one to open the X display to another host.  The
 .I Open URL
 button launches the browser, starting at the entered url.  The
 .I FTP
-button starts a file transfer protocol session with the host entered at the 
dialog prompt.  The
+button starts a file transfer protocol session with the host entered at the 
+dialog prompt.  The
 .I Telnet
 button launches a telnet session with the entered host.  The
 .I SSH
@@ -109,36 +135,43 @@
 .I SFTP
 button launches a secure file transfer protocol session with the entered host. 
 The 
 .I PPP On
-button launches the configured command for dialing an Internet service 
provider through PPP.  It is recommended that this option be examined in the 
configuration utility and customized to whatever command is used locally.  The
+button launches the configured command for dialing an Internet service 
provider through PPP.  It is recommended that this option be examined in the 
+configuration utility and customized to whatever command is used locally.  The
 .I PPP Off
-button stops the PPP connection.  Configure this as is appropriate for your 
site.  These commands use the ACE Launcher facility, which allows easy passing 
of options from the user to commands.  
+button stops the PPP connection.  Configure this as is appropriate for 
+your site.  These commands use the ACE Launcher facility, which allows 
+easy passing of options from the user to commands.  
+ The
+.I See Open Ports
+button runs a portscan of the local host and pipes the results into an 
+gtkshell work area.  This requires the nmap utility.  
 .PP
-The
-.I Themes Panel
-allows one to select the current X resource theme for applications.  The 
themes are defined in system.antiright, and therefore in ~/.antiright, allowing 
easy addition and modification of such through the settings utility and the 
text editor.  The default theme, as specified by ~/.Xdefaults, can be restored 
with the
-.I Reset Theme
-button.  The set of theme buttons is generated automatically from the theme 
definitions in the aforementioned ~/.antiright.
 .SH OPTIONS
 .B \-c
-Check the presence of ~/.antiright, the configuration file, and create one if 
it does not exist.  
+Check the presence of ~/.antiright, the configuration file, 
+and create one if it does not exist.  
 .TP
 .B \-t
 List the titles of the configuration options.
 .TP
 .B \-p
-Execute a configured binding but don't pass proceeding arguments to the bound 
command.  
+Execute a configured binding but don't pass proceeding arguments 
+to the bound command.  
 .TP
 .B \-r ARG
 Read the value of a configured option ARG.
 .TP
 .B \-L ARG
-Launch command ARG, gathering and passing to command ARG a user specified 
argument with an arshell dialog.  
+Launch command ARG, gathering and passing to command ARG a user 
+specified argument with an gtkshell dialog.  
 .TP
 .B \-V ARG
-Launch a verification dialog, verifying the desire to perform command ARG. 
+Launch a verification dialog, verifying the desire to perform 
+command ARG. 
 .TP
 .B \-A ARG
-Launch an AntiRight Configuration Environment function.  Please examine the 
ACE file for such functions.  
+Launch an AntiRight Configuration Environment function.  
+Please examine the ACE file for such functions.  
 .PP
 Other options will result in the printing of usage information.  
 .SH AUTHORS
@@ -146,8 +179,8 @@
 .SH REPORTING BUGS
 Report bugs to <address@hidden>
 .SH COPYRIGHT
-Copyright 2002-2004, Jeffrey E. Bedard
+Copyright 2002-2007, Jeffrey E. Bedard
 This  is  free software; see the source for copying conditions.  There is NO 
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 .SH SEE ALSO
-arshell(1) system.antiright(5) X(7)
+gtkshell(1) system.antiright(5) sh(1)

Index: ACE-desktop/Makefile
===================================================================
RCS file: /sources/antiright/antiright/ACE-desktop/Makefile,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- ACE-desktop/Makefile        25 Feb 2007 21:33:10 -0000      1.8
+++ ACE-desktop/Makefile        2 Mar 2007 03:56:07 -0000       1.9
@@ -1,4 +1,4 @@
-###############################################################################
+##############################################################################
 #
 #    AntiRight
 #    (c) 2004-2007 Jeffrey Bedard
@@ -54,8 +54,8 @@
         $(datadir) $(icondir)
        $(INSTALL_DATA) system.antiright $(datadir)
        $(INSTALL_SCRIPT) ACE.install $(bindir)/ACE
-       $(INSTALL_DATA) *.1 $(man1dir)
-       $(INSTALL_DATA) *.5 $(man5dir)
+       $(INSTALL_DATA) ACE.1 $(man1dir)
+       $(INSTALL_DATA) system.antiright.5 $(man5dir)
        $(INSTALL_DATA) AUTHORS $(docdir)
        $(INSTALL_DATA) icons/*.* $(icondir)
 

Index: gtkshell/Makefile
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/Makefile,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- gtkshell/Makefile   24 Feb 2007 08:49:27 -0000      1.8
+++ gtkshell/Makefile   2 Mar 2007 03:56:07 -0000       1.9
@@ -10,12 +10,14 @@
 objects=gtkshell.o arguments.o options.o callbacks.o updated.o\
                                label.o button.o text.o updated_label.o 
updated_progress.o\
                                updated_options.o add_options.o 
option_options.o dialog_options.o\
-                               file_dialog.o row.o containers.o geometry.o 
font.o dragdrop.o
+       file_dialog.o row.o containers.o geometry.o font.o dragdrop.o\
+       image_button.o
 
 sources=gtkshell.c arguments.c options.c callbacks.c updated.c\
                                label.c button.c text.c updated_label.c 
updated_progress.c\
                                updated_options.c add_options.c 
option_options.c dialog_options.c\
-                               file_dialog.c row.c containers.c geometry.c 
font.c dragdrop.c
+       file_dialog.c row.c containers.c geometry.c font.c dragdrop.c\
+       image_button.c
 
 all: $(objects) main.o
        $(CC) -o gtkshell $(objects) main.o $(LDFLAGS)

Index: gtkshell/add_options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/add_options.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- gtkshell/add_options.c      1 Mar 2007 18:54:04 -0000       1.10
+++ gtkshell/add_options.c      2 Mar 2007 03:56:07 -0000       1.11
@@ -22,23 +22,6 @@
 
 #include "gtkshell.h"
 
-static void
-gsh_handle_add_image_button(
-               struct GSH * gsh, int argc, char **argv, int *counter)
-{
-       gsh_count(argc, counter);
-       gsh_image_button(gsh, argv[(*counter)],
-                        argv[(*counter) + 1]);
-       gsh_count(argc, counter);
-}
-static void
-gsh_handle_add_unlabeled_image_button(
-               struct GSH * gsh, int argc, char **argv, int *counter)
-{
-       gsh_handle_add_image_button(gsh, argc, argv, counter);
-       gtk_button_set_label(GTK_BUTTON(gsh->button), "");
-}
-
 void
 gsh_handle_add_arguments(struct GSH * gsh, int argc, char **argv, int *counter)
 {
@@ -63,6 +46,29 @@
                gsh_count(argc, counter);
                gsh_add_label(gsh, argv[(*counter)]);
                break;
+       case 'P':
+               {
+                       gchar * output;
+                       GtkTextBuffer * buffer;
+                       GtkWidget * widget;
+
+                       widget=gsh_text_area(gsh);
+                       buffer=gtk_text_view_get_buffer(GTK_TEXT_VIEW(widget));
+                       output=antiright_read_file(stdin);
+                       gtk_text_buffer_set_text(buffer, output,
+                                                strlen(output));
+                       g_free(output);
+               }
+               break;
+       case 'p':
+               {
+                       gchar * output;
+
+                       output=antiright_read_file(stdin);
+                       gsh_add_label(gsh, output);
+                       g_free(output);
+               }
+               break;
 
        case 'r': /* Force creation of a new row.  */
                gsh_new_row(gsh);

Index: gtkshell/button.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/button.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- gtkshell/button.c   28 Feb 2007 03:53:51 -0000      1.15
+++ gtkshell/button.c   2 Mar 2007 03:56:07 -0000       1.16
@@ -72,13 +72,4 @@
 #endif                         /* DEBUG */
 }
 
-void
-gsh_image_button(struct GSH * gsh, char *command, char *filename)
-{
-       GtkWidget *image;
 
-       image = gtk_image_new_from_file(filename);
-       gsh_command_button(gsh, command);
-       gtk_button_set_image(GTK_BUTTON(gsh->button), image);
-       gtk_button_set_relief(GTK_BUTTON(gsh->button), GTK_RELIEF_NONE);
-}

Index: gtkshell/button.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/button.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- gtkshell/button.h   28 Feb 2007 03:53:51 -0000      1.4
+++ gtkshell/button.h   2 Mar 2007 03:56:07 -0000       1.5
@@ -24,9 +24,6 @@
 #define GSH_BUTTON_H
 
 void
-     gsh_command_button(struct GSH * gsh, char *command);
-
-void
-     gsh_image_button(struct GSH * gsh, char *command, char *filename);
+gsh_command_button(struct GSH * gsh, char *command);
 
 #endif

Index: gtkshell/callbacks.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/callbacks.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- gtkshell/callbacks.c        28 Feb 2007 06:55:27 -0000      1.13
+++ gtkshell/callbacks.c        2 Mar 2007 03:56:07 -0000       1.14
@@ -30,7 +30,7 @@
        ARBUG("gsh_test_exit()");
 #endif                         /* DEBUG */
 
-       if (ARPBOOL(gsh) && ARBBOOL(gsh->flags.button_exits))
+       if (ARPBOOL(gsh) && ((gsh->bflags & GSH_CBEXIT) == GSH_CBEXIT))
                exit(EXIT_SUCCESS);
 
 #ifdef DEBUG
@@ -97,7 +97,8 @@
 
                ARWIFNP(cb)
                {
-                       ARIFB(cb->gsh->flags.prompt_echoes)
+                       ARIFB((cb->gsh->bflags & GSH_PROMPT_ECHOES)
+                             == GSH_PROMPT_ECHOES)
                                g_print("%s\n", input);
                        else
                        sysprintf("%s %s", (char *) cb->data, (char *) input);

Index: gtkshell/containers.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/containers.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- gtkshell/containers.c       28 Feb 2007 03:53:51 -0000      1.7
+++ gtkshell/containers.c       2 Mar 2007 03:56:07 -0000       1.8
@@ -43,7 +43,7 @@
 {
        gsh->rows.h = gtk_hbox_new(FALSE, 2);
 
-       ARIFNB(gsh->flags.dont_scroll)
+       if ((gsh->bflags & GSH_SCROLL) == GSH_SCROLL)
        {
                gsh_setup_scrolled_window(gsh);
                gtk_scrolled_window_add_with_viewport(

Index: gtkshell/dragdrop.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/dragdrop.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- gtkshell/dragdrop.c 28 Feb 2007 06:55:27 -0000      1.6
+++ gtkshell/dragdrop.c 2 Mar 2007 03:56:07 -0000       1.7
@@ -69,11 +69,12 @@
 
        (void) g_signal_connect(widget, "drag-data-received",
                                G_CALLBACK(drag_received), NULL);
-       (void) g_signal_connect(widget, "drag-drop", G_CALLBACK(drag_drop), 
NULL);
+       (void) g_signal_connect(widget, "drag-drop", 
+                               G_CALLBACK(drag_drop), NULL);
        (void) g_signal_connect(widget, "drag-data-get",
                                G_CALLBACK(drag_data_get), NULL);
 
-       if (gsh->flags.button_exits)
+       if ((gsh->bflags & GSH_CBEXIT) == GSH_CBEXIT)
                (void) g_signal_connect(widget, "drag-end",
                                     G_CALLBACK(gtk_main_quit), NULL);
 }
@@ -89,9 +90,10 @@
        {
        case TARGET_STRING:
        {
-               char *label;
+               const gchar *label;
                label=gtk_button_get_label(GTK_BUTTON(widget));
-               sysprintf("%s %s", label, (gchar *) selection->data);
+               sysprintf("%s %s", (const gchar *)label, 
+                         (gchar *) selection->data);
                drag_status = TRUE;
                break;
        }

Index: gtkshell/geometry.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/geometry.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- gtkshell/geometry.c 28 Feb 2007 03:53:51 -0000      1.10
+++ gtkshell/geometry.c 2 Mar 2007 03:56:07 -0000       1.11
@@ -26,7 +26,7 @@
 void
 gsh_set_geometry(struct GSH * gsh)
 {
-       if (gsh->geometry)
+       ARIFP(gsh->geometry)
        {
                gtk_window_parse_geometry(GTK_WINDOW(gsh->window),
                                          gsh->geometry);
@@ -37,15 +37,14 @@
 static gboolean
 gsh_check_geometry(struct GSH * gsh)
 {
-       gboolean geometry_status = FALSE;
-
-       if (!ARPBOOL(gsh->geometry) && !ARBBOOL(gsh->flags.dont_scroll))
+       if (!ARPBOOL(gsh->geometry) 
+           && ((gsh->bflags & GSH_SCROLL) == GSH_SCROLL))
                ar_asprintf(&gsh->geometry, "400x267");
 
        ARIFP(gsh->geometry)
-               geometry_status = TRUE;
-
-       return geometry_status;
+               return TRUE;
+       else
+               return FALSE;
 }
 
 void

Index: gtkshell/gtkshell.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/gtkshell.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- gtkshell/gtkshell.c 1 Mar 2007 18:54:04 -0000       1.18
+++ gtkshell/gtkshell.c 2 Mar 2007 03:56:07 -0000       1.19
@@ -40,15 +40,6 @@
        return (window);
 }
 static void
-gsh_GSH_Flags(struct GSH_Flags * flags)
-{
-       flags->dont_scroll = TRUE;
-       flags->button_exits = FALSE;
-       flags->updating = FALSE;
-       flags->prompt_echoes = FALSE;
-       flags->horizontal_labels = FALSE;
-}
-static void
 gsh_GSH_Rows(struct GSH_Rows * rows)
 {
        rows->row = 1;
@@ -68,9 +59,9 @@
 {
        /* @null */
        gsh->geometry = (gchar *) NULL;
-       gsh_GSH_Flags(&gsh->flags);
        gsh_GSH_Rows(&gsh->rows);
        gsh_GSH_Updater(&gsh->update);
+       gsh->bflags=0;
 }
 struct GSH *
 gsh_new_GSH()
@@ -100,14 +91,4 @@
        gsh->window = gsh_create_main_window();
 }
 
-void
-gsh_widget_set_bg(GtkWidget *widget, int red, int green, int blue)
-{
-       GdkColor color;
-
-       color.red = red;
-       color.green = green;
-       color.blue = blue;
 
-       gtk_widget_modify_bg(widget, GTK_STATE_NORMAL, &color);
-}

Index: gtkshell/gtkshell.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/gtkshell.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- gtkshell/gtkshell.h 28 Feb 2007 03:53:51 -0000      1.20
+++ gtkshell/gtkshell.h 2 Mar 2007 03:56:07 -0000       1.21
@@ -29,16 +29,6 @@
 #include <stdlib.h>
 #include "../libantiright/library.h"
 
-struct GSH_Flags
-{
-       gboolean dont_scroll;
-       gboolean button_exits;
-       gboolean updating;
-       gboolean horizontal_labels;
-       gboolean prompt_echoes;
-       gboolean framed_labels;
-};
-
 struct GSH_Rows
 {
        GtkWidget *h;
@@ -53,15 +43,23 @@
        GSList *list;
 };
 
+#define GSH_NONE               0
+#define GSH_SCROLL             1
+#define GSH_CBEXIT             2
+#define GSH_UPDATING           4
+#define GSH_HORIZONTAL_LABELS  8
+#define GSH_PROMPT_ECHOES      16
+#define GSH_FRAMED_LABELS      32
+
 struct GSH
 {
        GtkWidget *window;
        GtkWidget *scrolled_window;
        struct GSH_Rows rows;
-       struct GSH_Flags flags;
        struct GSH_Updater update;
        GtkWidget *button;
        gchar *geometry;
+       guint bflags;
 };
 
 #include "arguments.h"
@@ -83,17 +81,15 @@
 #include "geometry.h"
 #include "font.h"
 #include "dragdrop.h"
+#include "image_button.h"
 
 void
-     gsh_stack_init(struct GSH * gsh, int *argc, char ***argv);
+gsh_stack_init(struct GSH * gsh, int *argc, char ***argv);
 
 struct GSH *
-    gsh_init(int *argc, char ***argv);
+gsh_init(int *argc, char ***argv);
 
 GtkWidget *
-          gsh_create_main_window();
-
-void
-     gsh_widget_set_bg(GtkWidget *widget, int red, int green, int blue);
+gsh_create_main_window();
 
 #endif

Index: gtkshell/label.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/label.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- gtkshell/label.c    28 Feb 2007 03:53:51 -0000      1.12
+++ gtkshell/label.c    2 Mar 2007 03:56:07 -0000       1.13
@@ -28,13 +28,10 @@
 {
        gtk_label_set_single_line_mode(GTK_LABEL(label), FALSE);
 
-       ARIFB(gsh->flags.horizontal_labels)
+       if((gsh->bflags & GSH_HORIZONTAL_LABELS) == GSH_HORIZONTAL_LABELS)
                gtk_label_set_angle(GTK_LABEL(label), 90.0);
        else
-       {
                gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
-               gtk_label_set_selectable(GTK_LABEL(label), TRUE);
-       }
 
        gsh_widget_set_font_mono(label);
 }
@@ -53,7 +50,7 @@
 
        set_options(gsh, label);
 
-       if (gsh->flags.framed_labels)
+       if ((gsh->bflags & GSH_FRAMED_LABELS) == GSH_FRAMED_LABELS)
        {
                GtkWidget *frame;
 

Index: gtkshell/main.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/main.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- gtkshell/main.c     1 Mar 2007 18:54:04 -0000       1.12
+++ gtkshell/main.c     2 Mar 2007 03:56:07 -0000       1.13
@@ -36,8 +36,8 @@
        g_debug("row:\t%d\n", gsh.rows.row);
 #endif                         /* DEBUG */
 
-       gsh.flags.dont_scroll = (((argc > 1) && (strlen(argv[1]) == 3))
-                && !strncmp(argv[1], "-os", 3)) ? FALSE : TRUE;
+       gsh.bflags |= (((argc > 1) && (strlen(argv[1]) == 3))
+                && !strncmp(argv[1], "-os", 3)) ? GSH_SCROLL : GSH_NONE;
 
        gsh_setup_containers(&gsh);
        gsh_parse_arguments(&gsh, argc, argv);

Index: gtkshell/option_options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/option_options.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- gtkshell/option_options.c   28 Feb 2007 03:53:51 -0000      1.11
+++ gtkshell/option_options.c   2 Mar 2007 03:56:07 -0000       1.12
@@ -30,13 +30,13 @@
        {
        case 'E':               /* Make a text entry simpley print the
                                 * text.  */
-               gsh->flags.prompt_echoes = TRUE;
+               gsh->bflags |= GSH_PROMPT_ECHOES;
                break;
        case 'e':
-               gsh->flags.button_exits = TRUE;
+               gsh->bflags |= GSH_CBEXIT;
                break;
        case 'f':
-               gsh->flags.framed_labels = TRUE;
+               gsh->bflags |= GSH_FRAMED_LABELS;
                break;
        case 'g':
                gsh_count(argc, counter);
@@ -48,7 +48,7 @@
 
                break;
        case 'h':
-               gsh->flags.horizontal_labels = TRUE;
+               gsh->bflags |= GSH_HORIZONTAL_LABELS;
                break;
        case 'n':
 

Index: gtkshell/text.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/text.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- gtkshell/text.c     28 Feb 2007 06:55:27 -0000      1.13
+++ gtkshell/text.c     2 Mar 2007 03:56:07 -0000       1.14
@@ -61,8 +61,9 @@
 gsh_text_area(struct GSH * gsh)
 {
        GtkWidget *text;
-/* FIXME: make scrollable, and word wrap at 80.  */
+
        text = gtk_text_view_new();
+       gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
        gsh_manage(gsh, text);
 
        return text;
@@ -72,17 +73,18 @@
 void
 gsh_text_editor(struct GSH * gsh, char *filename)
 {
-       GtkWidget *text;
+       GtkWidget *widget;
        GtkTextBuffer *buffer;
        GtkTextIter iter;
        size_t read;
        FILE *file;
-       char buf[BUFSIZ];
 
        ARPASSERT(gsh);
 
-       text = gsh_text_area(gsh);
-       buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text));
+       file=NULL;
+
+       widget = gsh_text_area(gsh);
+       buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(widget));
 
        ARPASSERT(filename);
 
@@ -90,19 +92,15 @@
 
        ARWIFNP(file)
        {
-               while ((read = fread(buf, sizeof(char), BUFSIZ, file)) != 0)
-               {
-                       /* @out */
-                       gtk_text_buffer_get_end_iter(buffer, &iter);
-                       gtk_text_buffer_insert(buffer, &iter, buf, (gint) read);
-               }
-
+               char *text;
+               text=antiright_read_file(file);
+               gtk_text_buffer_set_text(buffer, text, strlen(text));
                (void) fclose(file);
        }
 
        ARIFNP(gsh->geometry)
                asprintf(&gsh->geometry, "775x700");
 
-       gsh_widget_set_font_mono(text);
+       gsh_widget_set_font_mono(widget);
 
 }

Index: gtkshell/updated_options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/updated_options.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- gtkshell/updated_options.c  28 Feb 2007 03:53:51 -0000      1.8
+++ gtkshell/updated_options.c  2 Mar 2007 03:56:07 -0000       1.9
@@ -26,12 +26,12 @@
 gsh_test_updating(struct GSH * gsh)
 {
        ARPASSERT(gsh);
-
-       ARIFNB(gsh->flags.updating)
+       if((gsh->bflags & GSH_UPDATING) != GSH_UPDATING)
        {
                gsh_start_updates(gsh);
-               gsh->flags.updating = TRUE;
+               gsh->bflags |= GSH_UPDATING;
        }
+
 }
 
 static void

Index: libantiright/pipe.c
===================================================================
RCS file: /sources/antiright/antiright/libantiright/pipe.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- libantiright/pipe.c 28 Feb 2007 03:53:51 -0000      1.5
+++ libantiright/pipe.c 2 Mar 2007 03:56:07 -0000       1.6
@@ -23,50 +23,55 @@
 
 #include "library.h"
 
+/* FREE RETURNED STRING.  */
+gchar *
+antiright_read_file(FILE *file)
+{
+       gchar buffer[BUFSIZ];
+       gchar *text;
+       size_t total, read;
+       total=0;
+       read=0;
+       ar_asprintf(&text, "\0");
+       while((read = fread(buffer, sizeof(char), BUFSIZ, file)) != 0)
+       {
+               total += read;
+               text = (gchar *) realloc(text, total*sizeof(char));
+               ARPASSERT(text);
+               g_strlcat(text, buffer, total);
+       }
+       return text;
+}
+
 /* Make sure that you free the returned string.  */
 char *
 antiright_pipe_read(char *command_string)
 {
        /* Declare.  */
-
-       char *text_string;
-       char buffer[BUFSIZ];
+       char *text;
        FILE *pipe;
-       size_t read, total;
 
-       /* Initialize.  */
+       /* Check arguments.  */
+       ARPASSERT(command_string);
 
-       read = 0;
-       total = 0;
-       text_string = NULL;
+       /* Initialize.  */
+       text = NULL;
 
-       ARPASSERT(command_string);
 
        /* Execute the command indicated by command_string.  */
        /* Pipe is read-only.  Stdout will be directed to it.  */
        pipe = popen(command_string, "r");
-
        ARPASSERT(pipe);
-
-       ar_asprintf(&text_string, "\0");
-       /* Read the command's stdout.  */
-       while ((read = fread(buffer, sizeof(char), BUFSIZ, pipe)) != 0)
-       {
-               total += read;
-
-               text_string = (char *) realloc(text_string, total * 
sizeof(char));
-               ARPASSERT(text_string);
-
-               /* buffer[read-1]='\0'; */
-               snprintf(text_string, total, "%s%s", text_string, buffer);
-       }
-
+       text=antiright_read_file(pipe);
        /* Close the pipe once fgets() returns a false condition.  */
        (void) pclose(pipe);
 
-       return (text_string);
+       return (text);
 }
 
+
+
+
 /* void */
 /* antiright_pipe_write(char *command_string, char* data) */
 /* { */

Index: libantiright/pipe.h
===================================================================
RCS file: /sources/antiright/antiright/libantiright/pipe.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- libantiright/pipe.h 28 Feb 2007 03:53:51 -0000      1.3
+++ libantiright/pipe.h 2 Mar 2007 03:56:07 -0000       1.4
@@ -21,7 +21,10 @@
 #ifndef LIBAR_PIPE_H
 #define LIBAR_PIPE_H
 char *
-     antiright_pipe_read(char *command_string);
+antiright_pipe_read(char *command_string);
+
+gchar *
+antiright_read_file(FILE *file);
 
 /* void */
 /* antiright_pipe_write(char *command_string, char* data); */

Index: libantiright/util.h
===================================================================
RCS file: /sources/antiright/antiright/libantiright/util.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- libantiright/util.h 28 Feb 2007 03:53:51 -0000      1.5
+++ libantiright/util.h 2 Mar 2007 03:56:07 -0000       1.6
@@ -23,15 +23,26 @@
 #ifndef LIBAR_UTIL_H
 #define LIBAR_UTIL_H
 
+/* Decimal bitmasks for boolean storage.  */
+#define ARB_0 1
+#define ARB_1 2
+#define ARB_2 4
+#define ARB_3 8
+#define ARB_4 16
+#define ARB_5 32
+#define ARB_6 64
+#define ARB_7 128
+#define ARB_8 256
+
 gpointer
-         xmalloc(size_t size);
+xmalloc(size_t size);
 
 #define UNUSED(arg) { arg = arg; }
 
 void
-     rand_seed();
+rand_seed();
 
 int
-    rand_ranged(int start, int finish);
+rand_ranged(int start, int finish);
 
 #endif




reply via email to

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