antiright-devel
[Top][All Lists]
Advanced

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

[Antiright-devel] antiright lib/menubar.c lib/pipe.c src/ACE src/...


From: Jeffrey Bedard
Subject: [Antiright-devel] antiright lib/menubar.c lib/pipe.c src/ACE src/...
Date: Sun, 16 Apr 2006 23:20:48 +0000

CVSROOT:        /sources/antiright
Module name:    antiright
Branch:         
Changes by:     Jeffrey Bedard <address@hidden> 06/04/16 23:20:48

Modified files:
        lib            : menubar.c pipe.c 
        src            : ACE system.antiright 
        src/arshell    : arshell.c main.c update.c 

Log message:
        Fixed a major memory leak.
        Removed references to manual pages that are no longer used.
        Added Dashboard() to ACE.
        Added geometry specifications to all of ACE's invocations
        of arshell which use the work area.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/antiright/lib/menubar.c.diff?tr1=1.18&tr2=1.19&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/antiright/antiright/lib/pipe.c.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/antiright/antiright/src/ACE.diff?tr1=1.72&tr2=1.73&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/antiright/antiright/src/system.antiright.diff?tr1=1.18&tr2=1.19&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/antiright/antiright/src/arshell/arshell.c.diff?tr1=1.19&tr2=1.20&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/antiright/antiright/src/arshell/main.c.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/antiright/antiright/src/arshell/update.c.diff?tr1=1.11&tr2=1.12&r1=text&r2=text

Patches:
Index: antiright/lib/menubar.c
diff -u antiright/lib/menubar.c:1.18 antiright/lib/menubar.c:1.19
--- antiright/lib/menubar.c:1.18        Wed Mar 29 02:09:23 2006
+++ antiright/lib/menubar.c     Sun Apr 16 23:20:48 2006
@@ -73,7 +73,7 @@
 {
   char* command_string;  
   asprintf(&command_string,
-          "ARO %s/share/doc/antiright/%s &",
+          "ACE -A ARO %s/share/doc/antiright/%s &",
           PREFIX,
           file_string);
   return(command_string);
@@ -154,8 +154,6 @@
   Widget submenu_widget;
   submenu_widget=antiright_menu(help_widget, "Manual");
   antiright_manual_button(submenu_widget, "ACE");
-  antiright_manual_button(submenu_widget, "AR");
-  antiright_manual_button(submenu_widget, "ARO");
   antiright_manual_button(submenu_widget, "arshell");
   ARCLARG;
   antiright_set(XmNmnemonic, 's');
Index: antiright/lib/pipe.c
diff -u antiright/lib/pipe.c:1.5 antiright/lib/pipe.c:1.6
--- antiright/lib/pipe.c:1.5    Sat Apr 15 02:47:13 2006
+++ antiright/lib/pipe.c        Sun Apr 16 23:20:48 2006
@@ -67,7 +67,7 @@
   FILE *fifo_fp;
   FILE *pipe_fp=popen(command_string, "w");
   char buffer[80];
-  while(1)
+  while(True)
     {
       fifo_fp=fopen(fifo, "r");
       fgets(buffer, 80, fifo_fp);
@@ -75,3 +75,5 @@
       fclose(fifo_fp);
     }
 }
+
+
Index: antiright/src/ACE
diff -u antiright/src/ACE:1.72 antiright/src/ACE:1.73
--- antiright/src/ACE:1.72      Sat Apr 15 02:47:13 2006
+++ antiright/src/ACE   Sun Apr 16 23:20:48 2006
@@ -15,6 +15,7 @@
 #     received a copy of the GNU General Public License along with
 #     AntiRight; if not, write to the Free Software Foundation, Inc.,
 #     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
 DEBUG=0
 if [ "$DEBUG" = "1" ]; then
        COUNTER=$(($COUNTER+1))
@@ -57,7 +58,7 @@
 }
 ACE_record_titles()
 {
-    awk -F : 'NF > 0 {if ($0 !~ /#/){print $1}}' ~/.antiright\
+    $AWK -F : 'NF > 0 {if ($0 !~ /#/){print $1}}' ~/.antiright\
        | sort | uniq | tr '\n' ' '
 }
 ACE_read_configuration_value()
@@ -84,9 +85,10 @@
                exec mwm
        fi
 }
