[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Antiright-devel] antiright lib/form.c lib/form.h lib/frame.c lib...
From: |
Jeffrey Bedard |
Subject: |
[Antiright-devel] antiright lib/form.c lib/form.h lib/frame.c lib... |
Date: |
Fri, 21 Jan 2005 17:36:35 -0500 |
CVSROOT: /cvsroot/antiright
Module name: antiright
Branch:
Changes by: Jeffrey Bedard <address@hidden> 05/01/21 22:36:35
Modified files:
lib : form.c form.h frame.c frame.h help.c help.h
label.h library.c library.h util.c util.h
window.c window.h
src : ACE AR system.antiright
src/arshell : arguments.c clockload.c clockload.h
interface_file.c update.c
Log message:
Rearranged functions into more logical file separations. library.c is
now a place for new implementation.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/lib/form.c.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/lib/form.h.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/lib/frame.c.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/lib/frame.h.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/lib/help.c.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/lib/help.h.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/lib/label.h.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/lib/library.c.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/lib/library.h.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/lib/util.c.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/lib/util.h.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/lib/window.c.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/lib/window.h.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/ACE.diff?tr1=1.37&tr2=1.38&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/AR.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/system.antiright.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/arguments.c.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/clockload.c.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/clockload.h.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/interface_file.c.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/update.c.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
Patches:
Index: antiright/lib/form.c
diff -u antiright/lib/form.c:1.2 antiright/lib/form.c:1.3
--- antiright/lib/form.c:1.2 Sat Aug 7 17:13:41 2004
+++ antiright/lib/form.c Fri Jan 21 22:36:30 2005
@@ -1,6 +1,6 @@
/*
AntiRight
- (c) 2002-2004 Jeffrey Bedard
+ (c) 2002-2005 Jeffrey Bedard
address@hidden
This file is part of AntiRight.
Index: antiright/lib/form.h
diff -u antiright/lib/form.h:1.1 antiright/lib/form.h:1.2
--- antiright/lib/form.h:1.1 Thu Jul 8 18:58:04 2004
+++ antiright/lib/form.h Fri Jan 21 22:36:30 2005
@@ -1,6 +1,6 @@
/*
AntiRight
- (c) 2002-2004 Jeffrey Bedard
+ (c) 2002-2005 Jeffrey Bedard
address@hidden
This file is part of AntiRight.
Index: antiright/lib/frame.c
diff -u antiright/lib/frame.c:1.3 antiright/lib/frame.c:1.4
--- antiright/lib/frame.c:1.3 Thu Dec 16 23:55:47 2004
+++ antiright/lib/frame.c Fri Jan 21 22:36:30 2005
@@ -1,6 +1,6 @@
/*
AntiRight
- (c) 2002-2004 Jeffrey Bedard
+ (c) 2002-2005 Jeffrey Bedard
address@hidden
This file is part of AntiRight.
Index: antiright/lib/frame.h
diff -u antiright/lib/frame.h:1.1 antiright/lib/frame.h:1.2
--- antiright/lib/frame.h:1.1 Thu Jul 8 18:58:04 2004
+++ antiright/lib/frame.h Fri Jan 21 22:36:30 2005
@@ -1,6 +1,6 @@
/*
AntiRight
- (c) 2002-2004 Jeffrey Bedard
+ (c) 2002-2005 Jeffrey Bedard
address@hidden
This file is part of AntiRight.
Index: antiright/lib/help.c
diff -u antiright/lib/help.c:1.5 antiright/lib/help.c:1.6
--- antiright/lib/help.c:1.5 Sun Nov 21 21:45:47 2004
+++ antiright/lib/help.c Fri Jan 21 22:36:30 2005
@@ -1,6 +1,6 @@
/*
AntiRight
- (c) 2002-2004 Jeffrey Bedard
+ (c) 2002-2005 Jeffrey Bedard
address@hidden
This file is part of AntiRight.
Index: antiright/lib/help.h
diff -u antiright/lib/help.h:1.2 antiright/lib/help.h:1.3
--- antiright/lib/help.h:1.2 Sun Nov 21 21:48:49 2004
+++ antiright/lib/help.h Fri Jan 21 22:36:30 2005
@@ -1,6 +1,6 @@
/*
AntiRight
- (c) 2002-2004 Jeffrey Bedard
+ (c) 2002-2005 Jeffrey Bedard
address@hidden
This file is part of AntiRight.
Index: antiright/lib/label.h
diff -u antiright/lib/label.h:1.3 antiright/lib/label.h:1.4
--- antiright/lib/label.h:1.3 Mon Aug 16 17:27:05 2004
+++ antiright/lib/label.h Fri Jan 21 22:36:30 2005
@@ -1,6 +1,6 @@
/*
AntiRight
- (c) 2003-2004 Jeffrey Bedard
+ (c) 2003-2005 Jeffrey Bedard
address@hidden
This file is part of AntiRight.
Index: antiright/lib/library.c
diff -u antiright/lib/library.c:1.7 antiright/lib/library.c:1.8
--- antiright/lib/library.c:1.7 Sat Nov 6 22:52:12 2004
+++ antiright/lib/library.c Fri Jan 21 22:36:30 2005
@@ -1,6 +1,6 @@
/*
AntiRight
- (c) 2002-2004 Jeffrey Bedard
+ (c) 2002-2005 Jeffrey Bedard
address@hidden
This file is part of AntiRight.
@@ -24,99 +24,13 @@
#include "library.h"
-/* In theses callback declarations, cb stands for callback. */
-void
-antiright_close_cb(Widget widget,
- XtPointer client_data,
- XtPointer call_data)
-{
- XtUnmanageChild(widget);
- XtDestroyWidget(widget);
- call_data=NULL;
- client_data=NULL;
-}
-
-void
-antiright_command(Widget command_widget)
-{
- char *field_string=XmTextGetString(command_widget);
- antiright_system(field_string);
- XtFree(field_string);
-}
-
-void
-antiright_command_cb(Widget widget,
- XtPointer client_data,
- XtPointer call_data)
-{
- antiright_command((Widget)client_data);
- widget=NULL;
- call_data=NULL;
-}
-
-void
-antiright_exit_cb()
-{
- exit(0);
-}
-
-void
-antiright_system_cb(Widget widget,
- XtPointer client_data,
- XtPointer call_data)
-{
- antiright_system(client_data);
- widget=NULL;
- call_data=NULL;
-}
-
-void
-antiright_set(String name, XtArgVal value)
-{
- XtSetArg(antiright.arguments[antiright.arguments_int], name, value);
- antiright.arguments_int++;
-}
-
-/* Make sure that you free the returned string! */
-char*
-antiright_c_string(XmString motif_string)
-{
- char *c_string;
- XmStringGetLtoR(motif_string, XmSTRING_DEFAULT_CHARSET, &c_string);
- return(c_string);
-}
-XmString
-antiright_motif_string(char *string)
-{
- return(XmStringCreateLocalized(string));
-}
-void
-antiright_xmstring_resource(Widget widget, String name, char *string)
-{
- XmString motif_string=antiright_motif_string(string);
- XtVaSetValues(widget,
- name, motif_string,
- NULL);
- XmStringFree(motif_string);
-}
-void
-antiright_set_tooltip(Widget widget, char *tooltip_string)
-{
-#ifdef XmNtoolTipString
- antiright_xmstring_resource(widget, XmNtoolTipString, tooltip_string);
-#else
- widget=NULL;
- tooltip_string=NULL;
-#endif /* XmNtoolTipString */
-}
-
-void
-antiright_set_values(Widget widget)
-{
- XtSetValues(widget, antiright.arguments, antiright.arguments_int);
-}
-void
-antiright_get_values(Widget widget)
-{
- XtGetValues(widget, antiright.arguments, antiright.arguments_int);
-}
+/* This is a file in which newly implemented functionality is first
+ implemented. */
+
+
+
+
+
+
+
+
Index: antiright/lib/library.h
diff -u antiright/lib/library.h:1.11 antiright/lib/library.h:1.12
--- antiright/lib/library.h:1.11 Sun Nov 21 21:51:59 2004
+++ antiright/lib/library.h Fri Jan 21 22:36:30 2005
@@ -24,6 +24,14 @@
#define AR_LIBRARY_H
#include <Xm/XmAll.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <errno.h>
+#include <assert.h>
#include "button.h"
#include "drawing.h"
#include "edit.h"
@@ -39,12 +47,13 @@
#include "window.h"
#include "status.h"
#include "util.h"
-
-#ifdef HAVE_XMXPM
-#include <Xm/XpmP.h>
-#else
-#include <X11/xpm.h>
-#endif /* HAVE_XMXPM */
+#include "pixmap.h"
+#include "usage.h"
+#include "app.h"
+#include "resource.h"
+#include "string.h"
+#include "xmstring.h"
+#include "system.h"
#ifdef HAVE_XLT
#include <Xlt/Xlt.h>
@@ -81,66 +90,8 @@
/* This structure is used in all AntiRight programs. */
struct antiright_application_structure antiright;
-/* This is used to close and destroy dialogs. */
-void
-antiright_close_cb(Widget widget,
- XtPointer client_data,
- XtPointer call_data);
-
-/* This exits the program. */
-void
-antiright_exit_cb();
-
-/* This is used to execute a command. It will always be run in the
- background. */
-void
-antiright_system_cb(Widget widget,
- XtPointer client_data, /* This is the command to
- be executed. */
- XtPointer call_data);
-
-/* This is the means by which a command entered in a text field is
- executed by the shell. */
-void
-antiright_command(Widget command_widget);
-
-/* This is used as a callback for shell command text fields. */
-void
-antiright_command_cb(Widget widget,
- XtPointer client_data,
- XtPointer call_data);
-
-
-
-/* This sets a widget's value before creation. The resource
- arguments are stored in antiright_arguments. The number of
- arguments are stored in antiright_number_arguments. */
-void
-antiright_set(String name, /* This is the resource name. */
- XtArgVal value); /* This is the value of the resource.
- If it is a variable, it will have to
- be casted to XtArgVal. */
-
-/* This converts a Motif string into a C string. Make sure that you
- free the returned string when finished with XtFree(). */
-char*
-antiright_c_string(XmString motif_string);
-
-/* This sets the tooltip, if available, of WIDGET. */
-void
-antiright_set_tooltip(Widget widget, char *tooltip_string);
-
-/* This function sets the resource values of WIDGET to the ones
- contained in antiright.arguments. */
-void
-antiright_set_values(Widget widget);
-
-/* This gets the resource values of WIDGET. */
-void
-antiright_get_values(Widget widget);
-
/* This is a shortcut macro to clear antiright Xt arguments. AR is an
abreviation for AntiRight. CL is an abbreviation for CLear. ARG
is an abbreviation for ARGuments. */
@@ -160,8 +111,4 @@
fflush(stdout); \
}
-Widget
-antiright_widget(Widget parent, WidgetClass widget_class);
-
-
#endif /* AR_LIBRARY_H */
Index: antiright/lib/util.c
diff -u antiright/lib/util.c:1.6 antiright/lib/util.c:1.7
--- antiright/lib/util.c:1.6 Wed Dec 22 02:46:55 2004
+++ antiright/lib/util.c Fri Jan 21 22:36:30 2005
@@ -1,6 +1,6 @@
/*
AntiRight
- (c) 2002-2004 Jeffrey Bedard
+ (c) 2002-2005 Jeffrey Bedard
address@hidden
This file is part of AntiRight.
@@ -20,54 +20,18 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "util.h"
+#include "library.h"
void *
xmalloc(size_t size)
{
void *pointer;
pointer=malloc(size);
- assert(pointer != NULL);
+ assert(pointer != NULL); /* Ensure that the allocation was
+ successful. */
return(pointer);
}
-
-int
-antiright_system(char *field_string)
-{
- char *system_string;
- int system_return_value=0;
- extern int errno;
-
-
- if((field_string != NULL) & (strlen(field_string)>0))
- {
- if(field_string[strlen(field_string)-1] != '&')
- {
- asprintf(&system_string, "%s &", field_string);
- assert(system_string != NULL);
- system(system_string);
- free(system_string);
- }
- else /* The input command already includes an ampersand and will
- become a background operation. */
- {
- system(field_string);
- }
- return(system_return_value);
- }
- else if(errno==ENOENT)
- {
- perror("No such file or directory. ");
- return(-1);
- }
- else /* The user input is empty. */
- {
- perror("There was an error in executing the command. ");
- return(-1);
- }
-}
-
/* Make sure that you free the returned string. */
char*
antiright_pipe_read(char *command_string)
@@ -104,110 +68,39 @@
}
}
-/* Free the returned value! */
-char*
-antiright_beautified_label(char* current_argument_string)
+char *
+antiright_get_file_extension(char *filename)
{
- char *label_string=xmalloc(strlen(current_argument_string));
- int parse_counter;
- int label_counter;
-
- for(parse_counter=strlen(current_argument_string);
- current_argument_string[parse_counter]!=' ' && parse_counter>0;
- parse_counter--);
- for(label_counter=0;
- current_argument_string[parse_counter]!='\0';
- parse_counter++)
- {
- if(current_argument_string[parse_counter] == ' ')
- parse_counter++; /* This gets rid of an extra leading
- space. */
- if(current_argument_string[parse_counter] != '_')
- label_string[label_counter]=current_argument_string[parse_counter];
- else
- label_string[label_counter]=' ';
- label_counter++;
- }
- label_string[label_counter]='\0';
- return(label_string);
-}
+ char *extension=(char*)xmalloc(4);
+ unsigned int filename_length=strlen(filename);
+ unsigned int counter=filename_length-3;
+ unsigned int extension_counter=0;
-char*
-antiright_insert_string(char *text, char *insertion, unsigned int position)
-{
- /* Declare a counter for the output text. */
- unsigned int output_counter=0;
- /* Declare a counter for the initial text. */
- unsigned int text_counter=0;
- /* Declare a counter for the inserted text. */
- unsigned int insertion_counter=0;
- /* Store these lengths to avoid excessive function calls. */
- const unsigned int text_length=strlen(text);
- const unsigned int insertion_length=strlen(insertion);
- /* Allocate enough memory to hold both strings and a null
- character. */
- char *output=(char*)malloc(text_length+insertion_length+1);
- /* Put all text before insertion point into output buffer. */
- while(text_counter < position)
- {
- output[text_counter]=text[text_counter];
- text_counter++;
- }
- /* Start inserting at position. */
- output_counter=position;
- while(insertion_counter <= insertion_length)
- {
- output[output_counter]=insertion[insertion_counter];
- output_counter++;
- insertion_counter++;
- }
- /* Add the rest of the initial text to the output. */
- while(text_counter <= text_length)
+
+ while(counter < filename_length)
{
- output[output_counter]=text[text_counter];
- text_counter++;
- output_counter++;
+ extension[extension_counter]=filename[counter];
+ counter++;
+ extension_counter++;
}
- /* Set the end of the output to be null terminated. */
- output[output_counter]='\0';
- /* The function user must make sure that the returned string is
- freed after use. */
- return(output);
+ extension[extension_counter]='\0';
+ return(extension);
}
-char*
-antiright_delete_range(char *text, unsigned int start, unsigned int end)
+void
+antiright_exit_cb()
{
- /* Store the length of TEXT. */
- const unsigned int text_length=strlen(text);
- /* Create an output string large enough to hold TEXT. */
- char *output=(char*)malloc(text_length+1);
- /* Declare a counter for the text. */
- unsigned int text_counter=0;
- /* Declare a counter for the output. */
- unsigned int output_counter=0;
- /* Assign OUTPUT until START. */
- while(text_counter < start)
- {
- /* TEXT_COUNTER could be used but it is a clearer design to use
- OUTPUT_CONUTER for assignment to OUTPUT. */
- output[output_counter]=text[text_counter];
- output_counter++;
- text_counter++;
- }
- /* This sets the position at which assignment will once again start,
- removing all text between start and end through such. */
- text_counter=end+1;
- /* Start assignment from the character after END. */
- while(text_counter <= text_length)
- {
- output[output_counter]=text[text_counter];
- text_counter++;
- output_counter++;
- }
- /* Set the end of the output to be null terminated. */
- output[output_counter]='\0';
- /* The function user must make sure that the returned string is
- freed after use. */
- return(output);
+ exit(0);
}
+
+void
+antiright_close_cb(Widget widget,
+ XtPointer client_data,
+ XtPointer call_data)
+{
+ XtUnmanageChild(widget);
+ XtDestroyWidget(widget);
+ call_data=NULL;
+ client_data=NULL;
+}
+
Index: antiright/lib/util.h
diff -u antiright/lib/util.h:1.2 antiright/lib/util.h:1.3
--- antiright/lib/util.h:1.2 Wed Dec 22 02:46:55 2004
+++ antiright/lib/util.h Fri Jan 21 22:36:30 2005
@@ -23,15 +23,6 @@
#ifndef AR_UTIL_H
#define AR_UTIL_H
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <errno.h>
-#include <assert.h>
-
/* This is a function that launches a command and returns the output.
Make sure that you free the returned string when finished. */
char*
@@ -51,12 +42,17 @@
void *
xmalloc(size_t size);
-int
-antiright_system(char *field_string);
+char *
+antiright_get_file_extension(char *filename);
-/* Free the returned value! */
-char*
-antiright_beautified_label(char* current_argument_string);
+/* This exits the program. */
+void
+antiright_exit_cb();
+/* This is used to close and destroy dialogs. */
+void
+antiright_close_cb(Widget widget,
+ XtPointer client_data,
+ XtPointer call_data);
#endif /* AR_UTIL_H */
Index: antiright/lib/window.c
diff -u antiright/lib/window.c:1.7 antiright/lib/window.c:1.8
--- antiright/lib/window.c:1.7 Mon Nov 1 21:52:41 2004
+++ antiright/lib/window.c Fri Jan 21 22:36:30 2005
@@ -1,6 +1,6 @@
/*
AntiRight
- (c) 2002-2004 Jeffrey Bedard
+ (c) 2002-2005 Jeffrey Bedard
address@hidden
This file is part of AntiRight.
@@ -38,179 +38,3 @@
antiright_set_widget_title(antiright.parent_widget, name);
}
-Pixmap
-antiright_file_to_bitmap(char *filename)
-{
- Pixmap bitmap;
- int width, height, x_hot, y_hot;
- XReadBitmapFile(antiright.display, antiright.root_window, filename,
- &width, &height, &bitmap, &x_hot, &y_hot);
- return(bitmap);
-}
-
-char *
-antiright_get_file_extension(char *filename)
-{
- char *extension=(char*)xmalloc(4);
- unsigned int filename_length=strlen(filename);
- unsigned int counter=filename_length-3;
- unsigned int extension_counter=0;
-
-
- while(counter < filename_length)
- {
- extension[extension_counter]=filename[counter];
- counter++;
- extension_counter++;
- }
- extension[extension_counter]='\0';
- return(extension);
-}
-
-XpmColorSymbol *
-antiright_setup_color_symbol(Widget widget)
-{
- Pixel background;
- XpmColorSymbol *symbol=xmalloc(sizeof(XpmColorSymbol));
- XtVaGetValues(widget, XmNbackground, &background, NULL);
- symbol->name=NULL;
- symbol->value="none";
- symbol->pixel=background;
- return(symbol);
-}
-
-
-XpmAttributes
-antiright_setup_pixmap_attributes_for_widget(Widget widget)
-{
- XpmAttributes attributes;
-
- attributes.colorsymbols=antiright_setup_color_symbol(widget);
- attributes.numsymbols=1;
- attributes.valuemask=XpmColorSymbols;
-
- return(attributes);
-}
-void
-antiright_free_pixmap_attributes(XpmAttributes *attributes)
-{
- free(attributes->colorsymbols);
-}
-
-void
-antiright_set_widget_pixmaps(Widget label, Pixmap bitmap)
-{
- XtVaSetValues(label,
- XmNlabelType, XmPIXMAP,
- XmNlabelPixmap, bitmap,
- XmNiconPixmap, bitmap,
- NULL);
-#ifdef XmNpixmap
- XtVaSetValues(label, XmNpixmap, bitmap, NULL);
-#endif /* XmNpixmap */
-}
-void
-antiright_set_pixmap_from_data(Widget widget, char **data)
-{
- Pixmap bitmap;
- XpmAttributes attributes;
- attributes=antiright_setup_pixmap_attributes_for_widget(widget);
- XpmCreatePixmapFromData(antiright.display, antiright.root_window,
- data, &bitmap, NULL, &attributes);
- antiright_free_pixmap_attributes(&attributes);
- antiright_set_widget_pixmaps(widget, bitmap);
-}
-
-void
-antiright_set_bitmap_from_file(Widget label, char* filename)
-{
- Pixmap bitmap;
- char *extension=antiright_get_file_extension(filename);
-
- if(!strncmp(extension, "xpm", 3)) /* File is a pixmap. */
- {
- XpmAttributes attributes;
- attributes=antiright_setup_pixmap_attributes_for_widget(label);
- XpmReadFileToPixmap(antiright.display, antiright.root_window,
- filename, &bitmap, NULL, &attributes);
- antiright_free_pixmap_attributes(&attributes);
- }
- else /* File is a bitmap. */
- {
- bitmap=antiright_file_to_bitmap(filename);
- }
- free(extension);
- antiright_set_widget_pixmaps(label, bitmap);
-}
-
-void
-antiright_print_license_and_description()
-{
- puts( "AntiRight Desktop Environment");
- puts("Copyright 2002-2004, Jeffrey Bedard");
- puts("AntiRight is a lightweight dekstop environment.");
- puts("It is distributed under the GNU General Public License.");
- puts("There is NO WARRANTY. Please see COPYING for details.");
-}
-
-void
-antiright_print_command_line_options()
-{
- puts("Command Line Options:");
- puts("\t[-display display]");
- puts("\t[-geometry geometry]");
- puts("\t[-bg color], [-background color]");
- puts("\t[-fg color], [-foreground color]");
- puts("\t[-iconic]");
- puts("\t[-synchronous]");
- puts("\t[-title string]");
- puts("\t[-xrm string]");
-}
-
-
-void
-antiright_standard_usage(char *name_string)
-{
- antiright_print_license_and_description();
- printf("Usage: %s [OPTION]\n", name_string);
- fflush(stdout);
- antiright_print_command_line_options();
-}
-void
-antiright_report_bugs_message()
-{
- puts("Report bugs to <address@hidden>");
-}
-
-void
-antiright_setup_xt(int* argc, char **argv)
-{
- /* Set up Xt. */
- antiright.parent_widget=XtVaAppInitialize(&antiright.app_context,
- "AntiRight",
- NULL, 0, argc, argv, NULL, NULL);
-}
-
-void
-antiright_initialize_antiright_data()
-{
- antiright.display=XtDisplay(antiright.parent_widget);
- antiright.screen=DefaultScreen(antiright.display);
- antiright.root_window=RootWindow(antiright.display, antiright.screen);
-}
-
-/* Handle arguments and set up parent_widget. The character string
- name contains the string to which the icon and window title will be
- set. The array bits contains the icon data for the application
- icon. */
-void
-antiright_initialize_application(int* argc,
- char** argv,
- const char* name)
-{
- antiright_setup_xt(argc, argv);
- antiright_initialize_antiright_data();
- antiright_set_title(name);
- antiright_system("ACE -c &");
-}
-
Index: antiright/lib/window.h
diff -u antiright/lib/window.h:1.3 antiright/lib/window.h:1.4
--- antiright/lib/window.h:1.3 Mon Aug 16 17:27:05 2004
+++ antiright/lib/window.h Fri Jan 21 22:36:30 2005
@@ -32,27 +32,4 @@
void
antiright_set_title(const char* name); /* This is the title text. */
-/* This sets the icon of antiright_parent_widget. */
-void
-antiright_set_icon(unsigned char bits[]);
-
-/* This sets up the application and handles the command line. */
-void
-antiright_initialize_application(int* argc,
- char **argv,
- const char *name); /* The
- application's
- title. */
- void
-antiright_standard_usage(char *name_string);
-
-void
-antiright_set_bitmap_from_file(Widget label, char* filename);
-void
-antiright_set_icon_pixmap(char **data);
-void
-antiright_set_pixmap_from_data(Widget widget, char **data);
-void
-antiright_report_bugs_message();
-
#endif /* AR_WINDOW_H */
Index: antiright/src/ACE
diff -u antiright/src/ACE:1.37 antiright/src/ACE:1.38
--- antiright/src/ACE:1.37 Tue Jan 18 22:36:06 2005
+++ antiright/src/ACE Fri Jan 21 22:36:35 2005
@@ -3,7 +3,7 @@
###############################################################################
#
# AntiRight
-# (c) 2002-2004 Jeffrey Bedard
+# (c) 2002-2005 Jeffrey Bedard
# address@hidden
#
# This file is part of AntiRight.
Index: antiright/src/AR
diff -u antiright/src/AR:1.6 antiright/src/AR:1.7
--- antiright/src/AR:1.6 Thu Dec 16 23:55:47 2004
+++ antiright/src/AR Fri Jan 21 22:36:35 2005
@@ -29,7 +29,7 @@
# This is a rich, dark red.
#xsetroot -solid red4 &
# This is a soothing blue-grey.
-xsetroot -solid slategrey &
+xsetroot -solid darkgrey &
# Ensure that the AntiRight configuration file exists.
ACE -c
# Ensure that startup file exists.
@@ -44,11 +44,13 @@
if [ "$WINDOWMANAGER" != "" ]; then
exec $WINDOWMANAGER
else
- if [ -f /usr/X11R6/bin/mwm ] || [ -f /usr/local/bin/mwm ]; then
- exec mwm
- else
- exec twm
- fi
+ local windowmanagers=/usr/X11R6/bin/mwm /usr/local/bin/mwm\
+ /usr/bin/mwm /usr/X11R6/bin/twm
+ for windowmanager in $windowmanagers; do
+ if [ -f $windowmanager ]; then
+ exec $windowmanager
+ fi
+ done
fi
Index: antiright/src/arshell/arguments.c
diff -u antiright/src/arshell/arguments.c:1.15
antiright/src/arshell/arguments.c:1.16
--- antiright/src/arshell/arguments.c:1.15 Wed Dec 22 02:46:55 2004
+++ antiright/src/arshell/arguments.c Fri Jan 21 22:36:35 2005
@@ -81,7 +81,7 @@
arshell_handle_long_options(int *counter_int, char **argv)
{
int length=strlen(argv[(*counter_int)]), counter;
- char *option=(char*)malloc(length-1);
+ char *option=(char*)xmalloc(length-1);
for(counter=2; counter <= length; counter++)
{
option[counter-2]=argv[(*counter_int)][counter];
Index: antiright/src/arshell/clockload.c
diff -u antiright/src/arshell/clockload.c:1.1
antiright/src/arshell/clockload.c:1.2
--- antiright/src/arshell/clockload.c:1.1 Wed Dec 22 02:23:38 2004
+++ antiright/src/arshell/clockload.c Fri Jan 21 22:36:35 2005
@@ -30,15 +30,10 @@
ARCLARG;
clockload_form=antiright_form(parent);
ARCLARG;
- antiright_form_positions(0, 100, 0, 85);
+ antiright_form_positions(0, 100, 0, 100);
antiright_set(XmNalignment, XmALIGNMENT_CENTER);
arshell.gui.clockload.clockload=antiright_label(clockload_form, NULL);
arshell_add_updater(arshell.gui.clockload.clockload, "");
- ARCLARG;
- antiright_form_positions(0, 100, 85, 100);
- arshell.gui.clockload.mailuser=antiright_label(clockload_form, NULL);
- ARCLARG;
- arshell_add_updater(arshell.gui.clockload.mailuser, "");
arshell_update();
return(clockload_form);
}
Index: antiright/src/arshell/clockload.h
diff -u antiright/src/arshell/clockload.h:1.1
antiright/src/arshell/clockload.h:1.2
--- antiright/src/arshell/clockload.h:1.1 Wed Dec 29 02:43:54 2004
+++ antiright/src/arshell/clockload.h Fri Jan 21 22:36:35 2005
@@ -26,7 +26,6 @@
struct arshell_clockload_struct
{
Widget clockload;
- Widget mailuser;
};
Index: antiright/src/arshell/interface_file.c
diff -u antiright/src/arshell/interface_file.c:1.3
antiright/src/arshell/interface_file.c:1.4
--- antiright/src/arshell/interface_file.c:1.3 Sat Nov 6 22:52:12 2004
+++ antiright/src/arshell/interface_file.c Fri Jan 21 22:36:35 2005
@@ -23,6 +23,7 @@
#include "arshell.h"
#ifdef HAVE_YACLIB
#include <yaclib/yaclib.h>
+
void
arshell_interface_system_cb(Widget widget, XtPointer client_data,
XtPointer call_data)
@@ -133,7 +134,7 @@
arshell_parse_interface_file(char *filename)
{
/* char *a="one", *b="two", *c="three";*/
- yacl_list *grammar=(yacl_list *)malloc(sizeof(yacl_list));
+ yacl_list *grammar=(yacl_list *)xmalloc(sizeof(yacl_list));
struct yaclib_parse_rule rule;
L_INIT_PTR(grammar);
Index: antiright/src/arshell/update.c
diff -u antiright/src/arshell/update.c:1.4 antiright/src/arshell/update.c:1.5
--- antiright/src/arshell/update.c:1.4 Wed Dec 22 02:22:43 2004
+++ antiright/src/arshell/update.c Fri Jan 21 22:36:35 2005
@@ -38,50 +38,30 @@
char *time_string;
time_t time_date;
double load[3];
-
- getloadavg(load, 3);
- (void)time(&time_date);
- time_string=ctime(&time_date);
- time_string[strlen(time_string)-1]=' ';
- asprintf(&clockload_label_string, " %s %d%%", time_string,
- (int)(load[1]*100));
- antiright_label_string(iterator->widget, clockload_label_string);
- free(clockload_label_string);
-
- }
- else if(iterator->widget == arshell.gui.clockload.mailuser)
- {
char *user=getenv("USER");
char *maildir="/var/mail";
char *mailfile;
- Boolean have_mail;
struct stat mailfile_stat;
-
- asprintf(&mailfile, "%s/%s", maildir, user);
+ char *mail_string;
+ asprintf(&mailfile, "%s/%s", maildir, user);
stat(mailfile, &mailfile_stat);
free(mailfile);
- fflush(stdout);
- if(mailfile_stat.st_size > 0)
- have_mail=True;
- else
- have_mail=False;
-
- if(have_mail)
- {
- char *icon;
- asprintf(&icon, "%s/havemail.xbm", (char*)ICONDIR);
- antiright_set_bitmap_from_file(iterator->widget, icon);
- free(icon);
- }
+ if(mailfile_stat.st_size > 0)
+ mail_string="Mail";
else
- {
- ARCLARG;
- antiright_set(XmNlabelType, XmSTRING);
- antiright_set_values(iterator->widget);
- antiright_label_string(iterator->widget, "");
- }
+ mail_string="";
+
+ getloadavg(load, 3);
+ (void)time(&time_date);
+ time_string=ctime(&time_date);
+ time_string[strlen(time_string)-1]=' ';
+ asprintf(&clockload_label_string, " %s %d%% %s", time_string,
+ (int)(load[1]*100), mail_string);
+ /* free(time_string); */
+ antiright_label_string(iterator->widget, clockload_label_string);
+ free(clockload_label_string);
}
else if(XmIsLabel(iterator->widget))
Index: antiright/src/system.antiright
diff -u antiright/src/system.antiright:1.5 antiright/src/system.antiright:1.6
--- antiright/src/system.antiright:1.5 Sat Dec 25 00:50:49 2004
+++ antiright/src/system.antiright Fri Jan 21 22:36:35 2005
@@ -68,7 +68,7 @@
Stop_CD: arcd -s
# This is the administration panel configuration.
Fix_File_Permissions: ACE -A Fix_File_Permissions
-Root_Shell: ACE -A Root_Shell
+Root_Shell: xterm -e su
See_All_Processes: ACE -A See_All_Processes
See_All_Users: ACE -A See_All_Users
See_Disk_Info: ACE -A See_Disk_Info
@@ -81,11 +81,11 @@
Show_All_File_Systems: ACE -A Show_All_File_Systems
# This is the network panel configuration
Open_Display: ACE -A Open_Display
-FTP: ACE -A FTP
-Telnet: ACE -A Telnet
-SSH: ACE -A SSH
-SFTP: ACE -A SFTP
-Open_URL: ACE -A Open_URL
+FTP: ACE -A ACE_peer_operation ftp
+Telnet: ACE -A ACE_peer_operation telnet
+SSH: ACE -A ACE_peer_operation ssh
+SFTP: ACE -A ACE_peer_operation sftp
+Open_URL: ACE -L Open_URL xterm -e lynx
# Themes
Reset_Theme: ACE -A Reset_Theme
theme_New_Years:black violet 1
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Antiright-devel] antiright lib/form.c lib/form.h lib/frame.c lib...,
Jeffrey Bedard <=