[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Antiright-devel] antiright/src/arshell appendage.c appendage.h a...
From: |
Jeffrey Bedard |
Subject: |
[Antiright-devel] antiright/src/arshell appendage.c appendage.h a... |
Date: |
Sun, 31 Jul 2005 12:19:50 -0400 |
CVSROOT: /cvsroot/antiright
Module name: antiright
Branch:
Changes by: Jeffrey Bedard <address@hidden> 05/07/31 16:19:50
Modified files:
src/arshell : appendage.c appendage.h arguments.c arguments.h
arshell-util.c arshell-util.h arshell.c
arshell.h clockload.c clockload.h color.c
color.h dialog.c dialog.h file.c file.h
interface_file.h layout.c layout.h main.c
main.h menubar.c menubar.h pixmap.c pixmap.h
search.c search.h textedit.c textedit.h
update.c update.h
Log message:
Reindented.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/appendage.c.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/appendage.h.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.23&tr2=1.24&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/arguments.h.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/arshell-util.c.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/arshell-util.h.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/arshell.c.diff?tr1=1.16&tr2=1.17&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/arshell.h.diff?tr1=1.20&tr2=1.21&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/clockload.c.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/clockload.h.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/color.c.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/color.h.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/dialog.c.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/dialog.h.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/file.c.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/file.h.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/interface_file.h.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/layout.c.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/layout.h.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/main.c.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/main.h.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/menubar.c.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/menubar.h.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/pixmap.c.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/pixmap.h.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/search.c.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/search.h.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/textedit.c.diff?tr1=1.21&tr2=1.22&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/textedit.h.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/update.c.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/antiright/antiright/src/arshell/update.h.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
Patches:
Index: antiright/src/arshell/appendage.c
diff -u antiright/src/arshell/appendage.c:1.6
antiright/src/arshell/appendage.c:1.7
--- antiright/src/arshell/appendage.c:1.6 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/appendage.c Sun Jul 31 16:19:50 2005
@@ -23,67 +23,67 @@
#include "arshell.h"
Widget
-arshell_add_appendage(Widget container)
+arshell_add_appendage (Widget container)
{
char *command;
Widget button;
- command=antiright_pipe_read("arshell -ADp "
- "'Enter the command for the new button.'");
- button=arshell_optioned_button(container, arshell_system_cb, command);
- free(command);
- return(button);
+ command = antiright_pipe_read ("arshell -ADp "
+ "'Enter the command for the new button.'");
+ button = arshell_optioned_button (container, arshell_system_cb, command);
+ free (command);
+ return (button);
}
Widget
-arshell_add_predefined_appendage(Widget container, char *command)
+arshell_add_predefined_appendage (Widget container, char *command)
{
- return(arshell_optioned_button(container, arshell_system_cb, command));
+ return (arshell_optioned_button (container, arshell_system_cb, command));
}
void
-arshell_appendage_append_callback(Widget caller,
- XtPointer client,
- XtPointer call)
-{
- arshell_add_appendage((Widget)client);
- caller=NULL;
- call=NULL;
+arshell_appendage_append_callback (Widget caller,
+ XtPointer client, XtPointer call)
+{
+ arshell_add_appendage ((Widget) client);
+ caller = NULL;
+ call = NULL;
}
void
-arshell_appendage_append_predefined_callback(Widget caller,
- XtPointer client, XtPointer call)
+arshell_appendage_append_predefined_callback (Widget caller,
+ XtPointer client,
+ XtPointer call)
{
char *command;
- call=NULL;
+ call = NULL;
ARCLARG;
- antiright_set(XmNlabelString, (XtArgVal)&command);
- antiright_get_values(caller);
+ antiright_set (XmNlabelString, (XtArgVal) & command);
+ antiright_get_values (caller);
ARCLARG;
- arshell_add_predefined_appendage((Widget)client, command);
- XtFree(command);
+ arshell_add_predefined_appendage ((Widget) client, command);
+ XtFree (command);
}
Widget
-arshell_add_predefined_appendage_button(Widget parent,
- Widget container,
- char *command)
+arshell_add_predefined_appendage_button (Widget parent,
+ Widget container, char *command)
{
Widget button;
- button=antiright_button(parent,
- command,
- arshell_appendage_append_predefined_callback,
- (XtPointer)container);
- antiright_label_string(button, command);
- return(button);
+ button = antiright_button (parent,
+ command,
+ arshell_appendage_append_predefined_callback,
+ (XtPointer) container);
+ antiright_label_string (button, command);
+ return (button);
}
Widget
-arshell_add_appendage_button(Widget parent, Widget container)
+arshell_add_appendage_button (Widget parent, Widget container)
{
Widget button;
- button=antiright_button(parent, "Append", arshell_appendage_append_callback,
- (XtPointer)container);
- antiright_label_string(button, "Append...");
- return(button);
+ button =
+ antiright_button (parent, "Append", arshell_appendage_append_callback,
+ (XtPointer) container);
+ antiright_label_string (button, "Append...");
+ return (button);
}
Index: antiright/src/arshell/appendage.h
diff -u antiright/src/arshell/appendage.h:1.5
antiright/src/arshell/appendage.h:1.6
--- antiright/src/arshell/appendage.h:1.5 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/appendage.h Sun Jul 31 16:19:50 2005
@@ -23,16 +23,14 @@
#ifndef ARSHELL_APPENDAGE_H
#define ARSHELL_APPENDAGE_H
-Widget
-arshell_add_appendage(Widget container);
+Widget arshell_add_appendage (Widget container);
-Widget
-arshell_add_predefined_appendage(Widget container, char *command);
+Widget arshell_add_predefined_appendage (Widget container, char *command);
-Widget
-arshell_add_appendage_button(Widget parent, Widget container);
+Widget arshell_add_appendage_button (Widget parent, Widget container);
Widget
-arshell_add_predefined_appendage_button(Widget parent, Widget container, char
*command);
+arshell_add_predefined_appendage_button (Widget parent, Widget container,
+ char *command);
#endif /* not ARSHELL_APPENDAGE_H */
Index: antiright/src/arshell/arguments.c
diff -u antiright/src/arshell/arguments.c:1.23
antiright/src/arshell/arguments.c:1.24
--- antiright/src/arshell/arguments.c:1.23 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/arguments.c Sun Jul 31 16:19:50 2005
@@ -23,215 +23,216 @@
#include "arshell.h"
void
-arshell_add_lower_button()
+arshell_add_lower_button ()
{
Widget button;
- arshell_row_layout();
- assert(arshell.gui.layout.row_widget);
- button=antiright_panel_button(arshell.gui.layout.row_widget, "Lower",
- arshell_lower_mainwindow_cb, NULL);
- antiright_set_tooltip(button, "Lower the panel.");
+ arshell_row_layout ();
+ assert (arshell.gui.layout.row_widget);
+ button = antiright_panel_button (arshell.gui.layout.row_widget, "Lower",
+ arshell_lower_mainwindow_cb, NULL);
+ antiright_set_tooltip (button, "Lower the panel.");
}
+
void
-arshell_handle_graph_arguments(int *counter_int, char **argv)
+arshell_handle_graph_arguments (int *counter_int, char **argv)
{
- switch(argv[(*counter_int)][3])
+ switch (argv[(*counter_int)][3])
{
- case 'e': /* Graph an equation, using the output of the passed
- program. */
+ case 'e': /* Graph an equation, using the output of the
passed
+ program. */
(*counter_int)++;
- antiright_graph_equation(argv[(*counter_int)]);
+ antiright_graph_equation (argv[(*counter_int)]);
break;
- case 's': /* Display a number system output by the passed
- program. */
+ case 's': /* Display a number system output by the passed
+ program. */
(*counter_int)++;
- antiright_graph_system(argv[(*counter_int)]);
+ antiright_graph_system (argv[(*counter_int)]);
break;
- case 'l': /* Draw a line. */
+ case 'l': /* Draw a line. */
(*counter_int)++;
- antiright_graph_line(atoi(argv[(*counter_int)]),
- atoi(argv[(*counter_int)+1]),
- atoi(argv[(*counter_int)+2]),
- atoi(argv[(*counter_int)+3]));
- (*counter_int)+=3;
+ antiright_graph_line (atoi (argv[(*counter_int)]),
+ atoi (argv[(*counter_int) + 1]),
+ atoi (argv[(*counter_int) + 2]),
+ atoi (argv[(*counter_int) + 3]));
+ (*counter_int) += 3;
break;
- case 'p': /* Plot a point. */
+ case 'p': /* Plot a point. */
(*counter_int)++;
- antiright_graph_point(atoi(argv[(*counter_int)]),
- atoi(argv[(*counter_int)+1]));
+ antiright_graph_point (atoi (argv[(*counter_int)]),
+ atoi (argv[(*counter_int) + 1]));
(*counter_int)++;
-
+
break;
- case 'r': /* Graph a rectangle. */
+ case 'r': /* Graph a rectangle. */
(*counter_int)++;
- antiright_graph_rect(atoi(argv[(*counter_int)]),
- atoi(argv[(*counter_int)+1]),
- atoi(argv[(*counter_int)+2]),
- atoi(argv[(*counter_int)+3]));
- (*counter_int)+=3;
+ antiright_graph_rect (atoi (argv[(*counter_int)]),
+ atoi (argv[(*counter_int) + 1]),
+ atoi (argv[(*counter_int) + 2]),
+ atoi (argv[(*counter_int) + 3]));
+ (*counter_int) += 3;
break;
}
}
void
-arshell_handle_construction_arguments(int *counter_int, char **argv)
+arshell_handle_construction_arguments (int *counter_int, char **argv)
{
- switch(argv[(*counter_int)][2])
+ switch (argv[(*counter_int)][2])
{
- case 'b': /* Add a bitmap button. */
- arshell_add_bitmap_button(counter_int, argv);
+ case 'b': /* Add a bitmap button. */
+ arshell_add_bitmap_button (counter_int, argv);
break;
- case 'C': /* Add a color selector. */
- arshell_color_widget(arshell.gui.widgets.row);
+ case 'C': /* Add a color selector. */
+ arshell_color_widget (arshell.gui.widgets.row);
break;
- case 'c': /* Add a clockload applet. */
- arshell_clockload_applet(arshell.gui.widgets.row);
+ case 'c': /* Add a clockload applet. */
+ arshell_clockload_applet (arshell.gui.widgets.row);
break;
- case 'D': /* Add a dialog. */
- arshell_handle_dialog_arguments(counter_int, argv);
+ case 'D': /* Add a dialog. */
+ arshell_handle_dialog_arguments (counter_int, argv);
break;
- case 'g': /* Add a graphing widget. */
- arshell_handle_graph_arguments(counter_int, argv);
- arshell.use_graph=True;
+ case 'g': /* Add a graphing widget. */
+ arshell_handle_graph_arguments (counter_int, argv);
+ arshell.use_graph = True;
break;
- case 'i': /* Add an icon without a label. */
- arshell_add_icon_button(counter_int, argv);
+ case 'i': /* Add an icon without a label. */
+ arshell_add_icon_button (counter_int, argv);
break;
- case 'L': /* Add a Lower button. */
- arshell_add_lower_button();
+ case 'L': /* Add a Lower button. */
+ arshell_add_lower_button ();
break;
- case 'l': /* Add a label. */
+ case 'l': /* Add a label. */
(*counter_int)++;
ARCLARG;
- antiright_label(arshell.gui.widgets.row, argv[(*counter_int)]);
+ antiright_label (arshell.gui.widgets.row, argv[(*counter_int)]);
break;
case 'm':
- arshell_handle_menubar_sub_arguments(counter_int, argv);
+ arshell_handle_menubar_sub_arguments (counter_int, argv);
break;
- case 's': /* Create a status area. */
- antiright_create_status_bar(arshell.gui.widgets.mainwindow);
+ case 's': /* Create a status area. */
+ antiright_create_status_bar (arshell.gui.widgets.mainwindow);
break;
- case 't': /* Add a text field. */
+ case 't': /* Add a text field. */
(*counter_int)++;
- arshell_create_default_text_entry(arshell.gui.widgets.row,
- counter_int, argv);
+ arshell_create_default_text_entry (arshell.gui.widgets.row,
+ counter_int, argv);
break;
- case 'w': /* Add a work area scrolled text. */
- arshell_create_text_work_area();
+ case 'w': /* Add a work area scrolled text. */
+ arshell_create_text_work_area ();
break;
}
}
void
-arshell_handle_long_options(int *counter_int, char **argv)
+arshell_handle_long_options (int *counter_int, char **argv)
{
- int length=strlen(argv[(*counter_int)]), counter;
- char *option=(char*)xmalloc(length-1);
- for(counter=2; counter <= length; counter++)
+ int length = strlen (argv[(*counter_int)]), counter;
+ char *option = (char *) xmalloc (length - 1);
+ for (counter = 2; counter <= length; counter++)
{
- option[counter-2]=argv[(*counter_int)][counter];
+ option[counter - 2] = argv[(*counter_int)][counter];
}
#ifdef DEBUG
- printf("LENGTH:%d;COUNTER:%d;OPTION:%s\n", length, counter, option);
- fflush(stdout);
- length-=2;
+ printf ("LENGTH:%d;COUNTER:%d;OPTION:%s\n", length, counter, option);
+ fflush (stdout);
+ length -= 2;
#endif /* DEBUG */
- if(!strncmp(option, "help", length))
+ if (!strncmp (option, "help", length))
{
- arshell_usage();
+ arshell_usage ();
}
- if(!strncmp(option, "fifo", length))
+ if (!strncmp (option, "fifo", length))
{
(*counter_int)++;
- antiright_fifo_server(argv[(*counter_int)], argv[(*counter_int)+1]);
+ antiright_fifo_server (argv[(*counter_int)], argv[(*counter_int) + 1]);
(*counter_int)++;
}
- if(!strncmp(option, "test", length))
+ if (!strncmp (option, "test", length))
{
- puts("TESTING");
- antiright_pipe_write("cut -d ' ' -f 2", "num 1 2 3");
- puts("TESTING");
- exit(0);
+ puts ("TESTING");
+ antiright_pipe_write ("cut -d ' ' -f 2", "num 1 2 3");
+ puts ("TESTING");
+ exit (0);
}
}
void
-arshell_process_options(int *counter_int, char **argv)
+arshell_process_options (int *counter_int, char **argv)
{
/* The code for the case statements should be clear as to
its action and fully indirected through extraction. */
switch (argv[(*counter_int)][1])
{
- case 'A': /* This section adds a widget. */
- arshell_handle_construction_arguments(counter_int, argv);
-
+ case 'A': /* This section adds a widget. */
+ arshell_handle_construction_arguments (counter_int, argv);
+
break;
- case 'E': /* Exit when a button is pressed. */
- arshell.flags.exit_on_action=True;
+ case 'E': /* Exit when a button is pressed. */
+ arshell.flags.exit_on_action = True;
break;
/* The following only works if you have the yetanotherclib
- library. */
+ library. */
#ifdef HAVE_YACLIB
- case 'f': /* Load an arshell interface definition file. */
+ case 'f': /* Load an arshell interface definition file.
*/
(*counter_int)++;
- arshell_parse_interface_file(argv[(*counter_int)]);
+ arshell_parse_interface_file (argv[(*counter_int)]);
break;
#endif /* HAVE_YACLIB */
- case 'l': /* Start up lowered. */
- arshell.flags.lowered=True;
+ case 'l': /* Start up lowered. */
+ arshell.flags.lowered = True;
break;
- case 'p': /* Input pipe operations. */
- arshell_set_work_area_from_stdin();
+ case 'p': /* Input pipe operations. */
+ arshell_set_work_area_from_stdin ();
break;
case 'r':
- arshell_set_rows(counter_int, argv);
+ arshell_set_rows (counter_int, argv);
break;
case 'T':
- arshell.flags.force_tooltips=False;
- break;
+ arshell.flags.force_tooltips = False;
+ break;
case 't':
- arshell.flags.force_tooltips=True;
+ arshell.flags.force_tooltips = True;
break;
- case 'U':
- arshell_handle_updating_argument(counter_int, argv);
+ case 'U':
+ arshell_handle_updating_argument (counter_int, argv);
break;
- case 'W':
- arshell_set_window_title_and_work_filename(counter_int, argv);
+ case 'W':
+ arshell_set_window_title_and_work_filename (counter_int, argv);
break;
case '-':
- arshell_handle_long_options(counter_int, argv);
+ arshell_handle_long_options (counter_int, argv);
break;
default:
- arshell_usage();
+ arshell_usage ();
break;
}
}
void
-arshell_process_non_option_arguments(int *counter_int, char **argv)
+arshell_process_non_option_arguments (int *counter_int, char **argv)
{
- arshell_row_layout();
- arshell_optioned_button(arshell.gui.layout.row_widget,
- arshell_system_cb, argv[(*counter_int)]);
+ arshell_row_layout ();
+ arshell_optioned_button (arshell.gui.layout.row_widget,
+ arshell_system_cb, argv[(*counter_int)]);
}
void
-arshell_handle_command_line_arguments(int* argc, char** argv)
+arshell_handle_command_line_arguments (int *argc, char **argv)
{
- int counter_int;
- arshell_initialize_layout_values();
- for(counter_int=1; counter_int < (*argc); counter_int++)
- {
- if(argv[counter_int][0] == '-')
- {
- arshell_process_options(&counter_int, argv);
- }
- else
- {
- arshell_process_non_option_arguments(&counter_int, argv);
- }
- }
-
+ int counter_int;
+ arshell_initialize_layout_values ();
+ for (counter_int = 1; counter_int < (*argc); counter_int++)
+ {
+ if (argv[counter_int][0] == '-')
+ {
+ arshell_process_options (&counter_int, argv);
+ }
+ else
+ {
+ arshell_process_non_option_arguments (&counter_int, argv);
+ }
+ }
+
}
Index: antiright/src/arshell/arguments.h
diff -u antiright/src/arshell/arguments.h:1.9
antiright/src/arshell/arguments.h:1.10
--- antiright/src/arshell/arguments.h:1.9 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/arguments.h Sun Jul 31 16:19:50 2005
@@ -23,13 +23,9 @@
#ifndef ARSHELL_ARGUMENTS_H
#define ARSHELL_ARGUMENTS_H
-void
-arshell_handle_command_line_arguments(int* argc,
- char** argv);
-Widget
-arshell_progress_bar(Widget parent);
+void arshell_handle_command_line_arguments (int *argc, char **argv);
+Widget arshell_progress_bar (Widget parent);
-void
-arshell_transparency_hack();
+void arshell_transparency_hack ();
#endif /* ARSHELL_ARGUMENTS_H */
Index: antiright/src/arshell/arshell-util.c
diff -u antiright/src/arshell/arshell-util.c:1.12
antiright/src/arshell/arshell-util.c:1.13
--- antiright/src/arshell/arshell-util.c:1.12 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/arshell-util.c Sun Jul 31 16:19:50 2005
@@ -23,94 +23,91 @@
#include "arshell.h"
void
-arshell_system_cb(Widget parent_widget,
- XtPointer client_data,
- XtPointer call_data)
-{
- antiright_system(client_data);
-
- if(arshell.flags.exit_on_action)
- exit(0);
+arshell_system_cb (Widget parent_widget,
+ XtPointer client_data, XtPointer call_data)
+{
+ antiright_system (client_data);
+
+ if (arshell.flags.exit_on_action)
+ exit (0);
- parent_widget=(Widget)NULL;
- call_data=(XtPointer)NULL;
+ parent_widget = (Widget) NULL;
+ call_data = (XtPointer) NULL;
}
void
-arshell_beautify_label(Widget widget,
- char *current_argument_string)
+arshell_beautify_label (Widget widget, char *current_argument_string)
{
- char *label_string=antiright_beautified_label(current_argument_string);
- antiright_label_string(widget, label_string);
- free(label_string);
+ char *label_string = antiright_beautified_label (current_argument_string);
+ antiright_label_string (widget, label_string);
+ free (label_string);
}
void
-arshell_usage()
+arshell_usage ()
{
- antiright_standard_usage("arshell");
- puts(" [[-[-help [-fifo COMMAND FIFO]]]"
- "[-A[[C][D[Ff][mp label]]][bi label icon]"
- "[l label][m[[fevh] label]][s][t label][w]]Ep"
- "[r rows][U[[LPTW] command][f frequency]][W label]][command]");
- antiright_report_bugs_message();
- exit(1);
+ antiright_standard_usage ("arshell");
+ puts (" [[-[-help [-fifo COMMAND FIFO]]]"
+ "[-A[[C][D[Ff][mp label]]][bi label icon]"
+ "[l label][m[[fevh] label]][s][t label][w]]Ep"
+ "[r rows][U[[LPTW] command][f frequency]][W label]][command]");
+ antiright_report_bugs_message ();
+ exit (1);
}
Widget
-arshell_optioned_button(Widget parent_widget,
- XtCallbackProc callback,
- char* command_string)
+arshell_optioned_button (Widget parent_widget,
+ XtCallbackProc callback, char *command_string)
{
Widget button_widget;
- if(parent_widget != NULL)
+ if (parent_widget != NULL)
{
- if(!XtIsManaged(parent_widget))
+ if (!XtIsManaged (parent_widget))
{
- XtManageChild(parent_widget);
+ XtManageChild (parent_widget);
}
}
- button_widget=antiright_panel_button(parent_widget, command_string,
- callback, command_string);
- antiright_set_tooltip(button_widget, command_string);
- arshell_beautify_label(button_widget, command_string);
+ button_widget = antiright_panel_button (parent_widget, command_string,
+ callback, command_string);
+ antiright_set_tooltip (button_widget, command_string);
+ arshell_beautify_label (button_widget, command_string);
ARCLARG;
- antiright_set(XmNalignment, XmALIGNMENT_CENTER);
- antiright_set_values(button_widget);
+ antiright_set (XmNalignment, XmALIGNMENT_CENTER);
+ antiright_set_values (button_widget);
ARCLARG;
- return(button_widget);
+ return (button_widget);
}
void
-arshell_set_progress_bar_arguments()
+arshell_set_progress_bar_arguments ()
{
- antiright_set(XmNorientation, XmHORIZONTAL);
- antiright_set(XmNshowArrows, False);
- antiright_set(XmNmaximum, 100);
- antiright_set(XmNminimum, 0);
- antiright_set(XmNsliderSize, 1);
- antiright_set(XmNeditable, False);
+ antiright_set (XmNorientation, XmHORIZONTAL);
+ antiright_set (XmNshowArrows, False);
+ antiright_set (XmNmaximum, 100);
+ antiright_set (XmNminimum, 0);
+ antiright_set (XmNsliderSize, 1);
+ antiright_set (XmNeditable, False);
}
Widget
-arshell_progress_bar(Widget parent)
+arshell_progress_bar (Widget parent)
{
Widget progress;
- arshell_set_progress_bar_arguments();
- progress=XmCreateScrollBar(parent, "progress",
- antiright.arguments, antiright.arguments_int);
- XtManageChild(progress);
- return(progress);
+ arshell_set_progress_bar_arguments ();
+ progress = XmCreateScrollBar (parent, "progress",
+ antiright.arguments, antiright.arguments_int);
+ XtManageChild (progress);
+ return (progress);
}
void
-arshell_set_window_title_and_work_filename(int *counter_int, char **argv)
+arshell_set_window_title_and_work_filename (int *counter_int, char **argv)
{
/* This sets the window title and the work filename. I know this is
a weird way to do things, but it keeps things small and is
actually quite practical. */
(*counter_int)++;
- strncpy(arshell.edit.filename, argv[(*counter_int)], 255);
- arshell.flags.file_open=True;
- antiright_set_title(argv[(*counter_int)]);
+ strncpy (arshell.edit.filename, argv[(*counter_int)], 255);
+ arshell.flags.file_open = True;
+ antiright_set_title (argv[(*counter_int)]);
}
Index: antiright/src/arshell/arshell-util.h
diff -u antiright/src/arshell/arshell-util.h:1.7
antiright/src/arshell/arshell-util.h:1.8
--- antiright/src/arshell/arshell-util.h:1.7 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/arshell-util.h Sun Jul 31 16:19:50 2005
@@ -21,35 +21,26 @@
*/
#ifndef ARSHELL_UTIL_H
-#define ARSHELL_UTIL_H
+#define ARSHELL_UTIL_H
void
-arshell_system_cb(Widget parent_widget,
- XtPointer client_data,
- XtPointer call_data);
-void
-arshell_set_desktop_panel_mode();
-void
-arshell_update();
-void
-arshell_add_updater(Widget widget, char* command_string);
-void
-arshell_update_work_procedure(XtPointer client_data,
- XtIntervalId* timer_id);
-void
-arshell_beautify_label(Widget widget, char* current_argument_string);
-void
-arshell_row_layout();
-void
-arshell_set_rows(int* counter_int, char** argv);
-void
-arshell_usage();
+arshell_system_cb (Widget parent_widget,
+ XtPointer client_data, XtPointer call_data);
+void arshell_set_desktop_panel_mode ();
+void arshell_update ();
+void arshell_add_updater (Widget widget, char *command_string);
+void
+arshell_update_work_procedure (XtPointer client_data,
+ XtIntervalId * timer_id);
+void arshell_beautify_label (Widget widget, char *current_argument_string);
+void arshell_row_layout ();
+void arshell_set_rows (int *counter_int, char **argv);
+void arshell_usage ();
Widget
-arshell_optioned_button(Widget parent_widget,
- XtCallbackProc callback,
- char* command_string);
+arshell_optioned_button (Widget parent_widget,
+ XtCallbackProc callback, char *command_string);
void
-arshell_set_window_title_and_work_filename(int *counter_int, char **argv);
+arshell_set_window_title_and_work_filename (int *counter_int, char **argv);
#endif /* ARSHELL_UTIL_H */
Index: antiright/src/arshell/arshell.c
diff -u antiright/src/arshell/arshell.c:1.16
antiright/src/arshell/arshell.c:1.17
--- antiright/src/arshell/arshell.c:1.16 Thu Jul 28 04:44:03 2005
+++ antiright/src/arshell/arshell.c Sun Jul 31 16:19:50 2005
@@ -23,148 +23,138 @@
#include "arshell.h"
void
-arshell_setup_mainwindow()
+arshell_setup_mainwindow ()
{
ARCLARG;
- antiright_set(XmNshadowThickness, 0);
- arshell.gui.widgets.mainwindow=
- XmCreateMainWindow(antiright.parent_widget,
- "mainwindow_manager_widget",
- antiright.arguments,
- antiright.arguments_int);
- XtManageChild(arshell.gui.widgets.mainwindow);
+ antiright_set (XmNshadowThickness, 0);
+ arshell.gui.widgets.mainwindow =
+ XmCreateMainWindow (antiright.parent_widget,
+ "mainwindow_manager_widget",
+ antiright.arguments, antiright.arguments_int);
+ XtManageChild (arshell.gui.widgets.mainwindow);
}
Boolean
-arshell_override_is_set()
+arshell_override_is_set ()
{
Boolean override_is_set;
ARCLARG;
- antiright_set(XmNoverrideRedirect, (XtArgVal)&override_is_set);
- XtGetValues(antiright.parent_widget,
- antiright.arguments,
- antiright.arguments_int);
+ antiright_set (XmNoverrideRedirect, (XtArgVal) & override_is_set);
+ XtGetValues (antiright.parent_widget,
+ antiright.arguments, antiright.arguments_int);
ARCLARG;
- return(override_is_set);
+ return (override_is_set);
}
void
-arshell_handle_panel_override()
+arshell_handle_panel_override ()
{
#ifdef XmNtoolTipEnable
- if(!arshell_override_is_set() || arshell.flags.force_tooltips)
+ if (!arshell_override_is_set () || arshell.flags.force_tooltips)
{
- XtVaSetValues(antiright.parent_widget,
- XmNtoolTipEnable, True,
- NULL);
+ XtVaSetValues (antiright.parent_widget, XmNtoolTipEnable, True, NULL);
}
#endif /* XmNtoolTipEnable */
}
void
-arshell_check_if_lowered()
+arshell_check_if_lowered ()
{
- if(arshell.flags.lowered)
+ if (arshell.flags.lowered)
{
- XLowerWindow(antiright.display,
- XtWindow(antiright.parent_widget));
+ XLowerWindow (antiright.display, XtWindow (antiright.parent_widget));
/* This is a small hack to ensure that a window stays lowered if
- such is specified at the command line. This mainly is
- intended to fix operation of AntiRight with fvwm2. */
- arshell_add_updater(antiright.parent_widget, "lower");
+ such is specified at the command line. This mainly is
+ intended to fix operation of AntiRight with fvwm2. */
+ arshell_add_updater (antiright.parent_widget, "lower");
}
}
void
-arshell_place_arshell()
+arshell_place_arshell ()
{
- XtRealizeWidget(antiright.parent_widget);
- if(arshell.use_graph)
+ XtRealizeWidget (antiright.parent_widget);
+ if (arshell.use_graph)
{
- antiright_set(XmNresizePolicy, XmRESIZE_NONE);
- arshell.gui.widgets.work=
- antiright_create_graph(arshell.gui.widgets.mainwindow);
- arshell_setup_work_window();
+ antiright_set (XmNresizePolicy, XmRESIZE_NONE);
+ arshell.gui.widgets.work =
+ antiright_create_graph (arshell.gui.widgets.mainwindow);
+ arshell_setup_work_window ();
}
- /*arshell_handle_panel_override();*/
- arshell_check_if_lowered();
+ /*arshell_handle_panel_override(); */
+ arshell_check_if_lowered ();
}
void
-arshell_start_event_loop()
+arshell_start_event_loop ()
{
- arshell_place_arshell();
- XtAppMainLoop(antiright.app_context);
+ arshell_place_arshell ();
+ XtAppMainLoop (antiright.app_context);
}
void
-arshell_setup_work_row()
+arshell_setup_work_row ()
{
ARCLARG;
- antiright_set(XmNmarginHeight, 0);
- antiright_set(XmNmarginWidth, 0);
- arshell.gui.widgets.row=antiright_row(arshell.gui.widgets.mainwindow);
+ antiright_set (XmNmarginHeight, 0);
+ antiright_set (XmNmarginWidth, 0);
+ arshell.gui.widgets.row = antiright_row (arshell.gui.widgets.mainwindow);
/* The following implements a popup menu on the ACE desktop. */
- /* if ( arshell_override_is_set() && arshell.flags.lowered ) */
+ /* if ( arshell_override_is_set() && arshell.flags.lowered ) */
/* { */
- Widget menu;
- menu=antiright_popup_menu(arshell.gui.widgets.row);
- 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");
- /* } */
-}
-void
-arshell_initialize_application_data()
-{
- arshell.gui.menubar.file_widget=NULL;
- arshell.gui.widgets.work=NULL;
- antiright.status_widget=NULL;
- arshell.timer_id=NULL;
- arshell.edit.filename[0]='\0';
- arshell.update_frequency=1000; /* This is in miliseconds. */
-}
-void
-arshell_setup_work_window()
-{
- if(arshell.gui.widgets.work!=NULL)
- {
- XtVaSetValues(arshell.gui.widgets.mainwindow,
- XmNworkWindow, arshell.gui.widgets.work,
- XmNcommandWindow, arshell.gui.widgets.row,
- NULL);
+ Widget menu;
+ menu = antiright_popup_menu (arshell.gui.widgets.row);
+ 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");
+ /* } */
+}
+
+void
+arshell_initialize_application_data ()
+{
+ arshell.gui.menubar.file_widget = NULL;
+ arshell.gui.widgets.work = NULL;
+ antiright.status_widget = NULL;
+ arshell.timer_id = NULL;
+ arshell.edit.filename[0] = '\0';
+ arshell.update_frequency = 1000; /* This is in miliseconds. */
+}
+
+void
+arshell_setup_work_window ()
+{
+ if (arshell.gui.widgets.work != NULL)
+ {
+ XtVaSetValues (arshell.gui.widgets.mainwindow,
+ XmNworkWindow, arshell.gui.widgets.work,
+ XmNcommandWindow, arshell.gui.widgets.row, NULL);
}
else
{
- XtVaSetValues(arshell.gui.widgets.mainwindow,
- XmNworkWindow, arshell.gui.widgets.row,
- NULL);
+ XtVaSetValues (arshell.gui.widgets.mainwindow,
+ XmNworkWindow, arshell.gui.widgets.row, NULL);
}
- if(arshell.use_graph)
+ if (arshell.use_graph)
{
-
- XtVaSetValues(antiright.parent_widget,
- XmNheight, antiright.graph.height+10,
- XmNwidth, antiright.graph.width+10,
- NULL);
+
+ XtVaSetValues (antiright.parent_widget,
+ XmNheight, antiright.graph.height + 10,
+ XmNwidth, antiright.graph.width + 10, NULL);
}
}
void
-arshell_setup_message_window()
+arshell_setup_message_window ()
{
- if(antiright.status_widget!=NULL)
+ if (antiright.status_widget != NULL)
{
- XtVaSetValues(arshell.gui.widgets.mainwindow,
- XmNmessageWindow, antiright.status_widget,
- NULL);
+ XtVaSetValues (arshell.gui.widgets.mainwindow,
+ XmNmessageWindow, antiright.status_widget, NULL);
}
}
-
Index: antiright/src/arshell/arshell.h
diff -u antiright/src/arshell/arshell.h:1.20
antiright/src/arshell/arshell.h:1.21
--- antiright/src/arshell/arshell.h:1.20 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/arshell.h Sun Jul 31 16:19:50 2005
@@ -65,7 +65,7 @@
struct arshell_gui_struct
{
- Display* display;
+ Display *display;
struct arshell_layout_struct layout;
struct arshell_widgets_struct widgets;
struct antiright_menubar_structure menubar;
@@ -91,25 +91,18 @@
struct arshell_data_struct arshell;
-void
-arshell_setup_mainwindow();
+void arshell_setup_mainwindow ();
-void
-arshell_start_event_loop();
+void arshell_start_event_loop ();
-void
-arshell_setup_work_row();
+void arshell_setup_work_row ();
-void
-arshell_initialize_application_data();
+void arshell_initialize_application_data ();
-void
-arshell_setup_work_window();
+void arshell_setup_work_window ();
-void
-arshell_setup_message_window();
+void arshell_setup_message_window ();
-void
-arshell_handle_panel_override();
+void arshell_handle_panel_override ();
#endif /* AR_ARSHELL_H */
Index: antiright/src/arshell/clockload.c
diff -u antiright/src/arshell/clockload.c:1.5
antiright/src/arshell/clockload.c:1.6
--- antiright/src/arshell/clockload.c:1.5 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/clockload.c Sun Jul 31 16:19:50 2005
@@ -23,17 +23,17 @@
#include "arshell.h"
Widget
-arshell_clockload_applet(Widget parent)
+arshell_clockload_applet (Widget parent)
{
Widget clockload_form;
ARCLARG;
- clockload_form=antiright_form(parent);
+ clockload_form = antiright_form (parent);
ARCLARG;
- 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, "");
- arshell_update();
- return(clockload_form);
+ 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, "");
+ arshell_update ();
+ return (clockload_form);
}
Index: antiright/src/arshell/clockload.h
diff -u antiright/src/arshell/clockload.h:1.5
antiright/src/arshell/clockload.h:1.6
--- antiright/src/arshell/clockload.h:1.5 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/clockload.h Sun Jul 31 16:19:50 2005
@@ -29,7 +29,6 @@
};
-Widget
-arshell_clockload_applet(Widget parent);
+Widget arshell_clockload_applet (Widget parent);
#endif /* ARSHELL_CLOCKLOAD_H */
Index: antiright/src/arshell/color.c
diff -u antiright/src/arshell/color.c:1.10 antiright/src/arshell/color.c:1.11
--- antiright/src/arshell/color.c:1.10 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/color.c Sun Jul 31 16:19:50 2005
@@ -34,119 +34,114 @@
Widget arcolor_preview_widget;
void
-arcolor_allocate_color(XColor *color)
+arcolor_allocate_color (XColor * color)
{
Colormap colormap;
/* These options are set often enough, so set them in this generic
function. */
- color->flags=DoRed|DoGreen|DoBlue;
- colormap=DefaultColormap(antiright.display, antiright.screen);
- XAllocColor(antiright.display,colormap,color);
+ color->flags = DoRed | DoGreen | DoBlue;
+ colormap = DefaultColormap (antiright.display, antiright.screen);
+ XAllocColor (antiright.display, colormap, color);
}
void
-arcolor_update_preview()
+arcolor_update_preview ()
{
XColor color;
- char* label_string;
-
- XmScaleGetValue(arcolor_red_widget, (int*)&color.red);
- XmScaleGetValue(arcolor_green_widget, (int*)&color.green);
- XmScaleGetValue(arcolor_blue_widget, (int*)&color.blue);
-
- asprintf(&label_string, "rgb:%x/%x/%x", color.red, color.green, color.blue);
- antiright_label_string(arcolor_preview_widget, label_string);
- free(label_string);
-
- color.red=color.red*256;
- color.green=color.green*256;
- color.blue=color.blue*256;
-
- arcolor_allocate_color(&color);
-
- XtVaSetValues(arcolor_preview_widget,
- XmNbackground, color.pixel,
- NULL);
+ char *label_string;
+
+ XmScaleGetValue (arcolor_red_widget, (int *) &color.red);
+ XmScaleGetValue (arcolor_green_widget, (int *) &color.green);
+ XmScaleGetValue (arcolor_blue_widget, (int *) &color.blue);
+
+ asprintf (&label_string, "rgb:%x/%x/%x", color.red, color.green,
+ color.blue);
+ antiright_label_string (arcolor_preview_widget, label_string);
+ free (label_string);
+
+ color.red = color.red * 256;
+ color.green = color.green * 256;
+ color.blue = color.blue * 256;
+
+ arcolor_allocate_color (&color);
+
+ XtVaSetValues (arcolor_preview_widget, XmNbackground, color.pixel, NULL);
}
void
-antiright_color_scale_cb()
+antiright_color_scale_cb ()
{
- arcolor_update_preview();
+ arcolor_update_preview ();
}
void
-arcolor_set_scale_resources()
+arcolor_set_scale_resources ()
{
- antiright_set(XmNorientation, XmHORIZONTAL);
- antiright_set(XmNmaximum, 255);
- antiright_set(XmNwidth, 255);
- antiright_set(XmNvalue, 0);
- antiright_set(XmNshowValue, True);
+ antiright_set (XmNorientation, XmHORIZONTAL);
+ antiright_set (XmNmaximum, 255);
+ antiright_set (XmNwidth, 255);
+ antiright_set (XmNvalue, 0);
+ antiright_set (XmNshowValue, True);
}
-Widget
-arcolor_scale(Widget parent_widget,
- char *title_string)
+Widget
+arcolor_scale (Widget parent_widget, char *title_string)
{
Widget scale_widget;
- XmString title_motif_string=XmStringCreateLocalized(title_string);
- arcolor_set_scale_resources();
- antiright_set(XmNtitleString, (XtArgVal)title_motif_string);
- scale_widget=XmCreateScale(parent_widget,"scale_widget",
- antiright.arguments, antiright.arguments_int);
- XmStringFree(title_motif_string);
- XtManageChild(scale_widget);
-
- XtAddCallback(scale_widget,
- XmNdragCallback,
- antiright_color_scale_cb,
- NULL);
- return(scale_widget);
+ XmString title_motif_string = XmStringCreateLocalized (title_string);
+ arcolor_set_scale_resources ();
+ antiright_set (XmNtitleString, (XtArgVal) title_motif_string);
+ scale_widget = XmCreateScale (parent_widget, "scale_widget",
+ antiright.arguments, antiright.arguments_int);
+ XmStringFree (title_motif_string);
+ XtManageChild (scale_widget);
+
+ XtAddCallback (scale_widget,
+ XmNdragCallback, antiright_color_scale_cb, NULL);
+ return (scale_widget);
}
#endif /* #if XmVERSION > 1 & XmREVISION > 1 */
void
-arcolor_select_cb(Widget parent_widget,
- XtPointer client_data,
- XtPointer call_data)
-{
+arcolor_select_cb (Widget parent_widget,
+ XtPointer client_data, XtPointer call_data)
+{
#if XmVERSION > 1 & XmREVISION > 1
- char* color_string;
+ char *color_string;
ARCLARG;
- antiright_set(XmNcolorName, (XtArgVal)&color_string);
- XtGetValues((Widget)client_data,
- antiright.arguments, antiright.arguments_int);
- puts(color_string);
- free(color_string);
+ antiright_set (XmNcolorName, (XtArgVal) & color_string);
+ XtGetValues ((Widget) client_data,
+ antiright.arguments, antiright.arguments_int);
+ puts (color_string);
+ free (color_string);
#else
int red_int;
int green_int;
int blue_int;
-
- client_data=NULL;
- XmScaleGetValue(arcolor_red_widget, &red_int);
- XmScaleGetValue(arcolor_green_widget, &green_int);
- XmScaleGetValue(arcolor_blue_widget, &blue_int);
+ client_data = NULL;
+
+ XmScaleGetValue (arcolor_red_widget, &red_int);
+ XmScaleGetValue (arcolor_green_widget, &green_int);
+ XmScaleGetValue (arcolor_blue_widget, &blue_int);
/* This is the means by which data from this program is
obtained. */
- printf("rgb:%x/%x/%x", red_int, green_int, blue_int);
- fflush(stdout);
+ printf ("rgb:%x/%x/%x", red_int, green_int, blue_int);
+ fflush (stdout);
#endif
- parent_widget=NULL;
- call_data=NULL;
+ parent_widget = NULL;
+ call_data = NULL;
- exit(0);
+ exit (0);
}
Widget
-arshell_color_widget(Widget parent_widget)
+arshell_color_widget (Widget parent_widget)
{
Widget arcolor_widget;
#if XmVERSION > 1 & XmREVISION > 1
@@ -156,43 +151,43 @@
#endif /* XmVERSION > 1 & XmREVISION > 1 */
ARCLARG;
- antiright_form_positions(0, 100, 0, 100);
- arcolor_widget=antiright_form(parent_widget);
+ antiright_form_positions (0, 100, 0, 100);
+ arcolor_widget = antiright_form (parent_widget);
#if XmVERSION > 1 & XmREVISION > 1
ARCLARG;
- antiright_form_positions(0, 95, 0, 100);
- color_selector_widget=XmCreateColorSelector(arcolor_widget,
- "color_selector_widget",
- antiright.arguments,
- antiright.arguments_int);
- XtManageChild(color_selector_widget);
- ARCLARG;
- antiright_form_positions(95, 100, 0, 100);
- antiright_button(arcolor_widget, "Select",
- arcolor_select_cb, color_selector_widget);
+ antiright_form_positions (0, 95, 0, 100);
+ color_selector_widget = XmCreateColorSelector (arcolor_widget,
+ "color_selector_widget",
+ antiright.arguments,
+ antiright.arguments_int);
+ XtManageChild (color_selector_widget);
+ ARCLARG;
+ antiright_form_positions (95, 100, 0, 100);
+ antiright_button (arcolor_widget, "Select",
+ arcolor_select_cb, color_selector_widget);
#else /* not XmVERSION > 1 & not XmREVISION > 1 */
ARCLARG;
- antiright_form_positions(2, 66, 2, 34);
- preview_frame_widget=antiright_frame(arcolor_widget, XmSHADOW_IN);
+ antiright_form_positions (2, 66, 2, 34);
+ preview_frame_widget = antiright_frame (arcolor_widget, XmSHADOW_IN);
ARCLARG;
- arcolor_preview_widget=antiright_label(preview_frame_widget, "Color");
+ arcolor_preview_widget = antiright_label (preview_frame_widget, "Color");
ARCLARG;
- antiright_form_positions(66, 98, 2, 34);
- antiright_button(arcolor_widget,"Select",arcolor_select_cb,NULL);
+ antiright_form_positions (66, 98, 2, 34);
+ antiright_button (arcolor_widget, "Select", arcolor_select_cb, NULL);
ARCLARG;
- antiright_form_positions(2, 34, 34, 98);
- arcolor_red_widget=arcolor_scale(arcolor_widget, "Red");
+ antiright_form_positions (2, 34, 34, 98);
+ arcolor_red_widget = arcolor_scale (arcolor_widget, "Red");
ARCLARG;
- antiright_form_positions(34, 66, 34, 98);
- arcolor_green_widget=arcolor_scale(arcolor_widget, "Green");
- XtManageChild(arcolor_green_widget);
+ antiright_form_positions (34, 66, 34, 98);
+ arcolor_green_widget = arcolor_scale (arcolor_widget, "Green");
+ XtManageChild (arcolor_green_widget);
ARCLARG;
- antiright_form_positions(66, 98, 34, 98);
- arcolor_blue_widget=arcolor_scale(arcolor_widget, "Blue");
- arcolor_update_preview();
-
+ antiright_form_positions (66, 98, 34, 98);
+ arcolor_blue_widget = arcolor_scale (arcolor_widget, "Blue");
+ arcolor_update_preview ();
+
#endif /* XmVERSION > 1 & XmREVISION > 1 */
- return(arcolor_widget);
+ return (arcolor_widget);
}
Index: antiright/src/arshell/color.h
diff -u antiright/src/arshell/color.h:1.4 antiright/src/arshell/color.h:1.5
--- antiright/src/arshell/color.h:1.4 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/color.h Sun Jul 31 16:19:50 2005
@@ -23,8 +23,6 @@
#ifndef AR_COLOR_H
#define AR_COLOR_H
-Widget
-arshell_color_widget(Widget parent_widget);
+Widget arshell_color_widget (Widget parent_widget);
#endif /* AR_COLOR_H */
-
Index: antiright/src/arshell/dialog.c
diff -u antiright/src/arshell/dialog.c:1.10 antiright/src/arshell/dialog.c:1.11
--- antiright/src/arshell/dialog.c:1.10 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/dialog.c Sun Jul 31 16:19:50 2005
@@ -27,27 +27,28 @@
#endif /* XmVERSION > 1 & XmREVISION > 1 */
void
-arshell_dialog_cb(Widget widget, XtPointer client_data, XtPointer call_data)
+arshell_dialog_cb (Widget widget, XtPointer client_data, XtPointer call_data)
{
- widget=NULL;
- client_data=NULL;
- call_data=NULL;
- exit(0);
+ widget = NULL;
+ client_data = NULL;
+ call_data = NULL;
+ exit (0);
}
+
#if XmVERSION > 1 & XmREVISION > 1
void
-arshell_font_select_cb(ARCBARG)
+arshell_font_select_cb (ARCBARG)
{
- Widget font_selector=(Widget)client_data;
- char* font;
- widget=NULL;
- call_data=NULL;
+ Widget font_selector = (Widget) client_data;
+ char *font;
+ widget = NULL;
+ call_data = NULL;
ARCLARG;
- antiright_set(XmNcurrentFont, (XtArgVal)&font);
- antiright_get_values(font_selector);
+ antiright_set (XmNcurrentFont, (XtArgVal) & font);
+ antiright_get_values (font_selector);
ARCLARG;
- printf(font);
- exit(0);
+ printf (font);
+ exit (0);
}
#endif /* XmVERSION > 1 & XmREVISION > 1 */
/*#define DEBUG_OLD_MOTIF
@@ -64,200 +65,204 @@
#endif /* HAVE_XLT */
#endif /* DEBUG_NO_XLT */
-#if XmVERSION < 2 | XmREVISION < 2
+#if XmVERSION < 2 | XmREVISION < 2
#ifdef HAVE_XLT
void
-arshell_font_chooser_ok_cb(ARCBARG)
+arshell_font_chooser_ok_cb (ARCBARG)
{
char *font;
- antiright_set(XmNfontName, (XtArgVal)&font);
- antiright_get_values(widget);
- printf(font);
- exit(0);
+ antiright_set (XmNfontName, (XtArgVal) & font);
+ antiright_get_values (widget);
+ printf (font);
+ exit (0);
}
+
void
-arshell_font_chooser_cancel_cb(ARCBARG)
+arshell_font_chooser_cancel_cb (ARCBARG)
{
- exit(0);
+ exit (0);
}
#endif /* HAVE_XLT */
#endif /* XmVERSION < 1 & XmREVISION < 1 & HAVE_XLT */
void
-arshell_font_dialog()
+arshell_font_dialog ()
{
#if XmVERSION > 1 & XmREVISION > 1
Widget form;
Widget font_selector;
ARCLARG;
- form=antiright_form(arshell.gui.widgets.mainwindow);
- arshell.gui.widgets.work=form;
- antiright_set_title("Font Selector");
- ARCLARG;
- antiright_form_positions(0, 90, 0, 100);
- font_selector=XmCreateFontSelector(form, "font_selector", ARARGS);
- XtManageChild(font_selector);
- ARCLARG;
- antiright_set(XmNwidth, 500);
- antiright_set(XmNheight, 256);
- antiright_set_values(antiright.parent_widget);
+ form = antiright_form (arshell.gui.widgets.mainwindow);
+ arshell.gui.widgets.work = form;
+ antiright_set_title ("Font Selector");
+ ARCLARG;
+ antiright_form_positions (0, 90, 0, 100);
+ font_selector = XmCreateFontSelector (form, "font_selector", ARARGS);
+ XtManageChild (font_selector);
+ ARCLARG;
+ antiright_set (XmNwidth, 500);
+ antiright_set (XmNheight, 256);
+ antiright_set_values (antiright.parent_widget);
ARCLARG;
- XtUnmanageChild(arshell.gui.widgets.row);
+ XtUnmanageChild (arshell.gui.widgets.row);
ARCLARG;
- antiright_form_positions(90, 100, 0, 100);
- antiright_button(form, "Select", arshell_font_select_cb, font_selector);
+ antiright_form_positions (90, 100, 0, 100);
+ antiright_button (form, "Select", arshell_font_select_cb, font_selector);
ARCLARG;
#else
#if HAVE_XLT
Widget font_selector;
- antiright_set_title("Font Selector");
+ antiright_set_title ("Font Selector");
ARCLARG;
- font_selector=XltCreateFontChooser(arshell.gui.widgets.mainwindow,
- "font_selector", ARARGS);
- XtManageChild(font_selector);
- XtAddCallback(font_selector, XmNokCallback,
- arshell_font_chooser_ok_cb, NULL);
- XtAddCallback(font_selector, XmNcancelCallback,
- arshell_font_chooser_cancel_cb, NULL);
- XtAddCallback(font_selector, XmNhelpCallback,
- antiright_help_cb, "Use_this_dialog_to_select_a_font.");
+ font_selector = XltCreateFontChooser (arshell.gui.widgets.mainwindow,
+ "font_selector", ARARGS);
+ XtManageChild (font_selector);
+ XtAddCallback (font_selector, XmNokCallback,
+ arshell_font_chooser_ok_cb, NULL);
+ XtAddCallback (font_selector, XmNcancelCallback,
+ arshell_font_chooser_cancel_cb, NULL);
+ XtAddCallback (font_selector, XmNhelpCallback,
+ antiright_help_cb, "Use_this_dialog_to_select_a_font.");
#else
- system("arshell -ADp 'Enter a font name:' &");
- exit(0);
+ system ("arshell -ADp 'Enter a font name:' &");
+ exit (0);
#endif /* HAVE_XLT */
#endif /* XmVERSION > 1 & XmREVISION > 1 */
}
void
-arshell_setup_message_dialog_callbacks(Widget dialog)
+arshell_setup_message_dialog_callbacks (Widget dialog)
{
- XtAddCallback(dialog, XmNokCallback, arshell_dialog_cb, NULL);
- XtAddCallback(dialog, XmNhelpCallback, antiright_help_cb,
- "This_dialog_displays_application_messages.");
+ XtAddCallback (dialog, XmNokCallback, arshell_dialog_cb, NULL);
+ XtAddCallback (dialog, XmNhelpCallback, antiright_help_cb,
+ "This_dialog_displays_application_messages.");
}
void
-arshell_message_dialog(int *counter_int, char **argv)
+arshell_message_dialog (int *counter_int, char **argv)
{
Widget dialog;
Widget child;
XmString motif_string;
(*counter_int)++;
ARCLARG;
- motif_string=XmStringCreateLocalized(argv[(*counter_int)]);
- antiright_set(XmNmessageString, (XtArgVal)motif_string);
- dialog=XmCreateMessageBox(arshell.gui.widgets.row, "dialog",
- antiright.arguments, antiright.arguments_int);
- child=XmSelectionBoxGetChild(dialog, XmDIALOG_CANCEL_BUTTON);
- XtUnmanageChild(child);
- arshell_setup_message_dialog_callbacks(dialog);
- XtManageChild(dialog);
+ motif_string = XmStringCreateLocalized (argv[(*counter_int)]);
+ antiright_set (XmNmessageString, (XtArgVal) motif_string);
+ dialog = XmCreateMessageBox (arshell.gui.widgets.row, "dialog",
+ antiright.arguments, antiright.arguments_int);
+ child = XmSelectionBoxGetChild (dialog, XmDIALOG_CANCEL_BUTTON);
+ XtUnmanageChild (child);
+ arshell_setup_message_dialog_callbacks (dialog);
+ XtManageChild (dialog);
ARCLARG;
- XmStringFree(motif_string);
+ XmStringFree (motif_string);
}
void
-arshell_prompt_cb(Widget widget, XtPointer client_data, XtPointer call_data)
+arshell_prompt_cb (Widget widget, XtPointer client_data, XtPointer call_data)
{
- XmSelectionBoxCallbackStruct *call_pointer=call_data;
+ XmSelectionBoxCallbackStruct *call_pointer = call_data;
char *value;
- client_data=NULL;
- widget=NULL;
- value=antiright_c_string(call_pointer->value);
- puts(value);
- XtFree(value);
- exit(0);
+ client_data = NULL;
+ widget = NULL;
+ value = antiright_c_string (call_pointer->value);
+ puts (value);
+ XtFree (value);
+ exit (0);
}
void
-arshell_setup_prompt_dialog_callbacks(Widget dialog)
+arshell_setup_prompt_dialog_callbacks (Widget dialog)
{
- XtAddCallback(dialog, XmNokCallback, arshell_prompt_cb, NULL);
- XtAddCallback(dialog, XmNcancelCallback, arshell_dialog_cb, NULL);
- XtAddCallback(dialog, XmNhelpCallback, antiright_help_cb,
- "This_is_an_application_request_for_user_input.");
+ XtAddCallback (dialog, XmNokCallback, arshell_prompt_cb, NULL);
+ XtAddCallback (dialog, XmNcancelCallback, arshell_dialog_cb, NULL);
+ XtAddCallback (dialog, XmNhelpCallback, antiright_help_cb,
+ "This_is_an_application_request_for_user_input.");
}
void
-arshell_prompt_remove_buttons(Widget dialog)
+arshell_prompt_remove_buttons (Widget dialog)
{
Widget child;
- child=XmSelectionBoxGetChild(dialog, XmDIALOG_LIST);
- XtUnmanageChild(child);
- child=XmSelectionBoxGetChild(dialog, XmDIALOG_LIST_LABEL);
- XtUnmanageChild(child);
+ child = XmSelectionBoxGetChild (dialog, XmDIALOG_LIST);
+ XtUnmanageChild (child);
+ child = XmSelectionBoxGetChild (dialog, XmDIALOG_LIST_LABEL);
+ XtUnmanageChild (child);
}
void
-arshell_prompt_dialog(int *counter_int, char **argv)
+arshell_prompt_dialog (int *counter_int, char **argv)
{
Widget dialog;
XmString motif_string;
(*counter_int)++;
ARCLARG;
- motif_string=XmStringCreateLocalized(argv[(*counter_int)]);
- antiright_set(XmNselectionLabelString, (XtArgVal)motif_string);
- dialog=XmCreateSelectionBox(arshell.gui.widgets.row, "dialog",
- antiright.arguments, antiright.arguments_int);
- arshell_prompt_remove_buttons(dialog);
- arshell_setup_prompt_dialog_callbacks(dialog);
- XtManageChild(dialog);
+ motif_string = XmStringCreateLocalized (argv[(*counter_int)]);
+ antiright_set (XmNselectionLabelString, (XtArgVal) motif_string);
+ dialog = XmCreateSelectionBox (arshell.gui.widgets.row, "dialog",
+ antiright.arguments,
+ antiright.arguments_int);
+ arshell_prompt_remove_buttons (dialog);
+ arshell_setup_prompt_dialog_callbacks (dialog);
+ XtManageChild (dialog);
ARCLARG;
- XmStringFree(motif_string);
+ XmStringFree (motif_string);
}
void
-arshell_file_select_cb(Widget widget,
- XtPointer client_data, XtPointer call_data)
+arshell_file_select_cb (Widget widget,
+ XtPointer client_data, XtPointer call_data)
{
- XmFileSelectionBoxCallbackStruct *call_pointer=call_data;
- char *value=antiright_c_string(call_pointer->value);
- puts(value);
- XtFree(value);
- widget=NULL;
- client_data=NULL;
- exit(0);
+ XmFileSelectionBoxCallbackStruct *call_pointer = call_data;
+ char *value = antiright_c_string (call_pointer->value);
+ puts (value);
+ XtFree (value);
+ widget = NULL;
+ client_data = NULL;
+ exit (0);
}
void
-arshell_setup_file_selection_dialog_callbacks(Widget dialog)
+arshell_setup_file_selection_dialog_callbacks (Widget dialog)
{
- XtAddCallback(dialog, XmNokCallback, arshell_file_select_cb, NULL);
- XtAddCallback(dialog, XmNcancelCallback, arshell_dialog_cb, NULL);
- XtAddCallback(dialog, XmNhelpCallback, antiright_help_cb,
- "Use_this_dialog_to_select_a_file.");
+ XtAddCallback (dialog, XmNokCallback, arshell_file_select_cb, NULL);
+ XtAddCallback (dialog, XmNcancelCallback, arshell_dialog_cb, NULL);
+ XtAddCallback (dialog, XmNhelpCallback, antiright_help_cb,
+ "Use_this_dialog_to_select_a_file.");
}
void
-arshell_file_select_dialog()
+arshell_file_select_dialog ()
{
Widget dialog;
ARCLARG;
- dialog=XmCreateFileSelectionBox(arshell.gui.widgets.row, "dialog",
- antiright.arguments, antiright.arguments_int);
- arshell_setup_file_selection_dialog_callbacks(dialog);
- XtManageChild(dialog);
+ dialog = XmCreateFileSelectionBox (arshell.gui.widgets.row, "dialog",
+ antiright.arguments,
+ antiright.arguments_int);
+ arshell_setup_file_selection_dialog_callbacks (dialog);
+ XtManageChild (dialog);
ARCLARG;
}
+
void
-arshell_handle_dialog_arguments(int *counter_int, char **argv)
+arshell_handle_dialog_arguments (int *counter_int, char **argv)
{
/* The following add dialogs to the main row as opposed to creating
a new shell. */
- switch(argv[(*counter_int)][3])
+ switch (argv[(*counter_int)][3])
{
case 'F':
- arshell_font_dialog();
+ arshell_font_dialog ();
break;
- case 'f': /* Create a file selection dialog. */
- arshell_file_select_dialog();
+ case 'f': /* Create a file selection dialog. */
+ arshell_file_select_dialog ();
break;
case 'm':
- arshell_message_dialog(counter_int, argv);
+ arshell_message_dialog (counter_int, argv);
break;
- case 'p': /* Create a prompt dialog. */
- arshell_prompt_dialog(counter_int, argv);
+ case 'p': /* Create a prompt dialog. */
+ arshell_prompt_dialog (counter_int, argv);
break;
}
}
Index: antiright/src/arshell/dialog.h
diff -u antiright/src/arshell/dialog.h:1.5 antiright/src/arshell/dialog.h:1.6
--- antiright/src/arshell/dialog.h:1.5 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/dialog.h Sun Jul 31 16:19:50 2005
@@ -24,16 +24,12 @@
#define AR_DIALOG_H
void
-arshell_dialog_cb(Widget widget, XtPointer client_data, XtPointer call_data);
+arshell_dialog_cb (Widget widget, XtPointer client_data, XtPointer call_data);
+void arshell_message_dialog (int *counter_int, char **argv);
void
-arshell_message_dialog(int *counter_int, char **argv);
-void
-arshell_prompt_cb(Widget widget, XtPointer client_data, XtPointer call_data);
-void
-arshell_prompt_dialog(int *counter_int, char **argv);
-void
-arshell_file_select_dialog();
-void
-arshell_handle_dialog_arguments(int *counter_int, char **argv);
+arshell_prompt_cb (Widget widget, XtPointer client_data, XtPointer call_data);
+void arshell_prompt_dialog (int *counter_int, char **argv);
+void arshell_file_select_dialog ();
+void arshell_handle_dialog_arguments (int *counter_int, char **argv);
#endif /* AR_DIALOG_H */
Index: antiright/src/arshell/file.c
diff -u antiright/src/arshell/file.c:1.9 antiright/src/arshell/file.c:1.10
--- antiright/src/arshell/file.c:1.9 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/file.c Sun Jul 31 16:19:50 2005
@@ -22,164 +22,163 @@
#include "arshell.h"
void
-arshell_insert_file_cb()
-{
- char *file=antiright_pipe_read("cat `arshell -ADf`");
- XmTextInsert(arshell.gui.widgets.work,
- XmTextGetInsertionPosition(arshell.gui.widgets.work),
- file);
- free(file);
+arshell_insert_file_cb ()
+{
+ char *file = antiright_pipe_read ("cat `arshell -ADf`");
+ XmTextInsert (arshell.gui.widgets.work,
+ XmTextGetInsertionPosition (arshell.gui.widgets.work), file);
+ free (file);
}
void
-arshell_open_file_cb(Widget parent_widget,
- XtPointer client_data,
- XtPointer call_data)
-{
+arshell_open_file_cb (Widget parent_widget,
+ XtPointer client_data, XtPointer call_data)
+{
char *label;
XmString motif_string;
ARCLARG;
- antiright_set(XmNlabelString, (XtArgVal)&motif_string);
- antiright_get_values(parent_widget);
- label=antiright_c_string(motif_string);
- XmStringFree(motif_string);
- strncpy(arshell.edit.filename, label, ARSHELL_MAX_STRLEN);
- free(label);
- arshell.edit.open_is_MDI=True;
- arshell_open_file();
- call_data=NULL;
- client_data=NULL;
+ antiright_set (XmNlabelString, (XtArgVal) & motif_string);
+ antiright_get_values (parent_widget);
+ label = antiright_c_string (motif_string);
+ XmStringFree (motif_string);
+ strncpy (arshell.edit.filename, label, ARSHELL_MAX_STRLEN);
+ free (label);
+ arshell.edit.open_is_MDI = True;
+ arshell_open_file ();
+ call_data = NULL;
+ client_data = NULL;
}
void
-arshell_open_file()
-{
+arshell_open_file ()
+{
char *command_string;
char *buffer;
- antiright_get_file_type(arshell.edit.filename);
- asprintf(&command_string, "cat %s", arshell.edit.filename);
- buffer=antiright_pipe_read(command_string);
- free(command_string);
- XmTextSetString(arshell.gui.widgets.work, buffer);
- free(buffer);
- if(!arshell.edit.open_is_MDI)
- antiright_button(arshell.gui.menubar.view_widget, arshell.edit.filename,
- arshell_open_file_cb, NULL);
+ antiright_get_file_type (arshell.edit.filename);
+ asprintf (&command_string, "cat %s", arshell.edit.filename);
+ buffer = antiright_pipe_read (command_string);
+ free (command_string);
+ XmTextSetString (arshell.gui.widgets.work, buffer);
+ free (buffer);
+ if (!arshell.edit.open_is_MDI)
+ antiright_button (arshell.gui.menubar.view_widget, arshell.edit.filename,
+ arshell_open_file_cb, NULL);
else
- arshell.edit.open_is_MDI=False;
+ arshell.edit.open_is_MDI = False;
}
void
-arshell_revert_file_cb()
+arshell_revert_file_cb ()
{
- arshell.edit.open_is_MDI=True;
- arshell_open_file();
+ arshell.edit.open_is_MDI = True;
+ arshell_open_file ();
}
void
-arshell_file_select_ok_cb(Widget widget,
- XtPointer client_data,
- XtPointer call_data)
+arshell_file_select_ok_cb (Widget widget,
+ XtPointer client_data, XtPointer call_data)
{
- XmFileSelectionBoxCallbackStruct *call_pointer=call_data;
+ XmFileSelectionBoxCallbackStruct *call_pointer = call_data;
char *c_string;
/* if(arshell.flags.file_open)
- {
- arshell_save_work_area();
- }*/
-
- c_string=antiright_c_string(call_pointer->value);
- strncpy(arshell.edit.filename, c_string, ARSHELL_MAX_STRLEN);
- XtFree(c_string);
- XtDestroyWidget(widget);
+ {
+ arshell_save_work_area();
+ } */
+
+ c_string = antiright_c_string (call_pointer->value);
+ strncpy (arshell.edit.filename, c_string, ARSHELL_MAX_STRLEN);
+ XtFree (c_string);
+ XtDestroyWidget (widget);
- if(arshell.flags.saving && !arshell.flags.opening)
+ if (arshell.flags.saving && !arshell.flags.opening)
{
- arshell.flags.file_open=True;
- arshell_save_work_area();
- arshell.flags.saving=False;
+ arshell.flags.file_open = True;
+ arshell_save_work_area ();
+ arshell.flags.saving = False;
}
- if(arshell.flags.opening)
+ if (arshell.flags.opening)
{
- arshell_open_file();
- arshell.flags.file_open=True;
- arshell.flags.opening=False;
+ arshell_open_file ();
+ arshell.flags.file_open = True;
+ arshell.flags.opening = False;
}
- client_data=NULL;
+ client_data = NULL;
}
void
-arshell_select_filename()
+arshell_select_filename ()
{
-
+
Widget file_selection_widget;
ARCLARG;
- antiright_set(XmNtitle, (XtArgVal)"File Selector");
- file_selection_widget=XmCreateFileSelectionDialog(antiright.parent_widget,
- "file_selection_widget",
- antiright.arguments,
- antiright.arguments_int);
- antiright_set_widget_title(file_selection_widget, "File Selector");
- XtManageChild(file_selection_widget);
- XtAddCallback(file_selection_widget, XmNcancelCallback,
- antiright_close_cb, NULL);
- XtAddCallback(file_selection_widget, XmNhelpCallback,
- antiright_help_cb, "Use_this_dialog_to_select_a_file.");
- XtAddCallback(file_selection_widget, XmNokCallback,
- arshell_file_select_ok_cb, NULL);
+ antiright_set (XmNtitle, (XtArgVal) "File Selector");
+ file_selection_widget =
+ XmCreateFileSelectionDialog (antiright.parent_widget,
+ "file_selection_widget", antiright.arguments,
+ antiright.arguments_int);
+ antiright_set_widget_title (file_selection_widget, "File Selector");
+ XtManageChild (file_selection_widget);
+ XtAddCallback (file_selection_widget, XmNcancelCallback,
+ antiright_close_cb, NULL);
+ XtAddCallback (file_selection_widget, XmNhelpCallback,
+ antiright_help_cb, "Use_this_dialog_to_select_a_file.");
+ XtAddCallback (file_selection_widget, XmNokCallback,
+ arshell_file_select_ok_cb, NULL);
}
+
void
-arshell_put_text_into_file(FILE *file)
-{
+arshell_put_text_into_file (FILE * file)
+{
char *text_string;
- assert(arshell.gui.widgets.work != NULL);
- text_string=XmTextGetString(arshell.gui.widgets.work);
- fprintf(file, "%s\n", text_string);
- XtFree(text_string);
+ assert (arshell.gui.widgets.work != NULL);
+ text_string = XmTextGetString (arshell.gui.widgets.work);
+ fprintf (file, "%s\n", text_string);
+ XtFree (text_string);
}
+
void
-arshell_open_file_for_writing(FILE **file_pointer)
-{
- (*file_pointer)=fopen(arshell.edit.filename, "w");
- if((*file_pointer)==NULL)
+arshell_open_file_for_writing (FILE ** file_pointer)
+{
+ (*file_pointer) = fopen (arshell.edit.filename, "w");
+ if ((*file_pointer) == NULL)
{
- arshell_select_filename();
+ arshell_select_filename ();
}
}
void
-arshell_save_work_area()
+arshell_save_work_area ()
{
- FILE* file_pointer;
- arshell.flags.saving=True;
- if(arshell.flags.file_open==False)
- {
- arshell_select_filename();
+ FILE *file_pointer;
+ arshell.flags.saving = True;
+ if (arshell.flags.file_open == False)
+ {
+ arshell_select_filename ();
}
else
- {
- arshell_open_file_for_writing(&file_pointer);
- arshell_put_text_into_file(file_pointer);
- fclose(file_pointer);
- arshell_get_rid_of_modified_status();
- antiright_set_title(arshell.edit.filename);
+ {
+ arshell_open_file_for_writing (&file_pointer);
+ arshell_put_text_into_file (file_pointer);
+ fclose (file_pointer);
+ arshell_get_rid_of_modified_status ();
+ antiright_set_title (arshell.edit.filename);
}
}
void
-arshell_save_as_cb()
-{
- arshell.flags.saving=True;
- arshell_select_filename();
+arshell_save_as_cb ()
+{
+ arshell.flags.saving = True;
+ arshell_select_filename ();
}
void
-arshell_open_cb()
+arshell_open_cb ()
{
- arshell.flags.opening=True;
- arshell.flags.saving=False;
- arshell_select_filename();
+ arshell.flags.opening = True;
+ arshell.flags.saving = False;
+ arshell_select_filename ();
}
Index: antiright/src/arshell/file.h
diff -u antiright/src/arshell/file.h:1.5 antiright/src/arshell/file.h:1.6
--- antiright/src/arshell/file.h:1.5 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/file.h Sun Jul 31 16:19:50 2005
@@ -23,27 +23,17 @@
#ifndef ARSHELL_FILE_H
#define ARSHELL_FILE_H
+void arshell_insert_file_cb ();
void
-arshell_insert_file_cb();
-void
-arshell_open_file_cb(Widget parent_widget,
- XtPointer client_data,
- XtPointer call_data);
-void
-arshell_open_file();
-void
-arshell_select_filename();
-void
-arshell_put_text_into_file(FILE *file);
-void
-arshell_open_file_for_writing(FILE **file_pointer);
-void
-arshell_save_work_area();
-void
-arshell_save_as_cb();
-void
-arshell_open_cb();
-void
-arshell_revert_file_cb();
+arshell_open_file_cb (Widget parent_widget,
+ XtPointer client_data, XtPointer call_data);
+void arshell_open_file ();
+void arshell_select_filename ();
+void arshell_put_text_into_file (FILE * file);
+void arshell_open_file_for_writing (FILE ** file_pointer);
+void arshell_save_work_area ();
+void arshell_save_as_cb ();
+void arshell_open_cb ();
+void arshell_revert_file_cb ();
#endif /* ARSHELL_FILE_H */
Index: antiright/src/arshell/interface_file.h
diff -u antiright/src/arshell/interface_file.h:1.4
antiright/src/arshell/interface_file.h:1.5
--- antiright/src/arshell/interface_file.h:1.4 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/interface_file.h Sun Jul 31 16:19:50 2005
@@ -23,7 +23,6 @@
#ifndef INTERFACE_FILE_H
#define INTERFACE_FILE_H
-void
-arshell_parse_interface_file(char *filename);
+void arshell_parse_interface_file (char *filename);
#endif /* INTERFACE_FILE_H */
Index: antiright/src/arshell/layout.c
diff -u antiright/src/arshell/layout.c:1.7 antiright/src/arshell/layout.c:1.8
--- antiright/src/arshell/layout.c:1.7 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/layout.c Sun Jul 31 16:19:50 2005
@@ -23,85 +23,85 @@
#include "arshell.h"
void
-arshell_lower_mainwindow_cb()
+arshell_lower_mainwindow_cb ()
{
- XLowerWindow(antiright.display, XtWindow(antiright.parent_widget));
+ XLowerWindow (antiright.display, XtWindow (antiright.parent_widget));
}
void
-arshell_layout_mainwindow()
+arshell_layout_mainwindow ()
{
- arshell_setup_work_window();
- arshell_setup_menubar();
- arshell_setup_message_window();
+ arshell_setup_work_window ();
+ arshell_setup_menubar ();
+ arshell_setup_message_window ();
}
void
-arshell_set_rows(int *counter_int, char **argv)
+arshell_set_rows (int *counter_int, char **argv)
{
(*counter_int)++;
- arshell.gui.layout.rows_int=atoi(argv[(*counter_int)]);
- arshell.gui.layout.row_counter_int=arshell.gui.layout.rows_int;
+ arshell.gui.layout.rows_int = atoi (argv[(*counter_int)]);
+ arshell.gui.layout.row_counter_int = arshell.gui.layout.rows_int;
}
void
-arshell_initialize_row_manager()
+arshell_initialize_row_manager ()
{
ARCLARG;
- antiright_set(XmNorientation, XmHORIZONTAL);
- antiright_set(XmNmarginWidth, 0);
- antiright_set(XmNmarginHeight, 0);
- antiright_set(XmNpacking, XmPACK_TIGHT);
- antiright_set(XmNspacing, 0);
- arshell.gui.layout.row_manager_widget=
- antiright_row(arshell.gui.widgets.row);
+ antiright_set (XmNorientation, XmHORIZONTAL);
+ antiright_set (XmNmarginWidth, 0);
+ antiright_set (XmNmarginHeight, 0);
+ antiright_set (XmNpacking, XmPACK_TIGHT);
+ antiright_set (XmNspacing, 0);
+ arshell.gui.layout.row_manager_widget =
+ antiright_row (arshell.gui.widgets.row);
}
void
-arshell_initialize_row_manager_if_necessary()
+arshell_initialize_row_manager_if_necessary ()
{
- if(arshell.gui.layout.row_manager_widget == NULL)
+ if (arshell.gui.layout.row_manager_widget == NULL)
{
- arshell_initialize_row_manager();
- arshell_create_new_row();
+ arshell_initialize_row_manager ();
+ arshell_create_new_row ();
}
}
void
-arshell_create_new_row()
+arshell_create_new_row ()
{
ARCLARG;
- antiright_set(XmNorientation, XmVERTICAL);
- antiright_set(XmNmarginWidth, 0);
- antiright_set(XmNmarginHeight, 0);
- antiright_set(XmNpacking, XmPACK_TIGHT);
- antiright_set(XmNspacing, 0);
- assert(arshell.gui.layout.row_manager_widget);
- arshell.gui.layout.row_widget=
- antiright_row(arshell.gui.layout.row_manager_widget);
- arshell.gui.layout.row_counter_int=arshell.gui.layout.rows_int;
+ antiright_set (XmNorientation, XmVERTICAL);
+ antiright_set (XmNmarginWidth, 0);
+ antiright_set (XmNmarginHeight, 0);
+ antiright_set (XmNpacking, XmPACK_TIGHT);
+ antiright_set (XmNspacing, 0);
+ assert (arshell.gui.layout.row_manager_widget);
+ arshell.gui.layout.row_widget =
+ antiright_row (arshell.gui.layout.row_manager_widget);
+ arshell.gui.layout.row_counter_int = arshell.gui.layout.rows_int;
}
void
-arshell_create_new_row_if_necessary()
+arshell_create_new_row_if_necessary ()
{
- if(arshell.gui.layout.row_counter_int==0)
- arshell_create_new_row();
+ if (arshell.gui.layout.row_counter_int == 0)
+ arshell_create_new_row ();
}
void
-arshell_row_layout()
-{
- arshell_initialize_row_manager_if_necessary();
- arshell_create_new_row_if_necessary();
+arshell_row_layout ()
+{
+ arshell_initialize_row_manager_if_necessary ();
+ arshell_create_new_row_if_necessary ();
arshell.gui.layout.row_counter_int--;
}
void
-arshell_initialize_layout_values()
+arshell_initialize_layout_values ()
{
- arshell.gui.layout.row_manager_widget=NULL;
- arshell.gui.layout.row_widget=NULL;
- arshell.gui.layout.row_counter_int=0;
- arshell.gui.layout.rows_int=8;
+ arshell.gui.layout.row_manager_widget = NULL;
+ arshell.gui.layout.row_widget = NULL;
+ arshell.gui.layout.row_counter_int = 0;
+ arshell.gui.layout.rows_int = 8;
}
Index: antiright/src/arshell/layout.h
diff -u antiright/src/arshell/layout.h:1.7 antiright/src/arshell/layout.h:1.8
--- antiright/src/arshell/layout.h:1.7 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/layout.h Sun Jul 31 16:19:50 2005
@@ -31,31 +31,22 @@
int rows_int;
};
-void
-arshell_lower_mainwindow_cb();
+void arshell_lower_mainwindow_cb ();
-void
-arshell_layout_mainwindow();
+void arshell_layout_mainwindow ();
-void
-arshell_set_rows(int *counter_int, char **argv);
+void arshell_set_rows (int *counter_int, char **argv);
-void
-arshell_initialize_row_manager();
+void arshell_initialize_row_manager ();
-void
-arshell_initialize_row_manager_if_necessary();
+void arshell_initialize_row_manager_if_necessary ();
-void
-arshell_create_new_row();
+void arshell_create_new_row ();
-void
-arshell_create_new_row_if_necessary();
+void arshell_create_new_row_if_necessary ();
-void
-arshell_row_layout();
+void arshell_row_layout ();
-void
-arshell_initialize_layout_values();
+void arshell_initialize_layout_values ();
#endif /* AR_LAYOUT_H */
Index: antiright/src/arshell/main.c
diff -u antiright/src/arshell/main.c:1.8 antiright/src/arshell/main.c:1.9
--- antiright/src/arshell/main.c:1.8 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/main.c Sun Jul 31 16:19:50 2005
@@ -24,19 +24,18 @@
#include "../bitmaps/antiright.xpm"
int
-main(int argc, char **argv)
+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();
-
- arshell_handle_command_line_arguments(&argc, argv);
-
- arshell_layout_mainwindow();
-
- arshell_start_event_loop();
- return(0);
+ 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 ();
+
+ arshell_handle_command_line_arguments (&argc, argv);
+
+ arshell_layout_mainwindow ();
+
+ arshell_start_event_loop ();
+ return (0);
}
Index: antiright/src/arshell/main.h
diff -u antiright/src/arshell/main.h:1.4 antiright/src/arshell/main.h:1.5
--- antiright/src/arshell/main.h:1.4 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/main.h Sun Jul 31 16:19:50 2005
@@ -20,5 +20,4 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
-int
-main(int argc, char **argv);
+int main (int argc, char **argv);
Index: antiright/src/arshell/menubar.c
diff -u antiright/src/arshell/menubar.c:1.14
antiright/src/arshell/menubar.c:1.15
--- antiright/src/arshell/menubar.c:1.14 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/menubar.c Sun Jul 31 16:19:50 2005
@@ -30,266 +30,269 @@
#include "../bitmaps/print.xpm"
void
-arshell_setup_menubar()
+arshell_setup_menubar ()
{
- if(arshell.gui.menubar.menubar_widget!=NULL)
+ if (arshell.gui.menubar.menubar_widget != NULL)
{
- XtVaSetValues(arshell.gui.widgets.mainwindow,
- XmNmenuBar, arshell.gui.menubar.menubar_widget,
- NULL);
+ XtVaSetValues (arshell.gui.widgets.mainwindow,
+ XmNmenuBar, arshell.gui.menubar.menubar_widget, NULL);
}
}
void
-arshell_default_menubar_action()
+arshell_default_menubar_action ()
{
- antiright_set(XmNorientation, XmHORIZONTAL);
- arshell.gui.menubar=
- antiright_defined_menubar(arshell.gui.widgets.mainwindow, NULL);
- arshell.flags.use_menubar=True;
+ antiright_set (XmNorientation, XmHORIZONTAL);
+ arshell.gui.menubar =
+ antiright_defined_menubar (arshell.gui.widgets.mainwindow, NULL);
+ arshell.flags.use_menubar = True;
}
+
void
-arshell_align_left(Widget widget)
+arshell_align_left (Widget widget)
{
- ARCLARG;
- antiright_set(XmNalignment, XmALIGNMENT_BEGINNING);
- antiright_set_values(widget);
+ ARCLARG;
+ antiright_set (XmNalignment, XmALIGNMENT_BEGINNING);
+ antiright_set_values (widget);
}
+
void
-arshell_add_button_to_file_menu(int *counter_int, char **argv)
+arshell_add_button_to_file_menu (int *counter_int, char **argv)
{
Widget button;
(*counter_int)++;
- button=arshell_optioned_button(arshell.gui.menubar.file_widget,
- arshell_system_cb,
- argv[(*counter_int)]);
- arshell_align_left(button);
+ button = arshell_optioned_button (arshell.gui.menubar.file_widget,
+ arshell_system_cb, argv[(*counter_int)]);
+ arshell_align_left (button);
}
+
void
-arshell_add_button_to_edit_menu(int *counter_int, char **argv)
+arshell_add_button_to_edit_menu (int *counter_int, char **argv)
{
(*counter_int)++;
- if((arshell.gui.widgets.work != NULL))
+ if ((arshell.gui.widgets.work != NULL))
{
- Widget button;
- if(arshell.gui.menubar.edit_widget==NULL)
+ Widget button;
+ if (arshell.gui.menubar.edit_widget == NULL)
{
- antiright_edit_menu(arshell.gui.menubar.menubar_widget,
- arshell.gui.widgets.work);
+ antiright_edit_menu (arshell.gui.menubar.menubar_widget,
+ arshell.gui.widgets.work);
}
- button=arshell_optioned_button(arshell.gui.menubar.edit_widget,
- arshell_system_cb,
- argv[(*counter_int)]);
- arshell_align_left(button);
+ button = arshell_optioned_button (arshell.gui.menubar.edit_widget,
+ arshell_system_cb,
+ argv[(*counter_int)]);
+ arshell_align_left (button);
}
}
void
-arshell_add_button_to_view_menu(int* counter_int, char** argv)
+arshell_add_button_to_view_menu (int *counter_int, char **argv)
{
- Widget button;
+ Widget button;
(*counter_int)++;
- button=arshell_optioned_button(arshell.gui.menubar.view_widget,
- arshell_system_cb,
- argv[(*counter_int)]);
- arshell_align_left(button);
+ button = arshell_optioned_button (arshell.gui.menubar.view_widget,
+ arshell_system_cb, argv[(*counter_int)]);
+ arshell_align_left (button);
}
+
void
-arshell_add_button_to_help_menu(int *counter_int, char **argv)
+arshell_add_button_to_help_menu (int *counter_int, char **argv)
{
- Widget button;
+ Widget button;
(*counter_int)++;
- button=arshell_optioned_button(arshell.gui.menubar.help_widget,
- arshell_system_cb,
- argv[(*counter_int)]);
- arshell_align_left(button);
+ button = arshell_optioned_button (arshell.gui.menubar.help_widget,
+ arshell_system_cb, argv[(*counter_int)]);
+ arshell_align_left (button);
}
void
-arshell_handle_menubar_sub_arguments(int* counter_int, char** argv)
+arshell_handle_menubar_sub_arguments (int *counter_int, char **argv)
{
- switch(argv[(*counter_int)][3])
+ switch (argv[(*counter_int)][3])
{
case 'f':
- arshell_add_button_to_file_menu(counter_int, argv);
+ arshell_add_button_to_file_menu (counter_int, argv);
break;
case 'e':
- arshell_add_button_to_edit_menu(counter_int, argv);
+ arshell_add_button_to_edit_menu (counter_int, argv);
break;
case 'v':
- arshell_add_button_to_view_menu(counter_int, argv);
+ arshell_add_button_to_view_menu (counter_int, argv);
break;
case 'h':
- arshell_add_button_to_help_menu(counter_int, argv);
+ arshell_add_button_to_help_menu (counter_int, argv);
break;
default:
- arshell_default_menubar_action(arshell.gui.widgets.row,
- arshell.gui.menubar);
+ arshell_default_menubar_action (arshell.gui.widgets.row,
+ arshell.gui.menubar);
break;
}
}
void
-arshell_hide_sticky_note_toolbar()
+arshell_hide_sticky_note_toolbar ()
{
char *title;
ARCLARG;
- antiright_set(XmNtitle, (XtArgVal)&title);
- antiright_get_values(antiright.parent_widget);
- if((title[0]=='S') & (title[1]=='t') & (title[2]=='i'))
+ antiright_set (XmNtitle, (XtArgVal) & title);
+ antiright_get_values (antiright.parent_widget);
+ if ((title[0] == 'S') & (title[1] == 't') & (title[2] == 'i'))
{
- XtUnmanageChild(XtParent(arshell.gui.layout.row_manager_widget));
+ XtUnmanageChild (XtParent (arshell.gui.layout.row_manager_widget));
}
ARCLARG;
}
Widget
-antiright_toolbar_button(Widget parent, char *description, char **icon,
- XtCallbackProc callback, XtPointer client_data)
+antiright_toolbar_button (Widget parent, char *description, char **icon,
+ XtCallbackProc callback, XtPointer client_data)
{
Widget button;
ARCLARG;
- antiright_set(XmNshadowThickness, 0);
- button=antiright_button(parent, "button", callback, client_data);
- antiright_set_tooltip(button, description);
- antiright_set_pixmap_from_data(button, icon);
+ antiright_set (XmNshadowThickness, 0);
+ button = antiright_button (parent, "button", callback, client_data);
+ antiright_set_tooltip (button, description);
+ antiright_set_pixmap_from_data (button, icon);
ARCLARG;
- return(button);
+ return (button);
}
Widget
-arshell_toolbar_button(char *description, char **icon,
- XtCallbackProc callback, XtPointer client_data)
+arshell_toolbar_button (char *description, char **icon,
+ XtCallbackProc callback, XtPointer client_data)
{
- return(antiright_toolbar_button(arshell.gui.layout.row_manager_widget,
- description, icon,
- callback, client_data));
+ return (antiright_toolbar_button (arshell.gui.layout.row_manager_widget,
+ description, icon,
+ callback, client_data));
}
void
-arshell_toggle_toolbar_cb(Widget widget,
- XtPointer client_data, XtPointer call_data)
+arshell_toggle_toolbar_cb (Widget widget,
+ XtPointer client_data, XtPointer call_data)
{
- if(XmToggleButtonGetState(widget))
+ if (XmToggleButtonGetState (widget))
{
- if(!XtIsManaged(XtParent(arshell.gui.layout.row_manager_widget)))
+ if (!XtIsManaged (XtParent (arshell.gui.layout.row_manager_widget)))
{
- XtManageChild(XtParent(arshell.gui.layout.row_manager_widget));
+ XtManageChild (XtParent (arshell.gui.layout.row_manager_widget));
}
}
else
{
- if(XtIsManaged(XtParent(arshell.gui.layout.row_manager_widget)))
+ if (XtIsManaged (XtParent (arshell.gui.layout.row_manager_widget)))
{
- XtUnmanageChild(XtParent(arshell.gui.layout.row_manager_widget));
+ XtUnmanageChild (XtParent (arshell.gui.layout.row_manager_widget));
}
}
- client_data=NULL;
- call_data=NULL;
+ client_data = NULL;
+ call_data = NULL;
}
void
-arshell_setup_editor_toolbar()
+arshell_setup_editor_toolbar ()
{
- arshell_initialize_row_manager();
+ arshell_initialize_row_manager ();
/* ARCLARG;
- antiright_set(XmNmarginWidth, 0);
- antiright_set(XmNmarginHeight, 0);
- antiright_set(XmNpacking, XmPACK_TIGHT);
- antiright_set(XmNorientation, XmHORIZONTAL);
- antiright_set(XmNspacing, 0);
- arshell.edit.toolbar=
- antiright_row(arshell.gui.layout.row_manager_widget);*/
-
- arshell_hide_sticky_note_toolbar();
- arshell_toolbar_button("Open a file.", open_xpm,
- arshell_open_cb, NULL);
- arshell_toolbar_button("Save the current file.", save_xpm,
- arshell_save_work_area, NULL);
- arshell_toolbar_button("Print the current file.", print_xpm,
- arshell_print_cb, NULL);
- arshell_toolbar_button("Cut the selection into the clipboard.", cut_xpm,
- antiright_cut_cb, arshell.gui.widgets.work);
- arshell_toolbar_button("Copy the selection into the clipboard.", copy_xpm,
- antiright_copy_cb, arshell.gui.widgets.work);
- arshell_toolbar_button("Paste the contents of the clipboard.", paste_xpm,
- antiright_paste_cb, arshell.gui.widgets.work);
- arshell_toolbar_button("Search for and optionally replace text.", search_xpm,
- arshell_search_replace_cb, NULL);
- arshell_row_layout();
+ antiright_set(XmNmarginWidth, 0);
+ antiright_set(XmNmarginHeight, 0);
+ antiright_set(XmNpacking, XmPACK_TIGHT);
+ antiright_set(XmNorientation, XmHORIZONTAL);
+ antiright_set(XmNspacing, 0);
+ arshell.edit.toolbar=
+ antiright_row(arshell.gui.layout.row_manager_widget); */
+
+ arshell_hide_sticky_note_toolbar ();
+ arshell_toolbar_button ("Open a file.", open_xpm, arshell_open_cb, NULL);
+ arshell_toolbar_button ("Save the current file.", save_xpm,
+ arshell_save_work_area, NULL);
+ arshell_toolbar_button ("Print the current file.", print_xpm,
+ arshell_print_cb, NULL);
+ arshell_toolbar_button ("Cut the selection into the clipboard.", cut_xpm,
+ antiright_cut_cb, arshell.gui.widgets.work);
+ arshell_toolbar_button ("Copy the selection into the clipboard.", copy_xpm,
+ antiright_copy_cb, arshell.gui.widgets.work);
+ arshell_toolbar_button ("Paste the contents of the clipboard.", paste_xpm,
+ antiright_paste_cb, arshell.gui.widgets.work);
+ arshell_toolbar_button ("Search for and optionally replace text.",
+ search_xpm, arshell_search_replace_cb, NULL);
+ arshell_row_layout ();
}
void
-arshell_setup_work_menubar()
+arshell_setup_work_menubar ()
{
Widget toggle_widget;
ARCLARG;
- arshell_setup_editor_toolbar();
+ arshell_setup_editor_toolbar ();
ARCLARG;
- if(arshell.gui.menubar.menubar_widget != NULL)
+ if (arshell.gui.menubar.menubar_widget != NULL)
{
- antiright_separator(arshell.gui.menubar.file_widget);
- antiright_button(arshell.gui.menubar.file_widget, "Save",
- arshell_save_work_area, NULL);
- antiright_button(arshell.gui.menubar.file_widget, "Save As",
- arshell_save_as_cb, NULL);
- antiright_separator(arshell.gui.menubar.file_widget);
- antiright_button(arshell.gui.menubar.file_widget, "Insert",
- arshell_insert_file_cb, NULL);
- antiright_button(arshell.gui.menubar.file_widget, "Open",
- arshell_open_cb, NULL);
- antiright_button(arshell.gui.menubar.file_widget, "Revert",
- arshell_revert_file_cb, NULL);
- antiright_separator(arshell.gui.menubar.file_widget);
- antiright_button(arshell.gui.menubar.file_widget, "Print",
- arshell_print_cb, NULL);
- antiright_button(arshell.gui.menubar.file_widget, "Spell Check",
- arshell_spell_check_buffer, NULL);
- arshell.gui.menubar.edit_widget=
- antiright_edit_menu(arshell.gui.menubar.menubar_widget,
- arshell.gui.widgets.work);
- antiright_separator(arshell.gui.menubar.edit_widget);
- antiright_button(arshell.gui.menubar.edit_widget, "Select All",
- arshell_select_all, NULL);
- antiright_separator(arshell.gui.menubar.edit_widget);
- antiright_button(arshell.gui.menubar.edit_widget, "Search/Replace",
- arshell_search_replace_cb, NULL);
- antiright_button(arshell.gui.menubar.edit_widget, "Find at Cursor",
- arshell_find_at_cursor_cb, NULL);
- antiright_button(arshell.gui.menubar.edit_widget, "Find Selected",
- arshell_find_selected, NULL);
- antiright_button(arshell.gui.menubar.edit_widget, "Go to Line",
- arshell_goto_line_cb, NULL);
- antiright_separator(arshell.gui.menubar.edit_widget);
- antiright_button(arshell.gui.menubar.edit_widget, "Lower Selection Case",
- arshell_lower_selection_case, NULL);
- antiright_button(arshell.gui.menubar.edit_widget, "Raise Selection Case",
- arshell_upper_selection_case, NULL);
- antiright_separator(arshell.gui.menubar.edit_widget);
- antiright_button(arshell.gui.menubar.edit_widget, "Comment Selected",
- antiright_comment_selection, arshell.gui.widgets.work);
- antiright_button(arshell.gui.menubar.edit_widget, "Uncomment Selected",
- antiright_uncomment_selection, arshell.gui.widgets.work);
- antiright_separator(arshell.gui.menubar.edit_widget);
- antiright_button(arshell.gui.menubar.edit_widget, "Fill Selected",
- antiright_fill_selection, arshell.gui.widgets.work);
- antiright_button(arshell.gui.menubar.edit_widget, "Fill All",
- antiright_fill_all, arshell.gui.widgets.work);
- antiright_separator(arshell.gui.menubar.view_widget);
+ antiright_separator (arshell.gui.menubar.file_widget);
+ antiright_button (arshell.gui.menubar.file_widget, "Save",
+ arshell_save_work_area, NULL);
+ antiright_button (arshell.gui.menubar.file_widget, "Save As",
+ arshell_save_as_cb, NULL);
+ antiright_separator (arshell.gui.menubar.file_widget);
+ antiright_button (arshell.gui.menubar.file_widget, "Insert",
+ arshell_insert_file_cb, NULL);
+ antiright_button (arshell.gui.menubar.file_widget, "Open",
+ arshell_open_cb, NULL);
+ antiright_button (arshell.gui.menubar.file_widget, "Revert",
+ arshell_revert_file_cb, NULL);
+ antiright_separator (arshell.gui.menubar.file_widget);
+ antiright_button (arshell.gui.menubar.file_widget, "Print",
+ arshell_print_cb, NULL);
+ antiright_button (arshell.gui.menubar.file_widget, "Spell Check",
+ arshell_spell_check_buffer, NULL);
+ arshell.gui.menubar.edit_widget =
+ antiright_edit_menu (arshell.gui.menubar.menubar_widget,
+ arshell.gui.widgets.work);
+ antiright_separator (arshell.gui.menubar.edit_widget);
+ antiright_button (arshell.gui.menubar.edit_widget, "Select All",
+ arshell_select_all, NULL);
+ antiright_separator (arshell.gui.menubar.edit_widget);
+ antiright_button (arshell.gui.menubar.edit_widget, "Search/Replace",
+ arshell_search_replace_cb, NULL);
+ antiright_button (arshell.gui.menubar.edit_widget, "Find at Cursor",
+ arshell_find_at_cursor_cb, NULL);
+ antiright_button (arshell.gui.menubar.edit_widget, "Find Selected",
+ arshell_find_selected, NULL);
+ antiright_button (arshell.gui.menubar.edit_widget, "Go to Line",
+ arshell_goto_line_cb, NULL);
+ antiright_separator (arshell.gui.menubar.edit_widget);
+ antiright_button (arshell.gui.menubar.edit_widget,
+ "Lower Selection Case", arshell_lower_selection_case,
+ NULL);
+ antiright_button (arshell.gui.menubar.edit_widget,
+ "Raise Selection Case", arshell_upper_selection_case,
+ NULL);
+ antiright_separator (arshell.gui.menubar.edit_widget);
+ antiright_button (arshell.gui.menubar.edit_widget, "Comment Selected",
+ antiright_comment_selection,
+ arshell.gui.widgets.work);
+ antiright_button (arshell.gui.menubar.edit_widget, "Uncomment Selected",
+ antiright_uncomment_selection,
+ arshell.gui.widgets.work);
+ antiright_separator (arshell.gui.menubar.edit_widget);
+ antiright_button (arshell.gui.menubar.edit_widget, "Fill Selected",
+ antiright_fill_selection, arshell.gui.widgets.work);
+ antiright_button (arshell.gui.menubar.edit_widget, "Fill All",
+ antiright_fill_all, arshell.gui.widgets.work);
+ antiright_separator (arshell.gui.menubar.view_widget);
ARCLARG;
- toggle_widget=XmCreateToggleButton(arshell.gui.menubar.view_widget,
- "Show/Hide Toolbar", ARARGS);
- XtManageChild(toggle_widget);
- if(XtIsManaged(XtParent(arshell.gui.layout.row_manager_widget)))
- XmToggleButtonSetState(toggle_widget, True, True);
- XtAddCallback(toggle_widget, XmNvalueChangedCallback,
- arshell_toggle_toolbar_cb, NULL);
+ toggle_widget = XmCreateToggleButton (arshell.gui.menubar.view_widget,
+ "Show/Hide Toolbar", ARARGS);
+ XtManageChild (toggle_widget);
+ if (XtIsManaged (XtParent (arshell.gui.layout.row_manager_widget)))
+ XmToggleButtonSetState (toggle_widget, True, True);
+ XtAddCallback (toggle_widget, XmNvalueChangedCallback,
+ arshell_toggle_toolbar_cb, NULL);
#if XmVERSION > 1 & XmREVISION > 1
- antiright_separator(arshell.gui.menubar.view_widget);
- antiright_button(arshell.gui.menubar.view_widget, "Change Font",
- arshell_change_font_cb, NULL);
+ antiright_separator (arshell.gui.menubar.view_widget);
+ antiright_button (arshell.gui.menubar.view_widget, "Change Font",
+ arshell_change_font_cb, NULL);
#endif /* XmVERSION > 1 & XmREVISION > 1 */
- antiright_separator(arshell.gui.menubar.view_widget);
+ antiright_separator (arshell.gui.menubar.view_widget);
}
-
+
}
Index: antiright/src/arshell/menubar.h
diff -u antiright/src/arshell/menubar.h:1.5 antiright/src/arshell/menubar.h:1.6
--- antiright/src/arshell/menubar.h:1.5 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/menubar.h Sun Jul 31 16:19:50 2005
@@ -23,29 +23,21 @@
#ifndef AR_MENUBAR_H
#define AR_MENUBAR_H
-void
-arshell_setup_menubar();
+void arshell_setup_menubar ();
-void
-arshell_default_menubar_action();
+void arshell_default_menubar_action ();
-void
-arshell_add_button_to_file_menu(int *counter_int, char **argv);
+void arshell_add_button_to_file_menu (int *counter_int, char **argv);
-void
-arshell_add_button_to_edit_menu(int *counter_int, char **argv);
+void arshell_add_button_to_edit_menu (int *counter_int, char **argv);
-void
-arshell_add_button_to_view_menu(int* counter_int, char** argv);
+void arshell_add_button_to_view_menu (int *counter_int, char **argv);
-void
-arshell_add_button_to_help_menu(int *counter_int, char **argv);
+void arshell_add_button_to_help_menu (int *counter_int, char **argv);
-void
-arshell_handle_menubar_sub_arguments(int* counter_int, char** argv);
+void arshell_handle_menubar_sub_arguments (int *counter_int, char **argv);
-void
-arshell_setup_work_menubar();
+void arshell_setup_work_menubar ();
#endif /* AR_MENUBAR_H */
Index: antiright/src/arshell/pixmap.c
diff -u antiright/src/arshell/pixmap.c:1.4 antiright/src/arshell/pixmap.c:1.5
--- antiright/src/arshell/pixmap.c:1.4 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/pixmap.c Sun Jul 31 16:19:50 2005
@@ -24,47 +24,50 @@
void
-arshell_hack_transparency_with_pixmap()
+arshell_hack_transparency_with_pixmap ()
{
char *icon;
- asprintf(&icon, "%s/antiright.xpm", (char*)ICONDIR);
- antiright_set_bitmap_from_file(antiright.parent_widget, icon);
- free(icon);
- arshell.transparency_hacked=True;
+ asprintf (&icon, "%s/antiright.xpm", (char *) ICONDIR);
+ antiright_set_bitmap_from_file (antiright.parent_widget, icon);
+ free (icon);
+ arshell.transparency_hacked = True;
}
+
void
-arshell_transparency_hack()
+arshell_transparency_hack ()
{
- if((arshell.gui.widgets.work==NULL) & !arshell.transparency_hacked)
+ if ((arshell.gui.widgets.work == NULL) & !arshell.transparency_hacked)
{
- arshell_hack_transparency_with_pixmap();
- }
+ arshell_hack_transparency_with_pixmap ();
+ }
}
void
-arshell_add_bitmap_button(int *counter_int, char **argv)
+arshell_add_bitmap_button (int *counter_int, char **argv)
{
Widget button;
- arshell_transparency_hack();
+ arshell_transparency_hack ();
(*counter_int)++;
- arshell_row_layout();
- button=antiright_icon_button(arshell.gui.layout.row_widget,
- argv[(*counter_int)], argv[(*counter_int)+1],
- arshell_system_cb, argv[(*counter_int)]);
- antiright_set_tooltip(button, argv[(*counter_int)]);
+ arshell_row_layout ();
+ button = antiright_icon_button (arshell.gui.layout.row_widget,
+ argv[(*counter_int)],
+ argv[(*counter_int) + 1], arshell_system_cb,
+ argv[(*counter_int)]);
+ antiright_set_tooltip (button, argv[(*counter_int)]);
(*counter_int)++;
}
+
void
-arshell_add_icon_button(int *counter_int, char **argv)
+arshell_add_icon_button (int *counter_int, char **argv)
{
Widget button;
- arshell_transparency_hack();
+ arshell_transparency_hack ();
(*counter_int)++;
- arshell_row_layout();
- button=antiright_button(arshell.gui.layout.row_widget, argv[(*counter_int)],
- arshell_system_cb, argv[(*counter_int)]);
- antiright_set_tooltip(button, argv[(*counter_int)]);
+ arshell_row_layout ();
+ button =
+ antiright_button (arshell.gui.layout.row_widget, argv[(*counter_int)],
+ arshell_system_cb, argv[(*counter_int)]);
+ antiright_set_tooltip (button, argv[(*counter_int)]);
(*counter_int)++;
- antiright_set_bitmap_from_file(button, argv[(*counter_int)]);
+ antiright_set_bitmap_from_file (button, argv[(*counter_int)]);
}
-
Index: antiright/src/arshell/pixmap.h
diff -u antiright/src/arshell/pixmap.h:1.4 antiright/src/arshell/pixmap.h:1.5
--- antiright/src/arshell/pixmap.h:1.4 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/pixmap.h Sun Jul 31 16:19:50 2005
@@ -24,20 +24,16 @@
/* This overcomes transparency problems with the first icon button
created by loading the window icon file. */
-void
-arshell_hack_transparency_with_pixmap();
+void arshell_hack_transparency_with_pixmap ();
/* This decides whether or not to run
arshell_hack_transparency_with_pixmap(). */
-void
-arshell_transparency_hack();
+void arshell_transparency_hack ();
/* This creates a bitmap/pixmap button with a label at the bottom. */
-void
-arshell_add_bitmap_button(int *counter_int, char **argv);
+void arshell_add_bitmap_button (int *counter_int, char **argv);
/* This creates a bitmap/pixmap button without a label. */
-void
-arshell_add_icon_button(int *counter_int, char **argv);
+void arshell_add_icon_button (int *counter_int, char **argv);
#endif /* not ARSHELL_PIXMAP_H */
Index: antiright/src/arshell/search.c
diff -u antiright/src/arshell/search.c:1.7 antiright/src/arshell/search.c:1.8
--- antiright/src/arshell/search.c:1.7 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/search.c Sun Jul 31 16:19:50 2005
@@ -24,373 +24,376 @@
#include <ctype.h>
XmTextPosition
-arshell_end_of_word(XmTextPosition start)
+arshell_end_of_word (XmTextPosition start)
{
- char *text=XmTextGetString(arshell.gui.widgets.work);
- XmTextPosition counter=start;
- XmTextPosition last=XmTextGetLastPosition(arshell.gui.widgets.work);
- while((text[counter]!=' ')&(counter<=last))
+ char *text = XmTextGetString (arshell.gui.widgets.work);
+ XmTextPosition counter = start;
+ XmTextPosition last = XmTextGetLastPosition (arshell.gui.widgets.work);
+ while ((text[counter] != ' ') & (counter <= last))
counter++;
- free(text);
- if(counter>last)
- return(start);
+ free (text);
+ if (counter > last)
+ return (start);
else
- return(counter);
+ return (counter);
}
void
-arshell_find_selected()
+arshell_find_selected ()
{
- char *selection=XmTextGetSelection(arshell.gui.widgets.work);
+ char *selection = XmTextGetSelection (arshell.gui.widgets.work);
XmTextPosition left;
XmTextPosition right;
XmTextPosition position;
- XmTextGetSelectionPosition(arshell.gui.widgets.work,
- &left, &right);
- if(selection != NULL)
+ XmTextGetSelectionPosition (arshell.gui.widgets.work, &left, &right);
+ if (selection != NULL)
{
- Boolean found=XmTextFindString(arshell.gui.widgets.work,
- right, selection,
- XmTEXT_BACKWARD, &position);
- if(found)
- {
- XmTextSetInsertionPosition(arshell.gui.widgets.work, position);
- XmTextSetSelection(arshell.gui.widgets.work, position,
- arshell_end_of_word(position),
- XtLastTimestampProcessed(antiright.display));
- }
+ Boolean found = XmTextFindString (arshell.gui.widgets.work,
+ right, selection,
+ XmTEXT_BACKWARD, &position);
+ if (found)
+ {
+ XmTextSetInsertionPosition (arshell.gui.widgets.work, position);
+ XmTextSetSelection (arshell.gui.widgets.work, position,
+ arshell_end_of_word (position),
+ XtLastTimestampProcessed (antiright.display));
+ }
else
- antiright_status("Not Found");
+ antiright_status ("Not Found");
}
-
- XtFree(selection);
+
+ XtFree (selection);
}
void
-arshell_find_at_cursor_cb()
+arshell_find_at_cursor_cb ()
{
- char *buffer=XmTextGetString(arshell.gui.widgets.work);
+ char *buffer = XmTextGetString (arshell.gui.widgets.work);
char word[255];
- int word_counter=0;
- XmTextPosition position=XmTextGetInsertionPosition(arshell.gui.widgets.work);
+ int word_counter = 0;
+ XmTextPosition position =
+ XmTextGetInsertionPosition (arshell.gui.widgets.work);
XmTextPosition begin_position;
- while(buffer[position]!=' ')
+ while (buffer[position] != ' ')
{
position--;
}
- begin_position=position;
+ begin_position = position;
position++;
- while(buffer[position]!=' ')
+ while (buffer[position] != ' ')
{
- word[word_counter]=buffer[position];
+ word[word_counter] = buffer[position];
word_counter++;
position++;
}
- word[word_counter]='\0';
- XmTextFindString(arshell.gui.widgets.work, position, word,
- XmTEXT_FORWARD, &position);
- if(position < XmTextGetLastPosition(arshell.gui.widgets.work))
- XmTextSetInsertionPosition(arshell.gui.widgets.work, position);
- XtFree(buffer);
+ word[word_counter] = '\0';
+ XmTextFindString (arshell.gui.widgets.work, position, word,
+ XmTEXT_FORWARD, &position);
+ if (position < XmTextGetLastPosition (arshell.gui.widgets.work))
+ XmTextSetInsertionPosition (arshell.gui.widgets.work, position);
+ XtFree (buffer);
}
void
-arshell_wrap_toggle_cb()
+arshell_wrap_toggle_cb ()
{
- arshell.edit.search_options.wrap=
- XmToggleButtonGetState(arshell.edit.search_options.wrap_toggle);
- XmToggleButtonSetState(arshell.edit.search_options.preserve_toggle,
- arshell.edit.search_options.wrap, True);
+ arshell.edit.search_options.wrap =
+ XmToggleButtonGetState (arshell.edit.search_options.wrap_toggle);
+ XmToggleButtonSetState (arshell.edit.search_options.preserve_toggle,
+ arshell.edit.search_options.wrap, True);
}
+
void
-arshell_preserve_toggle_cb()
+arshell_preserve_toggle_cb ()
{
- arshell.edit.search_options.preserve=
- XmToggleButtonGetState(arshell.edit.search_options.preserve_toggle);
+ arshell.edit.search_options.preserve =
+ XmToggleButtonGetState (arshell.edit.search_options.preserve_toggle);
}
+
void
-arshell_set_replacing_sensitivities()
+arshell_set_replacing_sensitivities ()
{
ARCLARG;
- antiright_set(XmNsensitive, True);
- antiright_set_values(arshell.edit.replace_widget);
- antiright_set_values(arshell.edit.search_options.replace_label);
+ antiright_set (XmNsensitive, True);
+ antiright_set_values (arshell.edit.replace_widget);
+ antiright_set_values (arshell.edit.search_options.replace_label);
ARCLARG;
}
+
void
-arshell_unset_replacing_sensitivities()
+arshell_unset_replacing_sensitivities ()
{
ARCLARG;
- antiright_set(XmNsensitive, False);
- antiright_set_values(arshell.edit.replace_widget);
- antiright_set_values(arshell.edit.search_options.replace_label);
+ antiright_set (XmNsensitive, False);
+ antiright_set_values (arshell.edit.replace_widget);
+ antiright_set_values (arshell.edit.search_options.replace_label);
ARCLARG;
}
+
void
-arshell_replace_toggle_cb()
+arshell_replace_toggle_cb ()
{
- arshell.edit.search_options.replace=
- XmToggleButtonGetState(arshell.edit.search_options.replace_toggle);
-
- if(arshell.edit.search_options.replace)
- arshell_set_replacing_sensitivities();
+ arshell.edit.search_options.replace =
+ XmToggleButtonGetState (arshell.edit.search_options.replace_toggle);
+
+ if (arshell.edit.search_options.replace)
+ arshell_set_replacing_sensitivities ();
else
- arshell_unset_replacing_sensitivities();
+ arshell_unset_replacing_sensitivities ();
}
+
void
-arshell_ignore_case_toggle_cb()
+arshell_ignore_case_toggle_cb ()
{
- arshell.edit.search_options.ignore_case=
- XmToggleButtonGetState(arshell.edit.search_options.ignore_case_toggle);
+ arshell.edit.search_options.ignore_case =
+ XmToggleButtonGetState (arshell.edit.search_options.ignore_case_toggle);
}
void
-arshell_search_replace_ok_cb(Widget widget,
- XtPointer client_data,
- XtPointer call_data)
+arshell_search_replace_ok_cb (Widget widget,
+ XtPointer client_data, XtPointer call_data)
{
XmTextPosition position;
char *search_string;
- char *backup_text=NULL;
+ char *backup_text = NULL;
/* The find widget is always used. */
- search_string=XmTextFieldGetString(arshell.edit.find_widget);
- assert(search_string != NULL);
- if(XmToggleButtonGetState(arshell.edit.search_options.ignore_case_toggle))
+ search_string = XmTextFieldGetString (arshell.edit.find_widget);
+ assert (search_string != NULL);
+ if (XmToggleButtonGetState (arshell.edit.search_options.ignore_case_toggle))
{
/* Convert the text buffer and search string to lower case so
- that case is not a factor in the search. */
- int counter=0;
+ that case is not a factor in the search. */
+ int counter = 0;
char *lowered_buffer;
- while(search_string[counter]!='\0')
+ while (search_string[counter] != '\0')
{
- search_string[counter]=tolower(search_string[counter]);
+ search_string[counter] = tolower (search_string[counter]);
counter++;
}
- backup_text=XmTextGetString(arshell.gui.widgets.work);
- lowered_buffer=XmTextGetString(arshell.gui.widgets.work);
- counter=0;
- while(lowered_buffer[counter]!='\0')
+ backup_text = XmTextGetString (arshell.gui.widgets.work);
+ lowered_buffer = XmTextGetString (arshell.gui.widgets.work);
+ counter = 0;
+ while (lowered_buffer[counter] != '\0')
{
- lowered_buffer[counter]=tolower(lowered_buffer[counter]);
+ lowered_buffer[counter] = tolower (lowered_buffer[counter]);
counter++;
}
- XmTextSetString(arshell.gui.widgets.work, lowered_buffer);
+ XmTextSetString (arshell.gui.widgets.work, lowered_buffer);
}
- client_data=NULL;
-
- if(arshell.edit.search_options.replace)
+ client_data = NULL;
+
+ if (arshell.edit.search_options.replace)
{
XmTextPosition end_position;
char *replacement_string;
-
- XmTextFindString(arshell.gui.widgets.work,
- XmTextGetInsertionPosition(arshell.gui.widgets.work),
- search_string,
- arshell.edit.search_options.direction,
- &position);
+
+ XmTextFindString (arshell.gui.widgets.work,
+ XmTextGetInsertionPosition (arshell.gui.widgets.work),
+ search_string,
+ arshell.edit.search_options.direction, &position);
/* Restore the buffer if it was converted to lower case during a
- search with "Ignore Case" set. */
-
if(XmToggleButtonGetState(arshell.edit.search_options.ignore_case_toggle))
+ search with "Ignore Case" set. */
+ if (XmToggleButtonGetState
+ (arshell.edit.search_options.ignore_case_toggle))
{
- XmTextSetString(arshell.gui.widgets.work, backup_text);
- XtFree(backup_text);
+ XmTextSetString (arshell.gui.widgets.work, backup_text);
+ XtFree (backup_text);
}
-
- XtFree(search_string);
-
- XmTextFindString(arshell.gui.widgets.work,
- position,
- " ",
- XmTEXT_FORWARD,
- &end_position);
-
- replacement_string=XmTextFieldGetString(arshell.edit.replace_widget);
- if(end_position>position)
+
+ XtFree (search_string);
+
+ XmTextFindString (arshell.gui.widgets.work,
+ position, " ", XmTEXT_FORWARD, &end_position);
+
+ replacement_string = XmTextFieldGetString (arshell.edit.replace_widget);
+ if (end_position > position)
{
-
- XmTextReplace(arshell.gui.widgets.work, position, end_position,
- replacement_string);
-
+
+ XmTextReplace (arshell.gui.widgets.work, position, end_position,
+ replacement_string);
+
}
else
{
-
- if(arshell.edit.search_options.wrap
- && !arshell.edit.search_options.wrapped)
+
+ if (arshell.edit.search_options.wrap
+ && !arshell.edit.search_options.wrapped)
{
-
- arshell.edit.search_options.direction=XmTEXT_BACKWARD;
- arshell.edit.search_options.wrapped=True;
-
+
+ arshell.edit.search_options.direction = XmTEXT_BACKWARD;
+ arshell.edit.search_options.wrapped = True;
+
}
else
{
- arshell.edit.search_options.preserve=False;
+ arshell.edit.search_options.preserve = False;
}
-
+
}
-
- XtFree(replacement_string);
- if(arshell.edit.search_options.direction==XmTEXT_FORWARD)
- XmTextSetInsertionPosition(arshell.gui.widgets.work,
- arshell_end_of_word(position));
+
+ XtFree (replacement_string);
+ if (arshell.edit.search_options.direction == XmTEXT_FORWARD)
+ XmTextSetInsertionPosition (arshell.gui.widgets.work,
+ arshell_end_of_word (position));
else
- XmTextSetInsertionPosition(arshell.gui.widgets.work, position-1);
+ XmTextSetInsertionPosition (arshell.gui.widgets.work, position - 1);
/* The above use of the position before POSITION prevents
- the current word from being the highlighted search result
- when the search directoion is BACKWARD. */
- XmTextSetSelection(arshell.gui.widgets.work, position,
- arshell_end_of_word(position),
- XtLastTimestampProcessed(antiright.display));
- if(arshell.edit.search_options.preserve)
- XtManageChild(widget);
- call_data=NULL;
-
+ the current word from being the highlighted search result
+ when the search directoion is BACKWARD. */
+ XmTextSetSelection (arshell.gui.widgets.work, position,
+ arshell_end_of_word (position),
+ XtLastTimestampProcessed (antiright.display));
+ if (arshell.edit.search_options.preserve)
+ XtManageChild (widget);
+ call_data = NULL;
+
}
else
{
Boolean result;
-
-
-
- assert(arshell.gui.widgets.work != NULL);
-
- result=XmTextFindString(arshell.gui.widgets.work,
- XmTextGetInsertionPosition
- (arshell.gui.widgets.work),
- search_string,
- arshell.edit.search_options.direction,
- &position);
+
+
+
+ assert (arshell.gui.widgets.work != NULL);
+
+ result = XmTextFindString (arshell.gui.widgets.work,
+ XmTextGetInsertionPosition
+ (arshell.gui.widgets.work),
+ search_string,
+ arshell.edit.search_options.direction,
+ &position);
/* Restore the buffer if it was converted to lower case during a
- search with "Ignore Case" set. */
-
if(XmToggleButtonGetState(arshell.edit.search_options.ignore_case_toggle))
+ search with "Ignore Case" set. */
+ if (XmToggleButtonGetState
+ (arshell.edit.search_options.ignore_case_toggle))
{
- XmTextSetString(arshell.gui.widgets.work, backup_text);
- XtFree(backup_text);
+ XmTextSetString (arshell.gui.widgets.work, backup_text);
+ XtFree (backup_text);
}
-
- if(result)
+
+ if (result)
{
-
- XmTextSetSelection(arshell.gui.widgets.work, position,
- arshell_end_of_word(position),
- XtLastTimestampProcessed(antiright.display));
- if(arshell.edit.search_options.direction==XmTEXT_FORWARD)
- XmTextSetInsertionPosition(arshell.gui.widgets.work,
- arshell_end_of_word(position));
+
+ XmTextSetSelection (arshell.gui.widgets.work, position,
+ arshell_end_of_word (position),
+ XtLastTimestampProcessed (antiright.display));
+ if (arshell.edit.search_options.direction == XmTEXT_FORWARD)
+ XmTextSetInsertionPosition (arshell.gui.widgets.work,
+ arshell_end_of_word (position));
else
- XmTextSetInsertionPosition(arshell.gui.widgets.work, position-1);
+ XmTextSetInsertionPosition (arshell.gui.widgets.work,
+ position - 1);
/* The above use of the position before POSITION prevents
the current word from being the highlighted search result
when the search directoion is BACKWARD. */
}
else
{
-
- if(XmToggleButtonGetState(arshell.edit.search_options.wrap_toggle))
+
+ if (XmToggleButtonGetState
+ (arshell.edit.search_options.wrap_toggle))
{
-
- arshell.edit.search_options.direction=XmTEXT_BACKWARD;
+
+ arshell.edit.search_options.direction = XmTEXT_BACKWARD;
XmToggleButtonSetState
(arshell.edit.search_options.preserve_toggle, True, False);
- XmToggleButtonSetState(arshell.edit.search_options.wrap_toggle,
- False, False);
+ XmToggleButtonSetState (arshell.edit.search_options.wrap_toggle,
+ False, False);
}
-
+
}
-
- if(XmToggleButtonGetState(arshell.edit.search_options.preserve_toggle))
- XtManageChild(widget);
-
- XtFree(search_string);
-
+
+ if (XmToggleButtonGetState
+ (arshell.edit.search_options.preserve_toggle))
+ XtManageChild (widget);
+
+ XtFree (search_string);
+
}
}
-
-
+
+
void
-arshell_search_replace_cb(Widget widget,
- XtPointer client_data,
- XtPointer call_data)
+arshell_search_replace_cb (Widget widget,
+ XtPointer client_data, XtPointer call_data)
{
Widget prompt;
Widget form;
- client_data=NULL;
+ client_data = NULL;
ARCLARG;
- antiright_set(XmNtitle, (XtArgVal)"Find and Replace");
- prompt=XmCreateMessageDialog(antiright.parent_widget,
- "Find and Replace",
- antiright.arguments,
- antiright.arguments_int);
- XtManageChild(prompt);
- arshell.edit.search_options.direction=XmTEXT_FORWARD;
- ARCLARG;
- form=antiright_form(prompt);
- ARCLARG;
- antiright_form_positions(0, 25, 0, 25);
- antiright_set(XmNalignment, XmALIGNMENT_END);
- antiright_label(form, "Find:");
- ARCLARG;
- antiright_form_positions(0, 25, 25, 100);
- arshell.edit.find_widget=XmCreateTextField(form, "find_widget",
- antiright.arguments,
- antiright.arguments_int);
- antiright_set_tooltip(arshell.edit.find_widget,
- "Enter the text that is to be found here.");
- XtManageChild(arshell.edit.find_widget);
- ARCLARG;
- antiright_form_positions(25, 50, 0, 25);
- antiright_set(XmNalignment, XmALIGNMENT_END);
- antiright_set(XmNsensitive, False);
- arshell.edit.search_options.replace_label=antiright_label(form, "Replace:");
- ARCLARG;
- antiright_form_positions(25, 50, 25, 100);
- antiright_set(XmNsensitive, False);
- arshell.edit.replace_widget=XmCreateTextField(form, "replace_widget",
+ antiright_set (XmNtitle, (XtArgVal) "Find and Replace");
+ prompt = XmCreateMessageDialog (antiright.parent_widget,
+ "Find and Replace",
+ antiright.arguments,
+ antiright.arguments_int);
+ XtManageChild (prompt);
+ arshell.edit.search_options.direction = XmTEXT_FORWARD;
+ ARCLARG;
+ form = antiright_form (prompt);
+ ARCLARG;
+ antiright_form_positions (0, 25, 0, 25);
+ antiright_set (XmNalignment, XmALIGNMENT_END);
+ antiright_label (form, "Find:");
+ ARCLARG;
+ antiright_form_positions (0, 25, 25, 100);
+ arshell.edit.find_widget = XmCreateTextField (form, "find_widget",
antiright.arguments,
antiright.arguments_int);
- antiright_set_tooltip(arshell.edit.replace_widget,
- "Enter the replacement text here.");
- XtManageChild(arshell.edit.replace_widget);
- ARCLARG;
- antiright_form_positions(50, 75, 0, 50);
- arshell.edit.search_options.replace_toggle=
- XmCreateToggleButton(form, "Replace", ARARGS);
- XtManageChild(arshell.edit.search_options.replace_toggle);
- XtAddCallback(arshell.edit.search_options.replace_toggle,
- XmNvalueChangedCallback, arshell_replace_toggle_cb, NULL);
- ARCLARG;
- antiright_form_positions(50, 75, 50, 100);
- arshell.edit.search_options.wrap_toggle=XmCreateToggleButton(form, "Wrap",
- ARARGS);
- XtManageChild(arshell.edit.search_options.wrap_toggle);
- XtAddCallback(arshell.edit.search_options.wrap_toggle,
- XmNvalueChangedCallback, arshell_wrap_toggle_cb, NULL);
- ARCLARG;
- antiright_form_positions(75, 100, 0, 50);
- arshell.edit.search_options.ignore_case_toggle=
- XmCreateToggleButton(form, "Ignore Case", ARARGS);
- XtManageChild(arshell.edit.search_options.ignore_case_toggle);
- XtAddCallback(arshell.edit.search_options.ignore_case_toggle,
- XmNvalueChangedCallback, arshell_ignore_case_toggle_cb, NULL);
- ARCLARG;
- antiright_form_positions(75, 100, 50, 100);
- arshell.edit.search_options.preserve_toggle=
- XmCreateToggleButton(form, "Preserve Dialog", ARARGS);
- XtManageChild(arshell.edit.search_options.preserve_toggle);
- XtAddCallback(arshell.edit.search_options.preserve_toggle,
- XmNvalueChangedCallback, arshell_preserve_toggle_cb, NULL);
-
- XtAddCallback(prompt,
- XmNokCallback,
- arshell_search_replace_ok_cb,
- NULL);
- XtAddCallback(prompt,
- XmNhelpCallback,
- antiright_help_cb,
- "Enter_the_text_that_you_want_to_find_and/or_replace_in_the_"
- "appropriate_text_field.");
+ antiright_set_tooltip (arshell.edit.find_widget,
+ "Enter the text that is to be found here.");
+ XtManageChild (arshell.edit.find_widget);
+ ARCLARG;
+ antiright_form_positions (25, 50, 0, 25);
+ antiright_set (XmNalignment, XmALIGNMENT_END);
+ antiright_set (XmNsensitive, False);
+ arshell.edit.search_options.replace_label =
+ antiright_label (form, "Replace:");
+ ARCLARG;
+ antiright_form_positions (25, 50, 25, 100);
+ antiright_set (XmNsensitive, False);
+ arshell.edit.replace_widget = XmCreateTextField (form, "replace_widget",
+ antiright.arguments,
+ antiright.arguments_int);
+ antiright_set_tooltip (arshell.edit.replace_widget,
+ "Enter the replacement text here.");
+ XtManageChild (arshell.edit.replace_widget);
+ ARCLARG;
+ antiright_form_positions (50, 75, 0, 50);
+ arshell.edit.search_options.replace_toggle =
+ XmCreateToggleButton (form, "Replace", ARARGS);
+ XtManageChild (arshell.edit.search_options.replace_toggle);
+ XtAddCallback (arshell.edit.search_options.replace_toggle,
+ XmNvalueChangedCallback, arshell_replace_toggle_cb, NULL);
+ ARCLARG;
+ antiright_form_positions (50, 75, 50, 100);
+ arshell.edit.search_options.wrap_toggle =
+ XmCreateToggleButton (form, "Wrap", ARARGS);
+ XtManageChild (arshell.edit.search_options.wrap_toggle);
+ XtAddCallback (arshell.edit.search_options.wrap_toggle,
+ XmNvalueChangedCallback, arshell_wrap_toggle_cb, NULL);
+ ARCLARG;
+ antiright_form_positions (75, 100, 0, 50);
+ arshell.edit.search_options.ignore_case_toggle =
+ XmCreateToggleButton (form, "Ignore Case", ARARGS);
+ XtManageChild (arshell.edit.search_options.ignore_case_toggle);
+ XtAddCallback (arshell.edit.search_options.ignore_case_toggle,
+ XmNvalueChangedCallback, arshell_ignore_case_toggle_cb,
+ NULL);
+ ARCLARG;
+ antiright_form_positions (75, 100, 50, 100);
+ arshell.edit.search_options.preserve_toggle =
+ XmCreateToggleButton (form, "Preserve Dialog", ARARGS);
+ XtManageChild (arshell.edit.search_options.preserve_toggle);
+ XtAddCallback (arshell.edit.search_options.preserve_toggle,
+ XmNvalueChangedCallback, arshell_preserve_toggle_cb, NULL);
+
+ XtAddCallback (prompt, XmNokCallback, arshell_search_replace_ok_cb, NULL);
+ XtAddCallback (prompt,
+ XmNhelpCallback,
+ antiright_help_cb,
+ "Enter_the_text_that_you_want_to_find_and/or_replace_in_the_"
+ "appropriate_text_field.");
- widget=(Widget)NULL;
- call_data=(XtPointer)NULL;
+ widget = (Widget) NULL;
+ call_data = (XtPointer) NULL;
}
Index: antiright/src/arshell/search.h
diff -u antiright/src/arshell/search.h:1.5 antiright/src/arshell/search.h:1.6
--- antiright/src/arshell/search.h:1.5 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/search.h Sun Jul 31 16:19:50 2005
@@ -23,14 +23,11 @@
#ifndef ARSHELL_SEARCH_H
#define ARSHELL_SEARCH_H
-void
-arshell_find_selected();
+void arshell_find_selected ();
-void
-arshell_find_at_cursor_cb();
+void arshell_find_at_cursor_cb ();
void
-arshell_search_replace_cb(Widget widget,
- XtPointer client_data,
- XtPointer call_data);
+arshell_search_replace_cb (Widget widget,
+ XtPointer client_data, XtPointer call_data);
#endif /* ARSHELL_SEARCH_H */
Index: antiright/src/arshell/textedit.c
diff -u antiright/src/arshell/textedit.c:1.21
antiright/src/arshell/textedit.c:1.22
--- antiright/src/arshell/textedit.c:1.21 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/textedit.c Sun Jul 31 16:19:50 2005
@@ -24,91 +24,95 @@
#include <ctype.h>
void
-arshell_spell_check_buffer()
+arshell_spell_check_buffer ()
{
char *command;
char *spell_checker;
- arshell_save_work_area();
- spell_checker=antiright_pipe_read("which ispell | tail -1");
- if(strlen(spell_checker)>1)
- asprintf(&command, "xterm -e ispell %s", arshell.edit.filename);
+ arshell_save_work_area ();
+ spell_checker = antiright_pipe_read ("which ispell | tail -1");
+ if (strlen (spell_checker) > 1)
+ asprintf (&command, "xterm -e ispell %s", arshell.edit.filename);
else
{
- free(spell_checker);
- spell_checker=antiright_pipe_read("which aspell | tail -1");
- if(strlen(spell_checker)>1)
- asprintf(&command, "xterm -e aspell -c %s", arshell.edit.filename);
+ free (spell_checker);
+ spell_checker = antiright_pipe_read ("which aspell | tail -1");
+ if (strlen (spell_checker) > 1)
+ asprintf (&command, "xterm -e aspell -c %s", arshell.edit.filename);
else
{
- free(spell_checker);
- spell_checker=antiright_pipe_read("which spell | tail -1");
- if(strlen(spell_checker)>1)
- asprintf(&command, "xterm -e aspell -c %s", arshell.edit.filename);
+ free (spell_checker);
+ spell_checker = antiright_pipe_read ("which spell | tail -1");
+ if (strlen (spell_checker) > 1)
+ asprintf (&command, "xterm -e aspell -c %s",
+ arshell.edit.filename);
else
{
- free(spell_checker);
- asprintf(&command, "arshell -ADm 'No spell checker was found.'&");
+ free (spell_checker);
+ asprintf (&command,
+ "arshell -ADm 'No spell checker was found.'&");
}
}
}
- free(spell_checker);
- system(command);
- free(command);
- if(arshell.flags.file_open)
- arshell_revert_file_cb();
+ free (spell_checker);
+ system (command);
+ free (command);
+ if (arshell.flags.file_open)
+ arshell_revert_file_cb ();
}
void
-arshell_select_all()
+arshell_select_all ()
{
- XmTextSetSelection(arshell.gui.widgets.work, 0,
- XmTextGetLastPosition(arshell.gui.widgets.work),
- XtLastTimestampProcessed(antiright.display));
+ XmTextSetSelection (arshell.gui.widgets.work, 0,
+ XmTextGetLastPosition (arshell.gui.widgets.work),
+ XtLastTimestampProcessed (antiright.display));
}
void
-arshell_selection_case(int (*operation)(int))
+arshell_selection_case (int (*operation) (int))
{
- char *text=XmTextGetString(arshell.gui.widgets.work);
+ char *text = XmTextGetString (arshell.gui.widgets.work);
XmTextPosition left, right;
- int counter=0;
- XmTextGetSelectionPosition(arshell.gui.widgets.work, &left, &right);
- for(counter=left; counter <= right; counter++)
- text[counter]=(*operation)(text[counter]);
- XmTextSetString(arshell.gui.widgets.work, text);
- XtFree(text);
+ int counter = 0;
+ XmTextGetSelectionPosition (arshell.gui.widgets.work, &left, &right);
+ for (counter = left; counter <= right; counter++)
+ text[counter] = (*operation) (text[counter]);
+ XmTextSetString (arshell.gui.widgets.work, text);
+ XtFree (text);
}
+
void
-arshell_lower_selection_case()
+arshell_lower_selection_case ()
{
- arshell_selection_case(&tolower);
+ arshell_selection_case (&tolower);
}
+
void
-arshell_upper_selection_case()
+arshell_upper_selection_case ()
{
- arshell_selection_case(&toupper);
+ arshell_selection_case (&toupper);
}
void
-arshell_change_font_cb()
+arshell_change_font_cb ()
{
char *font_string;
XFontStruct *font_struct;
- font_string=antiright_pipe_read("arshell -ADF");
- if((*font_string)!='\0')
+ font_string = antiright_pipe_read ("arshell -ADF");
+ if ((*font_string) != '\0')
{
- font_struct=XLoadQueryFont(antiright.display, font_string);
- if(font_struct!=NULL)
+ font_struct = XLoadQueryFont (antiright.display, font_string);
+ if (font_struct != NULL)
{
- XmFontList font_list=XmFontListCreate(font_struct,
- XmSTRING_DEFAULT_CHARSET);
+ XmFontList font_list = XmFontListCreate (font_struct,
+ XmSTRING_DEFAULT_CHARSET);
ARCLARG;
- antiright_set(XmNfontList, (XtArgVal)font_list);
- antiright_set_values(arshell.gui.widgets.work);
+ antiright_set (XmNfontList, (XtArgVal) font_list);
+ antiright_set_values (arshell.gui.widgets.work);
ARCLARG;
- XmFontListFree(font_list);
+ XmFontListFree (font_list);
}
else
{
@@ -116,253 +120,263 @@
("arshell -ADm 'The entered font was not found. ' &");
}
}
- free(font_string);
+ free (font_string);
}
/* This is a simple method of printing the current file. */
-void
-arshell_print_cb()
+void
+arshell_print_cb ()
{
char *command;
char *print_string;
- print_string=
- antiright_pipe_read("echo -n `ACE -r Print`");
- asprintf(&command, "%s %s &", print_string, arshell.edit.filename);
- free(print_string);
- system(command); /* Print the file. */
- free(command); /* Free the unneeded memory. */
+ print_string = antiright_pipe_read ("echo -n `ACE -r Print`");
+ asprintf (&command, "%s %s &", print_string, arshell.edit.filename);
+ free (print_string);
+ system (command); /* Print the file. */
+ free (command); /* Free the unneeded memory. */
}
+
void
-arshell_value_changed_cb()
+arshell_value_changed_cb ()
{
char *title_string;
- asprintf(&title_string,
- "%s [%s]",
- arshell.edit.filename,
- "modified");
- XtVaSetValues(antiright.parent_widget,
- XmNtitle, title_string,
- NULL);
- free(title_string);
-
- arshell.flags.modified=True;
-}
-void
-arshell_text_return_cb(Widget parent_widget,
- XtPointer client_data,
- XtPointer call_data)
-{
- char* text_string=XmTextGetString(parent_widget);
- printf("%s %s", (char*)client_data, text_string);
- free(text_string);
- fflush(stdout);
- call_data=(XtPointer)NULL;
- exit(0);
+ asprintf (&title_string, "%s [%s]", arshell.edit.filename, "modified");
+ XtVaSetValues (antiright.parent_widget, XmNtitle, title_string, NULL);
+ free (title_string);
+
+ arshell.flags.modified = True;
+}
+
+void
+arshell_text_return_cb (Widget parent_widget,
+ XtPointer client_data, XtPointer call_data)
+{
+ char *text_string = XmTextGetString (parent_widget);
+ printf ("%s %s", (char *) client_data, text_string);
+ free (text_string);
+ fflush (stdout);
+ call_data = (XtPointer) NULL;
+ exit (0);
}
unsigned int
-arshell_line(XmTextPosition end_position)
+arshell_line (XmTextPosition end_position)
{
- int lines=1;
- char *text=XmTextGetString(arshell.gui.widgets.work);
- XmTextPosition position=0;
- while(position < end_position)
+ int lines = 1;
+ char *text = XmTextGetString (arshell.gui.widgets.work);
+ XmTextPosition position = 0;
+ while (position < end_position)
{
- if(text[position]=='\n')
+ if (text[position] == '\n')
lines++;
position++;
}
- XtFree(text);
- return(lines);
+ XtFree (text);
+ return (lines);
}
+
void
-arshell_position(XmTextPosition current_position, unsigned int *total_lines,
- unsigned int *current_line)
+arshell_position (XmTextPosition current_position, unsigned int *total_lines,
+ unsigned int *current_line)
{
- char *text=XmTextGetString(arshell.gui.widgets.work);
- XmTextPosition position=0;
- XmTextPosition end_position=XmTextGetLastPosition(arshell.gui.widgets.work);
- (*total_lines)=1;
- while(position <= end_position)
+ char *text = XmTextGetString (arshell.gui.widgets.work);
+ XmTextPosition position = 0;
+ XmTextPosition end_position =
+ XmTextGetLastPosition (arshell.gui.widgets.work);
+ (*total_lines) = 1;
+ while (position <= end_position)
{
- if(text[position]=='\n')
+ if (text[position] == '\n')
(*total_lines)++;
- if(position==current_position)
+ if (position == current_position)
{
- (*current_line)=(*total_lines);
- if(text[current_position]=='\n')
+ (*current_line) = (*total_lines);
+ if (text[current_position] == '\n')
(*current_line)--;
}
position++;
}
- XtFree(text);
+ XtFree (text);
}
+
void
-arshell_goto_line(unsigned int line)
+arshell_goto_line (unsigned int line)
{
/* Declare a counter for the number of lines counted. */
- unsigned int line_counter=1;
+ unsigned int line_counter = 1;
/* Declare a text position counter. */
- XmTextPosition position=0;
- char *text=XmTextGetString(arshell.gui.widgets.work);
- unsigned int text_length=strlen(text);
- while(((unsigned int)position < text_length) & (line_counter<line))
+ XmTextPosition position = 0;
+ char *text = XmTextGetString (arshell.gui.widgets.work);
+ unsigned int text_length = strlen (text);
+ while (((unsigned int) position < text_length) & (line_counter < line))
{
- if(text[position]=='\n')
+ if (text[position] == '\n')
line_counter++;
position++;
}
- XtFree(text);
- XmTextSetInsertionPosition(arshell.gui.widgets.work, position);
+ XtFree (text);
+ XmTextSetInsertionPosition (arshell.gui.widgets.work, position);
}
+
void
-arshell_goto_line_cb()
+arshell_goto_line_cb ()
{
- char *line_string=antiright_pipe_read("arshell -ADp Line:");
- arshell_goto_line(atoi(line_string));
- free(line_string);
+ char *line_string = antiright_pipe_read ("arshell -ADp Line:");
+ arshell_goto_line (atoi (line_string));
+ free (line_string);
}
+
int
-arshell_current_line()
+arshell_current_line ()
{
- return(arshell_line(XmTextGetInsertionPosition(arshell.gui.widgets.work)+1));
+ return (arshell_line
+ (XmTextGetInsertionPosition (arshell.gui.widgets.work) + 1));
}
+
int
-arshell_text_lines()
+arshell_text_lines ()
{
- return(arshell_line(XmTextGetLastPosition(arshell.gui.widgets.work)));
+ return (arshell_line (XmTextGetLastPosition (arshell.gui.widgets.work)));
}
void
-arshell_get_rid_of_modified_status()
+arshell_get_rid_of_modified_status ()
{
- if(arshell.flags.modified)
- arshell.flags.modified=False;
+ if (arshell.flags.modified)
+ arshell.flags.modified = False;
}
void
-arshell_set_work_area_arguments()
+arshell_set_work_area_arguments ()
{
ARCLARG;
- antiright_set(XmNeditMode, XmMULTI_LINE_EDIT);
- antiright_set(XmNcolumns, 80);
- antiright_set(XmNrows, 24);
+ antiright_set (XmNeditMode, XmMULTI_LINE_EDIT);
+ antiright_set (XmNcolumns, 80);
+ antiright_set (XmNrows, 24);
}
+
void
-arshell_verified_status(XmTextVerifyCallbackStruct *call_pointer)
+arshell_verified_status (XmTextVerifyCallbackStruct * call_pointer)
{
char *status;
- XmTextPosition last=XmTextGetLastPosition(arshell.gui.widgets.work);
- XmTextPosition current=call_pointer->newInsert;
+ XmTextPosition last = XmTextGetLastPosition (arshell.gui.widgets.work);
+ XmTextPosition current = call_pointer->newInsert;
unsigned int lines_uint;
unsigned int current_uint;
float percent;
- arshell_position(current, &lines_uint, ¤t_uint);
- percent=(float)current/(float)last;
- asprintf(&status, "Lines:%d, Current:%d, Percent:%f",
- lines_uint, current_uint, percent*100);
- antiright_status(status);
- free(status);
+ arshell_position (current, &lines_uint, ¤t_uint);
+ percent = (float) current / (float) last;
+ asprintf (&status, "Lines:%d, Current:%d, Percent:%f",
+ lines_uint, current_uint, percent * 100);
+ antiright_status (status);
+ free (status);
}
+
void
-arshell_modify_verify_cb(Widget widget, XtPointer client_data,
- XtPointer call_data)
+arshell_modify_verify_cb (Widget widget, XtPointer client_data,
+ XtPointer call_data)
{
- client_data=NULL;
- widget=NULL;
- arshell_verified_status(call_data);
+ client_data = NULL;
+ widget = NULL;
+ arshell_verified_status (call_data);
}
+
void
-arshell_motion_verify_cb(Widget widget, XtPointer client_data,
- XtPointer call_data)
+arshell_motion_verify_cb (Widget widget, XtPointer client_data,
+ XtPointer call_data)
{
- client_data=NULL;
- widget=NULL;
- arshell_verified_status(call_data);
+ client_data = NULL;
+ widget = NULL;
+ arshell_verified_status (call_data);
}
+
void
-arshell_setup_work_area_callbacks()
+arshell_setup_work_area_callbacks ()
{
- XtAddCallback(arshell.gui.widgets.work, XmNvalueChangedCallback,
- arshell_value_changed_cb, NULL);
- XtAddCallback(arshell.gui.widgets.work, XmNmodifyVerifyCallback,
- arshell_modify_verify_cb, NULL);
- XtAddCallback(arshell.gui.widgets.work, XmNmotionVerifyCallback,
- arshell_motion_verify_cb, NULL);
+ XtAddCallback (arshell.gui.widgets.work, XmNvalueChangedCallback,
+ arshell_value_changed_cb, NULL);
+ XtAddCallback (arshell.gui.widgets.work, XmNmodifyVerifyCallback,
+ arshell_modify_verify_cb, NULL);
+ XtAddCallback (arshell.gui.widgets.work, XmNmotionVerifyCallback,
+ arshell_motion_verify_cb, NULL);
}
+
void
-arshell_work_area_pixmap_hack()
+arshell_work_area_pixmap_hack ()
{
char *icon;
- asprintf(&icon, "%s/handtoface.xpm", ICONDIR);
- antiright_set_bitmap_from_file(antiright.parent_widget, icon);
- free(icon);
+ asprintf (&icon, "%s/handtoface.xpm", ICONDIR);
+ antiright_set_bitmap_from_file (antiright.parent_widget, icon);
+ free (icon);
}
+
void
-arshell_create_text_work_area()
+arshell_create_text_work_area ()
{
- arshell_set_work_area_arguments();
- arshell.gui.widgets.work=XmCreateText(arshell.gui.widgets.mainwindow, "work",
- antiright.arguments,
- antiright.arguments_int);
- XtManageChild(arshell.gui.widgets.work);
- antiright_defined_popup_menu(arshell.gui.widgets.work);
- arshell_setup_work_area_callbacks();
- arshell_setup_work_menubar();
- arshell_work_area_pixmap_hack();
+ arshell_set_work_area_arguments ();
+ arshell.gui.widgets.work =
+ XmCreateText (arshell.gui.widgets.mainwindow, "work", antiright.arguments,
+ antiright.arguments_int);
+ XtManageChild (arshell.gui.widgets.work);
+ antiright_defined_popup_menu (arshell.gui.widgets.work);
+ arshell_setup_work_area_callbacks ();
+ arshell_setup_work_menubar ();
+ arshell_work_area_pixmap_hack ();
}
void
-arshell_create_default_text_label(Widget form_widget,
- char* label_string)
+arshell_create_default_text_label (Widget form_widget, char *label_string)
{
ARCLARG;
- antiright_form_positions(0, 100, 0, 25);
- antiright_label(form_widget, label_string);
+ antiright_form_positions (0, 100, 0, 25);
+ antiright_label (form_widget, label_string);
}
+
void
-arshell_set_text_field_arguments()
+arshell_set_text_field_arguments ()
{
ARCLARG;
- antiright_form_positions(0, 100, 25, 100);
- antiright_set(XmNeditMode, XmSINGLE_LINE_EDIT);
- antiright_set(XmNscrollHorizontal, False);
+ antiright_form_positions (0, 100, 25, 100);
+ antiright_set (XmNeditMode, XmSINGLE_LINE_EDIT);
+ antiright_set (XmNscrollHorizontal, False);
}
+
Widget
-arshell_create_default_text_field(Widget parent_widget, char* return_string)
+arshell_create_default_text_field (Widget parent_widget, char *return_string)
{
Widget text_widget;
- arshell_set_text_field_arguments();
- text_widget=XmCreateText(parent_widget, "text_widget",
- antiright.arguments, antiright.arguments_int);
- assert(text_widget!=NULL);
- XtManageChild(text_widget);
- XtAddCallback(text_widget, XmNactivateCallback,
- arshell_text_return_cb, return_string);
- return(text_widget);
+ arshell_set_text_field_arguments ();
+ text_widget = XmCreateText (parent_widget, "text_widget",
+ antiright.arguments, antiright.arguments_int);
+ assert (text_widget != NULL);
+ XtManageChild (text_widget);
+ XtAddCallback (text_widget, XmNactivateCallback,
+ arshell_text_return_cb, return_string);
+ return (text_widget);
}
void
-arshell_set_work_area_from_stdin()
+arshell_set_work_area_from_stdin ()
{
char buffer[BUFSIZ];
- if(arshell.gui.widgets.work==NULL)
- arshell_create_text_work_area();
- while(fgets(buffer, BUFSIZ, stdin) != NULL)
- XmTextInsert(arshell.gui.widgets.work,
- XmTextGetInsertionPosition(arshell.gui.widgets.work), buffer);
- XmTextSetInsertionPosition(arshell.gui.widgets.work, 0);
+ if (arshell.gui.widgets.work == NULL)
+ arshell_create_text_work_area ();
+ while (fgets (buffer, BUFSIZ, stdin) != NULL)
+ XmTextInsert (arshell.gui.widgets.work,
+ XmTextGetInsertionPosition (arshell.gui.widgets.work),
+ buffer);
+ XmTextSetInsertionPosition (arshell.gui.widgets.work, 0);
}
+
void
-arshell_create_default_text_entry(Widget widget_row_widget,
- int* counter_int,
- char** argv)
+arshell_create_default_text_entry (Widget widget_row_widget,
+ int *counter_int, char **argv)
{
Widget form_widget;
-
+
ARCLARG;
- form_widget=antiright_form(widget_row_widget);
- arshell_create_default_text_label(form_widget, argv[(*counter_int)]);
- arshell_create_default_text_field(form_widget, argv[(*counter_int)]);
+ form_widget = antiright_form (widget_row_widget);
+ arshell_create_default_text_label (form_widget, argv[(*counter_int)]);
+ arshell_create_default_text_field (form_widget, argv[(*counter_int)]);
}
Index: antiright/src/arshell/textedit.h
diff -u antiright/src/arshell/textedit.h:1.11
antiright/src/arshell/textedit.h:1.12
--- antiright/src/arshell/textedit.h:1.11 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/textedit.h Sun Jul 31 16:19:50 2005
@@ -44,7 +44,7 @@
{
/* This is the filename of the work area file. */
char filename[ARSHELL_MAX_STRLEN];
-
+
/* This is the command that will operate on designated operation
buttons. The last specified command is the command which will
operate on all operation buttons. This is used by the -Bc
@@ -56,48 +56,33 @@
Boolean hungry_delete;
struct arshell_search_replace_data_struct search_options;
};
+void arshell_spell_check_buffer ();
+void arshell_value_changed_cb ();
+void arshell_print_cb ();
+void
+arshell_text_return_cb (Widget widget, XtPointer client_data,
+ XtPointer call_data);
+void arshell_create_text_work_area ();
+void arshell_set_work_area_text_from_buffer (char *buffer_string);
void
-arshell_spell_check_buffer();
-void
-arshell_value_changed_cb();
-void
-arshell_print_cb();
-void
-arshell_text_return_cb(Widget widget, XtPointer client_data,
- XtPointer call_data);
-void
-arshell_create_text_work_area();
-void
-arshell_set_work_area_text_from_buffer(char* buffer_string);
-void
-arshell_create_default_text_label(Widget parent_widget, char* label_string);
+arshell_create_default_text_label (Widget parent_widget, char *label_string);
Widget
-arshell_create_default_text_field(Widget parent_widget, char* return_string);
+arshell_create_default_text_field (Widget parent_widget, char *return_string);
void
-arshell_check_text_entry_sub_arguments(Widget text_widget,
- int* counter_int,
- char** argv);
-void
-arshell_set_work_area_from_stdin();
-void
-arshell_create_default_text_entry(Widget widget_row_widget,
- int* counter_int,
- char** argv);
-void
-arshell_goto_line_cb();
-void
-arshell_goto_line(unsigned int line);
-void
-arshell_change_font_cb();
-void
-arshell_lower_selection_case();
-void
-arshell_upper_selection_case();
-void
-arshell_select_all();
-void
-arshell_get_rid_of_modified_status();
+arshell_check_text_entry_sub_arguments (Widget text_widget,
+ int *counter_int, char **argv);
+void arshell_set_work_area_from_stdin ();
+void
+arshell_create_default_text_entry (Widget widget_row_widget,
+ int *counter_int, char **argv);
+void arshell_goto_line_cb ();
+void arshell_goto_line (unsigned int line);
+void arshell_change_font_cb ();
+void arshell_lower_selection_case ();
+void arshell_upper_selection_case ();
+void arshell_select_all ();
+void arshell_get_rid_of_modified_status ();
#endif /* AR_TEXTEDIT_H */
Index: antiright/src/arshell/update.c
diff -u antiright/src/arshell/update.c:1.8 antiright/src/arshell/update.c:1.9
--- antiright/src/arshell/update.c:1.8 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/update.c Sun Jul 31 16:19:50 2005
@@ -24,201 +24,198 @@
#include <time.h>
void
-arshell_update()
+arshell_update ()
{
- struct arshell_update_struct *iterator=arshell.updater;
- while(iterator->next!=NULL)
+ struct arshell_update_struct *iterator = arshell.updater;
+ while (iterator->next != NULL)
{
char *input_string;
- iterator=iterator->next;
-
- if(iterator->widget==arshell.gui.clockload.clockload)
+ iterator = iterator->next;
+
+ if (iterator->widget == arshell.gui.clockload.clockload)
{
char *clockload_label_string;
char *time_string;
time_t time_date;
double load[3];
- char *user=getenv("USER");
- char *maildir="/var/mail";
+ char *user = getenv ("USER");
+ char *maildir = "/var/mail";
char *mailfile;
struct stat mailfile_stat;
char *mail_string;
-
- asprintf(&mailfile, "%s/%s", maildir, user);
- stat(mailfile, &mailfile_stat);
- free(mailfile);
-
- if(mailfile_stat.st_size > 0)
- mail_string="Mail";
+
+ asprintf (&mailfile, "%s/%s", maildir, user);
+ stat (mailfile, &mailfile_stat);
+ free (mailfile);
+
+ if (mailfile_stat.st_size > 0)
+ mail_string = "Mail";
else
- 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);
+ 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))
- {
-
- input_string=antiright_pipe_read(iterator->command_string);
- input_string[strlen(input_string)-1]='\0';
- antiright_label_string(iterator->widget,
- input_string);
- free(input_string);
-
+ antiright_label_string (iterator->widget, clockload_label_string);
+ free (clockload_label_string);
+
}
- else if(XmIsScrollBar(iterator->widget))
+ else if (XmIsLabel (iterator->widget))
+ {
+
+ input_string = antiright_pipe_read (iterator->command_string);
+ input_string[strlen (input_string) - 1] = '\0';
+ antiright_label_string (iterator->widget, input_string);
+ free (input_string);
+
+ }
+ else if (XmIsScrollBar (iterator->widget))
{
int value_int;
- input_string=antiright_pipe_read(iterator->command_string);
- input_string[strlen(input_string)-1]='\0';
- value_int=atoi(input_string);
- free(input_string);
- if((value_int>0)&(value_int<=100))
+ input_string = antiright_pipe_read (iterator->command_string);
+ input_string[strlen (input_string) - 1] = '\0';
+ value_int = atoi (input_string);
+ free (input_string);
+ if ((value_int > 0) & (value_int <= 100))
{
- XtVaSetValues(iterator->widget,
- XmNsliderSize, value_int,
- NULL);
+ XtVaSetValues (iterator->widget,
+ XmNsliderSize, value_int, NULL);
}
}
- else if(iterator->widget==arshell.gui.widgets.work)
+ else if (iterator->widget == arshell.gui.widgets.work)
{
- assert(arshell.gui.widgets.work != NULL);
- assert(iterator->widget != NULL);
- input_string=antiright_pipe_read(iterator->command_string);
- input_string[strlen(input_string)-1]='\0';
+ assert (arshell.gui.widgets.work != NULL);
+ assert (iterator->widget != NULL);
+ input_string = antiright_pipe_read (iterator->command_string);
+ input_string[strlen (input_string) - 1] = '\0';
/* Append input_string to the work area. */
- XmTextInsert(arshell.gui.widgets.work,
- XmTextGetLastPosition(arshell.gui.widgets.work),
- input_string);
- free(input_string);
- XmTextInsert(arshell.gui.widgets.work,
- XmTextGetLastPosition(arshell.gui.widgets.work),
- "\n");
+ XmTextInsert (arshell.gui.widgets.work,
+ XmTextGetLastPosition (arshell.gui.widgets.work),
+ input_string);
+ free (input_string);
+ XmTextInsert (arshell.gui.widgets.work,
+ XmTextGetLastPosition (arshell.gui.widgets.work),
+ "\n");
}
- else if(iterator->widget==antiright.parent_widget)
+ else if (iterator->widget == antiright.parent_widget)
{
- if(arshell.flags.lowered)
+ if (arshell.flags.lowered)
{
- XLowerWindow(XtDisplay(iterator->widget),
- XtWindow(iterator->widget));
+ XLowerWindow (XtDisplay (iterator->widget),
+ XtWindow (iterator->widget));
}
else
{
- input_string=antiright_pipe_read
- (iterator->command_string);
- input_string[strlen(input_string)-1]='\0';
+ input_string = antiright_pipe_read (iterator->command_string);
+ input_string[strlen (input_string) - 1] = '\0';
/* Set the title to input_string. */
- antiright_set_title(input_string);
- free(input_string);
+ antiright_set_title (input_string);
+ free (input_string);
}
}
}
}
void
-arshell_restart_timers()
+arshell_restart_timers ()
{
- if((arshell.timer_id)!=NULL)
- XtRemoveTimeOut((*arshell.timer_id));
- arshell_update();
- XtAppAddTimeOut(antiright.app_context, arshell.update_frequency,
- arshell_update_work_procedure, NULL);
+ if ((arshell.timer_id) != NULL)
+ XtRemoveTimeOut ((*arshell.timer_id));
+ arshell_update ();
+ XtAppAddTimeOut (antiright.app_context, arshell.update_frequency,
+ arshell_update_work_procedure, NULL);
}
void
-arshell_add_updater(Widget widget, char* command_string)
+arshell_add_updater (Widget widget, char *command_string)
{
struct arshell_update_struct *iterator;
/* Initialize the global instance, if necessary. */
- if(arshell.updater==NULL)
+ if (arshell.updater == NULL)
{
- arshell.updater=
- (struct arshell_update_struct *)xmalloc
- (sizeof(struct arshell_update_struct));
- arshell.updater->next=NULL;
+ arshell.updater =
+ (struct arshell_update_struct *) xmalloc
+ (sizeof (struct arshell_update_struct));
+ arshell.updater->next = NULL;
}
/* Initialize from global instance. */
- iterator=arshell.updater;
+ iterator = arshell.updater;
/* Go to the end of the list. */
- while(iterator->next!=NULL)
- iterator=iterator->next;
+ while (iterator->next != NULL)
+ iterator = iterator->next;
/* Append the updating rules. */
- iterator->next=
- (struct arshell_update_struct *)xmalloc
- (sizeof(struct arshell_update_struct));
- iterator=iterator->next;
- iterator->next=NULL;
- iterator->widget=widget;
- strncpy(iterator->command_string, command_string, ARSHELL_MAX_STRLEN);
- arshell_restart_timers();
+ iterator->next =
+ (struct arshell_update_struct *) xmalloc
+ (sizeof (struct arshell_update_struct));
+ iterator = iterator->next;
+ iterator->next = NULL;
+ iterator->widget = widget;
+ strncpy (iterator->command_string, command_string, ARSHELL_MAX_STRLEN);
+ arshell_restart_timers ();
}
void
-arshell_update_work_procedure(XtPointer client_data,
- XtIntervalId *timer_id)
-{
- arshell_update();
- *timer_id=
- XtAppAddTimeOut(antiright.app_context, arshell.update_frequency,
- arshell_update_work_procedure, client_data);
- arshell.timer_id=timer_id;
+arshell_update_work_procedure (XtPointer client_data, XtIntervalId * timer_id)
+{
+ arshell_update ();
+ *timer_id =
+ XtAppAddTimeOut (antiright.app_context, arshell.update_frequency,
+ arshell_update_work_procedure, client_data);
+ arshell.timer_id = timer_id;
}
void
-arshell_handle_updating_argument(int* counter_int, char** argv)
+arshell_handle_updating_argument (int *counter_int, char **argv)
{
/* FIXME: Make this more extensive, allowing
updating of the work area, labels, etc. */
- switch(argv[(*counter_int)][2])
+ switch (argv[(*counter_int)][2])
{
- case 'f': /* Change the updating frequency. The value passed is
- in miliseconds. */
+ case 'f': /* Change the updating frequency. The value
passed is
+ in miliseconds. */
(*counter_int)++;
- arshell.update_frequency=atoi(argv[(*counter_int)]);
+ arshell.update_frequency = atoi (argv[(*counter_int)]);
break;
- case 'L': /* Add an updating label. */
+ case 'L': /* Add an updating label. */
(*counter_int)++;
- arshell_add_updater(antiright_label(arshell.gui.widgets.row,
"AntiRight"),
- argv[(*counter_int)]);
+ arshell_add_updater (antiright_label
+ (arshell.gui.widgets.row, "AntiRight"),
+ argv[(*counter_int)]);
break;
- case 'P': /* Add progress bar. The command must return a value
- between and including 1 and 100. The value is such
- that indicates the percentage of the bar to be
- filled. */
+ case 'P': /* Add progress bar. The command must return a
value
+ between and including 1 and 100. The value
is such
+ that indicates the percentage of the bar to
be
+ filled. */
(*counter_int)++;
- arshell_add_updater(arshell_progress_bar(arshell.gui.widgets.row),
- argv[(*counter_int)]);
+ arshell_add_updater (arshell_progress_bar (arshell.gui.widgets.row),
+ argv[(*counter_int)]);
break;
- case 'T': /* Append updating output to work area. */
+ case 'T': /* Append updating output to work area. */
(*counter_int)++;
- if(arshell.gui.widgets.work==NULL)
- arshell_create_text_work_area();
- arshell_add_updater(arshell.gui.widgets.work, argv[(*counter_int)]);
+ if (arshell.gui.widgets.work == NULL)
+ arshell_create_text_work_area ();
+ arshell_add_updater (arshell.gui.widgets.work, argv[(*counter_int)]);
break;
case 'W':
(*counter_int)++;
- arshell_add_updater(antiright.parent_widget, argv[(*counter_int)]);
+ arshell_add_updater (antiright.parent_widget, argv[(*counter_int)]);
break;
default:
(*counter_int)++;
/* The following avoids a segmentation fault if the status bar
- is not created before this code is reached. */
- if(antiright.status_widget==NULL)
+ is not created before this code is reached. */
+ if (antiright.status_widget == NULL)
{
- antiright_create_status_bar(arshell.gui.widgets.mainwindow);
+ antiright_create_status_bar (arshell.gui.widgets.mainwindow);
}
- arshell_add_updater(antiright.status_widget, argv[(*counter_int)]);
+ arshell_add_updater (antiright.status_widget, argv[(*counter_int)]);
}
}
Index: antiright/src/arshell/update.h
diff -u antiright/src/arshell/update.h:1.6 antiright/src/arshell/update.h:1.7
--- antiright/src/arshell/update.h:1.6 Sat Jul 23 17:10:09 2005
+++ antiright/src/arshell/update.h Sun Jul 31 16:19:50 2005
@@ -37,13 +37,11 @@
struct arshell_update_struct *next;
};
+void arshell_update ();
+void arshell_add_updater (Widget widget, char *command_string);
void
-arshell_update();
-void
-arshell_add_updater(Widget widget, char* command_string);
-void
-arshell_update_work_procedure(XtPointer client_data, XtIntervalId *timer_id);
-void
-arshell_handle_updating_argument(int* counter_int, char** argv);
+arshell_update_work_procedure (XtPointer client_data,
+ XtIntervalId * timer_id);
+void arshell_handle_updating_argument (int *counter_int, char **argv);
#endif /* AR_UPDATE_H */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Antiright-devel] antiright/src/arshell appendage.c appendage.h a...,
Jeffrey Bedard <=