+
 ARO()
 {
-       TMP=${TMPDIR:-/tmp}/ARO.$$
+       TMP=/tmp/ARO.$$
        if [ $# -gt 0 ]; then
                file $1 > $TMP
                if grep script $TMP; then
@@ -132,8 +134,7 @@
                arshell -Al 'No arguments were specified.'\
                -E 'echo Close'
        fi
-
-       trap "rm $TMP* 2>/dev/null" 0   
+       rm -f $TMP
 }
 Read_Man_Page()
 {
@@ -183,7 +184,7 @@
 Deb_Search()
 {
     keywords="$(arshell -At Keywords: | cut -d: -f2)"
-    apt-cache search $keywords | arshell -p
+    apt-cache search $keywords | arshell -p -geometry 550x400
 }
 Deb_Install()
 {
@@ -193,14 +194,14 @@
 Deb_Show()
 {
     package="$(arshell -At Package: | cut -d: -f2)"
-    apt-cache show $package | arshell -p
+    apt-cache show $package | arshell -p -geometry 550x400
 }
 Debian_Panel()
 {
     $ARSHELL -Am\
        -r 4\
        'ACE -A Deb_Search'\
-       'dpkg -l | arshell -p # List_All_Packages'\
+       'dpkg -l | arshell -p -geometry 550x400 # List_All_Packages'\
        'ACE -A Deb_Install'\
        'ACE -A Deb_Show'
 }
@@ -322,7 +323,7 @@
        if [ "$file_b" = "" ]; then
                exit
        fi
-       diff $file_a $file_b | arshell -Aw -p &
+       diff $file_a $file_b | arshell -p -geometry 550x400 &
 }
 Files()
 {
@@ -353,6 +354,7 @@
 }
 Settings()
 {
+       # Ensure the existance of a configuration file.
     ACE_Check_Configuration_File
     TMP=${TMPDIR:-/tmp}/ACE.$$
     echo "$ARSHELL -W Settings -Am -r 8"\\ > $TMP
@@ -398,7 +400,21 @@
 {
     $ARSHELL -Uf 5000 -UL 'vmstat' -xrm '*fontList: fixed'
 }
-
+# This is the panel that I use for mwm.
+# Things do-able from mwm, like launching apps, are not duplicated.
+Dashboard()
+{
+       arshell -Uf 3000 -Ac\
+               -xrm '*overrideRedirect: True'\
+               -xrm '*background: black'\
+               -xrm '*foreground: red3'\
+               -xrm '*fontList: -*-lucidatypewriter-*-*-*-*-12-*-*-*-*-*-*-*'\
+               -UL 'tail -n 4 /var/log/messages'\
+               -UL 'tail -n 4 /var/log/ipmon'\
+               -UL 'tail -n 4 /var/log/ppplog'\
+               -UL 'pppstats'\
+               -geometry 1600x320+0+0 1> /dev/null 2> /dev/null
+}
 Alarm()
 {
     local alarm_time="$($ARSHELL -W Alarm -ADp 'Time (ex 22:40):')"
@@ -462,7 +478,7 @@
 }
 Run_SAR()
 {
-       sar | arshell -Aw -p -W System_Accounting \
+       sar | arshell -p -geometry 550x400 -W System_Accounting \
                -xrm '*XmText.fontList: fixed'
 }
 System_Accounting()
@@ -479,28 +495,28 @@
 }
 See_All_Processes()
 {
-    ps xau | $ARSHELL -W 'All Processes' -Am -Aw -p\
+    ps xau | $ARSHELL -W 'All Processes' -Am -Aw -p -geometry 550x400\
        -xrm "*work.fontList: fixed"
 }
 See_All_Users()
 {
     who        | $ARSHELL -Am -W 'Users' -Aw -p\
-       -xrm "*work.fontList: fixed"
+       -xrm "*work.fontList: fixed" -geometry 550x400 
 }
 See_Disk_Info()
 {
     df | $ARSHELL -Am -W 'Disk Info' -Aw -p\
-       -xrm "*work.fontList: fixed"
+       -xrm "*work.fontList: fixed" -geometry 550x400 
 }
 See_Open_Ports()
 {
     nmap 127.0.0.1 | $ARSHELL -Am -W 'Network Ports' -Aw -p\
-       -xrm "*work.fontList: fixed"
+       -xrm "*work.fontList: fixed" -geometry 550x400 
 }
 See_User_Processes()
 {
     ps u | $ARSHELL -Am -W 'User Processes' -Aw -p\
-       -xrm "*work.fontList: fixed"
+       -xrm "*work.fontList: fixed" -geometry 550x400 
 }
 rgb_background()
 {
@@ -531,26 +547,32 @@
 See_Free_Space()
 {
     df | $ARSHELL -Am -W 'Disk Space' -Aw -p\
-       -xrm "*work.fontList: fixed"
+       -xrm "*work.fontList: fixed" -geometry 550x400 
 }
 Show_All_File_Systems()
 {
     cat /etc/fstab | $ARSHELL -W 'File System Table' -Am -Aw -p\
-       -xrm "*work.fontList: fixed"
+       -xrm "*work.fontList: fixed" -geometry 550x400 
+}
+texted_base()
+{
+       $ARSHELL -Am -Aw -As -geometry 550x400 -xrm '*XmText.fontList: fixed' $@
 }
 Text_Editor()
 {
     local file
 
+
     if [ -z "$1" ]; then
-       $ARSHELL -Am -Aw -As
+       texted_base
     else
        file=$1
+
        if [ ! -f $file ]; then
            touch $file
        fi
-       cat $file | $ARSHELL -Am -Aw -As -p -W $file\
-       -xrm "*work.fontList: fixed"
+
+       cat $file | texted_base -p -W $file
     fi
 }
 Manual_Page()
@@ -587,7 +609,7 @@
 SysV_Init()
 {
     local service=$(ls /etc/init.d | grep -v '.d' | $ARSHELL -Am\
-       -Aw -p -At Modify: | cut -d : -f 2)
+       -Aw -p -geometry 550x400 -At Modify: | cut -d : -f 2)
     if [ "$service" != "" ] && [ "$service" != "Dismiss" ]; then
        SysV_Service $service &
        SysV_Init &
@@ -656,3 +678,6 @@
     ACE_Panel
 fi
 
+
+
+
Index: antiright/src/arshell/arshell.c
diff -u antiright/src/arshell/arshell.c:1.19 
antiright/src/arshell/arshell.c:1.20
--- antiright/src/arshell/arshell.c:1.19        Mon Mar 27 00:33:02 2006
+++ antiright/src/arshell/arshell.c     Sun Apr 16 23:20:48 2006
@@ -102,12 +102,14 @@
  
         antiright_button (menu, "Terminal", antiright_system_cb, 
                "ACE Terminal");
-        antiright_separator (menu);
-        antiright_button (menu, "Restart",
-                antiright_system_cb, "ACE -A restart_desktop");
-        antiright_button (menu, "Quit Desktop",
-                antiright_system_cb, "ACE -A killdesk");
-        antiright_button (menu, "Logout", antiright_system_cb, "ACE -A 
killwm");
+        antiright_button (menu, "ACE Panel", antiright_system_cb,
+               "ACE -A Panel");
+       antiright_button (menu, "Browser", antiright_system_cb,
+               "ACE Browser");
+       antiright_button(menu, "Text Editor", antiright_system_cb,
+               "ACE Text_Editor");
+       antiright_separator(menu);
+       antiright_button(menu, "Exit", antiright_exit_cb, NULL);
 }
 
 void
@@ -186,3 +188,5 @@
     }
 }
 
+
+
Index: antiright/src/arshell/main.c
diff -u antiright/src/arshell/main.c:1.9 antiright/src/arshell/main.c:1.10
--- antiright/src/arshell/main.c:1.9    Sun Jul 31 16:19:50 2005
+++ antiright/src/arshell/main.c        Sun Apr 16 23:20:48 2006
@@ -1,6 +1,6 @@
 /*
   AntiRight
-  (c) 2003-2005 Jeffrey Bedard
+  (c) 2003-2006 Jeffrey Bedard
   address@hidden
    
   This file is part of AntiRight.
@@ -26,16 +26,21 @@
 int
 main (int argc, char **argv)
 {
-  antiright_initialize_application (&argc, argv, "AntiRight");
-  antiright_set_pixmap_from_data (antiright.parent_widget, antiright_xpm);
-  arshell_setup_mainwindow ();
-  arshell_setup_work_row ();
-  arshell_initialize_application_data ();
+       antiright_initialize_application (&argc, argv, "AntiRight");
 
-  arshell_handle_command_line_arguments (&argc, argv);
+       antiright_set_pixmap_from_data (antiright.parent_widget, antiright_xpm);
 
-  arshell_layout_mainwindow ();
+       arshell_setup_mainwindow ();
+       arshell_setup_work_row ();
 
-  arshell_start_event_loop ();
-  return (0);
+       arshell_initialize_application_data ();
+
+       arshell_handle_command_line_arguments (&argc, argv);
+
+       arshell_layout_mainwindow ();
+
+       arshell_start_event_loop ();
+
+       return (0);
 }
+
Index: antiright/src/arshell/update.c
diff -u antiright/src/arshell/update.c:1.11 antiright/src/arshell/update.c:1.12
--- antiright/src/arshell/update.c:1.11 Sat Apr 15 02:47:13 2006
+++ antiright/src/arshell/update.c      Sun Apr 16 23:20:48 2006
@@ -92,16 +92,10 @@
 arshell_update_label(struct arshell_update_struct **iterator)
 {
        char *input_string;
-       char *label_string;
-       unsigned int size;
 
        input_string = antiright_pipe_read ((*iterator)->command_string);
-       size=strlen(input_string);
-       label_string=(char*)malloc(sizeof(char)*(size+1));
-       strncpy(label_string, input_string, size);
+       antiright_label_string ((*iterator)->widget, input_string);
        free(input_string);
-       antiright_label_string ((*iterator)->widget, label_string);
-       free(label_string);
 }
 
 void
Index: antiright/src/system.antiright
diff -u antiright/src/system.antiright:1.18 antiright/src/system.antiright:1.19
--- antiright/src/system.antiright:1.18 Sat Apr 15 02:47:13 2006
+++ antiright/src/system.antiright      Sun Apr 16 23:20:48 2006
@@ -71,3 +71,4 @@
 mp3_dir:~/archive/music
 Manual_Root:echo /usr/share/man
 Lock_Display:xscreensaver-command -lock
+Lock_Display:xlock -mode blank




reply via email to

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