summaryrefslogtreecommitdiff
path: root/geometry.c
diff options
context:
space:
mode:
Diffstat (limited to 'geometry.c')
-rw-r--r--geometry.c82
1 files changed, 41 insertions, 41 deletions
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);