23 |
#include "arshell.h" |
#include "arshell.h" |
24 |
|
|
25 |
void |
void |
26 |
arshell_system_cb(Widget parent_widget, |
arshell_system_cb (Widget parent_widget, |
27 |
XtPointer client_data, |
XtPointer client_data, XtPointer call_data) |
28 |
XtPointer call_data) |
{ |
29 |
{ |
antiright_system (client_data); |
30 |
antiright_system(client_data); |
|
31 |
|
if (arshell.flags.exit_on_action) |
32 |
if(arshell.flags.exit_on_action) |
exit (0); |
|
exit(0); |
|
33 |
|
|
34 |
parent_widget=(Widget)NULL; |
parent_widget = (Widget) NULL; |
35 |
call_data=(XtPointer)NULL; |
call_data = (XtPointer) NULL; |
36 |
} |
} |
37 |
|
|
38 |
void |
void |
39 |
arshell_beautify_label(Widget widget, |
arshell_beautify_label (Widget widget, char *current_argument_string) |
|
char *current_argument_string) |
|
40 |
{ |
{ |
41 |
char *label_string=antiright_beautified_label(current_argument_string); |
char *label_string = antiright_beautified_label (current_argument_string); |
42 |
antiright_label_string(widget, label_string); |
antiright_label_string (widget, label_string); |
43 |
free(label_string); |
free (label_string); |
44 |
} |
} |
45 |
|
|
46 |
void |
void |
47 |
arshell_usage() |
arshell_usage () |
48 |
{ |
{ |
49 |
antiright_standard_usage("arshell"); |
antiright_standard_usage ("arshell"); |
50 |
puts(" [[-[-help [-fifo COMMAND FIFO]]]" |
puts (" [[-[-help [-fifo COMMAND FIFO]]]" |
51 |
"[-A[[C][D[Ff][mp label]]][bi label icon]" |
"[-A[[C][D[Ff][mp label]]][bi label icon]" |
52 |
"[l label][m[[fevh] label]][s][t label][w]]Ep" |
"[l label][m[[fevh] label]][s][t label][w]]Ep" |
53 |
"[r rows][U[[LPTW] command][f frequency]][W label]][command]"); |
"[r rows][U[[LPTW] command][f frequency]][W label]][command]"); |
54 |
antiright_report_bugs_message(); |
antiright_report_bugs_message (); |
55 |
exit(1); |
exit (1); |
56 |
} |
} |
57 |
|
|
58 |
Widget |
Widget |
59 |
arshell_optioned_button(Widget parent_widget, |
arshell_optioned_button (Widget parent_widget, |
60 |
XtCallbackProc callback, |
XtCallbackProc callback, char *command_string) |
|
char* command_string) |
|
61 |
{ |
{ |
62 |
Widget button_widget; |
Widget button_widget; |
63 |
if(parent_widget != NULL) |
if (parent_widget != NULL) |
64 |
{ |
{ |
65 |
if(!XtIsManaged(parent_widget)) |
if (!XtIsManaged (parent_widget)) |
66 |
{ |
{ |
67 |
XtManageChild(parent_widget); |
XtManageChild (parent_widget); |
68 |
} |
} |
69 |
} |
} |
70 |
button_widget=antiright_panel_button(parent_widget, command_string, |
button_widget = antiright_panel_button (parent_widget, command_string, |
71 |
callback, command_string); |
callback, command_string); |
72 |
antiright_set_tooltip(button_widget, command_string); |
antiright_set_tooltip (button_widget, command_string); |
73 |
arshell_beautify_label(button_widget, command_string); |
arshell_beautify_label (button_widget, command_string); |
74 |
ARCLARG; |
ARCLARG; |
75 |
antiright_set(XmNalignment, XmALIGNMENT_CENTER); |
antiright_set (XmNalignment, XmALIGNMENT_CENTER); |
76 |
antiright_set_values(button_widget); |
antiright_set_values (button_widget); |
77 |
ARCLARG; |
ARCLARG; |
78 |
return(button_widget); |
return (button_widget); |
79 |
} |
} |
80 |
|
|
81 |
void |
void |
82 |
arshell_set_progress_bar_arguments() |
arshell_set_progress_bar_arguments () |
83 |
{ |
{ |
84 |
antiright_set(XmNorientation, XmHORIZONTAL); |
antiright_set (XmNorientation, XmHORIZONTAL); |
85 |
antiright_set(XmNshowArrows, False); |
antiright_set (XmNshowArrows, False); |
86 |
antiright_set(XmNmaximum, 100); |
antiright_set (XmNmaximum, 100); |
87 |
antiright_set(XmNminimum, 0); |
antiright_set (XmNminimum, 0); |
88 |
antiright_set(XmNsliderSize, 1); |
antiright_set (XmNsliderSize, 1); |
89 |
antiright_set(XmNeditable, False); |
antiright_set (XmNeditable, False); |
90 |
} |
} |
91 |
|
|
92 |
Widget |
Widget |
93 |
arshell_progress_bar(Widget parent) |
arshell_progress_bar (Widget parent) |
94 |
{ |
{ |
95 |
Widget progress; |
Widget progress; |
96 |
arshell_set_progress_bar_arguments(); |
arshell_set_progress_bar_arguments (); |
97 |
progress=XmCreateScrollBar(parent, "progress", |
progress = XmCreateScrollBar (parent, "progress", |
98 |
antiright.arguments, antiright.arguments_int); |
antiright.arguments, antiright.arguments_int); |
99 |
XtManageChild(progress); |
XtManageChild (progress); |
100 |
return(progress); |
return (progress); |
101 |
} |
} |
102 |
|
|
103 |
void |
void |
104 |
arshell_set_window_title_and_work_filename(int *counter_int, char **argv) |
arshell_set_window_title_and_work_filename (int *counter_int, char **argv) |
105 |
{ |
{ |
106 |
/* This sets the window title and the work filename. I know this is |
/* This sets the window title and the work filename. I know this is |
107 |
a weird way to do things, but it keeps things small and is |
a weird way to do things, but it keeps things small and is |
108 |
actually quite practical. */ |
actually quite practical. */ |
109 |
(*counter_int)++; |
(*counter_int)++; |
110 |
strncpy(arshell.edit.filename, argv[(*counter_int)], 255); |
strncpy (arshell.edit.filename, argv[(*counter_int)], 255); |
111 |
arshell.flags.file_open=True; |
arshell.flags.file_open = True; |
112 |
antiright_set_title(argv[(*counter_int)]); |
antiright_set_title (argv[(*counter_int)]); |
113 |
} |
} |