summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2015-05-09 12:47:23 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2015-05-09 12:47:23 -0700
commita6733f76dad52644bd45a8674bf0ea97c6e424ac (patch)
tree9247b25cbb5dd21a45364055e782fd70f0940cd2
parentc33a44612947eb91579b24f98848812018dd8c16 (diff)
Strip trailing whitespace
'git diff -w' shows no changes for this commit Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--Makefile.am6
-rw-r--r--actions.c58
-rw-r--r--app-defaults/Editres6
-rw-r--r--comm.c148
-rw-r--r--configure.ac4
-rw-r--r--editres.c28
-rw-r--r--editresP.h26
-rw-r--r--geometry.c82
-rw-r--r--handler.c104
-rw-r--r--man/editres.man4
-rw-r--r--setvalues.c10
-rw-r--r--svpopup.c62
-rw-r--r--utils.c98
-rw-r--r--widgets.c172
-rw-r--r--wtree.c78
15 files changed, 443 insertions, 443 deletions
diff --git a/Makefile.am b/Makefile.am
index 2169e87..5fbc484 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
-#
+#
# Copyright 2005 Red Hat, Inc.
-#
+#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
@@ -10,7 +10,7 @@
# specific, written prior permission. Red Hat makes no
# representations about the suitability of this software for any purpose. It
# is provided "as is" without express or implied warranty.
-#
+#
# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
diff --git a/actions.c b/actions.c
index d62c03f..86ce61b 100644
--- a/actions.c
+++ b/actions.c
@@ -28,7 +28,7 @@ in this Software without prior written authorization from The Open Group.
#include <X11/Intrinsic.h>
#include <X11/Xutil.h>
-#include <X11/Xaw/Cardinals.h>
+#include <X11/Xaw/Cardinals.h>
#include <X11/Xmu/CharSet.h>
#include "editresP.h"
@@ -61,20 +61,20 @@ static struct ActionValues label_values[] = {
{ "toggle", (int) ToggleLabel }
};
-static void EnableGetVal ( Widget w, XEvent *event,
+static void EnableGetVal ( Widget w, XEvent *event,
String *params, Cardinal * num_params );
-static void SelectAction ( Widget w, XEvent *event,
+static void SelectAction ( Widget w, XEvent *event,
String *params, Cardinal *num_params );
-static void RelabelAction ( Widget w, XEvent *event,
+static void RelabelAction ( Widget w, XEvent *event,
String *params, Cardinal *num_params );
-static void PopdownFileDialogAction ( Widget w, XEvent *event,
+static void PopdownFileDialogAction ( Widget w, XEvent *event,
String *params, Cardinal *num_params );
-static void ActionQuit ( Widget w, XEvent *event,
+static void ActionQuit ( Widget w, XEvent *event,
String *params, Cardinal *num_params );
static WNode * FindTreeNodeFromWidget ( Widget w );
-static Boolean CheckAndFindEntry ( String action_name,
- String * params, Cardinal num_params,
- struct ActionValues * table,
+static Boolean CheckAndFindEntry ( String action_name,
+ String * params, Cardinal num_params,
+ struct ActionValues * table,
Cardinal num_table, int * type );
/* Function Name: EnableGetVal
@@ -83,7 +83,7 @@ static Boolean CheckAndFindEntry ( String action_name,
* Arguments: w - any widget in the widget tree.
* event - NOT USED.
* params, num_params - the parameters paseed to the action
- * routine.
+ * routine.
*
*/
@@ -97,11 +97,11 @@ EnableGetVal(Widget w, XEvent *event, String *params, Cardinal *num_params)
}
/* Function Name: SelectAction
- * Description:
+ * Description:
* Arguments: w - any widget in the widget tree.
* event - NOT USED.
* params, num_params - the parameters paseed to the action
- * routine.
+ * routine.
*
* params[0] - One of "nothing", "parent", "children", "ancestors",
* "descendants", "invert", "all"
@@ -115,7 +115,7 @@ SelectAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
WNode * node;
int type;
- if (!CheckAndFindEntry("Select", params, *num_params,
+ if (!CheckAndFindEntry("Select", params, *num_params,
select_values, XtNumber(select_values), &type))
return;
@@ -131,7 +131,7 @@ SelectAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
default:
node = FindTreeNodeFromWidget(w);
if (node)
- _TreeActivateNode(node, (SelectTypes)type);
+ _TreeActivateNode(node, (SelectTypes)type);
else
_TreeSelect(global_tree_info, (SelectTypes)type);
break;
@@ -139,11 +139,11 @@ SelectAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
}
/* Function Name: RelabelAction
- * Description:
+ * Description:
* Arguments: w - any widget in the widget tree.
* event - NOT USED.
* params, num_params - the parameters paseed to the action
- * routine.
+ * routine.
*
* params[0] - One of "name", "class", "id"
* num_params - must be one.
@@ -156,16 +156,16 @@ RelabelAction(Widget w, XEvent *event, String *params, Cardinal *num_params)
WNode * node;
int type;
- if (!CheckAndFindEntry("Relabel", params, *num_params,
+ if (!CheckAndFindEntry("Relabel", params, *num_params,
label_values, XtNumber(label_values), &type))
return;
- if ((node = FindTreeNodeFromWidget(w)) == NULL)
+ if ((node = FindTreeNodeFromWidget(w)) == NULL)
_TreeRelabel(global_tree_info, (LabelTypes)type);
else {
- PrepareToLayoutTree(global_tree_info->tree_widget);
+ PrepareToLayoutTree(global_tree_info->tree_widget);
_TreeRelabelNode(node, (LabelTypes)type, FALSE);
- LayoutTree(global_tree_info->tree_widget);
+ LayoutTree(global_tree_info->tree_widget);
}
}
@@ -244,7 +244,7 @@ static XtActionsRec actions[] = {
{"EnableGetVal", EnableGetVal},
{"Select", SelectAction},
{"SVActiveEntry", ModifySVEntry},
- {"Relabel", RelabelAction},
+ {"Relabel", RelabelAction},
{"PopdownFileDialog", PopdownFileDialogAction},
{"quit", ActionQuit}
};
@@ -253,13 +253,13 @@ void
SetApplicationActions(XtAppContext app_con)
{
XtAppAddActions(app_con, actions, XtNumber(actions));
-
+
}
/************************************************************
*
- * Private functions
+ * Private functions
*
************************************************************/
@@ -286,25 +286,25 @@ CheckAndFindEntry(String action_name, String *params, Cardinal num_params,
SetMessage(global_screen_data.info_label, buf);
return(FALSE);
}
-
+
XmuCopyISOLatin1Lowered(buf, params[0]);
- for ( i = 0 ; i < num_table; i++ )
+ for ( i = 0 ; i < num_table; i++ )
if (streq(buf, table[i].name)) {
*type = table[i].type;
return(TRUE);
}
-
+
snprintf(buf, sizeof(buf), res_labels[3], action_name);
for (i = 0; i < num_table; ) {
strcat(buf, table[i++].name);
-
+
if (i == (num_table - 1))
strcat(buf, ", or ");
else if (i < num_table)
strcat(buf, ", ");
}
-
+
SetMessage(global_screen_data.info_label, buf);
return(FALSE);
}
@@ -327,7 +327,7 @@ FindTreeNodeFromWidget(Widget w)
ret_val = XFindContext(XtDisplay(w), (Window) w, NODE_INFO, &data_return);
- if (ret_val == 0)
+ if (ret_val == 0)
return((WNode *) data_return);
return(NULL);
}
diff --git a/app-defaults/Editres b/app-defaults/Editres
index 5391949..8907299 100644
--- a/app-defaults/Editres
+++ b/app-defaults/Editres
@@ -128,7 +128,7 @@ Editres.Geometry: 500x568
! For the Filename popup dialog.
-*fileDialog*value:
+*fileDialog*value:
*fileDialog*allowShellResize: True
*fileDialog*Text.baseTranslations: #override \n\
<Key>Return: PopdownFileDialog(okay)
@@ -185,7 +185,7 @@ Editres.Geometry: 500x568
*namesAndClasses*Toggle.baseTranslations: #override \n\
<Btn1Down>,<Btn1Up>: set() notify()
-
+
*commandBox.skipAdjust: True
@@ -208,7 +208,7 @@ Editres.Geometry: 500x568
:<Key>N: Relabel(name) \n\
:<Key>C: Relabel(class) \n\
:<Key>I: Relabel(id) \n\
- :<Key>W: Relabel(window)
+ :<Key>W: Relabel(window)
*Tree.Toggle.baseTranslations: #override \n\
:<Key>space: Select(nothing) \n\
diff --git a/comm.c b/comm.c
index fb949e3..a19666b 100644
--- a/comm.c
+++ b/comm.c
@@ -56,13 +56,13 @@ extern Widget CM_entries[NUM_CM_ENTRIES], TM_entries[NUM_TM_ENTRIES];
static void ClientTimedOut ( XtPointer data, XtIntervalId * id );
static void TellUserAboutMessage ( Widget label, ResCommand command );
-static Boolean ConvertCommand ( Widget w, Atom * selection, Atom * target,
- Atom * type_ret, XtPointer *value_ret,
+static Boolean ConvertCommand ( Widget w, Atom * selection, Atom * target,
+ Atom * type_ret, XtPointer *value_ret,
unsigned long * length_ret, int * format_ret );
static void SelectionDone ( Widget w, Atom *sel, Atom *targ );
static void LoseSelection ( Widget w, Atom * sel );
-static void GetClientValue ( Widget w, XtPointer data, Atom *selection,
- Atom *type, XtPointer value,
+static void GetClientValue ( Widget w, XtPointer data, Atom *selection,
+ Atom *type, XtPointer value,
unsigned long *length, int * format );
static void BuildHeader ( CurrentClient * client_data );
static Event * BuildEvent ( ProtocolStream * stream );
@@ -73,7 +73,7 @@ static char * DispatchEvent ( Event * event );
/* Function Name: ClientTimedOut
* Description: Called if the client takes too long to take our selection.
- * Arguments: data - The widget that owns the client
+ * Arguments: data - The widget that owns the client
* communication selection.
* id - *** UNUSED ***
* Returns: none.
@@ -85,11 +85,11 @@ ClientTimedOut(XtPointer data, XtIntervalId *id)
{
char msg[BUFSIZ];
Widget w = (Widget) data;
-
+
global_client.ident = NO_IDENT;
- XtDisownSelection(w, global_client.atom,
+ XtDisownSelection(w, global_client.atom,
XtLastTimestampProcessed(XtDisplay(w)));
-
+
snprintf(msg, sizeof(msg), res_labels[4], "the Editres Protocol.");
SetMessage(global_screen_data.info_label, msg);
}
@@ -102,7 +102,7 @@ ClientTimedOut(XtPointer data, XtIntervalId *id)
* Returns: a clients window, or None.
*/
-Window
+Window
GetClientWindow(Widget w, int *x, int *y)
{
int status;
@@ -112,10 +112,10 @@ GetClientWindow(Widget w, int *x, int *y)
Display * dpy = XtDisplayOfObject(w);
Window target_win = None, root = RootWindowOfScreen(XtScreenOfObject(w));
XtAppContext app = XtWidgetToApplicationContext(w);
-
+
/* Make the target cursor */
cursor = XCreateFontCursor(dpy, XC_crosshair);
-
+
/* Grab the pointer using target cursor, letting it room all over */
status = XGrabPointer(dpy, root, False,
ButtonPressMask|ButtonReleaseMask, GrabModeSync,
@@ -124,7 +124,7 @@ GetClientWindow(Widget w, int *x, int *y)
SetMessage(global_screen_data.info_label, res_labels[5]);
return(None);
}
-
+
/* Let the user select a window... */
while ((target_win == None) || (buttons != 0)) {
/* allow one more event */
@@ -136,7 +136,7 @@ GetClientWindow(Widget w, int *x, int *y)
XtDispatchEvent(&event);
break;
}
-
+
if (target_win == None) {
target_win = event.xbutton.subwindow; /* window selected */
if (x != NULL)
@@ -151,7 +151,7 @@ GetClientWindow(Widget w, int *x, int *y)
XtDispatchEvent(&event);
break;
}
-
+
if (buttons > 0) /* There may have been some
down before we started */
buttons--;
@@ -160,17 +160,17 @@ GetClientWindow(Widget w, int *x, int *y)
XtDispatchEvent(&event);
break;
}
- }
-
+ }
+
XUngrabPointer(dpy, CurrentTime); /* Done with pointer */
-
+
return(XmuClientWindow(dpy, target_win));
}
/* Function Name: SetCommand
- * Description: Causes this widget to own the resource editor's
+ * Description: Causes this widget to own the resource editor's
* command selection.
* Arguments: w - the widget that will own the selection.
* command - command to send to client.
@@ -184,24 +184,24 @@ SetCommand(Widget w, ResCommand command, char *msg)
{
XClientMessageEvent client_event;
Display * dpy = XtDisplay(w);
-
- if (msg == NULL)
+
+ if (msg == NULL)
msg = res_labels[6];
-
+
SetMessage(global_screen_data.info_label, msg);
-
+
if (global_client.window == None)
- if ( (global_client.window = GetClientWindow(w, NULL, NULL)) == None)
+ if ( (global_client.window = GetClientWindow(w, NULL, NULL)) == None)
return;
global_client.ident = GetNewIdent();
-
+
global_client.command = command;
global_client.atom = atom_comm;
- BuildHeader(&(global_client));
+ BuildHeader(&(global_client));
- if (!XtOwnSelection(w, global_client.atom, CurrentTime, ConvertCommand,
+ if (!XtOwnSelection(w, global_client.atom, CurrentTime, ConvertCommand,
LoseSelection, SelectionDone))
SetMessage(global_screen_data.info_label,
res_labels[7]);
@@ -214,14 +214,14 @@ SetCommand(Widget w, ResCommand command, char *msg)
client_event.data.l[1] = global_client.atom;
client_event.data.l[2] = (long) global_client.ident;
client_event.data.l[3] = global_effective_protocol_version;
-
+
global_error_code = NO_ERROR; /* Reset Error code. */
global_old_error_handler = XSetErrorHandler(HandleXErrors);
global_serial_num = NextRequest(dpy);
-
- XSendEvent(dpy, global_client.window, FALSE, (long) 0,
+
+ XSendEvent(dpy, global_client.window, FALSE, (long) 0,
(XEvent *) &client_event);
-
+
XSync(dpy, FALSE);
XSetErrorHandler(global_old_error_handler);
if (global_error_code == NO_WINDOW) {
@@ -229,16 +229,16 @@ SetCommand(Widget w, ResCommand command, char *msg)
"The communication window with the"
" application is no longer available\n"
"Please select a new widget tree.";
-
+
global_error_code = NO_ERROR; /* Reset Error code. */
global_client.window = None;
SetCommand(w, LocalSendWidgetTree, error_buf);
return;
- }
-
+ }
+
TellUserAboutMessage(global_screen_data.info_label, command);
global_client.timeout = XtAppAddTimeOut(XtWidgetToApplicationContext(w),
- CLIENT_TIME_OUT,
+ CLIENT_TIME_OUT,
ClientTimedOut, (XtPointer) w);
}
@@ -303,7 +303,7 @@ ConvertCommand(Widget w, Atom *selection, Atom *target, Atom *type_ret,
*value_ret = (XtPointer) global_client.stream.real_top;
*length_ret = global_client.stream.size + HEADER_SIZE;
*format_ret = EDITRES_FORMAT;
-
+
return(TRUE);
}
@@ -394,15 +394,15 @@ GetClientValue(Widget w, XtPointer data, Atom *selection, Atom *type,
#ifdef DEBUG
if (global_resources.debug)
printf("Incorrect ident from client.\n");
-#endif
- if (!XtOwnSelection(w, *selection, CurrentTime, ConvertCommand,
+#endif
+ if (!XtOwnSelection(w, *selection, CurrentTime, ConvertCommand,
LoseSelection, SelectionDone))
SetMessage(global_screen_data.info_label,
res_labels[10]);
return;
}
- (void) _XEditResGet8(stream, &error_code);
+ (void) _XEditResGet8(stream, &error_code);
(void) _XEditResGet32(stream, &(stream->size));
stream->top = stream->current; /* reset stream to top of value.*/
@@ -443,10 +443,10 @@ GetClientValue(Widget w, XtPointer data, Atom *selection, Atom *type,
if (error_str == NULL) {
WNode * top;
-
+
if (global_tree_info == NULL)
return;
-
+
top = global_tree_info->top_node;
snprintf(msg, sizeof(msg), res_labels[12], top->name, top->class);
SetMessage(global_screen_data.info_label, msg);
@@ -478,22 +478,22 @@ BuildHeader(CurrentClient *client_data)
* fill in the space.
*/
- /*
+ /*
* Fool the insert routines into putting the header in the right
* place while being damn sure not to realloc (that would be very bad.
*/
-
+
old_current = stream->current;
old_alloc = stream->alloc;
old_size = stream->size;
stream->current = stream->real_top;
- stream->alloc = stream->size + (2 * HEADER_SIZE);
-
+ stream->alloc = stream->size + (2 * HEADER_SIZE);
+
_XEditResPut8(stream, client_data->ident);
switch(client_data->command) {
- case LocalSendWidgetTree:
- if (reset_protocol_level) global_effective_protocol_version =
+ case LocalSendWidgetTree:
+ if (reset_protocol_level) global_effective_protocol_version =
CURRENT_PROTOCOL_VERSION;
reset_protocol_level = True;
command = SendWidgetTree;
@@ -517,7 +517,7 @@ BuildHeader(CurrentClient *client_data)
command = SendWidgetTree;
break;
}
-
+
_XEditResPut8(stream, (unsigned char) command);
_XEditResPut32(stream, old_size);
@@ -529,12 +529,12 @@ BuildHeader(CurrentClient *client_data)
/* Function Name: BuildEvent
- * Description: Builds the event structure from the
+ * Description: Builds the event structure from the
* Arguments: stream - the protocol data stream.
* Returns: event - the event.
*/
-static Event *
+static Event *
BuildEvent(ProtocolStream *stream)
{
int i;
@@ -554,7 +554,7 @@ BuildEvent(ProtocolStream *stream)
if (!_XEditResGet16(stream, &(send_event->num_entries)))
goto done;
-
+
send_event->info = (WidgetTreeInfo *)
XtCalloc(sizeof(WidgetTreeInfo),
send_event->num_entries);
@@ -564,13 +564,13 @@ BuildEvent(ProtocolStream *stream)
if (!(_XEditResGetWidgetInfo(stream, &(info->widgets)) &&
_XEditResGetString8(stream, &(info->name)) &&
_XEditResGetString8(stream, &(info->class)) &&
- _XEditResGet32(stream, &(info->window))))
+ _XEditResGet32(stream, &(info->window))))
{
goto done;
}
}
- if (global_effective_protocol_version ==
+ if (global_effective_protocol_version ==
CURRENT_PROTOCOL_VERSION) {
/* get toolkit type and reset if necessary */
if (!_XEditResGetString8(stream, &(send_event->toolkit)))
@@ -580,11 +580,11 @@ BuildEvent(ProtocolStream *stream)
SetEntriesSensitive(&CM_entries[CM_OFFSET], CM_NUM, True);
/* set the tree menu entries senitive */
SetEntriesSensitive(TM_entries, TM_NUM, True);
- if (global_effective_protocol_version ==
+ if (global_effective_protocol_version ==
CURRENT_PROTOCOL_VERSION) {
- if (!strcmp(send_event->toolkit, "InterViews"))
+ if (!strcmp(send_event->toolkit, "InterViews"))
RebuildMenusAndLabel("iv");
- }
+ }
else
RebuildMenusAndLabel("xt");
}
@@ -597,7 +597,7 @@ BuildEvent(ProtocolStream *stream)
if (!_XEditResGet16(stream, &(sv_event->num_entries)))
goto done;
-
+
sv_event->info = (SetValuesInfo *) XtCalloc(sizeof(SetValuesInfo),
sv_event->num_entries);
@@ -614,13 +614,13 @@ BuildEvent(ProtocolStream *stream)
case LocalGetResources:
{
GetResourcesEvent * res_event = (GetResourcesEvent *) event;
-
+
res_event->type = GetGeometry;
if (!_XEditResGet16(stream, &(res_event->num_entries)))
goto done;
- res_event->info = (GetResourcesInfo *)
+ res_event->info = (GetResourcesInfo *)
XtCalloc(sizeof(GetResourcesInfo),
res_event->num_entries);
@@ -632,7 +632,7 @@ BuildEvent(ProtocolStream *stream)
goto done;
}
if (res_info->error) {
- if (!_XEditResGetString8(stream, &(res_info->message)))
+ if (!_XEditResGetString8(stream, &(res_info->message)))
goto done;
}
else {
@@ -641,7 +641,7 @@ BuildEvent(ProtocolStream *stream)
if (!_XEditResGet16(stream, &(res_info->num_resources)))
goto done;
- res_info->res_info = (ResourceInfo *)
+ res_info->res_info = (ResourceInfo *)
XtCalloc(sizeof(ResourceInfo),
res_info->num_resources);
@@ -671,7 +671,7 @@ BuildEvent(ProtocolStream *stream)
if (!_XEditResGet16(stream, &(geom_event->num_entries)))
goto done;
-
+
geom_event->info = (GetGeomInfo *) XtCalloc(sizeof(GetGeomInfo),
geom_event->num_entries);
@@ -714,9 +714,9 @@ BuildEvent(ProtocolStream *stream)
{
Arg args[1];
GetValuesEvent * gv_event = (GetValuesEvent *) event;
-
+
gv_event->type = GetValues;
-
+
if (!_XEditResGet16(stream, &(gv_event->num_entries)))
goto done;
@@ -758,7 +758,7 @@ BuildEvent(ProtocolStream *stream)
/* Function Name: FreeEvent
- * Description: Frees all memory associated with the event.
+ * Description: Frees all memory associated with the event.
* Arguments: event - the event.
* Returns: none.
*
@@ -775,7 +775,7 @@ FreeEvent(Event *event)
{
SendWidgetTreeEvent * send_event = (SendWidgetTreeEvent *) event;
WidgetTreeInfo * info = send_event->info;
-
+
if (info != NULL) {
for (i = 0; i < send_event->num_entries; i++, info++) {
XtFree((char *)info->widgets.ids);
@@ -790,7 +790,7 @@ FreeEvent(Event *event)
{
SetValuesEvent * sv_event = (SetValuesEvent *) event;
SetValuesInfo * info = sv_event->info;
-
+
if (info != NULL) {
for (i = 0; i < sv_event->num_entries; i++, info++) {
XtFree((char *)info->widgets.ids);
@@ -808,15 +808,15 @@ FreeEvent(Event *event)
if (info != NULL) {
for (i = 0; i < get_event->num_entries; i++, info++) {
XtFree((char *)info->widgets.ids);
- if (info->error)
+ if (info->error)
XtFree(info->message);
else {
unsigned int j;
ResourceInfo * res_info = info->res_info;
-
+
if (res_info != NULL) {
- for (j = 0;
- j < info->num_resources; j++, res_info++)
+ for (j = 0;
+ j < info->num_resources; j++, res_info++)
{
XtFree(res_info->name);
XtFree(res_info->class);
@@ -825,7 +825,7 @@ FreeEvent(Event *event)
XtFree((char *)info->res_info);
}
}
- }
+ }
XtFree((char *)get_event->info);
}
}
@@ -838,7 +838,7 @@ FreeEvent(Event *event)
if (info != NULL) {
for (i = 0; i < geom_event->num_entries; i++, info++) {
XtFree((char *)info->widgets.ids);
- if (info->error)
+ if (info->error)
XtFree(info->message);
}
XtFree((char *)geom_event->info);
@@ -848,7 +848,7 @@ FreeEvent(Event *event)
case FindChild:
{
FindChildEvent * find_event = (FindChildEvent *) event;
-
+
XtFree((char *)find_event->widgets.ids);
}
break;
@@ -864,7 +864,7 @@ FreeEvent(Event *event)
* Arguments: event - the event.
* Returns: one.
*/
-
+
static char *
DispatchEvent(Event *event)
{
diff --git a/configure.ac b/configure.ac
index 9f10229..b34557b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
dnl Copyright 2005 Red Hat, Inc.
-dnl
+dnl
dnl Permission to use, copy, modify, distribute, and sell this software and its
dnl documentation for any purpose is hereby granted without fee, provided that
dnl the above copyright notice appear in all copies and that both that
@@ -10,7 +10,7 @@ dnl advertising or publicity pertaining to distribution of the software without
dnl specific, written prior permission. Red Hat makes no
dnl representations about the suitability of this software for any purpose. It
dnl is provided "as is" without express or implied warranty.
-dnl
+dnl
dnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
dnl EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
diff --git a/editres.c b/editres.c
index 7ab1d26..e932807 100644
--- a/editres.c
+++ b/editres.c
@@ -27,7 +27,7 @@ in this Software without prior written authorization from The Open Group.
#include <stdlib.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
-#include <X11/Xaw/Cardinals.h>
+#include <X11/Xaw/Cardinals.h>
#define THIS_IS_MAIN /* Don't get extern definitions of global
variables. */
@@ -35,7 +35,7 @@ in this Software without prior written authorization from The Open Group.
#include "editresP.h"
/*
- * Global variables.
+ * Global variables.
*/
/* array of toolkit dependent labels taken from the resource file */
@@ -63,7 +63,7 @@ AppResources global_resources;
static void Syntax ( XtAppContext app_con, char *call );
-static String fallback_resources[] = {
+static String fallback_resources[] = {
NULL,
};
@@ -73,9 +73,9 @@ static XtResource editres_resources[] = {
{"debug", "Debug", XtRBoolean, sizeof(Boolean),
Offset(debug), XtRImmediate, (XtPointer) FALSE},
{"numFlashes", "NumFlashes", XtRInt, sizeof(int),
- Offset(num_flashes), XtRImmediate, (XtPointer) NUM_FLASHES},
+ Offset(num_flashes), XtRImmediate, (XtPointer) NUM_FLASHES},
{"flashTime", "FlashTime", XtRInt, sizeof(int),
- Offset(flash_time), XtRImmediate, (XtPointer) FLASH_TIME},
+ Offset(flash_time), XtRImmediate, (XtPointer) FLASH_TIME},
{"flashColor", XtCForeground, XtRPixel, sizeof(Pixel),
Offset(flash_color), XtRImmediate, (XtPointer) XtDefaultForeground},
{"saveResourceFile", "SaveResourcesFile", XtRString, sizeof(String),
@@ -93,23 +93,23 @@ main(int argc, char **argv)
&argc, argv, fallback_resources,
NULL, ZERO);
- if (argc != 1)
+ if (argc != 1)
Syntax(app_con, argv[0]);
SetApplicationActions(app_con);
- XtGetApplicationResources(global_toplevel, (XtPointer) &global_resources,
+ XtGetApplicationResources(global_toplevel, (XtPointer) &global_resources,
editres_resources, XtNumber(editres_resources),
NULL, (Cardinal) 0);
global_resources.allocated_save_resources_file = FALSE;
XtOverrideTranslations
- (global_toplevel,
- XtParseTranslationTable ("<Message>WM_PROTOCOLS: quit()"));
+ (global_toplevel,
+ XtParseTranslationTable ("<Message>WM_PROTOCOLS: quit()"));
/* build tree for Xt intrinsics */
- BuildWidgetTree(global_toplevel);
+ BuildWidgetTree(global_toplevel);
- SetMessage(global_screen_data.info_label,
+ SetMessage(global_screen_data.info_label,
res_labels[13]);
global_screen_data.set_values_popup = NULL;
@@ -118,10 +118,10 @@ main(int argc, char **argv)
XtRealizeWidget(global_toplevel);
- wm_delete_window =
+ wm_delete_window =
XInternAtom(XtDisplay(global_toplevel), "WM_DELETE_WINDOW",
False);
- (void) XSetWMProtocols (XtDisplay(global_toplevel),
+ (void) XSetWMProtocols (XtDisplay(global_toplevel),
XtWindow(global_toplevel),
&wm_delete_window, 1);
XtAppMainLoop(app_con);
@@ -135,7 +135,7 @@ main(int argc, char **argv)
* Returns: none - exits tho.
*/
-static void
+static void
Syntax(XtAppContext app_con, char *call)
{
XtDestroyApplicationContext(app_con);
diff --git a/editresP.h b/editresP.h
index fcdca7f..f6aa412 100644
--- a/editresP.h
+++ b/editresP.h
@@ -40,9 +40,9 @@ in this Software without prior written authorization from The Open Group.
#define PROTOCOL_VERSION_ONE_POINT_ONE 5 /* version 1.1 */
#define ONE_POINT_ONE_STRING "1.1"
#define PROTOCOL_VERSION_ONE_POINT_ZERO 4 /* version 1.0 */
-#define ONE_POINT_ZERO_STRING "1.0" ONE_POINT_ONE_STRING
+#define ONE_POINT_ZERO_STRING "1.0" ONE_POINT_ONE_STRING
-#define CURRENT_PROTOCOL_VERSION PROTOCOL_VERSION_ONE_POINT_ONE
+#define CURRENT_PROTOCOL_VERSION PROTOCOL_VERSION_ONE_POINT_ONE
#define CURRENT_PROTOCOL_VERSION_STRING ONE_POINT_ONE_STRING
#define FLASH_TIME 1000 /* Default flash time in microseconds */
@@ -71,19 +71,19 @@ in this Software without prior written authorization from The Open Group.
#define NODE_INFO ((XContext) 42)
/*
- * Error codes for X Server errors.
+ * Error codes for X Server errors.
*/
#define NO_ERROR 0
#define NO_WINDOW 1
-typedef enum {LocalSendWidgetTree, LocalSetValues, LocalFindChild,
+typedef enum {LocalSendWidgetTree, LocalSetValues, LocalFindChild,
LocalFlashWidget, LocalGetGeometry, LocalGetResources,
LocalGetValues} ResCommand;
typedef enum {ClassLabel, NameLabel, IDLabel, WindowLabel,
ToggleLabel} LabelTypes;
-typedef enum {SelectWidget, SelectAll, SelectNone, SelectInvert, SelectParent,
+typedef enum {SelectWidget, SelectAll, SelectNone, SelectInvert, SelectParent,
SelectChildren, SelectDescendants, SelectAncestors} SelectTypes;
typedef struct _NameInfo {
@@ -97,16 +97,16 @@ typedef struct _ResourceBoxInfo {
Widget res_label; /* The label containing current resoruce. */
Widget shell; /* Shell widget containing resource box. */
Widget norm_list; /* The List widget for the normal list. */
- Widget cons_list; /* The List widget for the
+ Widget cons_list; /* The List widget for the
Constriaint Resources */
NameInfo * name_info; /* The info about the widgets for each
name and class in the instance heirarchy. */
} ResourceBoxInfo;
-
+
typedef struct _WidgetResourceInfo {
char * name, * class, *type; /* Name, Class and Type of each resource. */
} WidgetResourceInfo;
-
+
typedef struct _WidgetResources {
int num_normal, num_constraint;
WidgetResourceInfo *normal, *constraint;
@@ -196,7 +196,7 @@ typedef struct _ApplyResourcesInfo {
ProtocolStream * stream;
XrmDatabase database;
} ApplyResourcesInfo;
-
+
/*
* Information needed to get a resource string from a widget.
*/
@@ -236,7 +236,7 @@ typedef struct _SetValuesInfo {
WidgetInfo widgets;
char * message;
} SetValuesInfo;
-
+
typedef struct _SetValuesEvent {
EditresCommand type;
unsigned short num_entries;
@@ -247,7 +247,7 @@ typedef struct _GetValuesInfo {
WidgetInfo widgets;
char * value;
} GetValuesInfo;
-
+
typedef struct _GetValuesEvent {
EditresCommand type;
unsigned short num_entries;
@@ -303,7 +303,7 @@ typedef union _Event {
FindChildEvent find_child_event;
GetValuesEvent get_values_event;
} Event;
-
+
/*
* number of application resource labels.
*/
@@ -311,7 +311,7 @@ typedef union _Event {
#define NUM_RES_LABELS 37
/*
- * Global variables.
+ * Global variables.
*/
extern int global_effective_protocol_version;
extern char* global_effective_toolkit;
diff --git a/geometry.c b/geometry.c
index c9b01a5..50dd286 100644
--- a/geometry.c
+++ b/geometry.c
@@ -30,19 +30,19 @@ in this Software without prior written authorization from The Open Group.
#include <X11/Shell.h>
#include <stdio.h>
-#include <X11/Xaw/Cardinals.h>
+#include <X11/Xaw/Cardinals.h>
#include "editresP.h"
/*
- * Local function definitions
+ * Local function definitions
*/
-static void AddToFlashList ( TreeInfo * tree_info, GetGeomInfo * geom_info,
+static void AddToFlashList ( TreeInfo * tree_info, GetGeomInfo * geom_info,
char ** errors );
-static void _AddToFlashList ( TreeInfo * tree_info, char ** errors,
- WNode * node, int x, int y, unsigned int width,
+static void _AddToFlashList ( TreeInfo * tree_info, char ** errors,
+ WNode * node, int x, int y, unsigned int width,
unsigned int height );
-static void CreateFlashWidget ( TreeInfo * tree_info, int x, int y,
+static void CreateFlashWidget ( TreeInfo * tree_info, int x, int y,
unsigned int width, unsigned int height );
static void FlashWidgets ( TreeInfo * tree_info );
static void FlashWidgetsOn ( XtPointer info_ptr, XtIntervalId * id );
@@ -55,7 +55,7 @@ static void FlashWidgetsCleanup ( XtPointer info_ptr, XtIntervalId * id );
* Returns: none.
*/
-void
+void
_FindWidget(Widget w)
{
char msg[BUFSIZ];
@@ -70,8 +70,8 @@ _FindWidget(Widget w)
if ( (win = GetClientWindow(w, &x, &y)) != None) {
node = FindWidgetFromWindow(global_tree_info, win);
if (node != NULL) {
- ProtocolStream * stream = &(global_client.stream);
-
+ ProtocolStream * stream = &(global_client.stream);
+
_XEditResResetStream(stream);
InsertWidgetFromNode(stream, node);
_XEditResPut16(stream, (short) x);
@@ -81,7 +81,7 @@ _FindWidget(Widget w)
}
}
- SetMessage(global_screen_data.info_label,
+ SetMessage(global_screen_data.info_label,
res_labels[15]);
}
@@ -105,7 +105,7 @@ DisplayChild(Event *event)
if (node == NULL) {
snprintf(msg, sizeof(msg), res_labels[13]);
SetMessage(global_screen_data.info_label, msg);
- return;
+ return;
}
SetAndCenterTreeNode(node);
@@ -140,14 +140,14 @@ _FlashActiveWidgets(TreeInfo *tree_info)
SetMessage(global_screen_data.info_label,res_labels[18]);
return;
}
-
- _XEditResResetStream(stream);
+
+ _XEditResResetStream(stream);
/*
- * Insert the number of widgets.
+ * Insert the number of widgets.
*/
_XEditResPut16(stream, (unsigned short) tree_info->num_nodes);
- for (i = 0; i < tree_info->num_nodes; i++)
+ for (i = 0; i < tree_info->num_nodes; i++)
InsertWidgetFromNode(stream, global_tree_info->active_nodes[i]);
SetCommand(tree_info->tree_widget, LocalFlashWidget, NULL);
@@ -167,7 +167,7 @@ HandleFlashWidget(Event *event)
char * errors = NULL;
int i;
- for (i = 0; i < (int)geom_event->num_entries; i++)
+ for (i = 0; i < (int)geom_event->num_entries; i++)
AddToFlashList(global_tree_info, geom_event->info + i, &errors);
FlashWidgets(global_tree_info);
@@ -189,31 +189,31 @@ AddToFlashList(TreeInfo *tree_info, GetGeomInfo *geom_info, char **errors)
WNode * node;
char buf[BUFSIZ];
- node = FindNode(tree_info->top_node,
+ node = FindNode(tree_info->top_node,
geom_info->widgets.ids, geom_info->widgets.num_widgets);
if (node == NULL) {
snprintf(buf, sizeof(buf),
"Editres Internal Error: Unable to FindNode.\n");
- AddString(errors, buf);
- return;
+ AddString(errors, buf);
+ return;
}
if (geom_info->error) {
- AddString(errors, geom_info->message);
- return;
+ AddString(errors, geom_info->message);
+ return;
}
if (!geom_info->visable) {
snprintf(buf, sizeof(buf), "%s(0x%lx) - This widget is not mapped\n",
node->name, node->id);
- AddString(errors, buf);
+ AddString(errors, buf);
return;
}
- _AddToFlashList(tree_info, errors, node,
- geom_info->x, geom_info->y,
- geom_info->width + geom_info->border_width,
+ _AddToFlashList(tree_info, errors, node,
+ geom_info->x, geom_info->y,
+ geom_info->width + geom_info->border_width,
geom_info->height + geom_info->border_width);
}
@@ -240,7 +240,7 @@ _AddToFlashList(TreeInfo *tree_info, char **errors, WNode *node,
if (window == EDITRES_IS_UNREALIZED) {
char buf[BUFSIZ];
- if (node->window == EDITRES_IS_OBJECT)
+ if (node->window == EDITRES_IS_OBJECT)
snprintf(buf, sizeof(buf),
"%s(0x%lx) - This object's parent is unrealized\n",
node->name, node->id);
@@ -249,7 +249,7 @@ _AddToFlashList(TreeInfo *tree_info, char **errors, WNode *node,
"%s(0x%lx) - This widget is unrealized\n",
node->name, node->id);
- AddString(errors, buf);
+ AddString(errors, buf);
return;
}
@@ -267,18 +267,18 @@ _AddToFlashList(TreeInfo *tree_info, char **errors, WNode *node,
snprintf(buf, sizeof(buf),
"%s(0x%lx) - This widget's window no longer exists.\n",
node->name, node->id);
- AddString(errors, buf);
+ AddString(errors, buf);
return;
- }
+ }
if (attrs.map_state != IsViewable) {
char buf[BUFSIZ];
snprintf(buf, sizeof(buf), "%s(0x%lx) - This widget is not mapped.\n",
node->name, node->id);
- AddString(errors, buf);
+ AddString(errors, buf);
return;
- }
+ }
CreateFlashWidget(tree_info, x, y, width, height);
}
@@ -291,7 +291,7 @@ _AddToFlashList(TreeInfo *tree_info, char **errors, WNode *node,
* x,y,width, height - size and location of the flash widget.
* Returns: none.
*/
-
+
#define MORE_FLASH_WIDGETS 5
static void
@@ -307,20 +307,20 @@ CreateFlashWidget(TreeInfo *tree_info, int x, int y,
XtSetArg(args[num], XtNy, y); num++;
XtSetArg(args[num], XtNbackground, global_resources.flash_color); num++;
- shell = XtCreatePopupShell("flash", overrideShellWidgetClass,
+ shell = XtCreatePopupShell("flash", overrideShellWidgetClass,
tree_info->tree_widget, args, num);
num = 0;
XtSetArg(args[num], XtNborderWidth, &bw); num++;
XtGetValues(shell, args, num);
-
+
bw *= 2;
num = 0;
XtSetArg(args[num], XtNwidth, (width - bw)); num++;
XtSetArg(args[num], XtNheight, (height - bw)); num++;
- XtSetValues(shell, args, num);
-
+ XtSetValues(shell, args, num);
+
if (tree_info->num_flash_widgets + 1 > tree_info->alloc_flash_widgets) {
tree_info->alloc_flash_widgets += MORE_FLASH_WIDGETS;
tree_info->flash_widgets =
@@ -361,7 +361,7 @@ FlashWidgets(TreeInfo *tree_info)
FlashWidgetsOn((XtPointer) tree_info, (XtIntervalId *) NULL);
}
-
+
/* Function Name: FlashWidgetsOn
* Description: Turns on all the Flash Widgets.
* Arguments: info_ptr - pointer to the tree info.
@@ -376,7 +376,7 @@ FlashWidgetsOn(XtPointer info_ptr, XtIntervalId *id)
Cardinal i;
TreeInfo * tree_info = (TreeInfo *) info_ptr;
-
+
for (i = 0; i < tree_info->num_flash_widgets; i++) {
XtRealizeWidget(tree_info->flash_widgets[i]);
XMapRaised(XtDisplay(tree_info->flash_widgets[i]),
@@ -397,7 +397,7 @@ FlashWidgetsOff(XtPointer info_ptr, XtIntervalId *id)
{
Cardinal i;
TreeInfo * tree_info = (TreeInfo *) info_ptr;
-
+
for (i = 0; i < tree_info->num_flash_widgets; i++)
XtUnmapWidget(tree_info->flash_widgets[i]);
}
@@ -419,13 +419,13 @@ FlashWidgetsCleanup(XtPointer info_ptr, XtIntervalId *id)
/*
* Unmap 'em first for consistency.
*/
-
+
for (i = 0; i < tree_info->num_flash_widgets; i++)
XtUnmapWidget(tree_info->flash_widgets[i]);
XFlush(XtDisplay(tree_info->tree_widget));
- for (i = 0; i < tree_info->num_flash_widgets; i++)
+ for (i = 0; i < tree_info->num_flash_widgets; i++)
XtDestroyWidget(tree_info->flash_widgets[i]);
XtFree((char *)tree_info->flash_widgets);
diff --git a/handler.c b/handler.c
index b2bf83c..c053868 100644
--- a/handler.c
+++ b/handler.c
@@ -39,13 +39,13 @@ in this Software without prior written authorization from The Open Group.
#include "editresP.h"
-/*
+/*
* Local function definitions.
*/
static char * GetResourceName ( ResourceBoxInfo * res_box );
-static void _AppendResourceString ( Widget w, XtPointer res_box_ptr,
+static void _AppendResourceString ( Widget w, XtPointer res_box_ptr,
XtPointer filename_ptr );
-static void _SetResourcesFile ( Widget w, XtPointer junk,
+static void _SetResourcesFile ( Widget w, XtPointer junk,
XtPointer filename_ptr );
static void ObtainResource ( XtPointer node_ptr );
static void CreateSetValuesCommand ( WNode * node, XtPointer info_ptr );
@@ -89,8 +89,8 @@ SendTree(Widget w, XtPointer value, XtPointer call_data)
w = XtParent(w);
_XEditResResetStream(&(global_client.stream)); /* an empty message. */
-
- SetCommand(w, LocalSendWidgetTree, NULL);
+
+ SetCommand(w, LocalSendWidgetTree, NULL);
}
/* Function Name: FindWidget
@@ -171,13 +171,13 @@ TreeRelabel(Widget w, XtPointer client_data, XtPointer call_data)
*/
/* ARGSUSED */
-void
+void
PannerCallback(Widget w, XtPointer closure, XtPointer report_ptr)
{
Arg args[2];
XawPannerReport *report = (XawPannerReport *) report_ptr;
- if (global_tree_info == NULL)
+ if (global_tree_info == NULL)
return;
XtSetArg (args[0], XtNx, -report->slider_x);
@@ -188,7 +188,7 @@ PannerCallback(Widget w, XtPointer closure, XtPointer report_ptr)
/* Function Name: PortholeCallback
* Description: called when the porthole or its child has
- * changed
+ * changed
* Arguments: porthole - the porthole widget.
* panner_ptr - the panner widget.
* report_ptr - the porthole record.
@@ -196,7 +196,7 @@ PannerCallback(Widget w, XtPointer closure, XtPointer report_ptr)
*/
/* ARGSUSED */
-void
+void
PortholeCallback(Widget w, XtPointer panner_ptr, XtPointer report_ptr)
{
Arg args[10];
@@ -222,7 +222,7 @@ PortholeCallback(Widget w, XtPointer panner_ptr, XtPointer report_ptr)
*/
/* ARGSUSED */
-void
+void
FlashActiveWidgets(Widget w, XtPointer junk, XtPointer garbage)
{
_FlashActiveWidgets(global_tree_info);
@@ -268,7 +268,7 @@ GetResourceList(Widget w, XtPointer junk, XtPointer garbage)
* No resoruces, fetch them from the client.
*/
- _XEditResResetStream(stream);
+ _XEditResResetStream(stream);
_XEditResPut16(stream, (unsigned short) 1);
InsertWidgetFromNode(stream, node);
SetCommand(global_tree_info->tree_widget, LocalGetResources, NULL);
@@ -282,7 +282,7 @@ GetResourceList(Widget w, XtPointer junk, XtPointer garbage)
*/
/* ARGSUSED */
-void
+void
DumpTreeToFile(Widget w, XtPointer junk, XtPointer garbage)
{
_PopupFileDialog(XtParent(w), "Enter the filename:", "",
@@ -290,24 +290,24 @@ DumpTreeToFile(Widget w, XtPointer junk, XtPointer garbage)
}
/************************************************************
- *
+ *
* Callbacks for the Resource Box.
*
************************************************************/
/* Function Name: AnyChosen
- * Description: Callback that is called when the "any" widget
+ * Description: Callback that is called when the "any" widget
* is activated.
* Arguments: w - the "any" widget that activated this callback.
- * any_info_ptr - pointer to struct containing
+ * any_info_ptr - pointer to struct containing
* dot and star widgets to lock.
* state_ptr - state of the any toggle.
* Returns: none.
*/
/* ARGSUSED */
-void
+void
AnyChosen(Widget w, XtPointer any_info_ptr, XtPointer state_ptr)
{
AnyInfo * any_info = (AnyInfo *) any_info_ptr;
@@ -337,9 +337,9 @@ AnyChosen(Widget w, XtPointer any_info_ptr, XtPointer state_ptr)
(*any_info->right_count)++;
}
else { /* state == 0 */
- if (any_info->left_count > 0)
+ if (any_info->left_count > 0)
any_info->left_count--;
- if ((any_info->right_count != NULL)&&(*any_info->right_count > 0))
+ if ((any_info->right_count != NULL)&&(*any_info->right_count > 0))
(*any_info->right_count)--;
if (any_info->left_count == 0) {
@@ -374,17 +374,17 @@ GetResourceName(ResourceBoxInfo *res_box)
{
XawListReturnStruct * list_info;
char * result;
-
+
list_info = XawListShowCurrent(res_box->norm_list);
- if ((list_info->list_index == XAW_LIST_NONE) &&
+ if ((list_info->list_index == XAW_LIST_NONE) &&
(res_box->cons_list != NULL)) {
list_info = XawListShowCurrent(res_box->cons_list);
}
- if (list_info->list_index == XAW_LIST_NONE)
+ if (list_info->list_index == XAW_LIST_NONE)
result = "unknown";
else
- result = list_info->string;
+ result = list_info->string;
return(result);
}
@@ -436,7 +436,7 @@ SetResourceString(Widget w, XtPointer node_ptr, XtPointer junk)
if ((w != NULL) && XtIsSubclass(w, toggleWidgetClass)) {
/*
* Only set resources when toggles are activated, not when they are
- * deactivated.
+ * deactivated.
*/
if (!((Boolean)(long) junk))
return;
@@ -456,13 +456,13 @@ SetResourceString(Widget w, XtPointer node_ptr, XtPointer junk)
if ( (temp != NULL) && !streq(temp, ANY_RADIO_DATA) ) {
strcat(buf, temp);
temp = (char *) XawToggleGetCurrent(name_node->next->sep_leader);
- if (temp == NULL)
+ if (temp == NULL)
strcat(buf, "!");
else
strcat(buf, temp);
}
}
-
+
strcat(buf, GetResourceName(res_box));
len = strlen(buf) + 2; /* Leave space for ':' and '\0' */
@@ -476,7 +476,7 @@ SetResourceString(Widget w, XtPointer node_ptr, XtPointer junk)
malloc_string = XtRealloc(malloc_string, sizeof(char) * len);
malloc_size = len;
}
-
+
strcpy(malloc_string, buf);
strcat(malloc_string, ":");
#ifdef notdef
@@ -486,9 +486,9 @@ SetResourceString(Widget w, XtPointer node_ptr, XtPointer junk)
XtSetArg(args[0], XtNlabel, malloc_string);
XtSetValues(res_box->res_label, args, ONE);
}
-
+
/* Function Name: ResourceListCallback
- * Description: Callback functions for the resource lists. This
+ * Description: Callback functions for the resource lists. This
* routine is essentialy called by the list widgets
* Notify action. If action EnableGetVal has been
* invoked, ResourceListCallback will perform a
@@ -508,7 +508,7 @@ ResourceListCallback(Widget list, XtPointer node_ptr, XtPointer junk)
WNode * node = (WNode *) node_ptr;
ResourceBoxInfo * res_box = node->resources->res_box;
- if (list == res_box->norm_list)
+ if (list == res_box->norm_list)
o_list = res_box->cons_list;
else
o_list = res_box->norm_list;
@@ -555,11 +555,11 @@ _AppendResourceString(Widget w, XtPointer res_box_ptr, XtPointer filename_ptr)
char *value_ptr;
if (filename != NULL) {
- if (global_resources.allocated_save_resources_file)
+ if (global_resources.allocated_save_resources_file)
XtFree(global_resources.save_resources_file);
else
global_resources.allocated_save_resources_file = TRUE;
-
+
global_resources.save_resources_file = XtNewString(filename);
}
@@ -596,7 +596,7 @@ _AppendResourceString(Widget w, XtPointer res_box_ptr, XtPointer filename_ptr)
void
SaveResource(Widget w, XtPointer res_box_ptr, XtPointer junk)
{
- /*
+ /*
* If there is no filename the ask for one, otherwise just save to
* current file.
*/
@@ -623,7 +623,7 @@ _SetResourcesFile(Widget w, XtPointer junk, XtPointer filename_ptr)
{
char *filename = (char *) filename_ptr;
- if (global_resources.allocated_save_resources_file)
+ if (global_resources.allocated_save_resources_file)
XtFree(global_resources.save_resources_file);
else
global_resources.allocated_save_resources_file = TRUE;
@@ -643,7 +643,7 @@ _SetResourcesFile(Widget w, XtPointer junk, XtPointer filename_ptr)
void
SetFile(Widget w, XtPointer junk, XtPointer garbage)
{
- /*
+ /*
* If there is no filename the ask for one, otherwise just save to
* current file.
*/
@@ -656,7 +656,7 @@ SetFile(Widget w, XtPointer junk, XtPointer garbage)
/* Function Name: ApplyResource
* Description: Apply the current resource to the running application.
* Arguments: w - any widget in the application.
- * node_ptr - a pointer to the node containing
+ * node_ptr - a pointer to the node containing
* the current resouce box.
* junk - UNUSED.
* Returns: none
@@ -668,7 +668,7 @@ ApplyResource(Widget w, XtPointer node_ptr, XtPointer junk)
{
ProtocolStream * stream = &(global_client.stream);
ApplyResourcesInfo info;
- WNode * node = (WNode *) node_ptr;
+ WNode * node = (WNode *) node_ptr;
char * value;
unsigned short size, i;
long len;
@@ -695,37 +695,37 @@ ApplyResource(Widget w, XtPointer node_ptr, XtPointer junk)
*/
value = GetResourceValueForSetValues(node, &size);
- _XEditResPut16(stream, size);
- for (i = 0; i < size; i++)
+ _XEditResPut16(stream, size);
+ for (i = 0; i < size; i++)
_XEditResPut8(stream, value[i]);
XtFree(value);
len = stream->current - stream->top;
- /*
- * Insert the widget count, overriden later.
+ /*
+ * Insert the widget count, overriden later.
*/
- _XEditResPut16(stream, 0);
+ _XEditResPut16(stream, 0);
ExecuteOverAllNodes(node->tree_info->top_node,
CreateSetValuesCommand, (XtPointer) &info);
-
+
if (info.count > 0) {
*(stream->top + len++) = info.count >> XER_NBBY; /* Set the correct */
*(stream->top + len) = info.count; /* count. */
SetCommand(node->tree_info->tree_widget, LocalSetValues, NULL);
}
- else
+ else
SetMessage(global_screen_data.info_label,
res_labels[20]);
-
+
XrmDestroyDatabase(info.database);
}
/* Function Name: ObtainResource
* Description: Obtain the current resource from the running application.
- * Arguments: node_ptr - a pointer to the node containing
+ * Arguments: node_ptr - a pointer to the node containing
* the current resouce box.
* Returns: none
*/
@@ -736,7 +736,7 @@ ObtainResource(XtPointer node_ptr)
{
ProtocolStream * stream = &(global_client.stream);
ObtainResourcesInfo info;
- WNode * node = (WNode *) node_ptr;
+ WNode * node = (WNode *) node_ptr;
char * value;
Arg args[1];
@@ -754,11 +754,11 @@ ObtainResource(XtPointer node_ptr)
_XEditResResetStream(stream);
_XEditResPutString8(stream, info.name); /* insert name */
- /*
+ /*
* Insert the widget count, always 1
*/
- _XEditResPut16(stream, 1);
+ _XEditResPut16(stream, 1);
/*CreateGetValuesCommand(node, (XtPointer)&info); Inserts widget */
@@ -837,7 +837,7 @@ CreateGetValuesCommand(WNode *node, XtPointer info_ptr)
* Description: Activates all widgets that match this resource.
* Arguments: w - UNUSED.
* node_ptr - the node that owns this resource box.
- * junk - UNUSED.
+ * junk - UNUSED.
* Returns: none.
*/
@@ -845,7 +845,7 @@ CreateGetValuesCommand(WNode *node, XtPointer info_ptr)
void
ActivateResourceWidgets(Widget w, XtPointer node_ptr, XtPointer junk)
{
- WNode * node = (WNode *) node_ptr;
+ WNode * node = (WNode *) node_ptr;
ApplyResourcesInfo info;
char * line;
Arg args[1];
@@ -853,7 +853,7 @@ ActivateResourceWidgets(Widget w, XtPointer node_ptr, XtPointer junk)
info.name = GetResourceName(node->resources->res_box);
info.class = "IGNORE_ME"; /* Not currently used. */
- /*
+ /*
* Unused fields.
*/
@@ -869,7 +869,7 @@ ActivateResourceWidgets(Widget w, XtPointer node_ptr, XtPointer junk)
ExecuteOverAllNodes(node->tree_info->top_node,
SetOnlyMatchingWidgets, (XtPointer) &info);
-
+
XrmDestroyDatabase(info.database);
}
diff --git a/man/editres.man b/man/editres.man
index 6afa9e4..0792136 100644
--- a/man/editres.man
+++ b/man/editres.man
@@ -325,8 +325,8 @@ the widgets which compose \fIeditres\fP. In the notation below,
indentation indicates hierarchical structure. The widget class name
is given first, followed by the widget instance name.
.sp
-.\" Default tab stops will work for this display,
-.\" which allows us to avoid spurious a warning duriing XML upconversion.
+.\" Default tab stops will work for this display,
+.\" which allows us to avoid spurious a warning duriing XML upconversion.
.nf
Editres editres
Paned paned
diff --git a/setvalues.c b/setvalues.c
index 09896d1..441d7ac 100644
--- a/setvalues.c
+++ b/setvalues.c
@@ -32,7 +32,7 @@ in this Software without prior written authorization from The Open Group.
#include <stdio.h>
#include <X11/Xaw/AsciiText.h>
-#include <X11/Xaw/Cardinals.h>
+#include <X11/Xaw/Cardinals.h>
#include <X11/Xfuncs.h>
#include <X11/Xos.h>
#include "editresP.h"
@@ -55,18 +55,18 @@ PrintSetValuesError(Event *event)
SetValuesEvent * sv_event = (SetValuesEvent *) event;
char buf[BUFSIZ];
- if (sv_event->num_entries == 0)
+ if (sv_event->num_entries == 0)
return(XtNewString("SetValues was Successful."));
for (i = 0 ; i < (int)sv_event->num_entries ; i++) {
node = FindNode(global_tree_info->top_node,
- sv_event->info[i].widgets.ids,
+ sv_event->info[i].widgets.ids,
sv_event->info[i].widgets.num_widgets);
if (node == NULL) {
snprintf(buf, sizeof(buf),
"Editres Internal Error: Unable to FindNode.\n");
- AddString(&errors, buf);
+ AddString(&errors, buf);
continue;
}
@@ -109,7 +109,7 @@ GetResourceValueForSetValues(WNode *node, unsigned short *size)
ptr = XtMalloc(sizeof(char) * value.size);
memmove( ptr, value.addr, value.size);
XrmDestroyDatabase(db);
-
+
*size = (unsigned short) value.size;
return(ptr);
}
diff --git a/svpopup.c b/svpopup.c
index b0a32c8..384eb70 100644
--- a/svpopup.c
+++ b/svpopup.c
@@ -32,10 +32,10 @@ in this Software without prior written authorization from The Open Group.
#include <X11/Shell.h>
#include <X11/Xaw/AsciiText.h>
-#include <X11/Xaw/Cardinals.h>
-#include <X11/Xaw/Command.h>
+#include <X11/Xaw/Cardinals.h>
+#include <X11/Xaw/Command.h>
#include <X11/Xaw/Form.h>
-#include <X11/Xaw/Label.h>
+#include <X11/Xaw/Label.h>
#include <stdio.h>
@@ -69,7 +69,7 @@ PopupSetValues(Widget parent, XEvent *event)
return;
}
-/*
+/*
* Check and possibly create the popup.
*/
@@ -94,27 +94,27 @@ PopupSetValues(Widget parent, XEvent *event)
}
/* Function Name: ModifySVEntry
- * Description: Action routine that can be bound to the set values
- * dialog box's Text Widget that will send input to the
+ * Description: Action routine that can be bound to the set values
+ * dialog box's Text Widget that will send input to the
* field specified.
- * Arguments: (Standard Action Routine args)
+ * Arguments: (Standard Action Routine args)
* Returns: none.
*/
/* ARGSUSED */
-void
+void
ModifySVEntry(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
Widget new, old;
char msg[BUFSIZ];
-
+
if (*num_params != 1) {
- strcpy(msg,
+ strcpy(msg,
res_labels[21]);
SetMessage(global_screen_data.info_label, msg);
return;
}
-
+
switch (params[0][0]) {
case 'r':
case 'R':
@@ -131,7 +131,7 @@ ModifySVEntry(Widget w, XEvent *event, String *params, Cardinal *num_params)
SetMessage(global_screen_data.info_label, msg);
return;
}
-
+
_SetField(new, old);
}
@@ -152,26 +152,26 @@ _SetField(Widget new, Widget old)
{
Arg args[2];
Pixel new_border, old_border, old_bg;
-
+
if (!XtIsSensitive(new)) {
#ifdef XKB
/* Don't set field to an inactive Widget. */
- XkbStdBell(XtDisplay(old), XtWindow(new), 0, XkbBI_InvalidLocation);
+ XkbStdBell(XtDisplay(old), XtWindow(new), 0, XkbBI_InvalidLocation);
#else
XBell(XtDisplay(old), 0); /* Don't set field to an inactive Widget. */
#endif
return;
}
-
- XtSetKeyboardFocus(XtParent(new), new);
-
+
+ XtSetKeyboardFocus(XtParent(new), new);
+
XtSetArg(args[0], XtNborderColor, &old_border);
XtSetArg(args[1], XtNbackground, &old_bg);
XtGetValues(new, args, TWO);
-
+
XtSetArg(args[0], XtNborderColor, &new_border);
XtGetValues(old, args, ONE);
-
+
if (old_border != old_bg) /* Colors are already correct, return. */
return;
@@ -196,12 +196,12 @@ CreateSetValuesPopup(Widget parent, ScreenData *scr_data)
Widget res_label;
Arg args[10];
Cardinal num_args;
-
- scr_data->set_values_popup = XtCreatePopupShell("setValuesPopup",
- transientShellWidgetClass,
+
+ scr_data->set_values_popup = XtCreatePopupShell("setValuesPopup",
+ transientShellWidgetClass,
parent, NULL, ZERO);
- form = XtCreateManagedWidget("form", formWidgetClass,
+ form = XtCreateManagedWidget("form", formWidgetClass,
scr_data->set_values_popup, NULL, ZERO);
num_args = 0;
@@ -217,7 +217,7 @@ CreateSetValuesPopup(Widget parent, ScreenData *scr_data)
num_args = 0;
XtSetArg(args[num_args], XtNfromVert, label); num_args++;
XtSetArg(args[num_args], XtNfromHoriz, res_label); num_args++;
- scr_data->res_text = XtCreateManagedWidget("resourceText",
+ scr_data->res_text = XtCreateManagedWidget("resourceText",
asciiTextWidgetClass,
form, args, num_args);
@@ -229,13 +229,13 @@ CreateSetValuesPopup(Widget parent, ScreenData *scr_data)
num_args = 0;
XtSetArg(args[num_args], XtNfromHoriz, res_label); num_args++;
XtSetArg(args[num_args], XtNfromVert, scr_data->res_text); num_args++;
- scr_data->val_text = XtCreateManagedWidget("valueText",
+ scr_data->val_text = XtCreateManagedWidget("valueText",
asciiTextWidgetClass,
form, args, num_args);
-
+
num_args = 0;
XtSetArg(args[num_args], XtNfromVert, scr_data->val_text); num_args++;
- do_it = XtCreateManagedWidget("setValues", commandWidgetClass,
+ do_it = XtCreateManagedWidget("setValues", commandWidgetClass,
form, args, num_args);
num_args = 0;
@@ -287,20 +287,20 @@ DoSetValues(Widget w, XtPointer junk, XtPointer garbage)
res_labels[23]);
return;
}
-
+
XtSetArg(args[0], XtNstring, &res_name);
XtGetValues(global_screen_data.res_text, args, ONE);
XtSetArg(args[0], XtNstring, &res_value);
XtGetValues(global_screen_data.val_text, args, ONE);
-
+
_XEditResResetStream(stream);
_XEditResPutString8(stream, res_name);
_XEditResPutString8(stream, XtRString);
_XEditResPutString8(stream, res_value);
_XEditResPut16(stream, global_tree_info->num_nodes);
- for (i = 0; i < global_tree_info->num_nodes; i++)
+ for (i = 0; i < global_tree_info->num_nodes; i++)
InsertWidgetFromNode(stream, global_tree_info->active_nodes[i]);
SetCommand(w, LocalSetValues, NULL);
@@ -317,5 +317,5 @@ DoSetValues(Widget w, XtPointer junk, XtPointer garbage)
static void
CancelSetValues(Widget w, XtPointer junk, XtPointer garbage)
{
- XtPopdown(XtParent(XtParent(w)));
+ XtPopdown(XtParent(XtParent(w)));
}
diff --git a/utils.c b/utils.c
index 9d93e3d..de046d2 100644
--- a/utils.c
+++ b/utils.c
@@ -39,11 +39,11 @@ in this Software without prior written authorization from The Open Group.
#include "editresP.h"
static WNode * FindWidgetFromWindowGivenNode ( WNode * node, Window win );
-static WidgetResources * ParseResources ( GetResourcesInfo * info,
+static WidgetResources * ParseResources ( GetResourcesInfo * info,
char **error );
-static int CompareResourceEntries ( const void *e1,
+static int CompareResourceEntries ( const void *e1,
const void *e2 );
-static void AddResource ( ResourceInfo * res_info,
+static void AddResource ( ResourceInfo * res_info,
WidgetResourceInfo * resource );
static void FreeResources ( WidgetResources * resources );
@@ -144,7 +144,7 @@ AddString(char ** str, char *add)
ptr = *str + len_str;
strcpy(ptr, add);
}
-
+
/* Function Name: FindNode
* Description: Finds a node give the top node, and a node id number.
* Arguments: top_node - the top node.
@@ -176,7 +176,7 @@ FindNode(WNode *top_node, unsigned long *ids, Cardinal number)
}
if (!found_it)
return(NULL);
- }
+ }
return(node);
}
@@ -187,7 +187,7 @@ FindNode(WNode *top_node, unsigned long *ids, Cardinal number)
* Returns: node - the node corrosponding to this widget.
*/
-WNode *
+WNode *
FindWidgetFromWindow(TreeInfo *tree_info, Window win)
{
if (tree_info == NULL)
@@ -237,7 +237,7 @@ HandleXErrors(Display *display, XErrorEvent *error)
}
if (error->error_code == BadWindow)
- global_error_code = NO_WINDOW;
+ global_error_code = NO_WINDOW;
else {
if (XmuPrintDefaultErrorMessage(display, error, stderr) != 0)
exit(1);
@@ -260,7 +260,7 @@ void
_DumpTreeToFile(Widget w, XtPointer tree_ptr, XtPointer filename)
{
TreeInfo * tree_info = (TreeInfo *) tree_ptr;
- FILE * fp;
+ FILE * fp;
if (tree_info == NULL) {
SetMessage(global_screen_data.info_label,
@@ -281,7 +281,7 @@ _DumpTreeToFile(Widget w, XtPointer tree_ptr, XtPointer filename)
}
/************************************************************
- *
+ *
* The file dialog boxes are handled with this code.
*
* It automatically calls the function specified when the
@@ -325,7 +325,7 @@ _PopupFileDialog(Widget w, String str, String default_value,
num_args = 0;
XtSetArg(args[num_args], XtNlabel, str); num_args++;
XtSetArg(args[num_args], XtNvalue, default_value); num_args++;
- dialog = XtCreateManagedWidget("dialog", dialogWidgetClass,
+ dialog = XtCreateManagedWidget("dialog", dialogWidgetClass,
shell, args, num_args);
file_info = XtNew(FileDialogInfo);
@@ -333,7 +333,7 @@ _PopupFileDialog(Widget w, String str, String default_value,
file_info->func = func;
file_info->data = data;
- if (XSaveContext(XtDisplay(dialog), (Window) dialog, file_dialog_context,
+ if (XSaveContext(XtDisplay(dialog), (Window) dialog, file_dialog_context,
(XPointer) file_info) != 0) {
SetMessage(global_screen_data.info_label,
"Error while trying to save Context\nAborting file dialog popup.");
@@ -391,7 +391,7 @@ PopupCentered(XEvent *event, Widget w, XtGrabKind mode)
Window root, child;
int win_x, win_y;
unsigned int mask;
-
+
XQueryPointer(XtDisplay(w), XtWindow(w),
&root, &child, &x, &y, &win_x, &win_y, &mask);
}
@@ -406,17 +406,17 @@ PopupCentered(XEvent *event, Widget w, XtGrabKind mode)
height += 2 * b_width;
x -= ((int) width/2);
- if (x < 0)
+ if (x < 0)
x = 0;
if ( x > (max_x = (int) (XtScreen(w)->width - width)) )
x = max_x;
y -= ( (Position) height/2 );
- if (y < 0)
+ if (y < 0)
y = 0;
if ( y > (max_y = (int) (XtScreen(w)->height - height)) )
y = max_y;
-
+
num_args = 0;
XtSetArg(args[num_args], XtNx, x); num_args++;
XtSetArg(args[num_args], XtNy, y); num_args++;
@@ -435,7 +435,7 @@ PopupCentered(XEvent *event, Widget w, XtGrabKind mode)
/* ARGSUSED */
-void
+void
_PopdownFileDialog(Widget w, XtPointer client_data, XtPointer junk)
{
Widget dialog = XtParent(w);
@@ -444,11 +444,11 @@ _PopdownFileDialog(Widget w, XtPointer client_data, XtPointer junk)
if (XFindContext(XtDisplay(dialog), (Window) dialog, file_dialog_context,
&file_info_ptr) == XCNOENT) {
- SetMessage(global_screen_data.info_label,
- "Error while trying to find Context\nAborting...");
+ SetMessage(global_screen_data.info_label,
+ "Error while trying to find Context\nAborting...");
}
- (void) XDeleteContext(XtDisplay(dialog), (Window)dialog,
+ (void) XDeleteContext(XtDisplay(dialog), (Window)dialog,
file_dialog_context);
file_info = (FileDialogInfo *) file_info_ptr;
@@ -514,16 +514,16 @@ HandleGetResources(Event *event)
for (i = 0; i < (int)get_event->num_entries; i++) {
node = FindNode(global_tree_info->top_node,
- get_event->info[i].widgets.ids,
+ get_event->info[i].widgets.ids,
get_event->info[i].widgets.num_widgets);
if (node == NULL) {
snprintf(buf, sizeof(buf), res_labels[16]);
- AddString(&errors, buf);
- continue;
+ AddString(&errors, buf);
+ continue;
}
- if (node->resources != NULL)
+ if (node->resources != NULL)
FreeResources(node->resources);
if (!get_event->info[i].error) {
@@ -563,7 +563,7 @@ CreateResourceBox(WNode *node, char **errors)
if (resources->num_normal > 0) {
names = (char **) XtMalloc(sizeof(char *) *
(resources->num_normal + 1));
- for (i = 0 ; i < resources->num_normal ; i++)
+ for (i = 0 ; i < resources->num_normal ; i++)
names[i] = resources->normal[i].name;
names[i] = NULL;
}
@@ -573,8 +573,8 @@ CreateResourceBox(WNode *node, char **errors)
if (resources->num_constraint > 0) {
cons_names = (char **) XtMalloc(sizeof(char *) *
(resources->num_constraint + 1));
-
- for (i = 0 ; i < resources->num_constraint ; i++)
+
+ for (i = 0 ; i < resources->num_constraint ; i++)
cons_names[i] = resources->constraint[i].name;
cons_names[i] = NULL;
}
@@ -592,15 +592,15 @@ CreateResourceBox(WNode *node, char **errors)
* Returns: The resource information.
*/
-static WidgetResources *
+static WidgetResources *
ParseResources(GetResourcesInfo *info, char **error)
{
WidgetResources * resources;
WidgetResourceInfo * normal;
int i;
- resources = (WidgetResources *) XtMalloc(sizeof(WidgetResources));
-
+ resources = (WidgetResources *) XtMalloc(sizeof(WidgetResources));
+
/*
* Allocate enough space for both the normal and constraint resources,
* then add the normal resources from the top, and the constraint resources
@@ -608,7 +608,7 @@ ParseResources(GetResourcesInfo *info, char **error)
* that there is no overlap.
*/
- resources->normal = (WidgetResourceInfo *)
+ resources->normal = (WidgetResourceInfo *)
XtMalloc(sizeof(WidgetResourceInfo) * info->num_resources);
normal = resources->normal;
@@ -620,7 +620,7 @@ ParseResources(GetResourcesInfo *info, char **error)
switch((int) info->res_info[i].res_type) {
case NormalResource:
resources->num_normal++;
- AddResource(info->res_info + i, normal++);
+ AddResource(info->res_info + i, normal++);
break;
case ConstraintResource:
resources->num_constraint++;
@@ -638,7 +638,7 @@ ParseResources(GetResourcesInfo *info, char **error)
}
/*
- * Sort the resources alphabetically.
+ * Sort the resources alphabetically.
*/
qsort(resources->normal, resources->num_normal,
@@ -661,10 +661,10 @@ ParseResources(GetResourcesInfo *info, char **error)
* Returns: an integer >, < or = 0.
*/
-static int
+static int
CompareResourceEntries(const void *e1, const void *e2)
{
- return (strcmp(((WidgetResourceInfo *)e1)->name,
+ return (strcmp(((WidgetResourceInfo *)e1)->name,
((WidgetResourceInfo *)e2)->name));
}
@@ -719,7 +719,7 @@ FreeResources(WidgetResources *resources)
XFree((char *)resources);
}
-
+
/* Function Name: CheckDatabase
* Description: Checks to see if the node is in the database.
@@ -758,12 +758,12 @@ Quarkify(char **list, char *ptr)
quarks = (XrmQuarkList) XtMalloc(sizeof(XrmQuark) * i);
- for (tlist = list, tquarks = quarks; *tlist != NULL; tlist++, tquarks++)
+ for (tlist = list, tquarks = quarks; *tlist != NULL; tlist++, tquarks++)
*tquarks = XrmStringToQuark(*tlist);
- if (ptr != NULL)
+ if (ptr != NULL)
*tquarks++ = XrmStringToQuark(ptr);
-
+
*tquarks = NULLQUARK;
return(quarks);
}
@@ -784,7 +784,7 @@ ExecuteOverAllNodes(WNode *top_node, void (*func)(WNode *, XtPointer),
(*func)(top_node, data);
- for (i = 0; i < top_node->num_children; i++)
+ for (i = 0; i < top_node->num_children; i++)
ExecuteOverAllNodes(top_node->children[i], func, data);
}
@@ -806,7 +806,7 @@ InsertWidgetFromNode(ProtocolStream *stream, WNode *node)
for (temp = node, i = 0; temp != NULL; temp = temp->parent, i++) {}
num_widgets = i;
- widget_list = (unsigned long *)
+ widget_list = (unsigned long *)
XtMalloc(sizeof(unsigned long) * num_widgets);
/*
@@ -814,13 +814,13 @@ InsertWidgetFromNode(ProtocolStream *stream, WNode *node)
* Make sure that they are inserted in the list from parent -> child.
*/
- for (i--, temp = node; temp != NULL; temp = temp->parent, i--)
+ for (i--, temp = node; temp != NULL; temp = temp->parent, i--)
widget_list[i] = temp->id;
-
+
_XEditResPut16(stream, num_widgets); /* insert number of widgets. */
for (i = 0; i < num_widgets; i++) /* insert Widgets themselves. */
_XEditResPut32(stream, widget_list[i]);
-
+
XtFree((char *)widget_list);
}
@@ -830,12 +830,12 @@ InsertWidgetFromNode(ProtocolStream *stream, WNode *node)
* Returns: message to show.
*/
-char *
+char *
GetFailureMessage(ProtocolStream *stream)
{
char * return_str;
- if (_XEditResGetString8(stream, &return_str))
+ if (_XEditResGetString8(stream, &return_str))
return(return_str);
return(XtNewString(res_labels[35]));
@@ -848,23 +848,23 @@ GetFailureMessage(ProtocolStream *stream)
* Returns: message to show.
*/
-char *
+char *
ProtocolFailure(ProtocolStream *stream)
{
char buf[BUFSIZ];
unsigned char version;
char* old_version_string;
- if (!_XEditResGet8(stream, &version))
+ if (!_XEditResGet8(stream, &version))
return(XtNewString(res_labels[35]));
switch ((int)version) {
case PROTOCOL_VERSION_ONE_POINT_ZERO: old_version_string = "1.0"; break;
default: old_version_string = "1.0";
}
-
+
snprintf(buf, sizeof(buf), res_labels[36],
CURRENT_PROTOCOL_VERSION_STRING, old_version_string);
return(XtNewString(buf));
}
-
+
diff --git a/widgets.c b/widgets.c
index ea13978..0bee2db 100644
--- a/widgets.c
+++ b/widgets.c
@@ -32,20 +32,20 @@ in this Software without prior written authorization from The Open Group.
#include <X11/StringDefs.h> /* Get standard string definations. */
#include <X11/Xaw/AsciiText.h>
-#include <X11/Xaw/Box.h>
-#include <X11/Xaw/Cardinals.h>
-#include <X11/Xaw/Label.h>
-#include <X11/Xaw/List.h>
-#include <X11/Xaw/MenuButton.h>
-#include <X11/Xaw/Paned.h>
-#include <X11/Xaw/Panner.h>
-#include <X11/Xaw/Porthole.h>
-#include <X11/Xaw/SmeBSB.h>
-#include <X11/Xaw/SmeLine.h>
-#include <X11/Xaw/SimpleMenu.h>
-#include <X11/Xaw/Toggle.h>
+#include <X11/Xaw/Box.h>
+#include <X11/Xaw/Cardinals.h>
+#include <X11/Xaw/Label.h>
+#include <X11/Xaw/List.h>
+#include <X11/Xaw/MenuButton.h>
+#include <X11/Xaw/Paned.h>
+#include <X11/Xaw/Panner.h>
+#include <X11/Xaw/Porthole.h>
+#include <X11/Xaw/SmeBSB.h>
+#include <X11/Xaw/SmeLine.h>
+#include <X11/Xaw/SimpleMenu.h>
+#include <X11/Xaw/Toggle.h>
#include <X11/Xaw/Tree.h>
-#include <X11/Xaw/Viewport.h>
+#include <X11/Xaw/Viewport.h>
#include "editresP.h"
@@ -60,10 +60,10 @@ static void CreateCommandMenu ( Widget parent, String toolkit );
static void CreateTreeCommandMenu ( Widget parent, String toolkit );
static void CreateResourceNameForm ( Widget parent, WNode * node );
static void SetToggleGroupLeaders ( WNode * node );
-static void MakeBoxLookNice ( Widget dot, Widget star, Widget any,
- Widget single, Widget name, Widget class,
+static void MakeBoxLookNice ( Widget dot, Widget star, Widget any,
+ Widget single, Widget name, Widget class,
int endbox );
-static void CreateLists ( Widget parent, WNode * node, char **names,
+static void CreateLists ( Widget parent, WNode * node, char **names,
char **cons_names );
static void CreateValueWidget ( Widget parent, WNode * node );
static void PopupOnNode ( WNode * node, Widget shell );
@@ -133,21 +133,21 @@ static XtResource resources[] = {
#undef Offset
-void
+void
RebuildMenusAndLabel(String toolkit)
{
if (strcmp(global_effective_toolkit, toolkit)) {
CreateCommandMenu(box, toolkit);
CreateTreeCommandMenu(box, toolkit);
XtDestroyWidget(global_screen_data.info_label);
- global_screen_data.info_label = XtCreateManagedWidget(toolkit,
+ global_screen_data.info_label = XtCreateManagedWidget(toolkit,
labelWidgetClass,
hPane, NULL, ZERO);
/* get the new toolkit label application resources for info_label */
XtGetApplicationResources(global_screen_data.info_label,
res_labels, resources,
XtNumber(resources), NULL, 0);
-
+
global_effective_toolkit = toolkit;
}
}
@@ -160,7 +160,7 @@ RebuildMenusAndLabel(String toolkit)
* Returns: none.
*/
-void
+void
BuildWidgetTree(Widget parent)
{
Widget paned, porthole, panner;
@@ -177,9 +177,9 @@ BuildWidgetTree(Widget parent)
* Allow the panner and porthole to talk to each other.
*/
- XtAddCallback(porthole,
+ XtAddCallback(porthole,
XtNreportCallback, PortholeCallback, (XtPointer) panner);
- XtAddCallback(panner,
+ XtAddCallback(panner,
XtNreportCallback, PannerCallback, (XtPointer) porthole);
global_tree_parent = porthole;
@@ -191,7 +191,7 @@ BuildWidgetTree(Widget parent)
/* Function Name: CreateTopArea
* Description: Creates the top part of the display
* Arguments: parent - widget to put this menu bar into.
- * Returns: none.
+ * Returns: none.
*/
@@ -208,10 +208,10 @@ CreateTopArea(Widget parent)
hPane = XtCreateManagedWidget("hPane",panedWidgetClass, parent, NULL,ZERO);
{
- panner = XtCreateManagedWidget("panner", pannerWidgetClass,
+ panner = XtCreateManagedWidget("panner", pannerWidgetClass,
hPane, NULL, ZERO);
- global_screen_data.info_label = XtCreateManagedWidget("xt",
+ global_screen_data.info_label = XtCreateManagedWidget("xt",
labelWidgetClass,
hPane, NULL,ZERO);
@@ -219,7 +219,7 @@ CreateTopArea(Widget parent)
XtGetApplicationResources(global_screen_data.info_label,
res_labels, resources,
XtNumber(resources), NULL, 0);
-
+
}
return(panner);
@@ -237,7 +237,7 @@ CreateTopArea(Widget parent)
void
SetEntriesSensitive(Widget *entries, int num, Boolean sensitive)
{
-int i; for (i=0; i<num; i++) XtSetSensitive(entries[i], sensitive);
+int i; for (i=0; i<num; i++) XtSetSensitive(entries[i], sensitive);
}
@@ -260,7 +260,7 @@ CreateCommandMenu(Widget parent, String toolkit)
Arg args[1];
if (cmenu) { XtDestroyWidget(cmenu); CM_set_insensitive = False; }
- else
+ else
cbutton = XtCreateManagedWidget("commands", menuButtonWidgetClass,
parent, NULL, ZERO);
@@ -270,7 +270,7 @@ CreateCommandMenu(Widget parent, String toolkit)
cmenu = XtCreatePopupShell(toolkit, simpleMenuWidgetClass, cbutton,
NULL, ZERO);
-
+
CM_entries[0] = XtCreateManagedWidget("sendTree", smeBSBObjectClass,cmenu,
NULL, ZERO);
XtAddCallback(CM_entries[0], XtNcallback, SendTree, (XtPointer) TRUE);
@@ -279,19 +279,19 @@ CreateCommandMenu(Widget parent, String toolkit)
NULL, ZERO);
XtAddCallback(CM_entries[1], XtNcallback, SendTree, (XtPointer) FALSE);
- CM_entries[2] = XtCreateManagedWidget("dumpTreeToFile",
+ CM_entries[2] = XtCreateManagedWidget("dumpTreeToFile",
smeBSBObjectClass,cmenu,
NULL, ZERO);
XtAddCallback(CM_entries[2], XtNcallback, DumpTreeToFile, NULL);
CM_entries[3] = XtCreateManagedWidget("line", smeLineObjectClass, cmenu,
NULL, ZERO);
- CM_entries[4]= XtCreateManagedWidget("getResourceList",
+ CM_entries[4]= XtCreateManagedWidget("getResourceList",
smeBSBObjectClass,cmenu,
NULL, ZERO);
XtAddCallback(CM_entries[4], XtNcallback, GetResourceList, NULL);
- CM_entries[5] = XtCreateManagedWidget("setValues", smeBSBObjectClass,
+ CM_entries[5] = XtCreateManagedWidget("setValues", smeBSBObjectClass,
cmenu,
NULL, ZERO);
XtAddCallback(CM_entries[5], XtNcallback, InitSetValues, NULL);
@@ -303,7 +303,7 @@ CreateCommandMenu(Widget parent, String toolkit)
NULL, ZERO);
XtAddCallback(CM_entries[7], XtNcallback, Quit, NULL);
- if (CM_set_insensitive)
+ if (CM_set_insensitive)
SetEntriesSensitive(&CM_entries[CM_OFFSET], CM_NUM, False);
}
@@ -395,7 +395,7 @@ CreateTreeCommandMenu(Widget parent, String toolkit)
TM_entries[i] = XtCreateManagedWidget(tree_menu[i].name, class, tmenu,
NULL, ZERO);
- if (func != NULL)
+ if (func != NULL)
XtAddCallback(TM_entries[i], XtNcallback, func,tree_menu[i].data);
}
if (TM_set_insensitive) SetEntriesSensitive(&TM_entries[TM_OFFSET],
@@ -438,9 +438,9 @@ void
LayoutTree(Widget tree)
{
Arg args[1];
-
+
XawTreeForceLayout(tree);
- XtMapWidget(tree);
+ XtMapWidget(tree);
XtSetArg(args[0], XtNbackgroundPixmap, old_pixmap);
XtSetValues(XtParent(tree), args, ONE);
@@ -458,8 +458,8 @@ LayoutTree(Widget tree)
* Description: Creates the widgets that make up the resource box.
* Arguments: node - the widget node.
* names - the list of names that make up the normal resources.
- * cons_names - the list of names that make up
- * the constraint resources.
+ * cons_names - the list of names that make up
+ * the constraint resources.
* Returns: none.
*/
@@ -483,16 +483,16 @@ CreateResourceBoxWidgets(WNode *node, char **names, char **cons_names)
XtAddCallback(res_box->shell, XtNdestroyCallback,
FreeResBox, (XtPointer) node);
- pane = XtCreateManagedWidget("pane", panedWidgetClass,
+ pane = XtCreateManagedWidget("pane", panedWidgetClass,
res_box->shell, NULL, ZERO);
viewport = XtCreateManagedWidget("mainViewport", viewportWidgetClass,
pane, NULL, 0);
- pane_child = XtCreateManagedWidget("pane", panedWidgetClass,
+ pane_child = XtCreateManagedWidget("pane", panedWidgetClass,
viewport, NULL, ZERO);
- res_box->res_label = XtCreateManagedWidget("resourceLabel",
- labelWidgetClass,
+ res_box->res_label = XtCreateManagedWidget("resourceLabel",
+ labelWidgetClass,
pane_child, NULL, ZERO);
CreateResourceNameForm(pane_child, node);
@@ -565,9 +565,9 @@ CreateResourceNameForm(Widget parent, WNode *node)
num_args = 0;
XtSetArg(args[num_args], XtNfromHoriz, name); num_args++;
XtSetArg(args[num_args], XtNradioData, "."); num_args++;
- dot = XtCreateManagedWidget("dot", toggleWidgetClass,
+ dot = XtCreateManagedWidget("dot", toggleWidgetClass,
form, args, num_args);
- XtAddCallback(dot, XtNcallback,
+ XtAddCallback(dot, XtNcallback,
ActivateWidgetsAndSetResourceString,(XtPointer) node);
num_args = 0;
@@ -575,9 +575,9 @@ CreateResourceNameForm(Widget parent, WNode *node)
XtSetArg(args[num_args], XtNfromVert, dot); num_args++;
XtSetArg(args[num_args], XtNradioGroup, dot); num_args++;
XtSetArg(args[num_args], XtNradioData, "*"); num_args++;
- star = XtCreateManagedWidget("star", toggleWidgetClass,
+ star = XtCreateManagedWidget("star", toggleWidgetClass,
form, args, num_args);
- XtAddCallback(star,XtNcallback,
+ XtAddCallback(star,XtNcallback,
ActivateWidgetsAndSetResourceString, (XtPointer) node);
if (name_info != NULL) {
@@ -585,7 +585,7 @@ CreateResourceNameForm(Widget parent, WNode *node)
name_info = name_info->next;
}
else
- res_box->name_info =
+ res_box->name_info =
name_info = (NameInfo *) XtMalloc(sizeof(NameInfo));
name_info->sep_leader = dot;
@@ -597,10 +597,10 @@ CreateResourceNameForm(Widget parent, WNode *node)
new_info->left_dot = dot;
new_info->left_star = star;
new_info->left_count = 0;
- if (old_info != NULL)
+ if (old_info != NULL)
old_info->right_count = &(new_info->left_count);
}
- else if (old_info != NULL)
+ else if (old_info != NULL)
old_info->right_count = NULL;
if (old_info != NULL) {
@@ -608,7 +608,7 @@ CreateResourceNameForm(Widget parent, WNode *node)
old_info->right_star = star;
XtAddCallback(any, XtNcallback, AnyChosen, (XtPointer) old_info);
- XtAddCallback(any, XtNdestroyCallback,
+ XtAddCallback(any, XtNdestroyCallback,
FreeClientData, (XtPointer) old_info);
}
@@ -621,7 +621,7 @@ CreateResourceNameForm(Widget parent, WNode *node)
XtSetArg(args[num_args], XtNfromHoriz, dot); num_args++;
XtSetArg(args[num_args], XtNlabel, names[i]); num_args++;
XtSetArg(args[num_args], XtNradioData, names[i]); num_args++;
- name = XtCreateManagedWidget("name", toggleWidgetClass,
+ name = XtCreateManagedWidget("name", toggleWidgetClass,
form, args, num_args);
XtAddCallback(name,XtNcallback,
ActivateWidgetsAndSetResourceString,(XtPointer) node);
@@ -632,7 +632,7 @@ CreateResourceNameForm(Widget parent, WNode *node)
XtSetArg(args[num_args], XtNlabel, classes[i]); num_args++;
XtSetArg(args[num_args], XtNradioGroup, name); num_args++;
XtSetArg(args[num_args], XtNradioData, classes[i]); num_args++;
- class = XtCreateManagedWidget("class", toggleWidgetClass,
+ class = XtCreateManagedWidget("class", toggleWidgetClass,
form,args,num_args);
XtAddCallback(class, XtNcallback,
ActivateWidgetsAndSetResourceString,(XtPointer) node);
@@ -642,7 +642,7 @@ CreateResourceNameForm(Widget parent, WNode *node)
XtSetArg(args[num_args], XtNfromVert, class); num_args++;
XtSetArg(args[num_args], XtNradioData, "?"); num_args++;
XtSetArg(args[num_args], XtNradioGroup, name); num_args++;
- single = XtCreateManagedWidget("single", toggleWidgetClass,
+ single = XtCreateManagedWidget("single", toggleWidgetClass,
form, args, num_args);
XtAddCallback(single,XtNcallback,
ActivateWidgetsAndSetResourceString,(XtPointer) node);
@@ -652,7 +652,7 @@ CreateResourceNameForm(Widget parent, WNode *node)
XtSetArg(args[num_args], XtNfromVert, single); num_args++;
XtSetArg(args[num_args], XtNradioGroup, name); num_args++;
XtSetArg(args[num_args], XtNradioData, ANY_RADIO_DATA); num_args++;
- any = XtCreateManagedWidget("any", toggleWidgetClass,
+ any = XtCreateManagedWidget("any", toggleWidgetClass,
form, args, num_args);
name_info->name_leader = name;
@@ -703,7 +703,7 @@ SetToggleGroupLeaders(WNode *node)
* name and class of this object.
* Returns: none.
*/
-
+
static void
MakeBoxLookNice(Widget dot, Widget star, Widget any, Widget single,
Widget name, Widget class, int endbox)
@@ -736,7 +736,7 @@ MakeBoxLookNice(Widget dot, Widget star, Widget any, Widget single,
XtSetArg(args[num_args], XtNhorizDistance, &(h_dist[2])); num_args++;
XtSetArg(args[num_args], XtNwidth, &any_width); num_args++;
XtGetValues(any, args, num_args);
-
+
dot_star_width = (width_1 > width_2) ? width_1 : width_2;
for (i = 1 ; i < MAX_HDIST; i++) {
if (h_dist[i] > h_dist[0]) h_dist[0] = h_dist[i];
@@ -745,11 +745,11 @@ MakeBoxLookNice(Widget dot, Widget star, Widget any, Widget single,
num_args = 0;
XtSetArg(args[num_args], XtNhorizDistance, h_dist[0]); num_args++;
XtSetValues(any, args, num_args);
-
+
/*
* Add a new arg, and continue...
*/
- XtSetArg(args[num_args], XtNwidth, dot_star_width); num_args++;
+ XtSetArg(args[num_args], XtNwidth, dot_star_width); num_args++;
XtSetValues(star, args, num_args);
XtSetValues(dot, args, num_args);
@@ -793,20 +793,20 @@ MakeBoxLookNice(Widget dot, Widget star, Widget any, Widget single,
}
XtSetArg(args[num_args], XtNwidth, any_width); num_args++;
- XtSetValues(any, args, num_args);
+ XtSetValues(any, args, num_args);
num_args = 0;
XtSetArg(args[num_args], XtNwidth, name_class_width); num_args++;
XtSetArg(args[num_args], XtNhorizDistance, h_dist[0]); num_args++;
- XtSetValues(name, args, num_args);
- XtSetValues(class, args, num_args);
- XtSetValues(single, args, num_args);
+ XtSetValues(name, args, num_args);
+ XtSetValues(class, args, num_args);
+ XtSetValues(single, args, num_args);
}
/* Function Name: CreateLists
- * Description: Creates the list widgets for the normal and constraint
+ * Description: Creates the list widgets for the normal and constraint
* resources
* Arguments: parent - parent of the lists.
* node - The widget node containing this res box.
@@ -824,9 +824,9 @@ CreateLists(Widget parent, WNode *node, char **names, char **cons_names)
ResourceBoxInfo * res_box = node->resources->res_box;
Arg args[3];
- (void) XtCreateManagedWidget("namesLabel", labelWidgetClass,
+ (void) XtCreateManagedWidget("namesLabel", labelWidgetClass,
parent, NULL, ZERO);
-
+
num_args = 0;
/* if the first list item is the widget name we want an empty
* list.
@@ -839,30 +839,30 @@ CreateLists(Widget parent, WNode *node, char **names, char **cons_names)
else { XtSetArg(args[num_args], XtNlist, names); num_args++; }
viewport = XtCreateManagedWidget("normalViewport", viewportWidgetClass,
parent, NULL, 0);
- res_box->norm_list = XtCreateManagedWidget("namesList", listWidgetClass,
+ res_box->norm_list = XtCreateManagedWidget("namesList", listWidgetClass,
viewport, args, num_args);
- XtAddCallback(res_box->norm_list, XtNcallback,
+ XtAddCallback(res_box->norm_list, XtNcallback,
ResourceListCallback, (XtPointer) node);
- XtAddCallback(res_box->norm_list, XtNdestroyCallback,
+ XtAddCallback(res_box->norm_list, XtNdestroyCallback,
FreeClientData, (XtPointer) names);
if (cons_names != NULL) {
- (void) XtCreateManagedWidget("constraintLabel", labelWidgetClass,
+ (void) XtCreateManagedWidget("constraintLabel", labelWidgetClass,
parent, NULL, ZERO);
-
+
num_args = 0;
- XtSetArg(args[num_args], XtNlist, cons_names); num_args++;
+ XtSetArg(args[num_args], XtNlist, cons_names); num_args++;
viewport = XtCreateManagedWidget("constraintViewport", viewportWidgetClass,
parent, NULL, 0);
- res_box->cons_list = XtCreateManagedWidget("constraintList",
- listWidgetClass,
+ res_box->cons_list = XtCreateManagedWidget("constraintList",
+ listWidgetClass,
viewport, args, num_args);
- XtAddCallback(res_box->cons_list, XtNcallback,
+ XtAddCallback(res_box->cons_list, XtNcallback,
ResourceListCallback, (XtPointer) node);
- XtAddCallback(res_box->cons_list, XtNdestroyCallback,
+ XtAddCallback(res_box->cons_list, XtNdestroyCallback,
FreeClientData, (XtPointer) cons_names);
}
- else
+ else
res_box->cons_list = NULL;
}
@@ -880,7 +880,7 @@ CreateValueWidget(Widget parent, WNode *node)
Cardinal num_args;
Arg args[10];
ResourceBoxInfo * res_box = node->resources->res_box;
-
+
form = XtCreateManagedWidget("valueForm", formWidgetClass,
parent, NULL, ZERO);
@@ -889,7 +889,7 @@ CreateValueWidget(Widget parent, WNode *node)
XtSetArg(args[num_args], XtNright, XawChainLeft); num_args++;
XtSetArg(args[num_args], XtNtop, XawChainTop); num_args++;
XtSetArg(args[num_args], XtNbottom, XawChainBottom); num_args++;
- label = XtCreateManagedWidget("valueLabel", labelWidgetClass,
+ label = XtCreateManagedWidget("valueLabel", labelWidgetClass,
form, args, num_args);
num_args = 0;
@@ -898,8 +898,8 @@ CreateValueWidget(Widget parent, WNode *node)
XtSetArg(args[num_args], XtNright, XawChainRight); num_args++;
XtSetArg(args[num_args], XtNtop, XawChainTop); num_args++;
XtSetArg(args[num_args], XtNbottom, XawChainBottom); num_args++;
- res_box->value_wid = XtCreateManagedWidget("valueText",
- asciiTextWidgetClass,
+ res_box->value_wid = XtCreateManagedWidget("valueText",
+ asciiTextWidgetClass,
form, args, num_args);
#ifdef notdef
XtAddCallback(XawTextGetSource(res_box->value_wid), XtNcallback,
@@ -929,10 +929,10 @@ PopupOnNode(WNode *node, Widget shell)
XtSetArg(args[num_args], XtNheight, &height); num_args++;
XtSetArg(args[num_args], XtNborderWidth, &bw); num_args++;
XtGetValues(node->widget, args, num_args);
- XtTranslateCoords(node->widget,
+ XtTranslateCoords(node->widget,
(Position) (width/2 + bw), (Position) (height/2 + bw),
&x, &y);
-
+
XtOverrideTranslations
(shell, XtParseTranslationTable ("<Message>WM_PROTOCOLS: quit()"));
XtRealizeWidget(shell);
@@ -954,7 +954,7 @@ PopupOnNode(WNode *node, Widget shell)
max_loc = HeightOfScreen(XtScreen(shell)) - (Position) (height + 2 * bw);
if (y > max_loc)
y = max_loc;
- if (y < 0)
+ if (y < 0)
y = 0;
num_args = 0;
@@ -1000,7 +1000,7 @@ FreeResBox(Widget w, XtPointer ptr, XtPointer junk)
NameInfo *old_name, *name = node->resources->res_box->name_info;
global_resource_box_up = FALSE;
-
+
XtFree((XtPointer) node->resources->res_box);
node->resources->res_box = NULL;
@@ -1008,8 +1008,8 @@ FreeResBox(Widget w, XtPointer ptr, XtPointer junk)
old_name = name;
name = name->next;
XtFree((XtPointer) old_name);
- }
+ }
}
-
+
diff --git a/wtree.c b/wtree.c
index 4550082..4e4076f 100644
--- a/wtree.c
+++ b/wtree.c
@@ -30,7 +30,7 @@ in this Software without prior written authorization from The Open Group.
#include <X11/Xaw/Cardinals.h>
#include <X11/Xaw/Toggle.h>
-#include <X11/Xaw/Viewport.h>
+#include <X11/Xaw/Viewport.h>
#include <X11/Xaw/Tree.h>
#include "editresP.h"
@@ -38,9 +38,9 @@ in this Software without prior written authorization from The Open Group.
static void AddNodeToActiveList ( WNode * node );
static void RemoveNodeFromActiveList ( WNode * node );
static Boolean IsActiveNode ( WNode * node );
-static void AddNode ( WNode ** top_node, WidgetTreeInfo * info,
+static void AddNode ( WNode ** top_node, WidgetTreeInfo * info,
TreeInfo * tree_info );
-static void FillNode ( WidgetTreeInfo * info, WNode * node,
+static void FillNode ( WidgetTreeInfo * info, WNode * node,
TreeInfo * tree_info );
static void AddChild ( WNode * parent, WNode * child );
static WNode ** CopyActiveNodes ( TreeInfo * tree_info );
@@ -118,15 +118,15 @@ AddTreeNode(Widget tree, WNode *top)
top->widget = XtCreateManagedWidget(top->name, toggleWidgetClass, tree,
args, num_args);
- if (XSaveContext(XtDisplay(top->widget), (Window) top->widget,
+ if (XSaveContext(XtDisplay(top->widget), (Window) top->widget,
NODE_INFO, (XPointer) top) != 0) {
snprintf(msg, sizeof(msg), res_labels[29], top->name);
SetMessage(global_screen_data.info_label, msg);
- }
+ }
XtAddCallback(top->widget, XtNcallback, TreeToggle, (XtPointer) top);
- for (i = 0; i < top->num_children; i++)
+ for (i = 0; i < top->num_children; i++)
AddTreeNode(tree, top->children[i]);
}
@@ -145,7 +145,7 @@ TreeToggle(Widget w, XtPointer node_ptr, XtPointer state_ptr)
Boolean state = (Boolean)(long) state_ptr;
WNode * node = (WNode *) node_ptr;
- if (state)
+ if (state)
AddNodeToActiveList(node);
else
RemoveNodeFromActiveList(node);
@@ -168,7 +168,7 @@ AddNodeToActiveList(WNode *node)
if (info->num_nodes >= info->alloc_nodes) {
info->alloc_nodes += NUM_INC;
info->active_nodes =(WNode **)XtRealloc((XtPointer) info->active_nodes,
- sizeof(WNode *) *
+ sizeof(WNode *) *
info->alloc_nodes);
}
@@ -194,7 +194,7 @@ RemoveNodeFromActiveList(WNode *node)
for (i = 0; i < info->num_nodes; i++) {
if (found_node)
info->active_nodes[i - 1] = info->active_nodes[i];
- else if (info->active_nodes[i] == node)
+ else if (info->active_nodes[i] == node)
found_node = TRUE;
}
@@ -213,19 +213,19 @@ IsActiveNode(WNode *node)
TreeInfo * info = node->tree_info;
Cardinal i;
- for (i = 0; i < info->num_nodes; i++)
+ for (i = 0; i < info->num_nodes; i++)
if (info->active_nodes[i] == node)
return(TRUE);
return(FALSE);
}
-
+
/* Function Name: CreateTree
* Description: Creates a widget tree give a list of names and classes.
* Arguments: event - the information from the client.
* Returns: The tree_info about this new tree.
*/
-
+
TreeInfo *
CreateTree(Event *event)
{
@@ -260,14 +260,14 @@ PrintNodes(WNode *top)
{
Cardinal i;
- if (top->parent == NULL)
- printf("Top of Tree, Name: %10s, ID: %10ld, Class: %10s\n",
+ if (top->parent == NULL)
+ printf("Top of Tree, Name: %10s, ID: %10ld, Class: %10s\n",
top->name, top->id, top->class);
else
- printf("Parent %10s, Name: %10s, ID: %10ld, Class: %10s\n",
+ printf("Parent %10s, Name: %10s, ID: %10ld, Class: %10s\n",
top->parent->name, top->name, top->id, top->class);
- for (i = 0; i < top->num_children; i++)
+ for (i = 0; i < top->num_children; i++)
PrintNodes(top->children[i]);
}
@@ -291,9 +291,9 @@ _TreeRelabel(TreeInfo *tree_info, LabelTypes type)
top = tree_info->top_node;
- PrepareToLayoutTree(tree_info->tree_widget);
+ PrepareToLayoutTree(tree_info->tree_widget);
_TreeRelabelNode(top, type, TRUE);
- LayoutTree(tree_info->tree_widget);
+ LayoutTree(tree_info->tree_widget);
}
/* Function Name: _TreeSelect
@@ -367,7 +367,7 @@ _TreeSelectNode(WNode *node, SelectTypes type, Boolean recurse)
case SelectInvert:
XtSetArg(args[0], XtNstate, &state);
XtGetValues(node->widget, args, ONE);
-
+
state = !state;
break;
default:
@@ -383,7 +383,7 @@ _TreeSelectNode(WNode *node, SelectTypes type, Boolean recurse)
if (!recurse)
return;
- for (i = 0; i < node->num_children; i++)
+ for (i = 0; i < node->num_children; i++)
_TreeSelectNode(node->children[i], type, recurse);
}
@@ -415,13 +415,13 @@ _TreeRelabelNode(WNode *node, LabelTypes type, Boolean recurse)
XtSetArg(args[0], XtNlabel, buf);
break;
case WindowLabel:
- if (node->window == EDITRES_IS_UNREALIZED)
+ if (node->window == EDITRES_IS_UNREALIZED)
strcpy(buf, "unrealized widget");
- else if (node->window == EDITRES_IS_OBJECT)
- strcpy(buf, "non windowed object");
+ else if (node->window == EDITRES_IS_OBJECT)
+ strcpy(buf, "non windowed object");
else
snprintf(buf, sizeof(buf), "win: 0x%lx", node->window);
-
+
XtSetArg(args[0], XtNlabel, buf);
break;
case ToggleLabel:
@@ -443,7 +443,7 @@ _TreeRelabelNode(WNode *node, LabelTypes type, Boolean recurse)
if (!recurse)
return;
- for (i = 0; i < node->num_children; i++)
+ for (i = 0; i < node->num_children; i++)
_TreeRelabelNode(node->children[i], type, recurse);
}
@@ -468,13 +468,13 @@ _TreeActivateNode(WNode* node, SelectTypes type)
if (node == NULL)
return;
- XtSetValues(node->widget, args, ONE);
+ XtSetValues(node->widget, args, ONE);
AddNodeToActiveList(node);
if (type == SelectAncestors)
- _TreeActivateNode(node, type);
+ _TreeActivateNode(node, type);
}
- else if ((type == SelectChildren) || (type == SelectDescendants))
+ else if ((type == SelectChildren) || (type == SelectDescendants))
for (i = 0; i < node->num_children; i++) {
AddNodeToActiveList(node->children[i]);
XtSetValues(node->children[i]->widget, args, ONE);
@@ -483,12 +483,12 @@ _TreeActivateNode(WNode* node, SelectTypes type)
}
else
SetMessage(global_screen_data.info_label,
- res_labels[33]);
+ res_labels[33]);
}
/************************************************************
*
- * Non - Exported Functions.
+ * Non - Exported Functions.
*
************************************************************/
@@ -525,7 +525,7 @@ AddNode(WNode **top_node, WidgetTreeInfo *info, TreeInfo *tree_info)
AddChild(parent, node);
- if (early_break)
+ if (early_break)
break;
}
@@ -571,7 +571,7 @@ AddChild(WNode *parent, WNode *child)
{
if (parent->num_children >= parent->alloc_children) {
parent->alloc_children += NUM_INC;
- parent->children = (WNode **) XtRealloc((char *)parent->children,
+ parent->children = (WNode **) XtRealloc((char *)parent->children,
sizeof(WNode *) * parent->alloc_children);
}
@@ -584,16 +584,16 @@ AddChild(WNode *parent, WNode *child)
/************************************************************
*
* Functions that operate of the current tree.
- *
+ *
************************************************************/
-
+
/* Function Name: CopyActiveNodes
* Description: returns a copy of the currently selected nodes.
* Arguments: tree_info - the tree info struct.
* Returns: a copy of the selected nodes.
*/
-static WNode **
+static WNode **
CopyActiveNodes(TreeInfo *tree_info)
{
WNode ** list;
@@ -654,19 +654,19 @@ SetAndCenterTreeNode(WNode *node)
* reset the node x and y location to be the new x and y location of
* the tree relative to the porthole.
*/
-
+
node_x = port_width/2 - (node_x + node_width/2 + node_bw);
node_y = port_height/2 - (node_y + node_height/2 + node_bw);
num_args = 0;
XtSetArg(args[num_args], XtNx, node_x); num_args++;
XtSetArg(args[num_args], XtNy, node_y); num_args++;
- XtSetValues(node->tree_info->tree_widget, args, num_args);
+ XtSetValues(node->tree_info->tree_widget, args, num_args);
}
/* Function Name: PerformTreeToFileDump
* Description: Dumps the contents of the current widget tree to
- * the file specified.
+ * the file specified.
* Arguments: node - node to dump.
* num_tabs - number of spaces to indent.
* fp - pointer to the file to write to.
@@ -678,7 +678,7 @@ PerformTreeToFileDump(WNode *node, Cardinal num_tabs, FILE *fp)
{
Cardinal i;
- for (i = 0; i < num_tabs; i++)
+ for (i = 0; i < num_tabs; i++)
fprintf(fp, "\t");
fprintf(fp, "%s %s\n", node->class, node->name);