summaryrefslogtreecommitdiff
path: root/hw/dmx
diff options
context:
space:
mode:
Diffstat (limited to 'hw/dmx')
-rw-r--r--hw/dmx/config/Canvas.c132
-rw-r--r--hw/dmx/config/Canvas.h8
-rw-r--r--hw/dmx/config/CanvasP.h10
-rw-r--r--hw/dmx/config/dmxcompat.c160
-rw-r--r--hw/dmx/config/dmxconfig.c340
-rw-r--r--hw/dmx/config/dmxconfig.h4
-rw-r--r--hw/dmx/config/dmxparse.c473
-rw-r--r--hw/dmx/config/dmxparse.h329
-rw-r--r--hw/dmx/config/dmxprint.c373
-rw-r--r--hw/dmx/config/dmxprint.h4
-rw-r--r--hw/dmx/config/dmxtodmx.c7
-rw-r--r--hw/dmx/config/vdltodmx.c10
-rw-r--r--hw/dmx/config/xdmxconfig.c1263
-rw-r--r--hw/dmx/dmx-config.h2
-rw-r--r--hw/dmx/dmx.c782
-rw-r--r--hw/dmx/dmx.h268
-rw-r--r--hw/dmx/dmx_glxvisuals.c904
-rw-r--r--hw/dmx/dmx_glxvisuals.h26
-rw-r--r--hw/dmx/dmxcb.c161
-rw-r--r--hw/dmx/dmxcb.h2
-rw-r--r--hw/dmx/dmxclient.h20
-rw-r--r--hw/dmx/dmxcmap.c136
-rw-r--r--hw/dmx/dmxcmap.h7
-rw-r--r--hw/dmx/dmxcursor.c522
-rw-r--r--hw/dmx/dmxcursor.h9
-rw-r--r--hw/dmx/dmxdpms.c117
-rw-r--r--hw/dmx/dmxdpms.h6
-rw-r--r--hw/dmx/dmxextension.c1770
-rw-r--r--hw/dmx/dmxextension.h99
-rw-r--r--hw/dmx/dmxfont.c597
-rw-r--r--hw/dmx/dmxfont.h4
-rw-r--r--hw/dmx/dmxgc.c382
-rw-r--r--hw/dmx/dmxgc.h11
-rw-r--r--hw/dmx/dmxgcops.c476
-rw-r--r--hw/dmx/dmxgcops.h64
-rw-r--r--hw/dmx/dmxinit.c850
-rw-r--r--hw/dmx/dmxinit.h16
-rw-r--r--hw/dmx/dmxinput.c27
-rw-r--r--hw/dmx/dmxinput.h78
-rw-r--r--hw/dmx/dmxlog.c310
-rw-r--r--hw/dmx/dmxlog.h18
-rw-r--r--hw/dmx/dmxpict.c1405
-rw-r--r--hw/dmx/dmxpict.h54
-rw-r--r--hw/dmx/dmxpixmap.c177
-rw-r--r--hw/dmx/dmxpixmap.h19
-rw-r--r--hw/dmx/dmxprop.c241
-rw-r--r--hw/dmx/dmxprop.h13
-rw-r--r--hw/dmx/dmxscrinit.c531
-rw-r--r--hw/dmx/dmxscrinit.h2
-rw-r--r--hw/dmx/dmxshadow.c27
-rw-r--r--hw/dmx/dmxshadow.h2
-rw-r--r--hw/dmx/dmxstat.c115
-rw-r--r--hw/dmx/dmxstat.h14
-rw-r--r--hw/dmx/dmxsync.c78
-rw-r--r--hw/dmx/dmxsync.h2
-rw-r--r--hw/dmx/dmxvisual.c82
-rw-r--r--hw/dmx/dmxvisual.h10
-rw-r--r--hw/dmx/dmxwindow.c1019
-rw-r--r--hw/dmx/dmxwindow.h47
-rw-r--r--hw/dmx/examples/dmxaddinput.c20
-rw-r--r--hw/dmx/examples/dmxaddscreen.c61
-rw-r--r--hw/dmx/examples/dmxinfo.c129
-rw-r--r--hw/dmx/examples/dmxreconfig.c139
-rw-r--r--hw/dmx/examples/dmxresize.c27
-rw-r--r--hw/dmx/examples/dmxrminput.c13
-rw-r--r--hw/dmx/examples/dmxrmscreen.c15
-rw-r--r--hw/dmx/examples/dmxwininfo.c748
-rw-r--r--hw/dmx/examples/ev.c218
-rw-r--r--hw/dmx/examples/evi.c21
-rw-r--r--hw/dmx/examples/res.c32
-rw-r--r--hw/dmx/examples/xbell.c45
-rw-r--r--hw/dmx/examples/xinput.c215
-rw-r--r--hw/dmx/examples/xled.c28
-rw-r--r--hw/dmx/examples/xtest.c14
-rw-r--r--hw/dmx/glxProxy/compsize.c866
-rw-r--r--hw/dmx/glxProxy/compsize.h2
-rw-r--r--hw/dmx/glxProxy/g_disptab.c1128
-rw-r--r--hw/dmx/glxProxy/g_disptab.h1252
-rw-r--r--hw/dmx/glxProxy/g_renderswap.c2735
-rw-r--r--hw/dmx/glxProxy/global.c2
-rw-r--r--hw/dmx/glxProxy/glxcmds.c4513
-rw-r--r--hw/dmx/glxProxy/glxcmds.h12
-rw-r--r--hw/dmx/glxProxy/glxcmdsswap.c927
-rw-r--r--hw/dmx/glxProxy/glxcontext.h56
-rw-r--r--hw/dmx/glxProxy/glxdrawable.h5
-rw-r--r--hw/dmx/glxProxy/glxerror.h1
-rw-r--r--hw/dmx/glxProxy/glxext.c409
-rw-r--r--hw/dmx/glxProxy/glxext.h45
-rw-r--r--hw/dmx/glxProxy/glxfbconfig.c128
-rw-r--r--hw/dmx/glxProxy/glxfbconfig.h5
-rw-r--r--hw/dmx/glxProxy/glxscreens.c499
-rw-r--r--hw/dmx/glxProxy/glxscreens.h7
-rw-r--r--hw/dmx/glxProxy/glxserver.h189
-rw-r--r--hw/dmx/glxProxy/glxsingle.c1332
-rw-r--r--hw/dmx/glxProxy/glxsingle.h30
-rw-r--r--hw/dmx/glxProxy/glxswap.c588
-rw-r--r--hw/dmx/glxProxy/glxswap.h12
-rw-r--r--hw/dmx/glxProxy/glxutil.c5
-rw-r--r--hw/dmx/glxProxy/glxutil.h9
-rw-r--r--hw/dmx/glxProxy/glxvendor.c753
-rw-r--r--hw/dmx/glxProxy/glxvendor.h27
-rw-r--r--hw/dmx/glxProxy/glxvisuals.c140
-rw-r--r--hw/dmx/glxProxy/glxvisuals.h12
-rw-r--r--hw/dmx/glxProxy/render2swap.c219
-rw-r--r--hw/dmx/glxProxy/renderpixswap.c445
-rw-r--r--hw/dmx/glxProxy/unpack.h41
-rw-r--r--hw/dmx/input/ChkNotMaskEv.c68
-rw-r--r--hw/dmx/input/ChkNotMaskEv.h2
-rw-r--r--hw/dmx/input/atKeynames.h40
-rw-r--r--hw/dmx/input/dmxarg.c69
-rw-r--r--hw/dmx/input/dmxarg.h10
-rw-r--r--hw/dmx/input/dmxbackend.c359
-rw-r--r--hw/dmx/input/dmxbackend.h26
-rw-r--r--hw/dmx/input/dmxcommon.c395
-rw-r--r--hw/dmx/input/dmxcommon.h40
-rw-r--r--hw/dmx/input/dmxconsole.c727
-rw-r--r--hw/dmx/input/dmxconsole.h34
-rw-r--r--hw/dmx/input/dmxdetach.c4
-rw-r--r--hw/dmx/input/dmxdummy.c50
-rw-r--r--hw/dmx/input/dmxevents.c412
-rw-r--r--hw/dmx/input/dmxevents.h4
-rw-r--r--hw/dmx/input/dmxinputinit.c829
-rw-r--r--hw/dmx/input/dmxinputinit.h271
-rw-r--r--hw/dmx/input/dmxmap.c28
-rw-r--r--hw/dmx/input/dmxmap.h2
-rw-r--r--hw/dmx/input/dmxmotion.c84
-rw-r--r--hw/dmx/input/dmxmotion.h11
-rw-r--r--hw/dmx/input/dmxsigio.c115
-rw-r--r--hw/dmx/input/dmxsigio.h4
-rw-r--r--hw/dmx/input/dmxxinput.c17
-rw-r--r--hw/dmx/input/lnx-keyboard.c1116
-rw-r--r--hw/dmx/input/lnx-keyboard.h44
-rw-r--r--hw/dmx/input/lnx-ms.c201
-rw-r--r--hw/dmx/input/lnx-ms.h26
-rw-r--r--hw/dmx/input/lnx-ps2.c173
-rw-r--r--hw/dmx/input/lnx-ps2.h26
-rw-r--r--hw/dmx/input/usb-common.c331
-rw-r--r--hw/dmx/input/usb-common.h15
-rw-r--r--hw/dmx/input/usb-keyboard.c441
-rw-r--r--hw/dmx/input/usb-keyboard.h17
-rw-r--r--hw/dmx/input/usb-mouse.c67
-rw-r--r--hw/dmx/input/usb-mouse.h17
-rw-r--r--hw/dmx/input/usb-other.c85
-rw-r--r--hw/dmx/input/usb-other.h17
-rw-r--r--hw/dmx/input/usb-private.h22
145 files changed, 20775 insertions, 18158 deletions
diff --git a/hw/dmx/config/Canvas.c b/hw/dmx/config/Canvas.c
index c2eba876a..34a47a2bf 100644
--- a/hw/dmx/config/Canvas.c
+++ b/hw/dmx/config/Canvas.c
@@ -60,100 +60,106 @@
#include <X11/StringDefs.h>
#include "CanvasP.h"
-static void CanvasInitialize(Widget request, Widget w,
- ArgList args, Cardinal *num_args)
+static void
+CanvasInitialize(Widget request, Widget w, ArgList args, Cardinal * num_args)
{
}
-static void CanvasExpose(Widget w, XEvent *event, Region region)
+static void
+CanvasExpose(Widget w, XEvent * event, Region region)
{
CanvasExposeDataRec data;
- data.w = w;
- data.event = event;
+ data.w = w;
+ data.event = event;
data.region = region;
-
- if (!XtIsRealized(w)) return;
- XtCallCallbacks(w, XtNcanvasExposeCallback, (XtPointer)&data);
+
+ if (!XtIsRealized(w))
+ return;
+ XtCallCallbacks(w, XtNcanvasExposeCallback, (XtPointer) & data);
}
-static void CanvasResize(Widget w)
+static void
+CanvasResize(Widget w)
{
- if (!XtIsRealized(w)) return;
- XtCallCallbacks(w, XtNcanvasResizeCallback, (XtPointer)w);
+ if (!XtIsRealized(w))
+ return;
+ XtCallCallbacks(w, XtNcanvasResizeCallback, (XtPointer) w);
}
-static void CanvasAction(Widget w, XEvent *event,
- String *params, Cardinal *num_params)
+static void
+CanvasAction(Widget w, XEvent * event, String * params, Cardinal * num_params)
{
- XtCallCallbacks(w, XtNcallback, (XtPointer)event);
+ XtCallCallbacks(w, XtNcallback, (XtPointer) event);
}
#define offset(field) XtOffsetOf(CanvasRec, canvas.field)
static XtResource resources[] = {
- { XtNcallback, XtCCallback, XtRCallback,
- sizeof(XtCallbackList), offset(input_callback), XtRCallback, NULL },
- { XtNcanvasExposeCallback, XtCcanvasExposeCallback, XtRCallback,
- sizeof(XtCallbackList), offset(expose_callback), XtRCallback, NULL },
- { XtNcanvasResizeCallback, XtCcanvasResizeCallback, XtRCallback,
- sizeof(XtCallbackList), offset(resize_callback), XtRCallback, NULL },
+ {XtNcallback, XtCCallback, XtRCallback,
+ sizeof(XtCallbackList), offset(input_callback), XtRCallback, NULL}
+ ,
+ {XtNcanvasExposeCallback, XtCcanvasExposeCallback, XtRCallback,
+ sizeof(XtCallbackList), offset(expose_callback), XtRCallback, NULL}
+ ,
+ {XtNcanvasResizeCallback, XtCcanvasResizeCallback, XtRCallback,
+ sizeof(XtCallbackList), offset(resize_callback), XtRCallback, NULL}
+ ,
};
+
#undef offset
-static XtActionsRec actions[] =
-{
- {"canvas", CanvasAction},
+static XtActionsRec actions[] = {
+ {"canvas", CanvasAction},
};
-static char translations[] =
-"<Key>: canvas()\n\
+static char translations[] = "<Key>: canvas()\n\
<Motion>: canvas()\n\
<BtnDown>: canvas()\n\
<BtnUp>: canvas()\n\
-"
-;
+";
#define Superclass (&widgetClassRec)
CanvasClassRec canvasClassRec = {
/* core */
{
- (WidgetClass)Superclass, /* superclass */
- "Canvas", /* class_name */
- sizeof(CanvasRec), /* widget_size */
- NULL, /* class_initialize */
- NULL, /* class_part_initialize */
- False, /* class_inited */
- CanvasInitialize, /* initialize */
- NULL, /* initialize_hook */
- XtInheritRealize, /* realize */
- actions, /* actions */
- XtNumber(actions), /* num_actions */
- resources, /* resources */
- XtNumber(resources), /* num_resources */
- NULLQUARK, /* xrm_class */
- True, /* compress_motion */
- True, /* compress_exposure */
- True, /* compress_enterleave */
- False, /* visible_interest */
- NULL, /* destroy */
- CanvasResize, /* resize */
- CanvasExpose, /* expose */
- NULL, /* set_values */
- NULL, /* set_values_hook */
- XtInheritSetValuesAlmost, /* set_values_almost */
- NULL, /* get_values_hook */
- NULL, /* accept_focus */
- XtVersion, /* version */
- NULL, /* callback_private */
- translations, /* tm_table */
- XtInheritQueryGeometry, /* query_geometry */
- XtInheritDisplayAccelerator, /* display_accelerator */
- NULL, /* extension */
- },
+ (WidgetClass) Superclass, /* superclass */
+ "Canvas", /* class_name */
+ sizeof(CanvasRec), /* widget_size */
+ NULL, /* class_initialize */
+ NULL, /* class_part_initialize */
+ False, /* class_inited */
+ CanvasInitialize, /* initialize */
+ NULL, /* initialize_hook */
+ XtInheritRealize, /* realize */
+ actions, /* actions */
+ XtNumber(actions), /* num_actions */
+ resources, /* resources */
+ XtNumber(resources), /* num_resources */
+ NULLQUARK, /* xrm_class */
+ True, /* compress_motion */
+ True, /* compress_exposure */
+ True, /* compress_enterleave */
+ False, /* visible_interest */
+ NULL, /* destroy */
+ CanvasResize, /* resize */
+ CanvasExpose, /* expose */
+ NULL, /* set_values */
+ NULL, /* set_values_hook */
+ XtInheritSetValuesAlmost, /* set_values_almost */
+ NULL, /* get_values_hook */
+ NULL, /* accept_focus */
+ XtVersion, /* version */
+ NULL, /* callback_private */
+ translations, /* tm_table */
+ XtInheritQueryGeometry, /* query_geometry */
+ XtInheritDisplayAccelerator, /* display_accelerator */
+ NULL, /* extension */
+ }
+ ,
/* canvas */
{
- NULL, /* extension */
- }
+ NULL, /* extension */
+ }
};
-WidgetClass canvasWidgetClass = (WidgetClass)&canvasClassRec;
+WidgetClass canvasWidgetClass = (WidgetClass) & canvasClassRec;
diff --git a/hw/dmx/config/Canvas.h b/hw/dmx/config/Canvas.h
index fe9a57f21..d516faf93 100644
--- a/hw/dmx/config/Canvas.h
+++ b/hw/dmx/config/Canvas.h
@@ -47,9 +47,9 @@ typedef struct _CanvasRec *CanvasWidget;
extern WidgetClass canvasWidgetClass;
typedef struct _CanvasExposeDataRec {
- Widget w;
- XEvent *event;
- Region region;
+ Widget w;
+ XEvent *event;
+ Region region;
} CanvasExposeDataRec, *CanvasExposeDataPtr;
-#endif /* _Canvas_h */
+#endif /* _Canvas_h */
diff --git a/hw/dmx/config/CanvasP.h b/hw/dmx/config/CanvasP.h
index cf43710f1..b1ccf2497 100644
--- a/hw/dmx/config/CanvasP.h
+++ b/hw/dmx/config/CanvasP.h
@@ -45,8 +45,8 @@ typedef struct {
} CanvasClassPart;
typedef struct _CanvasClassRec {
- CoreClassPart core_class;
- CanvasClassPart canvas_class;
+ CoreClassPart core_class;
+ CanvasClassPart canvas_class;
} CanvasClassRec;
extern CanvasClassRec canvasClassRec;
@@ -58,8 +58,8 @@ typedef struct {
} CanvasPart;
typedef struct _CanvasRec {
- CorePart core;
- CanvasPart canvas;
+ CorePart core;
+ CanvasPart canvas;
} CanvasRec;
-#endif /* _CanvasP_h */
+#endif /* _CanvasP_h */
diff --git a/hw/dmx/config/dmxcompat.c b/hw/dmx/config/dmxcompat.c
index 1c72084fa..bd9f12738 100644
--- a/hw/dmx/config/dmxcompat.c
+++ b/hw/dmx/config/dmxcompat.c
@@ -52,80 +52,84 @@
#include <string.h>
#include <ctype.h>
-static int dmxVDLReadLine(FILE *str, char *buf, int len)
+static int
+dmxVDLReadLine(FILE * str, char *buf, int len)
{
- if (fgets(buf, len, str)) return strlen(buf);
+ if (fgets(buf, len, str))
+ return strlen(buf);
return 0;
}
-static int dmxVDLCount(const char *buf)
+static int
+dmxVDLCount(const char *buf)
{
return strtol(buf, NULL, 10);
}
-static void dmxVDLVirtualEntry(const char *buf,
- char *name, int *len,
- int *x, int *y)
+static void
+dmxVDLVirtualEntry(const char *buf, char *name, int *len, int *x, int *y)
{
- char *end;
+ char *end;
const char *s;
- char *d;
- int start;
-
+ char *d;
+ int start;
+
*x = strtol(buf, &end, 10);
*y = strtol(end, &end, 10);
for (s = end, d = name, start = 1; *s && *s != '['; ++s) {
- if (start && isspace(*s)) continue;
- *d++ = *s;
+ if (start && isspace(*s))
+ continue;
+ *d++ = *s;
start = 0;
}
*d = '\0';
- while (d > name && isspace(d[-1])) *--d = '\0'; /* remove trailing space */
+ while (d > name && isspace(d[-1]))
+ *--d = '\0'; /* remove trailing space */
*len = strlen(name);
}
-static void dmxVDLDisplayEntry(const char *buf,
- char *name, int *len,
- int *x, int *y,
- int *xoff, int *yoff,
- int *xorig, int *yorig)
+static void
+dmxVDLDisplayEntry(const char *buf,
+ char *name, int *len,
+ int *x, int *y, int *xoff, int *yoff, int *xorig, int *yorig)
{
const char *pt;
- char *end;
-
- pt = strchr(buf, ' ');
- strlcpy(name, buf, 1+pt-buf);
- *len = strlen(name);
-
- *x = strtol(pt, &end, 10);
- *y = strtol(end, &end, 10);
+ char *end;
+
+ pt = strchr(buf, ' ');
+ strlcpy(name, buf, 1 + pt - buf);
+ *len = strlen(name);
+
+ *x = strtol(pt, &end, 10);
+ *y = strtol(end, &end, 10);
*xorig = strtol(end, &end, 10);
*yorig = strtol(end, &end, 10);
- *xoff = strtol(end, &end, 10);
- *yoff = strtol(end, NULL, 10);
+ *xoff = strtol(end, &end, 10);
+ *yoff = strtol(end, NULL, 10);
}
/** Read from the VDL format \a filename and return a newly allocated \a
* DMXConfigEntryPtr */
-DMXConfigEntryPtr dmxVDLRead(const char *filename)
+DMXConfigEntryPtr
+dmxVDLRead(const char *filename)
{
- FILE *str;
- char buf[2048]; /* RATS: Use ok */
- char *pt;
- int lineno = 0;
- DMXConfigEntryPtr entry = NULL;
+ FILE *str;
+ char buf[2048]; /* RATS: Use ok */
+ char *pt;
+ int lineno = 0;
+ DMXConfigEntryPtr entry = NULL;
DMXConfigVirtualPtr virtual = NULL;
- DMXConfigSubPtr sub = NULL;
+ DMXConfigSubPtr sub = NULL;
DMXConfigDisplayPtr display = NULL;
- DMXConfigFullDimPtr fdim = NULL;
- int vcount = 0;
- int dcount = 0;
- int icount = 0;
- int x, y, xoff, yoff, xorig, yorig;
- char name[2048]; /* RATS: Use ok */
- const char *tmp;
- int len;
+ DMXConfigFullDimPtr fdim = NULL;
+ int vcount = 0;
+ int dcount = 0;
+ int icount = 0;
+ int x, y, xoff, yoff, xorig, yorig;
+ char name[2048]; /* RATS: Use ok */
+ const char *tmp;
+ int len;
enum {
simulateFlag,
virtualCount,
@@ -134,15 +138,18 @@ DMXConfigEntryPtr dmxVDLRead(const char *filename)
displayEntry,
ignoreCount,
ignoreEntry
- } state = simulateFlag;
+ } state = simulateFlag;
- if (!filename) str = stdin;
- else str = fopen(filename, "r");
- if (!str) return NULL;
+ if (!filename)
+ str = stdin;
+ else
+ str = fopen(filename, "r");
+ if (!str)
+ return NULL;
while (dmxVDLReadLine(str, buf, sizeof(buf))) {
DMXConfigCommentPtr comment = NULL;
-
+
++lineno;
for (pt = buf; *pt; pt++)
if (*pt == '\r' || *pt == '\n') {
@@ -166,7 +173,7 @@ DMXConfigEntryPtr dmxVDLRead(const char *filename)
case virtualEntry:
len = sizeof(name);
dmxVDLVirtualEntry(buf, name, &len, &x, &y);
- tmp = dmxConfigCopyString(name, len);
+ tmp = dmxConfigCopyString(name, len);
virtual = dmxConfigCreateVirtual(NULL,
dmxConfigCreateString(T_STRING,
lineno,
@@ -186,41 +193,29 @@ DMXConfigEntryPtr dmxVDLRead(const char *filename)
case displayEntry:
dmxVDLDisplayEntry(buf, name, &len, &x, &y, &xoff, &yoff,
&xorig, &yorig);
- tmp = dmxConfigCopyString(name, len);
- fdim = dmxConfigCreateFullDim(
- dmxConfigCreatePartDim(
- dmxConfigCreatePair(T_DIMENSION,
- lineno,
- NULL,
- x, y, 0, 0),
- dmxConfigCreatePair(T_OFFSET,
- lineno,
- NULL,
- xoff, yoff,
- xoff, yoff)),
- NULL);
- display = dmxConfigCreateDisplay(NULL,
- dmxConfigCreateString(T_STRING,
- lineno,
- NULL,
- tmp),
- fdim,
- dmxConfigCreatePair(T_ORIGIN,
- lineno,
- NULL,
- xorig, yorig,
- 0, 0),
- NULL);
+ tmp = dmxConfigCopyString(name, len);
+ fdim =
+ dmxConfigCreateFullDim(dmxConfigCreatePartDim
+ (dmxConfigCreatePair
+ (T_DIMENSION, lineno, NULL, x, y, 0, 0),
+ dmxConfigCreatePair(T_OFFSET, lineno,
+ NULL, xoff, yoff,
+ xoff, yoff)), NULL);
+ display =
+ dmxConfigCreateDisplay(NULL,
+ dmxConfigCreateString(T_STRING, lineno,
+ NULL, tmp), fdim,
+ dmxConfigCreatePair(T_ORIGIN, lineno,
+ NULL, xorig, yorig,
+ 0, 0), NULL);
sub = dmxConfigAddSub(sub, dmxConfigSubDisplay(display));
if (!--dcount) {
- state = ignoreCount;
+ state = ignoreCount;
virtual->subentry = sub;
- entry = dmxConfigAddEntry(entry,
- dmxConfigVirtual,
- NULL,
- virtual);
- virtual = NULL;
- sub = NULL;
+ entry = dmxConfigAddEntry(entry,
+ dmxConfigVirtual, NULL, virtual);
+ virtual = NULL;
+ sub = NULL;
}
break;
case ignoreCount:
@@ -228,7 +223,8 @@ DMXConfigEntryPtr dmxVDLRead(const char *filename)
state = ignoreEntry;
break;
case ignoreEntry:
- if (!--icount) state = virtualEntry;
+ if (!--icount)
+ state = virtualEntry;
break;
}
}
diff --git a/hw/dmx/config/dmxconfig.c b/hw/dmx/config/dmxconfig.c
index a31e5f7f7..2cc9ab396 100644
--- a/hw/dmx/config/dmxconfig.c
+++ b/hw/dmx/config/dmxconfig.c
@@ -34,7 +34,6 @@
/** \file
* Provides interface for reading DMX configuration files and for
* combining that information with command-line configuration parameters. */
-
#ifdef HAVE_DMX_CONFIG_H
#include <dmx-config.h>
@@ -49,7 +48,7 @@
#include "dmxstat.h"
#include "parser.h"
-extern int yyparse(void);
+extern int yyparse(void);
extern FILE *yyin;
static char *dmxXkbRules;
@@ -60,35 +59,39 @@ static char *dmxXkbOptions;
/** Stores lists of configuration information. */
typedef struct DMXConfigListStruct {
- const char *name;
+ const char *name;
struct DMXConfigListStruct *next;
} DMXConfigList, *DMXConfigListPtr;
/** This stucture stores the parsed configuration information. */
typedef struct DMXConfigCmdStruct {
- const char *filename;
- const char *config;
+ const char *filename;
+ const char *config;
DMXConfigList *displays;
DMXConfigList *inputs;
DMXConfigList *xinputs;
} DMXConfigCmd, *DMXConfigCmdPtr;
-DMXConfigEntryPtr dmxConfigEntry;
-static DMXConfigCmd dmxConfigCmd;
+DMXConfigEntryPtr dmxConfigEntry;
+static DMXConfigCmd dmxConfigCmd;
static int dmxDisplaysFromCommandLine;
/** Make a note that \a display is the name of an X11 display that
* should be initialized as a backend (output) display. Called from
* #ddxProcessArgument. */
-void dmxConfigStoreDisplay(const char *display)
+void
+dmxConfigStoreDisplay(const char *display)
{
DMXConfigListPtr entry = malloc(sizeof(*entry));
+
entry->name = strdup(display);
entry->next = NULL;
- if (!dmxConfigCmd.displays) dmxConfigCmd.displays = entry;
+ if (!dmxConfigCmd.displays)
+ dmxConfigCmd.displays = entry;
else {
DMXConfigList *pt;
+
for (pt = dmxConfigCmd.displays; pt->next; pt = pt->next);
if (!pt)
dmxLog(dmxFatal, "dmxConfigStoreDisplay: end of list non-NULL\n");
@@ -99,14 +102,18 @@ void dmxConfigStoreDisplay(const char *display)
/** Make a note that \a input is the name of an X11 display that should
* be used for input (either a backend or a console input device). */
-void dmxConfigStoreInput(const char *input)
+void
+dmxConfigStoreInput(const char *input)
{
DMXConfigListPtr entry = malloc(sizeof(*entry));
+
entry->name = strdup(input);
entry->next = NULL;
- if (!dmxConfigCmd.inputs) dmxConfigCmd.inputs = entry;
+ if (!dmxConfigCmd.inputs)
+ dmxConfigCmd.inputs = entry;
else {
DMXConfigList *pt;
+
for (pt = dmxConfigCmd.inputs; pt->next; pt = pt->next);
if (!pt)
dmxLog(dmxFatal, "dmxConfigStoreInput: end of list non-NULL\n");
@@ -116,14 +123,18 @@ void dmxConfigStoreInput(const char *input)
/** Make a note that \a input is the name of an X11 display that should
* be used for input from XInput extension devices. */
-void dmxConfigStoreXInput(const char *input)
+void
+dmxConfigStoreXInput(const char *input)
{
DMXConfigListPtr entry = malloc(sizeof(*entry));
+
entry->name = strdup(input);
entry->next = NULL;
- if (!dmxConfigCmd.xinputs) dmxConfigCmd.xinputs = entry;
+ if (!dmxConfigCmd.xinputs)
+ dmxConfigCmd.xinputs = entry;
else {
DMXConfigList *pt;
+
for (pt = dmxConfigCmd.xinputs; pt->next; pt = pt->next);
if (!pt)
dmxLog(dmxFatal, "dmxConfigStoreXInput: end of list non-NULL\n");
@@ -132,7 +143,8 @@ void dmxConfigStoreXInput(const char *input)
}
/** Make a note that \a file is the configuration file. */
-void dmxConfigStoreFile(const char *file)
+void
+dmxConfigStoreFile(const char *file)
{
if (dmxConfigCmd.filename)
dmxLog(dmxFatal, "Only one -configfile allowed\n");
@@ -141,79 +153,89 @@ void dmxConfigStoreFile(const char *file)
/** Make a note that \a config should be used as the configuration for
* current instantiation of the DMX server. */
-void dmxConfigStoreConfig(const char *config)
+void
+dmxConfigStoreConfig(const char *config)
{
- if (dmxConfigCmd.config) dmxLog(dmxFatal, "Only one -config allowed\n");
+ if (dmxConfigCmd.config)
+ dmxLog(dmxFatal, "Only one -config allowed\n");
dmxConfigCmd.config = strdup(config);
}
-static int dmxConfigReadFile(const char *filename, int debug)
+static int
+dmxConfigReadFile(const char *filename, int debug)
{
FILE *str;
- if (!(str = fopen(filename, "r"))) return -1;
+ if (!(str = fopen(filename, "r")))
+ return -1;
dmxLog(dmxInfo, "Reading configuration file \"%s\"\n", filename);
- yyin = str;
+ yyin = str;
yydebug = debug;
yyparse();
fclose(str);
return 0;
}
-static const char *dmxConfigMatch(const char *target, DMXConfigEntryPtr entry)
+static const char *
+dmxConfigMatch(const char *target, DMXConfigEntryPtr entry)
{
- DMXConfigVirtualPtr v = entry->virtual;
- const char *name = NULL;
-
- if (v && v->name) name = v->name;
-
- if (v && !dmxConfigCmd.config) return v->name ? v->name : "<noname>";
- if (!name) return NULL;
- if (!strcmp(name, target)) return name;
+ DMXConfigVirtualPtr v = entry->virtual;
+ const char *name = NULL;
+
+ if (v && v->name)
+ name = v->name;
+
+ if (v && !dmxConfigCmd.config)
+ return v->name ? v->name : "<noname>";
+ if (!name)
+ return NULL;
+ if (!strcmp(name, target))
+ return name;
return NULL;
}
-static DMXScreenInfo *dmxConfigAddDisplay(const char *name,
- int scrnWidth, int scrnHeight,
- int scrnX, int scrnY,
- int scrnXSign, int scrnYSign,
- int rootWidth, int rootHeight,
- int rootX, int rootY,
- int rootXSign, int rootYSign)
+static DMXScreenInfo *
+dmxConfigAddDisplay(const char *name,
+ int scrnWidth, int scrnHeight,
+ int scrnX, int scrnY,
+ int scrnXSign, int scrnYSign,
+ int rootWidth, int rootHeight,
+ int rootX, int rootY, int rootXSign, int rootYSign)
{
DMXScreenInfo *dmxScreen;
-
+
if (!(dmxScreens = realloc(dmxScreens,
- (dmxNumScreens+1) * sizeof(*dmxScreens))))
+ (dmxNumScreens + 1) * sizeof(*dmxScreens))))
dmxLog(dmxFatal,
"dmxConfigAddDisplay: realloc failed for screen %d (%s)\n",
dmxNumScreens, name);
-
+
dmxScreen = &dmxScreens[dmxNumScreens];
memset(dmxScreen, 0, sizeof(*dmxScreen));
- dmxScreen->name = name;
- dmxScreen->index = dmxNumScreens;
- dmxScreen->scrnWidth = scrnWidth;
+ dmxScreen->name = name;
+ dmxScreen->index = dmxNumScreens;
+ dmxScreen->scrnWidth = scrnWidth;
dmxScreen->scrnHeight = scrnHeight;
- dmxScreen->scrnX = scrnX;
- dmxScreen->scrnY = scrnY;
- dmxScreen->scrnXSign = scrnXSign;
- dmxScreen->scrnYSign = scrnYSign;
- dmxScreen->rootWidth = rootWidth;
+ dmxScreen->scrnX = scrnX;
+ dmxScreen->scrnY = scrnY;
+ dmxScreen->scrnXSign = scrnXSign;
+ dmxScreen->scrnYSign = scrnYSign;
+ dmxScreen->rootWidth = rootWidth;
dmxScreen->rootHeight = rootHeight;
- dmxScreen->rootX = rootX;
- dmxScreen->rootY = rootY;
- dmxScreen->stat = dmxStatAlloc();
+ dmxScreen->rootX = rootX;
+ dmxScreen->rootY = rootY;
+ dmxScreen->stat = dmxStatAlloc();
++dmxNumScreens;
return dmxScreen;
}
-DMXInputInfo *dmxConfigAddInput(const char *name, int core)
+DMXInputInfo *
+dmxConfigAddInput(const char *name, int core)
{
DMXInputInfo *dmxInput;
if (!(dmxInputs = realloc(dmxInputs,
- (dmxNumInputs+1) * sizeof(*dmxInputs))))
+ (dmxNumInputs + 1) * sizeof(*dmxInputs))))
dmxLog(dmxFatal,
"dmxConfigAddInput: realloc failed for input %d (%s)\n",
dmxNumInputs, name);
@@ -221,71 +243,79 @@ DMXInputInfo *dmxConfigAddInput(const char *name, int core)
dmxInput = &dmxInputs[dmxNumInputs];
memset(dmxInput, 0, sizeof(*dmxInput));
- dmxInput->name = name;
+ dmxInput->name = name;
dmxInput->inputIdx = dmxNumInputs;
- dmxInput->scrnIdx = -1;
- dmxInput->core = core;
+ dmxInput->scrnIdx = -1;
+ dmxInput->core = core;
++dmxNumInputs;
return dmxInput;
}
-static void dmxConfigCopyFromDisplay(DMXConfigDisplayPtr d)
+static void
+dmxConfigCopyFromDisplay(DMXConfigDisplayPtr d)
{
DMXScreenInfo *dmxScreen;
- dmxScreen = dmxConfigAddDisplay(d->name,
- d->scrnWidth, d->scrnHeight,
- d->scrnX, d->scrnY,
- d->scrnXSign, d->scrnYSign,
- d->rootWidth, d->rootHeight,
- d->rootX, d->rootY,
- d->rootXSign, d->rootXSign);
- dmxScreen->where = PosAbsolute;
+ dmxScreen = dmxConfigAddDisplay(d->name,
+ d->scrnWidth, d->scrnHeight,
+ d->scrnX, d->scrnY,
+ d->scrnXSign, d->scrnYSign,
+ d->rootWidth, d->rootHeight,
+ d->rootX, d->rootY,
+ d->rootXSign, d->rootXSign);
+ dmxScreen->where = PosAbsolute;
dmxScreen->whereX = d->rootXOrigin;
dmxScreen->whereY = d->rootYOrigin;
}
-static void dmxConfigCopyFromWall(DMXConfigWallPtr w)
+static void
+dmxConfigCopyFromWall(DMXConfigWallPtr w)
{
DMXConfigStringPtr pt;
- DMXScreenInfo *dmxScreen;
- int edge = dmxNumScreens;
- int last = dmxNumScreens;
+ DMXScreenInfo *dmxScreen;
+ int edge = dmxNumScreens;
+ int last = dmxNumScreens;
- if (!w->xwall && !w->ywall) { /* Try to make it square */
+ if (!w->xwall && !w->ywall) { /* Try to make it square */
int count;
- for (pt = w->nameList, count = 0; pt; pt = pt->next) ++count;
+
+ for (pt = w->nameList, count = 0; pt; pt = pt->next)
+ ++count;
w->xwall = sqrt(count) + .5;
}
for (pt = w->nameList; pt; pt = pt->next) {
dmxScreen = dmxConfigAddDisplay(pt->string, w->width, w->height,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
- if (pt == w->nameList) { /* Upper left */
- dmxScreen->where = PosAbsolute;
+ if (pt == w->nameList) { /* Upper left */
+ dmxScreen->where = PosAbsolute;
dmxScreen->whereX = 0;
dmxScreen->whereY = 0;
- } else if (w->xwall) { /* Tile left to right, then top to bottom */
- if (!((dmxNumScreens-1) % w->xwall)) {
- dmxScreen->where = PosBelow;
+ }
+ else if (w->xwall) { /* Tile left to right, then top to bottom */
+ if (!((dmxNumScreens - 1) % w->xwall)) {
+ dmxScreen->where = PosBelow;
dmxScreen->whereRefScreen = edge;
- edge = dmxNumScreens-1;
- } else {
- dmxScreen->where = PosRightOf;
+ edge = dmxNumScreens - 1;
+ }
+ else {
+ dmxScreen->where = PosRightOf;
dmxScreen->whereRefScreen = last;
}
- } else { /* Tile top to bottom, then left to right */
- if (!((dmxNumScreens-1) % w->ywall)) {
- dmxScreen->where = PosRightOf;
+ }
+ else { /* Tile top to bottom, then left to right */
+ if (!((dmxNumScreens - 1) % w->ywall)) {
+ dmxScreen->where = PosRightOf;
dmxScreen->whereRefScreen = edge;
- edge = dmxNumScreens-1;
- } else {
- dmxScreen->where = PosBelow;
+ edge = dmxNumScreens - 1;
+ }
+ else {
+ dmxScreen->where = PosBelow;
dmxScreen->whereRefScreen = last;
}
}
- last = dmxNumScreens-1;
+ last = dmxNumScreens - 1;
if (dmxScreen->where == PosAbsolute)
dmxLog(dmxInfo, "Added %s at %d %d\n",
pt->string, dmxScreen->whereX, dmxScreen->whereY);
@@ -297,60 +327,79 @@ static void dmxConfigCopyFromWall(DMXConfigWallPtr w)
}
}
-static void dmxConfigCopyFromOption(DMXConfigOptionPtr o)
+static void
+dmxConfigCopyFromOption(DMXConfigOptionPtr o)
{
DMXConfigStringPtr pt;
- int argc = 0;
- char **argv = NULL;
+ int argc = 0;
+ char **argv = NULL;
- if (serverGeneration != 1) return; /* FIXME: only do once, for now */
- if (!o || !o->string) return;
+ if (serverGeneration != 1)
+ return; /* FIXME: only do once, for now */
+ if (!o || !o->string)
+ return;
for (pt = o->option; pt; pt = pt->next) {
if (pt->string) {
++argc;
- argv = realloc(argv, (argc+1) * sizeof(*argv));
- argv[argc] = (char *)pt->string;
+ argv = realloc(argv, (argc + 1) * sizeof(*argv));
+ argv[argc] = (char *) pt->string;
}
}
argv[0] = NULL;
- ProcessCommandLine(argc+1, argv);
+ ProcessCommandLine(argc + 1, argv);
free(argv);
}
-static void dmxConfigCopyFromParam(DMXConfigParamPtr p)
+static void
+dmxConfigCopyFromParam(DMXConfigParamPtr p)
{
const char **argv;
- int argc;
-
+ int argc;
+
if ((argv = dmxConfigLookupParam(p, "xkbrules", &argc)) && argc == 2) {
dmxConfigSetXkbRules(argv[1]);
- } else if ((argv = dmxConfigLookupParam(p, "xkbmodel", &argc))
- && argc == 2) {
+ }
+ else if ((argv = dmxConfigLookupParam(p, "xkbmodel", &argc))
+ && argc == 2) {
dmxConfigSetXkbModel(argv[1]);
- } else if ((argv = dmxConfigLookupParam(p, "xkblayout", &argc))
- && argc == 2) {
+ }
+ else if ((argv = dmxConfigLookupParam(p, "xkblayout", &argc))
+ && argc == 2) {
dmxConfigSetXkbLayout(argv[1]);
- } else if ((argv = dmxConfigLookupParam(p, "xkbvariant", &argc))
- && argc == 2) {
+ }
+ else if ((argv = dmxConfigLookupParam(p, "xkbvariant", &argc))
+ && argc == 2) {
dmxConfigSetXkbVariant(argv[1]);
- } else if ((argv = dmxConfigLookupParam(p, "xkboptions", &argc))
- && argc == 2) {
+ }
+ else if ((argv = dmxConfigLookupParam(p, "xkboptions", &argc))
+ && argc == 2) {
dmxConfigSetXkbOptions(argv[1]);
}
}
-static void dmxConfigCopyData(DMXConfigVirtualPtr v)
+static void
+dmxConfigCopyData(DMXConfigVirtualPtr v)
{
DMXConfigSubPtr sub;
-
- if (v->dim) dmxSetWidthHeight(v->dim->x, v->dim->y);
- else dmxSetWidthHeight(0, 0);
+
+ if (v->dim)
+ dmxSetWidthHeight(v->dim->x, v->dim->y);
+ else
+ dmxSetWidthHeight(0, 0);
for (sub = v->subentry; sub; sub = sub->next) {
switch (sub->type) {
- case dmxConfigDisplay: dmxConfigCopyFromDisplay(sub->display); break;
- case dmxConfigWall: dmxConfigCopyFromWall(sub->wall); break;
- case dmxConfigOption: dmxConfigCopyFromOption(sub->option); break;
- case dmxConfigParam: dmxConfigCopyFromParam(sub->param); break;
+ case dmxConfigDisplay:
+ dmxConfigCopyFromDisplay(sub->display);
+ break;
+ case dmxConfigWall:
+ dmxConfigCopyFromWall(sub->wall);
+ break;
+ case dmxConfigOption:
+ dmxConfigCopyFromOption(sub->option);
+ break;
+ case dmxConfigParam:
+ dmxConfigCopyFromParam(sub->param);
+ break;
default:
dmxLog(dmxFatal,
"dmxConfigCopyData: not a display, wall, or value\n");
@@ -358,25 +407,29 @@ static void dmxConfigCopyData(DMXConfigVirtualPtr v)
}
}
-static void dmxConfigFromCommandLine(void)
+static void
+dmxConfigFromCommandLine(void)
{
DMXConfigListPtr pt;
-
+
dmxLog(dmxInfo, "Using configuration from command line\n");
for (pt = dmxConfigCmd.displays; pt; pt = pt->next) {
DMXScreenInfo *dmxScreen = dmxConfigAddDisplay(pt->name,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0);
+
if (dmxNumScreens == 1) {
- dmxScreen->where = PosAbsolute;
+ dmxScreen->where = PosAbsolute;
dmxScreen->whereX = 0;
dmxScreen->whereY = 0;
dmxLog(dmxInfo, "Added %s at %d %d\n",
dmxScreen->name, dmxScreen->whereX, dmxScreen->whereY);
- } else {
- dmxScreen->where = PosRightOf;
+ }
+ else {
+ dmxScreen->where = PosRightOf;
dmxScreen->whereRefScreen = dmxNumScreens - 2;
- if (dmxScreen->whereRefScreen < 0) dmxScreen->whereRefScreen = 0;
+ if (dmxScreen->whereRefScreen < 0)
+ dmxScreen->whereRefScreen = 0;
dmxLog(dmxInfo, "Added %s %s %s\n",
dmxScreen->name,
dmxScreen->where == PosBelow ? "below" : "right of",
@@ -385,14 +438,16 @@ static void dmxConfigFromCommandLine(void)
}
}
-static void dmxConfigFromConfigFile(void)
+static void
+dmxConfigFromConfigFile(void)
{
DMXConfigEntryPtr pt;
- const char *name;
+ const char *name;
for (pt = dmxConfigEntry; pt; pt = pt->next) {
- /* FIXME -- if an input is specified, use it */
- if (pt->type != dmxConfigVirtual) continue;
+ /* FIXME -- if an input is specified, use it */
+ if (pt->type != dmxConfigVirtual)
+ continue;
if ((name = dmxConfigMatch(dmxConfigCmd.config, pt))) {
dmxLog(dmxInfo, "Using configuration \"%s\"\n", name);
dmxConfigCopyData(pt->virtual);
@@ -403,22 +458,26 @@ static void dmxConfigFromConfigFile(void)
dmxConfigCmd.config, dmxConfigCmd.filename);
}
-static void dmxConfigConfigInputs(void)
+static void
+dmxConfigConfigInputs(void)
{
DMXConfigListPtr pt;
- if (dmxNumInputs) return;
-
- if (dmxConfigCmd.inputs) { /* Use command line */
+ if (dmxNumInputs)
+ return;
+
+ if (dmxConfigCmd.inputs) { /* Use command line */
for (pt = dmxConfigCmd.inputs; pt; pt = pt->next)
dmxConfigAddInput(pt->name, TRUE);
- } else if (dmxNumScreens) { /* Use first display */
+ }
+ else if (dmxNumScreens) { /* Use first display */
dmxConfigAddInput(dmxScreens[0].name, TRUE);
- } else { /* Use dummy */
+ }
+ else { /* Use dummy */
dmxConfigAddInput("dummy", TRUE);
}
- if (dmxConfigCmd.xinputs) { /* Non-core devices from command line */
+ if (dmxConfigCmd.xinputs) { /* Non-core devices from command line */
for (pt = dmxConfigCmd.xinputs; pt; pt = pt->next)
dmxConfigAddInput(pt->name, FALSE);
}
@@ -427,7 +486,8 @@ static void dmxConfigConfigInputs(void)
/** Set up the appropriate global variables so that the DMX server will
* be initialized using the configuration specified in the config file
* and on the command line. */
-void dmxConfigConfigure(void)
+void
+dmxConfigConfigure(void)
{
if (dmxConfigEntry) {
dmxConfigFreeEntry(dmxConfigEntry);
@@ -440,7 +500,8 @@ void dmxConfigConfigure(void)
dmxConfigCmd.filename);
dmxConfigReadFile(dmxConfigCmd.filename, 0);
dmxConfigFromConfigFile();
- } else {
+ }
+ else {
if (dmxConfigCmd.config)
dmxLog(dmxWarning,
"Configuration name (%s) without configuration file\n",
@@ -454,11 +515,13 @@ void dmxConfigConfigure(void)
* sets MAXSCREENS to that value. This is difficult since the number
* depends on the command line (which is easy to count) or on the config
* file, which has to be parsed. */
-void dmxConfigSetMaxScreens(void)
+void
+dmxConfigSetMaxScreens(void)
{
static int processing = 0;
- if (processing) return; /* Prevent reentry via ProcessCommandLine */
+ if (processing)
+ return; /* Prevent reentry via ProcessCommandLine */
processing = 1;
if (dmxConfigCmd.filename) {
if (!dmxNumScreens)
@@ -466,7 +529,8 @@ void dmxConfigSetMaxScreens(void)
#ifndef MAXSCREENS
SetMaxScreens(dmxNumScreens);
#endif
- } else
+ }
+ else
#ifndef MAXSCREENS
SetMaxScreens(dmxDisplaysFromCommandLine);
#endif
@@ -490,8 +554,8 @@ void dmxConfigSetMaxScreens(void)
return (char *)(dmx##glob ? dmx##glob : def); \
}
-GEN(rules, XkbRules, XKB_DFLT_RULES)
-GEN(model, XkbModel, XKB_DFLT_MODEL)
-GEN(layout, XkbLayout, XKB_DFLT_LAYOUT)
-GEN(variant, XkbVariant, XKB_DFLT_VARIANT)
-GEN(options, XkbOptions, XKB_DFLT_OPTIONS)
+GEN(rules, XkbRules, XKB_DFLT_RULES)
+ GEN(model, XkbModel, XKB_DFLT_MODEL)
+ GEN(layout, XkbLayout, XKB_DFLT_LAYOUT)
+ GEN(variant, XkbVariant, XKB_DFLT_VARIANT)
+ GEN(options, XkbOptions, XKB_DFLT_OPTIONS)
diff --git a/hw/dmx/config/dmxconfig.h b/hw/dmx/config/dmxconfig.h
index 91a6662e3..deb293cc0 100644
--- a/hw/dmx/config/dmxconfig.h
+++ b/hw/dmx/config/dmxconfig.h
@@ -40,8 +40,8 @@
#include <xkb-config.h>
extern void dmxConfigStoreDisplay(const char *display);
-extern void dmxConfigStoreInput(const char *input); /* Core devices */
-extern void dmxConfigStoreXInput(const char *input); /* Non-core devices */
+extern void dmxConfigStoreInput(const char *input); /* Core devices */
+extern void dmxConfigStoreXInput(const char *input); /* Non-core devices */
extern void dmxConfigStoreFile(const char *file);
extern void dmxConfigStoreConfig(const char *config);
extern void dmxConfigConfigure(void);
diff --git a/hw/dmx/config/dmxparse.c b/hw/dmx/config/dmxparse.c
index 35f1c2185..cf510844d 100644
--- a/hw/dmx/config/dmxparse.c
+++ b/hw/dmx/config/dmxparse.c
@@ -52,10 +52,11 @@
/** A general error logging routine that does not depend on the dmxLog
* functions. */
-void dmxConfigLog(const char *format, ...)
+void
+dmxConfigLog(const char *format, ...)
{
va_list args;
-
+
va_start(args, format);
vprintf(format, args); /* RATS: All calls to dmxConfigLog from
* dmxparse.c and dmxprint.c use a
@@ -63,9 +64,11 @@ void dmxConfigLog(const char *format, ...)
va_end(args);
}
-void *dmxConfigAlloc(unsigned long bytes)
+void *
+dmxConfigAlloc(unsigned long bytes)
{
void *area = calloc(1, bytes);
+
if (!area) {
dmxConfigLog("dmxConfigAlloc: out of memory\n");
return NULL;
@@ -73,10 +76,11 @@ void *dmxConfigAlloc(unsigned long bytes)
return area;
}
-void *dmxConfigRealloc(void *orig, unsigned long orig_bytes,
- unsigned long bytes)
+void *
+dmxConfigRealloc(void *orig, unsigned long orig_bytes, unsigned long bytes)
{
unsigned char *area = realloc(orig, bytes);
+
if (!area) {
dmxConfigLog("dmxConfigRealloc: out of memory\n");
return NULL;
@@ -85,216 +89,237 @@ void *dmxConfigRealloc(void *orig, unsigned long orig_bytes,
return area;
}
-const char *dmxConfigCopyString(const char *string, int length)
+const char *
+dmxConfigCopyString(const char *string, int length)
{
char *copy;
-
- if (!length) length = strlen(string);
+
+ if (!length)
+ length = strlen(string);
copy = dmxConfigAlloc(length + 1);
- if (length) strncpy(copy, string, length);
+ if (length)
+ strncpy(copy, string, length);
copy[length] = '\0';
return copy;
}
-void dmxConfigFree(void *area)
+void
+dmxConfigFree(void *area)
{
free(area);
}
-DMXConfigTokenPtr dmxConfigCreateToken(int token, int line,
- const char *comment)
+DMXConfigTokenPtr
+dmxConfigCreateToken(int token, int line, const char *comment)
{
DMXConfigTokenPtr pToken = dmxConfigAlloc(sizeof(*pToken));
- pToken->token = token;
- pToken->line = line;
+
+ pToken->token = token;
+ pToken->line = line;
pToken->comment = comment;
return pToken;
}
-void dmxConfigFreeToken(DMXConfigTokenPtr p)
+void
+dmxConfigFreeToken(DMXConfigTokenPtr p)
{
- if (!p) return;
- dmxConfigFree((void *)p->comment);
+ if (!p)
+ return;
+ dmxConfigFree((void *) p->comment);
dmxConfigFree(p);
}
-DMXConfigStringPtr dmxConfigCreateString(int token, int line,
- const char *comment,
- const char *string)
+DMXConfigStringPtr
+dmxConfigCreateString(int token, int line,
+ const char *comment, const char *string)
{
DMXConfigStringPtr pString = dmxConfigAlloc(sizeof(*pString));
- pString->token = token;
- pString->line = line;
+ pString->token = token;
+ pString->line = line;
pString->comment = comment;
- pString->string = string;
+ pString->string = string;
return pString;
}
-void dmxConfigFreeString(DMXConfigStringPtr p)
+void
+dmxConfigFreeString(DMXConfigStringPtr p)
{
DMXConfigStringPtr next;
- if (!p) return;
+ if (!p)
+ return;
do {
next = p->next;
- dmxConfigFree((void *)p->comment);
- dmxConfigFree((void *)p->string);
+ dmxConfigFree((void *) p->comment);
+ dmxConfigFree((void *) p->string);
dmxConfigFree(p);
} while ((p = next));
}
-
-DMXConfigNumberPtr dmxConfigCreateNumber(int token, int line,
- const char *comment,
- int number)
+
+DMXConfigNumberPtr
+dmxConfigCreateNumber(int token, int line, const char *comment, int number)
{
DMXConfigNumberPtr pNumber = dmxConfigAlloc(sizeof(*pNumber));
- pNumber->token = token;
- pNumber->line = line;
+ pNumber->token = token;
+ pNumber->line = line;
pNumber->comment = comment;
- pNumber->number = number;
+ pNumber->number = number;
return pNumber;
}
-void dmxConfigFreeNumber(DMXConfigNumberPtr p)
+void
+dmxConfigFreeNumber(DMXConfigNumberPtr p)
{
- if (!p) return;
- dmxConfigFree((void *)p->comment);
+ if (!p)
+ return;
+ dmxConfigFree((void *) p->comment);
dmxConfigFree(p);
}
-DMXConfigPairPtr dmxConfigCreatePair(int token, int line,
- const char *comment,
- int x, int y,
- int xsign, int ysign)
+DMXConfigPairPtr
+dmxConfigCreatePair(int token, int line,
+ const char *comment, int x, int y, int xsign, int ysign)
{
DMXConfigPairPtr pPair = dmxConfigAlloc(sizeof(*pPair));
- pPair->token = token;
- pPair->line = line;
+ pPair->token = token;
+ pPair->line = line;
pPair->comment = comment;
- pPair->x = x;
- pPair->y = y;
- pPair->xsign = (xsign < 0) ? -1 : 1;
- pPair->ysign = (ysign < 0) ? -1 : 1;
+ pPair->x = x;
+ pPair->y = y;
+ pPair->xsign = (xsign < 0) ? -1 : 1;
+ pPair->ysign = (ysign < 0) ? -1 : 1;
return pPair;
}
-void dmxConfigFreePair(DMXConfigPairPtr p)
+void
+dmxConfigFreePair(DMXConfigPairPtr p)
{
- if (!p) return;
- dmxConfigFree((void *)p->comment);
+ if (!p)
+ return;
+ dmxConfigFree((void *) p->comment);
dmxConfigFree(p);
}
-DMXConfigCommentPtr dmxConfigCreateComment(int token, int line,
- const char *comment)
+DMXConfigCommentPtr
+dmxConfigCreateComment(int token, int line, const char *comment)
{
DMXConfigCommentPtr pComment = dmxConfigAlloc(sizeof(*pComment));
- pComment->token = token;
- pComment->line = line;
+ pComment->token = token;
+ pComment->line = line;
pComment->comment = comment;
return pComment;
}
-void dmxConfigFreeComment(DMXConfigCommentPtr p)
+void
+dmxConfigFreeComment(DMXConfigCommentPtr p)
{
- if (!p) return;
- dmxConfigFree((void *)p->comment);
+ if (!p)
+ return;
+ dmxConfigFree((void *) p->comment);
dmxConfigFree(p);
}
-DMXConfigPartDimPtr dmxConfigCreatePartDim(DMXConfigPairPtr pDim,
- DMXConfigPairPtr pOffset)
+DMXConfigPartDimPtr
+dmxConfigCreatePartDim(DMXConfigPairPtr pDim, DMXConfigPairPtr pOffset)
{
DMXConfigPartDimPtr pPart = dmxConfigAlloc(sizeof(*pPart));
- pPart->dim = pDim;
+
+ pPart->dim = pDim;
pPart->offset = pOffset;
return pPart;
}
-void dmxConfigFreePartDim(DMXConfigPartDimPtr p)
+void
+dmxConfigFreePartDim(DMXConfigPartDimPtr p)
{
- if (!p) return;
+ if (!p)
+ return;
dmxConfigFreePair(p->dim);
dmxConfigFreePair(p->offset);
dmxConfigFree(p);
}
-DMXConfigFullDimPtr dmxConfigCreateFullDim(DMXConfigPartDimPtr pScrn,
- DMXConfigPartDimPtr pRoot)
+DMXConfigFullDimPtr
+dmxConfigCreateFullDim(DMXConfigPartDimPtr pScrn, DMXConfigPartDimPtr pRoot)
{
DMXConfigFullDimPtr pFull = dmxConfigAlloc(sizeof(*pFull));
+
pFull->scrn = pScrn;
pFull->root = pRoot;
return pFull;
}
-void dmxConfigFreeFullDim(DMXConfigFullDimPtr p)
+void
+dmxConfigFreeFullDim(DMXConfigFullDimPtr p)
{
- if (!p) return;
+ if (!p)
+ return;
dmxConfigFreePartDim(p->scrn);
dmxConfigFreePartDim(p->root);
dmxConfigFree(p);
}
-DMXConfigDisplayPtr dmxConfigCreateDisplay(DMXConfigTokenPtr pStart,
- DMXConfigStringPtr pName,
- DMXConfigFullDimPtr pDim,
- DMXConfigPairPtr pOrigin,
- DMXConfigTokenPtr pEnd)
+DMXConfigDisplayPtr
+dmxConfigCreateDisplay(DMXConfigTokenPtr pStart,
+ DMXConfigStringPtr pName,
+ DMXConfigFullDimPtr pDim,
+ DMXConfigPairPtr pOrigin, DMXConfigTokenPtr pEnd)
{
DMXConfigDisplayPtr pDisplay = dmxConfigAlloc(sizeof(*pDisplay));
- pDisplay->start = pStart;
- pDisplay->dname = pName;
- pDisplay->dim = pDim;
- pDisplay->origin = pOrigin;
- pDisplay->end = pEnd;
+ pDisplay->start = pStart;
+ pDisplay->dname = pName;
+ pDisplay->dim = pDim;
+ pDisplay->origin = pOrigin;
+ pDisplay->end = pEnd;
- pDisplay->name = pName ? pName->string : NULL;
- pDisplay->rootXOrigin = pOrigin ? pOrigin->x : 0;
- pDisplay->rootYOrigin = pOrigin ? pOrigin->y : 0;
+ pDisplay->name = pName ? pName->string : NULL;
+ pDisplay->rootXOrigin = pOrigin ? pOrigin->x : 0;
+ pDisplay->rootYOrigin = pOrigin ? pOrigin->y : 0;
if (pDim && pDim->scrn && pDim->scrn->dim) {
- pDisplay->scrnWidth = pDim->scrn->dim->x;
+ pDisplay->scrnWidth = pDim->scrn->dim->x;
pDisplay->scrnHeight = pDim->scrn->dim->y;
}
if (pDim && pDim->scrn && pDim->scrn->offset) {
- pDisplay->scrnX = pDim->scrn->offset->x;
- pDisplay->scrnY = pDim->scrn->offset->y;
- pDisplay->scrnXSign = pDim->scrn->offset->xsign;
- pDisplay->scrnYSign = pDim->scrn->offset->ysign;
+ pDisplay->scrnX = pDim->scrn->offset->x;
+ pDisplay->scrnY = pDim->scrn->offset->y;
+ pDisplay->scrnXSign = pDim->scrn->offset->xsign;
+ pDisplay->scrnYSign = pDim->scrn->offset->ysign;
}
-
+
if (pDim && pDim->root) {
if (pDim->root->dim) {
- pDisplay->rootWidth = pDim->root->dim->x;
+ pDisplay->rootWidth = pDim->root->dim->x;
pDisplay->rootHeight = pDim->root->dim->y;
}
if (pDim->root->offset) {
- pDisplay->rootX = pDim->root->offset->x;
- pDisplay->rootY = pDim->root->offset->y;
- pDisplay->rootXSign = pDim->root->offset->xsign;
- pDisplay->rootYSign = pDim->root->offset->ysign;
+ pDisplay->rootX = pDim->root->offset->x;
+ pDisplay->rootY = pDim->root->offset->y;
+ pDisplay->rootXSign = pDim->root->offset->xsign;
+ pDisplay->rootYSign = pDim->root->offset->ysign;
}
- } else { /* If no root specification, copy width
+ }
+ else { /* If no root specification, copy width
* and height from scrn -- leave offset
* as zero, since it is relative to
* scrn. */
- pDisplay->rootWidth = pDisplay->scrnWidth;
+ pDisplay->rootWidth = pDisplay->scrnWidth;
pDisplay->rootHeight = pDisplay->scrnHeight;
}
-
return pDisplay;
}
-void dmxConfigFreeDisplay(DMXConfigDisplayPtr p)
+void
+dmxConfigFreeDisplay(DMXConfigDisplayPtr p)
{
- if (!p) return;
+ if (!p)
+ return;
dmxConfigFreeToken(p->start);
dmxConfigFreeString(p->dname);
dmxConfigFreeFullDim(p->dim);
@@ -302,31 +327,33 @@ void dmxConfigFreeDisplay(DMXConfigDisplayPtr p)
dmxConfigFree(p);
}
-DMXConfigWallPtr dmxConfigCreateWall(DMXConfigTokenPtr pStart,
- DMXConfigPairPtr pWallDim,
- DMXConfigPairPtr pDisplayDim,
- DMXConfigStringPtr pNameList,
- DMXConfigTokenPtr pEnd)
+DMXConfigWallPtr
+dmxConfigCreateWall(DMXConfigTokenPtr pStart,
+ DMXConfigPairPtr pWallDim,
+ DMXConfigPairPtr pDisplayDim,
+ DMXConfigStringPtr pNameList, DMXConfigTokenPtr pEnd)
{
DMXConfigWallPtr pWall = dmxConfigAlloc(sizeof(*pWall));
- pWall->start = pStart;
- pWall->wallDim = pWallDim;
+ pWall->start = pStart;
+ pWall->wallDim = pWallDim;
pWall->displayDim = pDisplayDim;
- pWall->nameList = pNameList;
- pWall->end = pEnd;
+ pWall->nameList = pNameList;
+ pWall->end = pEnd;
- pWall->width = pDisplayDim ? pDisplayDim->x : 0;
- pWall->height = pDisplayDim ? pDisplayDim->y : 0;
- pWall->xwall = pWallDim ? pWallDim->x : 0;
- pWall->ywall = pWallDim ? pWallDim->y : 0;
+ pWall->width = pDisplayDim ? pDisplayDim->x : 0;
+ pWall->height = pDisplayDim ? pDisplayDim->y : 0;
+ pWall->xwall = pWallDim ? pWallDim->x : 0;
+ pWall->ywall = pWallDim ? pWallDim->y : 0;
return pWall;
}
-void dmxConfigFreeWall(DMXConfigWallPtr p)
+void
+dmxConfigFreeWall(DMXConfigWallPtr p)
{
- if (!p) return;
+ if (!p)
+ return;
dmxConfigFreeToken(p->start);
dmxConfigFreePair(p->wallDim);
dmxConfigFreePair(p->displayDim);
@@ -335,41 +362,46 @@ void dmxConfigFreeWall(DMXConfigWallPtr p)
dmxConfigFree(p);
}
-DMXConfigOptionPtr dmxConfigCreateOption(DMXConfigTokenPtr pStart,
- DMXConfigStringPtr pOption,
- DMXConfigTokenPtr pEnd)
+DMXConfigOptionPtr
+dmxConfigCreateOption(DMXConfigTokenPtr pStart,
+ DMXConfigStringPtr pOption, DMXConfigTokenPtr pEnd)
{
- int length = 0;
- int offset = 0;
+ int length = 0;
+ int offset = 0;
DMXConfigStringPtr p;
DMXConfigOptionPtr option = dmxConfigAlloc(sizeof(*option));
for (p = pOption; p; p = p->next) {
- if (p->string) length += strlen(p->string) + 1;
+ if (p->string)
+ length += strlen(p->string) + 1;
}
option->string = dmxConfigAlloc(length + 1);
-
+
for (p = pOption; p; p = p->next) {
if (p->string) {
int len = strlen(p->string);
+
strncpy(option->string + offset, p->string, len);
offset += len;
- if (p->next) option->string[offset++] = ' ';
+ if (p->next)
+ option->string[offset++] = ' ';
}
}
option->string[offset] = '\0';
- option->start = pStart;
+ option->start = pStart;
option->option = pOption;
- option->end = pEnd;
+ option->end = pEnd;
return option;
}
-void dmxConfigFreeOption(DMXConfigOptionPtr p)
+void
+dmxConfigFreeOption(DMXConfigOptionPtr p)
{
- if (!p) return;
+ if (!p)
+ return;
free(p->string);
dmxConfigFreeToken(p->start);
dmxConfigFreeString(p->option);
@@ -377,8 +409,8 @@ void dmxConfigFreeOption(DMXConfigOptionPtr p)
dmxConfigFree(p);
}
-const char **dmxConfigLookupParam(DMXConfigParamPtr p, const char *key,
- int *argc)
+const char **
+dmxConfigLookupParam(DMXConfigParamPtr p, const char *key, int *argc)
{
DMXConfigParamPtr pt;
@@ -388,17 +420,17 @@ const char **dmxConfigLookupParam(DMXConfigParamPtr p, const char *key,
return pt->argv;
}
}
- *argc = 0;
+ *argc = 0;
return NULL;
}
-DMXConfigParamPtr dmxConfigCreateParam(DMXConfigTokenPtr pStart,
- DMXConfigTokenPtr pOpen,
- DMXConfigStringPtr pParam,
- DMXConfigTokenPtr pClose,
- DMXConfigTokenPtr pEnd)
+DMXConfigParamPtr
+dmxConfigCreateParam(DMXConfigTokenPtr pStart,
+ DMXConfigTokenPtr pOpen,
+ DMXConfigStringPtr pParam,
+ DMXConfigTokenPtr pClose, DMXConfigTokenPtr pEnd)
{
- DMXConfigParamPtr param = dmxConfigAlloc(sizeof(*param));
+ DMXConfigParamPtr param = dmxConfigAlloc(sizeof(*param));
DMXConfigStringPtr pt;
param->argc = 0;
@@ -406,27 +438,30 @@ DMXConfigParamPtr dmxConfigCreateParam(DMXConfigTokenPtr pStart,
for (pt = pParam; pt; pt = pt->next) {
if (pt->string) {
param->argv = realloc(param->argv,
- (param->argc+2) * sizeof(*param->argv));
+ (param->argc + 2) * sizeof(*param->argv));
param->argv[param->argc] = pt->string;
++param->argc;
}
}
- if (param->argv) param->argv[param->argc] = NULL;
+ if (param->argv)
+ param->argv[param->argc] = NULL;
param->start = pStart;
- param->open = pOpen;
+ param->open = pOpen;
param->param = pParam;
param->close = pClose;
- param->end = pEnd;
+ param->end = pEnd;
return param;
}
-void dmxConfigFreeParam(DMXConfigParamPtr p)
+void
+dmxConfigFreeParam(DMXConfigParamPtr p)
{
DMXConfigParamPtr next;
- if (!p) return;
+ if (!p)
+ return;
do {
next = p->next;
dmxConfigFreeToken(p->start);
@@ -439,37 +474,61 @@ void dmxConfigFreeParam(DMXConfigParamPtr p)
} while ((p = next));
}
-DMXConfigSubPtr dmxConfigCreateSub(DMXConfigType type,
- DMXConfigCommentPtr comment,
- DMXConfigDisplayPtr display,
- DMXConfigWallPtr wall,
- DMXConfigOptionPtr option,
- DMXConfigParamPtr param)
+DMXConfigSubPtr
+dmxConfigCreateSub(DMXConfigType type,
+ DMXConfigCommentPtr comment,
+ DMXConfigDisplayPtr display,
+ DMXConfigWallPtr wall,
+ DMXConfigOptionPtr option, DMXConfigParamPtr param)
{
DMXConfigSubPtr pSub = dmxConfigAlloc(sizeof(*pSub));
+
pSub->type = type;
switch (type) {
- case dmxConfigComment: pSub->comment = comment; break;
- case dmxConfigDisplay: pSub->display = display; break;
- case dmxConfigWall: pSub->wall = wall; break;
- case dmxConfigOption: pSub->option = option; break;
- case dmxConfigParam: pSub->param = param; break;
- default: dmxConfigLog("Type %d not supported in subentry\n", type); break;
+ case dmxConfigComment:
+ pSub->comment = comment;
+ break;
+ case dmxConfigDisplay:
+ pSub->display = display;
+ break;
+ case dmxConfigWall:
+ pSub->wall = wall;
+ break;
+ case dmxConfigOption:
+ pSub->option = option;
+ break;
+ case dmxConfigParam:
+ pSub->param = param;
+ break;
+ default:
+ dmxConfigLog("Type %d not supported in subentry\n", type);
+ break;
}
return pSub;
}
-void dmxConfigFreeSub(DMXConfigSubPtr sub)
+void
+dmxConfigFreeSub(DMXConfigSubPtr sub)
{
DMXConfigSubPtr pt;
for (pt = sub; pt; pt = pt->next) {
switch (pt->type) {
- case dmxConfigComment: dmxConfigFreeComment(pt->comment); break;
- case dmxConfigDisplay: dmxConfigFreeDisplay(pt->display); break;
- case dmxConfigWall: dmxConfigFreeWall(pt->wall); break;
- case dmxConfigOption: dmxConfigFreeOption(pt->option); break;
- case dmxConfigParam: dmxConfigFreeParam(pt->param); break;
+ case dmxConfigComment:
+ dmxConfigFreeComment(pt->comment);
+ break;
+ case dmxConfigDisplay:
+ dmxConfigFreeDisplay(pt->display);
+ break;
+ case dmxConfigWall:
+ dmxConfigFreeWall(pt->wall);
+ break;
+ case dmxConfigOption:
+ dmxConfigFreeOption(pt->option);
+ break;
+ case dmxConfigParam:
+ dmxConfigFreeParam(pt->param);
+ break;
default:
dmxConfigLog("Type %d not supported in subentry\n", pt->type);
break;
@@ -478,68 +537,75 @@ void dmxConfigFreeSub(DMXConfigSubPtr sub)
dmxConfigFree(sub);
}
-DMXConfigSubPtr dmxConfigSubComment(DMXConfigCommentPtr comment)
+DMXConfigSubPtr
+dmxConfigSubComment(DMXConfigCommentPtr comment)
{
return dmxConfigCreateSub(dmxConfigComment, comment, NULL, NULL, NULL,
NULL);
}
-DMXConfigSubPtr dmxConfigSubDisplay(DMXConfigDisplayPtr display)
+DMXConfigSubPtr
+dmxConfigSubDisplay(DMXConfigDisplayPtr display)
{
return dmxConfigCreateSub(dmxConfigDisplay, NULL, display, NULL, NULL,
NULL);
}
-DMXConfigSubPtr dmxConfigSubWall(DMXConfigWallPtr wall)
+DMXConfigSubPtr
+dmxConfigSubWall(DMXConfigWallPtr wall)
{
return dmxConfigCreateSub(dmxConfigWall, NULL, NULL, wall, NULL, NULL);
}
-DMXConfigSubPtr dmxConfigSubOption(DMXConfigOptionPtr option)
+DMXConfigSubPtr
+dmxConfigSubOption(DMXConfigOptionPtr option)
{
return dmxConfigCreateSub(dmxConfigOption, NULL, NULL, NULL, option, NULL);
}
-DMXConfigSubPtr dmxConfigSubParam(DMXConfigParamPtr param)
+DMXConfigSubPtr
+dmxConfigSubParam(DMXConfigParamPtr param)
{
return dmxConfigCreateSub(dmxConfigParam, NULL, NULL, NULL, NULL, param);
}
-extern DMXConfigSubPtr dmxConfigAddSub(DMXConfigSubPtr head,
- DMXConfigSubPtr sub)
+extern DMXConfigSubPtr
+dmxConfigAddSub(DMXConfigSubPtr head, DMXConfigSubPtr sub)
{
DMXConfigSubPtr pt;
-
- if (!head) return sub;
+
+ if (!head)
+ return sub;
for (pt = head; pt->next; pt = pt->next);
pt->next = sub;
return head;
}
-DMXConfigVirtualPtr dmxConfigCreateVirtual(DMXConfigTokenPtr pStart,
- DMXConfigStringPtr pName,
- DMXConfigPairPtr pDim,
- DMXConfigTokenPtr pOpen,
- DMXConfigSubPtr pSubentry,
- DMXConfigTokenPtr pClose)
+DMXConfigVirtualPtr
+dmxConfigCreateVirtual(DMXConfigTokenPtr pStart,
+ DMXConfigStringPtr pName,
+ DMXConfigPairPtr pDim,
+ DMXConfigTokenPtr pOpen,
+ DMXConfigSubPtr pSubentry, DMXConfigTokenPtr pClose)
{
DMXConfigVirtualPtr pVirtual = dmxConfigAlloc(sizeof(*pVirtual));
- pVirtual->start = pStart;
- pVirtual->vname = pName;
- pVirtual->dim = pDim;
- pVirtual->open = pOpen;
+ pVirtual->start = pStart;
+ pVirtual->vname = pName;
+ pVirtual->dim = pDim;
+ pVirtual->open = pOpen;
pVirtual->subentry = pSubentry;
- pVirtual->close = pClose;
+ pVirtual->close = pClose;
+
+ pVirtual->name = pName ? pName->string : NULL;
+ pVirtual->width = pDim ? pDim->x : 0;
+ pVirtual->height = pDim ? pDim->y : 0;
- pVirtual->name = pName ? pName->string : NULL;
- pVirtual->width = pDim ? pDim->x : 0;
- pVirtual->height = pDim ? pDim->y : 0;
-
return pVirtual;
}
-void dmxConfigFreeVirtual(DMXConfigVirtualPtr virtual)
+void
+dmxConfigFreeVirtual(DMXConfigVirtualPtr virtual)
{
dmxConfigFreeToken(virtual->start);
dmxConfigFreeString(virtual->vname);
@@ -550,28 +616,40 @@ void dmxConfigFreeVirtual(DMXConfigVirtualPtr virtual)
dmxConfigFree(virtual);
}
-DMXConfigEntryPtr dmxConfigCreateEntry(DMXConfigType type,
- DMXConfigCommentPtr comment,
- DMXConfigVirtualPtr virtual)
+DMXConfigEntryPtr
+dmxConfigCreateEntry(DMXConfigType type,
+ DMXConfigCommentPtr comment, DMXConfigVirtualPtr virtual)
{
DMXConfigEntryPtr pEntry = dmxConfigAlloc(sizeof(*pEntry));
+
pEntry->type = type;
switch (type) {
- case dmxConfigComment: pEntry->comment = comment; break;
- case dmxConfigVirtual: pEntry->virtual = virtual; break;
- default: dmxConfigLog("Type %d not supported in entry\n", type); break;
+ case dmxConfigComment:
+ pEntry->comment = comment;
+ break;
+ case dmxConfigVirtual:
+ pEntry->virtual = virtual;
+ break;
+ default:
+ dmxConfigLog("Type %d not supported in entry\n", type);
+ break;
}
return pEntry;
}
-void dmxConfigFreeEntry(DMXConfigEntryPtr entry)
+void
+dmxConfigFreeEntry(DMXConfigEntryPtr entry)
{
DMXConfigEntryPtr pt;
for (pt = entry; pt; pt = pt->next) {
switch (pt->type) {
- case dmxConfigComment: dmxConfigFreeComment(pt->comment); break;
- case dmxConfigVirtual: dmxConfigFreeVirtual(pt->virtual); break;
+ case dmxConfigComment:
+ dmxConfigFreeComment(pt->comment);
+ break;
+ case dmxConfigVirtual:
+ dmxConfigFreeVirtual(pt->virtual);
+ break;
default:
dmxConfigLog("Type %d not supported in entry\n", pt->type);
break;
@@ -580,15 +658,16 @@ void dmxConfigFreeEntry(DMXConfigEntryPtr entry)
dmxConfigFree(entry);
}
-DMXConfigEntryPtr dmxConfigAddEntry(DMXConfigEntryPtr head,
- DMXConfigType type,
- DMXConfigCommentPtr comment,
- DMXConfigVirtualPtr virtual)
+DMXConfigEntryPtr
+dmxConfigAddEntry(DMXConfigEntryPtr head,
+ DMXConfigType type,
+ DMXConfigCommentPtr comment, DMXConfigVirtualPtr virtual)
{
DMXConfigEntryPtr child = dmxConfigCreateEntry(type, comment, virtual);
DMXConfigEntryPtr pt;
- if (!head) return child;
+ if (!head)
+ return child;
for (pt = head; pt->next; pt = pt->next);
pt->next = child;
@@ -596,12 +675,14 @@ DMXConfigEntryPtr dmxConfigAddEntry(DMXConfigEntryPtr head,
return head;
}
-DMXConfigEntryPtr dmxConfigEntryComment(DMXConfigCommentPtr comment)
+DMXConfigEntryPtr
+dmxConfigEntryComment(DMXConfigCommentPtr comment)
{
return dmxConfigCreateEntry(dmxConfigComment, comment, NULL);
}
-DMXConfigEntryPtr dmxConfigEntryVirtual(DMXConfigVirtualPtr virtual)
+DMXConfigEntryPtr
+dmxConfigEntryVirtual(DMXConfigVirtualPtr virtual)
{
return dmxConfigCreateEntry(dmxConfigVirtual, NULL, virtual);
}
diff --git a/hw/dmx/config/dmxparse.h b/hw/dmx/config/dmxparse.h
index de81d23b7..7d31b6309 100644
--- a/hw/dmx/config/dmxparse.h
+++ b/hw/dmx/config/dmxparse.h
@@ -41,44 +41,44 @@
/** Stores tokens not stored in other structures (e.g., keywords and ;) */
typedef struct _DMXConfigToken {
- int token;
- int line;
- const char *comment;
+ int token;
+ int line;
+ const char *comment;
} DMXConfigToken, *DMXConfigTokenPtr;
/** Stores parsed strings. */
typedef struct _DMXConfigString {
- int token;
- int line;
- const char *comment;
- const char *string;
- struct _DMXConfigString *next;
+ int token;
+ int line;
+ const char *comment;
+ const char *string;
+ struct _DMXConfigString *next;
} DMXConfigString, *DMXConfigStringPtr;
/** Stores parsed numbers. */
typedef struct _DMXConfigNumber {
- int token;
- int line;
- const char *comment;
- int number;
+ int token;
+ int line;
+ const char *comment;
+ int number;
} DMXConfigNumber, *DMXConfigNumberPtr;
/** Stores parsed pairs (e.g., x y) */
typedef struct _DMXConfigPair {
- int token;
- int line;
- const char *comment;
- int x;
- int y;
- int xsign;
- int ysign;
+ int token;
+ int line;
+ const char *comment;
+ int x;
+ int y;
+ int xsign;
+ int ysign;
} DMXConfigPair, *DMXConfigPairPtr;
/** Stores parsed comments not stored with a token. */
typedef struct _DMXConfigComment {
- int token;
- int line;
- const char *comment;
+ int token;
+ int line;
+ const char *comment;
} DMXConfigComment, *DMXConfigCommentPtr;
typedef enum {
@@ -92,206 +92,201 @@ typedef enum {
/** Stores a geometry specification. */
typedef struct _DMXConfigPartDim {
- DMXConfigPairPtr dim;
- DMXConfigPairPtr offset;
+ DMXConfigPairPtr dim;
+ DMXConfigPairPtr offset;
} DMXConfigPartDim, *DMXConfigPartDimPtr;
/** Stores a pair of geometry specifications. */
typedef struct _DMXConfigFullDim {
- DMXConfigPartDimPtr scrn;
- DMXConfigPartDimPtr root;
+ DMXConfigPartDimPtr scrn;
+ DMXConfigPartDimPtr root;
} DMXConfigFullDim, *DMXConfigFullDimPtr;
/** Stores parsed display information. */
typedef struct _DMXConfigDisplay {
- /* Summary information */
- const char *name;
- /* Screen Window Geometry */
- int scrnWidth, scrnHeight;
- int scrnX, scrnY;
- int scrnXSign, scrnYSign;
- /* Root Window Geometry */
- int rootWidth, rootHeight;
- int rootX, rootY;
- int rootXSign, rootYSign;
- /* Origin in global space */
- int rootXOrigin, rootYOrigin;
-
- /* Raw configuration information */
- DMXConfigTokenPtr start;
- DMXConfigStringPtr dname;
- DMXConfigFullDimPtr dim;
- DMXConfigPairPtr origin;
- DMXConfigTokenPtr end;
+ /* Summary information */
+ const char *name;
+ /* Screen Window Geometry */
+ int scrnWidth, scrnHeight;
+ int scrnX, scrnY;
+ int scrnXSign, scrnYSign;
+ /* Root Window Geometry */
+ int rootWidth, rootHeight;
+ int rootX, rootY;
+ int rootXSign, rootYSign;
+ /* Origin in global space */
+ int rootXOrigin, rootYOrigin;
+
+ /* Raw configuration information */
+ DMXConfigTokenPtr start;
+ DMXConfigStringPtr dname;
+ DMXConfigFullDimPtr dim;
+ DMXConfigPairPtr origin;
+ DMXConfigTokenPtr end;
} DMXConfigDisplay, *DMXConfigDisplayPtr;
/** Stores parsed wall information. */
typedef struct _DMXConfigWall {
- /* Summary information */
- int width, height; /* dimensions of displays */
- int xwall, ywall; /* dimensions of wall, in tiles */
+ /* Summary information */
+ int width, height; /* dimensions of displays */
+ int xwall, ywall; /* dimensions of wall, in tiles */
-
- /* Raw configuration informaiton */
- DMXConfigTokenPtr start;
- DMXConfigPairPtr wallDim;
- DMXConfigPairPtr displayDim;
- DMXConfigStringPtr nameList;
- DMXConfigTokenPtr end;
+ /* Raw configuration informaiton */
+ DMXConfigTokenPtr start;
+ DMXConfigPairPtr wallDim;
+ DMXConfigPairPtr displayDim;
+ DMXConfigStringPtr nameList;
+ DMXConfigTokenPtr end;
} DMXConfigWall, *DMXConfigWallPtr;
/** Stores parsed option information. */
typedef struct _DMXConfigOption {
- /* Summary information */
- char *string;
-
- /* Raw configuration informaiton */
- DMXConfigTokenPtr start;
- DMXConfigStringPtr option;
- DMXConfigTokenPtr end;
+ /* Summary information */
+ char *string;
+
+ /* Raw configuration informaiton */
+ DMXConfigTokenPtr start;
+ DMXConfigStringPtr option;
+ DMXConfigTokenPtr end;
} DMXConfigOption, *DMXConfigOptionPtr;
/** Stores parsed param information. */
typedef struct _DMXConfigParam {
- int argc;
- const char **argv;
-
- DMXConfigTokenPtr start;
- DMXConfigTokenPtr open;
- DMXConfigStringPtr param;
- DMXConfigTokenPtr close;
- DMXConfigTokenPtr end; /* Either open/close OR end */
- struct _DMXConfigParam *next;
+ int argc;
+ const char **argv;
+
+ DMXConfigTokenPtr start;
+ DMXConfigTokenPtr open;
+ DMXConfigStringPtr param;
+ DMXConfigTokenPtr close;
+ DMXConfigTokenPtr end; /* Either open/close OR end */
+ struct _DMXConfigParam *next;
} DMXConfigParam, *DMXConfigParamPtr;
/** Stores options under an entry (subentry). */
typedef struct _DMXConfigSub {
- DMXConfigType type;
- DMXConfigCommentPtr comment;
- DMXConfigDisplayPtr display;
- DMXConfigWallPtr wall;
- DMXConfigOptionPtr option;
- DMXConfigParamPtr param;
- struct _DMXConfigSub *next;
+ DMXConfigType type;
+ DMXConfigCommentPtr comment;
+ DMXConfigDisplayPtr display;
+ DMXConfigWallPtr wall;
+ DMXConfigOptionPtr option;
+ DMXConfigParamPtr param;
+ struct _DMXConfigSub *next;
} DMXConfigSub, *DMXConfigSubPtr;
/** Stores parsed virtual information. */
typedef struct _DMXConfigVirtual {
- /* Summary information */
- const char *name;
- int width, height;
+ /* Summary information */
+ const char *name;
+ int width, height;
- /* Raw configuration information */
- DMXConfigTokenPtr start;
- DMXConfigStringPtr vname;
- DMXConfigPairPtr dim;
- DMXConfigTokenPtr open;
- DMXConfigSubPtr subentry;
- DMXConfigTokenPtr close;
+ /* Raw configuration information */
+ DMXConfigTokenPtr start;
+ DMXConfigStringPtr vname;
+ DMXConfigPairPtr dim;
+ DMXConfigTokenPtr open;
+ DMXConfigSubPtr subentry;
+ DMXConfigTokenPtr close;
} DMXConfigVirtual, *DMXConfigVirtualPtr;
/** Heads entry storage. */
typedef struct _DMXConfigEntry {
- DMXConfigType type;
- DMXConfigCommentPtr comment;
- DMXConfigVirtualPtr virtual;
- struct _DMXConfigEntry *next;
+ DMXConfigType type;
+ DMXConfigCommentPtr comment;
+ DMXConfigVirtualPtr virtual;
+ struct _DMXConfigEntry *next;
} DMXConfigEntry, *DMXConfigEntryPtr;
-extern DMXConfigEntryPtr dmxConfigEntry;
+extern DMXConfigEntryPtr dmxConfigEntry;
-extern int yylex(void);
-extern int yydebug;
-extern void yyerror(const char *message);
+extern int yylex(void);
+extern int yydebug;
+extern void yyerror(const char *message);
-extern void dmxConfigLog(const char *format, ...);
-extern void *dmxConfigAlloc(unsigned long bytes);
-extern void *dmxConfigRealloc(void *orig,
- unsigned long orig_bytes,
- unsigned long bytes);
-extern const char *dmxConfigCopyString(const char *string,
- int length);
-extern void dmxConfigFree(void *area);
-extern DMXConfigTokenPtr dmxConfigCreateToken(int token, int line,
- const char *comment);
-extern void dmxConfigFreeToken(DMXConfigTokenPtr p);
-extern DMXConfigStringPtr dmxConfigCreateString(int token, int line,
- const char *comment,
- const char *string);
-extern void dmxConfigFreeString(DMXConfigStringPtr p);
-extern DMXConfigNumberPtr dmxConfigCreateNumber(int token, int line,
- const char *comment,
- int number);
-extern void dmxConfigFreeNumber(DMXConfigNumberPtr p);
-extern DMXConfigPairPtr dmxConfigCreatePair(int token, int line,
- const char *comment,
- int x, int y,
- int xsign, int ysign);
-extern void dmxConfigFreePair(DMXConfigPairPtr p);
+extern void dmxConfigLog(const char *format, ...);
+extern void *dmxConfigAlloc(unsigned long bytes);
+extern void *dmxConfigRealloc(void *orig,
+ unsigned long orig_bytes, unsigned long bytes);
+extern const char *dmxConfigCopyString(const char *string, int length);
+extern void dmxConfigFree(void *area);
+extern DMXConfigTokenPtr dmxConfigCreateToken(int token, int line,
+ const char *comment);
+extern void dmxConfigFreeToken(DMXConfigTokenPtr p);
+extern DMXConfigStringPtr dmxConfigCreateString(int token, int line,
+ const char *comment,
+ const char *string);
+extern void dmxConfigFreeString(DMXConfigStringPtr p);
+extern DMXConfigNumberPtr dmxConfigCreateNumber(int token, int line,
+ const char *comment,
+ int number);
+extern void dmxConfigFreeNumber(DMXConfigNumberPtr p);
+extern DMXConfigPairPtr dmxConfigCreatePair(int token, int line,
+ const char *comment,
+ int x, int y, int xsign, int ysign);
+extern void dmxConfigFreePair(DMXConfigPairPtr p);
extern DMXConfigCommentPtr dmxConfigCreateComment(int token, int line,
const char *comment);
-extern void dmxConfigFreeComment(DMXConfigCommentPtr p);
+extern void dmxConfigFreeComment(DMXConfigCommentPtr p);
extern DMXConfigPartDimPtr dmxConfigCreatePartDim(DMXConfigPairPtr pDim,
DMXConfigPairPtr pOffset);
-extern void dmxConfigFreePartDim(DMXConfigPartDimPtr p);
+extern void dmxConfigFreePartDim(DMXConfigPartDimPtr p);
extern DMXConfigFullDimPtr dmxConfigCreateFullDim(DMXConfigPartDimPtr pScrn,
DMXConfigPartDimPtr pRoot);
-extern void dmxConfigFreeFullDim(DMXConfigFullDimPtr p);
+extern void dmxConfigFreeFullDim(DMXConfigFullDimPtr p);
extern DMXConfigDisplayPtr dmxConfigCreateDisplay(DMXConfigTokenPtr pStart,
DMXConfigStringPtr pName,
DMXConfigFullDimPtr pDim,
DMXConfigPairPtr pOrigin,
DMXConfigTokenPtr pEnd);
-extern void dmxConfigFreeDisplay(DMXConfigDisplayPtr p);
-extern DMXConfigWallPtr dmxConfigCreateWall(DMXConfigTokenPtr pStart,
- DMXConfigPairPtr pWallDim,
- DMXConfigPairPtr pDisplayDim,
- DMXConfigStringPtr pNameList,
- DMXConfigTokenPtr pEnd);
-extern void dmxConfigFreeWall(DMXConfigWallPtr p);
-extern DMXConfigOptionPtr dmxConfigCreateOption(DMXConfigTokenPtr pStart,
- DMXConfigStringPtr pOption,
- DMXConfigTokenPtr pEnd);
-extern void dmxConfigFreeOption(DMXConfigOptionPtr p);
-extern DMXConfigParamPtr dmxConfigCreateParam(DMXConfigTokenPtr pStart,
- DMXConfigTokenPtr pOpen,
- DMXConfigStringPtr pParam,
- DMXConfigTokenPtr pClose,
+extern void dmxConfigFreeDisplay(DMXConfigDisplayPtr p);
+extern DMXConfigWallPtr dmxConfigCreateWall(DMXConfigTokenPtr pStart,
+ DMXConfigPairPtr pWallDim,
+ DMXConfigPairPtr pDisplayDim,
+ DMXConfigStringPtr pNameList,
+ DMXConfigTokenPtr pEnd);
+extern void dmxConfigFreeWall(DMXConfigWallPtr p);
+extern DMXConfigOptionPtr dmxConfigCreateOption(DMXConfigTokenPtr pStart,
+ DMXConfigStringPtr pOption,
DMXConfigTokenPtr pEnd);
-extern void dmxConfigFreeParam(DMXConfigParamPtr p);
-extern const char **dmxConfigLookupParam(DMXConfigParamPtr p,
- const char *key,
- int *argc);
-extern DMXConfigSubPtr dmxConfigCreateSub(DMXConfigType type,
- DMXConfigCommentPtr comment,
- DMXConfigDisplayPtr display,
- DMXConfigWallPtr wall,
- DMXConfigOptionPtr option,
- DMXConfigParamPtr param);
-extern void dmxConfigFreeSub(DMXConfigSubPtr sub);
-extern DMXConfigSubPtr dmxConfigSubComment(DMXConfigCommentPtr comment);
-extern DMXConfigSubPtr dmxConfigSubDisplay(DMXConfigDisplayPtr display);
-extern DMXConfigSubPtr dmxConfigSubWall(DMXConfigWallPtr wall);
-extern DMXConfigSubPtr dmxConfigSubOption(DMXConfigOptionPtr option);
-extern DMXConfigSubPtr dmxConfigSubParam(DMXConfigParamPtr param);
-extern DMXConfigSubPtr dmxConfigAddSub(DMXConfigSubPtr head,
- DMXConfigSubPtr sub);
+extern void dmxConfigFreeOption(DMXConfigOptionPtr p);
+extern DMXConfigParamPtr dmxConfigCreateParam(DMXConfigTokenPtr pStart,
+ DMXConfigTokenPtr pOpen,
+ DMXConfigStringPtr pParam,
+ DMXConfigTokenPtr pClose,
+ DMXConfigTokenPtr pEnd);
+extern void dmxConfigFreeParam(DMXConfigParamPtr p);
+extern const char **dmxConfigLookupParam(DMXConfigParamPtr p,
+ const char *key, int *argc);
+extern DMXConfigSubPtr dmxConfigCreateSub(DMXConfigType type,
+ DMXConfigCommentPtr comment,
+ DMXConfigDisplayPtr display,
+ DMXConfigWallPtr wall,
+ DMXConfigOptionPtr option,
+ DMXConfigParamPtr param);
+extern void dmxConfigFreeSub(DMXConfigSubPtr sub);
+extern DMXConfigSubPtr dmxConfigSubComment(DMXConfigCommentPtr comment);
+extern DMXConfigSubPtr dmxConfigSubDisplay(DMXConfigDisplayPtr display);
+extern DMXConfigSubPtr dmxConfigSubWall(DMXConfigWallPtr wall);
+extern DMXConfigSubPtr dmxConfigSubOption(DMXConfigOptionPtr option);
+extern DMXConfigSubPtr dmxConfigSubParam(DMXConfigParamPtr param);
+extern DMXConfigSubPtr dmxConfigAddSub(DMXConfigSubPtr head,
+ DMXConfigSubPtr sub);
extern DMXConfigVirtualPtr dmxConfigCreateVirtual(DMXConfigTokenPtr pStart,
DMXConfigStringPtr pName,
DMXConfigPairPtr pDim,
DMXConfigTokenPtr pOpen,
DMXConfigSubPtr pSubentry,
DMXConfigTokenPtr pClose);
-extern void dmxConfigFreeVirtual(DMXConfigVirtualPtr virtual);
-extern DMXConfigEntryPtr dmxConfigCreateEntry(DMXConfigType type,
- DMXConfigCommentPtr comment,
- DMXConfigVirtualPtr virtual);
-extern void dmxConfigFreeEntry(DMXConfigEntryPtr entry);
-extern DMXConfigEntryPtr dmxConfigAddEntry(DMXConfigEntryPtr head,
- DMXConfigType type,
- DMXConfigCommentPtr comment,
- DMXConfigVirtualPtr virtual);
-extern DMXConfigEntryPtr dmxConfigEntryComment(DMXConfigCommentPtr comment);
-extern DMXConfigEntryPtr dmxConfigEntryVirtual(DMXConfigVirtualPtr virtual);
+extern void dmxConfigFreeVirtual(DMXConfigVirtualPtr virtual);
+extern DMXConfigEntryPtr dmxConfigCreateEntry(DMXConfigType type,
+ DMXConfigCommentPtr comment,
+ DMXConfigVirtualPtr virtual);
+extern void dmxConfigFreeEntry(DMXConfigEntryPtr entry);
+extern DMXConfigEntryPtr dmxConfigAddEntry(DMXConfigEntryPtr head,
+ DMXConfigType type,
+ DMXConfigCommentPtr comment,
+ DMXConfigVirtualPtr virtual);
+extern DMXConfigEntryPtr dmxConfigEntryComment(DMXConfigCommentPtr comment);
+extern DMXConfigEntryPtr dmxConfigEntryVirtual(DMXConfigVirtualPtr virtual);
#endif
diff --git a/hw/dmx/config/dmxprint.c b/hw/dmx/config/dmxprint.c
index 599ebf5df..3145fb56a 100644
--- a/hw/dmx/config/dmxprint.c
+++ b/hw/dmx/config/dmxprint.c
@@ -52,100 +52,126 @@
#include <stdarg.h>
#include <ctype.h>
-static FILE *str = NULL;
-static int indent = 0;
-static int pos = 0;
+static FILE *str = NULL;
+static int indent = 0;
+static int pos = 0;
/** Stack of indentation information used for pretty-printing
* configuration information. */
static struct stack {
- int base;
- int comment;
- int step;
+ int base;
+ int comment;
+ int step;
struct stack *next;
-} *stack, initialStack = { 0, 0, 4, NULL };
+} *stack, initialStack = {
+0, 0, 4, NULL};
-static void dmxConfigIndent(void)
+static void
+dmxConfigIndent(void)
{
int i;
- if (indent < 0) indent = 0;
- if (indent > 40) indent = 40;
- for (i = 0; i < indent; i++) fprintf(str, " ");
+
+ if (indent < 0)
+ indent = 0;
+ if (indent > 40)
+ indent = 40;
+ for (i = 0; i < indent; i++)
+ fprintf(str, " ");
}
-static void dmxConfigNewline(void)
+static void
+dmxConfigNewline(void)
{
- if (pos) fprintf(str, "\n");
+ if (pos)
+ fprintf(str, "\n");
pos = 0;
}
-static void dmxConfigPushState(int base, int comment, int step)
+static void
+dmxConfigPushState(int base, int comment, int step)
{
struct stack *new = dmxConfigAlloc(sizeof(*new));
- new->base = base;
+
+ new->base = base;
new->comment = comment;
- new->step = step;
- new->next = stack;
- stack = new;
- indent = base;
+ new->step = step;
+ new->next = stack;
+ stack = new;
+ indent = base;
dmxConfigNewline();
}
-static void dmxConfigPushComment(void)
+static void
+dmxConfigPushComment(void)
{
- if (stack) indent = stack->comment;
+ if (stack)
+ indent = stack->comment;
}
-static void dmxConfigPushStep(void)
+static void
+dmxConfigPushStep(void)
{
- if (stack) indent = stack->step;
+ if (stack)
+ indent = stack->step;
}
-static void dmxConfigPopState(void)
+static void
+dmxConfigPopState(void)
{
struct stack *old = stack;
- if (!stack) return;
+ if (!stack)
+ return;
indent = old->base;
- stack = old->next;
- if (!stack) dmxConfigLog("Stack underflow\n");
+ stack = old->next;
+ if (!stack)
+ dmxConfigLog("Stack underflow\n");
dmxConfigFree(old);
dmxConfigNewline();
}
-static void dmxConfigOutput(int addSpace, int doNewline, const char *comment,
- const char *format, ...)
+static void
+dmxConfigOutput(int addSpace, int doNewline, const char *comment,
+ const char *format, ...)
{
va_list args;
- if (!pos) dmxConfigIndent();
- else if (addSpace) fprintf(str, " ");
+ if (!pos)
+ dmxConfigIndent();
+ else if (addSpace)
+ fprintf(str, " ");
if (format) {
va_start(args, format);
- /* RATS: This hasn't been audited -- it
- * could probably result in a buffer
- * overflow. */
- pos += vfprintf(str, format, args); /* assumes no newlines! */
+ /* RATS: This hasn't been audited -- it
+ * could probably result in a buffer
+ * overflow. */
+ pos += vfprintf(str, format, args); /* assumes no newlines! */
va_end(args);
}
if (comment) {
- if (pos) fprintf(str, " ");
+ if (pos)
+ fprintf(str, " ");
pos += fprintf(str, "#%s", comment);
dmxConfigNewline();
dmxConfigPushComment();
- } else if (doNewline) dmxConfigNewline();
+ }
+ else if (doNewline)
+ dmxConfigNewline();
}
-static void dmxConfigPrintComment(DMXConfigCommentPtr p)
+static void
+dmxConfigPrintComment(DMXConfigCommentPtr p)
{
dmxConfigOutput(1, 1, p->comment, NULL);
}
-static void dmxConfigPrintTokenFlag(DMXConfigTokenPtr p, int flag)
+static void
+dmxConfigPrintTokenFlag(DMXConfigTokenPtr p, int flag)
{
- if (!p) return;
+ if (!p)
+ return;
switch (p->token) {
case T_VIRTUAL:
dmxConfigPushState(0, 4, 4);
@@ -169,14 +195,16 @@ static void dmxConfigPrintTokenFlag(DMXConfigTokenPtr p, int flag)
break;
case ';':
dmxConfigOutput(0, 1, p->comment, ";");
- if (flag) dmxConfigPopState();
+ if (flag)
+ dmxConfigPopState();
break;
case '{':
dmxConfigOutput(1, 1, p->comment, "{");
dmxConfigPushStep();
break;
case '}':
- if (flag) dmxConfigPopState();
+ if (flag)
+ dmxConfigPopState();
dmxConfigOutput(0, 1, p->comment, "}");
break;
case '/':
@@ -187,49 +215,66 @@ static void dmxConfigPrintTokenFlag(DMXConfigTokenPtr p, int flag)
}
}
-static void dmxConfigPrintToken(DMXConfigTokenPtr p)
+static void
+dmxConfigPrintToken(DMXConfigTokenPtr p)
{
dmxConfigPrintTokenFlag(p, 1);
}
-static void dmxConfigPrintTokenNopop(DMXConfigTokenPtr p)
+static void
+dmxConfigPrintTokenNopop(DMXConfigTokenPtr p)
{
dmxConfigPrintTokenFlag(p, 0);
}
-static int dmxConfigPrintQuotedString(const char *s)
+static int
+dmxConfigPrintQuotedString(const char *s)
{
const char *pt;
- if (!s || !s[0]) return 1; /* Quote empty string */
- for (pt = s; *pt; ++pt) if (isspace(*pt)) return 1;
+ if (!s || !s[0])
+ return 1; /* Quote empty string */
+ for (pt = s; *pt; ++pt)
+ if (isspace(*pt))
+ return 1;
return 0;
}
-static void dmxConfigPrintString(DMXConfigStringPtr p, int quote)
+static void
+dmxConfigPrintString(DMXConfigStringPtr p, int quote)
{
DMXConfigStringPtr pt;
-
- if (!p) return;
+
+ if (!p)
+ return;
for (pt = p; pt; pt = pt->next) {
if (quote && dmxConfigPrintQuotedString(pt->string)) {
dmxConfigOutput(1, 0, pt->comment, "\"%s\"",
pt->string ? pt->string : "");
- } else
+ }
+ else
dmxConfigOutput(1, 0, pt->comment, "%s",
pt->string ? pt->string : "");
}
}
-static int dmxConfigPrintPair(DMXConfigPairPtr p, int addSpace)
+static int
+dmxConfigPrintPair(DMXConfigPairPtr p, int addSpace)
{
const char *format = NULL;
-
- if (!p) return 0;
+
+ if (!p)
+ return 0;
switch (p->token) {
- case T_ORIGIN: format = "@%dx%d"; break;
- case T_DIMENSION: format = "%dx%d"; break;
- case T_OFFSET: format = "%c%d%c%d"; break;
+ case T_ORIGIN:
+ format = "@%dx%d";
+ break;
+ case T_DIMENSION:
+ format = "%dx%d";
+ break;
+ case T_OFFSET:
+ format = "%c%d%c%d";
+ break;
}
if (p->token == T_OFFSET) {
if (!p->comment && !p->x && !p->y && p->xsign >= 0 && p->ysign >= 0)
@@ -237,69 +282,79 @@ static int dmxConfigPrintPair(DMXConfigPairPtr p, int addSpace)
dmxConfigOutput(addSpace, 0, p->comment, format,
p->xsign < 0 ? '-' : '+', p->x,
p->ysign < 0 ? '-' : '+', p->y);
- } else {
- if (!p->comment && !p->x && !p->y) return 0;
+ }
+ else {
+ if (!p->comment && !p->x && !p->y)
+ return 0;
dmxConfigOutput(addSpace, 0, p->comment, format, p->x, p->y);
}
return 1;
}
-static void dmxConfigPrintDisplay(DMXConfigDisplayPtr p)
+static void
+dmxConfigPrintDisplay(DMXConfigDisplayPtr p)
{
- DMXConfigToken dummyStart = { T_DISPLAY, 0, NULL };
- DMXConfigToken dummyEnd = { ';', 0, NULL };
- DMXConfigToken dummySep = { '/', 0, NULL };
- DMXConfigString dummyName = { T_STRING, 0, NULL, NULL, NULL };
- DMXConfigPair dummySDim = { T_DIMENSION, 0, NULL, 0, 0, 0, 0 };
- DMXConfigPair dummySOffset = { T_OFFSET, 0, NULL, 0, 0, 0, 0 };
- DMXConfigPair dummyRDim = { T_DIMENSION, 0, NULL, 0, 0, 0, 0 };
- DMXConfigPair dummyROffset = { T_OFFSET, 0, NULL, 0, 0, 0, 0 };
- DMXConfigPair dummyOrigin = { T_ORIGIN, 0, NULL, 0, 0, 0, 0 };
- int output;
-
- if (p->dname) p->dname->string = p->name;
- else dummyName.string = p->name;
-
+ DMXConfigToken dummyStart = { T_DISPLAY, 0, NULL };
+ DMXConfigToken dummyEnd = { ';', 0, NULL };
+ DMXConfigToken dummySep = { '/', 0, NULL };
+ DMXConfigString dummyName = { T_STRING, 0, NULL, NULL, NULL };
+ DMXConfigPair dummySDim = { T_DIMENSION, 0, NULL, 0, 0, 0, 0 };
+ DMXConfigPair dummySOffset = { T_OFFSET, 0, NULL, 0, 0, 0, 0 };
+ DMXConfigPair dummyRDim = { T_DIMENSION, 0, NULL, 0, 0, 0, 0 };
+ DMXConfigPair dummyROffset = { T_OFFSET, 0, NULL, 0, 0, 0, 0 };
+ DMXConfigPair dummyOrigin = { T_ORIGIN, 0, NULL, 0, 0, 0, 0 };
+ int output;
+
+ if (p->dname)
+ p->dname->string = p->name;
+ else
+ dummyName.string = p->name;
+
if (p->dim && p->dim->scrn && p->dim->scrn->dim) {
- p->dim->scrn->dim->x = p->scrnWidth;
- p->dim->scrn->dim->y = p->scrnHeight;
- } else {
- dummySDim.x = p->scrnWidth;
- dummySDim.y = p->scrnHeight;
+ p->dim->scrn->dim->x = p->scrnWidth;
+ p->dim->scrn->dim->y = p->scrnHeight;
+ }
+ else {
+ dummySDim.x = p->scrnWidth;
+ dummySDim.y = p->scrnHeight;
}
if (p->dim && p->dim->scrn && p->dim->scrn->offset) {
p->dim->scrn->offset->x = p->scrnX;
p->dim->scrn->offset->y = p->scrnY;
- } else {
- dummySOffset.x = p->scrnX;
- dummySOffset.y = p->scrnY;
}
-
+ else {
+ dummySOffset.x = p->scrnX;
+ dummySOffset.y = p->scrnY;
+ }
+
if (p->dim && p->dim->root && p->dim->root->dim) {
- p->dim->root->dim->x = p->rootWidth;
- p->dim->root->dim->y = p->rootHeight;
- } else {
- dummyRDim.x = p->rootWidth;
- dummyRDim.y = p->rootHeight;
+ p->dim->root->dim->x = p->rootWidth;
+ p->dim->root->dim->y = p->rootHeight;
+ }
+ else {
+ dummyRDim.x = p->rootWidth;
+ dummyRDim.y = p->rootHeight;
}
if (p->dim && p->dim->root && p->dim->root->offset) {
p->dim->root->offset->x = p->rootX;
p->dim->root->offset->y = p->rootY;
- } else {
- dummyROffset.x = p->rootX;
- dummyROffset.y = p->rootY;
+ }
+ else {
+ dummyROffset.x = p->rootX;
+ dummyROffset.y = p->rootY;
}
if (p->origin) {
- p->origin->x = p->rootXOrigin, p->origin->y = p->rootYOrigin;
- p->origin->xsign = p->rootXSign, p->origin->ysign = p->rootYSign;
- } else {
- dummyOrigin.x = p->rootXOrigin, dummyOrigin.y = p->rootYOrigin;
- dummyOrigin.xsign = p->rootXSign, dummyOrigin.ysign = p->rootYSign;
+ p->origin->x = p->rootXOrigin, p->origin->y = p->rootYOrigin;
+ p->origin->xsign = p->rootXSign, p->origin->ysign = p->rootYSign;
+ }
+ else {
+ dummyOrigin.x = p->rootXOrigin, dummyOrigin.y = p->rootYOrigin;
+ dummyOrigin.xsign = p->rootXSign, dummyOrigin.ysign = p->rootYSign;
}
-
+
dmxConfigPrintToken(p->start ? p->start : &dummyStart);
dmxConfigPrintString(p->dname ? p->dname : &dummyName, 1);
@@ -313,9 +368,7 @@ static void dmxConfigPrintDisplay(DMXConfigDisplayPtr p)
dmxConfigPrintPair(&dummySOffset, !output);
if (p->scrnWidth != p->rootWidth
- || p->scrnHeight != p->rootHeight
- || p->rootX
- || p->rootY) {
+ || p->scrnHeight != p->rootHeight || p->rootX || p->rootY) {
dmxConfigPrintToken(&dummySep);
if (p->dim && p->dim->root && p->dim->root->dim)
output = dmxConfigPrintPair(p->dim->root->dim, 1);
@@ -331,7 +384,8 @@ static void dmxConfigPrintDisplay(DMXConfigDisplayPtr p)
dmxConfigPrintToken(p->end ? p->end : &dummyEnd);
}
-static void dmxConfigPrintWall(DMXConfigWallPtr p)
+static void
+dmxConfigPrintWall(DMXConfigWallPtr p)
{
dmxConfigPrintToken(p->start);
dmxConfigPrintPair(p->wallDim, 1);
@@ -340,11 +394,12 @@ static void dmxConfigPrintWall(DMXConfigWallPtr p)
dmxConfigPrintToken(p->end);
}
-static void dmxConfigPrintOption(DMXConfigOptionPtr p)
+static void
+dmxConfigPrintOption(DMXConfigOptionPtr p)
{
- DMXConfigToken dummyStart = { T_OPTION, 0, NULL };
+ DMXConfigToken dummyStart = { T_OPTION, 0, NULL };
DMXConfigString dummyOption = { T_STRING, 0, NULL, NULL, NULL };
- DMXConfigToken dummyEnd = { ';', 0, NULL };
+ DMXConfigToken dummyEnd = { ';', 0, NULL };
dummyOption.string = p->string;
@@ -353,41 +408,59 @@ static void dmxConfigPrintOption(DMXConfigOptionPtr p)
dmxConfigPrintToken(p->end ? p->end : &dummyEnd);
}
-static void dmxConfigPrintParam(DMXConfigParamPtr p)
+static void
+dmxConfigPrintParam(DMXConfigParamPtr p)
{
- if (!p) return;
+ if (!p)
+ return;
if (p->start) {
if (p->open && p->close) {
dmxConfigPrintToken(p->start);
dmxConfigPrintToken(p->open);
dmxConfigPrintParam(p->next);
dmxConfigPrintToken(p->close);
- } else if (p->end && p->param) {
+ }
+ else if (p->end && p->param) {
dmxConfigPrintToken(p->start);
dmxConfigPrintString(p->param, 1);
dmxConfigPrintToken(p->end);
- } else
+ }
+ else
dmxConfigLog("dmxConfigPrintParam: cannot handle format (a)\n");
- } else if (p->end && p->param) {
+ }
+ else if (p->end && p->param) {
dmxConfigPrintString(p->param, 1);
dmxConfigPrintTokenNopop(p->end);
dmxConfigPrintParam(p->next);
- } else
+ }
+ else
dmxConfigLog("dmxConfigPrintParam: cannot handle format (b)\n");
}
-static void dmxConfigPrintSub(DMXConfigSubPtr p)
+static void
+dmxConfigPrintSub(DMXConfigSubPtr p)
{
DMXConfigSubPtr pt;
- if (!p) return;
+ if (!p)
+ return;
for (pt = p; pt; pt = pt->next) {
switch (pt->type) {
- case dmxConfigComment: dmxConfigPrintComment(pt->comment); break;
- case dmxConfigDisplay: dmxConfigPrintDisplay(pt->display); break;
- case dmxConfigWall: dmxConfigPrintWall(pt->wall); break;
- case dmxConfigOption: dmxConfigPrintOption(pt->option); break;
- case dmxConfigParam: dmxConfigPrintParam(pt->param); break;
+ case dmxConfigComment:
+ dmxConfigPrintComment(pt->comment);
+ break;
+ case dmxConfigDisplay:
+ dmxConfigPrintDisplay(pt->display);
+ break;
+ case dmxConfigWall:
+ dmxConfigPrintWall(pt->wall);
+ break;
+ case dmxConfigOption:
+ dmxConfigPrintOption(pt->option);
+ break;
+ case dmxConfigParam:
+ dmxConfigPrintParam(pt->param);
+ break;
default:
dmxConfigLog("dmxConfigPrintSub:"
" cannot handle type %d in subentry\n", pt->type);
@@ -395,20 +468,24 @@ static void dmxConfigPrintSub(DMXConfigSubPtr p)
}
}
-static void dmxConfigPrintVirtual(DMXConfigVirtualPtr p)
+static void
+dmxConfigPrintVirtual(DMXConfigVirtualPtr p)
{
- DMXConfigToken dummyStart = { T_VIRTUAL, 0, NULL };
- DMXConfigToken dummyOpen = { '{', 0, NULL };
- DMXConfigToken dummyClose = { '}', 0, NULL };
- DMXConfigString dummyName = { T_STRING, 0, NULL, NULL, NULL };
- DMXConfigPair dummyDim = { T_DIMENSION, 0, NULL, 0, 0 };
-
- if (p->vname) p->vname->string = p->name;
- else dummyName.string = p->name;
+ DMXConfigToken dummyStart = { T_VIRTUAL, 0, NULL };
+ DMXConfigToken dummyOpen = { '{', 0, NULL };
+ DMXConfigToken dummyClose = { '}', 0, NULL };
+ DMXConfigString dummyName = { T_STRING, 0, NULL, NULL, NULL };
+ DMXConfigPair dummyDim = { T_DIMENSION, 0, NULL, 0, 0 };
+
+ if (p->vname)
+ p->vname->string = p->name;
+ else
+ dummyName.string = p->name;
- if (p->dim) p->dim->x = p->width, p->dim->y = p->height;
- else dummyDim.x = p->width, dummyDim.y = p->height;
-
+ if (p->dim)
+ p->dim->x = p->width, p->dim->y = p->height;
+ else
+ dummyDim.x = p->width, dummyDim.y = p->height;
dmxConfigPrintToken(p->start ? p->start : &dummyStart);
dmxConfigPrintString(p->vname ? p->vname : &dummyName, 1);
@@ -420,36 +497,48 @@ static void dmxConfigPrintVirtual(DMXConfigVirtualPtr p)
/** The configuration information in \a entry will be pretty-printed to
* the \a stream. If \a stream is NULL, then stdout will be used. */
-void dmxConfigPrint(FILE *stream, DMXConfigEntryPtr entry)
+void
+dmxConfigPrint(FILE * stream, DMXConfigEntryPtr entry)
{
DMXConfigEntryPtr pt;
- if (!stream) str = stdout;
- else str = stream;
-
+ if (!stream)
+ str = stdout;
+ else
+ str = stream;
+
stack = &initialStack;
-
+
for (pt = entry; pt; pt = pt->next) {
switch (pt->type) {
- case dmxConfigComment: dmxConfigPrintComment(pt->comment); break;
- case dmxConfigVirtual: dmxConfigPrintVirtual(pt->virtual); break;
+ case dmxConfigComment:
+ dmxConfigPrintComment(pt->comment);
+ break;
+ case dmxConfigVirtual:
+ dmxConfigPrintVirtual(pt->virtual);
+ break;
default:
dmxConfigLog("dmxConfigPrint: cannot handle type %d in entry\n",
pt->type);
}
}
- if (pos) dmxConfigNewline();
+ if (pos)
+ dmxConfigNewline();
}
/** The configuration information in \a p will be pretty-printed to the
* \a stream. If \a stream is NULL, then stdout will be used. */
-void dmxConfigVirtualPrint(FILE *stream, DMXConfigVirtualPtr p)
+void
+dmxConfigVirtualPrint(FILE * stream, DMXConfigVirtualPtr p)
{
- if (!stream) str = stdout;
- else str = stream;
+ if (!stream)
+ str = stdout;
+ else
+ str = stream;
stack = &initialStack;
-
+
dmxConfigPrintVirtual(p);
- if (pos) dmxConfigNewline();
+ if (pos)
+ dmxConfigNewline();
}
diff --git a/hw/dmx/config/dmxprint.h b/hw/dmx/config/dmxprint.h
index d162dea95..d77bafce2 100644
--- a/hw/dmx/config/dmxprint.h
+++ b/hw/dmx/config/dmxprint.h
@@ -37,7 +37,7 @@
#ifndef _DMXPRINT_H_
#define _DMXPRINT_H_
-void dmxConfigPrint(FILE *str, DMXConfigEntryPtr entry);
-void dmxConfigVirtualPrint(FILE *str, DMXConfigVirtualPtr p);
+void dmxConfigPrint(FILE * str, DMXConfigEntryPtr entry);
+void dmxConfigVirtualPrint(FILE * str, DMXConfigVirtualPtr p);
#endif
diff --git a/hw/dmx/config/dmxtodmx.c b/hw/dmx/config/dmxtodmx.c
index 0d4ee4c09..66342091e 100644
--- a/hw/dmx/config/dmxtodmx.c
+++ b/hw/dmx/config/dmxtodmx.c
@@ -37,10 +37,11 @@
#include "dmxprint.h"
#include "dmxcompat.h"
-extern int yyparse(void);
-extern FILE *yyin;
+extern int yyparse(void);
+extern FILE *yyin;
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
{
yydebug = 0;
yyparse();
diff --git a/hw/dmx/config/vdltodmx.c b/hw/dmx/config/vdltodmx.c
index 69563f16c..007416b33 100644
--- a/hw/dmx/config/vdltodmx.c
+++ b/hw/dmx/config/vdltodmx.c
@@ -36,18 +36,20 @@
#include "dmxprint.h"
#include "dmxcompat.h"
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
{
DMXConfigEntryPtr entry;
- FILE *str;
+ FILE *str;
- if (argc != 2 && argc !=3) {
+ if (argc != 2 && argc != 3) {
fprintf(stderr, "Usage: vdltodmx inFile [outFile]\n");
return 1;
}
if (argc == 2) {
str = stdout;
- } else if (!(str = fopen(argv[2], "w"))) {
+ }
+ else if (!(str = fopen(argv[2], "w"))) {
fprintf(stderr, "Cannot open %s for write\n", argv[2]);
return 2;
}
diff --git a/hw/dmx/config/xdmxconfig.c b/hw/dmx/config/xdmxconfig.c
index 3165ba000..f30841244 100644
--- a/hw/dmx/config/xdmxconfig.c
+++ b/hw/dmx/config/xdmxconfig.c
@@ -34,7 +34,7 @@
#ifdef HAVE_DMX_CONFIG_H
#include <dmx-config.h>
#endif
-
+
#include <stdio.h>
#include <stdlib.h>
#include <X11/Intrinsic.h>
@@ -55,8 +55,8 @@
#include "dmxprint.h"
#include "dmxlog.h"
-extern int yyparse(void);
-extern FILE *yyin;
+extern int yyparse(void);
+extern FILE *yyin;
#define DMX_INFO "xdmxconfig v0.9\nCopyright 2002 Red Hat Inc.\n"
@@ -67,329 +67,379 @@ extern FILE *yyin;
#define DMX_CANVAS_WIDTH 400
#define DMX_CANVAS_HEIGHT 500
-DMXConfigEntryPtr dmxConfigEntry;
+DMXConfigEntryPtr dmxConfigEntry;
static DMXConfigVirtualPtr dmxConfigCurrent, dmxConfigNewVirtual;
static DMXConfigDisplayPtr dmxConfigCurrentDisplay, dmxConfigNewDisplay;
-static int dmxConfigGrabbed, dmxConfigGrabbedFine;
-static int dmxConfigGrabbedX, dmxConfigGrabbedY;
-static char *dmxConfigFilename;
-static GC dmxConfigGC, dmxConfigGCRev, dmxConfigGCHL;
-static int dmxConfigGCInit = 0;
-static Dimension dmxConfigWidgetWidth, dmxConfigWidgetHeight;
-static Dimension dmxConfigWallWidth, dmxConfigWallHeight;
-static double dmxConfigScaleX, dmxConfigScaleY;
-static int dmxConfigNotSaved;
+static int dmxConfigGrabbed, dmxConfigGrabbedFine;
+static int dmxConfigGrabbedX, dmxConfigGrabbedY;
+static char *dmxConfigFilename;
+static GC dmxConfigGC, dmxConfigGCRev, dmxConfigGCHL;
+static int dmxConfigGCInit = 0;
+static Dimension dmxConfigWidgetWidth, dmxConfigWidgetHeight;
+static Dimension dmxConfigWallWidth, dmxConfigWallHeight;
+static double dmxConfigScaleX, dmxConfigScaleY;
+static int dmxConfigNotSaved;
static enum {
dmxConfigStateOpen,
dmxConfigStateSave
-} dmxConfigState;
+} dmxConfigState;
/* Global widgets */
-static Widget canvas;
-static Widget cnamebox, cdimbox;
-static Widget openpopup, opendialog;
-static Widget namebox, dimbox, rtbox, origbox;
-static Widget okbutton, buttonpopup;
-static Widget ecbutton, dcbutton;
-static Widget ndbutton0, ndbutton1, edbutton, ddbutton;
-static Widget ecpopup, ecdialog0, ecdialog1;
-static Widget edpopup, eddialog0, eddialog1, eddialog2;
-static Widget aboutpopup, quitpopup;
-
-static void dmxConfigCanvasGCs(void)
+static Widget canvas;
+static Widget cnamebox, cdimbox;
+static Widget openpopup, opendialog;
+static Widget namebox, dimbox, rtbox, origbox;
+static Widget okbutton, buttonpopup;
+static Widget ecbutton, dcbutton;
+static Widget ndbutton0, ndbutton1, edbutton, ddbutton;
+static Widget ecpopup, ecdialog0, ecdialog1;
+static Widget edpopup, eddialog0, eddialog1, eddialog2;
+static Widget aboutpopup, quitpopup;
+
+static void
+dmxConfigCanvasGCs(void)
{
- Display *dpy = XtDisplay(canvas);
- Window win = XtWindow(canvas);
- XGCValues gcvals;
+ Display *dpy = XtDisplay(canvas);
+ Window win = XtWindow(canvas);
+ XGCValues gcvals;
unsigned long mask;
- Colormap colormap;
- XColor fg, bg, hl, tmp;
-
- if (dmxConfigGCInit++) return;
+ Colormap colormap;
+ XColor fg, bg, hl, tmp;
+
+ if (dmxConfigGCInit++)
+ return;
XtVaGetValues(canvas, XtNcolormap, &colormap, NULL);
XAllocNamedColor(XtDisplay(canvas), colormap, "black", &bg, &tmp);
XAllocNamedColor(XtDisplay(canvas), colormap, "white", &fg, &tmp);
- XAllocNamedColor(XtDisplay(canvas), colormap, "red", &hl, &tmp);
+ XAllocNamedColor(XtDisplay(canvas), colormap, "red", &hl, &tmp);
mask = (GCFunction | GCPlaneMask | GCClipMask | GCForeground |
GCBackground | GCLineWidth | GCLineStyle | GCCapStyle |
GCFillStyle);
- /* FIXME: copy this from widget */
- gcvals.function = GXcopy;
+ /* FIXME: copy this from widget */
+ gcvals.function = GXcopy;
gcvals.plane_mask = AllPlanes;
- gcvals.clip_mask = None;
+ gcvals.clip_mask = None;
gcvals.foreground = fg.pixel;
gcvals.background = bg.pixel;
gcvals.line_width = 0;
gcvals.line_style = LineSolid;
- gcvals.cap_style = CapNotLast;
+ gcvals.cap_style = CapNotLast;
gcvals.fill_style = FillSolid;
-
- dmxConfigGC = XCreateGC(dpy, win, mask, &gcvals);
+
+ dmxConfigGC = XCreateGC(dpy, win, mask, &gcvals);
gcvals.foreground = hl.pixel;
- dmxConfigGCHL = XCreateGC(dpy, win, mask, &gcvals);
+ dmxConfigGCHL = XCreateGC(dpy, win, mask, &gcvals);
gcvals.foreground = bg.pixel;
gcvals.background = fg.pixel;
- dmxConfigGCRev = XCreateGC(dpy, win, mask, &gcvals);
+ dmxConfigGCRev = XCreateGC(dpy, win, mask, &gcvals);
}
-static void dmxConfigGetDims(int *maxWidth, int *maxHeight)
+static void
+dmxConfigGetDims(int *maxWidth, int *maxHeight)
{
- DMXConfigSubPtr pt;
+ DMXConfigSubPtr pt;
DMXConfigEntryPtr e;
-
- *maxWidth = dmxConfigWallWidth = 0;
+
+ *maxWidth = dmxConfigWallWidth = 0;
*maxHeight = dmxConfigWallHeight = 0;
- if (!dmxConfigCurrent) return;
-
- dmxConfigWallWidth = dmxConfigCurrent->width;
+ if (!dmxConfigCurrent)
+ return;
+
+ dmxConfigWallWidth = dmxConfigCurrent->width;
dmxConfigWallHeight = dmxConfigCurrent->height;
if (!dmxConfigWallWidth || !dmxConfigWallHeight) {
for (pt = dmxConfigCurrent->subentry; pt; pt = pt->next) {
if (pt->type == dmxConfigDisplay) {
- int x = pt->display->scrnWidth + pt->display->rootXOrigin;
+ int x = pt->display->scrnWidth + pt->display->rootXOrigin;
int y = pt->display->scrnHeight + pt->display->rootYOrigin;
- if (x > dmxConfigWallWidth) dmxConfigWallWidth = x;
- if (y > dmxConfigWallHeight) dmxConfigWallHeight = y;
+
+ if (x > dmxConfigWallWidth)
+ dmxConfigWallWidth = x;
+ if (y > dmxConfigWallHeight)
+ dmxConfigWallHeight = y;
}
}
}
- /* Compute maximums */
+ /* Compute maximums */
*maxWidth = *maxHeight = 0;
for (e = dmxConfigEntry; e; e = e->next) {
- if (e->type != dmxConfigVirtual) continue;
+ if (e->type != dmxConfigVirtual)
+ continue;
for (pt = e->virtual->subentry; pt; pt = pt->next) {
if (pt->type == dmxConfigDisplay) {
- int x = pt->display->scrnWidth + pt->display->rootXOrigin;
+ int x = pt->display->scrnWidth + pt->display->rootXOrigin;
int y = pt->display->scrnHeight + pt->display->rootYOrigin;
- if (x > *maxWidth) *maxWidth = x;
- if (y > *maxHeight) *maxHeight = y;
+
+ if (x > *maxWidth)
+ *maxWidth = x;
+ if (y > *maxHeight)
+ *maxHeight = y;
}
}
}
- if (dmxConfigWallWidth > *maxWidth) *maxWidth = dmxConfigWallWidth;
- if (dmxConfigWallHeight > *maxHeight) *maxHeight = dmxConfigWallHeight;
+ if (dmxConfigWallWidth > *maxWidth)
+ *maxWidth = dmxConfigWallWidth;
+ if (dmxConfigWallHeight > *maxHeight)
+ *maxHeight = dmxConfigWallHeight;
+}
+
+static int
+scalex(int x)
+{
+ return (int) ((x * dmxConfigScaleX) + .5);
+}
+
+static int
+scaley(int y)
+{
+ return (int) ((y * dmxConfigScaleY) + .5);
+}
+
+static int
+unscalex(int x)
+{
+ return (int) ((x / dmxConfigScaleX) + .5);
}
-static int scalex(int x) { return (int)((x * dmxConfigScaleX) + .5); }
-static int scaley(int y) { return (int)((y * dmxConfigScaleY) + .5); }
-static int unscalex(int x) { return (int)((x / dmxConfigScaleX) + .5); }
-static int unscaley(int y) { return (int)((y / dmxConfigScaleY) + .5); }
+static int
+unscaley(int y)
+{
+ return (int) ((y / dmxConfigScaleY) + .5);
+}
-static void dmxConfigDataUpdate(void)
+static void
+dmxConfigDataUpdate(void)
{
- /* FIXME: could result in buffer overflows */
- char cnambuf[512];
- char cdimbuf[128];
- char nambuf[512];
- char dimbuf[128];
- char rtbuf[128];
- char offbuf[128];
+ /* FIXME: could result in buffer overflows */
+ char cnambuf[512];
+ char cdimbuf[128];
+ char nambuf[512];
+ char dimbuf[128];
+ char rtbuf[128];
+ char offbuf[128];
const char *name;
if (!dmxConfigCurrent) {
- XtVaSetValues(cnamebox, XtNlabel, "", XtNsensitive, False, NULL);
- XtVaSetValues(cdimbox, XtNlabel, "", XtNsensitive, False, NULL);
- XtVaSetValues(ecbutton, XtNsensitive, False, NULL);
- XtVaSetValues(dcbutton, XtNsensitive, False, NULL);
- XtVaSetValues(ndbutton0, XtNsensitive, False, NULL);
- XtVaSetValues(ndbutton1, XtNsensitive, False, NULL);
- } else {
+ XtVaSetValues(cnamebox, XtNlabel, "", XtNsensitive, False, NULL);
+ XtVaSetValues(cdimbox, XtNlabel, "", XtNsensitive, False, NULL);
+ XtVaSetValues(ecbutton, XtNsensitive, False, NULL);
+ XtVaSetValues(dcbutton, XtNsensitive, False, NULL);
+ XtVaSetValues(ndbutton0, XtNsensitive, False, NULL);
+ XtVaSetValues(ndbutton1, XtNsensitive, False, NULL);
+ }
+ else {
name = dmxConfigCurrent->name;
snprintf(cnambuf, sizeof(cnambuf), "%s", name ? name : "");
snprintf(cdimbuf, sizeof(cdimbuf), "%dx%d",
- dmxConfigWallWidth, dmxConfigWallHeight);
- XtVaSetValues(cnamebox, XtNlabel, cnambuf, XtNsensitive, True, NULL);
- XtVaSetValues(cdimbox, XtNlabel, cdimbuf, XtNsensitive, True, NULL);
- XtVaSetValues(ecbutton, XtNsensitive, True, NULL);
- XtVaSetValues(dcbutton, XtNsensitive, True, NULL);
- XtVaSetValues(ndbutton0, XtNsensitive, True, NULL);
- XtVaSetValues(ndbutton1, XtNsensitive, True, NULL);
+ dmxConfigWallWidth, dmxConfigWallHeight);
+ XtVaSetValues(cnamebox, XtNlabel, cnambuf, XtNsensitive, True, NULL);
+ XtVaSetValues(cdimbox, XtNlabel, cdimbuf, XtNsensitive, True, NULL);
+ XtVaSetValues(ecbutton, XtNsensitive, True, NULL);
+ XtVaSetValues(dcbutton, XtNsensitive, True, NULL);
+ XtVaSetValues(ndbutton0, XtNsensitive, True, NULL);
+ XtVaSetValues(ndbutton1, XtNsensitive, True, NULL);
}
-
+
if (!dmxConfigCurrentDisplay) {
XtVaSetValues(namebox, XtNlabel, "", XtNsensitive, False, NULL);
- XtVaSetValues(dimbox, XtNlabel, "", XtNsensitive, False, NULL);
- XtVaSetValues(rtbox, XtNlabel, "", XtNsensitive, False, NULL);
+ XtVaSetValues(dimbox, XtNlabel, "", XtNsensitive, False, NULL);
+ XtVaSetValues(rtbox, XtNlabel, "", XtNsensitive, False, NULL);
XtVaSetValues(origbox, XtNlabel, "", XtNsensitive, False, NULL);
- XtVaSetValues(edbutton, XtNsensitive, False, NULL);
- XtVaSetValues(ddbutton, XtNsensitive, False, NULL);
- } else {
+ XtVaSetValues(edbutton, XtNsensitive, False, NULL);
+ XtVaSetValues(ddbutton, XtNsensitive, False, NULL);
+ }
+ else {
name = dmxConfigCurrentDisplay->name;
snprintf(nambuf, sizeof(nambuf), "%s", name ? name : "");
snprintf(dimbuf, sizeof(dimbuf), "%dx%d%c%d%c%d",
- dmxConfigCurrentDisplay->scrnWidth,
- dmxConfigCurrentDisplay->scrnHeight,
- dmxConfigCurrentDisplay->scrnXSign < 0 ? '-' : '+',
- dmxConfigCurrentDisplay->scrnX,
- dmxConfigCurrentDisplay->scrnYSign < 0 ? '-' : '+',
- dmxConfigCurrentDisplay->scrnY);
+ dmxConfigCurrentDisplay->scrnWidth,
+ dmxConfigCurrentDisplay->scrnHeight,
+ dmxConfigCurrentDisplay->scrnXSign < 0 ? '-' : '+',
+ dmxConfigCurrentDisplay->scrnX,
+ dmxConfigCurrentDisplay->scrnYSign < 0 ? '-' : '+',
+ dmxConfigCurrentDisplay->scrnY);
snprintf(rtbuf, sizeof(dimbuf), "%dx%d%c%d%c%d",
- dmxConfigCurrentDisplay->rootWidth,
- dmxConfigCurrentDisplay->rootHeight,
- dmxConfigCurrentDisplay->rootXSign < 0 ? '-' : '+',
- dmxConfigCurrentDisplay->rootX,
- dmxConfigCurrentDisplay->rootYSign < 0 ? '-' : '+',
- dmxConfigCurrentDisplay->rootY);
+ dmxConfigCurrentDisplay->rootWidth,
+ dmxConfigCurrentDisplay->rootHeight,
+ dmxConfigCurrentDisplay->rootXSign < 0 ? '-' : '+',
+ dmxConfigCurrentDisplay->rootX,
+ dmxConfigCurrentDisplay->rootYSign < 0 ? '-' : '+',
+ dmxConfigCurrentDisplay->rootY);
snprintf(offbuf, sizeof(offbuf), "@%dx%d",
- dmxConfigCurrentDisplay->rootXOrigin,
- dmxConfigCurrentDisplay->rootYOrigin);
+ dmxConfigCurrentDisplay->rootXOrigin,
+ dmxConfigCurrentDisplay->rootYOrigin);
XtVaSetValues(namebox, XtNlabel, nambuf, XtNsensitive, True, NULL);
- XtVaSetValues(dimbox, XtNlabel, dimbuf, XtNsensitive, True, NULL);
- XtVaSetValues(rtbox, XtNlabel, rtbuf, XtNsensitive, True, NULL);
+ XtVaSetValues(dimbox, XtNlabel, dimbuf, XtNsensitive, True, NULL);
+ XtVaSetValues(rtbox, XtNlabel, rtbuf, XtNsensitive, True, NULL);
XtVaSetValues(origbox, XtNlabel, offbuf, XtNsensitive, True, NULL);
- XtVaSetValues(edbutton, XtNsensitive, True, NULL);
- XtVaSetValues(ddbutton, XtNsensitive, True, NULL);
+ XtVaSetValues(edbutton, XtNsensitive, True, NULL);
+ XtVaSetValues(ddbutton, XtNsensitive, True, NULL);
}
}
-static void dmxConfigCanvasUpdate(void)
+static void
+dmxConfigCanvasUpdate(void)
{
DMXConfigSubPtr pt;
- Display *dpy = XtDisplay(canvas);
- Window win = XtWindow(canvas);
- GContext gcontext = XGContextFromGC(dmxConfigGC);
- XFontStruct *fs;
- int w, h;
+ Display *dpy = XtDisplay(canvas);
+ Window win = XtWindow(canvas);
+ GContext gcontext = XGContextFromGC(dmxConfigGC);
+ XFontStruct *fs;
+ int w, h;
XFillRectangle(dpy, win, dmxConfigGCRev,
0, 0, dmxConfigWidgetWidth, dmxConfigWidgetHeight);
dmxConfigDataUpdate();
- if (!dmxConfigCurrent) return;
+ if (!dmxConfigCurrent)
+ return;
w = scalex(dmxConfigWallWidth);
h = scaley(dmxConfigWallHeight);
- if (w > dmxConfigWidgetWidth - 1) w = dmxConfigWidgetWidth - 1;
- if (h > dmxConfigWidgetHeight - 1) h = dmxConfigWidgetHeight - 1;
+ if (w > dmxConfigWidgetWidth - 1)
+ w = dmxConfigWidgetWidth - 1;
+ if (h > dmxConfigWidgetHeight - 1)
+ h = dmxConfigWidgetHeight - 1;
XDrawRectangle(dpy, win, dmxConfigGC, 0, 0, w, h);
fs = XQueryFont(dpy, gcontext);
for (pt = dmxConfigCurrent->subentry; pt; pt = pt->next) {
int x, y, len;
int xo = 3, yo = fs->ascent + fs->descent + 2;
- GC gc;
-
- if (pt->type != dmxConfigDisplay) continue;
- gc = (pt->display == dmxConfigCurrentDisplay
- ? dmxConfigGCHL
- : dmxConfigGC);
- x = scalex(pt->display->rootXOrigin);
- y = scaley(pt->display->rootYOrigin);
- w = scalex(pt->display->scrnWidth);
- h = scaley(pt->display->scrnHeight);
+ GC gc;
+
+ if (pt->type != dmxConfigDisplay)
+ continue;
+ gc = (pt->display == dmxConfigCurrentDisplay
+ ? dmxConfigGCHL : dmxConfigGC);
+ x = scalex(pt->display->rootXOrigin);
+ y = scaley(pt->display->rootYOrigin);
+ w = scalex(pt->display->scrnWidth);
+ h = scaley(pt->display->scrnHeight);
len = pt->display->name ? strlen(pt->display->name) : 0;
- if (x > dmxConfigWidgetWidth - 1) x = dmxConfigWidgetWidth - 1;
- if (y > dmxConfigWidgetHeight - 1) y = dmxConfigWidgetHeight - 1;
+ if (x > dmxConfigWidgetWidth - 1)
+ x = dmxConfigWidgetWidth - 1;
+ if (y > dmxConfigWidgetHeight - 1)
+ y = dmxConfigWidgetHeight - 1;
XDrawRectangle(dpy, win, gc, x, y, w, h);
if (fs && len) {
while (len && XTextWidth(fs, pt->display->name, len) >= w - 2 * xo)
--len;
if (len)
- XDrawString(dpy, win, gc, x+xo, y+yo, pt->display->name, len);
+ XDrawString(dpy, win, gc, x + xo, y + yo, pt->display->name,
+ len);
}
}
- if (fs) XFreeFontInfo(NULL, fs, 0);
+ if (fs)
+ XFreeFontInfo(NULL, fs, 0);
}
-static void dmxConfigCanvasDraw(Region region)
+static void
+dmxConfigCanvasDraw(Region region)
{
Display *dpy = XtDisplay(canvas);
- int maxWidth, maxHeight;
-
+ int maxWidth, maxHeight;
+
dmxConfigCanvasGCs();
if (region) {
- XSetRegion(dpy, dmxConfigGC, region);
+ XSetRegion(dpy, dmxConfigGC, region);
XSetRegion(dpy, dmxConfigGCRev, region);
- XSetRegion(dpy, dmxConfigGCHL, region);
+ XSetRegion(dpy, dmxConfigGCHL, region);
}
XtVaGetValues(canvas,
XtNwidth, &dmxConfigWidgetWidth,
- XtNheight, &dmxConfigWidgetHeight,
- NULL);
+ XtNheight, &dmxConfigWidgetHeight, NULL);
dmxConfigGetDims(&maxWidth, &maxHeight);
- dmxConfigScaleX = (double)dmxConfigWidgetWidth / maxWidth;
- dmxConfigScaleY = (double)dmxConfigWidgetHeight / maxHeight;
- if (dmxConfigScaleX > dmxConfigScaleY) dmxConfigScaleX = dmxConfigScaleY;
- if (dmxConfigScaleY > dmxConfigScaleX) dmxConfigScaleY = dmxConfigScaleX;
+ dmxConfigScaleX = (double) dmxConfigWidgetWidth / maxWidth;
+ dmxConfigScaleY = (double) dmxConfigWidgetHeight / maxHeight;
+ if (dmxConfigScaleX > dmxConfigScaleY)
+ dmxConfigScaleX = dmxConfigScaleY;
+ if (dmxConfigScaleY > dmxConfigScaleX)
+ dmxConfigScaleY = dmxConfigScaleX;
dmxConfigCanvasUpdate();
if (region) {
- XSetClipMask(dpy, dmxConfigGC, None);
+ XSetClipMask(dpy, dmxConfigGC, None);
XSetClipMask(dpy, dmxConfigGCRev, None);
- XSetClipMask(dpy, dmxConfigGCHL, None);
+ XSetClipMask(dpy, dmxConfigGCHL, None);
}
}
-static void dmxConfigSelectCallback(Widget w, XtPointer closure,
- XtPointer callData)
+static void
+dmxConfigSelectCallback(Widget w, XtPointer closure, XtPointer callData)
{
dmxConfigCurrent = closure;
dmxConfigVirtualPrint(stdout, dmxConfigCurrent);
dmxConfigCanvasDraw(NULL);
}
-static void dmxConfigCopystrings(void)
+static void
+dmxConfigCopystrings(void)
{
DMXConfigEntryPtr pt;
- DMXConfigSubPtr sub;
+ DMXConfigSubPtr sub;
- if (!dmxConfigCurrent) return;
+ if (!dmxConfigCurrent)
+ return;
- /* FIXME: this is all a per-config file
- * memory leak */
+ /* FIXME: this is all a per-config file
+ * memory leak */
for (pt = dmxConfigEntry; pt; pt = pt->next) {
if (pt->type == dmxConfigVirtual) {
pt->virtual->name = XtNewString(pt->virtual->name
- ? pt->virtual->name
- : "");
+ ? pt->virtual->name : "");
for (sub = pt->virtual->subentry; sub; sub = sub->next) {
- if (sub->type != dmxConfigDisplay) continue;
+ if (sub->type != dmxConfigDisplay)
+ continue;
sub->display->name = XtNewString(sub->display->name
- ? sub->display->name
- : "");
+ ? sub->display->name : "");
}
}
}
}
-static void dmxConfigGetValueString(char **d, Widget w)
+static void
+dmxConfigGetValueString(char **d, Widget w)
{
const char *tmp = XawDialogGetValueString(w);
- if (*d) XtFree(*d);
+
+ if (*d)
+ XtFree(*d);
*d = XtNewString(tmp);
}
-static void dmxConfigSetupCnamemenu(void)
+static void
+dmxConfigSetupCnamemenu(void)
{
- static Widget cnamemenu = NULL;
- Widget w;
+ static Widget cnamemenu = NULL;
+ Widget w;
DMXConfigEntryPtr pt;
- if (cnamemenu) XtDestroyWidget(cnamemenu);
+ if (cnamemenu)
+ XtDestroyWidget(cnamemenu);
cnamemenu = NULL;
- if (!dmxConfigCurrent) return;
+ if (!dmxConfigCurrent)
+ return;
cnamemenu = XtVaCreatePopupShell("cnamemenu", simpleMenuWidgetClass,
- cnamebox,
- NULL);
-
+ cnamebox, NULL);
+
for (pt = dmxConfigEntry; pt; pt = pt->next) {
if (pt->type == dmxConfigVirtual) {
w = XtVaCreateManagedWidget(pt->virtual->name
? pt->virtual->name
: "",
- smeBSBObjectClass, cnamemenu,
- NULL);
- XtAddCallback(w, XtNcallback,
- dmxConfigSelectCallback, pt->virtual);
+ smeBSBObjectClass, cnamemenu, NULL);
+ XtAddCallback(w, XtNcallback, dmxConfigSelectCallback, pt->virtual);
}
}
}
-static void dmxConfigReadFile(void)
+static void
+dmxConfigReadFile(void)
{
- FILE *str;
+ FILE *str;
DMXConfigEntryPtr pt;
if (!(str = fopen(dmxConfigFilename, "r"))) {
@@ -397,7 +447,7 @@ static void dmxConfigReadFile(void)
dmxConfigFilename);
return;
}
- yyin = str;
+ yyin = str;
yydebug = 0;
yyparse();
fclose(str);
@@ -410,8 +460,6 @@ static void dmxConfigReadFile(void)
}
}
-
-
if (XtIsRealized(canvas)) {
dmxConfigCopystrings();
dmxConfigSetupCnamemenu();
@@ -420,9 +468,10 @@ static void dmxConfigReadFile(void)
dmxConfigVirtualPrint(stdout, dmxConfigCurrent);
}
-static void dmxConfigWriteFile(void)
+static void
+dmxConfigWriteFile(void)
{
- FILE *str;
+ FILE *str;
if (!(str = fopen(dmxConfigFilename, "w"))) {
dmxLog(dmxWarning, "Unable to write configuration file %s\n",
@@ -433,31 +482,36 @@ static void dmxConfigWriteFile(void)
fclose(str);
}
-static DMXConfigDisplayPtr dmxConfigFindDisplay(int x, int y)
+static DMXConfigDisplayPtr
+dmxConfigFindDisplay(int x, int y)
{
DMXConfigSubPtr pt;
- if (!dmxConfigCurrent) return NULL;
+ if (!dmxConfigCurrent)
+ return NULL;
for (pt = dmxConfigCurrent->subentry; pt; pt = pt->next) {
DMXConfigDisplayPtr d = pt->display;
- if (pt->type != dmxConfigDisplay) continue;
+
+ if (pt->type != dmxConfigDisplay)
+ continue;
if (x >= scalex(d->rootXOrigin)
&& x <= scalex(d->rootXOrigin + d->scrnWidth)
&& y >= scaley(d->rootYOrigin)
- && y <= scaley(d->rootYOrigin + d->scrnHeight)) return d;
+ && y <= scaley(d->rootYOrigin + d->scrnHeight))
+ return d;
}
return NULL;
}
-static void dmxConfigSetPopupPosition(Widget popup)
+static void
+dmxConfigSetPopupPosition(Widget popup)
{
- Position x, y;
- Window t1, t2;
- int root_x, root_y;
- int temp_x, temp_y;
+ Position x, y;
+ Window t1, t2;
+ int root_x, root_y;
+ int temp_x, temp_y;
unsigned int temp;
-
XtRealizeWidget(popup);
if (!XQueryPointer(XtDisplay(popup), XtWindow(popup), &t1, &t2,
&root_x, &root_y, &temp_x, &temp_y, &temp))
@@ -468,13 +522,15 @@ static void dmxConfigSetPopupPosition(Widget popup)
XtVaSetValues(popup, XtNx, x, XtNy, y, NULL);
}
-static void dmxConfigPlaceMenu(Widget w, XEvent *event,
- String *params, Cardinal *num_params)
+static void
+dmxConfigPlaceMenu(Widget w, XEvent * event,
+ String * params, Cardinal * num_params)
{
dmxConfigSetPopupPosition(buttonpopup);
}
-static void dmxConfigMove(int deltaX, int deltaY)
+static void
+dmxConfigMove(int deltaX, int deltaY)
{
dmxConfigCurrentDisplay->rootXOrigin += deltaX;
dmxConfigCurrentDisplay->rootYOrigin += deltaY;
@@ -492,40 +548,44 @@ static void dmxConfigMove(int deltaX, int deltaY)
dmxConfigNotSaved = 1;
}
-static void dmxConfigCanvasInput(Widget w, XtPointer closure,
- XtPointer callData)
+static void
+dmxConfigCanvasInput(Widget w, XtPointer closure, XtPointer callData)
{
- XEvent *e = (XEvent *)callData;
+ XEvent *e = (XEvent *) callData;
DMXConfigDisplayPtr display = NULL;
switch (e->type) {
case ButtonPress:
if (e->xbutton.button == Button1) {
- dmxConfigGrabbed = 1;
+ dmxConfigGrabbed = 1;
dmxConfigGrabbedFine = 0;
- dmxConfigGrabbedX = e->xbutton.x;
- dmxConfigGrabbedY = e->xbutton.y;
+ dmxConfigGrabbedX = e->xbutton.x;
+ dmxConfigGrabbedY = e->xbutton.y;
}
if (e->xbutton.button == Button2) {
- dmxConfigGrabbed = 1;
+ dmxConfigGrabbed = 1;
dmxConfigGrabbedFine = 1;
- dmxConfigGrabbedX = e->xbutton.x;
- dmxConfigGrabbedY = e->xbutton.y;
+ dmxConfigGrabbedX = e->xbutton.x;
+ dmxConfigGrabbedY = e->xbutton.y;
}
break;
case ButtonRelease:
- if (e->xbutton.button == Button1) dmxConfigGrabbed = 0;
- if (e->xbutton.button == Button2) dmxConfigGrabbed = 0;
+ if (e->xbutton.button == Button1)
+ dmxConfigGrabbed = 0;
+ if (e->xbutton.button == Button2)
+ dmxConfigGrabbed = 0;
break;
case MotionNotify:
if (dmxConfigGrabbed && dmxConfigCurrentDisplay) {
int deltaX = e->xmotion.x - dmxConfigGrabbedX;
int deltaY = e->xmotion.y - dmxConfigGrabbedY;
+
dmxConfigMove(dmxConfigGrabbedFine ? deltaX : unscalex(deltaX),
dmxConfigGrabbedFine ? deltaY : unscaley(deltaY));
dmxConfigGrabbedX = e->xmotion.x;
dmxConfigGrabbedY = e->xmotion.y;
- } else {
+ }
+ else {
display = dmxConfigFindDisplay(e->xmotion.x, e->xmotion.y);
if (display != dmxConfigCurrentDisplay) {
dmxConfigCurrentDisplay = display;
@@ -535,31 +595,39 @@ static void dmxConfigCanvasInput(Widget w, XtPointer closure,
break;
case KeyPress:
switch (XLookupKeysym(&e->xkey, 0)) {
- case XK_Right: dmxConfigMove(1,0); break;
- case XK_Left: dmxConfigMove(-1,0); break;
- case XK_Down: dmxConfigMove(0,1); break;
- case XK_Up: dmxConfigMove(0,-1); break;
+ case XK_Right:
+ dmxConfigMove(1, 0);
+ break;
+ case XK_Left:
+ dmxConfigMove(-1, 0);
+ break;
+ case XK_Down:
+ dmxConfigMove(0, 1);
+ break;
+ case XK_Up:
+ dmxConfigMove(0, -1);
+ break;
}
break;
}
}
-static void dmxConfigCanvasResize(Widget w, XtPointer closure,
- XtPointer callData)
+static void
+dmxConfigCanvasResize(Widget w, XtPointer closure, XtPointer callData)
{
dmxConfigCanvasDraw(NULL);
}
-static void dmxConfigCanvasExpose(Widget w, XtPointer closure,
- XtPointer callData)
+static void
+dmxConfigCanvasExpose(Widget w, XtPointer closure, XtPointer callData)
{
- CanvasExposeDataPtr data = (CanvasExposeDataPtr)callData;
+ CanvasExposeDataPtr data = (CanvasExposeDataPtr) callData;
dmxConfigCanvasDraw(data->region);
}
-static void dmxConfigOpenCallback(Widget w, XtPointer closure,
- XtPointer callData)
+static void
+dmxConfigOpenCallback(Widget w, XtPointer closure, XtPointer callData)
{
dmxConfigState = dmxConfigStateOpen;
XtVaSetValues(okbutton, XtNlabel, "Open", NULL);
@@ -567,8 +635,8 @@ static void dmxConfigOpenCallback(Widget w, XtPointer closure,
XtPopup(openpopup, XtGrabExclusive);
}
-static void dmxConfigSaveCallback(Widget w, XtPointer closure,
- XtPointer callData)
+static void
+dmxConfigSaveCallback(Widget w, XtPointer closure, XtPointer callData)
{
dmxConfigState = dmxConfigStateSave;
XtVaSetValues(okbutton, XtNlabel, "Save", NULL);
@@ -576,69 +644,73 @@ static void dmxConfigSaveCallback(Widget w, XtPointer closure,
XtPopup(openpopup, XtGrabExclusive);
}
-static void dmxConfigOkCallback(Widget w, XtPointer closure,
- XtPointer callData)
+static void
+dmxConfigOkCallback(Widget w, XtPointer closure, XtPointer callData)
{
dmxConfigGetValueString(&dmxConfigFilename, opendialog);
XtPopdown(openpopup);
- if (dmxConfigState == dmxConfigStateOpen) dmxConfigReadFile();
- else dmxConfigWriteFile();
+ if (dmxConfigState == dmxConfigStateOpen)
+ dmxConfigReadFile();
+ else
+ dmxConfigWriteFile();
dmxConfigNotSaved = 0;
}
-static void dmxConfigCanCallback(Widget w, XtPointer closure,
- XtPointer callData)
+static void
+dmxConfigCanCallback(Widget w, XtPointer closure, XtPointer callData)
{
XtPopdown(openpopup);
}
-static void dmxConfigECCallback(Widget w, XtPointer closure,
- XtPointer callData)
+static void
+dmxConfigECCallback(Widget w, XtPointer closure, XtPointer callData)
{
char buf[256]; /* RATS: Only used in snprintf */
-
- if (!dmxConfigCurrent) return;
+
+ if (!dmxConfigCurrent)
+ return;
dmxConfigSetPopupPosition(ecpopup);
XtVaSetValues(ecdialog0, XtNvalue,
- dmxConfigCurrent->name ? dmxConfigCurrent->name : "",
- NULL);
+ dmxConfigCurrent->name ? dmxConfigCurrent->name : "", NULL);
snprintf(buf, sizeof(buf), "%dx%d",
- dmxConfigCurrent->width, dmxConfigCurrent->height);
+ dmxConfigCurrent->width, dmxConfigCurrent->height);
XtVaSetValues(ecdialog1, XtNvalue, buf, NULL);
XtPopup(ecpopup, XtGrabExclusive);
}
-static void dmxConfigNCCallback(Widget w, XtPointer closure,
- XtPointer callData)
+static void
+dmxConfigNCCallback(Widget w, XtPointer closure, XtPointer callData)
{
- int width = 1280*2, height = 1024*2;
+ int width = 1280 * 2, height = 1024 * 2;
if (dmxConfigCurrent) {
- width = dmxConfigCurrent->width;
+ width = dmxConfigCurrent->width;
height = dmxConfigCurrent->height;
}
- dmxConfigCurrent = dmxConfigCreateVirtual(NULL, NULL, NULL,
- NULL, NULL, NULL);
- dmxConfigNewVirtual = dmxConfigCurrent;
- dmxConfigCurrent->width = width;
+ dmxConfigCurrent = dmxConfigCreateVirtual(NULL, NULL, NULL,
+ NULL, NULL, NULL);
+ dmxConfigNewVirtual = dmxConfigCurrent;
+ dmxConfigCurrent->width = width;
dmxConfigCurrent->height = height;
dmxConfigEntry = dmxConfigAddEntry(dmxConfigEntry, dmxConfigVirtual, NULL,
dmxConfigCurrent);
dmxConfigECCallback(w, closure, callData);
}
-static void dmxConfigDCCallback(Widget w, XtPointer closure,
- XtPointer callData)
+static void
+dmxConfigDCCallback(Widget w, XtPointer closure, XtPointer callData)
{
DMXConfigEntryPtr pt;
- if (!dmxConfigEntry) return;
+ if (!dmxConfigEntry)
+ return;
if (dmxConfigEntry
&& dmxConfigEntry->type == dmxConfigVirtual
&& dmxConfigEntry->virtual == dmxConfigCurrent) {
dmxConfigEntry = dmxConfigEntry->next;
- } else {
+ }
+ else {
for (pt = dmxConfigEntry; pt && pt->next; pt = pt->next)
if (pt->next->type == dmxConfigVirtual
&& pt->next->virtual == dmxConfigCurrent) {
@@ -647,10 +719,10 @@ static void dmxConfigDCCallback(Widget w, XtPointer closure,
}
}
dmxConfigFreeVirtual(dmxConfigCurrent);
- dmxConfigCurrent = NULL;
+ dmxConfigCurrent = NULL;
dmxConfigCurrentDisplay = NULL;
- /* Make the first entry current */
+ /* Make the first entry current */
for (pt = dmxConfigEntry; pt; pt = pt->next) {
if (pt->type == dmxConfigVirtual) {
dmxConfigCurrent = pt->virtual;
@@ -662,93 +734,96 @@ static void dmxConfigDCCallback(Widget w, XtPointer closure,
dmxConfigCanvasDraw(NULL);
}
-static void dmxConfigECOkCallback(Widget w, XtPointer closure,
- XtPointer callData)
+static void
+dmxConfigECOkCallback(Widget w, XtPointer closure, XtPointer callData)
{
const char *value;
- char *endpt;
+ char *endpt;
- dmxConfigGetValueString((char **)&dmxConfigCurrent->name, ecdialog0);
- value = XawDialogGetValueString(ecdialog1);
- dmxConfigCurrent->width = strtol(value, &endpt, 10);
- dmxConfigCurrent->height = strtol(endpt+1, NULL, 10);
+ dmxConfigGetValueString((char **) &dmxConfigCurrent->name, ecdialog0);
+ value = XawDialogGetValueString(ecdialog1);
+ dmxConfigCurrent->width = strtol(value, &endpt, 10);
+ dmxConfigCurrent->height = strtol(endpt + 1, NULL, 10);
XtPopdown(ecpopup);
dmxConfigCurrentDisplay = NULL;
- dmxConfigNewVirtual = NULL;
+ dmxConfigNewVirtual = NULL;
dmxConfigSetupCnamemenu();
dmxConfigCanvasDraw(NULL);
dmxConfigNotSaved = 1;
}
-static void dmxConfigECCanCallback(Widget w, XtPointer closure,
- XtPointer callData)
+static void
+dmxConfigECCanCallback(Widget w, XtPointer closure, XtPointer callData)
{
- if (dmxConfigNewVirtual) dmxConfigDCCallback(w, closure, callData);
- dmxConfigNewVirtual = NULL;
+ if (dmxConfigNewVirtual)
+ dmxConfigDCCallback(w, closure, callData);
+ dmxConfigNewVirtual = NULL;
XtPopdown(ecpopup);
}
-static void dmxConfigEDCallback(Widget w, XtPointer closure,
- XtPointer callData)
+static void
+dmxConfigEDCallback(Widget w, XtPointer closure, XtPointer callData)
{
char buf[256]; /* RATS: Only used in snprintf */
-
- if (!dmxConfigCurrent || !dmxConfigCurrentDisplay) return;
+
+ if (!dmxConfigCurrent || !dmxConfigCurrentDisplay)
+ return;
dmxConfigSetPopupPosition(edpopup);
XtVaSetValues(eddialog0, XtNvalue,
dmxConfigCurrentDisplay->name
- ? dmxConfigCurrentDisplay->name
- : "",
- NULL);
+ ? dmxConfigCurrentDisplay->name : "", NULL);
snprintf(buf, sizeof(buf), "%dx%d%c%d%c%d",
- dmxConfigCurrentDisplay->scrnWidth,
- dmxConfigCurrentDisplay->scrnHeight,
- dmxConfigCurrentDisplay->scrnXSign < 0 ? '-' : '+',
- dmxConfigCurrentDisplay->scrnY,
- dmxConfigCurrentDisplay->scrnYSign < 0 ? '-' : '+',
- dmxConfigCurrentDisplay->scrnY);
+ dmxConfigCurrentDisplay->scrnWidth,
+ dmxConfigCurrentDisplay->scrnHeight,
+ dmxConfigCurrentDisplay->scrnXSign < 0 ? '-' : '+',
+ dmxConfigCurrentDisplay->scrnY,
+ dmxConfigCurrentDisplay->scrnYSign < 0 ? '-' : '+',
+ dmxConfigCurrentDisplay->scrnY);
XtVaSetValues(eddialog1, XtNvalue, buf, NULL);
snprintf(buf, sizeof(buf), "@%dx%d",
- dmxConfigCurrentDisplay->rootXOrigin,
- dmxConfigCurrentDisplay->rootYOrigin);
+ dmxConfigCurrentDisplay->rootXOrigin,
+ dmxConfigCurrentDisplay->rootYOrigin);
XtVaSetValues(eddialog2, XtNvalue, buf, NULL);
XtPopup(edpopup, XtGrabExclusive);
}
-static void dmxConfigNDCallback(Widget w, XtPointer closure,
- XtPointer callData)
+static void
+dmxConfigNDCallback(Widget w, XtPointer closure, XtPointer callData)
{
int width = 1280, height = 1024;
- if (!dmxConfigCurrent) return;
+ if (!dmxConfigCurrent)
+ return;
if (dmxConfigCurrentDisplay) {
- width = dmxConfigCurrentDisplay->scrnWidth;
+ width = dmxConfigCurrentDisplay->scrnWidth;
height = dmxConfigCurrentDisplay->scrnHeight;
}
dmxConfigCurrentDisplay = dmxConfigCreateDisplay(NULL, NULL, NULL,
NULL, NULL);
- dmxConfigNewDisplay = dmxConfigCurrentDisplay;
- dmxConfigCurrentDisplay->scrnWidth = width;
+ dmxConfigNewDisplay = dmxConfigCurrentDisplay;
+ dmxConfigCurrentDisplay->scrnWidth = width;
dmxConfigCurrentDisplay->scrnHeight = height;
-
+
dmxConfigCurrent->subentry
= dmxConfigAddSub(dmxConfigCurrent->subentry,
dmxConfigSubDisplay(dmxConfigCurrentDisplay));
dmxConfigEDCallback(w, closure, callData);
}
-static void dmxConfigDDCallback(Widget w, XtPointer closure,
- XtPointer callData)
+static void
+dmxConfigDDCallback(Widget w, XtPointer closure, XtPointer callData)
{
DMXConfigSubPtr pt;
- if (!dmxConfigCurrent || !dmxConfigCurrentDisplay) return;
- /* First */
+ if (!dmxConfigCurrent || !dmxConfigCurrentDisplay)
+ return;
+ /* First */
if (dmxConfigCurrent->subentry
&& dmxConfigCurrent->subentry->type == dmxConfigDisplay
&& dmxConfigCurrent->subentry->display == dmxConfigCurrentDisplay) {
dmxConfigCurrent->subentry = dmxConfigCurrent->subentry->next;
- } else {
+ }
+ else {
for (pt = dmxConfigCurrent->subentry; pt && pt->next; pt = pt->next)
if (pt->next->type == dmxConfigDisplay
&& pt->next->display == dmxConfigCurrentDisplay) {
@@ -762,21 +837,21 @@ static void dmxConfigDDCallback(Widget w, XtPointer closure,
dmxConfigCanvasDraw(NULL);
}
-static void dmxConfigAboutCallback(Widget w, XtPointer closure,
- XtPointer callData)
+static void
+dmxConfigAboutCallback(Widget w, XtPointer closure, XtPointer callData)
{
dmxConfigSetPopupPosition(aboutpopup);
XtPopup(aboutpopup, XtGrabExclusive);
}
-static void dmxConfigAboutOkCallback(Widget w, XtPointer closure,
- XtPointer CallData)
+static void
+dmxConfigAboutOkCallback(Widget w, XtPointer closure, XtPointer CallData)
{
XtPopdown(aboutpopup);
}
-static void dmxConfigQuitCallback(Widget w, XtPointer closure,
- XtPointer callData)
+static void
+dmxConfigQuitCallback(Widget w, XtPointer closure, XtPointer callData)
{
if (dmxConfigNotSaved) {
dmxConfigSetPopupPosition(quitpopup);
@@ -786,77 +861,82 @@ static void dmxConfigQuitCallback(Widget w, XtPointer closure,
exit(0);
}
-static void dmxConfigQuitOkCallback(Widget w, XtPointer closure,
- XtPointer callData)
+static void
+dmxConfigQuitOkCallback(Widget w, XtPointer closure, XtPointer callData)
{
XtPopdown(quitpopup);
exit(0);
}
-static void dmxConfigQuitCanCallback(Widget w, XtPointer closure,
- XtPointer callData)
+static void
+dmxConfigQuitCanCallback(Widget w, XtPointer closure, XtPointer callData)
{
XtPopdown(quitpopup);
}
-static void dmxConfigEDOkCallback(Widget w, XtPointer closure,
- XtPointer callData)
+static void
+dmxConfigEDOkCallback(Widget w, XtPointer closure, XtPointer callData)
{
char *value;
char *endpt;
-
+
dmxConfigNewDisplay = NULL;
- dmxConfigGetValueString((char **)&dmxConfigCurrentDisplay->name,
+ dmxConfigGetValueString((char **) &dmxConfigCurrentDisplay->name,
eddialog0);
- value = XawDialogGetValueString(eddialog1);
+ value = XawDialogGetValueString(eddialog1);
if (*value == '-' || *value == '+') {
- dmxConfigCurrentDisplay->scrnWidth = 0;
+ dmxConfigCurrentDisplay->scrnWidth = 0;
dmxConfigCurrentDisplay->scrnHeight = 0;
- endpt = value;
- } else {
- dmxConfigCurrentDisplay->scrnWidth = strtol(value, &endpt, 10);
- dmxConfigCurrentDisplay->scrnHeight = strtol(endpt+1, &endpt, 10);
+ endpt = value;
+ }
+ else {
+ dmxConfigCurrentDisplay->scrnWidth = strtol(value, &endpt, 10);
+ dmxConfigCurrentDisplay->scrnHeight = strtol(endpt + 1, &endpt, 10);
}
if (*endpt) {
- dmxConfigCurrentDisplay->scrnXSign = (*endpt == '-') ? -1 : 1;
- dmxConfigCurrentDisplay->scrnX = strtol(endpt+1, &endpt, 10);
- dmxConfigCurrentDisplay->scrnYSign = (*endpt == '-') ? -1 : 1;
- dmxConfigCurrentDisplay->scrnY = strtol(endpt+1, NULL, 10);
+ dmxConfigCurrentDisplay->scrnXSign = (*endpt == '-') ? -1 : 1;
+ dmxConfigCurrentDisplay->scrnX = strtol(endpt + 1, &endpt, 10);
+ dmxConfigCurrentDisplay->scrnYSign = (*endpt == '-') ? -1 : 1;
+ dmxConfigCurrentDisplay->scrnY = strtol(endpt + 1, NULL, 10);
}
if (dmxConfigCurrentDisplay->scrnX < 0)
dmxConfigCurrentDisplay->scrnX = -dmxConfigCurrentDisplay->scrnX;
if (dmxConfigCurrentDisplay->scrnY < 0)
dmxConfigCurrentDisplay->scrnY = -dmxConfigCurrentDisplay->scrnY;
- value = XawDialogGetValueString(eddialog2);
- dmxConfigCurrentDisplay->rootXOrigin = strtol(value+1, &endpt, 10);
- dmxConfigCurrentDisplay->rootYOrigin = strtol(endpt+1, NULL, 10);
+ value = XawDialogGetValueString(eddialog2);
+ dmxConfigCurrentDisplay->rootXOrigin = strtol(value + 1, &endpt, 10);
+ dmxConfigCurrentDisplay->rootYOrigin = strtol(endpt + 1, NULL, 10);
XtPopdown(edpopup);
dmxConfigSetupCnamemenu();
dmxConfigCanvasDraw(NULL);
dmxConfigNotSaved = 1;
}
-static void dmxConfigEDCanCallback(Widget w, XtPointer closure,
- XtPointer callData)
+static void
+dmxConfigEDCanCallback(Widget w, XtPointer closure, XtPointer callData)
{
- if (dmxConfigNewDisplay) dmxConfigDDCallback(w, closure, callData);
+ if (dmxConfigNewDisplay)
+ dmxConfigDDCallback(w, closure, callData);
dmxConfigNewDisplay = NULL;
XtPopdown(edpopup);
}
-static void dmxConfigOkAction(Widget w, XEvent *event,
- String *params, Cardinal *num_params)
+static void
+dmxConfigOkAction(Widget w, XEvent * event,
+ String * params, Cardinal * num_params)
{
Widget p = XtParent(w);
Widget t;
- if (p == opendialog) dmxConfigOkCallback(w, NULL, NULL);
+ if (p == opendialog)
+ dmxConfigOkCallback(w, NULL, NULL);
if (p == ecdialog0) {
t = XtNameToWidget(ecdialog1, "value");
XWarpPointer(XtDisplay(t), None, XtWindow(t), 0, 0, 0, 0, 0, 10);
}
- if (p == ecdialog1) dmxConfigECOkCallback(w, NULL, NULL);
+ if (p == ecdialog1)
+ dmxConfigECOkCallback(w, NULL, NULL);
if (p == eddialog0) {
t = XtNameToWidget(eddialog1, "value");
@@ -866,322 +946,285 @@ static void dmxConfigOkAction(Widget w, XEvent *event,
t = XtNameToWidget(eddialog2, "value");
XWarpPointer(XtDisplay(t), None, XtWindow(t), 0, 0, 0, 0, 0, 10);
}
- if (p == eddialog2) dmxConfigEDOkCallback(w, NULL, NULL);
+ if (p == eddialog2)
+ dmxConfigEDOkCallback(w, NULL, NULL);
}
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
{
- XtAppContext appContext;
- Widget toplevel;
- Widget parent, menubox, bottombox, databox, canvasbox;
- Widget filebutton, helpbutton;
- Widget filemenu, openbutton, savebutton, quitbutton;
- Widget helpmenu, aboutbutton, aboutbox, aboutok;
- Widget quitbox, quitok, quitcan;
- Widget ncbutton;
- Widget canbutton;
- Widget ecbox, ecokbutton, eccanbutton;
- Widget edbox, edokbutton;
- Widget edcanbutton;
- /* FIXME: add meta-i, ctrl,meta-z,v? */
- const char *opentrans = "<Key>Return: openOk()\n\
+ XtAppContext appContext;
+ Widget toplevel;
+ Widget parent, menubox, bottombox, databox, canvasbox;
+ Widget filebutton, helpbutton;
+ Widget filemenu, openbutton, savebutton, quitbutton;
+ Widget helpmenu, aboutbutton, aboutbox, aboutok;
+ Widget quitbox, quitok, quitcan;
+ Widget ncbutton;
+ Widget canbutton;
+ Widget ecbox, ecokbutton, eccanbutton;
+ Widget edbox, edokbutton;
+ Widget edcanbutton;
+
+ /* FIXME: add meta-i, ctrl,meta-z,v? */
+ const char *opentrans = "<Key>Return: openOk()\n\
<Key>Linefeed: openOk()\n\
Ctrl<Key>M: openOk()\n\
Ctrl<Key>J: openOk()\n\
Ctrl<Key>O: noop()\n\
Ctrl<Key>N: noop()\n\
Ctrl<Key>P: noop()";
- const char *canvastrans =
+ const char *canvastrans =
"<Btn3Down>: placeMenu() XtMenuPopup(buttonpopup)";
- XtActionsRec actiontable[] = {
- { "openOk", dmxConfigOkAction },
- { "placeMenu", dmxConfigPlaceMenu },
- { "noop", NULL }
+ XtActionsRec actiontable[] = {
+ {"openOk", dmxConfigOkAction},
+ {"placeMenu", dmxConfigPlaceMenu},
+ {"noop", NULL}
};
dmxConfigFilename = XtNewString((argc >= 2) ? argv[1] : "");
- toplevel = XtVaAppInitialize(&appContext, "XDmxconfig",
- NULL, 0,
- &argc, argv,
- NULL,
- NULL);
-
- /* Main boxes */
- parent = XtVaCreateManagedWidget("parent", formWidgetClass, toplevel,
- XtNorientation, XtorientVertical,
- XtNwidth, DMX_MAIN_WIDTH,
- XtNheight, DMX_MAIN_HEIGHT,
- NULL);
- menubox = XtVaCreateManagedWidget("menubox", boxWidgetClass, parent,
- XtNborderWidth, 0,
- XtNorientation, XtorientHorizontal,
- XtNtop, XtChainTop,
- NULL);
- bottombox = XtVaCreateManagedWidget("bottombox", formWidgetClass, parent,
- XtNborderWidth, 0,
- XtNfromVert, menubox,
- XtNorientation, XtorientHorizontal,
- NULL);
- databox = XtVaCreateManagedWidget("databox", formWidgetClass,
- bottombox,
- XtNborderWidth, 0,
- XtNhorizDistance, 0,
- XtNwidth, DMX_DATA_WIDTH,
- XtNheight, DMX_DATA_HEIGHT,
- XtNleft, XtChainLeft,
- XtNorientation, XtorientVertical,
- NULL);
-
- /* Data */
- cnamebox = XtVaCreateManagedWidget("cnamebox", menuButtonWidgetClass,
- databox,
- XtNtop, XtChainTop,
- XtNjustify, XtJustifyLeft,
- XtNwidth, DMX_DATA_WIDTH,
- XtNlabel, "",
- XtNmenuName, "cnamemenu",
- NULL);
- cdimbox = XtVaCreateManagedWidget("cdimbox", labelWidgetClass,
- databox,
- XtNfromVert, cnamebox,
- XtNjustify, XtJustifyLeft,
- XtNwidth, DMX_DATA_WIDTH,
- XtNlabel, "",
- NULL);
- namebox = XtVaCreateManagedWidget("namebox", labelWidgetClass, databox,
- XtNfromVert, cdimbox,
- XtNjustify, XtJustifyLeft,
- XtNwidth, DMX_DATA_WIDTH,
- XtNlabel, "",
- NULL);
- dimbox = XtVaCreateManagedWidget("dimbox", labelWidgetClass,
- databox,
- XtNfromVert, namebox,
- XtNjustify, XtJustifyLeft,
- XtNwidth, DMX_DATA_WIDTH,
- XtNlabel, "",
- NULL);
- rtbox = XtVaCreateManagedWidget("rtbox", labelWidgetClass,
- databox,
- XtNfromVert, dimbox,
- XtNjustify, XtJustifyLeft,
- XtNwidth, DMX_DATA_WIDTH,
- XtNlabel, "",
- NULL);
- origbox = XtVaCreateManagedWidget("origbox", labelWidgetClass,
- databox,
- XtNfromVert, rtbox,
- XtNjustify, XtJustifyLeft,
- XtNwidth, DMX_DATA_WIDTH,
- XtNlabel, "",
- NULL);
-
- /* Canvas */
- canvasbox = XtVaCreateManagedWidget("canvasbox", boxWidgetClass,
- bottombox,
- XtNborderWidth, 0,
- XtNwidth, DMX_CANVAS_WIDTH,
- XtNheight, DMX_CANVAS_HEIGHT,
- XtNfromHoriz, databox,
- NULL);
-
- canvas = XtVaCreateManagedWidget("canvas", canvasWidgetClass,
- canvasbox,
- XtNwidth, DMX_CANVAS_WIDTH,
- XtNheight, DMX_CANVAS_HEIGHT,
- NULL);
-
-
- /* Main menu buttons */
- filebutton = XtVaCreateManagedWidget("File", menuButtonWidgetClass,
- menubox,
- XtNmenuName, "filemenu",
- NULL);
- helpbutton = XtVaCreateManagedWidget("Help", menuButtonWidgetClass,
- menubox,
- XtNmenuName, "helpmenu",
- NULL);
-
-
- /* File submenu buttons */
- filemenu = XtVaCreatePopupShell("filemenu", simpleMenuWidgetClass,
- filebutton, NULL);
- openbutton = XtVaCreateManagedWidget("Open File", smeBSBObjectClass,
- filemenu, NULL);
- savebutton = XtVaCreateManagedWidget("Save File", smeBSBObjectClass,
- filemenu,
- NULL);
- ncbutton = XtVaCreateManagedWidget("New Global", smeBSBObjectClass,
- filemenu, NULL);
- ecbutton = XtVaCreateManagedWidget("Edit Global", smeBSBObjectClass,
- filemenu,
- NULL);
- dcbutton = XtVaCreateManagedWidget("Delete Global", smeBSBObjectClass,
- filemenu,
- NULL);
- ndbutton0 = XtVaCreateManagedWidget("New Display", smeBSBObjectClass,
- filemenu,
- NULL);
- quitbutton = XtVaCreateManagedWidget("Quit", smeBSBObjectClass,
- filemenu, NULL);
-
- /* Help submenu button */
- helpmenu = XtVaCreatePopupShell("helpmenu", simpleMenuWidgetClass,
- helpbutton, NULL);
- aboutbutton = XtVaCreateManagedWidget("About", smeBSBObjectClass,
- helpmenu, NULL);
-
- /* Open popup */
- openpopup = XtVaCreatePopupShell("openpopup", transientShellWidgetClass,
- toplevel, NULL);
- opendialog = XtVaCreateManagedWidget("opendialog", dialogWidgetClass,
- openpopup,
- XtNlabel, "Filename: ",
- XtNvalue, dmxConfigFilename,
- NULL);
- okbutton = XtVaCreateManagedWidget("Open", commandWidgetClass,
- opendialog, NULL);
- canbutton = XtVaCreateManagedWidget("Cancel", commandWidgetClass,
- opendialog, NULL);
-
- /* EC popup */
- ecpopup = XtVaCreatePopupShell("ecpopup", transientShellWidgetClass,
- toplevel, NULL);
- ecbox = XtVaCreateManagedWidget("ecbox", boxWidgetClass,
- ecpopup, NULL);
- ecdialog0 = XtVaCreateManagedWidget("ecdialog0", dialogWidgetClass,
- ecbox,
- XtNlabel, "Name: ",
- XtNvalue, "",
- NULL);
- ecdialog1 = XtVaCreateManagedWidget("ecdialog1", dialogWidgetClass,
- ecbox,
- XtNlabel, "Dimension: ",
- XtNvalue, "",
- NULL);
- ecokbutton = XtVaCreateManagedWidget("OK", commandWidgetClass,
- ecbox, NULL);
- eccanbutton = XtVaCreateManagedWidget("Cancel", commandWidgetClass,
- ecbox, NULL);
-
- /* ED popup */
- edpopup = XtVaCreatePopupShell("edpopup", transientShellWidgetClass,
- toplevel, NULL);
- edbox = XtVaCreateManagedWidget("edbox", boxWidgetClass,
- edpopup, NULL);
- eddialog0 = XtVaCreateManagedWidget("eddialog0", dialogWidgetClass,
- edbox,
- XtNlabel, "Display Name: ",
- XtNvalue, "",
- NULL);
- eddialog1 = XtVaCreateManagedWidget("eddialog1", dialogWidgetClass,
- edbox,
- XtNlabel, "Geometry: ",
- XtNvalue, "",
- NULL);
- eddialog2 = XtVaCreateManagedWidget("eddialog2", dialogWidgetClass,
- edbox,
- XtNlabel, "Offset: ",
- XtNvalue, "",
- NULL);
- edokbutton = XtVaCreateManagedWidget("OK", commandWidgetClass,
- edbox, NULL);
- edcanbutton = XtVaCreateManagedWidget("Cancel", commandWidgetClass,
- edbox, NULL);
-
- /* About popup */
- aboutpopup = XtVaCreatePopupShell("aboutpopup",transientShellWidgetClass,
- toplevel, NULL);
- aboutbox = XtVaCreateManagedWidget("aboutbox", boxWidgetClass,
- aboutpopup, NULL);
- XtVaCreateManagedWidget("abouttext", labelWidgetClass,
- aboutbox,
- XtNlabel, DMX_INFO,
- NULL);
- aboutok = XtVaCreateManagedWidget("OK", commandWidgetClass,
- aboutbox, NULL);
-
- /* Quit popup */
- quitpopup = XtVaCreatePopupShell("quitpopup",transientShellWidgetClass,
- toplevel, NULL);
- quitbox = XtVaCreateManagedWidget("quitbox", boxWidgetClass,
- quitpopup, NULL);
- XtVaCreateManagedWidget("quittext", labelWidgetClass,
- quitbox,
- XtNlabel,
- "Changes to the configuration\n"
- "been made that have not yet\n"
- "been saved. Do you want to\n"
- "quit without saving?",
- NULL);
- quitok = XtVaCreateManagedWidget("Quit WITHOUT Saving",
- commandWidgetClass,
- quitbox, NULL);
- quitcan = XtVaCreateManagedWidget("Continue Editing",
- commandWidgetClass,
- quitbox, NULL);
-
- /* Button popup */
- buttonpopup = XtVaCreatePopupShell("buttonpopup", simpleMenuWidgetClass,
- toplevel, NULL);
- ndbutton1 = XtVaCreateManagedWidget("New Display", smeBSBObjectClass,
- buttonpopup,
- NULL);
- edbutton = XtVaCreateManagedWidget("Edit Display", smeBSBObjectClass,
- buttonpopup,
- NULL);
- ddbutton = XtVaCreateManagedWidget("Delete Display", smeBSBObjectClass,
- buttonpopup,
- NULL);
-
- /* Callbacks */
- XtAddCallback(openbutton, XtNcallback, dmxConfigOpenCallback, NULL);
- XtAddCallback(savebutton, XtNcallback, dmxConfigSaveCallback, NULL);
- XtAddCallback(okbutton, XtNcallback, dmxConfigOkCallback, NULL);
- XtAddCallback(canbutton, XtNcallback, dmxConfigCanCallback, NULL);
-
+ toplevel = XtVaAppInitialize(&appContext, "XDmxconfig",
+ NULL, 0, &argc, argv, NULL, NULL);
+
+ /* Main boxes */
+ parent = XtVaCreateManagedWidget("parent", formWidgetClass, toplevel,
+ XtNorientation, XtorientVertical,
+ XtNwidth, DMX_MAIN_WIDTH,
+ XtNheight, DMX_MAIN_HEIGHT, NULL);
+ menubox = XtVaCreateManagedWidget("menubox", boxWidgetClass, parent,
+ XtNborderWidth, 0,
+ XtNorientation, XtorientHorizontal,
+ XtNtop, XtChainTop, NULL);
+ bottombox = XtVaCreateManagedWidget("bottombox", formWidgetClass, parent,
+ XtNborderWidth, 0,
+ XtNfromVert, menubox,
+ XtNorientation, XtorientHorizontal,
+ NULL);
+ databox = XtVaCreateManagedWidget("databox", formWidgetClass,
+ bottombox,
+ XtNborderWidth, 0,
+ XtNhorizDistance, 0,
+ XtNwidth, DMX_DATA_WIDTH,
+ XtNheight, DMX_DATA_HEIGHT,
+ XtNleft, XtChainLeft,
+ XtNorientation, XtorientVertical, NULL);
+
+ /* Data */
+ cnamebox = XtVaCreateManagedWidget("cnamebox", menuButtonWidgetClass,
+ databox,
+ XtNtop, XtChainTop,
+ XtNjustify, XtJustifyLeft,
+ XtNwidth, DMX_DATA_WIDTH,
+ XtNlabel, "",
+ XtNmenuName, "cnamemenu", NULL);
+ cdimbox = XtVaCreateManagedWidget("cdimbox", labelWidgetClass,
+ databox,
+ XtNfromVert, cnamebox,
+ XtNjustify, XtJustifyLeft,
+ XtNwidth, DMX_DATA_WIDTH,
+ XtNlabel, "", NULL);
+ namebox = XtVaCreateManagedWidget("namebox", labelWidgetClass, databox,
+ XtNfromVert, cdimbox,
+ XtNjustify, XtJustifyLeft,
+ XtNwidth, DMX_DATA_WIDTH,
+ XtNlabel, "", NULL);
+ dimbox = XtVaCreateManagedWidget("dimbox", labelWidgetClass,
+ databox,
+ XtNfromVert, namebox,
+ XtNjustify, XtJustifyLeft,
+ XtNwidth, DMX_DATA_WIDTH,
+ XtNlabel, "", NULL);
+ rtbox = XtVaCreateManagedWidget("rtbox", labelWidgetClass,
+ databox,
+ XtNfromVert, dimbox,
+ XtNjustify, XtJustifyLeft,
+ XtNwidth, DMX_DATA_WIDTH,
+ XtNlabel, "", NULL);
+ origbox = XtVaCreateManagedWidget("origbox", labelWidgetClass,
+ databox,
+ XtNfromVert, rtbox,
+ XtNjustify, XtJustifyLeft,
+ XtNwidth, DMX_DATA_WIDTH,
+ XtNlabel, "", NULL);
+
+ /* Canvas */
+ canvasbox = XtVaCreateManagedWidget("canvasbox", boxWidgetClass,
+ bottombox,
+ XtNborderWidth, 0,
+ XtNwidth, DMX_CANVAS_WIDTH,
+ XtNheight, DMX_CANVAS_HEIGHT,
+ XtNfromHoriz, databox, NULL);
+
+ canvas = XtVaCreateManagedWidget("canvas", canvasWidgetClass,
+ canvasbox,
+ XtNwidth, DMX_CANVAS_WIDTH,
+ XtNheight, DMX_CANVAS_HEIGHT, NULL);
+
+ /* Main menu buttons */
+ filebutton = XtVaCreateManagedWidget("File", menuButtonWidgetClass,
+ menubox,
+ XtNmenuName, "filemenu", NULL);
+ helpbutton = XtVaCreateManagedWidget("Help", menuButtonWidgetClass,
+ menubox,
+ XtNmenuName, "helpmenu", NULL);
+
+ /* File submenu buttons */
+ filemenu = XtVaCreatePopupShell("filemenu", simpleMenuWidgetClass,
+ filebutton, NULL);
+ openbutton = XtVaCreateManagedWidget("Open File", smeBSBObjectClass,
+ filemenu, NULL);
+ savebutton = XtVaCreateManagedWidget("Save File", smeBSBObjectClass,
+ filemenu, NULL);
+ ncbutton = XtVaCreateManagedWidget("New Global", smeBSBObjectClass,
+ filemenu, NULL);
+ ecbutton = XtVaCreateManagedWidget("Edit Global", smeBSBObjectClass,
+ filemenu, NULL);
+ dcbutton = XtVaCreateManagedWidget("Delete Global", smeBSBObjectClass,
+ filemenu, NULL);
+ ndbutton0 = XtVaCreateManagedWidget("New Display", smeBSBObjectClass,
+ filemenu, NULL);
+ quitbutton = XtVaCreateManagedWidget("Quit", smeBSBObjectClass,
+ filemenu, NULL);
+
+ /* Help submenu button */
+ helpmenu = XtVaCreatePopupShell("helpmenu", simpleMenuWidgetClass,
+ helpbutton, NULL);
+ aboutbutton = XtVaCreateManagedWidget("About", smeBSBObjectClass,
+ helpmenu, NULL);
+
+ /* Open popup */
+ openpopup = XtVaCreatePopupShell("openpopup", transientShellWidgetClass,
+ toplevel, NULL);
+ opendialog = XtVaCreateManagedWidget("opendialog", dialogWidgetClass,
+ openpopup,
+ XtNlabel, "Filename: ",
+ XtNvalue, dmxConfigFilename, NULL);
+ okbutton = XtVaCreateManagedWidget("Open", commandWidgetClass,
+ opendialog, NULL);
+ canbutton = XtVaCreateManagedWidget("Cancel", commandWidgetClass,
+ opendialog, NULL);
+
+ /* EC popup */
+ ecpopup = XtVaCreatePopupShell("ecpopup", transientShellWidgetClass,
+ toplevel, NULL);
+ ecbox = XtVaCreateManagedWidget("ecbox", boxWidgetClass, ecpopup, NULL);
+ ecdialog0 = XtVaCreateManagedWidget("ecdialog0", dialogWidgetClass,
+ ecbox,
+ XtNlabel, "Name: ",
+ XtNvalue, "", NULL);
+ ecdialog1 = XtVaCreateManagedWidget("ecdialog1", dialogWidgetClass,
+ ecbox,
+ XtNlabel, "Dimension: ",
+ XtNvalue, "", NULL);
+ ecokbutton = XtVaCreateManagedWidget("OK", commandWidgetClass, ecbox, NULL);
+ eccanbutton = XtVaCreateManagedWidget("Cancel", commandWidgetClass,
+ ecbox, NULL);
+
+ /* ED popup */
+ edpopup = XtVaCreatePopupShell("edpopup", transientShellWidgetClass,
+ toplevel, NULL);
+ edbox = XtVaCreateManagedWidget("edbox", boxWidgetClass, edpopup, NULL);
+ eddialog0 = XtVaCreateManagedWidget("eddialog0", dialogWidgetClass,
+ edbox,
+ XtNlabel, "Display Name: ",
+ XtNvalue, "", NULL);
+ eddialog1 = XtVaCreateManagedWidget("eddialog1", dialogWidgetClass,
+ edbox,
+ XtNlabel, "Geometry: ",
+ XtNvalue, "", NULL);
+ eddialog2 = XtVaCreateManagedWidget("eddialog2", dialogWidgetClass,
+ edbox,
+ XtNlabel, "Offset: ",
+ XtNvalue, "", NULL);
+ edokbutton = XtVaCreateManagedWidget("OK", commandWidgetClass, edbox, NULL);
+ edcanbutton = XtVaCreateManagedWidget("Cancel", commandWidgetClass,
+ edbox, NULL);
+
+ /* About popup */
+ aboutpopup = XtVaCreatePopupShell("aboutpopup", transientShellWidgetClass,
+ toplevel, NULL);
+ aboutbox = XtVaCreateManagedWidget("aboutbox", boxWidgetClass,
+ aboutpopup, NULL);
+ XtVaCreateManagedWidget("abouttext", labelWidgetClass,
+ aboutbox, XtNlabel, DMX_INFO, NULL);
+ aboutok = XtVaCreateManagedWidget("OK", commandWidgetClass, aboutbox, NULL);
+
+ /* Quit popup */
+ quitpopup = XtVaCreatePopupShell("quitpopup", transientShellWidgetClass,
+ toplevel, NULL);
+ quitbox = XtVaCreateManagedWidget("quitbox", boxWidgetClass,
+ quitpopup, NULL);
+ XtVaCreateManagedWidget("quittext", labelWidgetClass,
+ quitbox,
+ XtNlabel,
+ "Changes to the configuration\n"
+ "been made that have not yet\n"
+ "been saved. Do you want to\n"
+ "quit without saving?", NULL);
+ quitok = XtVaCreateManagedWidget("Quit WITHOUT Saving",
+ commandWidgetClass, quitbox, NULL);
+ quitcan = XtVaCreateManagedWidget("Continue Editing",
+ commandWidgetClass, quitbox, NULL);
+
+ /* Button popup */
+ buttonpopup = XtVaCreatePopupShell("buttonpopup", simpleMenuWidgetClass,
+ toplevel, NULL);
+ ndbutton1 = XtVaCreateManagedWidget("New Display", smeBSBObjectClass,
+ buttonpopup, NULL);
+ edbutton = XtVaCreateManagedWidget("Edit Display", smeBSBObjectClass,
+ buttonpopup, NULL);
+ ddbutton = XtVaCreateManagedWidget("Delete Display", smeBSBObjectClass,
+ buttonpopup, NULL);
+
+ /* Callbacks */
+ XtAddCallback(openbutton, XtNcallback, dmxConfigOpenCallback, NULL);
+ XtAddCallback(savebutton, XtNcallback, dmxConfigSaveCallback, NULL);
+ XtAddCallback(okbutton, XtNcallback, dmxConfigOkCallback, NULL);
+ XtAddCallback(canbutton, XtNcallback, dmxConfigCanCallback, NULL);
+
XtAppAddActions(appContext, actiontable, XtNumber(actiontable));
XtOverrideTranslations(canvas, XtParseTranslationTable(canvastrans));
XtOverrideTranslations(XtNameToWidget(opendialog, "value"),
- XtParseTranslationTable(opentrans));
+ XtParseTranslationTable(opentrans));
XtOverrideTranslations(XtNameToWidget(ecdialog0, "value"),
- XtParseTranslationTable(opentrans));
+ XtParseTranslationTable(opentrans));
XtOverrideTranslations(XtNameToWidget(ecdialog1, "value"),
- XtParseTranslationTable(opentrans));
+ XtParseTranslationTable(opentrans));
XtOverrideTranslations(XtNameToWidget(eddialog0, "value"),
- XtParseTranslationTable(opentrans));
+ XtParseTranslationTable(opentrans));
XtOverrideTranslations(XtNameToWidget(eddialog1, "value"),
- XtParseTranslationTable(opentrans));
+ XtParseTranslationTable(opentrans));
XtOverrideTranslations(XtNameToWidget(eddialog2, "value"),
- XtParseTranslationTable(opentrans));
-
- XtAddCallback(ncbutton, XtNcallback, dmxConfigNCCallback, NULL);
- XtAddCallback(ecbutton, XtNcallback, dmxConfigECCallback, NULL);
- XtAddCallback(ecokbutton, XtNcallback, dmxConfigECOkCallback, NULL);
- XtAddCallback(eccanbutton, XtNcallback, dmxConfigECCanCallback, NULL);
- XtAddCallback(dcbutton, XtNcallback, dmxConfigDCCallback, NULL);
-
- XtAddCallback(ndbutton0, XtNcallback, dmxConfigNDCallback, NULL);
- XtAddCallback(ndbutton1, XtNcallback, dmxConfigNDCallback, NULL);
- XtAddCallback(edbutton, XtNcallback, dmxConfigEDCallback, NULL);
- XtAddCallback(ddbutton, XtNcallback, dmxConfigDDCallback, NULL);
- XtAddCallback(edokbutton, XtNcallback, dmxConfigEDOkCallback, NULL);
- XtAddCallback(edcanbutton, XtNcallback, dmxConfigEDCanCallback, NULL);
-
- XtAddCallback(aboutbutton, XtNcallback, dmxConfigAboutCallback, NULL);
- XtAddCallback(aboutok, XtNcallback, dmxConfigAboutOkCallback, NULL);
- XtAddCallback(quitok, XtNcallback, dmxConfigQuitOkCallback, NULL);
- XtAddCallback(quitcan, XtNcallback, dmxConfigQuitCanCallback, NULL);
-
- XtAddCallback(quitbutton, XtNcallback, dmxConfigQuitCallback, NULL);
-
- XtAddCallback(canvas, XtNcallback, dmxConfigCanvasInput, NULL);
- XtAddCallback(canvas, XtNcanvasExposeCallback, dmxConfigCanvasExpose,NULL);
- XtAddCallback(canvas, XtNcanvasResizeCallback, dmxConfigCanvasResize,NULL);
-
- if (dmxConfigFilename) dmxConfigReadFile();
-
+ XtParseTranslationTable(opentrans));
+
+ XtAddCallback(ncbutton, XtNcallback, dmxConfigNCCallback, NULL);
+ XtAddCallback(ecbutton, XtNcallback, dmxConfigECCallback, NULL);
+ XtAddCallback(ecokbutton, XtNcallback, dmxConfigECOkCallback, NULL);
+ XtAddCallback(eccanbutton, XtNcallback, dmxConfigECCanCallback, NULL);
+ XtAddCallback(dcbutton, XtNcallback, dmxConfigDCCallback, NULL);
+
+ XtAddCallback(ndbutton0, XtNcallback, dmxConfigNDCallback, NULL);
+ XtAddCallback(ndbutton1, XtNcallback, dmxConfigNDCallback, NULL);
+ XtAddCallback(edbutton, XtNcallback, dmxConfigEDCallback, NULL);
+ XtAddCallback(ddbutton, XtNcallback, dmxConfigDDCallback, NULL);
+ XtAddCallback(edokbutton, XtNcallback, dmxConfigEDOkCallback, NULL);
+ XtAddCallback(edcanbutton, XtNcallback, dmxConfigEDCanCallback, NULL);
+
+ XtAddCallback(aboutbutton, XtNcallback, dmxConfigAboutCallback, NULL);
+ XtAddCallback(aboutok, XtNcallback, dmxConfigAboutOkCallback, NULL);
+ XtAddCallback(quitok, XtNcallback, dmxConfigQuitOkCallback, NULL);
+ XtAddCallback(quitcan, XtNcallback, dmxConfigQuitCanCallback, NULL);
+
+ XtAddCallback(quitbutton, XtNcallback, dmxConfigQuitCallback, NULL);
+
+ XtAddCallback(canvas, XtNcallback, dmxConfigCanvasInput, NULL);
+ XtAddCallback(canvas, XtNcanvasExposeCallback, dmxConfigCanvasExpose, NULL);
+ XtAddCallback(canvas, XtNcanvasResizeCallback, dmxConfigCanvasResize, NULL);
+
+ if (dmxConfigFilename)
+ dmxConfigReadFile();
+
XtRealizeWidget(toplevel);
dmxConfigCopystrings();
dmxConfigSetupCnamemenu();
diff --git a/hw/dmx/dmx-config.h b/hw/dmx/dmx-config.h
index 1fda69f45..c435ece2e 100644
--- a/hw/dmx/dmx-config.h
+++ b/hw/dmx/dmx-config.h
@@ -72,4 +72,4 @@
/* Enable the DMX extension */
#define DMXEXT
-#endif /* DMX_CONFIG_H */
+#endif /* DMX_CONFIG_H */
diff --git a/hw/dmx/dmx.c b/hw/dmx/dmx.c
index 01a744849..add0e5390 100644
--- a/hw/dmx/dmx.c
+++ b/hw/dmx/dmx.c
@@ -62,16 +62,15 @@
#ifdef PANORAMIX
#include "panoramiX.h"
extern unsigned long XRT_WINDOW;
-extern int PanoramiXNumScreens;
+extern int PanoramiXNumScreens;
#endif
extern void DMXExtensionInit(void);
static unsigned char DMXCode;
-
-
-static int _DMXXineramaActive(void)
+static int
+_DMXXineramaActive(void)
{
#ifdef PANORAMIX
return !noPanoramiXExtension;
@@ -79,31 +78,51 @@ static int _DMXXineramaActive(void)
return 0;
}
-static void dmxSetScreenAttribute(int bit, DMXScreenAttributesPtr attr,
- CARD32 value)
+static void
+dmxSetScreenAttribute(int bit, DMXScreenAttributesPtr attr, CARD32 value)
{
switch (1 << bit) {
- case DMXScreenWindowWidth: attr->screenWindowWidth = value; break;
- case DMXScreenWindowHeight: attr->screenWindowHeight = value; break;
- case DMXScreenWindowXoffset: attr->screenWindowXoffset = value; break;
- case DMXScreenWindowYoffset: attr->screenWindowYoffset = value; break;
- case DMXRootWindowWidth: attr->rootWindowWidth = value; break;
- case DMXRootWindowHeight: attr->rootWindowHeight = value; break;
- case DMXRootWindowXoffset: attr->rootWindowXoffset = value; break;
- case DMXRootWindowYoffset: attr->rootWindowYoffset = value; break;
- case DMXRootWindowXorigin: attr->rootWindowXorigin = value; break;
- case DMXRootWindowYorigin: attr->rootWindowYorigin = value; break;
+ case DMXScreenWindowWidth:
+ attr->screenWindowWidth = value;
+ break;
+ case DMXScreenWindowHeight:
+ attr->screenWindowHeight = value;
+ break;
+ case DMXScreenWindowXoffset:
+ attr->screenWindowXoffset = value;
+ break;
+ case DMXScreenWindowYoffset:
+ attr->screenWindowYoffset = value;
+ break;
+ case DMXRootWindowWidth:
+ attr->rootWindowWidth = value;
+ break;
+ case DMXRootWindowHeight:
+ attr->rootWindowHeight = value;
+ break;
+ case DMXRootWindowXoffset:
+ attr->rootWindowXoffset = value;
+ break;
+ case DMXRootWindowYoffset:
+ attr->rootWindowYoffset = value;
+ break;
+ case DMXRootWindowXorigin:
+ attr->rootWindowXorigin = value;
+ break;
+ case DMXRootWindowYorigin:
+ attr->rootWindowYorigin = value;
+ break;
}
}
-static int dmxFetchScreenAttributes(unsigned int mask,
- DMXScreenAttributesPtr attr,
- CARD32 *value_list)
+static int
+dmxFetchScreenAttributes(unsigned int mask,
+ DMXScreenAttributesPtr attr, CARD32 *value_list)
{
- int i;
+ int i;
CARD32 *value = value_list;
- int count = 0;
-
+ int count = 0;
+
for (i = 0; i < 32; i++) {
if (mask & (1 << i)) {
dmxSetScreenAttribute(i, attr, *value);
@@ -114,52 +133,66 @@ static int dmxFetchScreenAttributes(unsigned int mask,
return count;
}
-static void dmxSetDesktopAttribute(int bit, DMXDesktopAttributesPtr attr,
- CARD32 value)
+static void
+dmxSetDesktopAttribute(int bit, DMXDesktopAttributesPtr attr, CARD32 value)
{
switch (1 << bit) {
- case DMXDesktopWidth: attr->width = value; break;
- case DMXDesktopHeight: attr->height = value; break;
- case DMXDesktopShiftX: attr->shiftX = value; break;
- case DMXDesktopShiftY: attr->shiftY = value; break;
+ case DMXDesktopWidth:
+ attr->width = value;
+ break;
+ case DMXDesktopHeight:
+ attr->height = value;
+ break;
+ case DMXDesktopShiftX:
+ attr->shiftX = value;
+ break;
+ case DMXDesktopShiftY:
+ attr->shiftY = value;
+ break;
}
}
-static int dmxFetchDesktopAttributes(unsigned int mask,
- DMXDesktopAttributesPtr attr,
- CARD32 *value_list)
+static int
+dmxFetchDesktopAttributes(unsigned int mask,
+ DMXDesktopAttributesPtr attr, CARD32 *value_list)
{
- int i;
+ int i;
CARD32 *value = value_list;
- int count = 0;
-
+ int count = 0;
+
for (i = 0; i < 32; i++) {
if (mask & (1 << i)) {
dmxSetDesktopAttribute(i, attr, *value);
- ++value;
+ ++value;
++count;
}
}
return count;
}
-static void dmxSetInputAttribute(int bit, DMXInputAttributesPtr attr,
- CARD32 value)
+static void
+dmxSetInputAttribute(int bit, DMXInputAttributesPtr attr, CARD32 value)
{
switch (1 << bit) {
- case DMXInputType: attr->inputType = value; break;
- case DMXInputPhysicalScreen: attr->physicalScreen = value; break;
- case DMXInputSendsCore: attr->sendsCore = !!value; break;
+ case DMXInputType:
+ attr->inputType = value;
+ break;
+ case DMXInputPhysicalScreen:
+ attr->physicalScreen = value;
+ break;
+ case DMXInputSendsCore:
+ attr->sendsCore = ! !value;
+ break;
}
}
-static int dmxFetchInputAttributes(unsigned int mask,
- DMXInputAttributesPtr attr,
- CARD32 *value_list)
+static int
+dmxFetchInputAttributes(unsigned int mask,
+ DMXInputAttributesPtr attr, CARD32 *value_list)
{
- int i;
+ int i;
CARD32 *value = value_list;
- int count = 0;
+ int count = 0;
for (i = 0; i < 32; i++) {
if (mask & (1 << i)) {
@@ -171,30 +204,32 @@ static int dmxFetchInputAttributes(unsigned int mask,
return count;
}
-static int ProcDMXQueryVersion(ClientPtr client)
+static int
+ProcDMXQueryVersion(ClientPtr client)
{
xDMXQueryVersionReply rep;
REQUEST_SIZE_MATCH(xDMXQueryVersionReq);
- rep.type = X_Reply;
+ rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.majorVersion = SERVER_DMX_MAJOR_VERSION;
- rep.minorVersion = SERVER_DMX_MINOR_VERSION;
- rep.patchVersion = SERVER_DMX_PATCH_VERSION;
+ rep.length = 0;
+ rep.majorVersion = SERVER_DMX_MAJOR_VERSION;
+ rep.minorVersion = SERVER_DMX_MINOR_VERSION;
+ rep.patchVersion = SERVER_DMX_PATCH_VERSION;
if (client->swapped) {
- swaps(&rep.sequenceNumber);
- swapl(&rep.length);
- swapl(&rep.majorVersion);
- swapl(&rep.minorVersion);
- swapl(&rep.patchVersion);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.majorVersion);
+ swapl(&rep.minorVersion);
+ swapl(&rep.patchVersion);
}
- WriteToClient(client, sizeof(xDMXQueryVersionReply), (char *)&rep);
+ WriteToClient(client, sizeof(xDMXQueryVersionReply), (char *) &rep);
return Success;
}
-static int ProcDMXSync(ClientPtr client)
+static int
+ProcDMXSync(ClientPtr client)
{
xDMXSyncReply rep;
@@ -202,41 +237,43 @@ static int ProcDMXSync(ClientPtr client)
dmxFlushPendingSyncs();
- rep.type = X_Reply;
+ rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.status = 0;
+ rep.length = 0;
+ rep.status = 0;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.status);
}
- WriteToClient(client, sizeof(xDMXSyncReply), (char *)&rep);
+ WriteToClient(client, sizeof(xDMXSyncReply), (char *) &rep);
return Success;
}
-static int ProcDMXForceWindowCreation(ClientPtr client)
+static int
+ProcDMXForceWindowCreation(ClientPtr client)
{
xDMXForceWindowCreationReply rep;
+
REQUEST(xDMXForceWindowCreationReq);
- WindowPtr pWin;
+ WindowPtr pWin;
REQUEST_SIZE_MATCH(xDMXForceWindowCreationReq);
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
PanoramiXRes *win;
- int i;
+ int i;
- if (Success != dixLookupResourceByType((pointer*) &win,
- stuff->window, XRT_WINDOW,
- client, DixReadAccess))
- return -1; /* BadWindow */
+ if (Success != dixLookupResourceByType((pointer *) &win,
+ stuff->window, XRT_WINDOW,
+ client, DixReadAccess))
+ return -1; /* BadWindow */
FOR_NSCREENS(i) {
if (Success != dixLookupWindow(&pWin, win->info[i].id, client,
- DixReadAccess))
- return -1; /* BadWindow */
+ DixReadAccess))
+ return -1; /* BadWindow */
dmxForceWindowCreation(pWin);
}
@@ -244,80 +281,84 @@ static int ProcDMXForceWindowCreation(ClientPtr client)
}
#endif
- if (Success != dixLookupWindow(&pWin, stuff->window, client,
- DixReadAccess))
- return -1; /* BadWindow */
+ if (Success != dixLookupWindow(&pWin, stuff->window, client, DixReadAccess))
+ return -1; /* BadWindow */
dmxForceWindowCreation(pWin);
- doreply:
+ doreply:
dmxFlushPendingSyncs();
- rep.type = X_Reply;
+ rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.status = 0;
+ rep.length = 0;
+ rep.status = 0;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.status);
}
- WriteToClient(client, sizeof(xDMXForceWindowCreationReply), (char *)&rep);
+ WriteToClient(client, sizeof(xDMXForceWindowCreationReply), (char *) &rep);
return Success;
}
-static int ProcDMXGetScreenCount(ClientPtr client)
+static int
+ProcDMXGetScreenCount(ClientPtr client)
{
xDMXGetScreenCountReply rep;
REQUEST_SIZE_MATCH(xDMXGetScreenCountReq);
- rep.type = X_Reply;
+ rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.screenCount = dmxGetNumScreens();
+ rep.length = 0;
+ rep.screenCount = dmxGetNumScreens();
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.screenCount);
}
- WriteToClient(client, sizeof(xDMXGetScreenCountReply), (char *)&rep);
+ WriteToClient(client, sizeof(xDMXGetScreenCountReply), (char *) &rep);
return Success;
}
-static int ProcDMXGetScreenAttributes(ClientPtr client)
+static int
+ProcDMXGetScreenAttributes(ClientPtr client)
{
REQUEST(xDMXGetScreenAttributesReq);
xDMXGetScreenAttributesReply rep;
- int length;
- int paddedLength;
- DMXScreenAttributesRec attr;
+ int length;
+ int paddedLength;
+ DMXScreenAttributesRec attr;
REQUEST_SIZE_MATCH(xDMXGetScreenAttributesReq);
if (stuff->physicalScreen < 0
- || stuff->physicalScreen >= dmxGetNumScreens()) return BadValue;
+ || stuff->physicalScreen >= dmxGetNumScreens())
+ return BadValue;
if (!dmxGetScreenAttributes(stuff->physicalScreen, &attr))
return BadValue;
- rep.logicalScreen = attr.logicalScreen;
- rep.screenWindowWidth = attr.screenWindowWidth;
- rep.screenWindowHeight = attr.screenWindowHeight;
+ rep.logicalScreen = attr.logicalScreen;
+ rep.screenWindowWidth = attr.screenWindowWidth;
+ rep.screenWindowHeight = attr.screenWindowHeight;
rep.screenWindowXoffset = attr.screenWindowXoffset;
rep.screenWindowYoffset = attr.screenWindowYoffset;
- rep.rootWindowWidth = attr.rootWindowWidth;
- rep.rootWindowHeight = attr.rootWindowHeight;
- rep.rootWindowXoffset = attr.rootWindowXoffset;
- rep.rootWindowYoffset = attr.rootWindowYoffset;
- rep.rootWindowXorigin = attr.rootWindowXorigin;
- rep.rootWindowYorigin = attr.rootWindowYorigin;
-
- length = attr.displayName ? strlen(attr.displayName) : 0;
- paddedLength = pad_to_int32(length);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = bytes_to_int32((sizeof(xDMXGetScreenAttributesReply) - sizeof(xGenericReply))
- + paddedLength);
- rep.displayNameLength = length;
+ rep.rootWindowWidth = attr.rootWindowWidth;
+ rep.rootWindowHeight = attr.rootWindowHeight;
+ rep.rootWindowXoffset = attr.rootWindowXoffset;
+ rep.rootWindowYoffset = attr.rootWindowYoffset;
+ rep.rootWindowXorigin = attr.rootWindowXorigin;
+ rep.rootWindowYorigin = attr.rootWindowYorigin;
+
+ length = attr.displayName ? strlen(attr.displayName) : 0;
+ paddedLength = pad_to_int32(length);
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length =
+ bytes_to_int32((sizeof(xDMXGetScreenAttributesReply) -
+ sizeof(xGenericReply))
+ + paddedLength);
+ rep.displayNameLength = length;
if (client->swapped) {
swaps(&rep.sequenceNumber);
@@ -335,49 +376,55 @@ static int ProcDMXGetScreenAttributes(ClientPtr client)
swaps(&rep.rootWindowXorigin);
swaps(&rep.rootWindowYorigin);
}
- WriteToClient(client, sizeof(xDMXGetScreenAttributesReply), (char *)&rep);
- if (length) WriteToClient(client, length, (char *)attr.displayName);
+ WriteToClient(client, sizeof(xDMXGetScreenAttributesReply), (char *) &rep);
+ if (length)
+ WriteToClient(client, length, (char *) attr.displayName);
return Success;
}
-static int ProcDMXChangeScreensAttributes(ClientPtr client)
+static int
+ProcDMXChangeScreensAttributes(ClientPtr client)
{
REQUEST(xDMXChangeScreensAttributesReq);
xDMXChangeScreensAttributesReply rep;
- int status = DMX_BAD_XINERAMA;
- unsigned int mask = 0;
- unsigned int i;
- CARD32 *screen_list;
- CARD32 *mask_list;
- CARD32 *value_list;
- DMXScreenAttributesPtr attribs;
- int errorScreen = 0;
- unsigned int len;
- int ones = 0;
-
+ int status = DMX_BAD_XINERAMA;
+ unsigned int mask = 0;
+ unsigned int i;
+ CARD32 *screen_list;
+ CARD32 *mask_list;
+ CARD32 *value_list;
+ DMXScreenAttributesPtr attribs;
+ int errorScreen = 0;
+ unsigned int len;
+ int ones = 0;
REQUEST_AT_LEAST_SIZE(xDMXChangeScreensAttributesReq);
- len = client->req_len - bytes_to_int32(sizeof(xDMXChangeScreensAttributesReq));
+ len =
+ client->req_len -
+ bytes_to_int32(sizeof(xDMXChangeScreensAttributesReq));
if (len < stuff->screenCount + stuff->maskCount)
return BadLength;
- screen_list = (CARD32 *)(stuff + 1);
- mask_list = &screen_list[stuff->screenCount];
- value_list = &mask_list[stuff->maskCount];
+ screen_list = (CARD32 *) (stuff + 1);
+ mask_list = &screen_list[stuff->screenCount];
+ value_list = &mask_list[stuff->maskCount];
- for (i = 0; i < stuff->maskCount; i++) ones += Ones(mask_list[i]);
+ for (i = 0; i < stuff->maskCount; i++)
+ ones += Ones(mask_list[i]);
if (len != stuff->screenCount + stuff->maskCount + ones)
return BadLength;
-
- if (!_DMXXineramaActive()) goto noxinerama;
+
+ if (!_DMXXineramaActive())
+ goto noxinerama;
if (!(attribs = malloc(stuff->screenCount * sizeof(*attribs))))
return BadAlloc;
for (i = 0; i < stuff->screenCount; i++) {
int count;
-
- if (i < stuff->maskCount) mask = mask_list[i];
+
+ if (i < stuff->maskCount)
+ mask = mask_list[i];
dmxGetScreenAttributes(screen_list[i], &attribs[i]);
count = dmxFetchScreenAttributes(mask, &attribs[i], value_list);
value_list += count;
@@ -385,21 +432,20 @@ static int ProcDMXChangeScreensAttributes(ClientPtr client)
#if PANORAMIX
status = dmxConfigureScreenWindows(stuff->screenCount,
- screen_list,
- attribs,
- &errorScreen);
+ screen_list, attribs, &errorScreen);
#endif
free(attribs);
- if (status == BadValue) return status;
+ if (status == BadValue)
+ return status;
- noxinerama:
- rep.type = X_Reply;
+ noxinerama:
+ rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.status = status;
- rep.errorScreen = errorScreen;
+ rep.length = 0;
+ rep.status = status;
+ rep.errorScreen = errorScreen;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
@@ -407,34 +453,34 @@ static int ProcDMXChangeScreensAttributes(ClientPtr client)
swapl(&rep.errorScreen);
}
WriteToClient(client,
- sizeof(xDMXChangeScreensAttributesReply),
- (char *)&rep);
+ sizeof(xDMXChangeScreensAttributesReply), (char *) &rep);
return Success;
}
-static int ProcDMXAddScreen(ClientPtr client)
+static int
+ProcDMXAddScreen(ClientPtr client)
{
REQUEST(xDMXAddScreenReq);
- xDMXAddScreenReply rep;
- int status = 0;
- CARD32 *value_list;
+ xDMXAddScreenReply rep;
+ int status = 0;
+ CARD32 *value_list;
DMXScreenAttributesRec attr;
- int count;
- char *name;
- int len;
- int paddedLength;
+ int count;
+ char *name;
+ int len;
+ int paddedLength;
REQUEST_AT_LEAST_SIZE(xDMXAddScreenReq);
paddedLength = pad_to_int32(stuff->displayNameLength);
- len = client->req_len - bytes_to_int32(sizeof(xDMXAddScreenReq));
- if (len != Ones(stuff->valueMask) + paddedLength/4)
+ len = client->req_len - bytes_to_int32(sizeof(xDMXAddScreenReq));
+ if (len != Ones(stuff->valueMask) + paddedLength / 4)
return BadLength;
memset(&attr, 0, sizeof(attr));
dmxGetScreenAttributes(stuff->physicalScreen, &attr);
- value_list = (CARD32 *)(stuff + 1);
- count = dmxFetchScreenAttributes(stuff->valueMask, &attr, value_list);
-
+ value_list = (CARD32 *) (stuff + 1);
+ count = dmxFetchScreenAttributes(stuff->valueMask, &attr, value_list);
+
if (!(name = malloc(stuff->displayNameLength + 1 + 4)))
return BadAlloc;
memcpy(name, &value_list[count], stuff->displayNameLength);
@@ -445,10 +491,10 @@ static int ProcDMXAddScreen(ClientPtr client)
free(name);
- rep.type = X_Reply;
+ rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.status = status;
+ rep.length = 0;
+ rep.status = status;
rep.physicalScreen = stuff->physicalScreen;
if (client->swapped) {
swaps(&rep.sequenceNumber);
@@ -456,63 +502,60 @@ static int ProcDMXAddScreen(ClientPtr client)
swapl(&rep.status);
swapl(&rep.physicalScreen);
}
- WriteToClient(client,
- sizeof(xDMXAddScreenReply),
- (char *)&rep);
+ WriteToClient(client, sizeof(xDMXAddScreenReply), (char *) &rep);
return Success;
}
-static int ProcDMXRemoveScreen(ClientPtr client)
+static int
+ProcDMXRemoveScreen(ClientPtr client)
{
REQUEST(xDMXRemoveScreenReq);
xDMXRemoveScreenReply rep;
- int status = 0;
+ int status = 0;
REQUEST_SIZE_MATCH(xDMXRemoveScreenReq);
status = dmxDetachScreen(stuff->physicalScreen);
- rep.type = X_Reply;
+ rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.status = status;
+ rep.length = 0;
+ rep.status = status;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.status);
}
- WriteToClient(client,
- sizeof(xDMXRemoveScreenReply),
- (char *)&rep);
+ WriteToClient(client, sizeof(xDMXRemoveScreenReply), (char *) &rep);
return Success;
}
-
#ifdef PANORAMIX
-static int dmxPopulatePanoramiX(ClientPtr client, Window window,
- CARD32 *screens, CARD32 *windows,
- xRectangle *pos, xRectangle *vis)
+static int
+dmxPopulatePanoramiX(ClientPtr client, Window window,
+ CARD32 *screens, CARD32 *windows,
+ xRectangle *pos, xRectangle *vis)
{
- WindowPtr pWin;
- PanoramiXRes *win;
- int i;
- int count = 0;
+ WindowPtr pWin;
+ PanoramiXRes *win;
+ int i;
+ int count = 0;
DMXWindowAttributesRec attr;
-
- if (Success != dixLookupResourceByType((pointer*) &win,
- window, XRT_WINDOW,
- client, DixReadAccess))
- return -1; /* BadWindow */
-
+
+ if (Success != dixLookupResourceByType((pointer *) &win,
+ window, XRT_WINDOW,
+ client, DixReadAccess))
+ return -1; /* BadWindow */
+
FOR_NSCREENS(i) {
if (Success != dixLookupWindow(&pWin, win->info[i].id, client,
- DixReadAccess))
+ DixReadAccess))
return -1; /* BadWindow */
if (dmxGetWindowAttributes(pWin, &attr)) {
screens[count] = attr.screen;
windows[count] = attr.window;
- pos[count] = attr.pos;
- vis[count] = attr.vis;
+ pos[count] = attr.pos;
+ vis[count] = attr.vis;
++count; /* Only count existing windows */
}
}
@@ -520,46 +563,49 @@ static int dmxPopulatePanoramiX(ClientPtr client, Window window,
}
#endif
-static int dmxPopulate(ClientPtr client, Window window, CARD32 *screens,
- CARD32 *windows, xRectangle *pos, xRectangle *vis)
+static int
+dmxPopulate(ClientPtr client, Window window, CARD32 *screens,
+ CARD32 *windows, xRectangle *pos, xRectangle *vis)
{
- WindowPtr pWin;
+ WindowPtr pWin;
DMXWindowAttributesRec attr;
#ifdef PANORAMIX
if (!noPanoramiXExtension)
- return dmxPopulatePanoramiX(client, window, screens, windows,
- pos, vis);
+ return dmxPopulatePanoramiX(client, window, screens, windows, pos, vis);
#endif
-
+
if (Success != dixLookupWindow(&pWin, window, client, DixReadAccess))
- return -1; /* BadWindow */
+ return -1; /* BadWindow */
dmxGetWindowAttributes(pWin, &attr);
*screens = attr.screen;
*windows = attr.window;
- *pos = attr.pos;
- *vis = attr.vis;
+ *pos = attr.pos;
+ *vis = attr.vis;
return 1;
}
-static int dmxMaxNumScreens(void)
+static int
+dmxMaxNumScreens(void)
{
#ifdef PANORAMIX
- if (!noPanoramiXExtension) return PanoramiXNumScreens;
+ if (!noPanoramiXExtension)
+ return PanoramiXNumScreens;
#endif
return 1;
}
-static int ProcDMXGetWindowAttributes(ClientPtr client)
+static int
+ProcDMXGetWindowAttributes(ClientPtr client)
{
REQUEST(xDMXGetWindowAttributesReq);
xDMXGetWindowAttributesReply rep;
- int i;
- CARD32 *screens;
- CARD32 *windows;
- xRectangle *pos, *vis;
- int count = dmxMaxNumScreens();
+ int i;
+ CARD32 *screens;
+ CARD32 *windows;
+ xRectangle *pos, *vis;
+ int count = dmxMaxNumScreens();
REQUEST_SIZE_MATCH(xDMXGetWindowAttributesReq);
@@ -590,10 +636,10 @@ static int ProcDMXGetWindowAttributes(ClientPtr client)
return BadWindow;
}
- rep.type = X_Reply;
+ rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
- rep.length = count * 6;
- rep.screenCount = count;
+ rep.length = count * 6;
+ rep.screenCount = count;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
@@ -601,12 +647,12 @@ static int ProcDMXGetWindowAttributes(ClientPtr client)
for (i = 0; i < count; i++) {
swapl(&screens[i]);
swapl(&windows[i]);
-
+
swaps(&pos[i].x);
swaps(&pos[i].y);
swaps(&pos[i].width);
swaps(&pos[i].height);
-
+
swaps(&vis[i].x);
swaps(&vis[i].y);
swaps(&vis[i].width);
@@ -616,12 +662,12 @@ static int ProcDMXGetWindowAttributes(ClientPtr client)
dmxFlushPendingSyncs();
- WriteToClient(client, sizeof(xDMXGetWindowAttributesReply), (char *)&rep);
+ WriteToClient(client, sizeof(xDMXGetWindowAttributesReply), (char *) &rep);
if (count) {
- WriteToClient(client, count * sizeof(*screens), (char *)screens);
- WriteToClient(client, count * sizeof(*windows), (char *)windows);
- WriteToClient(client, count * sizeof(*pos), (char *)pos);
- WriteToClient(client, count * sizeof(*vis), (char *)vis);
+ WriteToClient(client, count * sizeof(*screens), (char *) screens);
+ WriteToClient(client, count * sizeof(*windows), (char *) windows);
+ WriteToClient(client, count * sizeof(*pos), (char *) pos);
+ WriteToClient(client, count * sizeof(*vis), (char *) vis);
}
free(vis);
@@ -632,23 +678,24 @@ static int ProcDMXGetWindowAttributes(ClientPtr client)
return Success;
}
-static int ProcDMXGetDesktopAttributes(ClientPtr client)
+static int
+ProcDMXGetDesktopAttributes(ClientPtr client)
{
xDMXGetDesktopAttributesReply rep;
- DMXDesktopAttributesRec attr;
+ DMXDesktopAttributesRec attr;
REQUEST_SIZE_MATCH(xDMXGetDesktopAttributesReq);
dmxGetDesktopAttributes(&attr);
- rep.width = attr.width;
- rep.height = attr.height;
- rep.shiftX = attr.shiftX;
- rep.shiftY = attr.shiftY;
+ rep.width = attr.width;
+ rep.height = attr.height;
+ rep.shiftX = attr.shiftX;
+ rep.shiftY = attr.shiftY;
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
if (client->swapped) {
swaps(&rep.sequenceNumber);
@@ -658,95 +705,100 @@ static int ProcDMXGetDesktopAttributes(ClientPtr client)
swaps(&rep.shiftX);
swaps(&rep.shiftY);
}
- WriteToClient(client, sizeof(xDMXGetDesktopAttributesReply), (char *)&rep);
+ WriteToClient(client, sizeof(xDMXGetDesktopAttributesReply), (char *) &rep);
return Success;
}
-static int ProcDMXChangeDesktopAttributes(ClientPtr client)
+static int
+ProcDMXChangeDesktopAttributes(ClientPtr client)
{
REQUEST(xDMXChangeDesktopAttributesReq);
xDMXChangeDesktopAttributesReply rep;
- int status = DMX_BAD_XINERAMA;
- CARD32 *value_list;
- DMXDesktopAttributesRec attr;
- int len;
+ int status = DMX_BAD_XINERAMA;
+ CARD32 *value_list;
+ DMXDesktopAttributesRec attr;
+ int len;
REQUEST_AT_LEAST_SIZE(xDMXChangeDesktopAttributesReq);
len = client->req_len - (sizeof(xDMXChangeDesktopAttributesReq) >> 2);
if (len != Ones(stuff->valueMask))
return BadLength;
- if (!_DMXXineramaActive()) goto noxinerama;
+ if (!_DMXXineramaActive())
+ goto noxinerama;
+
+ value_list = (CARD32 *) (stuff + 1);
- value_list = (CARD32 *)(stuff + 1);
-
dmxGetDesktopAttributes(&attr);
dmxFetchDesktopAttributes(stuff->valueMask, &attr, value_list);
#if PANORAMIX
status = dmxConfigureDesktop(&attr);
#endif
- if (status == BadValue) return status;
+ if (status == BadValue)
+ return status;
- noxinerama:
- rep.type = X_Reply;
+ noxinerama:
+ rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.status = status;
+ rep.length = 0;
+ rep.status = status;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.status);
}
WriteToClient(client,
- sizeof(xDMXChangeDesktopAttributesReply),
- (char *)&rep);
+ sizeof(xDMXChangeDesktopAttributesReply), (char *) &rep);
return Success;
}
-static int ProcDMXGetInputCount(ClientPtr client)
+static int
+ProcDMXGetInputCount(ClientPtr client)
{
xDMXGetInputCountReply rep;
REQUEST_SIZE_MATCH(xDMXGetInputCountReq);
- rep.type = X_Reply;
+ rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.inputCount = dmxGetInputCount();
+ rep.length = 0;
+ rep.inputCount = dmxGetInputCount();
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.inputCount);
}
- WriteToClient(client, sizeof(xDMXGetInputCountReply), (char *)&rep);
+ WriteToClient(client, sizeof(xDMXGetInputCountReply), (char *) &rep);
return Success;
}
-static int ProcDMXGetInputAttributes(ClientPtr client)
+static int
+ProcDMXGetInputAttributes(ClientPtr client)
{
REQUEST(xDMXGetInputAttributesReq);
xDMXGetInputAttributesReply rep;
- int length;
- int paddedLength;
- DMXInputAttributesRec attr;
+ int length;
+ int paddedLength;
+ DMXInputAttributesRec attr;
REQUEST_SIZE_MATCH(xDMXGetInputAttributesReq);
- if (dmxGetInputAttributes(stuff->deviceId, &attr)) return BadValue;
- rep.inputType = attr.inputType;
+ if (dmxGetInputAttributes(stuff->deviceId, &attr))
+ return BadValue;
+ rep.inputType = attr.inputType;
rep.physicalScreen = attr.physicalScreen;
- rep.physicalId = attr.physicalId;
- rep.isCore = attr.isCore;
- rep.sendsCore = attr.sendsCore;
- rep.detached = attr.detached;
-
- length = attr.name ? strlen(attr.name) : 0;
- paddedLength = pad_to_int32(length);
- rep.type = X_Reply;
+ rep.physicalId = attr.physicalId;
+ rep.isCore = attr.isCore;
+ rep.sendsCore = attr.sendsCore;
+ rep.detached = attr.detached;
+
+ length = attr.name ? strlen(attr.name) : 0;
+ paddedLength = pad_to_int32(length);
+ rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
- rep.length = bytes_to_int32(paddedLength);
- rep.nameLength = length;
+ rep.length = bytes_to_int32(paddedLength);
+ rep.nameLength = length;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
@@ -755,34 +807,36 @@ static int ProcDMXGetInputAttributes(ClientPtr client)
swapl(&rep.physicalId);
swapl(&rep.nameLength);
}
- WriteToClient(client, sizeof(xDMXGetInputAttributesReply), (char *)&rep);
- if (length) WriteToClient(client, length, (char *)attr.name);
+ WriteToClient(client, sizeof(xDMXGetInputAttributesReply), (char *) &rep);
+ if (length)
+ WriteToClient(client, length, (char *) attr.name);
return Success;
}
-static int ProcDMXAddInput(ClientPtr client)
+static int
+ProcDMXAddInput(ClientPtr client)
{
REQUEST(xDMXAddInputReq);
- xDMXAddInputReply rep;
- int status = 0;
- CARD32 *value_list;
- DMXInputAttributesRec attr;
- int count;
- char *name;
- int len;
- int paddedLength;
- int id = -1;
+ xDMXAddInputReply rep;
+ int status = 0;
+ CARD32 *value_list;
+ DMXInputAttributesRec attr;
+ int count;
+ char *name;
+ int len;
+ int paddedLength;
+ int id = -1;
REQUEST_AT_LEAST_SIZE(xDMXAddInputReq);
paddedLength = pad_to_int32(stuff->displayNameLength);
- len = client->req_len - (sizeof(xDMXAddInputReq) >> 2);
- if (len != Ones(stuff->valueMask) + paddedLength/4)
+ len = client->req_len - (sizeof(xDMXAddInputReq) >> 2);
+ if (len != Ones(stuff->valueMask) + paddedLength / 4)
return BadLength;
memset(&attr, 0, sizeof(attr));
- value_list = (CARD32 *)(stuff + 1);
- count = dmxFetchInputAttributes(stuff->valueMask, &attr, value_list);
-
+ value_list = (CARD32 *) (stuff + 1);
+ count = dmxFetchInputAttributes(stuff->valueMask, &attr, value_list);
+
if (!(name = malloc(stuff->displayNameLength + 1 + 4)))
return BadAlloc;
memcpy(name, &value_list[count], stuff->displayNameLength);
@@ -793,81 +847,100 @@ static int ProcDMXAddInput(ClientPtr client)
free(name);
- if (status) return status;
+ if (status)
+ return status;
- rep.type = X_Reply;
+ rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.status = status;
- rep.physicalId = id;
+ rep.length = 0;
+ rep.status = status;
+ rep.physicalId = id;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.status);
swapl(&rep.physicalId);
}
- WriteToClient(client, sizeof(xDMXAddInputReply), (char *)&rep);
+ WriteToClient(client, sizeof(xDMXAddInputReply), (char *) &rep);
return Success;
}
-static int ProcDMXRemoveInput(ClientPtr client)
+static int
+ProcDMXRemoveInput(ClientPtr client)
{
REQUEST(xDMXRemoveInputReq);
- xDMXRemoveInputReply rep;
- int status = 0;
+ xDMXRemoveInputReply rep;
+ int status = 0;
REQUEST_SIZE_MATCH(xDMXRemoveInputReq);
status = dmxRemoveInput(stuff->physicalId);
- if (status) return status;
+ if (status)
+ return status;
- rep.type = X_Reply;
+ rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.status = status;
+ rep.length = 0;
+ rep.status = status;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.status);
}
- WriteToClient(client, sizeof(xDMXRemoveInputReply), (char *)&rep);
+ WriteToClient(client, sizeof(xDMXRemoveInputReply), (char *) &rep);
return Success;
}
-static int ProcDMXDispatch(ClientPtr client)
+static int
+ProcDMXDispatch(ClientPtr client)
{
REQUEST(xReq);
switch (stuff->data) {
- case X_DMXQueryVersion: return ProcDMXQueryVersion(client);
- case X_DMXSync: return ProcDMXSync(client);
- case X_DMXForceWindowCreation: return ProcDMXForceWindowCreation(client);
- case X_DMXGetScreenCount: return ProcDMXGetScreenCount(client);
- case X_DMXGetScreenAttributes: return ProcDMXGetScreenAttributes(client);
+ case X_DMXQueryVersion:
+ return ProcDMXQueryVersion(client);
+ case X_DMXSync:
+ return ProcDMXSync(client);
+ case X_DMXForceWindowCreation:
+ return ProcDMXForceWindowCreation(client);
+ case X_DMXGetScreenCount:
+ return ProcDMXGetScreenCount(client);
+ case X_DMXGetScreenAttributes:
+ return ProcDMXGetScreenAttributes(client);
case X_DMXChangeScreensAttributes:
return ProcDMXChangeScreensAttributes(client);
- case X_DMXAddScreen: return ProcDMXAddScreen(client);
- case X_DMXRemoveScreen: return ProcDMXRemoveScreen(client);
- case X_DMXGetWindowAttributes: return ProcDMXGetWindowAttributes(client);
- case X_DMXGetDesktopAttributes: return ProcDMXGetDesktopAttributes(client);
+ case X_DMXAddScreen:
+ return ProcDMXAddScreen(client);
+ case X_DMXRemoveScreen:
+ return ProcDMXRemoveScreen(client);
+ case X_DMXGetWindowAttributes:
+ return ProcDMXGetWindowAttributes(client);
+ case X_DMXGetDesktopAttributes:
+ return ProcDMXGetDesktopAttributes(client);
case X_DMXChangeDesktopAttributes:
return ProcDMXChangeDesktopAttributes(client);
- case X_DMXGetInputCount: return ProcDMXGetInputCount(client);
- case X_DMXGetInputAttributes: return ProcDMXGetInputAttributes(client);
- case X_DMXAddInput: return ProcDMXAddInput(client);
- case X_DMXRemoveInput: return ProcDMXRemoveInput(client);
-
+ case X_DMXGetInputCount:
+ return ProcDMXGetInputCount(client);
+ case X_DMXGetInputAttributes:
+ return ProcDMXGetInputAttributes(client);
+ case X_DMXAddInput:
+ return ProcDMXAddInput(client);
+ case X_DMXRemoveInput:
+ return ProcDMXRemoveInput(client);
+
case X_DMXGetScreenInformationDEPRECATED:
case X_DMXForceWindowCreationDEPRECATED:
case X_DMXReconfigureScreenDEPRECATED:
return BadImplementation;
- default: return BadRequest;
+ default:
+ return BadRequest;
}
}
-static int SProcDMXQueryVersion(ClientPtr client)
+static int
+SProcDMXQueryVersion(ClientPtr client)
{
REQUEST(xDMXQueryVersionReq);
@@ -876,7 +949,8 @@ static int SProcDMXQueryVersion(ClientPtr client)
return ProcDMXQueryVersion(client);
}
-static int SProcDMXSync(ClientPtr client)
+static int
+SProcDMXSync(ClientPtr client)
{
REQUEST(xDMXSyncReq);
@@ -885,7 +959,8 @@ static int SProcDMXSync(ClientPtr client)
return ProcDMXSync(client);
}
-static int SProcDMXForceWindowCreation(ClientPtr client)
+static int
+SProcDMXForceWindowCreation(ClientPtr client)
{
REQUEST(xDMXForceWindowCreationReq);
@@ -895,7 +970,8 @@ static int SProcDMXForceWindowCreation(ClientPtr client)
return ProcDMXForceWindowCreation(client);
}
-static int SProcDMXGetScreenCount(ClientPtr client)
+static int
+SProcDMXGetScreenCount(ClientPtr client)
{
REQUEST(xDMXGetScreenCountReq);
@@ -904,7 +980,8 @@ static int SProcDMXGetScreenCount(ClientPtr client)
return ProcDMXGetScreenCount(client);
}
-static int SProcDMXGetScreenAttributes(ClientPtr client)
+static int
+SProcDMXGetScreenAttributes(ClientPtr client)
{
REQUEST(xDMXGetScreenAttributesReq);
@@ -914,7 +991,8 @@ static int SProcDMXGetScreenAttributes(ClientPtr client)
return ProcDMXGetScreenAttributes(client);
}
-static int SProcDMXChangeScreensAttributes(ClientPtr client)
+static int
+SProcDMXChangeScreensAttributes(ClientPtr client)
{
REQUEST(xDMXChangeScreensAttributesReq);
@@ -926,9 +1004,11 @@ static int SProcDMXChangeScreensAttributes(ClientPtr client)
return ProcDMXGetScreenAttributes(client);
}
-static int SProcDMXAddScreen(ClientPtr client)
+static int
+SProcDMXAddScreen(ClientPtr client)
{
int paddedLength;
+
REQUEST(xDMXAddScreenReq);
swaps(&stuff->length);
@@ -936,11 +1016,12 @@ static int SProcDMXAddScreen(ClientPtr client)
swapl(&stuff->displayNameLength);
swapl(&stuff->valueMask);
paddedLength = pad_to_int32(stuff->displayNameLength);
- SwapLongs((CARD32 *)(stuff+1), LengthRestL(stuff) - paddedLength/4);
+ SwapLongs((CARD32 *) (stuff + 1), LengthRestL(stuff) - paddedLength / 4);
return ProcDMXAddScreen(client);
}
-static int SProcDMXRemoveScreen(ClientPtr client)
+static int
+SProcDMXRemoveScreen(ClientPtr client)
{
REQUEST(xDMXRemoveScreenReq);
@@ -950,7 +1031,8 @@ static int SProcDMXRemoveScreen(ClientPtr client)
return ProcDMXRemoveScreen(client);
}
-static int SProcDMXGetWindowAttributes(ClientPtr client)
+static int
+SProcDMXGetWindowAttributes(ClientPtr client)
{
REQUEST(xDMXGetWindowAttributesReq);
@@ -960,7 +1042,8 @@ static int SProcDMXGetWindowAttributes(ClientPtr client)
return ProcDMXGetWindowAttributes(client);
}
-static int SProcDMXGetDesktopAttributes(ClientPtr client)
+static int
+SProcDMXGetDesktopAttributes(ClientPtr client)
{
REQUEST(xDMXGetDesktopAttributesReq);
@@ -969,7 +1052,8 @@ static int SProcDMXGetDesktopAttributes(ClientPtr client)
return ProcDMXGetDesktopAttributes(client);
}
-static int SProcDMXChangeDesktopAttributes(ClientPtr client)
+static int
+SProcDMXChangeDesktopAttributes(ClientPtr client)
{
REQUEST(xDMXChangeDesktopAttributesReq);
@@ -980,7 +1064,8 @@ static int SProcDMXChangeDesktopAttributes(ClientPtr client)
return ProcDMXChangeDesktopAttributes(client);
}
-static int SProcDMXGetInputCount(ClientPtr client)
+static int
+SProcDMXGetInputCount(ClientPtr client)
{
REQUEST(xDMXGetInputCountReq);
@@ -989,7 +1074,8 @@ static int SProcDMXGetInputCount(ClientPtr client)
return ProcDMXGetInputCount(client);
}
-static int SProcDMXGetInputAttributes(ClientPtr client)
+static int
+SProcDMXGetInputAttributes(ClientPtr client)
{
REQUEST(xDMXGetInputAttributesReq);
@@ -999,9 +1085,11 @@ static int SProcDMXGetInputAttributes(ClientPtr client)
return ProcDMXGetInputAttributes(client);
}
-static int SProcDMXAddInput(ClientPtr client)
+static int
+SProcDMXAddInput(ClientPtr client)
{
int paddedLength;
+
REQUEST(xDMXAddInputReq);
swaps(&stuff->length);
@@ -1009,11 +1097,12 @@ static int SProcDMXAddInput(ClientPtr client)
swapl(&stuff->displayNameLength);
swapl(&stuff->valueMask);
paddedLength = pad_to_int32(stuff->displayNameLength);
- SwapLongs((CARD32 *)(stuff+1), LengthRestL(stuff) - paddedLength/4);
+ SwapLongs((CARD32 *) (stuff + 1), LengthRestL(stuff) - paddedLength / 4);
return ProcDMXAddInput(client);
}
-static int SProcDMXRemoveInput(ClientPtr client)
+static int
+SProcDMXRemoveInput(ClientPtr client)
{
REQUEST(xDMXRemoveInputReq);
@@ -1023,46 +1112,61 @@ static int SProcDMXRemoveInput(ClientPtr client)
return ProcDMXRemoveInput(client);
}
-static int SProcDMXDispatch (ClientPtr client)
+static int
+SProcDMXDispatch(ClientPtr client)
{
REQUEST(xReq);
switch (stuff->data) {
- case X_DMXQueryVersion: return SProcDMXQueryVersion(client);
- case X_DMXSync: return SProcDMXSync(client);
- case X_DMXForceWindowCreation: return SProcDMXForceWindowCreation(client);
- case X_DMXGetScreenCount: return SProcDMXGetScreenCount(client);
- case X_DMXGetScreenAttributes: return SProcDMXGetScreenAttributes(client);
+ case X_DMXQueryVersion:
+ return SProcDMXQueryVersion(client);
+ case X_DMXSync:
+ return SProcDMXSync(client);
+ case X_DMXForceWindowCreation:
+ return SProcDMXForceWindowCreation(client);
+ case X_DMXGetScreenCount:
+ return SProcDMXGetScreenCount(client);
+ case X_DMXGetScreenAttributes:
+ return SProcDMXGetScreenAttributes(client);
case X_DMXChangeScreensAttributes:
return SProcDMXChangeScreensAttributes(client);
- case X_DMXAddScreen: return SProcDMXAddScreen(client);
- case X_DMXRemoveScreen: return SProcDMXRemoveScreen(client);
- case X_DMXGetWindowAttributes: return SProcDMXGetWindowAttributes(client);
+ case X_DMXAddScreen:
+ return SProcDMXAddScreen(client);
+ case X_DMXRemoveScreen:
+ return SProcDMXRemoveScreen(client);
+ case X_DMXGetWindowAttributes:
+ return SProcDMXGetWindowAttributes(client);
case X_DMXGetDesktopAttributes:
return SProcDMXGetDesktopAttributes(client);
case X_DMXChangeDesktopAttributes:
return SProcDMXChangeDesktopAttributes(client);
- case X_DMXGetInputCount: return SProcDMXGetInputCount(client);
- case X_DMXGetInputAttributes: return SProcDMXGetInputAttributes(client);
- case X_DMXAddInput: return SProcDMXAddInput(client);
- case X_DMXRemoveInput: return SProcDMXRemoveInput(client);
-
+ case X_DMXGetInputCount:
+ return SProcDMXGetInputCount(client);
+ case X_DMXGetInputAttributes:
+ return SProcDMXGetInputAttributes(client);
+ case X_DMXAddInput:
+ return SProcDMXAddInput(client);
+ case X_DMXRemoveInput:
+ return SProcDMXRemoveInput(client);
+
case X_DMXGetScreenInformationDEPRECATED:
case X_DMXForceWindowCreationDEPRECATED:
case X_DMXReconfigureScreenDEPRECATED:
return BadImplementation;
- default: return BadRequest;
+ default:
+ return BadRequest;
}
}
/** Initialize the extension. */
-void DMXExtensionInit(void)
+void
+DMXExtensionInit(void)
{
ExtensionEntry *extEntry;
-
+
if ((extEntry = AddExtension(DMX_EXTENSION_NAME, 0, 0,
ProcDMXDispatch, SProcDMXDispatch,
NULL, StandardMinorOpcode)))
- DMXCode = extEntry->base;
+ DMXCode = extEntry->base;
}
diff --git a/hw/dmx/dmx.h b/hw/dmx/dmx.h
index c6b6199a5..d7c620467 100644
--- a/hw/dmx/dmx.h
+++ b/hw/dmx/dmx.h
@@ -89,211 +89,224 @@ typedef struct _DMXStatInfo DMXStatInfo;
/** Global structure containing information about each backend screen. */
typedef struct _DMXScreenInfo {
- const char *name; /**< Name from command line or config file */
- int index; /**< Index into dmxScreens global */
+ const char *name; /**< Name from command line or config file */
+ int index; /**< Index into dmxScreens global */
/*---------- Back-end X server information ----------*/
- Display *beDisplay; /**< Back-end X server's display */
- int beWidth; /**< Width of BE display */
- int beHeight; /**< Height of BE display */
- int beDepth; /**< Depth of BE display */
- int beBPP; /**< Bits per pixel of BE display */
- int beXDPI; /**< Horizontal dots per inch of BE */
- int beYDPI; /**< Vertical dots per inch of BE */
+ Display *beDisplay; /**< Back-end X server's display */
+ int beWidth; /**< Width of BE display */
+ int beHeight; /**< Height of BE display */
+ int beDepth; /**< Depth of BE display */
+ int beBPP; /**< Bits per pixel of BE display */
+ int beXDPI; /**< Horizontal dots per inch of BE */
+ int beYDPI; /**< Vertical dots per inch of BE */
- int beNumDepths; /**< Number of depths on BE server */
- int *beDepths; /**< Depths from BE server */
+ int beNumDepths; /**< Number of depths on BE server */
+ int *beDepths; /**< Depths from BE server */
- int beNumPixmapFormats; /**< Number of pixmap formats on BE */
+ int beNumPixmapFormats; /**< Number of pixmap formats on BE */
XPixmapFormatValues *bePixmapFormats; /**< Pixmap formats on BE */
- int beNumVisuals; /**< Number of visuals on BE */
- XVisualInfo *beVisuals; /**< Visuals from BE server */
- int beDefVisualIndex; /**< Default visual index of BE */
+ int beNumVisuals; /**< Number of visuals on BE */
+ XVisualInfo *beVisuals; /**< Visuals from BE server */
+ int beDefVisualIndex; /**< Default visual index of BE */
- int beNumDefColormaps; /**< Number of default colormaps */
- Colormap *beDefColormaps; /**< Default colormaps for DMX server */
+ int beNumDefColormaps; /**< Number of default colormaps */
+ Colormap *beDefColormaps; /**< Default colormaps for DMX server */
- Pixel beBlackPixel; /**< Default black pixel for BE */
- Pixel beWhitePixel; /**< Default white pixel for BE */
+ Pixel beBlackPixel; /**< Default black pixel for BE */
+ Pixel beWhitePixel; /**< Default white pixel for BE */
/*---------- Screen window information ----------*/
- Window scrnWin; /**< "Screen" window on backend display */
- int scrnX; /**< X offset of "screen" WRT BE display */
- int scrnY; /**< Y offset of "screen" WRT BE display */
- int scrnWidth; /**< Width of "screen" */
- int scrnHeight; /**< Height of "screen" */
- int scrnXSign; /**< X offset sign of "screen" */
- int scrnYSign; /**< Y offset sign of "screen" */
+ Window scrnWin; /**< "Screen" window on backend display */
+ int scrnX; /**< X offset of "screen" WRT BE display */
+ int scrnY; /**< Y offset of "screen" WRT BE display */
+ int scrnWidth; /**< Width of "screen" */
+ int scrnHeight; /**< Height of "screen" */
+ int scrnXSign; /**< X offset sign of "screen" */
+ int scrnYSign; /**< Y offset sign of "screen" */
/** Default drawables for "screen" */
- Drawable scrnDefDrawables[MAXFORMATS];
+ Drawable scrnDefDrawables[MAXFORMATS];
struct _DMXScreenInfo *next; /**< List of "screens" on same display */
struct _DMXScreenInfo *over; /**< List of "screens" that overlap */
/*---------- Root window information ----------*/
- Window rootWin; /**< "Root" window on backend display */
- int rootX; /**< X offset of "root" window WRT "screen"*/
- int rootY; /**< Y offset of "root" window WRT "screen"*/
- int rootWidth; /**< Width of "root" window */
- int rootHeight; /**< Height of "root" window */
+ Window rootWin; /**< "Root" window on backend display */
+ int rootX; /**< X offset of "root" window WRT "screen"*/
+ int rootY; /**< Y offset of "root" window WRT "screen"*/
+ int rootWidth; /**< Width of "root" window */
+ int rootHeight; /**< Height of "root" window */
- int rootXOrigin; /**< Global X origin of "root" window */
- int rootYOrigin; /**< Global Y origin of "root" window */
+ int rootXOrigin; /**< Global X origin of "root" window */
+ int rootYOrigin; /**< Global Y origin of "root" window */
/*---------- Shadow framebuffer information ----------*/
- void *shadow; /**< Shadow framebuffer data (if enabled) */
- XlibGC shadowGC; /**< Default GC used by shadow FB code */
- XImage *shadowFBImage; /**< Screen image used by shadow FB code */
+ void *shadow; /**< Shadow framebuffer data (if enabled) */
+ XlibGC shadowGC; /**< Default GC used by shadow FB code */
+ XImage *shadowFBImage; /**< Screen image used by shadow FB code */
/*---------- Other related information ----------*/
- int shared; /**< Non-zero if another Xdmx is running */
+ int shared; /**< Non-zero if another Xdmx is running */
- Bool WMRunningOnBE;
+ Bool WMRunningOnBE;
- Cursor noCursor;
- Cursor curCursor;
- /* Support for cursors on overlapped
- * backend displays. */
- CursorPtr cursor;
- int cursorVisible;
- int cursorNotShared; /* for overlapping screens on a backend */
+ Cursor noCursor;
+ Cursor curCursor;
+ /* Support for cursors on overlapped
+ * backend displays. */
+ CursorPtr cursor;
+ int cursorVisible;
+ int cursorNotShared; /* for overlapping screens on a backend */
- PositionType where; /**< Relative layout information */
- int whereX; /**< Relative layout information */
- int whereY; /**< Relative layout information */
- int whereRefScreen; /**< Relative layout information */
+ PositionType where; /**< Relative layout information */
+ int whereX; /**< Relative layout information */
+ int whereY; /**< Relative layout information */
+ int whereRefScreen; /**< Relative layout information */
- int savedTimeout; /**< Original screen saver timeout */
- int dpmsCapable; /**< Non-zero if backend is DPMS capable */
- int dpmsEnabled; /**< Non-zero if DPMS enabled */
- int dpmsStandby; /**< Original DPMS standby value */
- int dpmsSuspend; /**< Original DPMS suspend value */
- int dpmsOff; /**< Original DPMS off value */
+ int savedTimeout; /**< Original screen saver timeout */
+ int dpmsCapable; /**< Non-zero if backend is DPMS capable */
+ int dpmsEnabled; /**< Non-zero if DPMS enabled */
+ int dpmsStandby; /**< Original DPMS standby value */
+ int dpmsSuspend; /**< Original DPMS suspend value */
+ int dpmsOff; /**< Original DPMS off value */
- DMXStatInfo *stat; /**< Statistics about XSync */
- Bool needsSync; /**< True if an XSync is pending */
+ DMXStatInfo *stat; /**< Statistics about XSync */
+ Bool needsSync; /**< True if an XSync is pending */
#ifdef GLXEXT
/** Visual information for glxProxy */
- int numGlxVisuals;
+ int numGlxVisuals;
__GLXvisualConfig *glxVisuals;
- int glxMajorOpcode;
- int glxErrorBase;
+ int glxMajorOpcode;
+ int glxErrorBase;
/** FB config information for glxProxy */
__GLXFBConfig *fbconfigs;
- int numFBConfigs;
+ int numFBConfigs;
#endif
/** Function pointers to wrapped screen
* functions */
- CloseScreenProcPtr CloseScreen;
- SaveScreenProcPtr SaveScreen;
+ CloseScreenProcPtr CloseScreen;
+ SaveScreenProcPtr SaveScreen;
- CreateGCProcPtr CreateGC;
+ CreateGCProcPtr CreateGC;
- CreateWindowProcPtr CreateWindow;
- DestroyWindowProcPtr DestroyWindow;
- PositionWindowProcPtr PositionWindow;
- ChangeWindowAttributesProcPtr ChangeWindowAttributes;
- RealizeWindowProcPtr RealizeWindow;
- UnrealizeWindowProcPtr UnrealizeWindow;
- RestackWindowProcPtr RestackWindow;
- WindowExposuresProcPtr WindowExposures;
- CopyWindowProcPtr CopyWindow;
+ CreateWindowProcPtr CreateWindow;
+ DestroyWindowProcPtr DestroyWindow;
+ PositionWindowProcPtr PositionWindow;
+ ChangeWindowAttributesProcPtr ChangeWindowAttributes;
+ RealizeWindowProcPtr RealizeWindow;
+ UnrealizeWindowProcPtr UnrealizeWindow;
+ RestackWindowProcPtr RestackWindow;
+ WindowExposuresProcPtr WindowExposures;
+ CopyWindowProcPtr CopyWindow;
- ResizeWindowProcPtr ResizeWindow;
- ReparentWindowProcPtr ReparentWindow;
+ ResizeWindowProcPtr ResizeWindow;
+ ReparentWindowProcPtr ReparentWindow;
- ChangeBorderWidthProcPtr ChangeBorderWidth;
+ ChangeBorderWidthProcPtr ChangeBorderWidth;
- GetImageProcPtr GetImage;
- GetSpansProcPtr GetSpans;
+ GetImageProcPtr GetImage;
+ GetSpansProcPtr GetSpans;
- CreatePixmapProcPtr CreatePixmap;
- DestroyPixmapProcPtr DestroyPixmap;
- BitmapToRegionProcPtr BitmapToRegion;
+ CreatePixmapProcPtr CreatePixmap;
+ DestroyPixmapProcPtr DestroyPixmap;
+ BitmapToRegionProcPtr BitmapToRegion;
- RealizeFontProcPtr RealizeFont;
- UnrealizeFontProcPtr UnrealizeFont;
+ RealizeFontProcPtr RealizeFont;
+ UnrealizeFontProcPtr UnrealizeFont;
- CreateColormapProcPtr CreateColormap;
- DestroyColormapProcPtr DestroyColormap;
- InstallColormapProcPtr InstallColormap;
- StoreColorsProcPtr StoreColors;
+ CreateColormapProcPtr CreateColormap;
+ DestroyColormapProcPtr DestroyColormap;
+ InstallColormapProcPtr InstallColormap;
+ StoreColorsProcPtr StoreColors;
- SetShapeProcPtr SetShape;
+ SetShapeProcPtr SetShape;
- CreatePictureProcPtr CreatePicture;
- DestroyPictureProcPtr DestroyPicture;
- ChangePictureClipProcPtr ChangePictureClip;
- DestroyPictureClipProcPtr DestroyPictureClip;
-
- ChangePictureProcPtr ChangePicture;
- ValidatePictureProcPtr ValidatePicture;
+ CreatePictureProcPtr CreatePicture;
+ DestroyPictureProcPtr DestroyPicture;
+ ChangePictureClipProcPtr ChangePictureClip;
+ DestroyPictureClipProcPtr DestroyPictureClip;
- CompositeProcPtr Composite;
- GlyphsProcPtr Glyphs;
- CompositeRectsProcPtr CompositeRects;
+ ChangePictureProcPtr ChangePicture;
+ ValidatePictureProcPtr ValidatePicture;
- InitIndexedProcPtr InitIndexed;
- CloseIndexedProcPtr CloseIndexed;
- UpdateIndexedProcPtr UpdateIndexed;
+ CompositeProcPtr Composite;
+ GlyphsProcPtr Glyphs;
+ CompositeRectsProcPtr CompositeRects;
- TrapezoidsProcPtr Trapezoids;
- TrianglesProcPtr Triangles;
+ InitIndexedProcPtr InitIndexed;
+ CloseIndexedProcPtr CloseIndexed;
+ UpdateIndexedProcPtr UpdateIndexed;
+
+ TrapezoidsProcPtr Trapezoids;
+ TrianglesProcPtr Triangles;
} DMXScreenInfo;
/* Global variables available to all Xserver/hw/dmx routines. */
-extern int dmxNumScreens; /**< Number of dmxScreens */
-extern DMXScreenInfo *dmxScreens; /**< List of outputs */
-extern int dmxShadowFB; /**< Non-zero if using
+extern int dmxNumScreens; /**< Number of dmxScreens */
+extern DMXScreenInfo *dmxScreens; /**< List of outputs */
+extern int dmxShadowFB; /**< Non-zero if using
+
* shadow frame-buffer
* (deprecated) */
-extern XErrorEvent dmxLastErrorEvent; /**< Last error that
+extern XErrorEvent dmxLastErrorEvent; /**< Last error that
+
* occurred */
-extern Bool dmxErrorOccurred; /**< True if an error
+extern Bool dmxErrorOccurred; /**< True if an error
+
* occurred */
-extern Bool dmxOffScreenOpt; /**< True if using off
+extern Bool dmxOffScreenOpt; /**< True if using off
+
* screen
* optimizations */
-extern Bool dmxSubdividePrimitives; /**< True if using the
+extern Bool dmxSubdividePrimitives; /**< True if using the
+
* primitive subdivision
* optimization */
-extern Bool dmxLazyWindowCreation; /**< True if using the
+extern Bool dmxLazyWindowCreation; /**< True if using the
+
* lazy window creation
* optimization */
-extern Bool dmxUseXKB; /**< True if the XKB
+extern Bool dmxUseXKB; /**< True if the XKB
+
* extension should be
* used with the backend
* servers */
-extern int dmxDepth; /**< Requested depth if
+extern int dmxDepth; /**< Requested depth if
+
* non-zero */
#ifdef GLXEXT
-extern Bool dmxGLXProxy; /**< True if glxProxy
+extern Bool dmxGLXProxy; /**< True if glxProxy
+
* support is enabled */
-extern Bool dmxGLXSwapGroupSupport; /**< True if glxProxy
+extern Bool dmxGLXSwapGroupSupport; /**< True if glxProxy
+
* support for swap
* groups and barriers
* is enabled */
-extern Bool dmxGLXSyncSwap; /**< True if glxProxy
+extern Bool dmxGLXSyncSwap; /**< True if glxProxy
+
* should force an XSync
* request after each
* swap buffers call */
-extern Bool dmxGLXFinishSwap; /**< True if glxProxy
+extern Bool dmxGLXFinishSwap; /**< True if glxProxy
+
* should force a
* glFinish request
* after each swap
* buffers call */
#endif
-extern char *dmxFontPath; /**< NULL if no font
+extern char *dmxFontPath; /**< NULL if no font
+
* path is set on the
* command line;
* otherwise, a string
@@ -302,11 +315,13 @@ extern char *dmxFontPath; /**< NULL if no font
* command line
* specified font
* paths */
-extern Bool dmxIgnoreBadFontPaths; /**< True if bad font
+extern Bool dmxIgnoreBadFontPaths; /**< True if bad font
+
* paths should be
* ignored during server
* init */
-extern Bool dmxAddRemoveScreens; /**< True if add and
+extern Bool dmxAddRemoveScreens; /**< True if add and
+
* remove screens support
* is enabled */
@@ -346,7 +361,7 @@ do { \
if (!o) return retval; \
} \
} while (0)
-
+
#define MAXSCREENSFREE(o) \
do { \
free(o); \
@@ -363,26 +378,33 @@ do { \
#endif
extern DevPrivateKeyRec dmxGCPrivateKeyRec;
+
#define dmxGCPrivateKey (&dmxGCPrivateKeyRec) /**< Private index for GCs */
extern DevPrivateKeyRec dmxWinPrivateKeyRec;
+
#define dmxWinPrivateKey (&dmxWinPrivateKeyRec) /**< Private index for Windows */
extern DevPrivateKeyRec dmxPixPrivateKeyRec;
+
#define dmxPixPrivateKey (&dmxPixPrivateKeyRec) /**< Private index for Pixmaps */
extern int dmxFontPrivateIndex; /**< Private index for Fonts */
extern DevPrivateKeyRec dmxScreenPrivateKeyRec;
+
#define dmxScreenPrivateKey (&dmxScreenPrivateKeyRec) /**< Private index for Screens */
extern DevPrivateKeyRec dmxColormapPrivateKeyRec;
+
#define dmxColormapPrivateKey (&dmxColormapPrivateKeyRec) /**< Private index for Colormaps */
extern DevPrivateKeyRec dmxPictPrivateKeyRec;
+
#define dmxPictPrivateKey (&dmxPictPrivateKeyRec) /**< Private index for Picts */
extern DevPrivateKeyRec dmxGlyphSetPrivateKeyRec;
+
#define dmxGlyphSetPrivateKey (&dmxGlyphSetPrivateKeyRec) /**< Private index for GlyphSets */
-#endif /* DMX_H */
+#endif /* DMX_H */
diff --git a/hw/dmx/dmx_glxvisuals.c b/hw/dmx/dmx_glxvisuals.c
index f0050c283..9fcc0e58d 100644
--- a/hw/dmx/dmx_glxvisuals.c
+++ b/hw/dmx/dmx_glxvisuals.c
@@ -40,189 +40,190 @@
#include "dmx_glxvisuals.h"
-__GLXvisualConfig *GetGLXVisualConfigs(Display *dpy, int screen, int *nconfigs)
+__GLXvisualConfig *
+GetGLXVisualConfigs(Display * dpy, int screen, int *nconfigs)
{
xGLXGetVisualConfigsReq *req;
xGLXGetVisualConfigsReply reply;
__GLXvisualConfig *config, *configs;
GLint i, j, nvisuals, nprops;
INT32 *props, *p;
- int majorOpcode, dummy;
- int num_good_visuals;
+ int majorOpcode, dummy;
+ int num_good_visuals;
if (!XQueryExtension(dpy, "GLX", &majorOpcode, &dummy, &dummy)) {
- return NULL;
+ return NULL;
}
/* Send the glXGetVisualConfigs request */
LockDisplay(dpy);
- GetReq(GLXGetVisualConfigs,req);
+ GetReq(GLXGetVisualConfigs, req);
req->reqType = majorOpcode;
req->glxCode = X_GLXGetVisualConfigs;
req->screen = screen;
- if (!_XReply(dpy, (xReply*) &reply, 0, False)) {
- /* Something is busted. Punt. */
- UnlockDisplay(dpy);
- SyncHandle();
- return NULL;
+ if (!_XReply(dpy, (xReply *) & reply, 0, False)) {
+ /* Something is busted. Punt. */
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return NULL;
}
- nvisuals = (int)reply.numVisuals;
+ nvisuals = (int) reply.numVisuals;
if (!nvisuals) {
- /* This screen does not support GL rendering */
- UnlockDisplay(dpy);
- SyncHandle();
- return NULL;
+ /* This screen does not support GL rendering */
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return NULL;
}
/* Check number of properties per visual */
- nprops = (int)reply.numProps;
- if (nprops < __GLX_MIN_CONFIG_PROPS) {
- /* Huh? Not in protocol defined limits. Punt */
- UnlockDisplay(dpy);
- SyncHandle();
- return NULL;
+ nprops = (int) reply.numProps;
+ if (nprops < __GLX_MIN_CONFIG_PROPS) {
+ /* Huh? Not in protocol defined limits. Punt */
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return NULL;
}
- props = (INT32*) Xmalloc(nprops * __GLX_SIZE_CARD32);
+ props = (INT32 *) Xmalloc(nprops * __GLX_SIZE_CARD32);
if (!props) {
- UnlockDisplay(dpy);
- SyncHandle();
- return NULL;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return NULL;
}
/* Allocate memory for our config structure */
- config = (__GLXvisualConfig*)
- Xmalloc(nvisuals * sizeof(__GLXvisualConfig));
+ config = (__GLXvisualConfig *)
+ Xmalloc(nvisuals * sizeof(__GLXvisualConfig));
if (!config) {
- free(props);
- UnlockDisplay(dpy);
- SyncHandle();
- return NULL;
+ free(props);
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return NULL;
}
memset(config, 0, nvisuals * sizeof(__GLXvisualConfig));
configs = config;
num_good_visuals = 0;
/* Convert config structure into our format */
- for (i=0; i<nvisuals; i++) {
-
- /* Read config structure */
- _XRead(dpy, (char *)props, (nprops * __GLX_SIZE_CARD32));
-
- /* fill in default values */
- config->visualRating = GLX_NONE_EXT;
- config->transparentPixel = GLX_NONE_EXT;
-
- /* Copy in the first set of properties */
- config->vid = props[0];
- config->class = props[1];
-
- config->rgba = (Bool) props[2];
-
- config->redSize = props[3];
- config->greenSize = props[4];
- config->blueSize = props[5];
- config->alphaSize = props[6];
-
- config->accumRedSize = props[7];
- config->accumGreenSize = props[8];
- config->accumBlueSize = props[9];
- config->accumAlphaSize = props[10];
-
- config->doubleBuffer = (Bool) props[11];
- config->stereo = (Bool) props[12];
-
- config->bufferSize = props[13];
- config->depthSize = props[14];
- config->stencilSize = props[15];
-
- config->auxBuffers = props[16];
- config->level = props[17];
-
- /* Process remaining properties */
- p = &props[18];
- for (j=__GLX_MIN_CONFIG_PROPS; j<nprops; j+=2) {
- int property = *p++;
- int value = *p++;
-
- switch (property) {
- case GLX_SAMPLES_SGIS:
- config->multiSampleSize = value;
- break;
- case GLX_SAMPLE_BUFFERS_SGIS:
- config->nMultiSampleBuffers = value;
- break;
-
- case GLX_TRANSPARENT_TYPE_EXT:
- config->transparentPixel = value;
- break;
- case GLX_TRANSPARENT_INDEX_VALUE_EXT:
- config->transparentIndex = value;
- break;
- case GLX_TRANSPARENT_RED_VALUE_EXT:
- config->transparentRed = value;
- break;
- case GLX_TRANSPARENT_GREEN_VALUE_EXT:
- config->transparentGreen = value;
- break;
- case GLX_TRANSPARENT_BLUE_VALUE_EXT:
- config->transparentBlue = value;
- break;
- case GLX_TRANSPARENT_ALPHA_VALUE_EXT:
- config->transparentAlpha = value;
- break;
-
- case GLX_VISUAL_CAVEAT_EXT:
- config->visualRating = value;
- break;
-
- /* visualSelectGroup is an internal used property */
- case GLX_VISUAL_SELECT_GROUP_SGIX:
- config->visualSelectGroup = value;
- break;
-
- default :
- /* Ignore properties we don't recognize */
- break;
- }
- } /* for j */
-
- /*
- // filter out overlay visuals (dmx does not support overlays)
- */
- if (config->level == 0) {
- config++;
- num_good_visuals++;
- }
-
- } /* for i */
+ for (i = 0; i < nvisuals; i++) {
+
+ /* Read config structure */
+ _XRead(dpy, (char *) props, (nprops * __GLX_SIZE_CARD32));
+
+ /* fill in default values */
+ config->visualRating = GLX_NONE_EXT;
+ config->transparentPixel = GLX_NONE_EXT;
+
+ /* Copy in the first set of properties */
+ config->vid = props[0];
+ config->class = props[1];
+
+ config->rgba = (Bool) props[2];
+
+ config->redSize = props[3];
+ config->greenSize = props[4];
+ config->blueSize = props[5];
+ config->alphaSize = props[6];
+
+ config->accumRedSize = props[7];
+ config->accumGreenSize = props[8];
+ config->accumBlueSize = props[9];
+ config->accumAlphaSize = props[10];
+
+ config->doubleBuffer = (Bool) props[11];
+ config->stereo = (Bool) props[12];
+
+ config->bufferSize = props[13];
+ config->depthSize = props[14];
+ config->stencilSize = props[15];
+
+ config->auxBuffers = props[16];
+ config->level = props[17];
+
+ /* Process remaining properties */
+ p = &props[18];
+ for (j = __GLX_MIN_CONFIG_PROPS; j < nprops; j += 2) {
+ int property = *p++;
+ int value = *p++;
+
+ switch (property) {
+ case GLX_SAMPLES_SGIS:
+ config->multiSampleSize = value;
+ break;
+ case GLX_SAMPLE_BUFFERS_SGIS:
+ config->nMultiSampleBuffers = value;
+ break;
+
+ case GLX_TRANSPARENT_TYPE_EXT:
+ config->transparentPixel = value;
+ break;
+ case GLX_TRANSPARENT_INDEX_VALUE_EXT:
+ config->transparentIndex = value;
+ break;
+ case GLX_TRANSPARENT_RED_VALUE_EXT:
+ config->transparentRed = value;
+ break;
+ case GLX_TRANSPARENT_GREEN_VALUE_EXT:
+ config->transparentGreen = value;
+ break;
+ case GLX_TRANSPARENT_BLUE_VALUE_EXT:
+ config->transparentBlue = value;
+ break;
+ case GLX_TRANSPARENT_ALPHA_VALUE_EXT:
+ config->transparentAlpha = value;
+ break;
+
+ case GLX_VISUAL_CAVEAT_EXT:
+ config->visualRating = value;
+ break;
+
+ /* visualSelectGroup is an internal used property */
+ case GLX_VISUAL_SELECT_GROUP_SGIX:
+ config->visualSelectGroup = value;
+ break;
+
+ default:
+ /* Ignore properties we don't recognize */
+ break;
+ }
+ } /* for j */
+
+ /*
+ // filter out overlay visuals (dmx does not support overlays)
+ */
+ if (config->level == 0) {
+ config++;
+ num_good_visuals++;
+ }
+
+ } /* for i */
UnlockDisplay(dpy);
nvisuals = num_good_visuals;
config = configs;
- for (i=0; i<nvisuals; i++) {
- /* XXX hack to fill-in mask info (need a better way to do this) */
- {
- XVisualInfo *vis, template;
- int n;
-
- template.screen = screen;
- template.visualid = config->vid;
- vis = XGetVisualInfo(dpy, VisualScreenMask|VisualIDMask,
- &template, &n);
-
- if (vis != NULL) {
- config->redMask = vis->red_mask;
- config->greenMask = vis->green_mask;
- config->blueMask = vis->blue_mask;
- config->alphaMask = 0; /* XXX */
- free(vis);
- }
- }
- config++;
- } /* for i */
+ for (i = 0; i < nvisuals; i++) {
+ /* XXX hack to fill-in mask info (need a better way to do this) */
+ {
+ XVisualInfo *vis, template;
+ int n;
+
+ template.screen = screen;
+ template.visualid = config->vid;
+ vis = XGetVisualInfo(dpy, VisualScreenMask | VisualIDMask,
+ &template, &n);
+
+ if (vis != NULL) {
+ config->redMask = vis->red_mask;
+ config->greenMask = vis->green_mask;
+ config->blueMask = vis->blue_mask;
+ config->alphaMask = 0; /* XXX */
+ free(vis);
+ }
+ }
+ config++;
+ } /* for i */
XFree(props);
SyncHandle();
@@ -231,15 +232,15 @@ __GLXvisualConfig *GetGLXVisualConfigs(Display *dpy, int screen, int *nconfigs)
return configs;
}
-
-__GLXFBConfig *GetGLXFBConfigs(Display *dpy, int glxMajorOpcode, int *nconfigs)
+__GLXFBConfig *
+GetGLXFBConfigs(Display * dpy, int glxMajorOpcode, int *nconfigs)
{
xGLXGetFBConfigsReq *req;
xGLXGetFBConfigsReply reply;
__GLXFBConfig *config, *fbconfigs;
GLint i, j, numFBConfigs, numAttribs;
INT32 *attrs, *p;
- int screen = DefaultScreen( dpy );
+ int screen = DefaultScreen(dpy);
int numValidConfigs = 0;
/* Send the glXGetFBConfigs request */
@@ -251,238 +252,237 @@ __GLXFBConfig *GetGLXFBConfigs(Display *dpy, int glxMajorOpcode, int *nconfigs)
*nconfigs = 0;
- if (!_XReply(dpy, (xReply*) &reply, 0, False)) {
- /* Something is busted. Punt. */
- UnlockDisplay(dpy);
- SyncHandle();
- return NULL;
+ if (!_XReply(dpy, (xReply *) & reply, 0, False)) {
+ /* Something is busted. Punt. */
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return NULL;
}
- numFBConfigs = (int)reply.numFBConfigs;
+ numFBConfigs = (int) reply.numFBConfigs;
if (!numFBConfigs) {
- /* This screen does not support GL rendering */
- UnlockDisplay(dpy);
- SyncHandle();
- return NULL;
+ /* This screen does not support GL rendering */
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return NULL;
}
- numAttribs = (int)reply.numAttribs;
- if (!numAttribs) {
- UnlockDisplay(dpy);
- SyncHandle();
- return NULL;
+ numAttribs = (int) reply.numAttribs;
+ if (!numAttribs) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return NULL;
}
- attrs = (INT32*) Xmalloc(2*numAttribs * __GLX_SIZE_CARD32);
+ attrs = (INT32 *) Xmalloc(2 * numAttribs * __GLX_SIZE_CARD32);
if (!attrs) {
- UnlockDisplay(dpy);
- SyncHandle();
- return NULL;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return NULL;
}
/* Allocate memory for our config structure */
- config = (__GLXFBConfig*)
- Xmalloc(numFBConfigs * sizeof(__GLXFBConfig));
+ config = (__GLXFBConfig *)
+ Xmalloc(numFBConfigs * sizeof(__GLXFBConfig));
if (!config) {
- free(attrs);
- UnlockDisplay(dpy);
- SyncHandle();
- return NULL;
+ free(attrs);
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return NULL;
}
memset(config, 0, numFBConfigs * sizeof(__GLXFBConfig));
fbconfigs = config;
/* Convert attribute list into our format */
- for (i=0; i<numFBConfigs; i++) {
-
- /* Fill in default properties */
- config->transparentType = GLX_NONE_EXT;
- config->visualCaveat = GLX_NONE_EXT;
- config->minRed = 0.;
- config->maxRed = 1.;
- config->minGreen = 0.;
- config->maxGreen = 1.;
- config->minBlue = 0.;
- config->maxBlue = 1.;
- config->minAlpha = 0.;
- config->maxAlpha = 1.;
-
- /* Read attribute list */
- _XRead(dpy, (char *)attrs, (2*numAttribs * __GLX_SIZE_CARD32));
-
- p = attrs;
- for (j=0; j<numAttribs; j++) {
- int attribute = *p++;
- int value = *p++;
-
- switch (attribute) {
- /* core attributes */
- case GLX_FBCONFIG_ID:
- config->id = value;
- break;
- case GLX_BUFFER_SIZE:
- config->indexBits = value;
- break;
- case GLX_LEVEL:
- config->level = value;
- break;
- case GLX_DOUBLEBUFFER:
- config->doubleBufferMode = value;
- break;
- case GLX_STEREO:
- config->stereoMode = value;
- break;
- case GLX_AUX_BUFFERS:
- config->maxAuxBuffers = value;
- break;
- case GLX_RED_SIZE:
- config->redBits = value;
- break;
- case GLX_GREEN_SIZE:
- config->greenBits = value;
- break;
- case GLX_BLUE_SIZE:
- config->blueBits = value;
- break;
- case GLX_ALPHA_SIZE:
- config->alphaBits = value;
- break;
- case GLX_DEPTH_SIZE:
- config->depthBits = value;
- break;
- case GLX_STENCIL_SIZE:
- config->stencilBits = value;
- break;
- case GLX_ACCUM_RED_SIZE:
- config->accumRedBits = value;
- break;
- case GLX_ACCUM_GREEN_SIZE:
- config->accumGreenBits = value;
- break;
- case GLX_ACCUM_BLUE_SIZE:
- config->accumBlueBits = value;
- break;
- case GLX_ACCUM_ALPHA_SIZE:
- config->accumAlphaBits = value;
- break;
- case GLX_RENDER_TYPE:
- config->renderType = value;
- break;
- case GLX_DRAWABLE_TYPE:
- config->drawableType = value;
- break;
- case GLX_X_VISUAL_TYPE:
- config->visualType = value;
- break;
- case GLX_CONFIG_CAVEAT:
- config->visualCaveat = value;
- break;
- case GLX_TRANSPARENT_TYPE:
- config->transparentType = value;
- break;
- case GLX_TRANSPARENT_INDEX_VALUE:
- config->transparentIndex = value;
- break;
- case GLX_TRANSPARENT_RED_VALUE:
- config->transparentRed = value;
- break;
- case GLX_TRANSPARENT_GREEN_VALUE:
- config->transparentGreen = value;
- break;
- case GLX_TRANSPARENT_BLUE_VALUE:
- config->transparentBlue = value;
- break;
- case GLX_TRANSPARENT_ALPHA_VALUE:
- config->transparentAlpha = value;
- break;
- case GLX_MAX_PBUFFER_WIDTH:
- config->maxPbufferWidth = value;
- break;
- case GLX_MAX_PBUFFER_HEIGHT:
- config->maxPbufferHeight = value;
- break;
- case GLX_MAX_PBUFFER_PIXELS:
- config->maxPbufferPixels = value;
- break;
- case GLX_VISUAL_ID:
- config->associatedVisualId = value;
- break;
-
- /* visualSelectGroup is an internal used property */
- case GLX_VISUAL_SELECT_GROUP_SGIX:
- config->visualSelectGroup = value;
- break;
-
- /* SGIS_multisample attributes */
- case GLX_SAMPLES_SGIS:
- config->multiSampleSize = value;
- break;
- case GLX_SAMPLE_BUFFERS_SGIS:
- config->nMultiSampleBuffers = value;
- break;
-
- /* SGIX_pbuffer specific attributes */
- case GLX_OPTIMAL_PBUFFER_WIDTH_SGIX:
- config->optimalPbufferWidth = value;
- break;
- case GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX:
- config->optimalPbufferHeight = value;
- break;
-
- default:
- /* Ignore attributes we don't recognize */
- break;
- }
- } /* for j */
-
- /* Fill in derived values */
- config->screen = screen;
-
- config->rgbMode = config->renderType & GLX_RGBA_BIT;
- config->colorIndexMode = !config->rgbMode;
-
- config->haveAccumBuffer =
- config->accumRedBits > 0 ||
- config->accumGreenBits > 0 ||
- config->accumBlueBits > 0;
- /* Can't have alpha without color */
-
- config->haveDepthBuffer = config->depthBits > 0;
- config->haveStencilBuffer = config->stencilBits > 0;
-
- /* overlay visuals are not valid for now */
- if (!config->level) {
- config++;
- numValidConfigs++;
- }
-
- } /* for i */
+ for (i = 0; i < numFBConfigs; i++) {
+
+ /* Fill in default properties */
+ config->transparentType = GLX_NONE_EXT;
+ config->visualCaveat = GLX_NONE_EXT;
+ config->minRed = 0.;
+ config->maxRed = 1.;
+ config->minGreen = 0.;
+ config->maxGreen = 1.;
+ config->minBlue = 0.;
+ config->maxBlue = 1.;
+ config->minAlpha = 0.;
+ config->maxAlpha = 1.;
+
+ /* Read attribute list */
+ _XRead(dpy, (char *) attrs, (2 * numAttribs * __GLX_SIZE_CARD32));
+
+ p = attrs;
+ for (j = 0; j < numAttribs; j++) {
+ int attribute = *p++;
+ int value = *p++;
+
+ switch (attribute) {
+ /* core attributes */
+ case GLX_FBCONFIG_ID:
+ config->id = value;
+ break;
+ case GLX_BUFFER_SIZE:
+ config->indexBits = value;
+ break;
+ case GLX_LEVEL:
+ config->level = value;
+ break;
+ case GLX_DOUBLEBUFFER:
+ config->doubleBufferMode = value;
+ break;
+ case GLX_STEREO:
+ config->stereoMode = value;
+ break;
+ case GLX_AUX_BUFFERS:
+ config->maxAuxBuffers = value;
+ break;
+ case GLX_RED_SIZE:
+ config->redBits = value;
+ break;
+ case GLX_GREEN_SIZE:
+ config->greenBits = value;
+ break;
+ case GLX_BLUE_SIZE:
+ config->blueBits = value;
+ break;
+ case GLX_ALPHA_SIZE:
+ config->alphaBits = value;
+ break;
+ case GLX_DEPTH_SIZE:
+ config->depthBits = value;
+ break;
+ case GLX_STENCIL_SIZE:
+ config->stencilBits = value;
+ break;
+ case GLX_ACCUM_RED_SIZE:
+ config->accumRedBits = value;
+ break;
+ case GLX_ACCUM_GREEN_SIZE:
+ config->accumGreenBits = value;
+ break;
+ case GLX_ACCUM_BLUE_SIZE:
+ config->accumBlueBits = value;
+ break;
+ case GLX_ACCUM_ALPHA_SIZE:
+ config->accumAlphaBits = value;
+ break;
+ case GLX_RENDER_TYPE:
+ config->renderType = value;
+ break;
+ case GLX_DRAWABLE_TYPE:
+ config->drawableType = value;
+ break;
+ case GLX_X_VISUAL_TYPE:
+ config->visualType = value;
+ break;
+ case GLX_CONFIG_CAVEAT:
+ config->visualCaveat = value;
+ break;
+ case GLX_TRANSPARENT_TYPE:
+ config->transparentType = value;
+ break;
+ case GLX_TRANSPARENT_INDEX_VALUE:
+ config->transparentIndex = value;
+ break;
+ case GLX_TRANSPARENT_RED_VALUE:
+ config->transparentRed = value;
+ break;
+ case GLX_TRANSPARENT_GREEN_VALUE:
+ config->transparentGreen = value;
+ break;
+ case GLX_TRANSPARENT_BLUE_VALUE:
+ config->transparentBlue = value;
+ break;
+ case GLX_TRANSPARENT_ALPHA_VALUE:
+ config->transparentAlpha = value;
+ break;
+ case GLX_MAX_PBUFFER_WIDTH:
+ config->maxPbufferWidth = value;
+ break;
+ case GLX_MAX_PBUFFER_HEIGHT:
+ config->maxPbufferHeight = value;
+ break;
+ case GLX_MAX_PBUFFER_PIXELS:
+ config->maxPbufferPixels = value;
+ break;
+ case GLX_VISUAL_ID:
+ config->associatedVisualId = value;
+ break;
+
+ /* visualSelectGroup is an internal used property */
+ case GLX_VISUAL_SELECT_GROUP_SGIX:
+ config->visualSelectGroup = value;
+ break;
+
+ /* SGIS_multisample attributes */
+ case GLX_SAMPLES_SGIS:
+ config->multiSampleSize = value;
+ break;
+ case GLX_SAMPLE_BUFFERS_SGIS:
+ config->nMultiSampleBuffers = value;
+ break;
+
+ /* SGIX_pbuffer specific attributes */
+ case GLX_OPTIMAL_PBUFFER_WIDTH_SGIX:
+ config->optimalPbufferWidth = value;
+ break;
+ case GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX:
+ config->optimalPbufferHeight = value;
+ break;
+
+ default:
+ /* Ignore attributes we don't recognize */
+ break;
+ }
+ } /* for j */
+
+ /* Fill in derived values */
+ config->screen = screen;
+
+ config->rgbMode = config->renderType & GLX_RGBA_BIT;
+ config->colorIndexMode = !config->rgbMode;
+
+ config->haveAccumBuffer =
+ config->accumRedBits > 0 ||
+ config->accumGreenBits > 0 || config->accumBlueBits > 0;
+ /* Can't have alpha without color */
+
+ config->haveDepthBuffer = config->depthBits > 0;
+ config->haveStencilBuffer = config->stencilBits > 0;
+
+ /* overlay visuals are not valid for now */
+ if (!config->level) {
+ config++;
+ numValidConfigs++;
+ }
+
+ } /* for i */
UnlockDisplay(dpy);
config = fbconfigs;
- for (i=0; i<numValidConfigs; i++) {
-
- /* XXX hack to fill-in mask info (need a better way to do this) */
- if (config->associatedVisualId != 0) {
- XVisualInfo *vis, template;
- int n;
-
- template.screen = screen;
- template.visualid = config->associatedVisualId;
- vis = XGetVisualInfo(dpy, VisualScreenMask|VisualIDMask,
- &template, &n);
-
- if (vis != NULL) {
- config->redMask = (GLuint)vis->red_mask;
- config->greenMask = (GLuint)vis->green_mask;
- config->blueMask = (GLuint)vis->blue_mask;
- config->alphaMask = 0; /* XXX */
- free(vis);
- }
- }
-
- config++;
- } /* for i */
+ for (i = 0; i < numValidConfigs; i++) {
+
+ /* XXX hack to fill-in mask info (need a better way to do this) */
+ if (config->associatedVisualId != 0) {
+ XVisualInfo *vis, template;
+ int n;
+
+ template.screen = screen;
+ template.visualid = config->associatedVisualId;
+ vis = XGetVisualInfo(dpy, VisualScreenMask | VisualIDMask,
+ &template, &n);
+
+ if (vis != NULL) {
+ config->redMask = (GLuint) vis->red_mask;
+ config->greenMask = (GLuint) vis->green_mask;
+ config->blueMask = (GLuint) vis->blue_mask;
+ config->alphaMask = 0; /* XXX */
+ free(vis);
+ }
+ }
+
+ config++;
+ } /* for i */
XFree(attrs);
SyncHandle();
@@ -492,110 +492,110 @@ __GLXFBConfig *GetGLXFBConfigs(Display *dpy, int glxMajorOpcode, int *nconfigs)
}
__GLXvisualConfig *
-GetGLXVisualConfigsFromFBConfigs(__GLXFBConfig *fbconfigs, int nfbconfigs,
- XVisualInfo *visuals, int nvisuals,
- __GLXvisualConfig *glxConfigs, int nGlxConfigs,
- int *nconfigs)
+GetGLXVisualConfigsFromFBConfigs(__GLXFBConfig * fbconfigs, int nfbconfigs,
+ XVisualInfo * visuals, int nvisuals,
+ __GLXvisualConfig * glxConfigs,
+ int nGlxConfigs, int *nconfigs)
{
__GLXvisualConfig *configs = NULL;
int i;
-
- if (!fbconfigs || !nfbconfigs || !nconfigs) return NULL;
+
+ if (!fbconfigs || !nfbconfigs || !nconfigs)
+ return NULL;
*nconfigs = 0;
/* Allocate memory for our config structure */
- configs = (__GLXvisualConfig*)
- Xmalloc(nfbconfigs * sizeof(__GLXvisualConfig));
+ configs = (__GLXvisualConfig *)
+ Xmalloc(nfbconfigs * sizeof(__GLXvisualConfig));
if (!configs) {
- return NULL;
+ return NULL;
}
memset(configs, 0, nfbconfigs * sizeof(__GLXvisualConfig));
- for (i=0; i<nfbconfigs; i++) {
- __GLXFBConfig *fbcfg = &fbconfigs[i];
-
- if (fbcfg->associatedVisualId > 0) {
- __GLXvisualConfig *cfg = configs + (*nconfigs);
- int j;
- XVisualInfo *vinfo = NULL;
-
- for (j=0; j<nvisuals; j++) {
- if (visuals[j].visualid == fbcfg->associatedVisualId) {
- vinfo = &visuals[j];
- break;
- }
- }
- if (!vinfo) continue;
-
- /* skip 16 bit colormap visuals */
- if (vinfo->depth == 16 &&
- vinfo->class != TrueColor &&
- vinfo->class != DirectColor ) {
- continue;
- }
-
- (*nconfigs)++;
-
- /*
- * if the same visualid exists in the glx configs,
- * copy the glx attributes from the glx config
- */
- for (j=0; j<nGlxConfigs; j++) {
- if (glxConfigs[j].vid == vinfo->visualid)
- break;
- }
- if (j < nGlxConfigs) {
- memcpy(cfg, &glxConfigs[j], sizeof(__GLXvisualConfig) );
- continue;
- }
-
- /*
- * make glx attributes from the FB config attributes
- */
- cfg->vid = fbcfg->associatedVisualId;
- cfg->class = vinfo->class;
- cfg->rgba = !(fbcfg->renderType & GLX_COLOR_INDEX_BIT_SGIX);
- cfg->redSize = fbcfg->redBits;
- cfg->greenSize = fbcfg->greenBits;
- cfg->blueSize = fbcfg->blueBits;
- cfg->alphaSize = fbcfg->alphaBits;
- cfg->redMask = fbcfg->redMask;
- cfg->greenMask = fbcfg->greenMask;
- cfg->blueMask = fbcfg->blueMask;
- cfg->alphaMask = fbcfg->alphaMask;
- cfg->accumRedSize = fbcfg->accumRedBits;
- cfg->accumGreenSize = fbcfg->accumGreenBits;
- cfg->accumBlueSize = fbcfg->accumBlueBits;
- cfg->accumAlphaSize = fbcfg->accumAlphaBits;
- cfg->doubleBuffer = fbcfg->doubleBufferMode;
- cfg->stereo = fbcfg->stereoMode;
- if (vinfo->class == TrueColor || vinfo->class == DirectColor) {
- cfg->bufferSize = (fbcfg->rgbMode ? (fbcfg->redBits +
- fbcfg->greenBits +
- fbcfg->blueBits +
- fbcfg->alphaBits)
- : fbcfg->indexBits );
- }
- else {
- cfg->bufferSize = vinfo->depth;
- }
- cfg->depthSize = fbcfg->depthBits;
- cfg->stencilSize = fbcfg->stencilBits;
- cfg->auxBuffers = fbcfg->maxAuxBuffers;
- cfg->level = fbcfg->level;
- cfg->visualRating = fbcfg->visualCaveat;
- cfg->transparentPixel = fbcfg->transparentType;
- cfg->transparentRed = fbcfg->transparentRed;
- cfg->transparentGreen = fbcfg->transparentGreen;
- cfg->transparentBlue = fbcfg->transparentBlue;
- cfg->transparentAlpha = fbcfg->transparentAlpha;
- cfg->transparentIndex = fbcfg->transparentIndex;
- cfg->multiSampleSize = fbcfg->multiSampleSize;
- cfg->nMultiSampleBuffers = fbcfg->nMultiSampleBuffers;
- cfg->visualSelectGroup = fbcfg->visualSelectGroup;
- }
+ for (i = 0; i < nfbconfigs; i++) {
+ __GLXFBConfig *fbcfg = &fbconfigs[i];
+
+ if (fbcfg->associatedVisualId > 0) {
+ __GLXvisualConfig *cfg = configs + (*nconfigs);
+ int j;
+ XVisualInfo *vinfo = NULL;
+
+ for (j = 0; j < nvisuals; j++) {
+ if (visuals[j].visualid == fbcfg->associatedVisualId) {
+ vinfo = &visuals[j];
+ break;
+ }
+ }
+ if (!vinfo)
+ continue;
+
+ /* skip 16 bit colormap visuals */
+ if (vinfo->depth == 16 &&
+ vinfo->class != TrueColor && vinfo->class != DirectColor) {
+ continue;
+ }
+
+ (*nconfigs)++;
+
+ /*
+ * if the same visualid exists in the glx configs,
+ * copy the glx attributes from the glx config
+ */
+ for (j = 0; j < nGlxConfigs; j++) {
+ if (glxConfigs[j].vid == vinfo->visualid)
+ break;
+ }
+ if (j < nGlxConfigs) {
+ memcpy(cfg, &glxConfigs[j], sizeof(__GLXvisualConfig));
+ continue;
+ }
+
+ /*
+ * make glx attributes from the FB config attributes
+ */
+ cfg->vid = fbcfg->associatedVisualId;
+ cfg->class = vinfo->class;
+ cfg->rgba = !(fbcfg->renderType & GLX_COLOR_INDEX_BIT_SGIX);
+ cfg->redSize = fbcfg->redBits;
+ cfg->greenSize = fbcfg->greenBits;
+ cfg->blueSize = fbcfg->blueBits;
+ cfg->alphaSize = fbcfg->alphaBits;
+ cfg->redMask = fbcfg->redMask;
+ cfg->greenMask = fbcfg->greenMask;
+ cfg->blueMask = fbcfg->blueMask;
+ cfg->alphaMask = fbcfg->alphaMask;
+ cfg->accumRedSize = fbcfg->accumRedBits;
+ cfg->accumGreenSize = fbcfg->accumGreenBits;
+ cfg->accumBlueSize = fbcfg->accumBlueBits;
+ cfg->accumAlphaSize = fbcfg->accumAlphaBits;
+ cfg->doubleBuffer = fbcfg->doubleBufferMode;
+ cfg->stereo = fbcfg->stereoMode;
+ if (vinfo->class == TrueColor || vinfo->class == DirectColor) {
+ cfg->bufferSize = (fbcfg->rgbMode ? (fbcfg->redBits +
+ fbcfg->greenBits +
+ fbcfg->blueBits +
+ fbcfg->alphaBits)
+ : fbcfg->indexBits);
+ }
+ else {
+ cfg->bufferSize = vinfo->depth;
+ }
+ cfg->depthSize = fbcfg->depthBits;
+ cfg->stencilSize = fbcfg->stencilBits;
+ cfg->auxBuffers = fbcfg->maxAuxBuffers;
+ cfg->level = fbcfg->level;
+ cfg->visualRating = fbcfg->visualCaveat;
+ cfg->transparentPixel = fbcfg->transparentType;
+ cfg->transparentRed = fbcfg->transparentRed;
+ cfg->transparentGreen = fbcfg->transparentGreen;
+ cfg->transparentBlue = fbcfg->transparentBlue;
+ cfg->transparentAlpha = fbcfg->transparentAlpha;
+ cfg->transparentIndex = fbcfg->transparentIndex;
+ cfg->multiSampleSize = fbcfg->multiSampleSize;
+ cfg->nMultiSampleBuffers = fbcfg->nMultiSampleBuffers;
+ cfg->visualSelectGroup = fbcfg->visualSelectGroup;
+ }
}
return configs;
}
-
diff --git a/hw/dmx/dmx_glxvisuals.h b/hw/dmx/dmx_glxvisuals.h
index 477e92391..54c3b44ca 100644
--- a/hw/dmx/dmx_glxvisuals.h
+++ b/hw/dmx/dmx_glxvisuals.h
@@ -39,21 +39,19 @@ typedef struct {
int x_visual_class;
} dmxGlxVisualPrivate;
-__GLXvisualConfig *GetGLXVisualConfigs(Display *dpy,
- int screen,
- int *nconfigs);
+__GLXvisualConfig *GetGLXVisualConfigs(Display * dpy,
+ int screen, int *nconfigs);
-__GLXFBConfig *GetGLXFBConfigs(Display *dpy,
- int glxMajorOpcode,
- int *nconfigs);
+__GLXFBConfig *GetGLXFBConfigs(Display * dpy,
+ int glxMajorOpcode, int *nconfigs);
-__GLXvisualConfig *GetGLXVisualConfigsFromFBConfigs(__GLXFBConfig *fbconfigs,
- int nfbconfigs,
- XVisualInfo *visuals,
- int nvisuals,
- __GLXvisualConfig
- *glxConfigs,
- int nGlxConfigs,
- int *nconfigs);
+__GLXvisualConfig *GetGLXVisualConfigsFromFBConfigs(__GLXFBConfig * fbconfigs,
+ int nfbconfigs,
+ XVisualInfo * visuals,
+ int nvisuals,
+ __GLXvisualConfig
+ * glxConfigs,
+ int nGlxConfigs,
+ int *nconfigs);
#endif
diff --git a/hw/dmx/dmxcb.c b/hw/dmx/dmxcb.c
index d0eb35117..86015f395 100644
--- a/hw/dmx/dmxcb.c
+++ b/hw/dmx/dmxcb.c
@@ -43,40 +43,42 @@
#include "dmxinput.h"
#include "dmxlog.h"
-extern int connBlockScreenStart;
+extern int connBlockScreenStart;
#ifdef PANORAMIX
#include "panoramiXsrv.h"
-extern int PanoramiXPixWidth;
-extern int PanoramiXPixHeight;
-extern int PanoramiXNumScreens;
+extern int PanoramiXPixWidth;
+extern int PanoramiXPixHeight;
+extern int PanoramiXNumScreens;
#endif
- int dmxGlobalWidth, dmxGlobalHeight;
+int dmxGlobalWidth, dmxGlobalHeight;
/** We may want the wall dimensions to be different from the bounding
* box dimensions that Xinerama computes, so save those and update them
* here.
*/
-void dmxSetWidthHeight(int width, int height)
+void
+dmxSetWidthHeight(int width, int height)
{
- dmxGlobalWidth = width;
+ dmxGlobalWidth = width;
dmxGlobalHeight = height;
}
/** Computes the global bounding box for DMX. This may be larger than
* the one computed by Xinerama because of the DMX configuration
* file. */
-void dmxComputeWidthHeight(DMXRecomputeFlag flag)
+void
+dmxComputeWidthHeight(DMXRecomputeFlag flag)
{
- int i;
+ int i;
DMXScreenInfo *dmxScreen;
- int w = 0;
- int h = 0;
-
+ int w = 0;
+ int h = 0;
+
for (i = 0; i < dmxNumScreens; i++) {
- /* Don't use root* here because this is
- * the global bounding box. */
+ /* Don't use root* here because this is
+ * the global bounding box. */
dmxScreen = &dmxScreens[i];
if (w < dmxScreen->scrnWidth + dmxScreen->rootXOrigin)
w = dmxScreen->scrnWidth + dmxScreen->rootXOrigin;
@@ -85,7 +87,8 @@ void dmxComputeWidthHeight(DMXRecomputeFlag flag)
}
if (!dmxGlobalWidth && !dmxGlobalHeight) {
dmxLog(dmxInfo, "Using %dx%d as global bounding box\n", w, h);
- } else {
+ }
+ else {
switch (flag) {
case DMX_NO_RECOMPUTE_BOUNDING_BOX:
dmxLog(dmxInfo,
@@ -101,20 +104,21 @@ void dmxComputeWidthHeight(DMXRecomputeFlag flag)
break;
}
}
-
- dmxGlobalWidth = w;
+
+ dmxGlobalWidth = w;
dmxGlobalHeight = h;
}
/** A callback routine that hooks into Xinerama and provides a
* convenient place to print summary log information during server
* startup. This routine does not modify any values. */
-void dmxConnectionBlockCallback(void)
+void
+dmxConnectionBlockCallback(void)
{
- xWindowRoot *root = (xWindowRoot *)(ConnectionInfo+connBlockScreenStart);
- int offset = connBlockScreenStart + sizeof(xWindowRoot);
- int i;
- Bool *found = NULL;
+ xWindowRoot *root = (xWindowRoot *) (ConnectionInfo + connBlockScreenStart);
+ int offset = connBlockScreenStart + sizeof(xWindowRoot);
+ int i;
+ Bool *found = NULL;
MAXSCREENSALLOC(found);
if (!found)
@@ -130,22 +134,24 @@ void dmxConnectionBlockCallback(void)
"Changing Xinerama dimensions from %d %d to %d %d\n",
PanoramiXPixWidth, PanoramiXPixHeight,
dmxGlobalWidth, dmxGlobalHeight);
- PanoramiXPixWidth = root->pixWidth = dmxGlobalWidth;
+ PanoramiXPixWidth = root->pixWidth = dmxGlobalWidth;
PanoramiXPixHeight = root->pixHeight = dmxGlobalHeight;
- } else {
- dmxGlobalWidth = PanoramiXPixWidth;
+ }
+ else {
+ dmxGlobalWidth = PanoramiXPixWidth;
dmxGlobalHeight = PanoramiXPixHeight;
}
dmxLog(dmxInfo, "%d screens configured with Xinerama (%d %d)\n",
PanoramiXNumScreens, PanoramiXPixWidth, PanoramiXPixHeight);
- FOR_NSCREENS(i) found[i] = FALSE;
- } else {
+ FOR_NSCREENS(i) found[i] = FALSE;
+ }
+ else {
#endif
- /* This never happens because we're
- * either called from a Xinerama
- * callback or during reconfiguration
- * (which only works with Xinerama on).
- * In any case, be reasonable. */
+ /* This never happens because we're
+ * either called from a Xinerama
+ * callback or during reconfiguration
+ * (which only works with Xinerama on).
+ * In any case, be reasonable. */
dmxLog(dmxInfo, "%d screens configured (%d %d)\n",
screenInfo.numScreens, root->pixWidth, root->pixHeight);
#ifdef PANORAMIX
@@ -153,46 +159,48 @@ void dmxConnectionBlockCallback(void)
#endif
for (i = 0; i < root->nDepths; i++) {
- xDepth *depth = (xDepth *)(ConnectionInfo + offset);
- int voffset = offset + sizeof(xDepth);
- xVisualType *visual = (xVisualType *)(ConnectionInfo + voffset);
- int j;
-
+ xDepth *depth = (xDepth *) (ConnectionInfo + offset);
+ int voffset = offset + sizeof(xDepth);
+ xVisualType *visual = (xVisualType *) (ConnectionInfo + voffset);
+ int j;
+
dmxLog(dmxInfo, "%d visuals at depth %d:\n",
depth->nVisuals, depth->depth);
for (j = 0; j < depth->nVisuals; j++, visual++) {
XVisualInfo vi;
-
- vi.visual = NULL;
- vi.visualid = visual->visualID;
- vi.screen = 0;
- vi.depth = depth->depth;
- vi.class = visual->class;
- vi.red_mask = visual->redMask;
- vi.green_mask = visual->greenMask;
- vi.blue_mask = visual->blueMask;
+
+ vi.visual = NULL;
+ vi.visualid = visual->visualID;
+ vi.screen = 0;
+ vi.depth = depth->depth;
+ vi.class = visual->class;
+ vi.red_mask = visual->redMask;
+ vi.green_mask = visual->greenMask;
+ vi.blue_mask = visual->blueMask;
vi.colormap_size = visual->colormapEntries;
- vi.bits_per_rgb = visual->bitsPerRGB;
+ vi.bits_per_rgb = visual->bitsPerRGB;
dmxLogVisual(NULL, &vi, 0);
#ifdef PANORAMIX
- if (!noPanoramiXExtension) {
- int k;
- FOR_NSCREENS(k) {
- DMXScreenInfo *dmxScreen = &dmxScreens[k];
-
- if (dmxScreen->beDisplay) {
- XVisualInfo *pvi =
- &dmxScreen->beVisuals[dmxScreen->beDefVisualIndex];
- if (pvi->depth == depth->depth &&
- pvi->class == visual->class)
- found[k] = TRUE;
- } else {
- /* Screen #k is detatched, so it always succeeds */
- found[k] = TRUE;
- }
- }
- }
+ if (!noPanoramiXExtension) {
+ int k;
+
+ FOR_NSCREENS(k) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[k];
+
+ if (dmxScreen->beDisplay) {
+ XVisualInfo *pvi =
+ &dmxScreen->beVisuals[dmxScreen->beDefVisualIndex];
+ if (pvi->depth == depth->depth &&
+ pvi->class == visual->class)
+ found[k] = TRUE;
+ }
+ else {
+ /* Screen #k is detatched, so it always succeeds */
+ found[k] = TRUE;
+ }
+ }
+ }
#endif
}
offset = voffset + depth->nVisuals * sizeof(xVisualType);
@@ -203,18 +211,19 @@ void dmxConnectionBlockCallback(void)
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
- Bool fatal = FALSE;
- FOR_NSCREENS(i) {
- fatal |= !found[i];
- if (!found[i]) {
- dmxLog(dmxError,
- "The default visual for screen #%d does not match "
- "any of the\n", i);
- dmxLog(dmxError,
- "consolidated visuals from Xinerama (listed above)\n");
- }
- }
- if (fatal)
+ Bool fatal = FALSE;
+
+ FOR_NSCREENS(i) {
+ fatal |= !found[i];
+ if (!found[i]) {
+ dmxLog(dmxError,
+ "The default visual for screen #%d does not match "
+ "any of the\n", i);
+ dmxLog(dmxError,
+ "consolidated visuals from Xinerama (listed above)\n");
+ }
+ }
+ if (fatal)
dmxLog(dmxFatal,
"dmxConnectionBlockCallback: invalid screen(s) found");
}
diff --git a/hw/dmx/dmxcb.h b/hw/dmx/dmxcb.h
index fa334dbe8..ca8a2566d 100644
--- a/hw/dmx/dmxcb.h
+++ b/hw/dmx/dmxcb.h
@@ -38,7 +38,7 @@
#ifndef _DMXCB_H_
#define _DMXCB_H_
/** The cursor position, in global coordinates. */
-extern int dmxGlobalWidth, dmxGlobalHeight;
+extern int dmxGlobalWidth, dmxGlobalHeight;
/** #dmxComputeWidthHeight can either recompute the global bounding box
* or not. */
diff --git a/hw/dmx/dmxclient.h b/hw/dmx/dmxclient.h
index f0f235f61..19dfdbe16 100644
--- a/hw/dmx/dmxclient.h
+++ b/hw/dmx/dmxclient.h
@@ -51,19 +51,21 @@ typedef unsigned long Mask64;
typedef unsigned long Atom64;
typedef unsigned long VisualID64;
typedef unsigned long Time64;
+
#define XID XID64
#define Mask Mask64
#define Atom Atom64
#define VisualID VisualID64
#define Time Time64
-typedef XID Window64;
-typedef XID Drawable64;
-typedef XID Font64;
-typedef XID Pixmap64;
-typedef XID Cursor64;
-typedef XID Colormap64;
-typedef XID GContext64;
-typedef XID KeySym64;
+typedef XID Window64;
+typedef XID Drawable64;
+typedef XID Font64;
+typedef XID Pixmap64;
+typedef XID Cursor64;
+typedef XID Colormap64;
+typedef XID GContext64;
+typedef XID KeySym64;
+
#define Window Window64
#define Drawable Drawable64
#define Font Font64
@@ -94,7 +96,7 @@ typedef XID KeySym64;
#include <X11/extensions/XI.h>
/* Always include these, since we query them even if we don't export XINPUT. */
-#include <X11/extensions/XInput.h> /* For XDevice */
+#include <X11/extensions/XInput.h> /* For XDevice */
#include <X11/extensions/Xext.h>
#undef GC
diff --git a/hw/dmx/dmxcmap.c b/hw/dmx/dmxcmap.c
index ca9ef1ff9..450627b40 100644
--- a/hw/dmx/dmxcmap.c
+++ b/hw/dmx/dmxcmap.c
@@ -46,14 +46,15 @@
#include "micmap.h"
-static Bool dmxAllocateColormapPrivates(ColormapPtr pColormap)
+static Bool
+dmxAllocateColormapPrivates(ColormapPtr pColormap)
{
- dmxColormapPrivPtr pCmapPriv;
+ dmxColormapPrivPtr pCmapPriv;
- pCmapPriv = (dmxColormapPrivPtr)malloc(sizeof(*pCmapPriv));
+ pCmapPriv = (dmxColormapPrivPtr) malloc(sizeof(*pCmapPriv));
if (!pCmapPriv)
- return FALSE;
- pCmapPriv->cmap = (Colormap)0;
+ return FALSE;
+ pCmapPriv->cmap = (Colormap) 0;
DMX_SET_COLORMAP_PRIV(pColormap, pCmapPriv);
@@ -61,63 +62,66 @@ static Bool dmxAllocateColormapPrivates(ColormapPtr pColormap)
}
/** Create \a pColormap on the back-end server. */
-Bool dmxBECreateColormap(ColormapPtr pColormap)
+Bool
+dmxBECreateColormap(ColormapPtr pColormap)
{
- ScreenPtr pScreen = pColormap->pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxColormapPrivPtr pCmapPriv = DMX_GET_COLORMAP_PRIV(pColormap);
- VisualPtr pVisual = pColormap->pVisual;
- Visual *visual = dmxLookupVisual(pScreen, pVisual);
+ ScreenPtr pScreen = pColormap->pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ dmxColormapPrivPtr pCmapPriv = DMX_GET_COLORMAP_PRIV(pColormap);
+ VisualPtr pVisual = pColormap->pVisual;
+ Visual *visual = dmxLookupVisual(pScreen, pVisual);
if (visual) {
- pCmapPriv->cmap = XCreateColormap(dmxScreen->beDisplay,
- dmxScreen->scrnWin,
- visual,
- (pVisual->class & DynamicClass ?
- AllocAll : AllocNone));
- return pCmapPriv->cmap != 0;
+ pCmapPriv->cmap = XCreateColormap(dmxScreen->beDisplay,
+ dmxScreen->scrnWin,
+ visual,
+ (pVisual->class & DynamicClass ?
+ AllocAll : AllocNone));
+ return pCmapPriv->cmap != 0;
}
else {
- dmxLog(dmxWarning, "dmxBECreateColormap: No visual found\n");
- return 0;
+ dmxLog(dmxWarning, "dmxBECreateColormap: No visual found\n");
+ return 0;
}
}
/** Create colormap on back-end server associated with \a pColormap's
* screen. */
-Bool dmxCreateColormap(ColormapPtr pColormap)
+Bool
+dmxCreateColormap(ColormapPtr pColormap)
{
- ScreenPtr pScreen = pColormap->pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- Bool ret = TRUE;
+ ScreenPtr pScreen = pColormap->pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ Bool ret = TRUE;
if (!dmxAllocateColormapPrivates(pColormap))
- return FALSE;
+ return FALSE;
if (dmxScreen->beDisplay) {
- if (!dmxBECreateColormap(pColormap))
- return FALSE;
+ if (!dmxBECreateColormap(pColormap))
+ return FALSE;
}
DMX_UNWRAP(CreateColormap, dmxScreen, pScreen);
if (pScreen->CreateColormap)
- ret = pScreen->CreateColormap(pColormap);
+ ret = pScreen->CreateColormap(pColormap);
DMX_WRAP(CreateColormap, dmxCreateColormap, dmxScreen, pScreen);
return ret;
}
/** Destroy \a pColormap on the back-end server. */
-Bool dmxBEFreeColormap(ColormapPtr pColormap)
+Bool
+dmxBEFreeColormap(ColormapPtr pColormap)
{
- ScreenPtr pScreen = pColormap->pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxColormapPrivPtr pCmapPriv = DMX_GET_COLORMAP_PRIV(pColormap);
+ ScreenPtr pScreen = pColormap->pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ dmxColormapPrivPtr pCmapPriv = DMX_GET_COLORMAP_PRIV(pColormap);
if (pCmapPriv->cmap) {
- XFreeColormap(dmxScreen->beDisplay, pCmapPriv->cmap);
- pCmapPriv->cmap = (Colormap)0;
- return TRUE;
+ XFreeColormap(dmxScreen->beDisplay, pCmapPriv->cmap);
+ pCmapPriv->cmap = (Colormap) 0;
+ return TRUE;
}
return FALSE;
@@ -125,88 +129,94 @@ Bool dmxBEFreeColormap(ColormapPtr pColormap)
/** Destroy colormap on back-end server associated with \a pColormap's
* screen. */
-void dmxDestroyColormap(ColormapPtr pColormap)
+void
+dmxDestroyColormap(ColormapPtr pColormap)
{
- ScreenPtr pScreen = pColormap->pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxColormapPrivPtr pCmapPriv = DMX_GET_COLORMAP_PRIV(pColormap);
+ ScreenPtr pScreen = pColormap->pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ dmxColormapPrivPtr pCmapPriv = DMX_GET_COLORMAP_PRIV(pColormap);
if (dmxScreen->beDisplay)
- dmxBEFreeColormap(pColormap);
+ dmxBEFreeColormap(pColormap);
free(pCmapPriv);
DMX_SET_COLORMAP_PRIV(pColormap, NULL);
DMX_UNWRAP(DestroyColormap, dmxScreen, pScreen);
if (pScreen->DestroyColormap)
- pScreen->DestroyColormap(pColormap);
+ pScreen->DestroyColormap(pColormap);
DMX_WRAP(DestroyColormap, dmxDestroyColormap, dmxScreen, pScreen);
}
/** Install colormap on back-end server associated with \a pColormap's
* screen. */
-void dmxInstallColormap(ColormapPtr pColormap)
+void
+dmxInstallColormap(ColormapPtr pColormap)
{
- ScreenPtr pScreen = pColormap->pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxColormapPrivPtr pCmapPriv = DMX_GET_COLORMAP_PRIV(pColormap);
+ ScreenPtr pScreen = pColormap->pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ dmxColormapPrivPtr pCmapPriv = DMX_GET_COLORMAP_PRIV(pColormap);
DMX_UNWRAP(InstallColormap, dmxScreen, pScreen);
if (pScreen->InstallColormap)
- pScreen->InstallColormap(pColormap);
+ pScreen->InstallColormap(pColormap);
DMX_WRAP(InstallColormap, dmxInstallColormap, dmxScreen, pScreen);
if (dmxScreen->beDisplay) {
- XInstallColormap(dmxScreen->beDisplay, pCmapPriv->cmap);
- dmxSync(dmxScreen, FALSE);
+ XInstallColormap(dmxScreen->beDisplay, pCmapPriv->cmap);
+ dmxSync(dmxScreen, FALSE);
}
}
/** Store colors in \a pColormap on back-end server associated with \a
* pColormap's screen. */
-void dmxStoreColors(ColormapPtr pColormap, int ndef, xColorItem *pdef)
+void
+dmxStoreColors(ColormapPtr pColormap, int ndef, xColorItem * pdef)
{
- ScreenPtr pScreen = pColormap->pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxColormapPrivPtr pCmapPriv = DMX_GET_COLORMAP_PRIV(pColormap);
+ ScreenPtr pScreen = pColormap->pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ dmxColormapPrivPtr pCmapPriv = DMX_GET_COLORMAP_PRIV(pColormap);
if (dmxScreen->beDisplay && (pColormap->pVisual->class & DynamicClass)) {
XColor *color = malloc(sizeof(*color) * ndef);
- int i;
-
+ int i;
+
if (color) {
for (i = 0; i < ndef; i++) {
color[i].pixel = pdef[i].pixel;
- color[i].red = pdef[i].red;
- color[i].blue = pdef[i].blue;
+ color[i].red = pdef[i].red;
+ color[i].blue = pdef[i].blue;
color[i].green = pdef[i].green;
color[i].flags = pdef[i].flags;
- color[i].pad = pdef[i].pad;
+ color[i].pad = pdef[i].pad;
}
XStoreColors(dmxScreen->beDisplay, pCmapPriv->cmap, color, ndef);
free(color);
- } else { /* xalloc failed, so fallback */
+ }
+ else { /* xalloc failed, so fallback */
XColor c;
+
for (i = 0; i < ndef; i++) {
c.pixel = pdef[i].pixel;
- c.red = pdef[i].red;
- c.blue = pdef[i].blue;
+ c.red = pdef[i].red;
+ c.blue = pdef[i].blue;
c.green = pdef[i].green;
c.flags = pdef[i].flags;
- c.pad = pdef[i].pad;
+ c.pad = pdef[i].pad;
XStoreColor(dmxScreen->beDisplay, pCmapPriv->cmap, &c);
}
}
- dmxSync(dmxScreen, FALSE);
+ dmxSync(dmxScreen, FALSE);
}
DMX_UNWRAP(StoreColors, dmxScreen, pScreen);
if (pScreen->StoreColors)
- pScreen->StoreColors(pColormap, ndef, pdef);
+ pScreen->StoreColors(pColormap, ndef, pdef);
DMX_WRAP(StoreColors, dmxStoreColors, dmxScreen, pScreen);
}
/** Create the DMX server's default colormap. */
-Bool dmxCreateDefColormap(ScreenPtr pScreen)
+Bool
+dmxCreateDefColormap(ScreenPtr pScreen)
{
return miCreateDefColormap(pScreen);
}
diff --git a/hw/dmx/dmxcmap.h b/hw/dmx/dmxcmap.h
index 75e0650ce..29318b586 100644
--- a/hw/dmx/dmxcmap.h
+++ b/hw/dmx/dmxcmap.h
@@ -41,14 +41,13 @@
/** Colormap private area. */
typedef struct _dmxColormapPriv {
- Colormap cmap;
+ Colormap cmap;
} dmxColormapPrivRec, *dmxColormapPrivPtr;
-
extern Bool dmxCreateColormap(ColormapPtr pColormap);
extern void dmxDestroyColormap(ColormapPtr pColormap);
extern void dmxInstallColormap(ColormapPtr pColormap);
-extern void dmxStoreColors(ColormapPtr pColormap, int ndef, xColorItem *pdef);
+extern void dmxStoreColors(ColormapPtr pColormap, int ndef, xColorItem * pdef);
extern Bool dmxCreateDefColormap(ScreenPtr pScreen);
@@ -63,4 +62,4 @@ extern Bool dmxBEFreeColormap(ColormapPtr pColormap);
#define DMX_GET_COLORMAP_PRIV(_pCMap) (dmxColormapPrivPtr) \
dixLookupPrivate(&(_pCMap)->devPrivates, dmxColormapPrivateKey)
-#endif /* DMXCMAP_H */
+#endif /* DMXCMAP_H */
diff --git a/hw/dmx/dmxcursor.c b/hw/dmx/dmxcursor.c
index 7e0368699..1a77c7d78 100644
--- a/hw/dmx/dmxcursor.c
+++ b/hw/dmx/dmxcursor.c
@@ -116,38 +116,39 @@ static int dmxCursorDoMultiCursors = 1;
/** Turn off support for displaying multiple cursors on overlapped
back-end displays. See #dmxCursorDoMultiCursors. */
-void dmxCursorNoMulti(void)
+void
+dmxCursorNoMulti(void)
{
dmxCursorDoMultiCursors = 0;
}
-static Bool dmxCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
+static Bool
+dmxCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
{
DMXScreenInfo *dmxScreen;
- int i;
- int localX = *x;
- int localY = *y;
- int globalX;
- int globalY;
-
+ int i;
+ int localX = *x;
+ int localY = *y;
+ int globalX;
+ int globalY;
+
if (screenInfo.numScreens == 1)
return FALSE;
- /* On current screen? */
+ /* On current screen? */
dmxScreen = &dmxScreens[(*ppScreen)->myNum];
if (localX >= 0
&& localX < dmxScreen->rootWidth
- && localY >= 0
- && localY < dmxScreen->rootHeight)
+ && localY >= 0 && localY < dmxScreen->rootHeight)
return FALSE;
- /* Convert to global coordinate space */
+ /* Convert to global coordinate space */
globalX = dmxScreen->rootXOrigin + localX;
globalY = dmxScreen->rootYOrigin + localY;
- /* Is cursor on the current screen?
- * This efficiently exits this routine
- * for the most common case. */
+ /* Is cursor on the current screen?
+ * This efficiently exits this routine
+ * for the most common case. */
if (ppScreen && *ppScreen) {
dmxScreen = &dmxScreens[(*ppScreen)->myNum];
if (globalX >= dmxScreen->rootXOrigin
@@ -157,7 +158,7 @@ static Bool dmxCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
return FALSE;
}
- /* Find first screen cursor is on */
+ /* Find first screen cursor is on */
for (i = 0; i < dmxNumScreens; i++) {
dmxScreen = &dmxScreens[i];
if (globalX >= dmxScreen->rootXOrigin
@@ -167,31 +168,32 @@ static Bool dmxCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
if (dmxScreen->index == (*ppScreen)->myNum)
return FALSE;
*ppScreen = screenInfo.screens[dmxScreen->index];
- *x = globalX - dmxScreen->rootXOrigin;
- *y = globalY - dmxScreen->rootYOrigin;
+ *x = globalX - dmxScreen->rootXOrigin;
+ *y = globalY - dmxScreen->rootYOrigin;
return TRUE;
}
}
return FALSE;
}
-static void dmxCrossScreen(ScreenPtr pScreen, Bool entering)
+static void
+dmxCrossScreen(ScreenPtr pScreen, Bool entering)
{
}
-static void dmxWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
+static void
+dmxWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{
DMXDBG3("dmxWarpCursor(%d,%d,%d)\n", pScreen->myNum, x, y);
#if 11 /*BP*/
- /* This call is depracated. Replace with???? */
- miPointerWarpCursor(pDev, pScreen, x, y);
+ /* This call is depracated. Replace with???? */
+ miPointerWarpCursor(pDev, pScreen, x, y);
#else
pScreen->SetCursorPosition(pDev, pScreen, x, y, FALSE);
#endif
}
-miPointerScreenFuncRec dmxPointerCursorFuncs =
-{
+miPointerScreenFuncRec dmxPointerCursorFuncs = {
dmxCursorOffScreen,
dmxCrossScreen,
dmxWarpCursor,
@@ -199,28 +201,31 @@ miPointerScreenFuncRec dmxPointerCursorFuncs =
NULL,
};
-
/** Create a list of screens that we'll manipulate. */
-static int *dmxSLCreate(void)
+static int *
+dmxSLCreate(void)
{
int *list = malloc(dmxNumScreens * sizeof(*list));
int i;
-
+
for (i = 0; i < dmxNumScreens; i++)
list[i] = 1;
return list;
}
/** Free list. */
-static void dmxSLFree(int *list)
+static void
+dmxSLFree(int *list)
{
free(list);
}
/** Find next uninitialized entry in list. */
-static int dmxSLFindNext(int *list)
+static int
+dmxSLFindNext(int *list)
{
int i;
+
for (i = 0; i < dmxNumScreens; i++)
if (list[i])
return i;
@@ -228,17 +233,18 @@ static int dmxSLFindNext(int *list)
}
/** Make one pass over all the screens and return the number updated. */
-static int dmxTryComputeScreenOrigins(int *screensLeft)
+static int
+dmxTryComputeScreenOrigins(int *screensLeft)
{
- ScreenPtr pScreen, refScreen;
- DMXScreenInfo *screen;
- int i, ref;
- int changed = 0;
+ ScreenPtr pScreen, refScreen;
+ DMXScreenInfo *screen;
+ int i, ref;
+ int changed = 0;
for (i = 0; i < dmxNumScreens; i++) {
if (!screensLeft[i])
continue;
- screen = &dmxScreens[i];
+ screen = &dmxScreens[i];
pScreen = screenInfo.screens[i];
switch (screen->where) {
case PosAbsolute:
@@ -298,71 +304,71 @@ static int dmxTryComputeScreenOrigins(int *screensLeft)
return changed;
}
-static void dmxComputeScreenOrigins(void)
+static void
+dmxComputeScreenOrigins(void)
{
- ScreenPtr pScreen;
- int *screensLeft;
- int i, ref;
- int minX, minY;
+ ScreenPtr pScreen;
+ int *screensLeft;
+ int i, ref;
+ int minX, minY;
- /* Compute origins based on
- * configuration information. */
+ /* Compute origins based on
+ * configuration information. */
screensLeft = dmxSLCreate();
while ((i = dmxSLFindNext(screensLeft)) >= 0) {
while (dmxTryComputeScreenOrigins(screensLeft));
if ((i = dmxSLFindNext(screensLeft)) >= 0) {
- /* All of the remaining screens are referencing each other.
- * Assign a value to one of them and go through again. This
- * guarantees that we will eventually terminate.
- */
- ref = dmxScreens[i].whereRefScreen;
- pScreen = screenInfo.screens[ref];
- pScreen->x = pScreen->y = 0;
- screensLeft[ref] = 0;
- }
+ /* All of the remaining screens are referencing each other.
+ * Assign a value to one of them and go through again. This
+ * guarantees that we will eventually terminate.
+ */
+ ref = dmxScreens[i].whereRefScreen;
+ pScreen = screenInfo.screens[ref];
+ pScreen->x = pScreen->y = 0;
+ screensLeft[ref] = 0;
+ }
}
dmxSLFree(screensLeft);
-
- /* Justify the topmost and leftmost to
- * (0,0). */
+ /* Justify the topmost and leftmost to
+ * (0,0). */
minX = screenInfo.screens[0]->x;
minY = screenInfo.screens[0]->y;
- for (i = 1; i < dmxNumScreens; i++) { /* Compute minX, minY */
- if (screenInfo.screens[i]->x < minX)
+ for (i = 1; i < dmxNumScreens; i++) { /* Compute minX, minY */
+ if (screenInfo.screens[i]->x < minX)
minX = screenInfo.screens[i]->x;
- if (screenInfo.screens[i]->y < minY)
+ if (screenInfo.screens[i]->y < minY)
minY = screenInfo.screens[i]->y;
}
if (minX || minY) {
- for (i = 0; i < dmxNumScreens; i++) {
- screenInfo.screens[i]->x -= minX;
- screenInfo.screens[i]->y -= minY;
- }
+ for (i = 0; i < dmxNumScreens; i++) {
+ screenInfo.screens[i]->x -= minX;
+ screenInfo.screens[i]->y -= minY;
+ }
}
}
/** Recompute origin information in the #dmxScreens list. This is
* called from #dmxInitOrigins. */
-void dmxReInitOrigins(void)
+void
+dmxReInitOrigins(void)
{
- int i;
+ int i;
if (dmxNumScreens > MAXSCREENS)
dmxLog(dmxFatal, "dmxNumScreens = %d > MAXSCREENS = %d\n",
dmxNumScreens, MAXSCREENS);
for (i = 0; i < dmxNumScreens; i++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[i];
+ DMXScreenInfo *dmxScreen = &dmxScreens[i];
+
dmxLogOutput(dmxScreen,
"s=%dx%d%+d%+d r=%dx%d%+d%+d @%d,%d"
" (be=%dx%d depth=%d bpp=%d)\n",
dmxScreen->scrnWidth, dmxScreen->scrnHeight,
dmxScreen->scrnX, dmxScreen->scrnY,
-
dmxScreen->rootWidth, dmxScreen->rootHeight,
dmxScreen->rootX, dmxScreen->rootY,
-
dmxScreen->rootXOrigin, dmxScreen->rootYOrigin,
dmxScreen->beWidth, dmxScreen->beHeight,
dmxScreen->beDepth, dmxScreen->beBPP);
@@ -372,28 +378,27 @@ void dmxReInitOrigins(void)
/** Initialize screen origins (and relative position). This is called
* for each server generation. For dynamic reconfiguration, use
* #dmxReInitOrigins() instead. */
-void dmxInitOrigins(void)
+void
+dmxInitOrigins(void)
{
- int i;
+ int i;
if (dmxNumScreens > MAXSCREENS)
dmxLog(dmxFatal, "dmxNumScreens = %d > MAXSCREENS = %d\n",
dmxNumScreens, MAXSCREENS);
for (i = 0; i < dmxNumScreens; i++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[i];
+ DMXScreenInfo *dmxScreen = &dmxScreens[i];
+
dmxLogOutput(dmxScreen,
"(request) s=%dx%d%+d%+d r=%dx%d%+d%+d @%d,%d (%d)"
" (be=%dx%d depth=%d bpp=%d)\n",
dmxScreen->scrnWidth, dmxScreen->scrnHeight,
dmxScreen->scrnX, dmxScreen->scrnY,
-
dmxScreen->rootWidth, dmxScreen->rootHeight,
dmxScreen->rootX, dmxScreen->rootY,
-
dmxScreen->whereX, dmxScreen->whereY,
dmxScreen->where,
-
dmxScreen->beWidth, dmxScreen->beHeight,
dmxScreen->beDepth, dmxScreen->beBPP);
}
@@ -401,7 +406,8 @@ void dmxInitOrigins(void)
dmxComputeScreenOrigins();
for (i = 0; i < dmxNumScreens; i++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[i];
+ DMXScreenInfo *dmxScreen = &dmxScreens[i];
+
dmxScreen->rootXOrigin = screenInfo.screens[i]->x;
dmxScreen->rootYOrigin = screenInfo.screens[i]->y;
}
@@ -411,7 +417,8 @@ void dmxInitOrigins(void)
/** Returns non-zero if the global \a x, \a y coordinate is on the
* screen window of the \a dmxScreen. */
-int dmxOnScreen(int x, int y, DMXScreenInfo *dmxScreen)
+int
+dmxOnScreen(int x, int y, DMXScreenInfo * dmxScreen)
{
#if DMX_CURSOR_DEBUG > 1
dmxLog(dmxDebug,
@@ -426,43 +433,39 @@ int dmxOnScreen(int x, int y, DMXScreenInfo *dmxScreen)
if (x >= dmxScreen->rootXOrigin
&& x < dmxScreen->rootXOrigin + dmxScreen->rootWidth
&& y >= dmxScreen->rootYOrigin
- && y < dmxScreen->rootYOrigin + dmxScreen->rootHeight) return 1;
+ && y < dmxScreen->rootYOrigin + dmxScreen->rootHeight)
+ return 1;
return 0;
}
/** Returns non-zero if \a a overlaps \a b. */
-static int dmxDoesOverlap(DMXScreenInfo *a, DMXScreenInfo *b)
+static int
+dmxDoesOverlap(DMXScreenInfo * a, DMXScreenInfo * b)
{
- if (dmxOnScreen(a->rootXOrigin,
- a->rootYOrigin, b))
+ if (dmxOnScreen(a->rootXOrigin, a->rootYOrigin, b))
return 1;
- if (dmxOnScreen(a->rootXOrigin,
- a->rootYOrigin + a->scrnWidth, b))
+ if (dmxOnScreen(a->rootXOrigin, a->rootYOrigin + a->scrnWidth, b))
return 1;
- if (dmxOnScreen(a->rootXOrigin + a->scrnHeight,
- a->rootYOrigin, b))
+ if (dmxOnScreen(a->rootXOrigin + a->scrnHeight, a->rootYOrigin, b))
return 1;
if (dmxOnScreen(a->rootXOrigin + a->scrnHeight,
- a->rootYOrigin + a->scrnWidth, b))
+ a->rootYOrigin + a->scrnWidth, b))
return 1;
- if (dmxOnScreen(b->rootXOrigin,
- b->rootYOrigin, a))
+ if (dmxOnScreen(b->rootXOrigin, b->rootYOrigin, a))
return 1;
- if (dmxOnScreen(b->rootXOrigin,
- b->rootYOrigin + b->scrnWidth, a))
+ if (dmxOnScreen(b->rootXOrigin, b->rootYOrigin + b->scrnWidth, a))
return 1;
- if (dmxOnScreen(b->rootXOrigin + b->scrnHeight,
- b->rootYOrigin, a))
+ if (dmxOnScreen(b->rootXOrigin + b->scrnHeight, b->rootYOrigin, a))
return 1;
if (dmxOnScreen(b->rootXOrigin + b->scrnHeight,
- b->rootYOrigin + b->scrnWidth, a))
+ b->rootYOrigin + b->scrnWidth, a))
return 1;
return 0;
@@ -470,9 +473,11 @@ static int dmxDoesOverlap(DMXScreenInfo *a, DMXScreenInfo *b)
/** Used with \a dmxInterateOverlap to print out a list of screens which
* overlap each other. */
-static void *dmxPrintOverlap(DMXScreenInfo *dmxScreen, void *closure)
+static void *
+dmxPrintOverlap(DMXScreenInfo * dmxScreen, void *closure)
{
DMXScreenInfo *a = closure;
+
if (dmxScreen != a) {
if (dmxScreen->cursorNotShared)
dmxLogOutputCont(a, " [%d/%s]", dmxScreen->index, dmxScreen->name);
@@ -485,25 +490,30 @@ static void *dmxPrintOverlap(DMXScreenInfo *dmxScreen, void *closure)
/** Iterate over the screens which overlap with the \a start screen,
* calling \a f with the \a closure for each argument. Often used with
* #dmxPrintOverlap. */
-static void *dmxIterateOverlap(DMXScreenInfo *start,
- void *(*f)(DMXScreenInfo *dmxScreen, void *),
- void *closure)
+static void *
+dmxIterateOverlap(DMXScreenInfo * start,
+ void *(*f) (DMXScreenInfo * dmxScreen, void *), void *closure)
{
DMXScreenInfo *pt;
- if (!start->over) return f(start, closure);
+ if (!start->over)
+ return f(start, closure);
- for (pt = start->over; /* condition at end of loop */; pt = pt->over) {
+ for (pt = start->over; /* condition at end of loop */ ; pt = pt->over) {
void *retval;
- if ((retval = f(pt, closure))) return retval;
- if (pt == start) break;
+
+ if ((retval = f(pt, closure)))
+ return retval;
+ if (pt == start)
+ break;
}
return NULL;
}
/** Used with #dmxPropertyIterate to determine if screen \a a is the
* same as the screen \a closure. */
-static void *dmxTestSameDisplay(DMXScreenInfo *a, void *closure)
+static void *
+dmxTestSameDisplay(DMXScreenInfo * a, void *closure)
{
DMXScreenInfo *b = closure;
@@ -516,9 +526,10 @@ static void *dmxTestSameDisplay(DMXScreenInfo *a, void *closure)
* uses an O(dmxNumScreens^2) algorithm, but dmxNumScreens is < 100 and
* the computation only needs to be performed for every server
* generation or dynamic reconfiguration . */
-void dmxInitOverlap(void)
+void
+dmxInitOverlap(void)
{
- int i, j;
+ int i, j;
DMXScreenInfo *a, *b, *pt;
for (i = 0; i < dmxNumScreens; i++)
@@ -526,12 +537,12 @@ void dmxInitOverlap(void)
for (i = 0; i < dmxNumScreens; i++) {
a = &dmxScreens[i];
-
- for (j = i+1; j < dmxNumScreens; j++) {
+
+ for (j = i + 1; j < dmxNumScreens; j++) {
b = &dmxScreens[j];
if (b->over)
continue;
-
+
if (dmxDoesOverlap(a, b)) {
DMXDBG6("%d overlaps %d: a=%p %p b=%p %p\n",
a->index, b->index, a, a->over, b, b->over);
@@ -543,11 +554,11 @@ void dmxInitOverlap(void)
for (i = 0; i < dmxNumScreens; i++) {
a = &dmxScreens[i];
-
+
if (!a->over)
continue;
-
- /* Flag all pairs that are on same display */
+
+ /* Flag all pairs that are on same display */
for (pt = a->over; pt != a; pt = pt->over) {
if (dmxPropertyIterate(a, dmxTestSameDisplay, pt)) {
/* The ->over sets contain the transitive set of screens
@@ -558,7 +569,7 @@ void dmxInitOverlap(void)
* ->over set. */
if (!dmxDoesOverlap(a, pt))
continue;
- a->cursorNotShared = 1;
+ a->cursorNotShared = 1;
pt->cursorNotShared = 1;
dmxLog(dmxInfo,
"Screen %d and %d overlap on %s\n",
@@ -569,7 +580,7 @@ void dmxInitOverlap(void)
for (i = 0; i < dmxNumScreens; i++) {
a = &dmxScreens[i];
-
+
if (a->over) {
dmxLogOutput(a, "Overlaps");
dmxIterateOverlap(a, dmxPrintOverlap, a);
@@ -579,21 +590,22 @@ void dmxInitOverlap(void)
}
/** Create \a pCursor on the back-end associated with \a pScreen. */
-void dmxBECreateCursor(ScreenPtr pScreen, CursorPtr pCursor)
-{
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxCursorPrivPtr pCursorPriv = DMX_GET_CURSOR_PRIV(pCursor, pScreen);
- CursorBitsPtr pBits = pCursor->bits;
- Pixmap src, msk;
- XColor fg, bg;
- XImage *img;
- XlibGC gc = NULL;
- XGCValues v;
- unsigned long m;
- int i;
+void
+dmxBECreateCursor(ScreenPtr pScreen, CursorPtr pCursor)
+{
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ dmxCursorPrivPtr pCursorPriv = DMX_GET_CURSOR_PRIV(pCursor, pScreen);
+ CursorBitsPtr pBits = pCursor->bits;
+ Pixmap src, msk;
+ XColor fg, bg;
+ XImage *img;
+ XlibGC gc = NULL;
+ XGCValues v;
+ unsigned long m;
+ int i;
if (!pCursorPriv)
- return;
+ return;
m = GCFunction | GCPlaneMask | GCForeground | GCBackground | GCClipMask;
v.function = GXcopy;
@@ -603,55 +615,55 @@ void dmxBECreateCursor(ScreenPtr pScreen, CursorPtr pCursor)
v.clip_mask = None;
for (i = 0; i < dmxScreen->beNumPixmapFormats; i++) {
- if (dmxScreen->bePixmapFormats[i].depth == 1) {
- /* Create GC in the back-end servers */
- gc = XCreateGC(dmxScreen->beDisplay, dmxScreen->scrnDefDrawables[i],
- m, &v);
- break;
- }
+ if (dmxScreen->bePixmapFormats[i].depth == 1) {
+ /* Create GC in the back-end servers */
+ gc = XCreateGC(dmxScreen->beDisplay, dmxScreen->scrnDefDrawables[i],
+ m, &v);
+ break;
+ }
}
if (!gc)
dmxLog(dmxFatal, "dmxRealizeCursor: gc not initialized\n");
src = XCreatePixmap(dmxScreen->beDisplay, dmxScreen->scrnWin,
- pBits->width, pBits->height, 1);
+ pBits->width, pBits->height, 1);
msk = XCreatePixmap(dmxScreen->beDisplay, dmxScreen->scrnWin,
- pBits->width, pBits->height, 1);
+ pBits->width, pBits->height, 1);
img = XCreateImage(dmxScreen->beDisplay,
- dmxScreen->beVisuals[dmxScreen->beDefVisualIndex].visual,
- 1, XYBitmap, 0, (char *)pBits->source,
- pBits->width, pBits->height,
- BitmapPad(dmxScreen->beDisplay), 0);
+ dmxScreen->beVisuals[dmxScreen->beDefVisualIndex].visual,
+ 1, XYBitmap, 0, (char *) pBits->source,
+ pBits->width, pBits->height,
+ BitmapPad(dmxScreen->beDisplay), 0);
XPutImage(dmxScreen->beDisplay, src, gc, img, 0, 0, 0, 0,
- pBits->width, pBits->height);
+ pBits->width, pBits->height);
XFree(img);
-
+
img = XCreateImage(dmxScreen->beDisplay,
- dmxScreen->beVisuals[dmxScreen->beDefVisualIndex].visual,
- 1, XYBitmap, 0, (char *)pBits->mask,
- pBits->width, pBits->height,
- BitmapPad(dmxScreen->beDisplay), 0);
+ dmxScreen->beVisuals[dmxScreen->beDefVisualIndex].visual,
+ 1, XYBitmap, 0, (char *) pBits->mask,
+ pBits->width, pBits->height,
+ BitmapPad(dmxScreen->beDisplay), 0);
XPutImage(dmxScreen->beDisplay, msk, gc, img, 0, 0, 0, 0,
- pBits->width, pBits->height);
+ pBits->width, pBits->height);
XFree(img);
- fg.red = pCursor->foreRed;
+ fg.red = pCursor->foreRed;
fg.green = pCursor->foreGreen;
- fg.blue = pCursor->foreBlue;
+ fg.blue = pCursor->foreBlue;
- bg.red = pCursor->backRed;
+ bg.red = pCursor->backRed;
bg.green = pCursor->backGreen;
- bg.blue = pCursor->backBlue;
+ bg.blue = pCursor->backBlue;
pCursorPriv->cursor = XCreatePixmapCursor(dmxScreen->beDisplay,
- src, msk,
- &fg, &bg,
- pBits->xhot, pBits->yhot);
+ src, msk,
+ &fg, &bg,
+ pBits->xhot, pBits->yhot);
XFreePixmap(dmxScreen->beDisplay, src);
XFreePixmap(dmxScreen->beDisplay, msk);
@@ -660,105 +672,115 @@ void dmxBECreateCursor(ScreenPtr pScreen, CursorPtr pCursor)
dmxSync(dmxScreen, FALSE);
}
-static Bool _dmxRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
+static Bool
+_dmxRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
{
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxCursorPrivPtr pCursorPriv;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ dmxCursorPrivPtr pCursorPriv;
DMXDBG2("_dmxRealizeCursor(%d,%p)\n", pScreen->myNum, pCursor);
DMX_SET_CURSOR_PRIV(pCursor, pScreen, malloc(sizeof(*pCursorPriv)));
if (!DMX_GET_CURSOR_PRIV(pCursor, pScreen))
- return FALSE;
+ return FALSE;
pCursorPriv = DMX_GET_CURSOR_PRIV(pCursor, pScreen);
- pCursorPriv->cursor = (Cursor)0;
+ pCursorPriv->cursor = (Cursor) 0;
if (!dmxScreen->beDisplay)
- return TRUE;
+ return TRUE;
dmxBECreateCursor(pScreen, pCursor);
return TRUE;
}
/** Free \a pCursor on the back-end associated with \a pScreen. */
-Bool dmxBEFreeCursor(ScreenPtr pScreen, CursorPtr pCursor)
+Bool
+dmxBEFreeCursor(ScreenPtr pScreen, CursorPtr pCursor)
{
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxCursorPrivPtr pCursorPriv = DMX_GET_CURSOR_PRIV(pCursor, pScreen);
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ dmxCursorPrivPtr pCursorPriv = DMX_GET_CURSOR_PRIV(pCursor, pScreen);
if (pCursorPriv) {
- XFreeCursor(dmxScreen->beDisplay, pCursorPriv->cursor);
- pCursorPriv->cursor = (Cursor)0;
- return TRUE;
+ XFreeCursor(dmxScreen->beDisplay, pCursorPriv->cursor);
+ pCursorPriv->cursor = (Cursor) 0;
+ return TRUE;
}
return FALSE;
}
-static Bool _dmxUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
+static Bool
+_dmxUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
{
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- DMXDBG2("_dmxUnrealizeCursor(%d,%p)\n",
- pScreen->myNum, pCursor);
+ DMXDBG2("_dmxUnrealizeCursor(%d,%p)\n", pScreen->myNum, pCursor);
if (dmxScreen->beDisplay) {
- if (dmxBEFreeCursor(pScreen, pCursor))
- free(DMX_GET_CURSOR_PRIV(pCursor, pScreen));
+ if (dmxBEFreeCursor(pScreen, pCursor))
+ free(DMX_GET_CURSOR_PRIV(pCursor, pScreen));
}
DMX_SET_CURSOR_PRIV(pCursor, pScreen, NULL);
return TRUE;
}
-static void _dmxMoveCursor(ScreenPtr pScreen, int x, int y)
+static void
+_dmxMoveCursor(ScreenPtr pScreen, int x, int y)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- int newX = x + dmxScreen->rootX;
- int newY = y + dmxScreen->rootY;
+ int newX = x + dmxScreen->rootX;
+ int newY = y + dmxScreen->rootY;
- if (newX < 0) newX = 0;
- if (newY < 0) newY = 0;
+ if (newX < 0)
+ newX = 0;
+ if (newY < 0)
+ newY = 0;
DMXDBG5("_dmxMoveCursor(%d,%d,%d) -> %d,%d\n",
pScreen->myNum, x, y, newX, newY);
if (dmxScreen->beDisplay) {
- XWarpPointer(dmxScreen->beDisplay, None, dmxScreen->scrnWin,
- 0, 0, 0, 0, newX, newY);
- dmxSync(dmxScreen, TRUE);
+ XWarpPointer(dmxScreen->beDisplay, None, dmxScreen->scrnWin,
+ 0, 0, 0, 0, newX, newY);
+ dmxSync(dmxScreen, TRUE);
}
}
-static void _dmxSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
+static void
+_dmxSetCursor(ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
{
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
DMXDBG4("_dmxSetCursor(%d,%p,%d,%d)\n", pScreen->myNum, pCursor, x, y);
if (pCursor) {
- dmxCursorPrivPtr pCursorPriv = DMX_GET_CURSOR_PRIV(pCursor, pScreen);
- if (pCursorPriv && dmxScreen->curCursor != pCursorPriv->cursor) {
- if (dmxScreen->beDisplay)
- XDefineCursor(dmxScreen->beDisplay, dmxScreen->scrnWin,
- pCursorPriv->cursor);
- dmxScreen->cursor = pCursor;
- dmxScreen->curCursor = pCursorPriv->cursor;
+ dmxCursorPrivPtr pCursorPriv = DMX_GET_CURSOR_PRIV(pCursor, pScreen);
+
+ if (pCursorPriv && dmxScreen->curCursor != pCursorPriv->cursor) {
+ if (dmxScreen->beDisplay)
+ XDefineCursor(dmxScreen->beDisplay, dmxScreen->scrnWin,
+ pCursorPriv->cursor);
+ dmxScreen->cursor = pCursor;
+ dmxScreen->curCursor = pCursorPriv->cursor;
dmxScreen->cursorVisible = 1;
- }
- _dmxMoveCursor(pScreen, x, y);
- } else {
- if (dmxScreen->beDisplay)
- XDefineCursor(dmxScreen->beDisplay, dmxScreen->scrnWin,
- dmxScreen->noCursor);
- dmxScreen->cursor = NULL;
- dmxScreen->curCursor = (Cursor)0;
+ }
+ _dmxMoveCursor(pScreen, x, y);
+ }
+ else {
+ if (dmxScreen->beDisplay)
+ XDefineCursor(dmxScreen->beDisplay, dmxScreen->scrnWin,
+ dmxScreen->noCursor);
+ dmxScreen->cursor = NULL;
+ dmxScreen->curCursor = (Cursor) 0;
dmxScreen->cursorVisible = 0;
}
- if (dmxScreen->beDisplay) dmxSync(dmxScreen, TRUE);
+ if (dmxScreen->beDisplay)
+ dmxSync(dmxScreen, TRUE);
}
-static Bool dmxRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
+static Bool
+dmxRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
{
DMXScreenInfo *start = &dmxScreens[pScreen->myNum];
DMXScreenInfo *pt;
@@ -766,7 +788,7 @@ static Bool dmxRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCu
if (!start->over || !dmxCursorDoMultiCursors || start->cursorNotShared)
return _dmxRealizeCursor(pScreen, pCursor);
- for (pt = start->over; /* condition at end of loop */; pt = pt->over) {
+ for (pt = start->over; /* condition at end of loop */ ; pt = pt->over) {
if (pt->cursorNotShared)
continue;
_dmxRealizeCursor(screenInfo.screens[pt->index], pCursor);
@@ -776,7 +798,8 @@ static Bool dmxRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCu
return TRUE;
}
-static Bool dmxUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
+static Bool
+dmxUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
{
DMXScreenInfo *start = &dmxScreens[pScreen->myNum];
DMXScreenInfo *pt;
@@ -784,7 +807,7 @@ static Bool dmxUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr p
if (!start->over || !dmxCursorDoMultiCursors || start->cursorNotShared)
return _dmxUnrealizeCursor(pScreen, pCursor);
- for (pt = start->over; /* condition at end of loop */; pt = pt->over) {
+ for (pt = start->over; /* condition at end of loop */ ; pt = pt->over) {
if (pt->cursorNotShared)
continue;
_dmxUnrealizeCursor(screenInfo.screens[pt->index], pCursor);
@@ -794,13 +817,14 @@ static Bool dmxUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr p
return TRUE;
}
-static CursorPtr dmxFindCursor(DMXScreenInfo *start)
+static CursorPtr
+dmxFindCursor(DMXScreenInfo * start)
{
DMXScreenInfo *pt;
if (!start || !start->over)
return GetSpriteCursor(inputInfo.pointer);
- for (pt = start->over; /* condition at end of loop */; pt = pt->over) {
+ for (pt = start->over; /* condition at end of loop */ ; pt = pt->over) {
if (pt->cursor)
return pt->cursor;
if (pt == start)
@@ -818,7 +842,8 @@ static CursorPtr dmxFindCursor(DMXScreenInfo *start)
* back-end screens and see if they contain the global coord. If so, call
* _dmxMoveCursor() (XWarpPointer) to position the pointer on that screen.
*/
-void dmxMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
+void
+dmxMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{
DMXScreenInfo *start = &dmxScreens[pScreen->myNum];
DMXScreenInfo *pt;
@@ -830,21 +855,21 @@ void dmxMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
return;
}
- for (pt = start->over; /* condition at end of loop */; pt = pt->over) {
+ for (pt = start->over; /* condition at end of loop */ ; pt = pt->over) {
if (pt->cursorNotShared)
continue;
if (dmxOnScreen(x + start->rootXOrigin, y + start->rootYOrigin, pt)) {
- if (/* pt != start && */ !pt->cursorVisible) {
+ if ( /* pt != start && */ !pt->cursorVisible) {
if (!pt->cursor) {
- /* This only happens during
- * reconfiguration when a new overlap
- * occurs. */
+ /* This only happens during
+ * reconfiguration when a new overlap
+ * occurs. */
CursorPtr pCursor;
-
+
if ((pCursor = dmxFindCursor(start)))
_dmxRealizeCursor(screenInfo.screens[pt->index],
pt->cursor = pCursor);
-
+
}
_dmxSetCursor(screenInfo.screens[pt->index],
pt->cursor,
@@ -854,7 +879,8 @@ void dmxMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
_dmxMoveCursor(screenInfo.screens[pt->index],
x + start->rootXOrigin - pt->rootXOrigin,
y + start->rootYOrigin - pt->rootYOrigin);
- } else if (/* pt != start && */ pt->cursorVisible) {
+ }
+ else if ( /* pt != start && */ pt->cursorVisible) {
_dmxSetCursor(screenInfo.screens[pt->index],
NULL,
x + start->rootXOrigin - pt->rootXOrigin,
@@ -865,49 +891,52 @@ void dmxMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
}
}
-static void dmxSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, int y)
+static void
+dmxSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x,
+ int y)
{
DMXScreenInfo *start = &dmxScreens[pScreen->myNum];
DMXScreenInfo *pt;
- int GX, GY, gx, gy;
+ int GX, GY, gx, gy;
DMXDBG5("dmxSetCursor(%d %p, %p,%d,%d)\n",
pScreen->myNum, start, pCursor, x, y);
- /* We do this check here because of two cases:
- *
- * 1) if a client calls XWarpPointer()
- * and Xinerama is not running, we can
- * have mi's notion of the pointer
- * position out of phase with DMX's
- * notion.
- *
- * 2) if a down button is held while the
- * cursor moves outside the root window,
- * mi's notion of the pointer position
- * is out of phase with DMX's notion and
- * the cursor can remain visible when it
- * shouldn't be. */
+ /* We do this check here because of two cases:
+ *
+ * 1) if a client calls XWarpPointer()
+ * and Xinerama is not running, we can
+ * have mi's notion of the pointer
+ * position out of phase with DMX's
+ * notion.
+ *
+ * 2) if a down button is held while the
+ * cursor moves outside the root window,
+ * mi's notion of the pointer position
+ * is out of phase with DMX's notion and
+ * the cursor can remain visible when it
+ * shouldn't be. */
dmxGetGlobalPosition(&GX, &GY);
gx = start->rootXOrigin + x;
gy = start->rootYOrigin + y;
if (x && y && (GX != gx || GY != gy))
dmxCoreMotion(NULL, gx, gy, 0, DMX_NO_BLOCK);
-
+
if (!start->over || !dmxCursorDoMultiCursors || start->cursorNotShared) {
_dmxSetCursor(pScreen, pCursor, x, y);
return;
}
- for (pt = start->over; /* condition at end of loop */; pt = pt->over) {
+ for (pt = start->over; /* condition at end of loop */ ; pt = pt->over) {
if (pt->cursorNotShared)
continue;
if (dmxOnScreen(x + start->rootXOrigin, y + start->rootYOrigin, pt)) {
_dmxSetCursor(screenInfo.screens[pt->index], pCursor,
x + start->rootXOrigin - pt->rootXOrigin,
y + start->rootYOrigin - pt->rootYOrigin);
- } else {
+ }
+ else {
_dmxSetCursor(screenInfo.screens[pt->index], NULL,
x + start->rootXOrigin - pt->rootXOrigin,
y + start->rootYOrigin - pt->rootYOrigin);
@@ -917,13 +946,13 @@ static void dmxSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor
}
}
-
/** This routine is used by the backend input routines to hide the
* cursor on a screen that is being used for relative input. \see
* dmxbackend.c */
-void dmxHideCursor(DMXScreenInfo *dmxScreen)
+void
+dmxHideCursor(DMXScreenInfo * dmxScreen)
{
- int x, y;
+ int x, y;
ScreenPtr pScreen = screenInfo.screens[dmxScreen->index];
dmxGetGlobalPosition(&x, &y);
@@ -932,11 +961,12 @@ void dmxHideCursor(DMXScreenInfo *dmxScreen)
/** This routine is called during reconfiguration to make sure the
* cursor is visible. */
-void dmxCheckCursor(void)
+void
+dmxCheckCursor(void)
{
- int i;
- int x, y;
- ScreenPtr pScreen;
+ int i;
+ int x, y;
+ ScreenPtr pScreen;
DMXScreenInfo *firstScreen;
dmxGetGlobalPosition(&x, &y);
@@ -945,18 +975,21 @@ void dmxCheckCursor(void)
DMXDBG2("dmxCheckCursor %d %d\n", x, y);
for (i = 0; i < dmxNumScreens; i++) {
DMXScreenInfo *dmxScreen = &dmxScreens[i];
- pScreen = screenInfo.screens[dmxScreen->index];
+
+ pScreen = screenInfo.screens[dmxScreen->index];
if (!dmxOnScreen(x, y, dmxScreen)) {
- if (firstScreen && i == miPointerGetScreen(inputInfo.pointer)->myNum)
- miPointerSetScreen(inputInfo.pointer, firstScreen->index, x, y);
- _dmxSetCursor(pScreen, NULL,
- x - dmxScreen->rootXOrigin,
+ if (firstScreen &&
+ i == miPointerGetScreen(inputInfo.pointer)->myNum)
+ miPointerSetScreen(inputInfo.pointer, firstScreen->index, x,
+ y);
+ _dmxSetCursor(pScreen, NULL, x - dmxScreen->rootXOrigin,
y - dmxScreen->rootYOrigin);
- } else {
+ }
+ else {
if (!dmxScreen->cursor) {
CursorPtr pCursor;
-
+
if ((pCursor = dmxFindCursor(dmxScreen))) {
_dmxRealizeCursor(pScreen, dmxScreen->cursor = pCursor);
}
@@ -969,17 +1002,18 @@ void dmxCheckCursor(void)
DMXDBG2(" leave dmxCheckCursor %d %d\n", x, y);
}
-static Bool dmxDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScr)
+static Bool
+dmxDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScr)
{
return TRUE;
}
-static void dmxDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScr)
+static void
+dmxDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScr)
{
}
-miPointerSpriteFuncRec dmxPointerSpriteFuncs =
-{
+miPointerSpriteFuncRec dmxPointerSpriteFuncs = {
dmxRealizeCursor,
dmxUnrealizeCursor,
dmxSetCursor,
diff --git a/hw/dmx/dmxcursor.h b/hw/dmx/dmxcursor.h
index fc2e118e0..2b55b4e86 100644
--- a/hw/dmx/dmxcursor.h
+++ b/hw/dmx/dmxcursor.h
@@ -43,11 +43,12 @@
/** Cursor private area. */
typedef struct _dmxCursorPriv {
- Cursor cursor;
+ Cursor cursor;
} dmxCursorPrivRec, *dmxCursorPrivPtr;
/** Cursor functions for mi layer. \see dmxcursor.c \see dmxscrinit.c */
extern miPointerScreenFuncRec dmxPointerCursorFuncs;
+
/** Sprite functions for mi layer. \see dmxcursor.c \see dmxscrinit.c */
extern miPointerSpriteFuncRec dmxPointerSpriteFuncs;
@@ -57,8 +58,8 @@ extern void dmxInitOverlap(void);
extern void dmxCursorNoMulti(void);
extern void dmxMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y);
extern void dmxCheckCursor(void);
-extern int dmxOnScreen(int x, int y, DMXScreenInfo *dmxScreen);
-extern void dmxHideCursor(DMXScreenInfo *dmxScreen);
+extern int dmxOnScreen(int x, int y, DMXScreenInfo * dmxScreen);
+extern void dmxHideCursor(DMXScreenInfo * dmxScreen);
extern void dmxBECreateCursor(ScreenPtr pScreen, CursorPtr pCursor);
extern Bool dmxBEFreeCursor(ScreenPtr pScreen, CursorPtr pCursor);
@@ -69,4 +70,4 @@ extern Bool dmxBEFreeCursor(ScreenPtr pScreen, CursorPtr pCursor);
#define DMX_SET_CURSOR_PRIV(_pCursor, _pScreen, v) \
dixSetScreenPrivate(&(_pCursor)->devPrivates, CursorScreenKey, _pScreen, v)
-#endif /* DMXCURSOR_H */
+#endif /* DMXCURSOR_H */
diff --git a/hw/dmx/dmxdpms.c b/hw/dmx/dmxdpms.c
index 2af160556..d53a3d998 100644
--- a/hw/dmx/dmxdpms.c
+++ b/hw/dmx/dmxdpms.c
@@ -54,36 +54,37 @@
#include <X11/extensions/dpms.h>
static unsigned long dpmsGeneration = 0;
-static Bool dpmsSupported = TRUE;
+static Bool dpmsSupported = TRUE;
-static void _dmxDPMSInit(DMXScreenInfo *dmxScreen)
+static void
+_dmxDPMSInit(DMXScreenInfo * dmxScreen)
{
- int event_base, error_base;
- int major, minor;
- CARD16 level, standby, suspend, off;
- BOOL state;
+ int event_base, error_base;
+ int major, minor;
+ CARD16 level, standby, suspend, off;
+ BOOL state;
const char *monitor;
if (dpmsGeneration != serverGeneration) {
- dpmsSupported = TRUE; /* On unless a backend doesn't support it */
+ dpmsSupported = TRUE; /* On unless a backend doesn't support it */
dpmsGeneration = serverGeneration;
}
#ifdef DPMSExtension
- if (DPMSDisabledSwitch) dpmsSupported = FALSE; /* -dpms turns off */
+ if (DPMSDisabledSwitch)
+ dpmsSupported = FALSE; /* -dpms turns off */
#endif
dmxScreen->dpmsCapable = 0;
-
+
if (!dmxScreen->beDisplay) {
dmxLogOutput(dmxScreen,
- "Cannot determine if DPMS supported (detached screen)\n");
+ "Cannot determine if DPMS supported (detached screen)\n");
dpmsSupported = FALSE;
return;
}
- if (!DPMSQueryExtension(dmxScreen->beDisplay,
- &event_base, &error_base)) {
+ if (!DPMSQueryExtension(dmxScreen->beDisplay, &event_base, &error_base)) {
dmxLogOutput(dmxScreen, "DPMS not supported\n");
dpmsSupported = FALSE;
return;
@@ -106,19 +107,29 @@ static void _dmxDPMSInit(DMXScreenInfo *dmxScreen)
DPMSEnable(dmxScreen->beDisplay);
DPMSForceLevel(dmxScreen->beDisplay, DPMSModeOn);
dmxScreen->dpmsCapable = 1;
- dmxScreen->dpmsEnabled = !!state;
+ dmxScreen->dpmsEnabled = ! !state;
dmxScreen->dpmsStandby = standby;
dmxScreen->dpmsSuspend = suspend;
- dmxScreen->dpmsOff = off;
+ dmxScreen->dpmsOff = off;
switch (level) {
- case DPMSModeOn: monitor = "on"; break;
- case DPMSModeStandby: monitor = "standby"; break;
- case DPMSModeSuspend: monitor = "suspend"; break;
- case DPMSModeOff: monitor = "off"; break;
- default: monitor = "unknown"; break;
+ case DPMSModeOn:
+ monitor = "on";
+ break;
+ case DPMSModeStandby:
+ monitor = "standby";
+ break;
+ case DPMSModeSuspend:
+ monitor = "suspend";
+ break;
+ case DPMSModeOff:
+ monitor = "off";
+ break;
+ default:
+ monitor = "unknown";
+ break;
}
-
+
dmxLogOutput(dmxScreen,
"DPMS %d.%d (%s, %s, %d %d %d)\n",
major, minor, monitor, state ? "enabled" : "disabled",
@@ -127,86 +138,98 @@ static void _dmxDPMSInit(DMXScreenInfo *dmxScreen)
/** Initialize DPMS support. We save the current settings and turn off
* DPMS. The settings are restored in #dmxDPMSTerm. */
-void dmxDPMSInit(DMXScreenInfo *dmxScreen)
+void
+dmxDPMSInit(DMXScreenInfo * dmxScreen)
{
- int interval, preferBlanking, allowExposures;
+ int interval, preferBlanking, allowExposures;
- /* Turn off DPMS */
+ /* Turn off DPMS */
_dmxDPMSInit(dmxScreen);
if (!dmxScreen->beDisplay)
- return;
+ return;
- /* Turn off screen saver */
+ /* Turn off screen saver */
XGetScreenSaver(dmxScreen->beDisplay, &dmxScreen->savedTimeout, &interval,
- &preferBlanking, &allowExposures);
+ &preferBlanking, &allowExposures);
XSetScreenSaver(dmxScreen->beDisplay, 0, interval,
- preferBlanking, allowExposures);
+ preferBlanking, allowExposures);
XResetScreenSaver(dmxScreen->beDisplay);
dmxSync(dmxScreen, FALSE);
}
/** Terminate DPMS support on \a dmxScreen. We restore the settings
* saved in #dmxDPMSInit. */
-void dmxDPMSTerm(DMXScreenInfo *dmxScreen)
+void
+dmxDPMSTerm(DMXScreenInfo * dmxScreen)
{
- int timeout, interval, preferBlanking, allowExposures;
+ int timeout, interval, preferBlanking, allowExposures;
if (!dmxScreen->beDisplay)
- return;
+ return;
XGetScreenSaver(dmxScreen->beDisplay, &timeout, &interval,
- &preferBlanking, &allowExposures);
+ &preferBlanking, &allowExposures);
XSetScreenSaver(dmxScreen->beDisplay, dmxScreen->savedTimeout, interval,
- preferBlanking, allowExposures);
+ preferBlanking, allowExposures);
if (dmxScreen->dpmsCapable) {
- /* Restore saved state */
+ /* Restore saved state */
DPMSForceLevel(dmxScreen->beDisplay, DPMSModeOn);
DPMSSetTimeouts(dmxScreen->beDisplay, dmxScreen->dpmsStandby,
dmxScreen->dpmsSuspend, dmxScreen->dpmsOff);
- if (dmxScreen->dpmsEnabled) DPMSEnable(dmxScreen->beDisplay);
- else DPMSDisable(dmxScreen->beDisplay);
+ if (dmxScreen->dpmsEnabled)
+ DPMSEnable(dmxScreen->beDisplay);
+ else
+ DPMSDisable(dmxScreen->beDisplay);
}
dmxSync(dmxScreen, FALSE);
}
/** Called when activity is detected so that DPMS power-saving mode can
* be deactivated. */
-void dmxDPMSWakeup(void)
+void
+dmxDPMSWakeup(void)
{
if (screenIsSaved == SCREEN_SAVER_ON)
dixSaveScreens(serverClient, SCREEN_SAVER_OFF, ScreenSaverReset);
#ifdef DPMSExtension
- if (DPMSPowerLevel) DPMSSet(serverClient, 0);
+ if (DPMSPowerLevel)
+ DPMSSet(serverClient, 0);
#endif
}
#ifdef DPMSExtension
/** This is called on each server generation. It should determine if
* DPMS is supported on all of the backends and, if so, return TRUE. */
-Bool DPMSSupported(void)
+Bool
+DPMSSupported(void)
{
return dpmsSupported;
}
/** This is used by clients (e.g., xset) to set the DPMS level. */
-int DPMSSet(ClientPtr client, int level)
+int
+DPMSSet(ClientPtr client, int level)
{
int i;
- if (!dpmsSupported) return Success;
+ if (!dpmsSupported)
+ return Success;
+
+ if (level < 0)
+ level = DPMSModeOn;
+ if (level > 3)
+ level = DPMSModeOff;
- if (level < 0) level = DPMSModeOn;
- if (level > 3) level = DPMSModeOff;
-
DPMSPowerLevel = level;
for (i = 0; i < dmxNumScreens; i++) {
DMXScreenInfo *dmxScreen = &dmxScreens[i];
- if (dmxScreen->beDisplay) {
- DPMSForceLevel(dmxScreen->beDisplay, level);
- dmxSync(dmxScreen, FALSE);
- }
+
+ if (dmxScreen->beDisplay) {
+ DPMSForceLevel(dmxScreen->beDisplay, level);
+ dmxSync(dmxScreen, FALSE);
+ }
}
return Success;
}
diff --git a/hw/dmx/dmxdpms.h b/hw/dmx/dmxdpms.h
index e3eee983a..772fa2f11 100644
--- a/hw/dmx/dmxdpms.h
+++ b/hw/dmx/dmxdpms.h
@@ -36,7 +36,7 @@
#ifndef _DMXDPMS_H_
#define _DMXDPMS_H_
-extern void dmxDPMSInit(DMXScreenInfo *dmxScreen);
-extern void dmxDPMSTerm(DMXScreenInfo *dmxScreen);
-extern void dmxDPMSWakeup(void); /* Call when input is processed */
+extern void dmxDPMSInit(DMXScreenInfo * dmxScreen);
+extern void dmxDPMSTerm(DMXScreenInfo * dmxScreen);
+extern void dmxDPMSWakeup(void); /* Call when input is processed */
#endif
diff --git a/hw/dmx/dmxextension.c b/hw/dmx/dmxextension.c
index 80d11ee89..faa28a590 100644
--- a/hw/dmx/dmxextension.c
+++ b/hw/dmx/dmxextension.c
@@ -60,86 +60,89 @@
#include "input/dmxinputinit.h"
#include "windowstr.h"
-#include "inputstr.h" /* For DeviceIntRec */
-#include <X11/extensions/dmxproto.h> /* For DMX_BAD_* */
+#include "inputstr.h" /* For DeviceIntRec */
+#include <X11/extensions/dmxproto.h> /* For DMX_BAD_* */
#include "cursorstr.h"
/* The default font is declared in dix/globals.c, but is not included in
* _any_ header files. */
-extern FontPtr defaultFont;
-
+extern FontPtr defaultFont;
+
/** This routine provides information to the DMX protocol extension
* about a particular screen. */
-Bool dmxGetScreenAttributes(int physical, DMXScreenAttributesPtr attr)
+Bool
+dmxGetScreenAttributes(int physical, DMXScreenAttributesPtr attr)
{
DMXScreenInfo *dmxScreen;
- if (physical < 0 || physical >= dmxNumScreens) return FALSE;
+ if (physical < 0 || physical >= dmxNumScreens)
+ return FALSE;
dmxScreen = &dmxScreens[physical];
- attr->displayName = dmxScreen->name;
+ attr->displayName = dmxScreen->name;
#ifdef PANORAMIX
- attr->logicalScreen = noPanoramiXExtension ? dmxScreen->index : 0;
+ attr->logicalScreen = noPanoramiXExtension ? dmxScreen->index : 0;
#else
- attr->logicalScreen = dmxScreen->index;
+ attr->logicalScreen = dmxScreen->index;
#endif
- attr->screenWindowWidth = dmxScreen->scrnWidth;
- attr->screenWindowHeight = dmxScreen->scrnHeight;
+ attr->screenWindowWidth = dmxScreen->scrnWidth;
+ attr->screenWindowHeight = dmxScreen->scrnHeight;
attr->screenWindowXoffset = dmxScreen->scrnX;
attr->screenWindowYoffset = dmxScreen->scrnY;
- attr->rootWindowWidth = dmxScreen->rootWidth;
- attr->rootWindowHeight = dmxScreen->rootHeight;
- attr->rootWindowXoffset = dmxScreen->rootX;
- attr->rootWindowYoffset = dmxScreen->rootY;
+ attr->rootWindowWidth = dmxScreen->rootWidth;
+ attr->rootWindowHeight = dmxScreen->rootHeight;
+ attr->rootWindowXoffset = dmxScreen->rootX;
+ attr->rootWindowYoffset = dmxScreen->rootY;
- attr->rootWindowXorigin = dmxScreen->rootXOrigin;
- attr->rootWindowYorigin = dmxScreen->rootYOrigin;
+ attr->rootWindowXorigin = dmxScreen->rootXOrigin;
+ attr->rootWindowYorigin = dmxScreen->rootYOrigin;
return TRUE;
}
/** This routine provides information to the DMX protocol extension
* about a particular window. */
-Bool dmxGetWindowAttributes(WindowPtr pWindow, DMXWindowAttributesPtr attr)
+Bool
+dmxGetWindowAttributes(WindowPtr pWindow, DMXWindowAttributesPtr attr)
{
dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
- attr->screen = pWindow->drawable.pScreen->myNum;
- attr->window = pWinPriv->window;
+ attr->screen = pWindow->drawable.pScreen->myNum;
+ attr->window = pWinPriv->window;
- attr->pos.x = pWindow->drawable.x;
- attr->pos.y = pWindow->drawable.y;
- attr->pos.width = pWindow->drawable.width;
- attr->pos.height = pWindow->drawable.height;
+ attr->pos.x = pWindow->drawable.x;
+ attr->pos.y = pWindow->drawable.y;
+ attr->pos.width = pWindow->drawable.width;
+ attr->pos.height = pWindow->drawable.height;
if (!pWinPriv->window || pWinPriv->offscreen) {
- attr->vis.x = 0;
- attr->vis.y = 0;
+ attr->vis.x = 0;
+ attr->vis.y = 0;
attr->vis.height = 0;
- attr->vis.width = 0;
+ attr->vis.width = 0;
return pWinPriv->window ? TRUE : FALSE;
}
- /* Compute display-relative coordinates */
- attr->vis.x = pWindow->drawable.x;
- attr->vis.y = pWindow->drawable.y;
- attr->vis.width = pWindow->drawable.width;
- attr->vis.height = pWindow->drawable.height;
+ /* Compute display-relative coordinates */
+ attr->vis.x = pWindow->drawable.x;
+ attr->vis.y = pWindow->drawable.y;
+ attr->vis.width = pWindow->drawable.width;
+ attr->vis.height = pWindow->drawable.height;
if (attr->pos.x < 0) {
- attr->vis.x -= attr->pos.x;
- attr->vis.width = attr->pos.x + attr->pos.width - attr->vis.x;
+ attr->vis.x -= attr->pos.x;
+ attr->vis.width = attr->pos.x + attr->pos.width - attr->vis.x;
}
if (attr->pos.x + attr->pos.width > pWindow->drawable.pScreen->width) {
if (attr->pos.x < 0)
- attr->vis.width = pWindow->drawable.pScreen->width;
+ attr->vis.width = pWindow->drawable.pScreen->width;
else
- attr->vis.width = pWindow->drawable.pScreen->width - attr->pos.x;
+ attr->vis.width = pWindow->drawable.pScreen->width - attr->pos.x;
}
if (attr->pos.y < 0) {
- attr->vis.y -= attr->pos.y;
+ attr->vis.y -= attr->pos.y;
attr->vis.height = attr->pos.y + attr->pos.height - attr->vis.y;
}
if (attr->pos.y + attr->pos.height > pWindow->drawable.pScreen->height) {
@@ -149,29 +152,32 @@ Bool dmxGetWindowAttributes(WindowPtr pWindow, DMXWindowAttributesPtr attr)
attr->vis.height = pWindow->drawable.pScreen->height - attr->pos.y;
}
- /* Convert to window-relative coordinates */
+ /* Convert to window-relative coordinates */
attr->vis.x -= attr->pos.x;
attr->vis.y -= attr->pos.y;
return TRUE;
}
-void dmxGetDesktopAttributes(DMXDesktopAttributesPtr attr)
+void
+dmxGetDesktopAttributes(DMXDesktopAttributesPtr attr)
{
- attr->width = dmxGlobalWidth;
+ attr->width = dmxGlobalWidth;
attr->height = dmxGlobalHeight;
- attr->shiftX = 0; /* NOTE: The upper left hand corner of */
- attr->shiftY = 0; /* the desktop is always <0,0>. */
+ attr->shiftX = 0; /* NOTE: The upper left hand corner of */
+ attr->shiftY = 0; /* the desktop is always <0,0>. */
}
/** Return the total number of devices, not just #dmxNumInputs. The
* number returned should be the same as that returned by
* XListInputDevices. */
-int dmxGetInputCount(void)
+int
+dmxGetInputCount(void)
{
int i, total;
-
- for (total = i = 0; i < dmxNumInputs; i++) total += dmxInputs[i].numDevs;
+
+ for (total = i = 0; i < dmxNumInputs; i++)
+ total += dmxInputs[i].numDevs;
return total;
}
@@ -179,38 +185,42 @@ int dmxGetInputCount(void)
* information is primarily for the #ProcDMXGetInputAttributes()
* function, which does not have access to the appropriate data
* structure. */
-int dmxGetInputAttributes(int deviceId, DMXInputAttributesPtr attr)
+int
+dmxGetInputAttributes(int deviceId, DMXInputAttributesPtr attr)
{
- int i, j;
+ int i, j;
DMXInputInfo *dmxInput;
- if (deviceId < 0) return -1;
+ if (deviceId < 0)
+ return -1;
for (i = 0; i < dmxNumInputs; i++) {
dmxInput = &dmxInputs[i];
for (j = 0; j < dmxInput->numDevs; j++) {
DMXLocalInputInfoPtr dmxLocal = dmxInput->devs[j];
- if (deviceId != dmxLocal->pDevice->id) continue;
- attr->isCore = !!dmxLocal->isCore;
- attr->sendsCore = !!dmxLocal->sendsCore;
- attr->detached = !!dmxInput->detached;
- attr->physicalScreen = -1;
- attr->physicalId = -1;
- attr->name = NULL;
+
+ if (deviceId != dmxLocal->pDevice->id)
+ continue;
+ attr->isCore = ! !dmxLocal->isCore;
+ attr->sendsCore = ! !dmxLocal->sendsCore;
+ attr->detached = ! !dmxInput->detached;
+ attr->physicalScreen = -1;
+ attr->physicalId = -1;
+ attr->name = NULL;
switch (dmxLocal->extType) {
case DMX_LOCAL_TYPE_LOCAL:
- attr->inputType = 0;
+ attr->inputType = 0;
break;
case DMX_LOCAL_TYPE_CONSOLE:
- attr->inputType = 1;
- attr->name = dmxInput->name;
- attr->physicalId = dmxLocal->deviceId;
+ attr->inputType = 1;
+ attr->name = dmxInput->name;
+ attr->physicalId = dmxLocal->deviceId;
break;
case DMX_LOCAL_TYPE_BACKEND:
case DMX_LOCAL_TYPE_COMMON:
- attr->inputType = 2;
+ attr->inputType = 2;
attr->physicalScreen = dmxInput->scrnIdx;
- attr->name = dmxInput->name;
- attr->physicalId = dmxLocal->deviceId;
+ attr->name = dmxInput->name;
+ attr->physicalId = dmxLocal->deviceId;
break;
}
return 0; /* Success */
@@ -220,9 +230,10 @@ int dmxGetInputAttributes(int deviceId, DMXInputAttributesPtr attr)
}
/** Reinitialized the cursor boundaries. */
-static void dmxAdjustCursorBoundaries(void)
+static void
+dmxAdjustCursorBoundaries(void)
{
- int i;
+ int i;
dmxReInitOrigins();
dmxInitOverlap();
@@ -230,28 +241,33 @@ static void dmxAdjustCursorBoundaries(void)
dmxConnectionBlockCallback();
for (i = 0; i < dmxNumInputs; i++) {
DMXInputInfo *dmxInput = &dmxInputs[i];
- if (!dmxInput->detached) dmxInputReInit(dmxInput);
+
+ if (!dmxInput->detached)
+ dmxInputReInit(dmxInput);
}
dmxCheckCursor();
for (i = 0; i < dmxNumInputs; i++) {
DMXInputInfo *dmxInput = &dmxInputs[i];
- if (!dmxInput->detached) dmxInputLateReInit(dmxInput);
+
+ if (!dmxInput->detached)
+ dmxInputLateReInit(dmxInput);
}
}
/** Add an input with the specified attributes. If the input is added,
* the physical id is returned in \a deviceId. */
-int dmxAddInput(DMXInputAttributesPtr attr, int *id)
+int
+dmxAddInput(DMXInputAttributesPtr attr, int *id)
{
int retcode = BadValue;
if (attr->inputType == 1) /* console */
retcode = dmxInputAttachConsole(attr->name, attr->sendsCore, id);
- else if (attr->inputType == 2) /* backend */
+ else if (attr->inputType == 2) /* backend */
retcode = dmxInputAttachBackend(attr->physicalScreen,
- attr->sendsCore,id);
+ attr->sendsCore, id);
if (retcode == Success) {
/* Adjust the cursor boundaries */
@@ -265,7 +281,8 @@ int dmxAddInput(DMXInputAttributesPtr attr, int *id)
}
/** Remove the input with physical id \a id. */
-int dmxRemoveInput(int id)
+int
+dmxRemoveInput(int id)
{
return dmxInputDetachId(id);
}
@@ -273,46 +290,52 @@ int dmxRemoveInput(int id)
/** Return the value of #dmxNumScreens -- the total number of backend
* screens in use (these are logical screens and may be larger than the
* number of backend displays). */
-unsigned long dmxGetNumScreens(void)
+unsigned long
+dmxGetNumScreens(void)
{
return dmxNumScreens;
}
/** Make sure that #dmxCreateAndRealizeWindow has been called for \a
* pWindow. */
-void dmxForceWindowCreation(WindowPtr pWindow)
+void
+dmxForceWindowCreation(WindowPtr pWindow)
{
dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
- if (!pWinPriv->window) dmxCreateAndRealizeWindow(pWindow, TRUE);
+
+ if (!pWinPriv->window)
+ dmxCreateAndRealizeWindow(pWindow, TRUE);
}
/** Flush pending syncs for all screens. */
-void dmxFlushPendingSyncs(void)
+void
+dmxFlushPendingSyncs(void)
{
dmxSync(NULL, TRUE);
}
/** Update DMX's screen resources to match those of the newly moved
* and/or resized "root" window. */
-void dmxUpdateScreenResources(ScreenPtr pScreen, int x, int y, int w, int h)
+void
+dmxUpdateScreenResources(ScreenPtr pScreen, int x, int y, int w, int h)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- WindowPtr pRoot = pScreen->root;
- WindowPtr pChild;
- Bool anyMarked = FALSE;
+ WindowPtr pRoot = pScreen->root;
+ WindowPtr pChild;
+ Bool anyMarked = FALSE;
/* Handle special case where width and/or height are zero */
if (w == 0 || h == 0) {
- w = 1;
- h = 1;
+ w = 1;
+ h = 1;
}
/* Change screen size */
- pScreen->width = w;
+ pScreen->width = w;
pScreen->height = h;
/* Reset the root window's drawable's size */
- pRoot->drawable.width = w;
+ pRoot->drawable.width = w;
pRoot->drawable.height = h;
/* Set the root window's new winSize and borderSize */
@@ -328,15 +351,15 @@ void dmxUpdateScreenResources(ScreenPtr pScreen, int x, int y, int w, int h)
/* Recompute this screen's mmWidth & mmHeight */
pScreen->mmWidth =
- (w * 254 + dmxScreen->beXDPI * 5) / (dmxScreen->beXDPI * 10);
+ (w * 254 + dmxScreen->beXDPI * 5) / (dmxScreen->beXDPI * 10);
pScreen->mmHeight =
- (h * 254 + dmxScreen->beYDPI * 5) / (dmxScreen->beYDPI * 10);
+ (h * 254 + dmxScreen->beYDPI * 5) / (dmxScreen->beYDPI * 10);
/* Recompute this screen's window's clip rects as follows: */
/* 1. Mark all of root's children's windows */
for (pChild = pRoot->firstChild; pChild; pChild = pChild->nextSib)
- anyMarked |= pScreen->MarkOverlappedWindows(pChild, pChild,
- (WindowPtr *)NULL);
+ anyMarked |= pScreen->MarkOverlappedWindows(pChild, pChild,
+ (WindowPtr *) NULL);
/* 2. Set the root window's borderClip */
pRoot->borderClip.extents.x1 = 0;
@@ -346,27 +369,28 @@ void dmxUpdateScreenResources(ScreenPtr pScreen, int x, int y, int w, int h)
/* 3. Set the root window's clipList */
if (anyMarked) {
- /* If any windows have been marked, set the root window's
- * clipList to be broken since it will be recalculated in
- * ValidateTree()
- */
- RegionBreak(&pRoot->clipList);
- } else {
- /* Otherwise, we just set it directly since there are no
- * windows visible on this screen
- */
- pRoot->clipList.extents.x1 = 0;
- pRoot->clipList.extents.y1 = 0;
- pRoot->clipList.extents.x2 = w;
- pRoot->clipList.extents.y2 = h;
+ /* If any windows have been marked, set the root window's
+ * clipList to be broken since it will be recalculated in
+ * ValidateTree()
+ */
+ RegionBreak(&pRoot->clipList);
+ }
+ else {
+ /* Otherwise, we just set it directly since there are no
+ * windows visible on this screen
+ */
+ pRoot->clipList.extents.x1 = 0;
+ pRoot->clipList.extents.y1 = 0;
+ pRoot->clipList.extents.x2 = w;
+ pRoot->clipList.extents.y2 = h;
}
/* 4. Revalidate all clip rects and generate expose events */
if (anyMarked) {
- pScreen->ValidateTree(pRoot, NULL, VTBroken);
- pScreen->HandleExposures(pRoot);
- if (pScreen->PostValidateTree)
- pScreen->PostValidateTree(pRoot, NULL, VTBroken);
+ pScreen->ValidateTree(pRoot, NULL, VTBroken);
+ pScreen->HandleExposures(pRoot);
+ if (pScreen->PostValidateTree)
+ pScreen->PostValidateTree(pRoot, NULL, VTBroken);
}
}
@@ -375,72 +399,71 @@ void dmxUpdateScreenResources(ScreenPtr pScreen, int x, int y, int w, int h)
/** Change the "screen" window attributes by resizing the actual window
* on the back-end display (if necessary). */
-static void dmxConfigureScreenWindow(int idx,
- int x, int y, int w, int h)
+static void
+dmxConfigureScreenWindow(int idx, int x, int y, int w, int h)
{
DMXScreenInfo *dmxScreen = &dmxScreens[idx];
- ScreenPtr pScreen = screenInfo.screens[idx];
+ ScreenPtr pScreen = screenInfo.screens[idx];
/* Resize "screen" window */
- if (dmxScreen->scrnX != x ||
- dmxScreen->scrnY != y ||
- dmxScreen->scrnWidth != w ||
- dmxScreen->scrnHeight != h) {
- dmxResizeScreenWindow(pScreen, x, y, w, h);
+ if (dmxScreen->scrnX != x ||
+ dmxScreen->scrnY != y ||
+ dmxScreen->scrnWidth != w || dmxScreen->scrnHeight != h) {
+ dmxResizeScreenWindow(pScreen, x, y, w, h);
}
/* Change "screen" window values */
- dmxScreen->scrnX = x;
- dmxScreen->scrnY = y;
- dmxScreen->scrnWidth = w;
+ dmxScreen->scrnX = x;
+ dmxScreen->scrnY = y;
+ dmxScreen->scrnWidth = w;
dmxScreen->scrnHeight = h;
}
-
+
/** Change the "root" window position and size by resizing the actual
* window on the back-end display (if necessary) and updating all of
* DMX's resources by calling #dmxUpdateScreenResources. */
-static void dmxConfigureRootWindow(int idx, int x, int y, int w, int h)
+static void
+dmxConfigureRootWindow(int idx, int x, int y, int w, int h)
{
DMXScreenInfo *dmxScreen = &dmxScreens[idx];
- WindowPtr pRoot = screenInfo.screens[idx]->root;
+ WindowPtr pRoot = screenInfo.screens[idx]->root;
/* NOTE: Either this function or the ones that it calls must handle
* the case where w == 0 || h == 0. Currently, the functions that
* this one calls handle that case. */
/* 1. Resize "root" window */
- if (dmxScreen->rootX != x ||
- dmxScreen->rootY != y ||
- dmxScreen->rootWidth != w ||
- dmxScreen->rootHeight != h) {
- dmxResizeRootWindow(pRoot, x, y, w, h);
+ if (dmxScreen->rootX != x ||
+ dmxScreen->rootY != y ||
+ dmxScreen->rootWidth != w || dmxScreen->rootHeight != h) {
+ dmxResizeRootWindow(pRoot, x, y, w, h);
}
/* 2. Update all of the screen's resources associated with this root
* window */
- if (dmxScreen->rootWidth != w ||
- dmxScreen->rootHeight != h) {
- dmxUpdateScreenResources(screenInfo.screens[idx], x, y, w, h);
+ if (dmxScreen->rootWidth != w || dmxScreen->rootHeight != h) {
+ dmxUpdateScreenResources(screenInfo.screens[idx], x, y, w, h);
}
/* Change "root" window values */
- dmxScreen->rootX = x;
- dmxScreen->rootY = y;
- dmxScreen->rootWidth = w;
+ dmxScreen->rootX = x;
+ dmxScreen->rootY = y;
+ dmxScreen->rootWidth = w;
dmxScreen->rootHeight = h;
}
/** Change the "root" window's origin by updating DMX's internal data
* structures (dix and Xinerama) to use the new origin and adjust the
* positions of windows that overlap this "root" window. */
-static void dmxSetRootWindowOrigin(int idx, int x, int y)
+static void
+dmxSetRootWindowOrigin(int idx, int x, int y)
{
DMXScreenInfo *dmxScreen = &dmxScreens[idx];
- ScreenPtr pScreen = screenInfo.screens[idx];
- WindowPtr pRoot = pScreen->root;
- WindowPtr pChild;
- int xoff;
- int yoff;
+ ScreenPtr pScreen = screenInfo.screens[idx];
+ WindowPtr pRoot = pScreen->root;
+ WindowPtr pChild;
+ int xoff;
+ int yoff;
/* Change "root" window's origin */
dmxScreen->rootXOrigin = x;
@@ -458,129 +481,131 @@ static void dmxSetRootWindowOrigin(int idx, int x, int y)
XineramaReinitData();
/* Adjust each of the root window's children */
- if (!idx) ReinitializeRootWindow(screenInfo.screens[0]->root, xoff, yoff);
+ if (!idx)
+ ReinitializeRootWindow(screenInfo.screens[0]->root, xoff, yoff);
pChild = pRoot->firstChild;
while (pChild) {
- /* Adjust child window's position */
- pScreen->MoveWindow(pChild,
- pChild->origin.x - wBorderWidth(pChild) - xoff,
- pChild->origin.y - wBorderWidth(pChild) - yoff,
- pChild->nextSib,
- VTMove);
-
- /* Note that the call to MoveWindow will eventually call
- * dmxPositionWindow which will automatically create a
- * window if it is now exposed on screen (for lazy window
- * creation optimization) and it will properly set the
- * offscreen flag.
- */
-
- pChild = pChild->nextSib;
+ /* Adjust child window's position */
+ pScreen->MoveWindow(pChild,
+ pChild->origin.x - wBorderWidth(pChild) - xoff,
+ pChild->origin.y - wBorderWidth(pChild) - yoff,
+ pChild->nextSib, VTMove);
+
+ /* Note that the call to MoveWindow will eventually call
+ * dmxPositionWindow which will automatically create a
+ * window if it is now exposed on screen (for lazy window
+ * creation optimization) and it will properly set the
+ * offscreen flag.
+ */
+
+ pChild = pChild->nextSib;
}
}
/** Configure the attributes of each "screen" and "root" window. */
-int dmxConfigureScreenWindows(int nscreens,
- CARD32 *screens,
- DMXScreenAttributesPtr attribs,
- int *errorScreen)
+int
+dmxConfigureScreenWindows(int nscreens,
+ CARD32 *screens,
+ DMXScreenAttributesPtr attribs, int *errorScreen)
{
- int i;
+ int i;
for (i = 0; i < nscreens; i++) {
- DMXScreenAttributesPtr attr = &attribs[i];
- int idx = screens[i];
- DMXScreenInfo *dmxScreen = &dmxScreens[idx];
-
- if (errorScreen) *errorScreen = i;
-
- if (!dmxScreen->beDisplay) return DMX_BAD_VALUE;
-
- /* Check for illegal values */
- if (idx < 0 || idx >= dmxNumScreens) return BadValue;
-
- /* The "screen" and "root" windows must have valid sizes */
- if (attr->screenWindowWidth <= 0 || attr->screenWindowHeight <= 0 ||
- attr->rootWindowWidth < 0 || attr->rootWindowHeight < 0)
- return DMX_BAD_VALUE;
-
- /* The "screen" window must fit entirely within the BE display */
- if (attr->screenWindowXoffset < 0 ||
- attr->screenWindowYoffset < 0 ||
- attr->screenWindowXoffset
- + attr->screenWindowWidth > (unsigned)dmxScreen->beWidth ||
- attr->screenWindowYoffset
- + attr->screenWindowHeight > (unsigned)dmxScreen->beHeight)
- return DMX_BAD_VALUE;
-
- /* The "root" window must fit entirely within the "screen" window */
- if (attr->rootWindowXoffset < 0 ||
- attr->rootWindowYoffset < 0 ||
- attr->rootWindowXoffset
- + attr->rootWindowWidth > attr->screenWindowWidth ||
- attr->rootWindowYoffset
- + attr->rootWindowHeight > attr->screenWindowHeight)
- return DMX_BAD_VALUE;
-
- /* The "root" window must not expose unaddressable coordinates */
- if (attr->rootWindowXorigin < 0 ||
- attr->rootWindowYorigin < 0 ||
- attr->rootWindowXorigin + attr->rootWindowWidth > 32767 ||
- attr->rootWindowYorigin + attr->rootWindowHeight > 32767)
- return DMX_BAD_VALUE;
-
- /* The "root" window must fit within the global bounding box */
- if (attr->rootWindowXorigin
- + attr->rootWindowWidth > (unsigned)dmxGlobalWidth ||
- attr->rootWindowYorigin
- + attr->rootWindowHeight > (unsigned)dmxGlobalHeight)
- return DMX_BAD_VALUE;
-
- /* FIXME: Handle the rest of the illegal value checking */
+ DMXScreenAttributesPtr attr = &attribs[i];
+ int idx = screens[i];
+ DMXScreenInfo *dmxScreen = &dmxScreens[idx];
+
+ if (errorScreen)
+ *errorScreen = i;
+
+ if (!dmxScreen->beDisplay)
+ return DMX_BAD_VALUE;
+
+ /* Check for illegal values */
+ if (idx < 0 || idx >= dmxNumScreens)
+ return BadValue;
+
+ /* The "screen" and "root" windows must have valid sizes */
+ if (attr->screenWindowWidth <= 0 || attr->screenWindowHeight <= 0 ||
+ attr->rootWindowWidth < 0 || attr->rootWindowHeight < 0)
+ return DMX_BAD_VALUE;
+
+ /* The "screen" window must fit entirely within the BE display */
+ if (attr->screenWindowXoffset < 0 ||
+ attr->screenWindowYoffset < 0 ||
+ attr->screenWindowXoffset
+ + attr->screenWindowWidth > (unsigned) dmxScreen->beWidth ||
+ attr->screenWindowYoffset
+ + attr->screenWindowHeight > (unsigned) dmxScreen->beHeight)
+ return DMX_BAD_VALUE;
+
+ /* The "root" window must fit entirely within the "screen" window */
+ if (attr->rootWindowXoffset < 0 ||
+ attr->rootWindowYoffset < 0 ||
+ attr->rootWindowXoffset
+ + attr->rootWindowWidth > attr->screenWindowWidth ||
+ attr->rootWindowYoffset
+ + attr->rootWindowHeight > attr->screenWindowHeight)
+ return DMX_BAD_VALUE;
+
+ /* The "root" window must not expose unaddressable coordinates */
+ if (attr->rootWindowXorigin < 0 ||
+ attr->rootWindowYorigin < 0 ||
+ attr->rootWindowXorigin + attr->rootWindowWidth > 32767 ||
+ attr->rootWindowYorigin + attr->rootWindowHeight > 32767)
+ return DMX_BAD_VALUE;
+
+ /* The "root" window must fit within the global bounding box */
+ if (attr->rootWindowXorigin
+ + attr->rootWindowWidth > (unsigned) dmxGlobalWidth ||
+ attr->rootWindowYorigin
+ + attr->rootWindowHeight > (unsigned) dmxGlobalHeight)
+ return DMX_BAD_VALUE;
+
+ /* FIXME: Handle the rest of the illegal value checking */
}
/* No illegal values found */
- if (errorScreen) *errorScreen = 0;
+ if (errorScreen)
+ *errorScreen = 0;
for (i = 0; i < nscreens; i++) {
- DMXScreenAttributesPtr attr = &attribs[i];
- int idx = screens[i];
- DMXScreenInfo *dmxScreen = &dmxScreens[idx];
-
- dmxLog(dmxInfo, "Changing screen #%d attributes "
- "from %dx%d+%d+%d %dx%d+%d+%d +%d+%d "
- "to %dx%d+%d+%d %dx%d+%d+%d +%d+%d\n",
- idx,
- dmxScreen->scrnWidth, dmxScreen->scrnHeight,
- dmxScreen->scrnX, dmxScreen->scrnY,
- dmxScreen->rootWidth, dmxScreen->rootHeight,
- dmxScreen->rootX, dmxScreen->rootY,
- dmxScreen->rootXOrigin, dmxScreen->rootYOrigin,
- attr->screenWindowWidth, attr->screenWindowHeight,
- attr->screenWindowXoffset, attr->screenWindowYoffset,
- attr->rootWindowWidth, attr->rootWindowHeight,
- attr->rootWindowXoffset, attr->rootWindowYoffset,
- attr->rootWindowXorigin, attr->rootWindowYorigin);
-
- /* Configure "screen" window */
- dmxConfigureScreenWindow(idx,
- attr->screenWindowXoffset,
- attr->screenWindowYoffset,
- attr->screenWindowWidth,
- attr->screenWindowHeight);
-
- /* Configure "root" window */
- dmxConfigureRootWindow(idx,
- attr->rootWindowXoffset,
- attr->rootWindowYoffset,
- attr->rootWindowWidth,
- attr->rootWindowHeight);
-
-
- /* Set "root" window's origin */
- dmxSetRootWindowOrigin(idx,
- attr->rootWindowXorigin,
- attr->rootWindowYorigin);
+ DMXScreenAttributesPtr attr = &attribs[i];
+ int idx = screens[i];
+ DMXScreenInfo *dmxScreen = &dmxScreens[idx];
+
+ dmxLog(dmxInfo, "Changing screen #%d attributes "
+ "from %dx%d+%d+%d %dx%d+%d+%d +%d+%d "
+ "to %dx%d+%d+%d %dx%d+%d+%d +%d+%d\n",
+ idx,
+ dmxScreen->scrnWidth, dmxScreen->scrnHeight,
+ dmxScreen->scrnX, dmxScreen->scrnY,
+ dmxScreen->rootWidth, dmxScreen->rootHeight,
+ dmxScreen->rootX, dmxScreen->rootY,
+ dmxScreen->rootXOrigin, dmxScreen->rootYOrigin,
+ attr->screenWindowWidth, attr->screenWindowHeight,
+ attr->screenWindowXoffset, attr->screenWindowYoffset,
+ attr->rootWindowWidth, attr->rootWindowHeight,
+ attr->rootWindowXoffset, attr->rootWindowYoffset,
+ attr->rootWindowXorigin, attr->rootWindowYorigin);
+
+ /* Configure "screen" window */
+ dmxConfigureScreenWindow(idx,
+ attr->screenWindowXoffset,
+ attr->screenWindowYoffset,
+ attr->screenWindowWidth,
+ attr->screenWindowHeight);
+
+ /* Configure "root" window */
+ dmxConfigureRootWindow(idx,
+ attr->rootWindowXoffset,
+ attr->rootWindowYoffset,
+ attr->rootWindowWidth, attr->rootWindowHeight);
+
+ /* Set "root" window's origin */
+ dmxSetRootWindowOrigin(idx,
+ attr->rootWindowXorigin,
+ attr->rootWindowYorigin);
}
/* Adjust the cursor boundaries */
@@ -593,37 +618,46 @@ int dmxConfigureScreenWindows(int nscreens,
}
/** Configure the attributes of the global desktop. */
-int dmxConfigureDesktop(DMXDesktopAttributesPtr attribs)
+int
+dmxConfigureDesktop(DMXDesktopAttributesPtr attribs)
{
- if (attribs->width <= 0 || attribs->width >= 32767 ||
- attribs->height <= 0 || attribs->height >= 32767)
- return DMX_BAD_VALUE;
+ if (attribs->width <= 0 || attribs->width >= 32767 ||
+ attribs->height <= 0 || attribs->height >= 32767)
+ return DMX_BAD_VALUE;
/* If the desktop is shrinking, adjust the "root" windows on each
* "screen" window to only show the visible desktop. Also, handle
* the special case where the desktop shrinks such that the it no
* longer overlaps an portion of a "screen" window. */
if (attribs->width < dmxGlobalWidth || attribs->height < dmxGlobalHeight) {
- int i;
- for (i = 0; i < dmxNumScreens; i++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[i];
- if (dmxScreen->rootXOrigin
- + dmxScreen->rootWidth > attribs->width ||
- dmxScreen->rootYOrigin
- + dmxScreen->rootHeight > attribs->height) {
- int w, h;
- if ((w = attribs->width - dmxScreen->rootXOrigin) < 0) w = 0;
- if ((h = attribs->height - dmxScreen->rootYOrigin) < 0) h = 0;
- if (w > dmxScreen->scrnWidth) w = dmxScreen->scrnWidth;
- if (h > dmxScreen->scrnHeight) h = dmxScreen->scrnHeight;
- if (w > dmxScreen->rootWidth) w = dmxScreen->rootWidth;
- if (h > dmxScreen->rootHeight) h = dmxScreen->rootHeight;
- dmxConfigureRootWindow(i,
- dmxScreen->rootX,
- dmxScreen->rootY,
- w, h);
- }
- }
+ int i;
+
+ for (i = 0; i < dmxNumScreens; i++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[i];
+
+ if (dmxScreen->rootXOrigin
+ + dmxScreen->rootWidth > attribs->width ||
+ dmxScreen->rootYOrigin
+ + dmxScreen->rootHeight > attribs->height) {
+ int w, h;
+
+ if ((w = attribs->width - dmxScreen->rootXOrigin) < 0)
+ w = 0;
+ if ((h = attribs->height - dmxScreen->rootYOrigin) < 0)
+ h = 0;
+ if (w > dmxScreen->scrnWidth)
+ w = dmxScreen->scrnWidth;
+ if (h > dmxScreen->scrnHeight)
+ h = dmxScreen->scrnHeight;
+ if (w > dmxScreen->rootWidth)
+ w = dmxScreen->rootWidth;
+ if (h > dmxScreen->rootHeight)
+ h = dmxScreen->rootHeight;
+ dmxConfigureRootWindow(i,
+ dmxScreen->rootX,
+ dmxScreen->rootY, w, h);
+ }
+ }
}
/* Set the global width/height */
@@ -631,30 +665,30 @@ int dmxConfigureDesktop(DMXDesktopAttributesPtr attribs)
/* Handle shift[XY] changes */
if (attribs->shiftX || attribs->shiftY) {
- int i;
- for (i = 0; i < dmxNumScreens; i++) {
- ScreenPtr pScreen = screenInfo.screens[i];
- WindowPtr pChild = pScreen->root->firstChild;
- while (pChild) {
- /* Adjust child window's position */
- pScreen->MoveWindow(pChild,
- pChild->origin.x - wBorderWidth(pChild)
- - attribs->shiftX,
- pChild->origin.y - wBorderWidth(pChild)
- - attribs->shiftY,
- pChild->nextSib,
- VTMove);
-
- /* Note that the call to MoveWindow will eventually call
- * dmxPositionWindow which will automatically create a
- * window if it is now exposed on screen (for lazy
- * window creation optimization) and it will properly
- * set the offscreen flag.
- */
-
- pChild = pChild->nextSib;
- }
- }
+ int i;
+
+ for (i = 0; i < dmxNumScreens; i++) {
+ ScreenPtr pScreen = screenInfo.screens[i];
+ WindowPtr pChild = pScreen->root->firstChild;
+
+ while (pChild) {
+ /* Adjust child window's position */
+ pScreen->MoveWindow(pChild,
+ pChild->origin.x - wBorderWidth(pChild)
+ - attribs->shiftX,
+ pChild->origin.y - wBorderWidth(pChild)
+ - attribs->shiftY, pChild->nextSib, VTMove);
+
+ /* Note that the call to MoveWindow will eventually call
+ * dmxPositionWindow which will automatically create a
+ * window if it is now exposed on screen (for lazy
+ * window creation optimization) and it will properly
+ * set the offscreen flag.
+ */
+
+ pChild = pChild->nextSib;
+ }
+ }
}
/* Update connection block, Xinerama, etc. -- these appears to
@@ -672,14 +706,15 @@ int dmxConfigureDesktop(DMXDesktopAttributesPtr attribs)
#endif
/** Create the scratch GCs per depth. */
-static void dmxBECreateScratchGCs(int scrnNum)
+static void
+dmxBECreateScratchGCs(int scrnNum)
{
- ScreenPtr pScreen = screenInfo.screens[scrnNum];
- GCPtr *ppGC = pScreen->GCperDepth;
- int i;
+ ScreenPtr pScreen = screenInfo.screens[scrnNum];
+ GCPtr *ppGC = pScreen->GCperDepth;
+ int i;
for (i = 0; i <= pScreen->numDepths; i++)
- dmxBECreateGC(pScreen, ppGC[i]);
+ dmxBECreateGC(pScreen, ppGC[i]);
}
#ifdef PANORAMIX
@@ -689,89 +724,92 @@ static Bool FoundPixImage;
* to have its image restored. When it is found, see if there is
* another screen with the same image. If so, copy the pixmap image
* from the existing screen to the newly created pixmap. */
-static void dmxBERestorePixmapImage(pointer value, XID id, RESTYPE type,
- pointer p)
+static void
+dmxBERestorePixmapImage(pointer value, XID id, RESTYPE type, pointer p)
{
if ((type & TypeMask) == (XRT_PIXMAP & TypeMask)) {
- PixmapPtr pDst = (PixmapPtr)p;
- int idx = pDst->drawable.pScreen->myNum;
- PanoramiXRes *pXinPix = (PanoramiXRes *)value;
- PixmapPtr pPix;
- int i;
-
- dixLookupResourceByType((pointer*) &pPix, pXinPix->info[idx].id,
- RT_PIXMAP, NullClient, DixUnknownAccess);
- if (pPix != pDst) return; /* Not a match.... Next! */
-
- FOR_NSCREENS(i) {
- PixmapPtr pSrc;
- dmxPixPrivPtr pSrcPriv = NULL;
-
- if (i == idx) continue; /* Self replication is bad */
-
- dixLookupResourceByType((pointer*) &pSrc, pXinPix->info[i].id,
- RT_PIXMAP, NullClient, DixUnknownAccess);
- pSrcPriv = DMX_GET_PIXMAP_PRIV(pSrc);
- if (pSrcPriv->pixmap) {
- DMXScreenInfo *dmxSrcScreen = &dmxScreens[i];
- DMXScreenInfo *dmxDstScreen = &dmxScreens[idx];
- dmxPixPrivPtr pDstPriv = DMX_GET_PIXMAP_PRIV(pDst);
- XImage *img;
- int j;
- XlibGC gc = NULL;
-
- /* This should never happen, but just in case.... */
- if (pSrc->drawable.width != pDst->drawable.width ||
- pSrc->drawable.height != pDst->drawable.height)
- return;
-
- /* Copy from src pixmap to dst pixmap */
- img = XGetImage(dmxSrcScreen->beDisplay,
- pSrcPriv->pixmap,
- 0, 0,
- pSrc->drawable.width, pSrc->drawable.height,
- -1,
- ZPixmap);
-
- for (j = 0; j < dmxDstScreen->beNumPixmapFormats; j++) {
- if (dmxDstScreen->bePixmapFormats[j].depth == img->depth) {
- unsigned long m;
- XGCValues v;
-
- m = GCFunction | GCPlaneMask | GCClipMask;
- v.function = GXcopy;
- v.plane_mask = AllPlanes;
- v.clip_mask = None;
-
- gc = XCreateGC(dmxDstScreen->beDisplay,
- dmxDstScreen->scrnDefDrawables[j],
- m, &v);
- break;
- }
- }
-
- if (gc) {
- XPutImage(dmxDstScreen->beDisplay,
- pDstPriv->pixmap,
- gc, img, 0, 0, 0, 0,
- pDst->drawable.width, pDst->drawable.height);
- XFreeGC(dmxDstScreen->beDisplay, gc);
- FoundPixImage = True;
- } else {
- dmxLog(dmxWarning, "Could not create GC\n");
- }
-
- XDestroyImage(img);
- return;
- }
- }
+ PixmapPtr pDst = (PixmapPtr) p;
+ int idx = pDst->drawable.pScreen->myNum;
+ PanoramiXRes *pXinPix = (PanoramiXRes *) value;
+ PixmapPtr pPix;
+ int i;
+
+ dixLookupResourceByType((pointer *) &pPix, pXinPix->info[idx].id,
+ RT_PIXMAP, NullClient, DixUnknownAccess);
+ if (pPix != pDst)
+ return; /* Not a match.... Next! */
+
+ FOR_NSCREENS(i) {
+ PixmapPtr pSrc;
+ dmxPixPrivPtr pSrcPriv = NULL;
+
+ if (i == idx)
+ continue; /* Self replication is bad */
+
+ dixLookupResourceByType((pointer *) &pSrc, pXinPix->info[i].id,
+ RT_PIXMAP, NullClient, DixUnknownAccess);
+ pSrcPriv = DMX_GET_PIXMAP_PRIV(pSrc);
+ if (pSrcPriv->pixmap) {
+ DMXScreenInfo *dmxSrcScreen = &dmxScreens[i];
+ DMXScreenInfo *dmxDstScreen = &dmxScreens[idx];
+ dmxPixPrivPtr pDstPriv = DMX_GET_PIXMAP_PRIV(pDst);
+ XImage *img;
+ int j;
+ XlibGC gc = NULL;
+
+ /* This should never happen, but just in case.... */
+ if (pSrc->drawable.width != pDst->drawable.width ||
+ pSrc->drawable.height != pDst->drawable.height)
+ return;
+
+ /* Copy from src pixmap to dst pixmap */
+ img = XGetImage(dmxSrcScreen->beDisplay,
+ pSrcPriv->pixmap,
+ 0, 0,
+ pSrc->drawable.width, pSrc->drawable.height,
+ -1, ZPixmap);
+
+ for (j = 0; j < dmxDstScreen->beNumPixmapFormats; j++) {
+ if (dmxDstScreen->bePixmapFormats[j].depth == img->depth) {
+ unsigned long m;
+ XGCValues v;
+
+ m = GCFunction | GCPlaneMask | GCClipMask;
+ v.function = GXcopy;
+ v.plane_mask = AllPlanes;
+ v.clip_mask = None;
+
+ gc = XCreateGC(dmxDstScreen->beDisplay,
+ dmxDstScreen->scrnDefDrawables[j],
+ m, &v);
+ break;
+ }
+ }
+
+ if (gc) {
+ XPutImage(dmxDstScreen->beDisplay,
+ pDstPriv->pixmap,
+ gc, img, 0, 0, 0, 0,
+ pDst->drawable.width, pDst->drawable.height);
+ XFreeGC(dmxDstScreen->beDisplay, gc);
+ FoundPixImage = True;
+ }
+ else {
+ dmxLog(dmxWarning, "Could not create GC\n");
+ }
+
+ XDestroyImage(img);
+ return;
+ }
+ }
}
}
#endif
/** Restore the pixmap image either from another screen or from an image
* that was saved when the screen was previously detached. */
-static void dmxBERestorePixmap(PixmapPtr pPixmap)
+static void
+dmxBERestorePixmap(PixmapPtr pPixmap)
{
#ifdef PANORAMIX
int i;
@@ -779,62 +817,63 @@ static void dmxBERestorePixmap(PixmapPtr pPixmap)
/* If Xinerama is not active, there's nothing we can do (see comment
* in #else below for more info). */
if (noPanoramiXExtension) {
- dmxLog(dmxWarning, "Cannot restore pixmap image\n");
- return;
+ dmxLog(dmxWarning, "Cannot restore pixmap image\n");
+ return;
}
FoundPixImage = False;
- for (i = currentMaxClients; --i >= 0; )
- if (clients[i])
- FindAllClientResources(clients[i], dmxBERestorePixmapImage,
- (pointer)pPixmap);
+ for (i = currentMaxClients; --i >= 0;)
+ if (clients[i])
+ FindAllClientResources(clients[i], dmxBERestorePixmapImage,
+ (pointer) pPixmap);
/* No corresponding pixmap image was found on other screens, so we
* need to copy it from the saved image when the screen was detached
* (if available). */
if (!FoundPixImage) {
- dmxPixPrivPtr pPixPriv = DMX_GET_PIXMAP_PRIV(pPixmap);
-
- if (pPixPriv->detachedImage) {
- ScreenPtr pScreen = pPixmap->drawable.pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- XlibGC gc = NULL;
-
- for (i = 0; i < dmxScreen->beNumPixmapFormats; i++) {
- if (dmxScreen->bePixmapFormats[i].depth ==
- pPixPriv->detachedImage->depth) {
- unsigned long m;
- XGCValues v;
-
- m = GCFunction | GCPlaneMask | GCClipMask;
- v.function = GXcopy;
- v.plane_mask = AllPlanes;
- v.clip_mask = None;
-
- gc = XCreateGC(dmxScreen->beDisplay,
- dmxScreen->scrnDefDrawables[i],
- m, &v);
- break;
- }
- }
-
- if (gc) {
- XPutImage(dmxScreen->beDisplay,
- pPixPriv->pixmap,
- gc,
- pPixPriv->detachedImage,
- 0, 0, 0, 0,
- pPixmap->drawable.width, pPixmap->drawable.height);
- XFreeGC(dmxScreen->beDisplay, gc);
- } else {
- dmxLog(dmxWarning, "Cannot restore pixmap image\n");
- }
-
- XDestroyImage(pPixPriv->detachedImage);
- pPixPriv->detachedImage = NULL;
- } else {
- dmxLog(dmxWarning, "Cannot restore pixmap image\n");
- }
+ dmxPixPrivPtr pPixPriv = DMX_GET_PIXMAP_PRIV(pPixmap);
+
+ if (pPixPriv->detachedImage) {
+ ScreenPtr pScreen = pPixmap->drawable.pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ XlibGC gc = NULL;
+
+ for (i = 0; i < dmxScreen->beNumPixmapFormats; i++) {
+ if (dmxScreen->bePixmapFormats[i].depth ==
+ pPixPriv->detachedImage->depth) {
+ unsigned long m;
+ XGCValues v;
+
+ m = GCFunction | GCPlaneMask | GCClipMask;
+ v.function = GXcopy;
+ v.plane_mask = AllPlanes;
+ v.clip_mask = None;
+
+ gc = XCreateGC(dmxScreen->beDisplay,
+ dmxScreen->scrnDefDrawables[i], m, &v);
+ break;
+ }
+ }
+
+ if (gc) {
+ XPutImage(dmxScreen->beDisplay,
+ pPixPriv->pixmap,
+ gc,
+ pPixPriv->detachedImage,
+ 0, 0, 0, 0,
+ pPixmap->drawable.width, pPixmap->drawable.height);
+ XFreeGC(dmxScreen->beDisplay, gc);
+ }
+ else {
+ dmxLog(dmxWarning, "Cannot restore pixmap image\n");
+ }
+
+ XDestroyImage(pPixPriv->detachedImage);
+ pPixPriv->detachedImage = NULL;
+ }
+ else {
+ dmxLog(dmxWarning, "Cannot restore pixmap image\n");
+ }
}
#else
/* If Xinerama is not enabled, then there is no other copy of the
@@ -852,57 +891,68 @@ static void dmxBERestorePixmap(PixmapPtr pPixmap)
* function. It walks all resources, compares them to the screen
* number passed in as \a n and calls the appropriate DMX function to
* create the associated resource on the back-end server. */
-static void dmxBECreateResources(pointer value, XID id, RESTYPE type,
- pointer n)
+static void
+dmxBECreateResources(pointer value, XID id, RESTYPE type, pointer n)
{
- int scrnNum = (uintptr_t)n;
- ScreenPtr pScreen = screenInfo.screens[scrnNum];
+ int scrnNum = (uintptr_t) n;
+ ScreenPtr pScreen = screenInfo.screens[scrnNum];
if ((type & TypeMask) == (RT_WINDOW & TypeMask)) {
- /* Window resources are created below in dmxBECreateWindowTree */
- } else if ((type & TypeMask) == (RT_PIXMAP & TypeMask)) {
- PixmapPtr pPix = value;
- if (pPix->drawable.pScreen->myNum == scrnNum) {
- dmxBECreatePixmap(pPix);
- dmxBERestorePixmap(pPix);
- }
- } else if ((type & TypeMask) == (RT_GC & TypeMask)) {
- GCPtr pGC = value;
- if (pGC->pScreen->myNum == scrnNum) {
- /* Create the GC on the back-end server */
- dmxBECreateGC(pScreen, pGC);
- /* Create any pixmaps associated with this GC */
- if (!pGC->tileIsPixel) {
- dmxBECreatePixmap(pGC->tile.pixmap);
- dmxBERestorePixmap(pGC->tile.pixmap);
- }
- if (pGC->stipple != pScreen->PixmapPerDepth[0]) {
- dmxBECreatePixmap(pGC->stipple);
- dmxBERestorePixmap(pGC->stipple);
- }
- if (pGC->font != defaultFont) {
- (void)dmxBELoadFont(pScreen, pGC->font);
- }
- /* Update the GC on the back-end server */
- dmxChangeGC(pGC, -1L);
- }
- } else if ((type & TypeMask) == (RT_FONT & TypeMask)) {
- (void)dmxBELoadFont(pScreen, (FontPtr)value);
- } else if ((type & TypeMask) == (RT_CURSOR & TypeMask)) {
- dmxBECreateCursor(pScreen, (CursorPtr)value);
- } else if ((type & TypeMask) == (RT_COLORMAP & TypeMask)) {
- ColormapPtr pCmap = value;
- if (pCmap->pScreen->myNum == scrnNum)
- (void)dmxBECreateColormap((ColormapPtr)value);
+ /* Window resources are created below in dmxBECreateWindowTree */
+ }
+ else if ((type & TypeMask) == (RT_PIXMAP & TypeMask)) {
+ PixmapPtr pPix = value;
+
+ if (pPix->drawable.pScreen->myNum == scrnNum) {
+ dmxBECreatePixmap(pPix);
+ dmxBERestorePixmap(pPix);
+ }
+ }
+ else if ((type & TypeMask) == (RT_GC & TypeMask)) {
+ GCPtr pGC = value;
+
+ if (pGC->pScreen->myNum == scrnNum) {
+ /* Create the GC on the back-end server */
+ dmxBECreateGC(pScreen, pGC);
+ /* Create any pixmaps associated with this GC */
+ if (!pGC->tileIsPixel) {
+ dmxBECreatePixmap(pGC->tile.pixmap);
+ dmxBERestorePixmap(pGC->tile.pixmap);
+ }
+ if (pGC->stipple != pScreen->PixmapPerDepth[0]) {
+ dmxBECreatePixmap(pGC->stipple);
+ dmxBERestorePixmap(pGC->stipple);
+ }
+ if (pGC->font != defaultFont) {
+ (void) dmxBELoadFont(pScreen, pGC->font);
+ }
+ /* Update the GC on the back-end server */
+ dmxChangeGC(pGC, -1L);
+ }
+ }
+ else if ((type & TypeMask) == (RT_FONT & TypeMask)) {
+ (void) dmxBELoadFont(pScreen, (FontPtr) value);
+ }
+ else if ((type & TypeMask) == (RT_CURSOR & TypeMask)) {
+ dmxBECreateCursor(pScreen, (CursorPtr) value);
+ }
+ else if ((type & TypeMask) == (RT_COLORMAP & TypeMask)) {
+ ColormapPtr pCmap = value;
+
+ if (pCmap->pScreen->myNum == scrnNum)
+ (void) dmxBECreateColormap((ColormapPtr) value);
#if 0
- /* TODO: Recreate Picture and GlyphSet resources */
- } else if ((type & TypeMask) == (PictureType & TypeMask)) {
- /* Picture resources are created when windows are created */
- } else if ((type & TypeMask) == (GlyphSetType & TypeMask)) {
- dmxBEFreeGlyphSet(pScreen, (GlyphSetPtr)value);
+ /* TODO: Recreate Picture and GlyphSet resources */
+ }
+ else if ((type & TypeMask) == (PictureType & TypeMask)) {
+ /* Picture resources are created when windows are created */
+ }
+ else if ((type & TypeMask) == (GlyphSetType & TypeMask)) {
+ dmxBEFreeGlyphSet(pScreen, (GlyphSetPtr) value);
#endif
- } else {
- /* Other resource types??? */
+ }
+ else {
+ /* Other resource types??? */
}
}
@@ -912,21 +962,22 @@ static void dmxBECreateResources(pointer value, XID id, RESTYPE type,
* itself to create each window's parents. This is required so that we
* have the opportunity to create each window's border and background
* pixmaps (where appropriate) before the window is created. */
-static void dmxBECreateWindowTree(int idx)
+static void
+dmxBECreateWindowTree(int idx)
{
DMXScreenInfo *dmxScreen = &dmxScreens[idx];
- WindowPtr pRoot = screenInfo.screens[idx]->root;
- dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pRoot);
- WindowPtr pWin;
+ WindowPtr pRoot = screenInfo.screens[idx]->root;
+ dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pRoot);
+ WindowPtr pWin;
/* Create the pixmaps associated with the root window */
if (!pRoot->borderIsPixel) {
- dmxBECreatePixmap(pRoot->border.pixmap);
- dmxBERestorePixmap(pRoot->border.pixmap);
+ dmxBECreatePixmap(pRoot->border.pixmap);
+ dmxBERestorePixmap(pRoot->border.pixmap);
}
if (pRoot->backgroundState == BackgroundPixmap) {
- dmxBECreatePixmap(pRoot->background.pixmap);
- dmxBERestorePixmap(pRoot->background.pixmap);
+ dmxBECreatePixmap(pRoot->background.pixmap);
+ dmxBERestorePixmap(pRoot->background.pixmap);
}
/* Create root window first */
@@ -935,175 +986,188 @@ static void dmxBECreateWindowTree(int idx)
pWin = pRoot->lastChild;
while (pWin) {
- pWinPriv = DMX_GET_WINDOW_PRIV(pWin);
-
- /* Create the pixmaps regardless of whether or not the
- * window is created or not due to lazy window creation.
- */
- if (!pWin->borderIsPixel) {
- dmxBECreatePixmap(pWin->border.pixmap);
- dmxBERestorePixmap(pWin->border.pixmap);
- }
- if (pWin->backgroundState == BackgroundPixmap) {
- dmxBECreatePixmap(pWin->background.pixmap);
- dmxBERestorePixmap(pWin->background.pixmap);
- }
-
- /* Reset the window attributes */
- dmxGetDefaultWindowAttributes(pWin,
- &pWinPriv->cmap,
- &pWinPriv->visual);
-
- /* Create the window */
- if (pWinPriv->mapped && !pWinPriv->offscreen)
- dmxCreateAndRealizeWindow(pWin, TRUE);
-
- /* Next, create the bottom-most child */
- if (pWin->lastChild) {
- pWin = pWin->lastChild;
- continue;
- }
-
- /* If the window has no children, move on to the next higher window */
- while (!pWin->prevSib && (pWin != pRoot))
- pWin = pWin->parent;
-
- if (pWin->prevSib) {
- pWin = pWin->prevSib;
- continue;
- }
-
- /* When we reach the root window, we are finished */
- if (pWin == pRoot)
- break;
+ pWinPriv = DMX_GET_WINDOW_PRIV(pWin);
+
+ /* Create the pixmaps regardless of whether or not the
+ * window is created or not due to lazy window creation.
+ */
+ if (!pWin->borderIsPixel) {
+ dmxBECreatePixmap(pWin->border.pixmap);
+ dmxBERestorePixmap(pWin->border.pixmap);
+ }
+ if (pWin->backgroundState == BackgroundPixmap) {
+ dmxBECreatePixmap(pWin->background.pixmap);
+ dmxBERestorePixmap(pWin->background.pixmap);
+ }
+
+ /* Reset the window attributes */
+ dmxGetDefaultWindowAttributes(pWin, &pWinPriv->cmap, &pWinPriv->visual);
+
+ /* Create the window */
+ if (pWinPriv->mapped && !pWinPriv->offscreen)
+ dmxCreateAndRealizeWindow(pWin, TRUE);
+
+ /* Next, create the bottom-most child */
+ if (pWin->lastChild) {
+ pWin = pWin->lastChild;
+ continue;
+ }
+
+ /* If the window has no children, move on to the next higher window */
+ while (!pWin->prevSib && (pWin != pRoot))
+ pWin = pWin->parent;
+
+ if (pWin->prevSib) {
+ pWin = pWin->prevSib;
+ continue;
+ }
+
+ /* When we reach the root window, we are finished */
+ if (pWin == pRoot)
+ break;
}
}
/* Refresh screen by generating exposure events for all windows */
-static void dmxForceExposures(int idx)
+static void
+dmxForceExposures(int idx)
{
- ScreenPtr pScreen = screenInfo.screens[idx];
- WindowPtr pRoot = pScreen->root;
- Bool anyMarked = FALSE;
- WindowPtr pChild;
+ ScreenPtr pScreen = screenInfo.screens[idx];
+ WindowPtr pRoot = pScreen->root;
+ Bool anyMarked = FALSE;
+ WindowPtr pChild;
for (pChild = pRoot->firstChild; pChild; pChild = pChild->nextSib)
- anyMarked |= pScreen->MarkOverlappedWindows(pChild, pChild,
- (WindowPtr *)NULL);
+ anyMarked |= pScreen->MarkOverlappedWindows(pChild, pChild,
+ (WindowPtr *) NULL);
if (anyMarked) {
- /* If any windows have been marked, set the root window's
- * clipList to be broken since it will be recalculated in
- * ValidateTree()
- */
- RegionBreak(&pRoot->clipList);
- pScreen->ValidateTree(pRoot, NULL, VTBroken);
- pScreen->HandleExposures(pRoot);
- if (pScreen->PostValidateTree)
- pScreen->PostValidateTree(pRoot, NULL, VTBroken);
+ /* If any windows have been marked, set the root window's
+ * clipList to be broken since it will be recalculated in
+ * ValidateTree()
+ */
+ RegionBreak(&pRoot->clipList);
+ pScreen->ValidateTree(pRoot, NULL, VTBroken);
+ pScreen->HandleExposures(pRoot);
+ if (pScreen->PostValidateTree)
+ pScreen->PostValidateTree(pRoot, NULL, VTBroken);
}
}
/** Compare the new and old screens to see if they are compatible. */
-static Bool dmxCompareScreens(DMXScreenInfo *new, DMXScreenInfo *old)
+static Bool
+dmxCompareScreens(DMXScreenInfo * new, DMXScreenInfo * old)
{
int i;
- if (new->beWidth != old->beWidth) return FALSE;
- if (new->beHeight != old->beHeight) return FALSE;
- if (new->beDepth != old->beDepth) return FALSE;
- if (new->beBPP != old->beBPP) return FALSE;
-
- if (new->beNumDepths != old->beNumDepths) return FALSE;
+ if (new->beWidth != old->beWidth)
+ return FALSE;
+ if (new->beHeight != old->beHeight)
+ return FALSE;
+ if (new->beDepth != old->beDepth)
+ return FALSE;
+ if (new->beBPP != old->beBPP)
+ return FALSE;
+
+ if (new->beNumDepths != old->beNumDepths)
+ return FALSE;
for (i = 0; i < old->beNumDepths; i++)
- if (new->beDepths[i] != old->beDepths[i]) return FALSE;
+ if (new->beDepths[i] != old->beDepths[i])
+ return FALSE;
- if (new->beNumPixmapFormats != old->beNumPixmapFormats) return FALSE;
+ if (new->beNumPixmapFormats != old->beNumPixmapFormats)
+ return FALSE;
for (i = 0; i < old->beNumPixmapFormats; i++) {
- if (new->bePixmapFormats[i].depth !=
- old->bePixmapFormats[i].depth) return FALSE;
- if (new->bePixmapFormats[i].bits_per_pixel !=
- old->bePixmapFormats[i].bits_per_pixel) return FALSE;
- if (new->bePixmapFormats[i].scanline_pad !=
- old->bePixmapFormats[i].scanline_pad) return FALSE;
+ if (new->bePixmapFormats[i].depth != old->bePixmapFormats[i].depth)
+ return FALSE;
+ if (new->bePixmapFormats[i].bits_per_pixel !=
+ old->bePixmapFormats[i].bits_per_pixel)
+ return FALSE;
+ if (new->bePixmapFormats[i].scanline_pad !=
+ old->bePixmapFormats[i].scanline_pad)
+ return FALSE;
}
- if (new->beNumVisuals != old->beNumVisuals) return FALSE;
+ if (new->beNumVisuals != old->beNumVisuals)
+ return FALSE;
for (i = 0; i < old->beNumVisuals; i++) {
- if (new->beVisuals[i].visualid !=
- old->beVisuals[i].visualid) return FALSE;
- if (new->beVisuals[i].screen !=
- old->beVisuals[i].screen) return FALSE;
- if (new->beVisuals[i].depth !=
- old->beVisuals[i].depth) return FALSE;
- if (new->beVisuals[i].class !=
- old->beVisuals[i].class) return FALSE;
- if (new->beVisuals[i].red_mask !=
- old->beVisuals[i].red_mask) return FALSE;
- if (new->beVisuals[i].green_mask !=
- old->beVisuals[i].green_mask) return FALSE;
- if (new->beVisuals[i].blue_mask !=
- old->beVisuals[i].blue_mask) return FALSE;
- if (new->beVisuals[i].colormap_size !=
- old->beVisuals[i].colormap_size) return FALSE;
- if (new->beVisuals[i].bits_per_rgb !=
- old->beVisuals[i].bits_per_rgb) return FALSE;
- }
-
- if (new->beDefVisualIndex != old->beDefVisualIndex) return FALSE;
+ if (new->beVisuals[i].visualid != old->beVisuals[i].visualid)
+ return FALSE;
+ if (new->beVisuals[i].screen != old->beVisuals[i].screen)
+ return FALSE;
+ if (new->beVisuals[i].depth != old->beVisuals[i].depth)
+ return FALSE;
+ if (new->beVisuals[i].class != old->beVisuals[i].class)
+ return FALSE;
+ if (new->beVisuals[i].red_mask != old->beVisuals[i].red_mask)
+ return FALSE;
+ if (new->beVisuals[i].green_mask != old->beVisuals[i].green_mask)
+ return FALSE;
+ if (new->beVisuals[i].blue_mask != old->beVisuals[i].blue_mask)
+ return FALSE;
+ if (new->beVisuals[i].colormap_size != old->beVisuals[i].colormap_size)
+ return FALSE;
+ if (new->beVisuals[i].bits_per_rgb != old->beVisuals[i].bits_per_rgb)
+ return FALSE;
+ }
+
+ if (new->beDefVisualIndex != old->beDefVisualIndex)
+ return FALSE;
return TRUE;
}
/** Restore Render's picture */
-static void dmxBERestoreRenderPict(pointer value, XID id, pointer n)
+static void
+dmxBERestoreRenderPict(pointer value, XID id, pointer n)
{
- PicturePtr pPicture = value; /* The picture */
- DrawablePtr pDraw = pPicture->pDrawable; /* The picture's drawable */
- int scrnNum = (uintptr_t)n;
+ PicturePtr pPicture = value; /* The picture */
+ DrawablePtr pDraw = pPicture->pDrawable; /* The picture's drawable */
+ int scrnNum = (uintptr_t) n;
if (pDraw->pScreen->myNum != scrnNum) {
- /* Picture not on the screen we are restoring*/
- return;
+ /* Picture not on the screen we are restoring */
+ return;
}
if (pDraw->type == DRAWABLE_PIXMAP) {
- PixmapPtr pPixmap = (PixmapPtr)pDraw;
-
- /* Create and restore the pixmap drawable */
- dmxBECreatePixmap(pPixmap);
- dmxBERestorePixmap(pPixmap);
+ PixmapPtr pPixmap = (PixmapPtr) pDraw;
+
+ /* Create and restore the pixmap drawable */
+ dmxBECreatePixmap(pPixmap);
+ dmxBERestorePixmap(pPixmap);
}
dmxBECreatePicture(pPicture);
}
/** Restore Render's glyphs */
-static void dmxBERestoreRenderGlyph(pointer value, XID id, pointer n)
+static void
+dmxBERestoreRenderGlyph(pointer value, XID id, pointer n)
{
- GlyphSetPtr glyphSet = value;
- int scrnNum = (uintptr_t)n;
- dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
- DMXScreenInfo *dmxScreen = &dmxScreens[scrnNum];
- GlyphRefPtr table;
- char *images;
- Glyph *gids;
- XGlyphInfo *glyphs;
- char *pos;
- int beret;
- int len_images = 0;
- int i;
- int ctr;
+ GlyphSetPtr glyphSet = value;
+ int scrnNum = (uintptr_t) n;
+ dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
+ DMXScreenInfo *dmxScreen = &dmxScreens[scrnNum];
+ GlyphRefPtr table;
+ char *images;
+ Glyph *gids;
+ XGlyphInfo *glyphs;
+ char *pos;
+ int beret;
+ int len_images = 0;
+ int i;
+ int ctr;
if (glyphPriv->glyphSets[scrnNum]) {
- /* Only restore glyphs on the screen we are attaching */
- return;
+ /* Only restore glyphs on the screen we are attaching */
+ return;
}
/* First we must create the glyph set on the backend. */
if ((beret = dmxBECreateGlyphSet(scrnNum, glyphSet)) != Success) {
- dmxLog(dmxWarning,
- "\tdmxBERestoreRenderGlyph failed to create glyphset!\n");
- return;
+ dmxLog(dmxWarning,
+ "\tdmxBERestoreRenderGlyph failed to create glyphset!\n");
+ return;
}
/* Now for the complex part, restore the glyph data */
@@ -1111,89 +1175,92 @@ static void dmxBERestoreRenderGlyph(pointer value, XID id, pointer n)
/* We need to know how much memory to allocate for this part */
for (i = 0; i < glyphSet->hash.hashSet->size; i++) {
- GlyphRefPtr gr = &table[i];
- GlyphPtr gl = gr->glyph;
+ GlyphRefPtr gr = &table[i];
+ GlyphPtr gl = gr->glyph;
- if (!gl || gl == DeletedGlyph) continue;
- len_images += gl->size - sizeof(gl->info);
+ if (!gl || gl == DeletedGlyph)
+ continue;
+ len_images += gl->size - sizeof(gl->info);
}
/* Now allocate the memory we need */
images = calloc(len_images, sizeof(char));
- gids = malloc(glyphSet->hash.tableEntries*sizeof(Glyph));
- glyphs = malloc(glyphSet->hash.tableEntries*sizeof(XGlyphInfo));
+ gids = malloc(glyphSet->hash.tableEntries * sizeof(Glyph));
+ glyphs = malloc(glyphSet->hash.tableEntries * sizeof(XGlyphInfo));
pos = images;
ctr = 0;
-
+
/* Fill the allocated memory with the proper data */
for (i = 0; i < glyphSet->hash.hashSet->size; i++) {
- GlyphRefPtr gr = &table[i];
- GlyphPtr gl = gr->glyph;
-
- if (!gl || gl == DeletedGlyph) continue;
-
- /* First lets put the data into gids */
- gids[ctr] = gr->signature;
-
- /* Next do the glyphs data structures */
- glyphs[ctr].width = gl->info.width;
- glyphs[ctr].height = gl->info.height;
- glyphs[ctr].x = gl->info.x;
- glyphs[ctr].y = gl->info.y;
- glyphs[ctr].xOff = gl->info.xOff;
- glyphs[ctr].yOff = gl->info.yOff;
-
- /* Copy the images from the DIX's data into the buffer */
- memcpy(pos, gl+1, gl->size - sizeof(gl->info));
- pos += gl->size - sizeof(gl->info);
- ctr++;
+ GlyphRefPtr gr = &table[i];
+ GlyphPtr gl = gr->glyph;
+
+ if (!gl || gl == DeletedGlyph)
+ continue;
+
+ /* First lets put the data into gids */
+ gids[ctr] = gr->signature;
+
+ /* Next do the glyphs data structures */
+ glyphs[ctr].width = gl->info.width;
+ glyphs[ctr].height = gl->info.height;
+ glyphs[ctr].x = gl->info.x;
+ glyphs[ctr].y = gl->info.y;
+ glyphs[ctr].xOff = gl->info.xOff;
+ glyphs[ctr].yOff = gl->info.yOff;
+
+ /* Copy the images from the DIX's data into the buffer */
+ memcpy(pos, gl + 1, gl->size - sizeof(gl->info));
+ pos += gl->size - sizeof(gl->info);
+ ctr++;
}
-
+
/* Now restore the glyph data */
XRenderAddGlyphs(dmxScreen->beDisplay, glyphPriv->glyphSets[scrnNum],
- gids,glyphs, glyphSet->hash.tableEntries, images,
- len_images);
+ gids, glyphs, glyphSet->hash.tableEntries, images,
+ len_images);
/* Clean up */
free(images);
free(gids);
- free(glyphs);
+ free(glyphs);
}
/** Reattach previously detached back-end screen. */
-int dmxAttachScreen(int idx, DMXScreenAttributesPtr attr)
+int
+dmxAttachScreen(int idx, DMXScreenAttributesPtr attr)
{
- ScreenPtr pScreen;
+ ScreenPtr pScreen;
DMXScreenInfo *dmxScreen;
- CARD32 scrnNum = idx;
- DMXScreenInfo oldDMXScreen;
- int i;
+ CARD32 scrnNum = idx;
+ DMXScreenInfo oldDMXScreen;
+ int i;
/* Return failure if dynamic addition/removal of screens is disabled */
if (!dmxAddRemoveScreens) {
- dmxLog(dmxWarning,
- "Attempting to add a screen, but the AddRemoveScreen\n");
- dmxLog(dmxWarning,
- "extension has not been enabled. To enable this extension\n");
- dmxLog(dmxWarning,
- "add the \"-addremovescreens\" option either to the command\n");
- dmxLog(dmxWarning,
- "line or in the configuration file.\n");
- return 1;
+ dmxLog(dmxWarning,
+ "Attempting to add a screen, but the AddRemoveScreen\n");
+ dmxLog(dmxWarning,
+ "extension has not been enabled. To enable this extension\n");
+ dmxLog(dmxWarning,
+ "add the \"-addremovescreens\" option either to the command\n");
+ dmxLog(dmxWarning, "line or in the configuration file.\n");
+ return 1;
}
/* Cannot add a screen that does not exist */
- if (idx < 0 || idx >= dmxNumScreens) return 1;
+ if (idx < 0 || idx >= dmxNumScreens)
+ return 1;
pScreen = screenInfo.screens[idx];
dmxScreen = &dmxScreens[idx];
/* Cannot attach to a screen that is already opened */
if (dmxScreen->beDisplay) {
- dmxLog(dmxWarning,
- "Attempting to add screen #%d but a screen already exists\n",
- idx);
- return 1;
+ dmxLog(dmxWarning,
+ "Attempting to add screen #%d but a screen already exists\n",
+ idx);
+ return 1;
}
dmxLogOutput(dmxScreen, "Attaching screen #%d\n", idx);
@@ -1206,13 +1273,12 @@ int dmxAttachScreen(int idx, DMXScreenAttributesPtr attr)
/* Open display and get all of the screen info */
if (!dmxOpenDisplay(dmxScreen)) {
- dmxLog(dmxWarning,
- "dmxOpenDisplay: Unable to open display %s\n",
- dmxScreen->name);
+ dmxLog(dmxWarning,
+ "dmxOpenDisplay: Unable to open display %s\n", dmxScreen->name);
- /* Restore the old screen */
- *dmxScreen = oldDMXScreen;
- return 1;
+ /* Restore the old screen */
+ *dmxScreen = oldDMXScreen;
+ return 1;
}
dmxSetErrorHandler(dmxScreen);
@@ -1220,13 +1286,13 @@ int dmxAttachScreen(int idx, DMXScreenAttributesPtr attr)
dmxGetScreenAttribs(dmxScreen);
if (!dmxGetVisualInfo(dmxScreen)) {
- dmxLog(dmxWarning, "dmxGetVisualInfo: No matching visuals found\n");
- XFree(dmxScreen->beVisuals);
- XCloseDisplay(dmxScreen->beDisplay);
+ dmxLog(dmxWarning, "dmxGetVisualInfo: No matching visuals found\n");
+ XFree(dmxScreen->beVisuals);
+ XCloseDisplay(dmxScreen->beDisplay);
- /* Restore the old screen */
- *dmxScreen = oldDMXScreen;
- return 1;
+ /* Restore the old screen */
+ *dmxScreen = oldDMXScreen;
+ return 1;
}
dmxGetColormaps(dmxScreen);
@@ -1235,23 +1301,20 @@ int dmxAttachScreen(int idx, DMXScreenAttributesPtr attr)
/* Verify that the screen to be added has the same info as the
* previously added screen. */
if (!dmxCompareScreens(dmxScreen, &oldDMXScreen)) {
- dmxLog(dmxWarning,
- "New screen data (%s) does not match previously\n",
- dmxScreen->name);
- dmxLog(dmxWarning,
- "attached screen data (%s)\n",
- oldDMXScreen.name);
- dmxLog(dmxWarning,
- "All data must match in order to attach to screen #%d\n",
- idx);
- XFree(dmxScreen->beVisuals);
- XFree(dmxScreen->beDepths);
- XFree(dmxScreen->bePixmapFormats);
- XCloseDisplay(dmxScreen->beDisplay);
-
- /* Restore the old screen */
- *dmxScreen = oldDMXScreen;
- return 1;
+ dmxLog(dmxWarning,
+ "New screen data (%s) does not match previously\n",
+ dmxScreen->name);
+ dmxLog(dmxWarning, "attached screen data (%s)\n", oldDMXScreen.name);
+ dmxLog(dmxWarning,
+ "All data must match in order to attach to screen #%d\n", idx);
+ XFree(dmxScreen->beVisuals);
+ XFree(dmxScreen->beDepths);
+ XFree(dmxScreen->bePixmapFormats);
+ XCloseDisplay(dmxScreen->beDisplay);
+
+ /* Restore the old screen */
+ *dmxScreen = oldDMXScreen;
+ return 1;
}
/* Initialize the BE screen resources */
@@ -1268,30 +1331,30 @@ int dmxAttachScreen(int idx, DMXScreenAttributesPtr attr)
dmxBECreateScratchGCs(idx);
/* Create the default font */
- (void)dmxBELoadFont(pScreen, defaultFont);
+ (void) dmxBELoadFont(pScreen, defaultFont);
/* Create all resources that don't depend on windows */
- for (i = currentMaxClients; --i >= 0; )
- if (clients[i])
- FindAllClientResources(clients[i], dmxBECreateResources,
- (pointer)(uintptr_t)idx);
+ for (i = currentMaxClients; --i >= 0;)
+ if (clients[i])
+ FindAllClientResources(clients[i], dmxBECreateResources,
+ (pointer) (uintptr_t) idx);
/* Create window hierarchy (top down) */
dmxBECreateWindowTree(idx);
/* Restore the picture state for RENDER */
- for (i = currentMaxClients; --i >= 0; )
- if (clients[i])
- FindClientResourcesByType(clients[i],PictureType,
- dmxBERestoreRenderPict,
- (pointer)(uintptr_t)idx);
+ for (i = currentMaxClients; --i >= 0;)
+ if (clients[i])
+ FindClientResourcesByType(clients[i], PictureType,
+ dmxBERestoreRenderPict,
+ (pointer) (uintptr_t) idx);
/* Restore the glyph state for RENDER */
- for (i = currentMaxClients; --i >= 0; )
- if (clients[i])
- FindClientResourcesByType(clients[i],GlyphSetType,
- dmxBERestoreRenderGlyph,
- (pointer)(uintptr_t)idx);
+ for (i = currentMaxClients; --i >= 0;)
+ if (clients[i])
+ FindClientResourcesByType(clients[i], GlyphSetType,
+ dmxBERestoreRenderGlyph,
+ (pointer) (uintptr_t) idx);
/* Refresh screen by generating exposure events for all windows */
dmxForceExposures(idx);
@@ -1308,10 +1371,10 @@ int dmxAttachScreen(int idx, DMXScreenAttributesPtr attr)
#ifdef PANORAMIX
if (!noPanoramiXExtension)
- return dmxConfigureScreenWindows(1, &scrnNum, attr, NULL);
+ return dmxConfigureScreenWindows(1, &scrnNum, attr, NULL);
else
#endif
- return 0; /* Success */
+ return 0; /* Success */
}
/*
@@ -1358,34 +1421,36 @@ int dmxAttachScreen(int idx, DMXScreenAttributesPtr attr)
#ifdef PANORAMIX
/** Search the Xinerama XRT_PIXMAP resources for the pixmap that needs
* to have its image saved. */
-static void dmxBEFindPixmapImage(pointer value, XID id, RESTYPE type,
- pointer p)
+static void
+dmxBEFindPixmapImage(pointer value, XID id, RESTYPE type, pointer p)
{
if ((type & TypeMask) == (XRT_PIXMAP & TypeMask)) {
- PixmapPtr pDst = (PixmapPtr)p;
- int idx = pDst->drawable.pScreen->myNum;
- PanoramiXRes *pXinPix = (PanoramiXRes *)value;
- PixmapPtr pPix;
- int i;
-
- dixLookupResourceByType((pointer*) &pPix, pXinPix->info[idx].id,
- RT_PIXMAP, NullClient, DixUnknownAccess);
- if (pPix != pDst) return; /* Not a match.... Next! */
-
- FOR_NSCREENS(i) {
- PixmapPtr pSrc;
- dmxPixPrivPtr pSrcPriv = NULL;
-
- if (i == idx) continue; /* Self replication is bad */
-
- dixLookupResourceByType((pointer*) &pSrc, pXinPix->info[i].id,
- RT_PIXMAP, NullClient, DixUnknownAccess);
- pSrcPriv = DMX_GET_PIXMAP_PRIV(pSrc);
- if (pSrcPriv->pixmap) {
- FoundPixImage = True;
- return;
- }
- }
+ PixmapPtr pDst = (PixmapPtr) p;
+ int idx = pDst->drawable.pScreen->myNum;
+ PanoramiXRes *pXinPix = (PanoramiXRes *) value;
+ PixmapPtr pPix;
+ int i;
+
+ dixLookupResourceByType((pointer *) &pPix, pXinPix->info[idx].id,
+ RT_PIXMAP, NullClient, DixUnknownAccess);
+ if (pPix != pDst)
+ return; /* Not a match.... Next! */
+
+ FOR_NSCREENS(i) {
+ PixmapPtr pSrc;
+ dmxPixPrivPtr pSrcPriv = NULL;
+
+ if (i == idx)
+ continue; /* Self replication is bad */
+
+ dixLookupResourceByType((pointer *) &pSrc, pXinPix->info[i].id,
+ RT_PIXMAP, NullClient, DixUnknownAccess);
+ pSrcPriv = DMX_GET_PIXMAP_PRIV(pSrc);
+ if (pSrcPriv->pixmap) {
+ FoundPixImage = True;
+ return;
+ }
+ }
}
}
#endif
@@ -1399,40 +1464,41 @@ static void dmxBEFindPixmapImage(pointer value, XID id, RESTYPE type,
* However, if we do not find one, then we need to save the image data.
* The common case for these are for the default stipple and root
* tile. */
-static void dmxBESavePixmap(PixmapPtr pPixmap)
+static void
+dmxBESavePixmap(PixmapPtr pPixmap)
{
#ifdef PANORAMIX
int i;
/* If Xinerama is not active, there's nothing we can do (see comment
* in #else below for more info). */
- if (noPanoramiXExtension) return;
+ if (noPanoramiXExtension)
+ return;
FoundPixImage = False;
- for (i = currentMaxClients; --i >= 0; )
- if (clients[i])
- FindAllClientResources(clients[i], dmxBEFindPixmapImage,
- (pointer)pPixmap);
+ for (i = currentMaxClients; --i >= 0;)
+ if (clients[i])
+ FindAllClientResources(clients[i], dmxBEFindPixmapImage,
+ (pointer) pPixmap);
/* Save the image only if there is no other screens that have a
* pixmap that corresponds to the one we are trying to save. */
if (!FoundPixImage) {
- dmxPixPrivPtr pPixPriv = DMX_GET_PIXMAP_PRIV(pPixmap);
-
- if (!pPixPriv->detachedImage) {
- ScreenPtr pScreen = pPixmap->drawable.pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
-
- pPixPriv->detachedImage = XGetImage(dmxScreen->beDisplay,
- pPixPriv->pixmap,
- 0, 0,
- pPixmap->drawable.width,
- pPixmap->drawable.height,
- -1,
- ZPixmap);
- if (!pPixPriv->detachedImage)
- dmxLog(dmxWarning, "Cannot save pixmap image\n");
- }
+ dmxPixPrivPtr pPixPriv = DMX_GET_PIXMAP_PRIV(pPixmap);
+
+ if (!pPixPriv->detachedImage) {
+ ScreenPtr pScreen = pPixmap->drawable.pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+
+ pPixPriv->detachedImage = XGetImage(dmxScreen->beDisplay,
+ pPixPriv->pixmap,
+ 0, 0,
+ pPixmap->drawable.width,
+ pPixmap->drawable.height,
+ -1, ZPixmap);
+ if (!pPixPriv->detachedImage)
+ dmxLog(dmxWarning, "Cannot save pixmap image\n");
+ }
}
#else
/* NOTE: The only time there is a pixmap on another screen that
@@ -1452,59 +1518,73 @@ static void dmxBESavePixmap(PixmapPtr pPixmap)
* function. It walks all resources, compares them to the screen
* number passed in as \a n and calls the appropriate DMX function to
* free the associated resource on the back-end server. */
-static void dmxBEDestroyResources(pointer value, XID id, RESTYPE type,
- pointer n)
+static void
+dmxBEDestroyResources(pointer value, XID id, RESTYPE type, pointer n)
{
- int scrnNum = (uintptr_t)n;
- ScreenPtr pScreen = screenInfo.screens[scrnNum];
+ int scrnNum = (uintptr_t) n;
+ ScreenPtr pScreen = screenInfo.screens[scrnNum];
if ((type & TypeMask) == (RT_WINDOW & TypeMask)) {
- /* Window resources are destroyed below in dmxBEDestroyWindowTree */
- } else if ((type & TypeMask) == (RT_PIXMAP & TypeMask)) {
- PixmapPtr pPix = value;
- if (pPix->drawable.pScreen->myNum == scrnNum) {
- dmxBESavePixmap(pPix);
- dmxBEFreePixmap(pPix);
- }
- } else if ((type & TypeMask) == (RT_GC & TypeMask)) {
- GCPtr pGC = value;
- if (pGC->pScreen->myNum == scrnNum)
- dmxBEFreeGC(pGC);
- } else if ((type & TypeMask) == (RT_FONT & TypeMask)) {
- dmxBEFreeFont(pScreen, (FontPtr)value);
- } else if ((type & TypeMask) == (RT_CURSOR & TypeMask)) {
- dmxBEFreeCursor(pScreen, (CursorPtr)value);
- } else if ((type & TypeMask) == (RT_COLORMAP & TypeMask)) {
- ColormapPtr pCmap = value;
- if (pCmap->pScreen->myNum == scrnNum)
- dmxBEFreeColormap((ColormapPtr)value);
- } else if ((type & TypeMask) == (PictureType & TypeMask)) {
- PicturePtr pPict = value;
- if (pPict->pDrawable->pScreen->myNum == scrnNum) {
- /* Free the pixmaps on the backend if needed */
- if (pPict->pDrawable->type == DRAWABLE_PIXMAP) {
- PixmapPtr pPixmap = (PixmapPtr)(pPict->pDrawable);
- dmxBESavePixmap(pPixmap);
- dmxBEFreePixmap(pPixmap);
- }
- dmxBEFreePicture((PicturePtr)value);
- }
- } else if ((type & TypeMask) == (GlyphSetType & TypeMask)) {
- dmxBEFreeGlyphSet(pScreen, (GlyphSetPtr)value);
- } else {
- /* Other resource types??? */
+ /* Window resources are destroyed below in dmxBEDestroyWindowTree */
+ }
+ else if ((type & TypeMask) == (RT_PIXMAP & TypeMask)) {
+ PixmapPtr pPix = value;
+
+ if (pPix->drawable.pScreen->myNum == scrnNum) {
+ dmxBESavePixmap(pPix);
+ dmxBEFreePixmap(pPix);
+ }
+ }
+ else if ((type & TypeMask) == (RT_GC & TypeMask)) {
+ GCPtr pGC = value;
+
+ if (pGC->pScreen->myNum == scrnNum)
+ dmxBEFreeGC(pGC);
+ }
+ else if ((type & TypeMask) == (RT_FONT & TypeMask)) {
+ dmxBEFreeFont(pScreen, (FontPtr) value);
+ }
+ else if ((type & TypeMask) == (RT_CURSOR & TypeMask)) {
+ dmxBEFreeCursor(pScreen, (CursorPtr) value);
+ }
+ else if ((type & TypeMask) == (RT_COLORMAP & TypeMask)) {
+ ColormapPtr pCmap = value;
+
+ if (pCmap->pScreen->myNum == scrnNum)
+ dmxBEFreeColormap((ColormapPtr) value);
+ }
+ else if ((type & TypeMask) == (PictureType & TypeMask)) {
+ PicturePtr pPict = value;
+
+ if (pPict->pDrawable->pScreen->myNum == scrnNum) {
+ /* Free the pixmaps on the backend if needed */
+ if (pPict->pDrawable->type == DRAWABLE_PIXMAP) {
+ PixmapPtr pPixmap = (PixmapPtr) (pPict->pDrawable);
+
+ dmxBESavePixmap(pPixmap);
+ dmxBEFreePixmap(pPixmap);
+ }
+ dmxBEFreePicture((PicturePtr) value);
+ }
+ }
+ else if ((type & TypeMask) == (GlyphSetType & TypeMask)) {
+ dmxBEFreeGlyphSet(pScreen, (GlyphSetPtr) value);
+ }
+ else {
+ /* Other resource types??? */
}
}
/** Destroy the scratch GCs that are created per depth. */
-static void dmxBEDestroyScratchGCs(int scrnNum)
+static void
+dmxBEDestroyScratchGCs(int scrnNum)
{
- ScreenPtr pScreen = screenInfo.screens[scrnNum];
- GCPtr *ppGC = pScreen->GCperDepth;
- int i;
+ ScreenPtr pScreen = screenInfo.screens[scrnNum];
+ GCPtr *ppGC = pScreen->GCperDepth;
+ int i;
for (i = 0; i <= pScreen->numDepths; i++)
- dmxBEFreeGC(ppGC[i]);
+ dmxBEFreeGC(ppGC[i]);
}
/** Destroy window hierachy on back-end server. To ensure that all
@@ -1512,79 +1592,81 @@ static void dmxBEDestroyScratchGCs(int scrnNum)
* up order so that windows are not destroyed before their children.
* XDestroyWindow(), which is called from #dmxBEDestroyWindow(), will
* destroy a window as well as all of it's children. */
-static void dmxBEDestroyWindowTree(int idx)
+static void
+dmxBEDestroyWindowTree(int idx)
{
- WindowPtr pWin = screenInfo.screens[idx]->root;
- WindowPtr pChild = pWin;
+ WindowPtr pWin = screenInfo.screens[idx]->root;
+ WindowPtr pChild = pWin;
while (1) {
- if (pChild->firstChild) {
- pChild = pChild->firstChild;
- continue;
- }
-
- /* Destroy the window */
- dmxBEDestroyWindow(pChild);
-
- /* Make sure we destroy the window's border and background
- * pixmaps if they exist */
- if (!pChild->borderIsPixel) {
- dmxBESavePixmap(pChild->border.pixmap);
- dmxBEFreePixmap(pChild->border.pixmap);
- }
- if (pChild->backgroundState == BackgroundPixmap) {
- dmxBESavePixmap(pChild->background.pixmap);
- dmxBEFreePixmap(pChild->background.pixmap);
- }
-
- while (!pChild->nextSib && (pChild != pWin)) {
- pChild = pChild->parent;
- dmxBEDestroyWindow(pChild);
- if (!pChild->borderIsPixel) {
- dmxBESavePixmap(pChild->border.pixmap);
- dmxBEFreePixmap(pChild->border.pixmap);
- }
- if (pChild->backgroundState == BackgroundPixmap) {
- dmxBESavePixmap(pChild->background.pixmap);
- dmxBEFreePixmap(pChild->background.pixmap);
- }
- }
-
- if (pChild == pWin)
- break;
-
- pChild = pChild->nextSib;
+ if (pChild->firstChild) {
+ pChild = pChild->firstChild;
+ continue;
+ }
+
+ /* Destroy the window */
+ dmxBEDestroyWindow(pChild);
+
+ /* Make sure we destroy the window's border and background
+ * pixmaps if they exist */
+ if (!pChild->borderIsPixel) {
+ dmxBESavePixmap(pChild->border.pixmap);
+ dmxBEFreePixmap(pChild->border.pixmap);
+ }
+ if (pChild->backgroundState == BackgroundPixmap) {
+ dmxBESavePixmap(pChild->background.pixmap);
+ dmxBEFreePixmap(pChild->background.pixmap);
+ }
+
+ while (!pChild->nextSib && (pChild != pWin)) {
+ pChild = pChild->parent;
+ dmxBEDestroyWindow(pChild);
+ if (!pChild->borderIsPixel) {
+ dmxBESavePixmap(pChild->border.pixmap);
+ dmxBEFreePixmap(pChild->border.pixmap);
+ }
+ if (pChild->backgroundState == BackgroundPixmap) {
+ dmxBESavePixmap(pChild->background.pixmap);
+ dmxBEFreePixmap(pChild->background.pixmap);
+ }
+ }
+
+ if (pChild == pWin)
+ break;
+
+ pChild = pChild->nextSib;
}
}
/** Detach back-end screen. */
-int dmxDetachScreen(int idx)
+int
+dmxDetachScreen(int idx)
{
DMXScreenInfo *dmxScreen = &dmxScreens[idx];
- int i;
+ int i;
/* Return failure if dynamic addition/removal of screens is disabled */
if (!dmxAddRemoveScreens) {
- dmxLog(dmxWarning,
- "Attempting to remove a screen, but the AddRemoveScreen\n");
- dmxLog(dmxWarning,
- "extension has not been enabled. To enable this extension\n");
- dmxLog(dmxWarning,
- "add the \"-addremovescreens\" option either to the command\n");
- dmxLog(dmxWarning,
- "line or in the configuration file.\n");
- return 1;
+ dmxLog(dmxWarning,
+ "Attempting to remove a screen, but the AddRemoveScreen\n");
+ dmxLog(dmxWarning,
+ "extension has not been enabled. To enable this extension\n");
+ dmxLog(dmxWarning,
+ "add the \"-addremovescreens\" option either to the command\n");
+ dmxLog(dmxWarning, "line or in the configuration file.\n");
+ return 1;
}
/* Cannot remove a screen that does not exist */
- if (idx < 0 || idx >= dmxNumScreens) return 1;
+ if (idx < 0 || idx >= dmxNumScreens)
+ return 1;
/* Cannot detach from a screen that is not opened */
if (!dmxScreen->beDisplay) {
- dmxLog(dmxWarning,
- "Attempting to remove screen #%d but it has not been opened\n",
- idx);
- return 1;
+ dmxLog(dmxWarning,
+ "Attempting to remove screen #%d but it has not been opened\n",
+ idx);
+ return 1;
}
dmxLogOutput(dmxScreen, "Detaching screen #%d\n", idx);
@@ -1595,10 +1677,10 @@ int dmxDetachScreen(int idx)
/* Save all relevant state (TODO) */
/* Free all non-window resources related to this screen */
- for (i = currentMaxClients; --i >= 0; )
- if (clients[i])
- FindAllClientResources(clients[i], dmxBEDestroyResources,
- (pointer)(uintptr_t)idx);
+ for (i = currentMaxClients; --i >= 0;)
+ if (clients[i])
+ FindAllClientResources(clients[i], dmxBEDestroyResources,
+ (pointer) (uintptr_t) idx);
/* Free scratch GCs */
dmxBEDestroyScratchGCs(idx);
@@ -1616,5 +1698,5 @@ int dmxDetachScreen(int idx)
/* Adjust the cursor boundaries (paints detached console window) */
dmxAdjustCursorBoundaries();
- return 0; /* Success */
+ return 0; /* Success */
}
diff --git a/hw/dmx/dmxextension.h b/hw/dmx/dmxextension.h
index 5a6fd0e9f..036417b8d 100644
--- a/hw/dmx/dmxextension.h
+++ b/hw/dmx/dmxextension.h
@@ -42,77 +42,74 @@
/** Screen attributes. Used by #ProcDMXGetScreenAttributes and
* \a ProcDMXChangeScreensAttributes. */
typedef struct {
- const char *displayName;
- int logicalScreen;
+ const char *displayName;
+ int logicalScreen;
- unsigned int screenWindowWidth; /* displayName's coordinate system */
- unsigned int screenWindowHeight; /* displayName's coordinate system */
- int screenWindowXoffset; /* displayName's coordinate system */
- int screenWindowYoffset; /* displayName's coordinate system */
+ unsigned int screenWindowWidth; /* displayName's coordinate system */
+ unsigned int screenWindowHeight; /* displayName's coordinate system */
+ int screenWindowXoffset; /* displayName's coordinate system */
+ int screenWindowYoffset; /* displayName's coordinate system */
- unsigned int rootWindowWidth; /* screenWindow's coordinate system */
- unsigned int rootWindowHeight; /* screenWindow's coordinate system */
- int rootWindowXoffset; /* screenWindow's coordinate system */
- int rootWindowYoffset; /* screenWindow's coordinate system */
+ unsigned int rootWindowWidth; /* screenWindow's coordinate system */
+ unsigned int rootWindowHeight; /* screenWindow's coordinate system */
+ int rootWindowXoffset; /* screenWindow's coordinate system */
+ int rootWindowYoffset; /* screenWindow's coordinate system */
- int rootWindowXorigin; /* global coordinate system */
- int rootWindowYorigin; /* global coordinate system */
+ int rootWindowXorigin; /* global coordinate system */
+ int rootWindowYorigin; /* global coordinate system */
} DMXScreenAttributesRec, *DMXScreenAttributesPtr;
/** Window attributes. Used by #ProcDMXGetWindowAttributes. */
typedef struct {
- int screen;
- Window window;
- xRectangle pos;
- xRectangle vis;
+ int screen;
+ Window window;
+ xRectangle pos;
+ xRectangle vis;
} DMXWindowAttributesRec, *DMXWindowAttributesPtr;
/** Desktop attributes. Used by #ProcDMXGetDesktopAttributes and
* #ProcDMXChangeDesktopAttributes. */
typedef struct {
- int width;
- int height;
- int shiftX;
- int shiftY;
+ int width;
+ int height;
+ int shiftX;
+ int shiftY;
} DMXDesktopAttributesRec, *DMXDesktopAttributesPtr;
/** Input attributes. Used by #ProcDMXGetInputAttributes. */
typedef struct {
- const char *name;
- int inputType;
- int physicalScreen;
- int physicalId;
- int isCore;
- int sendsCore;
- int detached;
+ const char *name;
+ int inputType;
+ int physicalScreen;
+ int physicalId;
+ int isCore;
+ int sendsCore;
+ int detached;
} DMXInputAttributesRec, *DMXInputAttributesPtr;
-
extern unsigned long dmxGetNumScreens(void);
-extern void dmxForceWindowCreation(WindowPtr pWindow);
-extern void dmxFlushPendingSyncs(void);
-extern Bool dmxGetScreenAttributes(int physical,
- DMXScreenAttributesPtr attr);
-extern Bool dmxGetWindowAttributes(WindowPtr pWindow,
- DMXWindowAttributesPtr attr);
-extern void dmxGetDesktopAttributes(DMXDesktopAttributesPtr attr);
-extern int dmxGetInputCount(void);
-extern int dmxGetInputAttributes(int deviceId,
- DMXInputAttributesPtr attr);
-extern int dmxAddInput(DMXInputAttributesPtr attr, int *deviceId);
-extern int dmxRemoveInput(int deviceId);
-
-extern int dmxConfigureScreenWindows(int nscreens,
- CARD32 *screens,
- DMXScreenAttributesPtr attribs,
- int *errorScreen);
-
-extern int dmxConfigureDesktop(DMXDesktopAttributesPtr attribs);
+extern void dmxForceWindowCreation(WindowPtr pWindow);
+extern void dmxFlushPendingSyncs(void);
+extern Bool dmxGetScreenAttributes(int physical, DMXScreenAttributesPtr attr);
+extern Bool dmxGetWindowAttributes(WindowPtr pWindow,
+ DMXWindowAttributesPtr attr);
+extern void dmxGetDesktopAttributes(DMXDesktopAttributesPtr attr);
+extern int dmxGetInputCount(void);
+extern int dmxGetInputAttributes(int deviceId, DMXInputAttributesPtr attr);
+extern int dmxAddInput(DMXInputAttributesPtr attr, int *deviceId);
+extern int dmxRemoveInput(int deviceId);
+
+extern int dmxConfigureScreenWindows(int nscreens,
+ CARD32 *screens,
+ DMXScreenAttributesPtr attribs,
+ int *errorScreen);
+
+extern int dmxConfigureDesktop(DMXDesktopAttributesPtr attribs);
/* dmxUpdateScreenResources exposed for dmxCreateWindow in dmxwindow.c */
-extern void dmxUpdateScreenResources(ScreenPtr pScreen,
- int x, int y, int w, int h);
+extern void dmxUpdateScreenResources(ScreenPtr pScreen,
+ int x, int y, int w, int h);
-extern int dmxAttachScreen(int idx, DMXScreenAttributesPtr attr);
-extern int dmxDetachScreen(int idx);
+extern int dmxAttachScreen(int idx, DMXScreenAttributesPtr attr);
+extern int dmxDetachScreen(int idx);
#endif
diff --git a/hw/dmx/dmxfont.c b/hw/dmx/dmxfont.c
index 34161f214..7ef7ad971 100644
--- a/hw/dmx/dmxfont.c
+++ b/hw/dmx/dmxfont.c
@@ -49,36 +49,38 @@
#include "dixfont.h"
#include "dixstruct.h"
-static int (*dmxSaveProcVector[256])(ClientPtr);
-static int dmxFontLastError;
+static int (*dmxSaveProcVector[256]) (ClientPtr);
+static int dmxFontLastError;
-static int dmxFontErrorHandler(Display *dpy, XErrorEvent *ev)
+static int
+dmxFontErrorHandler(Display * dpy, XErrorEvent * ev)
{
dmxFontLastError = ev->error_code;
return 0;
}
-static char **dmxGetFontPath(int *npaths)
+static char **
+dmxGetFontPath(int *npaths)
{
- char **fp;
- unsigned char *c, *paths;
- char *newfp;
- int len, l, i;
+ char **fp;
+ unsigned char *c, *paths;
+ char *newfp;
+ int len, l, i;
GetFontPath(serverClient, npaths, &len, &paths);
newfp = malloc(*npaths + len);
- c = (unsigned char *)newfp;
+ c = (unsigned char *) newfp;
fp = malloc(*npaths * sizeof(*fp));
- memmove(newfp, paths+1, *npaths + len - 1);
+ memmove(newfp, paths + 1, *npaths + len - 1);
l = *paths;
for (i = 0; i < *npaths; i++) {
- fp[i] = (char *)c;
- c += l;
- l = *c;
- *c++ = '\0';
+ fp[i] = (char *) c;
+ c += l;
+ l = *c;
+ *c++ = '\0';
}
#if DMX_FONTPATH_DEBUG
@@ -89,18 +91,20 @@ static char **dmxGetFontPath(int *npaths)
return fp;
}
-static void dmxFreeFontPath(char **fp)
+static void
+dmxFreeFontPath(char **fp)
{
free(fp[0]);
free(fp);
}
-static Bool dmxCheckFontPathElement(DMXScreenInfo *dmxScreen, char *fp)
+static Bool
+dmxCheckFontPathElement(DMXScreenInfo * dmxScreen, char *fp)
{
- int (*oldErrorHandler)(Display *, XErrorEvent *);
+ int (*oldErrorHandler) (Display *, XErrorEvent *);
if (!dmxScreen->beDisplay)
- return TRUE;
+ return TRUE;
dmxFontLastError = 0;
oldErrorHandler = XSetErrorHandler(dmxFontErrorHandler);
@@ -111,18 +115,20 @@ static Bool dmxCheckFontPathElement(DMXScreenInfo *dmxScreen, char *fp)
return dmxFontLastError == 0;
}
-static int dmxSetFontPath(DMXScreenInfo *dmxScreen)
+static int
+dmxSetFontPath(DMXScreenInfo * dmxScreen)
{
- int (*oldErrorHandler)(Display *, XErrorEvent *);
+ int (*oldErrorHandler) (Display *, XErrorEvent *);
char **fp;
- int result = Success;
- int npaths;
+ int result = Success;
+ int npaths;
if (!dmxScreen->beDisplay)
- return result;
+ return result;
fp = dmxGetFontPath(&npaths);
- if (!fp) return BadAlloc;
+ if (!fp)
+ return BadAlloc;
dmxFontLastError = 0;
oldErrorHandler = XSetErrorHandler(dmxFontErrorHandler);
@@ -131,12 +137,12 @@ static int dmxSetFontPath(DMXScreenInfo *dmxScreen)
XSetErrorHandler(oldErrorHandler);
if (dmxFontLastError) {
- result = dmxFontLastError;
- /* We could set *error here to the offending path, but it is
- * ignored, so we don't bother figuring out which path is bad.
- * If we do add this support in the future, we'll need to add
- * error to the function's argument list.
- */
+ result = dmxFontLastError;
+ /* We could set *error here to the offending path, but it is
+ * ignored, so we don't bother figuring out which path is bad.
+ * If we do add this support in the future, we'll need to add
+ * error to the function's argument list.
+ */
}
dmxFreeFontPath(fp);
@@ -144,14 +150,15 @@ static int dmxSetFontPath(DMXScreenInfo *dmxScreen)
return result;
}
-static int dmxCheckFontPath(DMXScreenInfo *dmxScreen, int *error)
+static int
+dmxCheckFontPath(DMXScreenInfo * dmxScreen, int *error)
{
char **oldFontPath;
- int nOldPaths;
- int result = Success;
+ int nOldPaths;
+ int result = Success;
if (!dmxScreen->beDisplay)
- return result;
+ return result;
/* Save old font path */
oldFontPath = XGetFontPath(dmxScreen->beDisplay, &nOldPaths);
@@ -166,29 +173,31 @@ static int dmxCheckFontPath(DMXScreenInfo *dmxScreen, int *error)
return result;
}
-static int dmxProcSetFontPath(ClientPtr client)
+static int
+dmxProcSetFontPath(ClientPtr client)
{
unsigned char *ptr;
- unsigned long nbytes, total, n;
- long nfonts;
- int i, result;
+ unsigned long nbytes, total, n;
+ long nfonts;
+ int i, result;
unsigned char *oldFontPath, *tmpFontPath;
- int nOldPaths;
- int lenOldPaths;
+ int nOldPaths;
+ int lenOldPaths;
+
REQUEST(xSetFontPathReq);
-
+
REQUEST_AT_LEAST_SIZE(xSetFontPathReq);
-
+
nbytes = (client->req_len << 2) - sizeof(xSetFontPathReq);
total = nbytes;
- ptr = (unsigned char *)&stuff[1];
+ ptr = (unsigned char *) &stuff[1];
nfonts = stuff->nFonts;
while (--nfonts >= 0) {
- if ((total == 0) || (total < (n = (*ptr + 1))))
- return BadLength;
- total -= n;
- ptr += n;
+ if ((total == 0) || (total < (n = (*ptr + 1))))
+ return BadLength;
+ total -= n;
+ ptr += n;
}
if (total >= 4)
return BadLength;
@@ -197,18 +206,19 @@ static int dmxProcSetFontPath(ClientPtr client)
oldFontPath = malloc(nOldPaths + lenOldPaths);
memmove(oldFontPath, tmpFontPath, nOldPaths + lenOldPaths);
- result = SetFontPath(client, stuff->nFonts, (unsigned char *)&stuff[1]);
+ result = SetFontPath(client, stuff->nFonts, (unsigned char *) &stuff[1]);
if (!result) {
- int error = 0;
- for (i = 0; i < dmxNumScreens; i++)
- if ((result = dmxCheckFontPath(&dmxScreens[i], &error)))
- break;
-
- if (result) {
- /* Restore old fontpath in the DMX server */
- SetFontPath(client, nOldPaths, oldFontPath);
- client->errorValue = error;
- }
+ int error = 0;
+
+ for (i = 0; i < dmxNumScreens; i++)
+ if ((result = dmxCheckFontPath(&dmxScreens[i], &error)))
+ break;
+
+ if (result) {
+ /* Restore old fontpath in the DMX server */
+ SetFontPath(client, nOldPaths, oldFontPath);
+ client->errorValue = error;
+ }
}
free(oldFontPath);
@@ -219,47 +229,50 @@ static int dmxProcSetFontPath(ClientPtr client)
* pointers, DMX also hooks in at the ProcVector[] level. Here the old
* ProcVector function pointers are saved and the new ProcVector
* function pointers are initialized. */
-void dmxInitFonts(void)
+void
+dmxInitFonts(void)
{
- int i;
+ int i;
for (i = 0; i < 256; i++)
- dmxSaveProcVector[i] = ProcVector[i];
+ dmxSaveProcVector[i] = ProcVector[i];
ProcVector[X_SetFontPath] = dmxProcSetFontPath;
}
/** Reset font support by restoring the original ProcVector function
* pointers. */
-void dmxResetFonts(void)
+void
+dmxResetFonts(void)
{
- int i;
+ int i;
for (i = 0; i < 256; i++)
- ProcVector[i] = dmxSaveProcVector[i];
+ ProcVector[i] = dmxSaveProcVector[i];
}
/** Load the font, \a pFont, on the back-end server associated with \a
* pScreen. When a font is loaded, the font path on back-end server is
* first initialized to that specified on the command line with the
* -fontpath options, and then the font is loaded. */
-Bool dmxBELoadFont(ScreenPtr pScreen, FontPtr pFont)
+Bool
+dmxBELoadFont(ScreenPtr pScreen, FontPtr pFont)
{
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxFontPrivPtr pFontPriv = FontGetPrivate(pFont, dmxFontPrivateIndex);
- const char *name;
- char **oldFontPath = NULL;
- int nOldPaths;
- Atom name_atom, value_atom;
- int i;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ dmxFontPrivPtr pFontPriv = FontGetPrivate(pFont, dmxFontPrivateIndex);
+ const char *name;
+ char **oldFontPath = NULL;
+ int nOldPaths;
+ Atom name_atom, value_atom;
+ int i;
/* Make sure we have a font private struct to work with */
if (!pFontPriv)
- return FALSE;
+ return FALSE;
/* Don't load a font over top of itself */
if (pFontPriv->font[pScreen->myNum]) {
- return TRUE; /* Already loaded font */
+ return TRUE; /* Already loaded font */
}
/* Save old font path */
@@ -267,132 +280,131 @@ Bool dmxBELoadFont(ScreenPtr pScreen, FontPtr pFont)
/* Set the font path for the font about to be loaded on the back-end */
if (dmxSetFontPath(dmxScreen)) {
- char **fp;
- int npaths;
- Bool *goodfps;
-
- /* This could fail only when first starting the X server and
- * loading the default font. If it fails here, then the default
- * font path is invalid, no default font path will be set, the
- * DMX server will fail to load the default font, and it will
- * exit with an error unless we remove the offending font paths
- * with the -ignorebadfontpaths command line option.
- */
-
- fp = dmxGetFontPath(&npaths);
- if (!fp) {
- dmxLog(dmxError,
- "No default font path set.\n");
- dmxLog(dmxError,
- "Please see the Xdmx man page for information on how to\n");
- dmxLog(dmxError,
- "initialize the DMX server's default font path.\n");
- XFreeFontPath(oldFontPath);
- return FALSE;
- }
-
- if (!dmxFontPath)
- dmxLog(dmxWarning, "No default font path is set.\n");
-
- goodfps = malloc(npaths * sizeof(*goodfps));
-
- dmxLog(dmxError,
- "The DMX server failed to set the following font paths on "
- "screen #%d:\n", pScreen->myNum);
-
- for (i = 0; i < npaths; i++)
- if (!(goodfps[i] = dmxCheckFontPathElement(dmxScreen, fp[i])))
- dmxLog(dmxError, " %s\n", fp[i]);
-
- if (dmxIgnoreBadFontPaths) {
- char *newfp;
- int newnpaths = 0;
- int len = 0;
- int j = 0;
-
- dmxLog(dmxError,
- "These font paths will not be used because the "
- "\"-ignorebadfontpaths\"\n");
- dmxLog(dmxError,
- "option is set.\n");
-
- for (i = 0; i < npaths; i++)
- if (goodfps[i]) {
- len += strlen(fp[i]) + 1;
- newnpaths++;
- }
-
- if (!newnpaths) {
- /* No valid font paths were found */
- dmxLog(dmxError,
- "After removing the font paths above, no valid font "
- "paths were\n");
- dmxLog(dmxError,
- "available. Please check that the font paths set on "
- "the command\n");
- dmxLog(dmxError,
- "line or in the configuration file via the "
- "\"-fontpath\" option\n");
- dmxLog(dmxError,
- "are valid on all back-end servers. See the Xdmx man "
- "page for\n");
- dmxLog(dmxError,
- "more information on font paths.\n");
- dmxFreeFontPath(fp);
- XFreeFontPath(oldFontPath);
- free(goodfps);
- return FALSE;
- }
-
- newfp = malloc(len * sizeof(*newfp));
- for (i = 0; i < npaths; i++) {
- if (goodfps[i]) {
- int n = strlen(fp[i]);
- newfp[j++] = n;
- strncpy(&newfp[j], fp[i], n);
- j += n;
- }
- }
-
- if (SetFontPath(serverClient, newnpaths, (unsigned char *)newfp)) {
- /* Note that this should never happen since all of the
- * FPEs were previously valid. */
- dmxLog(dmxError, "Cannot reset the default font path.\n");
- }
- } else if (dmxFontPath) {
- dmxLog(dmxError,
- "Please remove these font paths from the command line "
- "or\n");
- dmxLog(dmxError,
- "configuration file, or set the \"-ignorebadfontpaths\" "
- "option to\n");
- dmxLog(dmxError,
- "ignore them. For more information on these options, see "
- "the\n");
- dmxLog(dmxError,
- "Xdmx man page.\n");
- } else {
- dmxLog(dmxError,
- "Please specify the font paths that are available on all "
- "back-end\n");
- dmxLog(dmxError,
- "servers with the \"-fontpath\" option, or use the "
+ char **fp;
+ int npaths;
+ Bool *goodfps;
+
+ /* This could fail only when first starting the X server and
+ * loading the default font. If it fails here, then the default
+ * font path is invalid, no default font path will be set, the
+ * DMX server will fail to load the default font, and it will
+ * exit with an error unless we remove the offending font paths
+ * with the -ignorebadfontpaths command line option.
+ */
+
+ fp = dmxGetFontPath(&npaths);
+ if (!fp) {
+ dmxLog(dmxError, "No default font path set.\n");
+ dmxLog(dmxError,
+ "Please see the Xdmx man page for information on how to\n");
+ dmxLog(dmxError,
+ "initialize the DMX server's default font path.\n");
+ XFreeFontPath(oldFontPath);
+ return FALSE;
+ }
+
+ if (!dmxFontPath)
+ dmxLog(dmxWarning, "No default font path is set.\n");
+
+ goodfps = malloc(npaths * sizeof(*goodfps));
+
+ dmxLog(dmxError,
+ "The DMX server failed to set the following font paths on "
+ "screen #%d:\n", pScreen->myNum);
+
+ for (i = 0; i < npaths; i++)
+ if (!(goodfps[i] = dmxCheckFontPathElement(dmxScreen, fp[i])))
+ dmxLog(dmxError, " %s\n", fp[i]);
+
+ if (dmxIgnoreBadFontPaths) {
+ char *newfp;
+ int newnpaths = 0;
+ int len = 0;
+ int j = 0;
+
+ dmxLog(dmxError,
+ "These font paths will not be used because the "
+ "\"-ignorebadfontpaths\"\n");
+ dmxLog(dmxError, "option is set.\n");
+
+ for (i = 0; i < npaths; i++)
+ if (goodfps[i]) {
+ len += strlen(fp[i]) + 1;
+ newnpaths++;
+ }
+
+ if (!newnpaths) {
+ /* No valid font paths were found */
+ dmxLog(dmxError,
+ "After removing the font paths above, no valid font "
+ "paths were\n");
+ dmxLog(dmxError,
+ "available. Please check that the font paths set on "
+ "the command\n");
+ dmxLog(dmxError,
+ "line or in the configuration file via the "
+ "\"-fontpath\" option\n");
+ dmxLog(dmxError,
+ "are valid on all back-end servers. See the Xdmx man "
+ "page for\n");
+ dmxLog(dmxError, "more information on font paths.\n");
+ dmxFreeFontPath(fp);
+ XFreeFontPath(oldFontPath);
+ free(goodfps);
+ return FALSE;
+ }
+
+ newfp = malloc(len * sizeof(*newfp));
+ for (i = 0; i < npaths; i++) {
+ if (goodfps[i]) {
+ int n = strlen(fp[i]);
+
+ newfp[j++] = n;
+ strncpy(&newfp[j], fp[i], n);
+ j += n;
+ }
+ }
+
+ if (SetFontPath(serverClient, newnpaths, (unsigned char *) newfp)) {
+ /* Note that this should never happen since all of the
+ * FPEs were previously valid. */
+ dmxLog(dmxError, "Cannot reset the default font path.\n");
+ }
+ }
+ else if (dmxFontPath) {
+ dmxLog(dmxError,
+ "Please remove these font paths from the command line "
+ "or\n");
+ dmxLog(dmxError,
+ "configuration file, or set the \"-ignorebadfontpaths\" "
+ "option to\n");
+ dmxLog(dmxError,
+ "ignore them. For more information on these options, see "
+ "the\n");
+ dmxLog(dmxError, "Xdmx man page.\n");
+ }
+ else {
+ dmxLog(dmxError,
+ "Please specify the font paths that are available on all "
+ "back-end\n");
+ dmxLog(dmxError,
+ "servers with the \"-fontpath\" option, or use the "
"\"-ignorebadfontpaths\"\n");
dmxLog(dmxError,
"to ignore bad defaults. For more information on "
"these and other\n");
- dmxLog(dmxError,
- "font-path-related options, see the Xdmx man page.\n");
- }
-
- if (!dmxIgnoreBadFontPaths ||
- (dmxIgnoreBadFontPaths && dmxSetFontPath(dmxScreen))) {
- /* We still have errors so return with error */
- dmxFreeFontPath(fp);
- XFreeFontPath(oldFontPath);
- free(goodfps);
- return FALSE;
- }
+ dmxLog(dmxError,
+ "font-path-related options, see the Xdmx man page.\n");
+ }
+
+ if (!dmxIgnoreBadFontPaths ||
+ (dmxIgnoreBadFontPaths && dmxSetFontPath(dmxScreen))) {
+ /* We still have errors so return with error */
+ dmxFreeFontPath(fp);
+ XFreeFontPath(oldFontPath);
+ free(goodfps);
+ return FALSE;
+ }
}
/* Find requested font on back-end server */
@@ -400,73 +412,80 @@ Bool dmxBELoadFont(ScreenPtr pScreen, FontPtr pFont)
value_atom = 0L;
for (i = 0; i < pFont->info.nprops; i++) {
- if ((Atom)pFont->info.props[i].name == name_atom) {
- value_atom = pFont->info.props[i].value;
- break;
- }
+ if ((Atom) pFont->info.props[i].name == name_atom) {
+ value_atom = pFont->info.props[i].value;
+ break;
+ }
}
- if (!value_atom) return FALSE;
+ if (!value_atom)
+ return FALSE;
name = NameForAtom(value_atom);
- if (!name) return FALSE;
+ if (!name)
+ return FALSE;
- pFontPriv->font[pScreen->myNum] =
- XLoadQueryFont(dmxScreen->beDisplay, name);
+ pFontPriv->font[pScreen->myNum] =
+ XLoadQueryFont(dmxScreen->beDisplay, name);
/* Restore old font path */
XSetFontPath(dmxScreen->beDisplay, oldFontPath, nOldPaths);
XFreeFontPath(oldFontPath);
dmxSync(dmxScreen, FALSE);
- if (!pFontPriv->font[pScreen->myNum]) return FALSE;
+ if (!pFontPriv->font[pScreen->myNum])
+ return FALSE;
return TRUE;
}
/** Realize the font, \a pFont, on the back-end server associated with
* \a pScreen. */
-Bool dmxRealizeFont(ScreenPtr pScreen, FontPtr pFont)
+Bool
+dmxRealizeFont(ScreenPtr pScreen, FontPtr pFont)
{
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxFontPrivPtr pFontPriv;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ dmxFontPrivPtr pFontPriv;
if (!(pFontPriv = FontGetPrivate(pFont, dmxFontPrivateIndex))) {
- FontSetPrivate(pFont, dmxFontPrivateIndex, NULL);
- pFontPriv = malloc(sizeof(dmxFontPrivRec));
- if (!pFontPriv) return FALSE;
+ FontSetPrivate(pFont, dmxFontPrivateIndex, NULL);
+ pFontPriv = malloc(sizeof(dmxFontPrivRec));
+ if (!pFontPriv)
+ return FALSE;
pFontPriv->font = NULL;
MAXSCREENSALLOC(pFontPriv->font);
if (!pFontPriv->font) {
free(pFontPriv);
return FALSE;
}
- pFontPriv->refcnt = 0;
+ pFontPriv->refcnt = 0;
}
- FontSetPrivate(pFont, dmxFontPrivateIndex, (pointer)pFontPriv);
+ FontSetPrivate(pFont, dmxFontPrivateIndex, (pointer) pFontPriv);
if (dmxScreen->beDisplay) {
- if (!dmxBELoadFont(pScreen, pFont))
- return FALSE;
+ if (!dmxBELoadFont(pScreen, pFont))
+ return FALSE;
- pFontPriv->refcnt++;
- } else {
- pFontPriv->font[pScreen->myNum] = NULL;
+ pFontPriv->refcnt++;
+ }
+ else {
+ pFontPriv->font[pScreen->myNum] = NULL;
}
return TRUE;
}
/** Free \a pFont on the back-end associated with \a pScreen. */
-Bool dmxBEFreeFont(ScreenPtr pScreen, FontPtr pFont)
+Bool
+dmxBEFreeFont(ScreenPtr pScreen, FontPtr pFont)
{
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxFontPrivPtr pFontPriv = FontGetPrivate(pFont, dmxFontPrivateIndex);
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ dmxFontPrivPtr pFontPriv = FontGetPrivate(pFont, dmxFontPrivateIndex);
if (pFontPriv && pFontPriv->font[pScreen->myNum]) {
- XFreeFont(dmxScreen->beDisplay, pFontPriv->font[pScreen->myNum]);
- pFontPriv->font[pScreen->myNum] = NULL;
- return TRUE;
+ XFreeFont(dmxScreen->beDisplay, pFontPriv->font[pScreen->myNum]);
+ pFontPriv->font[pScreen->myNum] = NULL;
+ return TRUE;
}
return FALSE;
@@ -474,77 +493,79 @@ Bool dmxBEFreeFont(ScreenPtr pScreen, FontPtr pFont)
/** Unrealize the font, \a pFont, on the back-end server associated with
* \a pScreen. */
-Bool dmxUnrealizeFont(ScreenPtr pScreen, FontPtr pFont)
+Bool
+dmxUnrealizeFont(ScreenPtr pScreen, FontPtr pFont)
{
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxFontPrivPtr pFontPriv;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ dmxFontPrivPtr pFontPriv;
if ((pFontPriv = FontGetPrivate(pFont, dmxFontPrivateIndex))) {
- /* In case the font failed to load properly */
- if (!pFontPriv->refcnt) {
+ /* In case the font failed to load properly */
+ if (!pFontPriv->refcnt) {
MAXSCREENSFREE(pFontPriv->font);
- free(pFontPriv);
- FontSetPrivate(pFont, dmxFontPrivateIndex, NULL);
- } else if (pFontPriv->font[pScreen->myNum]) {
- if (dmxScreen->beDisplay)
- dmxBEFreeFont(pScreen, pFont);
-
- /* The code below is non-obvious, so here's an explanation...
- *
- * When creating the default GC, the server opens up the
- * default font once for each screen, which in turn calls
- * the RealizeFont function pointer once for each screen.
- * During this process both dix's font refcnt and DMX's font
- * refcnt are incremented once for each screen.
- *
- * Later, when shutting down the X server, dix shuts down
- * each screen in reverse order. During this shutdown
- * procedure, each screen's default GC is freed and then
- * that screen is closed by calling the CloseScreen function
- * pointer. screenInfo.numScreens is then decremented after
- * closing each screen. This procedure means that the dix's
- * font refcnt for the font used by the default GC's is
- * decremented once for each screen # greater than 0.
- * However, since dix's refcnt for the default font is not
- * yet 0 for each screen greater than 0, no call to the
- * UnrealizeFont function pointer is made for those screens.
- * Then, when screen 0 is being closed, dix's font refcnt
- * for the default GC's font is finally 0 and the font is
- * unrealized. However, since screenInfo.numScreens has
- * been decremented already down to 1, only one call to
- * UnrealizeFont is made (for screen 0). Thus, even though
- * RealizeFont was called once for each screen,
- * UnrealizeFont is only called for screen 0.
- *
- * This is a bug in dix.
- *
- * To avoid the memory leak of pFontPriv for each server
- * generation, we can also free pFontPriv if the refcnt is
- * not yet 0 but the # of screens is 1 -- i.e., the case
- * described in the dix bug above. This is only a temporary
- * workaround until the bug in dix is solved.
- *
- * The other problem is that the font structure allocated by
- * XLoadQueryFont() above is not freed for screens > 0.
- * This problem cannot be worked around here since the back-
- * end displays for screens > 0 have already been closed by
- * the time this code is called from dix.
- *
- * When the bug in dix described above is fixed, then we can
- * remove the "|| screenInfo.numScreens == 1" code below and
- * the memory leaks will be eliminated.
- */
- if (--pFontPriv->refcnt == 0
+ free(pFontPriv);
+ FontSetPrivate(pFont, dmxFontPrivateIndex, NULL);
+ }
+ else if (pFontPriv->font[pScreen->myNum]) {
+ if (dmxScreen->beDisplay)
+ dmxBEFreeFont(pScreen, pFont);
+
+ /* The code below is non-obvious, so here's an explanation...
+ *
+ * When creating the default GC, the server opens up the
+ * default font once for each screen, which in turn calls
+ * the RealizeFont function pointer once for each screen.
+ * During this process both dix's font refcnt and DMX's font
+ * refcnt are incremented once for each screen.
+ *
+ * Later, when shutting down the X server, dix shuts down
+ * each screen in reverse order. During this shutdown
+ * procedure, each screen's default GC is freed and then
+ * that screen is closed by calling the CloseScreen function
+ * pointer. screenInfo.numScreens is then decremented after
+ * closing each screen. This procedure means that the dix's
+ * font refcnt for the font used by the default GC's is
+ * decremented once for each screen # greater than 0.
+ * However, since dix's refcnt for the default font is not
+ * yet 0 for each screen greater than 0, no call to the
+ * UnrealizeFont function pointer is made for those screens.
+ * Then, when screen 0 is being closed, dix's font refcnt
+ * for the default GC's font is finally 0 and the font is
+ * unrealized. However, since screenInfo.numScreens has
+ * been decremented already down to 1, only one call to
+ * UnrealizeFont is made (for screen 0). Thus, even though
+ * RealizeFont was called once for each screen,
+ * UnrealizeFont is only called for screen 0.
+ *
+ * This is a bug in dix.
+ *
+ * To avoid the memory leak of pFontPriv for each server
+ * generation, we can also free pFontPriv if the refcnt is
+ * not yet 0 but the # of screens is 1 -- i.e., the case
+ * described in the dix bug above. This is only a temporary
+ * workaround until the bug in dix is solved.
+ *
+ * The other problem is that the font structure allocated by
+ * XLoadQueryFont() above is not freed for screens > 0.
+ * This problem cannot be worked around here since the back-
+ * end displays for screens > 0 have already been closed by
+ * the time this code is called from dix.
+ *
+ * When the bug in dix described above is fixed, then we can
+ * remove the "|| screenInfo.numScreens == 1" code below and
+ * the memory leaks will be eliminated.
+ */
+ if (--pFontPriv->refcnt == 0
#if 1
- /* Remove this code when the dix bug is fixed */
- || screenInfo.numScreens == 1
+ /* Remove this code when the dix bug is fixed */
+ || screenInfo.numScreens == 1
#endif
- ) {
+ ) {
MAXSCREENSFREE(pFontPriv->font);
- free(pFontPriv);
- FontSetPrivate(pFont, dmxFontPrivateIndex, NULL);
- }
- }
+ free(pFontPriv);
+ FontSetPrivate(pFont, dmxFontPrivateIndex, NULL);
+ }
+ }
}
return TRUE;
diff --git a/hw/dmx/dmxfont.h b/hw/dmx/dmxfont.h
index 086e71b59..8575ca953 100644
--- a/hw/dmx/dmxfont.h
+++ b/hw/dmx/dmxfont.h
@@ -41,7 +41,7 @@
/** Font private area. */
typedef struct _dmxFontPriv {
- int refcnt;
+ int refcnt;
XFontStruct **font;
} dmxFontPrivRec, *dmxFontPrivPtr;
@@ -56,4 +56,4 @@ extern Bool dmxBEFreeFont(ScreenPtr pScreen, FontPtr pFont);
extern int dmxFontPrivateIndex;
-#endif /* DMXFONT_H */
+#endif /* DMXFONT_H */
diff --git a/hw/dmx/dmxgc.c b/hw/dmx/dmxgc.c
index f10f9a074..703aeb336 100644
--- a/hw/dmx/dmxgc.c
+++ b/hw/dmx/dmxgc.c
@@ -83,65 +83,70 @@ static GCOps dmxGCOps = {
};
/** Initialize the GC on \a pScreen */
-Bool dmxInitGC(ScreenPtr pScreen)
+Bool
+dmxInitGC(ScreenPtr pScreen)
{
- if (!dixRegisterPrivateKey(&dmxGCPrivateKeyRec, PRIVATE_GC, sizeof(dmxGCPrivRec)))
- return FALSE;
+ if (!dixRegisterPrivateKey
+ (&dmxGCPrivateKeyRec, PRIVATE_GC, sizeof(dmxGCPrivRec)))
+ return FALSE;
return TRUE;
}
/** Create the GC on the back-end server. */
-void dmxBECreateGC(ScreenPtr pScreen, GCPtr pGC)
+void
+dmxBECreateGC(ScreenPtr pScreen, GCPtr pGC)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
- int i;
+ dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
+ int i;
for (i = 0; i < dmxScreen->beNumPixmapFormats; i++) {
- if (pGC->depth == dmxScreen->bePixmapFormats[i].depth) {
- unsigned long mask;
- XGCValues gcvals;
-
- mask = GCGraphicsExposures;
- gcvals.graphics_exposures = FALSE;
-
- /* Create GC in the back-end servers */
- pGCPriv->gc = XCreateGC(dmxScreen->beDisplay,
- dmxScreen->scrnDefDrawables[i],
- mask, &gcvals);
- break;
- }
+ if (pGC->depth == dmxScreen->bePixmapFormats[i].depth) {
+ unsigned long mask;
+ XGCValues gcvals;
+
+ mask = GCGraphicsExposures;
+ gcvals.graphics_exposures = FALSE;
+
+ /* Create GC in the back-end servers */
+ pGCPriv->gc = XCreateGC(dmxScreen->beDisplay,
+ dmxScreen->scrnDefDrawables[i],
+ mask, &gcvals);
+ break;
+ }
}
}
/** Create a graphics context on the back-end server associated /a pGC's
* screen. */
-Bool dmxCreateGC(GCPtr pGC)
+Bool
+dmxCreateGC(GCPtr pGC)
{
- ScreenPtr pScreen = pGC->pScreen;
+ ScreenPtr pScreen = pGC->pScreen;
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
- Bool ret;
+ dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
+ Bool ret;
DMX_UNWRAP(CreateGC, dmxScreen, pScreen);
if ((ret = pScreen->CreateGC(pGC))) {
- /* Save the old funcs */
- pGCPriv->funcs = pGC->funcs;
- pGCPriv->ops = NULL;
-
- pGC->funcs = &dmxGCFuncs;
-
- if (dmxScreen->beDisplay) {
- dmxBECreateGC(pScreen, pGC);
- } else {
- pGCPriv->gc = NULL;
- }
-
- /* Check for "magic special case"
- * 1. see CreateGC in dix/gc.c for more info
- * 2. see dmxChangeGC for more info
- */
- pGCPriv->msc = (!pGC->tileIsPixel && !pGC->tile.pixmap);
+ /* Save the old funcs */
+ pGCPriv->funcs = pGC->funcs;
+ pGCPriv->ops = NULL;
+
+ pGC->funcs = &dmxGCFuncs;
+
+ if (dmxScreen->beDisplay) {
+ dmxBECreateGC(pScreen, pGC);
+ }
+ else {
+ pGCPriv->gc = NULL;
+ }
+
+ /* Check for "magic special case"
+ * 1. see CreateGC in dix/gc.c for more info
+ * 2. see dmxChangeGC for more info
+ */
+ pGCPriv->msc = (!pGC->tileIsPixel && !pGC->tile.pixmap);
}
DMX_WRAP(CreateGC, dmxCreateGC, dmxScreen, pScreen);
@@ -150,7 +155,8 @@ Bool dmxCreateGC(GCPtr pGC)
/** Validate a graphics context, \a pGC, locally in the DMX server and
* recompute the composite clip, if necessary. */
-void dmxValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
+void
+dmxValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
{
dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
@@ -160,13 +166,14 @@ void dmxValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
#endif
if (pDrawable->type == DRAWABLE_WINDOW ||
- pDrawable->type == DRAWABLE_PIXMAP) {
- /* Save the old ops, since we're about to change the ops in the
- * epilogue.
- */
- pGCPriv->ops = pGC->ops;
- } else {
- pGCPriv->ops = NULL;
+ pDrawable->type == DRAWABLE_PIXMAP) {
+ /* Save the old ops, since we're about to change the ops in the
+ * epilogue.
+ */
+ pGCPriv->ops = pGC->ops;
+ }
+ else {
+ pGCPriv->ops = NULL;
}
/* If the client clip is different or moved OR the subwindowMode has
@@ -174,12 +181,12 @@ void dmxValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
* validation, then we need to recompute the composite clip.
*/
if ((changes & (GCClipXOrigin |
- GCClipYOrigin |
- GCClipMask |
- GCSubwindowMode)) ||
- (pDrawable->serialNumber !=
- (pGC->serialNumber & DRAWABLE_SERIAL_BITS))) {
- miComputeCompositeClip(pGC, pDrawable);
+ GCClipYOrigin |
+ GCClipMask |
+ GCSubwindowMode)) ||
+ (pDrawable->serialNumber !=
+ (pGC->serialNumber & DRAWABLE_SERIAL_BITS))) {
+ miComputeCompositeClip(pGC, pDrawable);
}
DMX_GC_FUNC_EPILOGUE(pGC);
@@ -187,12 +194,13 @@ void dmxValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
/** Set the values in the graphics context on the back-end server
* associated with \a pGC's screen. */
-void dmxChangeGC(GCPtr pGC, unsigned long mask)
+void
+dmxChangeGC(GCPtr pGC, unsigned long mask)
{
- ScreenPtr pScreen = pGC->pScreen;
+ ScreenPtr pScreen = pGC->pScreen;
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
- XGCValues v;
+ dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
+ XGCValues v;
DMX_GC_FUNC_PROLOGUE(pGC);
#if 0
@@ -201,89 +209,113 @@ void dmxChangeGC(GCPtr pGC, unsigned long mask)
/* Handle "magic special case" from CreateGC */
if (pGCPriv->msc) {
- /* The "magic special case" is used to handle the case where a
- * foreground pixel is set when the GC is created so that a
- * "pseudo default-tile" can be created and used in case the
- * fillstyle was set to FillTiled. This specific case is tested
- * in xtest (XCreateGC test #3). What has happened in dix by
- * the time it reaches here is (1) the pGC->tile.pixel has been
- * set to pGC->fgPixel and pGC->tileIsPixel is set, (2) if a
- * tile has also been set, then pGC->tileIsPixel is unset and
- * pGC->tile.pixmap is initialized; else, the default tile is
- * created and pGC->tileIsPixel is unset and pGC->tile.pixmap is
- * initialized to the "pseudo default-tile". In either case,
- * pGC->tile.pixmap is set; however, in the "magic special case"
- * the mask is not updated to allow us to detect that we should
- * initialize the GCTile in the back-end server. Thus, we catch
- * this case in dmxCreateGC and add GCTile to the mask here.
- * Are there any cases that I've missed?
- */
-
- /* Make sure that the tile.pixmap is set, just in case the user
+ /* The "magic special case" is used to handle the case where a
+ * foreground pixel is set when the GC is created so that a
+ * "pseudo default-tile" can be created and used in case the
+ * fillstyle was set to FillTiled. This specific case is tested
+ * in xtest (XCreateGC test #3). What has happened in dix by
+ * the time it reaches here is (1) the pGC->tile.pixel has been
+ * set to pGC->fgPixel and pGC->tileIsPixel is set, (2) if a
+ * tile has also been set, then pGC->tileIsPixel is unset and
+ * pGC->tile.pixmap is initialized; else, the default tile is
+ * created and pGC->tileIsPixel is unset and pGC->tile.pixmap is
+ * initialized to the "pseudo default-tile". In either case,
+ * pGC->tile.pixmap is set; however, in the "magic special case"
+ * the mask is not updated to allow us to detect that we should
+ * initialize the GCTile in the back-end server. Thus, we catch
+ * this case in dmxCreateGC and add GCTile to the mask here.
+ * Are there any cases that I've missed?
+ */
+
+ /* Make sure that the tile.pixmap is set, just in case the user
* set GCTile in the mask but forgot to set vals.pixmap
- */
- if (pGC->tile.pixmap) mask |= GCTile;
+ */
+ if (pGC->tile.pixmap)
+ mask |= GCTile;
- /* This only happens once when the GC is created */
- pGCPriv->msc = FALSE;
+ /* This only happens once when the GC is created */
+ pGCPriv->msc = FALSE;
}
/* Update back-end server's gc */
- if (mask & GCFunction) v.function = pGC->alu;
- if (mask & GCPlaneMask) v.plane_mask = pGC->planemask;
- if (mask & GCForeground) v.foreground = pGC->fgPixel;
- if (mask & GCBackground) v.background = pGC->bgPixel;
- if (mask & GCLineWidth) v.line_width = pGC->lineWidth;
- if (mask & GCLineStyle) v.line_style = pGC->lineStyle;
- if (mask & GCCapStyle) v.cap_style = pGC->capStyle;
- if (mask & GCJoinStyle) v.join_style = pGC->joinStyle;
- if (mask & GCFillStyle) v.fill_style = pGC->fillStyle;
- if (mask & GCFillRule) v.fill_rule = pGC->fillRule;
+ if (mask & GCFunction)
+ v.function = pGC->alu;
+ if (mask & GCPlaneMask)
+ v.plane_mask = pGC->planemask;
+ if (mask & GCForeground)
+ v.foreground = pGC->fgPixel;
+ if (mask & GCBackground)
+ v.background = pGC->bgPixel;
+ if (mask & GCLineWidth)
+ v.line_width = pGC->lineWidth;
+ if (mask & GCLineStyle)
+ v.line_style = pGC->lineStyle;
+ if (mask & GCCapStyle)
+ v.cap_style = pGC->capStyle;
+ if (mask & GCJoinStyle)
+ v.join_style = pGC->joinStyle;
+ if (mask & GCFillStyle)
+ v.fill_style = pGC->fillStyle;
+ if (mask & GCFillRule)
+ v.fill_rule = pGC->fillRule;
if (mask & GCTile) {
- if (pGC->tileIsPixel) {
- mask &= ~GCTile;
- } else {
- dmxPixPrivPtr pPixPriv = DMX_GET_PIXMAP_PRIV(pGC->tile.pixmap);
- v.tile = (Drawable)pPixPriv->pixmap;
- }
+ if (pGC->tileIsPixel) {
+ mask &= ~GCTile;
+ }
+ else {
+ dmxPixPrivPtr pPixPriv = DMX_GET_PIXMAP_PRIV(pGC->tile.pixmap);
+
+ v.tile = (Drawable) pPixPriv->pixmap;
+ }
}
if (mask & GCStipple) {
- dmxPixPrivPtr pPixPriv = DMX_GET_PIXMAP_PRIV(pGC->stipple);
- v.stipple = (Drawable)pPixPriv->pixmap;
+ dmxPixPrivPtr pPixPriv = DMX_GET_PIXMAP_PRIV(pGC->stipple);
+
+ v.stipple = (Drawable) pPixPriv->pixmap;
}
- if (mask & GCTileStipXOrigin) v.ts_x_origin = pGC->patOrg.x;
- if (mask & GCTileStipYOrigin) v.ts_y_origin = pGC->patOrg.y;
+ if (mask & GCTileStipXOrigin)
+ v.ts_x_origin = pGC->patOrg.x;
+ if (mask & GCTileStipYOrigin)
+ v.ts_y_origin = pGC->patOrg.y;
if (mask & GCFont) {
- if (dmxScreen->beDisplay) {
- dmxFontPrivPtr pFontPriv;
- pFontPriv = FontGetPrivate(pGC->font, dmxFontPrivateIndex);
- v.font = pFontPriv->font[pScreen->myNum]->fid;
- } else {
- mask &= ~GCFont;
- }
+ if (dmxScreen->beDisplay) {
+ dmxFontPrivPtr pFontPriv;
+
+ pFontPriv = FontGetPrivate(pGC->font, dmxFontPrivateIndex);
+ v.font = pFontPriv->font[pScreen->myNum]->fid;
+ }
+ else {
+ mask &= ~GCFont;
+ }
}
- if (mask & GCSubwindowMode) v.subwindow_mode = pGC->subWindowMode;
+ if (mask & GCSubwindowMode)
+ v.subwindow_mode = pGC->subWindowMode;
/* Graphics exposures are not needed on the back-ends since they can
be generated on the front-end thereby saving bandwidth. */
- if (mask & GCGraphicsExposures) mask &= ~GCGraphicsExposures;
-
- if (mask & GCClipXOrigin) v.clip_x_origin = pGC->clipOrg.x;
- if (mask & GCClipYOrigin) v.clip_y_origin = pGC->clipOrg.y;
- if (mask & GCClipMask) mask &= ~GCClipMask; /* See ChangeClip */
- if (mask & GCDashOffset) v.dash_offset = pGC->dashOffset;
+ if (mask & GCGraphicsExposures)
+ mask &= ~GCGraphicsExposures;
+
+ if (mask & GCClipXOrigin)
+ v.clip_x_origin = pGC->clipOrg.x;
+ if (mask & GCClipYOrigin)
+ v.clip_y_origin = pGC->clipOrg.y;
+ if (mask & GCClipMask)
+ mask &= ~GCClipMask; /* See ChangeClip */
+ if (mask & GCDashOffset)
+ v.dash_offset = pGC->dashOffset;
if (mask & GCDashList) {
- mask &= ~GCDashList;
- if (dmxScreen->beDisplay)
- XSetDashes(dmxScreen->beDisplay, pGCPriv->gc,
- pGC->dashOffset, (char *)pGC->dash,
- pGC->numInDashList);
+ mask &= ~GCDashList;
+ if (dmxScreen->beDisplay)
+ XSetDashes(dmxScreen->beDisplay, pGCPriv->gc,
+ pGC->dashOffset, (char *) pGC->dash, pGC->numInDashList);
}
- if (mask & GCArcMode) v.arc_mode = pGC->arcMode;
+ if (mask & GCArcMode)
+ v.arc_mode = pGC->arcMode;
if (mask && dmxScreen->beDisplay) {
- XChangeGC(dmxScreen->beDisplay, pGCPriv->gc, mask, &v);
- dmxSync(dmxScreen, FALSE);
+ XChangeGC(dmxScreen->beDisplay, pGCPriv->gc, mask, &v);
+ dmxSync(dmxScreen, FALSE);
}
DMX_GC_FUNC_EPILOGUE(pGC);
@@ -291,34 +323,36 @@ void dmxChangeGC(GCPtr pGC, unsigned long mask)
/** Copy \a pGCSrc to \a pGCDst on the back-end server associated with
* \a pGCSrc's screen. */
-void dmxCopyGC(GCPtr pGCSrc, unsigned long changes, GCPtr pGCDst)
+void
+dmxCopyGC(GCPtr pGCSrc, unsigned long changes, GCPtr pGCDst)
{
- ScreenPtr pScreen = pGCSrc->pScreen;
+ ScreenPtr pScreen = pGCSrc->pScreen;
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxGCPrivPtr pGCSrcPriv = DMX_GET_GC_PRIV(pGCSrc);
- dmxGCPrivPtr pGCDstPriv = DMX_GET_GC_PRIV(pGCDst);
+ dmxGCPrivPtr pGCSrcPriv = DMX_GET_GC_PRIV(pGCSrc);
+ dmxGCPrivPtr pGCDstPriv = DMX_GET_GC_PRIV(pGCDst);
DMX_GC_FUNC_PROLOGUE(pGCDst);
pGCDst->funcs->CopyGC(pGCSrc, changes, pGCDst);
/* Copy the GC on the back-end server */
if (dmxScreen->beDisplay)
- XCopyGC(dmxScreen->beDisplay, pGCSrcPriv->gc, changes, pGCDstPriv->gc);
+ XCopyGC(dmxScreen->beDisplay, pGCSrcPriv->gc, changes, pGCDstPriv->gc);
DMX_GC_FUNC_EPILOGUE(pGCDst);
}
/** Free the \a pGC on the back-end server. */
-Bool dmxBEFreeGC(GCPtr pGC)
+Bool
+dmxBEFreeGC(GCPtr pGC)
{
- ScreenPtr pScreen = pGC->pScreen;
+ ScreenPtr pScreen = pGC->pScreen;
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
+ dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
if (pGCPriv->gc) {
- XFreeGC(dmxScreen->beDisplay, pGCPriv->gc);
- pGCPriv->gc = NULL;
- return TRUE;
+ XFreeGC(dmxScreen->beDisplay, pGCPriv->gc);
+ pGCPriv->gc = NULL;
+ return TRUE;
}
return FALSE;
@@ -326,30 +360,32 @@ Bool dmxBEFreeGC(GCPtr pGC)
/** Destroy the graphics context, \a pGC and free the corresponding GC
* on the back-end server. */
-void dmxDestroyGC(GCPtr pGC)
+void
+dmxDestroyGC(GCPtr pGC)
{
- ScreenPtr pScreen = pGC->pScreen;
+ ScreenPtr pScreen = pGC->pScreen;
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
DMX_GC_FUNC_PROLOGUE(pGC);
/* Free the GC on the back-end server */
if (dmxScreen->beDisplay)
- dmxBEFreeGC(pGC);
+ dmxBEFreeGC(pGC);
pGC->funcs->DestroyGC(pGC);
DMX_GC_FUNC_EPILOGUE(pGC);
}
/** Change the clip rects for a GC. */
-void dmxChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects)
+void
+dmxChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects)
{
- ScreenPtr pScreen = pGC->pScreen;
+ ScreenPtr pScreen = pGC->pScreen;
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
- XRectangle *pRects;
- BoxPtr pBox;
- int i, nRects;
+ dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
+ XRectangle *pRects;
+ BoxPtr pBox;
+ int i, nRects;
DMX_GC_FUNC_PROLOGUE(pGC);
pGC->funcs->ChangeClip(pGC, type, pvalue, nrects);
@@ -357,58 +393,60 @@ void dmxChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects)
/* Set the client clip on the back-end server */
switch (pGC->clientClipType) {
case CT_NONE:
- if (dmxScreen->beDisplay)
- XSetClipMask(dmxScreen->beDisplay, pGCPriv->gc, None);
- break;
+ if (dmxScreen->beDisplay)
+ XSetClipMask(dmxScreen->beDisplay, pGCPriv->gc, None);
+ break;
case CT_REGION:
- if (dmxScreen->beDisplay) {
- nRects = RegionNumRects((RegionPtr)pGC->clientClip);
- pRects = malloc(nRects * sizeof(*pRects));
- pBox = RegionRects((RegionPtr)pGC->clientClip);
-
- for (i = 0; i < nRects; i++) {
- pRects[i].x = pBox[i].x1;
- pRects[i].y = pBox[i].y1;
- pRects[i].width = pBox[i].x2 - pBox[i].x1;
- pRects[i].height = pBox[i].y2 - pBox[i].y1;
- }
-
- XSetClipRectangles(dmxScreen->beDisplay, pGCPriv->gc,
- pGC->clipOrg.x, pGC->clipOrg.y,
- pRects, nRects, Unsorted);
-
- free(pRects);
- }
- break;
+ if (dmxScreen->beDisplay) {
+ nRects = RegionNumRects((RegionPtr) pGC->clientClip);
+ pRects = malloc(nRects * sizeof(*pRects));
+ pBox = RegionRects((RegionPtr) pGC->clientClip);
+
+ for (i = 0; i < nRects; i++) {
+ pRects[i].x = pBox[i].x1;
+ pRects[i].y = pBox[i].y1;
+ pRects[i].width = pBox[i].x2 - pBox[i].x1;
+ pRects[i].height = pBox[i].y2 - pBox[i].y1;
+ }
+
+ XSetClipRectangles(dmxScreen->beDisplay, pGCPriv->gc,
+ pGC->clipOrg.x, pGC->clipOrg.y,
+ pRects, nRects, Unsorted);
+
+ free(pRects);
+ }
+ break;
case CT_PIXMAP:
- /* Condensed down to REGION in the mi code */
- break;
+ /* Condensed down to REGION in the mi code */
+ break;
}
DMX_GC_FUNC_EPILOGUE(pGC);
}
/** Destroy a GC's clip rects. */
-void dmxDestroyClip(GCPtr pGC)
+void
+dmxDestroyClip(GCPtr pGC)
{
- ScreenPtr pScreen = pGC->pScreen;
+ ScreenPtr pScreen = pGC->pScreen;
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
+ dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
DMX_GC_FUNC_PROLOGUE(pGC);
pGC->funcs->DestroyClip(pGC);
/* Set the client clip on the back-end server to None */
if (dmxScreen->beDisplay)
- XSetClipMask(dmxScreen->beDisplay, pGCPriv->gc, None);
+ XSetClipMask(dmxScreen->beDisplay, pGCPriv->gc, None);
DMX_GC_FUNC_EPILOGUE(pGC);
}
/** Copy a GC's clip rects. */
-void dmxCopyClip(GCPtr pGCDst, GCPtr pGCSrc)
+void
+dmxCopyClip(GCPtr pGCDst, GCPtr pGCSrc)
{
DMX_GC_FUNC_PROLOGUE(pGCDst);
pGCDst->funcs->CopyClip(pGCDst, pGCSrc);
diff --git a/hw/dmx/dmxgc.h b/hw/dmx/dmxgc.h
index 4ff3cd800..7b99d88c6 100644
--- a/hw/dmx/dmxgc.h
+++ b/hw/dmx/dmxgc.h
@@ -41,18 +41,17 @@
/** GC private area. */
typedef struct _dmxGCPriv {
- GCOps *ops;
+ GCOps *ops;
GCFuncs *funcs;
- XlibGC gc;
- Bool msc;
+ XlibGC gc;
+ Bool msc;
} dmxGCPrivRec, *dmxGCPrivPtr;
-
extern Bool dmxInitGC(ScreenPtr pScreen);
extern Bool dmxCreateGC(GCPtr pGC);
extern void dmxValidateGC(GCPtr pGC, unsigned long changes,
- DrawablePtr pDrawable);
+ DrawablePtr pDrawable);
extern void dmxChangeGC(GCPtr pGC, unsigned long mask);
extern void dmxCopyGC(GCPtr pGCSrc, unsigned long changes, GCPtr pGCDst);
extern void dmxDestroyGC(GCPtr pGC);
@@ -83,4 +82,4 @@ do { \
DMX_WRAP(ops, &dmxGCOps, _pGCPriv, (_pGC)); \
} while (0)
-#endif /* DMXGC_H */
+#endif /* DMXGC_H */
diff --git a/hw/dmx/dmxgcops.c b/hw/dmx/dmxgcops.c
index 500e2cdf1..19330668a 100644
--- a/hw/dmx/dmxgcops.c
+++ b/hw/dmx/dmxgcops.c
@@ -75,17 +75,17 @@ do { \
!DMX_GET_WINDOW_PRIV((WindowPtr)(_pDraw))->window)))
/** Fill spans -- this function should never be called. */
-void dmxFillSpans(DrawablePtr pDrawable, GCPtr pGC,
- int nInit, DDXPointPtr pptInit, int *pwidthInit,
- int fSorted)
+void
+dmxFillSpans(DrawablePtr pDrawable, GCPtr pGC,
+ int nInit, DDXPointPtr pptInit, int *pwidthInit, int fSorted)
{
/* Error -- this should never happen! */
}
/** Set spans -- this function should never be called. */
-void dmxSetSpans(DrawablePtr pDrawable, GCPtr pGC,
- char *psrc, DDXPointPtr ppt, int *pwidth, int nspans,
- int fSorted)
+void
+dmxSetSpans(DrawablePtr pDrawable, GCPtr pGC,
+ char *psrc, DDXPointPtr ppt, int *pwidth, int nspans, int fSorted)
{
/* Error -- this should never happen! */
}
@@ -94,73 +94,74 @@ void dmxSetSpans(DrawablePtr pDrawable, GCPtr pGC,
* pDrawable's screen. If primitive subdivision optimization is
* enabled, then only transfer the sections of \a pBits that are
* visible (i.e., not-clipped) to the back-end server. */
-void dmxPutImage(DrawablePtr pDrawable, GCPtr pGC,
- int depth, int x, int y, int w, int h,
- int leftPad, int format, char *pBits)
+void
+dmxPutImage(DrawablePtr pDrawable, GCPtr pGC,
+ int depth, int x, int y, int w, int h,
+ int leftPad, int format, char *pBits)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pDrawable->pScreen->myNum];
- dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
- XImage *img;
+ dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
+ XImage *img;
- if (DMX_GCOPS_OFFSCREEN(pDrawable)) return;
+ if (DMX_GCOPS_OFFSCREEN(pDrawable))
+ return;
img = XCreateImage(dmxScreen->beDisplay,
- dmxScreen->beVisuals[dmxScreen->beDefVisualIndex].visual,
- depth, format, leftPad, pBits, w, h,
- BitmapPad(dmxScreen->beDisplay),
- (format == ZPixmap) ?
- PixmapBytePad(w, depth) : BitmapBytePad(w+leftPad));
+ dmxScreen->beVisuals[dmxScreen->beDefVisualIndex].visual,
+ depth, format, leftPad, pBits, w, h,
+ BitmapPad(dmxScreen->beDisplay),
+ (format == ZPixmap) ?
+ PixmapBytePad(w, depth) : BitmapBytePad(w + leftPad));
if (img) {
- Drawable draw;
-
- DMX_GCOPS_SET_DRAWABLE(pDrawable, draw);
-
- if (dmxSubdividePrimitives && pGC->pCompositeClip) {
- RegionPtr pSubImages;
- RegionPtr pClip;
- BoxRec box;
- BoxPtr pBox;
- int nBox;
-
- box.x1 = x;
- box.y1 = y;
- box.x2 = x + w;
- box.y2 = y + h;
- pSubImages = RegionCreate(&box, 1);
-
- pClip = RegionCreate(NullBox, 1);
- RegionCopy(pClip, pGC->pCompositeClip);
- RegionTranslate(pClip,
- -pDrawable->x, -pDrawable->y);
- RegionIntersect(pSubImages, pSubImages, pClip);
-
- nBox = RegionNumRects(pSubImages);
- pBox = RegionRects(pSubImages);
-
- while (nBox--) {
- XPutImage(dmxScreen->beDisplay, draw, pGCPriv->gc, img,
- pBox->x1 - box.x1,
- pBox->y1 - box.y1,
- pBox->x1,
- pBox->y1,
- pBox->x2 - pBox->x1,
- pBox->y2 - pBox->y1);
- pBox++;
- }
+ Drawable draw;
+
+ DMX_GCOPS_SET_DRAWABLE(pDrawable, draw);
+
+ if (dmxSubdividePrimitives && pGC->pCompositeClip) {
+ RegionPtr pSubImages;
+ RegionPtr pClip;
+ BoxRec box;
+ BoxPtr pBox;
+ int nBox;
+
+ box.x1 = x;
+ box.y1 = y;
+ box.x2 = x + w;
+ box.y2 = y + h;
+ pSubImages = RegionCreate(&box, 1);
+
+ pClip = RegionCreate(NullBox, 1);
+ RegionCopy(pClip, pGC->pCompositeClip);
+ RegionTranslate(pClip, -pDrawable->x, -pDrawable->y);
+ RegionIntersect(pSubImages, pSubImages, pClip);
+
+ nBox = RegionNumRects(pSubImages);
+ pBox = RegionRects(pSubImages);
+
+ while (nBox--) {
+ XPutImage(dmxScreen->beDisplay, draw, pGCPriv->gc, img,
+ pBox->x1 - box.x1,
+ pBox->y1 - box.y1,
+ pBox->x1,
+ pBox->y1, pBox->x2 - pBox->x1, pBox->y2 - pBox->y1);
+ pBox++;
+ }
RegionDestroy(pClip);
RegionDestroy(pSubImages);
- } else {
- XPutImage(dmxScreen->beDisplay, draw, pGCPriv->gc,
- img, 0, 0, x, y, w, h);
- }
- XFree(img); /* Use XFree instead of XDestroyImage
+ }
+ else {
+ XPutImage(dmxScreen->beDisplay, draw, pGCPriv->gc,
+ img, 0, 0, x, y, w, h);
+ }
+ XFree(img); /* Use XFree instead of XDestroyImage
* because pBits is passed in from the
* caller. */
- dmxSync(dmxScreen, FALSE);
- } else {
- /* Error -- this should not happen! */
+ dmxSync(dmxScreen, FALSE);
+ }
+ else {
+ /* Error -- this should not happen! */
}
}
@@ -168,72 +169,75 @@ void dmxPutImage(DrawablePtr pDrawable, GCPtr pGC,
* server associated with \a pSrc drawable's screen. If the offscreen
* optimization is enabled, only copy when both \a pSrc and \a pDst are
* at least partially visible. */
-RegionPtr dmxCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
- int srcx, int srcy, int w, int h, int dstx, int dsty)
+RegionPtr
+dmxCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
+ int srcx, int srcy, int w, int h, int dstx, int dsty)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pSrc->pScreen->myNum];
- dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
- Drawable srcDraw, dstDraw;
+ dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
+ Drawable srcDraw, dstDraw;
if (DMX_GCOPS_OFFSCREEN(pSrc) || DMX_GCOPS_OFFSCREEN(pDst))
- return miHandleExposures(pSrc, pDst, pGC, srcx, srcy, w, h,
- dstx, dsty, 0L);
+ return miHandleExposures(pSrc, pDst, pGC, srcx, srcy, w, h,
+ dstx, dsty, 0L);
DMX_GCOPS_SET_DRAWABLE(pSrc, srcDraw);
DMX_GCOPS_SET_DRAWABLE(pDst, dstDraw);
XCopyArea(dmxScreen->beDisplay, srcDraw, dstDraw, pGCPriv->gc,
- srcx, srcy, w, h, dstx, dsty);
+ srcx, srcy, w, h, dstx, dsty);
dmxSync(dmxScreen, FALSE);
- return miHandleExposures(pSrc, pDst, pGC, srcx, srcy, w, h,
- dstx, dsty, 0L);
+ return miHandleExposures(pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty, 0L);
}
/** Copy plane number \a bitPlane from \a pSrc drawable to \a pDst
* drawable on the back-end server associated with \a pSrc drawable's
* screen. If the offscreen optimization is enabled, only copy when
* both \a pSrc and \a pDst are at least partially visible. */
-RegionPtr dmxCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
- int srcx, int srcy, int width, int height,
- int dstx, int dsty, unsigned long bitPlane)
+RegionPtr
+dmxCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
+ int srcx, int srcy, int width, int height,
+ int dstx, int dsty, unsigned long bitPlane)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pSrc->pScreen->myNum];
- dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
- Drawable srcDraw, dstDraw;
+ dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
+ Drawable srcDraw, dstDraw;
if (DMX_GCOPS_OFFSCREEN(pSrc) || DMX_GCOPS_OFFSCREEN(pDst))
- return miHandleExposures(pSrc, pDst, pGC, srcx, srcy, width, height,
- dstx, dsty, bitPlane);
+ return miHandleExposures(pSrc, pDst, pGC, srcx, srcy, width, height,
+ dstx, dsty, bitPlane);
DMX_GCOPS_SET_DRAWABLE(pSrc, srcDraw);
DMX_GCOPS_SET_DRAWABLE(pDst, dstDraw);
XCopyPlane(dmxScreen->beDisplay, srcDraw, dstDraw, pGCPriv->gc,
- srcx, srcy, width, height, dstx, dsty, bitPlane);
+ srcx, srcy, width, height, dstx, dsty, bitPlane);
dmxSync(dmxScreen, FALSE);
return miHandleExposures(pSrc, pDst, pGC, srcx, srcy, width, height,
- dstx, dsty, bitPlane);
+ dstx, dsty, bitPlane);
}
/** Render list of points, \a pptInit in \a pDrawable on the back-end
* server associated with \a pDrawable's screen. If the offscreen
* optimization is enabled, only draw when \a pDrawable is at least
* partially visible. */
-void dmxPolyPoint(DrawablePtr pDrawable, GCPtr pGC,
- int mode, int npt, DDXPointPtr pptInit)
+void
+dmxPolyPoint(DrawablePtr pDrawable, GCPtr pGC,
+ int mode, int npt, DDXPointPtr pptInit)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pDrawable->pScreen->myNum];
- dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
- Drawable draw;
+ dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
+ Drawable draw;
- if (DMX_GCOPS_OFFSCREEN(pDrawable)) return;
+ if (DMX_GCOPS_OFFSCREEN(pDrawable))
+ return;
DMX_GCOPS_SET_DRAWABLE(pDrawable, draw);
XDrawPoints(dmxScreen->beDisplay, draw, pGCPriv->gc,
- (XPoint *)pptInit, npt, mode);
+ (XPoint *) pptInit, npt, mode);
dmxSync(dmxScreen, FALSE);
}
@@ -241,19 +245,21 @@ void dmxPolyPoint(DrawablePtr pDrawable, GCPtr pGC,
* back-end server associated with \a pDrawable's screen. If the
* offscreen optimization is enabled, only draw when \a pDrawable is at
* least partially visible. */
-void dmxPolylines(DrawablePtr pDrawable, GCPtr pGC,
- int mode, int npt, DDXPointPtr pptInit)
+void
+dmxPolylines(DrawablePtr pDrawable, GCPtr pGC,
+ int mode, int npt, DDXPointPtr pptInit)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pDrawable->pScreen->myNum];
- dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
- Drawable draw;
+ dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
+ Drawable draw;
- if (DMX_GCOPS_OFFSCREEN(pDrawable)) return;
+ if (DMX_GCOPS_OFFSCREEN(pDrawable))
+ return;
DMX_GCOPS_SET_DRAWABLE(pDrawable, draw);
XDrawLines(dmxScreen->beDisplay, draw, pGCPriv->gc,
- (XPoint *)pptInit, npt, mode);
+ (XPoint *) pptInit, npt, mode);
dmxSync(dmxScreen, FALSE);
}
@@ -261,19 +267,20 @@ void dmxPolylines(DrawablePtr pDrawable, GCPtr pGC,
* back-end server associated with \a pDrawable's screen. If the
* offscreen optimization is enabled, only draw when \a pDrawable is at
* least partially visible. */
-void dmxPolySegment(DrawablePtr pDrawable, GCPtr pGC,
- int nseg, xSegment *pSegs)
+void
+dmxPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pSegs)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pDrawable->pScreen->myNum];
- dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
- Drawable draw;
+ dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
+ Drawable draw;
- if (DMX_GCOPS_OFFSCREEN(pDrawable)) return;
+ if (DMX_GCOPS_OFFSCREEN(pDrawable))
+ return;
DMX_GCOPS_SET_DRAWABLE(pDrawable, draw);
XDrawSegments(dmxScreen->beDisplay, draw, pGCPriv->gc,
- (XSegment *)pSegs, nseg);
+ (XSegment *) pSegs, nseg);
dmxSync(dmxScreen, FALSE);
}
@@ -281,19 +288,21 @@ void dmxPolySegment(DrawablePtr pDrawable, GCPtr pGC,
* back-end server associated with \a pDrawable's screen. If the
* offscreen optimization is enabled, only draw when \a pDrawable is at
* least partially visible. */
-void dmxPolyRectangle(DrawablePtr pDrawable, GCPtr pGC,
- int nrects, xRectangle *pRects)
+void
+dmxPolyRectangle(DrawablePtr pDrawable, GCPtr pGC,
+ int nrects, xRectangle *pRects)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pDrawable->pScreen->myNum];
- dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
- Drawable draw;
+ dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
+ Drawable draw;
- if (DMX_GCOPS_OFFSCREEN(pDrawable)) return;
+ if (DMX_GCOPS_OFFSCREEN(pDrawable))
+ return;
DMX_GCOPS_SET_DRAWABLE(pDrawable, draw);
XDrawRectangles(dmxScreen->beDisplay, draw, pGCPriv->gc,
- (XRectangle *)pRects, nrects);
+ (XRectangle *) pRects, nrects);
dmxSync(dmxScreen, FALSE);
}
@@ -302,19 +311,19 @@ void dmxPolyRectangle(DrawablePtr pDrawable, GCPtr pGC,
* back-end server associated with \a pDrawable's screen. If the
* offscreen optimization is enabled, only draw when \a pDrawable is at
* least partially visible. */
-void dmxPolyArc(DrawablePtr pDrawable, GCPtr pGC,
- int narcs, xArc *parcs)
+void
+dmxPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc * parcs)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pDrawable->pScreen->myNum];
- dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
- Drawable draw;
+ dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
+ Drawable draw;
- if (DMX_GCOPS_OFFSCREEN(pDrawable)) return;
+ if (DMX_GCOPS_OFFSCREEN(pDrawable))
+ return;
DMX_GCOPS_SET_DRAWABLE(pDrawable, draw);
- XDrawArcs(dmxScreen->beDisplay, draw, pGCPriv->gc,
- (XArc *)parcs, narcs);
+ XDrawArcs(dmxScreen->beDisplay, draw, pGCPriv->gc, (XArc *) parcs, narcs);
dmxSync(dmxScreen, FALSE);
}
@@ -322,19 +331,21 @@ void dmxPolyArc(DrawablePtr pDrawable, GCPtr pGC,
* associated with \a pDrawable's screen. If the offscreen
* optimization is enabled, only draw when \a pDrawable is at least
* partially visible. */
-void dmxFillPolygon(DrawablePtr pDrawable, GCPtr pGC,
- int shape, int mode, int count, DDXPointPtr pPts)
+void
+dmxFillPolygon(DrawablePtr pDrawable, GCPtr pGC,
+ int shape, int mode, int count, DDXPointPtr pPts)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pDrawable->pScreen->myNum];
- dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
- Drawable draw;
+ dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
+ Drawable draw;
- if (DMX_GCOPS_OFFSCREEN(pDrawable)) return;
+ if (DMX_GCOPS_OFFSCREEN(pDrawable))
+ return;
DMX_GCOPS_SET_DRAWABLE(pDrawable, draw);
XFillPolygon(dmxScreen->beDisplay, draw, pGCPriv->gc,
- (XPoint *)pPts, count, shape, mode);
+ (XPoint *) pPts, count, shape, mode);
dmxSync(dmxScreen, FALSE);
}
@@ -342,19 +353,21 @@ void dmxFillPolygon(DrawablePtr pDrawable, GCPtr pGC,
* the back-end server associated with \a pDrawable's screen. If the
* offscreen optimization is enabled, only draw when \a pDrawable is at
* least partially visible. */
-void dmxPolyFillRect(DrawablePtr pDrawable, GCPtr pGC,
- int nrectFill, xRectangle *prectInit)
+void
+dmxPolyFillRect(DrawablePtr pDrawable, GCPtr pGC,
+ int nrectFill, xRectangle *prectInit)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pDrawable->pScreen->myNum];
- dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
- Drawable draw;
+ dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
+ Drawable draw;
- if (DMX_GCOPS_OFFSCREEN(pDrawable)) return;
+ if (DMX_GCOPS_OFFSCREEN(pDrawable))
+ return;
DMX_GCOPS_SET_DRAWABLE(pDrawable, draw);
XFillRectangles(dmxScreen->beDisplay, draw, pGCPriv->gc,
- (XRectangle *)prectInit, nrectFill);
+ (XRectangle *) prectInit, nrectFill);
dmxSync(dmxScreen, FALSE);
}
@@ -362,19 +375,19 @@ void dmxPolyFillRect(DrawablePtr pDrawable, GCPtr pGC,
* server associated with \a pDrawable's screen. If the offscreen
* optimization is enabled, only draw when \a pDrawable is at least
* partially visible. */
-void dmxPolyFillArc(DrawablePtr pDrawable, GCPtr pGC,
- int narcs, xArc *parcs)
+void
+dmxPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc * parcs)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pDrawable->pScreen->myNum];
- dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
- Drawable draw;
+ dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
+ Drawable draw;
- if (DMX_GCOPS_OFFSCREEN(pDrawable)) return;
+ if (DMX_GCOPS_OFFSCREEN(pDrawable))
+ return;
DMX_GCOPS_SET_DRAWABLE(pDrawable, draw);
- XFillArcs(dmxScreen->beDisplay, draw, pGCPriv->gc,
- (XArc *)parcs, narcs);
+ XFillArcs(dmxScreen->beDisplay, draw, pGCPriv->gc, (XArc *) parcs, narcs);
dmxSync(dmxScreen, FALSE);
}
@@ -382,84 +395,90 @@ void dmxPolyFillArc(DrawablePtr pDrawable, GCPtr pGC,
* the back-end server associated with \a pDrawable's screen. If the
* offscreen optimization is enabled, only draw when \a pDrawable is at
* least partially visible. */
-int dmxPolyText8(DrawablePtr pDrawable, GCPtr pGC,
- int x, int y, int count, char *chars)
+int
+dmxPolyText8(DrawablePtr pDrawable, GCPtr pGC,
+ int x, int y, int count, char *chars)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pDrawable->pScreen->myNum];
- dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
- unsigned long n, i;
- int w;
- CharInfoPtr charinfo[255];
- Drawable draw;
+ dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
+ unsigned long n, i;
+ int w;
+ CharInfoPtr charinfo[255];
+ Drawable draw;
- GetGlyphs(pGC->font, (unsigned long)count, (unsigned char *)chars,
- Linear8Bit, &n, charinfo);
+ GetGlyphs(pGC->font, (unsigned long) count, (unsigned char *) chars,
+ Linear8Bit, &n, charinfo);
/* Calculate text width */
w = 0;
- for (i = 0; i < n; i++) w += charinfo[i]->metrics.characterWidth;
+ for (i = 0; i < n; i++)
+ w += charinfo[i]->metrics.characterWidth;
if (n != 0 && !DMX_GCOPS_OFFSCREEN(pDrawable)) {
- DMX_GCOPS_SET_DRAWABLE(pDrawable, draw);
+ DMX_GCOPS_SET_DRAWABLE(pDrawable, draw);
- XDrawString(dmxScreen->beDisplay, draw, pGCPriv->gc,
- x, y, chars, count);
- dmxSync(dmxScreen, FALSE);
+ XDrawString(dmxScreen->beDisplay, draw, pGCPriv->gc,
+ x, y, chars, count);
+ dmxSync(dmxScreen, FALSE);
}
- return x+w;
+ return x + w;
}
/** Render string of 16-bit \a chars (foreground only) in \a pDrawable
* on the back-end server associated with \a pDrawable's screen. If
* the offscreen optimization is enabled, only draw when \a pDrawable
* is at least partially visible. */
-int dmxPolyText16(DrawablePtr pDrawable, GCPtr pGC,
- int x, int y, int count, unsigned short *chars)
+int
+dmxPolyText16(DrawablePtr pDrawable, GCPtr pGC,
+ int x, int y, int count, unsigned short *chars)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pDrawable->pScreen->myNum];
- dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
- unsigned long n, i;
- int w;
- CharInfoPtr charinfo[255];
- Drawable draw;
+ dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
+ unsigned long n, i;
+ int w;
+ CharInfoPtr charinfo[255];
+ Drawable draw;
- GetGlyphs(pGC->font, (unsigned long)count, (unsigned char *)chars,
- (FONTLASTROW(pGC->font) == 0) ? Linear16Bit : TwoD16Bit,
- &n, charinfo);
+ GetGlyphs(pGC->font, (unsigned long) count, (unsigned char *) chars,
+ (FONTLASTROW(pGC->font) == 0) ? Linear16Bit : TwoD16Bit,
+ &n, charinfo);
/* Calculate text width */
w = 0;
- for (i = 0; i < n; i++) w += charinfo[i]->metrics.characterWidth;
+ for (i = 0; i < n; i++)
+ w += charinfo[i]->metrics.characterWidth;
if (n != 0 && !DMX_GCOPS_OFFSCREEN(pDrawable)) {
- DMX_GCOPS_SET_DRAWABLE(pDrawable, draw);
+ DMX_GCOPS_SET_DRAWABLE(pDrawable, draw);
- XDrawString16(dmxScreen->beDisplay, draw, pGCPriv->gc,
- x, y, (XChar2b *)chars, count);
- dmxSync(dmxScreen, FALSE);
+ XDrawString16(dmxScreen->beDisplay, draw, pGCPriv->gc,
+ x, y, (XChar2b *) chars, count);
+ dmxSync(dmxScreen, FALSE);
}
- return x+w;
+ return x + w;
}
/** Render string of 8-bit \a chars (both foreground and background) in
* \a pDrawable on the back-end server associated with \a pDrawable's
* screen. If the offscreen optimization is enabled, only draw when \a
* pDrawable is at least partially visible. */
-void dmxImageText8(DrawablePtr pDrawable, GCPtr pGC,
- int x, int y, int count, char *chars)
+void
+dmxImageText8(DrawablePtr pDrawable, GCPtr pGC,
+ int x, int y, int count, char *chars)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pDrawable->pScreen->myNum];
- dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
- Drawable draw;
+ dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
+ Drawable draw;
- if (DMX_GCOPS_OFFSCREEN(pDrawable)) return;
+ if (DMX_GCOPS_OFFSCREEN(pDrawable))
+ return;
DMX_GCOPS_SET_DRAWABLE(pDrawable, draw);
XDrawImageString(dmxScreen->beDisplay, draw, pGCPriv->gc,
- x, y, chars, count);
+ x, y, chars, count);
dmxSync(dmxScreen, FALSE);
}
@@ -467,41 +486,46 @@ void dmxImageText8(DrawablePtr pDrawable, GCPtr pGC,
* \a pDrawable on the back-end server associated with \a pDrawable's
* screen. If the offscreen optimization is enabled, only draw when \a
* pDrawable is at least partially visible. */
-void dmxImageText16(DrawablePtr pDrawable, GCPtr pGC,
- int x, int y, int count, unsigned short *chars)
+void
+dmxImageText16(DrawablePtr pDrawable, GCPtr pGC,
+ int x, int y, int count, unsigned short *chars)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pDrawable->pScreen->myNum];
- dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
- Drawable draw;
+ dmxGCPrivPtr pGCPriv = DMX_GET_GC_PRIV(pGC);
+ Drawable draw;
- if (DMX_GCOPS_OFFSCREEN(pDrawable)) return;
+ if (DMX_GCOPS_OFFSCREEN(pDrawable))
+ return;
DMX_GCOPS_SET_DRAWABLE(pDrawable, draw);
XDrawImageString16(dmxScreen->beDisplay, draw, pGCPriv->gc,
- x, y, (XChar2b *)chars, count);
+ x, y, (XChar2b *) chars, count);
dmxSync(dmxScreen, FALSE);
}
/** Image Glyph Blt -- this function should never be called. */
-void dmxImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
- int x, int y, unsigned int nglyph,
- CharInfoPtr *ppci, pointer pglyphBase)
+void
+dmxImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
+ int x, int y, unsigned int nglyph,
+ CharInfoPtr * ppci, pointer pglyphBase)
{
/* Error -- this should never happen! */
}
/** Poly Glyph Blt -- this function should never be called. */
-void dmxPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
- int x, int y, unsigned int nglyph,
- CharInfoPtr *ppci, pointer pglyphBase)
+void
+dmxPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
+ int x, int y, unsigned int nglyph,
+ CharInfoPtr * ppci, pointer pglyphBase)
{
/* Error -- this should never happen! */
}
/** Push Pixels -- this function should never be called. */
-void dmxPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst,
- int w, int h, int x, int y)
+void
+dmxPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst,
+ int w, int h, int x, int y)
{
/* Error -- this should never happen! */
}
@@ -514,29 +538,32 @@ void dmxPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst,
* screen 0. When screen 0 is detached, the pixmaps must be obtained
* from any other screen that is not detached. Usually, this is screen
* 1. */
-static DMXScreenInfo *dmxFindAlternatePixmap(DrawablePtr pDrawable, XID *draw)
+static DMXScreenInfo *
+dmxFindAlternatePixmap(DrawablePtr pDrawable, XID *draw)
{
#ifdef PANORAMIX
- PanoramiXRes *pXinPix;
- int i;
+ PanoramiXRes *pXinPix;
+ int i;
DMXScreenInfo *dmxScreen;
-
- if (noPanoramiXExtension) return NULL;
- if (pDrawable->type != DRAWABLE_PIXMAP) return NULL;
- if (Success != dixLookupResourceByType((pointer*) &pXinPix,
- pDrawable->id, XRT_PIXMAP,
- NullClient, DixUnknownAccess))
+ if (noPanoramiXExtension)
+ return NULL;
+ if (pDrawable->type != DRAWABLE_PIXMAP)
+ return NULL;
+
+ if (Success != dixLookupResourceByType((pointer *) &pXinPix,
+ pDrawable->id, XRT_PIXMAP,
+ NullClient, DixUnknownAccess))
return NULL;
FOR_NSCREENS_FORWARD_SKIP(i) {
dmxScreen = &dmxScreens[i];
if (dmxScreen->beDisplay) {
- PixmapPtr pSrc;
+ PixmapPtr pSrc;
dmxPixPrivPtr pSrcPriv;
-
- dixLookupResourceByType((pointer*) &pSrc, pXinPix->info[i].id,
- RT_PIXMAP, NullClient, DixUnknownAccess);
+
+ dixLookupResourceByType((pointer *) &pSrc, pXinPix->info[i].id,
+ RT_PIXMAP, NullClient, DixUnknownAccess);
pSrcPriv = DMX_GET_PIXMAP_PRIV(pSrc);
if (pSrcPriv->pixmap) {
*draw = pSrcPriv->pixmap;
@@ -553,53 +580,58 @@ static DMXScreenInfo *dmxFindAlternatePixmap(DrawablePtr pDrawable, XID *draw)
* image from it. If it is not viewable, then get the image from the
* first ancestor of \a pDrawable that is viewable. If no viewable
* ancestor is found, then simply return without getting an image. */
-void dmxGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
- unsigned int format, unsigned long planeMask, char *pdstLine)
+void
+dmxGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
+ unsigned int format, unsigned long planeMask, char *pdstLine)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pDrawable->pScreen->myNum];
- XImage *img;
- Drawable draw;
+ XImage *img;
+ Drawable draw;
/* Cannot get image from unviewable window */
if (pDrawable->type == DRAWABLE_WINDOW) {
- WindowPtr pWindow = (WindowPtr)pDrawable;
- if (!pWindow->viewable) {
- while (!pWindow->viewable && pWindow->parent) {
- sx += pWindow->origin.x - wBorderWidth(pWindow);
- sx += pWindow->origin.y - wBorderWidth(pWindow);
- pWindow = pWindow->parent;
- }
- if (!pWindow->viewable) {
- return;
- }
- }
- DMX_GCOPS_SET_DRAWABLE(&pWindow->drawable, draw);
- if (DMX_GCOPS_OFFSCREEN(&pWindow->drawable))
- return;
- } else {
- DMX_GCOPS_SET_DRAWABLE(pDrawable, draw);
- if (DMX_GCOPS_OFFSCREEN(pDrawable)) {
+ WindowPtr pWindow = (WindowPtr) pDrawable;
+
+ if (!pWindow->viewable) {
+ while (!pWindow->viewable && pWindow->parent) {
+ sx += pWindow->origin.x - wBorderWidth(pWindow);
+ sx += pWindow->origin.y - wBorderWidth(pWindow);
+ pWindow = pWindow->parent;
+ }
+ if (!pWindow->viewable) {
+ return;
+ }
+ }
+ DMX_GCOPS_SET_DRAWABLE(&pWindow->drawable, draw);
+ if (DMX_GCOPS_OFFSCREEN(&pWindow->drawable))
+ return;
+ }
+ else {
+ DMX_GCOPS_SET_DRAWABLE(pDrawable, draw);
+ if (DMX_GCOPS_OFFSCREEN(pDrawable)) {
/* Try to find the pixmap on a non-detached Xinerama screen */
dmxScreen = dmxFindAlternatePixmap(pDrawable, &draw);
- if (!dmxScreen) return;
+ if (!dmxScreen)
+ return;
}
}
img = XGetImage(dmxScreen->beDisplay, draw,
- sx, sy, w, h, planeMask, format);
+ sx, sy, w, h, planeMask, format);
if (img) {
- int len = img->bytes_per_line * img->height;
- memmove(pdstLine, img->data, len);
- XDestroyImage(img);
+ int len = img->bytes_per_line * img->height;
+
+ memmove(pdstLine, img->data, len);
+ XDestroyImage(img);
}
dmxSync(dmxScreen, FALSE);
}
/** Get Spans -- this function should never be called. */
-void dmxGetSpans(DrawablePtr pDrawable, int wMax,
- DDXPointPtr ppt, int *pwidth, int nspans,
- char *pdstStart)
+void
+dmxGetSpans(DrawablePtr pDrawable, int wMax,
+ DDXPointPtr ppt, int *pwidth, int nspans, char *pdstStart)
{
/* Error -- this should never happen! */
}
diff --git a/hw/dmx/dmxgcops.h b/hw/dmx/dmxgcops.h
index da14d4d94..4ba0ad500 100644
--- a/hw/dmx/dmxgcops.h
+++ b/hw/dmx/dmxgcops.h
@@ -38,58 +38,58 @@
#define DMXGCOPS_H
extern void dmxFillSpans(DrawablePtr pDrawable, GCPtr pGC,
- int nInit, DDXPointPtr pptInit, int *pwidthInit,
- int fSorted);
+ int nInit, DDXPointPtr pptInit, int *pwidthInit,
+ int fSorted);
extern void dmxSetSpans(DrawablePtr pDrawable, GCPtr pGC,
- char *psrc, DDXPointPtr ppt, int *pwidth, int nspans,
- int fSorted);
+ char *psrc, DDXPointPtr ppt, int *pwidth, int nspans,
+ int fSorted);
extern void dmxPutImage(DrawablePtr pDrawable, GCPtr pGC,
- int depth, int x, int y, int w, int h,
- int leftPad, int format, char *pBits);
+ int depth, int x, int y, int w, int h,
+ int leftPad, int format, char *pBits);
extern RegionPtr dmxCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
- int srcx, int srcy, int w, int h,
- int dstx, int dsty);
+ int srcx, int srcy, int w, int h,
+ int dstx, int dsty);
extern RegionPtr dmxCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
- int srcx, int srcy, int width, int height,
- int dstx, int dsty, unsigned long bitPlane);
+ int srcx, int srcy, int width, int height,
+ int dstx, int dsty, unsigned long bitPlane);
extern void dmxPolyPoint(DrawablePtr pDrawable, GCPtr pGC,
- int mode, int npt, DDXPointPtr pptInit);
+ int mode, int npt, DDXPointPtr pptInit);
extern void dmxPolylines(DrawablePtr pDrawable, GCPtr pGC,
- int mode, int npt, DDXPointPtr pptInit);
+ int mode, int npt, DDXPointPtr pptInit);
extern void dmxPolySegment(DrawablePtr pDrawable, GCPtr pGC,
- int nseg, xSegment *pSegs);
+ int nseg, xSegment * pSegs);
extern void dmxPolyRectangle(DrawablePtr pDrawable, GCPtr pGC,
- int nrects, xRectangle *pRects);
+ int nrects, xRectangle *pRects);
extern void dmxPolyArc(DrawablePtr pDrawable, GCPtr pGC,
- int narcs, xArc *parcs);
+ int narcs, xArc * parcs);
extern void dmxFillPolygon(DrawablePtr pDrawable, GCPtr pGC,
- int shape, int mode, int count, DDXPointPtr pPts);
+ int shape, int mode, int count, DDXPointPtr pPts);
extern void dmxPolyFillRect(DrawablePtr pDrawable, GCPtr pGC,
- int nrectFill, xRectangle *prectInit);
+ int nrectFill, xRectangle *prectInit);
extern void dmxPolyFillArc(DrawablePtr pDrawable, GCPtr pGC,
- int narcs, xArc *parcs);
+ int narcs, xArc * parcs);
extern int dmxPolyText8(DrawablePtr pDrawable, GCPtr pGC,
- int x, int y, int count, char *chars);
+ int x, int y, int count, char *chars);
extern int dmxPolyText16(DrawablePtr pDrawable, GCPtr pGC,
- int x, int y, int count, unsigned short *chars);
+ int x, int y, int count, unsigned short *chars);
extern void dmxImageText8(DrawablePtr pDrawable, GCPtr pGC,
- int x, int y, int count, char *chars);
+ int x, int y, int count, char *chars);
extern void dmxImageText16(DrawablePtr pDrawable, GCPtr pGC,
- int x, int y, int count, unsigned short *chars);
+ int x, int y, int count, unsigned short *chars);
extern void dmxImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
- int x, int y, unsigned int nglyph,
- CharInfoPtr *ppci, pointer pglyphBase);
+ int x, int y, unsigned int nglyph,
+ CharInfoPtr * ppci, pointer pglyphBase);
extern void dmxPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
- int x, int y, unsigned int nglyph,
- CharInfoPtr *ppci, pointer pglyphBase);
+ int x, int y, unsigned int nglyph,
+ CharInfoPtr * ppci, pointer pglyphBase);
extern void dmxPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst,
- int w, int h, int x, int y);
+ int w, int h, int x, int y);
extern void dmxGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
- unsigned int format, unsigned long planeMask,
- char *pdstLine);
+ unsigned int format, unsigned long planeMask,
+ char *pdstLine);
extern void dmxGetSpans(DrawablePtr pDrawable, int wMax,
- DDXPointPtr ppt, int *pwidth, int nspans,
- char *pdstStart);
+ DDXPointPtr ppt, int *pwidth, int nspans,
+ char *pdstStart);
-#endif /* DMXGCOPS_H */
+#endif /* DMXGCOPS_H */
diff --git a/hw/dmx/dmxinit.c b/hw/dmx/dmxinit.c
index 57c242598..09e3d74ea 100644
--- a/hw/dmx/dmxinit.c
+++ b/hw/dmx/dmxinit.c
@@ -55,8 +55,8 @@
#include "dmxstat.h"
#include "dmxpict.h"
-#include <X11/Xos.h> /* For gettimeofday */
-#include <X11/Xmu/SysUtil.h> /* For XmuGetHostname */
+#include <X11/Xos.h> /* For gettimeofday */
+#include <X11/Xmu/SysUtil.h> /* For XmuGetHostname */
#include "dixstruct.h"
#ifdef PANORAMIX
#include "panoramiXsrv.h"
@@ -70,91 +70,94 @@
#include "dmx_glxvisuals.h"
#include <X11/extensions/Xext.h>
#include <X11/extensions/extutil.h>
-#endif /* GLXEXT */
+#endif /* GLXEXT */
/* Global variables available to all Xserver/hw/dmx routines. */
-int dmxNumScreens;
-DMXScreenInfo *dmxScreens;
+int dmxNumScreens;
+DMXScreenInfo *dmxScreens;
-int dmxNumInputs;
-DMXInputInfo *dmxInputs;
+int dmxNumInputs;
+DMXInputInfo *dmxInputs;
-int dmxShadowFB = FALSE;
+int dmxShadowFB = FALSE;
-XErrorEvent dmxLastErrorEvent;
-Bool dmxErrorOccurred = FALSE;
+XErrorEvent dmxLastErrorEvent;
+Bool dmxErrorOccurred = FALSE;
-char *dmxFontPath = NULL;
+char *dmxFontPath = NULL;
-Bool dmxOffScreenOpt = TRUE;
+Bool dmxOffScreenOpt = TRUE;
-Bool dmxSubdividePrimitives = TRUE;
+Bool dmxSubdividePrimitives = TRUE;
-Bool dmxLazyWindowCreation = TRUE;
+Bool dmxLazyWindowCreation = TRUE;
-Bool dmxUseXKB = TRUE;
+Bool dmxUseXKB = TRUE;
-int dmxDepth = 0;
+int dmxDepth = 0;
#ifndef GLXEXT
-static Bool dmxGLXProxy = FALSE;
+static Bool dmxGLXProxy = FALSE;
#else
-Bool dmxGLXProxy = TRUE;
+Bool dmxGLXProxy = TRUE;
-Bool dmxGLXSwapGroupSupport = TRUE;
+Bool dmxGLXSwapGroupSupport = TRUE;
-Bool dmxGLXSyncSwap = FALSE;
+Bool dmxGLXSyncSwap = FALSE;
-Bool dmxGLXFinishSwap = FALSE;
+Bool dmxGLXFinishSwap = FALSE;
#endif
-Bool dmxIgnoreBadFontPaths = FALSE;
+Bool dmxIgnoreBadFontPaths = FALSE;
-Bool dmxAddRemoveScreens = FALSE;
+Bool dmxAddRemoveScreens = FALSE;
/* dmxErrorHandler catches errors that occur when calling one of the
* back-end servers. Some of this code is based on _XPrintDefaultError
* in xc/lib/X11/XlibInt.c */
-static int dmxErrorHandler(Display *dpy, XErrorEvent *ev)
+static int
+dmxErrorHandler(Display * dpy, XErrorEvent * ev)
{
#define DMX_ERROR_BUF_SIZE 256
- /* RATS: these buffers are only used in
- * length-limited calls. */
- char buf[DMX_ERROR_BUF_SIZE];
- char request[DMX_ERROR_BUF_SIZE];
+ /* RATS: these buffers are only used in
+ * length-limited calls. */
+ char buf[DMX_ERROR_BUF_SIZE];
+ char request[DMX_ERROR_BUF_SIZE];
_XExtension *ext = NULL;
- dmxErrorOccurred = TRUE;
+ dmxErrorOccurred = TRUE;
dmxLastErrorEvent = *ev;
XGetErrorText(dpy, ev->error_code, buf, sizeof(buf));
dmxLog(dmxWarning, "dmxErrorHandler: %s\n", buf);
- /* Find major opcode name */
+ /* Find major opcode name */
if (ev->request_code < 128) {
snprintf(request, sizeof(request), "%d", ev->request_code);
XGetErrorDatabaseText(dpy, "XRequest", request, "", buf, sizeof(buf));
- } else {
+ }
+ else {
for (ext = dpy->ext_procs;
ext && ext->codes.major_opcode != ev->request_code;
ext = ext->next);
- if (ext) strlcpy(buf, ext->name, sizeof(buf));
- else buf[0] = '\0';
+ if (ext)
+ strlcpy(buf, ext->name, sizeof(buf));
+ else
+ buf[0] = '\0';
}
dmxLog(dmxWarning, " Major opcode: %d (%s)\n",
ev->request_code, buf);
- /* Find minor opcode name */
+ /* Find minor opcode name */
if (ev->request_code >= 128 && ext) {
snprintf(request, sizeof(request), "%d", ev->request_code);
- snprintf(request, sizeof(request), "%s.%d",
- ext->name, ev->minor_code);
+ snprintf(request, sizeof(request), "%s.%d", ext->name, ev->minor_code);
XGetErrorDatabaseText(dpy, "XRequest", request, "", buf, sizeof(buf));
dmxLog(dmxWarning, " Minor opcode: %d (%s)\n",
ev->minor_code, buf);
}
- /* Provide value information */
+ /* Provide value information */
switch (ev->error_code) {
case BadValue:
dmxLog(dmxWarning, " Value: 0x%x\n",
@@ -170,7 +173,7 @@ static int dmxErrorHandler(Display *dpy, XErrorEvent *ev)
break;
}
- /* Provide serial number information */
+ /* Provide serial number information */
dmxLog(dmxWarning, " Failed serial number: %d\n",
ev->serial);
dmxLog(dmxWarning, " Current serial number: %d\n",
@@ -179,47 +182,53 @@ static int dmxErrorHandler(Display *dpy, XErrorEvent *ev)
}
#ifdef GLXEXT
-static int dmxNOPErrorHandler(Display *dpy, XErrorEvent *ev)
+static int
+dmxNOPErrorHandler(Display * dpy, XErrorEvent * ev)
{
return 0;
}
#endif
-Bool dmxOpenDisplay(DMXScreenInfo *dmxScreen)
+Bool
+dmxOpenDisplay(DMXScreenInfo * dmxScreen)
{
if (!(dmxScreen->beDisplay = XOpenDisplay(dmxScreen->name)))
- return FALSE;
+ return FALSE;
dmxPropertyDisplay(dmxScreen);
return TRUE;
}
-void dmxSetErrorHandler(DMXScreenInfo *dmxScreen)
+void
+dmxSetErrorHandler(DMXScreenInfo * dmxScreen)
{
XSetErrorHandler(dmxErrorHandler);
}
-static void dmxPrintScreenInfo(DMXScreenInfo *dmxScreen)
+static void
+dmxPrintScreenInfo(DMXScreenInfo * dmxScreen)
{
XWindowAttributes attribs;
- int ndepths = 0, *depths = NULL;
- int i;
- Display *dpy = dmxScreen->beDisplay;
- Screen *s = DefaultScreenOfDisplay(dpy);
- int scr = DefaultScreen(dpy);
+ int ndepths = 0, *depths = NULL;
+ int i;
+ Display *dpy = dmxScreen->beDisplay;
+ Screen *s = DefaultScreenOfDisplay(dpy);
+ int scr = DefaultScreen(dpy);
XGetWindowAttributes(dpy, DefaultRootWindow(dpy), &attribs);
- if (!(depths = XListDepths(dpy, scr, &ndepths))) ndepths = 0;
-
+ if (!(depths = XListDepths(dpy, scr, &ndepths)))
+ ndepths = 0;
+
dmxLogOutput(dmxScreen, "Name of display: %s\n", DisplayString(dpy));
dmxLogOutput(dmxScreen, "Version number: %d.%d\n",
ProtocolVersion(dpy), ProtocolRevision(dpy));
dmxLogOutput(dmxScreen, "Vendor string: %s\n", ServerVendor(dpy));
if (!strstr(ServerVendor(dpy), "XFree86")) {
dmxLogOutput(dmxScreen, "Vendor release: %d\n", VendorRelease(dpy));
- } else {
- /* This code based on xdpyinfo.c */
- int v = VendorRelease(dpy);
+ }
+ else {
+ /* This code based on xdpyinfo.c */
+ int v = VendorRelease(dpy);
int major = -1, minor = -1, patch = -1, subpatch = -1;
if (v < 336)
@@ -229,27 +238,33 @@ static void dmxPrintScreenInfo(DMXScreenInfo *dmxScreen)
minor = (v / 100) % 10;
if (((v / 10) % 10) || (v % 10)) {
patch = (v / 10) % 10;
- if (v % 10) subpatch = v % 10;
+ if (v % 10)
+ subpatch = v % 10;
}
- } else if (v < 40000000) {
+ }
+ else if (v < 40000000) {
major = v / 1000;
minor = (v / 10) % 10;
- if (v % 10) patch = v % 10;
- } else {
+ if (v % 10)
+ patch = v % 10;
+ }
+ else {
major = v / 10000000;
minor = (v / 100000) % 100;
patch = (v / 1000) % 100;
- if (v % 1000) subpatch = v % 1000;
- }
+ if (v % 1000)
+ subpatch = v % 1000;
+ }
dmxLogOutput(dmxScreen, "Vendor release: %d (XFree86 version: %d.%d",
v, major, minor);
- if (patch > 0) dmxLogOutputCont(dmxScreen, ".%d", patch);
- if (subpatch > 0) dmxLogOutputCont(dmxScreen, ".%d", subpatch);
+ if (patch > 0)
+ dmxLogOutputCont(dmxScreen, ".%d", patch);
+ if (subpatch > 0)
+ dmxLogOutputCont(dmxScreen, ".%d", subpatch);
dmxLogOutputCont(dmxScreen, ")\n");
}
-
- dmxLogOutput(dmxScreen, "Dimensions: %dx%d pixels\n",
+ dmxLogOutput(dmxScreen, "Dimensions: %dx%d pixels\n",
attribs.width, attribs.height);
dmxLogOutput(dmxScreen, "%d depths on screen %d: ", ndepths, scr);
for (i = 0; i < ndepths; i++)
@@ -261,59 +276,65 @@ static void dmxPrintScreenInfo(DMXScreenInfo *dmxScreen)
dmxLogOutput(dmxScreen, "Number of colormaps: %d min, %d max\n",
MinCmapsOfScreen(s), MaxCmapsOfScreen(s));
dmxLogOutput(dmxScreen, "Options: backing-store %s, save-unders %s\n",
- (DoesBackingStore (s) == NotUseful) ? "no" :
- ((DoesBackingStore (s) == Always) ? "yes" : "when mapped"),
- DoesSaveUnders (s) ? "yes" : "no");
+ (DoesBackingStore(s) == NotUseful) ? "no" :
+ ((DoesBackingStore(s) == Always) ? "yes" : "when mapped"),
+ DoesSaveUnders(s) ? "yes" : "no");
dmxLogOutput(dmxScreen, "Window Manager running: %s\n",
- (dmxScreen->WMRunningOnBE) ? "yes" : "no");
+ (dmxScreen->WMRunningOnBE) ? "yes" : "no");
if (dmxScreen->WMRunningOnBE) {
- dmxLogOutputWarning(dmxScreen,
- "Window manager running "
- "-- colormaps not supported\n");
+ dmxLogOutputWarning(dmxScreen,
+ "Window manager running "
+ "-- colormaps not supported\n");
}
XFree(depths);
}
-void dmxGetScreenAttribs(DMXScreenInfo *dmxScreen)
+void
+dmxGetScreenAttribs(DMXScreenInfo * dmxScreen)
{
XWindowAttributes attribs;
- Display *dpy = dmxScreen->beDisplay;
+ Display *dpy = dmxScreen->beDisplay;
+
#ifdef GLXEXT
- int dummy;
+ int dummy;
#endif
XGetWindowAttributes(dpy, DefaultRootWindow(dpy), &attribs);
- dmxScreen->beWidth = attribs.width;
+ dmxScreen->beWidth = attribs.width;
dmxScreen->beHeight = attribs.height;
-
- /* Fill in missing geometry information */
+
+ /* Fill in missing geometry information */
if (dmxScreen->scrnXSign < 0) {
if (dmxScreen->scrnWidth) {
- dmxScreen->scrnX = (attribs.width - dmxScreen->scrnWidth
- - dmxScreen->scrnX);
- } else {
- dmxScreen->scrnWidth = attribs.width - dmxScreen->scrnX;
- dmxScreen->scrnX = 0;
+ dmxScreen->scrnX = (attribs.width - dmxScreen->scrnWidth
+ - dmxScreen->scrnX);
+ }
+ else {
+ dmxScreen->scrnWidth = attribs.width - dmxScreen->scrnX;
+ dmxScreen->scrnX = 0;
}
}
if (dmxScreen->scrnYSign < 0) {
if (dmxScreen->scrnHeight) {
- dmxScreen->scrnY = (attribs.height - dmxScreen->scrnHeight
- - dmxScreen->scrnY);
- } else {
+ dmxScreen->scrnY = (attribs.height - dmxScreen->scrnHeight
+ - dmxScreen->scrnY);
+ }
+ else {
dmxScreen->scrnHeight = attribs.height - dmxScreen->scrnY;
- dmxScreen->scrnY = 0;
+ dmxScreen->scrnY = 0;
}
}
if (!dmxScreen->scrnWidth)
- dmxScreen->scrnWidth = attribs.width - dmxScreen->scrnX;
+ dmxScreen->scrnWidth = attribs.width - dmxScreen->scrnX;
if (!dmxScreen->scrnHeight)
dmxScreen->scrnHeight = attribs.height - dmxScreen->scrnY;
- if (!dmxScreen->rootWidth) dmxScreen->rootWidth = dmxScreen->scrnWidth;
- if (!dmxScreen->rootHeight) dmxScreen->rootHeight = dmxScreen->scrnHeight;
+ if (!dmxScreen->rootWidth)
+ dmxScreen->rootWidth = dmxScreen->scrnWidth;
+ if (!dmxScreen->rootHeight)
+ dmxScreen->rootHeight = dmxScreen->scrnHeight;
if (dmxScreen->rootWidth + dmxScreen->rootX > dmxScreen->scrnWidth)
dmxScreen->rootWidth = dmxScreen->scrnWidth - dmxScreen->rootX;
if (dmxScreen->rootHeight + dmxScreen->rootY > dmxScreen->scrnHeight)
@@ -323,22 +344,25 @@ void dmxGetScreenAttribs(DMXScreenInfo *dmxScreen)
dmxScreen->beXDPI = 75;
dmxScreen->beYDPI = 75;
- dmxScreen->beDepth = attribs.depth; /* FIXME: verify that this
- * works always. In
- * particular, this will work
- * well for depth=16, will fail
- * because of colormap issues
- * at depth 8. More work needs
- * to be done here. */
-
- if (dmxScreen->beDepth <= 8) dmxScreen->beBPP = 8;
- else if (dmxScreen->beDepth <= 16) dmxScreen->beBPP = 16;
- else dmxScreen->beBPP = 32;
+ dmxScreen->beDepth = attribs.depth; /* FIXME: verify that this
+ * works always. In
+ * particular, this will work
+ * well for depth=16, will fail
+ * because of colormap issues
+ * at depth 8. More work needs
+ * to be done here. */
+
+ if (dmxScreen->beDepth <= 8)
+ dmxScreen->beBPP = 8;
+ else if (dmxScreen->beDepth <= 16)
+ dmxScreen->beBPP = 16;
+ else
+ dmxScreen->beBPP = 32;
#ifdef GLXEXT
/* get the majorOpcode for the back-end GLX extension */
XQueryExtension(dpy, "GLX", &dmxScreen->glxMajorOpcode,
- &dummy, &dmxScreen->glxErrorBase);
+ &dummy, &dmxScreen->glxErrorBase);
#endif
dmxPrintScreenInfo(dmxScreen);
@@ -352,47 +376,50 @@ void dmxGetScreenAttribs(DMXScreenInfo *dmxScreen)
"Support for depth == 8 is not complete\n");
}
-Bool dmxGetVisualInfo(DMXScreenInfo *dmxScreen)
+Bool
+dmxGetVisualInfo(DMXScreenInfo * dmxScreen)
{
int i;
XVisualInfo visinfo;
visinfo.screen = DefaultScreen(dmxScreen->beDisplay);
dmxScreen->beVisuals = XGetVisualInfo(dmxScreen->beDisplay,
- VisualScreenMask,
- &visinfo,
- &dmxScreen->beNumVisuals);
+ VisualScreenMask,
+ &visinfo, &dmxScreen->beNumVisuals);
dmxScreen->beDefVisualIndex = -1;
if (defaultColorVisualClass >= 0 || dmxDepth > 0) {
- for (i = 0; i < dmxScreen->beNumVisuals; i++)
- if (defaultColorVisualClass >= 0) {
- if (dmxScreen->beVisuals[i].class == defaultColorVisualClass) {
- if (dmxDepth > 0) {
- if (dmxScreen->beVisuals[i].depth == dmxDepth) {
- dmxScreen->beDefVisualIndex = i;
- break;
- }
- } else {
- dmxScreen->beDefVisualIndex = i;
- break;
- }
- }
- } else if (dmxScreen->beVisuals[i].depth == dmxDepth) {
- dmxScreen->beDefVisualIndex = i;
- break;
- }
- } else {
- visinfo.visualid =
- XVisualIDFromVisual(DefaultVisual(dmxScreen->beDisplay,
- visinfo.screen));
-
- for (i = 0; i < dmxScreen->beNumVisuals; i++)
- if (visinfo.visualid == dmxScreen->beVisuals[i].visualid) {
- dmxScreen->beDefVisualIndex = i;
- break;
- }
+ for (i = 0; i < dmxScreen->beNumVisuals; i++)
+ if (defaultColorVisualClass >= 0) {
+ if (dmxScreen->beVisuals[i].class == defaultColorVisualClass) {
+ if (dmxDepth > 0) {
+ if (dmxScreen->beVisuals[i].depth == dmxDepth) {
+ dmxScreen->beDefVisualIndex = i;
+ break;
+ }
+ }
+ else {
+ dmxScreen->beDefVisualIndex = i;
+ break;
+ }
+ }
+ }
+ else if (dmxScreen->beVisuals[i].depth == dmxDepth) {
+ dmxScreen->beDefVisualIndex = i;
+ break;
+ }
+ }
+ else {
+ visinfo.visualid =
+ XVisualIDFromVisual(DefaultVisual(dmxScreen->beDisplay,
+ visinfo.screen));
+
+ for (i = 0; i < dmxScreen->beNumVisuals; i++)
+ if (visinfo.visualid == dmxScreen->beVisuals[i].visualid) {
+ dmxScreen->beDefVisualIndex = i;
+ break;
+ }
}
for (i = 0; i < dmxScreen->beNumVisuals; i++)
@@ -402,44 +429,45 @@ Bool dmxGetVisualInfo(DMXScreenInfo *dmxScreen)
return dmxScreen->beDefVisualIndex >= 0;
}
-void dmxGetColormaps(DMXScreenInfo *dmxScreen)
+void
+dmxGetColormaps(DMXScreenInfo * dmxScreen)
{
int i;
dmxScreen->beNumDefColormaps = dmxScreen->beNumVisuals;
dmxScreen->beDefColormaps = malloc(dmxScreen->beNumDefColormaps *
- sizeof(*dmxScreen->beDefColormaps));
+ sizeof(*dmxScreen->beDefColormaps));
for (i = 0; i < dmxScreen->beNumDefColormaps; i++)
- dmxScreen->beDefColormaps[i] =
- XCreateColormap(dmxScreen->beDisplay,
- DefaultRootWindow(dmxScreen->beDisplay),
- dmxScreen->beVisuals[i].visual,
- AllocNone);
+ dmxScreen->beDefColormaps[i] =
+ XCreateColormap(dmxScreen->beDisplay,
+ DefaultRootWindow(dmxScreen->beDisplay),
+ dmxScreen->beVisuals[i].visual, AllocNone);
dmxScreen->beBlackPixel = BlackPixel(dmxScreen->beDisplay,
- DefaultScreen(dmxScreen->beDisplay));
+ DefaultScreen(dmxScreen->beDisplay));
dmxScreen->beWhitePixel = WhitePixel(dmxScreen->beDisplay,
- DefaultScreen(dmxScreen->beDisplay));
+ DefaultScreen(dmxScreen->beDisplay));
}
-void dmxGetPixmapFormats(DMXScreenInfo *dmxScreen)
+void
+dmxGetPixmapFormats(DMXScreenInfo * dmxScreen)
{
dmxScreen->beDepths =
- XListDepths(dmxScreen->beDisplay, DefaultScreen(dmxScreen->beDisplay),
- &dmxScreen->beNumDepths);
+ XListDepths(dmxScreen->beDisplay, DefaultScreen(dmxScreen->beDisplay),
+ &dmxScreen->beNumDepths);
dmxScreen->bePixmapFormats =
- XListPixmapFormats(dmxScreen->beDisplay,
- &dmxScreen->beNumPixmapFormats);
+ XListPixmapFormats(dmxScreen->beDisplay,
+ &dmxScreen->beNumPixmapFormats);
}
-static Bool dmxSetPixmapFormats(ScreenInfo *pScreenInfo,
- DMXScreenInfo *dmxScreen)
+static Bool
+dmxSetPixmapFormats(ScreenInfo * pScreenInfo, DMXScreenInfo * dmxScreen)
{
XPixmapFormatValues *bePixmapFormat;
- PixmapFormatRec *format;
- int i, j;
+ PixmapFormatRec *format;
+ int i, j;
pScreenInfo->imageByteOrder = ImageByteOrder(dmxScreen->beDisplay);
pScreenInfo->bitmapScanlineUnit = BitmapUnit(dmxScreen->beDisplay);
@@ -448,53 +476,54 @@ static Bool dmxSetPixmapFormats(ScreenInfo *pScreenInfo,
pScreenInfo->numPixmapFormats = 0;
for (i = 0; i < dmxScreen->beNumPixmapFormats; i++) {
- bePixmapFormat = &dmxScreen->bePixmapFormats[i];
- for (j = 0; j < dmxScreen->beNumDepths; j++)
- if ((bePixmapFormat->depth == 1) ||
- (bePixmapFormat->depth == dmxScreen->beDepths[j])) {
- format = &pScreenInfo->formats[pScreenInfo->numPixmapFormats];
-
- format->depth = bePixmapFormat->depth;
- format->bitsPerPixel = bePixmapFormat->bits_per_pixel;
- format->scanlinePad = bePixmapFormat->scanline_pad;
-
- pScreenInfo->numPixmapFormats++;
- break;
- }
+ bePixmapFormat = &dmxScreen->bePixmapFormats[i];
+ for (j = 0; j < dmxScreen->beNumDepths; j++)
+ if ((bePixmapFormat->depth == 1) ||
+ (bePixmapFormat->depth == dmxScreen->beDepths[j])) {
+ format = &pScreenInfo->formats[pScreenInfo->numPixmapFormats];
+
+ format->depth = bePixmapFormat->depth;
+ format->bitsPerPixel = bePixmapFormat->bits_per_pixel;
+ format->scanlinePad = bePixmapFormat->scanline_pad;
+
+ pScreenInfo->numPixmapFormats++;
+ break;
+ }
}
return TRUE;
}
-void dmxCheckForWM(DMXScreenInfo *dmxScreen)
+void
+dmxCheckForWM(DMXScreenInfo * dmxScreen)
{
Status status;
XWindowAttributes xwa;
status = XGetWindowAttributes(dmxScreen->beDisplay,
- DefaultRootWindow(dmxScreen->beDisplay),
- &xwa);
+ DefaultRootWindow(dmxScreen->beDisplay),
+ &xwa);
dmxScreen->WMRunningOnBE =
- (status &&
- ((xwa.all_event_masks & SubstructureRedirectMask) ||
- (xwa.all_event_masks & SubstructureNotifyMask)));
+ (status &&
+ ((xwa.all_event_masks & SubstructureRedirectMask) ||
+ (xwa.all_event_masks & SubstructureNotifyMask)));
}
/** Initialize the display and collect relevant information about the
* display properties */
-static void dmxDisplayInit(DMXScreenInfo *dmxScreen)
+static void
+dmxDisplayInit(DMXScreenInfo * dmxScreen)
{
if (!dmxOpenDisplay(dmxScreen))
- dmxLog(dmxFatal,
- "dmxOpenDisplay: Unable to open display %s\n",
- dmxScreen->name);
+ dmxLog(dmxFatal,
+ "dmxOpenDisplay: Unable to open display %s\n", dmxScreen->name);
dmxSetErrorHandler(dmxScreen);
dmxCheckForWM(dmxScreen);
dmxGetScreenAttribs(dmxScreen);
if (!dmxGetVisualInfo(dmxScreen))
- dmxLog(dmxFatal, "dmxGetVisualInfo: No matching visuals found\n");
+ dmxLog(dmxFatal, "dmxGetVisualInfo: No matching visuals found\n");
dmxGetColormaps(dmxScreen);
dmxGetPixmapFormats(dmxScreen);
@@ -503,45 +532,52 @@ static void dmxDisplayInit(DMXScreenInfo *dmxScreen)
/* If this doesn't compile, just add || defined(yoursystem) to the line
* below. This information is to help with bug reports and is not
* critical. */
-#if !defined(_POSIX_SOURCE)
-static const char *dmxExecOS(void) { return ""; }
+#if !defined(_POSIX_SOURCE)
+static const char *
+dmxExecOS(void)
+{
+ return "";
+}
#else
#include <sys/utsname.h>
-static const char *dmxExecOS(void)
+static const char *
+dmxExecOS(void)
{
static char buffer[128];
- static int initialized = 0;
+ static int initialized = 0;
struct utsname u;
if (!initialized++) {
memset(buffer, 0, sizeof(buffer));
uname(&u);
- snprintf(buffer, sizeof(buffer)-1, "%s %s %s",
- u.sysname, u.release, u.version);
+ snprintf(buffer, sizeof(buffer) - 1, "%s %s %s",
+ u.sysname, u.release, u.version);
}
return buffer;
}
#endif
-static const char *dmxBuildCompiler(void)
+static const char *
+dmxBuildCompiler(void)
{
static char buffer[128];
- static int initialized = 0;
+ static int initialized = 0;
if (!initialized++) {
memset(buffer, 0, sizeof(buffer));
#if defined(__GNUC__) && defined(__GNUC_MINOR__) &&defined(__GNUC_PATCHLEVEL__)
- snprintf(buffer, sizeof(buffer)-1, "gcc %d.%d.%d",
- __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
+ snprintf(buffer, sizeof(buffer) - 1, "gcc %d.%d.%d",
+ __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
#endif
}
return buffer;
}
-static const char *dmxExecHost(void)
+static const char *
+dmxExecHost(void)
{
static char buffer[128];
- static int initialized = 0;
+ static int initialized = 0;
if (!initialized++) {
memset(buffer, 0, sizeof(buffer));
@@ -551,32 +587,35 @@ static const char *dmxExecHost(void)
}
/** This routine is called in Xserver/dix/main.c from \a main(). */
-void InitOutput(ScreenInfo *pScreenInfo, int argc, char *argv[])
+void
+InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[])
{
- int i;
+ int i;
static unsigned long dmxGeneration = 0;
+
#ifdef GLXEXT
- Bool glxSupported = TRUE;
+ Bool glxSupported = TRUE;
#endif
if (dmxGeneration != serverGeneration) {
- int vendrel = VENDOR_RELEASE;
+ int vendrel = VENDOR_RELEASE;
int major, minor, year, month, day;
-
+
dmxGeneration = serverGeneration;
- major = vendrel / 100000000;
- vendrel -= major * 100000000;
- minor = vendrel / 1000000;
- vendrel -= minor * 1000000;
- year = vendrel / 10000;
- vendrel -= year * 10000;
- month = vendrel / 100;
- vendrel -= month * 100;
- day = vendrel;
+ major = vendrel / 100000000;
+ vendrel -= major * 100000000;
+ minor = vendrel / 1000000;
+ vendrel -= minor * 1000000;
+ year = vendrel / 10000;
+ vendrel -= year * 10000;
+ month = vendrel / 100;
+ vendrel -= month * 100;
+ day = vendrel;
- /* Add other epoch tests here */
- if (major > 0 && minor > 0) year += 2000;
+ /* Add other epoch tests here */
+ if (major > 0 && minor > 0)
+ year += 2000;
dmxLog(dmxInfo, "Generation: %d\n", dmxGeneration);
dmxLog(dmxInfo, "DMX version: %d.%d.%02d%02d%02d (%s)\n",
@@ -600,32 +639,33 @@ void InitOutput(ScreenInfo *pScreenInfo, int argc, char *argv[])
dmxStatFree(dmxScreens[i].stat);
dmxScreens[i].stat = NULL;
}
- for (i = 0; i < dmxNumInputs; i++) dmxInputFree(&dmxInputs[i]);
+ for (i = 0; i < dmxNumInputs; i++)
+ dmxInputFree(&dmxInputs[i]);
free(dmxScreens);
free(dmxInputs);
- dmxScreens = NULL;
- dmxInputs = NULL;
+ dmxScreens = NULL;
+ dmxInputs = NULL;
dmxNumScreens = 0;
- dmxNumInputs = 0;
+ dmxNumInputs = 0;
}
/* Make sure that the command-line arguments are sane. */
if (dmxAddRemoveScreens && dmxGLXProxy) {
- /* Currently it is not possible to support GLX and Render
- * extensions with dynamic screen addition/removal due to the
- * state that each extension keeps, which cannot be restored. */
+ /* Currently it is not possible to support GLX and Render
+ * extensions with dynamic screen addition/removal due to the
+ * state that each extension keeps, which cannot be restored. */
dmxLog(dmxWarning,
- "GLX Proxy and Render extensions do not yet support dynamic\n");
+ "GLX Proxy and Render extensions do not yet support dynamic\n");
dmxLog(dmxWarning,
- "screen addition and removal. Please specify -noglxproxy\n");
+ "screen addition and removal. Please specify -noglxproxy\n");
dmxLog(dmxWarning,
- "and -norender on the command line or in the configuration\n");
+ "and -norender on the command line or in the configuration\n");
dmxLog(dmxWarning,
- "file to disable these two extensions if you wish to use\n");
+ "file to disable these two extensions if you wish to use\n");
dmxLog(dmxWarning,
- "the dynamic addition and removal of screens support.\n");
+ "the dynamic addition and removal of screens support.\n");
dmxLog(dmxFatal,
- "Dynamic screen addition/removal error (see above).\n");
+ "Dynamic screen addition/removal error (see above).\n");
}
/* ddxProcessArgument has been called at this point, but any data
@@ -636,17 +676,16 @@ void InitOutput(ScreenInfo *pScreenInfo, int argc, char *argv[])
dmxLog(dmxFatal, "InitOutput: no back-end displays found\n");
if (!dmxNumInputs)
dmxLog(dmxInfo, "InitOutput: no inputs found\n");
-
+
/* Disable lazy window creation optimization if offscreen
* optimization is disabled */
if (!dmxOffScreenOpt && dmxLazyWindowCreation) {
dmxLog(dmxInfo,
- "InitOutput: Disabling lazy window creation optimization\n");
+ "InitOutput: Disabling lazy window creation optimization\n");
dmxLog(dmxInfo,
- " since it requires the offscreen optimization\n");
- dmxLog(dmxInfo,
- " to function properly.\n");
- dmxLazyWindowCreation = FALSE;
+ " since it requires the offscreen optimization\n");
+ dmxLog(dmxInfo, " to function properly.\n");
+ dmxLazyWindowCreation = FALSE;
}
/* Open each display and gather information about it. */
@@ -662,8 +701,9 @@ void InitOutput(ScreenInfo *pScreenInfo, int argc, char *argv[])
#endif
/* Since we only have a single screen thus far, we only need to set
- the pixmap formats to match that screen. FIXME: this isn't true.*/
- if (!dmxSetPixmapFormats(pScreenInfo, &dmxScreens[0])) return;
+ the pixmap formats to match that screen. FIXME: this isn't true. */
+ if (!dmxSetPixmapFormats(pScreenInfo, &dmxScreens[0]))
+ return;
/* Might want to install a signal handler to allow cleaning up after
* unexpected signals. The DIX/OS layer already handles SIGINT and
@@ -682,93 +722,95 @@ void InitOutput(ScreenInfo *pScreenInfo, int argc, char *argv[])
#ifdef GLXEXT
/* Check if GLX extension exists on all back-end servers */
for (i = 0; i < dmxNumScreens; i++)
- glxSupported &= (dmxScreens[i].glxMajorOpcode > 0);
+ glxSupported &= (dmxScreens[i].glxMajorOpcode > 0);
#endif
/* Tell dix layer about the backend displays */
for (i = 0; i < dmxNumScreens; i++) {
#ifdef GLXEXT
- if (glxSupported) {
- /*
- * Builds GLX configurations from the list of visuals
- * supported by the back-end server, and give that
- * configuration list to the glx layer - so that he will
- * build the visuals accordingly.
- */
-
- DMXScreenInfo *dmxScreen = &dmxScreens[i];
- __GLXvisualConfig *configs = NULL;
- dmxGlxVisualPrivate **configprivs = NULL;
- int nconfigs = 0;
- int (*oldErrorHandler)(Display *, XErrorEvent *);
- int i;
-
- /* Catch errors if when using an older GLX w/o FBconfigs */
- oldErrorHandler = XSetErrorHandler(dmxNOPErrorHandler);
-
- /* Get FBConfigs of the back-end server */
- dmxScreen->fbconfigs = GetGLXFBConfigs(dmxScreen->beDisplay,
- dmxScreen->glxMajorOpcode,
- &dmxScreen->numFBConfigs);
-
- XSetErrorHandler(oldErrorHandler);
-
- dmxScreen->glxVisuals =
- GetGLXVisualConfigs(dmxScreen->beDisplay,
- DefaultScreen(dmxScreen->beDisplay),
- &dmxScreen->numGlxVisuals);
-
- if (dmxScreen->fbconfigs) {
- configs =
- GetGLXVisualConfigsFromFBConfigs(dmxScreen->fbconfigs,
- dmxScreen->numFBConfigs,
- dmxScreen->beVisuals,
- dmxScreen->beNumVisuals,
- dmxScreen->glxVisuals,
- dmxScreen->numGlxVisuals,
- &nconfigs);
- } else {
- configs = dmxScreen->glxVisuals;
- nconfigs = dmxScreen->numGlxVisuals;
- }
-
- configprivs = malloc(nconfigs * sizeof(dmxGlxVisualPrivate*));
-
- if (configs != NULL && configprivs != NULL) {
-
- /* Initialize our private info for each visual
- * (currently only x_visual_depth and x_visual_class)
- */
- for (i = 0; i < nconfigs; i++) {
-
- configprivs[i] = (dmxGlxVisualPrivate *)
- malloc(sizeof(dmxGlxVisualPrivate));
- configprivs[i]->x_visual_depth = 0;
- configprivs[i]->x_visual_class = 0;
-
- /* Find the visual depth */
- if (configs[i].vid > 0) {
- int j;
- for (j = 0; j < dmxScreen->beNumVisuals; j++) {
- if (dmxScreen->beVisuals[j].visualid ==
- configs[i].vid) {
- configprivs[i]->x_visual_depth =
- dmxScreen->beVisuals[j].depth;
- configprivs[i]->x_visual_class =
- dmxScreen->beVisuals[j].class;
- break;
- }
- }
- }
- }
+ if (glxSupported) {
+ /*
+ * Builds GLX configurations from the list of visuals
+ * supported by the back-end server, and give that
+ * configuration list to the glx layer - so that he will
+ * build the visuals accordingly.
+ */
+
+ DMXScreenInfo *dmxScreen = &dmxScreens[i];
+ __GLXvisualConfig *configs = NULL;
+ dmxGlxVisualPrivate **configprivs = NULL;
+ int nconfigs = 0;
+ int (*oldErrorHandler) (Display *, XErrorEvent *);
+ int i;
+
+ /* Catch errors if when using an older GLX w/o FBconfigs */
+ oldErrorHandler = XSetErrorHandler(dmxNOPErrorHandler);
+
+ /* Get FBConfigs of the back-end server */
+ dmxScreen->fbconfigs = GetGLXFBConfigs(dmxScreen->beDisplay,
+ dmxScreen->glxMajorOpcode,
+ &dmxScreen->numFBConfigs);
+
+ XSetErrorHandler(oldErrorHandler);
+
+ dmxScreen->glxVisuals =
+ GetGLXVisualConfigs(dmxScreen->beDisplay,
+ DefaultScreen(dmxScreen->beDisplay),
+ &dmxScreen->numGlxVisuals);
+
+ if (dmxScreen->fbconfigs) {
+ configs =
+ GetGLXVisualConfigsFromFBConfigs(dmxScreen->fbconfigs,
+ dmxScreen->numFBConfigs,
+ dmxScreen->beVisuals,
+ dmxScreen->beNumVisuals,
+ dmxScreen->glxVisuals,
+ dmxScreen->numGlxVisuals,
+ &nconfigs);
+ }
+ else {
+ configs = dmxScreen->glxVisuals;
+ nconfigs = dmxScreen->numGlxVisuals;
+ }
+
+ configprivs = malloc(nconfigs * sizeof(dmxGlxVisualPrivate *));
+
+ if (configs != NULL && configprivs != NULL) {
+
+ /* Initialize our private info for each visual
+ * (currently only x_visual_depth and x_visual_class)
+ */
+ for (i = 0; i < nconfigs; i++) {
+
+ configprivs[i] = (dmxGlxVisualPrivate *)
+ malloc(sizeof(dmxGlxVisualPrivate));
+ configprivs[i]->x_visual_depth = 0;
+ configprivs[i]->x_visual_class = 0;
+
+ /* Find the visual depth */
+ if (configs[i].vid > 0) {
+ int j;
+
+ for (j = 0; j < dmxScreen->beNumVisuals; j++) {
+ if (dmxScreen->beVisuals[j].visualid ==
+ configs[i].vid) {
+ configprivs[i]->x_visual_depth =
+ dmxScreen->beVisuals[j].depth;
+ configprivs[i]->x_visual_class =
+ dmxScreen->beVisuals[j].class;
+ break;
+ }
+ }
+ }
+ }
XFlush(dmxScreen->beDisplay);
- }
- }
-#endif /* GLXEXT */
+ }
+ }
+#endif /* GLXEXT */
- AddScreen(dmxScreenInit, argc, argv);
+ AddScreen(dmxScreenInit, argc, argv);
}
/* Compute origin information. */
@@ -787,30 +829,32 @@ void InitOutput(ScreenInfo *pScreenInfo, int argc, char *argv[])
/* Initialize the render extension */
if (!noRenderExtension)
- dmxInitRender();
+ dmxInitRender();
/* Initialized things that need timer hooks */
dmxStatInit();
dmxSyncInit(); /* Calls RegisterBlockAndWakeupHandlers */
dmxLog(dmxInfo, "Shadow framebuffer support %s\n",
- dmxShadowFB ? "enabled" : "disabled");
+ dmxShadowFB ? "enabled" : "disabled");
}
/* RATS: Assuming the fp string (which comes from the command-line argv
vector) is NULL-terminated, the buffer is large enough for the
- strcpy. */
-static void dmxSetDefaultFontPath(const char *fp)
+ strcpy. */
+static void
+dmxSetDefaultFontPath(const char *fp)
{
if (dmxFontPath) {
- int fplen = strlen(fp) + 1;
- int len = strlen(dmxFontPath);
-
- dmxFontPath = realloc(dmxFontPath, len+fplen+1);
- dmxFontPath[len] = ',';
- strncpy(&dmxFontPath[len+1], fp, fplen);
- } else {
- dmxFontPath = strdup(fp);
+ int fplen = strlen(fp) + 1;
+ int len = strlen(dmxFontPath);
+
+ dmxFontPath = realloc(dmxFontPath, len + fplen + 1);
+ dmxFontPath[len] = ',';
+ strncpy(&dmxFontPath[len + 1], fp, fplen);
+ }
+ else {
+ dmxFontPath = strdup(fp);
}
defaultFontPath = dmxFontPath;
@@ -819,20 +863,23 @@ static void dmxSetDefaultFontPath(const char *fp)
/** This function is called in Xserver/os/utils.c from \a AbortServer().
* We must ensure that backend and console state is restored in the
* event the server shutdown wasn't clean. */
-void AbortDDX(enum ExitCode error)
+void
+AbortDDX(enum ExitCode error)
{
int i;
- for (i=0; i < dmxNumScreens; i++) {
+ for (i = 0; i < dmxNumScreens; i++) {
DMXScreenInfo *dmxScreen = &dmxScreens[i];
-
- if (dmxScreen->beDisplay) XCloseDisplay(dmxScreen->beDisplay);
+
+ if (dmxScreen->beDisplay)
+ XCloseDisplay(dmxScreen->beDisplay);
dmxScreen->beDisplay = NULL;
}
}
#ifdef DDXBEFORERESET
-void ddxBeforeReset(void)
+void
+ddxBeforeReset(void)
{
}
#endif
@@ -840,13 +887,15 @@ void ddxBeforeReset(void)
/** This function is called in Xserver/dix/main.c from \a main() when
* dispatchException & DE_TERMINATE (which is the only way to exit the
* main loop without an interruption. */
-void ddxGiveUp(enum ExitCode error)
+void
+ddxGiveUp(enum ExitCode error)
{
AbortDDX(error);
}
/** This function is called in Xserver/os/osinit.c from \a OsInit(). */
-void OsVendorInit(void)
+void
+OsVendorInit(void)
{
}
@@ -855,100 +904,134 @@ void OsVendorInit(void)
* OsVendorVErrorFProc will cause \a VErrorF() (which is called by the
* two routines mentioned here, as well as by others) to use the
* referenced routine instead of \a vfprintf().) */
-void OsVendorFatalError(void)
+void
+OsVendorFatalError(void)
{
}
/** Process our command line arguments. */
-int ddxProcessArgument(int argc, char *argv[], int i)
+int
+ddxProcessArgument(int argc, char *argv[], int i)
{
int retval = 0;
-
+
if (!strcmp(argv[i], "-display")) {
- if (++i < argc) dmxConfigStoreDisplay(argv[i]);
+ if (++i < argc)
+ dmxConfigStoreDisplay(argv[i]);
retval = 2;
- } else if (!strcmp(argv[i], "-inputfrom") || !strcmp(argv[i], "-input")) {
- if (++i < argc) dmxConfigStoreInput(argv[i]);
+ }
+ else if (!strcmp(argv[i], "-inputfrom") || !strcmp(argv[i], "-input")) {
+ if (++i < argc)
+ dmxConfigStoreInput(argv[i]);
retval = 2;
- } else if (!strcmp(argv[i], "-xinputfrom") || !strcmp(argv[i],"-xinput")) {
- if (++i < argc) dmxConfigStoreXInput(argv[i]);
+ }
+ else if (!strcmp(argv[i], "-xinputfrom") || !strcmp(argv[i], "-xinput")) {
+ if (++i < argc)
+ dmxConfigStoreXInput(argv[i]);
retval = 2;
- } else if (!strcmp(argv[i], "-noshadowfb")) {
+ }
+ else if (!strcmp(argv[i], "-noshadowfb")) {
dmxLog(dmxWarning,
"-noshadowfb has been deprecated "
- "since it is now the default\n");
- dmxShadowFB = FALSE;
- retval = 1;
- } else if (!strcmp(argv[i], "-nomulticursor")) {
+ "since it is now the default\n");
+ dmxShadowFB = FALSE;
+ retval = 1;
+ }
+ else if (!strcmp(argv[i], "-nomulticursor")) {
dmxCursorNoMulti();
- retval = 1;
- } else if (!strcmp(argv[i], "-shadowfb")) {
- dmxShadowFB = TRUE;
- retval = 1;
- } else if (!strcmp(argv[i], "-configfile")) {
- if (++i < argc) dmxConfigStoreFile(argv[i]);
+ retval = 1;
+ }
+ else if (!strcmp(argv[i], "-shadowfb")) {
+ dmxShadowFB = TRUE;
+ retval = 1;
+ }
+ else if (!strcmp(argv[i], "-configfile")) {
+ if (++i < argc)
+ dmxConfigStoreFile(argv[i]);
retval = 2;
- } else if (!strcmp(argv[i], "-config")) {
- if (++i < argc) dmxConfigStoreConfig(argv[i]);
+ }
+ else if (!strcmp(argv[i], "-config")) {
+ if (++i < argc)
+ dmxConfigStoreConfig(argv[i]);
retval = 2;
- } else if (!strcmp(argv[i], "-fontpath")) {
- if (++i < argc) dmxSetDefaultFontPath(argv[i]);
+ }
+ else if (!strcmp(argv[i], "-fontpath")) {
+ if (++i < argc)
+ dmxSetDefaultFontPath(argv[i]);
retval = 2;
- } else if (!strcmp(argv[i], "-stat")) {
- if ((i += 2) < argc) dmxStatActivate(argv[i-1], argv[i]);
+ }
+ else if (!strcmp(argv[i], "-stat")) {
+ if ((i += 2) < argc)
+ dmxStatActivate(argv[i - 1], argv[i]);
retval = 3;
- } else if (!strcmp(argv[i], "-syncbatch")) {
- if (++i < argc) dmxSyncActivate(argv[i]);
+ }
+ else if (!strcmp(argv[i], "-syncbatch")) {
+ if (++i < argc)
+ dmxSyncActivate(argv[i]);
retval = 2;
- } else if (!strcmp(argv[i], "-nooffscreenopt")) {
- dmxOffScreenOpt = FALSE;
+ }
+ else if (!strcmp(argv[i], "-nooffscreenopt")) {
+ dmxOffScreenOpt = FALSE;
retval = 1;
- } else if (!strcmp(argv[i], "-nosubdivprims")) {
- dmxSubdividePrimitives = FALSE;
+ }
+ else if (!strcmp(argv[i], "-nosubdivprims")) {
+ dmxSubdividePrimitives = FALSE;
retval = 1;
- } else if (!strcmp(argv[i], "-nowindowopt")) {
- dmxLazyWindowCreation = FALSE;
+ }
+ else if (!strcmp(argv[i], "-nowindowopt")) {
+ dmxLazyWindowCreation = FALSE;
retval = 1;
- } else if (!strcmp(argv[i], "-noxkb")) {
- dmxUseXKB = FALSE;
+ }
+ else if (!strcmp(argv[i], "-noxkb")) {
+ dmxUseXKB = FALSE;
retval = 1;
- } else if (!strcmp(argv[i], "-depth")) {
- if (++i < argc) dmxDepth = atoi(argv[i]);
+ }
+ else if (!strcmp(argv[i], "-depth")) {
+ if (++i < argc)
+ dmxDepth = atoi(argv[i]);
retval = 2;
- } else if (!strcmp(argv[i], "-norender")) {
- noRenderExtension = TRUE;
+ }
+ else if (!strcmp(argv[i], "-norender")) {
+ noRenderExtension = TRUE;
retval = 1;
#ifdef GLXEXT
- } else if (!strcmp(argv[i], "-noglxproxy")) {
- dmxGLXProxy = FALSE;
+ }
+ else if (!strcmp(argv[i], "-noglxproxy")) {
+ dmxGLXProxy = FALSE;
retval = 1;
- } else if (!strcmp(argv[i], "-noglxswapgroup")) {
- dmxGLXSwapGroupSupport = FALSE;
+ }
+ else if (!strcmp(argv[i], "-noglxswapgroup")) {
+ dmxGLXSwapGroupSupport = FALSE;
retval = 1;
- } else if (!strcmp(argv[i], "-glxsyncswap")) {
- dmxGLXSyncSwap = TRUE;
+ }
+ else if (!strcmp(argv[i], "-glxsyncswap")) {
+ dmxGLXSyncSwap = TRUE;
retval = 1;
- } else if (!strcmp(argv[i], "-glxfinishswap")) {
- dmxGLXFinishSwap = TRUE;
+ }
+ else if (!strcmp(argv[i], "-glxfinishswap")) {
+ dmxGLXFinishSwap = TRUE;
retval = 1;
#endif
- } else if (!strcmp(argv[i], "-ignorebadfontpaths")) {
- dmxIgnoreBadFontPaths = TRUE;
+ }
+ else if (!strcmp(argv[i], "-ignorebadfontpaths")) {
+ dmxIgnoreBadFontPaths = TRUE;
retval = 1;
- } else if (!strcmp(argv[i], "-addremovescreens")) {
- dmxAddRemoveScreens = TRUE;
+ }
+ else if (!strcmp(argv[i], "-addremovescreens")) {
+ dmxAddRemoveScreens = TRUE;
retval = 1;
- } else if (!strcmp(argv[i], "-param")) {
+ }
+ else if (!strcmp(argv[i], "-param")) {
if ((i += 2) < argc) {
- if (!strcasecmp(argv[i-1], "xkbrules"))
+ if (!strcasecmp(argv[i - 1], "xkbrules"))
dmxConfigSetXkbRules(argv[i]);
- else if (!strcasecmp(argv[i-1], "xkbmodel"))
+ else if (!strcasecmp(argv[i - 1], "xkbmodel"))
dmxConfigSetXkbModel(argv[i]);
- else if (!strcasecmp(argv[i-1], "xkblayout"))
+ else if (!strcasecmp(argv[i - 1], "xkblayout"))
dmxConfigSetXkbLayout(argv[i]);
- else if (!strcasecmp(argv[i-1], "xkbvariant"))
+ else if (!strcasecmp(argv[i - 1], "xkbvariant"))
dmxConfigSetXkbVariant(argv[i]);
- else if (!strcasecmp(argv[i-1], "xkboptions"))
+ else if (!strcasecmp(argv[i - 1], "xkboptions"))
dmxConfigSetXkbOptions(argv[i]);
else
dmxLog(dmxWarning,
@@ -957,12 +1040,14 @@ int ddxProcessArgument(int argc, char *argv[], int i)
}
retval = 3;
}
- if (!serverGeneration) dmxConfigSetMaxScreens();
+ if (!serverGeneration)
+ dmxConfigSetMaxScreens();
return retval;
}
/** Provide succinct usage information for the DMX server. */
-void ddxUseMsg(void)
+void
+ddxUseMsg(void)
{
ErrorF("\n\nDevice Dependent Usage:\n");
ErrorF("-display string Specify the back-end display(s)\n");
@@ -990,7 +1075,8 @@ void ddxUseMsg(void)
ErrorF("-glxsyncswap Force XSync after swap buffers\n");
ErrorF("-glxfinishswap Force glFinish after swap buffers\n");
#endif
- ErrorF("-ignorebadfontpaths Ignore bad font paths during initialization\n");
+ ErrorF
+ ("-ignorebadfontpaths Ignore bad font paths during initialization\n");
ErrorF("-addremovescreens Enable dynamic screen addition/removal\n");
ErrorF("-param ... Specify configuration parameters (e.g.,\n");
ErrorF(" XkbRules, XkbModel, XkbLayout, etc.)\n");
@@ -1002,13 +1088,13 @@ void ddxUseMsg(void)
" that display in addition to the backend input. This is\n"
" useful if the backend window does not cover the whole\n"
" physical display.\n\n");
-
+
ErrorF(" Otherwise, if the -input or -xinput string specifies another\n"
" X display, then a console window will be created on that\n"
" display. Placing \",windows\" or \",nowindows\" after the\n"
" display name will control the display of window outlines in\n"
" the console.\n\n");
-
+
ErrorF(" -input or -xinput dummy specifies no input.\n");
ErrorF(" -input or -xinput local specifies the use of a raw keyboard,\n"
" mouse, or other (extension) device:\n"
@@ -1017,7 +1103,7 @@ void ddxUseMsg(void)
" -input local,usb-kbd,usb-mou will use USB devices \n"
" -xinput local,usb-oth will use a non-mouse and\n"
" non-keyboard USB device with XInput\n\n");
-
+
ErrorF(" Special Keys:\n");
ErrorF(" Ctrl-Alt-g Server grab/ungrab (console only)\n");
ErrorF(" Ctrl-Alt-f Fine (1-pixel) mouse mode (console only)\n");
diff --git a/hw/dmx/dmxinit.h b/hw/dmx/dmxinit.h
index 7d166fd85..ce4e2ff4b 100644
--- a/hw/dmx/dmxinit.h
+++ b/hw/dmx/dmxinit.h
@@ -39,12 +39,12 @@
#include "scrnintstr.h"
-extern Bool dmxOpenDisplay(DMXScreenInfo *dmxScreen);
-extern void dmxSetErrorHandler(DMXScreenInfo *dmxScreen);
-extern void dmxCheckForWM(DMXScreenInfo *dmxScreen);
-extern void dmxGetScreenAttribs(DMXScreenInfo *dmxScreen);
-extern Bool dmxGetVisualInfo(DMXScreenInfo *dmxScreen);
-extern void dmxGetColormaps(DMXScreenInfo *dmxScreen);
-extern void dmxGetPixmapFormats(DMXScreenInfo *dmxScreen);
+extern Bool dmxOpenDisplay(DMXScreenInfo * dmxScreen);
+extern void dmxSetErrorHandler(DMXScreenInfo * dmxScreen);
+extern void dmxCheckForWM(DMXScreenInfo * dmxScreen);
+extern void dmxGetScreenAttribs(DMXScreenInfo * dmxScreen);
+extern Bool dmxGetVisualInfo(DMXScreenInfo * dmxScreen);
+extern void dmxGetColormaps(DMXScreenInfo * dmxScreen);
+extern void dmxGetPixmapFormats(DMXScreenInfo * dmxScreen);
-#endif /* DMXINIT_H */
+#endif /* DMXINIT_H */
diff --git a/hw/dmx/dmxinput.c b/hw/dmx/dmxinput.c
index f006af4d2..4ccb43903 100644
--- a/hw/dmx/dmxinput.c
+++ b/hw/dmx/dmxinput.c
@@ -53,7 +53,8 @@
/** Returns TRUE if the key is a valid modifier. For PC-class
* keyboards, all keys can be used as modifiers, so return TRUE
* always. */
-Bool LegalModifier(unsigned int key, DeviceIntPtr pDev)
+Bool
+LegalModifier(unsigned int key, DeviceIntPtr pDev)
{
return TRUE;
}
@@ -61,21 +62,23 @@ Bool LegalModifier(unsigned int key, DeviceIntPtr pDev)
/** Called from dix/main.c on each server generation to initialize
* inputs. All the work is done in dmxInputInit. \see
* dmxInputInit() */
-void InitInput(int argc, char **argv)
+void
+InitInput(int argc, char **argv)
{
- int i;
+ int i;
DMXInputInfo *dmxInput;
if (!dmxNumInputs)
dmxLog(dmxFatal, "InitInput: no inputs specified\n");
-
+
for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++)
dmxInputInit(dmxInput);
mieqInit();
}
-void CloseInput(void)
+void
+CloseInput(void)
{
mieqFini();
}
@@ -83,9 +86,10 @@ void CloseInput(void)
/** Called from dix/dispatch.c in Dispatch() whenever input events
* require processing. All the work is done in the lower level
* routines. */
-void ProcessInputEvents(void)
+void
+ProcessInputEvents(void)
{
- int i;
+ int i;
DMXInputInfo *dmxInput;
for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++)
@@ -97,9 +101,10 @@ void ProcessInputEvents(void)
* windows on the display might have changed. This information is used
* by input drivers (currently only the console driver) that provide
* information about window layout to the user. */
-void dmxUpdateWindowInfo(DMXUpdateType type, WindowPtr pWindow)
+void
+dmxUpdateWindowInfo(DMXUpdateType type, WindowPtr pWindow)
{
- int i;
+ int i;
DMXInputInfo *dmxInput;
for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++)
@@ -108,8 +113,8 @@ void dmxUpdateWindowInfo(DMXUpdateType type, WindowPtr pWindow)
}
int
-NewInputDeviceRequest (InputOption *options, InputAttributes *attrs,
- DeviceIntPtr *pdev)
+NewInputDeviceRequest(InputOption *options, InputAttributes * attrs,
+ DeviceIntPtr *pdev)
{
return BadRequest;
}
diff --git a/hw/dmx/dmxinput.h b/hw/dmx/dmxinput.h
index edfff9fa1..83c9c8b95 100644
--- a/hw/dmx/dmxinput.h
+++ b/hw/dmx/dmxinput.h
@@ -43,7 +43,7 @@
* hw/dmx/input -- the interface defined here should be the only
* interface exported to the hw/dmx layer. \see input/dmxinputinit.c.
*/
-
+
#ifndef DMXINPUT_H
#define DMXINPUT_H
@@ -62,9 +62,9 @@ typedef enum {
DMX_UPDATE_REPARENT /**< Window reparented */
} DMXUpdateType;
-typedef void (*ProcessInputEventsProc)(struct _DMXInputInfo *);
-typedef void (*UpdateWindowInfoProc)(struct _DMXInputInfo *,
- DMXUpdateType, WindowPtr);
+typedef void (*ProcessInputEventsProc) (struct _DMXInputInfo *);
+typedef void (*UpdateWindowInfoProc) (struct _DMXInputInfo *,
+ DMXUpdateType, WindowPtr);
/** An opaque structure that is only exposed in the dmx/input layer. */
typedef struct _DMXLocalInputInfo *DMXLocalInputInfoPtr;
@@ -82,79 +82,79 @@ typedef enum {
* access to the global pointers. However, the elements are only
* available to input-related routines. */
struct _DMXInputInfo {
- const char *name; /**< Name of input display or device
+ const char *name; /**< Name of input display or device
* (from command line or config
* file) */
- Bool freename; /**< If true, free name on destroy */
- Bool detached; /**< If true, input screen is detached */
- int inputIdx; /**< Index into #dmxInputs global */
- int scrnIdx; /**< Index into #dmxScreens global */
- Bool core; /**< If True, initialize these
+ Bool freename; /**< If true, free name on destroy */
+ Bool detached; /**< If true, input screen is detached */
+ int inputIdx; /**< Index into #dmxInputs global */
+ int scrnIdx; /**< Index into #dmxScreens global */
+ Bool core; /**< If True, initialize these
* devices as devices that send core
* events */
- Bool console; /**< True if console and backend
+ Bool console; /**< True if console and backend
* input share the same backend
* display */
- Bool windows; /**< True if window outlines are
+ Bool windows; /**< True if window outlines are
* draw in console */
- ProcessInputEventsProc processInputEvents;
- UpdateWindowInfoProc updateWindowInfo;
+ ProcessInputEventsProc processInputEvents;
+ UpdateWindowInfoProc updateWindowInfo;
- /* Local input information */
- dmxSigioState sigioState; /**< Current stat */
- int sigioFdCount; /**< Number of fds in use */
- int sigioFd[DMX_MAX_SIGIO_FDS]; /**< List of fds */
- Bool sigioAdded[DMX_MAX_SIGIO_FDS]; /**< Active fds */
+ /* Local input information */
+ dmxSigioState sigioState; /**< Current stat */
+ int sigioFdCount; /**< Number of fds in use */
+ int sigioFd[DMX_MAX_SIGIO_FDS]; /**< List of fds */
+ Bool sigioAdded[DMX_MAX_SIGIO_FDS]; /**< Active fds */
-
/** True if a VT switch is pending, but has not yet happened. */
- int vt_switch_pending;
+ int vt_switch_pending;
/** True if a VT switch has happened. */
- int vt_switched;
+ int vt_switched;
/** Number of devices handled in this _DMXInputInfo structure. */
- int numDevs;
+ int numDevs;
/** List of actual input devices. Each _DMXInputInfo structure can
* refer to more than one device. For example, the keyboard and the
* pointer of a backend display; or all of the XInput extension
* devices on a backend display. */
- DMXLocalInputInfoPtr *devs;
+ DMXLocalInputInfoPtr *devs;
- char *keycodes; /**< XKB keycodes from command line */
- char *symbols; /**< XKB symbols from command line */
- char *geometry; /**< XKB geometry from command line */
+ char *keycodes; /**< XKB keycodes from command line */
+ char *symbols; /**< XKB symbols from command line */
+ char *geometry; /**< XKB geometry from command line */
};
-extern int dmxNumInputs; /**< Number of #dmxInputs */
-extern DMXInputInfo *dmxInputs; /**< List of inputs */
+extern int dmxNumInputs; /**< Number of #dmxInputs */
+extern DMXInputInfo *dmxInputs; /**< List of inputs */
-extern void dmxInputInit(DMXInputInfo *dmxInput);
-extern void dmxInputReInit(DMXInputInfo *dmxInput);
-extern void dmxInputLateReInit(DMXInputInfo *dmxInput);
-extern void dmxInputFree(DMXInputInfo *dmxInput);
+extern void dmxInputInit(DMXInputInfo * dmxInput);
+extern void dmxInputReInit(DMXInputInfo * dmxInput);
+extern void dmxInputLateReInit(DMXInputInfo * dmxInput);
+extern void dmxInputFree(DMXInputInfo * dmxInput);
extern void dmxInputLogDevices(void);
extern void dmxUpdateWindowInfo(DMXUpdateType type, WindowPtr pWindow);
/* These functions are defined in input/dmxeq.c */
-extern void dmxeqSwitchScreen(DeviceIntPtr pDev, ScreenPtr pScreen, Bool fromDIX);
+extern void dmxeqSwitchScreen(DeviceIntPtr pDev, ScreenPtr pScreen,
+ Bool fromDIX);
/* This type is used in input/dmxevents.c. Also, these functions are
* defined in input/dmxevents.c */
typedef enum {
DMX_NO_BLOCK = 0,
- DMX_BLOCK = 1
+ DMX_BLOCK = 1
} DMXBlockType;
-extern void dmxGetGlobalPosition(int *x, int *y);
+extern void dmxGetGlobalPosition(int *x, int *y);
extern DMXScreenInfo *dmxFindFirstScreen(int x, int y);
-extern void dmxCoreMotion(DevicePtr pDev, int x, int y, int delta,
- DMXBlockType block);
+extern void dmxCoreMotion(DevicePtr pDev, int x, int y, int delta,
+ DMXBlockType block);
/* Support for dynamic addition of inputs. This functions is defined in
* config/dmxconfig.c */
extern DMXInputInfo *dmxConfigAddInput(const char *name, int core);
-#endif /* DMXINPUT_H */
+#endif /* DMXINPUT_H */
diff --git a/hw/dmx/dmxlog.c b/hw/dmx/dmxlog.c
index 94b803528..b56bb93ed 100644
--- a/hw/dmx/dmxlog.c
+++ b/hw/dmx/dmxlog.c
@@ -49,16 +49,20 @@ static dmxLogLevel dmxCurrentLogLevel = dmxDebug;
/** Set the default level for logging to #dmxLogLevel. Returns the
* previous log level. */
-dmxLogLevel dmxSetLogLevel(dmxLogLevel newLevel)
+dmxLogLevel
+dmxSetLogLevel(dmxLogLevel newLevel)
{
dmxLogLevel oldLevel = dmxCurrentLogLevel;
- if (newLevel > dmxFatal) newLevel = dmxFatal;
+
+ if (newLevel > dmxFatal)
+ newLevel = dmxFatal;
dmxCurrentLogLevel = newLevel;
return oldLevel;
}
/** Returns the log level set by #dmxLogLevel. */
-dmxLogLevel dmxGetLogLevel(void)
+dmxLogLevel
+dmxGetLogLevel(void)
{
return dmxCurrentLogLevel;
}
@@ -68,37 +72,41 @@ dmxLogLevel dmxGetLogLevel(void)
* program, then the ultimate output routines have to be defined. */
/** Provide an ErrorF function when used stand-alone. */
-void ErrorF(const char *format, ...)
+void
+ErrorF(const char *format, ...)
{
va_list args;
va_start(args, format);
- vfprintf(stderr, format, args); /* RATS: We assume the format string
- * is trusted, since it is always
- * from a log message in our code. */
+ vfprintf(stderr, format, args); /* RATS: We assume the format string
+ * is trusted, since it is always
+ * from a log message in our code. */
va_end(args);
}
/** Provide an VFatalError function when used stand-alone. */
-static void VFatalError(const char *format, va_list args)
+static void
+VFatalError(const char *format, va_list args)
{
- vfprintf(stderr, format, args); /* RATS: We assume the format string
- * is trusted, since it is always
- * from a log message in our code. */
+ vfprintf(stderr, format, args); /* RATS: We assume the format string
+ * is trusted, since it is always
+ * from a log message in our code. */
exit(1);
}
/** Provide an VErrorF function when used stand-alone. */
-void VErrorF(const char *format, va_list args)
+void
+VErrorF(const char *format, va_list args)
{
- vfprintf(stderr, format, args); /* RATS: We assume the format string
- * is trusted, since it is always
- * from a log message in our code. */
+ vfprintf(stderr, format, args); /* RATS: We assume the format string
+ * is trusted, since it is always
+ * from a log message in our code. */
}
#else
/** This function was removed between XFree86 4.3.0 and XFree86 4.4.0. */
extern void AbortServer(void);
-static void VFatalError(const char *format, va_list args)
+static void
+VFatalError(const char *format, va_list args)
{
VErrorF(format, args);
ErrorF("\n");
@@ -106,60 +114,75 @@ static void VFatalError(const char *format, va_list args)
OsVendorFatalError();
#endif
AbortServer();
- /*NOTREACHED*/
-}
+ /*NOTREACHED*/}
#endif
/* Prints a consistent header for each line. */
-static void dmxHeader(dmxLogLevel logLevel, DMXInputInfo *dmxInput,
- DMXScreenInfo *dmxScreen)
+static void
+dmxHeader(dmxLogLevel logLevel, DMXInputInfo * dmxInput,
+ DMXScreenInfo * dmxScreen)
{
const char *type = "??";
switch (logLevel) {
- case dmxDebug: type = ".."; break;
- case dmxInfo: type = "II"; break;
- case dmxWarning: type = "**"; break;
- case dmxError: type = "!!"; break;
- case dmxFatal: type = "Fatal Error"; break;
+ case dmxDebug:
+ type = "..";
+ break;
+ case dmxInfo:
+ type = "II";
+ break;
+ case dmxWarning:
+ type = "**";
+ break;
+ case dmxError:
+ type = "!!";
+ break;
+ case dmxFatal:
+ type = "Fatal Error";
+ break;
}
if (dmxInput && dmxScreen) {
ErrorF("(%s) dmx[i%d/%s;o%d/%s]: ", type,
dmxInput->inputIdx, dmxInput->name,
dmxScreen->index, dmxScreen->name);
- } else if (dmxScreen) {
- ErrorF("(%s) dmx[o%d/%s]: ", type,
- dmxScreen->index, dmxScreen->name);
- } else if (dmxInput) {
+ }
+ else if (dmxScreen) {
+ ErrorF("(%s) dmx[o%d/%s]: ", type, dmxScreen->index, dmxScreen->name);
+ }
+ else if (dmxInput) {
const char *pt = strchr(dmxInput->name, ',');
- int len = (pt
- ? (size_t)(pt-dmxInput->name)
- : strlen(dmxInput->name));
+ int len = (pt ? (size_t) (pt - dmxInput->name)
+ : strlen(dmxInput->name));
ErrorF("(%s) dmx[i%d/%*.*s]: ", type,
dmxInput->inputIdx, len, len, dmxInput->name);
- } else {
+ }
+ else {
ErrorF("(%s) dmx: ", type);
}
}
/* Prints the error message with the appropriate low-level X output
* routine. */
-static void dmxMessage(dmxLogLevel logLevel, const char *format, va_list args)
+static void
+dmxMessage(dmxLogLevel logLevel, const char *format, va_list args)
{
if (logLevel == dmxFatal || logLevel >= dmxCurrentLogLevel) {
- if (logLevel == dmxFatal) VFatalError(format, args);
- else VErrorF(format, args);
+ if (logLevel == dmxFatal)
+ VFatalError(format, args);
+ else
+ VErrorF(format, args);
}
}
/** Log the specified message at the specified \a logLevel. \a format
* can be a printf-like format expression. */
-void dmxLog(dmxLogLevel logLevel, const char *format, ...)
+void
+dmxLog(dmxLogLevel logLevel, const char *format, ...)
{
va_list args;
-
+
dmxHeader(logLevel, NULL, NULL);
va_start(args, format);
dmxMessage(logLevel, format, args);
@@ -167,7 +190,8 @@ void dmxLog(dmxLogLevel logLevel, const char *format, ...)
}
/** Continue a log message without printing the message prefix. */
-void dmxLogCont(dmxLogLevel logLevel, const char *format, ...)
+void
+dmxLogCont(dmxLogLevel logLevel, const char *format, ...)
{
va_list args;
@@ -180,7 +204,8 @@ void dmxLogCont(dmxLogLevel logLevel, const char *format, ...)
/** Log an informational message (at level #dmxInfo) related to ouput.
* The message prefix will contain backend information from \a
* dmxScreen. */
-void dmxLogOutput(DMXScreenInfo *dmxScreen, const char *format, ...)
+void
+dmxLogOutput(DMXScreenInfo * dmxScreen, const char *format, ...)
{
va_list args;
@@ -192,7 +217,8 @@ void dmxLogOutput(DMXScreenInfo *dmxScreen, const char *format, ...)
/** Continue a message related to output without printing the message
* prefix. */
-void dmxLogOutputCont(DMXScreenInfo *dmxScreen, const char *format, ...)
+void
+dmxLogOutputCont(DMXScreenInfo * dmxScreen, const char *format, ...)
{
va_list args;
@@ -204,7 +230,8 @@ void dmxLogOutputCont(DMXScreenInfo *dmxScreen, const char *format, ...)
/** Log a warning message (at level #dmxWarning) related to output.
* The message prefix will contain backend information from \a
* dmxScreen. */
-void dmxLogOutputWarning(DMXScreenInfo *dmxScreen, const char *format, ...)
+void
+dmxLogOutputWarning(DMXScreenInfo * dmxScreen, const char *format, ...)
{
va_list args;
@@ -216,7 +243,8 @@ void dmxLogOutputWarning(DMXScreenInfo *dmxScreen, const char *format, ...)
/** Log an informational message (at level #dmxInfo) related to input.
* The message prefix will contain information from \a dmxInput. */
-void dmxLogInput(DMXInputInfo *dmxInput, const char *format, ...)
+void
+dmxLogInput(DMXInputInfo * dmxInput, const char *format, ...)
{
va_list args;
@@ -228,7 +256,8 @@ void dmxLogInput(DMXInputInfo *dmxInput, const char *format, ...)
/** Continue a message related to input without printing the message
* prefix. */
-void dmxLogInputCont(DMXInputInfo *dmxInput, const char *format, ...)
+void
+dmxLogInputCont(DMXInputInfo * dmxInput, const char *format, ...)
{
va_list args;
@@ -239,25 +268,40 @@ void dmxLogInputCont(DMXInputInfo *dmxInput, const char *format, ...)
/** Print \a argc messages, each describing an element in \a argv. This
* is maingly for debugging purposes. */
-void dmxLogArgs(dmxLogLevel logLevel, int argc, char **argv)
+void
+dmxLogArgs(dmxLogLevel logLevel, int argc, char **argv)
{
int i;
+
for (i = 0; i < argc; i++)
dmxLog(logLevel, " Arg[%d] = \"%s\"\n", i, argv[i]);
}
/** Print messages at level #dmxInfo describing the visuals in \a vi. */
-void dmxLogVisual(DMXScreenInfo *dmxScreen, XVisualInfo *vi, int defaultVisual)
+void
+dmxLogVisual(DMXScreenInfo * dmxScreen, XVisualInfo * vi, int defaultVisual)
{
- const char *class = "Unknown";
+ const char *class = "Unknown";
switch (vi->class) {
- case StaticGray: class = "StaticGray "; break;
- case GrayScale: class = "GrayScale "; break;
- case StaticColor: class = "StaticColor"; break;
- case PseudoColor: class = "PseudoColor"; break;
- case TrueColor: class = "TrueColor "; break;
- case DirectColor: class = "DirectColor"; break;
+ case StaticGray:
+ class = "StaticGray ";
+ break;
+ case GrayScale:
+ class = "GrayScale ";
+ break;
+ case StaticColor:
+ class = "StaticColor";
+ break;
+ case PseudoColor:
+ class = "PseudoColor";
+ break;
+ case TrueColor:
+ class = "TrueColor ";
+ break;
+ case DirectColor:
+ class = "DirectColor";
+ break;
}
if (dmxScreen) {
@@ -267,7 +311,8 @@ void dmxLogVisual(DMXScreenInfo *dmxScreen, XVisualInfo *vi, int defaultVisual)
vi->colormap_size,
vi->red_mask, vi->green_mask, vi->blue_mask,
defaultVisual ? " *" : "");
- } else {
+ }
+ else {
dmxLog(dmxInfo,
" 0x%02x %s %2db %db/rgb %3d 0x%04x 0x%04x 0x%04x%s\n",
vi->visualid, class, vi->depth, vi->bits_per_rgb,
@@ -279,68 +324,119 @@ void dmxLogVisual(DMXScreenInfo *dmxScreen, XVisualInfo *vi, int defaultVisual)
/** Translate a (normalized) XInput event \a type into a human-readable
* string. */
-const char *dmxXInputEventName(int type)
+const char *
+dmxXInputEventName(int type)
{
switch (type) {
- case XI_DeviceValuator: return "XI_DeviceValuator";
- case XI_DeviceKeyPress: return "XI_DeviceKeyPress";
- case XI_DeviceKeyRelease: return "XI_DeviceKeyRelease";
- case XI_DeviceButtonPress: return "XI_DeviceButtonPress";
- case XI_DeviceButtonRelease: return "XI_DeviceButtonRelease";
- case XI_DeviceMotionNotify: return "XI_DeviceMotionNotify";
- case XI_DeviceFocusIn: return "XI_DeviceFocusIn";
- case XI_DeviceFocusOut: return "XI_DeviceFocusOut";
- case XI_ProximityIn: return "XI_ProximityIn";
- case XI_ProximityOut: return "XI_ProximityOut";
- case XI_DeviceStateNotify: return "XI_DeviceStateNotify";
- case XI_DeviceMappingNotify: return "XI_DeviceMappingNotify";
- case XI_ChangeDeviceNotify: return "XI_ChangeDeviceNotify";
- case XI_DeviceKeystateNotify: return "XI_DeviceKeystateNotify";
- case XI_DeviceButtonstateNotify: return "XI_DeviceButtonstateNotify";
- default: return "unknown";
+ case XI_DeviceValuator:
+ return "XI_DeviceValuator";
+ case XI_DeviceKeyPress:
+ return "XI_DeviceKeyPress";
+ case XI_DeviceKeyRelease:
+ return "XI_DeviceKeyRelease";
+ case XI_DeviceButtonPress:
+ return "XI_DeviceButtonPress";
+ case XI_DeviceButtonRelease:
+ return "XI_DeviceButtonRelease";
+ case XI_DeviceMotionNotify:
+ return "XI_DeviceMotionNotify";
+ case XI_DeviceFocusIn:
+ return "XI_DeviceFocusIn";
+ case XI_DeviceFocusOut:
+ return "XI_DeviceFocusOut";
+ case XI_ProximityIn:
+ return "XI_ProximityIn";
+ case XI_ProximityOut:
+ return "XI_ProximityOut";
+ case XI_DeviceStateNotify:
+ return "XI_DeviceStateNotify";
+ case XI_DeviceMappingNotify:
+ return "XI_DeviceMappingNotify";
+ case XI_ChangeDeviceNotify:
+ return "XI_ChangeDeviceNotify";
+ case XI_DeviceKeystateNotify:
+ return "XI_DeviceKeystateNotify";
+ case XI_DeviceButtonstateNotify:
+ return "XI_DeviceButtonstateNotify";
+ default:
+ return "unknown";
}
}
#endif
/** Translate an event \a type into a human-readable string. */
-const char *dmxEventName(int type)
+const char *
+dmxEventName(int type)
{
switch (type) {
- case KeyPress: return "KeyPress";
- case KeyRelease: return "KeyRelease";
- case ButtonPress: return "ButtonPress";
- case ButtonRelease: return "ButtonRelease";
- case MotionNotify: return "MotionNotify";
- case EnterNotify: return "EnterNotify";
- case LeaveNotify: return "LeaveNotify";
- case FocusIn: return "FocusIn";
- case FocusOut: return "FocusOut";
- case KeymapNotify: return "KeymapNotify";
- case Expose: return "Expose";
- case GraphicsExpose: return "GraphicsExpose";
- case NoExpose: return "NoExpose";
- case VisibilityNotify: return "VisibilityNotify";
- case CreateNotify: return "CreateNotify";
- case DestroyNotify: return "DestroyNotify";
- case UnmapNotify: return "UnmapNotify";
- case MapNotify: return "MapNotify";
- case MapRequest: return "MapRequest";
- case ReparentNotify: return "ReparentNotify";
- case ConfigureNotify: return "ConfigureNotify";
- case ConfigureRequest: return "ConfigureRequest";
- case GravityNotify: return "GravityNotify";
- case ResizeRequest: return "ResizeRequest";
- case CirculateNotify: return "CirculateNotify";
- case CirculateRequest: return "CirculateRequest";
- case PropertyNotify: return "PropertyNotify";
- case SelectionClear: return "SelectionClear";
- case SelectionRequest: return "SelectionRequest";
- case SelectionNotify: return "SelectionNotify";
- case ColormapNotify: return "ColormapNotify";
- case ClientMessage: return "ClientMessage";
- case MappingNotify: return "MappingNotify";
- default: return "<unknown>";
+ case KeyPress:
+ return "KeyPress";
+ case KeyRelease:
+ return "KeyRelease";
+ case ButtonPress:
+ return "ButtonPress";
+ case ButtonRelease:
+ return "ButtonRelease";
+ case MotionNotify:
+ return "MotionNotify";
+ case EnterNotify:
+ return "EnterNotify";
+ case LeaveNotify:
+ return "LeaveNotify";
+ case FocusIn:
+ return "FocusIn";
+ case FocusOut:
+ return "FocusOut";
+ case KeymapNotify:
+ return "KeymapNotify";
+ case Expose:
+ return "Expose";
+ case GraphicsExpose:
+ return "GraphicsExpose";
+ case NoExpose:
+ return "NoExpose";
+ case VisibilityNotify:
+ return "VisibilityNotify";
+ case CreateNotify:
+ return "CreateNotify";
+ case DestroyNotify:
+ return "DestroyNotify";
+ case UnmapNotify:
+ return "UnmapNotify";
+ case MapNotify:
+ return "MapNotify";
+ case MapRequest:
+ return "MapRequest";
+ case ReparentNotify:
+ return "ReparentNotify";
+ case ConfigureNotify:
+ return "ConfigureNotify";
+ case ConfigureRequest:
+ return "ConfigureRequest";
+ case GravityNotify:
+ return "GravityNotify";
+ case ResizeRequest:
+ return "ResizeRequest";
+ case CirculateNotify:
+ return "CirculateNotify";
+ case CirculateRequest:
+ return "CirculateRequest";
+ case PropertyNotify:
+ return "PropertyNotify";
+ case SelectionClear:
+ return "SelectionClear";
+ case SelectionRequest:
+ return "SelectionRequest";
+ case SelectionNotify:
+ return "SelectionNotify";
+ case ColormapNotify:
+ return "ColormapNotify";
+ case ClientMessage:
+ return "ClientMessage";
+ case MappingNotify:
+ return "MappingNotify";
+ default:
+ return "<unknown>";
}
}
-
diff --git a/hw/dmx/dmxlog.h b/hw/dmx/dmxlog.h
index 7b614bd73..4d4cd269a 100644
--- a/hw/dmx/dmxlog.h
+++ b/hw/dmx/dmxlog.h
@@ -55,20 +55,20 @@ typedef enum {
/* Logging functions used by Xserver/hw/dmx routines. */
extern dmxLogLevel dmxSetLogLevel(dmxLogLevel newLevel);
extern dmxLogLevel dmxGetLogLevel(void);
-extern void dmxLog(dmxLogLevel logLevel, const char *format, ...);
-extern void dmxLogCont(dmxLogLevel logLevel, const char *format, ...);
-extern const char *dmxEventName(int type);
+extern void dmxLog(dmxLogLevel logLevel, const char *format, ...);
+extern void dmxLogCont(dmxLogLevel logLevel, const char *format, ...);
+extern const char *dmxEventName(int type);
#ifndef DMX_LOG_STANDALONE
-extern void dmxLogOutput(DMXScreenInfo *dmxScreen, const char *format, ...);
-extern void dmxLogOutputCont(DMXScreenInfo *dmxScreen, const char *format,
+extern void dmxLogOutput(DMXScreenInfo * dmxScreen, const char *format, ...);
+extern void dmxLogOutputCont(DMXScreenInfo * dmxScreen, const char *format,
...);
-extern void dmxLogOutputWarning(DMXScreenInfo *dmxScreen, const char *format,
+extern void dmxLogOutputWarning(DMXScreenInfo * dmxScreen, const char *format,
...);
-extern void dmxLogInput(DMXInputInfo *dmxInput, const char *format, ...);
-extern void dmxLogInputCont(DMXInputInfo *dmxInput, const char *format, ...);
+extern void dmxLogInput(DMXInputInfo * dmxInput, const char *format, ...);
+extern void dmxLogInputCont(DMXInputInfo * dmxInput, const char *format, ...);
extern void dmxLogArgs(dmxLogLevel logLevel, int argc, char **argv);
-extern void dmxLogVisual(DMXScreenInfo *dmxScreen, XVisualInfo *vi,
+extern void dmxLogVisual(DMXScreenInfo * dmxScreen, XVisualInfo * vi,
int defaultVisual);
extern const char *dmxXInputEventName(int type);
#endif
diff --git a/hw/dmx/dmxpict.c b/hw/dmx/dmxpict.c
index 1fb54620a..b1177cf41 100644
--- a/hw/dmx/dmxpict.c
+++ b/hw/dmx/dmxpict.c
@@ -57,12 +57,10 @@
#include "mipict.h"
#include "fbpict.h"
-
extern int RenderErrBase;
-extern int (*ProcRenderVector[RenderNumberRequests])(ClientPtr);
-
-static int (*dmxSaveRenderVector[RenderNumberRequests])(ClientPtr);
+extern int (*ProcRenderVector[RenderNumberRequests]) (ClientPtr);
+static int (*dmxSaveRenderVector[RenderNumberRequests]) (ClientPtr);
static int dmxProcRenderCreateGlyphSet(ClientPtr client);
static int dmxProcRenderFreeGlyphSet(ClientPtr client);
@@ -71,6 +69,7 @@ static int dmxProcRenderFreeGlyphs(ClientPtr client);
static int dmxProcRenderCompositeGlyphs(ClientPtr client);
static int dmxProcRenderSetPictureTransform(ClientPtr client);
static int dmxProcRenderSetPictureFilter(ClientPtr client);
+
#if 0
/* FIXME: Not (yet) supported */
static int dmxProcRenderCreateCursor(ClientPtr client);
@@ -80,20 +79,21 @@ static int dmxProcRenderCreateAnimCursor(ClientPtr client);
/** Catch errors that might occur when allocating Glyph Sets. Errors
* are saved in dmxGlyphLastError for later handling. */
static int dmxGlyphLastError;
-static int dmxGlyphErrorHandler(Display *dpy, XErrorEvent *ev)
+static int
+dmxGlyphErrorHandler(Display * dpy, XErrorEvent * ev)
{
dmxGlyphLastError = ev->error_code;
return 0;
}
-
/** Initialize the Proc Vector for the RENDER extension. The functions
* here cannot be handled by the mi layer RENDER hooks either because
* the required information is no longer available when it reaches the
* mi layer or no mi layer hooks exist. This function is called from
* InitOutput() since it should be initialized only once per server
* generation. */
-void dmxInitRender(void)
+void
+dmxInitRender(void)
{
int i;
@@ -101,29 +101,30 @@ void dmxInitRender(void)
dmxSaveRenderVector[i] = ProcRenderVector[i];
ProcRenderVector[X_RenderCreateGlyphSet]
- = dmxProcRenderCreateGlyphSet;
+ = dmxProcRenderCreateGlyphSet;
ProcRenderVector[X_RenderFreeGlyphSet]
- = dmxProcRenderFreeGlyphSet;
+ = dmxProcRenderFreeGlyphSet;
ProcRenderVector[X_RenderAddGlyphs]
- = dmxProcRenderAddGlyphs;
+ = dmxProcRenderAddGlyphs;
ProcRenderVector[X_RenderFreeGlyphs]
- = dmxProcRenderFreeGlyphs;
+ = dmxProcRenderFreeGlyphs;
ProcRenderVector[X_RenderCompositeGlyphs8]
- = dmxProcRenderCompositeGlyphs;
+ = dmxProcRenderCompositeGlyphs;
ProcRenderVector[X_RenderCompositeGlyphs16]
- = dmxProcRenderCompositeGlyphs;
+ = dmxProcRenderCompositeGlyphs;
ProcRenderVector[X_RenderCompositeGlyphs32]
- = dmxProcRenderCompositeGlyphs;
+ = dmxProcRenderCompositeGlyphs;
ProcRenderVector[X_RenderSetPictureTransform]
- = dmxProcRenderSetPictureTransform;
+ = dmxProcRenderSetPictureTransform;
ProcRenderVector[X_RenderSetPictureFilter]
- = dmxProcRenderSetPictureFilter;
+ = dmxProcRenderSetPictureFilter;
}
/** Reset the Proc Vector for the RENDER extension back to the original
* functions. This function is called from dmxCloseScreen() during the
* server reset (only for screen #0). */
-void dmxResetRender(void)
+void
+dmxResetRender(void)
{
int i;
@@ -134,104 +135,120 @@ void dmxResetRender(void)
/** Initialize the RENDER extension, allocate the picture privates and
* wrap mi function hooks. If the shadow frame buffer is used, then
* call the appropriate fb initialization function. */
-Bool dmxPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats)
+Bool
+dmxPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats)
{
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- PictureScreenPtr ps;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ PictureScreenPtr ps;
/* The shadow framebuffer only relies on FB to be initialized */
- if (dmxShadowFB) return fbPictureInit(pScreen, formats, nformats);
+ if (dmxShadowFB)
+ return fbPictureInit(pScreen, formats, nformats);
if (!miPictureInit(pScreen, formats, nformats))
- return FALSE;
+ return FALSE;
- if (!dixRegisterPrivateKey(&dmxPictPrivateKeyRec, PRIVATE_PICTURE, sizeof(dmxPictPrivRec)))
- return FALSE;
+ if (!dixRegisterPrivateKey
+ (&dmxPictPrivateKeyRec, PRIVATE_PICTURE, sizeof(dmxPictPrivRec)))
+ return FALSE;
ps = GetPictureScreen(pScreen);
- DMX_WRAP(CreatePicture, dmxCreatePicture, dmxScreen, ps);
- DMX_WRAP(DestroyPicture, dmxDestroyPicture, dmxScreen, ps);
+ DMX_WRAP(CreatePicture, dmxCreatePicture, dmxScreen, ps);
+ DMX_WRAP(DestroyPicture, dmxDestroyPicture, dmxScreen, ps);
- DMX_WRAP(ChangePictureClip, dmxChangePictureClip, dmxScreen, ps);
+ DMX_WRAP(ChangePictureClip, dmxChangePictureClip, dmxScreen, ps);
DMX_WRAP(DestroyPictureClip, dmxDestroyPictureClip, dmxScreen, ps);
- DMX_WRAP(ChangePicture, dmxChangePicture, dmxScreen, ps);
- DMX_WRAP(ValidatePicture, dmxValidatePicture, dmxScreen, ps);
+ DMX_WRAP(ChangePicture, dmxChangePicture, dmxScreen, ps);
+ DMX_WRAP(ValidatePicture, dmxValidatePicture, dmxScreen, ps);
- DMX_WRAP(Composite, dmxComposite, dmxScreen, ps);
- DMX_WRAP(Glyphs, dmxGlyphs, dmxScreen, ps);
- DMX_WRAP(CompositeRects, dmxCompositeRects, dmxScreen, ps);
+ DMX_WRAP(Composite, dmxComposite, dmxScreen, ps);
+ DMX_WRAP(Glyphs, dmxGlyphs, dmxScreen, ps);
+ DMX_WRAP(CompositeRects, dmxCompositeRects, dmxScreen, ps);
- DMX_WRAP(Trapezoids, dmxTrapezoids, dmxScreen, ps);
- DMX_WRAP(Triangles, dmxTriangles, dmxScreen, ps);
+ DMX_WRAP(Trapezoids, dmxTrapezoids, dmxScreen, ps);
+ DMX_WRAP(Triangles, dmxTriangles, dmxScreen, ps);
return TRUE;
}
-
/** Find the appropriate format on the requested screen given the
* internal format requested. The list of formats is searched
* sequentially as the XRenderFindFormat() function does not always
* find the appropriate format when a specific format is requested. */
-static XRenderPictFormat *dmxFindFormat(DMXScreenInfo *dmxScreen,
- PictFormatPtr pFmt)
+static XRenderPictFormat *
+dmxFindFormat(DMXScreenInfo * dmxScreen, PictFormatPtr pFmt)
{
XRenderPictFormat *pFormat = NULL;
- int i = 0;
+ int i = 0;
- if (!pFmt || !dmxScreen->beDisplay) return pFormat;
+ if (!pFmt || !dmxScreen->beDisplay)
+ return pFormat;
while (1) {
- pFormat = XRenderFindFormat(dmxScreen->beDisplay, 0, 0, i++);
- if (!pFormat) break;
-
- if (pFormat->type != pFmt->type) continue;
- if (pFormat->depth != pFmt->depth) continue;
- if (pFormat->direct.red != pFmt->direct.red) continue;
- if (pFormat->direct.redMask != pFmt->direct.redMask) continue;
- if (pFormat->direct.green != pFmt->direct.green) continue;
- if (pFormat->direct.greenMask != pFmt->direct.greenMask) continue;
- if (pFormat->direct.blue != pFmt->direct.blue) continue;
- if (pFormat->direct.blueMask != pFmt->direct.blueMask) continue;
- if (pFormat->direct.alpha != pFmt->direct.alpha) continue;
- if (pFormat->direct.alphaMask != pFmt->direct.alphaMask) continue;
-
- /* We have a match! */
- break;
+ pFormat = XRenderFindFormat(dmxScreen->beDisplay, 0, 0, i++);
+ if (!pFormat)
+ break;
+
+ if (pFormat->type != pFmt->type)
+ continue;
+ if (pFormat->depth != pFmt->depth)
+ continue;
+ if (pFormat->direct.red != pFmt->direct.red)
+ continue;
+ if (pFormat->direct.redMask != pFmt->direct.redMask)
+ continue;
+ if (pFormat->direct.green != pFmt->direct.green)
+ continue;
+ if (pFormat->direct.greenMask != pFmt->direct.greenMask)
+ continue;
+ if (pFormat->direct.blue != pFmt->direct.blue)
+ continue;
+ if (pFormat->direct.blueMask != pFmt->direct.blueMask)
+ continue;
+ if (pFormat->direct.alpha != pFmt->direct.alpha)
+ continue;
+ if (pFormat->direct.alphaMask != pFmt->direct.alphaMask)
+ continue;
+
+ /* We have a match! */
+ break;
}
return pFormat;
}
/** Free \a glyphSet on back-end screen number \a idx. */
-Bool dmxBEFreeGlyphSet(ScreenPtr pScreen, GlyphSetPtr glyphSet)
+Bool
+dmxBEFreeGlyphSet(ScreenPtr pScreen, GlyphSetPtr glyphSet)
{
- dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
- int idx = pScreen->myNum;
- DMXScreenInfo *dmxScreen = &dmxScreens[idx];
+ dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
+ int idx = pScreen->myNum;
+ DMXScreenInfo *dmxScreen = &dmxScreens[idx];
if (glyphPriv->glyphSets[idx]) {
- XRenderFreeGlyphSet(dmxScreen->beDisplay, glyphPriv->glyphSets[idx]);
- glyphPriv->glyphSets[idx] = (GlyphSet)0;
- return TRUE;
+ XRenderFreeGlyphSet(dmxScreen->beDisplay, glyphPriv->glyphSets[idx]);
+ glyphPriv->glyphSets[idx] = (GlyphSet) 0;
+ return TRUE;
}
return FALSE;
}
/** Create \a glyphSet on the backend screen number \a idx. */
-int dmxBECreateGlyphSet(int idx, GlyphSetPtr glyphSet)
+int
+dmxBECreateGlyphSet(int idx, GlyphSetPtr glyphSet)
{
XRenderPictFormat *pFormat;
- DMXScreenInfo *dmxScreen = &dmxScreens[idx];
- dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
- PictFormatPtr pFmt = glyphSet->format;
- int (*oldErrorHandler)(Display *, XErrorEvent *);
+ DMXScreenInfo *dmxScreen = &dmxScreens[idx];
+ dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
+ PictFormatPtr pFmt = glyphSet->format;
+ int (*oldErrorHandler) (Display *, XErrorEvent *);
pFormat = dmxFindFormat(dmxScreen, pFmt);
if (!pFormat) {
- return BadMatch;
+ return BadMatch;
}
dmxGlyphLastError = 0;
@@ -239,12 +256,12 @@ int dmxBECreateGlyphSet(int idx, GlyphSetPtr glyphSet)
/* Catch when this fails */
glyphPriv->glyphSets[idx]
- = XRenderCreateGlyphSet(dmxScreen->beDisplay, pFormat);
+ = XRenderCreateGlyphSet(dmxScreen->beDisplay, pFormat);
XSetErrorHandler(oldErrorHandler);
if (dmxGlyphLastError) {
- return dmxGlyphLastError;
+ return dmxGlyphLastError;
}
return Success;
@@ -254,141 +271,147 @@ int dmxBECreateGlyphSet(int idx, GlyphSetPtr glyphSet)
* screen in the Glyph Set's private structure. Fail if the format
* requested is not available or if the Glyph Set cannot be created on
* the screen. */
-static int dmxProcRenderCreateGlyphSet(ClientPtr client)
+static int
+dmxProcRenderCreateGlyphSet(ClientPtr client)
{
- int ret;
+ int ret;
+
REQUEST(xRenderCreateGlyphSetReq);
- ret = dmxSaveRenderVector[stuff->renderReqType](client);
+ ret = dmxSaveRenderVector[stuff->renderReqType] (client);
if (ret == Success) {
- GlyphSetPtr glyphSet;
- dmxGlyphPrivPtr glyphPriv;
- int i;
+ GlyphSetPtr glyphSet;
+ dmxGlyphPrivPtr glyphPriv;
+ int i;
- /* Look up glyphSet that was just created ???? */
- /* Store glyphsets from backends in glyphSet->devPrivate ????? */
- /* Make sure we handle all errors here!! */
+ /* Look up glyphSet that was just created ???? */
+ /* Store glyphsets from backends in glyphSet->devPrivate ????? */
+ /* Make sure we handle all errors here!! */
- dixLookupResourceByType((pointer*) &glyphSet,
- stuff->gsid, GlyphSetType,
- client, DixDestroyAccess);
+ dixLookupResourceByType((pointer *) &glyphSet,
+ stuff->gsid, GlyphSetType,
+ client, DixDestroyAccess);
- glyphPriv = malloc(sizeof(dmxGlyphPrivRec));
- if (!glyphPriv) return BadAlloc;
+ glyphPriv = malloc(sizeof(dmxGlyphPrivRec));
+ if (!glyphPriv)
+ return BadAlloc;
glyphPriv->glyphSets = NULL;
MAXSCREENSALLOC_RETURN(glyphPriv->glyphSets, BadAlloc);
- DMX_SET_GLYPH_PRIV(glyphSet, glyphPriv);
+ DMX_SET_GLYPH_PRIV(glyphSet, glyphPriv);
- for (i = 0; i < dmxNumScreens; i++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[i];
- int beret;
+ for (i = 0; i < dmxNumScreens; i++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[i];
+ int beret;
- if (!dmxScreen->beDisplay) {
- glyphPriv->glyphSets[i] = 0;
- continue;
- }
+ if (!dmxScreen->beDisplay) {
+ glyphPriv->glyphSets[i] = 0;
+ continue;
+ }
- if ((beret = dmxBECreateGlyphSet(i, glyphSet)) != Success) {
- int j;
+ if ((beret = dmxBECreateGlyphSet(i, glyphSet)) != Success) {
+ int j;
- /* Free the glyph sets we've allocated thus far */
- for (j = 0; j < i; j++)
- dmxBEFreeGlyphSet(screenInfo.screens[j], glyphSet);
+ /* Free the glyph sets we've allocated thus far */
+ for (j = 0; j < i; j++)
+ dmxBEFreeGlyphSet(screenInfo.screens[j], glyphSet);
- /* Free the resource created by render */
- FreeResource(stuff->gsid, RT_NONE);
+ /* Free the resource created by render */
+ FreeResource(stuff->gsid, RT_NONE);
- return beret;
- }
- }
+ return beret;
+ }
+ }
}
return ret;
}
/** Free the previously allocated Glyph Sets for each screen. */
-static int dmxProcRenderFreeGlyphSet(ClientPtr client)
+static int
+dmxProcRenderFreeGlyphSet(ClientPtr client)
{
- GlyphSetPtr glyphSet;
+ GlyphSetPtr glyphSet;
+
REQUEST(xRenderFreeGlyphSetReq);
REQUEST_SIZE_MATCH(xRenderFreeGlyphSetReq);
- dixLookupResourceByType((pointer*) &glyphSet,
- stuff->glyphset, GlyphSetType,
- client, DixDestroyAccess);
+ dixLookupResourceByType((pointer *) &glyphSet,
+ stuff->glyphset, GlyphSetType,
+ client, DixDestroyAccess);
if (glyphSet && glyphSet->refcnt == 1) {
- dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
- int i;
-
- for (i = 0; i < dmxNumScreens; i++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[i];
-
- if (dmxScreen->beDisplay) {
- if (dmxBEFreeGlyphSet(screenInfo.screens[i], glyphSet))
- dmxSync(dmxScreen, FALSE);
- }
- }
+ dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
+ int i;
+
+ for (i = 0; i < dmxNumScreens; i++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[i];
+
+ if (dmxScreen->beDisplay) {
+ if (dmxBEFreeGlyphSet(screenInfo.screens[i], glyphSet))
+ dmxSync(dmxScreen, FALSE);
+ }
+ }
MAXSCREENSFREE(glyphPriv->glyphSets);
- free(glyphPriv);
- DMX_SET_GLYPH_PRIV(glyphSet, NULL);
+ free(glyphPriv);
+ DMX_SET_GLYPH_PRIV(glyphSet, NULL);
}
- return dmxSaveRenderVector[stuff->renderReqType](client);
+ return dmxSaveRenderVector[stuff->renderReqType] (client);
}
/** Add glyphs to the Glyph Set on each screen. */
-static int dmxProcRenderAddGlyphs(ClientPtr client)
+static int
+dmxProcRenderAddGlyphs(ClientPtr client)
{
- int ret;
+ int ret;
+
REQUEST(xRenderAddGlyphsReq);
- ret = dmxSaveRenderVector[stuff->renderReqType](client);
+ ret = dmxSaveRenderVector[stuff->renderReqType] (client);
if (ret == Success) {
- GlyphSetPtr glyphSet;
- dmxGlyphPrivPtr glyphPriv;
- int i;
- int nglyphs;
- CARD32 *gids;
- Glyph *gidsCopy;
- xGlyphInfo *gi;
- CARD8 *bits;
- int nbytes;
-
- dixLookupResourceByType((pointer*) &glyphSet,
- stuff->glyphset, GlyphSetType,
- client, DixReadAccess);
- glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
-
- nglyphs = stuff->nglyphs;
- gids = (CARD32 *)(stuff + 1);
- gi = (xGlyphInfo *)(gids + nglyphs);
- bits = (CARD8 *)(gi + nglyphs);
- nbytes = ((stuff->length << 2) -
- sizeof(xRenderAddGlyphsReq) -
- (sizeof(CARD32) + sizeof(xGlyphInfo)) * nglyphs);
+ GlyphSetPtr glyphSet;
+ dmxGlyphPrivPtr glyphPriv;
+ int i;
+ int nglyphs;
+ CARD32 *gids;
+ Glyph *gidsCopy;
+ xGlyphInfo *gi;
+ CARD8 *bits;
+ int nbytes;
+
+ dixLookupResourceByType((pointer *) &glyphSet,
+ stuff->glyphset, GlyphSetType,
+ client, DixReadAccess);
+ glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
+
+ nglyphs = stuff->nglyphs;
+ gids = (CARD32 *) (stuff + 1);
+ gi = (xGlyphInfo *) (gids + nglyphs);
+ bits = (CARD8 *) (gi + nglyphs);
+ nbytes = ((stuff->length << 2) -
+ sizeof(xRenderAddGlyphsReq) -
+ (sizeof(CARD32) + sizeof(xGlyphInfo)) * nglyphs);
gidsCopy = malloc(sizeof(*gidsCopy) * nglyphs);
- for (i = 0; i < nglyphs; i++) gidsCopy[i] = gids[i];
-
- /* FIXME: Will this ever fail? */
- for (i = 0; i < dmxNumScreens; i++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[i];
-
- if (dmxScreen->beDisplay) {
- XRenderAddGlyphs(dmxScreen->beDisplay,
- glyphPriv->glyphSets[i],
- gidsCopy,
- (XGlyphInfo *)gi,
- nglyphs,
- (char *)bits,
- nbytes);
- dmxSync(dmxScreen, FALSE);
- }
- }
+ for (i = 0; i < nglyphs; i++)
+ gidsCopy[i] = gids[i];
+
+ /* FIXME: Will this ever fail? */
+ for (i = 0; i < dmxNumScreens; i++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[i];
+
+ if (dmxScreen->beDisplay) {
+ XRenderAddGlyphs(dmxScreen->beDisplay,
+ glyphPriv->glyphSets[i],
+ gidsCopy,
+ (XGlyphInfo *) gi,
+ nglyphs, (char *) bits, nbytes);
+ dmxSync(dmxScreen, FALSE);
+ }
+ }
free(gidsCopy);
}
@@ -396,239 +419,252 @@ static int dmxProcRenderAddGlyphs(ClientPtr client)
}
/** Free glyphs from the Glyph Set for each screen. */
-static int dmxProcRenderFreeGlyphs(ClientPtr client)
+static int
+dmxProcRenderFreeGlyphs(ClientPtr client)
{
- GlyphSetPtr glyphSet;
+ GlyphSetPtr glyphSet;
+
REQUEST(xRenderFreeGlyphsReq);
REQUEST_AT_LEAST_SIZE(xRenderFreeGlyphsReq);
- dixLookupResourceByType((pointer*) &glyphSet,
- stuff->glyphset, GlyphSetType,
- client, DixWriteAccess);
+ dixLookupResourceByType((pointer *) &glyphSet,
+ stuff->glyphset, GlyphSetType,
+ client, DixWriteAccess);
if (glyphSet) {
- dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
- int i;
- int nglyphs;
- Glyph *gids;
-
- nglyphs = ((client->req_len << 2) - sizeof(xRenderFreeGlyphsReq)) >> 2;
- if (nglyphs) {
- gids = malloc(sizeof(*gids) * nglyphs);
+ dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
+ int i;
+ int nglyphs;
+ Glyph *gids;
+
+ nglyphs = ((client->req_len << 2) - sizeof(xRenderFreeGlyphsReq)) >> 2;
+ if (nglyphs) {
+ gids = malloc(sizeof(*gids) * nglyphs);
for (i = 0; i < nglyphs; i++)
- gids[i] = ((CARD32 *)(stuff + 1))[i];
-
- for (i = 0; i < dmxNumScreens; i++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[i];
-
- if (dmxScreen->beDisplay) {
- XRenderFreeGlyphs(dmxScreen->beDisplay,
- glyphPriv->glyphSets[i], gids, nglyphs);
- dmxSync(dmxScreen, FALSE);
- }
- }
+ gids[i] = ((CARD32 *) (stuff + 1))[i];
+
+ for (i = 0; i < dmxNumScreens; i++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[i];
+
+ if (dmxScreen->beDisplay) {
+ XRenderFreeGlyphs(dmxScreen->beDisplay,
+ glyphPriv->glyphSets[i], gids, nglyphs);
+ dmxSync(dmxScreen, FALSE);
+ }
+ }
free(gids);
- }
+ }
}
- return dmxSaveRenderVector[stuff->renderReqType](client);
+ return dmxSaveRenderVector[stuff->renderReqType] (client);
}
/** Composite glyphs on each screen into the requested picture. If
* either the src or dest picture has not been allocated due to lazy
* window creation, this request will gracefully return. */
-static int dmxProcRenderCompositeGlyphs(ClientPtr client)
+static int
+dmxProcRenderCompositeGlyphs(ClientPtr client)
{
- int ret;
+ int ret;
+
REQUEST(xRenderCompositeGlyphsReq);
- ret = dmxSaveRenderVector[stuff->renderReqType](client);
+ ret = dmxSaveRenderVector[stuff->renderReqType] (client);
/* For the following to work with PanoramiX, it assumes that Render
* wraps the ProcRenderVector after dmxRenderInit has been called.
*/
if (ret == Success) {
- PicturePtr pSrc;
- dmxPictPrivPtr pSrcPriv;
- PicturePtr pDst;
- dmxPictPrivPtr pDstPriv;
- PictFormatPtr pFmt;
- XRenderPictFormat *pFormat;
- int size;
-
- int scrnNum;
- DMXScreenInfo *dmxScreen;
-
- CARD8 *buffer;
- CARD8 *end;
- int space;
-
- int nglyph;
- char *glyphs;
- char *curGlyph;
-
- xGlyphElt *elt;
- int nelt;
- XGlyphElt8 *elts;
- XGlyphElt8 *curElt;
-
- GlyphSetPtr glyphSet;
- dmxGlyphPrivPtr glyphPriv;
-
- dixLookupResourceByType((pointer*) &pSrc,
- stuff->src, PictureType,
- client, DixReadAccess);
-
- pSrcPriv = DMX_GET_PICT_PRIV(pSrc);
- if (!pSrcPriv->pict)
- return ret;
-
- dixLookupResourceByType((pointer*) &pDst,
- stuff->dst, PictureType,
- client, DixWriteAccess);
-
- pDstPriv = DMX_GET_PICT_PRIV(pDst);
- if (!pDstPriv->pict)
- return ret;
-
- scrnNum = pDst->pDrawable->pScreen->myNum;
- dmxScreen = &dmxScreens[scrnNum];
-
- /* Note: If the back-end display has been detached, then it
- * should not be possible to reach here since the pSrcPriv->pict
- * and pDstPriv->pict will have already been set to 0.
- */
- if (!dmxScreen->beDisplay)
- return ret;
-
- if (stuff->maskFormat)
- dixLookupResourceByType((pointer*) &pFmt,
- stuff->maskFormat, PictFormatType,
- client, DixReadAccess);
- else
- pFmt = NULL;
-
- pFormat = dmxFindFormat(dmxScreen, pFmt);
-
- switch (stuff->renderReqType) {
- case X_RenderCompositeGlyphs8: size = sizeof(CARD8); break;
- case X_RenderCompositeGlyphs16: size = sizeof(CARD16); break;
- case X_RenderCompositeGlyphs32: size = sizeof(CARD32); break;
- default: return BadPictOp; /* Can't happen */
- }
-
- buffer = (CARD8 *)(stuff + 1);
- end = (CARD8 *)stuff + (stuff->length << 2);
- nelt = 0;
- nglyph = 0;
- while (buffer + sizeof(xGlyphElt) < end) {
- elt = (xGlyphElt *)buffer;
- buffer += sizeof(xGlyphElt);
-
- if (elt->len == 0xff) {
- buffer += 4;
- } else {
- nelt++;
- nglyph += elt->len;
- space = size * elt->len;
- if (space & 3) space += 4 - (space & 3);
- buffer += space;
- }
- }
-
- /* The following only works for Render version > 0.2 */
-
- /* All of the XGlyphElt* structure sizes are identical */
- elts = malloc(nelt * sizeof(XGlyphElt8));
- if (!elts)
- return BadAlloc;
-
- glyphs = malloc(nglyph * size);
- if (!glyphs) {
- free(elts);
- return BadAlloc;
- }
-
- buffer = (CARD8 *)(stuff + 1);
- end = (CARD8 *)stuff + (stuff->length << 2);
- curGlyph = glyphs;
- curElt = elts;
-
- dixLookupResourceByType((pointer*) &glyphSet,
- stuff->glyphset, GlyphSetType,
- client, DixReadAccess);
- glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
-
- while (buffer + sizeof(xGlyphElt) < end) {
- elt = (xGlyphElt *)buffer;
- buffer += sizeof(xGlyphElt);
-
- if (elt->len == 0xff) {
- dixLookupResourceByType((pointer*) &glyphSet,
- *((CARD32 *)buffer),
- GlyphSetType,
- client,
- DixReadAccess);
- glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
- buffer += 4;
- } else {
- curElt->glyphset = glyphPriv->glyphSets[scrnNum];
- curElt->xOff = elt->deltax;
- curElt->yOff = elt->deltay;
- curElt->nchars = elt->len;
- curElt->chars = curGlyph;
-
- memcpy(curGlyph, buffer, size*elt->len);
- curGlyph += size * elt->len;
-
- curElt++;
-
- space = size * elt->len;
- if (space & 3) space += 4 - (space & 3);
- buffer += space;
- }
- }
-
- switch (stuff->renderReqType) {
- case X_RenderCompositeGlyphs8:
- XRenderCompositeText8(dmxScreen->beDisplay, stuff->op,
- pSrcPriv->pict, pDstPriv->pict,
- pFormat,
- stuff->xSrc, stuff->ySrc,
- 0, 0, elts, nelt);
- break;
- case X_RenderCompositeGlyphs16:
- XRenderCompositeText16(dmxScreen->beDisplay, stuff->op,
- pSrcPriv->pict, pDstPriv->pict,
- pFormat,
- stuff->xSrc, stuff->ySrc,
- 0, 0, (XGlyphElt16 *)elts, nelt);
- break;
- case X_RenderCompositeGlyphs32:
- XRenderCompositeText32(dmxScreen->beDisplay, stuff->op,
- pSrcPriv->pict, pDstPriv->pict,
- pFormat,
- stuff->xSrc, stuff->ySrc,
- 0, 0, (XGlyphElt32 *)elts, nelt);
- break;
- }
-
- dmxSync(dmxScreen, FALSE);
-
- free(elts);
- free(glyphs);
+ PicturePtr pSrc;
+ dmxPictPrivPtr pSrcPriv;
+ PicturePtr pDst;
+ dmxPictPrivPtr pDstPriv;
+ PictFormatPtr pFmt;
+ XRenderPictFormat *pFormat;
+ int size;
+
+ int scrnNum;
+ DMXScreenInfo *dmxScreen;
+
+ CARD8 *buffer;
+ CARD8 *end;
+ int space;
+
+ int nglyph;
+ char *glyphs;
+ char *curGlyph;
+
+ xGlyphElt *elt;
+ int nelt;
+ XGlyphElt8 *elts;
+ XGlyphElt8 *curElt;
+
+ GlyphSetPtr glyphSet;
+ dmxGlyphPrivPtr glyphPriv;
+
+ dixLookupResourceByType((pointer *) &pSrc,
+ stuff->src, PictureType, client, DixReadAccess);
+
+ pSrcPriv = DMX_GET_PICT_PRIV(pSrc);
+ if (!pSrcPriv->pict)
+ return ret;
+
+ dixLookupResourceByType((pointer *) &pDst,
+ stuff->dst, PictureType,
+ client, DixWriteAccess);
+
+ pDstPriv = DMX_GET_PICT_PRIV(pDst);
+ if (!pDstPriv->pict)
+ return ret;
+
+ scrnNum = pDst->pDrawable->pScreen->myNum;
+ dmxScreen = &dmxScreens[scrnNum];
+
+ /* Note: If the back-end display has been detached, then it
+ * should not be possible to reach here since the pSrcPriv->pict
+ * and pDstPriv->pict will have already been set to 0.
+ */
+ if (!dmxScreen->beDisplay)
+ return ret;
+
+ if (stuff->maskFormat)
+ dixLookupResourceByType((pointer *) &pFmt,
+ stuff->maskFormat, PictFormatType,
+ client, DixReadAccess);
+ else
+ pFmt = NULL;
+
+ pFormat = dmxFindFormat(dmxScreen, pFmt);
+
+ switch (stuff->renderReqType) {
+ case X_RenderCompositeGlyphs8:
+ size = sizeof(CARD8);
+ break;
+ case X_RenderCompositeGlyphs16:
+ size = sizeof(CARD16);
+ break;
+ case X_RenderCompositeGlyphs32:
+ size = sizeof(CARD32);
+ break;
+ default:
+ return BadPictOp; /* Can't happen */
+ }
+
+ buffer = (CARD8 *) (stuff + 1);
+ end = (CARD8 *) stuff + (stuff->length << 2);
+ nelt = 0;
+ nglyph = 0;
+ while (buffer + sizeof(xGlyphElt) < end) {
+ elt = (xGlyphElt *) buffer;
+ buffer += sizeof(xGlyphElt);
+
+ if (elt->len == 0xff) {
+ buffer += 4;
+ }
+ else {
+ nelt++;
+ nglyph += elt->len;
+ space = size * elt->len;
+ if (space & 3)
+ space += 4 - (space & 3);
+ buffer += space;
+ }
+ }
+
+ /* The following only works for Render version > 0.2 */
+
+ /* All of the XGlyphElt* structure sizes are identical */
+ elts = malloc(nelt * sizeof(XGlyphElt8));
+ if (!elts)
+ return BadAlloc;
+
+ glyphs = malloc(nglyph * size);
+ if (!glyphs) {
+ free(elts);
+ return BadAlloc;
+ }
+
+ buffer = (CARD8 *) (stuff + 1);
+ end = (CARD8 *) stuff + (stuff->length << 2);
+ curGlyph = glyphs;
+ curElt = elts;
+
+ dixLookupResourceByType((pointer *) &glyphSet,
+ stuff->glyphset, GlyphSetType,
+ client, DixReadAccess);
+ glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
+
+ while (buffer + sizeof(xGlyphElt) < end) {
+ elt = (xGlyphElt *) buffer;
+ buffer += sizeof(xGlyphElt);
+
+ if (elt->len == 0xff) {
+ dixLookupResourceByType((pointer *) &glyphSet,
+ *((CARD32 *) buffer),
+ GlyphSetType, client, DixReadAccess);
+ glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet);
+ buffer += 4;
+ }
+ else {
+ curElt->glyphset = glyphPriv->glyphSets[scrnNum];
+ curElt->xOff = elt->deltax;
+ curElt->yOff = elt->deltay;
+ curElt->nchars = elt->len;
+ curElt->chars = curGlyph;
+
+ memcpy(curGlyph, buffer, size * elt->len);
+ curGlyph += size * elt->len;
+
+ curElt++;
+
+ space = size * elt->len;
+ if (space & 3)
+ space += 4 - (space & 3);
+ buffer += space;
+ }
+ }
+
+ switch (stuff->renderReqType) {
+ case X_RenderCompositeGlyphs8:
+ XRenderCompositeText8(dmxScreen->beDisplay, stuff->op,
+ pSrcPriv->pict, pDstPriv->pict,
+ pFormat,
+ stuff->xSrc, stuff->ySrc, 0, 0, elts, nelt);
+ break;
+ case X_RenderCompositeGlyphs16:
+ XRenderCompositeText16(dmxScreen->beDisplay, stuff->op,
+ pSrcPriv->pict, pDstPriv->pict,
+ pFormat,
+ stuff->xSrc, stuff->ySrc,
+ 0, 0, (XGlyphElt16 *) elts, nelt);
+ break;
+ case X_RenderCompositeGlyphs32:
+ XRenderCompositeText32(dmxScreen->beDisplay, stuff->op,
+ pSrcPriv->pict, pDstPriv->pict,
+ pFormat,
+ stuff->xSrc, stuff->ySrc,
+ 0, 0, (XGlyphElt32 *) elts, nelt);
+ break;
+ }
+
+ dmxSync(dmxScreen, FALSE);
+
+ free(elts);
+ free(glyphs);
}
return ret;
}
/** Set the picture transform on each screen. */
-static int dmxProcRenderSetPictureTransform(ClientPtr client)
+static int
+dmxProcRenderSetPictureTransform(ClientPtr client)
{
- DMXScreenInfo *dmxScreen;
- PicturePtr pPicture;
- dmxPictPrivPtr pPictPriv;
- XTransform xform;
+ DMXScreenInfo *dmxScreen;
+ PicturePtr pPicture;
+ dmxPictPrivPtr pPictPriv;
+ XTransform xform;
+
REQUEST(xRenderSetPictureTransformReq);
REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq);
@@ -641,34 +677,35 @@ static int dmxProcRenderSetPictureTransform(ClientPtr client)
pPictPriv = DMX_GET_PICT_PRIV(pPicture);
if (pPictPriv->pict) {
- xform.matrix[0][0] = stuff->transform.matrix11;
- xform.matrix[0][1] = stuff->transform.matrix12;
- xform.matrix[0][2] = stuff->transform.matrix13;
- xform.matrix[1][0] = stuff->transform.matrix21;
- xform.matrix[1][1] = stuff->transform.matrix22;
- xform.matrix[1][2] = stuff->transform.matrix23;
- xform.matrix[2][0] = stuff->transform.matrix31;
- xform.matrix[2][1] = stuff->transform.matrix32;
- xform.matrix[2][2] = stuff->transform.matrix33;
-
- XRenderSetPictureTransform(dmxScreen->beDisplay,
- pPictPriv->pict,
- &xform);
- dmxSync(dmxScreen, FALSE);
+ xform.matrix[0][0] = stuff->transform.matrix11;
+ xform.matrix[0][1] = stuff->transform.matrix12;
+ xform.matrix[0][2] = stuff->transform.matrix13;
+ xform.matrix[1][0] = stuff->transform.matrix21;
+ xform.matrix[1][1] = stuff->transform.matrix22;
+ xform.matrix[1][2] = stuff->transform.matrix23;
+ xform.matrix[2][0] = stuff->transform.matrix31;
+ xform.matrix[2][1] = stuff->transform.matrix32;
+ xform.matrix[2][2] = stuff->transform.matrix33;
+
+ XRenderSetPictureTransform(dmxScreen->beDisplay,
+ pPictPriv->pict, &xform);
+ dmxSync(dmxScreen, FALSE);
}
- return dmxSaveRenderVector[stuff->renderReqType](client);
+ return dmxSaveRenderVector[stuff->renderReqType] (client);
}
/** Set the picture filter on each screen. */
-static int dmxProcRenderSetPictureFilter(ClientPtr client)
+static int
+dmxProcRenderSetPictureFilter(ClientPtr client)
{
- DMXScreenInfo *dmxScreen;
- PicturePtr pPicture;
- dmxPictPrivPtr pPictPriv;
- char *filter;
- XFixed *params;
- int nparams;
+ DMXScreenInfo *dmxScreen;
+ PicturePtr pPicture;
+ dmxPictPrivPtr pPictPriv;
+ char *filter;
+ XFixed *params;
+ int nparams;
+
REQUEST(xRenderSetPictureFilterReq);
REQUEST_AT_LEAST_SIZE(xRenderSetPictureFilterReq);
@@ -681,52 +718,50 @@ static int dmxProcRenderSetPictureFilter(ClientPtr client)
pPictPriv = DMX_GET_PICT_PRIV(pPicture);
if (pPictPriv->pict) {
- filter = (char *)(stuff + 1);
- params = (XFixed *)(filter + ((stuff->nbytes + 3) & ~3));
- nparams = ((XFixed *)stuff + client->req_len) - params;
-
- XRenderSetPictureFilter(dmxScreen->beDisplay,
- pPictPriv->pict,
- filter,
- params,
- nparams);
- dmxSync(dmxScreen, FALSE);
+ filter = (char *) (stuff + 1);
+ params = (XFixed *) (filter + ((stuff->nbytes + 3) & ~3));
+ nparams = ((XFixed *) stuff + client->req_len) - params;
+
+ XRenderSetPictureFilter(dmxScreen->beDisplay,
+ pPictPriv->pict, filter, params, nparams);
+ dmxSync(dmxScreen, FALSE);
}
- return dmxSaveRenderVector[stuff->renderReqType](client);
+ return dmxSaveRenderVector[stuff->renderReqType] (client);
}
-
/** Create a picture on the appropriate screen. This is the actual
* function that creates the picture. However, if the associated
* window has not yet been created due to lazy window creation, then
* delay the picture creation until the window is mapped. */
-static Picture dmxDoCreatePicture(PicturePtr pPicture)
+static Picture
+dmxDoCreatePicture(PicturePtr pPicture)
{
- DrawablePtr pDraw = pPicture->pDrawable;
- ScreenPtr pScreen = pDraw->pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- XRenderPictFormat *pFormat;
- Drawable draw;
+ DrawablePtr pDraw = pPicture->pDrawable;
+ ScreenPtr pScreen = pDraw->pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ XRenderPictFormat *pFormat;
+ Drawable draw;
if (pPicture->pDrawable->type == DRAWABLE_WINDOW) {
- dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV((WindowPtr)(pDraw));
-
- if (!(draw = pWinPriv->window)) {
- /* Window has not been created yet due to the window
- * optimization. Delay picture creation until window is
- * mapped.
- */
- pWinPriv->hasPict = TRUE;
- return 0;
- }
- } else {
- dmxPixPrivPtr pPixPriv = DMX_GET_PIXMAP_PRIV((PixmapPtr)(pDraw));
-
- if (!(draw = pPixPriv->pixmap)) {
- /* FIXME: Zero width/height pixmap?? */
- return 0;
- }
+ dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV((WindowPtr) (pDraw));
+
+ if (!(draw = pWinPriv->window)) {
+ /* Window has not been created yet due to the window
+ * optimization. Delay picture creation until window is
+ * mapped.
+ */
+ pWinPriv->hasPict = TRUE;
+ return 0;
+ }
+ }
+ else {
+ dmxPixPrivPtr pPixPriv = DMX_GET_PIXMAP_PRIV((PixmapPtr) (pDraw));
+
+ if (!(draw = pPixPriv->pixmap)) {
+ /* FIXME: Zero width/height pixmap?? */
+ return 0;
+ }
}
/* This should not be reached if the back-end display has been
@@ -734,7 +769,7 @@ static Picture dmxDoCreatePicture(PicturePtr pPicture)
* will be NULL; however, we add it here for completeness
*/
if (!dmxScreen->beDisplay)
- return 0;
+ return 0;
pFormat = dmxFindFormat(dmxScreen, pPicture->pFormat);
@@ -745,32 +780,34 @@ static Picture dmxDoCreatePicture(PicturePtr pPicture)
* dmxCreateAndRealizeWindow() during the lazy window creation
* realization process. It creates the entire list of pictures that
* are associated with the given window. */
-void dmxCreatePictureList(WindowPtr pWindow)
+void
+dmxCreatePictureList(WindowPtr pWindow)
{
- PicturePtr pPicture = GetPictureWindow(pWindow);
+ PicturePtr pPicture = GetPictureWindow(pWindow);
while (pPicture) {
- dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pPicture);
+ dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pPicture);
- /* Create the picture for this window */
- pPictPriv->pict = dmxDoCreatePicture(pPicture);
+ /* Create the picture for this window */
+ pPictPriv->pict = dmxDoCreatePicture(pPicture);
- /* ValidatePicture takes care of the state changes */
+ /* ValidatePicture takes care of the state changes */
- pPicture = pPicture->pNext;
+ pPicture = pPicture->pNext;
}
}
/** Create \a pPicture on the backend. */
-int dmxBECreatePicture(PicturePtr pPicture)
+int
+dmxBECreatePicture(PicturePtr pPicture)
{
- dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pPicture);
+ dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pPicture);
/* Create picutre on BE */
pPictPriv->pict = dmxDoCreatePicture(pPicture);
/* Flush changes to the backend server */
- dmxValidatePicture(pPicture, (1 << (CPLastBit+1)) - 1);
+ dmxValidatePicture(pPicture, (1 << (CPLastBit + 1)) - 1);
return Success;
}
@@ -778,22 +815,23 @@ int dmxBECreatePicture(PicturePtr pPicture)
/** Create a picture. This function handles the CreatePicture
* unwrapping/wrapping and calls dmxDoCreatePicture to actually create
* the picture on the appropriate screen. */
-int dmxCreatePicture(PicturePtr pPicture)
+int
+dmxCreatePicture(PicturePtr pPicture)
{
- ScreenPtr pScreen = pPicture->pDrawable->pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pPicture);
- int ret = Success;
+ ScreenPtr pScreen = pPicture->pDrawable->pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ PictureScreenPtr ps = GetPictureScreen(pScreen);
+ dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pPicture);
+ int ret = Success;
DMX_UNWRAP(CreatePicture, dmxScreen, ps);
#if 1
if (ps->CreatePicture)
- ret = ps->CreatePicture(pPicture);
+ ret = ps->CreatePicture(pPicture);
#endif
/* Create picture on back-end server */
- pPictPriv->pict = dmxDoCreatePicture(pPicture);
+ pPictPriv->pict = dmxDoCreatePicture(pPicture);
pPictPriv->savedMask = 0;
DMX_WRAP(CreatePicture, dmxCreatePicture, dmxScreen, ps);
@@ -802,16 +840,17 @@ int dmxCreatePicture(PicturePtr pPicture)
}
/** Destroy \a pPicture on the back-end server. */
-Bool dmxBEFreePicture(PicturePtr pPicture)
+Bool
+dmxBEFreePicture(PicturePtr pPicture)
{
- ScreenPtr pScreen = pPicture->pDrawable->pScreen;
+ ScreenPtr pScreen = pPicture->pDrawable->pScreen;
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pPicture);
if (pPictPriv->pict) {
- XRenderFreePicture(dmxScreen->beDisplay, pPictPriv->pict);
- pPictPriv->pict = (Picture)0;
- return TRUE;
+ XRenderFreePicture(dmxScreen->beDisplay, pPictPriv->pict);
+ pPictPriv->pict = (Picture) 0;
+ return TRUE;
}
return FALSE;
@@ -820,14 +859,15 @@ Bool dmxBEFreePicture(PicturePtr pPicture)
/** Destroy a list of pictures that are associated with the window that
* is being destroyed. This function is called by #dmxDestroyWindow().
* */
-Bool dmxDestroyPictureList(WindowPtr pWindow)
+Bool
+dmxDestroyPictureList(WindowPtr pWindow)
{
- PicturePtr pPicture = GetPictureWindow(pWindow);
- Bool ret = FALSE;
+ PicturePtr pPicture = GetPictureWindow(pWindow);
+ Bool ret = FALSE;
while (pPicture) {
- ret |= dmxBEFreePicture(pPicture);
- pPicture = pPicture->pNext;
+ ret |= dmxBEFreePicture(pPicture);
+ pPicture = pPicture->pNext;
}
return ret;
@@ -836,112 +876,114 @@ Bool dmxDestroyPictureList(WindowPtr pWindow)
/** Destroy a picture. This function calls the wrapped function that
* frees the resources in the DMX server associated with this
* picture. */
-void dmxDestroyPicture(PicturePtr pPicture)
+void
+dmxDestroyPicture(PicturePtr pPicture)
{
- ScreenPtr pScreen = pPicture->pDrawable->pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- PictureScreenPtr ps = GetPictureScreen(pScreen);
+ ScreenPtr pScreen = pPicture->pDrawable->pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ PictureScreenPtr ps = GetPictureScreen(pScreen);
DMX_UNWRAP(DestroyPicture, dmxScreen, ps);
/* Destroy picture on back-end server */
if (dmxBEFreePicture(pPicture))
- dmxSync(dmxScreen, FALSE);
+ dmxSync(dmxScreen, FALSE);
#if 1
if (ps->DestroyPicture)
- ps->DestroyPicture(pPicture);
+ ps->DestroyPicture(pPicture);
#endif
DMX_WRAP(DestroyPicture, dmxDestroyPicture, dmxScreen, ps);
}
/** Change the picture's list of clip rectangles. */
-int dmxChangePictureClip(PicturePtr pPicture, int clipType,
- pointer value, int n)
+int
+dmxChangePictureClip(PicturePtr pPicture, int clipType, pointer value, int n)
{
- ScreenPtr pScreen = pPicture->pDrawable->pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pPicture);
+ ScreenPtr pScreen = pPicture->pDrawable->pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ PictureScreenPtr ps = GetPictureScreen(pScreen);
+ dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pPicture);
DMX_UNWRAP(ChangePictureClip, dmxScreen, ps);
#if 1
if (ps->ChangePictureClip)
- ps->ChangePictureClip(pPicture, clipType, value, n);
+ ps->ChangePictureClip(pPicture, clipType, value, n);
#endif
/* Change picture clip rects on back-end server */
if (pPictPriv->pict) {
- /* The clip has already been changed into a region by the mi
- * routine called above.
- */
- if (clipType == CT_NONE) {
- /* Disable clipping, show all */
- XFixesSetPictureClipRegion(dmxScreen->beDisplay,
- pPictPriv->pict, 0, 0, None);
- } else if (pPicture->clientClip) {
- RegionPtr pClip = pPicture->clientClip;
- BoxPtr pBox = RegionRects(pClip);
- int nBox = RegionNumRects(pClip);
- XRectangle *pRects;
- XRectangle *pRect;
- int nRects;
-
- nRects = nBox;
- pRects = pRect = malloc(nRects * sizeof(*pRect));
-
- while (nBox--) {
- pRect->x = pBox->x1;
- pRect->y = pBox->y1;
- pRect->width = pBox->x2 - pBox->x1;
- pRect->height = pBox->y2 - pBox->y1;
- pBox++;
- pRect++;
- }
-
- XRenderSetPictureClipRectangles(dmxScreen->beDisplay,
- pPictPriv->pict,
- 0, 0,
- pRects,
- nRects);
- free(pRects);
- } else {
- XRenderSetPictureClipRectangles(dmxScreen->beDisplay,
- pPictPriv->pict,
- 0, 0, NULL, 0);
- }
- dmxSync(dmxScreen, FALSE);
- } else {
- /* FIXME: Handle saving clip region when offscreen */
+ /* The clip has already been changed into a region by the mi
+ * routine called above.
+ */
+ if (clipType == CT_NONE) {
+ /* Disable clipping, show all */
+ XFixesSetPictureClipRegion(dmxScreen->beDisplay,
+ pPictPriv->pict, 0, 0, None);
+ }
+ else if (pPicture->clientClip) {
+ RegionPtr pClip = pPicture->clientClip;
+ BoxPtr pBox = RegionRects(pClip);
+ int nBox = RegionNumRects(pClip);
+ XRectangle *pRects;
+ XRectangle *pRect;
+ int nRects;
+
+ nRects = nBox;
+ pRects = pRect = malloc(nRects * sizeof(*pRect));
+
+ while (nBox--) {
+ pRect->x = pBox->x1;
+ pRect->y = pBox->y1;
+ pRect->width = pBox->x2 - pBox->x1;
+ pRect->height = pBox->y2 - pBox->y1;
+ pBox++;
+ pRect++;
+ }
+
+ XRenderSetPictureClipRectangles(dmxScreen->beDisplay,
+ pPictPriv->pict,
+ 0, 0, pRects, nRects);
+ free(pRects);
+ }
+ else {
+ XRenderSetPictureClipRectangles(dmxScreen->beDisplay,
+ pPictPriv->pict, 0, 0, NULL, 0);
+ }
+ dmxSync(dmxScreen, FALSE);
+ }
+ else {
+ /* FIXME: Handle saving clip region when offscreen */
}
DMX_WRAP(ChangePictureClip, dmxChangePictureClip, dmxScreen, ps);
-
+
return Success;
}
/** Destroy the picture's list of clip rectangles. */
-void dmxDestroyPictureClip(PicturePtr pPicture)
+void
+dmxDestroyPictureClip(PicturePtr pPicture)
{
- ScreenPtr pScreen = pPicture->pDrawable->pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pPicture);
+ ScreenPtr pScreen = pPicture->pDrawable->pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ PictureScreenPtr ps = GetPictureScreen(pScreen);
+ dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pPicture);
DMX_UNWRAP(DestroyPictureClip, dmxScreen, ps);
#if 1
if (ps->DestroyPictureClip)
- ps->DestroyPictureClip(pPicture);
+ ps->DestroyPictureClip(pPicture);
#endif
/* Destroy picture clip rects on back-end server */
if (pPictPriv->pict) {
- XRenderSetPictureClipRectangles(dmxScreen->beDisplay,
- pPictPriv->pict,
- 0, 0, NULL, 0);
- dmxSync(dmxScreen, FALSE);
- } else {
- /* FIXME: Handle destroying clip region when offscreen */
+ XRenderSetPictureClipRectangles(dmxScreen->beDisplay,
+ pPictPriv->pict, 0, 0, NULL, 0);
+ dmxSync(dmxScreen, FALSE);
+ }
+ else {
+ /* FIXME: Handle destroying clip region when offscreen */
}
DMX_WRAP(DestroyPictureClip, dmxDestroyPictureClip, dmxScreen, ps);
@@ -951,17 +993,18 @@ void dmxDestroyPictureClip(PicturePtr pPicture)
* been created due to lazy window creation, save the mask so that it
* can be used to appropriately initialize the picture's attributes
* when it is created later. */
-void dmxChangePicture(PicturePtr pPicture, Mask mask)
+void
+dmxChangePicture(PicturePtr pPicture, Mask mask)
{
- ScreenPtr pScreen = pPicture->pDrawable->pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pPicture);
+ ScreenPtr pScreen = pPicture->pDrawable->pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ PictureScreenPtr ps = GetPictureScreen(pScreen);
+ dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pPicture);
DMX_UNWRAP(ChangePicture, dmxScreen, ps);
#if 1
if (ps->ChangePicture)
- ps->ChangePicture(pPicture, mask);
+ ps->ChangePicture(pPicture, mask);
#endif
/* Picture attribute changes are handled in ValidatePicture */
@@ -973,67 +1016,72 @@ void dmxChangePicture(PicturePtr pPicture, Mask mask)
/** Validate the picture's attributes before rendering to it. Update
* any picture attributes that have been changed by one of the higher
* layers. */
-void dmxValidatePicture(PicturePtr pPicture, Mask mask)
+void
+dmxValidatePicture(PicturePtr pPicture, Mask mask)
{
- ScreenPtr pScreen = pPicture->pDrawable->pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pPicture);
+ ScreenPtr pScreen = pPicture->pDrawable->pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ PictureScreenPtr ps = GetPictureScreen(pScreen);
+ dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pPicture);
DMX_UNWRAP(ValidatePicture, dmxScreen, ps);
/* Change picture attributes on back-end server */
if (pPictPriv->pict) {
- XRenderPictureAttributes attribs;
-
- if (mask & CPRepeat) {
- attribs.repeat = pPicture->repeatType;
- }
- if (mask & CPAlphaMap) {
- if (pPicture->alphaMap) {
- dmxPictPrivPtr pAlphaPriv;
- pAlphaPriv = DMX_GET_PICT_PRIV(pPicture->alphaMap);
- if (pAlphaPriv->pict) {
- attribs.alpha_map = pAlphaPriv->pict;
- } else {
- /* FIXME: alpha picture drawable has not been created?? */
- return; /* or should this be: attribs.alpha_map = None; */
- }
- } else {
- attribs.alpha_map = None;
- }
- }
- if (mask & CPAlphaXOrigin)
- attribs.alpha_x_origin = pPicture->alphaOrigin.x;
- if (mask & CPAlphaYOrigin)
- attribs.alpha_y_origin = pPicture->alphaOrigin.y;
- if (mask & CPClipXOrigin)
- attribs.clip_x_origin = pPicture->clipOrigin.x;
- if (mask & CPClipYOrigin)
- attribs.clip_y_origin = pPicture->clipOrigin.y;
- if (mask & CPClipMask)
- mask &= ~CPClipMask; /* Handled in ChangePictureClip */
- if (mask & CPGraphicsExposure)
- attribs.graphics_exposures = pPicture->graphicsExposures;
- if (mask & CPSubwindowMode)
- attribs.subwindow_mode = pPicture->subWindowMode;
- if (mask & CPPolyEdge)
- attribs.poly_edge = pPicture->polyEdge;
- if (mask & CPPolyMode)
- attribs.poly_mode = pPicture->polyMode;
- if (mask & CPComponentAlpha)
- attribs.component_alpha = pPicture->componentAlpha;
-
- XRenderChangePicture(dmxScreen->beDisplay, pPictPriv->pict,
- mask, &attribs);
- dmxSync(dmxScreen, FALSE);
- } else {
- pPictPriv->savedMask |= mask;
+ XRenderPictureAttributes attribs;
+
+ if (mask & CPRepeat) {
+ attribs.repeat = pPicture->repeatType;
+ }
+ if (mask & CPAlphaMap) {
+ if (pPicture->alphaMap) {
+ dmxPictPrivPtr pAlphaPriv;
+
+ pAlphaPriv = DMX_GET_PICT_PRIV(pPicture->alphaMap);
+ if (pAlphaPriv->pict) {
+ attribs.alpha_map = pAlphaPriv->pict;
+ }
+ else {
+ /* FIXME: alpha picture drawable has not been created?? */
+ return; /* or should this be: attribs.alpha_map = None; */
+ }
+ }
+ else {
+ attribs.alpha_map = None;
+ }
+ }
+ if (mask & CPAlphaXOrigin)
+ attribs.alpha_x_origin = pPicture->alphaOrigin.x;
+ if (mask & CPAlphaYOrigin)
+ attribs.alpha_y_origin = pPicture->alphaOrigin.y;
+ if (mask & CPClipXOrigin)
+ attribs.clip_x_origin = pPicture->clipOrigin.x;
+ if (mask & CPClipYOrigin)
+ attribs.clip_y_origin = pPicture->clipOrigin.y;
+ if (mask & CPClipMask)
+ mask &= ~CPClipMask; /* Handled in ChangePictureClip */
+ if (mask & CPGraphicsExposure)
+ attribs.graphics_exposures = pPicture->graphicsExposures;
+ if (mask & CPSubwindowMode)
+ attribs.subwindow_mode = pPicture->subWindowMode;
+ if (mask & CPPolyEdge)
+ attribs.poly_edge = pPicture->polyEdge;
+ if (mask & CPPolyMode)
+ attribs.poly_mode = pPicture->polyMode;
+ if (mask & CPComponentAlpha)
+ attribs.component_alpha = pPicture->componentAlpha;
+
+ XRenderChangePicture(dmxScreen->beDisplay, pPictPriv->pict,
+ mask, &attribs);
+ dmxSync(dmxScreen, FALSE);
+ }
+ else {
+ pPictPriv->savedMask |= mask;
}
#if 1
if (ps->ValidatePicture)
- ps->ValidatePicture(pPicture, mask);
+ ps->ValidatePicture(pPicture, mask);
#endif
DMX_WRAP(ValidatePicture, dmxValidatePicture, dmxScreen, ps);
@@ -1044,57 +1092,54 @@ void dmxValidatePicture(PicturePtr pPicture, Mask mask)
* the specified rectangle of the dst using op as the compositing
* operator. For a complete description see the protocol document of
* the RENDER library. */
-void dmxComposite(CARD8 op,
- PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
- INT16 xSrc, INT16 ySrc,
- INT16 xMask, INT16 yMask,
- INT16 xDst, INT16 yDst,
- CARD16 width, CARD16 height)
+void
+dmxComposite(CARD8 op,
+ PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
+ INT16 xSrc, INT16 ySrc,
+ INT16 xMask, INT16 yMask,
+ INT16 xDst, INT16 yDst, CARD16 width, CARD16 height)
{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- dmxPictPrivPtr pSrcPriv = DMX_GET_PICT_PRIV(pSrc);
- dmxPictPrivPtr pMaskPriv = NULL;
- dmxPictPrivPtr pDstPriv = DMX_GET_PICT_PRIV(pDst);
+ ScreenPtr pScreen = pDst->pDrawable->pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ PictureScreenPtr ps = GetPictureScreen(pScreen);
+ dmxPictPrivPtr pSrcPriv = DMX_GET_PICT_PRIV(pSrc);
+ dmxPictPrivPtr pMaskPriv = NULL;
+ dmxPictPrivPtr pDstPriv = DMX_GET_PICT_PRIV(pDst);
- if (pMask) pMaskPriv = DMX_GET_PICT_PRIV(pMask);
+ if (pMask)
+ pMaskPriv = DMX_GET_PICT_PRIV(pMask);
DMX_UNWRAP(Composite, dmxScreen, ps);
#if 0
if (ps->Composite)
- ps->Composite(op, pSrc, pMask, pDst,
- xSrc, ySrc, xMask, yMask, xDst, yDst,
- width, height);
+ ps->Composite(op, pSrc, pMask, pDst,
+ xSrc, ySrc, xMask, yMask, xDst, yDst, width, height);
#endif
/* Composite on back-end server */
if (pSrcPriv->pict && pDstPriv->pict &&
- ((pMaskPriv && pMaskPriv->pict) || !pMaskPriv)) {
- XRenderComposite(dmxScreen->beDisplay,
- op,
- pSrcPriv->pict,
- pMaskPriv ? pMaskPriv->pict : None,
- pDstPriv->pict,
- xSrc, ySrc,
- xMask, yMask,
- xDst, yDst,
- width, height);
- dmxSync(dmxScreen, FALSE);
+ ((pMaskPriv && pMaskPriv->pict) || !pMaskPriv)) {
+ XRenderComposite(dmxScreen->beDisplay,
+ op,
+ pSrcPriv->pict,
+ pMaskPriv ? pMaskPriv->pict : None,
+ pDstPriv->pict,
+ xSrc, ySrc, xMask, yMask, xDst, yDst, width, height);
+ dmxSync(dmxScreen, FALSE);
}
-
DMX_WRAP(Composite, dmxComposite, dmxScreen, ps);
}
/** Null function to catch when/if RENDER calls lower level mi hooks.
* Compositing glyphs is handled by dmxProcRenderCompositeGlyphs().
* This function should never be called. */
-void dmxGlyphs(CARD8 op,
- PicturePtr pSrc, PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc, INT16 ySrc,
- int nlists, GlyphListPtr lists, GlyphPtr *glyphs)
+void
+dmxGlyphs(CARD8 op,
+ PicturePtr pSrc, PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc, INT16 ySrc,
+ int nlists, GlyphListPtr lists, GlyphPtr * glyphs)
{
/* This won't work, so we need to wrap ProcRenderCompositeGlyphs */
}
@@ -1103,91 +1148,91 @@ void dmxGlyphs(CARD8 op,
* with the dest picture in the area specified by the list of
* rectangles. For a complete description see the protocol document of
* the RENDER library. */
-void dmxCompositeRects(CARD8 op,
- PicturePtr pDst,
- xRenderColor *color,
- int nRect, xRectangle *rects)
+void
+dmxCompositeRects(CARD8 op,
+ PicturePtr pDst,
+ xRenderColor * color, int nRect, xRectangle *rects)
{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pDst);
+ ScreenPtr pScreen = pDst->pDrawable->pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ PictureScreenPtr ps = GetPictureScreen(pScreen);
+ dmxPictPrivPtr pPictPriv = DMX_GET_PICT_PRIV(pDst);
DMX_UNWRAP(CompositeRects, dmxScreen, ps);
#if 0
if (ps->CompositeRects)
- ps->CompositeRects(op, pDst, color, nRect, rects);
+ ps->CompositeRects(op, pDst, color, nRect, rects);
#endif
/* CompositeRects on back-end server */
if (pPictPriv->pict) {
- XRenderFillRectangles(dmxScreen->beDisplay,
- op,
- pPictPriv->pict,
- (XRenderColor *)color,
- (XRectangle *)rects,
- nRect);
- dmxSync(dmxScreen, FALSE);
+ XRenderFillRectangles(dmxScreen->beDisplay,
+ op,
+ pPictPriv->pict,
+ (XRenderColor *) color,
+ (XRectangle *) rects, nRect);
+ dmxSync(dmxScreen, FALSE);
}
DMX_WRAP(CompositeRects, dmxCompositeRects, dmxScreen, ps);
}
/** Indexed color visuals are not yet supported. */
-Bool dmxInitIndexed(ScreenPtr pScreen, PictFormatPtr pFormat)
+Bool
+dmxInitIndexed(ScreenPtr pScreen, PictFormatPtr pFormat)
{
return TRUE;
}
/** Indexed color visuals are not yet supported. */
-void dmxCloseIndexed(ScreenPtr pScreen, PictFormatPtr pFormat)
+void
+dmxCloseIndexed(ScreenPtr pScreen, PictFormatPtr pFormat)
{
}
/** Indexed color visuals are not yet supported. */
-void dmxUpdateIndexed(ScreenPtr pScreen, PictFormatPtr pFormat,
- int ndef, xColorItem *pdef)
+void
+dmxUpdateIndexed(ScreenPtr pScreen, PictFormatPtr pFormat,
+ int ndef, xColorItem * pdef)
{
}
/** Composite a list of trapezoids on the appropriate screen. For a
* complete description see the protocol document of the RENDER
* library. */
-void dmxTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc, INT16 ySrc,
- int ntrap, xTrapezoid *traps)
+void
+dmxTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid * traps)
{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- dmxPictPrivPtr pSrcPriv = DMX_GET_PICT_PRIV(pSrc);
- dmxPictPrivPtr pDstPriv = DMX_GET_PICT_PRIV(pDst);
+ ScreenPtr pScreen = pDst->pDrawable->pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ PictureScreenPtr ps = GetPictureScreen(pScreen);
+ dmxPictPrivPtr pSrcPriv = DMX_GET_PICT_PRIV(pSrc);
+ dmxPictPrivPtr pDstPriv = DMX_GET_PICT_PRIV(pDst);
DMX_UNWRAP(Trapezoids, dmxScreen, ps);
#if 0
if (ps->Trapezoids)
- ps->Trapezoids(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntrap, *traps);
+ ps->Trapezoids(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntrap, *traps);
#endif
/* Draw trapezoids on back-end server */
if (pDstPriv->pict) {
- XRenderPictFormat *pFormat;
-
- pFormat = dmxFindFormat(dmxScreen, maskFormat);
- if (!pFormat) {
- /* FIXME: Error! */
- }
-
- XRenderCompositeTrapezoids(dmxScreen->beDisplay,
- op,
- pSrcPriv->pict,
- pDstPriv->pict,
- pFormat,
- xSrc, ySrc,
- (XTrapezoid *)traps,
- ntrap);
- dmxSync(dmxScreen, FALSE);
+ XRenderPictFormat *pFormat;
+
+ pFormat = dmxFindFormat(dmxScreen, maskFormat);
+ if (!pFormat) {
+ /* FIXME: Error! */
+ }
+
+ XRenderCompositeTrapezoids(dmxScreen->beDisplay,
+ op,
+ pSrcPriv->pict,
+ pDstPriv->pict,
+ pFormat,
+ xSrc, ySrc, (XTrapezoid *) traps, ntrap);
+ dmxSync(dmxScreen, FALSE);
}
DMX_WRAP(Trapezoids, dmxTrapezoids, dmxScreen, ps);
@@ -1196,41 +1241,39 @@ void dmxTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
/** Composite a list of triangles on the appropriate screen. For a
* complete description see the protocol document of the RENDER
* library. */
-void dmxTriangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc, INT16 ySrc,
- int ntri, xTriangle *tris)
+void
+dmxTriangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc, INT16 ySrc, int ntri, xTriangle * tris)
{
- ScreenPtr pScreen = pDst->pDrawable->pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- dmxPictPrivPtr pSrcPriv = DMX_GET_PICT_PRIV(pSrc);
- dmxPictPrivPtr pDstPriv = DMX_GET_PICT_PRIV(pDst);
+ ScreenPtr pScreen = pDst->pDrawable->pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ PictureScreenPtr ps = GetPictureScreen(pScreen);
+ dmxPictPrivPtr pSrcPriv = DMX_GET_PICT_PRIV(pSrc);
+ dmxPictPrivPtr pDstPriv = DMX_GET_PICT_PRIV(pDst);
DMX_UNWRAP(Triangles, dmxScreen, ps);
#if 0
if (ps->Triangles)
- ps->Triangles(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, *tris);
+ ps->Triangles(op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, *tris);
#endif
/* Draw trapezoids on back-end server */
if (pDstPriv->pict) {
- XRenderPictFormat *pFormat;
-
- pFormat = dmxFindFormat(dmxScreen, maskFormat);
- if (!pFormat) {
- /* FIXME: Error! */
- }
-
- XRenderCompositeTriangles(dmxScreen->beDisplay,
- op,
- pSrcPriv->pict,
- pDstPriv->pict,
- pFormat,
- xSrc, ySrc,
- (XTriangle *)tris,
- ntri);
- dmxSync(dmxScreen, FALSE);
+ XRenderPictFormat *pFormat;
+
+ pFormat = dmxFindFormat(dmxScreen, maskFormat);
+ if (!pFormat) {
+ /* FIXME: Error! */
+ }
+
+ XRenderCompositeTriangles(dmxScreen->beDisplay,
+ op,
+ pSrcPriv->pict,
+ pDstPriv->pict,
+ pFormat,
+ xSrc, ySrc, (XTriangle *) tris, ntri);
+ dmxSync(dmxScreen, FALSE);
}
DMX_WRAP(Triangles, dmxTriangles, dmxScreen, ps);
diff --git a/hw/dmx/dmxpict.h b/hw/dmx/dmxpict.h
index a732991e4..6c37be924 100644
--- a/hw/dmx/dmxpict.h
+++ b/hw/dmx/dmxpict.h
@@ -43,23 +43,21 @@
/** Picture private structure */
typedef struct _dmxPictPriv {
- Picture pict; /**< Picture ID from back-end server */
- Mask savedMask; /**< Mask of picture attributes saved for
+ Picture pict; /**< Picture ID from back-end server */
+ Mask savedMask; /**< Mask of picture attributes saved for
* lazy window creation. */
} dmxPictPrivRec, *dmxPictPrivPtr;
-
/** Glyph Set private structure */
typedef struct _dmxGlyphPriv {
- GlyphSet *glyphSets; /**< Glyph Set IDs from back-end server */
+ GlyphSet *glyphSets; /**< Glyph Set IDs from back-end server */
} dmxGlyphPrivRec, *dmxGlyphPrivPtr;
-
extern void dmxInitRender(void);
extern void dmxResetRender(void);
extern Bool dmxPictureInit(ScreenPtr pScreen,
- PictFormatPtr formats, int nformats);
+ PictFormatPtr formats, int nformats);
extern void dmxCreatePictureList(WindowPtr pWindow);
extern Bool dmxDestroyPictureList(WindowPtr pWindow);
@@ -67,39 +65,37 @@ extern Bool dmxDestroyPictureList(WindowPtr pWindow);
extern int dmxCreatePicture(PicturePtr pPicture);
extern void dmxDestroyPicture(PicturePtr pPicture);
extern int dmxChangePictureClip(PicturePtr pPicture, int clipType,
- pointer value, int n);
+ pointer value, int n);
extern void dmxDestroyPictureClip(PicturePtr pPicture);
extern void dmxChangePicture(PicturePtr pPicture, Mask mask);
extern void dmxValidatePicture(PicturePtr pPicture, Mask mask);
extern void dmxComposite(CARD8 op,
- PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
- INT16 xSrc, INT16 ySrc,
- INT16 xMask, INT16 yMask,
- INT16 xDst, INT16 yDst,
- CARD16 width, CARD16 height);
+ PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
+ INT16 xSrc, INT16 ySrc,
+ INT16 xMask, INT16 yMask,
+ INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
extern void dmxGlyphs(CARD8 op,
- PicturePtr pSrc, PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc, INT16 ySrc,
- int nlists, GlyphListPtr lists, GlyphPtr *glyphs);
+ PicturePtr pSrc, PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc, INT16 ySrc,
+ int nlists, GlyphListPtr lists, GlyphPtr * glyphs);
extern void dmxCompositeRects(CARD8 op,
- PicturePtr pDst,
- xRenderColor *color,
- int nRect, xRectangle *rects);
+ PicturePtr pDst,
+ xRenderColor * color,
+ int nRect, xRectangle *rects);
extern Bool dmxInitIndexed(ScreenPtr pScreen, PictFormatPtr pFormat);
extern void dmxCloseIndexed(ScreenPtr pScreen, PictFormatPtr pFormat);
extern void dmxUpdateIndexed(ScreenPtr pScreen, PictFormatPtr pFormat,
- int ndef, xColorItem *pdef);
+ int ndef, xColorItem * pdef);
extern void dmxTrapezoids(CARD8 op,
- PicturePtr pSrc, PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc, INT16 ySrc,
- int ntrap, xTrapezoid *traps);
+ PicturePtr pSrc, PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc, INT16 ySrc,
+ int ntrap, xTrapezoid * traps);
extern void dmxTriangles(CARD8 op,
- PicturePtr pSrc, PicturePtr pDst,
- PictFormatPtr maskFormat,
- INT16 xSrc, INT16 ySrc,
- int ntri, xTriangle *tris);
+ PicturePtr pSrc, PicturePtr pDst,
+ PictFormatPtr maskFormat,
+ INT16 xSrc, INT16 ySrc, int ntri, xTriangle * tris);
extern int dmxBECreateGlyphSet(int idx, GlyphSetPtr glyphSet);
extern Bool dmxBEFreeGlyphSet(ScreenPtr pScreen, GlyphSetPtr glyphSet);
@@ -117,4 +113,4 @@ extern Bool dmxBEFreePicture(PicturePtr pPicture);
#define DMX_GET_GLYPH_PRIV(_pGlyph) \
(dmxGlyphPrivPtr)GlyphSetGetPrivate((_pGlyph), dmxGlyphSetPrivateKey)
-#endif /* DMXPICT_H */
+#endif /* DMXPICT_H */
diff --git a/hw/dmx/dmxpixmap.c b/hw/dmx/dmxpixmap.c
index 81b71151a..17aca9224 100644
--- a/hw/dmx/dmxpixmap.c
+++ b/hw/dmx/dmxpixmap.c
@@ -47,61 +47,67 @@
#include "privates.h"
/** Initialize a private area in \a pScreen for pixmap information. */
-Bool dmxInitPixmap(ScreenPtr pScreen)
+Bool
+dmxInitPixmap(ScreenPtr pScreen)
{
- if (!dixRegisterPrivateKey(&dmxPixPrivateKeyRec, PRIVATE_PIXMAP, sizeof(dmxPixPrivRec)))
- return FALSE;
+ if (!dixRegisterPrivateKey
+ (&dmxPixPrivateKeyRec, PRIVATE_PIXMAP, sizeof(dmxPixPrivRec)))
+ return FALSE;
return TRUE;
}
/** Create a pixmap on the back-end server. */
-void dmxBECreatePixmap(PixmapPtr pPixmap)
+void
+dmxBECreatePixmap(PixmapPtr pPixmap)
{
- ScreenPtr pScreen = pPixmap->drawable.pScreen;
+ ScreenPtr pScreen = pPixmap->drawable.pScreen;
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxPixPrivPtr pPixPriv = DMX_GET_PIXMAP_PRIV(pPixmap);
+ dmxPixPrivPtr pPixPriv = DMX_GET_PIXMAP_PRIV(pPixmap);
/* Make sure we haven't already created this pixmap. This can
* happen when the pixmap is used elsewhere (e.g., as a background
* or border for a window) and the refcnt > 1.
*/
if (pPixPriv->pixmap)
- return;
+ return;
if (pPixmap->drawable.width && pPixmap->drawable.height) {
- pPixPriv->pixmap = XCreatePixmap(dmxScreen->beDisplay,
- dmxScreen->scrnWin,
- pPixmap->drawable.width,
- pPixmap->drawable.height,
- pPixmap->drawable.depth);
- dmxSync(dmxScreen, FALSE);
+ pPixPriv->pixmap = XCreatePixmap(dmxScreen->beDisplay,
+ dmxScreen->scrnWin,
+ pPixmap->drawable.width,
+ pPixmap->drawable.height,
+ pPixmap->drawable.depth);
+ dmxSync(dmxScreen, FALSE);
}
}
/** Create a pixmap for \a pScreen with the specified \a width, \a
* height, and \a depth. */
-PixmapPtr dmxCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
- unsigned usage_hint)
+PixmapPtr
+dmxCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
+ unsigned usage_hint)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- PixmapPtr pPixmap;
- int bpp;
- dmxPixPrivPtr pPixPriv;
+ PixmapPtr pPixmap;
+ int bpp;
+ dmxPixPrivPtr pPixPriv;
#if 0
DMX_UNWRAP(CreatePixmap, dmxScreen, pScreen);
if (pScreen->CreatePixmap)
- ret = pScreen->CreatePixmap(pPixmap);
+ ret = pScreen->CreatePixmap(pPixmap);
#endif
/* Create pixmap on back-end server */
- if (depth == 24) bpp = 32;
- else bpp = depth;
+ if (depth == 24)
+ bpp = 32;
+ else
+ bpp = depth;
pPixmap = AllocatePixmap(pScreen, 0);
if (!pPixmap)
- return NullPixmap;
+ return NullPixmap;
pPixmap->drawable.type = DRAWABLE_PIXMAP;
pPixmap->drawable.class = 0;
@@ -119,12 +125,12 @@ PixmapPtr dmxCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
pPixmap->usage_hint = usage_hint;
pPixPriv = DMX_GET_PIXMAP_PRIV(pPixmap);
- pPixPriv->pixmap = (Pixmap)0;
+ pPixPriv->pixmap = (Pixmap) 0;
pPixPriv->detachedImage = NULL;
/* Create the pixmap on the back-end server */
if (dmxScreen->beDisplay) {
- dmxBECreatePixmap(pPixmap);
+ dmxBECreatePixmap(pPixmap);
}
#if 0
@@ -135,50 +141,53 @@ PixmapPtr dmxCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
}
/** Destroy the pixmap on the back-end server. */
-Bool dmxBEFreePixmap(PixmapPtr pPixmap)
+Bool
+dmxBEFreePixmap(PixmapPtr pPixmap)
{
- ScreenPtr pScreen = pPixmap->drawable.pScreen;
+ ScreenPtr pScreen = pPixmap->drawable.pScreen;
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxPixPrivPtr pPixPriv = DMX_GET_PIXMAP_PRIV(pPixmap);
+ dmxPixPrivPtr pPixPriv = DMX_GET_PIXMAP_PRIV(pPixmap);
if (pPixPriv->pixmap) {
- XFreePixmap(dmxScreen->beDisplay, pPixPriv->pixmap);
- pPixPriv->pixmap = (Pixmap)0;
- return TRUE;
+ XFreePixmap(dmxScreen->beDisplay, pPixPriv->pixmap);
+ pPixPriv->pixmap = (Pixmap) 0;
+ return TRUE;
}
return FALSE;
}
/** Destroy the pixmap pointed to by \a pPixmap. */
-Bool dmxDestroyPixmap(PixmapPtr pPixmap)
+Bool
+dmxDestroyPixmap(PixmapPtr pPixmap)
{
- ScreenPtr pScreen = pPixmap->drawable.pScreen;
+ ScreenPtr pScreen = pPixmap->drawable.pScreen;
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- Bool ret = TRUE;
+ Bool ret = TRUE;
#if 0
DMX_UNWRAP(DestroyPixmap, dmxScreen, pScreen);
#endif
if (--pPixmap->refcnt)
- return TRUE;
+ return TRUE;
/* Destroy pixmap on back-end server */
if (dmxScreen->beDisplay) {
- if (dmxBEFreePixmap(pPixmap)) {
- /* Also make sure that we destroy any detached image */
- dmxPixPrivPtr pPixPriv = DMX_GET_PIXMAP_PRIV(pPixmap);
- if (pPixPriv->detachedImage)
- XDestroyImage(pPixPriv->detachedImage);
- dmxSync(dmxScreen, FALSE);
- }
+ if (dmxBEFreePixmap(pPixmap)) {
+ /* Also make sure that we destroy any detached image */
+ dmxPixPrivPtr pPixPriv = DMX_GET_PIXMAP_PRIV(pPixmap);
+
+ if (pPixPriv->detachedImage)
+ XDestroyImage(pPixPriv->detachedImage);
+ dmxSync(dmxScreen, FALSE);
+ }
}
FreePixmap(pPixmap);
#if 0
if (pScreen->DestroyPixmap)
- ret = pScreen->DestroyPixmap(pPixmap);
+ ret = pScreen->DestroyPixmap(pPixmap);
DMX_WRAP(DestroyPixmap, dmxDestroyPixmap, dmxScreen, pScreen);
#endif
@@ -187,60 +196,62 @@ Bool dmxDestroyPixmap(PixmapPtr pPixmap)
/** Create and return a region based on the pixmap pointed to by \a
* pPixmap. */
-RegionPtr dmxBitmapToRegion(PixmapPtr pPixmap)
+RegionPtr
+dmxBitmapToRegion(PixmapPtr pPixmap)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pPixmap->drawable.pScreen->myNum];
- dmxPixPrivPtr pPixPriv = DMX_GET_PIXMAP_PRIV(pPixmap);
- XImage *ximage;
- RegionPtr pReg, pTmpReg;
- int x, y;
- unsigned long previousPixel, currentPixel;
- BoxRec Box;
- Bool overlap;
-
+ dmxPixPrivPtr pPixPriv = DMX_GET_PIXMAP_PRIV(pPixmap);
+ XImage *ximage;
+ RegionPtr pReg, pTmpReg;
+ int x, y;
+ unsigned long previousPixel, currentPixel;
+ BoxRec Box;
+ Bool overlap;
+
if (!dmxScreen->beDisplay) {
- pReg = RegionCreate(NullBox, 1);
- return pReg;
+ pReg = RegionCreate(NullBox, 1);
+ return pReg;
}
ximage = XGetImage(dmxScreen->beDisplay, pPixPriv->pixmap, 0, 0,
- pPixmap->drawable.width, pPixmap->drawable.height,
- 1, XYPixmap);
+ pPixmap->drawable.width, pPixmap->drawable.height,
+ 1, XYPixmap);
pReg = RegionCreate(NullBox, 1);
pTmpReg = RegionCreate(NullBox, 1);
- if(!pReg || !pTmpReg) {
- XDestroyImage(ximage);
- return NullRegion;
+ if (!pReg || !pTmpReg) {
+ XDestroyImage(ximage);
+ return NullRegion;
}
for (y = 0; y < pPixmap->drawable.height; y++) {
- Box.y1 = y;
- Box.y2 = y + 1;
- previousPixel = 0L;
- for (x = 0; x < pPixmap->drawable.width; x++) {
- currentPixel = XGetPixel(ximage, x, y);
- if (previousPixel != currentPixel) {
- if (previousPixel == 0L) {
- /* left edge */
- Box.x1 = x;
- } else if (currentPixel == 0L) {
- /* right edge */
- Box.x2 = x;
- RegionReset(pTmpReg, &Box);
- RegionAppend(pReg, pTmpReg);
- }
- previousPixel = currentPixel;
- }
- }
- if (previousPixel != 0L) {
- /* right edge because of the end of pixmap */
- Box.x2 = pPixmap->drawable.width;
- RegionReset(pTmpReg, &Box);
- RegionAppend(pReg, pTmpReg);
- }
+ Box.y1 = y;
+ Box.y2 = y + 1;
+ previousPixel = 0L;
+ for (x = 0; x < pPixmap->drawable.width; x++) {
+ currentPixel = XGetPixel(ximage, x, y);
+ if (previousPixel != currentPixel) {
+ if (previousPixel == 0L) {
+ /* left edge */
+ Box.x1 = x;
+ }
+ else if (currentPixel == 0L) {
+ /* right edge */
+ Box.x2 = x;
+ RegionReset(pTmpReg, &Box);
+ RegionAppend(pReg, pTmpReg);
+ }
+ previousPixel = currentPixel;
+ }
+ }
+ if (previousPixel != 0L) {
+ /* right edge because of the end of pixmap */
+ Box.x2 = pPixmap->drawable.width;
+ RegionReset(pTmpReg, &Box);
+ RegionAppend(pReg, pTmpReg);
+ }
}
-
+
RegionDestroy(pTmpReg);
XDestroyImage(ximage);
diff --git a/hw/dmx/dmxpixmap.h b/hw/dmx/dmxpixmap.h
index 59da788b3..30bb666d5 100644
--- a/hw/dmx/dmxpixmap.h
+++ b/hw/dmx/dmxpixmap.h
@@ -41,24 +41,23 @@
/** Pixmap private area. */
typedef struct _dmxPixPriv {
- Pixmap pixmap;
- XImage *detachedImage;
+ Pixmap pixmap;
+ XImage *detachedImage;
} dmxPixPrivRec, *dmxPixPrivPtr;
-
-extern Bool dmxInitPixmap(ScreenPtr pScreen);
+extern Bool dmxInitPixmap(ScreenPtr pScreen);
extern PixmapPtr dmxCreatePixmap(ScreenPtr pScreen,
- int width, int height, int depth,
- unsigned usage_hint);
-extern Bool dmxDestroyPixmap(PixmapPtr pPixmap);
+ int width, int height, int depth,
+ unsigned usage_hint);
+extern Bool dmxDestroyPixmap(PixmapPtr pPixmap);
extern RegionPtr dmxBitmapToRegion(PixmapPtr pPixmap);
-extern void dmxBECreatePixmap(PixmapPtr pPixmap);
-extern Bool dmxBEFreePixmap(PixmapPtr pPixmap);
+extern void dmxBECreatePixmap(PixmapPtr pPixmap);
+extern Bool dmxBEFreePixmap(PixmapPtr pPixmap);
/** Get pixmap private pointer. */
#define DMX_GET_PIXMAP_PRIV(_pPix) \
(dmxPixPrivPtr)dixLookupPrivate(&(_pPix)->devPrivates, dmxPixPrivateKey)
-#endif /* DMXPIXMAP_H */
+#endif /* DMXPIXMAP_H */
diff --git a/hw/dmx/dmxprop.c b/hw/dmx/dmxprop.c
index b4695dd5d..4be2dbd4c 100644
--- a/hw/dmx/dmxprop.c
+++ b/hw/dmx/dmxprop.c
@@ -62,7 +62,7 @@
#include "dmx.h"
#include "dmxprop.h"
#include "dmxlog.h"
-#include <X11/Xmu/SysUtil.h> /* For XmuGetHostname */
+#include <X11/Xmu/SysUtil.h> /* For XmuGetHostname */
/** Holds the window id of all DMX windows on the backend X server. */
#define DMX_ATOMNAME "DMX_NAME"
@@ -72,95 +72,108 @@
extern char *display;
-static int dmxPropertyErrorHandler(Display *dpy, XErrorEvent *ev)
+static int
+dmxPropertyErrorHandler(Display * dpy, XErrorEvent * ev)
{
return 0;
}
-static const unsigned char *dmxPropertyIdentifier(void)
+static const unsigned char *
+dmxPropertyIdentifier(void)
{
- /* RATS: These buffers are only used in
- * length-limited calls. */
- char hostname[256];
- static char buf[128];
- static int initialized = 0;
-
- if (initialized++) return (unsigned char *)buf;
-
+ /* RATS: These buffers are only used in
+ * length-limited calls. */
+ char hostname[256];
+ static char buf[128];
+ static int initialized = 0;
+
+ if (initialized++)
+ return (unsigned char *) buf;
+
XmuGetHostname(hostname, sizeof(hostname));
snprintf(buf, sizeof(buf), "%s:%s:%s", DMX_IDENT, hostname, display);
- return (unsigned char *)buf;
+ return (unsigned char *) buf;
}
/** Starting with the \a start screen, iterate over all of the screens
* on the same physical X server as \a start, calling \a f with the
* screen and the \a closure. (The common case is that \a start is the
* only DMX window on the backend X server.) */
-void *dmxPropertyIterate(DMXScreenInfo *start,
- void *(*f)(DMXScreenInfo *dmxScreen, void *),
- void *closure)
+void *
+dmxPropertyIterate(DMXScreenInfo * start,
+ void *(*f) (DMXScreenInfo * dmxScreen, void *),
+ void *closure)
{
DMXScreenInfo *pt;
if (!start->next) {
- if (!start->beDisplay) return NULL;
+ if (!start->beDisplay)
+ return NULL;
return f(start, closure);
}
- for (pt = start->next; /* condition at end of loop */; pt = pt->next) {
+ for (pt = start->next; /* condition at end of loop */ ; pt = pt->next) {
void *retval;
+
/* beDisplay ban be NULL if a screen was detached */
dmxLog(dmxDebug, "pt = %p\n", pt);
dmxLog(dmxDebug, "pt->beDisplay = %p\n", pt->beDisplay);
- if (pt->beDisplay && (retval = f(pt, closure))) return retval;
- if (pt == start) break;
+ if (pt->beDisplay && (retval = f(pt, closure)))
+ return retval;
+ if (pt == start)
+ break;
}
return NULL;
}
/** Returns 0 if this is the only Xdmx session on the display; 1
* otherwise. */
-static int dmxPropertyCheckOtherServers(DMXScreenInfo *dmxScreen, Atom atom)
+static int
+dmxPropertyCheckOtherServers(DMXScreenInfo * dmxScreen, Atom atom)
{
- Display *dpy = dmxScreen->beDisplay;
+ Display *dpy = dmxScreen->beDisplay;
XTextProperty tp;
XTextProperty tproot;
- const char *pt;
- int retcode = 0;
- char **list = NULL;
- int count = 0;
- int i;
- int (*dmxOldHandler)(Display *, XErrorEvent *);
+ const char *pt;
+ int retcode = 0;
+ char **list = NULL;
+ int count = 0;
+ int i;
+ int (*dmxOldHandler) (Display *, XErrorEvent *);
if (!dpy)
- return 0;
-
- if (!XGetTextProperty(dpy, RootWindow(dpy,0), &tproot, atom)
- || !tproot.nitems) return 0;
-
- /* Ignore BadWindow errors for this
- * routine because the window id stored
- * in the property might be old */
+ return 0;
+
+ if (!XGetTextProperty(dpy, RootWindow(dpy, 0), &tproot, atom)
+ || !tproot.nitems)
+ return 0;
+
+ /* Ignore BadWindow errors for this
+ * routine because the window id stored
+ * in the property might be old */
dmxOldHandler = XSetErrorHandler(dmxPropertyErrorHandler);
- for (pt = (const char *)tproot.value; pt && *pt; pt = pt ? pt + 1 : NULL) {
+ for (pt = (const char *) tproot.value; pt && *pt; pt = pt ? pt + 1 : NULL) {
if ((pt = strchr(pt, ','))) {
- Window win = strtol(pt+1, NULL, 10);
+ Window win = strtol(pt + 1, NULL, 10);
+
if (XGetTextProperty(dpy, win, &tp, atom) && tp.nitems) {
- if (!strncmp((char *)tp.value, DMX_IDENT, strlen(DMX_IDENT))) {
+ if (!strncmp((char *) tp.value, DMX_IDENT, strlen(DMX_IDENT))) {
int flag = 0;
+
for (i = 0; i < count; i++)
- if (!strcmp(list[i], (char *)tp.value)) {
+ if (!strcmp(list[i], (char *) tp.value)) {
++flag;
break;
}
- if (flag) continue;
+ if (flag)
+ continue;
++retcode;
dmxLogOutputWarning(dmxScreen,
"%s also running on %s\n",
tp.value, dmxScreen->name);
list = realloc(list, ++count * sizeof(*list));
- list[count-1] = malloc(tp.nitems + 2);
- strncpy(list[count-1], (char *)tp.value, tp.nitems + 1);
+ list[count - 1] = malloc(tp.nitems + 2);
+ strncpy(list[count - 1], (char *) tp.value, tp.nitems + 1);
}
XFree(tp.value);
}
@@ -168,7 +181,8 @@ static int dmxPropertyCheckOtherServers(DMXScreenInfo *dmxScreen, Atom atom)
}
XSetErrorHandler(dmxOldHandler);
- for (i = 0; i < count; i++) free(list[i]);
+ for (i = 0; i < count; i++)
+ free(list[i]);
free(list);
XFree(tproot.value);
if (!retcode)
@@ -179,40 +193,45 @@ static int dmxPropertyCheckOtherServers(DMXScreenInfo *dmxScreen, Atom atom)
/** Returns NULL if this is the only Xdmx window on the display.
* Otherwise, returns a pointer to the dmxScreen of the other windows on
* the display. */
-static DMXScreenInfo *dmxPropertyCheckOtherWindows(DMXScreenInfo *dmxScreen,
- Atom atom)
+static DMXScreenInfo *
+dmxPropertyCheckOtherWindows(DMXScreenInfo * dmxScreen, Atom atom)
{
- Display *dpy = dmxScreen->beDisplay;
- const unsigned char *id = dmxPropertyIdentifier();
- XTextProperty tproot;
- XTextProperty tp;
- const char *pt;
- int (*dmxOldHandler)(Display *, XErrorEvent *);
+ Display *dpy = dmxScreen->beDisplay;
+ const unsigned char *id = dmxPropertyIdentifier();
+ XTextProperty tproot;
+ XTextProperty tp;
+ const char *pt;
+ int (*dmxOldHandler) (Display *, XErrorEvent *);
if (!dpy)
- return NULL;
+ return NULL;
- if (!XGetTextProperty(dpy, RootWindow(dpy,0), &tproot, atom)
- || !tproot.nitems) return 0;
+ if (!XGetTextProperty(dpy, RootWindow(dpy, 0), &tproot, atom)
+ || !tproot.nitems)
+ return 0;
- /* Ignore BadWindow errors for this
- * routine because the window id stored
- * in the property might be old */
+ /* Ignore BadWindow errors for this
+ * routine because the window id stored
+ * in the property might be old */
dmxOldHandler = XSetErrorHandler(dmxPropertyErrorHandler);
- for (pt = (const char *)tproot.value; pt && *pt; pt = pt ? pt + 1 : NULL) {
+ for (pt = (const char *) tproot.value; pt && *pt; pt = pt ? pt + 1 : NULL) {
if ((pt = strchr(pt, ','))) {
- Window win = strtol(pt+1, NULL, 10);
+ Window win = strtol(pt + 1, NULL, 10);
+
if (XGetTextProperty(dpy, win, &tp, atom) && tp.nitems) {
- dmxLog(dmxDebug,"On %s/%lu: %s\n",
+ dmxLog(dmxDebug, "On %s/%lu: %s\n",
dmxScreen->name, win, tp.value);
- if (!strncmp((char *)tp.value, (char *)id,
- strlen((char *)id))) {
+ if (!strncmp((char *) tp.value, (char *) id,
+ strlen((char *) id))) {
int idx;
-
- if (!(pt = strchr((char *)tp.value, ','))) continue;
- idx = strtol(pt+1, NULL, 10);
- if (idx < 0 || idx >= dmxNumScreens) continue;
- if (dmxScreens[idx].scrnWin != win) continue;
+
+ if (!(pt = strchr((char *) tp.value, ',')))
+ continue;
+ idx = strtol(pt + 1, NULL, 10);
+ if (idx < 0 || idx >= dmxNumScreens)
+ continue;
+ if (dmxScreens[idx].scrnWin != win)
+ continue;
XSetErrorHandler(dmxOldHandler);
return &dmxScreens[idx];
}
@@ -227,22 +246,23 @@ static DMXScreenInfo *dmxPropertyCheckOtherWindows(DMXScreenInfo *dmxScreen,
/** Returns 0 if this is the only Xdmx session on the display; 1
* otherwise. */
-int dmxPropertyDisplay(DMXScreenInfo *dmxScreen)
+int
+dmxPropertyDisplay(DMXScreenInfo * dmxScreen)
{
- Atom atom;
- const unsigned char *id = dmxPropertyIdentifier();
- Display *dpy = dmxScreen->beDisplay;
+ Atom atom;
+ const unsigned char *id = dmxPropertyIdentifier();
+ Display *dpy = dmxScreen->beDisplay;
if (!dpy)
- return 0;
+ return 0;
atom = XInternAtom(dpy, DMX_ATOMNAME, False);
if (dmxPropertyCheckOtherServers(dmxScreen, atom)) {
dmxScreen->shared = 1;
return 1;
}
- XChangeProperty(dpy, RootWindow(dpy,0), atom, XA_STRING, 8,
- PropModeReplace, id, strlen((char *)id));
+ XChangeProperty(dpy, RootWindow(dpy, 0), atom, XA_STRING, 8,
+ PropModeReplace, id, strlen((char *) id));
return 0;
}
@@ -251,18 +271,19 @@ int dmxPropertyDisplay(DMXScreenInfo *dmxScreen)
* names because there can be multiple synonyms for the same display,
* some of which cannot be determined without accessing the display
* itself (e.g., domain aliases or machines with multiple NICs). */
-int dmxPropertySameDisplay(DMXScreenInfo *dmxScreen, const char *name)
+int
+dmxPropertySameDisplay(DMXScreenInfo * dmxScreen, const char *name)
{
- Display *dpy0 = dmxScreen->beDisplay;
- Atom atom0;
- XTextProperty tp0;
- Display *dpy1 = NULL;
- Atom atom1;
- XTextProperty tp1;
- int retval = 0;
+ Display *dpy0 = dmxScreen->beDisplay;
+ Atom atom0;
+ XTextProperty tp0;
+ Display *dpy1 = NULL;
+ Atom atom1;
+ XTextProperty tp1;
+ int retval = 0;
if (!dpy0)
- return 0;
+ return 0;
tp0.nitems = 0;
tp1.nitems = 0;
@@ -271,7 +292,7 @@ int dmxPropertySameDisplay(DMXScreenInfo *dmxScreen, const char *name)
dmxLog(dmxWarning, "No atom on %s\n", dmxScreen->name);
return 0;
}
- if (!XGetTextProperty(dpy0, RootWindow(dpy0,0), &tp0, atom0)
+ if (!XGetTextProperty(dpy0, RootWindow(dpy0, 0), &tp0, atom0)
|| !tp0.nitems) {
dmxLog(dmxWarning, "No text property on %s\n", dmxScreen->name);
return 0;
@@ -286,17 +307,21 @@ int dmxPropertySameDisplay(DMXScreenInfo *dmxScreen, const char *name)
dmxLog(dmxDebug, "No atom on %s\n", name);
goto cleanup;
}
- if (!XGetTextProperty(dpy1, RootWindow(dpy1,0), &tp1, atom1)
+ if (!XGetTextProperty(dpy1, RootWindow(dpy1, 0), &tp1, atom1)
|| !tp1.nitems) {
dmxLog(dmxDebug, "No text property on %s\n", name);
goto cleanup;
}
- if (!strcmp((char *)tp0.value, (char *)tp1.value)) retval = 1;
-
- cleanup:
- if (tp0.nitems) XFree(tp0.value);
- if (tp1.nitems) XFree(tp1.value);
- if (dpy1) XCloseDisplay(dpy1);
+ if (!strcmp((char *) tp0.value, (char *) tp1.value))
+ retval = 1;
+
+ cleanup:
+ if (tp0.nitems)
+ XFree(tp0.value);
+ if (tp1.nitems)
+ XFree(tp1.value);
+ if (dpy1)
+ XCloseDisplay(dpy1);
return retval;
}
@@ -313,36 +338,38 @@ int dmxPropertySameDisplay(DMXScreenInfo *dmxScreen, const char *name)
*
* "#DMX_IDENT:<hostname running DMX>:<display name of DMX>,<screen number>"
*/
-void dmxPropertyWindow(DMXScreenInfo *dmxScreen)
+void
+dmxPropertyWindow(DMXScreenInfo * dmxScreen)
{
- Atom atom;
- const unsigned char *id = dmxPropertyIdentifier();
- Display *dpy = dmxScreen->beDisplay;
- Window win = dmxScreen->scrnWin;
- DMXScreenInfo *other;
- char buf[128]; /* RATS: only used with snprintf */
+ Atom atom;
+ const unsigned char *id = dmxPropertyIdentifier();
+ Display *dpy = dmxScreen->beDisplay;
+ Window win = dmxScreen->scrnWin;
+ DMXScreenInfo *other;
+ char buf[128]; /* RATS: only used with snprintf */
if (!dpy)
- return; /* FIXME: What should be done here if Xdmx is started
- * with this screen initially detached?
- */
+ return; /* FIXME: What should be done here if Xdmx is started
+ * with this screen initially detached?
+ */
atom = XInternAtom(dpy, DMX_ATOMNAME, False);
if ((other = dmxPropertyCheckOtherWindows(dmxScreen, atom))) {
DMXScreenInfo *tmp = dmxScreen->next;
- dmxScreen->next = (other->next ? other->next : other);
- other->next = (tmp ? tmp : dmxScreen);
+
+ dmxScreen->next = (other->next ? other->next : other);
+ other->next = (tmp ? tmp : dmxScreen);
dmxLog(dmxDebug, "%d/%s/%lu and %d/%s/%lu are on the same backend\n",
dmxScreen->index, dmxScreen->name, dmxScreen->scrnWin,
other->index, other->name, other->scrnWin);
}
snprintf(buf, sizeof(buf), ".%d,%lu", dmxScreen->index,
- (long unsigned)win);
- XChangeProperty(dpy, RootWindow(dpy,0), atom, XA_STRING, 8,
- PropModeAppend, (unsigned char *)buf, strlen(buf));
+ (long unsigned) win);
+ XChangeProperty(dpy, RootWindow(dpy, 0), atom, XA_STRING, 8,
+ PropModeAppend, (unsigned char *) buf, strlen(buf));
snprintf(buf, sizeof(buf), "%s,%d", id, dmxScreen->index);
XChangeProperty(dpy, win, atom, XA_STRING, 8,
- PropModeAppend, (unsigned char *)buf, strlen(buf));
+ PropModeAppend, (unsigned char *) buf, strlen(buf));
}
diff --git a/hw/dmx/dmxprop.h b/hw/dmx/dmxprop.h
index 50135cd64..a1170520f 100644
--- a/hw/dmx/dmxprop.h
+++ b/hw/dmx/dmxprop.h
@@ -36,11 +36,10 @@
#ifndef _DMXPROP_H_
#define _DMXPROP_H_
-extern int dmxPropertyDisplay(DMXScreenInfo *dmxScreen);
-extern void dmxPropertyWindow(DMXScreenInfo *dmxScreen);
-extern void *dmxPropertyIterate(DMXScreenInfo *start,
- void *(*f)(DMXScreenInfo *dmxScreen,
- void *closure),
- void *closure);
-extern int dmxPropertySameDisplay(DMXScreenInfo *dmxScreen, const char *name);
+extern int dmxPropertyDisplay(DMXScreenInfo * dmxScreen);
+extern void dmxPropertyWindow(DMXScreenInfo * dmxScreen);
+extern void *dmxPropertyIterate(DMXScreenInfo * start,
+ void *(*f) (DMXScreenInfo * dmxScreen,
+ void *closure), void *closure);
+extern int dmxPropertySameDisplay(DMXScreenInfo * dmxScreen, const char *name);
#endif
diff --git a/hw/dmx/dmxscrinit.c b/hw/dmx/dmxscrinit.c
index 7a94627f0..37b3f3b5a 100644
--- a/hw/dmx/dmxscrinit.c
+++ b/hw/dmx/dmxscrinit.c
@@ -76,13 +76,14 @@ DevPrivateKeyRec dmxGlyphSetPrivateKeyRec;
/** Initialize the parts of screen \a idx that require access to the
* back-end server. */
-void dmxBEScreenInit(int idx, ScreenPtr pScreen)
+void
+dmxBEScreenInit(int idx, ScreenPtr pScreen)
{
- DMXScreenInfo *dmxScreen = &dmxScreens[idx];
- XSetWindowAttributes attribs;
- XGCValues gcvals;
- unsigned long mask;
- int i, j;
+ DMXScreenInfo *dmxScreen = &dmxScreens[idx];
+ XSetWindowAttributes attribs;
+ XGCValues gcvals;
+ unsigned long mask;
+ int i, j;
/* FIXME: The dmxScreenInit() code currently assumes that it will
* not be called if the Xdmx server is started with this screen
@@ -93,10 +94,10 @@ void dmxBEScreenInit(int idx, ScreenPtr pScreen)
* assumption.
*/
- pScreen->mmWidth = DisplayWidthMM(dmxScreen->beDisplay,
- DefaultScreen(dmxScreen->beDisplay));
- pScreen->mmHeight = DisplayHeightMM(dmxScreen->beDisplay,
- DefaultScreen(dmxScreen->beDisplay));
+ pScreen->mmWidth = DisplayWidthMM(dmxScreen->beDisplay,
+ DefaultScreen(dmxScreen->beDisplay));
+ pScreen->mmHeight = DisplayHeightMM(dmxScreen->beDisplay,
+ DefaultScreen(dmxScreen->beDisplay));
pScreen->whitePixel = dmxScreen->beWhitePixel;
pScreen->blackPixel = dmxScreen->beBlackPixel;
@@ -114,24 +115,22 @@ void dmxBEScreenInit(int idx, ScreenPtr pScreen)
| EnterWindowMask
| LeaveWindowMask
| PointerMotionMask
- | KeymapStateMask
- | FocusChangeMask);
+ | KeymapStateMask | FocusChangeMask);
attribs.colormap = dmxScreen->beDefColormaps[dmxScreen->beDefVisualIndex];
attribs.override_redirect = True;
-
+
dmxScreen->scrnWin =
- XCreateWindow(dmxScreen->beDisplay,
- DefaultRootWindow(dmxScreen->beDisplay),
- dmxScreen->scrnX,
- dmxScreen->scrnY,
- dmxScreen->scrnWidth,
- dmxScreen->scrnHeight,
- 0,
- pScreen->rootDepth,
- InputOutput,
- dmxScreen->beVisuals[dmxScreen->beDefVisualIndex].visual,
- mask,
- &attribs);
+ XCreateWindow(dmxScreen->beDisplay,
+ DefaultRootWindow(dmxScreen->beDisplay),
+ dmxScreen->scrnX,
+ dmxScreen->scrnY,
+ dmxScreen->scrnWidth,
+ dmxScreen->scrnHeight,
+ 0,
+ pScreen->rootDepth,
+ InputOutput,
+ dmxScreen->beVisuals[dmxScreen->beDefVisualIndex].visual,
+ mask, &attribs);
dmxPropertyWindow(dmxScreen);
/*
@@ -139,94 +138,95 @@ void dmxBEScreenInit(int idx, ScreenPtr pScreen)
* components.
*/
{
- char noCursorData[] = {0, 0, 0, 0,
- 0, 0, 0, 0};
- Pixmap pixmap;
- XColor color, tmp;
-
- pixmap = XCreateBitmapFromData(dmxScreen->beDisplay, dmxScreen->scrnWin,
- noCursorData, 8, 8);
- XAllocNamedColor(dmxScreen->beDisplay, dmxScreen->beDefColormaps[0],
- "black", &color, &tmp);
- dmxScreen->noCursor = XCreatePixmapCursor(dmxScreen->beDisplay,
- pixmap, pixmap,
- &color, &color, 0, 0);
- XDefineCursor(dmxScreen->beDisplay, dmxScreen->scrnWin,
- dmxScreen->noCursor);
-
- XFreePixmap(dmxScreen->beDisplay, pixmap);
+ char noCursorData[] = { 0, 0, 0, 0,
+ 0, 0, 0, 0
+ };
+ Pixmap pixmap;
+ XColor color, tmp;
+
+ pixmap = XCreateBitmapFromData(dmxScreen->beDisplay, dmxScreen->scrnWin,
+ noCursorData, 8, 8);
+ XAllocNamedColor(dmxScreen->beDisplay, dmxScreen->beDefColormaps[0],
+ "black", &color, &tmp);
+ dmxScreen->noCursor = XCreatePixmapCursor(dmxScreen->beDisplay,
+ pixmap, pixmap,
+ &color, &color, 0, 0);
+ XDefineCursor(dmxScreen->beDisplay, dmxScreen->scrnWin,
+ dmxScreen->noCursor);
+
+ XFreePixmap(dmxScreen->beDisplay, pixmap);
}
XMapWindow(dmxScreen->beDisplay, dmxScreen->scrnWin);
if (dmxShadowFB) {
- mask = (GCFunction
- | GCPlaneMask
- | GCClipMask);
- gcvals.function = GXcopy;
- gcvals.plane_mask = AllPlanes;
- gcvals.clip_mask = None;
-
- dmxScreen->shadowGC = XCreateGC(dmxScreen->beDisplay,
- dmxScreen->scrnWin,
- mask, &gcvals);
-
- dmxScreen->shadowFBImage =
- XCreateImage(dmxScreen->beDisplay,
- dmxScreen->beVisuals[dmxScreen->beDefVisualIndex].visual,
- dmxScreen->beDepth,
- ZPixmap,
- 0,
- (char *)dmxScreen->shadow,
- dmxScreen->scrnWidth, dmxScreen->scrnHeight,
- dmxScreen->beBPP,
- PixmapBytePad(dmxScreen->scrnWidth,
- dmxScreen->beBPP));
- } else {
- /* Create default drawables (used during GC creation) */
- for (i = 0; i < dmxScreen->beNumPixmapFormats; i++)
- for (j = 0; j < dmxScreen->beNumDepths; j++)
- if ((dmxScreen->bePixmapFormats[i].depth == 1) ||
- (dmxScreen->bePixmapFormats[i].depth ==
- dmxScreen->beDepths[j])) {
- dmxScreen->scrnDefDrawables[i] = (Drawable)
- XCreatePixmap(dmxScreen->beDisplay, dmxScreen->scrnWin,
- 1, 1, dmxScreen->bePixmapFormats[i].depth);
- break;
- }
+ mask = (GCFunction | GCPlaneMask | GCClipMask);
+ gcvals.function = GXcopy;
+ gcvals.plane_mask = AllPlanes;
+ gcvals.clip_mask = None;
+
+ dmxScreen->shadowGC = XCreateGC(dmxScreen->beDisplay,
+ dmxScreen->scrnWin, mask, &gcvals);
+
+ dmxScreen->shadowFBImage =
+ XCreateImage(dmxScreen->beDisplay,
+ dmxScreen->beVisuals[dmxScreen->beDefVisualIndex].
+ visual, dmxScreen->beDepth, ZPixmap, 0,
+ (char *) dmxScreen->shadow, dmxScreen->scrnWidth,
+ dmxScreen->scrnHeight, dmxScreen->beBPP,
+ PixmapBytePad(dmxScreen->scrnWidth, dmxScreen->beBPP));
+ }
+ else {
+ /* Create default drawables (used during GC creation) */
+ for (i = 0; i < dmxScreen->beNumPixmapFormats; i++)
+ for (j = 0; j < dmxScreen->beNumDepths; j++)
+ if ((dmxScreen->bePixmapFormats[i].depth == 1) ||
+ (dmxScreen->bePixmapFormats[i].depth ==
+ dmxScreen->beDepths[j])) {
+ dmxScreen->scrnDefDrawables[i] = (Drawable)
+ XCreatePixmap(dmxScreen->beDisplay, dmxScreen->scrnWin,
+ 1, 1,
+ dmxScreen->bePixmapFormats[i].depth);
+ break;
+ }
}
}
/** Initialize screen number \a idx. */
-Bool dmxScreenInit(int idx, ScreenPtr pScreen, int argc, char *argv[])
+Bool
+dmxScreenInit(int idx, ScreenPtr pScreen, int argc, char *argv[])
{
- DMXScreenInfo *dmxScreen = &dmxScreens[idx];
- int i, j;
+ DMXScreenInfo *dmxScreen = &dmxScreens[idx];
+ int i, j;
if (!dixRegisterPrivateKey(&dmxScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
- return FALSE;
+ return FALSE;
if (!dixRegisterPrivateKey(&dmxColormapPrivateKeyRec, PRIVATE_COLORMAP, 0))
- return FALSE;
+ return FALSE;
if (!dixRegisterPrivateKey(&dmxGlyphSetPrivateKeyRec, PRIVATE_GLYPHSET, 0))
- return FALSE;
+ return FALSE;
if (dmxGeneration != serverGeneration) {
- /* Allocate font private index */
- dmxFontPrivateIndex = AllocateFontPrivateIndex();
- if (dmxFontPrivateIndex == -1)
- return FALSE;
+ /* Allocate font private index */
+ dmxFontPrivateIndex = AllocateFontPrivateIndex();
+ if (dmxFontPrivateIndex == -1)
+ return FALSE;
- dmxGeneration = serverGeneration;
+ dmxGeneration = serverGeneration;
}
if (dmxShadowFB) {
- dmxScreen->shadow = shadowAlloc(dmxScreen->scrnWidth,
- dmxScreen->scrnHeight,
- dmxScreen->beBPP);
- } else {
- if (!dmxInitGC(pScreen)) return FALSE;
- if (!dmxInitWindow(pScreen)) return FALSE;
- if (!dmxInitPixmap(pScreen)) return FALSE;
+ dmxScreen->shadow = shadowAlloc(dmxScreen->scrnWidth,
+ dmxScreen->scrnHeight,
+ dmxScreen->beBPP);
+ }
+ else {
+ if (!dmxInitGC(pScreen))
+ return FALSE;
+ if (!dmxInitWindow(pScreen))
+ return FALSE;
+ if (!dmxInitPixmap(pScreen))
+ return FALSE;
}
/*
@@ -237,65 +237,63 @@ Bool dmxScreenInit(int idx, ScreenPtr pScreen, int argc, char *argv[])
* things easier here.
*/
for (i = 0; i < dmxScreen->beNumDepths; i++) {
- int depth;
- int visuals = 0;
- int bitsPerRgb = 0;
- int preferredClass = -1;
- Pixel redMask = 0;
- Pixel greenMask = 0;
- Pixel blueMask = 0;
-
- depth = dmxScreen->beDepths[i];
- for (j = 0; j < dmxScreen->beNumVisuals; j++) {
- XVisualInfo *vi;
-
- vi = &dmxScreen->beVisuals[j];
- if (vi->depth == depth) {
- /* Assume the masks are all the same. */
- visuals |= (1 << vi->class);
- bitsPerRgb = vi->bits_per_rgb;
- redMask = vi->red_mask;
- greenMask = vi->green_mask;
- blueMask = vi->blue_mask;
- if (j == dmxScreen->beDefVisualIndex) {
- preferredClass = vi->class;
- }
- }
- }
- miSetVisualTypesAndMasks(depth, visuals, bitsPerRgb, preferredClass,
- redMask, greenMask, blueMask);
+ int depth;
+ int visuals = 0;
+ int bitsPerRgb = 0;
+ int preferredClass = -1;
+ Pixel redMask = 0;
+ Pixel greenMask = 0;
+ Pixel blueMask = 0;
+
+ depth = dmxScreen->beDepths[i];
+ for (j = 0; j < dmxScreen->beNumVisuals; j++) {
+ XVisualInfo *vi;
+
+ vi = &dmxScreen->beVisuals[j];
+ if (vi->depth == depth) {
+ /* Assume the masks are all the same. */
+ visuals |= (1 << vi->class);
+ bitsPerRgb = vi->bits_per_rgb;
+ redMask = vi->red_mask;
+ greenMask = vi->green_mask;
+ blueMask = vi->blue_mask;
+ if (j == dmxScreen->beDefVisualIndex) {
+ preferredClass = vi->class;
+ }
+ }
+ }
+ miSetVisualTypesAndMasks(depth, visuals, bitsPerRgb, preferredClass,
+ redMask, greenMask, blueMask);
}
fbScreenInit(pScreen,
- dmxShadowFB ? dmxScreen->shadow : NULL,
- dmxScreen->scrnWidth,
- dmxScreen->scrnHeight,
- dmxScreen->beXDPI,
- dmxScreen->beXDPI,
- dmxScreen->scrnWidth,
- dmxScreen->beBPP);
- (void)dmxPictureInit(pScreen, 0, 0);
+ dmxShadowFB ? dmxScreen->shadow : NULL,
+ dmxScreen->scrnWidth,
+ dmxScreen->scrnHeight,
+ dmxScreen->beXDPI,
+ dmxScreen->beXDPI, dmxScreen->scrnWidth, dmxScreen->beBPP);
+ (void) dmxPictureInit(pScreen, 0, 0);
/* Not yet... */
pScreen->GetWindowPixmap = NULL;
pScreen->SetWindowPixmap = NULL;
if (dmxShadowFB && !shadowInit(pScreen, dmxShadowUpdateProc, NULL))
- return FALSE;
+ return FALSE;
if (dmxShadowFB) {
- miDCInitialize(pScreen, &dmxPointerCursorFuncs);
- } else {
+ miDCInitialize(pScreen, &dmxPointerCursorFuncs);
+ }
+ else {
MAXSCREENSALLOC(dmxCursorGeneration);
- if (dmxCursorGeneration[idx] != serverGeneration) {
- if (!(miPointerInitialize(pScreen,
- &dmxPointerSpriteFuncs,
- &dmxPointerCursorFuncs,
- FALSE)))
- return FALSE;
-
- dmxCursorGeneration[idx] = serverGeneration;
- }
+ if (dmxCursorGeneration[idx] != serverGeneration) {
+ if (!(miPointerInitialize(pScreen,
+ &dmxPointerSpriteFuncs,
+ &dmxPointerCursorFuncs, FALSE)))
+ return FALSE;
+
+ dmxCursorGeneration[idx] = serverGeneration;
+ }
}
DMX_WRAP(CloseScreen, dmxCloseScreen, dmxScreen, pScreen);
@@ -304,60 +302,61 @@ Bool dmxScreenInit(int idx, ScreenPtr pScreen, int argc, char *argv[])
dmxBEScreenInit(idx, pScreen);
if (!dmxShadowFB) {
- /* Wrap GC functions */
- DMX_WRAP(CreateGC, dmxCreateGC, dmxScreen, pScreen);
-
- /* Wrap Window functions */
- DMX_WRAP(CreateWindow, dmxCreateWindow, dmxScreen, pScreen);
- DMX_WRAP(DestroyWindow, dmxDestroyWindow, dmxScreen, pScreen);
- DMX_WRAP(PositionWindow, dmxPositionWindow, dmxScreen, pScreen);
- DMX_WRAP(ChangeWindowAttributes, dmxChangeWindowAttributes, dmxScreen,
- pScreen);
- DMX_WRAP(RealizeWindow, dmxRealizeWindow, dmxScreen, pScreen);
- DMX_WRAP(UnrealizeWindow, dmxUnrealizeWindow, dmxScreen, pScreen);
- DMX_WRAP(RestackWindow, dmxRestackWindow, dmxScreen, pScreen);
- DMX_WRAP(WindowExposures, dmxWindowExposures, dmxScreen, pScreen);
- DMX_WRAP(CopyWindow, dmxCopyWindow, dmxScreen, pScreen);
-
- DMX_WRAP(ResizeWindow, dmxResizeWindow, dmxScreen, pScreen);
- DMX_WRAP(ReparentWindow, dmxReparentWindow, dmxScreen, pScreen);
-
- DMX_WRAP(ChangeBorderWidth, dmxChangeBorderWidth, dmxScreen, pScreen);
-
- /* Wrap Image functions */
- DMX_WRAP(GetImage, dmxGetImage, dmxScreen, pScreen);
- DMX_WRAP(GetSpans, dmxGetSpans, dmxScreen, pScreen);
-
- /* Wrap Pixmap functions */
- DMX_WRAP(CreatePixmap, dmxCreatePixmap, dmxScreen, pScreen);
- DMX_WRAP(DestroyPixmap, dmxDestroyPixmap, dmxScreen, pScreen);
- DMX_WRAP(BitmapToRegion, dmxBitmapToRegion, dmxScreen, pScreen);
-
- /* Wrap Font functions */
- DMX_WRAP(RealizeFont, dmxRealizeFont, dmxScreen, pScreen);
- DMX_WRAP(UnrealizeFont, dmxUnrealizeFont, dmxScreen, pScreen);
-
- /* Wrap Colormap functions */
- DMX_WRAP(CreateColormap, dmxCreateColormap, dmxScreen, pScreen);
- DMX_WRAP(DestroyColormap, dmxDestroyColormap, dmxScreen, pScreen);
- DMX_WRAP(InstallColormap, dmxInstallColormap, dmxScreen, pScreen);
- DMX_WRAP(StoreColors, dmxStoreColors, dmxScreen, pScreen);
-
- /* Wrap Shape functions */
- DMX_WRAP(SetShape, dmxSetShape, dmxScreen, pScreen);
+ /* Wrap GC functions */
+ DMX_WRAP(CreateGC, dmxCreateGC, dmxScreen, pScreen);
+
+ /* Wrap Window functions */
+ DMX_WRAP(CreateWindow, dmxCreateWindow, dmxScreen, pScreen);
+ DMX_WRAP(DestroyWindow, dmxDestroyWindow, dmxScreen, pScreen);
+ DMX_WRAP(PositionWindow, dmxPositionWindow, dmxScreen, pScreen);
+ DMX_WRAP(ChangeWindowAttributes, dmxChangeWindowAttributes, dmxScreen,
+ pScreen);
+ DMX_WRAP(RealizeWindow, dmxRealizeWindow, dmxScreen, pScreen);
+ DMX_WRAP(UnrealizeWindow, dmxUnrealizeWindow, dmxScreen, pScreen);
+ DMX_WRAP(RestackWindow, dmxRestackWindow, dmxScreen, pScreen);
+ DMX_WRAP(WindowExposures, dmxWindowExposures, dmxScreen, pScreen);
+ DMX_WRAP(CopyWindow, dmxCopyWindow, dmxScreen, pScreen);
+
+ DMX_WRAP(ResizeWindow, dmxResizeWindow, dmxScreen, pScreen);
+ DMX_WRAP(ReparentWindow, dmxReparentWindow, dmxScreen, pScreen);
+
+ DMX_WRAP(ChangeBorderWidth, dmxChangeBorderWidth, dmxScreen, pScreen);
+
+ /* Wrap Image functions */
+ DMX_WRAP(GetImage, dmxGetImage, dmxScreen, pScreen);
+ DMX_WRAP(GetSpans, dmxGetSpans, dmxScreen, pScreen);
+
+ /* Wrap Pixmap functions */
+ DMX_WRAP(CreatePixmap, dmxCreatePixmap, dmxScreen, pScreen);
+ DMX_WRAP(DestroyPixmap, dmxDestroyPixmap, dmxScreen, pScreen);
+ DMX_WRAP(BitmapToRegion, dmxBitmapToRegion, dmxScreen, pScreen);
+
+ /* Wrap Font functions */
+ DMX_WRAP(RealizeFont, dmxRealizeFont, dmxScreen, pScreen);
+ DMX_WRAP(UnrealizeFont, dmxUnrealizeFont, dmxScreen, pScreen);
+
+ /* Wrap Colormap functions */
+ DMX_WRAP(CreateColormap, dmxCreateColormap, dmxScreen, pScreen);
+ DMX_WRAP(DestroyColormap, dmxDestroyColormap, dmxScreen, pScreen);
+ DMX_WRAP(InstallColormap, dmxInstallColormap, dmxScreen, pScreen);
+ DMX_WRAP(StoreColors, dmxStoreColors, dmxScreen, pScreen);
+
+ /* Wrap Shape functions */
+ DMX_WRAP(SetShape, dmxSetShape, dmxScreen, pScreen);
}
if (!dmxCreateDefColormap(pScreen))
- return FALSE;
+ return FALSE;
return TRUE;
}
/** Close the \a pScreen resources on the back-end server. */
-void dmxBECloseScreen(ScreenPtr pScreen)
+void
+dmxBECloseScreen(ScreenPtr pScreen)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- int i;
+ int i;
/* Restore the back-end screen-saver and DPMS state. */
dmxDPMSTerm(dmxScreen);
@@ -365,32 +364,33 @@ void dmxBECloseScreen(ScreenPtr pScreen)
/* Free the screen resources */
XFreeCursor(dmxScreen->beDisplay, dmxScreen->noCursor);
- dmxScreen->noCursor = (Cursor)0;
+ dmxScreen->noCursor = (Cursor) 0;
XUnmapWindow(dmxScreen->beDisplay, dmxScreen->scrnWin);
XDestroyWindow(dmxScreen->beDisplay, dmxScreen->scrnWin);
- dmxScreen->scrnWin = (Window)0;
+ dmxScreen->scrnWin = (Window) 0;
if (dmxShadowFB) {
- /* Free the shadow GC and image assocated with the back-end server */
- XFreeGC(dmxScreen->beDisplay, dmxScreen->shadowGC);
- dmxScreen->shadowGC = NULL;
- XFree(dmxScreen->shadowFBImage);
- dmxScreen->shadowFBImage = NULL;
- } else {
- /* Free the default drawables */
- for (i = 0; i < dmxScreen->beNumPixmapFormats; i++) {
- if (dmxScreen->scrnDefDrawables[i]) {
- XFreePixmap(dmxScreen->beDisplay,
- dmxScreen->scrnDefDrawables[i]);
- dmxScreen->scrnDefDrawables[i] = (Drawable)0;
- }
- }
+ /* Free the shadow GC and image assocated with the back-end server */
+ XFreeGC(dmxScreen->beDisplay, dmxScreen->shadowGC);
+ dmxScreen->shadowGC = NULL;
+ XFree(dmxScreen->shadowFBImage);
+ dmxScreen->shadowFBImage = NULL;
+ }
+ else {
+ /* Free the default drawables */
+ for (i = 0; i < dmxScreen->beNumPixmapFormats; i++) {
+ if (dmxScreen->scrnDefDrawables[i]) {
+ XFreePixmap(dmxScreen->beDisplay,
+ dmxScreen->scrnDefDrawables[i]);
+ dmxScreen->scrnDefDrawables[i] = (Drawable) 0;
+ }
+ }
}
/* Free resources allocated during initialization (in dmxinit.c) */
for (i = 0; i < dmxScreen->beNumDefColormaps; i++)
- XFreeColormap(dmxScreen->beDisplay, dmxScreen->beDefColormaps[i]);
+ XFreeColormap(dmxScreen->beDisplay, dmxScreen->beDefColormaps[i]);
free(dmxScreen->beDefColormaps);
dmxScreen->beDefColormaps = NULL;
@@ -409,9 +409,9 @@ void dmxBECloseScreen(ScreenPtr pScreen)
#ifdef GLXEXT
if (dmxScreen->glxVisuals) {
- XFree(dmxScreen->glxVisuals);
- dmxScreen->glxVisuals = NULL;
- dmxScreen->numGlxVisuals = 0;
+ XFree(dmxScreen->glxVisuals);
+ dmxScreen->glxVisuals = NULL;
+ dmxScreen->numGlxVisuals = 0;
}
#endif
@@ -421,77 +421,79 @@ void dmxBECloseScreen(ScreenPtr pScreen)
}
/** Close screen number \a idx. */
-Bool dmxCloseScreen(int idx, ScreenPtr pScreen)
+Bool
+dmxCloseScreen(int idx, ScreenPtr pScreen)
{
DMXScreenInfo *dmxScreen = &dmxScreens[idx];
/* Reset the proc vectors */
if (idx == 0) {
- dmxResetRender();
- dmxResetFonts();
+ dmxResetRender();
+ dmxResetFonts();
}
if (dmxShadowFB) {
- /* Free the shadow framebuffer */
- free(dmxScreen->shadow);
- } else {
+ /* Free the shadow framebuffer */
+ free(dmxScreen->shadow);
+ }
+ else {
- /* Unwrap Shape functions */
- DMX_UNWRAP(SetShape, dmxScreen, pScreen);
+ /* Unwrap Shape functions */
+ DMX_UNWRAP(SetShape, dmxScreen, pScreen);
- /* Unwrap the pScreen functions */
- DMX_UNWRAP(CreateGC, dmxScreen, pScreen);
+ /* Unwrap the pScreen functions */
+ DMX_UNWRAP(CreateGC, dmxScreen, pScreen);
- DMX_UNWRAP(CreateWindow, dmxScreen, pScreen);
- DMX_UNWRAP(DestroyWindow, dmxScreen, pScreen);
- DMX_UNWRAP(PositionWindow, dmxScreen, pScreen);
- DMX_UNWRAP(ChangeWindowAttributes, dmxScreen, pScreen);
- DMX_UNWRAP(RealizeWindow, dmxScreen, pScreen);
- DMX_UNWRAP(UnrealizeWindow, dmxScreen, pScreen);
- DMX_UNWRAP(RestackWindow, dmxScreen, pScreen);
- DMX_UNWRAP(WindowExposures, dmxScreen, pScreen);
- DMX_UNWRAP(CopyWindow, dmxScreen, pScreen);
+ DMX_UNWRAP(CreateWindow, dmxScreen, pScreen);
+ DMX_UNWRAP(DestroyWindow, dmxScreen, pScreen);
+ DMX_UNWRAP(PositionWindow, dmxScreen, pScreen);
+ DMX_UNWRAP(ChangeWindowAttributes, dmxScreen, pScreen);
+ DMX_UNWRAP(RealizeWindow, dmxScreen, pScreen);
+ DMX_UNWRAP(UnrealizeWindow, dmxScreen, pScreen);
+ DMX_UNWRAP(RestackWindow, dmxScreen, pScreen);
+ DMX_UNWRAP(WindowExposures, dmxScreen, pScreen);
+ DMX_UNWRAP(CopyWindow, dmxScreen, pScreen);
- DMX_UNWRAP(ResizeWindow, dmxScreen, pScreen);
- DMX_UNWRAP(ReparentWindow, dmxScreen, pScreen);
+ DMX_UNWRAP(ResizeWindow, dmxScreen, pScreen);
+ DMX_UNWRAP(ReparentWindow, dmxScreen, pScreen);
- DMX_UNWRAP(ChangeBorderWidth, dmxScreen, pScreen);
+ DMX_UNWRAP(ChangeBorderWidth, dmxScreen, pScreen);
- DMX_UNWRAP(GetImage, dmxScreen, pScreen);
- DMX_UNWRAP(GetSpans, dmxScreen, pScreen);
+ DMX_UNWRAP(GetImage, dmxScreen, pScreen);
+ DMX_UNWRAP(GetSpans, dmxScreen, pScreen);
- DMX_UNWRAP(CreatePixmap, dmxScreen, pScreen);
- DMX_UNWRAP(DestroyPixmap, dmxScreen, pScreen);
- DMX_UNWRAP(BitmapToRegion, dmxScreen, pScreen);
+ DMX_UNWRAP(CreatePixmap, dmxScreen, pScreen);
+ DMX_UNWRAP(DestroyPixmap, dmxScreen, pScreen);
+ DMX_UNWRAP(BitmapToRegion, dmxScreen, pScreen);
- DMX_UNWRAP(RealizeFont, dmxScreen, pScreen);
- DMX_UNWRAP(UnrealizeFont, dmxScreen, pScreen);
+ DMX_UNWRAP(RealizeFont, dmxScreen, pScreen);
+ DMX_UNWRAP(UnrealizeFont, dmxScreen, pScreen);
- DMX_UNWRAP(CreateColormap, dmxScreen, pScreen);
- DMX_UNWRAP(DestroyColormap, dmxScreen, pScreen);
- DMX_UNWRAP(InstallColormap, dmxScreen, pScreen);
- DMX_UNWRAP(StoreColors, dmxScreen, pScreen);
+ DMX_UNWRAP(CreateColormap, dmxScreen, pScreen);
+ DMX_UNWRAP(DestroyColormap, dmxScreen, pScreen);
+ DMX_UNWRAP(InstallColormap, dmxScreen, pScreen);
+ DMX_UNWRAP(StoreColors, dmxScreen, pScreen);
}
DMX_UNWRAP(SaveScreen, dmxScreen, pScreen);
if (dmxScreen->beDisplay) {
- dmxBECloseScreen(pScreen);
+ dmxBECloseScreen(pScreen);
#if 1
- /* Free visuals, depths and pixmap formats here so that they
- * won't be freed when a screen is detached, thereby allowing
- * the screen to be reattached to be compared to the one
- * previously removed.
- */
- XFree(dmxScreen->beVisuals);
- dmxScreen->beVisuals = NULL;
-
- XFree(dmxScreen->beDepths);
- dmxScreen->beDepths = NULL;
-
- XFree(dmxScreen->bePixmapFormats);
- dmxScreen->bePixmapFormats = NULL;
+ /* Free visuals, depths and pixmap formats here so that they
+ * won't be freed when a screen is detached, thereby allowing
+ * the screen to be reattached to be compared to the one
+ * previously removed.
+ */
+ XFree(dmxScreen->beVisuals);
+ dmxScreen->beVisuals = NULL;
+
+ XFree(dmxScreen->beDepths);
+ dmxScreen->beDepths = NULL;
+
+ XFree(dmxScreen->bePixmapFormats);
+ dmxScreen->bePixmapFormats = NULL;
#endif
}
@@ -499,23 +501,24 @@ Bool dmxCloseScreen(int idx, ScreenPtr pScreen)
return pScreen->CloseScreen(idx, pScreen);
}
-static Bool dmxSaveScreen(ScreenPtr pScreen, int what)
+static Bool
+dmxSaveScreen(ScreenPtr pScreen, int what)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
if (dmxScreen->beDisplay) {
- switch (what) {
- case SCREEN_SAVER_OFF:
- case SCREEN_SAVER_FORCER:
- XResetScreenSaver(dmxScreen->beDisplay);
- dmxSync(dmxScreen, FALSE);
- break;
- case SCREEN_SAVER_ON:
- case SCREEN_SAVER_CYCLE:
- XActivateScreenSaver(dmxScreen->beDisplay);
- dmxSync(dmxScreen, FALSE);
- break;
- }
+ switch (what) {
+ case SCREEN_SAVER_OFF:
+ case SCREEN_SAVER_FORCER:
+ XResetScreenSaver(dmxScreen->beDisplay);
+ dmxSync(dmxScreen, FALSE);
+ break;
+ case SCREEN_SAVER_ON:
+ case SCREEN_SAVER_CYCLE:
+ XActivateScreenSaver(dmxScreen->beDisplay);
+ dmxSync(dmxScreen, FALSE);
+ break;
+ }
}
return TRUE;
diff --git a/hw/dmx/dmxscrinit.h b/hw/dmx/dmxscrinit.h
index 9c9fbc59d..5c0bfacce 100644
--- a/hw/dmx/dmxscrinit.h
+++ b/hw/dmx/dmxscrinit.h
@@ -45,4 +45,4 @@ extern Bool dmxScreenInit(int idx, ScreenPtr pScreen, int argc, char *argv[]);
extern void dmxBEScreenInit(int idx, ScreenPtr pScreen);
extern void dmxBECloseScreen(ScreenPtr pScreen);
-#endif /* DMXSCRINIT_H */
+#endif /* DMXSCRINIT_H */
diff --git a/hw/dmx/dmxshadow.c b/hw/dmx/dmxshadow.c
index a62eb5c52..9b4bafc34 100644
--- a/hw/dmx/dmxshadow.c
+++ b/hw/dmx/dmxshadow.c
@@ -44,27 +44,26 @@
* This file provides support for the shadow frame buffer. */
/** Update the screen from the shadow frame buffer. */
-void dmxShadowUpdateProc(ScreenPtr pScreen, shadowBufPtr pBuf)
+void
+dmxShadowUpdateProc(ScreenPtr pScreen, shadowBufPtr pBuf)
{
- RegionPtr damage = &pBuf->damage;
- int nbox = RegionNumRects(damage);
- BoxPtr pbox = RegionRects(damage);
+ RegionPtr damage = &pBuf->damage;
+ int nbox = RegionNumRects(damage);
+ BoxPtr pbox = RegionRects(damage);
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
if (!dmxScreen->beDisplay)
- return;
+ return;
while (nbox--) {
- XPutImage(dmxScreen->beDisplay,
- dmxScreen->scrnWin,
- dmxScreen->shadowGC,
- dmxScreen->shadowFBImage,
- pbox->x1, pbox->y1,
- pbox->x1, pbox->y1,
- pbox->x2 - pbox->x1,
- pbox->y2 - pbox->y1);
+ XPutImage(dmxScreen->beDisplay,
+ dmxScreen->scrnWin,
+ dmxScreen->shadowGC,
+ dmxScreen->shadowFBImage,
+ pbox->x1, pbox->y1,
+ pbox->x1, pbox->y1, pbox->x2 - pbox->x1, pbox->y2 - pbox->y1);
- pbox++;
+ pbox++;
}
dmxSync(dmxScreen, FALSE);
diff --git a/hw/dmx/dmxshadow.h b/hw/dmx/dmxshadow.h
index cafe87900..081b4d1dc 100644
--- a/hw/dmx/dmxshadow.h
+++ b/hw/dmx/dmxshadow.h
@@ -43,4 +43,4 @@
extern void dmxShadowUpdateProc(ScreenPtr pScreen, shadowBufPtr pBuf);
-#endif /* DMXSHADOW_H */
+#endif /* DMXSHADOW_H */
diff --git a/hw/dmx/dmxstat.c b/hw/dmx/dmxstat.c
index c3f1d3b36..0d8c22a9e 100644
--- a/hw/dmx/dmxstat.c
+++ b/hw/dmx/dmxstat.c
@@ -49,12 +49,12 @@
#include "dmx.h"
#include "dmxstat.h"
#include "dmxlog.h"
-#include <X11/Xos.h> /* For sys/time.h */
+#include <X11/Xos.h> /* For sys/time.h */
/** Used to compute a running average of value. */
typedef struct _DMXStatAvg {
- int pos;
- int count;
+ int pos;
+ int count;
unsigned long value[DMX_STAT_LENGTH];
} DMXStatAvg;
@@ -63,35 +63,39 @@ struct _DMXStatInfo {
unsigned long syncCount;
unsigned long oldSyncCount;
- DMXStatAvg usec;
- DMXStatAvg pending;
+ DMXStatAvg usec;
+ DMXStatAvg pending;
unsigned long bins[DMX_STAT_BINS];
};
/* Interval in mS between statistic message log entries. */
- int dmxStatInterval;
-static int dmxStatDisplays;
+int dmxStatInterval;
+static int dmxStatDisplays;
static OsTimerPtr dmxStatTimer;
/** Return the number of microseconds as an unsigned long.
* Unfortunately, this is only useful for intervals < about 4 sec. */
-static unsigned long usec(struct timeval *stop, struct timeval *start)
+static unsigned long
+usec(struct timeval *stop, struct timeval *start)
{
return (stop->tv_sec - start->tv_sec) * 1000000
+ stop->tv_usec - start->tv_usec;
}
-static unsigned long avg(DMXStatAvg *data, unsigned long *max)
+static unsigned long
+avg(DMXStatAvg * data, unsigned long *max)
{
unsigned long sum;
- int i;
+ int i;
*max = 0;
- if (!data->count) return 0;
+ if (!data->count)
+ return 0;
for (i = 0, sum = 0; i < data->count; i++) {
- if (data->value[i] > *max) *max = data->value[i];
+ if (data->value[i] > *max)
+ *max = data->value[i];
sum += data->value[i];
}
return sum / data->count;
@@ -103,32 +107,41 @@ static unsigned long avg(DMXStatAvg *data, unsigned long *max)
* used (meaning a line for every display will be printed). Note that
* this function takes string arguments because it will usually be
* called from #ddxProcessArgument in \a dmxinit.c. */
-void dmxStatActivate(const char *interval, const char *displays)
+void
+dmxStatActivate(const char *interval, const char *displays)
{
dmxStatInterval = (interval ? atoi(interval) : 1) * 1000;
dmxStatDisplays = (displays ? atoi(displays) : 0);
- if (dmxStatInterval < 1000) dmxStatInterval = 1000;
- if (dmxStatDisplays < 0) dmxStatDisplays = 0;
+ if (dmxStatInterval < 1000)
+ dmxStatInterval = 1000;
+ if (dmxStatDisplays < 0)
+ dmxStatDisplays = 0;
}
/** Allocate a \a DMXStatInfo structure. */
-DMXStatInfo *dmxStatAlloc(void)
+DMXStatInfo *
+dmxStatAlloc(void)
{
DMXStatInfo *pt = calloc(1, sizeof(*pt));
+
return pt;
}
/** Free the memory used by a \a DMXStatInfo structure. */
-void dmxStatFree(DMXStatInfo *pt)
+void
+dmxStatFree(DMXStatInfo * pt)
{
free(pt);
}
-static void dmxStatValue(DMXStatAvg *data, unsigned long value)
+static void
+dmxStatValue(DMXStatAvg * data, unsigned long value)
{
- if (data->count != DMX_STAT_LENGTH) ++data->count;
- if (data->pos >= DMX_STAT_LENGTH-1) data->pos = 0;
+ if (data->count != DMX_STAT_LENGTH)
+ ++data->count;
+ if (data->pos >= DMX_STAT_LENGTH - 1)
+ data->pos = 0;
data->value[data->pos++] = value;
}
@@ -136,35 +149,37 @@ static void dmxStatValue(DMXStatAvg *data, unsigned long value)
* and \a stop times (from gettimeofday()) and the number of
* pending-but-not-yet-processed XSync requests. This routine is called
* from #dmxDoSync in \a dmxsync.c */
-void dmxStatSync(DMXScreenInfo *dmxScreen,
- struct timeval *stop, struct timeval *start,
- unsigned long pending)
+void
+dmxStatSync(DMXScreenInfo * dmxScreen,
+ struct timeval *stop, struct timeval *start, unsigned long pending)
{
- DMXStatInfo *s = dmxScreen->stat;
+ DMXStatInfo *s = dmxScreen->stat;
unsigned long elapsed = usec(stop, start);
unsigned long thresh;
- int i;
+ int i;
++s->syncCount;
dmxStatValue(&s->usec, elapsed);
dmxStatValue(&s->pending, pending);
-
- for (i = 0, thresh = DMX_STAT_BIN0; i < DMX_STAT_BINS-1; i++) {
+
+ for (i = 0, thresh = DMX_STAT_BIN0; i < DMX_STAT_BINS - 1; i++) {
if (elapsed < thresh) {
++s->bins[i];
break;
}
thresh *= DMX_STAT_BINMULT;
}
- if (i == DMX_STAT_BINS-1) ++s->bins[i];
+ if (i == DMX_STAT_BINS - 1)
+ ++s->bins[i];
}
/* Actually do the work of printing out the human-readable message. */
-static CARD32 dmxStatCallback(OsTimerPtr timer, CARD32 t, pointer arg)
+static CARD32
+dmxStatCallback(OsTimerPtr timer, CARD32 t, pointer arg)
{
- int i, j;
- static int header = 0;
- int limit = dmxNumScreens;
+ int i, j;
+ static int header = 0;
+ int limit = dmxNumScreens;
if (!dmxNumScreens) {
header = 0;
@@ -177,33 +192,34 @@ static CARD32 dmxStatCallback(OsTimerPtr timer, CARD32 t, pointer arg)
"<10ms <1s >1s\n");
}
- if (dmxStatDisplays && dmxStatDisplays < limit) limit = dmxStatDisplays;
+ if (dmxStatDisplays && dmxStatDisplays < limit)
+ limit = dmxStatDisplays;
for (i = 0; i < limit; i++) {
DMXScreenInfo *dmxScreen = &dmxScreens[i];
- DMXStatInfo *s = dmxScreen->stat;
+ DMXStatInfo *s = dmxScreen->stat;
unsigned long aSync, mSync;
unsigned long aPend, mPend;
-
- if (!s) continue;
- aSync = avg(&s->usec, &mSync);
+ if (!s)
+ continue;
+
+ aSync = avg(&s->usec, &mSync);
aPend = avg(&s->pending, &mPend);
- dmxLog(dmxDebug, "%2d %9lu %7lu %6lu %6lu %6lu %6lu |",
- i, /* S */
- s->syncCount, /* SyncCount */
- (s->syncCount
- - s->oldSyncCount) * 1000 / dmxStatInterval, /* Sync/s */
- aSync, /* us/Sync */
- mSync, /* max/Sync */
- aPend, /* avgPend */
- mPend); /* maxPend */
+ dmxLog(dmxDebug, "%2d %9lu %7lu %6lu %6lu %6lu %6lu |", i, /* S */
+ s->syncCount, /* SyncCount */
+ (s->syncCount - s->oldSyncCount) * 1000 / dmxStatInterval, /* Sync/s */
+ aSync, /* us/Sync */
+ mSync, /* max/Sync */
+ aPend, /* avgPend */
+ mPend); /* maxPend */
for (j = 0; j < DMX_STAT_BINS; j++)
dmxLogCont(dmxDebug, " %5lu", s->bins[j]);
dmxLogCont(dmxDebug, "\n");
- /* Reset/clear */
+ /* Reset/clear */
s->oldSyncCount = s->syncCount;
- for (j = 0; j < DMX_STAT_BINS; j++) s->bins[j] = 0;
+ for (j = 0; j < DMX_STAT_BINS; j++)
+ s->bins[j] = 0;
}
return DMX_STAT_INTERVAL; /* Place on queue again */
}
@@ -213,7 +229,8 @@ static CARD32 dmxStatCallback(OsTimerPtr timer, CARD32 t, pointer arg)
* called. We don't need the same generation protection that we used in
* dmxSyncInit because our timer is always on a queue -- hence, server
* generation will always free it. */
-void dmxStatInit(void)
+void
+dmxStatInit(void)
{
if (dmxStatInterval)
dmxStatTimer = TimerSet(NULL, 0,
diff --git a/hw/dmx/dmxstat.h b/hw/dmx/dmxstat.h
index 04c88d3c9..8c8d7bae5 100644
--- a/hw/dmx/dmxstat.h
+++ b/hw/dmx/dmxstat.h
@@ -43,13 +43,13 @@
#define DMX_STAT_BIN0 10000 /**< us for bin[0] */
#define DMX_STAT_BINMULT 100 /**< multiplier for next bin[] */
-extern int dmxStatInterval; /**< Only for dmxstat.c and dmxsync.c */
-extern void dmxStatActivate(const char *interval, const char *displays);
+extern int dmxStatInterval; /**< Only for dmxstat.c and dmxsync.c */
+extern void dmxStatActivate(const char *interval, const char *displays);
extern DMXStatInfo *dmxStatAlloc(void);
-extern void dmxStatFree(DMXStatInfo *);
-extern void dmxStatInit(void);
-extern void dmxStatSync(DMXScreenInfo *dmxScreen,
- struct timeval *stop, struct timeval *start,
- unsigned long pending);
+extern void dmxStatFree(DMXStatInfo *);
+extern void dmxStatInit(void);
+extern void dmxStatSync(DMXScreenInfo * dmxScreen,
+ struct timeval *stop, struct timeval *start,
+ unsigned long pending);
#endif
diff --git a/hw/dmx/dmxsync.c b/hw/dmx/dmxsync.c
index 2c7ccb837..bf28584b4 100644
--- a/hw/dmx/dmxsync.c
+++ b/hw/dmx/dmxsync.c
@@ -56,22 +56,24 @@
#include "dmxlog.h"
#include <sys/time.h>
-static int dmxSyncInterval = 100; /* Default interval in milliseconds */
+static int dmxSyncInterval = 100; /* Default interval in milliseconds */
static OsTimerPtr dmxSyncTimer;
-static int dmxSyncPending;
+static int dmxSyncPending;
-static void dmxDoSync(DMXScreenInfo *dmxScreen)
+static void
+dmxDoSync(DMXScreenInfo * dmxScreen)
{
dmxScreen->needsSync = FALSE;
if (!dmxScreen->beDisplay)
- return; /* FIXME: Is this correct behavior for sync stats? */
+ return; /* FIXME: Is this correct behavior for sync stats? */
if (!dmxStatInterval) {
XSync(dmxScreen->beDisplay, False);
- } else {
+ }
+ else {
struct timeval start, stop;
-
+
gettimeofday(&start, 0);
XSync(dmxScreen->beDisplay, False);
gettimeofday(&stop, 0);
@@ -79,28 +81,31 @@ static void dmxDoSync(DMXScreenInfo *dmxScreen)
}
}
-static CARD32 dmxSyncCallback(OsTimerPtr timer, CARD32 time, pointer arg)
+static CARD32
+dmxSyncCallback(OsTimerPtr timer, CARD32 time, pointer arg)
{
- int i;
+ int i;
if (dmxSyncPending) {
for (i = 0; i < dmxNumScreens; i++) {
DMXScreenInfo *dmxScreen = &dmxScreens[i];
- if (dmxScreen->needsSync) dmxDoSync(dmxScreen);
+
+ if (dmxScreen->needsSync)
+ dmxDoSync(dmxScreen);
}
}
dmxSyncPending = 0;
return 0; /* Do not place on queue again */
}
-static void dmxSyncBlockHandler(pointer blockData, OSTimePtr pTimeout,
- pointer pReadMask)
+static void
+dmxSyncBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadMask)
{
TimerForce(dmxSyncTimer);
}
-static void dmxSyncWakeupHandler(pointer blockData, int result,
- pointer pReadMask)
+static void
+dmxSyncWakeupHandler(pointer blockData, int result, pointer pReadMask)
{
}
@@ -112,24 +117,27 @@ static void dmxSyncWakeupHandler(pointer blockData, int result,
*
* Note that the parameter to this routine is a string, since it will
* usually be called from #ddxProcessArgument in \a dmxinit.c */
-void dmxSyncActivate(const char *interval)
+void
+dmxSyncActivate(const char *interval)
{
dmxSyncInterval = (interval ? atoi(interval) : 100);
- if (dmxSyncInterval < 0) dmxSyncInterval = 0;
+ if (dmxSyncInterval < 0)
+ dmxSyncInterval = 0;
}
/** Initialize the XSync() batching optimization, but only if
* #dmxSyncActivate was last called with a non-negative value. */
-void dmxSyncInit(void)
+void
+dmxSyncInit(void)
{
if (dmxSyncInterval) {
RegisterBlockAndWakeupHandlers(dmxSyncBlockHandler,
- dmxSyncWakeupHandler,
- NULL);
+ dmxSyncWakeupHandler, NULL);
dmxLog(dmxInfo, "XSync batching with %d ms interval\n",
dmxSyncInterval);
- } else {
+ }
+ else {
dmxLog(dmxInfo, "XSync batching disabled\n");
}
}
@@ -147,7 +155,8 @@ void dmxSyncInit(void)
* If \a dmxScreen is \a NULL, then all pending syncs will be flushed
* immediately.
*/
-void dmxSync(DMXScreenInfo *dmxScreen, Bool now)
+void
+dmxSync(DMXScreenInfo * dmxScreen, Bool now)
{
static unsigned long dmxGeneration = 0;
@@ -159,35 +168,40 @@ void dmxSync(DMXScreenInfo *dmxScreen, Bool now)
* 2) freed, if it was on a queue (dmxSyncPending != 0), or
* 3) allocated, if it wasn't on a queue (dmxSyncPending == 0)
*/
- if (dmxSyncTimer && !dmxSyncPending) free(dmxSyncTimer);
- dmxSyncTimer = NULL;
- now = TRUE;
+ if (dmxSyncTimer && !dmxSyncPending)
+ free(dmxSyncTimer);
+ dmxSyncTimer = NULL;
+ now = TRUE;
dmxGeneration = serverGeneration;
}
- /* Queue sync */
+ /* Queue sync */
if (dmxScreen) {
dmxScreen->needsSync = TRUE;
++dmxSyncPending;
}
- /* Do sync or set time for later */
+ /* Do sync or set time for later */
if (now || !dmxScreen) {
- if (!TimerForce(dmxSyncTimer)) dmxSyncCallback(NULL, 0, NULL);
+ if (!TimerForce(dmxSyncTimer))
+ dmxSyncCallback(NULL, 0, NULL);
/* At this point, dmxSyncPending == 0 because
* dmxSyncCallback must have been called. */
if (dmxSyncPending)
dmxLog(dmxFatal, "dmxSync(%s,%d): dmxSyncPending = %d\n",
dmxScreen ? dmxScreen->name : "", now, dmxSyncPending);
- } else {
+ }
+ else {
dmxScreen->needsSync = TRUE;
if (dmxSyncPending == 1)
dmxSyncTimer = TimerSet(dmxSyncTimer, 0, dmxSyncInterval,
dmxSyncCallback, NULL);
}
- } else {
- /* If dmxSyncInterval is not being used,
- * then all the backends are already
- * up-to-date. */
- if (dmxScreen) dmxDoSync(dmxScreen);
+ }
+ else {
+ /* If dmxSyncInterval is not being used,
+ * then all the backends are already
+ * up-to-date. */
+ if (dmxScreen)
+ dmxDoSync(dmxScreen);
}
}
diff --git a/hw/dmx/dmxsync.h b/hw/dmx/dmxsync.h
index b80f54af2..d67ae09c6 100644
--- a/hw/dmx/dmxsync.h
+++ b/hw/dmx/dmxsync.h
@@ -39,5 +39,5 @@
extern void dmxSyncActivate(const char *interval);
extern void dmxSyncInit(void);
-extern void dmxSync(DMXScreenInfo *dmxScreen, Bool now);
+extern void dmxSync(DMXScreenInfo * dmxScreen, Bool now);
#endif
diff --git a/hw/dmx/dmxvisual.c b/hw/dmx/dmxvisual.c
index 7b8771f9e..23b9bddea 100644
--- a/hw/dmx/dmxvisual.c
+++ b/hw/dmx/dmxvisual.c
@@ -48,24 +48,25 @@
#include <GL/glxint.h>
extern VisualID glxMatchVisualInConfigList(ScreenPtr pScreen,
- VisualPtr pVisual,
- __GLXvisualConfig *configs,
- int nconfigs);
+ VisualPtr pVisual,
+ __GLXvisualConfig * configs,
+ int nconfigs);
-static Visual *dmxLookupGLXVisual(ScreenPtr pScreen, VisualPtr pVisual)
+static Visual *
+dmxLookupGLXVisual(ScreenPtr pScreen, VisualPtr pVisual)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- int j;
- VisualID vid;
+ int j;
+ VisualID vid;
vid = glxMatchVisualInConfigList(pScreen, pVisual,
- dmxScreen->glxVisuals,
- dmxScreen->numGlxVisuals);
+ dmxScreen->glxVisuals,
+ dmxScreen->numGlxVisuals);
if (vid) {
- /* Find the X visual of the matching GLX visual */
- for (j = 0; j < dmxScreen->beNumVisuals; j++)
- if (vid == dmxScreen->beVisuals[j].visualid)
- return dmxScreen->beVisuals[j].visual;
+ /* Find the X visual of the matching GLX visual */
+ for (j = 0; j < dmxScreen->beNumVisuals; j++)
+ if (vid == dmxScreen->beVisuals[j].visualid)
+ return dmxScreen->beVisuals[j].visual;
}
/* No matching visual found */
@@ -74,66 +75,71 @@ static Visual *dmxLookupGLXVisual(ScreenPtr pScreen, VisualPtr pVisual)
#endif
/** Return the visual that matched \a pVisual. */
-Visual *dmxLookupVisual(ScreenPtr pScreen, VisualPtr pVisual)
+Visual *
+dmxLookupVisual(ScreenPtr pScreen, VisualPtr pVisual)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- int i;
+ int i;
+
#ifdef GLXEXT
- Visual *retval;
+ Visual *retval;
#endif
if (!dmxScreen->beDisplay)
- return NULL;
+ return NULL;
#ifdef GLXEXT
if ((retval = dmxLookupGLXVisual(pScreen, pVisual)))
- return retval;
+ return retval;
#endif
for (i = 0; i < dmxScreen->beNumVisuals; i++) {
- if (pVisual->class == dmxScreen->beVisuals[i].class &&
- pVisual->bitsPerRGBValue == dmxScreen->beVisuals[i].bits_per_rgb &&
- pVisual->ColormapEntries == dmxScreen->beVisuals[i].colormap_size &&
- pVisual->nplanes == dmxScreen->beVisuals[i].depth &&
- pVisual->redMask == dmxScreen->beVisuals[i].red_mask &&
- pVisual->greenMask == dmxScreen->beVisuals[i].green_mask &&
- pVisual->blueMask == dmxScreen->beVisuals[i].blue_mask) {
- return dmxScreen->beVisuals[i].visual;
- }
+ if (pVisual->class == dmxScreen->beVisuals[i].class &&
+ pVisual->bitsPerRGBValue == dmxScreen->beVisuals[i].bits_per_rgb &&
+ pVisual->ColormapEntries == dmxScreen->beVisuals[i].colormap_size &&
+ pVisual->nplanes == dmxScreen->beVisuals[i].depth &&
+ pVisual->redMask == dmxScreen->beVisuals[i].red_mask &&
+ pVisual->greenMask == dmxScreen->beVisuals[i].green_mask &&
+ pVisual->blueMask == dmxScreen->beVisuals[i].blue_mask) {
+ return dmxScreen->beVisuals[i].visual;
+ }
}
return NULL;
}
/** Return the visual that matched the \a vid. */
-Visual *dmxLookupVisualFromID(ScreenPtr pScreen, VisualID vid)
+Visual *
+dmxLookupVisualFromID(ScreenPtr pScreen, VisualID vid)
{
Visual *visual;
- int i;
+ int i;
if (!dmxScreens[pScreen->myNum].beDisplay)
- return NULL;
+ return NULL;
for (i = 0; i < pScreen->numVisuals; i++) {
- if (pScreen->visuals[i].vid == vid) {
- visual = dmxLookupVisual(pScreen, &pScreen->visuals[i]);
- if (visual) return visual;
- }
+ if (pScreen->visuals[i].vid == vid) {
+ visual = dmxLookupVisual(pScreen, &pScreen->visuals[i]);
+ if (visual)
+ return visual;
+ }
}
return NULL;
}
/** Return the colormap for the \a visual. */
-Colormap dmxColormapFromDefaultVisual(ScreenPtr pScreen, Visual *visual)
+Colormap
+dmxColormapFromDefaultVisual(ScreenPtr pScreen, Visual * visual)
{
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- int i;
+ int i;
if (dmxScreen->beDisplay) {
- for (i = 0; i < dmxScreen->beNumDefColormaps; i++)
- if (visual == dmxScreen->beVisuals[i].visual)
- return dmxScreen->beDefColormaps[i];
+ for (i = 0; i < dmxScreen->beNumDefColormaps; i++)
+ if (visual == dmxScreen->beVisuals[i].visual)
+ return dmxScreen->beDefColormaps[i];
}
return None;
diff --git a/hw/dmx/dmxvisual.h b/hw/dmx/dmxvisual.h
index bcb54cd0e..4d97df927 100644
--- a/hw/dmx/dmxvisual.h
+++ b/hw/dmx/dmxvisual.h
@@ -39,9 +39,9 @@
#include "scrnintstr.h"
-extern Visual *dmxLookupVisual(ScreenPtr pScreen, VisualPtr pVisual);
-extern Visual *dmxLookupVisualFromID(ScreenPtr pScreen, VisualID vid);
-extern Colormap dmxColormapFromDefaultVisual(ScreenPtr pScreen,
- Visual *visual);
+extern Visual *dmxLookupVisual(ScreenPtr pScreen, VisualPtr pVisual);
+extern Visual *dmxLookupVisualFromID(ScreenPtr pScreen, VisualID vid);
+extern Colormap dmxColormapFromDefaultVisual(ScreenPtr pScreen,
+ Visual * visual);
-#endif /* DMXVISUAL_H */
+#endif /* DMXVISUAL_H */
diff --git a/hw/dmx/dmxwindow.c b/hw/dmx/dmxwindow.c
index 704fcff54..855e56b9d 100644
--- a/hw/dmx/dmxwindow.c
+++ b/hw/dmx/dmxwindow.c
@@ -52,79 +52,78 @@
static void dmxDoRestackWindow(WindowPtr pWindow);
static void dmxDoChangeWindowAttributes(WindowPtr pWindow,
- unsigned long *mask,
- XSetWindowAttributes *attribs);
+ unsigned long *mask,
+ XSetWindowAttributes * attribs);
static void dmxDoSetShape(WindowPtr pWindow);
/** Initialize the private area for the window functions. */
-Bool dmxInitWindow(ScreenPtr pScreen)
+Bool
+dmxInitWindow(ScreenPtr pScreen)
{
- if (!dixRegisterPrivateKey(&dmxWinPrivateKeyRec, PRIVATE_WINDOW, sizeof(dmxWinPrivRec)))
- return FALSE;
+ if (!dixRegisterPrivateKey
+ (&dmxWinPrivateKeyRec, PRIVATE_WINDOW, sizeof(dmxWinPrivRec)))
+ return FALSE;
return TRUE;
}
-
-Window dmxCreateRootWindow(WindowPtr pWindow)
+Window
+dmxCreateRootWindow(WindowPtr pWindow)
{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
- Window parent;
- Visual *visual;
- unsigned long mask;
- XSetWindowAttributes attribs;
- ColormapPtr pCmap;
- dmxColormapPrivPtr pCmapPriv;
+ ScreenPtr pScreen = pWindow->drawable.pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
+ Window parent;
+ Visual *visual;
+ unsigned long mask;
+ XSetWindowAttributes attribs;
+ ColormapPtr pCmap;
+ dmxColormapPrivPtr pCmapPriv;
/* Create root window */
- parent = dmxScreen->scrnWin; /* This is our "Screen" window */
+ parent = dmxScreen->scrnWin; /* This is our "Screen" window */
visual = dmxScreen->beVisuals[dmxScreen->beDefVisualIndex].visual;
- dixLookupResourceByType((pointer*) &pCmap, wColormap(pWindow),
- RT_COLORMAP, NullClient, DixUnknownAccess);
+ dixLookupResourceByType((pointer *) &pCmap, wColormap(pWindow),
+ RT_COLORMAP, NullClient, DixUnknownAccess);
pCmapPriv = DMX_GET_COLORMAP_PRIV(pCmap);
mask = CWEventMask | CWBackingStore | CWColormap | CWBorderPixel;
- attribs.event_mask = ExposureMask;
+ attribs.event_mask = ExposureMask;
attribs.backing_store = NotUseful;
- attribs.colormap = pCmapPriv->cmap;
- attribs.border_pixel = 0;
+ attribs.colormap = pCmapPriv->cmap;
+ attribs.border_pixel = 0;
/* Incorporate new attributes, if needed */
if (pWinPriv->attribMask) {
- dmxDoChangeWindowAttributes(pWindow, &pWinPriv->attribMask, &attribs);
- mask |= pWinPriv->attribMask;
+ dmxDoChangeWindowAttributes(pWindow, &pWinPriv->attribMask, &attribs);
+ mask |= pWinPriv->attribMask;
}
return XCreateWindow(dmxScreen->beDisplay,
- parent,
- pWindow->origin.x - wBorderWidth(pWindow),
- pWindow->origin.y - wBorderWidth(pWindow),
- pWindow->drawable.width,
- pWindow->drawable.height,
- pWindow->borderWidth,
- pWindow->drawable.depth,
- pWindow->drawable.class,
- visual,
- mask,
- &attribs);
+ parent,
+ pWindow->origin.x - wBorderWidth(pWindow),
+ pWindow->origin.y - wBorderWidth(pWindow),
+ pWindow->drawable.width,
+ pWindow->drawable.height,
+ pWindow->borderWidth,
+ pWindow->drawable.depth,
+ pWindow->drawable.class, visual, mask, &attribs);
}
/** Change the location and size of the "screen" window. Called from
* dmxextension.c dmxConfigureScreenWindow(). */
-void dmxResizeScreenWindow(ScreenPtr pScreen,
- int x, int y, int w, int h)
+void
+dmxResizeScreenWindow(ScreenPtr pScreen, int x, int y, int w, int h)
{
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- unsigned int m;
- XWindowChanges c;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ unsigned int m;
+ XWindowChanges c;
if (!dmxScreen->beDisplay)
- return;
+ return;
/* Handle resizing on back-end server */
m = CWX | CWY | CWWidth | CWHeight;
@@ -139,81 +138,85 @@ void dmxResizeScreenWindow(ScreenPtr pScreen,
/** Change the location and size of the "root" window. Called from
* #dmxCreateWindow. */
-void dmxResizeRootWindow(WindowPtr pRoot,
- int x, int y, int w, int h)
+void
+dmxResizeRootWindow(WindowPtr pRoot, int x, int y, int w, int h)
{
- DMXScreenInfo *dmxScreen = &dmxScreens[pRoot->drawable.pScreen->myNum];
- dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pRoot);
- unsigned int m;
- XWindowChanges c;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pRoot->drawable.pScreen->myNum];
+ dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pRoot);
+ unsigned int m;
+ XWindowChanges c;
/* Handle resizing on back-end server */
if (dmxScreen->beDisplay) {
- m = CWX | CWY | CWWidth | CWHeight;
- c.x = x;
- c.y = y;
- c.width = (w > 0) ? w : 1;
- c.height = (h > 0) ? h : 1;
+ m = CWX | CWY | CWWidth | CWHeight;
+ c.x = x;
+ c.y = y;
+ c.width = (w > 0) ? w : 1;
+ c.height = (h > 0) ? h : 1;
- XConfigureWindow(dmxScreen->beDisplay, pWinPriv->window, m, &c);
+ XConfigureWindow(dmxScreen->beDisplay, pWinPriv->window, m, &c);
}
if (w == 0 || h == 0) {
- if (pWinPriv->mapped) {
- if (dmxScreen->beDisplay)
- XUnmapWindow(dmxScreen->beDisplay, pWinPriv->window);
- pWinPriv->mapped = FALSE;
- }
- } else if (!pWinPriv->mapped) {
- if (dmxScreen->beDisplay)
- XMapWindow(dmxScreen->beDisplay, pWinPriv->window);
- pWinPriv->mapped = TRUE;
+ if (pWinPriv->mapped) {
+ if (dmxScreen->beDisplay)
+ XUnmapWindow(dmxScreen->beDisplay, pWinPriv->window);
+ pWinPriv->mapped = FALSE;
+ }
+ }
+ else if (!pWinPriv->mapped) {
+ if (dmxScreen->beDisplay)
+ XMapWindow(dmxScreen->beDisplay, pWinPriv->window);
+ pWinPriv->mapped = TRUE;
}
if (dmxScreen->beDisplay)
- dmxSync(dmxScreen, False);
+ dmxSync(dmxScreen, False);
}
-void dmxGetDefaultWindowAttributes(WindowPtr pWindow,
- Colormap *cmap,
- Visual **visual)
+void
+dmxGetDefaultWindowAttributes(WindowPtr pWindow,
+ Colormap * cmap, Visual ** visual)
{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
+ ScreenPtr pScreen = pWindow->drawable.pScreen;
if (pWindow->drawable.class != InputOnly &&
- pWindow->optional &&
- pWindow->optional->visual != wVisual(pWindow->parent)) {
-
- /* Find the matching visual */
- *visual = dmxLookupVisualFromID(pScreen, wVisual(pWindow));
-
- /* Handle optional colormaps */
- if (pWindow->optional->colormap) {
- ColormapPtr pCmap;
- dmxColormapPrivPtr pCmapPriv;
-
- dixLookupResourceByType((pointer*) &pCmap, wColormap(pWindow),
- RT_COLORMAP, NullClient, DixUnknownAccess);
- pCmapPriv = DMX_GET_COLORMAP_PRIV(pCmap);
- *cmap = pCmapPriv->cmap;
- } else {
- *cmap = dmxColormapFromDefaultVisual(pScreen, *visual);
- }
- } else {
- *visual = CopyFromParent;
- *cmap = (Colormap)0;
+ pWindow->optional &&
+ pWindow->optional->visual != wVisual(pWindow->parent)) {
+
+ /* Find the matching visual */
+ *visual = dmxLookupVisualFromID(pScreen, wVisual(pWindow));
+
+ /* Handle optional colormaps */
+ if (pWindow->optional->colormap) {
+ ColormapPtr pCmap;
+ dmxColormapPrivPtr pCmapPriv;
+
+ dixLookupResourceByType((pointer *) &pCmap, wColormap(pWindow),
+ RT_COLORMAP, NullClient, DixUnknownAccess);
+ pCmapPriv = DMX_GET_COLORMAP_PRIV(pCmap);
+ *cmap = pCmapPriv->cmap;
+ }
+ else {
+ *cmap = dmxColormapFromDefaultVisual(pScreen, *visual);
+ }
+ }
+ else {
+ *visual = CopyFromParent;
+ *cmap = (Colormap) 0;
}
}
-static Window dmxCreateNonRootWindow(WindowPtr pWindow)
+static Window
+dmxCreateNonRootWindow(WindowPtr pWindow)
{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
- Window parent;
- unsigned long mask = 0L;
- XSetWindowAttributes attribs;
- dmxWinPrivPtr pParentPriv = DMX_GET_WINDOW_PRIV(pWindow->parent);
+ ScreenPtr pScreen = pWindow->drawable.pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
+ Window parent;
+ unsigned long mask = 0L;
+ XSetWindowAttributes attribs;
+ dmxWinPrivPtr pParentPriv = DMX_GET_WINDOW_PRIV(pWindow->parent);
/* Create window on back-end server */
@@ -223,29 +226,29 @@ static Window dmxCreateNonRootWindow(WindowPtr pWindow)
from ReparentWindow and the grandparent window has not yet been
created */
if (!parent) {
- dmxCreateAndRealizeWindow(pWindow->parent, FALSE);
- parent = pParentPriv->window;
+ dmxCreateAndRealizeWindow(pWindow->parent, FALSE);
+ parent = pParentPriv->window;
}
/* Incorporate new attributes, if needed */
if (pWinPriv->attribMask) {
- dmxDoChangeWindowAttributes(pWindow, &pWinPriv->attribMask, &attribs);
- mask |= pWinPriv->attribMask;
+ dmxDoChangeWindowAttributes(pWindow, &pWinPriv->attribMask, &attribs);
+ mask |= pWinPriv->attribMask;
}
/* Add in default attributes */
if (pWindow->drawable.class != InputOnly) {
- mask |= CWBackingStore;
- attribs.backing_store = NotUseful;
-
- if (!(mask & CWColormap) && pWinPriv->cmap) {
- mask |= CWColormap;
- attribs.colormap = pWinPriv->cmap;
- if (!(mask & CWBorderPixel)) {
- mask |= CWBorderPixel;
- attribs.border_pixel = 0;
- }
- }
+ mask |= CWBackingStore;
+ attribs.backing_store = NotUseful;
+
+ if (!(mask & CWColormap) && pWinPriv->cmap) {
+ mask |= CWColormap;
+ attribs.colormap = pWinPriv->cmap;
+ if (!(mask & CWBorderPixel)) {
+ mask |= CWBorderPixel;
+ attribs.border_pixel = 0;
+ }
+ }
}
/* Handle case where subwindows are being mapped, but created out of
@@ -254,17 +257,15 @@ static Window dmxCreateNonRootWindow(WindowPtr pWindow)
pWinPriv->restacked = (pWindow->prevSib != NullWindow);
return XCreateWindow(dmxScreen->beDisplay,
- parent,
- pWindow->origin.x - wBorderWidth(pWindow),
- pWindow->origin.y - wBorderWidth(pWindow),
- pWindow->drawable.width,
- pWindow->drawable.height,
- pWindow->borderWidth,
- pWindow->drawable.depth,
- pWindow->drawable.class,
- pWinPriv->visual,
- mask,
- &attribs);
+ parent,
+ pWindow->origin.x - wBorderWidth(pWindow),
+ pWindow->origin.y - wBorderWidth(pWindow),
+ pWindow->drawable.width,
+ pWindow->drawable.height,
+ pWindow->borderWidth,
+ pWindow->drawable.depth,
+ pWindow->drawable.class,
+ pWinPriv->visual, mask, &attribs);
}
/** This function handles lazy window creation and realization. Window
@@ -276,93 +277,101 @@ static Window dmxCreateNonRootWindow(WindowPtr pWindow)
* associated with it, those pictures are created on the back-end
* server by calling #dmxCreatePictureList(). If \a doSync is TRUE,
* then #dmxSync() is called. */
-void dmxCreateAndRealizeWindow(WindowPtr pWindow, Bool doSync)
+void
+dmxCreateAndRealizeWindow(WindowPtr pWindow, Bool doSync)
{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
+ ScreenPtr pScreen = pWindow->drawable.pScreen;
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
+ dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
- if (!dmxScreen->beDisplay) return;
+ if (!dmxScreen->beDisplay)
+ return;
pWinPriv->window = dmxCreateNonRootWindow(pWindow);
- if (pWinPriv->restacked) dmxDoRestackWindow(pWindow);
- if (pWinPriv->isShaped) dmxDoSetShape(pWindow);
- if (pWinPriv->hasPict) dmxCreatePictureList(pWindow);
- if (pWinPriv->mapped) XMapWindow(dmxScreen->beDisplay,
- pWinPriv->window);
- if (doSync) dmxSync(dmxScreen, False);
+ if (pWinPriv->restacked)
+ dmxDoRestackWindow(pWindow);
+ if (pWinPriv->isShaped)
+ dmxDoSetShape(pWindow);
+ if (pWinPriv->hasPict)
+ dmxCreatePictureList(pWindow);
+ if (pWinPriv->mapped)
+ XMapWindow(dmxScreen->beDisplay, pWinPriv->window);
+ if (doSync)
+ dmxSync(dmxScreen, False);
}
/** Create \a pWindow on the back-end server. If the lazy window
* creation optimization is enabled, then the actual creation and
* realization of the window is handled by
* #dmxCreateAndRealizeWindow(). */
-Bool dmxCreateWindow(WindowPtr pWindow)
+Bool
+dmxCreateWindow(WindowPtr pWindow)
{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
- Bool ret = TRUE;
+ ScreenPtr pScreen = pWindow->drawable.pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
+ Bool ret = TRUE;
DMX_UNWRAP(CreateWindow, dmxScreen, pScreen);
#if 0
if (pScreen->CreateWindow)
- ret = pScreen->CreateWindow(pWindow);
+ ret = pScreen->CreateWindow(pWindow);
#endif
/* Set up the defaults */
- pWinPriv->window = (Window)0;
- pWinPriv->offscreen = TRUE;
- pWinPriv->mapped = FALSE;
- pWinPriv->restacked = FALSE;
+ pWinPriv->window = (Window) 0;
+ pWinPriv->offscreen = TRUE;
+ pWinPriv->mapped = FALSE;
+ pWinPriv->restacked = FALSE;
pWinPriv->attribMask = 0;
- pWinPriv->isShaped = FALSE;
- pWinPriv->hasPict = FALSE;
+ pWinPriv->isShaped = FALSE;
+ pWinPriv->hasPict = FALSE;
#ifdef GLXEXT
- pWinPriv->swapGroup = NULL;
- pWinPriv->barrier = 0;
+ pWinPriv->swapGroup = NULL;
+ pWinPriv->barrier = 0;
#endif
if (dmxScreen->beDisplay) {
- /* Only create the root window at this stage -- non-root windows are
- created when they are mapped and are on-screen */
- if (!pWindow->parent) {
- dmxScreen->rootWin = pWinPriv->window
- = dmxCreateRootWindow(pWindow);
- if (dmxScreen->scrnX != dmxScreen->rootX
- || dmxScreen->scrnY != dmxScreen->rootY
- || dmxScreen->scrnWidth != dmxScreen->rootWidth
- || dmxScreen->scrnHeight != dmxScreen->rootHeight) {
- dmxResizeRootWindow(pWindow,
- dmxScreen->rootX,
- dmxScreen->rootY,
- dmxScreen->rootWidth,
- dmxScreen->rootHeight);
- dmxUpdateScreenResources(screenInfo.screens[dmxScreen->index],
- dmxScreen->rootX,
- dmxScreen->rootY,
- dmxScreen->rootWidth,
- dmxScreen->rootHeight);
- pWindow->origin.x = dmxScreen->rootX;
- pWindow->origin.y = dmxScreen->rootY;
- }
- } else {
- dmxGetDefaultWindowAttributes(pWindow,
- &pWinPriv->cmap,
- &pWinPriv->visual);
-
- if (dmxLazyWindowCreation) {
- /* Save parent's visual for use later */
- if (pWinPriv->visual == CopyFromParent)
- pWinPriv->visual =
- dmxLookupVisualFromID(pScreen,
- wVisual(pWindow->parent));
- } else {
- pWinPriv->window = dmxCreateNonRootWindow(pWindow);
- }
- }
-
- dmxSync(dmxScreen, False);
+ /* Only create the root window at this stage -- non-root windows are
+ created when they are mapped and are on-screen */
+ if (!pWindow->parent) {
+ dmxScreen->rootWin = pWinPriv->window
+ = dmxCreateRootWindow(pWindow);
+ if (dmxScreen->scrnX != dmxScreen->rootX
+ || dmxScreen->scrnY != dmxScreen->rootY
+ || dmxScreen->scrnWidth != dmxScreen->rootWidth
+ || dmxScreen->scrnHeight != dmxScreen->rootHeight) {
+ dmxResizeRootWindow(pWindow,
+ dmxScreen->rootX,
+ dmxScreen->rootY,
+ dmxScreen->rootWidth,
+ dmxScreen->rootHeight);
+ dmxUpdateScreenResources(screenInfo.screens[dmxScreen->index],
+ dmxScreen->rootX,
+ dmxScreen->rootY,
+ dmxScreen->rootWidth,
+ dmxScreen->rootHeight);
+ pWindow->origin.x = dmxScreen->rootX;
+ pWindow->origin.y = dmxScreen->rootY;
+ }
+ }
+ else {
+ dmxGetDefaultWindowAttributes(pWindow,
+ &pWinPriv->cmap, &pWinPriv->visual);
+
+ if (dmxLazyWindowCreation) {
+ /* Save parent's visual for use later */
+ if (pWinPriv->visual == CopyFromParent)
+ pWinPriv->visual =
+ dmxLookupVisualFromID(pScreen,
+ wVisual(pWindow->parent));
+ }
+ else {
+ pWinPriv->window = dmxCreateNonRootWindow(pWindow);
+ }
+ }
+
+ dmxSync(dmxScreen, False);
}
DMX_WRAP(CreateWindow, dmxCreateWindow, dmxScreen, pScreen);
@@ -371,16 +380,17 @@ Bool dmxCreateWindow(WindowPtr pWindow)
}
/** Destroy \a pWindow on the back-end server. */
-Bool dmxBEDestroyWindow(WindowPtr pWindow)
+Bool
+dmxBEDestroyWindow(WindowPtr pWindow)
{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
+ ScreenPtr pScreen = pWindow->drawable.pScreen;
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
+ dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
if (pWinPriv->window) {
- XDestroyWindow(dmxScreen->beDisplay, pWinPriv->window);
- pWinPriv->window = (Window)0;
- return TRUE;
+ XDestroyWindow(dmxScreen->beDisplay, pWinPriv->window);
+ pWinPriv->window = (Window) 0;
+ return TRUE;
}
return FALSE;
@@ -388,14 +398,16 @@ Bool dmxBEDestroyWindow(WindowPtr pWindow)
/** Destroy \a pWindow on the back-end server. If any RENDER pictures
were created, destroy them as well. */
-Bool dmxDestroyWindow(WindowPtr pWindow)
+Bool
+dmxDestroyWindow(WindowPtr pWindow)
{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
+ ScreenPtr pScreen = pWindow->drawable.pScreen;
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- Bool ret = TRUE;
- Bool needSync = FALSE;
+ Bool ret = TRUE;
+ Bool needSync = FALSE;
+
#ifdef GLXEXT
- dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
+ dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
#endif
DMX_UNWRAP(DestroyWindow, dmxScreen, pScreen);
@@ -405,15 +417,16 @@ Bool dmxDestroyWindow(WindowPtr pWindow)
/* Destroy window on back-end server */
needSync |= dmxBEDestroyWindow(pWindow);
- if (needSync) dmxSync(dmxScreen, FALSE);
+ if (needSync)
+ dmxSync(dmxScreen, FALSE);
#ifdef GLXEXT
if (pWinPriv->swapGroup && pWinPriv->windowDestroyed)
- pWinPriv->windowDestroyed(pWindow);
+ pWinPriv->windowDestroyed(pWindow);
#endif
if (pScreen->DestroyWindow)
- ret = pScreen->DestroyWindow(pWindow);
+ ret = pScreen->DestroyWindow(pWindow);
DMX_WRAP(DestroyWindow, dmxDestroyWindow, dmxScreen, pScreen);
@@ -421,19 +434,20 @@ Bool dmxDestroyWindow(WindowPtr pWindow)
}
/** Change the position of \a pWindow to be \a x, \a y. */
-Bool dmxPositionWindow(WindowPtr pWindow, int x, int y)
+Bool
+dmxPositionWindow(WindowPtr pWindow, int x, int y)
{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- Bool ret = TRUE;
- dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
- unsigned int m;
- XWindowChanges c;
+ ScreenPtr pScreen = pWindow->drawable.pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ Bool ret = TRUE;
+ dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
+ unsigned int m;
+ XWindowChanges c;
DMX_UNWRAP(PositionWindow, dmxScreen, pScreen);
#if 0
if (pScreen->PositionWindow)
- ret = pScreen->PositionWindow(pWindow, x, y);
+ ret = pScreen->PositionWindow(pWindow, x, y);
#endif
/* Determine if the window is completely off the visible portion of
@@ -443,21 +457,22 @@ Bool dmxPositionWindow(WindowPtr pWindow, int x, int y)
/* If the window is now on-screen and it is mapped and it has not
been created yet, create it and map it */
if (!pWinPriv->window && pWinPriv->mapped && !pWinPriv->offscreen) {
- dmxCreateAndRealizeWindow(pWindow, TRUE);
- } else if (pWinPriv->window) {
- /* Position window on back-end server */
- m = CWX | CWY | CWWidth | CWHeight;
- c.x = pWindow->origin.x - wBorderWidth(pWindow);
- c.y = pWindow->origin.y - wBorderWidth(pWindow);
- c.width = pWindow->drawable.width;
- c.height = pWindow->drawable.height;
- if (pWindow->drawable.class != InputOnly) {
- m |= CWBorderWidth;
- c.border_width = pWindow->borderWidth;
- }
-
- XConfigureWindow(dmxScreen->beDisplay, pWinPriv->window, m, &c);
- dmxSync(dmxScreen, False);
+ dmxCreateAndRealizeWindow(pWindow, TRUE);
+ }
+ else if (pWinPriv->window) {
+ /* Position window on back-end server */
+ m = CWX | CWY | CWWidth | CWHeight;
+ c.x = pWindow->origin.x - wBorderWidth(pWindow);
+ c.y = pWindow->origin.y - wBorderWidth(pWindow);
+ c.width = pWindow->drawable.width;
+ c.height = pWindow->drawable.height;
+ if (pWindow->drawable.class != InputOnly) {
+ m |= CWBorderWidth;
+ c.border_width = pWindow->borderWidth;
+ }
+
+ XConfigureWindow(dmxScreen->beDisplay, pWinPriv->window, m, &c);
+ dmxSync(dmxScreen, False);
}
DMX_WRAP(PositionWindow, dmxPositionWindow, dmxScreen, pScreen);
@@ -465,110 +480,111 @@ Bool dmxPositionWindow(WindowPtr pWindow, int x, int y)
return ret;
}
-static void dmxDoChangeWindowAttributes(WindowPtr pWindow,
- unsigned long *mask,
- XSetWindowAttributes *attribs)
+static void
+dmxDoChangeWindowAttributes(WindowPtr pWindow,
+ unsigned long *mask, XSetWindowAttributes * attribs)
{
- dmxPixPrivPtr pPixPriv;
+ dmxPixPrivPtr pPixPriv;
if (*mask & CWBackPixmap) {
- switch (pWindow->backgroundState) {
- case None:
- attribs->background_pixmap = None;
- break;
-
- case ParentRelative:
- attribs->background_pixmap = ParentRelative;
- break;
-
- case BackgroundPixmap:
- pPixPriv = DMX_GET_PIXMAP_PRIV(pWindow->background.pixmap);
- attribs->background_pixmap = pPixPriv->pixmap;
- break;
-
- case BackgroundPixel:
- *mask &= ~CWBackPixmap;
- break;
- }
+ switch (pWindow->backgroundState) {
+ case None:
+ attribs->background_pixmap = None;
+ break;
+
+ case ParentRelative:
+ attribs->background_pixmap = ParentRelative;
+ break;
+
+ case BackgroundPixmap:
+ pPixPriv = DMX_GET_PIXMAP_PRIV(pWindow->background.pixmap);
+ attribs->background_pixmap = pPixPriv->pixmap;
+ break;
+
+ case BackgroundPixel:
+ *mask &= ~CWBackPixmap;
+ break;
+ }
}
if (*mask & CWBackPixel) {
- if (pWindow->backgroundState == BackgroundPixel)
- attribs->background_pixel = pWindow->background.pixel;
- else
- *mask &= ~CWBackPixel;
+ if (pWindow->backgroundState == BackgroundPixel)
+ attribs->background_pixel = pWindow->background.pixel;
+ else
+ *mask &= ~CWBackPixel;
}
if (*mask & CWBorderPixmap) {
- if (pWindow->borderIsPixel)
- *mask &= ~CWBorderPixmap;
- else {
- pPixPriv = DMX_GET_PIXMAP_PRIV(pWindow->border.pixmap);
- attribs->border_pixmap = pPixPriv->pixmap;
- }
+ if (pWindow->borderIsPixel)
+ *mask &= ~CWBorderPixmap;
+ else {
+ pPixPriv = DMX_GET_PIXMAP_PRIV(pWindow->border.pixmap);
+ attribs->border_pixmap = pPixPriv->pixmap;
+ }
}
if (*mask & CWBorderPixel) {
- if (pWindow->borderIsPixel)
- attribs->border_pixel = pWindow->border.pixel;
- else
- *mask &= ~CWBorderPixel;
+ if (pWindow->borderIsPixel)
+ attribs->border_pixel = pWindow->border.pixel;
+ else
+ *mask &= ~CWBorderPixel;
}
if (*mask & CWBitGravity)
- attribs->bit_gravity = pWindow->bitGravity;
+ attribs->bit_gravity = pWindow->bitGravity;
if (*mask & CWWinGravity)
- *mask &= ~CWWinGravity; /* Handled by dix */
+ *mask &= ~CWWinGravity; /* Handled by dix */
if (*mask & CWBackingStore)
- *mask &= ~CWBackingStore; /* Backing store not supported */
+ *mask &= ~CWBackingStore; /* Backing store not supported */
if (*mask & CWBackingPlanes)
- *mask &= ~CWBackingPlanes; /* Backing store not supported */
+ *mask &= ~CWBackingPlanes; /* Backing store not supported */
if (*mask & CWBackingPixel)
- *mask &= ~CWBackingPixel; /* Backing store not supported */
+ *mask &= ~CWBackingPixel; /* Backing store not supported */
if (*mask & CWOverrideRedirect)
- attribs->override_redirect = pWindow->overrideRedirect;
+ attribs->override_redirect = pWindow->overrideRedirect;
if (*mask & CWSaveUnder)
- *mask &= ~CWSaveUnder; /* Save unders not supported */
+ *mask &= ~CWSaveUnder; /* Save unders not supported */
if (*mask & CWEventMask)
- *mask &= ~CWEventMask; /* Events are handled by dix */
+ *mask &= ~CWEventMask; /* Events are handled by dix */
if (*mask & CWDontPropagate)
- *mask &= ~CWDontPropagate; /* Events are handled by dix */
+ *mask &= ~CWDontPropagate; /* Events are handled by dix */
if (*mask & CWColormap) {
- ColormapPtr pCmap;
- dmxColormapPrivPtr pCmapPriv;
+ ColormapPtr pCmap;
+ dmxColormapPrivPtr pCmapPriv;
- dixLookupResourceByType((pointer*) &pCmap, wColormap(pWindow),
- RT_COLORMAP, NullClient, DixUnknownAccess);
- pCmapPriv = DMX_GET_COLORMAP_PRIV(pCmap);
- attribs->colormap = pCmapPriv->cmap;
+ dixLookupResourceByType((pointer *) &pCmap, wColormap(pWindow),
+ RT_COLORMAP, NullClient, DixUnknownAccess);
+ pCmapPriv = DMX_GET_COLORMAP_PRIV(pCmap);
+ attribs->colormap = pCmapPriv->cmap;
}
if (*mask & CWCursor)
- *mask &= ~CWCursor; /* Handled by the cursor code */
+ *mask &= ~CWCursor; /* Handled by the cursor code */
}
/** Change the window attributes of \a pWindow. */
-Bool dmxChangeWindowAttributes(WindowPtr pWindow, unsigned long mask)
+Bool
+dmxChangeWindowAttributes(WindowPtr pWindow, unsigned long mask)
{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- Bool ret = TRUE;
- dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
- XSetWindowAttributes attribs;
+ ScreenPtr pScreen = pWindow->drawable.pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ Bool ret = TRUE;
+ dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
+ XSetWindowAttributes attribs;
DMX_UNWRAP(ChangeWindowAttributes, dmxScreen, pScreen);
#if 0
if (pScreen->ChangeWindowAttributes)
- ret = pScreen->ChangeWindowAttributes(pWindow, mask);
+ ret = pScreen->ChangeWindowAttributes(pWindow, mask);
#endif
/* Change window attribs on back-end server */
@@ -578,13 +594,13 @@ Bool dmxChangeWindowAttributes(WindowPtr pWindow, unsigned long mask)
pWinPriv->attribMask |= mask;
if (mask && pWinPriv->window) {
- XChangeWindowAttributes(dmxScreen->beDisplay, pWinPriv->window,
- mask, &attribs);
- dmxSync(dmxScreen, False);
+ XChangeWindowAttributes(dmxScreen->beDisplay, pWinPriv->window,
+ mask, &attribs);
+ dmxSync(dmxScreen, False);
}
DMX_WRAP(ChangeWindowAttributes, dmxChangeWindowAttributes, dmxScreen,
- pScreen);
+ pScreen);
return ret;
}
@@ -592,17 +608,18 @@ Bool dmxChangeWindowAttributes(WindowPtr pWindow, unsigned long mask)
/** Realize \a pWindow on the back-end server. If the lazy window
* creation optimization is enabled, the window is only realized when
* it at least partially overlaps the screen. */
-Bool dmxRealizeWindow(WindowPtr pWindow)
+Bool
+dmxRealizeWindow(WindowPtr pWindow)
{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
+ ScreenPtr pScreen = pWindow->drawable.pScreen;
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- Bool ret = TRUE;
- dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
+ Bool ret = TRUE;
+ dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
DMX_UNWRAP(RealizeWindow, dmxScreen, pScreen);
#if 0
if (pScreen->RealizeWindow)
- ret = pScreen->RealizeWindow(pWindow);
+ ret = pScreen->RealizeWindow(pWindow);
#endif
/* Determine if the window is completely off the visible portion of
@@ -612,13 +629,13 @@ Bool dmxRealizeWindow(WindowPtr pWindow)
/* If the window hasn't been created and it's not offscreen, then
create it */
if (!pWinPriv->window && !pWinPriv->offscreen) {
- dmxCreateAndRealizeWindow(pWindow, FALSE);
+ dmxCreateAndRealizeWindow(pWindow, FALSE);
}
if (pWinPriv->window) {
- /* Realize window on back-end server */
- XMapWindow(dmxScreen->beDisplay, pWinPriv->window);
- dmxSync(dmxScreen, False);
+ /* Realize window on back-end server */
+ XMapWindow(dmxScreen->beDisplay, pWinPriv->window);
+ dmxSync(dmxScreen, False);
}
/* Let the other functions know that the window is now mapped */
@@ -631,23 +648,24 @@ Bool dmxRealizeWindow(WindowPtr pWindow)
}
/** Unrealize \a pWindow on the back-end server. */
-Bool dmxUnrealizeWindow(WindowPtr pWindow)
+Bool
+dmxUnrealizeWindow(WindowPtr pWindow)
{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
+ ScreenPtr pScreen = pWindow->drawable.pScreen;
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- Bool ret = TRUE;
- dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
+ Bool ret = TRUE;
+ dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
DMX_UNWRAP(UnrealizeWindow, dmxScreen, pScreen);
#if 0
if (pScreen->UnrealizeWindow)
- ret = pScreen->UnrealizeWindow(pWindow);
+ ret = pScreen->UnrealizeWindow(pWindow);
#endif
if (pWinPriv->window) {
- /* Unrealize window on back-end server */
- XUnmapWindow(dmxScreen->beDisplay, pWinPriv->window);
- dmxSync(dmxScreen, False);
+ /* Unrealize window on back-end server */
+ XUnmapWindow(dmxScreen->beDisplay, pWinPriv->window);
+ dmxSync(dmxScreen, False);
}
/* When unrealized (i.e., unmapped), the window is always considered
@@ -657,7 +675,7 @@ Bool dmxUnrealizeWindow(WindowPtr pWindow)
#ifdef GLXEXT
if (pWinPriv->swapGroup && pWinPriv->windowUnmapped)
- pWinPriv->windowUnmapped(pWindow);
+ pWinPriv->windowUnmapped(pWindow);
#endif
DMX_WRAP(UnrealizeWindow, dmxUnrealizeWindow, dmxScreen, pScreen);
@@ -666,118 +684,122 @@ Bool dmxUnrealizeWindow(WindowPtr pWindow)
return ret;
}
-static void dmxDoRestackWindow(WindowPtr pWindow)
+static void
+dmxDoRestackWindow(WindowPtr pWindow)
{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
- WindowPtr pNextSib = pWindow->nextSib;
- unsigned int m;
- XWindowChanges c;
+ ScreenPtr pScreen = pWindow->drawable.pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
+ WindowPtr pNextSib = pWindow->nextSib;
+ unsigned int m;
+ XWindowChanges c;
if (pNextSib == NullWindow) {
- /* Window is at the bottom of the stack */
- m = CWStackMode;
- c.sibling = (Window)0;
- c.stack_mode = Below;
- XConfigureWindow(dmxScreen->beDisplay, pWinPriv->window, m, &c);
- } else {
- /* Window is not at the bottom of the stack */
- dmxWinPrivPtr pNextSibPriv = DMX_GET_WINDOW_PRIV(pNextSib);
-
- /* Handle case where siblings have not yet been created due to
+ /* Window is at the bottom of the stack */
+ m = CWStackMode;
+ c.sibling = (Window) 0;
+ c.stack_mode = Below;
+ XConfigureWindow(dmxScreen->beDisplay, pWinPriv->window, m, &c);
+ }
+ else {
+ /* Window is not at the bottom of the stack */
+ dmxWinPrivPtr pNextSibPriv = DMX_GET_WINDOW_PRIV(pNextSib);
+
+ /* Handle case where siblings have not yet been created due to
lazy window creation optimization by first finding the next
sibling in the sibling list that has been created (if any)
and then putting the current window just above that sibling,
and if no next siblings have been created yet, then put it at
the bottom of the stack (since it might have a previous
sibling that should be above it). */
- while (!pNextSibPriv->window) {
- pNextSib = pNextSib->nextSib;
- if (pNextSib == NullWindow) {
- /* Window is at the bottom of the stack */
- m = CWStackMode;
- c.sibling = (Window)0;
- c.stack_mode = Below;
- XConfigureWindow(dmxScreen->beDisplay, pWinPriv->window, m, &c);
- return;
- }
- pNextSibPriv = DMX_GET_WINDOW_PRIV(pNextSib);
- }
-
- m = CWStackMode | CWSibling;
- c.sibling = pNextSibPriv->window;
- c.stack_mode = Above;
- XConfigureWindow(dmxScreen->beDisplay, pWinPriv->window, m, &c);
+ while (!pNextSibPriv->window) {
+ pNextSib = pNextSib->nextSib;
+ if (pNextSib == NullWindow) {
+ /* Window is at the bottom of the stack */
+ m = CWStackMode;
+ c.sibling = (Window) 0;
+ c.stack_mode = Below;
+ XConfigureWindow(dmxScreen->beDisplay, pWinPriv->window, m, &c);
+ return;
+ }
+ pNextSibPriv = DMX_GET_WINDOW_PRIV(pNextSib);
+ }
+
+ m = CWStackMode | CWSibling;
+ c.sibling = pNextSibPriv->window;
+ c.stack_mode = Above;
+ XConfigureWindow(dmxScreen->beDisplay, pWinPriv->window, m, &c);
}
}
/** Handle window restacking. The actual restacking occurs in
* #dmxDoRestackWindow(). */
-void dmxRestackWindow(WindowPtr pWindow, WindowPtr pOldNextSib)
+void
+dmxRestackWindow(WindowPtr pWindow, WindowPtr pOldNextSib)
{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
+ ScreenPtr pScreen = pWindow->drawable.pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
DMX_UNWRAP(RestackWindow, dmxScreen, pScreen);
#if 0
if (pScreen->RestackWindow)
- pScreen->RestackWindow(pWindow, pOldNextSib);
+ pScreen->RestackWindow(pWindow, pOldNextSib);
#endif
if (pOldNextSib != pWindow->nextSib) {
- /* Track restacking for lazy window creation optimization */
- pWinPriv->restacked = TRUE;
-
- /* Restack window on back-end server */
- if (pWinPriv->window) {
- dmxDoRestackWindow(pWindow);
- dmxSync(dmxScreen, False);
- }
+ /* Track restacking for lazy window creation optimization */
+ pWinPriv->restacked = TRUE;
+
+ /* Restack window on back-end server */
+ if (pWinPriv->window) {
+ dmxDoRestackWindow(pWindow);
+ dmxSync(dmxScreen, False);
+ }
}
DMX_WRAP(RestackWindow, dmxRestackWindow, dmxScreen, pScreen);
dmxUpdateWindowInfo(DMX_UPDATE_RESTACK, pWindow);
}
-static Bool dmxWindowExposurePredicate(Display *dpy, XEvent *ev, XPointer ptr)
+static Bool
+dmxWindowExposurePredicate(Display * dpy, XEvent * ev, XPointer ptr)
{
- return (ev->type == Expose && ev->xexpose.window == *(Window *)ptr);
+ return (ev->type == Expose && ev->xexpose.window == *(Window *) ptr);
}
/** Handle exposures on \a pWindow. Since window exposures are handled
* in DMX, the events that are generated by the back-end server are
* redundant, so we eat them here. */
-void dmxWindowExposures(WindowPtr pWindow, RegionPtr prgn,
- RegionPtr other_exposed)
+void
+dmxWindowExposures(WindowPtr pWindow, RegionPtr prgn, RegionPtr other_exposed)
{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
+ ScreenPtr pScreen = pWindow->drawable.pScreen;
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
- XEvent ev;
+ dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
+ XEvent ev;
DMX_UNWRAP(WindowExposures, dmxScreen, pScreen);
dmxSync(dmxScreen, False);
if (pWinPriv->window) {
- while (XCheckIfEvent(dmxScreen->beDisplay, &ev,
- dmxWindowExposurePredicate,
- (XPointer)&pWinPriv->window)) {
- /* Handle expose events -- this should not be necessary
- since the base window in which the root window was
- created is guaranteed to be on top (override_redirect),
- so we should just swallow these events. If for some
- reason the window is not on top, then we'd need to
- collect these events and send them to the client later
- (e.g., during the block handler as Xnest does). */
- }
+ while (XCheckIfEvent(dmxScreen->beDisplay, &ev,
+ dmxWindowExposurePredicate,
+ (XPointer) & pWinPriv->window)) {
+ /* Handle expose events -- this should not be necessary
+ since the base window in which the root window was
+ created is guaranteed to be on top (override_redirect),
+ so we should just swallow these events. If for some
+ reason the window is not on top, then we'd need to
+ collect these events and send them to the client later
+ (e.g., during the block handler as Xnest does). */
+ }
}
#if 1
if (pScreen->WindowExposures)
- pScreen->WindowExposures(pWindow, prgn, other_exposed);
+ pScreen->WindowExposures(pWindow, prgn, other_exposed);
#endif
DMX_WRAP(WindowExposures, dmxWindowExposures, dmxScreen, pScreen);
}
@@ -785,18 +807,19 @@ void dmxWindowExposures(WindowPtr pWindow, RegionPtr prgn,
/** Move \a pWindow on the back-end server. Determine whether or not it
* is on or offscreen, and realize it if it is newly on screen and the
* lazy window creation optimization is enabled. */
-void dmxCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
+void
+dmxCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
- unsigned int m;
- XWindowChanges c;
+ ScreenPtr pScreen = pWindow->drawable.pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
+ unsigned int m;
+ XWindowChanges c;
DMX_UNWRAP(CopyWindow, dmxScreen, pScreen);
#if 0
if (pScreen->CopyWindow)
- pScreen->CopyWindow(pWindow, ptOldOrg, prgnSrc);
+ pScreen->CopyWindow(pWindow, ptOldOrg, prgnSrc);
#endif
/* Determine if the window is completely off the visible portion of
@@ -806,17 +829,18 @@ void dmxCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
/* If the window is now on-screen and it is mapped and it has not
been created yet, create it and map it */
if (!pWinPriv->window && pWinPriv->mapped && !pWinPriv->offscreen) {
- dmxCreateAndRealizeWindow(pWindow, TRUE);
- } else if (pWinPriv->window) {
- /* Move window on back-end server */
- m = CWX | CWY | CWWidth | CWHeight;
- c.x = pWindow->origin.x - wBorderWidth(pWindow);
- c.y = pWindow->origin.y - wBorderWidth(pWindow);
- c.width = pWindow->drawable.width;
- c.height = pWindow->drawable.height;
-
- XConfigureWindow(dmxScreen->beDisplay, pWinPriv->window, m, &c);
- dmxSync(dmxScreen, False);
+ dmxCreateAndRealizeWindow(pWindow, TRUE);
+ }
+ else if (pWinPriv->window) {
+ /* Move window on back-end server */
+ m = CWX | CWY | CWWidth | CWHeight;
+ c.x = pWindow->origin.x - wBorderWidth(pWindow);
+ c.y = pWindow->origin.y - wBorderWidth(pWindow);
+ c.width = pWindow->drawable.width;
+ c.height = pWindow->drawable.height;
+
+ XConfigureWindow(dmxScreen->beDisplay, pWinPriv->window, m, &c);
+ dmxSync(dmxScreen, False);
}
DMX_WRAP(CopyWindow, dmxCopyWindow, dmxScreen, pScreen);
@@ -826,23 +850,24 @@ void dmxCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
/** Resize \a pWindow on the back-end server. Determine whether or not
* it is on or offscreen, and realize it if it is newly on screen and
* the lazy window creation optimization is enabled. */
-void dmxResizeWindow(WindowPtr pWindow, int x, int y,
- unsigned int w, unsigned int h, WindowPtr pSib)
+void
+dmxResizeWindow(WindowPtr pWindow, int x, int y,
+ unsigned int w, unsigned int h, WindowPtr pSib)
{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
- dmxWinPrivPtr pSibPriv;
- unsigned int m;
- XWindowChanges c;
+ ScreenPtr pScreen = pWindow->drawable.pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
+ dmxWinPrivPtr pSibPriv;
+ unsigned int m;
+ XWindowChanges c;
if (pSib)
- pSibPriv = DMX_GET_WINDOW_PRIV(pSib);
+ pSibPriv = DMX_GET_WINDOW_PRIV(pSib);
DMX_UNWRAP(ResizeWindow, dmxScreen, pScreen);
#if 1
if (pScreen->ResizeWindow)
- pScreen->ResizeWindow(pWindow, x, y, w, h, pSib);
+ pScreen->ResizeWindow(pWindow, x, y, w, h, pSib);
#endif
/* Determine if the window is completely off the visible portion of
@@ -852,17 +877,18 @@ void dmxResizeWindow(WindowPtr pWindow, int x, int y,
/* If the window is now on-screen and it is mapped and it has not
been created yet, create it and map it */
if (!pWinPriv->window && pWinPriv->mapped && !pWinPriv->offscreen) {
- dmxCreateAndRealizeWindow(pWindow, TRUE);
- } else if (pWinPriv->window) {
- /* Handle resizing on back-end server */
- m = CWX | CWY | CWWidth | CWHeight;
- c.x = pWindow->origin.x - wBorderWidth(pWindow);
- c.y = pWindow->origin.y - wBorderWidth(pWindow);
- c.width = pWindow->drawable.width;
- c.height = pWindow->drawable.height;
-
- XConfigureWindow(dmxScreen->beDisplay, pWinPriv->window, m, &c);
- dmxSync(dmxScreen, False);
+ dmxCreateAndRealizeWindow(pWindow, TRUE);
+ }
+ else if (pWinPriv->window) {
+ /* Handle resizing on back-end server */
+ m = CWX | CWY | CWWidth | CWHeight;
+ c.x = pWindow->origin.x - wBorderWidth(pWindow);
+ c.y = pWindow->origin.y - wBorderWidth(pWindow);
+ c.width = pWindow->drawable.width;
+ c.height = pWindow->drawable.height;
+
+ XConfigureWindow(dmxScreen->beDisplay, pWinPriv->window, m, &c);
+ dmxSync(dmxScreen, False);
}
DMX_WRAP(ResizeWindow, dmxResizeWindow, dmxScreen, pScreen);
@@ -870,30 +896,31 @@ void dmxResizeWindow(WindowPtr pWindow, int x, int y,
}
/** Reparent \a pWindow on the back-end server. */
-void dmxReparentWindow(WindowPtr pWindow, WindowPtr pPriorParent)
+void
+dmxReparentWindow(WindowPtr pWindow, WindowPtr pPriorParent)
{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
+ ScreenPtr pScreen = pWindow->drawable.pScreen;
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
- dmxWinPrivPtr pParentPriv = DMX_GET_WINDOW_PRIV(pWindow->parent);
+ dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
+ dmxWinPrivPtr pParentPriv = DMX_GET_WINDOW_PRIV(pWindow->parent);
DMX_UNWRAP(ReparentWindow, dmxScreen, pScreen);
#if 0
if (pScreen->ReparentWindow)
- pScreen->ReparentWindow(pWindow, pPriorParent);
+ pScreen->ReparentWindow(pWindow, pPriorParent);
#endif
if (pWinPriv->window) {
- if (!pParentPriv->window) {
- dmxCreateAndRealizeWindow(pWindow->parent, FALSE);
- }
-
- /* Handle reparenting on back-end server */
- XReparentWindow(dmxScreen->beDisplay, pWinPriv->window,
- pParentPriv->window,
- pWindow->origin.x - wBorderWidth(pWindow),
- pWindow->origin.x - wBorderWidth(pWindow));
- dmxSync(dmxScreen, False);
+ if (!pParentPriv->window) {
+ dmxCreateAndRealizeWindow(pWindow->parent, FALSE);
+ }
+
+ /* Handle reparenting on back-end server */
+ XReparentWindow(dmxScreen->beDisplay, pWinPriv->window,
+ pParentPriv->window,
+ pWindow->origin.x - wBorderWidth(pWindow),
+ pWindow->origin.x - wBorderWidth(pWindow));
+ dmxSync(dmxScreen, False);
}
DMX_WRAP(ReparentWindow, dmxReparentWindow, dmxScreen, pScreen);
@@ -901,116 +928,120 @@ void dmxReparentWindow(WindowPtr pWindow, WindowPtr pPriorParent)
}
/** Change border width for \a pWindow to \a width pixels. */
-void dmxChangeBorderWidth(WindowPtr pWindow, unsigned int width)
+void
+dmxChangeBorderWidth(WindowPtr pWindow, unsigned int width)
{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
- unsigned int m;
- XWindowChanges c;
+ ScreenPtr pScreen = pWindow->drawable.pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
+ unsigned int m;
+ XWindowChanges c;
DMX_UNWRAP(ChangeBorderWidth, dmxScreen, pScreen);
#if 1
if (pScreen->ChangeBorderWidth)
- pScreen->ChangeBorderWidth(pWindow, width);
+ pScreen->ChangeBorderWidth(pWindow, width);
#endif
/* NOTE: Do we need to check for on/off screen here? */
if (pWinPriv->window) {
- /* Handle border width change on back-end server */
- m = CWBorderWidth;
- c.border_width = width;
+ /* Handle border width change on back-end server */
+ m = CWBorderWidth;
+ c.border_width = width;
- XConfigureWindow(dmxScreen->beDisplay, pWinPriv->window, m, &c);
- dmxSync(dmxScreen, False);
+ XConfigureWindow(dmxScreen->beDisplay, pWinPriv->window, m, &c);
+ dmxSync(dmxScreen, False);
}
DMX_WRAP(ChangeBorderWidth, dmxChangeBorderWidth, dmxScreen, pScreen);
}
-static void dmxDoSetShape(WindowPtr pWindow)
+static void
+dmxDoSetShape(WindowPtr pWindow)
{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
- int nBox;
- BoxPtr pBox;
- int nRect;
- XRectangle *pRect;
- XRectangle *pRectFirst;
+ ScreenPtr pScreen = pWindow->drawable.pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
+ int nBox;
+ BoxPtr pBox;
+ int nRect;
+ XRectangle *pRect;
+ XRectangle *pRectFirst;
/* First, set the bounding shape */
if (wBoundingShape(pWindow)) {
- pBox = RegionRects(wBoundingShape(pWindow));
- nRect = nBox = RegionNumRects(wBoundingShape(pWindow));
- pRectFirst = pRect = malloc(nRect * sizeof(*pRect));
- while (nBox--) {
- pRect->x = pBox->x1;
- pRect->y = pBox->y1;
- pRect->width = pBox->x2 - pBox->x1;
- pRect->height = pBox->y2 - pBox->y1;
- pBox++;
- pRect++;
- }
- XShapeCombineRectangles(dmxScreen->beDisplay, pWinPriv->window,
- ShapeBounding, 0, 0,
- pRectFirst, nRect,
- ShapeSet, YXBanded);
- free(pRectFirst);
- } else {
- XShapeCombineMask(dmxScreen->beDisplay, pWinPriv->window,
- ShapeBounding, 0, 0, None, ShapeSet);
+ pBox = RegionRects(wBoundingShape(pWindow));
+ nRect = nBox = RegionNumRects(wBoundingShape(pWindow));
+ pRectFirst = pRect = malloc(nRect * sizeof(*pRect));
+ while (nBox--) {
+ pRect->x = pBox->x1;
+ pRect->y = pBox->y1;
+ pRect->width = pBox->x2 - pBox->x1;
+ pRect->height = pBox->y2 - pBox->y1;
+ pBox++;
+ pRect++;
+ }
+ XShapeCombineRectangles(dmxScreen->beDisplay, pWinPriv->window,
+ ShapeBounding, 0, 0,
+ pRectFirst, nRect, ShapeSet, YXBanded);
+ free(pRectFirst);
+ }
+ else {
+ XShapeCombineMask(dmxScreen->beDisplay, pWinPriv->window,
+ ShapeBounding, 0, 0, None, ShapeSet);
}
/* Next, set the clip shape */
if (wClipShape(pWindow)) {
- pBox = RegionRects(wClipShape(pWindow));
- nRect = nBox = RegionNumRects(wClipShape(pWindow));
- pRectFirst = pRect = malloc(nRect * sizeof(*pRect));
- while (nBox--) {
- pRect->x = pBox->x1;
- pRect->y = pBox->y1;
- pRect->width = pBox->x2 - pBox->x1;
- pRect->height = pBox->y2 - pBox->y1;
- pBox++;
- pRect++;
- }
- XShapeCombineRectangles(dmxScreen->beDisplay, pWinPriv->window,
- ShapeClip, 0, 0,
- pRectFirst, nRect,
- ShapeSet, YXBanded);
- free(pRectFirst);
- } else {
- XShapeCombineMask(dmxScreen->beDisplay, pWinPriv->window,
- ShapeClip, 0, 0, None, ShapeSet);
+ pBox = RegionRects(wClipShape(pWindow));
+ nRect = nBox = RegionNumRects(wClipShape(pWindow));
+ pRectFirst = pRect = malloc(nRect * sizeof(*pRect));
+ while (nBox--) {
+ pRect->x = pBox->x1;
+ pRect->y = pBox->y1;
+ pRect->width = pBox->x2 - pBox->x1;
+ pRect->height = pBox->y2 - pBox->y1;
+ pBox++;
+ pRect++;
+ }
+ XShapeCombineRectangles(dmxScreen->beDisplay, pWinPriv->window,
+ ShapeClip, 0, 0,
+ pRectFirst, nRect, ShapeSet, YXBanded);
+ free(pRectFirst);
+ }
+ else {
+ XShapeCombineMask(dmxScreen->beDisplay, pWinPriv->window,
+ ShapeClip, 0, 0, None, ShapeSet);
}
if (XShapeInputSelected(dmxScreen->beDisplay, pWinPriv->window)) {
- ErrorF("Input selected for window %x on Screen %d\n",
- (unsigned int)pWinPriv->window, pScreen->myNum);
+ ErrorF("Input selected for window %x on Screen %d\n",
+ (unsigned int) pWinPriv->window, pScreen->myNum);
}
}
/** Set shape of \a pWindow on the back-end server. */
-void dmxSetShape(WindowPtr pWindow, int kind)
+void
+dmxSetShape(WindowPtr pWindow, int kind)
{
- ScreenPtr pScreen = pWindow->drawable.pScreen;
- DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
- dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
+ ScreenPtr pScreen = pWindow->drawable.pScreen;
+ DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
+ dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWindow);
DMX_UNWRAP(SetShape, dmxScreen, pScreen);
#if 1
if (pScreen->SetShape)
- pScreen->SetShape(pWindow, kind);
+ pScreen->SetShape(pWindow, kind);
#endif
if (pWinPriv->window) {
- /* Handle setting the current shape on the back-end server */
- dmxDoSetShape(pWindow);
- dmxSync(dmxScreen, False);
- } else {
- pWinPriv->isShaped = TRUE;
+ /* Handle setting the current shape on the back-end server */
+ dmxDoSetShape(pWindow);
+ dmxSync(dmxScreen, False);
+ }
+ else {
+ pWinPriv->isShaped = TRUE;
}
DMX_WRAP(SetShape, dmxSetShape, dmxScreen, pScreen);
diff --git a/hw/dmx/dmxwindow.h b/hw/dmx/dmxwindow.h
index f93121ea2..c6b2efee6 100644
--- a/hw/dmx/dmxwindow.h
+++ b/hw/dmx/dmxwindow.h
@@ -41,31 +41,29 @@
/** Window private area. */
typedef struct _dmxWinPriv {
- Window window;
- Bool offscreen;
- Bool mapped;
- Bool restacked;
- unsigned long attribMask;
- Colormap cmap;
- Visual *visual;
- Bool isShaped;
- Bool hasPict;
+ Window window;
+ Bool offscreen;
+ Bool mapped;
+ Bool restacked;
+ unsigned long attribMask;
+ Colormap cmap;
+ Visual *visual;
+ Bool isShaped;
+ Bool hasPict;
#ifdef GLXEXT
- void *swapGroup;
- int barrier;
- void (*windowDestroyed)(WindowPtr);
- void (*windowUnmapped)(WindowPtr);
+ void *swapGroup;
+ int barrier;
+ void (*windowDestroyed) (WindowPtr);
+ void (*windowUnmapped) (WindowPtr);
#endif
} dmxWinPrivRec, *dmxWinPrivPtr;
-
extern Bool dmxInitWindow(ScreenPtr pScreen);
extern Window dmxCreateRootWindow(WindowPtr pWindow);
extern void dmxGetDefaultWindowAttributes(WindowPtr pWindow,
- Colormap *cmap,
- Visual **visual);
+ Colormap * cmap, Visual ** visual);
extern void dmxCreateAndRealizeWindow(WindowPtr pWindow, Bool doSync);
extern Bool dmxCreateWindow(WindowPtr pWindow);
@@ -76,20 +74,19 @@ extern Bool dmxRealizeWindow(WindowPtr pWindow);
extern Bool dmxUnrealizeWindow(WindowPtr pWindow);
extern void dmxRestackWindow(WindowPtr pWindow, WindowPtr pOldNextSib);
extern void dmxWindowExposures(WindowPtr pWindow, RegionPtr prgn,
- RegionPtr other_exposed);
+ RegionPtr other_exposed);
extern void dmxCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg,
- RegionPtr prgnSrc);
+ RegionPtr prgnSrc);
extern void dmxResizeWindow(WindowPtr pWindow, int x, int y,
- unsigned int w, unsigned int h, WindowPtr pSib);
+ unsigned int w, unsigned int h, WindowPtr pSib);
extern void dmxReparentWindow(WindowPtr pWindow, WindowPtr pPriorParent);
extern void dmxChangeBorderWidth(WindowPtr pWindow, unsigned int width);
extern void dmxResizeScreenWindow(ScreenPtr pScreen,
- int x, int y, int w, int h);
-extern void dmxResizeRootWindow(WindowPtr pRoot,
- int x, int y, int w, int h);
+ int x, int y, int w, int h);
+extern void dmxResizeRootWindow(WindowPtr pRoot, int x, int y, int w, int h);
extern Bool dmxBEDestroyWindow(WindowPtr pWindow);
@@ -122,9 +119,9 @@ do { \
#define DMX_WINDOW_Y1(_pWin) \
((_pWin)->drawable.y - wBorderWidth(_pWin))
#define DMX_WINDOW_X2(_pWin) \
- ((_pWin)->drawable.x + wBorderWidth(_pWin) + (_pWin)->drawable.width)
+ ((_pWin)->drawable.x + wBorderWidth(_pWin) + (_pWin)->drawable.width)
#define DMX_WINDOW_Y2(_pWin) \
- ((_pWin)->drawable.y + wBorderWidth(_pWin) + (_pWin)->drawable.height)
+ ((_pWin)->drawable.y + wBorderWidth(_pWin) + (_pWin)->drawable.height)
#define DMX_WINDOW_OFFSCREEN(_pWin) \
(DMX_WINDOW_X1(_pWin) >= (_pWin)->drawable.pScreen->width || \
@@ -132,4 +129,4 @@ do { \
DMX_WINDOW_X2(_pWin) <= 0 || \
DMX_WINDOW_Y2(_pWin) <= 0)
-#endif /* DMXWINDOW_H */
+#endif /* DMXWINDOW_H */
diff --git a/hw/dmx/examples/dmxaddinput.c b/hw/dmx/examples/dmxaddinput.c
index dcfd4f5cc..fdd09b99b 100644
--- a/hw/dmx/examples/dmxaddinput.c
+++ b/hw/dmx/examples/dmxaddinput.c
@@ -36,14 +36,15 @@
#include <X11/Xlib.h>
#include <X11/extensions/dmxext.h>
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
{
- Display *display = NULL;
- int event_base;
- int error_base;
- int major_version, minor_version, patch_version;
- int id = -1;
- int status;
+ Display *display = NULL;
+ int event_base;
+ int error_base;
+ int major_version, minor_version, patch_version;
+ int id = -1;
+ int status;
if (argc != 5) {
printf("Usage: %s display c|b name|screen isCore\n", argv[0]);
@@ -72,8 +73,9 @@ int main(int argc, char **argv)
if (argv[2][0] == 'c') {
status = DMXAddConsoleInput(display, argv[3], atoi(argv[4]), &id);
- } else {
- status = DMXAddBackendInput(display, atoi(argv[3]), atoi(argv[4]),&id);
+ }
+ else {
+ status = DMXAddBackendInput(display, atoi(argv[3]), atoi(argv[4]), &id);
}
printf("status = %d, id = %d\n", status, id);
diff --git a/hw/dmx/examples/dmxaddscreen.c b/hw/dmx/examples/dmxaddscreen.c
index 8e60872df..58129faa5 100644
--- a/hw/dmx/examples/dmxaddscreen.c
+++ b/hw/dmx/examples/dmxaddscreen.c
@@ -37,18 +37,21 @@
#include <X11/Xlib.h>
#include <X11/extensions/dmxext.h>
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
{
- Display *display = NULL;
- int event_base;
- int error_base;
- int major_version, minor_version, patch_version;
- int screenNum;
- DMXScreenAttributes attr;
- unsigned int mask = 0;
+ Display *display = NULL;
+ int event_base;
+ int error_base;
+ int major_version, minor_version, patch_version;
+ int screenNum;
+ DMXScreenAttributes attr;
+ unsigned int mask = 0;
if (argc != 4 && argc != 14) {
- printf("Usage: %s display screenNum displayName [scrnx scrny scrnw scrnh rootx rooty rootw rooth originx originy]\n", argv[0]);
+ printf
+ ("Usage: %s display screenNum displayName [scrnx scrny scrnw scrnh rootx rooty rootw rooth originx originy]\n",
+ argv[0]);
return -1;
}
@@ -59,27 +62,25 @@ int main(int argc, char **argv)
screenNum = strtol(argv[2], NULL, 0);
if (argc == 14) {
- mask |= (DMXScreenWindowXoffset |
- DMXScreenWindowYoffset |
- DMXScreenWindowWidth |
- DMXScreenWindowHeight);
- attr.screenWindowXoffset = strtol(argv[4], NULL, 0);
- attr.screenWindowYoffset = strtol(argv[5], NULL, 0);
- attr.screenWindowWidth = strtol(argv[6], NULL, 0);
- attr.screenWindowHeight = strtol(argv[7], NULL, 0);
+ mask |= (DMXScreenWindowXoffset |
+ DMXScreenWindowYoffset |
+ DMXScreenWindowWidth | DMXScreenWindowHeight);
+ attr.screenWindowXoffset = strtol(argv[4], NULL, 0);
+ attr.screenWindowYoffset = strtol(argv[5], NULL, 0);
+ attr.screenWindowWidth = strtol(argv[6], NULL, 0);
+ attr.screenWindowHeight = strtol(argv[7], NULL, 0);
- mask |= (DMXRootWindowXoffset |
- DMXRootWindowYoffset |
- DMXRootWindowWidth |
- DMXRootWindowHeight);
- attr.rootWindowXoffset = strtol(argv[8], NULL, 0);
- attr.rootWindowYoffset = strtol(argv[9], NULL, 0);
- attr.rootWindowWidth = strtol(argv[10], NULL, 0);
- attr.rootWindowHeight = strtol(argv[11], NULL, 0);
+ mask |= (DMXRootWindowXoffset |
+ DMXRootWindowYoffset |
+ DMXRootWindowWidth | DMXRootWindowHeight);
+ attr.rootWindowXoffset = strtol(argv[8], NULL, 0);
+ attr.rootWindowYoffset = strtol(argv[9], NULL, 0);
+ attr.rootWindowWidth = strtol(argv[10], NULL, 0);
+ attr.rootWindowHeight = strtol(argv[11], NULL, 0);
- mask |= DMXRootWindowXorigin | DMXRootWindowYorigin;
- attr.rootWindowXorigin = strtol(argv[12], NULL, 0);
- attr.rootWindowYorigin = strtol(argv[13], NULL, 0);
+ mask |= DMXRootWindowXorigin | DMXRootWindowYorigin;
+ attr.rootWindowXorigin = strtol(argv[12], NULL, 0);
+ attr.rootWindowYorigin = strtol(argv[13], NULL, 0);
}
if (!DMXQueryExtension(display, &event_base, &error_base)) {
@@ -98,8 +99,8 @@ int main(int argc, char **argv)
major_version, minor_version, patch_version);
if (!DMXAddScreen(display, argv[3], mask, &attr, &screenNum))
- printf("Failed to add %s as screen #%d\n", argv[2], screenNum);
-
+ printf("Failed to add %s as screen #%d\n", argv[2], screenNum);
+
XCloseDisplay(display);
return 0;
}
diff --git a/hw/dmx/examples/dmxinfo.c b/hw/dmx/examples/dmxinfo.c
index dedce6e8d..fea94e203 100644
--- a/hw/dmx/examples/dmxinfo.c
+++ b/hw/dmx/examples/dmxinfo.c
@@ -36,45 +36,52 @@
#include <X11/Xlib.h>
#include <X11/extensions/dmxext.h>
-static void indent(int level)
+static void
+indent(int level)
{
int i;
- for (i = 0; i < level; i++) printf(" ");
+
+ for (i = 0; i < level; i++)
+ printf(" ");
}
-static void print_window_id(const char *displayName, Display *display,
- Window window, int level, int child)
+static void
+print_window_id(const char *displayName, Display * display,
+ Window window, int level, int child)
{
- char *name;
-
- if (!XFetchName(display, window, &name)) name = NULL;
+ char *name;
+
+ if (!XFetchName(display, window, &name))
+ name = NULL;
indent(level);
- if (child) printf("(%d) ", child);
+ if (child)
+ printf("(%d) ", child);
printf("%s window 0x%08lx: %s%s\n",
displayName,
- (long unsigned)window,
- name ? name : "",
- (window == DefaultRootWindow(display))
+ (long unsigned) window,
+ name ? name : "", (window == DefaultRootWindow(display))
? " (DMX root window)" : "");
- if (name) XFree(name);
+ if (name)
+ XFree(name);
}
-static void print_info(Display *display, Window window, int level, int child)
+static void
+print_info(Display * display, Window window, int level, int child)
{
DMXWindowAttributes winfo[128];
- int count;
- int i;
-
+ int count;
+ int i;
+
if (!DMXGetWindowAttributes(display, window, &count, 128, winfo)) {
printf("Could not get window information for 0x%08lx\n",
- (long unsigned)window);
+ (long unsigned) window);
exit(-2);
}
printf("\n");
print_window_id("DMX", display, window, level, child);
for (i = 0; i < count; i++) {
- DMXScreenAttributes sinfo;
- Display *backend;
+ DMXScreenAttributes sinfo;
+ Display *backend;
/* This could also be cached -- the information doesn't change. */
if (!DMXGetScreenAttributes(display, winfo[i].screen, &sinfo)) {
@@ -86,78 +93,86 @@ static void print_info(Display *display, Window window, int level, int child)
exit(-2);
}
XCloseDisplay(backend);
-
- indent(level+1);
+
+ indent(level + 1);
printf("%s window 0x%08lx: %dx%d%+d%+d",
sinfo.displayName,
- (long unsigned)winfo[i].window,
+ (long unsigned) winfo[i].window,
winfo[i].pos.width, winfo[i].pos.height,
winfo[i].pos.x, winfo[i].pos.y);
if (!winfo[i].vis.width
- && !winfo[i].vis.height
- && !winfo[i].vis.x
- && !winfo[i].vis.y) printf(" not visible\n");
+ && !winfo[i].vis.height && !winfo[i].vis.x && !winfo[i].vis.y)
+ printf(" not visible\n");
else if (winfo[i].vis.width == winfo[i].pos.width
&& winfo[i].vis.height == winfo[i].pos.height) {
- printf( " %+d%+d\n", winfo[i].vis.x, winfo[i].vis.y);
- } else {
- printf( " %dx%d%+d%+d\n",
- winfo[i].vis.width, winfo[i].vis.height,
- winfo[i].vis.x, winfo[i].vis.y);
+ printf(" %+d%+d\n", winfo[i].vis.x, winfo[i].vis.y);
+ }
+ else {
+ printf(" %dx%d%+d%+d\n",
+ winfo[i].vis.width, winfo[i].vis.height,
+ winfo[i].vis.x, winfo[i].vis.y);
}
}
}
-static void print_tree(Display *display, Window window, int level, int child)
+static void
+print_tree(Display * display, Window window, int level, int child)
{
- Window root, parent;
- Window *list;
+ Window root, parent;
+ Window *list;
unsigned int count;
unsigned int i;
print_info(display, window, level, child);
-
+
if (!XQueryTree(display, window, &root, &parent, &list, &count)) {
printf("Cannot query window tree for 0x%08lx\n",
- (long unsigned)window);
+ (long unsigned) window);
exit(-3);
}
if (count) {
- indent(level+1);
+ indent(level + 1);
printf("%d child%s:\n", count, count > 1 ? "ren" : "");
for (i = 0; i < count; i++) {
- print_tree(display, list[i], level+1, i+1);
+ print_tree(display, list[i], level + 1, i + 1);
}
}
}
-static const char *core(DMXInputAttributes *iinfo)
+static const char *
+core(DMXInputAttributes * iinfo)
{
- if (iinfo->isCore) return "core";
- else if (iinfo->sendsCore) return "extension (sends core)";
- else return "extension";
+ if (iinfo->isCore)
+ return "core";
+ else if (iinfo->sendsCore)
+ return "extension (sends core)";
+ else
+ return "extension";
}
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
{
- Display *display = NULL;
- Window window = 0;
- int event_base;
- int error_base;
- int major_version, minor_version, patch_version;
- DMXScreenAttributes sinfo;
- DMXInputAttributes iinfo;
- int count;
- int i;
+ Display *display = NULL;
+ Window window = 0;
+ int event_base;
+ int error_base;
+ int major_version, minor_version, patch_version;
+ DMXScreenAttributes sinfo;
+ DMXInputAttributes iinfo;
+ int count;
+ int i;
if (argc == 2 || argc == 3) {
if (!(display = XOpenDisplay(argv[1]))) {
printf("Cannot open display %s\n", argv[1]);
return -1;
}
- if (argc == 3) window = strtol(argv[2], NULL, 0);
- } else {
+ if (argc == 3)
+ window = strtol(argv[2], NULL, 0);
+ }
+ else {
printf("Usage: %s display [windowid]\n", argv[0]);
return -1;
}
@@ -231,9 +246,11 @@ int main(int argc, char **argv)
}
}
- if (window) print_info(display, window, 0, 0);
- else print_tree(display, DefaultRootWindow(display), 0, 0);
-
+ if (window)
+ print_info(display, window, 0, 0);
+ else
+ print_tree(display, DefaultRootWindow(display), 0, 0);
+
XCloseDisplay(display);
return 0;
}
diff --git a/hw/dmx/examples/dmxreconfig.c b/hw/dmx/examples/dmxreconfig.c
index 042f8a112..9587682db 100644
--- a/hw/dmx/examples/dmxreconfig.c
+++ b/hw/dmx/examples/dmxreconfig.c
@@ -36,47 +36,47 @@
#include <X11/Xlib.h>
#include <X11/extensions/dmxext.h>
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
{
- Display *display = NULL;
- int event_base;
- int error_base;
- int major_version, minor_version, patch_version;
- int screen;
- DMXScreenAttributes attr;
- unsigned int mask = 0;
- int status;
- int errorScreen;
+ Display *display = NULL;
+ int event_base;
+ int error_base;
+ int major_version, minor_version, patch_version;
+ int screen;
+ DMXScreenAttributes attr;
+ unsigned int mask = 0;
+ int status;
+ int errorScreen;
if (argc != 13) {
- fprintf(stderr, "Usage: %s display screen scrnx scrny scrnw scrnh rootx rooty rootw rooth originx originy\n", argv[0]);
- return -1;
+ fprintf(stderr,
+ "Usage: %s display screen scrnx scrny scrnw scrnh rootx rooty rootw rooth originx originy\n",
+ argv[0]);
+ return -1;
}
if (!(display = XOpenDisplay(argv[1]))) {
- fprintf(stderr, "Cannot open display %s\n", argv[1]);
- return -1;
+ fprintf(stderr, "Cannot open display %s\n", argv[1]);
+ return -1;
}
- screen = strtol(argv[2], NULL, 0);
+ screen = strtol(argv[2], NULL, 0);
mask |= (DMXScreenWindowXoffset |
- DMXScreenWindowYoffset |
- DMXScreenWindowWidth |
- DMXScreenWindowHeight);
- attr.screenWindowXoffset = strtol(argv[3], NULL, 0);
- attr.screenWindowYoffset = strtol(argv[4], NULL, 0);
- attr.screenWindowWidth = strtol(argv[5], NULL, 0);
- attr.screenWindowHeight = strtol(argv[6], NULL, 0);
+ DMXScreenWindowYoffset |
+ DMXScreenWindowWidth | DMXScreenWindowHeight);
+ attr.screenWindowXoffset = strtol(argv[3], NULL, 0);
+ attr.screenWindowYoffset = strtol(argv[4], NULL, 0);
+ attr.screenWindowWidth = strtol(argv[5], NULL, 0);
+ attr.screenWindowHeight = strtol(argv[6], NULL, 0);
mask |= (DMXRootWindowXoffset |
- DMXRootWindowYoffset |
- DMXRootWindowWidth |
- DMXRootWindowHeight);
- attr.rootWindowXoffset = strtol(argv[7], NULL, 0);
- attr.rootWindowYoffset = strtol(argv[8], NULL, 0);
- attr.rootWindowWidth = strtol(argv[9], NULL, 0);
- attr.rootWindowHeight = strtol(argv[10], NULL, 0);
+ DMXRootWindowYoffset | DMXRootWindowWidth | DMXRootWindowHeight);
+ attr.rootWindowXoffset = strtol(argv[7], NULL, 0);
+ attr.rootWindowYoffset = strtol(argv[8], NULL, 0);
+ attr.rootWindowWidth = strtol(argv[9], NULL, 0);
+ attr.rootWindowHeight = strtol(argv[10], NULL, 0);
mask |= DMXRootWindowXorigin | DMXRootWindowYorigin;
attr.rootWindowXorigin = strtol(argv[11], NULL, 0);
@@ -99,62 +99,61 @@ int main(int argc, char **argv)
if (major_version == 1 && minor_version < 3) {
fprintf(stderr,
- "ReconfigureScreen not supported in this extension version\n");
+ "ReconfigureScreen not supported in this extension version\n");
return -1;
}
if (major_version < 2) {
fprintf(stderr,
- "ChangeScreensAttributes not supported in this extension "
- "version\n");
+ "ChangeScreensAttributes not supported in this extension "
+ "version\n");
return -1;
}
if (!(status = DMXChangeScreensAttributes(display, 1, &screen, 1, &mask,
&attr, &errorScreen))) {
printf("Reconfigured screen #%d to "
- "%dx%d%s%d%s%d %dx%d%s%d%s%d %s%d%s%d\n",
- screen,
- attr.screenWindowWidth,
- attr.screenWindowHeight,
- (attr.screenWindowXoffset < 0 ? "" : "+"),
- attr.screenWindowXoffset,
- (attr.screenWindowYoffset < 0 ? "" : "+"),
- attr.screenWindowYoffset,
- attr.rootWindowWidth,
- attr.rootWindowHeight,
- (attr.rootWindowXoffset < 0 ? "" : "+"),
- attr.rootWindowXoffset,
- (attr.rootWindowYoffset < 0 ? "" : "+"),
- attr.rootWindowYoffset,
- (attr.rootWindowXorigin < 0 ? "" : "+"),
- attr.rootWindowXorigin,
- (attr.rootWindowYorigin < 0 ? "" : "+"),
- attr.rootWindowYorigin);
- } else {
+ "%dx%d%s%d%s%d %dx%d%s%d%s%d %s%d%s%d\n",
+ screen,
+ attr.screenWindowWidth,
+ attr.screenWindowHeight,
+ (attr.screenWindowXoffset < 0 ? "" : "+"),
+ attr.screenWindowXoffset,
+ (attr.screenWindowYoffset < 0 ? "" : "+"),
+ attr.screenWindowYoffset,
+ attr.rootWindowWidth,
+ attr.rootWindowHeight,
+ (attr.rootWindowXoffset < 0 ? "" : "+"),
+ attr.rootWindowXoffset,
+ (attr.rootWindowYoffset < 0 ? "" : "+"),
+ attr.rootWindowYoffset,
+ (attr.rootWindowXorigin < 0 ? "" : "+"),
+ attr.rootWindowXorigin,
+ (attr.rootWindowYorigin < 0 ? "" : "+"), attr.rootWindowYorigin);
+ }
+ else {
fprintf(stderr,
"Could not set screen #%d to "
- "%dx%d%s%d%s%d %dx%d%s%d%s%d %s%d%s%d\n"
+ "%dx%d%s%d%s%d %dx%d%s%d%s%d %s%d%s%d\n"
"[status = %d, errorScreen=%d]\n",
screen,
- attr.screenWindowWidth,
- attr.screenWindowHeight,
- (attr.screenWindowXoffset < 0 ? "" : "+"),
- attr.screenWindowXoffset,
- (attr.screenWindowYoffset < 0 ? "" : "+"),
- attr.screenWindowYoffset,
- attr.rootWindowWidth,
- attr.rootWindowHeight,
- (attr.rootWindowXoffset < 0 ? "" : "+"),
- attr.rootWindowXoffset,
- (attr.rootWindowYoffset < 0 ? "" : "+"),
- attr.rootWindowYoffset,
- (attr.rootWindowXorigin < 0 ? "" : "+"),
- attr.rootWindowXorigin,
- (attr.rootWindowYorigin < 0 ? "" : "+"),
- attr.rootWindowYorigin,
- status, errorScreen);
- return -1;
+ attr.screenWindowWidth,
+ attr.screenWindowHeight,
+ (attr.screenWindowXoffset < 0 ? "" : "+"),
+ attr.screenWindowXoffset,
+ (attr.screenWindowYoffset < 0 ? "" : "+"),
+ attr.screenWindowYoffset,
+ attr.rootWindowWidth,
+ attr.rootWindowHeight,
+ (attr.rootWindowXoffset < 0 ? "" : "+"),
+ attr.rootWindowXoffset,
+ (attr.rootWindowYoffset < 0 ? "" : "+"),
+ attr.rootWindowYoffset,
+ (attr.rootWindowXorigin < 0 ? "" : "+"),
+ attr.rootWindowXorigin,
+ (attr.rootWindowYorigin < 0 ? "" : "+"),
+ attr.rootWindowYorigin, status, errorScreen);
+ return -1;
}
XCloseDisplay(display);
diff --git a/hw/dmx/examples/dmxresize.c b/hw/dmx/examples/dmxresize.c
index caed91d8d..fed3bd08a 100644
--- a/hw/dmx/examples/dmxresize.c
+++ b/hw/dmx/examples/dmxresize.c
@@ -36,15 +36,16 @@
#include <X11/Xlib.h>
#include <X11/extensions/dmxext.h>
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
{
- Display *display = NULL;
- int event_base;
- int error_base;
- int major_version, minor_version, patch_version;
- int width, height, shiftX, shiftY, status;
+ Display *display = NULL;
+ int event_base;
+ int error_base;
+ int major_version, minor_version, patch_version;
+ int width, height, shiftX, shiftY, status;
DMXDesktopAttributes attr;
- unsigned int mask;
+ unsigned int mask;
if (argc != 6) {
printf("Usage: %s display width height shiftX shiftY\n", argv[0]);
@@ -56,7 +57,7 @@ int main(int argc, char **argv)
return -1;
}
- width = strtol(argv[2], NULL, 0);
+ width = strtol(argv[2], NULL, 0);
height = strtol(argv[3], NULL, 0);
shiftX = strtol(argv[4], NULL, 0);
shiftY = strtol(argv[5], NULL, 0);
@@ -76,11 +77,9 @@ int main(int argc, char **argv)
printf("Extension version: %d.%d patch %d\n",
major_version, minor_version, patch_version);
- mask = (DMXDesktopWidth |
- DMXDesktopHeight |
- DMXDesktopShiftX |
- DMXDesktopShiftY);
- attr.width = width;
+ mask = (DMXDesktopWidth |
+ DMXDesktopHeight | DMXDesktopShiftX | DMXDesktopShiftY);
+ attr.width = width;
attr.height = height;
attr.shiftX = shiftX;
attr.shiftY = shiftY;
@@ -98,7 +97,7 @@ int main(int argc, char **argv)
printf("status = %d (UNKNOWN ERROR *****)\n", status);
break;
}
-
+
XCloseDisplay(display);
return 0;
}
diff --git a/hw/dmx/examples/dmxrminput.c b/hw/dmx/examples/dmxrminput.c
index ef62cab8b..0113a7f5c 100644
--- a/hw/dmx/examples/dmxrminput.c
+++ b/hw/dmx/examples/dmxrminput.c
@@ -36,13 +36,14 @@
#include <X11/Xlib.h>
#include <X11/extensions/dmxext.h>
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
{
- Display *display = NULL;
- int event_base;
- int error_base;
- int major_version, minor_version, patch_version;
- int status;
+ Display *display = NULL;
+ int event_base;
+ int error_base;
+ int major_version, minor_version, patch_version;
+ int status;
if (argc != 3) {
printf("Usage: %s display id\n", argv[0]);
diff --git a/hw/dmx/examples/dmxrmscreen.c b/hw/dmx/examples/dmxrmscreen.c
index fecf0f6c1..627875bda 100644
--- a/hw/dmx/examples/dmxrmscreen.c
+++ b/hw/dmx/examples/dmxrmscreen.c
@@ -37,13 +37,14 @@
#include <X11/Xlib.h>
#include <X11/extensions/dmxext.h>
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
{
- Display *display = NULL;
- int event_base;
- int error_base;
- int major_version, minor_version, patch_version;
- int screenNum;
+ Display *display = NULL;
+ int event_base;
+ int error_base;
+ int major_version, minor_version, patch_version;
+ int screenNum;
if (argc != 3) {
printf("Usage: %s display screenNum\n", argv[0]);
@@ -74,7 +75,7 @@ int main(int argc, char **argv)
if (!DMXRemoveScreen(display, screenNum))
printf("Failed to remove screen #%d\n", screenNum);
-
+
XCloseDisplay(display);
return 0;
}
diff --git a/hw/dmx/examples/dmxwininfo.c b/hw/dmx/examples/dmxwininfo.c
index 3d027d530..9b1ce76b6 100644
--- a/hw/dmx/examples/dmxwininfo.c
+++ b/hw/dmx/examples/dmxwininfo.c
@@ -43,183 +43,180 @@
static const char *FontName = "fixed";
-
static void
-EventLoop(Display *dpy, Window win, GC gc)
+EventLoop(Display * dpy, Window win, GC gc)
{
- XEvent ev;
- while (1) {
- XNextEvent( dpy, &ev );
- switch (ev.type) {
- case ReparentNotify:
- break;
- case MapNotify:
- break;
- case ConfigureNotify:
- case Expose:
- {
+ XEvent ev;
+
+ while (1) {
+ XNextEvent(dpy, &ev);
+ switch (ev.type) {
+ case ReparentNotify:
+ break;
+ case MapNotify:
+ break;
+ case ConfigureNotify:
+ case Expose:
+ {
int numScreens, count, i;
DMXWindowAttributes *winInfo;
int x, y;
const char *msg = "DMX window info:";
DMXGetScreenCount(dpy, &numScreens);
- winInfo
- = (DMXWindowAttributes *)
+ winInfo = (DMXWindowAttributes *)
malloc(numScreens * sizeof(DMXWindowAttributes));
assert(winInfo);
- if (!DMXGetWindowAttributes(dpy, win, &count,
- numScreens, winInfo)) {
- printf("Could not get window information for 0x%08lx\n",
- (long unsigned)win);
+ if (!DMXGetWindowAttributes(dpy, win, &count, numScreens, winInfo)) {
+ printf("Could not get window information for 0x%08lx\n",
+ (long unsigned) win);
}
x = y = 50;
XClearWindow(dpy, win);
XDrawString(dpy, win, gc, x, y, msg, strlen(msg));
y += 20;
for (i = 0; i < count; i++) {
- char str[500];
- snprintf(str, sizeof(str),
- "screen %d: pos: %dx%d+%d+%d visible: %dx%d+%d+%d",
- winInfo[i].screen,
- winInfo[i].pos.width, winInfo[i].pos.height,
- winInfo[i].pos.x, winInfo[i].pos.y,
- winInfo[i].vis.width, winInfo[i].vis.height,
- winInfo[i].vis.x, winInfo[i].vis.y);
- XDrawString(dpy, win, gc, x, y, str, strlen(str));
- y += 20;
+ char str[500];
+
+ snprintf(str, sizeof(str),
+ "screen %d: pos: %dx%d+%d+%d visible: %dx%d+%d+%d",
+ winInfo[i].screen,
+ winInfo[i].pos.width, winInfo[i].pos.height,
+ winInfo[i].pos.x, winInfo[i].pos.y,
+ winInfo[i].vis.width, winInfo[i].vis.height,
+ winInfo[i].vis.x, winInfo[i].vis.y);
+ XDrawString(dpy, win, gc, x, y, str, strlen(str));
+ y += 20;
}
free(winInfo);
- }
- break;
- default:
- printf("Event type 0x%x\n", ev.type);
- }
- }
+ }
+ break;
+ default:
+ printf("Event type 0x%x\n", ev.type);
+ }
+ }
}
int
main(int argc, char *argv[])
{
- const char *displayName = NULL;
- Display *dpy;
- int event_base, error_base;
- int scr, n;
- long vinfoMask, attrMask;
- XVisualInfo vinfoTemp, *visInfo;
- Visual *vis;
- Window win, root;
- XSetWindowAttributes attr;
- XFontStruct *fontInfo;
- GC gc;
-
- if (argc > 1) {
- displayName = argv[1];
- }
-
- dpy = XOpenDisplay(displayName);
- if (!dpy) {
- fprintf(stderr, "Unable to open display %s\n", displayName);
- return -1;
- }
-
- if (!DMXQueryExtension(dpy, &event_base, &error_base)) {
- fprintf(stderr, "DMX extension not available on this display.\n");
- return -1;
- }
-
- scr = DefaultScreen(dpy);
- root = RootWindow(dpy, scr);
- vis = DefaultVisual(dpy, scr);
-
- vinfoMask = VisualIDMask;
- vinfoTemp.visualid = vis->visualid;
- visInfo = XGetVisualInfo(dpy, vinfoMask, &vinfoTemp, &n);
- if (!visInfo || n != 1) {
- fprintf(stderr, "Unable to get visual!\n");
- XCloseDisplay(dpy);
- return -1;
- }
-
- attr.background_pixel = 0;
- attr.border_pixel = 0;
- attr.colormap = XCreateColormap(dpy, root, visInfo->visual, AllocNone);
- attr.event_mask = StructureNotifyMask | ExposureMask;
- attrMask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
-
- win = XCreateWindow(dpy, root,
- 500, 500, 600, 400, /* x, y, w, h */
- 0, /* border_width */
- visInfo->depth, InputOutput,
- visInfo->visual, attrMask, &attr);
-
-
- if (!win) {
- fprintf(stderr, "Unable to create window!\n");
- XCloseDisplay(dpy);
- return -1;
- }
-
- fontInfo = XLoadQueryFont(dpy, FontName);
- if (!fontInfo) {
- fprintf(stderr, "Error: font %s not found\n", FontName);
- exit(0);
- }
-
- gc = XCreateGC(dpy, win, 0, NULL);
- XSetBackground(dpy, gc, BlackPixel(dpy, scr));
- XSetForeground(dpy, gc, WhitePixel(dpy, scr));
- XSetFont(dpy, gc, fontInfo->fid);
-
- XMapWindow(dpy, win);
-
- EventLoop(dpy, win, gc);
-
- XDestroyWindow(dpy, win);
- XCloseDisplay(dpy);
- return 0;
+ const char *displayName = NULL;
+ Display *dpy;
+ int event_base, error_base;
+ int scr, n;
+ long vinfoMask, attrMask;
+ XVisualInfo vinfoTemp, *visInfo;
+ Visual *vis;
+ Window win, root;
+ XSetWindowAttributes attr;
+ XFontStruct *fontInfo;
+ GC gc;
+
+ if (argc > 1) {
+ displayName = argv[1];
+ }
+
+ dpy = XOpenDisplay(displayName);
+ if (!dpy) {
+ fprintf(stderr, "Unable to open display %s\n", displayName);
+ return -1;
+ }
+
+ if (!DMXQueryExtension(dpy, &event_base, &error_base)) {
+ fprintf(stderr, "DMX extension not available on this display.\n");
+ return -1;
+ }
+
+ scr = DefaultScreen(dpy);
+ root = RootWindow(dpy, scr);
+ vis = DefaultVisual(dpy, scr);
+
+ vinfoMask = VisualIDMask;
+ vinfoTemp.visualid = vis->visualid;
+ visInfo = XGetVisualInfo(dpy, vinfoMask, &vinfoTemp, &n);
+ if (!visInfo || n != 1) {
+ fprintf(stderr, "Unable to get visual!\n");
+ XCloseDisplay(dpy);
+ return -1;
+ }
+
+ attr.background_pixel = 0;
+ attr.border_pixel = 0;
+ attr.colormap = XCreateColormap(dpy, root, visInfo->visual, AllocNone);
+ attr.event_mask = StructureNotifyMask | ExposureMask;
+ attrMask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
+
+ win = XCreateWindow(dpy, root, 500, 500, 600, 400, /* x, y, w, h */
+ 0, /* border_width */
+ visInfo->depth, InputOutput,
+ visInfo->visual, attrMask, &attr);
+
+ if (!win) {
+ fprintf(stderr, "Unable to create window!\n");
+ XCloseDisplay(dpy);
+ return -1;
+ }
+
+ fontInfo = XLoadQueryFont(dpy, FontName);
+ if (!fontInfo) {
+ fprintf(stderr, "Error: font %s not found\n", FontName);
+ exit(0);
+ }
+
+ gc = XCreateGC(dpy, win, 0, NULL);
+ XSetBackground(dpy, gc, BlackPixel(dpy, scr));
+ XSetForeground(dpy, gc, WhitePixel(dpy, scr));
+ XSetFont(dpy, gc, fontInfo->fid);
+
+ XMapWindow(dpy, win);
+
+ EventLoop(dpy, win, gc);
+
+ XDestroyWindow(dpy, win);
+ XCloseDisplay(dpy);
+ return 0;
}
#if 00
-static void make_window( char *title, int color_flag )
+static void
+make_window(char *title, int color_flag)
{
- int x = 10, y = 10, width = 400, height = 300;
- Display *dpy;
- int scr;
- Window root, win;
- Colormap cmap;
- XColor xcolor;
- int attr_flags;
- XVisualInfo *visinfo;
- XSetWindowAttributes attr;
- XTextProperty tp;
- XSizeHints sh;
- XEvent e;
- XMesaContext context;
- XMesaVisual visual;
- XMesaBuffer buffer;
-
-
- /*
- * Do the usual X things to make a window.
- */
-
- dpy = XOpenDisplay(NULL);
- if (!dpy) {
- printf("Couldn't open default display!\n");
- exit(1);
- }
-
- scr = DefaultScreen(dpy);
- root = RootWindow(dpy, scr);
-
- /* alloc visinfo struct */
- visinfo = (XVisualInfo *) malloc( sizeof(XVisualInfo) );
-
- /* Get a visual and colormap */
- if (color_flag) {
- /* Open TrueColor window */
+ int x = 10, y = 10, width = 400, height = 300;
+ Display *dpy;
+ int scr;
+ Window root, win;
+ Colormap cmap;
+ XColor xcolor;
+ int attr_flags;
+ XVisualInfo *visinfo;
+ XSetWindowAttributes attr;
+ XTextProperty tp;
+ XSizeHints sh;
+ XEvent e;
+ XMesaContext context;
+ XMesaVisual visual;
+ XMesaBuffer buffer;
+
+ /*
+ * Do the usual X things to make a window.
+ */
+
+ dpy = XOpenDisplay(NULL);
+ if (!dpy) {
+ printf("Couldn't open default display!\n");
+ exit(1);
+ }
+
+ scr = DefaultScreen(dpy);
+ root = RootWindow(dpy, scr);
+
+ /* alloc visinfo struct */
+ visinfo = (XVisualInfo *) malloc(sizeof(XVisualInfo));
+
+ /* Get a visual and colormap */
+ if (color_flag) {
+ /* Open TrueColor window */
/*
if (!XMatchVisualInfo( dpy, scr, 24, TrueColor, visinfo )) {
@@ -227,269 +224,254 @@ static void make_window( char *title, int color_flag )
exit(1);
}
*/
- if (!XMatchVisualInfo( dpy, scr, 8, PseudoColor, visinfo )) {
- printf("Couldn't get 8-bit PseudoColor visual!\n");
- exit(1);
- }
+ if (!XMatchVisualInfo(dpy, scr, 8, PseudoColor, visinfo)) {
+ printf("Couldn't get 8-bit PseudoColor visual!\n");
+ exit(1);
+ }
- cmap = XCreateColormap( dpy, root, visinfo->visual, AllocNone );
- Black = Red = Green = Blue = 0;
- }
- else {
- /* Open color index window */
+ cmap = XCreateColormap(dpy, root, visinfo->visual, AllocNone);
+ Black = Red = Green = Blue = 0;
+ }
+ else {
+ /* Open color index window */
- if (!XMatchVisualInfo( dpy, scr, 8, PseudoColor, visinfo )) {
- printf("Couldn't get 8-bit PseudoColor visual\n");
- exit(1);
- }
+ if (!XMatchVisualInfo(dpy, scr, 8, PseudoColor, visinfo)) {
+ printf("Couldn't get 8-bit PseudoColor visual\n");
+ exit(1);
+ }
- cmap = XCreateColormap( dpy, root, visinfo->visual, AllocNone );
+ cmap = XCreateColormap(dpy, root, visinfo->visual, AllocNone);
- /* Allocate colors */
- xcolor.red = 0x0;
- xcolor.green = 0x0;
- xcolor.blue = 0x0;
- xcolor.flags = DoRed | DoGreen | DoBlue;
- if (!XAllocColor( dpy, cmap, &xcolor )) {
- printf("Couldn't allocate black!\n");
- exit(1);
- }
- Black = xcolor.pixel;
-
- xcolor.red = 0xffff;
- xcolor.green = 0x0;
- xcolor.blue = 0x0;
- xcolor.flags = DoRed | DoGreen | DoBlue;
- if (!XAllocColor( dpy, cmap, &xcolor )) {
- printf("Couldn't allocate red!\n");
- exit(1);
- }
- Red = xcolor.pixel;
-
- xcolor.red = 0x0;
- xcolor.green = 0xffff;
- xcolor.blue = 0x0;
- xcolor.flags = DoRed | DoGreen | DoBlue;
- if (!XAllocColor( dpy, cmap, &xcolor )) {
- printf("Couldn't allocate green!\n");
- exit(1);
- }
- Green = xcolor.pixel;
-
- xcolor.red = 0x0;
- xcolor.green = 0x0;
- xcolor.blue = 0xffff;
- xcolor.flags = DoRed | DoGreen | DoBlue;
- if (!XAllocColor( dpy, cmap, &xcolor )) {
- printf("Couldn't allocate blue!\n");
- exit(1);
- }
- Blue = xcolor.pixel;
- }
-
- /* set window attributes */
- attr.colormap = cmap;
- attr.event_mask = ExposureMask | StructureNotifyMask;
- attr.border_pixel = BlackPixel( dpy, scr );
- attr.background_pixel = BlackPixel( dpy, scr );
- attr_flags = CWColormap | CWEventMask | CWBorderPixel | CWBackPixel;
-
- /* Create the window */
- win = XCreateWindow( dpy, root, x,y, width, height, 0,
- visinfo->depth, InputOutput,
- visinfo->visual,
- attr_flags, &attr);
- if (!win) {
- printf("Couldn't open window!\n");
- exit(1);
- }
-
- XStringListToTextProperty(&title, 1, &tp);
- sh.flags = USPosition | USSize;
- XSetWMProperties(dpy, win, &tp, &tp, 0, 0, &sh, 0, 0);
- XMapWindow(dpy, win);
- while (1) {
- XNextEvent( dpy, &e );
- if (e.type == MapNotify && e.xmap.window == win) {
- break;
- }
- }
-
-
- /*
- * Now do the special Mesa/Xlib stuff!
- */
-
- visual = XMesaCreateVisual( dpy, visinfo,
- (GLboolean) color_flag,
- GL_FALSE, /* alpha_flag */
- GL_FALSE, /* db_flag */
- GL_FALSE, /* stereo flag */
- GL_FALSE, /* ximage_flag */
- 0, /* depth size */
- 0, /* stencil size */
- 0,0,0,0, /* accum_size */
- 0, /* num samples */
- 0, /* level */
- 0 /* caveat */
- );
- if (!visual) {
- printf("Couldn't create Mesa/X visual!\n");
- exit(1);
- }
-
- /* Create a Mesa rendering context */
- context = XMesaCreateContext( visual,
- NULL /* share_list */
- );
- if (!context) {
- printf("Couldn't create Mesa/X context!\n");
- exit(1);
- }
-
- buffer = XMesaCreateWindowBuffer( visual, win );
- if (!buffer) {
- printf("Couldn't create Mesa/X buffer!\n");
- exit(1);
- }
-
-
- XMesaMakeCurrent( context, buffer );
-
- /* Ready to render! */
+ /* Allocate colors */
+ xcolor.red = 0x0;
+ xcolor.green = 0x0;
+ xcolor.blue = 0x0;
+ xcolor.flags = DoRed | DoGreen | DoBlue;
+ if (!XAllocColor(dpy, cmap, &xcolor)) {
+ printf("Couldn't allocate black!\n");
+ exit(1);
+ }
+ Black = xcolor.pixel;
+
+ xcolor.red = 0xffff;
+ xcolor.green = 0x0;
+ xcolor.blue = 0x0;
+ xcolor.flags = DoRed | DoGreen | DoBlue;
+ if (!XAllocColor(dpy, cmap, &xcolor)) {
+ printf("Couldn't allocate red!\n");
+ exit(1);
+ }
+ Red = xcolor.pixel;
+
+ xcolor.red = 0x0;
+ xcolor.green = 0xffff;
+ xcolor.blue = 0x0;
+ xcolor.flags = DoRed | DoGreen | DoBlue;
+ if (!XAllocColor(dpy, cmap, &xcolor)) {
+ printf("Couldn't allocate green!\n");
+ exit(1);
+ }
+ Green = xcolor.pixel;
+
+ xcolor.red = 0x0;
+ xcolor.green = 0x0;
+ xcolor.blue = 0xffff;
+ xcolor.flags = DoRed | DoGreen | DoBlue;
+ if (!XAllocColor(dpy, cmap, &xcolor)) {
+ printf("Couldn't allocate blue!\n");
+ exit(1);
+ }
+ Blue = xcolor.pixel;
+ }
+
+ /* set window attributes */
+ attr.colormap = cmap;
+ attr.event_mask = ExposureMask | StructureNotifyMask;
+ attr.border_pixel = BlackPixel(dpy, scr);
+ attr.background_pixel = BlackPixel(dpy, scr);
+ attr_flags = CWColormap | CWEventMask | CWBorderPixel | CWBackPixel;
+
+ /* Create the window */
+ win = XCreateWindow(dpy, root, x, y, width, height, 0,
+ visinfo->depth, InputOutput,
+ visinfo->visual, attr_flags, &attr);
+ if (!win) {
+ printf("Couldn't open window!\n");
+ exit(1);
+ }
+
+ XStringListToTextProperty(&title, 1, &tp);
+ sh.flags = USPosition | USSize;
+ XSetWMProperties(dpy, win, &tp, &tp, 0, 0, &sh, 0, 0);
+ XMapWindow(dpy, win);
+ while (1) {
+ XNextEvent(dpy, &e);
+ if (e.type == MapNotify && e.xmap.window == win) {
+ break;
+ }
+ }
+
+ /*
+ * Now do the special Mesa/Xlib stuff!
+ */
+
+ visual = XMesaCreateVisual(dpy, visinfo, (GLboolean) color_flag, GL_FALSE, /* alpha_flag */
+ GL_FALSE, /* db_flag */
+ GL_FALSE, /* stereo flag */
+ GL_FALSE, /* ximage_flag */
+ 0, /* depth size */
+ 0, /* stencil size */
+ 0, 0, 0, 0, /* accum_size */
+ 0, /* num samples */
+ 0, /* level */
+ 0 /* caveat */
+ );
+ if (!visual) {
+ printf("Couldn't create Mesa/X visual!\n");
+ exit(1);
+ }
+
+ /* Create a Mesa rendering context */
+ context = XMesaCreateContext(visual, NULL /* share_list */
+ );
+ if (!context) {
+ printf("Couldn't create Mesa/X context!\n");
+ exit(1);
+ }
+
+ buffer = XMesaCreateWindowBuffer(visual, win);
+ if (!buffer) {
+ printf("Couldn't create Mesa/X buffer!\n");
+ exit(1);
+ }
+
+ XMesaMakeCurrent(context, buffer);
+
+ /* Ready to render! */
}
-
-
-static void draw_cube( void )
+static void
+draw_cube(void)
{
- /* X faces */
- glIndexi( Red );
- glColor3f( 1.0, 0.0, 0.0 );
- glBegin( GL_POLYGON );
- glVertex3f( 1.0, 1.0, 1.0 );
- glVertex3f( 1.0, -1.0, 1.0 );
- glVertex3f( 1.0, -1.0, -1.0 );
- glVertex3f( 1.0, 1.0, -1.0 );
- glEnd();
-
- glBegin( GL_POLYGON );
- glVertex3f( -1.0, 1.0, 1.0 );
- glVertex3f( -1.0, 1.0, -1.0 );
- glVertex3f( -1.0, -1.0, -1.0 );
- glVertex3f( -1.0, -1.0, 1.0 );
- glEnd();
-
- /* Y faces */
- glIndexi( Green );
- glColor3f( 0.0, 1.0, 0.0 );
- glBegin( GL_POLYGON );
- glVertex3f( 1.0, 1.0, 1.0 );
- glVertex3f( 1.0, 1.0, -1.0 );
- glVertex3f( -1.0, 1.0, -1.0 );
- glVertex3f( -1.0, 1.0, 1.0 );
- glEnd();
-
- glBegin( GL_POLYGON );
- glVertex3f( 1.0, -1.0, 1.0 );
- glVertex3f( -1.0, -1.0, 1.0 );
- glVertex3f( -1.0, -1.0, -1.0 );
- glVertex3f( 1.0, -1.0, -1.0 );
- glEnd();
-
- /* Z faces */
- glIndexi( Blue );
- glColor3f( 0.0, 0.0, 1.0 );
- glBegin( GL_POLYGON );
- glVertex3f( 1.0, 1.0, 1.0 );
- glVertex3f( -1.0, 1.0, 1.0 );
- glVertex3f( -1.0, -1.0, 1.0 );
- glVertex3f( 1.0, -1.0, 1.0 );
- glEnd();
-
- glBegin( GL_POLYGON );
- glVertex3f( 1.0, 1.0, -1.0 );
- glVertex3f( 1.0,-1.0, -1.0 );
- glVertex3f( -1.0,-1.0, -1.0 );
- glVertex3f( -1.0, 1.0, -1.0 );
- glEnd();
+ /* X faces */
+ glIndexi(Red);
+ glColor3f(1.0, 0.0, 0.0);
+ glBegin(GL_POLYGON);
+ glVertex3f(1.0, 1.0, 1.0);
+ glVertex3f(1.0, -1.0, 1.0);
+ glVertex3f(1.0, -1.0, -1.0);
+ glVertex3f(1.0, 1.0, -1.0);
+ glEnd();
+
+ glBegin(GL_POLYGON);
+ glVertex3f(-1.0, 1.0, 1.0);
+ glVertex3f(-1.0, 1.0, -1.0);
+ glVertex3f(-1.0, -1.0, -1.0);
+ glVertex3f(-1.0, -1.0, 1.0);
+ glEnd();
+
+ /* Y faces */
+ glIndexi(Green);
+ glColor3f(0.0, 1.0, 0.0);
+ glBegin(GL_POLYGON);
+ glVertex3f(1.0, 1.0, 1.0);
+ glVertex3f(1.0, 1.0, -1.0);
+ glVertex3f(-1.0, 1.0, -1.0);
+ glVertex3f(-1.0, 1.0, 1.0);
+ glEnd();
+
+ glBegin(GL_POLYGON);
+ glVertex3f(1.0, -1.0, 1.0);
+ glVertex3f(-1.0, -1.0, 1.0);
+ glVertex3f(-1.0, -1.0, -1.0);
+ glVertex3f(1.0, -1.0, -1.0);
+ glEnd();
+
+ /* Z faces */
+ glIndexi(Blue);
+ glColor3f(0.0, 0.0, 1.0);
+ glBegin(GL_POLYGON);
+ glVertex3f(1.0, 1.0, 1.0);
+ glVertex3f(-1.0, 1.0, 1.0);
+ glVertex3f(-1.0, -1.0, 1.0);
+ glVertex3f(1.0, -1.0, 1.0);
+ glEnd();
+
+ glBegin(GL_POLYGON);
+ glVertex3f(1.0, 1.0, -1.0);
+ glVertex3f(1.0, -1.0, -1.0);
+ glVertex3f(-1.0, -1.0, -1.0);
+ glVertex3f(-1.0, 1.0, -1.0);
+ glEnd();
}
-
-
-
-static void display_loop( void )
+static void
+display_loop(void)
{
- GLfloat xrot, yrot, zrot;
+ GLfloat xrot, yrot, zrot;
- xrot = yrot = zrot = 0.0;
+ xrot = yrot = zrot = 0.0;
- glClearColor( 0.0, 0.0, 0.0, 0.0 );
- glClearIndex( Black );
+ glClearColor(0.0, 0.0, 0.0, 0.0);
+ glClearIndex(Black);
- glMatrixMode( GL_PROJECTION );
- glLoadIdentity();
- glFrustum( -1.0, 1.0, -1.0, 1.0, 1.0, 10.0 );
- glTranslatef( 0.0, 0.0, -5.0 );
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glFrustum(-1.0, 1.0, -1.0, 1.0, 1.0, 10.0);
+ glTranslatef(0.0, 0.0, -5.0);
- glMatrixMode( GL_MODELVIEW );
- glLoadIdentity();
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
- glCullFace( GL_BACK );
- glEnable( GL_CULL_FACE );
+ glCullFace(GL_BACK);
+ glEnable(GL_CULL_FACE);
- glShadeModel( GL_FLAT );
+ glShadeModel(GL_FLAT);
- while (1) {
- glClear( GL_COLOR_BUFFER_BIT );
- glPushMatrix();
- glRotatef( xrot, 1.0, 0.0, 0.0 );
- glRotatef( yrot, 0.0, 1.0, 0.0 );
- glRotatef( zrot, 0.0, 0.0, 1.0 );
+ while (1) {
+ glClear(GL_COLOR_BUFFER_BIT);
+ glPushMatrix();
+ glRotatef(xrot, 1.0, 0.0, 0.0);
+ glRotatef(yrot, 0.0, 1.0, 0.0);
+ glRotatef(zrot, 0.0, 0.0, 1.0);
- draw_cube();
+ draw_cube();
- glPopMatrix();
- glFinish();
+ glPopMatrix();
+ glFinish();
- xrot += 10.0;
- yrot += 7.0;
- zrot -= 3.0;
- }
+ xrot += 10.0;
+ yrot += 7.0;
+ zrot -= 3.0;
+ }
}
-
-
-
-int main( int argc, char *argv[] )
+int
+main(int argc, char *argv[])
{
- int mode = 0;
-
- if (argc >= 2)
- {
- if (strcmp(argv[1],"-ci")==0)
- mode = 0;
- else if (strcmp(argv[1],"-rgb")==0)
- mode = 1;
- else
- {
- printf("Bad flag: %s\n", argv[1]);
- printf("Specify -ci for 8-bit color index or -rgb for RGB mode\n");
- exit(1);
+ int mode = 0;
+
+ if (argc >= 2) {
+ if (strcmp(argv[1], "-ci") == 0)
+ mode = 0;
+ else if (strcmp(argv[1], "-rgb") == 0)
+ mode = 1;
+ else {
+ printf("Bad flag: %s\n", argv[1]);
+ printf("Specify -ci for 8-bit color index or -rgb for RGB mode\n");
+ exit(1);
}
- }
- else
- {
+ }
+ else {
printf("Specify -ci for 8-bit color index or -rgb for RGB mode\n");
printf("Defaulting to 8-bit color index\n");
- }
+ }
- make_window( argv[0], mode );
+ make_window(argv[0], mode);
- display_loop();
- return 0;
+ display_loop();
+ return 0;
}
-
#endif
diff --git a/hw/dmx/examples/ev.c b/hw/dmx/examples/ev.c
index ed23b8aa9..b70016a45 100644
--- a/hw/dmx/examples/ev.c
+++ b/hw/dmx/examples/ev.c
@@ -46,16 +46,17 @@
struct input_event event;
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
{
- char name[64]; /* RATS: Use ok, but could be better */
- char buf[256] = { 0, }; /* RATS: Use ok */
- unsigned char mask[EV_MAX/8 + 1]; /* RATS: Use ok */
- int version;
- int fd = 0;
- int rc;
- int i, j;
- char *tmp;
+ char name[64]; /* RATS: Use ok, but could be better */
+ char buf[256] = { 0, }; /* RATS: Use ok */
+ unsigned char mask[EV_MAX / 8 + 1]; /* RATS: Use ok */
+ int version;
+ int fd = 0;
+ int rc;
+ int i, j;
+ char *tmp;
#define test_bit(bit) (mask[(bit)/8] & (1 << ((bit)%8)))
@@ -73,15 +74,32 @@ int main(int argc, char **argv)
for (j = 0; j < EV_MAX; j++) {
if (test_bit(j)) {
const char *type = "unknown";
- switch(j) {
- case EV_KEY: type = "keys/buttons"; break;
- case EV_REL: type = "relative"; break;
- case EV_ABS: type = "absolute"; break;
- case EV_MSC: type = "reserved"; break;
- case EV_LED: type = "leds"; break;
- case EV_SND: type = "sound"; break;
- case EV_REP: type = "repeat"; break;
- case EV_FF: type = "feedback"; break;
+
+ switch (j) {
+ case EV_KEY:
+ type = "keys/buttons";
+ break;
+ case EV_REL:
+ type = "relative";
+ break;
+ case EV_ABS:
+ type = "absolute";
+ break;
+ case EV_MSC:
+ type = "reserved";
+ break;
+ case EV_LED:
+ type = "leds";
+ break;
+ case EV_SND:
+ type = "sound";
+ break;
+ case EV_REP:
+ type = "repeat";
+ break;
+ case EV_FF:
+ type = "feedback";
+ break;
}
printf(" %s", type);
}
@@ -96,27 +114,27 @@ int main(int argc, char **argv)
if ((fd = open(name, O_RDWR, 0)) >= 0) {
printf("%s: open, fd = %d\n", name, fd);
for (i = 0; i < LED_MAX; i++) {
- event.time.tv_sec = time(0);
+ event.time.tv_sec = time(0);
event.time.tv_usec = 0;
- event.type = EV_LED;
- event.code = i;
- event.value = 0;
+ event.type = EV_LED;
+ event.code = i;
+ event.value = 0;
write(fd, &event, sizeof(event));
}
-
+
while ((rc = read(fd, &event, sizeof(event))) > 0) {
printf("%-24.24s.%06lu type 0x%04x; code 0x%04x;"
" value 0x%08x; ",
ctime(&event.time.tv_sec),
- event.time.tv_usec,
- event.type, event.code, event.value);
+ event.time.tv_usec, event.type, event.code, event.value);
switch (event.type) {
case EV_KEY:
if (event.code > BTN_MISC) {
printf("Button %d %s",
event.code & 0xff,
event.value ? "press" : "release");
- } else {
+ }
+ else {
printf("Key %d (0x%x) %s",
event.code & 0xff,
event.code & 0xff,
@@ -125,51 +143,125 @@ int main(int argc, char **argv)
break;
case EV_REL:
switch (event.code) {
- case REL_X: tmp = "X"; break;
- case REL_Y: tmp = "Y"; break;
- case REL_HWHEEL: tmp = "HWHEEL"; break;
- case REL_DIAL: tmp = "DIAL"; break;
- case REL_WHEEL: tmp = "WHEEL"; break;
- case REL_MISC: tmp = "MISC"; break;
- default: tmp = "UNKNOWN"; break;
+ case REL_X:
+ tmp = "X";
+ break;
+ case REL_Y:
+ tmp = "Y";
+ break;
+ case REL_HWHEEL:
+ tmp = "HWHEEL";
+ break;
+ case REL_DIAL:
+ tmp = "DIAL";
+ break;
+ case REL_WHEEL:
+ tmp = "WHEEL";
+ break;
+ case REL_MISC:
+ tmp = "MISC";
+ break;
+ default:
+ tmp = "UNKNOWN";
+ break;
}
printf("Relative %s %d", tmp, event.value);
break;
case EV_ABS:
switch (event.code) {
- case ABS_X: tmp = "X"; break;
- case ABS_Y: tmp = "Y"; break;
- case ABS_Z: tmp = "Z"; break;
- case ABS_RX: tmp = "RX"; break;
- case ABS_RY: tmp = "RY"; break;
- case ABS_RZ: tmp = "RZ"; break;
- case ABS_THROTTLE: tmp = "THROTTLE"; break;
- case ABS_RUDDER: tmp = "RUDDER"; break;
- case ABS_WHEEL: tmp = "WHEEL"; break;
- case ABS_GAS: tmp = "GAS"; break;
- case ABS_BRAKE: tmp = "BRAKE"; break;
- case ABS_HAT0X: tmp = "HAT0X"; break;
- case ABS_HAT0Y: tmp = "HAT0Y"; break;
- case ABS_HAT1X: tmp = "HAT1X"; break;
- case ABS_HAT1Y: tmp = "HAT1Y"; break;
- case ABS_HAT2X: tmp = "HAT2X"; break;
- case ABS_HAT2Y: tmp = "HAT2Y"; break;
- case ABS_HAT3X: tmp = "HAT3X"; break;
- case ABS_HAT3Y: tmp = "HAT3Y"; break;
- case ABS_PRESSURE: tmp = "PRESSURE"; break;
- case ABS_DISTANCE: tmp = "DISTANCE"; break;
- case ABS_TILT_X: tmp = "TILT_X"; break;
- case ABS_TILT_Y: tmp = "TILT_Y"; break;
- case ABS_MISC: tmp = "MISC"; break;
- default: tmp = "UNKNOWN"; break;
+ case ABS_X:
+ tmp = "X";
+ break;
+ case ABS_Y:
+ tmp = "Y";
+ break;
+ case ABS_Z:
+ tmp = "Z";
+ break;
+ case ABS_RX:
+ tmp = "RX";
+ break;
+ case ABS_RY:
+ tmp = "RY";
+ break;
+ case ABS_RZ:
+ tmp = "RZ";
+ break;
+ case ABS_THROTTLE:
+ tmp = "THROTTLE";
+ break;
+ case ABS_RUDDER:
+ tmp = "RUDDER";
+ break;
+ case ABS_WHEEL:
+ tmp = "WHEEL";
+ break;
+ case ABS_GAS:
+ tmp = "GAS";
+ break;
+ case ABS_BRAKE:
+ tmp = "BRAKE";
+ break;
+ case ABS_HAT0X:
+ tmp = "HAT0X";
+ break;
+ case ABS_HAT0Y:
+ tmp = "HAT0Y";
+ break;
+ case ABS_HAT1X:
+ tmp = "HAT1X";
+ break;
+ case ABS_HAT1Y:
+ tmp = "HAT1Y";
+ break;
+ case ABS_HAT2X:
+ tmp = "HAT2X";
+ break;
+ case ABS_HAT2Y:
+ tmp = "HAT2Y";
+ break;
+ case ABS_HAT3X:
+ tmp = "HAT3X";
+ break;
+ case ABS_HAT3Y:
+ tmp = "HAT3Y";
+ break;
+ case ABS_PRESSURE:
+ tmp = "PRESSURE";
+ break;
+ case ABS_DISTANCE:
+ tmp = "DISTANCE";
+ break;
+ case ABS_TILT_X:
+ tmp = "TILT_X";
+ break;
+ case ABS_TILT_Y:
+ tmp = "TILT_Y";
+ break;
+ case ABS_MISC:
+ tmp = "MISC";
+ break;
+ default:
+ tmp = "UNKNOWN";
+ break;
}
printf("Absolute %s %d", tmp, event.value);
break;
- case EV_MSC: printf("Misc"); break;
- case EV_LED: printf("Led"); break;
- case EV_SND: printf("Snd"); break;
- case EV_REP: printf("Rep"); break;
- case EV_FF: printf("FF"); break;
+ case EV_MSC:
+ printf("Misc");
+ break;
+ case EV_LED:
+ printf("Led");
+ break;
+ case EV_SND:
+ printf("Snd");
+ break;
+ case EV_REP:
+ printf("Rep");
+ break;
+ case EV_FF:
+ printf("FF");
+ break;
break;
}
printf("\n");
diff --git a/hw/dmx/examples/evi.c b/hw/dmx/examples/evi.c
index 644ea8f51..64dfb7eaa 100644
--- a/hw/dmx/examples/evi.c
+++ b/hw/dmx/examples/evi.c
@@ -36,20 +36,22 @@
#include <X11/Xlib.h>
#include <X11/extensions/XEVI.h>
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
{
- Display *display = NULL;
- int major_version, minor_version;
- ExtendedVisualInfo *evi;
- int count;
- int i;
+ Display *display = NULL;
+ int major_version, minor_version;
+ ExtendedVisualInfo *evi;
+ int count;
+ int i;
if (argc == 2) {
if (!(display = XOpenDisplay(argv[1]))) {
printf("Cannot open display %s\n", argv[1]);
return -1;
}
- } else {
+ }
+ else {
printf("Usage: %s display\n", argv[0]);
return -1;
}
@@ -71,14 +73,13 @@ int main(int argc, char **argv)
printf("%02d vid=0x%02lx screen=%d level=%d type=%u value=%u"
" min=%u max=%u conflicts=%u\n",
i,
- (long unsigned)evi[i].core_visual_id,
+ (long unsigned) evi[i].core_visual_id,
evi[i].screen,
evi[i].level,
evi[i].transparency_type,
evi[i].transparency_value,
evi[i].min_hw_colormaps,
- evi[i].max_hw_colormaps,
- evi[i].num_colormap_conflicts);
+ evi[i].max_hw_colormaps, evi[i].num_colormap_conflicts);
}
XCloseDisplay(display);
diff --git a/hw/dmx/examples/res.c b/hw/dmx/examples/res.c
index 901a1958b..138216e4c 100644
--- a/hw/dmx/examples/res.c
+++ b/hw/dmx/examples/res.c
@@ -36,21 +36,23 @@
#include <X11/Xlib.h>
#include <X11/extensions/XRes.h>
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
{
- Display *display = NULL;
- int major_version, minor_version;
- int event, error;
- int count;
- int i;
- XResClient *clients;
+ Display *display = NULL;
+ int major_version, minor_version;
+ int event, error;
+ int count;
+ int i;
+ XResClient *clients;
if (argc == 2) {
if (!(display = XOpenDisplay(argv[1]))) {
printf("Cannot open display %s\n", argv[1]);
return -1;
}
- } else {
+ }
+ else {
printf("Usage: %s display\n", argv[0]);
return -1;
}
@@ -65,7 +67,7 @@ int main(int argc, char **argv)
return -1;
}
printf("X-Resource extension present: event=%d error=%d\n", event, error);
-
+
if (!XResQueryVersion(display, &major_version, &minor_version)) {
printf("XResQueryVersion call failed\n");
return -1;
@@ -77,16 +79,16 @@ int main(int argc, char **argv)
printf("%d clients:\n", count);
for (i = 0; i < count; i++) {
- int c, j;
+ int c, j;
XResType *types;
-
- XResQueryClientResources(display, clients[i].resource_base,
- &c, &types);
+
+ XResQueryClientResources(display, clients[i].resource_base, &c, &types);
printf(" %3d: base = 0x%lx, mask = 0x%lx, %d resource types:\n",
- i, (long unsigned)clients[i].resource_base,
- (long unsigned)clients[i].resource_mask, c);
+ i, (long unsigned) clients[i].resource_base,
+ (long unsigned) clients[i].resource_mask, c);
for (j = 0; j < c; j++) {
char *name = XGetAtomName(display, types[j].resource_type);
+
printf(" %2d: %s %d\n", j, name, types[j].count);
XFree(name);
}
diff --git a/hw/dmx/examples/xbell.c b/hw/dmx/examples/xbell.c
index 79419d324..543db24bf 100644
--- a/hw/dmx/examples/xbell.c
+++ b/hw/dmx/examples/xbell.c
@@ -35,27 +35,29 @@
#include <stdlib.h>
#include <X11/Xlib.h>
-static void pkc(XKeyboardControl *kc, unsigned long vm)
+static void
+pkc(XKeyboardControl * kc, unsigned long vm)
{
- if (vm&KBKeyClickPercent)
+ if (vm & KBKeyClickPercent)
printf(" key_click_percent = %d\n", kc->key_click_percent);
- if (vm&KBBellPercent)
+ if (vm & KBBellPercent)
printf(" bell_percent = %d\n", kc->bell_percent);
- if (vm&KBBellPitch)
+ if (vm & KBBellPitch)
printf(" bell_pitch = %d\n", kc->bell_pitch);
- if (vm&KBBellDuration)
+ if (vm & KBBellDuration)
printf(" bell_duration = %d\n", kc->bell_duration);
- if (vm&KBLed)
+ if (vm & KBLed)
printf(" led = 0x%x\n", kc->led);
- if (vm&KBLedMode)
+ if (vm & KBLedMode)
printf(" led_mode = %d\n", kc->led_mode);
- if (vm&KBKey)
+ if (vm & KBKey)
printf(" key = %d\n", kc->key);
- if (vm&KBAutoRepeatMode)
+ if (vm & KBAutoRepeatMode)
printf(" auto_repeat_mode = %d\n", kc->auto_repeat_mode);
}
-static void pks(XKeyboardState *ks)
+static void
+pks(XKeyboardState * ks)
{
printf(" key_click_percent = %d\n", ks->key_click_percent);
printf(" bell_percent = %d\n", ks->bell_percent);
@@ -65,24 +67,23 @@ static void pks(XKeyboardState *ks)
printf(" global_auto_repeat = %d\n", ks->global_auto_repeat);
}
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
{
- Display *display = XOpenDisplay(NULL);
+ Display *display = XOpenDisplay(NULL);
XKeyboardControl kc;
- XKeyboardState ks;
- unsigned long vm;
+ XKeyboardState ks;
+ unsigned long vm;
if (argc != 5) {
printf("Usage: xbell percent baseVolume pitch duration\n");
return 1;
}
-
- vm = (KBBellPercent
- | KBBellPitch
- | KBBellDuration);
+
+ vm = (KBBellPercent | KBBellPitch | KBBellDuration);
kc.key_click_percent = atoi(argv[1]);
- kc.bell_percent = atoi(argv[2]);
- kc.bell_pitch = atoi(argv[3]);
+ kc.bell_percent = atoi(argv[2]);
+ kc.bell_pitch = atoi(argv[3]);
kc.bell_duration = atoi(argv[4]);
printf("Setting:\n");
@@ -92,9 +93,9 @@ int main(int argc, char **argv)
printf("Have:\n");
XGetKeyboardControl(display, &ks);
pks(&ks);
-
+
XBell(display, 100);
-
+
XCloseDisplay(display);
return 0;
}
diff --git a/hw/dmx/examples/xinput.c b/hw/dmx/examples/xinput.c
index b12daf201..db6601030 100644
--- a/hw/dmx/examples/xinput.c
+++ b/hw/dmx/examples/xinput.c
@@ -42,31 +42,42 @@
#include <X11/extensions/dmxext.h>
#include <sys/time.h>
-static const char *core(DMXInputAttributes *iinf)
+static const char *
+core(DMXInputAttributes * iinf)
{
- if (iinf->isCore) return "core";
- else if (iinf->sendsCore) return "extension (sends core events)";
- else return "extension";
+ if (iinf->isCore)
+ return "core";
+ else if (iinf->sendsCore)
+ return "extension (sends core events)";
+ else
+ return "extension";
}
-static void printdmxinfo(Display *display, int id)
+static void
+printdmxinfo(Display * display, int id)
{
- int event_base;
- int error_base;
- int major_version, minor_version, patch_version;
- DMXInputAttributes iinf;
- Display *backend;
- char *backendname = NULL;
-
- if (!DMXQueryExtension(display, &event_base, &error_base)) return;
+ int event_base;
+ int error_base;
+ int major_version, minor_version, patch_version;
+ DMXInputAttributes iinf;
+ Display *backend;
+ char *backendname = NULL;
+
+ if (!DMXQueryExtension(display, &event_base, &error_base))
+ return;
if (!DMXQueryVersion(display, &major_version, &minor_version,
- &patch_version)) return;
- if (major_version == 1 && minor_version == 0) return; /* too old */
- if (!DMXGetInputAttributes(display, id, &iinf)) return;
+ &patch_version))
+ return;
+ if (major_version == 1 && minor_version == 0)
+ return; /* too old */
+ if (!DMXGetInputAttributes(display, id, &iinf))
+ return;
printf(" DMX Information: ");
- if (iinf.detached) printf("detached ");
- else printf("active ");
+ if (iinf.detached)
+ printf("detached ");
+ else
+ printf("active ");
switch (iinf.inputType) {
case DMXLocalInputType:
printf("local, %s", core(&iinf));
@@ -78,12 +89,14 @@ static void printdmxinfo(Display *display, int id)
if (iinf.physicalId >= 0) {
if ((backend = XOpenDisplay(iinf.name))) {
XExtensionVersion *ext = XGetExtensionVersion(backend, INAME);
- if (ext && ext != (XExtensionVersion *)NoSuchExtension) {
+
+ if (ext && ext != (XExtensionVersion *) NoSuchExtension) {
int count, i;
XDeviceInfo *devInfo = XListInputDevices(backend, &count);
+
if (devInfo) {
for (i = 0; i < count; i++) {
- if ((unsigned)iinf.physicalId == devInfo[i].id
+ if ((unsigned) iinf.physicalId == devInfo[i].id
&& devInfo[i].name) {
backendname = strdup(devInfo[i].name);
break;
@@ -95,8 +108,9 @@ static void printdmxinfo(Display *display, int id)
XCloseDisplay(backend);
}
}
- printf("backend o%d/%s",iinf.physicalScreen, iinf.name);
- if (iinf.physicalId >= 0) printf("/id%d", iinf.physicalId);
+ printf("backend o%d/%s", iinf.physicalScreen, iinf.name);
+ if (iinf.physicalId >= 0)
+ printf("/id%d", iinf.physicalId);
if (backendname) {
printf("=%s", backendname);
free(backendname);
@@ -107,26 +121,31 @@ static void printdmxinfo(Display *display, int id)
printf("\n");
}
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
{
- Display *display = NULL;
- int device = -1;
- int newmouse = -1;
- int newkbd = -1;
- int count;
- int i, j;
- XDeviceInfo *devInfo;
- XExtensionVersion *ext;
+ Display *display = NULL;
+ int device = -1;
+ int newmouse = -1;
+ int newkbd = -1;
+ int count;
+ int i, j;
+ XDeviceInfo *devInfo;
+ XExtensionVersion *ext;
if (argc == 2 || argc == 3 || argc == 4 || argc == 5) {
if (!(display = XOpenDisplay(argv[1]))) {
printf("Cannot open display %s\n", argv[1]);
return -1;
}
- if (argc >= 3) device = strtol(argv[2], NULL, 0);
- if (argc >= 4) newmouse = strtol(argv[3], NULL, 0);
- if (argc >= 5) newkbd = strtol(argv[4], NULL, 0);
- } else {
+ if (argc >= 3)
+ device = strtol(argv[2], NULL, 0);
+ if (argc >= 4)
+ newmouse = strtol(argv[3], NULL, 0);
+ if (argc >= 5)
+ newkbd = strtol(argv[4], NULL, 0);
+ }
+ else {
printf("Usage: %s display [device] [newmouse] [newkbd]\n", argv[0]);
return -1;
}
@@ -137,12 +156,11 @@ int main(int argc, char **argv)
}
ext = XGetExtensionVersion(display, INAME);
- if (!ext || ext == (XExtensionVersion *)NoSuchExtension) {
+ if (!ext || ext == (XExtensionVersion *) NoSuchExtension) {
printf("No XInputExtension\n");
return -1;
}
- printf("%s version %d.%d\n",
- INAME, ext->major_version, ext->minor_version);
+ printf("%s version %d.%d\n", INAME, ext->major_version, ext->minor_version);
if (!(devInfo = XListInputDevices(display, &count)) || !count) {
printf("Cannot list devices\n");
@@ -151,30 +169,52 @@ int main(int argc, char **argv)
for (i = 0; i < count; i++) {
XAnyClassPtr any;
- const char *kind = "Unknown";
- int has_key = 0;
-
+ const char *kind = "Unknown";
+ int has_key = 0;
+
switch (devInfo[i].use) {
- case IsXPointer: kind = "XPointer"; break;
- case IsXKeyboard: kind = "XKeyboard"; break;
- case IsXExtensionDevice: kind = "XExtensionDevice"; break;
+ case IsXPointer:
+ kind = "XPointer";
+ break;
+ case IsXKeyboard:
+ kind = "XKeyboard";
+ break;
+ case IsXExtensionDevice:
+ kind = "XExtensionDevice";
+ break;
}
printf("%2lu %-20.20s %-16.16s",
- (long unsigned)devInfo[i].id,
+ (long unsigned) devInfo[i].id,
devInfo[i].name ? devInfo[i].name : "", kind);
for (j = 0, any = devInfo[i].inputclassinfo;
j < devInfo[i].num_classes;
- any = (XAnyClassPtr)((char *)any + any->length), j++) {
- const char *class = "unk";
+ any = (XAnyClassPtr) ((char *) any + any->length), j++) {
+ const char *class = "unk";
+
switch (any->class) {
- case KeyClass: class = "key"; ++has_key; break;
- case ButtonClass: class = "btn"; break;
- case ValuatorClass: class = "val"; break;
- case FeedbackClass: class = "fdb"; break;
- case ProximityClass: class = "prx"; break;
- case FocusClass: class = "foc"; break;
- case OtherClass: class = "oth"; break;
+ case KeyClass:
+ class = "key";
+ ++has_key;
+ break;
+ case ButtonClass:
+ class = "btn";
+ break;
+ case ValuatorClass:
+ class = "val";
+ break;
+ case FeedbackClass:
+ class = "fdb";
+ break;
+ case ProximityClass:
+ class = "prx";
+ break;
+ case FocusClass:
+ class = "foc";
+ break;
+ case OtherClass:
+ class = "oth";
+ break;
}
printf(" %s", class);
}
@@ -182,10 +222,10 @@ int main(int argc, char **argv)
printdmxinfo(display, i);
if (has_key) {
- XkbDescPtr xkb;
+ XkbDescPtr xkb;
+
if ((xkb = XkbGetKeyboard(display,
- XkbAllComponentsMask,
- devInfo[i].id))) {
+ XkbAllComponentsMask, devInfo[i].id))) {
printf(" Xkb Information:\n");
printf(" Device id = %d\n", xkb->device_spec);
printf(" Min keycode = 0x%02x\n", xkb->min_key_code);
@@ -203,41 +243,37 @@ int main(int argc, char **argv)
}
if (newmouse >= 0) {
- XDevice *dev;
+ XDevice *dev;
printf("Trying to make device %d core mouse\n", newmouse);
dev = XOpenDevice(display, devInfo[newmouse].id);
- printf("Status = %d\n",
- XChangePointerDevice(display, dev, 0, 1));
+ printf("Status = %d\n", XChangePointerDevice(display, dev, 0, 1));
return 0;
}
if (newkbd >= 0) {
- XDevice *dev;
+ XDevice *dev;
printf("Trying to make device %d core keyboard\n", newkbd);
dev = XOpenDevice(display, devInfo[newkbd].id);
- printf("Status = %d\n",
- XChangeKeyboardDevice(display, dev));
+ printf("Status = %d\n", XChangeKeyboardDevice(display, dev));
return 0;
}
-
- if (device >=0){
+ if (device >= 0) {
#define MAX_EVENTS 100
- int cnt = 0;
- XDevice *dev;
+ int cnt = 0;
+ XDevice *dev;
XEventClass event_list[MAX_EVENTS];
- int event_type[MAX_EVENTS];
- const char *names[MAX_EVENTS];
- int total = 0;
+ int event_type[MAX_EVENTS];
+ const char *names[MAX_EVENTS];
+ int total = 0;
#define ADD(type) \
if (cnt >= MAX_EVENTS) abort(); \
names[cnt] = #type; \
type(dev, event_type[cnt], event_list[cnt]); \
if (event_type[cnt]) ++cnt
-
dev = XOpenDevice(display, devInfo[device].id);
ADD(DeviceKeyPress);
@@ -252,54 +288,55 @@ int main(int argc, char **argv)
ADD(DeviceStateNotify);
ADD(DeviceMappingNotify);
ADD(ChangeDeviceNotify);
-
+
for (i = 0; i < cnt; i++) {
printf("Waiting for %s events of type %d (%lu) on 0x%08lx\n",
names[i],
- event_type[i], (unsigned long)event_list[i],
- (long unsigned)DefaultRootWindow(display));
+ event_type[i], (unsigned long) event_list[i],
+ (long unsigned) DefaultRootWindow(display));
}
XSelectExtensionEvent(display, DefaultRootWindow(display),
event_list, cnt);
-
+
for (;;) {
XEvent event;
+
XNextEvent(display, &event);
for (i = 0; i < cnt; i++) {
- XDeviceMotionEvent *e = (XDeviceMotionEvent *)&event;
- XDeviceButtonEvent *b = (XDeviceButtonEvent *)&event;
+ XDeviceMotionEvent *e = (XDeviceMotionEvent *) & event;
+ XDeviceButtonEvent *b = (XDeviceButtonEvent *) & event;
+
if (event.type == event_type[i]) {
printf("%s id=%lu (%d @ %d,%d; s=0x%04x, d=%d, t=%lu)"
" axes_count=%d first=%d %d %d %d %d %d %d\n",
names[i],
- (long unsigned)e->deviceid,
+ (long unsigned) e->deviceid,
e->type,
e->x, e->y,
e->device_state,
b->button,
- (long unsigned)b->time,
+ (long unsigned) b->time,
e->axes_count,
e->first_axis,
e->axis_data[0],
e->axis_data[1],
e->axis_data[2],
- e->axis_data[3],
- e->axis_data[4],
- e->axis_data[5]);
+ e->axis_data[3], e->axis_data[4], e->axis_data[5]);
}
}
++total;
#if 0
- /* Used to check motion history for
- * extension devices. */
+ /* Used to check motion history for
+ * extension devices. */
if (!(total % 10)) {
XDeviceTimeCoord *tc;
- int n, m, a;
- struct timeval tv;
- unsigned long ms;
+ int n, m, a;
+ struct timeval tv;
+ unsigned long ms;
+
gettimeofday(&tv, NULL);
ms = tv.tv_sec * 1000 + tv.tv_usec / 1000;
- tc = XGetDeviceMotionEvents(display, dev, ms-1000, ms,
+ tc = XGetDeviceMotionEvents(display, dev, ms - 1000, ms,
&n, &m, &a);
printf("Got %d events of mode %s with %d axes\n",
n, m == Absolute ? "Absolute" : "Relative", a);
@@ -309,7 +346,7 @@ int main(int argc, char **argv)
}
XFreeDeviceMotionEvents(tc);
}
-#endif
+#endif
}
}
diff --git a/hw/dmx/examples/xled.c b/hw/dmx/examples/xled.c
index 270f80511..32e8e3770 100644
--- a/hw/dmx/examples/xled.c
+++ b/hw/dmx/examples/xled.c
@@ -40,23 +40,26 @@
#include <X11/extensions/XKBstr.h>
#include <sys/time.h>
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
{
- Display *display = NULL;
- int mask = 0;
- unsigned i;
- XKeyboardState ks;
- XKeyboardControl kc;
- XkbDescPtr xkb;
- int old[32];
+ Display *display = NULL;
+ int mask = 0;
+ unsigned i;
+ XKeyboardState ks;
+ XKeyboardControl kc;
+ XkbDescPtr xkb;
+ int old[32];
if (argc == 2 || argc == 3) {
if (!(display = XOpenDisplay(argv[1]))) {
printf("Cannot open display %s\n", argv[1]);
return -1;
}
- if (argc >= 3) mask = strtol(argv[2], NULL, 0);
- } else {
+ if (argc >= 3)
+ mask = strtol(argv[2], NULL, 0);
+ }
+ else {
printf("Usage: %s display [mask]\n", argv[0]);
return -1;
}
@@ -81,14 +84,13 @@ int main(int argc, char **argv)
for (i = 0; i < XkbNumIndicators; i++) {
if (xkb->indicators->phys_indicators & (1 << i)) {
printf("led %d = %d\n", i, xkb->indicators->maps[i].flags);
- old[i] = xkb->indicators->maps[i].flags;
+ old[i] = xkb->indicators->maps[i].flags;
xkb->indicators->maps[i].flags = XkbIM_NoAutomatic;
}
}
printf("XkbSetIndicatorMap = %d\n", XkbSetIndicatorMap(display, ~0, xkb));
XkbFreeKeyboard(xkb, 0, True);
-
if (!(xkb = XkbAllocKeyboard())) {
printf("Cannot allocate\n");
return -1;
@@ -105,7 +107,7 @@ int main(int argc, char **argv)
printf("XGetKeyboardControl = %d\n", XGetKeyboardControl(display, &ks));
printf("old mask = 0x%08lx\n", ks.led_mask);
for (i = 0; i < 5; i++) {
- kc.led = i + 1;
+ kc.led = i + 1;
kc.led_mode = (mask & (1 << i)) ? LedModeOn : LedModeOff;
printf("XChangeKeyboardControl = %d\n",
XChangeKeyboardControl(display, KBLed | KBLedMode, &kc));
diff --git a/hw/dmx/examples/xtest.c b/hw/dmx/examples/xtest.c
index 1e2d1cfff..9ce896a29 100644
--- a/hw/dmx/examples/xtest.c
+++ b/hw/dmx/examples/xtest.c
@@ -36,19 +36,21 @@
#include <X11/Xlib.h>
#include <X11/extensions/XTest.h>
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
{
- Display *display = NULL;
- int event_base;
- int error_base;
- int major_version, minor_version;
+ Display *display = NULL;
+ int event_base;
+ int error_base;
+ int major_version, minor_version;
if (argc == 2) {
if (!(display = XOpenDisplay(argv[1]))) {
printf("Cannot open display %s\n", argv[1]);
return -1;
}
- } else {
+ }
+ else {
printf("Usage: %s display\n", argv[0]);
return -1;
}
diff --git a/hw/dmx/glxProxy/compsize.c b/hw/dmx/glxProxy/compsize.c
index 5a5d5d0f1..c204d3ded 100644
--- a/hw/dmx/glxProxy/compsize.c
+++ b/hw/dmx/glxProxy/compsize.c
@@ -31,529 +31,611 @@
#include <GL/gl.h>
#include "compsize.h"
-GLint __glFogiv_size(GLenum pname)
+GLint
+__glFogiv_size(GLenum pname)
{
switch (pname) {
- case GL_FOG_COLOR: return 4;
- case GL_FOG_DENSITY: return 1;
- case GL_FOG_END: return 1;
- case GL_FOG_MODE: return 1;
- case GL_FOG_INDEX: return 1;
- case GL_FOG_START: return 1;
- default:
- return 0;
+ case GL_FOG_COLOR:
+ return 4;
+ case GL_FOG_DENSITY:
+ return 1;
+ case GL_FOG_END:
+ return 1;
+ case GL_FOG_MODE:
+ return 1;
+ case GL_FOG_INDEX:
+ return 1;
+ case GL_FOG_START:
+ return 1;
+ default:
+ return 0;
}
}
-GLint __glFogfv_size(GLenum pname)
+GLint
+__glFogfv_size(GLenum pname)
{
return __glFogiv_size(pname);
}
-GLint __glCallLists_size(GLsizei n, GLenum type)
+GLint
+__glCallLists_size(GLsizei n, GLenum type)
{
GLint size;
- if (n < 0) return 0;
+ if (n < 0)
+ return 0;
switch (type) {
- case GL_BYTE: size = 1; break;
- case GL_UNSIGNED_BYTE: size = 1; break;
- case GL_SHORT: size = 2; break;
- case GL_UNSIGNED_SHORT: size = 2; break;
- case GL_INT: size = 4; break;
- case GL_UNSIGNED_INT: size = 4; break;
- case GL_FLOAT: size = 4; break;
- case GL_2_BYTES: size = 2; break;
- case GL_3_BYTES: size = 3; break;
- case GL_4_BYTES: size = 4; break;
- default:
- return 0;
+ case GL_BYTE:
+ size = 1;
+ break;
+ case GL_UNSIGNED_BYTE:
+ size = 1;
+ break;
+ case GL_SHORT:
+ size = 2;
+ break;
+ case GL_UNSIGNED_SHORT:
+ size = 2;
+ break;
+ case GL_INT:
+ size = 4;
+ break;
+ case GL_UNSIGNED_INT:
+ size = 4;
+ break;
+ case GL_FLOAT:
+ size = 4;
+ break;
+ case GL_2_BYTES:
+ size = 2;
+ break;
+ case GL_3_BYTES:
+ size = 3;
+ break;
+ case GL_4_BYTES:
+ size = 4;
+ break;
+ default:
+ return 0;
}
return n * size;
}
-GLint __glDrawPixels_size(GLenum format, GLenum type, GLsizei w, GLsizei h)
+GLint
+__glDrawPixels_size(GLenum format, GLenum type, GLsizei w, GLsizei h)
{
GLint elements, esize;
-
+
switch (format) {
- case GL_COLOR_INDEX:
- case GL_STENCIL_INDEX:
- case GL_DEPTH_COMPONENT:
- elements = 1;
- break;
- case GL_RED:
- case GL_GREEN:
- case GL_BLUE:
- case GL_ALPHA:
- case GL_LUMINANCE:
- elements = 1;
- break;
- case GL_LUMINANCE_ALPHA:
- elements = 2;
- break;
- case GL_RGB:
- elements = 3;
- break;
- case GL_RGBA:
- case GL_ABGR_EXT:
- elements = 4;
- break;
- default:
- return 0;
+ case GL_COLOR_INDEX:
+ case GL_STENCIL_INDEX:
+ case GL_DEPTH_COMPONENT:
+ elements = 1;
+ break;
+ case GL_RED:
+ case GL_GREEN:
+ case GL_BLUE:
+ case GL_ALPHA:
+ case GL_LUMINANCE:
+ elements = 1;
+ break;
+ case GL_LUMINANCE_ALPHA:
+ elements = 2;
+ break;
+ case GL_RGB:
+ elements = 3;
+ break;
+ case GL_RGBA:
+ case GL_ABGR_EXT:
+ elements = 4;
+ break;
+ default:
+ return 0;
}
switch (type) {
- case GL_BITMAP:
- if (format == GL_COLOR_INDEX || format == GL_STENCIL_INDEX) {
- return (h * ((w+7)/8));
- } else {
- return 0;
- }
- case GL_BYTE:
- case GL_UNSIGNED_BYTE:
- esize = 1;
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- esize = 1;
- elements = 1;
- break;
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- esize = 2;
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- esize = 2;
- elements = 1;
- break;
- case GL_INT:
- case GL_UNSIGNED_INT:
- case GL_FLOAT:
- esize = 4;
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- esize = 4;
- elements = 1;
- break;
- default:
- return 0;
+ case GL_BITMAP:
+ if (format == GL_COLOR_INDEX || format == GL_STENCIL_INDEX) {
+ return (h * ((w + 7) / 8));
+ }
+ else {
+ return 0;
+ }
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ esize = 1;
+ break;
+ case GL_UNSIGNED_BYTE_3_3_2:
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ esize = 1;
+ elements = 1;
+ break;
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ esize = 2;
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ esize = 2;
+ elements = 1;
+ break;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ case GL_FLOAT:
+ esize = 4;
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ case GL_UNSIGNED_INT_10_10_10_2:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ esize = 4;
+ elements = 1;
+ break;
+ default:
+ return 0;
}
return elements * esize * w * h;
}
-GLint __glBitmap_size(GLsizei w, GLsizei h)
+GLint
+__glBitmap_size(GLsizei w, GLsizei h)
{
return __glDrawPixels_size(GL_COLOR_INDEX, GL_BITMAP, w, h);
}
-GLint __glTexGendv_size(GLenum e)
+GLint
+__glTexGendv_size(GLenum e)
{
switch (e) {
- case GL_TEXTURE_GEN_MODE:
- return 1;
- case GL_OBJECT_PLANE:
- case GL_EYE_PLANE:
- return 4;
- default:
- return 0;
+ case GL_TEXTURE_GEN_MODE:
+ return 1;
+ case GL_OBJECT_PLANE:
+ case GL_EYE_PLANE:
+ return 4;
+ default:
+ return 0;
}
}
-GLint __glTexGenfv_size(GLenum e)
+GLint
+__glTexGenfv_size(GLenum e)
{
return __glTexGendv_size(e);
}
-GLint __glTexGeniv_size(GLenum e)
+GLint
+__glTexGeniv_size(GLenum e)
{
return __glTexGendv_size(e);
}
-GLint __glTexParameterfv_size(GLenum e)
+GLint
+__glTexParameterfv_size(GLenum e)
{
switch (e) {
- case GL_TEXTURE_WRAP_S:
- case GL_TEXTURE_WRAP_T:
- case GL_TEXTURE_WRAP_R:
- case GL_TEXTURE_MIN_FILTER:
- case GL_TEXTURE_MAG_FILTER:
- return 1;
- case GL_TEXTURE_BORDER_COLOR:
- return 4;
- case GL_TEXTURE_PRIORITY:
- return 1;
- case GL_TEXTURE_MIN_LOD:
- case GL_TEXTURE_MAX_LOD:
- case GL_TEXTURE_BASE_LEVEL:
- case GL_TEXTURE_MAX_LEVEL:
- return 1;
- default:
- return 0;
+ case GL_TEXTURE_WRAP_S:
+ case GL_TEXTURE_WRAP_T:
+ case GL_TEXTURE_WRAP_R:
+ case GL_TEXTURE_MIN_FILTER:
+ case GL_TEXTURE_MAG_FILTER:
+ return 1;
+ case GL_TEXTURE_BORDER_COLOR:
+ return 4;
+ case GL_TEXTURE_PRIORITY:
+ return 1;
+ case GL_TEXTURE_MIN_LOD:
+ case GL_TEXTURE_MAX_LOD:
+ case GL_TEXTURE_BASE_LEVEL:
+ case GL_TEXTURE_MAX_LEVEL:
+ return 1;
+ default:
+ return 0;
}
}
-GLint __glTexParameteriv_size(GLenum e)
+GLint
+__glTexParameteriv_size(GLenum e)
{
return __glTexParameterfv_size(e);
}
-GLint __glTexEnvfv_size(GLenum e)
+GLint
+__glTexEnvfv_size(GLenum e)
{
switch (e) {
- case GL_TEXTURE_ENV_MODE:
- return 1;
- case GL_TEXTURE_ENV_COLOR:
- return 4;
- default:
- return 0;
+ case GL_TEXTURE_ENV_MODE:
+ return 1;
+ case GL_TEXTURE_ENV_COLOR:
+ return 4;
+ default:
+ return 0;
}
}
-GLint __glTexEnviv_size(GLenum e)
+GLint
+__glTexEnviv_size(GLenum e)
{
return __glTexEnvfv_size(e);
}
-GLint __glTexImage1D_size(GLenum format, GLenum type, GLsizei w)
+GLint
+__glTexImage1D_size(GLenum format, GLenum type, GLsizei w)
{
GLint elements, esize;
- if (w < 0) return 0;
+ if (w < 0)
+ return 0;
switch (format) {
- case GL_COLOR_INDEX:
- elements = 1;
- break;
- case GL_RED:
- case GL_GREEN:
- case GL_BLUE:
- case GL_ALPHA:
- case GL_LUMINANCE:
- elements = 1;
- break;
- case GL_LUMINANCE_ALPHA:
- elements = 2;
- break;
- case GL_RGB:
- elements = 3;
- break;
- case GL_RGBA:
- case GL_ABGR_EXT:
- elements = 4;
- break;
- default:
- return 0;
+ case GL_COLOR_INDEX:
+ elements = 1;
+ break;
+ case GL_RED:
+ case GL_GREEN:
+ case GL_BLUE:
+ case GL_ALPHA:
+ case GL_LUMINANCE:
+ elements = 1;
+ break;
+ case GL_LUMINANCE_ALPHA:
+ elements = 2;
+ break;
+ case GL_RGB:
+ elements = 3;
+ break;
+ case GL_RGBA:
+ case GL_ABGR_EXT:
+ elements = 4;
+ break;
+ default:
+ return 0;
}
switch (type) {
- case GL_BITMAP:
- if (format == GL_COLOR_INDEX) {
- return (w+7)/8;
- } else {
- return 0;
- }
- case GL_BYTE:
- case GL_UNSIGNED_BYTE:
- esize = 1;
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- esize = 1;
- elements = 1;
- break;
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- esize = 2;
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- esize = 2;
- elements = 1;
- break;
- case GL_INT:
- case GL_UNSIGNED_INT:
- case GL_FLOAT:
- esize = 4;
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- esize = 4;
- elements = 1;
- break;
- default:
- return 0;
+ case GL_BITMAP:
+ if (format == GL_COLOR_INDEX) {
+ return (w + 7) / 8;
+ }
+ else {
+ return 0;
+ }
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ esize = 1;
+ break;
+ case GL_UNSIGNED_BYTE_3_3_2:
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ esize = 1;
+ elements = 1;
+ break;
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ esize = 2;
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ esize = 2;
+ elements = 1;
+ break;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ case GL_FLOAT:
+ esize = 4;
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ case GL_UNSIGNED_INT_10_10_10_2:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ esize = 4;
+ elements = 1;
+ break;
+ default:
+ return 0;
}
return elements * esize * w;
}
-GLint __glTexImage2D_size(GLenum format, GLenum type, GLsizei w, GLsizei h)
+GLint
+__glTexImage2D_size(GLenum format, GLenum type, GLsizei w, GLsizei h)
{
GLint elements, esize;
- if (w < 0) return 0;
- if (h < 0) return 0;
+ if (w < 0)
+ return 0;
+ if (h < 0)
+ return 0;
switch (format) {
- case GL_COLOR_INDEX:
- elements = 1;
- break;
- case GL_RED:
- case GL_GREEN:
- case GL_BLUE:
- case GL_ALPHA:
- case GL_LUMINANCE:
- elements = 1;
- break;
- case GL_LUMINANCE_ALPHA:
- elements = 2;
- break;
- case GL_RGB:
- elements = 3;
- break;
- case GL_RGBA:
- case GL_ABGR_EXT:
- elements = 4;
- break;
- default:
- return 0;
+ case GL_COLOR_INDEX:
+ elements = 1;
+ break;
+ case GL_RED:
+ case GL_GREEN:
+ case GL_BLUE:
+ case GL_ALPHA:
+ case GL_LUMINANCE:
+ elements = 1;
+ break;
+ case GL_LUMINANCE_ALPHA:
+ elements = 2;
+ break;
+ case GL_RGB:
+ elements = 3;
+ break;
+ case GL_RGBA:
+ case GL_ABGR_EXT:
+ elements = 4;
+ break;
+ default:
+ return 0;
}
switch (type) {
- case GL_BITMAP:
- if (format == GL_COLOR_INDEX) {
- return (h * ((w+7)/8));
- } else {
- return 0;
- }
- case GL_BYTE:
- case GL_UNSIGNED_BYTE:
- esize = 1;
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- esize = 1;
- elements = 1;
- break;
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- esize = 2;
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- esize = 2;
- elements = 1;
- break;
- case GL_INT:
- case GL_UNSIGNED_INT:
- case GL_FLOAT:
- esize = 4;
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- esize = 4;
- elements = 1;
- break;
- default:
- return 0;
+ case GL_BITMAP:
+ if (format == GL_COLOR_INDEX) {
+ return (h * ((w + 7) / 8));
+ }
+ else {
+ return 0;
+ }
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ esize = 1;
+ break;
+ case GL_UNSIGNED_BYTE_3_3_2:
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ esize = 1;
+ elements = 1;
+ break;
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ esize = 2;
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ esize = 2;
+ elements = 1;
+ break;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ case GL_FLOAT:
+ esize = 4;
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ case GL_UNSIGNED_INT_10_10_10_2:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ esize = 4;
+ elements = 1;
+ break;
+ default:
+ return 0;
}
return elements * esize * w * h;
}
-GLint __glTexImage3D_size(GLenum format, GLenum type, GLsizei w, GLsizei h,
- GLsizei d)
+GLint
+__glTexImage3D_size(GLenum format, GLenum type, GLsizei w, GLsizei h, GLsizei d)
{
GLint elements, esize;
- if (w < 0) return 0;
- if (h < 0) return 0;
- if (d < 0) return 0;
+ if (w < 0)
+ return 0;
+ if (h < 0)
+ return 0;
+ if (d < 0)
+ return 0;
switch (format) {
- case GL_COLOR_INDEX:
- elements = 1;
- break;
- case GL_RED:
- case GL_GREEN:
- case GL_BLUE:
- case GL_ALPHA:
- case GL_LUMINANCE:
- elements = 1;
- break;
- case GL_LUMINANCE_ALPHA:
- elements = 2;
- break;
- case GL_RGB:
- elements = 3;
- break;
- case GL_RGBA:
- case GL_ABGR_EXT:
- elements = 4;
- break;
- default:
- return 0;
+ case GL_COLOR_INDEX:
+ elements = 1;
+ break;
+ case GL_RED:
+ case GL_GREEN:
+ case GL_BLUE:
+ case GL_ALPHA:
+ case GL_LUMINANCE:
+ elements = 1;
+ break;
+ case GL_LUMINANCE_ALPHA:
+ elements = 2;
+ break;
+ case GL_RGB:
+ elements = 3;
+ break;
+ case GL_RGBA:
+ case GL_ABGR_EXT:
+ elements = 4;
+ break;
+ default:
+ return 0;
}
switch (type) {
- case GL_BITMAP:
- if (format == GL_COLOR_INDEX) {
- return (d * (h * ((w+7)/8)));
- } else {
- return 0;
- }
- case GL_BYTE:
- case GL_UNSIGNED_BYTE:
- esize = 1;
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- esize = 1;
- elements = 1;
- break;
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- esize = 2;
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- esize = 2;
- elements = 1;
- break;
- case GL_INT:
- case GL_UNSIGNED_INT:
- case GL_FLOAT:
- esize = 4;
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- esize = 4;
- elements = 1;
- break;
- default:
- return 0;
+ case GL_BITMAP:
+ if (format == GL_COLOR_INDEX) {
+ return (d * (h * ((w + 7) / 8)));
+ }
+ else {
+ return 0;
+ }
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ esize = 1;
+ break;
+ case GL_UNSIGNED_BYTE_3_3_2:
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ esize = 1;
+ elements = 1;
+ break;
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ esize = 2;
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ esize = 2;
+ elements = 1;
+ break;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ case GL_FLOAT:
+ esize = 4;
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ case GL_UNSIGNED_INT_10_10_10_2:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ esize = 4;
+ elements = 1;
+ break;
+ default:
+ return 0;
}
return elements * esize * w * h * d;
}
-GLint __glLightfv_size(GLenum pname)
+GLint
+__glLightfv_size(GLenum pname)
{
switch (pname) {
- case GL_SPOT_EXPONENT: return 1;
- case GL_SPOT_CUTOFF: return 1;
- case GL_AMBIENT: return 4;
- case GL_DIFFUSE: return 4;
- case GL_SPECULAR: return 4;
- case GL_POSITION: return 4;
- case GL_SPOT_DIRECTION: return 3;
- case GL_CONSTANT_ATTENUATION: return 1;
- case GL_LINEAR_ATTENUATION: return 1;
- case GL_QUADRATIC_ATTENUATION: return 1;
- default:
- return 0;
+ case GL_SPOT_EXPONENT:
+ return 1;
+ case GL_SPOT_CUTOFF:
+ return 1;
+ case GL_AMBIENT:
+ return 4;
+ case GL_DIFFUSE:
+ return 4;
+ case GL_SPECULAR:
+ return 4;
+ case GL_POSITION:
+ return 4;
+ case GL_SPOT_DIRECTION:
+ return 3;
+ case GL_CONSTANT_ATTENUATION:
+ return 1;
+ case GL_LINEAR_ATTENUATION:
+ return 1;
+ case GL_QUADRATIC_ATTENUATION:
+ return 1;
+ default:
+ return 0;
}
}
-GLint __glLightiv_size(GLenum pname)
+GLint
+__glLightiv_size(GLenum pname)
{
return __glLightfv_size(pname);
}
-GLint __glLightModelfv_size(GLenum pname)
+GLint
+__glLightModelfv_size(GLenum pname)
{
switch (pname) {
- case GL_LIGHT_MODEL_AMBIENT: return 4;
- case GL_LIGHT_MODEL_LOCAL_VIEWER: return 1;
- case GL_LIGHT_MODEL_TWO_SIDE: return 1;
- case GL_LIGHT_MODEL_COLOR_CONTROL: return 1;
- default:
- return 0;
+ case GL_LIGHT_MODEL_AMBIENT:
+ return 4;
+ case GL_LIGHT_MODEL_LOCAL_VIEWER:
+ return 1;
+ case GL_LIGHT_MODEL_TWO_SIDE:
+ return 1;
+ case GL_LIGHT_MODEL_COLOR_CONTROL:
+ return 1;
+ default:
+ return 0;
}
}
-GLint __glLightModeliv_size(GLenum pname)
+GLint
+__glLightModeliv_size(GLenum pname)
{
return __glLightModelfv_size(pname);
}
-GLint __glMaterialfv_size(GLenum pname)
+GLint
+__glMaterialfv_size(GLenum pname)
{
switch (pname) {
- case GL_SHININESS: return 1;
- case GL_EMISSION: return 4;
- case GL_AMBIENT: return 4;
- case GL_DIFFUSE: return 4;
- case GL_SPECULAR: return 4;
- case GL_AMBIENT_AND_DIFFUSE: return 4;
- case GL_COLOR_INDEXES: return 3;
- default:
- return 0;
+ case GL_SHININESS:
+ return 1;
+ case GL_EMISSION:
+ return 4;
+ case GL_AMBIENT:
+ return 4;
+ case GL_DIFFUSE:
+ return 4;
+ case GL_SPECULAR:
+ return 4;
+ case GL_AMBIENT_AND_DIFFUSE:
+ return 4;
+ case GL_COLOR_INDEXES:
+ return 3;
+ default:
+ return 0;
}
}
-GLint __glMaterialiv_size(GLenum pname)
+GLint
+__glMaterialiv_size(GLenum pname)
{
return __glMaterialfv_size(pname);
}
-GLint __glColorTableParameterfv_size(GLenum pname)
+GLint
+__glColorTableParameterfv_size(GLenum pname)
{
switch (pname) {
- case GL_COLOR_TABLE_FORMAT:
- case GL_COLOR_TABLE_WIDTH:
- case GL_COLOR_TABLE_RED_SIZE:
- case GL_COLOR_TABLE_GREEN_SIZE:
- case GL_COLOR_TABLE_BLUE_SIZE:
- case GL_COLOR_TABLE_ALPHA_SIZE:
- case GL_COLOR_TABLE_LUMINANCE_SIZE:
- case GL_COLOR_TABLE_INTENSITY_SIZE:
- return 1;
- case GL_COLOR_TABLE_SCALE:
- case GL_COLOR_TABLE_BIAS:
- return 4;
- default:
- return -1;
+ case GL_COLOR_TABLE_FORMAT:
+ case GL_COLOR_TABLE_WIDTH:
+ case GL_COLOR_TABLE_RED_SIZE:
+ case GL_COLOR_TABLE_GREEN_SIZE:
+ case GL_COLOR_TABLE_BLUE_SIZE:
+ case GL_COLOR_TABLE_ALPHA_SIZE:
+ case GL_COLOR_TABLE_LUMINANCE_SIZE:
+ case GL_COLOR_TABLE_INTENSITY_SIZE:
+ return 1;
+ case GL_COLOR_TABLE_SCALE:
+ case GL_COLOR_TABLE_BIAS:
+ return 4;
+ default:
+ return -1;
}
}
-GLint __glColorTableParameteriv_size(GLenum pname)
+GLint
+__glColorTableParameteriv_size(GLenum pname)
{
return __glColorTableParameterfv_size(pname);
}
-GLint __glConvolutionParameterfv_size(GLenum pname)
+GLint
+__glConvolutionParameterfv_size(GLenum pname)
{
- switch(pname) {
- case GL_CONVOLUTION_BORDER_MODE:
- return 1;
- case GL_CONVOLUTION_BORDER_COLOR:
- case GL_CONVOLUTION_FILTER_SCALE:
- case GL_CONVOLUTION_FILTER_BIAS:
- return 4;
- default: /* error: bad enum value */
- return -1;
+ switch (pname) {
+ case GL_CONVOLUTION_BORDER_MODE:
+ return 1;
+ case GL_CONVOLUTION_BORDER_COLOR:
+ case GL_CONVOLUTION_FILTER_SCALE:
+ case GL_CONVOLUTION_FILTER_BIAS:
+ return 4;
+ default: /* error: bad enum value */
+ return -1;
}
}
-GLint __glConvolutionParameteriv_size(GLenum pname)
+GLint
+__glConvolutionParameteriv_size(GLenum pname)
{
return __glConvolutionParameterfv_size(pname);
}
diff --git a/hw/dmx/glxProxy/compsize.h b/hw/dmx/glxProxy/compsize.h
index 856c6f5ad..360966233 100644
--- a/hw/dmx/glxProxy/compsize.h
+++ b/hw/dmx/glxProxy/compsize.h
@@ -48,4 +48,4 @@ extern GLint __glTexGeniv_size(GLenum e);
extern GLint __glTexParameterfv_size(GLenum e);
extern GLint __glTexParameteriv_size(GLenum e);
-#endif /* !__compsize_h__ */
+#endif /* !__compsize_h__ */
diff --git a/hw/dmx/glxProxy/g_disptab.c b/hw/dmx/glxProxy/g_disptab.c
index 3f0a6e77e..46177c4cc 100644
--- a/hw/dmx/glxProxy/g_disptab.c
+++ b/hw/dmx/glxProxy/g_disptab.c
@@ -35,578 +35,576 @@
#include "glxsingle.h"
__GLXdispatchSingleProcPtr __glXSingleTable[] = {
- __glXNoSuchSingleOpcode,
- __glXRender,
- __glXRenderLarge,
- __glXCreateContext,
- __glXDestroyContext,
- __glXMakeCurrent,
- __glXIsDirect,
- __glXQueryVersion,
- __glXWaitGL,
- __glXWaitX,
- __glXCopyContext,
- __glXSwapBuffers,
- __glXUseXFont,
- __glXCreateGLXPixmap,
- __glXGetVisualConfigs,
- __glXDestroyGLXPixmap,
- __glXVendorPrivate,
- __glXVendorPrivateWithReply,
- __glXQueryExtensionsString,
- __glXQueryServerString,
- __glXClientInfo,
- __glXGetFBConfigs, /* __glXGetFBConfigs */
- __glXCreatePixmap, /* __glXCreatePixmap,*/
- __glXDestroyGLXPixmap, /* __glXDestroyPixmap,*/
- __glXCreateNewContext, /* __glXCreateNewContext,*/
- __glXQueryContext, /* __glXQueryContext,*/
- __glXMakeContextCurrent, /* __glXMakeContextCurrent,*/
- __glXCreatePbuffer, /* __glXCreatePbuffer,*/
- __glXDestroyPbuffer, /* __glXDestroyPbuffer,*/
- __glXGetDrawableAttributes, /* __glXGetDrawableAttributes,*/
- __glXChangeDrawableAttributes, /* __glXChangeDrawableAttributes,*/
- __glXCreateWindow, /* __glXCreateWindow,*/
- __glXDestroyWindow, /* __glXDestroyWindow,*/
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXForwardSingleReq, /* __glXDisp_NewList, */
- __glXForwardSingleReq, /* __glXDisp_EndList, */
- __glXForwardSingleReq, /* __glXDisp_DeleteLists, */
- __glXForwardPipe0WithReply, /* __glXDisp_GenLists, */
- __glXForwardSingleReq, /* __glXDisp_FeedbackBuffer, */
- __glXForwardSingleReq, /* __glXDisp_SelectBuffer, */
- __glXForwardAllWithReply, /* __glXDisp_RenderMode, */
- __glXForwardAllWithReply, /* __glXDisp_Finish, */
- __glXForwardSingleReq, /* __glXDisp_PixelStoref, */
- __glXForwardSingleReq, /* __glXDisp_PixelStorei, */
- __glXDisp_ReadPixels, /* __glXDisp_ReadPixels, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetBooleanv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetClipPlane, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetDoublev, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetError, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetFloatv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetIntegerv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetLightfv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetLightiv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetMapdv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetMapfv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetMapiv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetMaterialfv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetMaterialiv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetPixelMapfv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetPixelMapuiv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetPixelMapusv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetPolygonStipple, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetString, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetTexEnvfv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetTexEnviv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetTexGendv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetTexGenfv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetTexGeniv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetTexImage, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetTexParameterfv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetTexParameteriv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetTexLevelParameterfv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetTexLevelParameteriv, */
- __glXForwardPipe0WithReply, /* __glXDisp_IsEnabled, */
- __glXForwardPipe0WithReply, /* __glXDisp_IsList, */
- __glXForwardSingleReq, /* __glXDisp_Flush, */
- __glXForwardPipe0WithReply, /* __glXDisp_AreTexturesResident, */
- __glXForwardSingleReq, /* __glXDisp_DeleteTextures, */
- __glXForwardAllWithReply, /* __glXDisp_GenTextures, */
- __glXForwardPipe0WithReply, /* __glXDisp_IsTexture, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetColorTable, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetColorTableParameterfv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetColorTableParameteriv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetConvolutionFilter, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetConvolutionParameterfv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetConvolutionParameteriv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetSeparableFilter, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetHistogram, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetHistogramParameterfv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetHistogramParameteriv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetMinmax, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetMinmaxParameterfv, */
- __glXForwardPipe0WithReply, /* __glXDisp_GetMinmaxParameteriv, */
+ __glXNoSuchSingleOpcode,
+ __glXRender,
+ __glXRenderLarge,
+ __glXCreateContext,
+ __glXDestroyContext,
+ __glXMakeCurrent,
+ __glXIsDirect,
+ __glXQueryVersion,
+ __glXWaitGL,
+ __glXWaitX,
+ __glXCopyContext,
+ __glXSwapBuffers,
+ __glXUseXFont,
+ __glXCreateGLXPixmap,
+ __glXGetVisualConfigs,
+ __glXDestroyGLXPixmap,
+ __glXVendorPrivate,
+ __glXVendorPrivateWithReply,
+ __glXQueryExtensionsString,
+ __glXQueryServerString,
+ __glXClientInfo,
+ __glXGetFBConfigs, /* __glXGetFBConfigs */
+ __glXCreatePixmap, /* __glXCreatePixmap, */
+ __glXDestroyGLXPixmap, /* __glXDestroyPixmap, */
+ __glXCreateNewContext, /* __glXCreateNewContext, */
+ __glXQueryContext, /* __glXQueryContext, */
+ __glXMakeContextCurrent, /* __glXMakeContextCurrent, */
+ __glXCreatePbuffer, /* __glXCreatePbuffer, */
+ __glXDestroyPbuffer, /* __glXDestroyPbuffer, */
+ __glXGetDrawableAttributes, /* __glXGetDrawableAttributes, */
+ __glXChangeDrawableAttributes, /* __glXChangeDrawableAttributes, */
+ __glXCreateWindow, /* __glXCreateWindow, */
+ __glXDestroyWindow, /* __glXDestroyWindow, */
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXForwardSingleReq, /* __glXDisp_NewList, */
+ __glXForwardSingleReq, /* __glXDisp_EndList, */
+ __glXForwardSingleReq, /* __glXDisp_DeleteLists, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GenLists, */
+ __glXForwardSingleReq, /* __glXDisp_FeedbackBuffer, */
+ __glXForwardSingleReq, /* __glXDisp_SelectBuffer, */
+ __glXForwardAllWithReply, /* __glXDisp_RenderMode, */
+ __glXForwardAllWithReply, /* __glXDisp_Finish, */
+ __glXForwardSingleReq, /* __glXDisp_PixelStoref, */
+ __glXForwardSingleReq, /* __glXDisp_PixelStorei, */
+ __glXDisp_ReadPixels, /* __glXDisp_ReadPixels, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetBooleanv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetClipPlane, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetDoublev, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetError, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetFloatv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetIntegerv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetLightfv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetLightiv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetMapdv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetMapfv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetMapiv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetMaterialfv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetMaterialiv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetPixelMapfv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetPixelMapuiv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetPixelMapusv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetPolygonStipple, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetString, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetTexEnvfv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetTexEnviv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetTexGendv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetTexGenfv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetTexGeniv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetTexImage, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetTexParameterfv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetTexParameteriv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetTexLevelParameterfv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetTexLevelParameteriv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_IsEnabled, */
+ __glXForwardPipe0WithReply, /* __glXDisp_IsList, */
+ __glXForwardSingleReq, /* __glXDisp_Flush, */
+ __glXForwardPipe0WithReply, /* __glXDisp_AreTexturesResident, */
+ __glXForwardSingleReq, /* __glXDisp_DeleteTextures, */
+ __glXForwardAllWithReply, /* __glXDisp_GenTextures, */
+ __glXForwardPipe0WithReply, /* __glXDisp_IsTexture, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetColorTable, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetColorTableParameterfv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetColorTableParameteriv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetConvolutionFilter, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetConvolutionParameterfv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetConvolutionParameteriv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetSeparableFilter, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetHistogram, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetHistogramParameterfv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetHistogramParameteriv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetMinmax, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetMinmaxParameterfv, */
+ __glXForwardPipe0WithReply, /* __glXDisp_GetMinmaxParameteriv, */
};
__GLXdispatchSingleProcPtr __glXSwapSingleTable[] = {
- __glXNoSuchSingleOpcode,
- __glXSwapRender,
- __glXSwapRenderLarge,
- __glXSwapCreateContext,
- __glXSwapDestroyContext,
- __glXSwapMakeCurrent,
- __glXSwapIsDirect,
- __glXSwapQueryVersion,
- __glXSwapWaitGL,
- __glXSwapWaitX,
- __glXSwapCopyContext,
- __glXSwapSwapBuffers,
- __glXSwapUseXFont,
- __glXSwapCreateGLXPixmap,
- __glXSwapGetVisualConfigs,
- __glXSwapDestroyGLXPixmap,
- __glXSwapVendorPrivate,
- __glXSwapVendorPrivateWithReply,
- __glXSwapQueryExtensionsString,
- __glXSwapQueryServerString,
- __glXSwapClientInfo,
- __glXSwapGetFBConfigs,
- __glXSwapCreatePixmap,
- __glXSwapDestroyGLXPixmap,
- __glXSwapCreateNewContext,
- __glXSwapQueryContext,
- __glXSwapMakeContextCurrent,
- __glXSwapCreatePbuffer,
- __glXSwapDestroyPbuffer,
- __glXSwapGetDrawableAttributes,
- __glXSwapChangeDrawableAttributes,
- __glXSwapCreateWindow,
- __glXSwapDestroyWindow,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXNoSuchSingleOpcode,
- __glXForwardSingleReqSwap, /* __glXDisp_NewList, */
- __glXForwardSingleReqSwap, /* __glXDisp_EndList, */
- __glXForwardSingleReqSwap, /* __glXDisp_DeleteLists, */
- __glXForwardPipe0WithReplySwap, /* __glXDisp_GenLists, */
- __glXForwardSingleReqSwap, /* __glXDisp_FeedbackBuffer, */
- __glXForwardSingleReqSwap, /* __glXDisp_SelectBuffer, */
- __glXForwardAllWithReplySwapiv, /* __glXDisp_RenderMode, */
- __glXForwardAllWithReplySwap, /* __glXDisp_Finish, */
- __glXForwardSingleReqSwap, /* __glXDisp_PixelStoref, */
- __glXForwardSingleReqSwap, /* __glXDisp_PixelStorei, */
- __glXDisp_ReadPixels, /* __glXDisp_ReadPixels, */
- __glXForwardPipe0WithReplySwap, /* __glXDisp_GetBooleanv, */
- __glXForwardPipe0WithReplySwapdv, /* __glXDisp_GetClipPlane, */
- __glXForwardPipe0WithReplySwapdv, /* __glXDisp_GetDoublev, */
- __glXForwardPipe0WithReplySwap, /* __glXDisp_GetError, */
- __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetFloatv, */
- __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetIntegerv, */
- __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetLightfv, */
- __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetLightiv, */
- __glXForwardPipe0WithReplySwapdv, /* __glXDisp_GetMapdv, */
- __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetMapfv, */
- __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetMapiv, */
- __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetMaterialfv, */
- __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetMaterialiv, */
- __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetPixelMapfv, */
- __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetPixelMapuiv, */
- __glXForwardPipe0WithReplySwapsv, /* __glXDisp_GetPixelMapusv, */
- __glXForwardPipe0WithReplySwap, /* __glXDisp_GetPolygonStipple, */
- __glXForwardPipe0WithReplySwap, /* __glXDisp_GetString, */
- __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetTexEnvfv, */
- __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetTexEnviv, */
- __glXForwardPipe0WithReplySwapdv, /* __glXDisp_GetTexGendv, */
- __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetTexGenfv, */
- __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetTexGeniv, */
- __glXDispSwap_GetTexImage, /* __glXDisp_GetTexImage, */
- __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetTexParameterfv, */
- __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetTexParameteriv, */
- __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetTexLevelParameterfv, */
- __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetTexLevelParameteriv, */
- __glXForwardPipe0WithReplySwap, /* __glXDisp_IsEnabled, */
- __glXForwardPipe0WithReplySwap, /* __glXDisp_IsList, */
- __glXForwardSingleReqSwap, /* __glXDisp_Flush, */
- __glXForwardPipe0WithReplySwap, /* __glXDisp_AreTexturesResident, */
- __glXForwardSingleReqSwap, /* __glXDisp_DeleteTextures, */
- __glXForwardAllWithReplySwapiv, /* __glXDisp_GenTextures, */
- __glXForwardPipe0WithReplySwap, /* __glXDisp_IsTexture, */
- __glXDispSwap_GetColorTable, /* __glXDisp_GetColorTable, */
- __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetColorTableParameterfv, */
- __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetColorTableParameteriv, */
- __glXDispSwap_GetColorTable, /* __glXDisp_GetConvolutionFilter, */
- __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetConvolutionParameterfv, */
- __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetConvolutionParameteriv, */
- __glXDispSwap_GetColorTable, /* __glXDisp_GetSeparableFilter, */
- __glXDispSwap_GetColorTable, /* __glXDisp_GetHistogram, */
- __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetHistogramParameterfv, */
- __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetHistogramParameteriv, */
- __glXDispSwap_GetColorTable, /* __glXDisp_GetMinmax, */
- __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetMinmaxParameterfv, */
- __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetMinmaxParameteriv, */
+ __glXNoSuchSingleOpcode,
+ __glXSwapRender,
+ __glXSwapRenderLarge,
+ __glXSwapCreateContext,
+ __glXSwapDestroyContext,
+ __glXSwapMakeCurrent,
+ __glXSwapIsDirect,
+ __glXSwapQueryVersion,
+ __glXSwapWaitGL,
+ __glXSwapWaitX,
+ __glXSwapCopyContext,
+ __glXSwapSwapBuffers,
+ __glXSwapUseXFont,
+ __glXSwapCreateGLXPixmap,
+ __glXSwapGetVisualConfigs,
+ __glXSwapDestroyGLXPixmap,
+ __glXSwapVendorPrivate,
+ __glXSwapVendorPrivateWithReply,
+ __glXSwapQueryExtensionsString,
+ __glXSwapQueryServerString,
+ __glXSwapClientInfo,
+ __glXSwapGetFBConfigs,
+ __glXSwapCreatePixmap,
+ __glXSwapDestroyGLXPixmap,
+ __glXSwapCreateNewContext,
+ __glXSwapQueryContext,
+ __glXSwapMakeContextCurrent,
+ __glXSwapCreatePbuffer,
+ __glXSwapDestroyPbuffer,
+ __glXSwapGetDrawableAttributes,
+ __glXSwapChangeDrawableAttributes,
+ __glXSwapCreateWindow,
+ __glXSwapDestroyWindow,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXNoSuchSingleOpcode,
+ __glXForwardSingleReqSwap, /* __glXDisp_NewList, */
+ __glXForwardSingleReqSwap, /* __glXDisp_EndList, */
+ __glXForwardSingleReqSwap, /* __glXDisp_DeleteLists, */
+ __glXForwardPipe0WithReplySwap, /* __glXDisp_GenLists, */
+ __glXForwardSingleReqSwap, /* __glXDisp_FeedbackBuffer, */
+ __glXForwardSingleReqSwap, /* __glXDisp_SelectBuffer, */
+ __glXForwardAllWithReplySwapiv, /* __glXDisp_RenderMode, */
+ __glXForwardAllWithReplySwap, /* __glXDisp_Finish, */
+ __glXForwardSingleReqSwap, /* __glXDisp_PixelStoref, */
+ __glXForwardSingleReqSwap, /* __glXDisp_PixelStorei, */
+ __glXDisp_ReadPixels, /* __glXDisp_ReadPixels, */
+ __glXForwardPipe0WithReplySwap, /* __glXDisp_GetBooleanv, */
+ __glXForwardPipe0WithReplySwapdv, /* __glXDisp_GetClipPlane, */
+ __glXForwardPipe0WithReplySwapdv, /* __glXDisp_GetDoublev, */
+ __glXForwardPipe0WithReplySwap, /* __glXDisp_GetError, */
+ __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetFloatv, */
+ __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetIntegerv, */
+ __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetLightfv, */
+ __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetLightiv, */
+ __glXForwardPipe0WithReplySwapdv, /* __glXDisp_GetMapdv, */
+ __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetMapfv, */
+ __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetMapiv, */
+ __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetMaterialfv, */
+ __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetMaterialiv, */
+ __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetPixelMapfv, */
+ __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetPixelMapuiv, */
+ __glXForwardPipe0WithReplySwapsv, /* __glXDisp_GetPixelMapusv, */
+ __glXForwardPipe0WithReplySwap, /* __glXDisp_GetPolygonStipple, */
+ __glXForwardPipe0WithReplySwap, /* __glXDisp_GetString, */
+ __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetTexEnvfv, */
+ __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetTexEnviv, */
+ __glXForwardPipe0WithReplySwapdv, /* __glXDisp_GetTexGendv, */
+ __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetTexGenfv, */
+ __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetTexGeniv, */
+ __glXDispSwap_GetTexImage, /* __glXDisp_GetTexImage, */
+ __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetTexParameterfv, */
+ __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetTexParameteriv, */
+ __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetTexLevelParameterfv, */
+ __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetTexLevelParameteriv, */
+ __glXForwardPipe0WithReplySwap, /* __glXDisp_IsEnabled, */
+ __glXForwardPipe0WithReplySwap, /* __glXDisp_IsList, */
+ __glXForwardSingleReqSwap, /* __glXDisp_Flush, */
+ __glXForwardPipe0WithReplySwap, /* __glXDisp_AreTexturesResident, */
+ __glXForwardSingleReqSwap, /* __glXDisp_DeleteTextures, */
+ __glXForwardAllWithReplySwapiv, /* __glXDisp_GenTextures, */
+ __glXForwardPipe0WithReplySwap, /* __glXDisp_IsTexture, */
+ __glXDispSwap_GetColorTable, /* __glXDisp_GetColorTable, */
+ __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetColorTableParameterfv, */
+ __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetColorTableParameteriv, */
+ __glXDispSwap_GetColorTable, /* __glXDisp_GetConvolutionFilter, */
+ __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetConvolutionParameterfv, */
+ __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetConvolutionParameteriv, */
+ __glXDispSwap_GetColorTable, /* __glXDisp_GetSeparableFilter, */
+ __glXDispSwap_GetColorTable, /* __glXDisp_GetHistogram, */
+ __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetHistogramParameterfv, */
+ __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetHistogramParameteriv, */
+ __glXDispSwap_GetColorTable, /* __glXDisp_GetMinmax, */
+ __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetMinmaxParameterfv, */
+ __glXForwardPipe0WithReplySwapiv, /* __glXDisp_GetMinmaxParameteriv, */
};
__GLXdispatchRenderProcPtr __glXSwapRenderTable[] = {
- __glXNoSuchRenderOpcode,
- __glXDispSwap_CallList,
- __glXDispSwap_CallLists,
- __glXDispSwap_ListBase,
- __glXDispSwap_Begin,
- __glXDispSwap_Bitmap,
- __glXDispSwap_Color3bv,
- __glXDispSwap_Color3dv,
- __glXDispSwap_Color3fv,
- __glXDispSwap_Color3iv,
- __glXDispSwap_Color3sv,
- __glXDispSwap_Color3ubv,
- __glXDispSwap_Color3uiv,
- __glXDispSwap_Color3usv,
- __glXDispSwap_Color4bv,
- __glXDispSwap_Color4dv,
- __glXDispSwap_Color4fv,
- __glXDispSwap_Color4iv,
- __glXDispSwap_Color4sv,
- __glXDispSwap_Color4ubv,
- __glXDispSwap_Color4uiv,
- __glXDispSwap_Color4usv,
- __glXDispSwap_EdgeFlagv,
- __glXDispSwap_End,
- __glXDispSwap_Indexdv,
- __glXDispSwap_Indexfv,
- __glXDispSwap_Indexiv,
- __glXDispSwap_Indexsv,
- __glXDispSwap_Normal3bv,
- __glXDispSwap_Normal3dv,
- __glXDispSwap_Normal3fv,
- __glXDispSwap_Normal3iv,
- __glXDispSwap_Normal3sv,
- __glXDispSwap_RasterPos2dv,
- __glXDispSwap_RasterPos2fv,
- __glXDispSwap_RasterPos2iv,
- __glXDispSwap_RasterPos2sv,
- __glXDispSwap_RasterPos3dv,
- __glXDispSwap_RasterPos3fv,
- __glXDispSwap_RasterPos3iv,
- __glXDispSwap_RasterPos3sv,
- __glXDispSwap_RasterPos4dv,
- __glXDispSwap_RasterPos4fv,
- __glXDispSwap_RasterPos4iv,
- __glXDispSwap_RasterPos4sv,
- __glXDispSwap_Rectdv,
- __glXDispSwap_Rectfv,
- __glXDispSwap_Rectiv,
- __glXDispSwap_Rectsv,
- __glXDispSwap_TexCoord1dv,
- __glXDispSwap_TexCoord1fv,
- __glXDispSwap_TexCoord1iv,
- __glXDispSwap_TexCoord1sv,
- __glXDispSwap_TexCoord2dv,
- __glXDispSwap_TexCoord2fv,
- __glXDispSwap_TexCoord2iv,
- __glXDispSwap_TexCoord2sv,
- __glXDispSwap_TexCoord3dv,
- __glXDispSwap_TexCoord3fv,
- __glXDispSwap_TexCoord3iv,
- __glXDispSwap_TexCoord3sv,
- __glXDispSwap_TexCoord4dv,
- __glXDispSwap_TexCoord4fv,
- __glXDispSwap_TexCoord4iv,
- __glXDispSwap_TexCoord4sv,
- __glXDispSwap_Vertex2dv,
- __glXDispSwap_Vertex2fv,
- __glXDispSwap_Vertex2iv,
- __glXDispSwap_Vertex2sv,
- __glXDispSwap_Vertex3dv,
- __glXDispSwap_Vertex3fv,
- __glXDispSwap_Vertex3iv,
- __glXDispSwap_Vertex3sv,
- __glXDispSwap_Vertex4dv,
- __glXDispSwap_Vertex4fv,
- __glXDispSwap_Vertex4iv,
- __glXDispSwap_Vertex4sv,
- __glXDispSwap_ClipPlane,
- __glXDispSwap_ColorMaterial,
- __glXDispSwap_CullFace,
- __glXDispSwap_Fogf,
- __glXDispSwap_Fogfv,
- __glXDispSwap_Fogi,
- __glXDispSwap_Fogiv,
- __glXDispSwap_FrontFace,
- __glXDispSwap_Hint,
- __glXDispSwap_Lightf,
- __glXDispSwap_Lightfv,
- __glXDispSwap_Lighti,
- __glXDispSwap_Lightiv,
- __glXDispSwap_LightModelf,
- __glXDispSwap_LightModelfv,
- __glXDispSwap_LightModeli,
- __glXDispSwap_LightModeliv,
- __glXDispSwap_LineStipple,
- __glXDispSwap_LineWidth,
- __glXDispSwap_Materialf,
- __glXDispSwap_Materialfv,
- __glXDispSwap_Materiali,
- __glXDispSwap_Materialiv,
- __glXDispSwap_PointSize,
- __glXDispSwap_PolygonMode,
- __glXDispSwap_PolygonStipple,
- __glXDispSwap_Scissor,
- __glXDispSwap_ShadeModel,
- __glXDispSwap_TexParameterf,
- __glXDispSwap_TexParameterfv,
- __glXDispSwap_TexParameteri,
- __glXDispSwap_TexParameteriv,
- __glXDispSwap_TexImage1D,
- __glXDispSwap_TexImage2D,
- __glXDispSwap_TexEnvf,
- __glXDispSwap_TexEnvfv,
- __glXDispSwap_TexEnvi,
- __glXDispSwap_TexEnviv,
- __glXDispSwap_TexGend,
- __glXDispSwap_TexGendv,
- __glXDispSwap_TexGenf,
- __glXDispSwap_TexGenfv,
- __glXDispSwap_TexGeni,
- __glXDispSwap_TexGeniv,
- __glXDispSwap_InitNames,
- __glXDispSwap_LoadName,
- __glXDispSwap_PassThrough,
- __glXDispSwap_PopName,
- __glXDispSwap_PushName,
- __glXDispSwap_DrawBuffer,
- __glXDispSwap_Clear,
- __glXDispSwap_ClearAccum,
- __glXDispSwap_ClearIndex,
- __glXDispSwap_ClearColor,
- __glXDispSwap_ClearStencil,
- __glXDispSwap_ClearDepth,
- __glXDispSwap_StencilMask,
- __glXDispSwap_ColorMask,
- __glXDispSwap_DepthMask,
- __glXDispSwap_IndexMask,
- __glXDispSwap_Accum,
- __glXDispSwap_Disable,
- __glXDispSwap_Enable,
- __glXNoSuchRenderOpcode,
- __glXDispSwap_PopAttrib,
- __glXDispSwap_PushAttrib,
- __glXDispSwap_Map1d,
- __glXDispSwap_Map1f,
- __glXDispSwap_Map2d,
- __glXDispSwap_Map2f,
- __glXDispSwap_MapGrid1d,
- __glXDispSwap_MapGrid1f,
- __glXDispSwap_MapGrid2d,
- __glXDispSwap_MapGrid2f,
- __glXDispSwap_EvalCoord1dv,
- __glXDispSwap_EvalCoord1fv,
- __glXDispSwap_EvalCoord2dv,
- __glXDispSwap_EvalCoord2fv,
- __glXDispSwap_EvalMesh1,
- __glXDispSwap_EvalPoint1,
- __glXDispSwap_EvalMesh2,
- __glXDispSwap_EvalPoint2,
- __glXDispSwap_AlphaFunc,
- __glXDispSwap_BlendFunc,
- __glXDispSwap_LogicOp,
- __glXDispSwap_StencilFunc,
- __glXDispSwap_StencilOp,
- __glXDispSwap_DepthFunc,
- __glXDispSwap_PixelZoom,
- __glXDispSwap_PixelTransferf,
- __glXDispSwap_PixelTransferi,
- __glXDispSwap_PixelMapfv,
- __glXDispSwap_PixelMapuiv,
- __glXDispSwap_PixelMapusv,
- __glXDispSwap_ReadBuffer,
- __glXDispSwap_CopyPixels,
- __glXDispSwap_DrawPixels,
- __glXDispSwap_DepthRange,
- __glXDispSwap_Frustum,
- __glXDispSwap_LoadIdentity,
- __glXDispSwap_LoadMatrixf,
- __glXDispSwap_LoadMatrixd,
- __glXDispSwap_MatrixMode,
- __glXDispSwap_MultMatrixf,
- __glXDispSwap_MultMatrixd,
- __glXDispSwap_Ortho,
- __glXDispSwap_PopMatrix,
- __glXDispSwap_PushMatrix,
- __glXDispSwap_Rotated,
- __glXDispSwap_Rotatef,
- __glXDispSwap_Scaled,
- __glXDispSwap_Scalef,
- __glXDispSwap_Translated,
- __glXDispSwap_Translatef,
- __glXDispSwap_Viewport,
- __glXDispSwap_PolygonOffset,
- __glXDispSwap_DrawArrays,
- __glXDispSwap_Indexubv,
- __glXDispSwap_ColorSubTable,
- __glXDispSwap_CopyColorSubTable,
- __glXDispSwap_ActiveTextureARB,
- __glXDispSwap_MultiTexCoord1dvARB,
- __glXDispSwap_MultiTexCoord1fvARB,
- __glXDispSwap_MultiTexCoord1ivARB,
- __glXDispSwap_MultiTexCoord1svARB,
- __glXDispSwap_MultiTexCoord2dvARB,
- __glXDispSwap_MultiTexCoord2fvARB,
- __glXDispSwap_MultiTexCoord2ivARB,
- __glXDispSwap_MultiTexCoord2svARB,
- __glXDispSwap_MultiTexCoord3dvARB,
- __glXDispSwap_MultiTexCoord3fvARB,
- __glXDispSwap_MultiTexCoord3ivARB,
- __glXDispSwap_MultiTexCoord3svARB,
- __glXDispSwap_MultiTexCoord4dvARB,
- __glXDispSwap_MultiTexCoord4fvARB,
- __glXDispSwap_MultiTexCoord4ivARB,
- __glXDispSwap_MultiTexCoord4svARB,
+ __glXNoSuchRenderOpcode,
+ __glXDispSwap_CallList,
+ __glXDispSwap_CallLists,
+ __glXDispSwap_ListBase,
+ __glXDispSwap_Begin,
+ __glXDispSwap_Bitmap,
+ __glXDispSwap_Color3bv,
+ __glXDispSwap_Color3dv,
+ __glXDispSwap_Color3fv,
+ __glXDispSwap_Color3iv,
+ __glXDispSwap_Color3sv,
+ __glXDispSwap_Color3ubv,
+ __glXDispSwap_Color3uiv,
+ __glXDispSwap_Color3usv,
+ __glXDispSwap_Color4bv,
+ __glXDispSwap_Color4dv,
+ __glXDispSwap_Color4fv,
+ __glXDispSwap_Color4iv,
+ __glXDispSwap_Color4sv,
+ __glXDispSwap_Color4ubv,
+ __glXDispSwap_Color4uiv,
+ __glXDispSwap_Color4usv,
+ __glXDispSwap_EdgeFlagv,
+ __glXDispSwap_End,
+ __glXDispSwap_Indexdv,
+ __glXDispSwap_Indexfv,
+ __glXDispSwap_Indexiv,
+ __glXDispSwap_Indexsv,
+ __glXDispSwap_Normal3bv,
+ __glXDispSwap_Normal3dv,
+ __glXDispSwap_Normal3fv,
+ __glXDispSwap_Normal3iv,
+ __glXDispSwap_Normal3sv,
+ __glXDispSwap_RasterPos2dv,
+ __glXDispSwap_RasterPos2fv,
+ __glXDispSwap_RasterPos2iv,
+ __glXDispSwap_RasterPos2sv,
+ __glXDispSwap_RasterPos3dv,
+ __glXDispSwap_RasterPos3fv,
+ __glXDispSwap_RasterPos3iv,
+ __glXDispSwap_RasterPos3sv,
+ __glXDispSwap_RasterPos4dv,
+ __glXDispSwap_RasterPos4fv,
+ __glXDispSwap_RasterPos4iv,
+ __glXDispSwap_RasterPos4sv,
+ __glXDispSwap_Rectdv,
+ __glXDispSwap_Rectfv,
+ __glXDispSwap_Rectiv,
+ __glXDispSwap_Rectsv,
+ __glXDispSwap_TexCoord1dv,
+ __glXDispSwap_TexCoord1fv,
+ __glXDispSwap_TexCoord1iv,
+ __glXDispSwap_TexCoord1sv,
+ __glXDispSwap_TexCoord2dv,
+ __glXDispSwap_TexCoord2fv,
+ __glXDispSwap_TexCoord2iv,
+ __glXDispSwap_TexCoord2sv,
+ __glXDispSwap_TexCoord3dv,
+ __glXDispSwap_TexCoord3fv,
+ __glXDispSwap_TexCoord3iv,
+ __glXDispSwap_TexCoord3sv,
+ __glXDispSwap_TexCoord4dv,
+ __glXDispSwap_TexCoord4fv,
+ __glXDispSwap_TexCoord4iv,
+ __glXDispSwap_TexCoord4sv,
+ __glXDispSwap_Vertex2dv,
+ __glXDispSwap_Vertex2fv,
+ __glXDispSwap_Vertex2iv,
+ __glXDispSwap_Vertex2sv,
+ __glXDispSwap_Vertex3dv,
+ __glXDispSwap_Vertex3fv,
+ __glXDispSwap_Vertex3iv,
+ __glXDispSwap_Vertex3sv,
+ __glXDispSwap_Vertex4dv,
+ __glXDispSwap_Vertex4fv,
+ __glXDispSwap_Vertex4iv,
+ __glXDispSwap_Vertex4sv,
+ __glXDispSwap_ClipPlane,
+ __glXDispSwap_ColorMaterial,
+ __glXDispSwap_CullFace,
+ __glXDispSwap_Fogf,
+ __glXDispSwap_Fogfv,
+ __glXDispSwap_Fogi,
+ __glXDispSwap_Fogiv,
+ __glXDispSwap_FrontFace,
+ __glXDispSwap_Hint,
+ __glXDispSwap_Lightf,
+ __glXDispSwap_Lightfv,
+ __glXDispSwap_Lighti,
+ __glXDispSwap_Lightiv,
+ __glXDispSwap_LightModelf,
+ __glXDispSwap_LightModelfv,
+ __glXDispSwap_LightModeli,
+ __glXDispSwap_LightModeliv,
+ __glXDispSwap_LineStipple,
+ __glXDispSwap_LineWidth,
+ __glXDispSwap_Materialf,
+ __glXDispSwap_Materialfv,
+ __glXDispSwap_Materiali,
+ __glXDispSwap_Materialiv,
+ __glXDispSwap_PointSize,
+ __glXDispSwap_PolygonMode,
+ __glXDispSwap_PolygonStipple,
+ __glXDispSwap_Scissor,
+ __glXDispSwap_ShadeModel,
+ __glXDispSwap_TexParameterf,
+ __glXDispSwap_TexParameterfv,
+ __glXDispSwap_TexParameteri,
+ __glXDispSwap_TexParameteriv,
+ __glXDispSwap_TexImage1D,
+ __glXDispSwap_TexImage2D,
+ __glXDispSwap_TexEnvf,
+ __glXDispSwap_TexEnvfv,
+ __glXDispSwap_TexEnvi,
+ __glXDispSwap_TexEnviv,
+ __glXDispSwap_TexGend,
+ __glXDispSwap_TexGendv,
+ __glXDispSwap_TexGenf,
+ __glXDispSwap_TexGenfv,
+ __glXDispSwap_TexGeni,
+ __glXDispSwap_TexGeniv,
+ __glXDispSwap_InitNames,
+ __glXDispSwap_LoadName,
+ __glXDispSwap_PassThrough,
+ __glXDispSwap_PopName,
+ __glXDispSwap_PushName,
+ __glXDispSwap_DrawBuffer,
+ __glXDispSwap_Clear,
+ __glXDispSwap_ClearAccum,
+ __glXDispSwap_ClearIndex,
+ __glXDispSwap_ClearColor,
+ __glXDispSwap_ClearStencil,
+ __glXDispSwap_ClearDepth,
+ __glXDispSwap_StencilMask,
+ __glXDispSwap_ColorMask,
+ __glXDispSwap_DepthMask,
+ __glXDispSwap_IndexMask,
+ __glXDispSwap_Accum,
+ __glXDispSwap_Disable,
+ __glXDispSwap_Enable,
+ __glXNoSuchRenderOpcode,
+ __glXDispSwap_PopAttrib,
+ __glXDispSwap_PushAttrib,
+ __glXDispSwap_Map1d,
+ __glXDispSwap_Map1f,
+ __glXDispSwap_Map2d,
+ __glXDispSwap_Map2f,
+ __glXDispSwap_MapGrid1d,
+ __glXDispSwap_MapGrid1f,
+ __glXDispSwap_MapGrid2d,
+ __glXDispSwap_MapGrid2f,
+ __glXDispSwap_EvalCoord1dv,
+ __glXDispSwap_EvalCoord1fv,
+ __glXDispSwap_EvalCoord2dv,
+ __glXDispSwap_EvalCoord2fv,
+ __glXDispSwap_EvalMesh1,
+ __glXDispSwap_EvalPoint1,
+ __glXDispSwap_EvalMesh2,
+ __glXDispSwap_EvalPoint2,
+ __glXDispSwap_AlphaFunc,
+ __glXDispSwap_BlendFunc,
+ __glXDispSwap_LogicOp,
+ __glXDispSwap_StencilFunc,
+ __glXDispSwap_StencilOp,
+ __glXDispSwap_DepthFunc,
+ __glXDispSwap_PixelZoom,
+ __glXDispSwap_PixelTransferf,
+ __glXDispSwap_PixelTransferi,
+ __glXDispSwap_PixelMapfv,
+ __glXDispSwap_PixelMapuiv,
+ __glXDispSwap_PixelMapusv,
+ __glXDispSwap_ReadBuffer,
+ __glXDispSwap_CopyPixels,
+ __glXDispSwap_DrawPixels,
+ __glXDispSwap_DepthRange,
+ __glXDispSwap_Frustum,
+ __glXDispSwap_LoadIdentity,
+ __glXDispSwap_LoadMatrixf,
+ __glXDispSwap_LoadMatrixd,
+ __glXDispSwap_MatrixMode,
+ __glXDispSwap_MultMatrixf,
+ __glXDispSwap_MultMatrixd,
+ __glXDispSwap_Ortho,
+ __glXDispSwap_PopMatrix,
+ __glXDispSwap_PushMatrix,
+ __glXDispSwap_Rotated,
+ __glXDispSwap_Rotatef,
+ __glXDispSwap_Scaled,
+ __glXDispSwap_Scalef,
+ __glXDispSwap_Translated,
+ __glXDispSwap_Translatef,
+ __glXDispSwap_Viewport,
+ __glXDispSwap_PolygonOffset,
+ __glXDispSwap_DrawArrays,
+ __glXDispSwap_Indexubv,
+ __glXDispSwap_ColorSubTable,
+ __glXDispSwap_CopyColorSubTable,
+ __glXDispSwap_ActiveTextureARB,
+ __glXDispSwap_MultiTexCoord1dvARB,
+ __glXDispSwap_MultiTexCoord1fvARB,
+ __glXDispSwap_MultiTexCoord1ivARB,
+ __glXDispSwap_MultiTexCoord1svARB,
+ __glXDispSwap_MultiTexCoord2dvARB,
+ __glXDispSwap_MultiTexCoord2fvARB,
+ __glXDispSwap_MultiTexCoord2ivARB,
+ __glXDispSwap_MultiTexCoord2svARB,
+ __glXDispSwap_MultiTexCoord3dvARB,
+ __glXDispSwap_MultiTexCoord3fvARB,
+ __glXDispSwap_MultiTexCoord3ivARB,
+ __glXDispSwap_MultiTexCoord3svARB,
+ __glXDispSwap_MultiTexCoord4dvARB,
+ __glXDispSwap_MultiTexCoord4fvARB,
+ __glXDispSwap_MultiTexCoord4ivARB,
+ __glXDispSwap_MultiTexCoord4svARB,
};
-__GLXRenderSwapInfo __glXSwapRenderTable_EXT[] =
-{
- {4, 4, NULL}, /* X_GLrop_BlendColorEXT */
- {4, 1, NULL}, /* X_GLrop_BlendEquationEXT */
- {4, 2, NULL}, /* X_GLrop_PolygonOffsetEXT */
- {4, 0, __glXDispSwap_TexSubImage1D}, /* X_GLrop_TexSubImage1DEXT */
- {4, 0, __glXDispSwap_TexSubImage2D}, /* X_GLrop_TexSubImage2DEXT */
- {4, 0, __glXDispSwap_ConvolutionFilter1D}, /* X_GLrop_ConvolutionFilter1DEXT */
- {4, 0, __glXDispSwap_ConvolutionFilter2D}, /* X_GLrop_ConvolutionFilter2DEXT */
- {4, 3, NULL}, /* X_GLrop_ConvolutionParameterfEXT */
- {4, 0, __glXDispSwap_ConvolutionParameterfv}, /* X_GLrop_ConvolutionParameterfvEXT */
- {4, 3, NULL}, /* X_GLrop_ConvolutionParameteriEXT */
- {4, 0, __glXDispSwap_ConvolutionParameteriv}, /* X_GLrop_ConvolutionParameterivEXT */
- {4, 0, __glXDispSwap_CopyConvolutionFilter1D}, /* X_GLrop_CopyConvolutionFilter1DEXT */
- {4, 0, __glXDispSwap_CopyConvolutionFilter2D}, /* X_GLrop_CopyConvolutionFilter2DEXT */
- {4, 0, __glXDispSwap_SeparableFilter2D}, /* X_GLrop_SeparableFilter2DEXT */
- {4, 3, NULL}, /* X_GLrop_HistogramEXT */
- {4, 2, NULL}, /* X_GLrop_MinmaxEXT */
- {4, 1, NULL}, /* X_GLrop_ResetHistogramEXT */
- {4, 1, NULL}, /* X_GLrop_ResetMinmaxEXT */
- {4, 0, __glXDispSwap_TexImage3D}, /* X_GLrop_TexImage3DEXT */
- {4, 0, __glXDispSwap_TexSubImage3D}, /* X_GLrop_TexSubImage3DEXT */
- {4, 0, __glXDispSwap_DrawArrays}, /* X_GLrop_DrawArraysEXT */
- {4, 2, NULL}, /* X_GLrop_BindTextureEXT */
- {4, 0, __glXDispSwap_PrioritizeTextures}, /* X_GLrop_PrioritizeTexturesEXT */
- {4, 0, __glXDispSwap_CopyTexImage1D}, /* X_GLrop_CopyTexImage1DEXT */
- {4, 0, __glXDispSwap_CopyTexImage2D}, /* X_GLrop_CopyTexImage2DEXT */
- {4, 0, __glXDispSwap_CopyTexSubImage1D}, /* X_GLrop_CopyTexSubImage1DEXT */
- {4, 0, __glXDispSwap_CopyTexSubImage2D}, /* X_GLrop_CopyTexSubImage2DEXT */
- {4, 0, __glXDispSwap_CopyTexSubImage3D}, /* X_GLrop_CopyTexSubImage3DEXT */
+__GLXRenderSwapInfo __glXSwapRenderTable_EXT[] = {
+ {4, 4, NULL}, /* X_GLrop_BlendColorEXT */
+ {4, 1, NULL}, /* X_GLrop_BlendEquationEXT */
+ {4, 2, NULL}, /* X_GLrop_PolygonOffsetEXT */
+ {4, 0, __glXDispSwap_TexSubImage1D}, /* X_GLrop_TexSubImage1DEXT */
+ {4, 0, __glXDispSwap_TexSubImage2D}, /* X_GLrop_TexSubImage2DEXT */
+ {4, 0, __glXDispSwap_ConvolutionFilter1D}, /* X_GLrop_ConvolutionFilter1DEXT */
+ {4, 0, __glXDispSwap_ConvolutionFilter2D}, /* X_GLrop_ConvolutionFilter2DEXT */
+ {4, 3, NULL}, /* X_GLrop_ConvolutionParameterfEXT */
+ {4, 0, __glXDispSwap_ConvolutionParameterfv}, /* X_GLrop_ConvolutionParameterfvEXT */
+ {4, 3, NULL}, /* X_GLrop_ConvolutionParameteriEXT */
+ {4, 0, __glXDispSwap_ConvolutionParameteriv}, /* X_GLrop_ConvolutionParameterivEXT */
+ {4, 0, __glXDispSwap_CopyConvolutionFilter1D}, /* X_GLrop_CopyConvolutionFilter1DEXT */
+ {4, 0, __glXDispSwap_CopyConvolutionFilter2D}, /* X_GLrop_CopyConvolutionFilter2DEXT */
+ {4, 0, __glXDispSwap_SeparableFilter2D}, /* X_GLrop_SeparableFilter2DEXT */
+ {4, 3, NULL}, /* X_GLrop_HistogramEXT */
+ {4, 2, NULL}, /* X_GLrop_MinmaxEXT */
+ {4, 1, NULL}, /* X_GLrop_ResetHistogramEXT */
+ {4, 1, NULL}, /* X_GLrop_ResetMinmaxEXT */
+ {4, 0, __glXDispSwap_TexImage3D}, /* X_GLrop_TexImage3DEXT */
+ {4, 0, __glXDispSwap_TexSubImage3D}, /* X_GLrop_TexSubImage3DEXT */
+ {4, 0, __glXDispSwap_DrawArrays}, /* X_GLrop_DrawArraysEXT */
+ {4, 2, NULL}, /* X_GLrop_BindTextureEXT */
+ {4, 0, __glXDispSwap_PrioritizeTextures}, /* X_GLrop_PrioritizeTexturesEXT */
+ {4, 0, __glXDispSwap_CopyTexImage1D}, /* X_GLrop_CopyTexImage1DEXT */
+ {4, 0, __glXDispSwap_CopyTexImage2D}, /* X_GLrop_CopyTexImage2DEXT */
+ {4, 0, __glXDispSwap_CopyTexSubImage1D}, /* X_GLrop_CopyTexSubImage1DEXT */
+ {4, 0, __glXDispSwap_CopyTexSubImage2D}, /* X_GLrop_CopyTexSubImage2DEXT */
+ {4, 0, __glXDispSwap_CopyTexSubImage3D}, /* X_GLrop_CopyTexSubImage3DEXT */
};
-
diff --git a/hw/dmx/glxProxy/g_disptab.h b/hw/dmx/glxProxy/g_disptab.h
index c497c88e5..530338798 100644
--- a/hw/dmx/glxProxy/g_disptab.h
+++ b/hw/dmx/glxProxy/g_disptab.h
@@ -31,633 +31,637 @@
* Silicon Graphics, Inc.
*/
-extern int __glXRender(__GLXclientState*, GLbyte*);
-extern int __glXRenderLarge(__GLXclientState*, GLbyte*);
-extern int __glXSendLargeCommand(__GLXclientState *cl, GLXContextTag contextTag);
-extern int __glXCreateContext(__GLXclientState*, GLbyte*);
-extern int __glXCreateNewContext(__GLXclientState *cl, GLbyte *pc);
-extern int __glXDestroyContext(__GLXclientState*, GLbyte*);
-extern int __glXMakeCurrent(__GLXclientState*, GLbyte*);
-extern int __glXMakeContextCurrent(__GLXclientState*, GLbyte*);
-extern int __glXCreatePbuffer(__GLXclientState *cl, GLbyte *pc);
-extern int __glXDestroyPbuffer(__GLXclientState *cl, GLbyte *pc);
-extern int __glXGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc);
-extern int __glXChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc);
-extern int __glXIsDirect(__GLXclientState*, GLbyte*);
-extern int __glXQueryVersion(__GLXclientState*, GLbyte*);
-extern int __glXWaitGL(__GLXclientState*, GLbyte*);
-extern int __glXWaitX(__GLXclientState*, GLbyte*);
-extern int __glXCopyContext(__GLXclientState*, GLbyte*);
-extern int __glXSwapBuffers(__GLXclientState*, GLbyte*);
-extern int __glXUseXFont(__GLXclientState*, GLbyte*);
-extern int __glXCreateGLXPixmap(__GLXclientState*, GLbyte*);
-extern int __glXCreatePixmap(__GLXclientState *cl, GLbyte *pc);
-extern int __glXGetVisualConfigs(__GLXclientState*, GLbyte*);
-extern int __glXDestroyGLXPixmap(__GLXclientState*, GLbyte*);
-extern int __glXVendorPrivate(__GLXclientState*, GLbyte*);
-extern int __glXVendorPrivateWithReply(__GLXclientState*, GLbyte*);
-extern int __glXQueryExtensionsString(__GLXclientState*, GLbyte*);
-extern int __glXQueryServerString(__GLXclientState*, GLbyte*);
-extern int __glXClientInfo(__GLXclientState*, GLbyte*);
-extern int __glXGetFBConfigs(__GLXclientState*, GLbyte*);
-extern int __glXCreateWindow(__GLXclientState *cl, GLbyte *pc);
-extern int __glXDestroyWindow(__GLXclientState *cl, GLbyte *pc);
-extern int __glXQueryContext(__GLXclientState *cl, GLbyte *pc);
-extern int __glXDisp_NewList(__GLXclientState*, GLbyte*);
-extern int __glXDisp_EndList(__GLXclientState*, GLbyte*);
-extern int __glXDisp_DeleteLists(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GenLists(__GLXclientState*, GLbyte*);
-extern int __glXDisp_FeedbackBuffer(__GLXclientState*, GLbyte*);
-extern int __glXDisp_SelectBuffer(__GLXclientState*, GLbyte*);
-extern int __glXDisp_RenderMode(__GLXclientState*, GLbyte*);
-extern int __glXDisp_Finish(__GLXclientState*, GLbyte*);
-extern int __glXDisp_PixelStoref(__GLXclientState*, GLbyte*);
-extern int __glXDisp_PixelStorei(__GLXclientState*, GLbyte*);
-extern int __glXDisp_ReadPixels(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetBooleanv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetClipPlane(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetDoublev(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetError(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetFloatv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetIntegerv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetLightfv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetLightiv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetMapdv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetMapfv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetMapiv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetMaterialfv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetMaterialiv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetPixelMapfv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetPixelMapuiv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetPixelMapusv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetPolygonStipple(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetString(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetTexEnvfv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetTexEnviv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetTexGendv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetTexGenfv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetTexGeniv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetTexImage(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetTexParameterfv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetTexParameteriv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetTexLevelParameterfv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetTexLevelParameteriv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_IsEnabled(__GLXclientState*, GLbyte*);
-extern int __glXDisp_IsList(__GLXclientState*, GLbyte*);
-extern int __glXDisp_Flush(__GLXclientState*, GLbyte*);
-extern int __glXDisp_AreTexturesResident(__GLXclientState*, GLbyte*);
-extern int __glXDisp_DeleteTextures(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GenTextures(__GLXclientState*, GLbyte*);
-extern int __glXDisp_IsTexture(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetColorTable(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetColorTableParameterfv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetColorTableParameteriv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetConvolutionFilter(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetConvolutionParameterfv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetConvolutionParameteriv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetSeparableFilter(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetHistogram(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetHistogramParameterfv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetHistogramParameteriv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetMinmax(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetMinmaxParameterfv(__GLXclientState*, GLbyte*);
-extern int __glXDisp_GetMinmaxParameteriv(__GLXclientState*, GLbyte*);
+extern int __glXRender(__GLXclientState *, GLbyte *);
+extern int __glXRenderLarge(__GLXclientState *, GLbyte *);
+extern int __glXSendLargeCommand(__GLXclientState * cl,
+ GLXContextTag contextTag);
+extern int __glXCreateContext(__GLXclientState *, GLbyte *);
+extern int __glXCreateNewContext(__GLXclientState * cl, GLbyte * pc);
+extern int __glXDestroyContext(__GLXclientState *, GLbyte *);
+extern int __glXMakeCurrent(__GLXclientState *, GLbyte *);
+extern int __glXMakeContextCurrent(__GLXclientState *, GLbyte *);
+extern int __glXCreatePbuffer(__GLXclientState * cl, GLbyte * pc);
+extern int __glXDestroyPbuffer(__GLXclientState * cl, GLbyte * pc);
+extern int __glXGetDrawableAttributes(__GLXclientState * cl, GLbyte * pc);
+extern int __glXChangeDrawableAttributes(__GLXclientState * cl, GLbyte * pc);
+extern int __glXIsDirect(__GLXclientState *, GLbyte *);
+extern int __glXQueryVersion(__GLXclientState *, GLbyte *);
+extern int __glXWaitGL(__GLXclientState *, GLbyte *);
+extern int __glXWaitX(__GLXclientState *, GLbyte *);
+extern int __glXCopyContext(__GLXclientState *, GLbyte *);
+extern int __glXSwapBuffers(__GLXclientState *, GLbyte *);
+extern int __glXUseXFont(__GLXclientState *, GLbyte *);
+extern int __glXCreateGLXPixmap(__GLXclientState *, GLbyte *);
+extern int __glXCreatePixmap(__GLXclientState * cl, GLbyte * pc);
+extern int __glXGetVisualConfigs(__GLXclientState *, GLbyte *);
+extern int __glXDestroyGLXPixmap(__GLXclientState *, GLbyte *);
+extern int __glXVendorPrivate(__GLXclientState *, GLbyte *);
+extern int __glXVendorPrivateWithReply(__GLXclientState *, GLbyte *);
+extern int __glXQueryExtensionsString(__GLXclientState *, GLbyte *);
+extern int __glXQueryServerString(__GLXclientState *, GLbyte *);
+extern int __glXClientInfo(__GLXclientState *, GLbyte *);
+extern int __glXGetFBConfigs(__GLXclientState *, GLbyte *);
+extern int __glXCreateWindow(__GLXclientState * cl, GLbyte * pc);
+extern int __glXDestroyWindow(__GLXclientState * cl, GLbyte * pc);
+extern int __glXQueryContext(__GLXclientState * cl, GLbyte * pc);
+extern int __glXDisp_NewList(__GLXclientState *, GLbyte *);
+extern int __glXDisp_EndList(__GLXclientState *, GLbyte *);
+extern int __glXDisp_DeleteLists(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GenLists(__GLXclientState *, GLbyte *);
+extern int __glXDisp_FeedbackBuffer(__GLXclientState *, GLbyte *);
+extern int __glXDisp_SelectBuffer(__GLXclientState *, GLbyte *);
+extern int __glXDisp_RenderMode(__GLXclientState *, GLbyte *);
+extern int __glXDisp_Finish(__GLXclientState *, GLbyte *);
+extern int __glXDisp_PixelStoref(__GLXclientState *, GLbyte *);
+extern int __glXDisp_PixelStorei(__GLXclientState *, GLbyte *);
+extern int __glXDisp_ReadPixels(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetBooleanv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetClipPlane(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetDoublev(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetError(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetFloatv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetIntegerv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetLightfv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetLightiv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetMapdv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetMapfv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetMapiv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetMaterialfv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetMaterialiv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetPixelMapfv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetPixelMapuiv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetPixelMapusv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetPolygonStipple(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetString(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetTexEnvfv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetTexEnviv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetTexGendv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetTexGenfv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetTexGeniv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetTexImage(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetTexParameterfv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetTexParameteriv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetTexLevelParameterfv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetTexLevelParameteriv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_IsEnabled(__GLXclientState *, GLbyte *);
+extern int __glXDisp_IsList(__GLXclientState *, GLbyte *);
+extern int __glXDisp_Flush(__GLXclientState *, GLbyte *);
+extern int __glXDisp_AreTexturesResident(__GLXclientState *, GLbyte *);
+extern int __glXDisp_DeleteTextures(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GenTextures(__GLXclientState *, GLbyte *);
+extern int __glXDisp_IsTexture(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetColorTable(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetColorTableParameterfv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetColorTableParameteriv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetConvolutionFilter(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetConvolutionParameterfv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetConvolutionParameteriv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetSeparableFilter(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetHistogram(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetHistogramParameterfv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetHistogramParameteriv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetMinmax(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetMinmaxParameterfv(__GLXclientState *, GLbyte *);
+extern int __glXDisp_GetMinmaxParameteriv(__GLXclientState *, GLbyte *);
-extern void __glXDisp_CallList(GLbyte*);
-extern void __glXDisp_CallLists(GLbyte*);
-extern void __glXDisp_ListBase(GLbyte*);
-extern void __glXDisp_Begin(GLbyte*);
-extern void __glXDisp_Bitmap(GLbyte*);
-extern void __glXDisp_Color3bv(GLbyte*);
-extern void __glXDisp_Color3dv(GLbyte*);
-extern void __glXDisp_Color3fv(GLbyte*);
-extern void __glXDisp_Color3iv(GLbyte*);
-extern void __glXDisp_Color3sv(GLbyte*);
-extern void __glXDisp_Color3ubv(GLbyte*);
-extern void __glXDisp_Color3uiv(GLbyte*);
-extern void __glXDisp_Color3usv(GLbyte*);
-extern void __glXDisp_Color4bv(GLbyte*);
-extern void __glXDisp_Color4dv(GLbyte*);
-extern void __glXDisp_Color4fv(GLbyte*);
-extern void __glXDisp_Color4iv(GLbyte*);
-extern void __glXDisp_Color4sv(GLbyte*);
-extern void __glXDisp_Color4ubv(GLbyte*);
-extern void __glXDisp_Color4uiv(GLbyte*);
-extern void __glXDisp_Color4usv(GLbyte*);
-extern void __glXDisp_EdgeFlagv(GLbyte*);
-extern void __glXDisp_End(GLbyte*);
-extern void __glXDisp_Indexdv(GLbyte*);
-extern void __glXDisp_Indexfv(GLbyte*);
-extern void __glXDisp_Indexiv(GLbyte*);
-extern void __glXDisp_Indexsv(GLbyte*);
-extern void __glXDisp_Normal3bv(GLbyte*);
-extern void __glXDisp_Normal3dv(GLbyte*);
-extern void __glXDisp_Normal3fv(GLbyte*);
-extern void __glXDisp_Normal3iv(GLbyte*);
-extern void __glXDisp_Normal3sv(GLbyte*);
-extern void __glXDisp_RasterPos2dv(GLbyte*);
-extern void __glXDisp_RasterPos2fv(GLbyte*);
-extern void __glXDisp_RasterPos2iv(GLbyte*);
-extern void __glXDisp_RasterPos2sv(GLbyte*);
-extern void __glXDisp_RasterPos3dv(GLbyte*);
-extern void __glXDisp_RasterPos3fv(GLbyte*);
-extern void __glXDisp_RasterPos3iv(GLbyte*);
-extern void __glXDisp_RasterPos3sv(GLbyte*);
-extern void __glXDisp_RasterPos4dv(GLbyte*);
-extern void __glXDisp_RasterPos4fv(GLbyte*);
-extern void __glXDisp_RasterPos4iv(GLbyte*);
-extern void __glXDisp_RasterPos4sv(GLbyte*);
-extern void __glXDisp_Rectdv(GLbyte*);
-extern void __glXDisp_Rectfv(GLbyte*);
-extern void __glXDisp_Rectiv(GLbyte*);
-extern void __glXDisp_Rectsv(GLbyte*);
-extern void __glXDisp_TexCoord1dv(GLbyte*);
-extern void __glXDisp_TexCoord1fv(GLbyte*);
-extern void __glXDisp_TexCoord1iv(GLbyte*);
-extern void __glXDisp_TexCoord1sv(GLbyte*);
-extern void __glXDisp_TexCoord2dv(GLbyte*);
-extern void __glXDisp_TexCoord2fv(GLbyte*);
-extern void __glXDisp_TexCoord2iv(GLbyte*);
-extern void __glXDisp_TexCoord2sv(GLbyte*);
-extern void __glXDisp_TexCoord3dv(GLbyte*);
-extern void __glXDisp_TexCoord3fv(GLbyte*);
-extern void __glXDisp_TexCoord3iv(GLbyte*);
-extern void __glXDisp_TexCoord3sv(GLbyte*);
-extern void __glXDisp_TexCoord4dv(GLbyte*);
-extern void __glXDisp_TexCoord4fv(GLbyte*);
-extern void __glXDisp_TexCoord4iv(GLbyte*);
-extern void __glXDisp_TexCoord4sv(GLbyte*);
-extern void __glXDisp_Vertex2dv(GLbyte*);
-extern void __glXDisp_Vertex2fv(GLbyte*);
-extern void __glXDisp_Vertex2iv(GLbyte*);
-extern void __glXDisp_Vertex2sv(GLbyte*);
-extern void __glXDisp_Vertex3dv(GLbyte*);
-extern void __glXDisp_Vertex3fv(GLbyte*);
-extern void __glXDisp_Vertex3iv(GLbyte*);
-extern void __glXDisp_Vertex3sv(GLbyte*);
-extern void __glXDisp_Vertex4dv(GLbyte*);
-extern void __glXDisp_Vertex4fv(GLbyte*);
-extern void __glXDisp_Vertex4iv(GLbyte*);
-extern void __glXDisp_Vertex4sv(GLbyte*);
-extern void __glXDisp_ClipPlane(GLbyte*);
-extern void __glXDisp_ColorMaterial(GLbyte*);
-extern void __glXDisp_CullFace(GLbyte*);
-extern void __glXDisp_Fogf(GLbyte*);
-extern void __glXDisp_Fogfv(GLbyte*);
-extern void __glXDisp_Fogi(GLbyte*);
-extern void __glXDisp_Fogiv(GLbyte*);
-extern void __glXDisp_FrontFace(GLbyte*);
-extern void __glXDisp_Hint(GLbyte*);
-extern void __glXDisp_Lightf(GLbyte*);
-extern void __glXDisp_Lightfv(GLbyte*);
-extern void __glXDisp_Lighti(GLbyte*);
-extern void __glXDisp_Lightiv(GLbyte*);
-extern void __glXDisp_LightModelf(GLbyte*);
-extern void __glXDisp_LightModelfv(GLbyte*);
-extern void __glXDisp_LightModeli(GLbyte*);
-extern void __glXDisp_LightModeliv(GLbyte*);
-extern void __glXDisp_LineStipple(GLbyte*);
-extern void __glXDisp_LineWidth(GLbyte*);
-extern void __glXDisp_Materialf(GLbyte*);
-extern void __glXDisp_Materialfv(GLbyte*);
-extern void __glXDisp_Materiali(GLbyte*);
-extern void __glXDisp_Materialiv(GLbyte*);
-extern void __glXDisp_PointSize(GLbyte*);
-extern void __glXDisp_PolygonMode(GLbyte*);
-extern void __glXDisp_PolygonStipple(GLbyte*);
-extern void __glXDisp_Scissor(GLbyte*);
-extern void __glXDisp_ShadeModel(GLbyte*);
-extern void __glXDisp_TexParameterf(GLbyte*);
-extern void __glXDisp_TexParameterfv(GLbyte*);
-extern void __glXDisp_TexParameteri(GLbyte*);
-extern void __glXDisp_TexParameteriv(GLbyte*);
-extern void __glXDisp_TexImage1D(GLbyte*);
-extern void __glXDisp_TexImage2D(GLbyte*);
-extern void __glXDisp_TexEnvf(GLbyte*);
-extern void __glXDisp_TexEnvfv(GLbyte*);
-extern void __glXDisp_TexEnvi(GLbyte*);
-extern void __glXDisp_TexEnviv(GLbyte*);
-extern void __glXDisp_TexGend(GLbyte*);
-extern void __glXDisp_TexGendv(GLbyte*);
-extern void __glXDisp_TexGenf(GLbyte*);
-extern void __glXDisp_TexGenfv(GLbyte*);
-extern void __glXDisp_TexGeni(GLbyte*);
-extern void __glXDisp_TexGeniv(GLbyte*);
-extern void __glXDisp_InitNames(GLbyte*);
-extern void __glXDisp_LoadName(GLbyte*);
-extern void __glXDisp_PassThrough(GLbyte*);
-extern void __glXDisp_PopName(GLbyte*);
-extern void __glXDisp_PushName(GLbyte*);
-extern void __glXDisp_DrawBuffer(GLbyte*);
-extern void __glXDisp_Clear(GLbyte*);
-extern void __glXDisp_ClearAccum(GLbyte*);
-extern void __glXDisp_ClearIndex(GLbyte*);
-extern void __glXDisp_ClearColor(GLbyte*);
-extern void __glXDisp_ClearStencil(GLbyte*);
-extern void __glXDisp_ClearDepth(GLbyte*);
-extern void __glXDisp_StencilMask(GLbyte*);
-extern void __glXDisp_ColorMask(GLbyte*);
-extern void __glXDisp_DepthMask(GLbyte*);
-extern void __glXDisp_IndexMask(GLbyte*);
-extern void __glXDisp_Accum(GLbyte*);
-extern void __glXDisp_Disable(GLbyte*);
-extern void __glXDisp_Enable(GLbyte*);
-extern void __glXDisp_PopAttrib(GLbyte*);
-extern void __glXDisp_PushAttrib(GLbyte*);
-extern void __glXDisp_Map1d(GLbyte*);
-extern void __glXDisp_Map1f(GLbyte*);
-extern void __glXDisp_Map2d(GLbyte*);
-extern void __glXDisp_Map2f(GLbyte*);
-extern void __glXDisp_MapGrid1d(GLbyte*);
-extern void __glXDisp_MapGrid1f(GLbyte*);
-extern void __glXDisp_MapGrid2d(GLbyte*);
-extern void __glXDisp_MapGrid2f(GLbyte*);
-extern void __glXDisp_EvalCoord1dv(GLbyte*);
-extern void __glXDisp_EvalCoord1fv(GLbyte*);
-extern void __glXDisp_EvalCoord2dv(GLbyte*);
-extern void __glXDisp_EvalCoord2fv(GLbyte*);
-extern void __glXDisp_EvalMesh1(GLbyte*);
-extern void __glXDisp_EvalPoint1(GLbyte*);
-extern void __glXDisp_EvalMesh2(GLbyte*);
-extern void __glXDisp_EvalPoint2(GLbyte*);
-extern void __glXDisp_AlphaFunc(GLbyte*);
-extern void __glXDisp_BlendFunc(GLbyte*);
-extern void __glXDisp_LogicOp(GLbyte*);
-extern void __glXDisp_StencilFunc(GLbyte*);
-extern void __glXDisp_StencilOp(GLbyte*);
-extern void __glXDisp_DepthFunc(GLbyte*);
-extern void __glXDisp_PixelZoom(GLbyte*);
-extern void __glXDisp_PixelTransferf(GLbyte*);
-extern void __glXDisp_PixelTransferi(GLbyte*);
-extern void __glXDisp_PixelMapfv(GLbyte*);
-extern void __glXDisp_PixelMapuiv(GLbyte*);
-extern void __glXDisp_PixelMapusv(GLbyte*);
-extern void __glXDisp_ReadBuffer(GLbyte*);
-extern void __glXDisp_CopyPixels(GLbyte*);
-extern void __glXDisp_DrawPixels(GLbyte*);
-extern void __glXDisp_DepthRange(GLbyte*);
-extern void __glXDisp_Frustum(GLbyte*);
-extern void __glXDisp_LoadIdentity(GLbyte*);
-extern void __glXDisp_LoadMatrixf(GLbyte*);
-extern void __glXDisp_LoadMatrixd(GLbyte*);
-extern void __glXDisp_MatrixMode(GLbyte*);
-extern void __glXDisp_MultMatrixf(GLbyte*);
-extern void __glXDisp_MultMatrixd(GLbyte*);
-extern void __glXDisp_Ortho(GLbyte*);
-extern void __glXDisp_PopMatrix(GLbyte*);
-extern void __glXDisp_PushMatrix(GLbyte*);
-extern void __glXDisp_Rotated(GLbyte*);
-extern void __glXDisp_Rotatef(GLbyte*);
-extern void __glXDisp_Scaled(GLbyte*);
-extern void __glXDisp_Scalef(GLbyte*);
-extern void __glXDisp_Translated(GLbyte*);
-extern void __glXDisp_Translatef(GLbyte*);
-extern void __glXDisp_Viewport(GLbyte*);
-extern void __glXDisp_PolygonOffset(GLbyte*);
-extern void __glXDisp_DrawArrays(GLbyte*);
-extern void __glXDisp_Indexubv(GLbyte*);
-extern void __glXDisp_ColorSubTable(GLbyte*);
-extern void __glXDisp_CopyColorSubTable(GLbyte*);
-extern void __glXDisp_ActiveTextureARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord1dvARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord1fvARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord1ivARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord1svARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord2dvARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord2fvARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord2ivARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord2svARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord3dvARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord3fvARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord3ivARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord3svARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord4dvARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord4fvARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord4ivARB(GLbyte*);
-extern void __glXDisp_MultiTexCoord4svARB(GLbyte*);
+extern void __glXDisp_CallList(GLbyte *);
+extern void __glXDisp_CallLists(GLbyte *);
+extern void __glXDisp_ListBase(GLbyte *);
+extern void __glXDisp_Begin(GLbyte *);
+extern void __glXDisp_Bitmap(GLbyte *);
+extern void __glXDisp_Color3bv(GLbyte *);
+extern void __glXDisp_Color3dv(GLbyte *);
+extern void __glXDisp_Color3fv(GLbyte *);
+extern void __glXDisp_Color3iv(GLbyte *);
+extern void __glXDisp_Color3sv(GLbyte *);
+extern void __glXDisp_Color3ubv(GLbyte *);
+extern void __glXDisp_Color3uiv(GLbyte *);
+extern void __glXDisp_Color3usv(GLbyte *);
+extern void __glXDisp_Color4bv(GLbyte *);
+extern void __glXDisp_Color4dv(GLbyte *);
+extern void __glXDisp_Color4fv(GLbyte *);
+extern void __glXDisp_Color4iv(GLbyte *);
+extern void __glXDisp_Color4sv(GLbyte *);
+extern void __glXDisp_Color4ubv(GLbyte *);
+extern void __glXDisp_Color4uiv(GLbyte *);
+extern void __glXDisp_Color4usv(GLbyte *);
+extern void __glXDisp_EdgeFlagv(GLbyte *);
+extern void __glXDisp_End(GLbyte *);
+extern void __glXDisp_Indexdv(GLbyte *);
+extern void __glXDisp_Indexfv(GLbyte *);
+extern void __glXDisp_Indexiv(GLbyte *);
+extern void __glXDisp_Indexsv(GLbyte *);
+extern void __glXDisp_Normal3bv(GLbyte *);
+extern void __glXDisp_Normal3dv(GLbyte *);
+extern void __glXDisp_Normal3fv(GLbyte *);
+extern void __glXDisp_Normal3iv(GLbyte *);
+extern void __glXDisp_Normal3sv(GLbyte *);
+extern void __glXDisp_RasterPos2dv(GLbyte *);
+extern void __glXDisp_RasterPos2fv(GLbyte *);
+extern void __glXDisp_RasterPos2iv(GLbyte *);
+extern void __glXDisp_RasterPos2sv(GLbyte *);
+extern void __glXDisp_RasterPos3dv(GLbyte *);
+extern void __glXDisp_RasterPos3fv(GLbyte *);
+extern void __glXDisp_RasterPos3iv(GLbyte *);
+extern void __glXDisp_RasterPos3sv(GLbyte *);
+extern void __glXDisp_RasterPos4dv(GLbyte *);
+extern void __glXDisp_RasterPos4fv(GLbyte *);
+extern void __glXDisp_RasterPos4iv(GLbyte *);
+extern void __glXDisp_RasterPos4sv(GLbyte *);
+extern void __glXDisp_Rectdv(GLbyte *);
+extern void __glXDisp_Rectfv(GLbyte *);
+extern void __glXDisp_Rectiv(GLbyte *);
+extern void __glXDisp_Rectsv(GLbyte *);
+extern void __glXDisp_TexCoord1dv(GLbyte *);
+extern void __glXDisp_TexCoord1fv(GLbyte *);
+extern void __glXDisp_TexCoord1iv(GLbyte *);
+extern void __glXDisp_TexCoord1sv(GLbyte *);
+extern void __glXDisp_TexCoord2dv(GLbyte *);
+extern void __glXDisp_TexCoord2fv(GLbyte *);
+extern void __glXDisp_TexCoord2iv(GLbyte *);
+extern void __glXDisp_TexCoord2sv(GLbyte *);
+extern void __glXDisp_TexCoord3dv(GLbyte *);
+extern void __glXDisp_TexCoord3fv(GLbyte *);
+extern void __glXDisp_TexCoord3iv(GLbyte *);
+extern void __glXDisp_TexCoord3sv(GLbyte *);
+extern void __glXDisp_TexCoord4dv(GLbyte *);
+extern void __glXDisp_TexCoord4fv(GLbyte *);
+extern void __glXDisp_TexCoord4iv(GLbyte *);
+extern void __glXDisp_TexCoord4sv(GLbyte *);
+extern void __glXDisp_Vertex2dv(GLbyte *);
+extern void __glXDisp_Vertex2fv(GLbyte *);
+extern void __glXDisp_Vertex2iv(GLbyte *);
+extern void __glXDisp_Vertex2sv(GLbyte *);
+extern void __glXDisp_Vertex3dv(GLbyte *);
+extern void __glXDisp_Vertex3fv(GLbyte *);
+extern void __glXDisp_Vertex3iv(GLbyte *);
+extern void __glXDisp_Vertex3sv(GLbyte *);
+extern void __glXDisp_Vertex4dv(GLbyte *);
+extern void __glXDisp_Vertex4fv(GLbyte *);
+extern void __glXDisp_Vertex4iv(GLbyte *);
+extern void __glXDisp_Vertex4sv(GLbyte *);
+extern void __glXDisp_ClipPlane(GLbyte *);
+extern void __glXDisp_ColorMaterial(GLbyte *);
+extern void __glXDisp_CullFace(GLbyte *);
+extern void __glXDisp_Fogf(GLbyte *);
+extern void __glXDisp_Fogfv(GLbyte *);
+extern void __glXDisp_Fogi(GLbyte *);
+extern void __glXDisp_Fogiv(GLbyte *);
+extern void __glXDisp_FrontFace(GLbyte *);
+extern void __glXDisp_Hint(GLbyte *);
+extern void __glXDisp_Lightf(GLbyte *);
+extern void __glXDisp_Lightfv(GLbyte *);
+extern void __glXDisp_Lighti(GLbyte *);
+extern void __glXDisp_Lightiv(GLbyte *);
+extern void __glXDisp_LightModelf(GLbyte *);
+extern void __glXDisp_LightModelfv(GLbyte *);
+extern void __glXDisp_LightModeli(GLbyte *);
+extern void __glXDisp_LightModeliv(GLbyte *);
+extern void __glXDisp_LineStipple(GLbyte *);
+extern void __glXDisp_LineWidth(GLbyte *);
+extern void __glXDisp_Materialf(GLbyte *);
+extern void __glXDisp_Materialfv(GLbyte *);
+extern void __glXDisp_Materiali(GLbyte *);
+extern void __glXDisp_Materialiv(GLbyte *);
+extern void __glXDisp_PointSize(GLbyte *);
+extern void __glXDisp_PolygonMode(GLbyte *);
+extern void __glXDisp_PolygonStipple(GLbyte *);
+extern void __glXDisp_Scissor(GLbyte *);
+extern void __glXDisp_ShadeModel(GLbyte *);
+extern void __glXDisp_TexParameterf(GLbyte *);
+extern void __glXDisp_TexParameterfv(GLbyte *);
+extern void __glXDisp_TexParameteri(GLbyte *);
+extern void __glXDisp_TexParameteriv(GLbyte *);
+extern void __glXDisp_TexImage1D(GLbyte *);
+extern void __glXDisp_TexImage2D(GLbyte *);
+extern void __glXDisp_TexEnvf(GLbyte *);
+extern void __glXDisp_TexEnvfv(GLbyte *);
+extern void __glXDisp_TexEnvi(GLbyte *);
+extern void __glXDisp_TexEnviv(GLbyte *);
+extern void __glXDisp_TexGend(GLbyte *);
+extern void __glXDisp_TexGendv(GLbyte *);
+extern void __glXDisp_TexGenf(GLbyte *);
+extern void __glXDisp_TexGenfv(GLbyte *);
+extern void __glXDisp_TexGeni(GLbyte *);
+extern void __glXDisp_TexGeniv(GLbyte *);
+extern void __glXDisp_InitNames(GLbyte *);
+extern void __glXDisp_LoadName(GLbyte *);
+extern void __glXDisp_PassThrough(GLbyte *);
+extern void __glXDisp_PopName(GLbyte *);
+extern void __glXDisp_PushName(GLbyte *);
+extern void __glXDisp_DrawBuffer(GLbyte *);
+extern void __glXDisp_Clear(GLbyte *);
+extern void __glXDisp_ClearAccum(GLbyte *);
+extern void __glXDisp_ClearIndex(GLbyte *);
+extern void __glXDisp_ClearColor(GLbyte *);
+extern void __glXDisp_ClearStencil(GLbyte *);
+extern void __glXDisp_ClearDepth(GLbyte *);
+extern void __glXDisp_StencilMask(GLbyte *);
+extern void __glXDisp_ColorMask(GLbyte *);
+extern void __glXDisp_DepthMask(GLbyte *);
+extern void __glXDisp_IndexMask(GLbyte *);
+extern void __glXDisp_Accum(GLbyte *);
+extern void __glXDisp_Disable(GLbyte *);
+extern void __glXDisp_Enable(GLbyte *);
+extern void __glXDisp_PopAttrib(GLbyte *);
+extern void __glXDisp_PushAttrib(GLbyte *);
+extern void __glXDisp_Map1d(GLbyte *);
+extern void __glXDisp_Map1f(GLbyte *);
+extern void __glXDisp_Map2d(GLbyte *);
+extern void __glXDisp_Map2f(GLbyte *);
+extern void __glXDisp_MapGrid1d(GLbyte *);
+extern void __glXDisp_MapGrid1f(GLbyte *);
+extern void __glXDisp_MapGrid2d(GLbyte *);
+extern void __glXDisp_MapGrid2f(GLbyte *);
+extern void __glXDisp_EvalCoord1dv(GLbyte *);
+extern void __glXDisp_EvalCoord1fv(GLbyte *);
+extern void __glXDisp_EvalCoord2dv(GLbyte *);
+extern void __glXDisp_EvalCoord2fv(GLbyte *);
+extern void __glXDisp_EvalMesh1(GLbyte *);
+extern void __glXDisp_EvalPoint1(GLbyte *);
+extern void __glXDisp_EvalMesh2(GLbyte *);
+extern void __glXDisp_EvalPoint2(GLbyte *);
+extern void __glXDisp_AlphaFunc(GLbyte *);
+extern void __glXDisp_BlendFunc(GLbyte *);
+extern void __glXDisp_LogicOp(GLbyte *);
+extern void __glXDisp_StencilFunc(GLbyte *);
+extern void __glXDisp_StencilOp(GLbyte *);
+extern void __glXDisp_DepthFunc(GLbyte *);
+extern void __glXDisp_PixelZoom(GLbyte *);
+extern void __glXDisp_PixelTransferf(GLbyte *);
+extern void __glXDisp_PixelTransferi(GLbyte *);
+extern void __glXDisp_PixelMapfv(GLbyte *);
+extern void __glXDisp_PixelMapuiv(GLbyte *);
+extern void __glXDisp_PixelMapusv(GLbyte *);
+extern void __glXDisp_ReadBuffer(GLbyte *);
+extern void __glXDisp_CopyPixels(GLbyte *);
+extern void __glXDisp_DrawPixels(GLbyte *);
+extern void __glXDisp_DepthRange(GLbyte *);
+extern void __glXDisp_Frustum(GLbyte *);
+extern void __glXDisp_LoadIdentity(GLbyte *);
+extern void __glXDisp_LoadMatrixf(GLbyte *);
+extern void __glXDisp_LoadMatrixd(GLbyte *);
+extern void __glXDisp_MatrixMode(GLbyte *);
+extern void __glXDisp_MultMatrixf(GLbyte *);
+extern void __glXDisp_MultMatrixd(GLbyte *);
+extern void __glXDisp_Ortho(GLbyte *);
+extern void __glXDisp_PopMatrix(GLbyte *);
+extern void __glXDisp_PushMatrix(GLbyte *);
+extern void __glXDisp_Rotated(GLbyte *);
+extern void __glXDisp_Rotatef(GLbyte *);
+extern void __glXDisp_Scaled(GLbyte *);
+extern void __glXDisp_Scalef(GLbyte *);
+extern void __glXDisp_Translated(GLbyte *);
+extern void __glXDisp_Translatef(GLbyte *);
+extern void __glXDisp_Viewport(GLbyte *);
+extern void __glXDisp_PolygonOffset(GLbyte *);
+extern void __glXDisp_DrawArrays(GLbyte *);
+extern void __glXDisp_Indexubv(GLbyte *);
+extern void __glXDisp_ColorSubTable(GLbyte *);
+extern void __glXDisp_CopyColorSubTable(GLbyte *);
+extern void __glXDisp_ActiveTextureARB(GLbyte *);
+extern void __glXDisp_MultiTexCoord1dvARB(GLbyte *);
+extern void __glXDisp_MultiTexCoord1fvARB(GLbyte *);
+extern void __glXDisp_MultiTexCoord1ivARB(GLbyte *);
+extern void __glXDisp_MultiTexCoord1svARB(GLbyte *);
+extern void __glXDisp_MultiTexCoord2dvARB(GLbyte *);
+extern void __glXDisp_MultiTexCoord2fvARB(GLbyte *);
+extern void __glXDisp_MultiTexCoord2ivARB(GLbyte *);
+extern void __glXDisp_MultiTexCoord2svARB(GLbyte *);
+extern void __glXDisp_MultiTexCoord3dvARB(GLbyte *);
+extern void __glXDisp_MultiTexCoord3fvARB(GLbyte *);
+extern void __glXDisp_MultiTexCoord3ivARB(GLbyte *);
+extern void __glXDisp_MultiTexCoord3svARB(GLbyte *);
+extern void __glXDisp_MultiTexCoord4dvARB(GLbyte *);
+extern void __glXDisp_MultiTexCoord4fvARB(GLbyte *);
+extern void __glXDisp_MultiTexCoord4ivARB(GLbyte *);
+extern void __glXDisp_MultiTexCoord4svARB(GLbyte *);
-extern int __glXSwapRender(__GLXclientState*, GLbyte*);
-extern int __glXSwapRenderLarge(__GLXclientState*, GLbyte*);
-extern int __glXSwapCreateContext(__GLXclientState*, GLbyte*);
-extern int __glXSwapCreateNewContext(__GLXclientState *cl, GLbyte *pc);
-extern int __glXSwapDestroyContext(__GLXclientState*, GLbyte*);
-extern int __glXSwapMakeCurrent(__GLXclientState*, GLbyte*);
-extern int __glXSwapMakeContextCurrent(__GLXclientState*, GLbyte*);
-extern int __glXSwapCreatePbuffer(__GLXclientState *cl, GLbyte *pc);
-extern int __glXSwapDestroyPbuffer(__GLXclientState *cl, GLbyte *pc);
-extern int __glXSwapGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc);
-extern int __glXSwapChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc);
-extern int __glXSwapIsDirect(__GLXclientState*, GLbyte*);
-extern int __glXSwapQueryVersion(__GLXclientState*, GLbyte*);
-extern int __glXSwapWaitGL(__GLXclientState*, GLbyte*);
-extern int __glXSwapWaitX(__GLXclientState*, GLbyte*);
-extern int __glXSwapCopyContext(__GLXclientState*, GLbyte*);
-extern int __glXSwapSwapBuffers(__GLXclientState*, GLbyte*);
-extern int __glXSwapUseXFont(__GLXclientState*, GLbyte*);
-extern int __glXSwapCreateGLXPixmap(__GLXclientState*, GLbyte*);
-extern int __glXSwapCreatePixmap(__GLXclientState *cl, GLbyte *pc);
-extern int __glXSwapGetVisualConfigs(__GLXclientState*, GLbyte*);
-extern int __glXSwapDestroyGLXPixmap(__GLXclientState*, GLbyte*);
-extern int __glXSwapVendorPrivate(__GLXclientState*, GLbyte*);
-extern int __glXSwapVendorPrivateWithReply(__GLXclientState*, GLbyte*);
-extern int __glXSwapQueryExtensionsString(__GLXclientState*, GLbyte*);
-extern int __glXSwapQueryServerString(__GLXclientState*, GLbyte*);
-extern int __glXSwapClientInfo(__GLXclientState*, GLbyte*);
-extern int __glXSwapGetFBConfigs(__GLXclientState*, GLbyte*);
-extern int __glXSwapCreateWindow(__GLXclientState *cl, GLbyte *pc);
-extern int __glXSwapDestroyWindow(__GLXclientState *cl, GLbyte *pc);
-extern int __glXSwapQueryContext(__GLXclientState *cl, GLbyte *pc);
-extern int __glXDispSwap_NewList(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_EndList(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_DeleteLists(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GenLists(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_FeedbackBuffer(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_SelectBuffer(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_RenderMode(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_Finish(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_PixelStoref(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_PixelStorei(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_ReadPixels(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetBooleanv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetClipPlane(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetDoublev(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetError(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetFloatv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetIntegerv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetLightfv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetLightiv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetMapdv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetMapfv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetMapiv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetMaterialfv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetMaterialiv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetPixelMapfv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetPixelMapuiv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetPixelMapusv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetPolygonStipple(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetString(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetTexEnvfv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetTexEnviv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetTexGendv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetTexGenfv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetTexGeniv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetTexImage(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetTexParameterfv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetTexParameteriv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetTexLevelParameterfv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetTexLevelParameteriv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_IsEnabled(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_IsList(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_Flush(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_AreTexturesResident(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_DeleteTextures(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GenTextures(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_IsTexture(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetColorTable(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetColorTableParameterfv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetColorTableParameteriv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetConvolutionFilter(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetConvolutionParameterfv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetConvolutionParameteriv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetSeparableFilter(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetHistogram(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetHistogramParameterfv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetHistogramParameteriv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetMinmax(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetMinmaxParameterfv(__GLXclientState*, GLbyte*);
-extern int __glXDispSwap_GetMinmaxParameteriv(__GLXclientState*, GLbyte*);
+extern int __glXSwapRender(__GLXclientState *, GLbyte *);
+extern int __glXSwapRenderLarge(__GLXclientState *, GLbyte *);
+extern int __glXSwapCreateContext(__GLXclientState *, GLbyte *);
+extern int __glXSwapCreateNewContext(__GLXclientState * cl, GLbyte * pc);
+extern int __glXSwapDestroyContext(__GLXclientState *, GLbyte *);
+extern int __glXSwapMakeCurrent(__GLXclientState *, GLbyte *);
+extern int __glXSwapMakeContextCurrent(__GLXclientState *, GLbyte *);
+extern int __glXSwapCreatePbuffer(__GLXclientState * cl, GLbyte * pc);
+extern int __glXSwapDestroyPbuffer(__GLXclientState * cl, GLbyte * pc);
+extern int __glXSwapGetDrawableAttributes(__GLXclientState * cl, GLbyte * pc);
+extern int __glXSwapChangeDrawableAttributes(__GLXclientState * cl,
+ GLbyte * pc);
+extern int __glXSwapIsDirect(__GLXclientState *, GLbyte *);
+extern int __glXSwapQueryVersion(__GLXclientState *, GLbyte *);
+extern int __glXSwapWaitGL(__GLXclientState *, GLbyte *);
+extern int __glXSwapWaitX(__GLXclientState *, GLbyte *);
+extern int __glXSwapCopyContext(__GLXclientState *, GLbyte *);
+extern int __glXSwapSwapBuffers(__GLXclientState *, GLbyte *);
+extern int __glXSwapUseXFont(__GLXclientState *, GLbyte *);
+extern int __glXSwapCreateGLXPixmap(__GLXclientState *, GLbyte *);
+extern int __glXSwapCreatePixmap(__GLXclientState * cl, GLbyte * pc);
+extern int __glXSwapGetVisualConfigs(__GLXclientState *, GLbyte *);
+extern int __glXSwapDestroyGLXPixmap(__GLXclientState *, GLbyte *);
+extern int __glXSwapVendorPrivate(__GLXclientState *, GLbyte *);
+extern int __glXSwapVendorPrivateWithReply(__GLXclientState *, GLbyte *);
+extern int __glXSwapQueryExtensionsString(__GLXclientState *, GLbyte *);
+extern int __glXSwapQueryServerString(__GLXclientState *, GLbyte *);
+extern int __glXSwapClientInfo(__GLXclientState *, GLbyte *);
+extern int __glXSwapGetFBConfigs(__GLXclientState *, GLbyte *);
+extern int __glXSwapCreateWindow(__GLXclientState * cl, GLbyte * pc);
+extern int __glXSwapDestroyWindow(__GLXclientState * cl, GLbyte * pc);
+extern int __glXSwapQueryContext(__GLXclientState * cl, GLbyte * pc);
+extern int __glXDispSwap_NewList(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_EndList(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_DeleteLists(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GenLists(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_FeedbackBuffer(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_SelectBuffer(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_RenderMode(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_Finish(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_PixelStoref(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_PixelStorei(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_ReadPixels(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetBooleanv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetClipPlane(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetDoublev(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetError(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetFloatv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetIntegerv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetLightfv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetLightiv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetMapdv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetMapfv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetMapiv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetMaterialfv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetMaterialiv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetPixelMapfv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetPixelMapuiv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetPixelMapusv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetPolygonStipple(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetString(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetTexEnvfv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetTexEnviv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetTexGendv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetTexGenfv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetTexGeniv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetTexImage(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetTexParameterfv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetTexParameteriv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetTexLevelParameterfv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetTexLevelParameteriv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_IsEnabled(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_IsList(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_Flush(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_AreTexturesResident(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_DeleteTextures(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GenTextures(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_IsTexture(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetColorTable(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetColorTableParameterfv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetColorTableParameteriv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetConvolutionFilter(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetConvolutionParameterfv(__GLXclientState *,
+ GLbyte *);
+extern int __glXDispSwap_GetConvolutionParameteriv(__GLXclientState *,
+ GLbyte *);
+extern int __glXDispSwap_GetSeparableFilter(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetHistogram(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetHistogramParameterfv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetHistogramParameteriv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetMinmax(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetMinmaxParameterfv(__GLXclientState *, GLbyte *);
+extern int __glXDispSwap_GetMinmaxParameteriv(__GLXclientState *, GLbyte *);
-extern void __glXDispSwap_CallList(GLbyte*);
-extern void __glXDispSwap_CallLists(GLbyte*);
-extern void __glXDispSwap_ListBase(GLbyte*);
-extern void __glXDispSwap_Begin(GLbyte*);
-extern void __glXDispSwap_Bitmap(GLbyte*);
-extern void __glXDispSwap_Color3bv(GLbyte*);
-extern void __glXDispSwap_Color3dv(GLbyte*);
-extern void __glXDispSwap_Color3fv(GLbyte*);
-extern void __glXDispSwap_Color3iv(GLbyte*);
-extern void __glXDispSwap_Color3sv(GLbyte*);
-extern void __glXDispSwap_Color3ubv(GLbyte*);
-extern void __glXDispSwap_Color3uiv(GLbyte*);
-extern void __glXDispSwap_Color3usv(GLbyte*);
-extern void __glXDispSwap_Color4bv(GLbyte*);
-extern void __glXDispSwap_Color4dv(GLbyte*);
-extern void __glXDispSwap_Color4fv(GLbyte*);
-extern void __glXDispSwap_Color4iv(GLbyte*);
-extern void __glXDispSwap_Color4sv(GLbyte*);
-extern void __glXDispSwap_Color4ubv(GLbyte*);
-extern void __glXDispSwap_Color4uiv(GLbyte*);
-extern void __glXDispSwap_Color4usv(GLbyte*);
-extern void __glXDispSwap_EdgeFlagv(GLbyte*);
-extern void __glXDispSwap_End(GLbyte*);
-extern void __glXDispSwap_Indexdv(GLbyte*);
-extern void __glXDispSwap_Indexfv(GLbyte*);
-extern void __glXDispSwap_Indexiv(GLbyte*);
-extern void __glXDispSwap_Indexsv(GLbyte*);
-extern void __glXDispSwap_Normal3bv(GLbyte*);
-extern void __glXDispSwap_Normal3dv(GLbyte*);
-extern void __glXDispSwap_Normal3fv(GLbyte*);
-extern void __glXDispSwap_Normal3iv(GLbyte*);
-extern void __glXDispSwap_Normal3sv(GLbyte*);
-extern void __glXDispSwap_RasterPos2dv(GLbyte*);
-extern void __glXDispSwap_RasterPos2fv(GLbyte*);
-extern void __glXDispSwap_RasterPos2iv(GLbyte*);
-extern void __glXDispSwap_RasterPos2sv(GLbyte*);
-extern void __glXDispSwap_RasterPos3dv(GLbyte*);
-extern void __glXDispSwap_RasterPos3fv(GLbyte*);
-extern void __glXDispSwap_RasterPos3iv(GLbyte*);
-extern void __glXDispSwap_RasterPos3sv(GLbyte*);
-extern void __glXDispSwap_RasterPos4dv(GLbyte*);
-extern void __glXDispSwap_RasterPos4fv(GLbyte*);
-extern void __glXDispSwap_RasterPos4iv(GLbyte*);
-extern void __glXDispSwap_RasterPos4sv(GLbyte*);
-extern void __glXDispSwap_Rectdv(GLbyte*);
-extern void __glXDispSwap_Rectfv(GLbyte*);
-extern void __glXDispSwap_Rectiv(GLbyte*);
-extern void __glXDispSwap_Rectsv(GLbyte*);
-extern void __glXDispSwap_TexCoord1dv(GLbyte*);
-extern void __glXDispSwap_TexCoord1fv(GLbyte*);
-extern void __glXDispSwap_TexCoord1iv(GLbyte*);
-extern void __glXDispSwap_TexCoord1sv(GLbyte*);
-extern void __glXDispSwap_TexCoord2dv(GLbyte*);
-extern void __glXDispSwap_TexCoord2fv(GLbyte*);
-extern void __glXDispSwap_TexCoord2iv(GLbyte*);
-extern void __glXDispSwap_TexCoord2sv(GLbyte*);
-extern void __glXDispSwap_TexCoord3dv(GLbyte*);
-extern void __glXDispSwap_TexCoord3fv(GLbyte*);
-extern void __glXDispSwap_TexCoord3iv(GLbyte*);
-extern void __glXDispSwap_TexCoord3sv(GLbyte*);
-extern void __glXDispSwap_TexCoord4dv(GLbyte*);
-extern void __glXDispSwap_TexCoord4fv(GLbyte*);
-extern void __glXDispSwap_TexCoord4iv(GLbyte*);
-extern void __glXDispSwap_TexCoord4sv(GLbyte*);
-extern void __glXDispSwap_Vertex2dv(GLbyte*);
-extern void __glXDispSwap_Vertex2fv(GLbyte*);
-extern void __glXDispSwap_Vertex2iv(GLbyte*);
-extern void __glXDispSwap_Vertex2sv(GLbyte*);
-extern void __glXDispSwap_Vertex3dv(GLbyte*);
-extern void __glXDispSwap_Vertex3fv(GLbyte*);
-extern void __glXDispSwap_Vertex3iv(GLbyte*);
-extern void __glXDispSwap_Vertex3sv(GLbyte*);
-extern void __glXDispSwap_Vertex4dv(GLbyte*);
-extern void __glXDispSwap_Vertex4fv(GLbyte*);
-extern void __glXDispSwap_Vertex4iv(GLbyte*);
-extern void __glXDispSwap_Vertex4sv(GLbyte*);
-extern void __glXDispSwap_ClipPlane(GLbyte*);
-extern void __glXDispSwap_ColorMaterial(GLbyte*);
-extern void __glXDispSwap_CullFace(GLbyte*);
-extern void __glXDispSwap_Fogf(GLbyte*);
-extern void __glXDispSwap_Fogfv(GLbyte*);
-extern void __glXDispSwap_Fogi(GLbyte*);
-extern void __glXDispSwap_Fogiv(GLbyte*);
-extern void __glXDispSwap_FrontFace(GLbyte*);
-extern void __glXDispSwap_Hint(GLbyte*);
-extern void __glXDispSwap_Lightf(GLbyte*);
-extern void __glXDispSwap_Lightfv(GLbyte*);
-extern void __glXDispSwap_Lighti(GLbyte*);
-extern void __glXDispSwap_Lightiv(GLbyte*);
-extern void __glXDispSwap_LightModelf(GLbyte*);
-extern void __glXDispSwap_LightModelfv(GLbyte*);
-extern void __glXDispSwap_LightModeli(GLbyte*);
-extern void __glXDispSwap_LightModeliv(GLbyte*);
-extern void __glXDispSwap_LineStipple(GLbyte*);
-extern void __glXDispSwap_LineWidth(GLbyte*);
-extern void __glXDispSwap_Materialf(GLbyte*);
-extern void __glXDispSwap_Materialfv(GLbyte*);
-extern void __glXDispSwap_Materiali(GLbyte*);
-extern void __glXDispSwap_Materialiv(GLbyte*);
-extern void __glXDispSwap_PointSize(GLbyte*);
-extern void __glXDispSwap_PolygonMode(GLbyte*);
-extern void __glXDispSwap_PolygonStipple(GLbyte*);
-extern void __glXDispSwap_Scissor(GLbyte*);
-extern void __glXDispSwap_ShadeModel(GLbyte*);
-extern void __glXDispSwap_TexParameterf(GLbyte*);
-extern void __glXDispSwap_TexParameterfv(GLbyte*);
-extern void __glXDispSwap_TexParameteri(GLbyte*);
-extern void __glXDispSwap_TexParameteriv(GLbyte*);
-extern void __glXDispSwap_TexImage1D(GLbyte*);
-extern void __glXDispSwap_TexImage2D(GLbyte*);
-extern void __glXDispSwap_TexEnvf(GLbyte*);
-extern void __glXDispSwap_TexEnvfv(GLbyte*);
-extern void __glXDispSwap_TexEnvi(GLbyte*);
-extern void __glXDispSwap_TexEnviv(GLbyte*);
-extern void __glXDispSwap_TexGend(GLbyte*);
-extern void __glXDispSwap_TexGendv(GLbyte*);
-extern void __glXDispSwap_TexGenf(GLbyte*);
-extern void __glXDispSwap_TexGenfv(GLbyte*);
-extern void __glXDispSwap_TexGeni(GLbyte*);
-extern void __glXDispSwap_TexGeniv(GLbyte*);
-extern void __glXDispSwap_InitNames(GLbyte*);
-extern void __glXDispSwap_LoadName(GLbyte*);
-extern void __glXDispSwap_PassThrough(GLbyte*);
-extern void __glXDispSwap_PopName(GLbyte*);
-extern void __glXDispSwap_PushName(GLbyte*);
-extern void __glXDispSwap_DrawBuffer(GLbyte*);
-extern void __glXDispSwap_Clear(GLbyte*);
-extern void __glXDispSwap_ClearAccum(GLbyte*);
-extern void __glXDispSwap_ClearIndex(GLbyte*);
-extern void __glXDispSwap_ClearColor(GLbyte*);
-extern void __glXDispSwap_ClearStencil(GLbyte*);
-extern void __glXDispSwap_ClearDepth(GLbyte*);
-extern void __glXDispSwap_StencilMask(GLbyte*);
-extern void __glXDispSwap_ColorMask(GLbyte*);
-extern void __glXDispSwap_DepthMask(GLbyte*);
-extern void __glXDispSwap_IndexMask(GLbyte*);
-extern void __glXDispSwap_Accum(GLbyte*);
-extern void __glXDispSwap_Disable(GLbyte*);
-extern void __glXDispSwap_Enable(GLbyte*);
-extern void __glXDispSwap_PopAttrib(GLbyte*);
-extern void __glXDispSwap_PushAttrib(GLbyte*);
-extern void __glXDispSwap_Map1d(GLbyte*);
-extern void __glXDispSwap_Map1f(GLbyte*);
-extern void __glXDispSwap_Map2d(GLbyte*);
-extern void __glXDispSwap_Map2f(GLbyte*);
-extern void __glXDispSwap_MapGrid1d(GLbyte*);
-extern void __glXDispSwap_MapGrid1f(GLbyte*);
-extern void __glXDispSwap_MapGrid2d(GLbyte*);
-extern void __glXDispSwap_MapGrid2f(GLbyte*);
-extern void __glXDispSwap_EvalCoord1dv(GLbyte*);
-extern void __glXDispSwap_EvalCoord1fv(GLbyte*);
-extern void __glXDispSwap_EvalCoord2dv(GLbyte*);
-extern void __glXDispSwap_EvalCoord2fv(GLbyte*);
-extern void __glXDispSwap_EvalMesh1(GLbyte*);
-extern void __glXDispSwap_EvalPoint1(GLbyte*);
-extern void __glXDispSwap_EvalMesh2(GLbyte*);
-extern void __glXDispSwap_EvalPoint2(GLbyte*);
-extern void __glXDispSwap_AlphaFunc(GLbyte*);
-extern void __glXDispSwap_BlendFunc(GLbyte*);
-extern void __glXDispSwap_LogicOp(GLbyte*);
-extern void __glXDispSwap_StencilFunc(GLbyte*);
-extern void __glXDispSwap_StencilOp(GLbyte*);
-extern void __glXDispSwap_DepthFunc(GLbyte*);
-extern void __glXDispSwap_PixelZoom(GLbyte*);
-extern void __glXDispSwap_PixelTransferf(GLbyte*);
-extern void __glXDispSwap_PixelTransferi(GLbyte*);
-extern void __glXDispSwap_PixelMapfv(GLbyte*);
-extern void __glXDispSwap_PixelMapuiv(GLbyte*);
-extern void __glXDispSwap_PixelMapusv(GLbyte*);
-extern void __glXDispSwap_ReadBuffer(GLbyte*);
-extern void __glXDispSwap_CopyPixels(GLbyte*);
-extern void __glXDispSwap_DrawPixels(GLbyte*);
-extern void __glXDispSwap_DepthRange(GLbyte*);
-extern void __glXDispSwap_Frustum(GLbyte*);
-extern void __glXDispSwap_LoadIdentity(GLbyte*);
-extern void __glXDispSwap_LoadMatrixf(GLbyte*);
-extern void __glXDispSwap_LoadMatrixd(GLbyte*);
-extern void __glXDispSwap_MatrixMode(GLbyte*);
-extern void __glXDispSwap_MultMatrixf(GLbyte*);
-extern void __glXDispSwap_MultMatrixd(GLbyte*);
-extern void __glXDispSwap_Ortho(GLbyte*);
-extern void __glXDispSwap_PopMatrix(GLbyte*);
-extern void __glXDispSwap_PushMatrix(GLbyte*);
-extern void __glXDispSwap_Rotated(GLbyte*);
-extern void __glXDispSwap_Rotatef(GLbyte*);
-extern void __glXDispSwap_Scaled(GLbyte*);
-extern void __glXDispSwap_Scalef(GLbyte*);
-extern void __glXDispSwap_Translated(GLbyte*);
-extern void __glXDispSwap_Translatef(GLbyte*);
-extern void __glXDispSwap_Viewport(GLbyte*);
-extern void __glXDispSwap_PolygonOffset(GLbyte*);
-extern void __glXDispSwap_DrawArrays(GLbyte*);
-extern void __glXDispSwap_Indexubv(GLbyte*);
-extern void __glXDispSwap_ColorSubTable(GLbyte*);
-extern void __glXDispSwap_CopyColorSubTable(GLbyte*);
-extern void __glXDispSwap_ActiveTextureARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord1dvARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord1fvARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord1ivARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord1svARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord2dvARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord2fvARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord2ivARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord2svARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord3dvARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord3fvARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord3ivARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord3svARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord4dvARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord4fvARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord4ivARB(GLbyte*);
-extern void __glXDispSwap_MultiTexCoord4svARB(GLbyte*);
+extern void __glXDispSwap_CallList(GLbyte *);
+extern void __glXDispSwap_CallLists(GLbyte *);
+extern void __glXDispSwap_ListBase(GLbyte *);
+extern void __glXDispSwap_Begin(GLbyte *);
+extern void __glXDispSwap_Bitmap(GLbyte *);
+extern void __glXDispSwap_Color3bv(GLbyte *);
+extern void __glXDispSwap_Color3dv(GLbyte *);
+extern void __glXDispSwap_Color3fv(GLbyte *);
+extern void __glXDispSwap_Color3iv(GLbyte *);
+extern void __glXDispSwap_Color3sv(GLbyte *);
+extern void __glXDispSwap_Color3ubv(GLbyte *);
+extern void __glXDispSwap_Color3uiv(GLbyte *);
+extern void __glXDispSwap_Color3usv(GLbyte *);
+extern void __glXDispSwap_Color4bv(GLbyte *);
+extern void __glXDispSwap_Color4dv(GLbyte *);
+extern void __glXDispSwap_Color4fv(GLbyte *);
+extern void __glXDispSwap_Color4iv(GLbyte *);
+extern void __glXDispSwap_Color4sv(GLbyte *);
+extern void __glXDispSwap_Color4ubv(GLbyte *);
+extern void __glXDispSwap_Color4uiv(GLbyte *);
+extern void __glXDispSwap_Color4usv(GLbyte *);
+extern void __glXDispSwap_EdgeFlagv(GLbyte *);
+extern void __glXDispSwap_End(GLbyte *);
+extern void __glXDispSwap_Indexdv(GLbyte *);
+extern void __glXDispSwap_Indexfv(GLbyte *);
+extern void __glXDispSwap_Indexiv(GLbyte *);
+extern void __glXDispSwap_Indexsv(GLbyte *);
+extern void __glXDispSwap_Normal3bv(GLbyte *);
+extern void __glXDispSwap_Normal3dv(GLbyte *);
+extern void __glXDispSwap_Normal3fv(GLbyte *);
+extern void __glXDispSwap_Normal3iv(GLbyte *);
+extern void __glXDispSwap_Normal3sv(GLbyte *);
+extern void __glXDispSwap_RasterPos2dv(GLbyte *);
+extern void __glXDispSwap_RasterPos2fv(GLbyte *);
+extern void __glXDispSwap_RasterPos2iv(GLbyte *);
+extern void __glXDispSwap_RasterPos2sv(GLbyte *);
+extern void __glXDispSwap_RasterPos3dv(GLbyte *);
+extern void __glXDispSwap_RasterPos3fv(GLbyte *);
+extern void __glXDispSwap_RasterPos3iv(GLbyte *);
+extern void __glXDispSwap_RasterPos3sv(GLbyte *);
+extern void __glXDispSwap_RasterPos4dv(GLbyte *);
+extern void __glXDispSwap_RasterPos4fv(GLbyte *);
+extern void __glXDispSwap_RasterPos4iv(GLbyte *);
+extern void __glXDispSwap_RasterPos4sv(GLbyte *);
+extern void __glXDispSwap_Rectdv(GLbyte *);
+extern void __glXDispSwap_Rectfv(GLbyte *);
+extern void __glXDispSwap_Rectiv(GLbyte *);
+extern void __glXDispSwap_Rectsv(GLbyte *);
+extern void __glXDispSwap_TexCoord1dv(GLbyte *);
+extern void __glXDispSwap_TexCoord1fv(GLbyte *);
+extern void __glXDispSwap_TexCoord1iv(GLbyte *);
+extern void __glXDispSwap_TexCoord1sv(GLbyte *);
+extern void __glXDispSwap_TexCoord2dv(GLbyte *);
+extern void __glXDispSwap_TexCoord2fv(GLbyte *);
+extern void __glXDispSwap_TexCoord2iv(GLbyte *);
+extern void __glXDispSwap_TexCoord2sv(GLbyte *);
+extern void __glXDispSwap_TexCoord3dv(GLbyte *);
+extern void __glXDispSwap_TexCoord3fv(GLbyte *);
+extern void __glXDispSwap_TexCoord3iv(GLbyte *);
+extern void __glXDispSwap_TexCoord3sv(GLbyte *);
+extern void __glXDispSwap_TexCoord4dv(GLbyte *);
+extern void __glXDispSwap_TexCoord4fv(GLbyte *);
+extern void __glXDispSwap_TexCoord4iv(GLbyte *);
+extern void __glXDispSwap_TexCoord4sv(GLbyte *);
+extern void __glXDispSwap_Vertex2dv(GLbyte *);
+extern void __glXDispSwap_Vertex2fv(GLbyte *);
+extern void __glXDispSwap_Vertex2iv(GLbyte *);
+extern void __glXDispSwap_Vertex2sv(GLbyte *);
+extern void __glXDispSwap_Vertex3dv(GLbyte *);
+extern void __glXDispSwap_Vertex3fv(GLbyte *);
+extern void __glXDispSwap_Vertex3iv(GLbyte *);
+extern void __glXDispSwap_Vertex3sv(GLbyte *);
+extern void __glXDispSwap_Vertex4dv(GLbyte *);
+extern void __glXDispSwap_Vertex4fv(GLbyte *);
+extern void __glXDispSwap_Vertex4iv(GLbyte *);
+extern void __glXDispSwap_Vertex4sv(GLbyte *);
+extern void __glXDispSwap_ClipPlane(GLbyte *);
+extern void __glXDispSwap_ColorMaterial(GLbyte *);
+extern void __glXDispSwap_CullFace(GLbyte *);
+extern void __glXDispSwap_Fogf(GLbyte *);
+extern void __glXDispSwap_Fogfv(GLbyte *);
+extern void __glXDispSwap_Fogi(GLbyte *);
+extern void __glXDispSwap_Fogiv(GLbyte *);
+extern void __glXDispSwap_FrontFace(GLbyte *);
+extern void __glXDispSwap_Hint(GLbyte *);
+extern void __glXDispSwap_Lightf(GLbyte *);
+extern void __glXDispSwap_Lightfv(GLbyte *);
+extern void __glXDispSwap_Lighti(GLbyte *);
+extern void __glXDispSwap_Lightiv(GLbyte *);
+extern void __glXDispSwap_LightModelf(GLbyte *);
+extern void __glXDispSwap_LightModelfv(GLbyte *);
+extern void __glXDispSwap_LightModeli(GLbyte *);
+extern void __glXDispSwap_LightModeliv(GLbyte *);
+extern void __glXDispSwap_LineStipple(GLbyte *);
+extern void __glXDispSwap_LineWidth(GLbyte *);
+extern void __glXDispSwap_Materialf(GLbyte *);
+extern void __glXDispSwap_Materialfv(GLbyte *);
+extern void __glXDispSwap_Materiali(GLbyte *);
+extern void __glXDispSwap_Materialiv(GLbyte *);
+extern void __glXDispSwap_PointSize(GLbyte *);
+extern void __glXDispSwap_PolygonMode(GLbyte *);
+extern void __glXDispSwap_PolygonStipple(GLbyte *);
+extern void __glXDispSwap_Scissor(GLbyte *);
+extern void __glXDispSwap_ShadeModel(GLbyte *);
+extern void __glXDispSwap_TexParameterf(GLbyte *);
+extern void __glXDispSwap_TexParameterfv(GLbyte *);
+extern void __glXDispSwap_TexParameteri(GLbyte *);
+extern void __glXDispSwap_TexParameteriv(GLbyte *);
+extern void __glXDispSwap_TexImage1D(GLbyte *);
+extern void __glXDispSwap_TexImage2D(GLbyte *);
+extern void __glXDispSwap_TexEnvf(GLbyte *);
+extern void __glXDispSwap_TexEnvfv(GLbyte *);
+extern void __glXDispSwap_TexEnvi(GLbyte *);
+extern void __glXDispSwap_TexEnviv(GLbyte *);
+extern void __glXDispSwap_TexGend(GLbyte *);
+extern void __glXDispSwap_TexGendv(GLbyte *);
+extern void __glXDispSwap_TexGenf(GLbyte *);
+extern void __glXDispSwap_TexGenfv(GLbyte *);
+extern void __glXDispSwap_TexGeni(GLbyte *);
+extern void __glXDispSwap_TexGeniv(GLbyte *);
+extern void __glXDispSwap_InitNames(GLbyte *);
+extern void __glXDispSwap_LoadName(GLbyte *);
+extern void __glXDispSwap_PassThrough(GLbyte *);
+extern void __glXDispSwap_PopName(GLbyte *);
+extern void __glXDispSwap_PushName(GLbyte *);
+extern void __glXDispSwap_DrawBuffer(GLbyte *);
+extern void __glXDispSwap_Clear(GLbyte *);
+extern void __glXDispSwap_ClearAccum(GLbyte *);
+extern void __glXDispSwap_ClearIndex(GLbyte *);
+extern void __glXDispSwap_ClearColor(GLbyte *);
+extern void __glXDispSwap_ClearStencil(GLbyte *);
+extern void __glXDispSwap_ClearDepth(GLbyte *);
+extern void __glXDispSwap_StencilMask(GLbyte *);
+extern void __glXDispSwap_ColorMask(GLbyte *);
+extern void __glXDispSwap_DepthMask(GLbyte *);
+extern void __glXDispSwap_IndexMask(GLbyte *);
+extern void __glXDispSwap_Accum(GLbyte *);
+extern void __glXDispSwap_Disable(GLbyte *);
+extern void __glXDispSwap_Enable(GLbyte *);
+extern void __glXDispSwap_PopAttrib(GLbyte *);
+extern void __glXDispSwap_PushAttrib(GLbyte *);
+extern void __glXDispSwap_Map1d(GLbyte *);
+extern void __glXDispSwap_Map1f(GLbyte *);
+extern void __glXDispSwap_Map2d(GLbyte *);
+extern void __glXDispSwap_Map2f(GLbyte *);
+extern void __glXDispSwap_MapGrid1d(GLbyte *);
+extern void __glXDispSwap_MapGrid1f(GLbyte *);
+extern void __glXDispSwap_MapGrid2d(GLbyte *);
+extern void __glXDispSwap_MapGrid2f(GLbyte *);
+extern void __glXDispSwap_EvalCoord1dv(GLbyte *);
+extern void __glXDispSwap_EvalCoord1fv(GLbyte *);
+extern void __glXDispSwap_EvalCoord2dv(GLbyte *);
+extern void __glXDispSwap_EvalCoord2fv(GLbyte *);
+extern void __glXDispSwap_EvalMesh1(GLbyte *);
+extern void __glXDispSwap_EvalPoint1(GLbyte *);
+extern void __glXDispSwap_EvalMesh2(GLbyte *);
+extern void __glXDispSwap_EvalPoint2(GLbyte *);
+extern void __glXDispSwap_AlphaFunc(GLbyte *);
+extern void __glXDispSwap_BlendFunc(GLbyte *);
+extern void __glXDispSwap_LogicOp(GLbyte *);
+extern void __glXDispSwap_StencilFunc(GLbyte *);
+extern void __glXDispSwap_StencilOp(GLbyte *);
+extern void __glXDispSwap_DepthFunc(GLbyte *);
+extern void __glXDispSwap_PixelZoom(GLbyte *);
+extern void __glXDispSwap_PixelTransferf(GLbyte *);
+extern void __glXDispSwap_PixelTransferi(GLbyte *);
+extern void __glXDispSwap_PixelMapfv(GLbyte *);
+extern void __glXDispSwap_PixelMapuiv(GLbyte *);
+extern void __glXDispSwap_PixelMapusv(GLbyte *);
+extern void __glXDispSwap_ReadBuffer(GLbyte *);
+extern void __glXDispSwap_CopyPixels(GLbyte *);
+extern void __glXDispSwap_DrawPixels(GLbyte *);
+extern void __glXDispSwap_DepthRange(GLbyte *);
+extern void __glXDispSwap_Frustum(GLbyte *);
+extern void __glXDispSwap_LoadIdentity(GLbyte *);
+extern void __glXDispSwap_LoadMatrixf(GLbyte *);
+extern void __glXDispSwap_LoadMatrixd(GLbyte *);
+extern void __glXDispSwap_MatrixMode(GLbyte *);
+extern void __glXDispSwap_MultMatrixf(GLbyte *);
+extern void __glXDispSwap_MultMatrixd(GLbyte *);
+extern void __glXDispSwap_Ortho(GLbyte *);
+extern void __glXDispSwap_PopMatrix(GLbyte *);
+extern void __glXDispSwap_PushMatrix(GLbyte *);
+extern void __glXDispSwap_Rotated(GLbyte *);
+extern void __glXDispSwap_Rotatef(GLbyte *);
+extern void __glXDispSwap_Scaled(GLbyte *);
+extern void __glXDispSwap_Scalef(GLbyte *);
+extern void __glXDispSwap_Translated(GLbyte *);
+extern void __glXDispSwap_Translatef(GLbyte *);
+extern void __glXDispSwap_Viewport(GLbyte *);
+extern void __glXDispSwap_PolygonOffset(GLbyte *);
+extern void __glXDispSwap_DrawArrays(GLbyte *);
+extern void __glXDispSwap_Indexubv(GLbyte *);
+extern void __glXDispSwap_ColorSubTable(GLbyte *);
+extern void __glXDispSwap_CopyColorSubTable(GLbyte *);
+extern void __glXDispSwap_ActiveTextureARB(GLbyte *);
+extern void __glXDispSwap_MultiTexCoord1dvARB(GLbyte *);
+extern void __glXDispSwap_MultiTexCoord1fvARB(GLbyte *);
+extern void __glXDispSwap_MultiTexCoord1ivARB(GLbyte *);
+extern void __glXDispSwap_MultiTexCoord1svARB(GLbyte *);
+extern void __glXDispSwap_MultiTexCoord2dvARB(GLbyte *);
+extern void __glXDispSwap_MultiTexCoord2fvARB(GLbyte *);
+extern void __glXDispSwap_MultiTexCoord2ivARB(GLbyte *);
+extern void __glXDispSwap_MultiTexCoord2svARB(GLbyte *);
+extern void __glXDispSwap_MultiTexCoord3dvARB(GLbyte *);
+extern void __glXDispSwap_MultiTexCoord3fvARB(GLbyte *);
+extern void __glXDispSwap_MultiTexCoord3ivARB(GLbyte *);
+extern void __glXDispSwap_MultiTexCoord3svARB(GLbyte *);
+extern void __glXDispSwap_MultiTexCoord4dvARB(GLbyte *);
+extern void __glXDispSwap_MultiTexCoord4fvARB(GLbyte *);
+extern void __glXDispSwap_MultiTexCoord4ivARB(GLbyte *);
+extern void __glXDispSwap_MultiTexCoord4svARB(GLbyte *);
-extern void __glXDispSwap_TexSubImage1D(GLbyte*);
-extern void __glXDispSwap_TexSubImage2D(GLbyte*);
-extern void __glXDispSwap_ConvolutionFilter1D(GLbyte*);
-extern void __glXDispSwap_ConvolutionFilter2D(GLbyte*);
-extern void __glXDispSwap_ConvolutionParameterfv(GLbyte*);
-extern void __glXDispSwap_ConvolutionParameteriv(GLbyte*);
-extern void __glXDispSwap_CopyConvolutionFilter1D(GLbyte*);
-extern void __glXDispSwap_CopyConvolutionFilter2D(GLbyte*);
-extern void __glXDispSwap_SeparableFilter2D(GLbyte*);
-extern void __glXDispSwap_TexImage3D(GLbyte*);
-extern void __glXDispSwap_TexSubImage3D(GLbyte*);
-extern void __glXDispSwap_DrawArrays(GLbyte*);
-extern void __glXDispSwap_PrioritizeTextures(GLbyte*);
-extern void __glXDispSwap_CopyTexImage1D(GLbyte*);
-extern void __glXDispSwap_CopyTexImage2D(GLbyte*);
-extern void __glXDispSwap_CopyTexSubImage1D(GLbyte*);
-extern void __glXDispSwap_CopyTexSubImage2D(GLbyte*);
-extern void __glXDispSwap_CopyTexSubImage3D(GLbyte*);
+extern void __glXDispSwap_TexSubImage1D(GLbyte *);
+extern void __glXDispSwap_TexSubImage2D(GLbyte *);
+extern void __glXDispSwap_ConvolutionFilter1D(GLbyte *);
+extern void __glXDispSwap_ConvolutionFilter2D(GLbyte *);
+extern void __glXDispSwap_ConvolutionParameterfv(GLbyte *);
+extern void __glXDispSwap_ConvolutionParameteriv(GLbyte *);
+extern void __glXDispSwap_CopyConvolutionFilter1D(GLbyte *);
+extern void __glXDispSwap_CopyConvolutionFilter2D(GLbyte *);
+extern void __glXDispSwap_SeparableFilter2D(GLbyte *);
+extern void __glXDispSwap_TexImage3D(GLbyte *);
+extern void __glXDispSwap_TexSubImage3D(GLbyte *);
+extern void __glXDispSwap_DrawArrays(GLbyte *);
+extern void __glXDispSwap_PrioritizeTextures(GLbyte *);
+extern void __glXDispSwap_CopyTexImage1D(GLbyte *);
+extern void __glXDispSwap_CopyTexImage2D(GLbyte *);
+extern void __glXDispSwap_CopyTexSubImage1D(GLbyte *);
+extern void __glXDispSwap_CopyTexSubImage2D(GLbyte *);
+extern void __glXDispSwap_CopyTexSubImage3D(GLbyte *);
#define __GLX_MIN_GLXCMD_OPCODE 1
#define __GLX_MAX_GLXCMD_OPCODE 20
@@ -673,4 +677,4 @@ extern void __glXDispSwap_CopyTexSubImage3D(GLbyte*);
extern __GLXdispatchSingleProcPtr __glXSingleTable[__GLX_SINGLE_TABLE_SIZE];
extern __GLXdispatchSingleProcPtr __glXSwapSingleTable[__GLX_SINGLE_TABLE_SIZE];
-#endif /* _GLX_g_disptab_h_ */
+#endif /* _GLX_g_disptab_h_ */
diff --git a/hw/dmx/glxProxy/g_renderswap.c b/hw/dmx/glxProxy/g_renderswap.c
index e434a71b6..ce1c609bd 100644
--- a/hw/dmx/glxProxy/g_renderswap.c
+++ b/hw/dmx/glxProxy/g_renderswap.c
@@ -34,2401 +34,2630 @@
#include "unpack.h"
#include "compsize.h"
-void __glXDispSwap_CallList(GLbyte *pc)
+void
+__glXDispSwap_CallList(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 0);
}
-void __glXDispSwap_ListBase(GLbyte *pc)
+void
+__glXDispSwap_ListBase(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 0);
}
-void __glXDispSwap_Begin(GLbyte *pc)
+void
+__glXDispSwap_Begin(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 0);
}
-void __glXDispSwap_Color3bv(GLbyte *pc)
+void
+__glXDispSwap_Color3bv(GLbyte * pc)
{
}
-void __glXDispSwap_Color3dv(GLbyte *pc)
+void
+__glXDispSwap_Color3dv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 24);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 24);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 3);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 3);
}
-void __glXDispSwap_Color3fv(GLbyte *pc)
+void
+__glXDispSwap_Color3fv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 3);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 3);
}
-void __glXDispSwap_Color3iv(GLbyte *pc)
+void
+__glXDispSwap_Color3iv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT_ARRAY(pc + 0, 3);
+ __GLX_SWAP_INT_ARRAY(pc + 0, 3);
}
-void __glXDispSwap_Color3sv(GLbyte *pc)
+void
+__glXDispSwap_Color3sv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 3);
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 3);
}
-void __glXDispSwap_Color3ubv(GLbyte *pc)
+void
+__glXDispSwap_Color3ubv(GLbyte * pc)
{
}
-void __glXDispSwap_Color3uiv(GLbyte *pc)
+void
+__glXDispSwap_Color3uiv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT_ARRAY(pc + 0, 3);
+ __GLX_SWAP_INT_ARRAY(pc + 0, 3);
}
-void __glXDispSwap_Color3usv(GLbyte *pc)
+void
+__glXDispSwap_Color3usv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 3);
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 3);
}
-void __glXDispSwap_Color4bv(GLbyte *pc)
+void
+__glXDispSwap_Color4bv(GLbyte * pc)
{
}
-void __glXDispSwap_Color4dv(GLbyte *pc)
+void
+__glXDispSwap_Color4dv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 32);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 32);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 4);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 4);
}
-void __glXDispSwap_Color4fv(GLbyte *pc)
+void
+__glXDispSwap_Color4fv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 4);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 4);
}
-void __glXDispSwap_Color4iv(GLbyte *pc)
+void
+__glXDispSwap_Color4iv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT_ARRAY(pc + 0, 4);
+ __GLX_SWAP_INT_ARRAY(pc + 0, 4);
}
-void __glXDispSwap_Color4sv(GLbyte *pc)
+void
+__glXDispSwap_Color4sv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 4);
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 4);
}
-void __glXDispSwap_Color4ubv(GLbyte *pc)
+void
+__glXDispSwap_Color4ubv(GLbyte * pc)
{
}
-void __glXDispSwap_Color4uiv(GLbyte *pc)
+void
+__glXDispSwap_Color4uiv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT_ARRAY(pc + 0, 4);
+ __GLX_SWAP_INT_ARRAY(pc + 0, 4);
}
-void __glXDispSwap_Color4usv(GLbyte *pc)
+void
+__glXDispSwap_Color4usv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 4);
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 4);
}
-void __glXDispSwap_EdgeFlagv(GLbyte *pc)
+void
+__glXDispSwap_EdgeFlagv(GLbyte * pc)
{
}
-void __glXDispSwap_End(GLbyte *pc)
+void
+__glXDispSwap_End(GLbyte * pc)
{
}
-void __glXDispSwap_Indexdv(GLbyte *pc)
+void
+__glXDispSwap_Indexdv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 8);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 8);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 1);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 1);
}
-void __glXDispSwap_Indexfv(GLbyte *pc)
+void
+__glXDispSwap_Indexfv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 1);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 1);
}
-void __glXDispSwap_Indexiv(GLbyte *pc)
+void
+__glXDispSwap_Indexiv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT_ARRAY(pc + 0, 1);
+ __GLX_SWAP_INT_ARRAY(pc + 0, 1);
}
-void __glXDispSwap_Indexsv(GLbyte *pc)
+void
+__glXDispSwap_Indexsv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 1);
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 1);
}
-void __glXDispSwap_Normal3bv(GLbyte *pc)
+void
+__glXDispSwap_Normal3bv(GLbyte * pc)
{
}
-void __glXDispSwap_Normal3dv(GLbyte *pc)
+void
+__glXDispSwap_Normal3dv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 24);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 24);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 3);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 3);
}
-void __glXDispSwap_Normal3fv(GLbyte *pc)
+void
+__glXDispSwap_Normal3fv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 3);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 3);
}
-void __glXDispSwap_Normal3iv(GLbyte *pc)
+void
+__glXDispSwap_Normal3iv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT_ARRAY(pc + 0, 3);
+ __GLX_SWAP_INT_ARRAY(pc + 0, 3);
}
-void __glXDispSwap_Normal3sv(GLbyte *pc)
+void
+__glXDispSwap_Normal3sv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 3);
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 3);
}
-void __glXDispSwap_RasterPos2dv(GLbyte *pc)
+void
+__glXDispSwap_RasterPos2dv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 16);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 16);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 2);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 2);
}
-void __glXDispSwap_RasterPos2fv(GLbyte *pc)
+void
+__glXDispSwap_RasterPos2fv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 2);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 2);
}
-void __glXDispSwap_RasterPos2iv(GLbyte *pc)
+void
+__glXDispSwap_RasterPos2iv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT_ARRAY(pc + 0, 2);
+ __GLX_SWAP_INT_ARRAY(pc + 0, 2);
}
-void __glXDispSwap_RasterPos2sv(GLbyte *pc)
+void
+__glXDispSwap_RasterPos2sv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 2);
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 2);
}
-void __glXDispSwap_RasterPos3dv(GLbyte *pc)
+void
+__glXDispSwap_RasterPos3dv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 24);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 24);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 3);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 3);
}
-void __glXDispSwap_RasterPos3fv(GLbyte *pc)
+void
+__glXDispSwap_RasterPos3fv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 3);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 3);
}
-void __glXDispSwap_RasterPos3iv(GLbyte *pc)
+void
+__glXDispSwap_RasterPos3iv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT_ARRAY(pc + 0, 3);
+ __GLX_SWAP_INT_ARRAY(pc + 0, 3);
}
-void __glXDispSwap_RasterPos3sv(GLbyte *pc)
+void
+__glXDispSwap_RasterPos3sv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 3);
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 3);
}
-void __glXDispSwap_RasterPos4dv(GLbyte *pc)
+void
+__glXDispSwap_RasterPos4dv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 32);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 32);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 4);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 4);
}
-void __glXDispSwap_RasterPos4fv(GLbyte *pc)
+void
+__glXDispSwap_RasterPos4fv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 4);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 4);
}
-void __glXDispSwap_RasterPos4iv(GLbyte *pc)
+void
+__glXDispSwap_RasterPos4iv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT_ARRAY(pc + 0, 4);
+ __GLX_SWAP_INT_ARRAY(pc + 0, 4);
}
-void __glXDispSwap_RasterPos4sv(GLbyte *pc)
+void
+__glXDispSwap_RasterPos4sv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 4);
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 4);
}
-void __glXDispSwap_Rectdv(GLbyte *pc)
+void
+__glXDispSwap_Rectdv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 32);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 32);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 2);
- __GLX_SWAP_DOUBLE_ARRAY(pc + 16, 2);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 2);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 16, 2);
}
-void __glXDispSwap_Rectfv(GLbyte *pc)
+void
+__glXDispSwap_Rectfv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 2);
- __GLX_SWAP_FLOAT_ARRAY(pc + 8, 2);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 2);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 8, 2);
}
-void __glXDispSwap_Rectiv(GLbyte *pc)
+void
+__glXDispSwap_Rectiv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT_ARRAY(pc + 0, 2);
- __GLX_SWAP_INT_ARRAY(pc + 8, 2);
+ __GLX_SWAP_INT_ARRAY(pc + 0, 2);
+ __GLX_SWAP_INT_ARRAY(pc + 8, 2);
}
-void __glXDispSwap_Rectsv(GLbyte *pc)
+void
+__glXDispSwap_Rectsv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 2);
- __GLX_SWAP_SHORT_ARRAY(pc + 4, 2);
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 2);
+ __GLX_SWAP_SHORT_ARRAY(pc + 4, 2);
}
-void __glXDispSwap_TexCoord1dv(GLbyte *pc)
+void
+__glXDispSwap_TexCoord1dv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 8);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 8);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 1);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 1);
}
-void __glXDispSwap_TexCoord1fv(GLbyte *pc)
+void
+__glXDispSwap_TexCoord1fv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 1);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 1);
}
-void __glXDispSwap_TexCoord1iv(GLbyte *pc)
+void
+__glXDispSwap_TexCoord1iv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT_ARRAY(pc + 0, 1);
+ __GLX_SWAP_INT_ARRAY(pc + 0, 1);
}
-void __glXDispSwap_TexCoord1sv(GLbyte *pc)
+void
+__glXDispSwap_TexCoord1sv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 1);
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 1);
}
-void __glXDispSwap_TexCoord2dv(GLbyte *pc)
+void
+__glXDispSwap_TexCoord2dv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 16);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 16);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 2);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 2);
}
-void __glXDispSwap_TexCoord2fv(GLbyte *pc)
+void
+__glXDispSwap_TexCoord2fv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 2);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 2);
}
-void __glXDispSwap_TexCoord2iv(GLbyte *pc)
+void
+__glXDispSwap_TexCoord2iv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT_ARRAY(pc + 0, 2);
+ __GLX_SWAP_INT_ARRAY(pc + 0, 2);
}
-void __glXDispSwap_TexCoord2sv(GLbyte *pc)
+void
+__glXDispSwap_TexCoord2sv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 2);
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 2);
}
-void __glXDispSwap_TexCoord3dv(GLbyte *pc)
+void
+__glXDispSwap_TexCoord3dv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 24);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 24);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 3);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 3);
}
-void __glXDispSwap_TexCoord3fv(GLbyte *pc)
+void
+__glXDispSwap_TexCoord3fv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 3);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 3);
}
-void __glXDispSwap_TexCoord3iv(GLbyte *pc)
+void
+__glXDispSwap_TexCoord3iv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT_ARRAY(pc + 0, 3);
+ __GLX_SWAP_INT_ARRAY(pc + 0, 3);
}
-void __glXDispSwap_TexCoord3sv(GLbyte *pc)
+void
+__glXDispSwap_TexCoord3sv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 3);
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 3);
}
-void __glXDispSwap_TexCoord4dv(GLbyte *pc)
+void
+__glXDispSwap_TexCoord4dv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 32);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 32);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 4);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 4);
}
-void __glXDispSwap_TexCoord4fv(GLbyte *pc)
+void
+__glXDispSwap_TexCoord4fv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 4);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 4);
}
-void __glXDispSwap_TexCoord4iv(GLbyte *pc)
+void
+__glXDispSwap_TexCoord4iv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT_ARRAY(pc + 0, 4);
+ __GLX_SWAP_INT_ARRAY(pc + 0, 4);
}
-void __glXDispSwap_TexCoord4sv(GLbyte *pc)
+void
+__glXDispSwap_TexCoord4sv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 4);
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 4);
}
-void __glXDispSwap_Vertex2dv(GLbyte *pc)
+void
+__glXDispSwap_Vertex2dv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 16);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 16);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 2);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 2);
}
-void __glXDispSwap_Vertex2fv(GLbyte *pc)
+void
+__glXDispSwap_Vertex2fv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 2);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 2);
}
-void __glXDispSwap_Vertex2iv(GLbyte *pc)
+void
+__glXDispSwap_Vertex2iv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT_ARRAY(pc + 0, 2);
+ __GLX_SWAP_INT_ARRAY(pc + 0, 2);
}
-void __glXDispSwap_Vertex2sv(GLbyte *pc)
+void
+__glXDispSwap_Vertex2sv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 2);
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 2);
}
-void __glXDispSwap_Vertex3dv(GLbyte *pc)
+void
+__glXDispSwap_Vertex3dv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 24);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 24);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 3);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 3);
}
-void __glXDispSwap_Vertex3fv(GLbyte *pc)
+void
+__glXDispSwap_Vertex3fv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 3);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 3);
}
-void __glXDispSwap_Vertex3iv(GLbyte *pc)
+void
+__glXDispSwap_Vertex3iv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT_ARRAY(pc + 0, 3);
+ __GLX_SWAP_INT_ARRAY(pc + 0, 3);
}
-void __glXDispSwap_Vertex3sv(GLbyte *pc)
+void
+__glXDispSwap_Vertex3sv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 3);
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 3);
}
-void __glXDispSwap_Vertex4dv(GLbyte *pc)
+void
+__glXDispSwap_Vertex4dv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 32);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 32);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 4);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 4);
}
-void __glXDispSwap_Vertex4fv(GLbyte *pc)
+void
+__glXDispSwap_Vertex4fv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 4);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 4);
}
-void __glXDispSwap_Vertex4iv(GLbyte *pc)
+void
+__glXDispSwap_Vertex4iv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT_ARRAY(pc + 0, 4);
+ __GLX_SWAP_INT_ARRAY(pc + 0, 4);
}
-void __glXDispSwap_Vertex4sv(GLbyte *pc)
+void
+__glXDispSwap_Vertex4sv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT_ARRAY(pc + 0, 4);
+ __GLX_SWAP_SHORT_ARRAY(pc + 0, 4);
}
-void __glXDispSwap_ClipPlane(GLbyte *pc)
+void
+__glXDispSwap_ClipPlane(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 36);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 36);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_INT(pc + 32);
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 4);
+ __GLX_SWAP_INT(pc + 32);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 4);
}
-void __glXDispSwap_ColorMaterial(GLbyte *pc)
+void
+__glXDispSwap_ColorMaterial(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
}
-void __glXDispSwap_CullFace(GLbyte *pc)
+void
+__glXDispSwap_CullFace(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 0);
}
-void __glXDispSwap_Fogf(GLbyte *pc)
+void
+__glXDispSwap_Fogf(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
}
-void __glXDispSwap_Fogfv(GLbyte *pc)
+void
+__glXDispSwap_Fogfv(GLbyte * pc)
{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ GLenum pname;
+ GLint compsize;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- pname = *(GLenum *)(pc + 0);
- compsize = __glFogfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_FLOAT_ARRAY(pc + 4, compsize);
+ __GLX_SWAP_INT(pc + 0);
+ pname = *(GLenum *) (pc + 0);
+ compsize = __glFogfv_size(pname);
+ if (compsize < 0)
+ compsize = 0;
+ __GLX_SWAP_FLOAT_ARRAY(pc + 4, compsize);
}
-void __glXDispSwap_Fogi(GLbyte *pc)
+void
+__glXDispSwap_Fogi(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
}
-void __glXDispSwap_Fogiv(GLbyte *pc)
+void
+__glXDispSwap_Fogiv(GLbyte * pc)
{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ GLenum pname;
+ GLint compsize;
- __GLX_SWAP_INT(pc + 0);
- pname = *(GLenum *)(pc + 0);
- compsize = __glFogiv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT_ARRAY(pc + 4, compsize);
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ pname = *(GLenum *) (pc + 0);
+ compsize = __glFogiv_size(pname);
+ if (compsize < 0)
+ compsize = 0;
+ __GLX_SWAP_INT_ARRAY(pc + 4, compsize);
}
-void __glXDispSwap_FrontFace(GLbyte *pc)
+void
+__glXDispSwap_FrontFace(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 0);
}
-void __glXDispSwap_Hint(GLbyte *pc)
+void
+__glXDispSwap_Hint(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
}
-void __glXDispSwap_Lightf(GLbyte *pc)
+void
+__glXDispSwap_Lightf(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
}
-void __glXDispSwap_Lightfv(GLbyte *pc)
+void
+__glXDispSwap_Lightfv(GLbyte * pc)
{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ GLenum pname;
+ GLint compsize;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glLightfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *) (pc + 4);
+ compsize = __glLightfv_size(pname);
+ if (compsize < 0)
+ compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
}
-void __glXDispSwap_Lighti(GLbyte *pc)
+void
+__glXDispSwap_Lighti(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
}
-void __glXDispSwap_Lightiv(GLbyte *pc)
+void
+__glXDispSwap_Lightiv(GLbyte * pc)
{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ GLenum pname;
+ GLint compsize;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glLightiv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *) (pc + 4);
+ compsize = __glLightiv_size(pname);
+ if (compsize < 0)
+ compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
}
-void __glXDispSwap_LightModelf(GLbyte *pc)
+void
+__glXDispSwap_LightModelf(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
}
-void __glXDispSwap_LightModelfv(GLbyte *pc)
+void
+__glXDispSwap_LightModelfv(GLbyte * pc)
{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ GLenum pname;
+ GLint compsize;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- pname = *(GLenum *)(pc + 0);
- compsize = __glLightModelfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_FLOAT_ARRAY(pc + 4, compsize);
+ __GLX_SWAP_INT(pc + 0);
+ pname = *(GLenum *) (pc + 0);
+ compsize = __glLightModelfv_size(pname);
+ if (compsize < 0)
+ compsize = 0;
+ __GLX_SWAP_FLOAT_ARRAY(pc + 4, compsize);
}
-void __glXDispSwap_LightModeli(GLbyte *pc)
+void
+__glXDispSwap_LightModeli(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
}
-void __glXDispSwap_LightModeliv(GLbyte *pc)
+void
+__glXDispSwap_LightModeliv(GLbyte * pc)
{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ GLenum pname;
+ GLint compsize;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- pname = *(GLenum *)(pc + 0);
- compsize = __glLightModeliv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT_ARRAY(pc + 4, compsize);
+ __GLX_SWAP_INT(pc + 0);
+ pname = *(GLenum *) (pc + 0);
+ compsize = __glLightModeliv_size(pname);
+ if (compsize < 0)
+ compsize = 0;
+ __GLX_SWAP_INT_ARRAY(pc + 4, compsize);
}
-void __glXDispSwap_LineStipple(GLbyte *pc)
+void
+__glXDispSwap_LineStipple(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_SHORT(pc + 4);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_SHORT(pc + 4);
}
-void __glXDispSwap_LineWidth(GLbyte *pc)
+void
+__glXDispSwap_LineWidth(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_FLOAT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 0);
}
-void __glXDispSwap_Materialf(GLbyte *pc)
+void
+__glXDispSwap_Materialf(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
}
-void __glXDispSwap_Materialfv(GLbyte *pc)
+void
+__glXDispSwap_Materialfv(GLbyte * pc)
{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ GLenum pname;
+ GLint compsize;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glMaterialfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *) (pc + 4);
+ compsize = __glMaterialfv_size(pname);
+ if (compsize < 0)
+ compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
}
-void __glXDispSwap_Materiali(GLbyte *pc)
+void
+__glXDispSwap_Materiali(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
}
-void __glXDispSwap_Materialiv(GLbyte *pc)
+void
+__glXDispSwap_Materialiv(GLbyte * pc)
{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ GLenum pname;
+ GLint compsize;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glMaterialiv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *) (pc + 4);
+ compsize = __glMaterialiv_size(pname);
+ if (compsize < 0)
+ compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
}
-void __glXDispSwap_PointSize(GLbyte *pc)
+void
+__glXDispSwap_PointSize(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_FLOAT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 0);
}
-void __glXDispSwap_PolygonMode(GLbyte *pc)
+void
+__glXDispSwap_PolygonMode(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
}
-void __glXDispSwap_Scissor(GLbyte *pc)
+void
+__glXDispSwap_Scissor(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
}
-void __glXDispSwap_ShadeModel(GLbyte *pc)
+void
+__glXDispSwap_ShadeModel(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 0);
}
-void __glXDispSwap_TexParameterf(GLbyte *pc)
+void
+__glXDispSwap_TexParameterf(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
}
-void __glXDispSwap_TexParameterfv(GLbyte *pc)
+void
+__glXDispSwap_TexParameterfv(GLbyte * pc)
{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ GLenum pname;
+ GLint compsize;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glTexParameterfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *) (pc + 4);
+ compsize = __glTexParameterfv_size(pname);
+ if (compsize < 0)
+ compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
}
-void __glXDispSwap_TexParameteri(GLbyte *pc)
+void
+__glXDispSwap_TexParameteri(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
}
-void __glXDispSwap_TexParameteriv(GLbyte *pc)
+void
+__glXDispSwap_TexParameteriv(GLbyte * pc)
{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ GLenum pname;
+ GLint compsize;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glTexParameteriv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *) (pc + 4);
+ compsize = __glTexParameteriv_size(pname);
+ if (compsize < 0)
+ compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
}
-void __glXDispSwap_TexEnvf(GLbyte *pc)
+void
+__glXDispSwap_TexEnvf(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
}
-void __glXDispSwap_TexEnvfv(GLbyte *pc)
+void
+__glXDispSwap_TexEnvfv(GLbyte * pc)
{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ GLenum pname;
+ GLint compsize;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glTexEnvfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *) (pc + 4);
+ compsize = __glTexEnvfv_size(pname);
+ if (compsize < 0)
+ compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
}
-void __glXDispSwap_TexEnvi(GLbyte *pc)
+void
+__glXDispSwap_TexEnvi(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
}
-void __glXDispSwap_TexEnviv(GLbyte *pc)
+void
+__glXDispSwap_TexEnviv(GLbyte * pc)
{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ GLenum pname;
+ GLint compsize;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glTexEnviv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *) (pc + 4);
+ compsize = __glTexEnviv_size(pname);
+ if (compsize < 0)
+ compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
}
-void __glXDispSwap_TexGend(GLbyte *pc)
+void
+__glXDispSwap_TexGend(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 16);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 16);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_DOUBLE(pc + 0);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_DOUBLE(pc + 0);
}
-void __glXDispSwap_TexGendv(GLbyte *pc)
+void
+__glXDispSwap_TexGendv(GLbyte * pc)
{
- GLenum pname;
- GLint cmdlen;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ GLenum pname;
+ GLint cmdlen;
+ GLint compsize;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glTexGendv_size(pname);
- if (compsize < 0) compsize = 0;
- cmdlen = __GLX_PAD(8+compsize*8);
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *) (pc + 4);
+ compsize = __glTexGendv_size(pname);
+ if (compsize < 0)
+ compsize = 0;
+ cmdlen = __GLX_PAD(8 + compsize * 8);
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, cmdlen);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, cmdlen);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_DOUBLE_ARRAY(pc + 8, compsize);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 8, compsize);
}
-void __glXDispSwap_TexGenf(GLbyte *pc)
+void
+__glXDispSwap_TexGenf(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
}
-void __glXDispSwap_TexGenfv(GLbyte *pc)
+void
+__glXDispSwap_TexGenfv(GLbyte * pc)
{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ GLenum pname;
+ GLint compsize;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glTexGenfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *) (pc + 4);
+ compsize = __glTexGenfv_size(pname);
+ if (compsize < 0)
+ compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
}
-void __glXDispSwap_TexGeni(GLbyte *pc)
+void
+__glXDispSwap_TexGeni(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
}
-void __glXDispSwap_TexGeniv(GLbyte *pc)
+void
+__glXDispSwap_TexGeniv(GLbyte * pc)
{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ GLenum pname;
+ GLint compsize;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glTexGeniv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *) (pc + 4);
+ compsize = __glTexGeniv_size(pname);
+ if (compsize < 0)
+ compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
}
-void __glXDispSwap_InitNames(GLbyte *pc)
+void
+__glXDispSwap_InitNames(GLbyte * pc)
{
}
-void __glXDispSwap_LoadName(GLbyte *pc)
+void
+__glXDispSwap_LoadName(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 0);
}
-void __glXDispSwap_PassThrough(GLbyte *pc)
+void
+__glXDispSwap_PassThrough(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_FLOAT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 0);
}
-void __glXDispSwap_PopName(GLbyte *pc)
+void
+__glXDispSwap_PopName(GLbyte * pc)
{
}
-void __glXDispSwap_PushName(GLbyte *pc)
+void
+__glXDispSwap_PushName(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 0);
}
-void __glXDispSwap_DrawBuffer(GLbyte *pc)
+void
+__glXDispSwap_DrawBuffer(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 0);
}
-void __glXDispSwap_Clear(GLbyte *pc)
+void
+__glXDispSwap_Clear(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 0);
}
-void __glXDispSwap_ClearAccum(GLbyte *pc)
+void
+__glXDispSwap_ClearAccum(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_FLOAT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
- __GLX_SWAP_FLOAT(pc + 12);
+ __GLX_SWAP_FLOAT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+ __GLX_SWAP_FLOAT(pc + 12);
}
-void __glXDispSwap_ClearIndex(GLbyte *pc)
+void
+__glXDispSwap_ClearIndex(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_FLOAT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 0);
}
-void __glXDispSwap_ClearColor(GLbyte *pc)
+void
+__glXDispSwap_ClearColor(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_FLOAT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
- __GLX_SWAP_FLOAT(pc + 12);
+ __GLX_SWAP_FLOAT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+ __GLX_SWAP_FLOAT(pc + 12);
}
-void __glXDispSwap_ClearStencil(GLbyte *pc)
+void
+__glXDispSwap_ClearStencil(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 0);
}
-void __glXDispSwap_ClearDepth(GLbyte *pc)
+void
+__glXDispSwap_ClearDepth(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 8);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 8);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_DOUBLE(pc + 0);
+ __GLX_SWAP_DOUBLE(pc + 0);
}
-void __glXDispSwap_StencilMask(GLbyte *pc)
+void
+__glXDispSwap_StencilMask(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 0);
}
-void __glXDispSwap_ColorMask(GLbyte *pc)
+void
+__glXDispSwap_ColorMask(GLbyte * pc)
{
}
-void __glXDispSwap_DepthMask(GLbyte *pc)
+void
+__glXDispSwap_DepthMask(GLbyte * pc)
{
}
-void __glXDispSwap_IndexMask(GLbyte *pc)
+void
+__glXDispSwap_IndexMask(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 0);
}
-void __glXDispSwap_Accum(GLbyte *pc)
+void
+__glXDispSwap_Accum(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
}
-void __glXDispSwap_Disable(GLbyte *pc)
+void
+__glXDispSwap_Disable(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 0);
}
-void __glXDispSwap_Enable(GLbyte *pc)
+void
+__glXDispSwap_Enable(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 0);
}
-void __glXDispSwap_PopAttrib(GLbyte *pc)
+void
+__glXDispSwap_PopAttrib(GLbyte * pc)
{
}
-void __glXDispSwap_PushAttrib(GLbyte *pc)
+void
+__glXDispSwap_PushAttrib(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 0);
}
-void __glXDispSwap_MapGrid1d(GLbyte *pc)
+void
+__glXDispSwap_MapGrid1d(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 20);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 20);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_INT(pc + 16);
- __GLX_SWAP_DOUBLE(pc + 0);
- __GLX_SWAP_DOUBLE(pc + 8);
+ __GLX_SWAP_INT(pc + 16);
+ __GLX_SWAP_DOUBLE(pc + 0);
+ __GLX_SWAP_DOUBLE(pc + 8);
}
-void __glXDispSwap_MapGrid1f(GLbyte *pc)
+void
+__glXDispSwap_MapGrid1f(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
}
-void __glXDispSwap_MapGrid2d(GLbyte *pc)
+void
+__glXDispSwap_MapGrid2d(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 40);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 40);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_INT(pc + 32);
- __GLX_SWAP_DOUBLE(pc + 0);
- __GLX_SWAP_DOUBLE(pc + 8);
- __GLX_SWAP_INT(pc + 36);
- __GLX_SWAP_DOUBLE(pc + 16);
- __GLX_SWAP_DOUBLE(pc + 24);
+ __GLX_SWAP_INT(pc + 32);
+ __GLX_SWAP_DOUBLE(pc + 0);
+ __GLX_SWAP_DOUBLE(pc + 8);
+ __GLX_SWAP_INT(pc + 36);
+ __GLX_SWAP_DOUBLE(pc + 16);
+ __GLX_SWAP_DOUBLE(pc + 24);
}
-void __glXDispSwap_MapGrid2f(GLbyte *pc)
+void
+__glXDispSwap_MapGrid2f(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_FLOAT(pc + 16);
- __GLX_SWAP_FLOAT(pc + 20);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_FLOAT(pc + 16);
+ __GLX_SWAP_FLOAT(pc + 20);
}
-void __glXDispSwap_EvalCoord1dv(GLbyte *pc)
+void
+__glXDispSwap_EvalCoord1dv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 8);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 8);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 1);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 1);
}
-void __glXDispSwap_EvalCoord1fv(GLbyte *pc)
+void
+__glXDispSwap_EvalCoord1fv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 1);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 1);
}
-void __glXDispSwap_EvalCoord2dv(GLbyte *pc)
+void
+__glXDispSwap_EvalCoord2dv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 16);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 16);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 2);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 2);
}
-void __glXDispSwap_EvalCoord2fv(GLbyte *pc)
+void
+__glXDispSwap_EvalCoord2fv(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 2);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 2);
}
-void __glXDispSwap_EvalMesh1(GLbyte *pc)
+void
+__glXDispSwap_EvalMesh1(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
}
-void __glXDispSwap_EvalPoint1(GLbyte *pc)
+void
+__glXDispSwap_EvalPoint1(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 0);
}
-void __glXDispSwap_EvalMesh2(GLbyte *pc)
+void
+__glXDispSwap_EvalMesh2(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_INT(pc + 16);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 16);
}
-void __glXDispSwap_EvalPoint2(GLbyte *pc)
+void
+__glXDispSwap_EvalPoint2(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
}
-void __glXDispSwap_AlphaFunc(GLbyte *pc)
+void
+__glXDispSwap_AlphaFunc(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
}
-void __glXDispSwap_BlendFunc(GLbyte *pc)
+void
+__glXDispSwap_BlendFunc(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
}
-void __glXDispSwap_LogicOp(GLbyte *pc)
+void
+__glXDispSwap_LogicOp(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 0);
}
-void __glXDispSwap_StencilFunc(GLbyte *pc)
+void
+__glXDispSwap_StencilFunc(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
}
-void __glXDispSwap_StencilOp(GLbyte *pc)
+void
+__glXDispSwap_StencilOp(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
}
-void __glXDispSwap_DepthFunc(GLbyte *pc)
+void
+__glXDispSwap_DepthFunc(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 0);
}
-void __glXDispSwap_PixelZoom(GLbyte *pc)
+void
+__glXDispSwap_PixelZoom(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_FLOAT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
}
-void __glXDispSwap_PixelTransferf(GLbyte *pc)
+void
+__glXDispSwap_PixelTransferf(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
}
-void __glXDispSwap_PixelTransferi(GLbyte *pc)
+void
+__glXDispSwap_PixelTransferi(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
}
-void __glXDispSwap_PixelMapfv(GLbyte *pc)
+void
+__glXDispSwap_PixelMapfv(GLbyte * pc)
{
- GLint mapsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ GLint mapsize;
- __GLX_SWAP_INT(pc + 4);
- mapsize = *(GLint *)(pc + 4);
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT_ARRAY(pc + 8, mapsize);
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ mapsize = *(GLint *) (pc + 4);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 8, mapsize);
}
-void __glXDispSwap_PixelMapuiv(GLbyte *pc)
+void
+__glXDispSwap_PixelMapuiv(GLbyte * pc)
{
- GLint mapsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ GLint mapsize;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT(pc + 4);
- mapsize = *(GLint *)(pc + 4);
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 8, mapsize);
+ __GLX_SWAP_INT(pc + 4);
+ mapsize = *(GLint *) (pc + 4);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 8, mapsize);
}
-void __glXDispSwap_PixelMapusv(GLbyte *pc)
+void
+__glXDispSwap_PixelMapusv(GLbyte * pc)
{
- GLint mapsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ GLint mapsize;
- __GLX_SWAP_INT(pc + 4);
- mapsize = *(GLint *)(pc + 4);
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_SHORT_ARRAY(pc + 8, mapsize);
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ mapsize = *(GLint *) (pc + 4);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_SHORT_ARRAY(pc + 8, mapsize);
}
-void __glXDispSwap_ReadBuffer(GLbyte *pc)
+void
+__glXDispSwap_ReadBuffer(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 0);
}
-void __glXDispSwap_CopyPixels(GLbyte *pc)
+void
+__glXDispSwap_CopyPixels(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_INT(pc + 16);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 16);
}
-void __glXDispSwap_DepthRange(GLbyte *pc)
+void
+__glXDispSwap_DepthRange(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 16);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 16);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_DOUBLE(pc + 0);
- __GLX_SWAP_DOUBLE(pc + 8);
+ __GLX_SWAP_DOUBLE(pc + 0);
+ __GLX_SWAP_DOUBLE(pc + 8);
}
-void __glXDispSwap_Frustum(GLbyte *pc)
+void
+__glXDispSwap_Frustum(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 48);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 48);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_DOUBLE(pc + 0);
- __GLX_SWAP_DOUBLE(pc + 8);
- __GLX_SWAP_DOUBLE(pc + 16);
- __GLX_SWAP_DOUBLE(pc + 24);
- __GLX_SWAP_DOUBLE(pc + 32);
- __GLX_SWAP_DOUBLE(pc + 40);
+ __GLX_SWAP_DOUBLE(pc + 0);
+ __GLX_SWAP_DOUBLE(pc + 8);
+ __GLX_SWAP_DOUBLE(pc + 16);
+ __GLX_SWAP_DOUBLE(pc + 24);
+ __GLX_SWAP_DOUBLE(pc + 32);
+ __GLX_SWAP_DOUBLE(pc + 40);
}
-void __glXDispSwap_LoadIdentity(GLbyte *pc)
+void
+__glXDispSwap_LoadIdentity(GLbyte * pc)
{
}
-void __glXDispSwap_LoadMatrixf(GLbyte *pc)
+void
+__glXDispSwap_LoadMatrixf(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 16);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 16);
}
-void __glXDispSwap_LoadMatrixd(GLbyte *pc)
+void
+__glXDispSwap_LoadMatrixd(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 128);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 128);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 16);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 16);
}
-void __glXDispSwap_MatrixMode(GLbyte *pc)
+void
+__glXDispSwap_MatrixMode(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 0);
}
-void __glXDispSwap_MultMatrixf(GLbyte *pc)
+void
+__glXDispSwap_MultMatrixf(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_FLOAT_ARRAY(pc + 0, 16);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 0, 16);
}
-void __glXDispSwap_MultMatrixd(GLbyte *pc)
+void
+__glXDispSwap_MultMatrixd(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 128);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 128);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 16);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 16);
}
-void __glXDispSwap_Ortho(GLbyte *pc)
+void
+__glXDispSwap_Ortho(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 48);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 48);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_DOUBLE(pc + 0);
- __GLX_SWAP_DOUBLE(pc + 8);
- __GLX_SWAP_DOUBLE(pc + 16);
- __GLX_SWAP_DOUBLE(pc + 24);
- __GLX_SWAP_DOUBLE(pc + 32);
- __GLX_SWAP_DOUBLE(pc + 40);
+ __GLX_SWAP_DOUBLE(pc + 0);
+ __GLX_SWAP_DOUBLE(pc + 8);
+ __GLX_SWAP_DOUBLE(pc + 16);
+ __GLX_SWAP_DOUBLE(pc + 24);
+ __GLX_SWAP_DOUBLE(pc + 32);
+ __GLX_SWAP_DOUBLE(pc + 40);
}
-void __glXDispSwap_PopMatrix(GLbyte *pc)
+void
+__glXDispSwap_PopMatrix(GLbyte * pc)
{
}
-void __glXDispSwap_PushMatrix(GLbyte *pc)
+void
+__glXDispSwap_PushMatrix(GLbyte * pc)
{
}
-void __glXDispSwap_Rotated(GLbyte *pc)
+void
+__glXDispSwap_Rotated(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 32);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 32);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_DOUBLE(pc + 0);
- __GLX_SWAP_DOUBLE(pc + 8);
- __GLX_SWAP_DOUBLE(pc + 16);
- __GLX_SWAP_DOUBLE(pc + 24);
+ __GLX_SWAP_DOUBLE(pc + 0);
+ __GLX_SWAP_DOUBLE(pc + 8);
+ __GLX_SWAP_DOUBLE(pc + 16);
+ __GLX_SWAP_DOUBLE(pc + 24);
}
-void __glXDispSwap_Rotatef(GLbyte *pc)
+void
+__glXDispSwap_Rotatef(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_FLOAT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
- __GLX_SWAP_FLOAT(pc + 12);
+ __GLX_SWAP_FLOAT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+ __GLX_SWAP_FLOAT(pc + 12);
}
-void __glXDispSwap_Scaled(GLbyte *pc)
+void
+__glXDispSwap_Scaled(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 24);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 24);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_DOUBLE(pc + 0);
- __GLX_SWAP_DOUBLE(pc + 8);
- __GLX_SWAP_DOUBLE(pc + 16);
+ __GLX_SWAP_DOUBLE(pc + 0);
+ __GLX_SWAP_DOUBLE(pc + 8);
+ __GLX_SWAP_DOUBLE(pc + 16);
}
-void __glXDispSwap_Scalef(GLbyte *pc)
+void
+__glXDispSwap_Scalef(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_FLOAT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
+ __GLX_SWAP_FLOAT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
}
-void __glXDispSwap_Translated(GLbyte *pc)
+void
+__glXDispSwap_Translated(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 24);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 24);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_DOUBLE(pc + 0);
- __GLX_SWAP_DOUBLE(pc + 8);
- __GLX_SWAP_DOUBLE(pc + 16);
+ __GLX_SWAP_DOUBLE(pc + 0);
+ __GLX_SWAP_DOUBLE(pc + 8);
+ __GLX_SWAP_DOUBLE(pc + 16);
}
-void __glXDispSwap_Translatef(GLbyte *pc)
+void
+__glXDispSwap_Translatef(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_FLOAT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
+ __GLX_SWAP_FLOAT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
}
-void __glXDispSwap_Viewport(GLbyte *pc)
+void
+__glXDispSwap_Viewport(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
}
-void __glXDispSwap_PolygonOffset(GLbyte *pc)
+void
+__glXDispSwap_PolygonOffset(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_FLOAT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
}
-void __glXDispSwap_CopyTexImage1D(GLbyte *pc)
+void
+__glXDispSwap_CopyTexImage1D(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_INT(pc + 16);
- __GLX_SWAP_INT(pc + 20);
- __GLX_SWAP_INT(pc + 24);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 16);
+ __GLX_SWAP_INT(pc + 20);
+ __GLX_SWAP_INT(pc + 24);
}
-void __glXDispSwap_CopyTexImage2D(GLbyte *pc)
+void
+__glXDispSwap_CopyTexImage2D(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_INT(pc + 16);
- __GLX_SWAP_INT(pc + 20);
- __GLX_SWAP_INT(pc + 24);
- __GLX_SWAP_INT(pc + 28);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 16);
+ __GLX_SWAP_INT(pc + 20);
+ __GLX_SWAP_INT(pc + 24);
+ __GLX_SWAP_INT(pc + 28);
}
-void __glXDispSwap_CopyTexSubImage1D(GLbyte *pc)
+void
+__glXDispSwap_CopyTexSubImage1D(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_INT(pc + 16);
- __GLX_SWAP_INT(pc + 20);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 16);
+ __GLX_SWAP_INT(pc + 20);
}
-void __glXDispSwap_CopyTexSubImage2D(GLbyte *pc)
+void
+__glXDispSwap_CopyTexSubImage2D(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_INT(pc + 16);
- __GLX_SWAP_INT(pc + 20);
- __GLX_SWAP_INT(pc + 24);
- __GLX_SWAP_INT(pc + 28);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 16);
+ __GLX_SWAP_INT(pc + 20);
+ __GLX_SWAP_INT(pc + 24);
+ __GLX_SWAP_INT(pc + 28);
}
-void __glXDispSwap_BindTexture(GLbyte *pc)
+void
+__glXDispSwap_BindTexture(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
}
-void __glXDispSwap_PrioritizeTextures(GLbyte *pc)
+void
+__glXDispSwap_PrioritizeTextures(GLbyte * pc)
{
- GLsizei n;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ GLsizei n;
- __GLX_SWAP_INT(pc + 0);
- n = *(GLsizei *)(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 4, n);
- __GLX_SWAP_FLOAT_ARRAY(pc + 4+n*4, n);
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 0);
+ n = *(GLsizei *) (pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 4, n);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 4 + n * 4, n);
}
-void __glXDispSwap_Indexubv(GLbyte *pc)
+void
+__glXDispSwap_Indexubv(GLbyte * pc)
{
}
-void __glXDispSwap_BlendColor(GLbyte *pc)
+void
+__glXDispSwap_BlendColor(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_FLOAT(pc + 0);
- __GLX_SWAP_FLOAT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
- __GLX_SWAP_FLOAT(pc + 12);
+ __GLX_SWAP_FLOAT(pc + 0);
+ __GLX_SWAP_FLOAT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
+ __GLX_SWAP_FLOAT(pc + 12);
}
-void __glXDispSwap_BlendEquation(GLbyte *pc)
+void
+__glXDispSwap_BlendEquation(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 0);
}
-void __glXDispSwap_ColorTableParameterfv(GLbyte *pc)
+void
+__glXDispSwap_ColorTableParameterfv(GLbyte * pc)
{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ GLenum pname;
+ GLint compsize;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glColorTableParameterfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *) (pc + 4);
+ compsize = __glColorTableParameterfv_size(pname);
+ if (compsize < 0)
+ compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
}
-void __glXDispSwap_ColorTableParameteriv(GLbyte *pc)
+void
+__glXDispSwap_ColorTableParameteriv(GLbyte * pc)
{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ GLenum pname;
+ GLint compsize;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glColorTableParameteriv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *) (pc + 4);
+ compsize = __glColorTableParameteriv_size(pname);
+ if (compsize < 0)
+ compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
}
-void __glXDispSwap_CopyColorTable(GLbyte *pc)
+void
+__glXDispSwap_CopyColorTable(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_INT(pc + 16);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 16);
}
-void __glXDispSwap_CopyColorSubTable(GLbyte *pc)
+void
+__glXDispSwap_CopyColorSubTable(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_INT(pc + 16);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 16);
}
-void __glXDispSwap_ConvolutionParameterf(GLbyte *pc)
+void
+__glXDispSwap_ConvolutionParameterf(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_FLOAT(pc + 8);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_FLOAT(pc + 8);
}
-void __glXDispSwap_ConvolutionParameterfv(GLbyte *pc)
+void
+__glXDispSwap_ConvolutionParameterfv(GLbyte * pc)
{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ GLenum pname;
+ GLint compsize;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glConvolutionParameterfv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *) (pc + 4);
+ compsize = __glConvolutionParameterfv_size(pname);
+ if (compsize < 0)
+ compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 8, compsize);
}
-void __glXDispSwap_ConvolutionParameteri(GLbyte *pc)
+void
+__glXDispSwap_ConvolutionParameteri(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
}
-void __glXDispSwap_ConvolutionParameteriv(GLbyte *pc)
+void
+__glXDispSwap_ConvolutionParameteriv(GLbyte * pc)
{
- GLenum pname;
- GLint compsize;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ GLenum pname;
+ GLint compsize;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT(pc + 4);
- pname = *(GLenum *)(pc + 4);
- compsize = __glConvolutionParameteriv_size(pname);
- if (compsize < 0) compsize = 0;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
+ __GLX_SWAP_INT(pc + 4);
+ pname = *(GLenum *) (pc + 4);
+ compsize = __glConvolutionParameteriv_size(pname);
+ if (compsize < 0)
+ compsize = 0;
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 8, compsize);
}
-void __glXDispSwap_CopyConvolutionFilter1D(GLbyte *pc)
+void
+__glXDispSwap_CopyConvolutionFilter1D(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_INT(pc + 16);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 16);
}
-void __glXDispSwap_CopyConvolutionFilter2D(GLbyte *pc)
+void
+__glXDispSwap_CopyConvolutionFilter2D(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_INT(pc + 16);
- __GLX_SWAP_INT(pc + 20);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 16);
+ __GLX_SWAP_INT(pc + 20);
}
-void __glXDispSwap_Histogram(GLbyte *pc)
+void
+__glXDispSwap_Histogram(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
}
-void __glXDispSwap_Minmax(GLbyte *pc)
+void
+__glXDispSwap_Minmax(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
}
-void __glXDispSwap_ResetHistogram(GLbyte *pc)
+void
+__glXDispSwap_ResetHistogram(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 0);
}
-void __glXDispSwap_ResetMinmax(GLbyte *pc)
+void
+__glXDispSwap_ResetMinmax(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 0);
}
-void __glXDispSwap_CopyTexSubImage3D(GLbyte *pc)
+void
+__glXDispSwap_CopyTexSubImage3D(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT(pc + 4);
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_INT(pc + 12);
- __GLX_SWAP_INT(pc + 16);
- __GLX_SWAP_INT(pc + 20);
- __GLX_SWAP_INT(pc + 24);
- __GLX_SWAP_INT(pc + 28);
- __GLX_SWAP_INT(pc + 32);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 4);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_INT(pc + 12);
+ __GLX_SWAP_INT(pc + 16);
+ __GLX_SWAP_INT(pc + 20);
+ __GLX_SWAP_INT(pc + 24);
+ __GLX_SWAP_INT(pc + 28);
+ __GLX_SWAP_INT(pc + 32);
}
-void __glXDispSwap_ActiveTextureARB(GLbyte *pc)
+void
+__glXDispSwap_ActiveTextureARB(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT(pc + 0);
}
-void __glXDispSwap_MultiTexCoord1dvARB(GLbyte *pc)
+void
+__glXDispSwap_MultiTexCoord1dvARB(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 12);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 12);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_INT(pc + 8);
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 1);
+ __GLX_SWAP_INT(pc + 8);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 1);
}
-void __glXDispSwap_MultiTexCoord1fvARB(GLbyte *pc)
+void
+__glXDispSwap_MultiTexCoord1fvARB(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT_ARRAY(pc + 4, 1);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 4, 1);
}
-void __glXDispSwap_MultiTexCoord1ivARB(GLbyte *pc)
+void
+__glXDispSwap_MultiTexCoord1ivARB(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 4, 1);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 4, 1);
}
-void __glXDispSwap_MultiTexCoord1svARB(GLbyte *pc)
+void
+__glXDispSwap_MultiTexCoord1svARB(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_SHORT_ARRAY(pc + 4, 1);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_SHORT_ARRAY(pc + 4, 1);
}
-void __glXDispSwap_MultiTexCoord2dvARB(GLbyte *pc)
+void
+__glXDispSwap_MultiTexCoord2dvARB(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 20);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 20);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_INT(pc + 16);
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 2);
+ __GLX_SWAP_INT(pc + 16);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 2);
}
-void __glXDispSwap_MultiTexCoord2fvARB(GLbyte *pc)
+void
+__glXDispSwap_MultiTexCoord2fvARB(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT_ARRAY(pc + 4, 2);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 4, 2);
}
-void __glXDispSwap_MultiTexCoord2ivARB(GLbyte *pc)
+void
+__glXDispSwap_MultiTexCoord2ivARB(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 4, 2);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 4, 2);
}
-void __glXDispSwap_MultiTexCoord2svARB(GLbyte *pc)
+void
+__glXDispSwap_MultiTexCoord2svARB(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_SHORT_ARRAY(pc + 4, 2);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_SHORT_ARRAY(pc + 4, 2);
}
-void __glXDispSwap_MultiTexCoord3dvARB(GLbyte *pc)
+void
+__glXDispSwap_MultiTexCoord3dvARB(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 28);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 28);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_INT(pc + 24);
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 3);
+ __GLX_SWAP_INT(pc + 24);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 3);
}
-void __glXDispSwap_MultiTexCoord3fvARB(GLbyte *pc)
+void
+__glXDispSwap_MultiTexCoord3fvARB(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT_ARRAY(pc + 4, 3);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 4, 3);
}
-void __glXDispSwap_MultiTexCoord3ivARB(GLbyte *pc)
+void
+__glXDispSwap_MultiTexCoord3ivARB(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 4, 3);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 4, 3);
}
-void __glXDispSwap_MultiTexCoord3svARB(GLbyte *pc)
+void
+__glXDispSwap_MultiTexCoord3svARB(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_SHORT_ARRAY(pc + 4, 3);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_SHORT_ARRAY(pc + 4, 3);
}
-void __glXDispSwap_MultiTexCoord4dvARB(GLbyte *pc)
+void
+__glXDispSwap_MultiTexCoord4dvARB(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
#ifdef __GLX_ALIGN64
- if ((unsigned long)(pc) & 7) {
- __GLX_MEM_COPY(pc-4, pc, 36);
- pc -= 4;
- }
+ if ((unsigned long) (pc) & 7) {
+ __GLX_MEM_COPY(pc - 4, pc, 36);
+ pc -= 4;
+ }
#endif
- __GLX_SWAP_INT(pc + 32);
- __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 4);
+ __GLX_SWAP_INT(pc + 32);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 0, 4);
}
-void __glXDispSwap_MultiTexCoord4fvARB(GLbyte *pc)
+void
+__glXDispSwap_MultiTexCoord4fvARB(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_FLOAT_ARRAY(pc + 4, 4);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_FLOAT_ARRAY(pc + 4, 4);
}
-void __glXDispSwap_MultiTexCoord4ivARB(GLbyte *pc)
+void
+__glXDispSwap_MultiTexCoord4ivARB(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_INT_ARRAY(pc + 4, 4);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_INT_ARRAY(pc + 4, 4);
}
-void __glXDispSwap_MultiTexCoord4svARB(GLbyte *pc)
+void
+__glXDispSwap_MultiTexCoord4svARB(GLbyte * pc)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT(pc + 0);
- __GLX_SWAP_SHORT_ARRAY(pc + 4, 4);
+ __GLX_SWAP_INT(pc + 0);
+ __GLX_SWAP_SHORT_ARRAY(pc + 4, 4);
}
-
diff --git a/hw/dmx/glxProxy/global.c b/hw/dmx/glxProxy/global.c
index 9cf8c11c3..6d4612deb 100644
--- a/hw/dmx/glxProxy/global.c
+++ b/hw/dmx/glxProxy/global.c
@@ -64,7 +64,7 @@ xGLXSingleReply __glXReply;
** A set of state for each client. The 0th one is unused because client
** indices start at 1, not 0.
*/
-__GLXclientState *__glXClients[MAXCLIENTS+1];
+__GLXclientState *__glXClients[MAXCLIENTS + 1];
int __glXVersionMajor;
int __glXVersionMinor;
diff --git a/hw/dmx/glxProxy/glxcmds.c b/hw/dmx/glxProxy/glxcmds.c
index fb4bce850..49c6ef1ed 100644
--- a/hw/dmx/glxProxy/glxcmds.c
+++ b/hw/dmx/glxProxy/glxcmds.c
@@ -59,71 +59,78 @@
#endif
extern __GLXFBConfig **__glXFBConfigs;
-extern int __glXNumFBConfigs;
+extern int __glXNumFBConfigs;
-extern int glxIsExtensionSupported( char *ext );
-extern int __glXGetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc);
+extern int glxIsExtensionSupported(char *ext);
+extern int __glXGetFBConfigsSGIX(__GLXclientState * cl, GLbyte * pc);
#define BE_TO_CLIENT_ERROR(x) \
( (x) >= __glXerrorBase ? \
(x) - dmxScreen->glxErrorBase + __glXerrorBase \
: (x) )
-static __GLXFBConfig *glxLookupFBConfig( GLXFBConfigID id )
+static __GLXFBConfig *
+glxLookupFBConfig(GLXFBConfigID id)
{
- int i,j;
+ int i, j;
- for (i=0, j=0; i<__glXNumFBConfigs; i++,j+=(__glXNumActiveScreens+1) ) {
- if ( __glXFBConfigs[j]->id == id)
- return __glXFBConfigs[j];
- }
+ for (i = 0, j = 0; i < __glXNumFBConfigs;
+ i++, j += (__glXNumActiveScreens + 1)) {
+ if (__glXFBConfigs[j]->id == id)
+ return __glXFBConfigs[j];
+ }
- return NULL;
+ return NULL;
}
-static __GLXFBConfig *glxLookupFBConfigByVID( VisualID vid )
+static __GLXFBConfig *
+glxLookupFBConfigByVID(VisualID vid)
{
- int i,j;
+ int i, j;
- for (i=0, j=0; i<__glXNumFBConfigs; i++,j+=(__glXNumActiveScreens+1) ) {
- if ( __glXFBConfigs[j]->associatedVisualId == vid)
- return __glXFBConfigs[j];
- }
+ for (i = 0, j = 0; i < __glXNumFBConfigs;
+ i++, j += (__glXNumActiveScreens + 1)) {
+ if (__glXFBConfigs[j]->associatedVisualId == vid)
+ return __glXFBConfigs[j];
+ }
- return NULL;
+ return NULL;
}
-static __GLXFBConfig *glxLookupBackEndFBConfig( GLXFBConfigID id, int screen )
+static __GLXFBConfig *
+glxLookupBackEndFBConfig(GLXFBConfigID id, int screen)
{
- int i;
- int j;
+ int i;
+ int j;
- for (i=0, j=0; i<__glXNumFBConfigs; i++,j+=(__glXNumActiveScreens+1) ) {
- if ( __glXFBConfigs[j]->id == id)
- return __glXFBConfigs[j+screen+1];
- }
+ for (i = 0, j = 0; i < __glXNumFBConfigs;
+ i++, j += (__glXNumActiveScreens + 1)) {
+ if (__glXFBConfigs[j]->id == id)
+ return __glXFBConfigs[j + screen + 1];
+ }
- return NULL;
+ return NULL;
}
-Display *GetBackEndDisplay( __GLXclientState *cl, int s )
+Display *
+GetBackEndDisplay(__GLXclientState * cl, int s)
{
- if (! cl->be_displays[s] ) {
- cl->be_displays[s] = XOpenDisplay( DisplayString(dmxScreens[s].beDisplay) );
- }
- return cl->be_displays[s];
+ if (!cl->be_displays[s]) {
+ cl->be_displays[s] =
+ XOpenDisplay(DisplayString(dmxScreens[s].beDisplay));
+ }
+ return cl->be_displays[s];
}
/*
** Create a GL context with the given properties.
*/
-static int CreateContext(__GLXclientState *cl,
- GLXContextID gcId,
- VisualID vid, GLXFBConfigID fbconfigId,
- int screen,
- GLXContextID shareList,
- int isDirect )
+static int
+CreateContext(__GLXclientState * cl,
+ GLXContextID gcId,
+ VisualID vid, GLXFBConfigID fbconfigId,
+ int screen, GLXContextID shareList, int isDirect)
{
ClientPtr client = cl->client;
xGLXCreateContextReq *be_req;
@@ -142,20 +149,19 @@ static int CreateContext(__GLXclientState *cl,
GLXFBConfigID be_fbconfigId = 0;
int num_be_screens;
Display *dpy;
-
+
/*
- ** Check if screen exists.
- */
+ ** Check if screen exists.
+ */
if (screen >= screenInfo.numScreens) {
- client->errorValue = screen;
- return BadValue;
+ client->errorValue = screen;
+ return BadValue;
}
-
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
- from_screen = 0;
- to_screen = screenInfo.numScreens - 1;
+ from_screen = 0;
+ to_screen = screenInfo.numScreens - 1;
}
#endif
@@ -164,87 +170,88 @@ static int CreateContext(__GLXclientState *cl,
**
*/
if (shareList == None) {
- shareglxc = NULL;
- } else {
- dixLookupResourceByType((pointer*) &shareglxc, shareList,
- __glXContextRes, NullClient, DixUnknownAccess);
- if (!shareglxc) {
- client->errorValue = shareList;
- return __glXBadContext;
- }
+ shareglxc = NULL;
+ }
+ else {
+ dixLookupResourceByType((pointer *) &shareglxc, shareList,
+ __glXContextRes, NullClient, DixUnknownAccess);
+ if (!shareglxc) {
+ client->errorValue = shareList;
+ return __glXBadContext;
+ }
}
/*
- ** Allocate memory for the new context
- */
+ ** Allocate memory for the new context
+ */
glxc = calloc(1, sizeof(__GLXcontext));
if (!glxc) {
- return BadAlloc;
+ return BadAlloc;
}
pScreen = screenInfo.screens[screen];
pGlxScreen = &__glXActiveScreens[screen];
if (fbconfigId != None) {
- glxc->pFBConfig = glxLookupFBConfig( fbconfigId );
- if (!glxc->pFBConfig) {
- client->errorValue = fbconfigId;
- free( glxc );
- return BadValue;
- }
- visual = glxc->pFBConfig->associatedVisualId;
+ glxc->pFBConfig = glxLookupFBConfig(fbconfigId);
+ if (!glxc->pFBConfig) {
+ client->errorValue = fbconfigId;
+ free(glxc);
+ return BadValue;
+ }
+ visual = glxc->pFBConfig->associatedVisualId;
}
else {
- glxc->pFBConfig = NULL;
+ glxc->pFBConfig = NULL;
}
if (visual != None) {
- /*
- ** Check if the visual ID is valid for this screen.
- */
- pVisual = pScreen->visuals;
- for (i = 0; i < pScreen->numVisuals; i++, pVisual++) {
- if (pVisual->vid == visual) {
- break;
- }
- }
- if (i == pScreen->numVisuals) {
- client->errorValue = visual;
- free( glxc );
- return BadValue;
- }
-
- pGlxVisual = pGlxScreen->pGlxVisual;
- for (i = 0; i < pGlxScreen->numVisuals; i++, pGlxVisual++) {
- if (pGlxVisual->vid == visual) {
- break;
- }
- }
- if (i == pGlxScreen->numVisuals) {
- /*
- ** Visual not support on this screen by this OpenGL implementation.
- */
- client->errorValue = visual;
- free( glxc );
- return BadValue;
- }
-
- if ( glxc->pFBConfig == NULL ) {
- glxc->pFBConfig = glxLookupFBConfigByVID( visual );
-
- if ( glxc->pFBConfig == NULL ) {
- /*
- * visual does not have an FBConfig ???
- client->errorValue = visual;
- free( glxc );
- return BadValue;
- */
- }
- }
+ /*
+ ** Check if the visual ID is valid for this screen.
+ */
+ pVisual = pScreen->visuals;
+ for (i = 0; i < pScreen->numVisuals; i++, pVisual++) {
+ if (pVisual->vid == visual) {
+ break;
+ }
+ }
+ if (i == pScreen->numVisuals) {
+ client->errorValue = visual;
+ free(glxc);
+ return BadValue;
+ }
+
+ pGlxVisual = pGlxScreen->pGlxVisual;
+ for (i = 0; i < pGlxScreen->numVisuals; i++, pGlxVisual++) {
+ if (pGlxVisual->vid == visual) {
+ break;
+ }
+ }
+ if (i == pGlxScreen->numVisuals) {
+ /*
+ ** Visual not support on this screen by this OpenGL implementation.
+ */
+ client->errorValue = visual;
+ free(glxc);
+ return BadValue;
+ }
+
+ if (glxc->pFBConfig == NULL) {
+ glxc->pFBConfig = glxLookupFBConfigByVID(visual);
+
+ if (glxc->pFBConfig == NULL) {
+ /*
+ * visual does not have an FBConfig ???
+ client->errorValue = visual;
+ free( glxc );
+ return BadValue;
+ */
+ }
+ }
}
else {
- pVisual = NULL;
- pGlxVisual = NULL;
+ pVisual = NULL;
+ pGlxVisual = NULL;
}
glxc->pScreen = pScreen;
@@ -256,140 +263,152 @@ static int CreateContext(__GLXclientState *cl,
* allocate memory for back-end servers info
*/
num_be_screens = to_screen - from_screen + 1;
- glxc->real_ids = (XID *)malloc(sizeof(XID) * num_be_screens);
+ glxc->real_ids = (XID *) malloc(sizeof(XID) * num_be_screens);
if (!glxc->real_ids) {
- return BadAlloc;
+ return BadAlloc;
}
- glxc->real_vids = (XID *)malloc(sizeof(XID) * num_be_screens);
+ glxc->real_vids = (XID *) malloc(sizeof(XID) * num_be_screens);
if (!glxc->real_vids) {
- return BadAlloc;
+ return BadAlloc;
}
for (screen = from_screen; screen <= to_screen; screen++) {
- int sent = 0;
- pScreen = screenInfo.screens[screen];
- pGlxScreen = &__glXActiveScreens[screen];
- dmxScreen = &dmxScreens[screen];
-
- if (glxc->pFBConfig) {
- __GLXFBConfig *beFBConfig = glxLookupBackEndFBConfig( glxc->pFBConfig->id,
- screen );
- be_fbconfigId = beFBConfig->id;
- }
-
- if (pGlxVisual) {
-
- be_vid = glxMatchGLXVisualInConfigList( pGlxVisual,
- dmxScreen->glxVisuals,
- dmxScreen->numGlxVisuals );
-
- if (!be_vid) {
- /* visual is not supported on the back-end server */
- free( glxc->real_ids );
- free( glxc->real_vids );
- free( glxc );
- return BadValue;
- }
- }
-
- glxc->real_ids[screen-from_screen] = XAllocID(GetBackEndDisplay(cl,screen));
-
- /* send the create context request to the back-end server */
- dpy = GetBackEndDisplay(cl,screen);
- if (glxc->pFBConfig) {
- /*Since for a certain visual both RGB and COLOR INDEX
- *can be on then the only parmeter to choose the renderType
- * should be the class of the colormap since all 4 first
- * classes does not support RGB mode only COLOR INDEX ,
- * and so TrueColor and DirectColor does not support COLOR INDEX*/
- int renderType = glxc->pFBConfig->renderType;
- if ( pVisual ) {
- switch ( pVisual->class ){
- case PseudoColor:
- case StaticColor:
- case GrayScale:
- case StaticGray:
- renderType = GLX_COLOR_INDEX_TYPE;
- break;
- case TrueColor:
- case DirectColor:
- default:
- renderType = GLX_RGBA_TYPE;
- break;
- }
- }
- if ( __GLX_IS_VERSION_SUPPORTED(1,3) ) {
- LockDisplay(dpy);
- GetReq(GLXCreateNewContext,be_new_req);
- be_new_req->reqType = dmxScreen->glxMajorOpcode;
- be_new_req->glxCode = X_GLXCreateNewContext;
- be_new_req->context = (unsigned int)glxc->real_ids[screen-from_screen];
- be_new_req->fbconfig = (unsigned int)be_fbconfigId;
- be_new_req->screen = DefaultScreen(dpy);
- be_new_req->renderType = renderType;
-
- be_new_req->shareList = (shareglxc ? shareglxc->real_ids[screen-from_screen] : 0);
- be_new_req->isDirect = 0;
- UnlockDisplay(dpy);
- glxc->real_vids[screen-from_screen] = be_fbconfigId;
- sent = 1;
- }
- else if (glxIsExtensionSupported("GLX_SGIX_fbconfig")) {
-
- xGLXCreateContextWithConfigSGIXReq *ext_req;
- xGLXVendorPrivateReq *vpreq;
- LockDisplay(dpy);
- GetReqExtra(GLXVendorPrivate,
- sz_xGLXCreateContextWithConfigSGIXReq - sz_xGLXVendorPrivateReq,
- vpreq);
- ext_req = (xGLXCreateContextWithConfigSGIXReq *)vpreq;
- ext_req->reqType = dmxScreen->glxMajorOpcode;
- ext_req->glxCode = X_GLXVendorPrivate;
- ext_req->vendorCode = X_GLXvop_CreateContextWithConfigSGIX;
- ext_req->context = (unsigned int)glxc->real_ids[screen-from_screen];
- ext_req->fbconfig = (unsigned int)be_fbconfigId;
- ext_req->screen = DefaultScreen(dpy);
- ext_req->renderType = renderType;
- ext_req->shareList = (shareglxc ? shareglxc->real_ids[screen-from_screen] : 0);
- ext_req->isDirect = 0;
- UnlockDisplay(dpy);
- glxc->real_vids[screen-from_screen] = be_fbconfigId;
- sent = 1;
- }
- }
-
- if (!sent) {
- LockDisplay(dpy);
- GetReq(GLXCreateContext,be_req);
- be_req->reqType = dmxScreen->glxMajorOpcode;
- be_req->glxCode = X_GLXCreateContext;
- be_req->context = (unsigned int)glxc->real_ids[screen-from_screen];
- be_req->visual = (unsigned int)be_vid;
- be_req->screen = DefaultScreen(dpy);
- be_req->shareList = (shareglxc ? shareglxc->real_ids[screen-from_screen] : 0);
- be_req->isDirect = 0;
- UnlockDisplay(dpy);
- glxc->real_vids[screen-from_screen] = be_vid;
- }
- SyncHandle();
+ int sent = 0;
+
+ pScreen = screenInfo.screens[screen];
+ pGlxScreen = &__glXActiveScreens[screen];
+ dmxScreen = &dmxScreens[screen];
+
+ if (glxc->pFBConfig) {
+ __GLXFBConfig *beFBConfig =
+ glxLookupBackEndFBConfig(glxc->pFBConfig->id,
+ screen);
+
+ be_fbconfigId = beFBConfig->id;
+ }
+
+ if (pGlxVisual) {
+
+ be_vid = glxMatchGLXVisualInConfigList(pGlxVisual,
+ dmxScreen->glxVisuals,
+ dmxScreen->numGlxVisuals);
+
+ if (!be_vid) {
+ /* visual is not supported on the back-end server */
+ free(glxc->real_ids);
+ free(glxc->real_vids);
+ free(glxc);
+ return BadValue;
+ }
+ }
+
+ glxc->real_ids[screen - from_screen] =
+ XAllocID(GetBackEndDisplay(cl, screen));
+
+ /* send the create context request to the back-end server */
+ dpy = GetBackEndDisplay(cl, screen);
+ if (glxc->pFBConfig) {
+ /*Since for a certain visual both RGB and COLOR INDEX
+ *can be on then the only parmeter to choose the renderType
+ * should be the class of the colormap since all 4 first
+ * classes does not support RGB mode only COLOR INDEX ,
+ * and so TrueColor and DirectColor does not support COLOR INDEX*/
+ int renderType = glxc->pFBConfig->renderType;
+
+ if (pVisual) {
+ switch (pVisual->class) {
+ case PseudoColor:
+ case StaticColor:
+ case GrayScale:
+ case StaticGray:
+ renderType = GLX_COLOR_INDEX_TYPE;
+ break;
+ case TrueColor:
+ case DirectColor:
+ default:
+ renderType = GLX_RGBA_TYPE;
+ break;
+ }
+ }
+ if (__GLX_IS_VERSION_SUPPORTED(1, 3)) {
+ LockDisplay(dpy);
+ GetReq(GLXCreateNewContext, be_new_req);
+ be_new_req->reqType = dmxScreen->glxMajorOpcode;
+ be_new_req->glxCode = X_GLXCreateNewContext;
+ be_new_req->context =
+ (unsigned int) glxc->real_ids[screen - from_screen];
+ be_new_req->fbconfig = (unsigned int) be_fbconfigId;
+ be_new_req->screen = DefaultScreen(dpy);
+ be_new_req->renderType = renderType;
+
+ be_new_req->shareList =
+ (shareglxc ? shareglxc->real_ids[screen - from_screen] : 0);
+ be_new_req->isDirect = 0;
+ UnlockDisplay(dpy);
+ glxc->real_vids[screen - from_screen] = be_fbconfigId;
+ sent = 1;
+ }
+ else if (glxIsExtensionSupported("GLX_SGIX_fbconfig")) {
+
+ xGLXCreateContextWithConfigSGIXReq *ext_req;
+ xGLXVendorPrivateReq *vpreq;
+
+ LockDisplay(dpy);
+ GetReqExtra(GLXVendorPrivate,
+ sz_xGLXCreateContextWithConfigSGIXReq -
+ sz_xGLXVendorPrivateReq, vpreq);
+ ext_req = (xGLXCreateContextWithConfigSGIXReq *) vpreq;
+ ext_req->reqType = dmxScreen->glxMajorOpcode;
+ ext_req->glxCode = X_GLXVendorPrivate;
+ ext_req->vendorCode = X_GLXvop_CreateContextWithConfigSGIX;
+ ext_req->context =
+ (unsigned int) glxc->real_ids[screen - from_screen];
+ ext_req->fbconfig = (unsigned int) be_fbconfigId;
+ ext_req->screen = DefaultScreen(dpy);
+ ext_req->renderType = renderType;
+ ext_req->shareList =
+ (shareglxc ? shareglxc->real_ids[screen - from_screen] : 0);
+ ext_req->isDirect = 0;
+ UnlockDisplay(dpy);
+ glxc->real_vids[screen - from_screen] = be_fbconfigId;
+ sent = 1;
+ }
+ }
+
+ if (!sent) {
+ LockDisplay(dpy);
+ GetReq(GLXCreateContext, be_req);
+ be_req->reqType = dmxScreen->glxMajorOpcode;
+ be_req->glxCode = X_GLXCreateContext;
+ be_req->context =
+ (unsigned int) glxc->real_ids[screen - from_screen];
+ be_req->visual = (unsigned int) be_vid;
+ be_req->screen = DefaultScreen(dpy);
+ be_req->shareList =
+ (shareglxc ? shareglxc->real_ids[screen - from_screen] : 0);
+ be_req->isDirect = 0;
+ UnlockDisplay(dpy);
+ glxc->real_vids[screen - from_screen] = be_vid;
+ }
+ SyncHandle();
}
/*
- ** Register this context as a resource.
- */
- if (!AddResource(gcId, __glXContextRes, (pointer)glxc)) {
- free( glxc->real_ids );
- free( glxc->real_vids );
- free( glxc );
- client->errorValue = gcId;
- return BadAlloc;
- }
-
+ ** Register this context as a resource.
+ */
+ if (!AddResource(gcId, __glXContextRes, (pointer) glxc)) {
+ free(glxc->real_ids);
+ free(glxc->real_vids);
+ free(glxc);
+ client->errorValue = gcId;
+ return BadAlloc;
+ }
+
/*
- ** Finally, now that everything is working, setup the rest of the
- ** context.
- */
+ ** Finally, now that everything is working, setup the rest of the
+ ** context.
+ */
glxc->id = gcId;
glxc->share_id = shareList;
glxc->idExists = GL_TRUE;
@@ -398,38 +417,43 @@ static int CreateContext(__GLXclientState *cl,
return Success;
}
-int __glXCreateContext(__GLXclientState *cl, GLbyte *pc)
+int
+__glXCreateContext(__GLXclientState * cl, GLbyte * pc)
{
xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc;
- return( CreateContext(cl, req->context,req->visual, None,
- req->screen, req->shareList, req->isDirect) );
+ return (CreateContext(cl, req->context, req->visual, None,
+ req->screen, req->shareList, req->isDirect));
}
-int __glXCreateNewContext(__GLXclientState *cl, GLbyte *pc)
+int
+__glXCreateNewContext(__GLXclientState * cl, GLbyte * pc)
{
xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc;
- return( CreateContext(cl, req->context,None, req->fbconfig,
- req->screen, req->shareList, req->isDirect) );
+ return (CreateContext(cl, req->context, None, req->fbconfig,
+ req->screen, req->shareList, req->isDirect));
}
-int __glXCreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
+int
+__glXCreateContextWithConfigSGIX(__GLXclientState * cl, GLbyte * pc)
{
- xGLXCreateContextWithConfigSGIXReq *req = (xGLXCreateContextWithConfigSGIXReq *) pc;
+ xGLXCreateContextWithConfigSGIXReq *req =
+ (xGLXCreateContextWithConfigSGIXReq *) pc;
- return( CreateContext(cl, req->context, None, req->fbconfig,
- req->screen, req->shareList, req->isDirect) );
+ return (CreateContext(cl, req->context, None, req->fbconfig,
+ req->screen, req->shareList, req->isDirect));
}
-int __glXQueryMaxSwapBarriersSGIX(__GLXclientState *cl, GLbyte *pc)
+int
+__glXQueryMaxSwapBarriersSGIX(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXQueryMaxSwapBarriersSGIXReq *req =
- (xGLXQueryMaxSwapBarriersSGIXReq *)pc;
+ (xGLXQueryMaxSwapBarriersSGIXReq *) pc;
xGLXQueryMaxSwapBarriersSGIXReply reply;
reply.type = X_Reply;
@@ -438,19 +462,21 @@ int __glXQueryMaxSwapBarriersSGIX(__GLXclientState *cl, GLbyte *pc)
reply.max = QueryMaxSwapBarriersSGIX(req->screen);
if (client->swapped) {
- __glXSwapQueryMaxSwapBarriersSGIXReply(client, &reply);
- } else {
- WriteToClient(client, sz_xGLXQueryMaxSwapBarriersSGIXReply,
- (char *)&reply);
+ __glXSwapQueryMaxSwapBarriersSGIXReply(client, &reply);
+ }
+ else {
+ WriteToClient(client, sz_xGLXQueryMaxSwapBarriersSGIXReply,
+ (char *) &reply);
}
return Success;
}
-int __glXBindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc)
+int
+__glXBindSwapBarrierSGIX(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
- xGLXBindSwapBarrierSGIXReq *req = (xGLXBindSwapBarrierSGIXReq *)pc;
+ xGLXBindSwapBarrierSGIXReq *req = (xGLXBindSwapBarrierSGIXReq *) pc;
DrawablePtr pDraw;
__GLXpixmap *pGlxPixmap = NULL;
__glXWindow *pGlxWindow = NULL;
@@ -458,29 +484,32 @@ int __glXBindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc)
rc = dixLookupDrawable(&pDraw, req->drawable, client, 0, DixGetAttrAccess);
if (rc != Success) {
- dixLookupResourceByType((pointer*) &pGlxPixmap, req->drawable,
- __glXPixmapRes, NullClient, DixUnknownAccess);
- if (pGlxPixmap) pDraw = pGlxPixmap->pDraw;
+ dixLookupResourceByType((pointer *) &pGlxPixmap, req->drawable,
+ __glXPixmapRes, NullClient, DixUnknownAccess);
+ if (pGlxPixmap)
+ pDraw = pGlxPixmap->pDraw;
}
- if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
- dixLookupResourceByType((pointer*) &pGlxWindow, req->drawable,
- __glXWindowRes, NullClient, DixUnknownAccess);
- if (pGlxWindow) pDraw = pGlxWindow->pDraw;
+ if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1, 3)) {
+ dixLookupResourceByType((pointer *) &pGlxWindow, req->drawable,
+ __glXWindowRes, NullClient, DixUnknownAccess);
+ if (pGlxWindow)
+ pDraw = pGlxWindow->pDraw;
}
if (!pDraw) {
- client->errorValue = req->drawable;
- return __glXBadDrawable;
+ client->errorValue = req->drawable;
+ return __glXBadDrawable;
}
return BindSwapBarrierSGIX(pDraw, req->barrier);
}
-int __glXJoinSwapGroupSGIX(__GLXclientState *cl, GLbyte *pc)
+int
+__glXJoinSwapGroupSGIX(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
- xGLXJoinSwapGroupSGIXReq *req = (xGLXJoinSwapGroupSGIXReq *)pc;
+ xGLXJoinSwapGroupSGIXReq *req = (xGLXJoinSwapGroupSGIXReq *) pc;
DrawablePtr pDraw, pMember = NULL;
__GLXpixmap *pGlxPixmap = NULL;
__glXWindow *pGlxWindow = NULL;
@@ -488,53 +517,57 @@ int __glXJoinSwapGroupSGIX(__GLXclientState *cl, GLbyte *pc)
rc = dixLookupDrawable(&pDraw, req->drawable, client, 0, DixManageAccess);
if (rc != Success) {
- dixLookupResourceByType((pointer*) &pGlxPixmap, req->drawable,
- __glXPixmapRes, NullClient, DixUnknownAccess);
- if (pGlxPixmap) pDraw = pGlxPixmap->pDraw;
+ dixLookupResourceByType((pointer *) &pGlxPixmap, req->drawable,
+ __glXPixmapRes, NullClient, DixUnknownAccess);
+ if (pGlxPixmap)
+ pDraw = pGlxPixmap->pDraw;
}
- if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
- dixLookupResourceByType((pointer*) &pGlxWindow, req->drawable,
- __glXWindowRes, NullClient, DixUnknownAccess);
- if (pGlxWindow) pDraw = pGlxWindow->pDraw;
+ if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1, 3)) {
+ dixLookupResourceByType((pointer *) &pGlxWindow, req->drawable,
+ __glXWindowRes, NullClient, DixUnknownAccess);
+ if (pGlxWindow)
+ pDraw = pGlxWindow->pDraw;
}
if (!pDraw) {
- client->errorValue = req->drawable;
- return __glXBadDrawable;
+ client->errorValue = req->drawable;
+ return __glXBadDrawable;
}
if (req->member != None) {
- rc = dixLookupDrawable(&pMember, req->member, client, 0,
- DixGetAttrAccess);
- if (rc != Success) {
- dixLookupResourceByType((pointer*) &pGlxPixmap, req->member,
+ rc = dixLookupDrawable(&pMember, req->member, client, 0,
+ DixGetAttrAccess);
+ if (rc != Success) {
+ dixLookupResourceByType((pointer *) &pGlxPixmap, req->member,
__glXPixmapRes, NullClient,
DixUnknownAccess);
- if (pGlxPixmap) pMember = pGlxPixmap->pDraw;
- }
+ if (pGlxPixmap)
+ pMember = pGlxPixmap->pDraw;
+ }
- if (!pMember && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
- dixLookupResourceByType((pointer*) &pGlxWindow, req->member,
+ if (!pMember && __GLX_IS_VERSION_SUPPORTED(1, 3)) {
+ dixLookupResourceByType((pointer *) &pGlxWindow, req->member,
__glXWindowRes, NullClient,
DixUnknownAccess);
- if (pGlxWindow) pMember = pGlxWindow->pDraw;
- }
+ if (pGlxWindow)
+ pMember = pGlxWindow->pDraw;
+ }
- if (!pMember) {
- client->errorValue = req->member;
- return __glXBadDrawable;
- }
+ if (!pMember) {
+ client->errorValue = req->member;
+ return __glXBadDrawable;
+ }
}
return JoinSwapGroupSGIX(pDraw, pMember);
}
-
/*
** Destroy a GL context as an X resource.
*/
-int __glXDestroyContext(__GLXclientState *cl, GLbyte *pc)
+int
+__glXDestroyContext(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc;
@@ -544,46 +577,47 @@ int __glXDestroyContext(__GLXclientState *cl, GLbyte *pc)
int from_screen = 0;
int to_screen = 0;
int s;
-
- dixLookupResourceByType((pointer*) &glxc, gcId, __glXContextRes,
- NullClient, DixUnknownAccess);
+
+ dixLookupResourceByType((pointer *) &glxc, gcId, __glXContextRes,
+ NullClient, DixUnknownAccess);
if (glxc) {
- /*
- ** Just free the resource; don't actually destroy the context,
- ** because it might be in use. The
- ** destroy method will be called by the resource destruction routine
- ** if necessary.
- */
- FreeResourceByType(gcId, __glXContextRes, FALSE);
+ /*
+ ** Just free the resource; don't actually destroy the context,
+ ** because it might be in use. The
+ ** destroy method will be called by the resource destruction routine
+ ** if necessary.
+ */
+ FreeResourceByType(gcId, __glXContextRes, FALSE);
- from_screen = to_screen = glxc->pScreen->myNum;
+ from_screen = to_screen = glxc->pScreen->myNum;
- } else {
- client->errorValue = gcId;
- return __glXBadContext;
+ }
+ else {
+ client->errorValue = gcId;
+ return __glXBadContext;
}
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
- from_screen = 0;
- to_screen = screenInfo.numScreens - 1;
+ from_screen = 0;
+ to_screen = screenInfo.numScreens - 1;
}
#endif
/*
* send DestroyContext request to all back-end servers
*/
- for (s=from_screen; s<=to_screen; s++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[s];
- Display *dpy = GetBackEndDisplay(cl,s);
+ for (s = from_screen; s <= to_screen; s++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[s];
+ Display *dpy = GetBackEndDisplay(cl, s);
- LockDisplay(dpy);
- GetReq(GLXDestroyContext,be_req);
- be_req->reqType = dmxScreen->glxMajorOpcode;
- be_req->glxCode = X_GLXDestroyContext;
- be_req->context = glxc->real_ids[s-from_screen];
- UnlockDisplay(dpy);
- SyncHandle();
+ LockDisplay(dpy);
+ GetReq(GLXDestroyContext, be_req);
+ be_req->reqType = dmxScreen->glxMajorOpcode;
+ be_req->glxCode = X_GLXDestroyContext;
+ be_req->context = glxc->real_ids[s - from_screen];
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return Success;
@@ -600,83 +634,97 @@ int __glXDestroyContext(__GLXclientState *cl, GLbyte *pc)
/*
** Add a current context, and return the tag that will be used to refer to it.
*/
-static int AddCurrentContext(__GLXclientState *cl, __GLXcontext *glxc, DrawablePtr pDraw)
+static int
+AddCurrentContext(__GLXclientState * cl, __GLXcontext * glxc, DrawablePtr pDraw)
{
int i;
int num = cl->numCurrentContexts;
__GLXcontext **table = cl->currentContexts;
- if (!glxc) return -1;
-
+ if (!glxc)
+ return -1;
+
/*
- ** Try to find an empty slot and use it.
- */
- for (i=0; i < num; i++) {
- if (!table[i]) {
- table[i] = glxc;
- return i+1;
- }
+ ** Try to find an empty slot and use it.
+ */
+ for (i = 0; i < num; i++) {
+ if (!table[i]) {
+ table[i] = glxc;
+ return i + 1;
+ }
}
/*
- ** Didn't find a free slot, so we'll have to grow the table.
- */
+ ** Didn't find a free slot, so we'll have to grow the table.
+ */
if (!num) {
- table = (__GLXcontext **) malloc(sizeof(__GLXcontext *));
- cl->currentDrawables = (DrawablePtr *) malloc(sizeof(DrawablePtr));
- cl->be_currentCTag = (GLXContextTag *) malloc(screenInfo.numScreens *sizeof(GLXContextTag));
- } else {
- table = (__GLXcontext **) realloc(table,
- (num+1)*sizeof(__GLXcontext *));
- cl->currentDrawables = (DrawablePtr *) realloc(
- cl->currentDrawables ,
- (num+1)*sizeof(DrawablePtr));
- cl->be_currentCTag = (GLXContextTag *) realloc(cl->be_currentCTag,
- (num+1)*screenInfo.numScreens*sizeof(GLXContextTag));
+ table = (__GLXcontext **) malloc(sizeof(__GLXcontext *));
+ cl->currentDrawables = (DrawablePtr *) malloc(sizeof(DrawablePtr));
+ cl->be_currentCTag =
+ (GLXContextTag *) malloc(screenInfo.numScreens *
+ sizeof(GLXContextTag));
+ }
+ else {
+ table = (__GLXcontext **) realloc(table,
+ (num + 1) * sizeof(__GLXcontext *));
+ cl->currentDrawables = (DrawablePtr *) realloc(cl->currentDrawables,
+ (num +
+ 1) *
+ sizeof(DrawablePtr));
+ cl->be_currentCTag =
+ (GLXContextTag *) realloc(cl->be_currentCTag,
+ (num +
+ 1) * screenInfo.numScreens *
+ sizeof(GLXContextTag));
}
table[num] = glxc;
cl->currentDrawables[num] = pDraw;
cl->currentContexts = table;
cl->numCurrentContexts++;
- memset(cl->be_currentCTag + num*screenInfo.numScreens, 0,
- screenInfo.numScreens * sizeof(GLXContextTag));
+ memset(cl->be_currentCTag + num * screenInfo.numScreens, 0,
+ screenInfo.numScreens * sizeof(GLXContextTag));
- return num+1;
+ return num + 1;
}
/*
** Given a tag, change the current context for the corresponding entry.
*/
-static void ChangeCurrentContext(__GLXclientState *cl, __GLXcontext *glxc,
- GLXContextTag tag)
+static void
+ChangeCurrentContext(__GLXclientState * cl, __GLXcontext * glxc,
+ GLXContextTag tag)
{
__GLXcontext **table = cl->currentContexts;
- table[tag-1] = glxc;
+
+ table[tag - 1] = glxc;
}
/*
** Given a tag, and back-end screen number, retrives the current back-end
** tag.
*/
-int GetCurrentBackEndTag(__GLXclientState *cl, GLXContextTag tag, int s)
+int
+GetCurrentBackEndTag(__GLXclientState * cl, GLXContextTag tag, int s)
{
- if (tag >0) {
- return( cl->be_currentCTag[ (tag-1)*screenInfo.numScreens + s ] );
- }
- else {
- return 0;
- }
+ if (tag > 0) {
+ return (cl->be_currentCTag[(tag - 1) * screenInfo.numScreens + s]);
+ }
+ else {
+ return 0;
+ }
}
/*
** Given a tag, and back-end screen number, sets the current back-end
** tag.
*/
-static void SetCurrentBackEndTag(__GLXclientState *cl, GLXContextTag tag, int s, GLXContextTag be_tag)
+static void
+SetCurrentBackEndTag(__GLXclientState * cl, GLXContextTag tag, int s,
+ GLXContextTag be_tag)
{
- if (tag >0) {
- cl->be_currentCTag[ (tag-1)*screenInfo.numScreens + s ] = be_tag;
- }
+ if (tag > 0) {
+ cl->be_currentCTag[(tag - 1) * screenInfo.numScreens + s] = be_tag;
+ }
}
/*
@@ -684,45 +732,51 @@ static void SetCurrentBackEndTag(__GLXclientState *cl, GLXContextTag tag, int s,
** context's entry in the table as the context tag. A tag must be greater
** than 0.
*/
-__GLXcontext *__glXLookupContextByTag(__GLXclientState *cl, GLXContextTag tag)
+__GLXcontext *
+__glXLookupContextByTag(__GLXclientState * cl, GLXContextTag tag)
{
int num = cl->numCurrentContexts;
if (tag < 1 || tag > num) {
- return 0;
- } else {
- return cl->currentContexts[tag-1];
+ return 0;
+ }
+ else {
+ return cl->currentContexts[tag - 1];
}
}
-DrawablePtr __glXLookupDrawableByTag(__GLXclientState *cl, GLXContextTag tag)
+DrawablePtr
+__glXLookupDrawableByTag(__GLXclientState * cl, GLXContextTag tag)
{
int num = cl->numCurrentContexts;
if (tag < 1 || tag > num) {
- return 0;
- } else {
- return cl->currentDrawables[tag-1];
+ return 0;
+ }
+ else {
+ return cl->currentDrawables[tag - 1];
}
}
/*****************************************************************************/
-static void StopUsingContext(__GLXcontext *glxc)
+static void
+StopUsingContext(__GLXcontext * glxc)
{
if (glxc) {
- if (glxc == __glXLastContext) {
- /* Tell server GL library */
- __glXLastContext = 0;
- }
- glxc->isCurrent = GL_FALSE;
- if (!glxc->idExists) {
- __glXFreeContext(glxc);
- }
+ if (glxc == __glXLastContext) {
+ /* Tell server GL library */
+ __glXLastContext = 0;
+ }
+ glxc->isCurrent = GL_FALSE;
+ if (!glxc->idExists) {
+ __glXFreeContext(glxc);
+ }
}
}
-static void StartUsingContext(__GLXclientState *cl, __GLXcontext *glxc)
+static void
+StartUsingContext(__GLXclientState * cl, __GLXcontext * glxc)
{
glxc->isCurrent = GL_TRUE;
}
@@ -731,11 +785,11 @@ static void StartUsingContext(__GLXclientState *cl, __GLXcontext *glxc)
/*
** Make an OpenGL context and drawable current.
*/
-static int MakeCurrent(__GLXclientState *cl,
- GLXDrawable drawable,
- GLXDrawable readdrawable,
- GLXContextID context,
- GLXContextTag oldContextTag)
+static int
+MakeCurrent(__GLXclientState * cl,
+ GLXDrawable drawable,
+ GLXDrawable readdrawable,
+ GLXContextID context, GLXContextTag oldContextTag)
{
ClientPtr client = cl->client;
DrawablePtr pDraw = NULL;
@@ -758,6 +812,7 @@ static int MakeCurrent(__GLXclientState *cl,
__glXWindow *pGlxReadWindow = NULL;
__glXPbuffer *pGlxPbuffer = NULL;
__glXPbuffer *pGlxReadPbuffer = NULL;
+
#ifdef PANORAMIX
PanoramiXRes *pXinDraw = NULL;
PanoramiXRes *pXinReadDraw = NULL;
@@ -767,117 +822,122 @@ static int MakeCurrent(__GLXclientState *cl,
int s, rc;
/*
- ** If one is None and the other isn't, it's a bad match.
- */
+ ** If one is None and the other isn't, it's a bad match.
+ */
if ((drawId == None && contextId != None) ||
- (drawId != None && contextId == None)) {
- return BadMatch;
+ (drawId != None && contextId == None)) {
+ return BadMatch;
}
-
+
/*
- ** Lookup old context. If we have one, it must be in a usable state.
- */
+ ** Lookup old context. If we have one, it must be in a usable state.
+ */
if (tag != 0) {
- prevglxc = __glXLookupContextByTag(cl, tag);
- if (!prevglxc) {
- /*
- ** Tag for previous context is invalid.
- */
- return __glXBadContextTag;
- }
- } else {
- prevglxc = 0;
+ prevglxc = __glXLookupContextByTag(cl, tag);
+ if (!prevglxc) {
+ /*
+ ** Tag for previous context is invalid.
+ */
+ return __glXBadContextTag;
+ }
+ }
+ else {
+ prevglxc = 0;
}
/*
- ** Lookup new context. It must not be current for someone else.
- */
+ ** Lookup new context. It must not be current for someone else.
+ */
if (contextId != None) {
- dixLookupResourceByType((pointer*) &glxc, contextId, __glXContextRes,
- NullClient, DixUnknownAccess);
- if (!glxc) {
- client->errorValue = contextId;
- return __glXBadContext;
- }
- if ((glxc != prevglxc) && glxc->isCurrent) {
- /* Context is current to somebody else */
- return BadAccess;
- }
- } else {
- /* Switching to no context. Ignore new drawable. */
- glxc = 0;
+ dixLookupResourceByType((pointer *) &glxc, contextId, __glXContextRes,
+ NullClient, DixUnknownAccess);
+ if (!glxc) {
+ client->errorValue = contextId;
+ return __glXBadContext;
+ }
+ if ((glxc != prevglxc) && glxc->isCurrent) {
+ /* Context is current to somebody else */
+ return BadAccess;
+ }
+ }
+ else {
+ /* Switching to no context. Ignore new drawable. */
+ glxc = 0;
}
if (drawId != None) {
- rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixWriteAccess);
- if (rc == Success) {
- if (pDraw->type == DRAWABLE_WINDOW) {
- /*
- ** Drawable is an X Window.
- */
- VisualID vid;
- pWin = (WindowPtr)pDraw;
- vid = wVisual(pWin);
-
- new_reply.writeVid = (glxc->pFBConfig ? glxc->pFBConfig->id : vid);
- new_reply.writeType = GLX_WINDOW_TYPE;
-
- /*
- ** Check if window and context are similar.
- */
- if ((vid != glxc->pVisual->vid) ||
- (pWin->drawable.pScreen != glxc->pScreen)) {
- client->errorValue = drawId;
- return BadMatch;
- }
-
- from_screen = to_screen = pWin->drawable.pScreen->myNum;
-
- } else {
- /*
- ** An X Pixmap is not allowed as a parameter (a GLX Pixmap
- ** is, but it must first be created with glxCreateGLXPixmap).
- */
- client->errorValue = drawId;
- return __glXBadDrawable;
- }
- }
+ rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixWriteAccess);
+ if (rc == Success) {
+ if (pDraw->type == DRAWABLE_WINDOW) {
+ /*
+ ** Drawable is an X Window.
+ */
+ VisualID vid;
+
+ pWin = (WindowPtr) pDraw;
+ vid = wVisual(pWin);
+
+ new_reply.writeVid =
+ (glxc->pFBConfig ? glxc->pFBConfig->id : vid);
+ new_reply.writeType = GLX_WINDOW_TYPE;
+
+ /*
+ ** Check if window and context are similar.
+ */
+ if ((vid != glxc->pVisual->vid) ||
+ (pWin->drawable.pScreen != glxc->pScreen)) {
+ client->errorValue = drawId;
+ return BadMatch;
+ }
+
+ from_screen = to_screen = pWin->drawable.pScreen->myNum;
+
+ }
+ else {
+ /*
+ ** An X Pixmap is not allowed as a parameter (a GLX Pixmap
+ ** is, but it must first be created with glxCreateGLXPixmap).
+ */
+ client->errorValue = drawId;
+ return __glXBadDrawable;
+ }
+ }
if (!pDraw) {
- dixLookupResourceByType((pointer*) &pGlxPixmap, drawId,
- __glXPixmapRes, NullClient,
- DixUnknownAccess);
- if (pGlxPixmap) {
- /*
- ** Check if pixmap and context are similar.
- */
- if (pGlxPixmap->pScreen != glxc->pScreen ||
- pGlxPixmap->pGlxVisual != glxc->pGlxVisual) {
- client->errorValue = drawId;
- return BadMatch;
- }
- pDraw = pGlxPixmap->pDraw;
-
- new_reply.writeVid = (glxc->pFBConfig ? glxc->pFBConfig->id :
- pGlxPixmap->pGlxVisual->vid);
-
- new_reply.writeType = GLX_PIXMAP_TYPE;
-
- from_screen = to_screen = pGlxPixmap->pScreen->myNum;
-
- }
- }
-
- if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
- dixLookupResourceByType((pointer*) &pGlxWindow, drawId,
- __glXWindowRes, NullClient,
- DixUnknownAccess);
+ dixLookupResourceByType((pointer *) &pGlxPixmap, drawId,
+ __glXPixmapRes, NullClient,
+ DixUnknownAccess);
+ if (pGlxPixmap) {
+ /*
+ ** Check if pixmap and context are similar.
+ */
+ if (pGlxPixmap->pScreen != glxc->pScreen ||
+ pGlxPixmap->pGlxVisual != glxc->pGlxVisual) {
+ client->errorValue = drawId;
+ return BadMatch;
+ }
+ pDraw = pGlxPixmap->pDraw;
+
+ new_reply.writeVid = (glxc->pFBConfig ? glxc->pFBConfig->id :
+ pGlxPixmap->pGlxVisual->vid);
+
+ new_reply.writeType = GLX_PIXMAP_TYPE;
+
+ from_screen = to_screen = pGlxPixmap->pScreen->myNum;
+
+ }
+ }
+
+ if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1, 3)) {
+ dixLookupResourceByType((pointer *) &pGlxWindow, drawId,
+ __glXWindowRes, NullClient,
+ DixUnknownAccess);
if (pGlxWindow) {
/*
- ** Drawable is a GLXWindow.
- **
- ** Check if GLX window and context are similar.
- */
+ ** Drawable is a GLXWindow.
+ **
+ ** Check if GLX window and context are similar.
+ */
if (pGlxWindow->pScreen != glxc->pScreen ||
pGlxWindow->pGlxFBConfig != glxc->pFBConfig) {
client->errorValue = drawId;
@@ -889,103 +949,107 @@ static int MakeCurrent(__GLXclientState *cl,
new_reply.writeType = GLX_GLXWINDOW_TYPE;
}
- }
+ }
- if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
- dixLookupResourceByType((pointer*) &pGlxPbuffer, drawId,
- __glXPbufferRes, NullClient,
- DixUnknownAccess);
- if (pGlxPbuffer) {
+ if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1, 3)) {
+ dixLookupResourceByType((pointer *) &pGlxPbuffer, drawId,
+ __glXPbufferRes, NullClient,
+ DixUnknownAccess);
+ if (pGlxPbuffer) {
if (pGlxPbuffer->pScreen != glxc->pScreen ||
pGlxPbuffer->pFBConfig != glxc->pFBConfig) {
client->errorValue = drawId;
return BadMatch;
}
- pDraw = (DrawablePtr)pGlxPbuffer;
+ pDraw = (DrawablePtr) pGlxPbuffer;
new_reply.writeVid = pGlxPbuffer->pFBConfig->id;
new_reply.writeType = GLX_PBUFFER_TYPE;
- }
- }
-
- if (!pDraw) {
- /*
- ** Drawable is not a Window , GLXWindow or a GLXPixmap.
- */
- client->errorValue = drawId;
- return __glXBadDrawable;
- }
-
- } else {
- pDraw = 0;
- }
-
- if (readId != None && readId != drawId ) {
- rc = dixLookupDrawable(&pReadDraw, readId, client, 0, DixReadAccess);
- if (rc == Success) {
- if (pReadDraw->type == DRAWABLE_WINDOW) {
- /*
- ** Drawable is an X Window.
- */
- VisualID vid;
- pReadWin = (WindowPtr)pDraw;
- vid = wVisual(pReadWin);
-
- new_reply.readVid = (glxc->pFBConfig ? glxc->pFBConfig->id : vid);
- new_reply.readType = GLX_WINDOW_TYPE;
-
- /*
- ** Check if window and context are similar.
- */
- if ((vid != glxc->pVisual->vid) ||
- (pReadWin->drawable.pScreen != glxc->pScreen)) {
- client->errorValue = readId;
- return BadMatch;
- }
-
- } else {
-
- /*
- ** An X Pixmap is not allowed as a parameter (a GLX Pixmap
- ** is, but it must first be created with glxCreateGLXPixmap).
- */
- client->errorValue = readId;
- return __glXBadDrawable;
- }
- }
-
- if (!pReadDraw) {
- dixLookupResourceByType((pointer*) &pReadGlxPixmap, readId,
- __glXPixmapRes, NullClient,
- DixUnknownAccess);
- if (pReadGlxPixmap) {
- /*
- ** Check if pixmap and context are similar.
- */
- if (pReadGlxPixmap->pScreen != glxc->pScreen ||
- pReadGlxPixmap->pGlxVisual != glxc->pGlxVisual) {
- client->errorValue = readId;
- return BadMatch;
- }
- pReadDraw = pReadGlxPixmap->pDraw;
-
- new_reply.readVid = (glxc->pFBConfig ? glxc->pFBConfig->id :
- pReadGlxPixmap->pGlxVisual->vid );
- new_reply.readType = GLX_PIXMAP_TYPE;
-
- }
- }
-
- if (!pReadDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
- dixLookupResourceByType((pointer*) &pGlxReadWindow, readId,
- __glXWindowRes, NullClient,
- DixUnknownAccess);
+ }
+ }
+
+ if (!pDraw) {
+ /*
+ ** Drawable is not a Window , GLXWindow or a GLXPixmap.
+ */
+ client->errorValue = drawId;
+ return __glXBadDrawable;
+ }
+
+ }
+ else {
+ pDraw = 0;
+ }
+
+ if (readId != None && readId != drawId) {
+ rc = dixLookupDrawable(&pReadDraw, readId, client, 0, DixReadAccess);
+ if (rc == Success) {
+ if (pReadDraw->type == DRAWABLE_WINDOW) {
+ /*
+ ** Drawable is an X Window.
+ */
+ VisualID vid;
+
+ pReadWin = (WindowPtr) pDraw;
+ vid = wVisual(pReadWin);
+
+ new_reply.readVid =
+ (glxc->pFBConfig ? glxc->pFBConfig->id : vid);
+ new_reply.readType = GLX_WINDOW_TYPE;
+
+ /*
+ ** Check if window and context are similar.
+ */
+ if ((vid != glxc->pVisual->vid) ||
+ (pReadWin->drawable.pScreen != glxc->pScreen)) {
+ client->errorValue = readId;
+ return BadMatch;
+ }
+
+ }
+ else {
+
+ /*
+ ** An X Pixmap is not allowed as a parameter (a GLX Pixmap
+ ** is, but it must first be created with glxCreateGLXPixmap).
+ */
+ client->errorValue = readId;
+ return __glXBadDrawable;
+ }
+ }
+
+ if (!pReadDraw) {
+ dixLookupResourceByType((pointer *) &pReadGlxPixmap, readId,
+ __glXPixmapRes, NullClient,
+ DixUnknownAccess);
+ if (pReadGlxPixmap) {
+ /*
+ ** Check if pixmap and context are similar.
+ */
+ if (pReadGlxPixmap->pScreen != glxc->pScreen ||
+ pReadGlxPixmap->pGlxVisual != glxc->pGlxVisual) {
+ client->errorValue = readId;
+ return BadMatch;
+ }
+ pReadDraw = pReadGlxPixmap->pDraw;
+
+ new_reply.readVid = (glxc->pFBConfig ? glxc->pFBConfig->id :
+ pReadGlxPixmap->pGlxVisual->vid);
+ new_reply.readType = GLX_PIXMAP_TYPE;
+
+ }
+ }
+
+ if (!pReadDraw && __GLX_IS_VERSION_SUPPORTED(1, 3)) {
+ dixLookupResourceByType((pointer *) &pGlxReadWindow, readId,
+ __glXWindowRes, NullClient,
+ DixUnknownAccess);
if (pGlxReadWindow) {
/*
- ** Drawable is a GLXWindow.
- **
- ** Check if GLX window and context are similar.
- */
+ ** Drawable is a GLXWindow.
+ **
+ ** Check if GLX window and context are similar.
+ */
if (pGlxReadWindow->pScreen != glxc->pScreen ||
pGlxReadWindow->pGlxFBConfig != glxc->pFBConfig) {
client->errorValue = readId;
@@ -996,140 +1060,143 @@ static int MakeCurrent(__GLXclientState *cl,
new_reply.readVid = pGlxReadWindow->pGlxFBConfig->id;
new_reply.readType = GLX_GLXWINDOW_TYPE;
}
- }
+ }
- if (!pReadDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
- dixLookupResourceByType((pointer*) &pGlxReadPbuffer, readId,
- __glXPbufferRes, NullClient,
- DixUnknownAccess);
- if (pGlxReadPbuffer) {
+ if (!pReadDraw && __GLX_IS_VERSION_SUPPORTED(1, 3)) {
+ dixLookupResourceByType((pointer *) &pGlxReadPbuffer, readId,
+ __glXPbufferRes, NullClient,
+ DixUnknownAccess);
+ if (pGlxReadPbuffer) {
if (pGlxReadPbuffer->pScreen != glxc->pScreen ||
pGlxReadPbuffer->pFBConfig != glxc->pFBConfig) {
client->errorValue = drawId;
return BadMatch;
}
- pReadDraw = (DrawablePtr)pGlxReadPbuffer;
+ pReadDraw = (DrawablePtr) pGlxReadPbuffer;
new_reply.readVid = pGlxReadPbuffer->pFBConfig->id;
new_reply.readType = GLX_PBUFFER_TYPE;
- }
- }
+ }
+ }
- if (!pReadDraw) {
- /*
- ** Drawable is neither a Window nor a GLXPixmap.
- */
- client->errorValue = readId;
- return __glXBadDrawable;
- }
+ if (!pReadDraw) {
+ /*
+ ** Drawable is neither a Window nor a GLXPixmap.
+ */
+ client->errorValue = readId;
+ return __glXBadDrawable;
+ }
- } else {
- pReadDraw = pDraw;
- pReadGlxPixmap = pGlxPixmap;
- pReadWin = pWin;
- new_reply.readVid = new_reply.writeVid;
- new_reply.readType = new_reply.writeType;
+ }
+ else {
+ pReadDraw = pDraw;
+ pReadGlxPixmap = pGlxPixmap;
+ pReadWin = pWin;
+ new_reply.readVid = new_reply.writeVid;
+ new_reply.readType = new_reply.writeType;
}
if (prevglxc) {
- if (prevglxc->pGlxPixmap) {
- /*
- ** The previous drawable was a glx pixmap, release it.
- */
- prevglxc->pGlxPixmap->refcnt--;
- __glXFreeGLXPixmap( prevglxc->pGlxPixmap );
- prevglxc->pGlxPixmap = 0;
- }
-
- if (prevglxc->pGlxReadPixmap) {
- /*
- ** The previous drawable was a glx pixmap, release it.
- */
- prevglxc->pGlxReadPixmap->refcnt--;
- __glXFreeGLXPixmap( prevglxc->pGlxReadPixmap );
- prevglxc->pGlxReadPixmap = 0;
- }
-
- if (prevglxc->pGlxWindow) {
- /*
- ** The previous drawable was a glx window, release it.
- */
- prevglxc->pGlxWindow->refcnt--;
- __glXFreeGLXWindow( prevglxc->pGlxWindow );
- prevglxc->pGlxWindow = 0;
- }
-
- if (prevglxc->pGlxReadWindow) {
- /*
- ** The previous drawable was a glx window, release it.
- */
- prevglxc->pGlxReadWindow->refcnt--;
- __glXFreeGLXWindow( prevglxc->pGlxReadWindow );
- prevglxc->pGlxReadWindow = 0;
- }
-
- if (prevglxc->pGlxPbuffer) {
- /*
- ** The previous drawable was a glx Pbuffer, release it.
- */
- prevglxc->pGlxPbuffer->refcnt--;
- __glXFreeGLXPbuffer( prevglxc->pGlxPbuffer );
- prevglxc->pGlxPbuffer = 0;
- }
-
- if (prevglxc->pGlxReadPbuffer) {
- /*
- ** The previous drawable was a glx Pbuffer, release it.
- */
- prevglxc->pGlxReadPbuffer->refcnt--;
- __glXFreeGLXPbuffer( prevglxc->pGlxReadPbuffer );
- prevglxc->pGlxReadPbuffer = 0;
- }
-
- ChangeCurrentContext(cl, glxc, tag);
- ChangeCurrentContext(cl, glxc, tag);
- StopUsingContext(prevglxc);
- } else {
- tag = AddCurrentContext(cl, glxc, pDraw);
+ if (prevglxc->pGlxPixmap) {
+ /*
+ ** The previous drawable was a glx pixmap, release it.
+ */
+ prevglxc->pGlxPixmap->refcnt--;
+ __glXFreeGLXPixmap(prevglxc->pGlxPixmap);
+ prevglxc->pGlxPixmap = 0;
+ }
+
+ if (prevglxc->pGlxReadPixmap) {
+ /*
+ ** The previous drawable was a glx pixmap, release it.
+ */
+ prevglxc->pGlxReadPixmap->refcnt--;
+ __glXFreeGLXPixmap(prevglxc->pGlxReadPixmap);
+ prevglxc->pGlxReadPixmap = 0;
+ }
+
+ if (prevglxc->pGlxWindow) {
+ /*
+ ** The previous drawable was a glx window, release it.
+ */
+ prevglxc->pGlxWindow->refcnt--;
+ __glXFreeGLXWindow(prevglxc->pGlxWindow);
+ prevglxc->pGlxWindow = 0;
+ }
+
+ if (prevglxc->pGlxReadWindow) {
+ /*
+ ** The previous drawable was a glx window, release it.
+ */
+ prevglxc->pGlxReadWindow->refcnt--;
+ __glXFreeGLXWindow(prevglxc->pGlxReadWindow);
+ prevglxc->pGlxReadWindow = 0;
+ }
+
+ if (prevglxc->pGlxPbuffer) {
+ /*
+ ** The previous drawable was a glx Pbuffer, release it.
+ */
+ prevglxc->pGlxPbuffer->refcnt--;
+ __glXFreeGLXPbuffer(prevglxc->pGlxPbuffer);
+ prevglxc->pGlxPbuffer = 0;
+ }
+
+ if (prevglxc->pGlxReadPbuffer) {
+ /*
+ ** The previous drawable was a glx Pbuffer, release it.
+ */
+ prevglxc->pGlxReadPbuffer->refcnt--;
+ __glXFreeGLXPbuffer(prevglxc->pGlxReadPbuffer);
+ prevglxc->pGlxReadPbuffer = 0;
+ }
+
+ ChangeCurrentContext(cl, glxc, tag);
+ ChangeCurrentContext(cl, glxc, tag);
+ StopUsingContext(prevglxc);
+ }
+ else {
+ tag = AddCurrentContext(cl, glxc, pDraw);
}
if (glxc) {
- glxc->pGlxPixmap = pGlxPixmap;
- glxc->pGlxReadPixmap = pReadGlxPixmap;
- glxc->pGlxWindow = pGlxWindow;
- glxc->pGlxReadWindow = pGlxReadWindow;
- glxc->pGlxPbuffer = pGlxPbuffer;
- glxc->pGlxReadPbuffer = pGlxReadPbuffer;
+ glxc->pGlxPixmap = pGlxPixmap;
+ glxc->pGlxReadPixmap = pReadGlxPixmap;
+ glxc->pGlxWindow = pGlxWindow;
+ glxc->pGlxReadWindow = pGlxReadWindow;
+ glxc->pGlxPbuffer = pGlxPbuffer;
+ glxc->pGlxReadPbuffer = pGlxReadPbuffer;
- if (pGlxPixmap) {
- pGlxPixmap->refcnt++;
- }
+ if (pGlxPixmap) {
+ pGlxPixmap->refcnt++;
+ }
- if (pReadGlxPixmap) {
- pReadGlxPixmap->refcnt++;
- }
+ if (pReadGlxPixmap) {
+ pReadGlxPixmap->refcnt++;
+ }
- if (pGlxWindow) {
- pGlxWindow->refcnt++;
- }
+ if (pGlxWindow) {
+ pGlxWindow->refcnt++;
+ }
- if (pGlxReadWindow) {
- pGlxReadWindow->refcnt++;
- }
+ if (pGlxReadWindow) {
+ pGlxReadWindow->refcnt++;
+ }
- if (pGlxPbuffer) {
- pGlxPbuffer->refcnt++;
- }
+ if (pGlxPbuffer) {
+ pGlxPbuffer->refcnt++;
+ }
- if (pGlxReadPbuffer) {
- pGlxReadPbuffer->refcnt++;
- }
+ if (pGlxReadPbuffer) {
+ pGlxReadPbuffer->refcnt++;
+ }
- StartUsingContext(cl, glxc);
- new_reply.contextTag = tag;
- } else {
- new_reply.contextTag = 0;
+ StartUsingContext(cl, glxc);
+ new_reply.contextTag = tag;
+ }
+ else {
+ new_reply.contextTag = 0;
}
new_reply.length = 0;
new_reply.type = X_Reply;
@@ -1137,216 +1204,226 @@ static int MakeCurrent(__GLXclientState *cl,
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
- from_screen = 0;
- to_screen = screenInfo.numScreens - 1;
-
- if (pDraw && new_reply.writeType != GLX_PBUFFER_TYPE) {
- dixLookupResourceByClass((pointer*) &pXinDraw,
- pDraw->id, XRC_DRAWABLE,
- client, DixReadAccess);
- }
-
- if (pReadDraw && pReadDraw != pDraw &&
- new_reply.readType != GLX_PBUFFER_TYPE) {
- dixLookupResourceByClass((pointer*) &pXinReadDraw,
- pReadDraw->id, XRC_DRAWABLE,
- client, DixReadAccess);
- }
- else {
- pXinReadDraw = pXinDraw;
- }
+ from_screen = 0;
+ to_screen = screenInfo.numScreens - 1;
+
+ if (pDraw && new_reply.writeType != GLX_PBUFFER_TYPE) {
+ dixLookupResourceByClass((pointer *) &pXinDraw,
+ pDraw->id, XRC_DRAWABLE,
+ client, DixReadAccess);
+ }
+
+ if (pReadDraw && pReadDraw != pDraw &&
+ new_reply.readType != GLX_PBUFFER_TYPE) {
+ dixLookupResourceByClass((pointer *) &pXinReadDraw,
+ pReadDraw->id, XRC_DRAWABLE,
+ client, DixReadAccess);
+ }
+ else {
+ pXinReadDraw = pXinDraw;
+ }
}
#endif
-
/* send the MakeCurrent request to all required
* back-end servers.
*/
- for (s = from_screen; s<=to_screen; s++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[s];
- Display *dpy = GetBackEndDisplay(cl,s);
- unsigned int be_draw = None;
- unsigned int be_read_draw = None;
-
- if (pGlxPixmap) {
- be_draw = pGlxPixmap->be_xids[s];
- }
- else if (pGlxPbuffer) {
- be_draw = pGlxPbuffer->be_xids[s];
- }
+ for (s = from_screen; s <= to_screen; s++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[s];
+ Display *dpy = GetBackEndDisplay(cl, s);
+ unsigned int be_draw = None;
+ unsigned int be_read_draw = None;
+
+ if (pGlxPixmap) {
+ be_draw = pGlxPixmap->be_xids[s];
+ }
+ else if (pGlxPbuffer) {
+ be_draw = pGlxPbuffer->be_xids[s];
+ }
#ifdef PANORAMIX
- else if (pXinDraw) {
- dixLookupWindow(&pWin, pXinDraw->info[s].id, client, DixReadAccess);
- }
+ else if (pXinDraw) {
+ dixLookupWindow(&pWin, pXinDraw->info[s].id, client, DixReadAccess);
+ }
#endif
- else if (pGlxWindow) {
- pWin = (WindowPtr)pGlxWindow->pDraw;
- }
-
- if (pWin && be_draw == None) {
- be_draw = (unsigned int)(DMX_GET_WINDOW_PRIV(pWin))->window;
- if (!be_draw) {
- /* it might be that the window did not created yet on the */
- /* back-end server (lazy window creation option), force */
- /* creation of the window */
- dmxCreateAndRealizeWindow( pWin, TRUE );
- be_draw = (unsigned int)(DMX_GET_WINDOW_PRIV(pWin))->window;
- }
- }
-
- /*
- * Before sending the MakeCurrent request - sync the
- * X11 connection to the back-end servers to make sure
- * that drawable is already created
- */
- dmxSync( dmxScreen, 1 );
-
- if (drawId == readId) {
- LockDisplay(dpy);
- GetReq(GLXMakeCurrent, be_req);
- be_req->reqType = dmxScreen->glxMajorOpcode;
- be_req->glxCode = X_GLXMakeCurrent;
- be_req->drawable = be_draw;
- be_req->context = (unsigned int)(glxc ? glxc->real_ids[s-from_screen] : 0);
- be_req->oldContextTag = GetCurrentBackEndTag(cl, tag, s);
- if (!_XReply(dpy, (xReply *) &be_reply, 0, False)) {
-
- /* The make current failed */
- UnlockDisplay(dpy);
- SyncHandle();
- return( BE_TO_CLIENT_ERROR(dmxLastErrorEvent.error_code) );
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
-
- SetCurrentBackEndTag( cl, tag, s, be_reply.contextTag );
- }
- else {
-
- if (pReadGlxPixmap) {
- be_read_draw = pReadGlxPixmap->be_xids[s];
- }
- else if (pGlxReadPbuffer) {
- be_read_draw = pGlxReadPbuffer->be_xids[s];
- }
+ else if (pGlxWindow) {
+ pWin = (WindowPtr) pGlxWindow->pDraw;
+ }
+
+ if (pWin && be_draw == None) {
+ be_draw = (unsigned int) (DMX_GET_WINDOW_PRIV(pWin))->window;
+ if (!be_draw) {
+ /* it might be that the window did not created yet on the */
+ /* back-end server (lazy window creation option), force */
+ /* creation of the window */
+ dmxCreateAndRealizeWindow(pWin, TRUE);
+ be_draw = (unsigned int) (DMX_GET_WINDOW_PRIV(pWin))->window;
+ }
+ }
+
+ /*
+ * Before sending the MakeCurrent request - sync the
+ * X11 connection to the back-end servers to make sure
+ * that drawable is already created
+ */
+ dmxSync(dmxScreen, 1);
+
+ if (drawId == readId) {
+ LockDisplay(dpy);
+ GetReq(GLXMakeCurrent, be_req);
+ be_req->reqType = dmxScreen->glxMajorOpcode;
+ be_req->glxCode = X_GLXMakeCurrent;
+ be_req->drawable = be_draw;
+ be_req->context =
+ (unsigned int) (glxc ? glxc->real_ids[s - from_screen] : 0);
+ be_req->oldContextTag = GetCurrentBackEndTag(cl, tag, s);
+ if (!_XReply(dpy, (xReply *) & be_reply, 0, False)) {
+
+ /* The make current failed */
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return (BE_TO_CLIENT_ERROR(dmxLastErrorEvent.error_code));
+ }
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+
+ SetCurrentBackEndTag(cl, tag, s, be_reply.contextTag);
+ }
+ else {
+
+ if (pReadGlxPixmap) {
+ be_read_draw = pReadGlxPixmap->be_xids[s];
+ }
+ else if (pGlxReadPbuffer) {
+ be_read_draw = pGlxReadPbuffer->be_xids[s];
+ }
#ifdef PANORAMIX
- else if (pXinReadDraw) {
- dixLookupWindow(&pReadWin, pXinReadDraw->info[s].id, client,
- DixReadAccess);
- }
+ else if (pXinReadDraw) {
+ dixLookupWindow(&pReadWin, pXinReadDraw->info[s].id, client,
+ DixReadAccess);
+ }
#endif
- else if (pGlxReadWindow) {
- pReadWin = (WindowPtr)pGlxReadWindow->pDraw;
- }
-
- if (pReadWin && be_read_draw == None) {
- be_read_draw = (unsigned int)(DMX_GET_WINDOW_PRIV(pReadWin))->window;
- if (!be_read_draw) {
- /* it might be that the window did not created yet on the */
- /* back-end server (lazy window creation option), force */
- /* creation of the window */
- dmxCreateAndRealizeWindow( pReadWin, TRUE );
- be_read_draw = (unsigned int)(DMX_GET_WINDOW_PRIV(pReadWin))->window;
- dmxSync( dmxScreen, 1 );
- }
- }
-
- if ( __GLX_IS_VERSION_SUPPORTED(1,3) ) {
- LockDisplay(dpy);
- GetReq(GLXMakeContextCurrent, be_new_req);
- be_new_req->reqType = dmxScreen->glxMajorOpcode;
- be_new_req->glxCode = X_GLXMakeContextCurrent;
- be_new_req->drawable = be_draw;
- be_new_req->readdrawable = be_read_draw;
- be_new_req->context = (unsigned int)(glxc ? glxc->real_ids[s-from_screen] : 0);
- be_new_req->oldContextTag = GetCurrentBackEndTag(cl, tag, s);
- if (!_XReply(dpy, (xReply *) &be_new_reply, 0, False)) {
-
- /* The make current failed */
- UnlockDisplay(dpy);
- SyncHandle();
- return( BE_TO_CLIENT_ERROR(dmxLastErrorEvent.error_code) );
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
-
- SetCurrentBackEndTag( cl, tag, s, be_new_reply.contextTag );
- }
- else if (glxIsExtensionSupported("GLX_SGI_make_current_read")) {
- xGLXMakeCurrentReadSGIReq *ext_req;
- xGLXVendorPrivateWithReplyReq *vpreq;
- xGLXMakeCurrentReadSGIReply ext_reply;
-
- LockDisplay(dpy);
- GetReqExtra(GLXVendorPrivateWithReply,
- sz_xGLXMakeCurrentReadSGIReq - sz_xGLXVendorPrivateWithReplyReq,
- vpreq);
- ext_req = (xGLXMakeCurrentReadSGIReq *)vpreq;
- ext_req->reqType = dmxScreen->glxMajorOpcode;
- ext_req->glxCode = X_GLXVendorPrivateWithReply;
- ext_req->vendorCode = X_GLXvop_MakeCurrentReadSGI;
- ext_req->drawable = be_draw;
- ext_req->readable = be_read_draw;
- ext_req->context = (unsigned int)(glxc ? glxc->real_ids[s-from_screen] : 0);
- ext_req->oldContextTag = GetCurrentBackEndTag(cl, tag, s);
- if (!_XReply(dpy, (xReply *) &ext_reply, 0, False)) {
-
- /* The make current failed */
- UnlockDisplay(dpy);
- SyncHandle();
- return( BE_TO_CLIENT_ERROR(dmxLastErrorEvent.error_code) );
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
-
- SetCurrentBackEndTag( cl, tag, s, ext_reply.contextTag );
-
- }
- else {
- return BadMatch;
- }
- }
-
- XFlush( dpy );
+ else if (pGlxReadWindow) {
+ pReadWin = (WindowPtr) pGlxReadWindow->pDraw;
+ }
+
+ if (pReadWin && be_read_draw == None) {
+ be_read_draw =
+ (unsigned int) (DMX_GET_WINDOW_PRIV(pReadWin))->window;
+ if (!be_read_draw) {
+ /* it might be that the window did not created yet on the */
+ /* back-end server (lazy window creation option), force */
+ /* creation of the window */
+ dmxCreateAndRealizeWindow(pReadWin, TRUE);
+ be_read_draw =
+ (unsigned int) (DMX_GET_WINDOW_PRIV(pReadWin))->window;
+ dmxSync(dmxScreen, 1);
+ }
+ }
+
+ if (__GLX_IS_VERSION_SUPPORTED(1, 3)) {
+ LockDisplay(dpy);
+ GetReq(GLXMakeContextCurrent, be_new_req);
+ be_new_req->reqType = dmxScreen->glxMajorOpcode;
+ be_new_req->glxCode = X_GLXMakeContextCurrent;
+ be_new_req->drawable = be_draw;
+ be_new_req->readdrawable = be_read_draw;
+ be_new_req->context =
+ (unsigned int) (glxc ? glxc->real_ids[s - from_screen] : 0);
+ be_new_req->oldContextTag = GetCurrentBackEndTag(cl, tag, s);
+ if (!_XReply(dpy, (xReply *) & be_new_reply, 0, False)) {
+
+ /* The make current failed */
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return (BE_TO_CLIENT_ERROR(dmxLastErrorEvent.error_code));
+ }
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+
+ SetCurrentBackEndTag(cl, tag, s, be_new_reply.contextTag);
+ }
+ else if (glxIsExtensionSupported("GLX_SGI_make_current_read")) {
+ xGLXMakeCurrentReadSGIReq *ext_req;
+ xGLXVendorPrivateWithReplyReq *vpreq;
+ xGLXMakeCurrentReadSGIReply ext_reply;
+
+ LockDisplay(dpy);
+ GetReqExtra(GLXVendorPrivateWithReply,
+ sz_xGLXMakeCurrentReadSGIReq -
+ sz_xGLXVendorPrivateWithReplyReq, vpreq);
+ ext_req = (xGLXMakeCurrentReadSGIReq *) vpreq;
+ ext_req->reqType = dmxScreen->glxMajorOpcode;
+ ext_req->glxCode = X_GLXVendorPrivateWithReply;
+ ext_req->vendorCode = X_GLXvop_MakeCurrentReadSGI;
+ ext_req->drawable = be_draw;
+ ext_req->readable = be_read_draw;
+ ext_req->context =
+ (unsigned int) (glxc ? glxc->real_ids[s - from_screen] : 0);
+ ext_req->oldContextTag = GetCurrentBackEndTag(cl, tag, s);
+ if (!_XReply(dpy, (xReply *) & ext_reply, 0, False)) {
+
+ /* The make current failed */
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return (BE_TO_CLIENT_ERROR(dmxLastErrorEvent.error_code));
+ }
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+
+ SetCurrentBackEndTag(cl, tag, s, ext_reply.contextTag);
+
+ }
+ else {
+ return BadMatch;
+ }
+ }
+
+ XFlush(dpy);
}
if (client->swapped) {
- __glXSwapMakeCurrentReply(client, &new_reply);
- } else {
- WriteToClient(client, sz_xGLXMakeContextCurrentReply, (char *)&new_reply);
+ __glXSwapMakeCurrentReply(client, &new_reply);
+ }
+ else {
+ WriteToClient(client, sz_xGLXMakeContextCurrentReply,
+ (char *) &new_reply);
}
return Success;
}
-int __glXMakeCurrent(__GLXclientState *cl, GLbyte *pc)
+int
+__glXMakeCurrent(__GLXclientState * cl, GLbyte * pc)
{
xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc;
- return( MakeCurrent(cl, req->drawable, req->drawable,
- req->context, req->oldContextTag ) );
+ return (MakeCurrent(cl, req->drawable, req->drawable,
+ req->context, req->oldContextTag));
}
-int __glXMakeContextCurrent(__GLXclientState *cl, GLbyte *pc)
+int
+__glXMakeContextCurrent(__GLXclientState * cl, GLbyte * pc)
{
xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc;
- return( MakeCurrent(cl, req->drawable, req->readdrawable,
- req->context, req->oldContextTag ) );
+ return (MakeCurrent(cl, req->drawable, req->readdrawable,
+ req->context, req->oldContextTag));
}
-int __glXMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc)
+int
+__glXMakeCurrentReadSGI(__GLXclientState * cl, GLbyte * pc)
{
xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc;
- return( MakeCurrent(cl, req->drawable, req->readable,
- req->context, req->oldContextTag ) );
+ return (MakeCurrent(cl, req->drawable, req->readable,
+ req->context, req->oldContextTag));
}
-int __glXIsDirect(__GLXclientState *cl, GLbyte *pc)
+int
+__glXIsDirect(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc;
@@ -1354,13 +1431,13 @@ int __glXIsDirect(__GLXclientState *cl, GLbyte *pc)
__GLXcontext *glxc;
/*
- ** Find the GL context.
- */
- dixLookupResourceByType((pointer*) &glxc, req->context, __glXContextRes,
+ ** Find the GL context.
+ */
+ dixLookupResourceByType((pointer *) &glxc, req->context, __glXContextRes,
NullClient, DixUnknownAccess);
if (!glxc) {
- client->errorValue = req->context;
- return __glXBadContext;
+ client->errorValue = req->context;
+ return __glXBadContext;
}
reply.isDirect = 0;
@@ -1369,25 +1446,28 @@ int __glXIsDirect(__GLXclientState *cl, GLbyte *pc)
reply.sequenceNumber = client->sequence;
if (client->swapped) {
- __glXSwapIsDirectReply(client, &reply);
- } else {
- WriteToClient(client, sz_xGLXIsDirectReply, (char *)&reply);
+ __glXSwapIsDirectReply(client, &reply);
+ }
+ else {
+ WriteToClient(client, sz_xGLXIsDirectReply, (char *) &reply);
}
return Success;
}
-int __glXQueryVersion(__GLXclientState *cl, GLbyte *pc)
+int
+__glXQueryVersion(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
+
/* xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc; */
xGLXQueryVersionReply reply;
/*
- ** Server should take into consideration the version numbers sent by the
- ** client if it wants to work with older clients; however, in this
- ** implementation the server just returns its version number.
- */
+ ** Server should take into consideration the version numbers sent by the
+ ** client if it wants to work with older clients; however, in this
+ ** implementation the server just returns its version number.
+ */
reply.majorVersion = __glXVersionMajor;
reply.minorVersion = __glXVersionMinor;
reply.length = 0;
@@ -1395,98 +1475,104 @@ int __glXQueryVersion(__GLXclientState *cl, GLbyte *pc)
reply.sequenceNumber = client->sequence;
if (client->swapped) {
- __glXSwapQueryVersionReply(client, &reply);
- } else {
- WriteToClient(client, sz_xGLXQueryVersionReply, (char *)&reply);
+ __glXSwapQueryVersionReply(client, &reply);
+ }
+ else {
+ WriteToClient(client, sz_xGLXQueryVersionReply, (char *) &reply);
}
return Success;
}
-int __glXWaitGL(__GLXclientState *cl, GLbyte *pc)
+int
+__glXWaitGL(__GLXclientState * cl, GLbyte * pc)
{
- xGLXWaitGLReq *req = (xGLXWaitGLReq *)pc;
- xGLXWaitGLReq *be_req = (xGLXWaitGLReq *)pc;
+ xGLXWaitGLReq *req = (xGLXWaitGLReq *) pc;
+ xGLXWaitGLReq *be_req = (xGLXWaitGLReq *) pc;
int from_screen = 0;
int to_screen = 0;
int s;
__GLXcontext *glxc = NULL;
-
+
if (req->contextTag != 0) {
- glxc = __glXLookupContextByTag(cl, req->contextTag);
- if (glxc) {
- from_screen = to_screen = glxc->pScreen->myNum;
- }
+ glxc = __glXLookupContextByTag(cl, req->contextTag);
+ if (glxc) {
+ from_screen = to_screen = glxc->pScreen->myNum;
+ }
}
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
- from_screen = 0;
- to_screen = screenInfo.numScreens - 1;
+ from_screen = 0;
+ to_screen = screenInfo.numScreens - 1;
}
#endif
- for (s=from_screen; s<=to_screen; s++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[s];
- Display *dpy = GetBackEndDisplay(cl,s);
+ for (s = from_screen; s <= to_screen; s++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[s];
+ Display *dpy = GetBackEndDisplay(cl, s);
- LockDisplay(dpy);
- GetReq(GLXWaitGL,be_req);
- be_req->reqType = dmxScreen->glxMajorOpcode;
- be_req->glxCode = X_GLXWaitGL;
- be_req->contextTag = (glxc ? GetCurrentBackEndTag(cl,req->contextTag,s) : 0);
- UnlockDisplay(dpy);
- SyncHandle();
+ LockDisplay(dpy);
+ GetReq(GLXWaitGL, be_req);
+ be_req->reqType = dmxScreen->glxMajorOpcode;
+ be_req->glxCode = X_GLXWaitGL;
+ be_req->contextTag =
+ (glxc ? GetCurrentBackEndTag(cl, req->contextTag, s) : 0);
+ UnlockDisplay(dpy);
+ SyncHandle();
- XSync(dpy, False);
+ XSync(dpy, False);
}
-
+
return Success;
}
-int __glXWaitX(__GLXclientState *cl, GLbyte *pc)
+int
+__glXWaitX(__GLXclientState * cl, GLbyte * pc)
{
- xGLXWaitXReq *req = (xGLXWaitXReq *)pc;
+ xGLXWaitXReq *req = (xGLXWaitXReq *) pc;
xGLXWaitXReq *be_req;
int from_screen = 0;
int to_screen = 0;
int s;
__GLXcontext *glxc = NULL;
-
+
if (req->contextTag != 0) {
- glxc = __glXLookupContextByTag(cl, req->contextTag);
- if (glxc) {
- from_screen = to_screen = glxc->pScreen->myNum;
- }
+ glxc = __glXLookupContextByTag(cl, req->contextTag);
+ if (glxc) {
+ from_screen = to_screen = glxc->pScreen->myNum;
+ }
}
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
- from_screen = 0;
- to_screen = screenInfo.numScreens - 1;
+ from_screen = 0;
+ to_screen = screenInfo.numScreens - 1;
}
#endif
- for (s=from_screen; s<=to_screen; s++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[s];
- Display *dpy = GetBackEndDisplay(cl,s);
+ for (s = from_screen; s <= to_screen; s++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[s];
+ Display *dpy = GetBackEndDisplay(cl, s);
- dmxSync( dmxScreen, 1 );
+ dmxSync(dmxScreen, 1);
- LockDisplay(dpy);
- GetReq(GLXWaitX,be_req);
- be_req->reqType = dmxScreen->glxMajorOpcode;
- be_req->glxCode = X_GLXWaitX;
- be_req->contextTag = (glxc ? GetCurrentBackEndTag(cl,req->contextTag,s) : 0);
- UnlockDisplay(dpy);
- SyncHandle();
+ LockDisplay(dpy);
+ GetReq(GLXWaitX, be_req);
+ be_req->reqType = dmxScreen->glxMajorOpcode;
+ be_req->glxCode = X_GLXWaitX;
+ be_req->contextTag =
+ (glxc ? GetCurrentBackEndTag(cl, req->contextTag, s) : 0);
+ UnlockDisplay(dpy);
+ SyncHandle();
- XFlush( dpy );
+ XFlush(dpy);
}
return Success;
}
-int __glXCopyContext(__GLXclientState *cl, GLbyte *pc)
+int
+__glXCopyContext(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXCopyContextReq *be_req;
@@ -1501,81 +1587,83 @@ int __glXCopyContext(__GLXclientState *cl, GLbyte *pc)
int to_screen = 0;
/*
- ** Check that each context exists.
- */
- dixLookupResourceByType((pointer*) &src, source, __glXContextRes,
+ ** Check that each context exists.
+ */
+ dixLookupResourceByType((pointer *) &src, source, __glXContextRes,
NullClient, DixUnknownAccess);
if (!src) {
- client->errorValue = source;
- return __glXBadContext;
+ client->errorValue = source;
+ return __glXBadContext;
}
- dixLookupResourceByType((pointer*) &dst, dest, __glXContextRes,
+ dixLookupResourceByType((pointer *) &dst, dest, __glXContextRes,
NullClient, DixUnknownAccess);
if (!dst) {
- client->errorValue = dest;
- return __glXBadContext;
+ client->errorValue = dest;
+ return __glXBadContext;
}
/*
- ** They must be in the same address space, and same screen.
- */
+ ** They must be in the same address space, and same screen.
+ */
if (src->pGlxScreen != dst->pGlxScreen) {
- client->errorValue = source;
- return BadMatch;
+ client->errorValue = source;
+ return BadMatch;
}
/*
- ** The destination context must not be current for any client.
- */
+ ** The destination context must not be current for any client.
+ */
if (dst->isCurrent) {
- client->errorValue = dest;
- return BadAccess;
+ client->errorValue = dest;
+ return BadAccess;
}
if (tag) {
- __GLXcontext *tagcx = __glXLookupContextByTag(cl, tag);
-
- if (!tagcx) {
- return __glXBadContextTag;
- }
- if (tagcx != src) {
- /*
- ** This would be caused by a faulty implementation of the client
- ** library.
- */
- return BadMatch;
- }
+ __GLXcontext *tagcx = __glXLookupContextByTag(cl, tag);
+
+ if (!tagcx) {
+ return __glXBadContextTag;
+ }
+ if (tagcx != src) {
+ /*
+ ** This would be caused by a faulty implementation of the client
+ ** library.
+ */
+ return BadMatch;
+ }
}
from_screen = to_screen = src->pScreen->myNum;
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
- from_screen = 0;
- to_screen = screenInfo.numScreens - 1;
+ from_screen = 0;
+ to_screen = screenInfo.numScreens - 1;
}
#endif
- for (s=from_screen; s<=to_screen; s++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[s];
- Display *dpy = GetBackEndDisplay(cl,s);
+ for (s = from_screen; s <= to_screen; s++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[s];
+ Display *dpy = GetBackEndDisplay(cl, s);
- LockDisplay(dpy);
- GetReq(GLXCopyContext,be_req);
- be_req->reqType = dmxScreen->glxMajorOpcode;
- be_req->glxCode = X_GLXCopyContext;
- be_req->source = (unsigned int)src->real_ids[s-from_screen];
- be_req->dest = (unsigned int)dst->real_ids[s-from_screen];
- be_req->mask = mask;
- be_req->contextTag = (tag ? GetCurrentBackEndTag(cl,req->contextTag,s) : 0);
- UnlockDisplay(dpy);
- SyncHandle();
+ LockDisplay(dpy);
+ GetReq(GLXCopyContext, be_req);
+ be_req->reqType = dmxScreen->glxMajorOpcode;
+ be_req->glxCode = X_GLXCopyContext;
+ be_req->source = (unsigned int) src->real_ids[s - from_screen];
+ be_req->dest = (unsigned int) dst->real_ids[s - from_screen];
+ be_req->mask = mask;
+ be_req->contextTag =
+ (tag ? GetCurrentBackEndTag(cl, req->contextTag, s) : 0);
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return Success;
}
-int __glXGetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
+int
+__glXGetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc;
@@ -1588,75 +1676,75 @@ int __glXGetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
screen = req->screen;
if (screen >= screenInfo.numScreens) {
- /* The client library must send a valid screen number. */
- client->errorValue = screen;
- return BadValue;
+ /* The client library must send a valid screen number. */
+ client->errorValue = screen;
+ return BadValue;
}
pGlxScreen = &__glXActiveScreens[screen];
reply.numVisuals = pGlxScreen->numGLXVisuals;
reply.numProps = __GLX_TOTAL_CONFIG;
reply.length = (pGlxScreen->numGLXVisuals * __GLX_SIZE_CARD32 *
- __GLX_TOTAL_CONFIG) >> 2;
+ __GLX_TOTAL_CONFIG) >> 2;
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
- WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *)&reply);
-
- for (i=0; i < pGlxScreen->numVisuals; i++) {
- pGlxVisual = &pGlxScreen->pGlxVisual[i];
- if (!pGlxScreen->isGLXvis[i] || pGlxVisual->vid == 0) {
- /* not a usable visual */
- continue;
- }
- p = 0;
- buf[p++] = pGlxVisual->vid;
- buf[p++] = pGlxVisual->class;
- buf[p++] = pGlxVisual->rgba;
-
- buf[p++] = pGlxVisual->redSize;
- buf[p++] = pGlxVisual->greenSize;
- buf[p++] = pGlxVisual->blueSize;
- buf[p++] = pGlxVisual->alphaSize;
- buf[p++] = pGlxVisual->accumRedSize;
- buf[p++] = pGlxVisual->accumGreenSize;
- buf[p++] = pGlxVisual->accumBlueSize;
- buf[p++] = pGlxVisual->accumAlphaSize;
-
- buf[p++] = pGlxVisual->doubleBuffer;
- buf[p++] = pGlxVisual->stereo;
-
- buf[p++] = pGlxVisual->bufferSize;
- buf[p++] = pGlxVisual->depthSize;
- buf[p++] = pGlxVisual->stencilSize;
- buf[p++] = pGlxVisual->auxBuffers;
- buf[p++] = pGlxVisual->level;
- /*
- ** Add token/value pairs for extensions.
- */
- buf[p++] = GLX_VISUAL_CAVEAT_EXT;
- buf[p++] = pGlxVisual->visualRating;
- buf[p++] = GLX_TRANSPARENT_TYPE_EXT;
- buf[p++] = pGlxVisual->transparentPixel;
- buf[p++] = GLX_TRANSPARENT_RED_VALUE_EXT;
- buf[p++] = pGlxVisual->transparentRed;
- buf[p++] = GLX_TRANSPARENT_GREEN_VALUE_EXT;
- buf[p++] = pGlxVisual->transparentGreen;
- buf[p++] = GLX_TRANSPARENT_BLUE_VALUE_EXT;
- buf[p++] = pGlxVisual->transparentBlue;
- buf[p++] = GLX_TRANSPARENT_ALPHA_VALUE_EXT;
- buf[p++] = pGlxVisual->transparentAlpha;
- buf[p++] = GLX_TRANSPARENT_INDEX_VALUE_EXT;
- buf[p++] = pGlxVisual->transparentIndex;
- buf[p++] = GLX_SAMPLES_SGIS;
- buf[p++] = pGlxVisual->multiSampleSize;
- buf[p++] = GLX_SAMPLE_BUFFERS_SGIS;
- buf[p++] = pGlxVisual->nMultiSampleBuffers;
- buf[p++] = GLX_VISUAL_SELECT_GROUP_SGIX;
- buf[p++] = pGlxVisual->visualSelectGroup;
-
- WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG,
- (char *)buf);
+ WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *) &reply);
+
+ for (i = 0; i < pGlxScreen->numVisuals; i++) {
+ pGlxVisual = &pGlxScreen->pGlxVisual[i];
+ if (!pGlxScreen->isGLXvis[i] || pGlxVisual->vid == 0) {
+ /* not a usable visual */
+ continue;
+ }
+ p = 0;
+ buf[p++] = pGlxVisual->vid;
+ buf[p++] = pGlxVisual->class;
+ buf[p++] = pGlxVisual->rgba;
+
+ buf[p++] = pGlxVisual->redSize;
+ buf[p++] = pGlxVisual->greenSize;
+ buf[p++] = pGlxVisual->blueSize;
+ buf[p++] = pGlxVisual->alphaSize;
+ buf[p++] = pGlxVisual->accumRedSize;
+ buf[p++] = pGlxVisual->accumGreenSize;
+ buf[p++] = pGlxVisual->accumBlueSize;
+ buf[p++] = pGlxVisual->accumAlphaSize;
+
+ buf[p++] = pGlxVisual->doubleBuffer;
+ buf[p++] = pGlxVisual->stereo;
+
+ buf[p++] = pGlxVisual->bufferSize;
+ buf[p++] = pGlxVisual->depthSize;
+ buf[p++] = pGlxVisual->stencilSize;
+ buf[p++] = pGlxVisual->auxBuffers;
+ buf[p++] = pGlxVisual->level;
+ /*
+ ** Add token/value pairs for extensions.
+ */
+ buf[p++] = GLX_VISUAL_CAVEAT_EXT;
+ buf[p++] = pGlxVisual->visualRating;
+ buf[p++] = GLX_TRANSPARENT_TYPE_EXT;
+ buf[p++] = pGlxVisual->transparentPixel;
+ buf[p++] = GLX_TRANSPARENT_RED_VALUE_EXT;
+ buf[p++] = pGlxVisual->transparentRed;
+ buf[p++] = GLX_TRANSPARENT_GREEN_VALUE_EXT;
+ buf[p++] = pGlxVisual->transparentGreen;
+ buf[p++] = GLX_TRANSPARENT_BLUE_VALUE_EXT;
+ buf[p++] = pGlxVisual->transparentBlue;
+ buf[p++] = GLX_TRANSPARENT_ALPHA_VALUE_EXT;
+ buf[p++] = pGlxVisual->transparentAlpha;
+ buf[p++] = GLX_TRANSPARENT_INDEX_VALUE_EXT;
+ buf[p++] = pGlxVisual->transparentIndex;
+ buf[p++] = GLX_SAMPLES_SGIS;
+ buf[p++] = pGlxVisual->multiSampleSize;
+ buf[p++] = GLX_SAMPLE_BUFFERS_SGIS;
+ buf[p++] = pGlxVisual->nMultiSampleBuffers;
+ buf[p++] = GLX_VISUAL_SELECT_GROUP_SGIX;
+ buf[p++] = pGlxVisual->visualSelectGroup;
+
+ WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG,
+ (char *) buf);
}
return Success;
}
@@ -1664,9 +1752,10 @@ int __glXGetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
/*
** Create a GLX Pixmap from an X Pixmap.
*/
-static int CreateGLXPixmap(__GLXclientState *cl,
- VisualID visual, GLXFBConfigID fbconfigId,
- int screenNum, XID pixmapId, XID glxpixmapId )
+static int
+CreateGLXPixmap(__GLXclientState * cl,
+ VisualID visual, GLXFBConfigID fbconfigId,
+ int screenNum, XID pixmapId, XID glxpixmapId)
{
ClientPtr client = cl->client;
xGLXCreateGLXPixmapReq *be_req;
@@ -1680,107 +1769,107 @@ static int CreateGLXPixmap(__GLXclientState *cl,
__GLXFBConfig *pFBConfig;
int i, s, rc;
int from_screen, to_screen;
+
#ifdef PANORAMIX
PanoramiXRes *pXinDraw = NULL;
#endif
rc = dixLookupDrawable(&pDraw, pixmapId, client, M_DRAWABLE_PIXMAP,
- DixAddAccess);
+ DixAddAccess);
if (rc != Success)
- return rc;
+ return rc;
/*
- ** Check if screen of visual matches screen of pixmap.
- */
+ ** Check if screen of visual matches screen of pixmap.
+ */
pScreen = pDraw->pScreen;
if (screenNum != pScreen->myNum) {
- return BadMatch;
+ return BadMatch;
}
if (fbconfigId == 0 && visual == 0) {
- return BadValue;
+ return BadValue;
}
if (fbconfigId != None) {
- pFBConfig = glxLookupFBConfig( fbconfigId );
- if (!pFBConfig) {
- client->errorValue = fbconfigId;
- return BadValue;
- }
- visual = pFBConfig->associatedVisualId;
+ pFBConfig = glxLookupFBConfig(fbconfigId);
+ if (!pFBConfig) {
+ client->errorValue = fbconfigId;
+ return BadValue;
+ }
+ visual = pFBConfig->associatedVisualId;
}
else {
- pFBConfig = NULL;
+ pFBConfig = NULL;
}
if (visual != None) {
- /*
- ** Find the VisualRec for this visual.
- */
- pVisual = pScreen->visuals;
- for (i=0; i < pScreen->numVisuals; i++, pVisual++) {
- if (pVisual->vid == visual) {
- break;
- }
- }
- if (i == pScreen->numVisuals) {
- client->errorValue = visual;
- return BadValue;
- }
- /*
- ** Check if depth of visual matches depth of pixmap.
- */
- if (pVisual->nplanes != pDraw->depth) {
- client->errorValue = visual;
- return BadMatch;
- }
-
- /*
- ** Get configuration of the visual.
- */
- pGlxScreen = &__glXActiveScreens[screenNum];
- pGlxVisual = pGlxScreen->pGlxVisual;
- for (i = 0; i < pGlxScreen->numVisuals; i++, pGlxVisual++) {
- if (pGlxVisual->vid == visual) {
- break;
- }
- }
- if (i == pGlxScreen->numVisuals) {
- /*
- ** Visual not support on this screen by this OpenGL implementation.
- */
- client->errorValue = visual;
- return BadValue;
- }
-
-
- /* find the FBConfig for that visual (if any) */
- if ( pFBConfig == NULL ) {
- pFBConfig = glxLookupFBConfigByVID( visual );
-
- if ( pFBConfig == NULL ) {
- /*
- * visual does not have an FBConfig ???
- client->errorValue = visual;
- return BadValue;
- */
- }
- }
+ /*
+ ** Find the VisualRec for this visual.
+ */
+ pVisual = pScreen->visuals;
+ for (i = 0; i < pScreen->numVisuals; i++, pVisual++) {
+ if (pVisual->vid == visual) {
+ break;
+ }
+ }
+ if (i == pScreen->numVisuals) {
+ client->errorValue = visual;
+ return BadValue;
+ }
+ /*
+ ** Check if depth of visual matches depth of pixmap.
+ */
+ if (pVisual->nplanes != pDraw->depth) {
+ client->errorValue = visual;
+ return BadMatch;
+ }
+
+ /*
+ ** Get configuration of the visual.
+ */
+ pGlxScreen = &__glXActiveScreens[screenNum];
+ pGlxVisual = pGlxScreen->pGlxVisual;
+ for (i = 0; i < pGlxScreen->numVisuals; i++, pGlxVisual++) {
+ if (pGlxVisual->vid == visual) {
+ break;
+ }
+ }
+ if (i == pGlxScreen->numVisuals) {
+ /*
+ ** Visual not support on this screen by this OpenGL implementation.
+ */
+ client->errorValue = visual;
+ return BadValue;
+ }
+
+ /* find the FBConfig for that visual (if any) */
+ if (pFBConfig == NULL) {
+ pFBConfig = glxLookupFBConfigByVID(visual);
+
+ if (pFBConfig == NULL) {
+ /*
+ * visual does not have an FBConfig ???
+ client->errorValue = visual;
+ return BadValue;
+ */
+ }
+ }
}
else {
- pVisual = NULL;
- pGlxVisual = NULL;
- pGlxScreen = &__glXActiveScreens[pDraw->pScreen->myNum];
+ pVisual = NULL;
+ pGlxVisual = NULL;
+ pGlxScreen = &__glXActiveScreens[pDraw->pScreen->myNum];
}
pGlxPixmap = (__GLXpixmap *) malloc(sizeof(__GLXpixmap));
if (!pGlxPixmap) {
- return BadAlloc;
+ return BadAlloc;
}
pGlxPixmap->be_xids = (XID *) malloc(sizeof(XID) * screenInfo.numScreens);
if (!pGlxPixmap->be_xids) {
- free( pGlxPixmap );
- return BadAlloc;
+ free(pGlxPixmap);
+ return BadAlloc;
}
pGlxPixmap->pDraw = pDraw;
@@ -1792,8 +1881,8 @@ static int CreateGLXPixmap(__GLXclientState *cl,
pGlxPixmap->refcnt = 0;
/*
- ** Bump the ref count on the X pixmap so it won't disappear.
- */
+ ** Bump the ref count on the X pixmap so it won't disappear.
+ */
((PixmapPtr) pDraw)->refcnt++;
/*
@@ -1802,121 +1891,128 @@ static int CreateGLXPixmap(__GLXclientState *cl,
from_screen = to_screen = screenNum;
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
- from_screen = 0;
- to_screen = screenInfo.numScreens - 1;
+ from_screen = 0;
+ to_screen = screenInfo.numScreens - 1;
- dixLookupResourceByClass((pointer*) &pXinDraw,
- pDraw->id, XRC_DRAWABLE,
- client, DixReadAccess);
+ dixLookupResourceByClass((pointer *) &pXinDraw,
+ pDraw->id, XRC_DRAWABLE,
+ client, DixReadAccess);
}
#endif
- for (s=from_screen; s<=to_screen; s++) {
+ for (s = from_screen; s <= to_screen; s++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[s];
- Display *dpy = GetBackEndDisplay(cl,s);
- Pixmap be_pixmap;
- DrawablePtr pRealDraw = pDraw;
+ DMXScreenInfo *dmxScreen = &dmxScreens[s];
+ Display *dpy = GetBackEndDisplay(cl, s);
+ Pixmap be_pixmap;
+ DrawablePtr pRealDraw = pDraw;
#ifdef PANORAMIX
- if (pXinDraw) {
- dixLookupDrawable(&pRealDraw, pXinDraw->info[s].id, client, 0,
- DixAddAccess);
- }
+ if (pXinDraw) {
+ dixLookupDrawable(&pRealDraw, pXinDraw->info[s].id, client, 0,
+ DixAddAccess);
+ }
#endif
- be_pixmap = (DMX_GET_PIXMAP_PRIV((PixmapPtr)pRealDraw))->pixmap;
-
- /* make sure pixmap already created on back-end */
- dmxSync( dmxScreen, 1 );
-
- if ( pFBConfig && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
- __GLXFBConfig *be_FBConfig = glxLookupBackEndFBConfig( pFBConfig->id, s );
-
- LockDisplay(dpy);
- pGlxPixmap->be_xids[s] = XAllocID(dpy);
- GetReq(GLXCreatePixmap,be_new_req);
- be_new_req->reqType = dmxScreen->glxMajorOpcode;
- be_new_req->glxCode = X_GLXCreatePixmap;
- be_new_req->screen = DefaultScreen(dpy);
- be_new_req->fbconfig = be_FBConfig->id;
- be_new_req->pixmap = (unsigned int)be_pixmap;
- be_new_req->glxpixmap = (unsigned int)pGlxPixmap->be_xids[s];
- be_new_req->numAttribs = 0;
- UnlockDisplay(dpy);
- SyncHandle();
- }
- else if (pFBConfig && glxIsExtensionSupported("GLX_SGIX_fbconfig")) {
- __GLXFBConfig *be_FBConfig = glxLookupBackEndFBConfig( pFBConfig->id, s );
- xGLXCreateGLXPixmapWithConfigSGIXReq *ext_req;
- xGLXVendorPrivateReq *vpreq;
-
- LockDisplay(dpy);
- pGlxPixmap->be_xids[s] = XAllocID(dpy);
- GetReqExtra(GLXVendorPrivate,
- sz_xGLXCreateGLXPixmapWithConfigSGIXReq-sz_xGLXVendorPrivateReq,
- vpreq);
- ext_req = (xGLXCreateGLXPixmapWithConfigSGIXReq *)vpreq;
- ext_req->reqType = dmxScreen->glxMajorOpcode;
- ext_req->glxCode = X_GLXVendorPrivate;
- ext_req->vendorCode = X_GLXvop_CreateGLXPixmapWithConfigSGIX;
- ext_req->screen = DefaultScreen(dpy);
- ext_req->fbconfig = be_FBConfig->id;
- ext_req->pixmap = (unsigned int)be_pixmap;
- ext_req->glxpixmap = (unsigned int)pGlxPixmap->be_xids[s];
- UnlockDisplay(dpy);
- SyncHandle();
- }
- else if (pGlxVisual) {
- LockDisplay(dpy);
- pGlxPixmap->be_xids[s] = XAllocID(dpy);
- GetReq(GLXCreateGLXPixmap,be_req);
- be_req->reqType = dmxScreen->glxMajorOpcode;
- be_req->glxCode = X_GLXCreateGLXPixmap;
- be_req->screen = DefaultScreen(dpy);
- be_req->visual = (unsigned int)glxMatchGLXVisualInConfigList(
- pGlxVisual,
- dmxScreen->glxVisuals,
- dmxScreen->numGlxVisuals );
- be_req->pixmap = (unsigned int)be_pixmap;
- be_req->glxpixmap = (unsigned int)pGlxPixmap->be_xids[s];
- UnlockDisplay(dpy);
- SyncHandle();
- }
- else {
- client->errorValue = ( visual ? visual : fbconfigId );
- free( pGlxPixmap );
- return BadValue;
- }
-
- XFlush( dpy );
+ be_pixmap = (DMX_GET_PIXMAP_PRIV((PixmapPtr) pRealDraw))->pixmap;
+
+ /* make sure pixmap already created on back-end */
+ dmxSync(dmxScreen, 1);
+
+ if (pFBConfig && __GLX_IS_VERSION_SUPPORTED(1, 3)) {
+ __GLXFBConfig *be_FBConfig =
+ glxLookupBackEndFBConfig(pFBConfig->id, s);
+
+ LockDisplay(dpy);
+ pGlxPixmap->be_xids[s] = XAllocID(dpy);
+ GetReq(GLXCreatePixmap, be_new_req);
+ be_new_req->reqType = dmxScreen->glxMajorOpcode;
+ be_new_req->glxCode = X_GLXCreatePixmap;
+ be_new_req->screen = DefaultScreen(dpy);
+ be_new_req->fbconfig = be_FBConfig->id;
+ be_new_req->pixmap = (unsigned int) be_pixmap;
+ be_new_req->glxpixmap = (unsigned int) pGlxPixmap->be_xids[s];
+ be_new_req->numAttribs = 0;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ }
+ else if (pFBConfig && glxIsExtensionSupported("GLX_SGIX_fbconfig")) {
+ __GLXFBConfig *be_FBConfig =
+ glxLookupBackEndFBConfig(pFBConfig->id, s);
+ xGLXCreateGLXPixmapWithConfigSGIXReq *ext_req;
+ xGLXVendorPrivateReq *vpreq;
+
+ LockDisplay(dpy);
+ pGlxPixmap->be_xids[s] = XAllocID(dpy);
+ GetReqExtra(GLXVendorPrivate,
+ sz_xGLXCreateGLXPixmapWithConfigSGIXReq -
+ sz_xGLXVendorPrivateReq, vpreq);
+ ext_req = (xGLXCreateGLXPixmapWithConfigSGIXReq *) vpreq;
+ ext_req->reqType = dmxScreen->glxMajorOpcode;
+ ext_req->glxCode = X_GLXVendorPrivate;
+ ext_req->vendorCode = X_GLXvop_CreateGLXPixmapWithConfigSGIX;
+ ext_req->screen = DefaultScreen(dpy);
+ ext_req->fbconfig = be_FBConfig->id;
+ ext_req->pixmap = (unsigned int) be_pixmap;
+ ext_req->glxpixmap = (unsigned int) pGlxPixmap->be_xids[s];
+ UnlockDisplay(dpy);
+ SyncHandle();
+ }
+ else if (pGlxVisual) {
+ LockDisplay(dpy);
+ pGlxPixmap->be_xids[s] = XAllocID(dpy);
+ GetReq(GLXCreateGLXPixmap, be_req);
+ be_req->reqType = dmxScreen->glxMajorOpcode;
+ be_req->glxCode = X_GLXCreateGLXPixmap;
+ be_req->screen = DefaultScreen(dpy);
+ be_req->visual =
+ (unsigned int) glxMatchGLXVisualInConfigList(pGlxVisual,
+ dmxScreen->
+ glxVisuals,
+ dmxScreen->
+ numGlxVisuals);
+ be_req->pixmap = (unsigned int) be_pixmap;
+ be_req->glxpixmap = (unsigned int) pGlxPixmap->be_xids[s];
+ UnlockDisplay(dpy);
+ SyncHandle();
+ }
+ else {
+ client->errorValue = (visual ? visual : fbconfigId);
+ free(pGlxPixmap);
+ return BadValue;
+ }
+
+ XFlush(dpy);
}
if (!(AddResource(glxpixmapId, __glXPixmapRes, pGlxPixmap))) {
- free( pGlxPixmap );
- return BadAlloc;
+ free(pGlxPixmap);
+ return BadAlloc;
}
return Success;
}
-int __glXCreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
+int
+__glXCreateGLXPixmap(__GLXclientState * cl, GLbyte * pc)
{
xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc;
- return( CreateGLXPixmap(cl, req->visual, None,
- req->screen, req->pixmap, req->glxpixmap) );
+ return (CreateGLXPixmap(cl, req->visual, None,
+ req->screen, req->pixmap, req->glxpixmap));
}
-int __glXCreatePixmap(__GLXclientState *cl, GLbyte *pc)
+int
+__glXCreatePixmap(__GLXclientState * cl, GLbyte * pc)
{
xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc;
- return( CreateGLXPixmap(cl, None, req->fbconfig,
- req->screen, req->pixmap, req->glxpixmap) );
+ return (CreateGLXPixmap(cl, None, req->fbconfig,
+ req->screen, req->pixmap, req->glxpixmap));
}
-int __glXDestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
+int
+__glXDestroyGLXPixmap(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
@@ -1926,13 +2022,13 @@ int __glXDestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
int from_screen, to_screen;
/*
- ** Check if it's a valid GLX pixmap.
- */
- dixLookupResourceByType((pointer*) &pGlxPixmap, glxpixmap,
+ ** Check if it's a valid GLX pixmap.
+ */
+ dixLookupResourceByType((pointer *) &pGlxPixmap, glxpixmap,
__glXPixmapRes, NullClient, DixUnknownAccess);
if (!pGlxPixmap) {
- client->errorValue = glxpixmap;
- return __glXBadPixmap;
+ client->errorValue = glxpixmap;
+ return __glXBadPixmap;
}
FreeResource(glxpixmap, FALSE);
@@ -1942,28 +2038,27 @@ int __glXDestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
from_screen = to_screen = pGlxPixmap->pDraw->pScreen->myNum;
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
- from_screen = 0;
- to_screen = screenInfo.numScreens - 1;
+ from_screen = 0;
+ to_screen = screenInfo.numScreens - 1;
}
#endif
- for (s=from_screen; s<=to_screen; s++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[s];
- Display *dpy = GetBackEndDisplay(cl,s);
+ for (s = from_screen; s <= to_screen; s++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[s];
+ Display *dpy = GetBackEndDisplay(cl, s);
- /* make sure pixmap exist in back-end */
- dmxSync( dmxScreen, 1 );
+ /* make sure pixmap exist in back-end */
+ dmxSync(dmxScreen, 1);
- LockDisplay(dpy);
- GetReq(GLXDestroyGLXPixmap,req);
- req->reqType = dmxScreen->glxMajorOpcode;
- req->glxCode = X_GLXDestroyGLXPixmap;
- req->glxpixmap = (unsigned int)pGlxPixmap->be_xids[s];
- UnlockDisplay(dpy);
- SyncHandle();
+ LockDisplay(dpy);
+ GetReq(GLXDestroyGLXPixmap, req);
+ req->reqType = dmxScreen->glxMajorOpcode;
+ req->glxCode = X_GLXDestroyGLXPixmap;
+ req->glxpixmap = (unsigned int) pGlxPixmap->be_xids[s];
+ UnlockDisplay(dpy);
+ SyncHandle();
}
-
return Success;
}
@@ -1974,7 +2069,8 @@ int __glXDestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
** this time that is of value. Consequently, this code must be
** implemented by somebody other than SGI.
*/
-int __glXDoSwapBuffers(__GLXclientState *cl, XID drawId, GLXContextTag tag)
+int
+__glXDoSwapBuffers(__GLXclientState * cl, XID drawId, GLXContextTag tag)
{
ClientPtr client = cl->client;
DrawablePtr pDraw;
@@ -1982,6 +2078,7 @@ int __glXDoSwapBuffers(__GLXclientState *cl, XID drawId, GLXContextTag tag)
WindowPtr pWin = NULL;
__GLXpixmap *pGlxPixmap = NULL;
__GLXcontext *glxc = NULL;
+
#ifdef PANORAMIX
PanoramiXRes *pXinDraw = NULL;
#endif
@@ -1989,152 +2086,154 @@ int __glXDoSwapBuffers(__GLXclientState *cl, XID drawId, GLXContextTag tag)
int from_screen = 0;
int to_screen = 0;
int s, rc;
-
+
/*
- ** Check that the GLX drawable is valid.
- */
+ ** Check that the GLX drawable is valid.
+ */
rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixWriteAccess);
if (rc == Success) {
from_screen = to_screen = pDraw->pScreen->myNum;
- if (pDraw->type == DRAWABLE_WINDOW) {
- /*
- ** Drawable is an X window.
- */
- pWin = (WindowPtr)pDraw;
- } else {
- /*
- ** Drawable is an X pixmap, which is not allowed.
- */
- client->errorValue = drawId;
- return __glXBadDrawable;
- }
- }
+ if (pDraw->type == DRAWABLE_WINDOW) {
+ /*
+ ** Drawable is an X window.
+ */
+ pWin = (WindowPtr) pDraw;
+ }
+ else {
+ /*
+ ** Drawable is an X pixmap, which is not allowed.
+ */
+ client->errorValue = drawId;
+ return __glXBadDrawable;
+ }
+ }
if (!pDraw) {
- dixLookupResourceByType((pointer*) &pGlxPixmap, drawId,
- __glXPixmapRes, NullClient, DixUnknownAccess);
- if (pGlxPixmap) {
- /*
- ** Drawable is a GLX pixmap.
- */
- pDraw = pGlxPixmap->pDraw;
- from_screen = to_screen = pGlxPixmap->pScreen->myNum;
- }
- }
-
- if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
- dixLookupResourceByType((pointer*) &pGlxWindow, drawId,
- __glXWindowRes, NullClient, DixUnknownAccess);
- if (pGlxWindow) {
- /*
- ** Drawable is a GLXWindow.
- */
- pDraw = pGlxWindow->pDraw;
- from_screen = to_screen = pGlxWindow->pScreen->myNum;
- }
+ dixLookupResourceByType((pointer *) &pGlxPixmap, drawId,
+ __glXPixmapRes, NullClient, DixUnknownAccess);
+ if (pGlxPixmap) {
+ /*
+ ** Drawable is a GLX pixmap.
+ */
+ pDraw = pGlxPixmap->pDraw;
+ from_screen = to_screen = pGlxPixmap->pScreen->myNum;
+ }
+ }
+
+ if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1, 3)) {
+ dixLookupResourceByType((pointer *) &pGlxWindow, drawId,
+ __glXWindowRes, NullClient, DixUnknownAccess);
+ if (pGlxWindow) {
+ /*
+ ** Drawable is a GLXWindow.
+ */
+ pDraw = pGlxWindow->pDraw;
+ from_screen = to_screen = pGlxWindow->pScreen->myNum;
+ }
}
if (!pDraw) {
- /*
- ** Drawable is neither a X window nor a GLX pixmap.
- */
- client->errorValue = drawId;
- return __glXBadDrawable;
+ /*
+ ** Drawable is neither a X window nor a GLX pixmap.
+ */
+ client->errorValue = drawId;
+ return __glXBadDrawable;
}
if (tag) {
- glxc = __glXLookupContextByTag(cl, tag);
- if (!glxc) {
- return __glXBadContextTag;
- }
+ glxc = __glXLookupContextByTag(cl, tag);
+ if (!glxc) {
+ return __glXBadContextTag;
+ }
}
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
- from_screen = 0;
- to_screen = screenInfo.numScreens - 1;
- dixLookupResourceByClass((pointer*) &pXinDraw,
- pDraw->id, XRC_DRAWABLE,
- client, DixReadAccess);
+ from_screen = 0;
+ to_screen = screenInfo.numScreens - 1;
+ dixLookupResourceByClass((pointer *) &pXinDraw,
+ pDraw->id, XRC_DRAWABLE,
+ client, DixReadAccess);
}
#endif
/* If requested, send a glFinish to all back-end servers before swapping. */
if (dmxGLXFinishSwap) {
- for (s=from_screen; s<=to_screen; s++) {
- Display *dpy = GetBackEndDisplay(cl,s);
- DMXScreenInfo *dmxScreen = &dmxScreens[s];
- xGLXSingleReq *finishReq;
- xGLXSingleReply reply;
-
-#define X_GLXSingle 0 /* needed by GetReq below */
-
- LockDisplay(dpy);
- GetReq(GLXSingle,finishReq);
- finishReq->reqType = dmxScreen->glxMajorOpcode;
- finishReq->glxCode = X_GLsop_Finish;
- finishReq->contextTag = (tag ? GetCurrentBackEndTag(cl,tag,s) : 0);
- (void) _XReply(dpy, (xReply*) &reply, 0, False);
- UnlockDisplay(dpy);
- SyncHandle();
- }
+ for (s = from_screen; s <= to_screen; s++) {
+ Display *dpy = GetBackEndDisplay(cl, s);
+ DMXScreenInfo *dmxScreen = &dmxScreens[s];
+ xGLXSingleReq *finishReq;
+ xGLXSingleReply reply;
+
+#define X_GLXSingle 0 /* needed by GetReq below */
+
+ LockDisplay(dpy);
+ GetReq(GLXSingle, finishReq);
+ finishReq->reqType = dmxScreen->glxMajorOpcode;
+ finishReq->glxCode = X_GLsop_Finish;
+ finishReq->contextTag =
+ (tag ? GetCurrentBackEndTag(cl, tag, s) : 0);
+ (void) _XReply(dpy, (xReply *) & reply, 0, False);
+ UnlockDisplay(dpy);
+ SyncHandle();
+ }
}
/* If requested, send an XSync to all back-end servers before swapping. */
if (dmxGLXSyncSwap) {
- for (s=from_screen; s<=to_screen; s++)
- XSync(GetBackEndDisplay(cl,s), False);
+ for (s = from_screen; s <= to_screen; s++)
+ XSync(GetBackEndDisplay(cl, s), False);
}
-
/* send the SwapBuffers request to all back-end servers */
- for (s=from_screen; s<=to_screen; s++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[s];
- Display *dpy = GetBackEndDisplay(cl,s);
- unsigned int be_draw = 0;
+ for (s = from_screen; s <= to_screen; s++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[s];
+ Display *dpy = GetBackEndDisplay(cl, s);
+ unsigned int be_draw = 0;
- if (pGlxPixmap) {
- be_draw = (unsigned int)pGlxPixmap->be_xids[s];
- }
+ if (pGlxPixmap) {
+ be_draw = (unsigned int) pGlxPixmap->be_xids[s];
+ }
#ifdef PANORAMIX
- else if (pXinDraw) {
- dixLookupWindow(&pWin, pXinDraw->info[s].id, client, DixReadAccess);
- }
+ else if (pXinDraw) {
+ dixLookupWindow(&pWin, pXinDraw->info[s].id, client, DixReadAccess);
+ }
#endif
- else if (pGlxWindow) {
- pWin = (WindowPtr)pGlxWindow->pDraw;
- }
-
- if (pWin && !be_draw) {
- be_draw = (unsigned int)(DMX_GET_WINDOW_PRIV(pWin))->window;
- if (!be_draw) {
- /* it might be that the window did not created yet on the */
- /* back-end server (lazy window creation option), force */
- /* creation of the window */
- dmxCreateAndRealizeWindow( pWin, TRUE );
- be_draw = (unsigned int)(DMX_GET_WINDOW_PRIV(pWin))->window;
- }
- }
-
- dmxSync( dmxScreen, 1 );
-
- LockDisplay(dpy);
- GetReq(GLXSwapBuffers,be_req);
- be_req->reqType = dmxScreen->glxMajorOpcode;
- be_req->glxCode = X_GLXSwapBuffers;
- be_req->drawable = be_draw;
- be_req->contextTag = ( tag ? GetCurrentBackEndTag(cl,tag,s) : 0 );
- UnlockDisplay(dpy);
- SyncHandle();
- XFlush(dpy);
+ else if (pGlxWindow) {
+ pWin = (WindowPtr) pGlxWindow->pDraw;
+ }
+
+ if (pWin && !be_draw) {
+ be_draw = (unsigned int) (DMX_GET_WINDOW_PRIV(pWin))->window;
+ if (!be_draw) {
+ /* it might be that the window did not created yet on the */
+ /* back-end server (lazy window creation option), force */
+ /* creation of the window */
+ dmxCreateAndRealizeWindow(pWin, TRUE);
+ be_draw = (unsigned int) (DMX_GET_WINDOW_PRIV(pWin))->window;
+ }
+ }
+
+ dmxSync(dmxScreen, 1);
+
+ LockDisplay(dpy);
+ GetReq(GLXSwapBuffers, be_req);
+ be_req->reqType = dmxScreen->glxMajorOpcode;
+ be_req->glxCode = X_GLXSwapBuffers;
+ be_req->drawable = be_draw;
+ be_req->contextTag = (tag ? GetCurrentBackEndTag(cl, tag, s) : 0);
+ UnlockDisplay(dpy);
+ SyncHandle();
+ XFlush(dpy);
}
return Success;
}
-int __glXSwapBuffers(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapBuffers(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
DrawablePtr pDraw;
@@ -2145,68 +2244,67 @@ int __glXSwapBuffers(__GLXclientState *cl, GLbyte *pc)
__GLXcontext *glxc = NULL;
__glXWindow *pGlxWindow = NULL;
int rc;
-
+
/*
- ** Check that the GLX drawable is valid.
- */
+ ** Check that the GLX drawable is valid.
+ */
rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixWriteAccess);
if (rc == Success) {
- if (pDraw->type != DRAWABLE_WINDOW) {
- /*
- ** Drawable is an X pixmap, which is not allowed.
- */
- client->errorValue = drawId;
- return __glXBadDrawable;
- }
- }
+ if (pDraw->type != DRAWABLE_WINDOW) {
+ /*
+ ** Drawable is an X pixmap, which is not allowed.
+ */
+ client->errorValue = drawId;
+ return __glXBadDrawable;
+ }
+ }
if (!pDraw) {
- dixLookupResourceByType((pointer*) &pGlxPixmap, drawId,
- __glXPixmapRes, NullClient, DixUnknownAccess);
- if (pGlxPixmap) {
- /*
- ** Drawable is a GLX pixmap.
- */
- pDraw = pGlxPixmap->pDraw;
- }
- }
-
- if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1,3) ) {
- dixLookupResourceByType((pointer*) &pGlxWindow, drawId,
- __glXWindowRes, NullClient, DixUnknownAccess);
- if (pGlxWindow) {
- /*
- ** Drawable is a GLXWindow.
- */
- pDraw = pGlxWindow->pDraw;
- }
+ dixLookupResourceByType((pointer *) &pGlxPixmap, drawId,
+ __glXPixmapRes, NullClient, DixUnknownAccess);
+ if (pGlxPixmap) {
+ /*
+ ** Drawable is a GLX pixmap.
+ */
+ pDraw = pGlxPixmap->pDraw;
+ }
+ }
+
+ if (!pDraw && __GLX_IS_VERSION_SUPPORTED(1, 3)) {
+ dixLookupResourceByType((pointer *) &pGlxWindow, drawId,
+ __glXWindowRes, NullClient, DixUnknownAccess);
+ if (pGlxWindow) {
+ /*
+ ** Drawable is a GLXWindow.
+ */
+ pDraw = pGlxWindow->pDraw;
+ }
}
if (!pDraw) {
- /*
- ** Drawable is neither a X window nor a GLX pixmap.
- */
- client->errorValue = drawId;
- return __glXBadDrawable;
+ /*
+ ** Drawable is neither a X window nor a GLX pixmap.
+ */
+ client->errorValue = drawId;
+ return __glXBadDrawable;
}
if (tag) {
- glxc = __glXLookupContextByTag(cl, tag);
- if (!glxc) {
- return __glXBadContextTag;
- }
+ glxc = __glXLookupContextByTag(cl, tag);
+ if (!glxc) {
+ return __glXBadContextTag;
+ }
}
if (pDraw &&
- pDraw->type == DRAWABLE_WINDOW &&
- DMX_GET_WINDOW_PRIV((WindowPtr)pDraw)->swapGroup) {
- return SGSwapBuffers(cl, drawId, tag, pDraw);
+ pDraw->type == DRAWABLE_WINDOW &&
+ DMX_GET_WINDOW_PRIV((WindowPtr) pDraw)->swapGroup) {
+ return SGSwapBuffers(cl, drawId, tag, pDraw);
}
return __glXDoSwapBuffers(cl, drawId, tag);
}
-
/************************************************************************/
/*
@@ -2217,7 +2315,8 @@ int __glXSwapBuffers(__GLXclientState *cl, GLbyte *pc)
/*
** Execute all the drawing commands in a request.
*/
-int __glXRender(__GLXclientState *cl, GLbyte *pc)
+int
+__glXRender(__GLXclientState * cl, GLbyte * pc)
{
xGLXRenderReq *req;
xGLXRenderReq *be_req;
@@ -2228,23 +2327,23 @@ int __glXRender(__GLXclientState *cl, GLbyte *pc)
int s;
/*
- ** NOTE: much of this code also appears in the byteswapping version of this
- ** routine, __glXSwapRender(). Any changes made here should also be
- ** duplicated there.
- */
-
+ ** NOTE: much of this code also appears in the byteswapping version of this
+ ** routine, __glXSwapRender(). Any changes made here should also be
+ ** duplicated there.
+ */
+
req = (xGLXRenderReq *) pc;
glxc = __glXLookupContextByTag(cl, req->contextTag);
if (!glxc) {
- return 0;
+ return 0;
}
from_screen = to_screen = glxc->pScreen->myNum;
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
- from_screen = 0;
- to_screen = screenInfo.numScreens - 1;
+ from_screen = 0;
+ to_screen = screenInfo.numScreens - 1;
}
#endif
@@ -2254,19 +2353,19 @@ int __glXRender(__GLXclientState *cl, GLbyte *pc)
/*
* just forward the request to back-end server(s)
*/
- for (s=from_screen; s<=to_screen; s++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[s];
- Display *dpy = GetBackEndDisplay(cl,s);
+ for (s = from_screen; s <= to_screen; s++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[s];
+ Display *dpy = GetBackEndDisplay(cl, s);
- LockDisplay(dpy);
- GetReq(GLXRender,be_req);
- be_req->reqType = dmxScreen->glxMajorOpcode;
- be_req->glxCode = X_GLXRender;
- be_req->length = req->length;
- be_req->contextTag = GetCurrentBackEndTag(cl,req->contextTag,s);
- _XSend(dpy, (const char *)pc, size);
- UnlockDisplay(dpy);
- SyncHandle();
+ LockDisplay(dpy);
+ GetReq(GLXRender, be_req);
+ be_req->reqType = dmxScreen->glxMajorOpcode;
+ be_req->glxCode = X_GLXRender;
+ be_req->length = req->length;
+ be_req->contextTag = GetCurrentBackEndTag(cl, req->contextTag, s);
+ _XSend(dpy, (const char *) pc, size);
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return Success;
@@ -2275,7 +2374,8 @@ int __glXRender(__GLXclientState *cl, GLbyte *pc)
/*
** Execute a large rendering request (one that spans multiple X requests).
*/
-int __glXRenderLarge(__GLXclientState *cl, GLbyte *pc)
+int
+__glXRenderLarge(__GLXclientState * cl, GLbyte * pc)
{
xGLXRenderLargeReq *req;
xGLXRenderLargeReq *be_req;
@@ -2285,22 +2385,22 @@ int __glXRenderLarge(__GLXclientState *cl, GLbyte *pc)
int s;
/*
- ** NOTE: much of this code also appears in the byteswapping version of this
- ** routine, __glXSwapRenderLarge(). Any changes made here should also be
- ** duplicated there.
- */
-
+ ** NOTE: much of this code also appears in the byteswapping version of this
+ ** routine, __glXSwapRenderLarge(). Any changes made here should also be
+ ** duplicated there.
+ */
+
req = (xGLXRenderLargeReq *) pc;
glxc = __glXLookupContextByTag(cl, req->contextTag);
if (!glxc) {
- return 0;
+ return 0;
}
from_screen = to_screen = glxc->pScreen->myNum;
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
- from_screen = 0;
- to_screen = screenInfo.numScreens - 1;
+ from_screen = 0;
+ to_screen = screenInfo.numScreens - 1;
}
#endif
@@ -2309,82 +2409,82 @@ int __glXRenderLarge(__GLXclientState *cl, GLbyte *pc)
/*
* just forward the request to back-end server(s)
*/
- for (s=from_screen; s<=to_screen; s++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[s];
- Display *dpy = GetBackEndDisplay(cl,s);
+ for (s = from_screen; s <= to_screen; s++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[s];
+ Display *dpy = GetBackEndDisplay(cl, s);
- GetReq(GLXRenderLarge,be_req);
- be_req->reqType = dmxScreen->glxMajorOpcode;
- be_req->glxCode = X_GLXRenderLarge;
- be_req->contextTag = GetCurrentBackEndTag(cl,req->contextTag,s);
- be_req->length = req->length;
- be_req->requestNumber = req->requestNumber;
- be_req->requestTotal = req->requestTotal;
- be_req->dataBytes = req->dataBytes;
- Data(dpy, (const char *)pc, req->dataBytes);
- UnlockDisplay(dpy);
- SyncHandle();
+ GetReq(GLXRenderLarge, be_req);
+ be_req->reqType = dmxScreen->glxMajorOpcode;
+ be_req->glxCode = X_GLXRenderLarge;
+ be_req->contextTag = GetCurrentBackEndTag(cl, req->contextTag, s);
+ be_req->length = req->length;
+ be_req->requestNumber = req->requestNumber;
+ be_req->requestTotal = req->requestTotal;
+ be_req->dataBytes = req->dataBytes;
+ Data(dpy, (const char *) pc, req->dataBytes);
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return Success;
}
-
/************************************************************************/
-int __glXVendorPrivate(__GLXclientState *cl, GLbyte *pc)
+int
+__glXVendorPrivate(__GLXclientState * cl, GLbyte * pc)
{
xGLXVendorPrivateReq *req;
req = (xGLXVendorPrivateReq *) pc;
- switch( req->vendorCode ) {
-
- case X_GLvop_DeleteTexturesEXT:
- return __glXVForwardSingleReq( cl, pc );
- break;
-
- case X_GLXvop_SwapIntervalSGI:
- if (glxIsExtensionSupported("SGI_swap_control")) {
- return __glXVForwardSingleReq( cl, pc );
- }
- else {
- return Success;
- }
- break;
-
-#if 0 /* glx 1.3 */
- case X_GLXvop_CreateGLXVideoSourceSGIX:
- break;
- case X_GLXvop_DestroyGLXVideoSourceSGIX:
- break;
- case X_GLXvop_CreateGLXPixmapWithConfigSGIX:
- break;
- case X_GLXvop_DestroyGLXPbufferSGIX:
- break;
- case X_GLXvop_ChangeDrawableAttributesSGIX:
- break;
+ switch (req->vendorCode) {
+
+ case X_GLvop_DeleteTexturesEXT:
+ return __glXVForwardSingleReq(cl, pc);
+ break;
+
+ case X_GLXvop_SwapIntervalSGI:
+ if (glxIsExtensionSupported("SGI_swap_control")) {
+ return __glXVForwardSingleReq(cl, pc);
+ }
+ else {
+ return Success;
+ }
+ break;
+
+#if 0 /* glx 1.3 */
+ case X_GLXvop_CreateGLXVideoSourceSGIX:
+ break;
+ case X_GLXvop_DestroyGLXVideoSourceSGIX:
+ break;
+ case X_GLXvop_CreateGLXPixmapWithConfigSGIX:
+ break;
+ case X_GLXvop_DestroyGLXPbufferSGIX:
+ break;
+ case X_GLXvop_ChangeDrawableAttributesSGIX:
+ break;
#endif
- case X_GLXvop_BindSwapBarrierSGIX:
- return __glXBindSwapBarrierSGIX( cl, pc );
- break;
+ case X_GLXvop_BindSwapBarrierSGIX:
+ return __glXBindSwapBarrierSGIX(cl, pc);
+ break;
- case X_GLXvop_JoinSwapGroupSGIX:
- return __glXJoinSwapGroupSGIX( cl, pc );
- break;
+ case X_GLXvop_JoinSwapGroupSGIX:
+ return __glXJoinSwapGroupSGIX(cl, pc);
+ break;
- case X_GLXvop_CreateContextWithConfigSGIX:
- return __glXCreateContextWithConfigSGIX( cl, pc );
- break;
+ case X_GLXvop_CreateContextWithConfigSGIX:
+ return __glXCreateContextWithConfigSGIX(cl, pc);
+ break;
- default:
- /*
- ** unsupported private request
- */
- cl->client->errorValue = req->vendorCode;
- return __glXUnsupportedPrivateRequest;
+ default:
+ /*
+ ** unsupported private request
+ */
+ cl->client->errorValue = req->vendorCode;
+ return __glXUnsupportedPrivateRequest;
}
cl->client->errorValue = req->vendorCode;
@@ -2392,78 +2492,79 @@ int __glXVendorPrivate(__GLXclientState *cl, GLbyte *pc)
}
-int __glXVendorPrivateWithReply(__GLXclientState *cl, GLbyte *pc)
+int
+__glXVendorPrivateWithReply(__GLXclientState * cl, GLbyte * pc)
{
xGLXVendorPrivateWithReplyReq *req;
req = (xGLXVendorPrivateWithReplyReq *) pc;
- switch( req->vendorCode ) {
-
- case X_GLvop_GetConvolutionFilterEXT:
- case X_GLvop_GetConvolutionParameterfvEXT:
- case X_GLvop_GetConvolutionParameterivEXT:
- case X_GLvop_GetSeparableFilterEXT:
- case X_GLvop_GetHistogramEXT:
- case X_GLvop_GetHistogramParameterivEXT:
- case X_GLvop_GetMinmaxEXT:
- case X_GLvop_GetMinmaxParameterfvEXT:
- case X_GLvop_GetMinmaxParameterivEXT:
- case X_GLvop_AreTexturesResidentEXT:
- case X_GLvop_IsTextureEXT:
- return( __glXVForwardPipe0WithReply(cl, pc) );
- break;
-
- case X_GLvop_GenTexturesEXT:
- return( __glXVForwardAllWithReply(cl, pc) );
- break;
-
-
-#if 0 /* glx1.3 */
- case X_GLvop_GetDetailTexFuncSGIS:
- case X_GLvop_GetSharpenTexFuncSGIS:
- case X_GLvop_GetColorTableSGI:
- case X_GLvop_GetColorTableParameterfvSGI:
- case X_GLvop_GetColorTableParameterivSGI:
- case X_GLvop_GetTexFilterFuncSGIS:
- case X_GLvop_GetInstrumentsSGIX:
- case X_GLvop_InstrumentsBufferSGIX:
- case X_GLvop_PollInstrumentsSGIX:
- case X_GLvop_FlushRasterSGIX:
- case X_GLXvop_CreateGLXPbufferSGIX:
- case X_GLXvop_GetDrawableAttributesSGIX:
- case X_GLXvop_QueryHyperpipeNetworkSGIX:
- case X_GLXvop_QueryHyperpipeConfigSGIX:
- case X_GLXvop_HyperpipeConfigSGIX:
- case X_GLXvop_DestroyHyperpipeConfigSGIX:
+ switch (req->vendorCode) {
+
+ case X_GLvop_GetConvolutionFilterEXT:
+ case X_GLvop_GetConvolutionParameterfvEXT:
+ case X_GLvop_GetConvolutionParameterivEXT:
+ case X_GLvop_GetSeparableFilterEXT:
+ case X_GLvop_GetHistogramEXT:
+ case X_GLvop_GetHistogramParameterivEXT:
+ case X_GLvop_GetMinmaxEXT:
+ case X_GLvop_GetMinmaxParameterfvEXT:
+ case X_GLvop_GetMinmaxParameterivEXT:
+ case X_GLvop_AreTexturesResidentEXT:
+ case X_GLvop_IsTextureEXT:
+ return (__glXVForwardPipe0WithReply(cl, pc));
+ break;
+
+ case X_GLvop_GenTexturesEXT:
+ return (__glXVForwardAllWithReply(cl, pc));
+ break;
+
+#if 0 /* glx1.3 */
+ case X_GLvop_GetDetailTexFuncSGIS:
+ case X_GLvop_GetSharpenTexFuncSGIS:
+ case X_GLvop_GetColorTableSGI:
+ case X_GLvop_GetColorTableParameterfvSGI:
+ case X_GLvop_GetColorTableParameterivSGI:
+ case X_GLvop_GetTexFilterFuncSGIS:
+ case X_GLvop_GetInstrumentsSGIX:
+ case X_GLvop_InstrumentsBufferSGIX:
+ case X_GLvop_PollInstrumentsSGIX:
+ case X_GLvop_FlushRasterSGIX:
+ case X_GLXvop_CreateGLXPbufferSGIX:
+ case X_GLXvop_GetDrawableAttributesSGIX:
+ case X_GLXvop_QueryHyperpipeNetworkSGIX:
+ case X_GLXvop_QueryHyperpipeConfigSGIX:
+ case X_GLXvop_HyperpipeConfigSGIX:
+ case X_GLXvop_DestroyHyperpipeConfigSGIX:
#endif
- case X_GLXvop_QueryMaxSwapBarriersSGIX:
- return( __glXQueryMaxSwapBarriersSGIX(cl, pc) );
- break;
+ case X_GLXvop_QueryMaxSwapBarriersSGIX:
+ return (__glXQueryMaxSwapBarriersSGIX(cl, pc));
+ break;
- case X_GLXvop_GetFBConfigsSGIX:
- return( __glXGetFBConfigsSGIX(cl, pc) );
- break;
+ case X_GLXvop_GetFBConfigsSGIX:
+ return (__glXGetFBConfigsSGIX(cl, pc));
+ break;
- case X_GLXvop_MakeCurrentReadSGI:
- return( __glXMakeCurrentReadSGI(cl, pc) );
- break;
+ case X_GLXvop_MakeCurrentReadSGI:
+ return (__glXMakeCurrentReadSGI(cl, pc));
+ break;
- case X_GLXvop_QueryContextInfoEXT:
- return( __glXQueryContextInfoEXT(cl,pc) );
- break;
+ case X_GLXvop_QueryContextInfoEXT:
+ return (__glXQueryContextInfoEXT(cl, pc));
+ break;
- default:
- /*
- ** unsupported private request
- */
- cl->client->errorValue = req->vendorCode;
- return __glXUnsupportedPrivateRequest;
+ default:
+ /*
+ ** unsupported private request
+ */
+ cl->client->errorValue = req->vendorCode;
+ return __glXUnsupportedPrivateRequest;
}
}
-int __glXQueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
+int
+__glXQueryExtensionsString(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *) pc;
@@ -2484,34 +2585,36 @@ int __glXQueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
screen = req->screen;
/*
- ** Check if screen exists.
- */
+ ** Check if screen exists.
+ */
if ((screen < 0) || (screen >= screenInfo.numScreens)) {
- client->errorValue = screen;
- return BadValue;
+ client->errorValue = screen;
+ return BadValue;
}
#ifdef FWD_QUERY_REQ
dmxScreen = &dmxScreens[screen];
/* Send the glXQueryServerString request */
- dpy = GetBackEndDisplay(cl,screen);
+ dpy = GetBackEndDisplay(cl, screen);
LockDisplay(dpy);
- GetReq(GLXQueryExtensionsString,be_req);
+ GetReq(GLXQueryExtensionsString, be_req);
be_req->reqType = dmxScreen->glxMajorOpcode;
be_req->glxCode = X_GLXQueryServerString;
be_req->screen = DefaultScreen(dpy);
- _XReply(dpy, (xReply*) &be_reply, 0, False);
- len = (int)be_reply.length;
- numbytes = (int)be_reply.n;
+ _XReply(dpy, (xReply *) & be_reply, 0, False);
+ len = (int) be_reply.length;
+ numbytes = (int) be_reply.n;
slop = numbytes * __GLX_SIZE_INT8 & 3;
- be_buf = (char *)malloc(numbytes);
+ be_buf = (char *) malloc(numbytes);
if (!be_buf) {
/* Throw data on the floor */
_XEatData(dpy, len);
- } else {
- _XRead(dpy, (char *)be_buf, numbytes);
- if (slop) _XEatData(dpy,4-slop);
+ }
+ else {
+ _XRead(dpy, (char *) be_buf, numbytes);
+ if (slop)
+ _XEatData(dpy, 4 - slop);
}
UnlockDisplay(dpy);
SyncHandle();
@@ -2532,15 +2635,18 @@ int __glXQueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
if (client->swapped) {
glxSwapQueryExtensionsStringReply(client, &reply, be_buf);
- } else {
- WriteToClient(client, sz_xGLXQueryExtensionsStringReply,(char *)&reply);
- WriteToClient(client, (int)(length << 2), (char *)be_buf);
+ }
+ else {
+ WriteToClient(client, sz_xGLXQueryExtensionsStringReply,
+ (char *) &reply);
+ WriteToClient(client, (int) (length << 2), (char *) be_buf);
}
return Success;
}
-int __glXQueryServerString(__GLXclientState *cl, GLbyte *pc)
+int
+__glXQueryServerString(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *) pc;
@@ -2550,46 +2656,49 @@ int __glXQueryServerString(__GLXclientState *cl, GLbyte *pc)
size_t length;
int len, numbytes;
char *be_buf;
+
#ifdef FWD_QUERY_REQ
xGLXQueryServerStringReq *be_req;
xGLXQueryServerStringReply be_reply;
DMXScreenInfo *dmxScreen;
Display *dpy;
- int slop;
+ int slop;
#endif
name = req->name;
screen = req->screen;
/*
- ** Check if screen exists.
- */
+ ** Check if screen exists.
+ */
if ((screen < 0) || (screen >= screenInfo.numScreens)) {
- client->errorValue = screen;
- return BadValue;
+ client->errorValue = screen;
+ return BadValue;
}
#ifdef FWD_QUERY_REQ
dmxScreen = &dmxScreens[screen];
/* Send the glXQueryServerString request */
- dpy = GetBackEndDisplay(cl,screen);
+ dpy = GetBackEndDisplay(cl, screen);
LockDisplay(dpy);
- GetReq(GLXQueryServerString,be_req);
+ GetReq(GLXQueryServerString, be_req);
be_req->reqType = dmxScreen->glxMajorOpcode;
be_req->glxCode = X_GLXQueryServerString;
be_req->screen = DefaultScreen(dpy);
be_req->name = name;
- _XReply(dpy, (xReply*) &be_reply, 0, False);
- len = (int)be_reply.length;
- numbytes = (int)be_reply.n;
+ _XReply(dpy, (xReply *) & be_reply, 0, False);
+ len = (int) be_reply.length;
+ numbytes = (int) be_reply.n;
slop = numbytes * __GLX_SIZE_INT8 & 3;
- be_buf = (char *)malloc(numbytes);
+ be_buf = (char *) malloc(numbytes);
if (!be_buf) {
/* Throw data on the floor */
_XEatData(dpy, len);
- } else {
- _XRead(dpy, (char *)be_buf, numbytes);
- if (slop) _XEatData(dpy,4-slop);
+ }
+ else {
+ _XRead(dpy, (char *) be_buf, numbytes);
+ if (slop)
+ _XEatData(dpy, 4 - slop);
}
UnlockDisplay(dpy);
SyncHandle();
@@ -2608,15 +2717,17 @@ int __glXQueryServerString(__GLXclientState *cl, GLbyte *pc)
if (client->swapped) {
glxSwapQueryServerStringReply(client, &reply, be_buf);
- } else {
- WriteToClient(client, sz_xGLXQueryServerStringReply, (char *)&reply);
- WriteToClient(client, (int)(length << 2), be_buf);
+ }
+ else {
+ WriteToClient(client, sz_xGLXQueryServerStringReply, (char *) &reply);
+ WriteToClient(client, (int) (length << 2), be_buf);
}
return Success;
}
-int __glXClientInfo(__GLXclientState *cl, GLbyte *pc)
+int
+__glXClientInfo(__GLXclientState * cl, GLbyte * pc)
{
xGLXClientInfoReq *req = (xGLXClientInfoReq *) pc;
xGLXClientInfoReq *be_req;
@@ -2624,38 +2735,38 @@ int __glXClientInfo(__GLXclientState *cl, GLbyte *pc)
int from_screen = 0;
int to_screen = 0;
int s;
-
+
cl->GLClientmajorVersion = req->major;
cl->GLClientminorVersion = req->minor;
free(cl->GLClientextensions);
- buf = (const char *)(req+1);
+ buf = (const char *) (req + 1);
cl->GLClientextensions = strdup(buf);
to_screen = screenInfo.numScreens - 1;
- for (s=from_screen; s<=to_screen; s++)
- {
- DMXScreenInfo *dmxScreen = &dmxScreens[s];
- Display *dpy = GetBackEndDisplay(cl,s);
+ for (s = from_screen; s <= to_screen; s++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[s];
+ Display *dpy = GetBackEndDisplay(cl, s);
- LockDisplay(dpy);
- GetReq(GLXClientInfo,be_req);
- be_req->reqType = dmxScreen->glxMajorOpcode;
- be_req->glxCode = X_GLXClientInfo;
- be_req->major = req->major;
- be_req->minor = req->minor;
- be_req->length = req->length;
- be_req->numbytes = req->numbytes;
- Data(dpy, buf, req->numbytes);
+ LockDisplay(dpy);
+ GetReq(GLXClientInfo, be_req);
+ be_req->reqType = dmxScreen->glxMajorOpcode;
+ be_req->glxCode = X_GLXClientInfo;
+ be_req->major = req->major;
+ be_req->minor = req->minor;
+ be_req->length = req->length;
+ be_req->numbytes = req->numbytes;
+ Data(dpy, buf, req->numbytes);
- UnlockDisplay(dpy);
- SyncHandle();
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return Success;
}
-int __glXUseXFont(__GLXclientState *cl, GLbyte *pc)
+int
+__glXUseXFont(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXUseXFontReq *req;
@@ -2665,66 +2776,66 @@ int __glXUseXFont(__GLXclientState *cl, GLbyte *pc)
int from_screen = 0;
int to_screen = 0;
int s;
- dmxFontPrivPtr pFontPriv;
+ dmxFontPrivPtr pFontPriv;
DMXScreenInfo *dmxScreen;
Display *dpy;
req = (xGLXUseXFontReq *) pc;
if (req->contextTag != 0) {
- glxc = __glXLookupContextByTag(cl, req->contextTag);
- if (glxc) {
- from_screen = to_screen = glxc->pScreen->myNum;
- }
+ glxc = __glXLookupContextByTag(cl, req->contextTag);
+ if (glxc) {
+ from_screen = to_screen = glxc->pScreen->myNum;
+ }
}
/*
- ** Font can actually be either the ID of a font or the ID of a GC
- ** containing a font.
- */
- dixLookupResourceByType((pointer*) &pFont, req->font, RT_FONT,
+ ** Font can actually be either the ID of a font or the ID of a GC
+ ** containing a font.
+ */
+ dixLookupResourceByType((pointer *) &pFont, req->font, RT_FONT,
NullClient, DixUnknownAccess);
if (!pFont) {
GC *pGC;
- dixLookupResourceByType((pointer*) &pGC, req->font,
- RT_GC, NullClient,
- DixUnknownAccess);
+
+ dixLookupResourceByType((pointer *) &pGC, req->font,
+ RT_GC, NullClient, DixUnknownAccess);
if (!pGC) {
- client->errorValue = req->font;
+ client->errorValue = req->font;
return BadFont;
- }
- pFont = pGC->font;
+ }
+ pFont = pGC->font;
}
pFontPriv = FontGetPrivate(pFont, dmxFontPrivateIndex);
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
- from_screen = 0;
- to_screen = screenInfo.numScreens - 1;
+ from_screen = 0;
+ to_screen = screenInfo.numScreens - 1;
}
#endif
+ for (s = from_screen; s <= to_screen; s++) {
+ dmxScreen = &dmxScreens[s];
+ dpy = GetBackEndDisplay(cl, s);
- for (s=from_screen; s<=to_screen; s++) {
- dmxScreen = &dmxScreens[s];
- dpy = GetBackEndDisplay(cl,s);
-
- dmxSync( dmxScreen, 1 );
+ dmxSync(dmxScreen, 1);
- LockDisplay(dpy);
- GetReq(GLXUseXFont,be_req);
- be_req->reqType = dmxScreen->glxMajorOpcode;
- be_req->glxCode = X_GLXUseXFont;
- be_req->contextTag = (glxc ? GetCurrentBackEndTag(cl,req->contextTag,s) : 0);
- be_req->font = pFontPriv->font[s]->fid;
- be_req->first = req->first;
- be_req->count = req->count;
- be_req->listBase = req->listBase;
- UnlockDisplay(dpy);
- SyncHandle();
+ LockDisplay(dpy);
+ GetReq(GLXUseXFont, be_req);
+ be_req->reqType = dmxScreen->glxMajorOpcode;
+ be_req->glxCode = X_GLXUseXFont;
+ be_req->contextTag =
+ (glxc ? GetCurrentBackEndTag(cl, req->contextTag, s) : 0);
+ be_req->font = pFontPriv->font[s]->fid;
+ be_req->first = req->first;
+ be_req->count = req->count;
+ be_req->listBase = req->listBase;
+ UnlockDisplay(dpy);
+ SyncHandle();
- XSync( dpy, False );
+ XSync(dpy, False);
}
return Success;
@@ -2734,7 +2845,8 @@ int __glXUseXFont(__GLXclientState *cl, GLbyte *pc)
* start GLX 1.3 here
*/
-int __glXGetFBConfigs(__GLXclientState *cl, GLbyte *pc)
+int
+__glXGetFBConfigs(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc;
@@ -2747,9 +2859,9 @@ int __glXGetFBConfigs(__GLXclientState *cl, GLbyte *pc)
__GLXscreenInfo *pGlxScreen;
if (screen >= screenInfo.numScreens) {
- /* The client library must send a valid screen number. */
- client->errorValue = screen;
- return BadValue;
+ /* The client library must send a valid screen number. */
+ client->errorValue = screen;
+ return BadValue;
}
pGlxScreen = &__glXActiveScreens[screen];
@@ -2762,169 +2874,174 @@ int __glXGetFBConfigs(__GLXclientState *cl, GLbyte *pc)
reply.sequenceNumber = client->sequence;
if (client->swapped) {
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_SHORT(&reply.sequenceNumber);
- __GLX_SWAP_INT(&reply.length);
- __GLX_SWAP_INT(&reply.numFBConfigs);
- __GLX_SWAP_INT(&reply.numAttribs);
- }
- WriteToClient(client, sz_xGLXGetFBConfigsReply, (char *)&reply);
-
- for (i=0; i < numFBConfigs; i++) {
- int associatedVisualId = 0;
- int drawableTypeIndex;
- pFBConfig = __glXFBConfigs[ i * (screenInfo.numScreens+1) ];
-
- p = 0;
- /* core attributes */
- buf[p++] = GLX_FBCONFIG_ID;
- buf[p++] = pFBConfig->id;
- buf[p++] = GLX_BUFFER_SIZE;
- buf[p++] = pFBConfig->indexBits;
- buf[p++] = GLX_LEVEL;
- buf[p++] = pFBConfig->level;
- buf[p++] = GLX_DOUBLEBUFFER;
- buf[p++] = pFBConfig->doubleBufferMode;
- buf[p++] = GLX_STEREO;
- buf[p++] = pFBConfig->stereoMode;
- buf[p++] = GLX_AUX_BUFFERS;
- buf[p++] = pFBConfig->maxAuxBuffers;
- buf[p++] = GLX_RED_SIZE;
- buf[p++] = pFBConfig->redBits;
- buf[p++] = GLX_GREEN_SIZE;
- buf[p++] = pFBConfig->greenBits;
- buf[p++] = GLX_BLUE_SIZE;
- buf[p++] = pFBConfig->blueBits;
- buf[p++] = GLX_ALPHA_SIZE;
- buf[p++] = pFBConfig->alphaBits;
- buf[p++] = GLX_DEPTH_SIZE;
- buf[p++] = pFBConfig->depthBits;
- buf[p++] = GLX_STENCIL_SIZE;
- buf[p++] = pFBConfig->stencilBits;
- buf[p++] = GLX_ACCUM_RED_SIZE;
- buf[p++] = pFBConfig->accumRedBits;
- buf[p++] = GLX_ACCUM_GREEN_SIZE;
- buf[p++] = pFBConfig->accumGreenBits;
- buf[p++] = GLX_ACCUM_BLUE_SIZE;
- buf[p++] = pFBConfig->accumBlueBits;
- buf[p++] = GLX_ACCUM_ALPHA_SIZE;
- buf[p++] = pFBConfig->accumAlphaBits;
- buf[p++] = GLX_RENDER_TYPE;
- buf[p++] = pFBConfig->renderType;
- buf[p++] = GLX_DRAWABLE_TYPE;
- drawableTypeIndex = p;
- buf[p++] = pFBConfig->drawableType;
- buf[p++] = GLX_X_VISUAL_TYPE;
- buf[p++] = pFBConfig->visualType;
- buf[p++] = GLX_CONFIG_CAVEAT;
- buf[p++] = pFBConfig->visualCaveat;
- buf[p++] = GLX_TRANSPARENT_TYPE;
- buf[p++] = pFBConfig->transparentType;
- buf[p++] = GLX_TRANSPARENT_RED_VALUE;
- buf[p++] = pFBConfig->transparentRed;
- buf[p++] = GLX_TRANSPARENT_GREEN_VALUE;
- buf[p++] = pFBConfig->transparentGreen;
- buf[p++] = GLX_TRANSPARENT_BLUE_VALUE;
- buf[p++] = pFBConfig->transparentBlue;
- buf[p++] = GLX_TRANSPARENT_ALPHA_VALUE;
- buf[p++] = pFBConfig->transparentAlpha;
- buf[p++] = GLX_TRANSPARENT_INDEX_VALUE;
- buf[p++] = pFBConfig->transparentIndex;
- buf[p++] = GLX_MAX_PBUFFER_WIDTH;
- buf[p++] = pFBConfig->maxPbufferWidth;
- buf[p++] = GLX_MAX_PBUFFER_HEIGHT;
- buf[p++] = pFBConfig->maxPbufferHeight;
- buf[p++] = GLX_MAX_PBUFFER_PIXELS;
- buf[p++] = pFBConfig->maxPbufferPixels;
-
- /*
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_SWAP_SHORT(&reply.sequenceNumber);
+ __GLX_SWAP_INT(&reply.length);
+ __GLX_SWAP_INT(&reply.numFBConfigs);
+ __GLX_SWAP_INT(&reply.numAttribs);
+ }
+ WriteToClient(client, sz_xGLXGetFBConfigsReply, (char *) &reply);
+
+ for (i = 0; i < numFBConfigs; i++) {
+ int associatedVisualId = 0;
+ int drawableTypeIndex;
+
+ pFBConfig = __glXFBConfigs[i * (screenInfo.numScreens + 1)];
+
+ p = 0;
+ /* core attributes */
+ buf[p++] = GLX_FBCONFIG_ID;
+ buf[p++] = pFBConfig->id;
+ buf[p++] = GLX_BUFFER_SIZE;
+ buf[p++] = pFBConfig->indexBits;
+ buf[p++] = GLX_LEVEL;
+ buf[p++] = pFBConfig->level;
+ buf[p++] = GLX_DOUBLEBUFFER;
+ buf[p++] = pFBConfig->doubleBufferMode;
+ buf[p++] = GLX_STEREO;
+ buf[p++] = pFBConfig->stereoMode;
+ buf[p++] = GLX_AUX_BUFFERS;
+ buf[p++] = pFBConfig->maxAuxBuffers;
+ buf[p++] = GLX_RED_SIZE;
+ buf[p++] = pFBConfig->redBits;
+ buf[p++] = GLX_GREEN_SIZE;
+ buf[p++] = pFBConfig->greenBits;
+ buf[p++] = GLX_BLUE_SIZE;
+ buf[p++] = pFBConfig->blueBits;
+ buf[p++] = GLX_ALPHA_SIZE;
+ buf[p++] = pFBConfig->alphaBits;
+ buf[p++] = GLX_DEPTH_SIZE;
+ buf[p++] = pFBConfig->depthBits;
+ buf[p++] = GLX_STENCIL_SIZE;
+ buf[p++] = pFBConfig->stencilBits;
+ buf[p++] = GLX_ACCUM_RED_SIZE;
+ buf[p++] = pFBConfig->accumRedBits;
+ buf[p++] = GLX_ACCUM_GREEN_SIZE;
+ buf[p++] = pFBConfig->accumGreenBits;
+ buf[p++] = GLX_ACCUM_BLUE_SIZE;
+ buf[p++] = pFBConfig->accumBlueBits;
+ buf[p++] = GLX_ACCUM_ALPHA_SIZE;
+ buf[p++] = pFBConfig->accumAlphaBits;
+ buf[p++] = GLX_RENDER_TYPE;
+ buf[p++] = pFBConfig->renderType;
+ buf[p++] = GLX_DRAWABLE_TYPE;
+ drawableTypeIndex = p;
+ buf[p++] = pFBConfig->drawableType;
+ buf[p++] = GLX_X_VISUAL_TYPE;
+ buf[p++] = pFBConfig->visualType;
+ buf[p++] = GLX_CONFIG_CAVEAT;
+ buf[p++] = pFBConfig->visualCaveat;
+ buf[p++] = GLX_TRANSPARENT_TYPE;
+ buf[p++] = pFBConfig->transparentType;
+ buf[p++] = GLX_TRANSPARENT_RED_VALUE;
+ buf[p++] = pFBConfig->transparentRed;
+ buf[p++] = GLX_TRANSPARENT_GREEN_VALUE;
+ buf[p++] = pFBConfig->transparentGreen;
+ buf[p++] = GLX_TRANSPARENT_BLUE_VALUE;
+ buf[p++] = pFBConfig->transparentBlue;
+ buf[p++] = GLX_TRANSPARENT_ALPHA_VALUE;
+ buf[p++] = pFBConfig->transparentAlpha;
+ buf[p++] = GLX_TRANSPARENT_INDEX_VALUE;
+ buf[p++] = pFBConfig->transparentIndex;
+ buf[p++] = GLX_MAX_PBUFFER_WIDTH;
+ buf[p++] = pFBConfig->maxPbufferWidth;
+ buf[p++] = GLX_MAX_PBUFFER_HEIGHT;
+ buf[p++] = pFBConfig->maxPbufferHeight;
+ buf[p++] = GLX_MAX_PBUFFER_PIXELS;
+ buf[p++] = pFBConfig->maxPbufferPixels;
+
+ /*
* find the visual of the back-end server and match a visual
- * on the proxy.
- * do only once - if a visual is not yet associated.
- */
- if (pFBConfig->associatedVisualId == (unsigned int)-1) {
- DMXScreenInfo *dmxScreen = &dmxScreens[screen];
- __GLXFBConfig *be_pFBConfig = __glXFBConfigs[ i * (screenInfo.numScreens+1)+screen+1 ];
- __GLXvisualConfig *pGlxVisual = NULL;
- int v;
- int found = 0;
- for (v=0; v<dmxScreen->numGlxVisuals; v++) {
- if (dmxScreen->glxVisuals[v].vid == be_pFBConfig->associatedVisualId) {
- pGlxVisual = &dmxScreen->glxVisuals[v];
- break;
- }
- }
-
- if (pGlxVisual) {
- for (v=0; v<pGlxScreen->numVisuals; v++) {
- if (glxVisualsMatch(&pGlxScreen->pGlxVisual[v], pGlxVisual)) {
- associatedVisualId = pGlxScreen->pGlxVisual[v].vid;
- found = 1;
- break;
- }
- }
- }
-
- if (!found) {
- associatedVisualId = 0;
- pFBConfig->drawableType &= ~(GLX_WINDOW_BIT);
- buf[drawableTypeIndex] = pFBConfig->drawableType;
- }
+ * on the proxy.
+ * do only once - if a visual is not yet associated.
+ */
+ if (pFBConfig->associatedVisualId == (unsigned int) -1) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[screen];
+ __GLXFBConfig *be_pFBConfig =
+ __glXFBConfigs[i * (screenInfo.numScreens + 1) + screen + 1];
+ __GLXvisualConfig *pGlxVisual = NULL;
+ int v;
+ int found = 0;
+
+ for (v = 0; v < dmxScreen->numGlxVisuals; v++) {
+ if (dmxScreen->glxVisuals[v].vid ==
+ be_pFBConfig->associatedVisualId) {
+ pGlxVisual = &dmxScreen->glxVisuals[v];
+ break;
+ }
+ }
+
+ if (pGlxVisual) {
+ for (v = 0; v < pGlxScreen->numVisuals; v++) {
+ if (glxVisualsMatch(&pGlxScreen->pGlxVisual[v], pGlxVisual)) {
+ associatedVisualId = pGlxScreen->pGlxVisual[v].vid;
+ found = 1;
+ break;
+ }
+ }
+ }
+
+ if (!found) {
+ associatedVisualId = 0;
+ pFBConfig->drawableType &= ~(GLX_WINDOW_BIT);
+ buf[drawableTypeIndex] = pFBConfig->drawableType;
+ }
#ifdef PANORAMIX
- else if (!noPanoramiXExtension) {
- /* convert the associated visualId to the panoramix one */
- pFBConfig->associatedVisualId =
- PanoramiXTranslateVisualID(screen, v);
- }
+ else if (!noPanoramiXExtension) {
+ /* convert the associated visualId to the panoramix one */
+ pFBConfig->associatedVisualId =
+ PanoramiXTranslateVisualID(screen, v);
+ }
#endif
- }
- else {
- associatedVisualId = pFBConfig->associatedVisualId;
- }
-
- buf[p++] = GLX_VISUAL_ID;
- buf[p++] = associatedVisualId;
-
- /* SGIS_multisample attributes */
- buf[p++] = GLX_SAMPLES_SGIS;
- buf[p++] = pFBConfig->multiSampleSize;
- buf[p++] = GLX_SAMPLE_BUFFERS_SGIS;
- buf[p++] = pFBConfig->nMultiSampleBuffers;
-
- /* SGIX_pbuffer specific attributes */
- buf[p++] = GLX_OPTIMAL_PBUFFER_WIDTH_SGIX;
- buf[p++] = pFBConfig->optimalPbufferWidth;
- buf[p++] = GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX;
- buf[p++] = pFBConfig->optimalPbufferHeight;
-
- buf[p++] = GLX_VISUAL_SELECT_GROUP_SGIX;
- buf[p++] = pFBConfig->visualSelectGroup;
-
- if (client->swapped) {
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_INT_ARRAY((int *)buf, 2*numAttribs);
- }
- WriteToClient(client, 2*numAttribs * __GLX_SIZE_CARD32, (char *)buf);
+ }
+ else {
+ associatedVisualId = pFBConfig->associatedVisualId;
+ }
+
+ buf[p++] = GLX_VISUAL_ID;
+ buf[p++] = associatedVisualId;
+
+ /* SGIS_multisample attributes */
+ buf[p++] = GLX_SAMPLES_SGIS;
+ buf[p++] = pFBConfig->multiSampleSize;
+ buf[p++] = GLX_SAMPLE_BUFFERS_SGIS;
+ buf[p++] = pFBConfig->nMultiSampleBuffers;
+
+ /* SGIX_pbuffer specific attributes */
+ buf[p++] = GLX_OPTIMAL_PBUFFER_WIDTH_SGIX;
+ buf[p++] = pFBConfig->optimalPbufferWidth;
+ buf[p++] = GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX;
+ buf[p++] = pFBConfig->optimalPbufferHeight;
+
+ buf[p++] = GLX_VISUAL_SELECT_GROUP_SGIX;
+ buf[p++] = pFBConfig->visualSelectGroup;
+
+ if (client->swapped) {
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ __GLX_SWAP_INT_ARRAY((int *) buf, 2 * numAttribs);
+ }
+ WriteToClient(client, 2 * numAttribs * __GLX_SIZE_CARD32, (char *) buf);
}
return Success;
}
-int __glXGetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc)
+int
+__glXGetFBConfigsSGIX(__GLXclientState * cl, GLbyte * pc)
{
- xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *)pc;
- xGLXGetFBConfigsReq new_req;
+ xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) pc;
+ xGLXGetFBConfigsReq new_req;
- new_req.reqType = req->reqType;
- new_req.glxCode = req->glxCode;
- new_req.length = req->length;
- new_req.screen = req->screen;
+ new_req.reqType = req->reqType;
+ new_req.glxCode = req->glxCode;
+ new_req.length = req->length;
+ new_req.screen = req->screen;
- return( __glXGetFBConfigs( cl, (GLbyte *)&new_req ) );
+ return (__glXGetFBConfigs(cl, (GLbyte *) & new_req));
}
-
-int __glXCreateWindow(__GLXclientState *cl, GLbyte *pc)
+int
+__glXCreateWindow(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXCreateWindowReq *req = (xGLXCreateWindowReq *) pc;
@@ -2942,86 +3059,87 @@ int __glXCreateWindow(__GLXclientState *cl, GLbyte *pc)
pointer val;
/*
- ** Check if windowId is valid
- */
+ ** Check if windowId is valid
+ */
rc = dixLookupDrawable(&pDraw, windowId, client, M_DRAWABLE_WINDOW,
- DixAddAccess);
+ DixAddAccess);
if (rc != Success)
- return rc;
+ return rc;
/*
- ** Check if screen of window matches screen of fbconfig.
- */
+ ** Check if screen of window matches screen of fbconfig.
+ */
pScreen = pDraw->pScreen;
if (screen != pScreen->myNum) {
- return BadMatch;
+ return BadMatch;
}
/*
- ** Find the FBConfigRec for this fbconfigid.
- */
+ ** Find the FBConfigRec for this fbconfigid.
+ */
if (!(pGlxFBConfig = glxLookupFBConfig(fbconfigId))) {
- client->errorValue = fbconfigId;
- return __glXBadFBConfig;
+ client->errorValue = fbconfigId;
+ return __glXBadFBConfig;
}
visId = pGlxFBConfig->associatedVisualId;
/*
- ** Check if the fbconfig supports rendering to windows
- */
- if( !(pGlxFBConfig->drawableType & GLX_WINDOW_BIT) ) {
- return BadMatch;
+ ** Check if the fbconfig supports rendering to windows
+ */
+ if (!(pGlxFBConfig->drawableType & GLX_WINDOW_BIT)) {
+ return BadMatch;
}
if (visId != None) {
- /*
- ** Check if the visual ID is valid for this screen.
- */
- pVisual = pScreen->visuals;
- for (i = 0; i < pScreen->numVisuals; i++, pVisual++) {
- if (pVisual->vid == visId) {
- break;
- }
- }
- if (i == pScreen->numVisuals) {
- client->errorValue = visId;
- return BadValue;
- }
-
/*
- ** Check if color buffer depth of fbconfig matches depth
- ** of window.
- */
+ ** Check if the visual ID is valid for this screen.
+ */
+ pVisual = pScreen->visuals;
+ for (i = 0; i < pScreen->numVisuals; i++, pVisual++) {
+ if (pVisual->vid == visId) {
+ break;
+ }
+ }
+ if (i == pScreen->numVisuals) {
+ client->errorValue = visId;
+ return BadValue;
+ }
+
+ /*
+ ** Check if color buffer depth of fbconfig matches depth
+ ** of window.
+ */
if (pVisual->nplanes != pDraw->depth) {
- return BadMatch;
- }
- } else
- /*
- ** The window was created with no visual that corresponds
- ** to fbconfig
- */
- return BadMatch;
+ return BadMatch;
+ }
+ }
+ else
+ /*
+ ** The window was created with no visual that corresponds
+ ** to fbconfig
+ */
+ return BadMatch;
/*
- ** Check if there is already a fbconfig associated with this window
- */
+ ** Check if there is already a fbconfig associated with this window
+ */
if (Success == dixLookupResourceByType(&val,
- glxwindowId, __glXWindowRes,
- NullClient, DixUnknownAccess)) {
- client->errorValue = glxwindowId;
- return BadAlloc;
+ glxwindowId, __glXWindowRes,
+ NullClient, DixUnknownAccess)) {
+ client->errorValue = glxwindowId;
+ return BadAlloc;
}
pGlxWindow = (__glXWindow *) malloc(sizeof(__glXWindow));
if (!pGlxWindow) {
- return BadAlloc;
+ return BadAlloc;
}
/*
- ** Register this GLX window as a resource
- */
+ ** Register this GLX window as a resource
+ */
if (!(AddResource(glxwindowId, __glXWindowRes, pGlxWindow))) {
- return BadAlloc;
+ return BadAlloc;
}
pGlxWindow->pDraw = pDraw;
@@ -3034,7 +3152,8 @@ int __glXCreateWindow(__GLXclientState *cl, GLbyte *pc)
return Success;
}
-int __glXDestroyWindow(__GLXclientState *cl, GLbyte *pc)
+int
+__glXDestroyWindow(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXDestroyWindowReq *req = (xGLXDestroyWindowReq *) pc;
@@ -3042,24 +3161,25 @@ int __glXDestroyWindow(__GLXclientState *cl, GLbyte *pc)
pointer val;
/*
- ** Check if it's a valid GLX window.
- */
+ ** Check if it's a valid GLX window.
+ */
if (Success != dixLookupResourceByType(&val,
- glxwindow, __glXWindowRes,
- NullClient, DixUnknownAccess)) {
- client->errorValue = glxwindow;
- return __glXBadDrawable;
+ glxwindow, __glXWindowRes,
+ NullClient, DixUnknownAccess)) {
+ client->errorValue = glxwindow;
+ return __glXBadDrawable;
}
/*
- ** The glx window destructor will check whether it's current before
- ** freeing anything.
- */
- FreeResource(glxwindow, RT_NONE);
+ ** The glx window destructor will check whether it's current before
+ ** freeing anything.
+ */
+ FreeResource(glxwindow, RT_NONE);
return Success;
}
-int __glXQueryContext(__GLXclientState *cl, GLbyte *pc)
+int
+__glXQueryContext(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
__GLXcontext *ctx;
@@ -3069,8 +3189,8 @@ int __glXQueryContext(__GLXclientState *cl, GLbyte *pc)
int *sendBuf, *pSendBuf;
int nReplyBytes;
- req = (xGLXQueryContextReq *)pc;
- dixLookupResourceByType((pointer*) &ctx, req->context, __glXContextRes,
+ req = (xGLXQueryContextReq *) pc;
+ dixLookupResourceByType((pointer *) &ctx, req->context, __glXContextRes,
NullClient, DixUnknownAccess);
if (!ctx) {
client->errorValue = req->context;
@@ -3085,27 +3205,29 @@ int __glXQueryContext(__GLXclientState *cl, GLbyte *pc)
reply.n = nProps;
nReplyBytes = reply.length << 2;
- sendBuf = (int *)malloc(nReplyBytes);
+ sendBuf = (int *) malloc(nReplyBytes);
pSendBuf = sendBuf;
*pSendBuf++ = GLX_FBCONFIG_ID;
- *pSendBuf++ = (int)(ctx->pFBConfig->id);
+ *pSendBuf++ = (int) (ctx->pFBConfig->id);
*pSendBuf++ = GLX_RENDER_TYPE;
- *pSendBuf++ = (int)(ctx->pFBConfig->renderType);
+ *pSendBuf++ = (int) (ctx->pFBConfig->renderType);
*pSendBuf++ = GLX_SCREEN;
- *pSendBuf++ = (int)(ctx->pScreen->myNum);
+ *pSendBuf++ = (int) (ctx->pScreen->myNum);
if (client->swapped) {
__glXSwapQueryContextReply(client, &reply, sendBuf);
- } else {
- WriteToClient(client, sz_xGLXQueryContextReply, (char *)&reply);
- WriteToClient(client, nReplyBytes, (char *)sendBuf);
}
- free((char *)sendBuf);
+ else {
+ WriteToClient(client, sz_xGLXQueryContextReply, (char *) &reply);
+ WriteToClient(client, nReplyBytes, (char *) sendBuf);
+ }
+ free((char *) sendBuf);
return Success;
}
-int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
+int
+__glXQueryContextInfoEXT(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
__GLXcontext *ctx;
@@ -3115,10 +3237,10 @@ int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
int *sendBuf, *pSendBuf;
int nReplyBytes;
- req = (xGLXQueryContextInfoEXTReq *)pc;
- dixLookupResourceByType((pointer*) &ctx,
- req->context, __glXContextRes,
- client, DixReadAccess);
+ req = (xGLXQueryContextInfoEXTReq *) pc;
+ dixLookupResourceByType((pointer *) &ctx,
+ req->context, __glXContextRes,
+ client, DixReadAccess);
if (!ctx) {
client->errorValue = req->context;
@@ -3133,32 +3255,34 @@ int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
reply.n = nProps;
nReplyBytes = reply.length << 2;
- sendBuf = (int *)malloc(nReplyBytes);
+ sendBuf = (int *) malloc(nReplyBytes);
pSendBuf = sendBuf;
*pSendBuf++ = GLX_SHARE_CONTEXT_EXT;
- *pSendBuf++ = (int)(ctx->share_id);
+ *pSendBuf++ = (int) (ctx->share_id);
*pSendBuf++ = GLX_VISUAL_ID_EXT;
- *pSendBuf++ = (int)(ctx->pVisual ? ctx->pVisual->vid : 0);
+ *pSendBuf++ = (int) (ctx->pVisual ? ctx->pVisual->vid : 0);
*pSendBuf++ = GLX_SCREEN_EXT;
- *pSendBuf++ = (int)(ctx->pScreen->myNum);
+ *pSendBuf++ = (int) (ctx->pScreen->myNum);
*pSendBuf++ = GLX_FBCONFIG_ID;
- *pSendBuf++ = (int)(ctx->pFBConfig ? ctx->pFBConfig->id : 0);
+ *pSendBuf++ = (int) (ctx->pFBConfig ? ctx->pFBConfig->id : 0);
if (client->swapped) {
__glXSwapQueryContextInfoEXTReply(client, &reply, sendBuf);
- } else {
- WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *)&reply);
- WriteToClient(client, nReplyBytes, (char *)sendBuf);
}
- free((char *)sendBuf);
+ else {
+ WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *) &reply);
+ WriteToClient(client, nReplyBytes, (char *) sendBuf);
+ }
+ free((char *) sendBuf);
return Success;
}
-int __glXCreatePbuffer(__GLXclientState *cl, GLbyte *pc)
+int
+__glXCreatePbuffer(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
- xGLXCreatePbufferReq *req = (xGLXCreatePbufferReq *)pc;
+ xGLXCreatePbufferReq *req = (xGLXCreatePbufferReq *) pc;
xGLXCreatePbufferReq *be_req;
int screen = req->screen;
GLXFBConfigID fbconfigId = req->fbconfig;
@@ -3175,9 +3299,9 @@ int __glXCreatePbuffer(__GLXclientState *cl, GLbyte *pc)
int s;
int from_screen, to_screen;
- /*
- ** Look up screen and FBConfig.
- */
+ /*
+ ** Look up screen and FBConfig.
+ */
if (screen >= screenInfo.numScreens) {
/* The client library must send a valid screen number. */
client->errorValue = screen;
@@ -3186,22 +3310,22 @@ int __glXCreatePbuffer(__GLXclientState *cl, GLbyte *pc)
pScreen = screenInfo.screens[screen];
/*
- ** Find the FBConfigRec for this fbconfigid.
- */
+ ** Find the FBConfigRec for this fbconfigid.
+ */
if (!(pGlxFBConfig = glxLookupFBConfig(fbconfigId))) {
- client->errorValue = fbconfigId;
- return __glXBadFBConfig;
+ client->errorValue = fbconfigId;
+ return __glXBadFBConfig;
}
/*
- ** Create the GLX part of the Pbuffer.
- */
+ ** Create the GLX part of the Pbuffer.
+ */
pGlxPbuffer = (__glXPbuffer *) malloc(sizeof(__glXPbuffer));
if (!pGlxPbuffer) {
return BadAlloc;
}
- pGlxPbuffer->be_xids = (XID *) malloc( sizeof(XID) * screenInfo.numScreens );
+ pGlxPbuffer->be_xids = (XID *) malloc(sizeof(XID) * screenInfo.numScreens);
if (!pGlxPbuffer->be_xids) {
free(pGlxPbuffer);
return BadAlloc;
@@ -3213,53 +3337,53 @@ int __glXCreatePbuffer(__GLXclientState *cl, GLbyte *pc)
from_screen = to_screen = screen;
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
- from_screen = 0;
- to_screen = screenInfo.numScreens - 1;
+ from_screen = 0;
+ to_screen = screenInfo.numScreens - 1;
}
#endif
- for (s=from_screen; s<=to_screen; s++) {
- dpy = GetBackEndDisplay(cl,s);
- be_xid = XAllocID(dpy);
- dmxScreen = &dmxScreens[s];
- be_pGlxFBConfig = glxLookupBackEndFBConfig( pGlxFBConfig->id, s );
-
- attr = (int *)( req+1 );
-
- LockDisplay(dpy);
- GetReqExtra(GLXCreatePbuffer, 2 * numAttribs * __GLX_SIZE_CARD32, be_req);
- be_req->reqType = dmxScreen->glxMajorOpcode;
- be_req->glxCode = X_GLXCreatePbuffer;
- be_req->screen = be_pGlxFBConfig->screen;
- be_req->fbconfig = be_pGlxFBConfig->id;
- be_req->pbuffer = be_xid;
- be_req->numAttribs = numAttribs;
-
- /* Send attributes */
- if ( attr != NULL ) {
- CARD32 *pc = (CARD32 *)(be_req + 1);
-
- while (numAttribs-- > 0) {
- *pc++ = *attr++; /* token */
- *pc++ = *attr++; /* value */
- }
- }
+ for (s = from_screen; s <= to_screen; s++) {
+ dpy = GetBackEndDisplay(cl, s);
+ be_xid = XAllocID(dpy);
+ dmxScreen = &dmxScreens[s];
+ be_pGlxFBConfig = glxLookupBackEndFBConfig(pGlxFBConfig->id, s);
+
+ attr = (int *) (req + 1);
+
+ LockDisplay(dpy);
+ GetReqExtra(GLXCreatePbuffer, 2 * numAttribs * __GLX_SIZE_CARD32,
+ be_req);
+ be_req->reqType = dmxScreen->glxMajorOpcode;
+ be_req->glxCode = X_GLXCreatePbuffer;
+ be_req->screen = be_pGlxFBConfig->screen;
+ be_req->fbconfig = be_pGlxFBConfig->id;
+ be_req->pbuffer = be_xid;
+ be_req->numAttribs = numAttribs;
+
+ /* Send attributes */
+ if (attr != NULL) {
+ CARD32 *pc = (CARD32 *) (be_req + 1);
+
+ while (numAttribs-- > 0) {
+ *pc++ = *attr++; /* token */
+ *pc++ = *attr++; /* value */
+ }
+ }
- UnlockDisplay(dpy);
- SyncHandle();
+ UnlockDisplay(dpy);
+ SyncHandle();
- pGlxPbuffer->be_xids[s] = be_xid;
+ pGlxPbuffer->be_xids[s] = be_xid;
}
-
pGlxPbuffer->idExists = True;
pGlxPbuffer->refcnt = 0;
pGlxPbuffer->pFBConfig = pGlxFBConfig;
pGlxPbuffer->pScreen = pScreen;
/*
- ** Register the resource.
- */
+ ** Register the resource.
+ */
if (!(AddResource(pbuffer, __glXPbufferRes, pGlxPbuffer))) {
return BadAlloc;
}
@@ -3268,7 +3392,8 @@ int __glXCreatePbuffer(__GLXclientState *cl, GLbyte *pc)
}
-int __glXDestroyPbuffer(__GLXclientState *cl, GLbyte *pc)
+int
+__glXDestroyPbuffer(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc;
@@ -3282,13 +3407,13 @@ int __glXDestroyPbuffer(__GLXclientState *cl, GLbyte *pc)
int from_screen, to_screen;
/*
- ** Check if it's a valid Pbuffer
- */
- dixLookupResourceByType((pointer*) &pGlxPbuffer, pbuffer,
+ ** Check if it's a valid Pbuffer
+ */
+ dixLookupResourceByType((pointer *) &pGlxPbuffer, pbuffer,
__glXPbufferRes, NullClient, DixUnknownAccess);
if (!pGlxPbuffer) {
- client->errorValue = pbuffer;
- return __glXBadPbuffer;
+ client->errorValue = pbuffer;
+ return __glXBadPbuffer;
}
screen = pGlxPbuffer->pScreen->myNum;
@@ -3296,327 +3421,342 @@ int __glXDestroyPbuffer(__GLXclientState *cl, GLbyte *pc)
from_screen = to_screen = screen;
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
- from_screen = 0;
- to_screen = screenInfo.numScreens - 1;
+ from_screen = 0;
+ to_screen = screenInfo.numScreens - 1;
}
#endif
- for (s=from_screen; s<=to_screen; s++) {
- dpy = GetBackEndDisplay(cl,s);
- dmxScreen = &dmxScreens[s];
+ for (s = from_screen; s <= to_screen; s++) {
+ dpy = GetBackEndDisplay(cl, s);
+ dmxScreen = &dmxScreens[s];
- /* send the destroy request to the back-end server */
- LockDisplay(dpy);
- GetReq(GLXDestroyPbuffer, be_req);
- be_req->reqType = dmxScreen->glxMajorOpcode;
- be_req->glxCode = X_GLXDestroyPbuffer;
- be_req->pbuffer = pGlxPbuffer->be_xids[s];
- UnlockDisplay(dpy);
- SyncHandle();
+ /* send the destroy request to the back-end server */
+ LockDisplay(dpy);
+ GetReq(GLXDestroyPbuffer, be_req);
+ be_req->reqType = dmxScreen->glxMajorOpcode;
+ be_req->glxCode = X_GLXDestroyPbuffer;
+ be_req->pbuffer = pGlxPbuffer->be_xids[s];
+ UnlockDisplay(dpy);
+ SyncHandle();
}
- FreeResource(pbuffer, RT_NONE);
+ FreeResource(pbuffer, RT_NONE);
return Success;
}
-int __glXGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
+int
+__glXGetDrawableAttributes(__GLXclientState * cl, GLbyte * pc)
{
- xGLXGetDrawableAttributesReq *req = (xGLXGetDrawableAttributesReq *)pc;
- xGLXGetDrawableAttributesReq *be_req;
- xGLXGetDrawableAttributesReply reply;
- ClientPtr client = cl->client;
- GLXDrawable drawId = req->drawable;
- GLXDrawable be_drawable = 0;
- DrawablePtr pDraw = NULL;
- Display *dpy;
- int screen, rc;
- DMXScreenInfo *dmxScreen;
- CARD32 *attribs = NULL;
- int attribs_size = 0;
+ xGLXGetDrawableAttributesReq *req = (xGLXGetDrawableAttributesReq *) pc;
+ xGLXGetDrawableAttributesReq *be_req;
+ xGLXGetDrawableAttributesReply reply;
+ ClientPtr client = cl->client;
+ GLXDrawable drawId = req->drawable;
+ GLXDrawable be_drawable = 0;
+ DrawablePtr pDraw = NULL;
+ Display *dpy;
+ int screen, rc;
+ DMXScreenInfo *dmxScreen;
+ CARD32 *attribs = NULL;
+ int attribs_size = 0;
+
#ifdef PANORAMIX
PanoramiXRes *pXinDraw = NULL;
#endif
- if (drawId != None) {
- rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixGetAttrAccess);
- if (rc == Success && pDraw->type == DRAWABLE_WINDOW) {
- WindowPtr pWin = (WindowPtr)pDraw;
- be_drawable = 0;
- screen = pWin->drawable.pScreen->myNum;
- } else {
- /*
- ** Drawable is not a Window , GLXWindow or a GLXPixmap.
- */
- client->errorValue = drawId;
- return __glXBadDrawable;
- }
-
- if (!pDraw) {
- __GLXpixmap *pGlxPixmap;
- dixLookupResourceByType((pointer*) &pGlxPixmap,
- drawId, __glXPixmapRes,
- NullClient, DixUnknownAccess);
- if (pGlxPixmap) {
- pDraw = pGlxPixmap->pDraw;
- screen = pGlxPixmap->pScreen->myNum;
+ if (drawId != None) {
+ rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixGetAttrAccess);
+ if (rc == Success && pDraw->type == DRAWABLE_WINDOW) {
+ WindowPtr pWin = (WindowPtr) pDraw;
+
+ be_drawable = 0;
+ screen = pWin->drawable.pScreen->myNum;
+ }
+ else {
+ /*
+ ** Drawable is not a Window , GLXWindow or a GLXPixmap.
+ */
+ client->errorValue = drawId;
+ return __glXBadDrawable;
+ }
+
+ if (!pDraw) {
+ __GLXpixmap *pGlxPixmap;
+
+ dixLookupResourceByType((pointer *) &pGlxPixmap,
+ drawId, __glXPixmapRes,
+ NullClient, DixUnknownAccess);
+ if (pGlxPixmap) {
+ pDraw = pGlxPixmap->pDraw;
+ screen = pGlxPixmap->pScreen->myNum;
be_drawable = pGlxPixmap->be_xids[screen];
- }
- }
-
- if (!pDraw) {
- __glXWindow *pGlxWindow;
- dixLookupResourceByType((pointer*) &pGlxWindow,
- drawId, __glXWindowRes,
- NullClient, DixUnknownAccess);
- if (pGlxWindow) {
- pDraw = pGlxWindow->pDraw;
- screen = pGlxWindow->pScreen->myNum;
- be_drawable = 0;
- }
- }
-
- if (!pDraw) {
- __glXPbuffer *pGlxPbuffer;
- dixLookupResourceByType((pointer*) &pGlxPbuffer,
- drawId, __glXPbufferRes,
- NullClient, DixUnknownAccess);
- if (pGlxPbuffer) {
- pDraw = (DrawablePtr)pGlxPbuffer;
- screen = pGlxPbuffer->pScreen->myNum;
- be_drawable = pGlxPbuffer->be_xids[screen];
- }
- }
+ }
+ }
+
+ if (!pDraw) {
+ __glXWindow *pGlxWindow;
+
+ dixLookupResourceByType((pointer *) &pGlxWindow,
+ drawId, __glXWindowRes,
+ NullClient, DixUnknownAccess);
+ if (pGlxWindow) {
+ pDraw = pGlxWindow->pDraw;
+ screen = pGlxWindow->pScreen->myNum;
+ be_drawable = 0;
+ }
+ }
+
+ if (!pDraw) {
+ __glXPbuffer *pGlxPbuffer;
+
+ dixLookupResourceByType((pointer *) &pGlxPbuffer,
+ drawId, __glXPbufferRes,
+ NullClient, DixUnknownAccess);
+ if (pGlxPbuffer) {
+ pDraw = (DrawablePtr) pGlxPbuffer;
+ screen = pGlxPbuffer->pScreen->myNum;
+ be_drawable = pGlxPbuffer->be_xids[screen];
+ }
+ }
}
if (!pDraw) {
- /*
- ** Drawable is not a Window , GLXWindow or a GLXPixmap.
- */
- client->errorValue = drawId;
- return __glXBadDrawable;
- }
-
- /* if the drawable is a window or GLXWindow -
- * we need to find the base id on the back-end server
- */
- if (!be_drawable) {
- WindowPtr pWin = (WindowPtr)pDraw;
+ /*
+ ** Drawable is not a Window , GLXWindow or a GLXPixmap.
+ */
+ client->errorValue = drawId;
+ return __glXBadDrawable;
+ }
+
+ /* if the drawable is a window or GLXWindow -
+ * we need to find the base id on the back-end server
+ */
+ if (!be_drawable) {
+ WindowPtr pWin = (WindowPtr) pDraw;
#ifdef PANORAMIX
- if (!noPanoramiXExtension) {
- if (Success != dixLookupResourceByClass((pointer*) &pXinDraw,
- pDraw->id, XRC_DRAWABLE,
- client, DixReadAccess)) {
- client->errorValue = drawId;
- return __glXBadDrawable;
- }
-
- dixLookupWindow(&pWin, pXinDraw->info[screen].id, client,
- DixReadAccess);
- }
+ if (!noPanoramiXExtension) {
+ if (Success != dixLookupResourceByClass((pointer *) &pXinDraw,
+ pDraw->id, XRC_DRAWABLE,
+ client, DixReadAccess)) {
+ client->errorValue = drawId;
+ return __glXBadDrawable;
+ }
+
+ dixLookupWindow(&pWin, pXinDraw->info[screen].id, client,
+ DixReadAccess);
+ }
#endif
- if (pWin) {
- be_drawable = (unsigned int)(DMX_GET_WINDOW_PRIV(pWin))->window;
- if (!be_drawable) {
- /* it might be that the window did not created yet on the */
- /* back-end server (lazy window creation option), force */
- /* creation of the window */
- dmxCreateAndRealizeWindow( pWin, TRUE );
- be_drawable = (unsigned int)(DMX_GET_WINDOW_PRIV(pWin))->window;
- }
- }
- else {
- client->errorValue = drawId;
- return __glXBadDrawable;
- }
- }
-
-
- /* send the request to the back-end server */
- dpy = GetBackEndDisplay(cl,screen);
- dmxScreen = &dmxScreens[screen];
-
- /* make sure drawable exists on back-end */
- dmxSync( dmxScreen, 1 );
-
- LockDisplay(dpy);
- GetReq(GLXGetDrawableAttributes, be_req);
- be_req->reqType = dmxScreen->glxMajorOpcode;
- be_req->glxCode = X_GLXGetDrawableAttributes;
- be_req->drawable = be_drawable;
- be_req->length = req->length;
- if (!_XReply(dpy, (xReply *) &reply, 0, False)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return( BE_TO_CLIENT_ERROR(dmxLastErrorEvent.error_code) );
- }
-
- if (reply.numAttribs) {
- attribs_size = 2 * reply.numAttribs * __GLX_SIZE_CARD32;
- attribs = (CARD32 *) malloc(attribs_size);
- if (attribs == NULL) {
- UnlockDisplay(dpy);
- SyncHandle();
- return BadAlloc;
- }
-
- _XRead(dpy, (char *) attribs, attribs_size);
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
-
-
- /* send the reply back to the client */
- reply.sequenceNumber = client->sequence;
- if (client->swapped) {
- __glXSwapGetDrawableAttributesReply(client, &reply, (int *)attribs);
- }
- else {
- WriteToClient(client, sz_xGLXGetDrawableAttributesReply, (char *)&reply);
- WriteToClient(client, attribs_size, (char *)attribs);
- }
-
- free(attribs);
-
- return Success;
+ if (pWin) {
+ be_drawable = (unsigned int) (DMX_GET_WINDOW_PRIV(pWin))->window;
+ if (!be_drawable) {
+ /* it might be that the window did not created yet on the */
+ /* back-end server (lazy window creation option), force */
+ /* creation of the window */
+ dmxCreateAndRealizeWindow(pWin, TRUE);
+ be_drawable =
+ (unsigned int) (DMX_GET_WINDOW_PRIV(pWin))->window;
+ }
+ }
+ else {
+ client->errorValue = drawId;
+ return __glXBadDrawable;
+ }
+ }
+
+ /* send the request to the back-end server */
+ dpy = GetBackEndDisplay(cl, screen);
+ dmxScreen = &dmxScreens[screen];
+
+ /* make sure drawable exists on back-end */
+ dmxSync(dmxScreen, 1);
+
+ LockDisplay(dpy);
+ GetReq(GLXGetDrawableAttributes, be_req);
+ be_req->reqType = dmxScreen->glxMajorOpcode;
+ be_req->glxCode = X_GLXGetDrawableAttributes;
+ be_req->drawable = be_drawable;
+ be_req->length = req->length;
+ if (!_XReply(dpy, (xReply *) & reply, 0, False)) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return (BE_TO_CLIENT_ERROR(dmxLastErrorEvent.error_code));
+ }
+
+ if (reply.numAttribs) {
+ attribs_size = 2 * reply.numAttribs * __GLX_SIZE_CARD32;
+ attribs = (CARD32 *) malloc(attribs_size);
+ if (attribs == NULL) {
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return BadAlloc;
+ }
+
+ _XRead(dpy, (char *) attribs, attribs_size);
+ }
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+
+ /* send the reply back to the client */
+ reply.sequenceNumber = client->sequence;
+ if (client->swapped) {
+ __glXSwapGetDrawableAttributesReply(client, &reply, (int *) attribs);
+ }
+ else {
+ WriteToClient(client, sz_xGLXGetDrawableAttributesReply,
+ (char *) &reply);
+ WriteToClient(client, attribs_size, (char *) attribs);
+ }
+
+ free(attribs);
+
+ return Success;
}
-int __glXChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
+int
+__glXChangeDrawableAttributes(__GLXclientState * cl, GLbyte * pc)
{
- xGLXChangeDrawableAttributesReq *req = (xGLXChangeDrawableAttributesReq *)pc;
- xGLXChangeDrawableAttributesReq *be_req;
- ClientPtr client = cl->client;
- GLXDrawable drawId = req->drawable;
- GLXDrawable be_drawable = 0;
- DrawablePtr pDraw = NULL;
- Display *dpy;
- int screen, rc;
- DMXScreenInfo *dmxScreen;
-
- if (drawId != None) {
- rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixSetAttrAccess);
- if (rc == Success && pDraw->type == DRAWABLE_WINDOW) {
- be_drawable = 0;
- screen = pDraw->pScreen->myNum;
- } else {
- /*
- ** Drawable is not a Window , GLXWindow or a GLXPixmap.
- */
- client->errorValue = drawId;
- return __glXBadDrawable;
- }
-
- if (!pDraw) {
- __GLXpixmap *pGlxPixmap;
- dixLookupResourceByType((pointer*) &pGlxPixmap,
- drawId, __glXPixmapRes,
- NullClient, DixUnknownAccess);
- if (pGlxPixmap) {
- pDraw = pGlxPixmap->pDraw;
- screen = pGlxPixmap->pScreen->myNum;
+ xGLXChangeDrawableAttributesReq *req =
+ (xGLXChangeDrawableAttributesReq *) pc;
+ xGLXChangeDrawableAttributesReq *be_req;
+ ClientPtr client = cl->client;
+ GLXDrawable drawId = req->drawable;
+ GLXDrawable be_drawable = 0;
+ DrawablePtr pDraw = NULL;
+ Display *dpy;
+ int screen, rc;
+ DMXScreenInfo *dmxScreen;
+
+ if (drawId != None) {
+ rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixSetAttrAccess);
+ if (rc == Success && pDraw->type == DRAWABLE_WINDOW) {
+ be_drawable = 0;
+ screen = pDraw->pScreen->myNum;
+ }
+ else {
+ /*
+ ** Drawable is not a Window , GLXWindow or a GLXPixmap.
+ */
+ client->errorValue = drawId;
+ return __glXBadDrawable;
+ }
+
+ if (!pDraw) {
+ __GLXpixmap *pGlxPixmap;
+
+ dixLookupResourceByType((pointer *) &pGlxPixmap,
+ drawId, __glXPixmapRes,
+ NullClient, DixUnknownAccess);
+ if (pGlxPixmap) {
+ pDraw = pGlxPixmap->pDraw;
+ screen = pGlxPixmap->pScreen->myNum;
be_drawable = pGlxPixmap->be_xids[screen];
- }
- }
-
- if (!pDraw) {
- __glXWindow *pGlxWindow;
- dixLookupResourceByType((pointer*) &pGlxWindow,
- drawId, __glXWindowRes,
- NullClient, DixUnknownAccess);
- if (pGlxWindow) {
- pDraw = pGlxWindow->pDraw;
- screen = pGlxWindow->pScreen->myNum;
- be_drawable = 0;
- }
- }
-
- if (!pDraw) {
- __glXPbuffer *pGlxPbuffer;
- dixLookupResourceByType((pointer*) &pGlxPbuffer,
- drawId, __glXPbufferRes,
- NullClient, DixUnknownAccess);
- if (pGlxPbuffer) {
- pDraw = (DrawablePtr)pGlxPbuffer;
- screen = pGlxPbuffer->pScreen->myNum;
- be_drawable = pGlxPbuffer->be_xids[screen];
- }
- }
- }
-
- if (!pDraw) {
- /*
- ** Drawable is not a Window , GLXWindow or a GLXPixmap.
- */
- client->errorValue = drawId;
- return __glXBadDrawable;
- }
-
- /* if the drawable is a window or GLXWindow -
- * we need to find the base id on the back-end server
- */
- if (!be_drawable) {
- WindowPtr pWin = (WindowPtr)pDraw;
+ }
+ }
+
+ if (!pDraw) {
+ __glXWindow *pGlxWindow;
+
+ dixLookupResourceByType((pointer *) &pGlxWindow,
+ drawId, __glXWindowRes,
+ NullClient, DixUnknownAccess);
+ if (pGlxWindow) {
+ pDraw = pGlxWindow->pDraw;
+ screen = pGlxWindow->pScreen->myNum;
+ be_drawable = 0;
+ }
+ }
+
+ if (!pDraw) {
+ __glXPbuffer *pGlxPbuffer;
+
+ dixLookupResourceByType((pointer *) &pGlxPbuffer,
+ drawId, __glXPbufferRes,
+ NullClient, DixUnknownAccess);
+ if (pGlxPbuffer) {
+ pDraw = (DrawablePtr) pGlxPbuffer;
+ screen = pGlxPbuffer->pScreen->myNum;
+ be_drawable = pGlxPbuffer->be_xids[screen];
+ }
+ }
+ }
+
+ if (!pDraw) {
+ /*
+ ** Drawable is not a Window , GLXWindow or a GLXPixmap.
+ */
+ client->errorValue = drawId;
+ return __glXBadDrawable;
+ }
+
+ /* if the drawable is a window or GLXWindow -
+ * we need to find the base id on the back-end server
+ */
+ if (!be_drawable) {
+ WindowPtr pWin = (WindowPtr) pDraw;
#ifdef PANORAMIX
- if (!noPanoramiXExtension) {
- PanoramiXRes *pXinDraw;
- if (Success != dixLookupResourceByClass((pointer*) &pXinDraw,
- pDraw->id, XRC_DRAWABLE,
- client, DixReadAccess)) {
- client->errorValue = drawId;
- return __glXBadDrawable;
- }
-
- dixLookupWindow(&pWin, pXinDraw->info[screen].id, client,
- DixReadAccess);
- }
+ if (!noPanoramiXExtension) {
+ PanoramiXRes *pXinDraw;
+
+ if (Success != dixLookupResourceByClass((pointer *) &pXinDraw,
+ pDraw->id, XRC_DRAWABLE,
+ client, DixReadAccess)) {
+ client->errorValue = drawId;
+ return __glXBadDrawable;
+ }
+
+ dixLookupWindow(&pWin, pXinDraw->info[screen].id, client,
+ DixReadAccess);
+ }
#endif
- if (pWin) {
- be_drawable = (unsigned int)(DMX_GET_WINDOW_PRIV(pWin))->window;
- if (!be_drawable) {
- /* it might be that the window did not created yet on the */
- /* back-end server (lazy window creation option), force */
- /* creation of the window */
- dmxCreateAndRealizeWindow( pWin, TRUE );
- be_drawable = (unsigned int)(DMX_GET_WINDOW_PRIV(pWin))->window;
- }
- }
- else {
- client->errorValue = drawId;
- return __glXBadDrawable;
- }
- }
-
-
- /* send the request to the back-end server */
- dpy = GetBackEndDisplay(cl,screen);
- dmxScreen = &dmxScreens[screen];
-
- /* make sure drawable exists on back-end */
- dmxSync( dmxScreen, 1 );
-
- LockDisplay(dpy);
- GetReqExtra(GLXChangeDrawableAttributes,
- 2 * req->numAttribs * __GLX_SIZE_CARD32, be_req);
- be_req->reqType = dmxScreen->glxMajorOpcode;
- be_req->glxCode = X_GLXChangeDrawableAttributes;
- be_req->drawable = be_drawable;
- be_req->numAttribs = req->numAttribs;
- be_req->length = req->length;
-
- UnlockDisplay(dpy);
- SyncHandle();
-
- return Success;
+ if (pWin) {
+ be_drawable = (unsigned int) (DMX_GET_WINDOW_PRIV(pWin))->window;
+ if (!be_drawable) {
+ /* it might be that the window did not created yet on the */
+ /* back-end server (lazy window creation option), force */
+ /* creation of the window */
+ dmxCreateAndRealizeWindow(pWin, TRUE);
+ be_drawable =
+ (unsigned int) (DMX_GET_WINDOW_PRIV(pWin))->window;
+ }
+ }
+ else {
+ client->errorValue = drawId;
+ return __glXBadDrawable;
+ }
+ }
+
+ /* send the request to the back-end server */
+ dpy = GetBackEndDisplay(cl, screen);
+ dmxScreen = &dmxScreens[screen];
+
+ /* make sure drawable exists on back-end */
+ dmxSync(dmxScreen, 1);
+
+ LockDisplay(dpy);
+ GetReqExtra(GLXChangeDrawableAttributes,
+ 2 * req->numAttribs * __GLX_SIZE_CARD32, be_req);
+ be_req->reqType = dmxScreen->glxMajorOpcode;
+ be_req->glxCode = X_GLXChangeDrawableAttributes;
+ be_req->drawable = be_drawable;
+ be_req->numAttribs = req->numAttribs;
+ be_req->length = req->length;
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+
+ return Success;
}
-int __glXSendLargeCommand(__GLXclientState *cl, GLXContextTag contextTag)
+int
+__glXSendLargeCommand(__GLXclientState * cl, GLXContextTag contextTag)
{
- ClientPtr client = cl->client;
+ ClientPtr client = cl->client;
xGLXRenderLargeReq *req;
GLint maxSize, amount;
GLint totalRequests, requestNumber;
@@ -3626,56 +3766,57 @@ int __glXSendLargeCommand(__GLXclientState *cl, GLXContextTag contextTag)
int s;
int from_screen, to_screen;
- maxSize = cl->largeCmdMaxReqDataSize - (GLint)sizeof(xGLXRenderLargeReq);
+ maxSize = cl->largeCmdMaxReqDataSize - (GLint) sizeof(xGLXRenderLargeReq);
dataLen = cl->largeCmdBytesTotal;
totalRequests = (dataLen / maxSize);
- if (dataLen % maxSize) totalRequests++;
+ if (dataLen % maxSize)
+ totalRequests++;
glxc = __glXLookupContextByTag(cl, contextTag);
if (!glxc) {
- client->errorValue = contextTag;
- return __glXBadContext;
+ client->errorValue = contextTag;
+ return __glXBadContext;
}
from_screen = to_screen = glxc->pScreen->myNum;
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
- from_screen = 0;
- to_screen = screenInfo.numScreens - 1;
+ from_screen = 0;
+ to_screen = screenInfo.numScreens - 1;
}
#endif
/*
- ** Send enough requests until the whole array is sent.
- */
+ ** Send enough requests until the whole array is sent.
+ */
requestNumber = 1;
data = cl->largeCmdBuf;
while (dataLen > 0) {
- amount = dataLen;
- if (amount > maxSize) {
- amount = maxSize;
- }
-
- for (s=from_screen; s<=to_screen; s++) {
-
- Display *dpy = GetBackEndDisplay(cl,s);
- DMXScreenInfo *dmxScreen = &dmxScreens[s];
-
- LockDisplay(dpy);
- GetReq(GLXRenderLarge,req);
- req->reqType = dmxScreen->glxMajorOpcode;
- req->glxCode = X_GLXRenderLarge;
- req->contextTag = GetCurrentBackEndTag(cl,contextTag,s);
- req->length += (amount + 3) >> 2;
- req->requestNumber = requestNumber++;
- req->requestTotal = totalRequests;
- req->dataBytes = amount;
- Data(dpy, ((const char*)data), amount);
- dataLen -= amount;
- data = ((GLbyte *) data) + amount;
- UnlockDisplay(dpy);
- SyncHandle();
- }
+ amount = dataLen;
+ if (amount > maxSize) {
+ amount = maxSize;
+ }
+
+ for (s = from_screen; s <= to_screen; s++) {
+
+ Display *dpy = GetBackEndDisplay(cl, s);
+ DMXScreenInfo *dmxScreen = &dmxScreens[s];
+
+ LockDisplay(dpy);
+ GetReq(GLXRenderLarge, req);
+ req->reqType = dmxScreen->glxMajorOpcode;
+ req->glxCode = X_GLXRenderLarge;
+ req->contextTag = GetCurrentBackEndTag(cl, contextTag, s);
+ req->length += (amount + 3) >> 2;
+ req->requestNumber = requestNumber++;
+ req->requestTotal = totalRequests;
+ req->dataBytes = amount;
+ Data(dpy, ((const char *) data), amount);
+ dataLen -= amount;
+ data = ((GLbyte *) data) + amount;
+ UnlockDisplay(dpy);
+ SyncHandle();
+ }
}
return Success;
diff --git a/hw/dmx/glxProxy/glxcmds.h b/hw/dmx/glxProxy/glxcmds.h
index ae866be29..b0745927e 100644
--- a/hw/dmx/glxProxy/glxcmds.h
+++ b/hw/dmx/glxProxy/glxcmds.h
@@ -28,10 +28,10 @@
#ifndef __GLX_cmds_h__
#define __GLX_cmds_h__
-extern int __glXBindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc);
-extern int __glXCreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc);
-extern int __glXJoinSwapGroupSGIX(__GLXclientState *cl, GLbyte *pc);
-extern int __glXMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc);
-extern int __glXQueryMaxSwapBarriersSGIX(__GLXclientState *cl, GLbyte *pc);
+extern int __glXBindSwapBarrierSGIX(__GLXclientState * cl, GLbyte * pc);
+extern int __glXCreateContextWithConfigSGIX(__GLXclientState * cl, GLbyte * pc);
+extern int __glXJoinSwapGroupSGIX(__GLXclientState * cl, GLbyte * pc);
+extern int __glXMakeCurrentReadSGI(__GLXclientState * cl, GLbyte * pc);
+extern int __glXQueryMaxSwapBarriersSGIX(__GLXclientState * cl, GLbyte * pc);
-#endif /* !__GLX_cmds_h__ */
+#endif /* !__GLX_cmds_h__ */
diff --git a/hw/dmx/glxProxy/glxcmdsswap.c b/hw/dmx/glxProxy/glxcmdsswap.c
index f28a79df6..ec0e83d09 100644
--- a/hw/dmx/glxProxy/glxcmdsswap.c
+++ b/hw/dmx/glxProxy/glxcmdsswap.c
@@ -39,9 +39,9 @@
#include "glxext.h"
#include "glxvendor.h"
-extern int glxIsExtensionSupported( char *ext );
+extern int glxIsExtensionSupported(char *ext);
-int __glXSwapGetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc);
+int __glXSwapGetFBConfigsSGIX(__GLXclientState * cl, GLbyte * pc);
/************************************************************************/
@@ -52,9 +52,11 @@ int __glXSwapGetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc);
** it is called at the end of the unswapped routine.
*/
-int __glXSwapCreateContext(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapCreateContext(__GLXclientState * cl, GLbyte * pc)
{
xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
@@ -66,9 +68,11 @@ int __glXSwapCreateContext(__GLXclientState *cl, GLbyte *pc)
return __glXCreateContext(cl, pc);
}
-int __glXSwapCreateNewContext(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapCreateNewContext(__GLXclientState * cl, GLbyte * pc)
{
xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
@@ -80,9 +84,11 @@ int __glXSwapCreateNewContext(__GLXclientState *cl, GLbyte *pc)
return __glXCreateNewContext(cl, pc);
}
-int __glXSwapCreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapCreateContextWithConfigSGIX(__GLXclientState * cl, GLbyte * pc)
{
- xGLXCreateContextWithConfigSGIXReq *req = (xGLXCreateContextWithConfigSGIXReq *) pc;
+ xGLXCreateContextWithConfigSGIXReq *req =
+ (xGLXCreateContextWithConfigSGIXReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
@@ -94,10 +100,11 @@ int __glXSwapCreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
return __glXCreateContextWithConfigSGIX(cl, pc);
}
-int __glXSwapQueryMaxSwapBarriersSGIX(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapQueryMaxSwapBarriersSGIX(__GLXclientState * cl, GLbyte * pc)
{
xGLXQueryMaxSwapBarriersSGIXReq *req =
- (xGLXQueryMaxSwapBarriersSGIXReq *)pc;
+ (xGLXQueryMaxSwapBarriersSGIXReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
@@ -106,9 +113,11 @@ int __glXSwapQueryMaxSwapBarriersSGIX(__GLXclientState *cl, GLbyte *pc)
return __glXQueryMaxSwapBarriersSGIX(cl, pc);
}
-int __glXSwapBindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapBindSwapBarrierSGIX(__GLXclientState * cl, GLbyte * pc)
{
- xGLXBindSwapBarrierSGIXReq *req = (xGLXBindSwapBarrierSGIXReq *)pc;
+ xGLXBindSwapBarrierSGIXReq *req = (xGLXBindSwapBarrierSGIXReq *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
@@ -118,9 +127,11 @@ int __glXSwapBindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc)
return __glXBindSwapBarrierSGIX(cl, pc);
}
-int __glXSwapJoinSwapGroupSGIX(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapJoinSwapGroupSGIX(__GLXclientState * cl, GLbyte * pc)
{
- xGLXJoinSwapGroupSGIXReq *req = (xGLXJoinSwapGroupSGIXReq *)pc;
+ xGLXJoinSwapGroupSGIXReq *req = (xGLXJoinSwapGroupSGIXReq *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
@@ -130,9 +141,11 @@ int __glXSwapJoinSwapGroupSGIX(__GLXclientState *cl, GLbyte *pc)
return __glXJoinSwapGroupSGIX(cl, pc);
}
-int __glXSwapDestroyContext(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapDestroyContext(__GLXclientState * cl, GLbyte * pc)
{
xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
@@ -141,9 +154,11 @@ int __glXSwapDestroyContext(__GLXclientState *cl, GLbyte *pc)
return __glXDestroyContext(cl, pc);
}
-int __glXSwapMakeCurrent(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapMakeCurrent(__GLXclientState * cl, GLbyte * pc)
{
xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
@@ -154,9 +169,11 @@ int __glXSwapMakeCurrent(__GLXclientState *cl, GLbyte *pc)
return __glXMakeCurrent(cl, pc);
}
-int __glXSwapMakeContextCurrent(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapMakeContextCurrent(__GLXclientState * cl, GLbyte * pc)
{
xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
@@ -168,9 +185,11 @@ int __glXSwapMakeContextCurrent(__GLXclientState *cl, GLbyte *pc)
return __glXMakeContextCurrent(cl, pc);
}
-int __glXSwapMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapMakeCurrentReadSGI(__GLXclientState * cl, GLbyte * pc)
{
xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
@@ -182,9 +201,11 @@ int __glXSwapMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc)
return __glXMakeCurrentReadSGI(cl, pc);
}
-int __glXSwapIsDirect(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapIsDirect(__GLXclientState * cl, GLbyte * pc)
{
xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
@@ -193,9 +214,11 @@ int __glXSwapIsDirect(__GLXclientState *cl, GLbyte *pc)
return __glXIsDirect(cl, pc);
}
-int __glXSwapQueryVersion(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapQueryVersion(__GLXclientState * cl, GLbyte * pc)
{
xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
@@ -205,9 +228,11 @@ int __glXSwapQueryVersion(__GLXclientState *cl, GLbyte *pc)
return __glXQueryVersion(cl, pc);
}
-int __glXSwapWaitGL(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapWaitGL(__GLXclientState * cl, GLbyte * pc)
{
xGLXWaitGLReq *req = (xGLXWaitGLReq *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
@@ -216,9 +241,11 @@ int __glXSwapWaitGL(__GLXclientState *cl, GLbyte *pc)
return __glXWaitGL(cl, pc);
}
-int __glXSwapWaitX(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapWaitX(__GLXclientState * cl, GLbyte * pc)
{
xGLXWaitXReq *req = (xGLXWaitXReq *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
@@ -227,9 +254,11 @@ int __glXSwapWaitX(__GLXclientState *cl, GLbyte *pc)
return __glXWaitX(cl, pc);
}
-int __glXSwapCopyContext(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapCopyContext(__GLXclientState * cl, GLbyte * pc)
{
xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
@@ -240,9 +269,10 @@ int __glXSwapCopyContext(__GLXclientState *cl, GLbyte *pc)
return __glXCopyContext(cl, pc);
}
-int __glXSwapGetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapGetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
{
- ClientPtr client = cl->client;
+ ClientPtr client = cl->client;
xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc;
xGLXGetVisualConfigsReply reply;
__GLXscreenInfo *pGlxScreen;
@@ -250,62 +280,63 @@ int __glXSwapGetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
CARD32 buf[__GLX_TOTAL_CONFIG];
unsigned int screen;
int i, p;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_INT(&req->screen);
screen = req->screen;
if (screen >= screenInfo.numScreens) {
- /* The client library must send a valid screen number. */
- client->errorValue = screen;
- return BadValue;
+ /* The client library must send a valid screen number. */
+ client->errorValue = screen;
+ return BadValue;
}
pGlxScreen = &__glXActiveScreens[screen];
reply.numVisuals = pGlxScreen->numGLXVisuals;
reply.numProps = __GLX_TOTAL_CONFIG;
reply.length = (pGlxScreen->numGLXVisuals * __GLX_SIZE_CARD32 *
- __GLX_TOTAL_CONFIG) >> 2;
+ __GLX_TOTAL_CONFIG) >> 2;
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
-
+
__GLX_SWAP_SHORT(&reply.sequenceNumber);
__GLX_SWAP_INT(&reply.length);
__GLX_SWAP_INT(&reply.numVisuals);
__GLX_SWAP_INT(&reply.numProps);
- WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *)&reply);
-
- for (i=0; i < pGlxScreen->numVisuals; i++) {
- pGlxVisual = &pGlxScreen->pGlxVisual[i];
- if (!pGlxScreen->isGLXvis[i] || pGlxVisual->vid == 0) {
- /* not a usable visual */
- continue;
- }
- p = 0;
- buf[p++] = pGlxVisual->vid;
- buf[p++] = pGlxVisual->class;
- buf[p++] = pGlxVisual->rgba;
-
- buf[p++] = pGlxVisual->redSize;
- buf[p++] = pGlxVisual->greenSize;
- buf[p++] = pGlxVisual->blueSize;
- buf[p++] = pGlxVisual->alphaSize;
- buf[p++] = pGlxVisual->accumRedSize;
- buf[p++] = pGlxVisual->accumGreenSize;
- buf[p++] = pGlxVisual->accumBlueSize;
- buf[p++] = pGlxVisual->accumAlphaSize;
-
- buf[p++] = pGlxVisual->doubleBuffer;
- buf[p++] = pGlxVisual->stereo;
-
- buf[p++] = pGlxVisual->bufferSize;
- buf[p++] = pGlxVisual->depthSize;
- buf[p++] = pGlxVisual->stencilSize;
- buf[p++] = pGlxVisual->auxBuffers;
- buf[p++] = pGlxVisual->level;
+ WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *) &reply);
+
+ for (i = 0; i < pGlxScreen->numVisuals; i++) {
+ pGlxVisual = &pGlxScreen->pGlxVisual[i];
+ if (!pGlxScreen->isGLXvis[i] || pGlxVisual->vid == 0) {
+ /* not a usable visual */
+ continue;
+ }
+ p = 0;
+ buf[p++] = pGlxVisual->vid;
+ buf[p++] = pGlxVisual->class;
+ buf[p++] = pGlxVisual->rgba;
+
+ buf[p++] = pGlxVisual->redSize;
+ buf[p++] = pGlxVisual->greenSize;
+ buf[p++] = pGlxVisual->blueSize;
+ buf[p++] = pGlxVisual->alphaSize;
+ buf[p++] = pGlxVisual->accumRedSize;
+ buf[p++] = pGlxVisual->accumGreenSize;
+ buf[p++] = pGlxVisual->accumBlueSize;
+ buf[p++] = pGlxVisual->accumAlphaSize;
+
+ buf[p++] = pGlxVisual->doubleBuffer;
+ buf[p++] = pGlxVisual->stereo;
+
+ buf[p++] = pGlxVisual->bufferSize;
+ buf[p++] = pGlxVisual->depthSize;
+ buf[p++] = pGlxVisual->stencilSize;
+ buf[p++] = pGlxVisual->auxBuffers;
+ buf[p++] = pGlxVisual->level;
/*
- ** Add token/value pairs for extensions.
- */
+ ** Add token/value pairs for extensions.
+ */
buf[p++] = GLX_VISUAL_CAVEAT_EXT;
buf[p++] = pGlxVisual->visualRating;
buf[p++] = GLX_TRANSPARENT_TYPE_EXT;
@@ -321,16 +352,18 @@ int __glXSwapGetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
buf[p++] = GLX_TRANSPARENT_INDEX_VALUE_EXT;
buf[p++] = pGlxVisual->transparentIndex;
- __GLX_SWAP_INT_ARRAY(buf, __GLX_TOTAL_CONFIG);
- WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG,
- (char *)buf);
+ __GLX_SWAP_INT_ARRAY(buf, __GLX_TOTAL_CONFIG);
+ WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG,
+ (char *) buf);
}
return Success;
}
-int __glXSwapCreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapCreateGLXPixmap(__GLXclientState * cl, GLbyte * pc)
{
xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
@@ -342,9 +375,11 @@ int __glXSwapCreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
return __glXCreateGLXPixmap(cl, pc);
}
-int __glXSwapCreatePixmap(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapCreatePixmap(__GLXclientState * cl, GLbyte * pc)
{
xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
@@ -357,9 +392,11 @@ int __glXSwapCreatePixmap(__GLXclientState *cl, GLbyte *pc)
return __glXCreatePixmap(cl, pc);
}
-int __glXSwapDestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapDestroyGLXPixmap(__GLXclientState * cl, GLbyte * pc)
{
xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
@@ -368,9 +405,11 @@ int __glXSwapDestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
return __glXDestroyGLXPixmap(cl, pc);
}
-int __glXSwapSwapBuffers(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapSwapBuffers(__GLXclientState * cl, GLbyte * pc)
{
xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
@@ -380,9 +419,11 @@ int __glXSwapSwapBuffers(__GLXclientState *cl, GLbyte *pc)
return __glXSwapBuffers(cl, pc);
}
-int __glXSwapUseXFont(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapUseXFont(__GLXclientState * cl, GLbyte * pc)
{
xGLXUseXFontReq *req = (xGLXUseXFontReq *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
@@ -395,10 +436,11 @@ int __glXSwapUseXFont(__GLXclientState *cl, GLbyte *pc)
return __glXUseXFont(cl, pc);
}
-
-int __glXSwapQueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapQueryExtensionsString(__GLXclientState * cl, GLbyte * pc)
{
xGLXQueryExtensionsStringReq *req = NULL;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
@@ -407,9 +449,11 @@ int __glXSwapQueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
return __glXQueryExtensionsString(cl, pc);
}
-int __glXSwapQueryServerString(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapQueryServerString(__GLXclientState * cl, GLbyte * pc)
{
- xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *)pc;
+ xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
@@ -419,9 +463,11 @@ int __glXSwapQueryServerString(__GLXclientState *cl, GLbyte *pc)
return __glXQueryServerString(cl, pc);
}
-int __glXSwapClientInfo(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapClientInfo(__GLXclientState * cl, GLbyte * pc)
{
- xGLXClientInfoReq *req = (xGLXClientInfoReq *)pc;
+ xGLXClientInfoReq *req = (xGLXClientInfoReq *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
@@ -432,15 +478,17 @@ int __glXSwapClientInfo(__GLXclientState *cl, GLbyte *pc)
return __glXClientInfo(cl, pc);
}
-int __glXSwapQueryContextInfoEXT(__GLXclientState *cl, char *pc)
+int
+__glXSwapQueryContextInfoEXT(__GLXclientState * cl, char *pc)
{
xGLXQueryContextInfoEXTReq *req = (xGLXQueryContextInfoEXTReq *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context);
- return __glXQueryContextInfoEXT(cl, (GLbyte *)pc);
+ return __glXQueryContextInfoEXT(cl, (GLbyte *) pc);
}
/************************************************************************/
@@ -449,7 +497,8 @@ int __glXSwapQueryContextInfoEXT(__GLXclientState *cl, char *pc)
** Swap replies.
*/
-void __glXSwapMakeCurrentReply(ClientPtr client, xGLXMakeCurrentReadSGIReply *reply)
+void
+__glXSwapMakeCurrentReply(ClientPtr client, xGLXMakeCurrentReadSGIReply * reply)
{
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&reply->sequenceNumber);
@@ -459,103 +508,120 @@ void __glXSwapMakeCurrentReply(ClientPtr client, xGLXMakeCurrentReadSGIReply *r
__GLX_SWAP_INT(&reply->writeType);
__GLX_SWAP_INT(&reply->readVid);
__GLX_SWAP_INT(&reply->readType);
- WriteToClient(client, sz_xGLXMakeCurrentReadSGIReply, (char *)reply);
+ WriteToClient(client, sz_xGLXMakeCurrentReadSGIReply, (char *) reply);
}
-void __glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply *reply)
+void
+__glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply * reply)
{
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
- WriteToClient(client, sz_xGLXIsDirectReply, (char *)reply);
+ WriteToClient(client, sz_xGLXIsDirectReply, (char *) reply);
}
-void __glXSwapQueryVersionReply(ClientPtr client, xGLXQueryVersionReply *reply)
+void
+__glXSwapQueryVersionReply(ClientPtr client, xGLXQueryVersionReply * reply)
{
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
__GLX_SWAP_INT(&reply->majorVersion);
__GLX_SWAP_INT(&reply->minorVersion);
- WriteToClient(client, sz_xGLXQueryVersionReply, (char *)reply);
+ WriteToClient(client, sz_xGLXQueryVersionReply, (char *) reply);
}
-void glxSwapQueryExtensionsStringReply(ClientPtr client,
- xGLXQueryExtensionsStringReply *reply, char *buf)
+void
+glxSwapQueryExtensionsStringReply(ClientPtr client,
+ xGLXQueryExtensionsStringReply * reply,
+ char *buf)
{
int length = reply->length;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
__GLX_SWAP_INT(&reply->n);
- WriteToClient(client, sz_xGLXQueryExtensionsStringReply, (char *)reply);
- __GLX_SWAP_INT_ARRAY((int *)buf, length);
+ WriteToClient(client, sz_xGLXQueryExtensionsStringReply, (char *) reply);
+ __GLX_SWAP_INT_ARRAY((int *) buf, length);
WriteToClient(client, length << 2, buf);
}
-void glxSwapQueryServerStringReply(ClientPtr client,
- xGLXQueryServerStringReply *reply, char *buf)
+void
+glxSwapQueryServerStringReply(ClientPtr client,
+ xGLXQueryServerStringReply * reply, char *buf)
{
int length = reply->length;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
__GLX_SWAP_INT(&reply->n);
- WriteToClient(client, sz_xGLXQueryServerStringReply, (char *)reply);
+ WriteToClient(client, sz_xGLXQueryServerStringReply, (char *) reply);
/** no swap is needed for an array of chars **/
/* __GLX_SWAP_INT_ARRAY((int *)buf, length); */
WriteToClient(client, length << 2, buf);
}
-void __glXSwapQueryContextInfoEXTReply(ClientPtr client, xGLXQueryContextInfoEXTReply *reply, int *buf)
+void
+__glXSwapQueryContextInfoEXTReply(ClientPtr client,
+ xGLXQueryContextInfoEXTReply * reply,
+ int *buf)
{
int length = reply->length;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
__GLX_SWAP_INT(&reply->n);
- WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *)reply);
- __GLX_SWAP_INT_ARRAY((int *)buf, length);
- WriteToClient(client, length << 2, (char *)buf);
+ WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *) reply);
+ __GLX_SWAP_INT_ARRAY((int *) buf, length);
+ WriteToClient(client, length << 2, (char *) buf);
}
-
-void __glXSwapQueryContextReply(ClientPtr client,
- xGLXQueryContextReply *reply, int *buf)
+void
+__glXSwapQueryContextReply(ClientPtr client,
+ xGLXQueryContextReply * reply, int *buf)
{
int length = reply->length;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
__GLX_SWAP_INT(&reply->n);
- WriteToClient(client, sz_xGLXQueryContextReply, (char *)reply);
- __GLX_SWAP_INT_ARRAY((int *)buf, length);
- WriteToClient(client, length << 2, (char *)buf);
+ WriteToClient(client, sz_xGLXQueryContextReply, (char *) reply);
+ __GLX_SWAP_INT_ARRAY((int *) buf, length);
+ WriteToClient(client, length << 2, (char *) buf);
}
-void __glXSwapGetDrawableAttributesReply(ClientPtr client,
- xGLXGetDrawableAttributesReply *reply, int *buf)
+void
+__glXSwapGetDrawableAttributesReply(ClientPtr client,
+ xGLXGetDrawableAttributesReply * reply,
+ int *buf)
{
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
__GLX_SWAP_INT(&reply->numAttribs);
- __GLX_SWAP_INT_ARRAY( buf, reply->length );
- WriteToClient(client, sz_xGLXGetDrawableAttributesReply, (char *)reply);
- WriteToClient(client, reply->length << 2, (char *)buf);
+ __GLX_SWAP_INT_ARRAY(buf, reply->length);
+ WriteToClient(client, sz_xGLXGetDrawableAttributesReply, (char *) reply);
+ WriteToClient(client, reply->length << 2, (char *) buf);
}
-void __glXSwapQueryMaxSwapBarriersSGIXReply(ClientPtr client, xGLXQueryMaxSwapBarriersSGIXReply *reply)
+void
+__glXSwapQueryMaxSwapBarriersSGIXReply(ClientPtr client,
+ xGLXQueryMaxSwapBarriersSGIXReply *
+ reply)
{
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
__GLX_SWAP_INT(&reply->max);
- WriteToClient(client, sz_xGLXQueryMaxSwapBarriersSGIXReply, (char *)reply);
+ WriteToClient(client, sz_xGLXQueryMaxSwapBarriersSGIXReply, (char *) reply);
}
/************************************************************************/
@@ -565,21 +631,23 @@ void __glXSwapQueryMaxSwapBarriersSGIXReply(ClientPtr client, xGLXQueryMaxSwapBa
** client library to send batches of GL rendering commands.
*/
-int __glXSwapRender(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapRender(__GLXclientState * cl, GLbyte * pc)
{
xGLXRenderReq *req;
int left;
__GLXrenderHeader *hdr;
ClientPtr client = cl->client;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
/*
- ** NOTE: much of this code also appears in the nonswapping version of this
- ** routine, __glXRender(). Any changes made here should also be
- ** duplicated there.
- */
-
+ ** NOTE: much of this code also appears in the nonswapping version of this
+ ** routine, __glXRender(). Any changes made here should also be
+ ** duplicated there.
+ */
+
req = (xGLXRenderReq *) pc;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag);
@@ -587,74 +655,81 @@ int __glXSwapRender(__GLXclientState *cl, GLbyte *pc)
pc += sz_xGLXRenderReq;
left = (req->length << 2) - sz_xGLXRenderReq;
while (left > 0) {
- void (* proc)(GLbyte *);
- CARD16 opcode;
-
- /*
- ** Verify that the header length and the overall length agree.
- ** Also, each command must be word aligned.
- */
- hdr = (__GLXrenderHeader *) pc;
- __GLX_SWAP_SHORT(&hdr->length);
- __GLX_SWAP_SHORT(&hdr->opcode);
-
- /*
+ void (*proc) (GLbyte *);
+ CARD16 opcode;
+
+ /*
+ ** Verify that the header length and the overall length agree.
+ ** Also, each command must be word aligned.
+ */
+ hdr = (__GLXrenderHeader *) pc;
+ __GLX_SWAP_SHORT(&hdr->length);
+ __GLX_SWAP_SHORT(&hdr->opcode);
+
+ /*
* call the command procedure to swap any arguments
- */
- opcode = hdr->opcode;
- if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
- (opcode <= __GLX_MAX_RENDER_OPCODE) ) {
- proc = __glXSwapRenderTable[opcode];
+ */
+ opcode = hdr->opcode;
+ if ((opcode >= __GLX_MIN_RENDER_OPCODE) &&
+ (opcode <= __GLX_MAX_RENDER_OPCODE)) {
+ proc = __glXSwapRenderTable[opcode];
#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
- } else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
- (opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
- int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
- __GLXRenderSwapInfo *info = &__glXSwapRenderTable_EXT[index];
- if (info->swapfunc) {
- proc = info->swapfunc;
- }
- else {
- proc = NULL;
- if (info->elem_size == 4 && info->nelems > 0) {
- __GLX_SWAP_INT_ARRAY( (int *)(pc + __GLX_RENDER_HDR_SIZE),
- info->nelems );
- }
- else if (info->elem_size == 2 && info->nelems > 0) {
- __GLX_SWAP_SHORT_ARRAY( (short *)(pc + __GLX_RENDER_HDR_SIZE),
- info->nelems );
- }
- else if (info->elem_size == 8 && info->nelems > 0) {
- __GLX_SWAP_DOUBLE_ARRAY( (double *)(pc + __GLX_RENDER_HDR_SIZE),
- info->nelems );
- }
- }
-#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
- } else {
- client->errorValue = 0;
- return __glXBadRenderRequest;
- }
-
- if (proc != NULL)
- (*proc)(pc + __GLX_RENDER_HDR_SIZE);
-
- /*
- * proceed to the next command
- */
- pc += hdr->length;
- left -= hdr->length;
+ }
+ else if ((opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
+ (opcode <= __GLX_MAX_RENDER_OPCODE_EXT)) {
+ int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
+ __GLXRenderSwapInfo *info = &__glXSwapRenderTable_EXT[index];
+
+ if (info->swapfunc) {
+ proc = info->swapfunc;
+ }
+ else {
+ proc = NULL;
+ if (info->elem_size == 4 && info->nelems > 0) {
+ __GLX_SWAP_INT_ARRAY((int *) (pc + __GLX_RENDER_HDR_SIZE),
+ info->nelems);
+ }
+ else if (info->elem_size == 2 && info->nelems > 0) {
+ __GLX_SWAP_SHORT_ARRAY((short *) (pc +
+ __GLX_RENDER_HDR_SIZE),
+ info->nelems);
+ }
+ else if (info->elem_size == 8 && info->nelems > 0) {
+ __GLX_SWAP_DOUBLE_ARRAY((double *) (pc +
+ __GLX_RENDER_HDR_SIZE),
+ info->nelems);
+ }
+ }
+#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
+ }
+ else {
+ client->errorValue = 0;
+ return __glXBadRenderRequest;
+ }
+
+ if (proc != NULL)
+ (*proc) (pc + __GLX_RENDER_HDR_SIZE);
+
+ /*
+ * proceed to the next command
+ */
+ pc += hdr->length;
+ left -= hdr->length;
}
- return __glXRender( cl, (GLbyte *)req );
+ return __glXRender(cl, (GLbyte *) req);
}
/*
** Execute a large rendering request (one that spans multiple X requests).
*/
-int __glXSwapRenderLarge(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapRenderLarge(__GLXclientState * cl, GLbyte * pc)
{
- ClientPtr client = cl->client;
+ ClientPtr client = cl->client;
xGLXRenderLargeReq *req;
__GLXrenderLargeHeader *hdr;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
@@ -666,134 +741,139 @@ int __glXSwapRenderLarge(__GLXclientState *cl, GLbyte *pc)
__GLX_SWAP_SHORT(&req->requestTotal);
pc += sz_xGLXRenderLargeReq;
-
+
if (req->requestNumber == 1) {
- void (* proc)(GLbyte *) = NULL;
- __GLXRenderSwapInfo *info = NULL;
- CARD16 opcode;
+ void (*proc) (GLbyte *) = NULL;
+ __GLXRenderSwapInfo *info = NULL;
+ CARD16 opcode;
- hdr = (__GLXrenderLargeHeader *) pc;
- __GLX_SWAP_INT(&hdr->length);
- __GLX_SWAP_INT(&hdr->opcode);
+ hdr = (__GLXrenderLargeHeader *) pc;
+ __GLX_SWAP_INT(&hdr->length);
+ __GLX_SWAP_INT(&hdr->opcode);
- /*
+ /*
* call the command procedure to swap any arguments
- * Note that we are assuming that all arguments that needs to be
- * swaped are on the first req only !
- */
- opcode = hdr->opcode;
- if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
- (opcode <= __GLX_MAX_RENDER_OPCODE) ) {
- proc = __glXSwapRenderTable[opcode];
+ * Note that we are assuming that all arguments that needs to be
+ * swaped are on the first req only !
+ */
+ opcode = hdr->opcode;
+ if ((opcode >= __GLX_MIN_RENDER_OPCODE) &&
+ (opcode <= __GLX_MAX_RENDER_OPCODE)) {
+ proc = __glXSwapRenderTable[opcode];
#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
- } else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
- (opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
- int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
- info = &__glXSwapRenderTable_EXT[index];
- if (info->swapfunc) {
- proc = info->swapfunc;
- }
-#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
- } else {
- client->errorValue = 0;
- cl->largeCmdRequestsTotal = 0;
- return __glXBadLargeRequest;
- }
-
- /*
- ** Make enough space in the buffer, then copy the entire request.
- */
- if (cl->largeCmdBufSize < hdr->length) {
- if (!cl->largeCmdBuf) {
- cl->largeCmdBuf = (GLbyte *) malloc(hdr->length);
- } else {
- cl->largeCmdBuf = (GLbyte *) realloc(cl->largeCmdBuf, hdr->length);
- }
- if (!cl->largeCmdBuf) {
- cl->largeCmdRequestsTotal = 0;
- return BadAlloc;
- }
- cl->largeCmdBufSize = hdr->length;
- }
- memcpy(cl->largeCmdBuf, pc, req->dataBytes);
-
- cl->largeCmdBytesSoFar = req->dataBytes;
- cl->largeCmdBytesTotal = hdr->length;
- cl->largeCmdRequestsSoFar = 1;
- cl->largeCmdRequestsTotal = req->requestTotal;
- cl->largeCmdRequestsSwapProc = proc;
- cl->largeCmdMaxReqDataSize = req->dataBytes;
- cl->largeCmdRequestsSwap_info = info;
-
- return Success;
-
+ }
+ else if ((opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
+ (opcode <= __GLX_MAX_RENDER_OPCODE_EXT)) {
+ int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
+
+ info = &__glXSwapRenderTable_EXT[index];
+ if (info->swapfunc) {
+ proc = info->swapfunc;
+ }
+#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
+ }
+ else {
+ client->errorValue = 0;
+ cl->largeCmdRequestsTotal = 0;
+ return __glXBadLargeRequest;
+ }
+
+ /*
+ ** Make enough space in the buffer, then copy the entire request.
+ */
+ if (cl->largeCmdBufSize < hdr->length) {
+ if (!cl->largeCmdBuf) {
+ cl->largeCmdBuf = (GLbyte *) malloc(hdr->length);
+ }
+ else {
+ cl->largeCmdBuf =
+ (GLbyte *) realloc(cl->largeCmdBuf, hdr->length);
+ }
+ if (!cl->largeCmdBuf) {
+ cl->largeCmdRequestsTotal = 0;
+ return BadAlloc;
+ }
+ cl->largeCmdBufSize = hdr->length;
+ }
+ memcpy(cl->largeCmdBuf, pc, req->dataBytes);
+
+ cl->largeCmdBytesSoFar = req->dataBytes;
+ cl->largeCmdBytesTotal = hdr->length;
+ cl->largeCmdRequestsSoFar = 1;
+ cl->largeCmdRequestsTotal = req->requestTotal;
+ cl->largeCmdRequestsSwapProc = proc;
+ cl->largeCmdMaxReqDataSize = req->dataBytes;
+ cl->largeCmdRequestsSwap_info = info;
+
+ return Success;
}
else if (req->requestNumber < cl->largeCmdRequestsTotal) {
- /*
- * This is not the first nor last request - just copy the data
- */
- if ( cl->largeCmdBytesSoFar + req->dataBytes > cl->largeCmdBytesTotal) {
- cl->largeCmdRequestsTotal = 0;
- return __glXBadLargeRequest;
- }
+ /*
+ * This is not the first nor last request - just copy the data
+ */
+ if (cl->largeCmdBytesSoFar + req->dataBytes > cl->largeCmdBytesTotal) {
+ cl->largeCmdRequestsTotal = 0;
+ return __glXBadLargeRequest;
+ }
- memcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar,
- pc, req->dataBytes);
+ memcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar, pc, req->dataBytes);
- cl->largeCmdBytesSoFar += req->dataBytes;
+ cl->largeCmdBytesSoFar += req->dataBytes;
- if (req->dataBytes > cl->largeCmdMaxReqDataSize)
- cl->largeCmdMaxReqDataSize = req->dataBytes;
+ if (req->dataBytes > cl->largeCmdMaxReqDataSize)
+ cl->largeCmdMaxReqDataSize = req->dataBytes;
- return Success;
+ return Success;
}
else if (req->requestNumber == cl->largeCmdRequestsTotal) {
- /*
- * this is the last request
- * copy the remainder bytes, call the procedure to swap any
- * needed data, and then call to transfer the command to all
- * back-end servers
- */
- if ( cl->largeCmdBytesSoFar + req->dataBytes > cl->largeCmdBytesTotal) {
- cl->largeCmdRequestsTotal = 0;
- return __glXBadLargeRequest;
- }
-
- memcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar,
- pc, req->dataBytes);
-
- cl->largeCmdBytesSoFar += req->dataBytes;
-
- if (req->dataBytes > cl->largeCmdMaxReqDataSize)
- cl->largeCmdMaxReqDataSize = req->dataBytes;
-
- if (cl->largeCmdRequestsSwapProc != NULL) {
- (*cl->largeCmdRequestsSwapProc)(cl->largeCmdBuf + __GLX_RENDER_LARGE_HDR_SIZE);
- }
- else if (cl->largeCmdRequestsSwap_info &&
- cl->largeCmdRequestsSwap_info->nelems > 0) {
- if (cl->largeCmdRequestsSwap_info->elem_size == 4) {
- __GLX_SWAP_INT_ARRAY( (int *)(pc + __GLX_RENDER_LARGE_HDR_SIZE),
- cl->largeCmdRequestsSwap_info->nelems );
- }
- else if (cl->largeCmdRequestsSwap_info->elem_size == 2) {
- __GLX_SWAP_SHORT_ARRAY( (short *)(pc + __GLX_RENDER_LARGE_HDR_SIZE),
- cl->largeCmdRequestsSwap_info->nelems );
- }
- else if (cl->largeCmdRequestsSwap_info->elem_size == 8) {
- __GLX_SWAP_DOUBLE_ARRAY( (double *)(pc + __GLX_RENDER_LARGE_HDR_SIZE),
- cl->largeCmdRequestsSwap_info->nelems );
- }
- }
-
- cl->largeCmdRequestsTotal = 0;
- return( __glXSendLargeCommand(cl, req->contextTag) );
+ /*
+ * this is the last request
+ * copy the remainder bytes, call the procedure to swap any
+ * needed data, and then call to transfer the command to all
+ * back-end servers
+ */
+ if (cl->largeCmdBytesSoFar + req->dataBytes > cl->largeCmdBytesTotal) {
+ cl->largeCmdRequestsTotal = 0;
+ return __glXBadLargeRequest;
+ }
+
+ memcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar, pc, req->dataBytes);
+
+ cl->largeCmdBytesSoFar += req->dataBytes;
+
+ if (req->dataBytes > cl->largeCmdMaxReqDataSize)
+ cl->largeCmdMaxReqDataSize = req->dataBytes;
+
+ if (cl->largeCmdRequestsSwapProc != NULL) {
+ (*cl->largeCmdRequestsSwapProc) (cl->largeCmdBuf +
+ __GLX_RENDER_LARGE_HDR_SIZE);
+ }
+ else if (cl->largeCmdRequestsSwap_info &&
+ cl->largeCmdRequestsSwap_info->nelems > 0) {
+ if (cl->largeCmdRequestsSwap_info->elem_size == 4) {
+ __GLX_SWAP_INT_ARRAY((int *) (pc + __GLX_RENDER_LARGE_HDR_SIZE),
+ cl->largeCmdRequestsSwap_info->nelems);
+ }
+ else if (cl->largeCmdRequestsSwap_info->elem_size == 2) {
+ __GLX_SWAP_SHORT_ARRAY((short *) (pc +
+ __GLX_RENDER_LARGE_HDR_SIZE),
+ cl->largeCmdRequestsSwap_info->nelems);
+ }
+ else if (cl->largeCmdRequestsSwap_info->elem_size == 8) {
+ __GLX_SWAP_DOUBLE_ARRAY((double *) (pc +
+ __GLX_RENDER_LARGE_HDR_SIZE),
+ cl->largeCmdRequestsSwap_info->nelems);
+ }
+ }
+
+ cl->largeCmdRequestsTotal = 0;
+ return (__glXSendLargeCommand(cl, req->contextTag));
}
else {
- cl->largeCmdRequestsTotal = 0;
- return __glXBadLargeRequest;
+ cl->largeCmdRequestsTotal = 0;
+ return __glXBadLargeRequest;
}
}
@@ -805,7 +885,8 @@ int __glXSwapRenderLarge(__GLXclientState *cl, GLbyte *pc)
** allocating these entry points in the dispatch table.
*/
-int __glXSwapVendorPrivate(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapVendorPrivate(__GLXclientState * cl, GLbyte * pc)
{
xGLXVendorPrivateReq *req;
CARD32 vendorCode;
@@ -816,58 +897,58 @@ int __glXSwapVendorPrivate(__GLXclientState *cl, GLbyte *pc)
vendorCode = req->vendorCode;
__GLX_SWAP_INT(&vendorCode);
-
- switch( vendorCode ) {
-
- case X_GLvop_DeleteTexturesEXT:
- return __glXVForwardSingleReqSwap( cl, pc );
- break;
-
- case X_GLXvop_SwapIntervalSGI:
- if (glxIsExtensionSupported("SGI_swap_control")) {
- return __glXVForwardSingleReqSwap( cl, pc );
- }
- else {
- return Success;
- }
- break;
-
-#if 0 /* glx 1.3 */
- case X_GLXvop_CreateGLXVideoSourceSGIX:
- break;
- case X_GLXvop_DestroyGLXVideoSourceSGIX:
- break;
- case X_GLXvop_CreateGLXPixmapWithConfigSGIX:
- break;
- case X_GLXvop_DestroyGLXPbufferSGIX:
- break;
- case X_GLXvop_ChangeDrawableAttributesSGIX:
- break;
+ switch (vendorCode) {
+
+ case X_GLvop_DeleteTexturesEXT:
+ return __glXVForwardSingleReqSwap(cl, pc);
+ break;
+
+ case X_GLXvop_SwapIntervalSGI:
+ if (glxIsExtensionSupported("SGI_swap_control")) {
+ return __glXVForwardSingleReqSwap(cl, pc);
+ }
+ else {
+ return Success;
+ }
+ break;
+
+#if 0 /* glx 1.3 */
+ case X_GLXvop_CreateGLXVideoSourceSGIX:
+ break;
+ case X_GLXvop_DestroyGLXVideoSourceSGIX:
+ break;
+ case X_GLXvop_CreateGLXPixmapWithConfigSGIX:
+ break;
+ case X_GLXvop_DestroyGLXPbufferSGIX:
+ break;
+ case X_GLXvop_ChangeDrawableAttributesSGIX:
+ break;
#endif
- case X_GLXvop_JoinSwapGroupSGIX:
- return __glXSwapJoinSwapGroupSGIX( cl, pc );
- break;
+ case X_GLXvop_JoinSwapGroupSGIX:
+ return __glXSwapJoinSwapGroupSGIX(cl, pc);
+ break;
- case X_GLXvop_BindSwapBarrierSGIX:
- return __glXSwapBindSwapBarrierSGIX( cl, pc );
- break;
+ case X_GLXvop_BindSwapBarrierSGIX:
+ return __glXSwapBindSwapBarrierSGIX(cl, pc);
+ break;
- case X_GLXvop_CreateContextWithConfigSGIX:
- return __glXSwapCreateContextWithConfigSGIX( cl, pc );
- break;
+ case X_GLXvop_CreateContextWithConfigSGIX:
+ return __glXSwapCreateContextWithConfigSGIX(cl, pc);
+ break;
- default:
- /*
- ** unsupported private request
- */
- cl->client->errorValue = req->vendorCode;
- return __glXUnsupportedPrivateRequest;
+ default:
+ /*
+ ** unsupported private request
+ */
+ cl->client->errorValue = req->vendorCode;
+ return __glXUnsupportedPrivateRequest;
}
}
-int __glXSwapVendorPrivateWithReply(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapVendorPrivateWithReply(__GLXclientState * cl, GLbyte * pc)
{
xGLXVendorPrivateWithReplyReq *req;
CARD32 vendorCode;
@@ -878,76 +959,78 @@ int __glXSwapVendorPrivateWithReply(__GLXclientState *cl, GLbyte *pc)
vendorCode = req->vendorCode;
__GLX_SWAP_INT(&vendorCode);
- switch( vendorCode ) {
-
- case X_GLvop_GetConvolutionFilterEXT:
- case X_GLvop_GetSeparableFilterEXT:
- case X_GLvop_GetHistogramEXT:
- case X_GLvop_GetMinmaxEXT:
- return( __glXNoSuchSingleOpcode(cl, pc) );
- break;
-
- case X_GLvop_GetConvolutionParameterfvEXT:
- case X_GLvop_GetConvolutionParameterivEXT:
- case X_GLvop_GetHistogramParameterivEXT:
- case X_GLvop_GetMinmaxParameterfvEXT:
- case X_GLvop_GetMinmaxParameterivEXT:
- case X_GLvop_GenTexturesEXT:
- return( __glXVForwardAllWithReplySwapiv(cl, pc) );
- break;
-
- case X_GLvop_AreTexturesResidentEXT:
- case X_GLvop_IsTextureEXT:
- return( __glXVForwardPipe0WithReplySwap(cl, pc) );
- break;
-
-#if 0 /* glx1.3 */
- case X_GLvop_GetDetailTexFuncSGIS:
- case X_GLvop_GetSharpenTexFuncSGIS:
- case X_GLvop_GetColorTableSGI:
- case X_GLvop_GetColorTableParameterfvSGI:
- case X_GLvop_GetColorTableParameterivSGI:
- case X_GLvop_GetTexFilterFuncSGIS:
- case X_GLvop_GetInstrumentsSGIX:
- case X_GLvop_InstrumentsBufferSGIX:
- case X_GLvop_PollInstrumentsSGIX:
- case X_GLvop_FlushRasterSGIX:
- case X_GLXvop_CreateGLXPbufferSGIX:
- case X_GLXvop_GetDrawableAttributesSGIX:
- case X_GLXvop_QueryHyperpipeNetworkSGIX:
- case X_GLXvop_QueryHyperpipeConfigSGIX:
- case X_GLXvop_HyperpipeConfigSGIX:
- case X_GLXvop_DestroyHyperpipeConfigSGIX:
+ switch (vendorCode) {
+
+ case X_GLvop_GetConvolutionFilterEXT:
+ case X_GLvop_GetSeparableFilterEXT:
+ case X_GLvop_GetHistogramEXT:
+ case X_GLvop_GetMinmaxEXT:
+ return (__glXNoSuchSingleOpcode(cl, pc));
+ break;
+
+ case X_GLvop_GetConvolutionParameterfvEXT:
+ case X_GLvop_GetConvolutionParameterivEXT:
+ case X_GLvop_GetHistogramParameterivEXT:
+ case X_GLvop_GetMinmaxParameterfvEXT:
+ case X_GLvop_GetMinmaxParameterivEXT:
+ case X_GLvop_GenTexturesEXT:
+ return (__glXVForwardAllWithReplySwapiv(cl, pc));
+ break;
+
+ case X_GLvop_AreTexturesResidentEXT:
+ case X_GLvop_IsTextureEXT:
+ return (__glXVForwardPipe0WithReplySwap(cl, pc));
+ break;
+
+#if 0 /* glx1.3 */
+ case X_GLvop_GetDetailTexFuncSGIS:
+ case X_GLvop_GetSharpenTexFuncSGIS:
+ case X_GLvop_GetColorTableSGI:
+ case X_GLvop_GetColorTableParameterfvSGI:
+ case X_GLvop_GetColorTableParameterivSGI:
+ case X_GLvop_GetTexFilterFuncSGIS:
+ case X_GLvop_GetInstrumentsSGIX:
+ case X_GLvop_InstrumentsBufferSGIX:
+ case X_GLvop_PollInstrumentsSGIX:
+ case X_GLvop_FlushRasterSGIX:
+ case X_GLXvop_CreateGLXPbufferSGIX:
+ case X_GLXvop_GetDrawableAttributesSGIX:
+ case X_GLXvop_QueryHyperpipeNetworkSGIX:
+ case X_GLXvop_QueryHyperpipeConfigSGIX:
+ case X_GLXvop_HyperpipeConfigSGIX:
+ case X_GLXvop_DestroyHyperpipeConfigSGIX:
#endif
- case X_GLXvop_QueryMaxSwapBarriersSGIX:
- return( __glXSwapQueryMaxSwapBarriersSGIX(cl, pc) );
- break;
-
- case X_GLXvop_GetFBConfigsSGIX:
- return( __glXSwapGetFBConfigsSGIX(cl, pc) );
- break;
-
- case X_GLXvop_MakeCurrentReadSGI:
- return( __glXSwapMakeCurrentReadSGI(cl, pc) );
- break;
-
- case X_GLXvop_QueryContextInfoEXT:
- return( __glXSwapQueryContextInfoEXT(cl,(char *)pc) );
- break;
-
- default:
- /*
- ** unsupported private request
- */
- cl->client->errorValue = req->vendorCode;
- return __glXUnsupportedPrivateRequest;
+ case X_GLXvop_QueryMaxSwapBarriersSGIX:
+ return (__glXSwapQueryMaxSwapBarriersSGIX(cl, pc));
+ break;
+
+ case X_GLXvop_GetFBConfigsSGIX:
+ return (__glXSwapGetFBConfigsSGIX(cl, pc));
+ break;
+
+ case X_GLXvop_MakeCurrentReadSGI:
+ return (__glXSwapMakeCurrentReadSGI(cl, pc));
+ break;
+
+ case X_GLXvop_QueryContextInfoEXT:
+ return (__glXSwapQueryContextInfoEXT(cl, (char *) pc));
+ break;
+
+ default:
+ /*
+ ** unsupported private request
+ */
+ cl->client->errorValue = req->vendorCode;
+ return __glXUnsupportedPrivateRequest;
}
}
-int __glXSwapGetFBConfigs(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapGetFBConfigs(__GLXclientState * cl, GLbyte * pc)
{
xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
@@ -956,22 +1039,25 @@ int __glXSwapGetFBConfigs(__GLXclientState *cl, GLbyte *pc)
return __glXGetFBConfigs(cl, pc);
}
-int __glXSwapGetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapGetFBConfigsSGIX(__GLXclientState * cl, GLbyte * pc)
{
- xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *)pc;
- xGLXGetFBConfigsReq new_req;
+ xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) pc;
+ xGLXGetFBConfigsReq new_req;
- new_req.reqType = req->reqType;
- new_req.glxCode = req->glxCode;
- new_req.length = req->length;
- new_req.screen = req->screen;
+ new_req.reqType = req->reqType;
+ new_req.glxCode = req->glxCode;
+ new_req.length = req->length;
+ new_req.screen = req->screen;
- return( __glXSwapGetFBConfigs( cl, (GLbyte *)&new_req ) );
+ return (__glXSwapGetFBConfigs(cl, (GLbyte *) & new_req));
}
-int __glXSwapCreateWindow(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapCreateWindow(__GLXclientState * cl, GLbyte * pc)
{
xGLXCreateWindowReq *req = (xGLXCreateWindowReq *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
@@ -981,37 +1067,42 @@ int __glXSwapCreateWindow(__GLXclientState *cl, GLbyte *pc)
__GLX_SWAP_INT(&req->glxwindow);
__GLX_SWAP_INT(&req->numAttribs);
- return( __glXCreateWindow( cl, (GLbyte *)pc ) );
+ return (__glXCreateWindow(cl, (GLbyte *) pc));
}
-int __glXSwapDestroyWindow(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapDestroyWindow(__GLXclientState * cl, GLbyte * pc)
{
xGLXDestroyWindowReq *req = (xGLXDestroyWindowReq *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->glxwindow);
- return( __glXDestroyWindow( cl, (GLbyte *)pc ) );
+ return (__glXDestroyWindow(cl, (GLbyte *) pc));
}
-int __glXSwapQueryContext(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapQueryContext(__GLXclientState * cl, GLbyte * pc)
{
- xGLXQueryContextReq *req = (xGLXQueryContextReq *)pc;
+ xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context);
- return( __glXQueryContext(cl, (GLbyte *)pc) );
-
+ return (__glXQueryContext(cl, (GLbyte *) pc));
+
}
-int __glXSwapCreatePbuffer(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapCreatePbuffer(__GLXclientState * cl, GLbyte * pc)
{
- xGLXCreatePbufferReq *req = (xGLXCreatePbufferReq *)pc;
+ xGLXCreatePbufferReq *req = (xGLXCreatePbufferReq *) pc;
int nattr = req->numAttribs;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
@@ -1020,43 +1111,49 @@ int __glXSwapCreatePbuffer(__GLXclientState *cl, GLbyte *pc)
__GLX_SWAP_INT(&req->fbconfig);
__GLX_SWAP_INT(&req->pbuffer);
__GLX_SWAP_INT(&req->numAttribs);
- __GLX_SWAP_INT_ARRAY( (int *)(req+1), nattr*2 );
+ __GLX_SWAP_INT_ARRAY((int *) (req + 1), nattr * 2);
- return( __glXCreatePbuffer( cl, pc ) );
+ return (__glXCreatePbuffer(cl, pc));
}
-int __glXSwapDestroyPbuffer(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapDestroyPbuffer(__GLXclientState * cl, GLbyte * pc)
{
xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->pbuffer);
- return( __glXDestroyPbuffer( cl, (GLbyte *)pc ) );
+ return (__glXDestroyPbuffer(cl, (GLbyte *) pc));
}
-int __glXSwapGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapGetDrawableAttributes(__GLXclientState * cl, GLbyte * pc)
{
- xGLXGetDrawableAttributesReq *req = (xGLXGetDrawableAttributesReq *)pc;
+ xGLXGetDrawableAttributesReq *req = (xGLXGetDrawableAttributesReq *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->drawable);
- return( __glXGetDrawableAttributes(cl, pc) );
+ return (__glXGetDrawableAttributes(cl, pc));
}
-int __glXSwapChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
+int
+__glXSwapChangeDrawableAttributes(__GLXclientState * cl, GLbyte * pc)
{
- xGLXChangeDrawableAttributesReq *req = (xGLXChangeDrawableAttributesReq *)pc;
+ xGLXChangeDrawableAttributesReq *req =
+ (xGLXChangeDrawableAttributesReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->drawable);
__GLX_SWAP_INT(&req->numAttribs);
- __GLX_SWAP_INT_ARRAY( (int *)(req+1), req->numAttribs * 2 );
+ __GLX_SWAP_INT_ARRAY((int *) (req + 1), req->numAttribs * 2);
- return( __glXChangeDrawableAttributes(cl, pc) );
+ return (__glXChangeDrawableAttributes(cl, pc));
}
diff --git a/hw/dmx/glxProxy/glxcontext.h b/hw/dmx/glxProxy/glxcontext.h
index f88093bc7..ac8c0573d 100644
--- a/hw/dmx/glxProxy/glxcontext.h
+++ b/hw/dmx/glxProxy/glxcontext.h
@@ -37,68 +37,68 @@ typedef struct __GLXcontextRec __GLXcontext;
struct __GLXcontextRec {
/*
- ** list of context structs
- */
+ ** list of context structs
+ */
struct __GLXcontextRec *last;
struct __GLXcontextRec *next;
/*
- ** Pointer to screen info data for this context. This is set
- ** when the context is created.
- */
+ ** Pointer to screen info data for this context. This is set
+ ** when the context is created.
+ */
ScreenPtr pScreen;
__GLXscreenInfo *pGlxScreen;
/*
- ** This context is created with respect to this visual.
- */
+ ** This context is created with respect to this visual.
+ */
VisualRec *pVisual;
__GLXvisualConfig *pGlxVisual;
__GLXFBConfig *pFBConfig;
/*
- ** The XID of this context.
- */
+ ** The XID of this context.
+ */
XID id;
XID *real_ids;
/*
- ** The XID of the shareList context.
- */
+ ** The XID of the shareList context.
+ */
XID share_id;
/*
- ** Visual id.
- */
+ ** Visual id.
+ */
VisualID vid;
VisualID *real_vids;
/*
- ** screen number.
- */
+ ** screen number.
+ */
GLint screen;
/*
- ** Whether this context's ID still exists.
- */
+ ** Whether this context's ID still exists.
+ */
GLboolean idExists;
-
+
/*
- ** Whether this context is current for some client.
- */
+ ** Whether this context is current for some client.
+ */
GLboolean isCurrent;
-
+
/*
- ** Buffers for feedback and selection.
- */
+ ** Buffers for feedback and selection.
+ */
GLfloat *feedbackBuf;
- GLint feedbackBufSize; /* number of elements allocated */
+ GLint feedbackBufSize; /* number of elements allocated */
GLuint *selectBuf;
- GLint selectBufSize; /* number of elements allocated */
+ GLint selectBufSize; /* number of elements allocated */
/*
- ** Set only if current drawable is a glx pixmap.
- */
+ ** Set only if current drawable is a glx pixmap.
+ */
__GLXpixmap *pGlxPixmap;
__GLXpixmap *pGlxReadPixmap;
__glXWindow *pGlxWindow;
@@ -108,4 +108,4 @@ struct __GLXcontextRec {
};
-#endif /* !__GLX_context_h__ */
+#endif /* !__GLX_context_h__ */
diff --git a/hw/dmx/glxProxy/glxdrawable.h b/hw/dmx/glxProxy/glxdrawable.h
index 8f2d81e26..0340896e5 100644
--- a/hw/dmx/glxProxy/glxdrawable.h
+++ b/hw/dmx/glxProxy/glxdrawable.h
@@ -48,12 +48,11 @@ typedef struct {
DrawablePtr pDraw;
int type;
Bool idExists;
- int refcnt; /* contexts bound */
+ int refcnt; /* contexts bound */
__GLXFBConfig *pGlxFBConfig;
ScreenPtr pScreen;
} __glXWindow;
-
typedef struct {
__GLXscreenInfo *pGlxScreen;
__GLXFBConfig *pFBConfig;
@@ -63,4 +62,4 @@ typedef struct {
XID *be_xids;
} __glXPbuffer;
-#endif /* !__GLX_drawable_h__ */
+#endif /* !__GLX_drawable_h__ */
diff --git a/hw/dmx/glxProxy/glxerror.h b/hw/dmx/glxProxy/glxerror.h
index d84ec4457..26492d2d4 100644
--- a/hw/dmx/glxProxy/glxerror.h
+++ b/hw/dmx/glxProxy/glxerror.h
@@ -48,5 +48,4 @@ extern int __glXUnsupportedPrivateRequest;
extern int __glXBadFBConfig;
extern int __glXBadPbuffer;
-
#endif
diff --git a/hw/dmx/glxProxy/glxext.c b/hw/dmx/glxProxy/glxext.c
index 7f63b6b0b..b0710ccc6 100644
--- a/hw/dmx/glxProxy/glxext.c
+++ b/hw/dmx/glxProxy/glxext.c
@@ -50,7 +50,10 @@
*/
typedef int __GLXprovider;
__GLXprovider __glXDRISWRastProvider;
-void GlxPushProvider(__GLXprovider *provider) { }
+void
+GlxPushProvider(__GLXprovider * provider)
+{
+}
/*
** Forward declarations.
@@ -61,7 +64,8 @@ static int __glXDispatch(ClientPtr);
/*
** Called when the extension is reset.
*/
-static void ResetExtension(ExtensionEntry* extEntry)
+static void
+ResetExtension(ExtensionEntry * extEntry)
{
__glXFlushContextCache();
__glXScreenReset();
@@ -71,7 +75,8 @@ static void ResetExtension(ExtensionEntry* extEntry)
/*
** Initialize the per-client context storage.
*/
-static void ResetClientState(int clientIndex)
+static void
+ResetClientState(int clientIndex)
{
__GLXclientState *cl = __glXClients[clientIndex];
Display **keep_be_displays;
@@ -82,9 +87,9 @@ static void ResetClientState(int clientIndex)
free(cl->currentDrawables);
free(cl->largeCmdBuf);
- for (i=0; i< screenInfo.numScreens; i++) {
- if (cl->be_displays[i])
- XCloseDisplay( cl->be_displays[i] );
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ if (cl->be_displays[i])
+ XCloseDisplay(cl->be_displays[i]);
}
keep_be_displays = cl->be_displays;
@@ -92,9 +97,9 @@ static void ResetClientState(int clientIndex)
cl->be_displays = keep_be_displays;
/*
- ** By default, assume that the client supports
- ** GLX major version 1 minor version 0 protocol.
- */
+ ** By default, assume that the client supports
+ ** GLX major version 1 minor version 0 protocol.
+ */
cl->GLClientmajorVersion = 1;
cl->GLClientminorVersion = 0;
free(cl->GLClientextensions);
@@ -102,18 +107,18 @@ static void ResetClientState(int clientIndex)
memset(cl->be_displays, 0, screenInfo.numScreens * sizeof(Display *));
}
-
/*
** This procedure is called when the client who created the context goes
** away OR when glXDestroyContext is called. In either case, all we do is
** flag that the ID is no longer valid, and (maybe) free the context.
** use.
*/
-static int ContextGone(__GLXcontext* cx, XID id)
+static int
+ContextGone(__GLXcontext * cx, XID id)
{
cx->idExists = GL_FALSE;
if (!cx->isCurrent) {
- __glXFreeContext(cx);
+ __glXFreeContext(cx);
}
return True;
@@ -122,31 +127,32 @@ static int ContextGone(__GLXcontext* cx, XID id)
/*
** Free a client's state.
*/
-static int ClientGone(int clientIndex, XID id)
+static int
+ClientGone(int clientIndex, XID id)
{
__GLXcontext *cx;
__GLXclientState *cl = __glXClients[clientIndex];
int i;
if (cl) {
- /*
- ** Free all the contexts that are current for this client.
- */
- for (i=0; i < cl->numCurrentContexts; i++) {
- cx = cl->currentContexts[i];
- if (cx) {
- cx->isCurrent = GL_FALSE;
- if (!cx->idExists) {
- __glXFreeContext(cx);
- }
- }
- }
- /*
- ** Re-initialize the client state structure. Don't free it because
- ** we'll probably get another client with this index and use the struct
- ** again. There is a maximum of MAXCLIENTS of these structures.
- */
- ResetClientState(clientIndex);
+ /*
+ ** Free all the contexts that are current for this client.
+ */
+ for (i = 0; i < cl->numCurrentContexts; i++) {
+ cx = cl->currentContexts[i];
+ if (cx) {
+ cx->isCurrent = GL_FALSE;
+ if (!cx->idExists) {
+ __glXFreeContext(cx);
+ }
+ }
+ }
+ /*
+ ** Re-initialize the client state structure. Don't free it because
+ ** we'll probably get another client with this index and use the struct
+ ** again. There is a maximum of MAXCLIENTS of these structures.
+ */
+ ResetClientState(clientIndex);
}
return True;
@@ -155,57 +161,61 @@ static int ClientGone(int clientIndex, XID id)
/*
** Free a GLX Pixmap.
*/
-void __glXFreeGLXPixmap( __GLXpixmap *pGlxPixmap )
+void
+__glXFreeGLXPixmap(__GLXpixmap * pGlxPixmap)
{
- if (!pGlxPixmap->idExists &&
- !pGlxPixmap->refcnt) {
-
- PixmapPtr pPixmap = (PixmapPtr) pGlxPixmap->pDraw;
-
- /*
- ** The DestroyPixmap routine should decrement the refcount and free
- ** only if it's zero.
- */
- (*pGlxPixmap->pScreen->DestroyPixmap)(pPixmap);
- free(pGlxPixmap->be_xids);
- free(pGlxPixmap);
+ if (!pGlxPixmap->idExists && !pGlxPixmap->refcnt) {
+
+ PixmapPtr pPixmap = (PixmapPtr) pGlxPixmap->pDraw;
+
+ /*
+ ** The DestroyPixmap routine should decrement the refcount and free
+ ** only if it's zero.
+ */
+ (*pGlxPixmap->pScreen->DestroyPixmap) (pPixmap);
+ free(pGlxPixmap->be_xids);
+ free(pGlxPixmap);
}
}
-static int PixmapGone(__GLXpixmap *pGlxPixmap, XID id)
+static int
+PixmapGone(__GLXpixmap * pGlxPixmap, XID id)
{
pGlxPixmap->idExists = False;
- __glXFreeGLXPixmap( pGlxPixmap );
+ __glXFreeGLXPixmap(pGlxPixmap);
return True;
}
-void __glXFreeGLXWindow(__glXWindow *pGlxWindow)
+void
+__glXFreeGLXWindow(__glXWindow * pGlxWindow)
{
if (!pGlxWindow->idExists && !pGlxWindow->refcnt) {
- WindowPtr pWindow = (WindowPtr) pGlxWindow->pDraw;
- WindowPtr ret;
+ WindowPtr pWindow = (WindowPtr) pGlxWindow->pDraw;
+ WindowPtr ret;
- dixLookupResourceByType((pointer) &ret,
- pWindow->drawable.id, RT_WINDOW,
- NullClient, DixUnknownAccess);
+ dixLookupResourceByType((pointer) &ret,
+ pWindow->drawable.id, RT_WINDOW,
+ NullClient, DixUnknownAccess);
if (ret == pWindow) {
- (*pGlxWindow->pScreen->DestroyWindow)(pWindow);
+ (*pGlxWindow->pScreen->DestroyWindow) (pWindow);
}
- free(pGlxWindow);
+ free(pGlxWindow);
}
}
-static void WindowGone(__glXWindow *pGlxWindow, XID id)
+static void
+WindowGone(__glXWindow * pGlxWindow, XID id)
{
pGlxWindow->idExists = False;
__glXFreeGLXWindow(pGlxWindow);
}
-void __glXFreeGLXPbuffer(__glXPbuffer *pGlxPbuffer)
+void
+__glXFreeGLXPbuffer(__glXPbuffer * pGlxPbuffer)
{
if (!pGlxPbuffer->idExists && !pGlxPbuffer->refcnt) {
free(pGlxPbuffer->be_xids);
@@ -213,7 +223,8 @@ void __glXFreeGLXPbuffer(__glXPbuffer *pGlxPbuffer)
}
}
-static void PbufferGone(__glXPbuffer *pGlxPbuffer, XID id)
+static void
+PbufferGone(__glXPbuffer * pGlxPbuffer, XID id)
{
pGlxPbuffer->idExists = False;
__glXFreeGLXPbuffer(pGlxPbuffer);
@@ -222,55 +233,57 @@ static void PbufferGone(__glXPbuffer *pGlxPbuffer, XID id)
/*
** Free a context.
*/
-GLboolean __glXFreeContext(__GLXcontext *cx)
+GLboolean
+__glXFreeContext(__GLXcontext * cx)
{
- if (cx->idExists || cx->isCurrent) return GL_FALSE;
-
+ if (cx->idExists || cx->isCurrent)
+ return GL_FALSE;
+
free(cx->feedbackBuf);
free(cx->selectBuf);
free(cx->real_ids);
free(cx->real_vids);
if (cx->pGlxPixmap) {
- /*
- ** The previous drawable was a glx pixmap, release it.
- */
- cx->pGlxPixmap->refcnt--;
- __glXFreeGLXPixmap( cx->pGlxPixmap );
- cx->pGlxPixmap = 0;
+ /*
+ ** The previous drawable was a glx pixmap, release it.
+ */
+ cx->pGlxPixmap->refcnt--;
+ __glXFreeGLXPixmap(cx->pGlxPixmap);
+ cx->pGlxPixmap = 0;
}
if (cx->pGlxReadPixmap) {
- /*
- ** The previous drawable was a glx pixmap, release it.
- */
- cx->pGlxReadPixmap->refcnt--;
- __glXFreeGLXPixmap( cx->pGlxReadPixmap );
- cx->pGlxReadPixmap = 0;
+ /*
+ ** The previous drawable was a glx pixmap, release it.
+ */
+ cx->pGlxReadPixmap->refcnt--;
+ __glXFreeGLXPixmap(cx->pGlxReadPixmap);
+ cx->pGlxReadPixmap = 0;
}
if (cx->pGlxWindow) {
- /*
- ** The previous drawable was a glx window, release it.
- */
- cx->pGlxWindow->refcnt--;
- __glXFreeGLXWindow( cx->pGlxWindow );
- cx->pGlxWindow = 0;
+ /*
+ ** The previous drawable was a glx window, release it.
+ */
+ cx->pGlxWindow->refcnt--;
+ __glXFreeGLXWindow(cx->pGlxWindow);
+ cx->pGlxWindow = 0;
}
if (cx->pGlxReadWindow) {
- /*
- ** The previous drawable was a glx window, release it.
- */
- cx->pGlxReadWindow->refcnt--;
- __glXFreeGLXWindow( cx->pGlxReadWindow );
- cx->pGlxReadWindow = 0;
+ /*
+ ** The previous drawable was a glx window, release it.
+ */
+ cx->pGlxReadWindow->refcnt--;
+ __glXFreeGLXWindow(cx->pGlxReadWindow);
+ cx->pGlxReadWindow = 0;
}
free(cx);
if (cx == __glXLastContext) {
- __glXFlushContextCache();
+ __glXFlushContextCache();
}
return GL_TRUE;
@@ -279,56 +292,57 @@ GLboolean __glXFreeContext(__GLXcontext *cx)
/*
** Initialize the GLX extension.
*/
-void GlxExtensionInit(void)
+void
+GlxExtensionInit(void)
{
ExtensionEntry *extEntry;
int i;
int glxSupported = 1;
/*
- // do not initialize GLX extension if GLX is not supported
- // by ALL back-end servers.
- */
- for (i=0; i<screenInfo.numScreens; i++) {
- glxSupported &= (dmxScreens[i].glxMajorOpcode > 0);
+ // do not initialize GLX extension if GLX is not supported
+ // by ALL back-end servers.
+ */
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ glxSupported &= (dmxScreens[i].glxMajorOpcode > 0);
}
if (!glxSupported || !dmxGLXProxy) {
- return;
+ return;
}
-
- __glXContextRes = CreateNewResourceType((DeleteType)ContextGone,
- "GLXContext");
- __glXClientRes = CreateNewResourceType((DeleteType)ClientGone,
- "GLXClient");
- __glXPixmapRes = CreateNewResourceType((DeleteType)PixmapGone,
- "GLXPixmap");
- __glXWindowRes = CreateNewResourceType((DeleteType)WindowGone,
- "GLXWindow");
- __glXPbufferRes = CreateNewResourceType((DeleteType)PbufferGone,
- "GLXPbuffer");
+
+ __glXContextRes = CreateNewResourceType((DeleteType) ContextGone,
+ "GLXContext");
+ __glXClientRes = CreateNewResourceType((DeleteType) ClientGone,
+ "GLXClient");
+ __glXPixmapRes = CreateNewResourceType((DeleteType) PixmapGone,
+ "GLXPixmap");
+ __glXWindowRes = CreateNewResourceType((DeleteType) WindowGone,
+ "GLXWindow");
+ __glXPbufferRes = CreateNewResourceType((DeleteType) PbufferGone,
+ "GLXPbuffer");
if (!__glXContextRes || !__glXClientRes || !__glXPixmapRes ||
- !__glXWindowRes || !__glXPbufferRes)
- return;
+ !__glXWindowRes || !__glXPbufferRes)
+ return;
/*
- ** Add extension to server extensions.
- */
+ ** Add extension to server extensions.
+ */
extEntry = AddExtension(GLX_EXTENSION_NAME, __GLX_NUMBER_EVENTS,
- __GLX_NUMBER_ERRORS, __glXDispatch,
- __glXSwapDispatch, ResetExtension,
- StandardMinorOpcode);
+ __GLX_NUMBER_ERRORS, __glXDispatch,
+ __glXSwapDispatch, ResetExtension,
+ StandardMinorOpcode);
if (!extEntry) {
- FatalError("__glXExtensionInit: AddExtensions failed\n");
- return;
+ FatalError("__glXExtensionInit: AddExtensions failed\n");
+ return;
}
/*
- if (!AddExtensionAlias(GLX_EXTENSION_ALIAS, extEntry)) {
- ErrorF("__glXExtensionInit: AddExtensionAlias failed\n");
- return;
- }
- */
+ if (!AddExtensionAlias(GLX_EXTENSION_ALIAS, extEntry)) {
+ ErrorF("__glXExtensionInit: AddExtensionAlias failed\n");
+ return;
+ }
+ */
__glXerrorBase = extEntry->errorBase;
__glXBadContext = extEntry->errorBase + GLXBadContext;
@@ -340,38 +354,40 @@ void GlxExtensionInit(void)
__glXBadRenderRequest = extEntry->errorBase + GLXBadRenderRequest;
__glXBadLargeRequest = extEntry->errorBase + GLXBadLargeRequest;
__glXUnsupportedPrivateRequest = extEntry->errorBase +
- GLXUnsupportedPrivateRequest;
+ GLXUnsupportedPrivateRequest;
__glXBadFBConfig = extEntry->errorBase + GLXBadFBConfig;
__glXBadPbuffer = extEntry->errorBase + GLXBadPbuffer;
/*
- ** Initialize table of client state. There is never a client 0.
- */
- for (i=1; i <= MAXCLIENTS; i++) {
- __glXClients[i] = 0;
+ ** Initialize table of client state. There is never a client 0.
+ */
+ for (i = 1; i <= MAXCLIENTS; i++) {
+ __glXClients[i] = 0;
}
/*
- ** Initialize screen specific data.
- */
+ ** Initialize screen specific data.
+ */
__glXScreenInit(screenInfo.numScreens);
/*
- ** Initialize swap barrier support.
- */
+ ** Initialize swap barrier support.
+ */
SwapBarrierInit();
}
/************************************************************************/
-Bool __glXCoreType(void)
+Bool
+__glXCoreType(void)
{
return 0;
}
/************************************************************************/
-void __glXFlushContextCache(void)
+void
+__glXFlushContextCache(void)
{
__glXLastContext = 0;
}
@@ -381,116 +397,121 @@ void __glXFlushContextCache(void)
/*
** Top level dispatcher; all commands are executed from here down.
*/
-static int __glXDispatch(ClientPtr client)
+static int
+__glXDispatch(ClientPtr client)
{
REQUEST(xGLXSingleReq);
CARD8 opcode;
- int (*proc)(__GLXclientState *cl, GLbyte *pc);
+ int (*proc) (__GLXclientState * cl, GLbyte * pc);
__GLXclientState *cl;
opcode = stuff->glxCode;
cl = __glXClients[client->index];
if (!cl) {
- cl = calloc(1, sizeof(__GLXclientState));
- __glXClients[client->index] = cl;
- if (!cl) {
- return BadAlloc;
- }
-
- cl->be_displays = calloc(screenInfo.numScreens, sizeof(Display *));
- if (!cl->be_displays) {
- free( cl );
- return BadAlloc;
- }
+ cl = calloc(1, sizeof(__GLXclientState));
+ __glXClients[client->index] = cl;
+ if (!cl) {
+ return BadAlloc;
+ }
+
+ cl->be_displays = calloc(screenInfo.numScreens, sizeof(Display *));
+ if (!cl->be_displays) {
+ free(cl);
+ return BadAlloc;
+ }
}
-
+
if (!cl->inUse) {
- /*
- ** This is first request from this client. Associate a resource
- ** with the client so we will be notified when the client dies.
- */
- XID xid = FakeClientID(client->index);
- if (!AddResource( xid, __glXClientRes, (pointer)(long)client->index)) {
- return BadAlloc;
- }
- ResetClientState(client->index);
- cl->largeCmdRequestsTotal = 0;
- cl->inUse = GL_TRUE;
- cl->client = client;
+ /*
+ ** This is first request from this client. Associate a resource
+ ** with the client so we will be notified when the client dies.
+ */
+ XID xid = FakeClientID(client->index);
+
+ if (!AddResource(xid, __glXClientRes, (pointer) (long) client->index)) {
+ return BadAlloc;
+ }
+ ResetClientState(client->index);
+ cl->largeCmdRequestsTotal = 0;
+ cl->inUse = GL_TRUE;
+ cl->client = client;
}
/*
- ** Check for valid opcode.
- */
+ ** Check for valid opcode.
+ */
if (opcode >= __GLX_SINGLE_TABLE_SIZE) {
- return BadRequest;
+ return BadRequest;
}
/*
- ** Use the opcode to index into the procedure table.
- */
+ ** Use the opcode to index into the procedure table.
+ */
proc = __glXSingleTable[opcode];
- return (*proc)(cl, (GLbyte *) stuff);
+ return (*proc) (cl, (GLbyte *) stuff);
}
-static int __glXSwapDispatch(ClientPtr client)
+static int
+__glXSwapDispatch(ClientPtr client)
{
REQUEST(xGLXSingleReq);
CARD8 opcode;
- int (*proc)(__GLXclientState *cl, GLbyte *pc);
+ int (*proc) (__GLXclientState * cl, GLbyte * pc);
__GLXclientState *cl;
opcode = stuff->glxCode;
cl = __glXClients[client->index];
if (!cl) {
- cl = calloc(1, sizeof(__GLXclientState));
- __glXClients[client->index] = cl;
- if (!cl) {
- return BadAlloc;
- }
-
- cl->be_displays = calloc(screenInfo.numScreens, sizeof(Display *));
- if (!cl->be_displays) {
- free( cl );
- return BadAlloc;
- }
+ cl = calloc(1, sizeof(__GLXclientState));
+ __glXClients[client->index] = cl;
+ if (!cl) {
+ return BadAlloc;
+ }
+
+ cl->be_displays = calloc(screenInfo.numScreens, sizeof(Display *));
+ if (!cl->be_displays) {
+ free(cl);
+ return BadAlloc;
+ }
}
-
+
if (!cl->inUse) {
- /*
- ** This is first request from this client. Associate a resource
- ** with the client so we will be notified when the client dies.
- */
- XID xid = FakeClientID(client->index);
- if (!AddResource( xid, __glXClientRes, (pointer)(long)client->index)) {
- return BadAlloc;
- }
- ResetClientState(client->index);
- cl->inUse = GL_TRUE;
- cl->client = client;
+ /*
+ ** This is first request from this client. Associate a resource
+ ** with the client so we will be notified when the client dies.
+ */
+ XID xid = FakeClientID(client->index);
+
+ if (!AddResource(xid, __glXClientRes, (pointer) (long) client->index)) {
+ return BadAlloc;
+ }
+ ResetClientState(client->index);
+ cl->inUse = GL_TRUE;
+ cl->client = client;
}
/*
- ** Check for valid opcode.
- */
+ ** Check for valid opcode.
+ */
if (opcode >= __GLX_SINGLE_TABLE_SIZE) {
- return BadRequest;
+ return BadRequest;
}
/*
- ** Use the opcode to index into the procedure table.
- */
+ ** Use the opcode to index into the procedure table.
+ */
proc = __glXSwapSingleTable[opcode];
- return (*proc)(cl, (GLbyte *) stuff);
+ return (*proc) (cl, (GLbyte *) stuff);
}
-int __glXNoSuchSingleOpcode(__GLXclientState *cl, GLbyte *pc)
+int
+__glXNoSuchSingleOpcode(__GLXclientState * cl, GLbyte * pc)
{
return BadRequest;
}
-void __glXNoSuchRenderOpcode(GLbyte *pc)
+void
+__glXNoSuchRenderOpcode(GLbyte * pc)
{
return;
}
-
diff --git a/hw/dmx/glxProxy/glxext.h b/hw/dmx/glxProxy/glxext.h
index 361bcac25..881152d1c 100644
--- a/hw/dmx/glxProxy/glxext.h
+++ b/hw/dmx/glxProxy/glxext.h
@@ -36,43 +36,36 @@
*/
typedef struct {
int type;
- void (*resetExtension)(void);
- Bool (*initVisuals)(
- VisualPtr * visualp,
- DepthPtr * depthp,
- int * nvisualp,
- int * ndepthp,
- int * rootDepthp,
- VisualID * defaultVisp,
- unsigned long sizes,
- int bitsPerRGB
- );
- void (*setVisualConfigs)(
- int nconfigs,
- __GLXvisualConfig *configs,
- void **privates
- );
+ void (*resetExtension) (void);
+ Bool (*initVisuals) (VisualPtr * visualp,
+ DepthPtr * depthp,
+ int *nvisualp,
+ int *ndepthp,
+ int *rootDepthp,
+ VisualID * defaultVisp,
+ unsigned long sizes, int bitsPerRGB);
+ void (*setVisualConfigs) (int nconfigs,
+ __GLXvisualConfig * configs, void **privates);
} __GLXextensionInfo;
-extern GLboolean __glXFreeContext(__GLXcontext *glxc);
+extern GLboolean __glXFreeContext(__GLXcontext * glxc);
extern void __glXFlushContextCache(void);
-extern void __glXFreeGLXWindow(__glXWindow *pGlxWindow);
-extern void __glXFreeGLXPixmap( __GLXpixmap *pGlxPixmap );
+extern void __glXFreeGLXWindow(__glXWindow * pGlxWindow);
+extern void __glXFreeGLXPixmap(__GLXpixmap * pGlxPixmap);
-extern void __glXNoSuchRenderOpcode(GLbyte*);
-extern int __glXNoSuchSingleOpcode(__GLXclientState*, GLbyte*);
+extern void __glXNoSuchRenderOpcode(GLbyte *);
+extern int __glXNoSuchSingleOpcode(__GLXclientState *, GLbyte *);
extern void __glXErrorCallBack(GLenum code);
extern void __glXClearErrorOccured(void);
extern GLboolean __glXErrorOccured(void);
-extern void __glXResetLargeCommandStatus(__GLXclientState*);
+extern void __glXResetLargeCommandStatus(__GLXclientState *);
-extern int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc);
-extern int __glXSwapQueryContextInfoEXT(__GLXclientState *cl, char *pc);
+extern int __glXQueryContextInfoEXT(__GLXclientState * cl, GLbyte * pc);
+extern int __glXSwapQueryContextInfoEXT(__GLXclientState * cl, char *pc);
extern void GlxExtensionInit(void);
extern Bool __glXCoreType(void);
-#endif /* _glxext_h_ */
-
+#endif /* _glxext_h_ */
diff --git a/hw/dmx/glxProxy/glxfbconfig.c b/hw/dmx/glxProxy/glxfbconfig.c
index a7741ff59..2f46bd07a 100644
--- a/hw/dmx/glxProxy/glxfbconfig.c
+++ b/hw/dmx/glxProxy/glxfbconfig.c
@@ -30,77 +30,77 @@
#include "glxfbconfig.h"
-int AreFBConfigsMatch( __GLXFBConfig *c1, __GLXFBConfig *c2 )
+int
+AreFBConfigsMatch(__GLXFBConfig * c1, __GLXFBConfig * c2)
{
- int match;
+ int match;
- match = (
- (c1->visualType == c2->visualType) &&
- (c1->transparentType == c2->transparentType) &&
- (c1->transparentRed == c2->transparentRed) &&
- (c1->transparentGreen == c2->transparentGreen) &&
- (c1->transparentBlue == c2->transparentBlue) &&
- (c1->transparentAlpha == c2->transparentAlpha) &&
- (c1->transparentIndex == c2->transparentIndex) &&
- (c1->visualCaveat == c2->visualCaveat) &&
- (c1->drawableType == c2->drawableType) &&
- (c1->renderType == c2->renderType) &&
-#if 0
- (c1->maxPbufferWidth == c2->maxPbufferWidth) &&
- (c1->maxPbufferHeight == c2->maxPbufferHeight) &&
- (c1->maxPbufferPixels == c2->maxPbufferPixels) &&
- (c1->optimalPbufferWidth == c2->optimalPbufferWidth) &&
- (c1->optimalPbufferHeight == c2->optimalPbufferHeight) &&
+ match = ((c1->visualType == c2->visualType) &&
+ (c1->transparentType == c2->transparentType) &&
+ (c1->transparentRed == c2->transparentRed) &&
+ (c1->transparentGreen == c2->transparentGreen) &&
+ (c1->transparentBlue == c2->transparentBlue) &&
+ (c1->transparentAlpha == c2->transparentAlpha) &&
+ (c1->transparentIndex == c2->transparentIndex) &&
+ (c1->visualCaveat == c2->visualCaveat) &&
+ (c1->drawableType == c2->drawableType) &&
+ (c1->renderType == c2->renderType) &&
+#if 0
+ (c1->maxPbufferWidth == c2->maxPbufferWidth) &&
+ (c1->maxPbufferHeight == c2->maxPbufferHeight) &&
+ (c1->maxPbufferPixels == c2->maxPbufferPixels) &&
+ (c1->optimalPbufferWidth == c2->optimalPbufferWidth) &&
+ (c1->optimalPbufferHeight == c2->optimalPbufferHeight) &&
#endif
- (c1->visualSelectGroup == c2->visualSelectGroup) &&
- (c1->rgbMode == c2->rgbMode) &&
- (c1->colorIndexMode == c2->colorIndexMode) &&
- (c1->doubleBufferMode == c2->doubleBufferMode) &&
- (c1->stereoMode == c2->stereoMode) &&
- (c1->haveAccumBuffer == c2->haveAccumBuffer) &&
- (c1->haveDepthBuffer == c2->haveDepthBuffer) &&
- (c1->haveStencilBuffer == c2->haveStencilBuffer) &&
- (c1->accumRedBits == c2->accumRedBits) &&
- (c1->accumGreenBits == c2->accumGreenBits) &&
- (c1->accumBlueBits == c2->accumBlueBits) &&
- (c1->accumAlphaBits == c2->accumAlphaBits) &&
- (c1->depthBits == c2->depthBits) &&
- (c1->stencilBits == c2->stencilBits) &&
- (c1->indexBits == c2->indexBits) &&
- (c1->redBits == c2->redBits) &&
- (c1->greenBits == c2->greenBits) &&
- (c1->blueBits == c2->blueBits) &&
- (c1->alphaBits == c2->alphaBits) &&
- (c1->redMask == c2->redMask) &&
- (c1->greenMask == c2->greenMask) &&
- (c1->blueMask == c2->blueMask) &&
- (c1->alphaMask == c2->alphaMask) &&
- (c1->multiSampleSize == c2->multiSampleSize) &&
- (c1->nMultiSampleBuffers == c2->nMultiSampleBuffers) &&
- (c1->maxAuxBuffers == c2->maxAuxBuffers) &&
- (c1->level == c2->level) &&
- (c1->extendedRange == c2->extendedRange) &&
- (c1->minRed == c2->minRed) &&
- (c1->maxRed == c2->maxRed) &&
- (c1->minGreen == c2->minGreen) &&
- (c1->maxGreen == c2->maxGreen) &&
- (c1->minBlue == c2->minBlue) &&
- (c1->maxBlue == c2->maxBlue) &&
- (c1->minAlpha == c2->minAlpha) &&
- (c1->maxAlpha == c2->maxAlpha)
- );
+ (c1->visualSelectGroup == c2->visualSelectGroup) &&
+ (c1->rgbMode == c2->rgbMode) &&
+ (c1->colorIndexMode == c2->colorIndexMode) &&
+ (c1->doubleBufferMode == c2->doubleBufferMode) &&
+ (c1->stereoMode == c2->stereoMode) &&
+ (c1->haveAccumBuffer == c2->haveAccumBuffer) &&
+ (c1->haveDepthBuffer == c2->haveDepthBuffer) &&
+ (c1->haveStencilBuffer == c2->haveStencilBuffer) &&
+ (c1->accumRedBits == c2->accumRedBits) &&
+ (c1->accumGreenBits == c2->accumGreenBits) &&
+ (c1->accumBlueBits == c2->accumBlueBits) &&
+ (c1->accumAlphaBits == c2->accumAlphaBits) &&
+ (c1->depthBits == c2->depthBits) &&
+ (c1->stencilBits == c2->stencilBits) &&
+ (c1->indexBits == c2->indexBits) &&
+ (c1->redBits == c2->redBits) &&
+ (c1->greenBits == c2->greenBits) &&
+ (c1->blueBits == c2->blueBits) &&
+ (c1->alphaBits == c2->alphaBits) &&
+ (c1->redMask == c2->redMask) &&
+ (c1->greenMask == c2->greenMask) &&
+ (c1->blueMask == c2->blueMask) &&
+ (c1->alphaMask == c2->alphaMask) &&
+ (c1->multiSampleSize == c2->multiSampleSize) &&
+ (c1->nMultiSampleBuffers == c2->nMultiSampleBuffers) &&
+ (c1->maxAuxBuffers == c2->maxAuxBuffers) &&
+ (c1->level == c2->level) &&
+ (c1->extendedRange == c2->extendedRange) &&
+ (c1->minRed == c2->minRed) &&
+ (c1->maxRed == c2->maxRed) &&
+ (c1->minGreen == c2->minGreen) &&
+ (c1->maxGreen == c2->maxGreen) &&
+ (c1->minBlue == c2->minBlue) &&
+ (c1->maxBlue == c2->maxBlue) &&
+ (c1->minAlpha == c2->minAlpha) && (c1->maxAlpha == c2->maxAlpha)
+ );
- return match;
+ return match;
}
-__GLXFBConfig *FindMatchingFBConfig( __GLXFBConfig *c, __GLXFBConfig *configs, int nconfigs )
+__GLXFBConfig *
+FindMatchingFBConfig(__GLXFBConfig * c, __GLXFBConfig * configs, int nconfigs)
{
- int i;
+ int i;
- for (i=0; i<nconfigs; i++) {
- if ( AreFBConfigsMatch( c, configs + i ) )
- return configs + i;
- }
+ for (i = 0; i < nconfigs; i++) {
+ if (AreFBConfigsMatch(c, configs + i))
+ return configs + i;
+ }
- return 0;
+ return 0;
}
diff --git a/hw/dmx/glxProxy/glxfbconfig.h b/hw/dmx/glxProxy/glxfbconfig.h
index c5e94043b..6626410d9 100644
--- a/hw/dmx/glxProxy/glxfbconfig.h
+++ b/hw/dmx/glxProxy/glxfbconfig.h
@@ -32,7 +32,8 @@
#include <GL/glxint.h>
-int AreFBConfigsMatch( __GLXFBConfig *c1, __GLXFBConfig *c2 );
-__GLXFBConfig *FindMatchingFBConfig( __GLXFBConfig *c, __GLXFBConfig *configs, int nconfigs );
+int AreFBConfigsMatch(__GLXFBConfig * c1, __GLXFBConfig * c2);
+__GLXFBConfig *FindMatchingFBConfig(__GLXFBConfig * c, __GLXFBConfig * configs,
+ int nconfigs);
#endif
diff --git a/hw/dmx/glxProxy/glxscreens.c b/hw/dmx/glxProxy/glxscreens.c
index baa4a65a7..f725bd138 100644
--- a/hw/dmx/glxProxy/glxscreens.c
+++ b/hw/dmx/glxProxy/glxscreens.c
@@ -49,285 +49,296 @@ __GLXscreenInfo *__glXActiveScreens;
GLint __glXNumActiveScreens;
__GLXFBConfig **__glXFBConfigs;
-int __glXNumFBConfigs;
+int __glXNumFBConfigs;
static char GLXServerVendorName[] = "SGI DMX/glxProxy";
static char GLXServerVersion[64];
static char GLXServerExtensions[] =
- "GLX_EXT_visual_info "
- "GLX_EXT_visual_rating "
- "GLX_EXT_import_context "
- "GLX_SGIX_fbconfig "
- "GLX_SGI_make_current_read "
- "GLX_SGI_swap_control "
- ;
+ "GLX_EXT_visual_info "
+ "GLX_EXT_visual_rating "
+ "GLX_EXT_import_context "
+ "GLX_SGIX_fbconfig " "GLX_SGI_make_current_read " "GLX_SGI_swap_control ";
static char ExtensionsString[1024];
-static void CalcServerVersionAndExtensions( void )
+static void
+CalcServerVersionAndExtensions(void)
{
- int s;
- xGLXQueryVersionReq *req;
- xGLXQueryVersionReply reply;
- char **be_extensions;
- char *ext;
- char *denied_extensions;
-
- /*
- * set the server glx version to be the minimum version
- * supported by all back-end servers
- */
- __glXVersionMajor = 0;
- __glXVersionMinor = 0;
- for (s=0; s<__glXNumActiveScreens; s++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[s];
- Display *dpy = dmxScreen->beDisplay;
-
- /* Send the glXQueryVersion request */
- LockDisplay(dpy);
- GetReq(GLXQueryVersion,req);
- req->reqType = dmxScreen->glxMajorOpcode;
- req->glxCode = X_GLXQueryVersion;
- req->majorVersion = GLX_SERVER_MAJOR_VERSION;
- req->minorVersion = GLX_SERVER_MINOR_VERSION;
- _XReply(dpy, (xReply*) &reply, 0, False);
- UnlockDisplay(dpy);
- SyncHandle();
-
- if (s == 0) {
- __glXVersionMajor = reply.majorVersion;
- __glXVersionMinor = reply.minorVersion;
- }
- else {
- if (reply.majorVersion < __glXVersionMajor) {
- __glXVersionMajor = reply.majorVersion;
- __glXVersionMinor = reply.minorVersion;
- }
- else if ( (reply.majorVersion == __glXVersionMajor) &&
- (reply.minorVersion < __glXVersionMinor) ) {
- __glXVersionMinor = reply.minorVersion;
- }
- }
-
- }
-
- if (GLX_SERVER_MAJOR_VERSION < __glXVersionMajor) {
- __glXVersionMajor = GLX_SERVER_MAJOR_VERSION;
- __glXVersionMinor = GLX_SERVER_MINOR_VERSION;
- }
- else if ( (GLX_SERVER_MAJOR_VERSION == __glXVersionMajor) &&
- (GLX_SERVER_MINOR_VERSION < __glXVersionMinor) ) {
- __glXVersionMinor = GLX_SERVER_MINOR_VERSION;
- }
-
- snprintf(GLXServerVersion, sizeof(GLXServerVersion),
+ int s;
+ xGLXQueryVersionReq *req;
+ xGLXQueryVersionReply reply;
+ char **be_extensions;
+ char *ext;
+ char *denied_extensions;
+
+ /*
+ * set the server glx version to be the minimum version
+ * supported by all back-end servers
+ */
+ __glXVersionMajor = 0;
+ __glXVersionMinor = 0;
+ for (s = 0; s < __glXNumActiveScreens; s++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[s];
+ Display *dpy = dmxScreen->beDisplay;
+
+ /* Send the glXQueryVersion request */
+ LockDisplay(dpy);
+ GetReq(GLXQueryVersion, req);
+ req->reqType = dmxScreen->glxMajorOpcode;
+ req->glxCode = X_GLXQueryVersion;
+ req->majorVersion = GLX_SERVER_MAJOR_VERSION;
+ req->minorVersion = GLX_SERVER_MINOR_VERSION;
+ _XReply(dpy, (xReply *) & reply, 0, False);
+ UnlockDisplay(dpy);
+ SyncHandle();
+
+ if (s == 0) {
+ __glXVersionMajor = reply.majorVersion;
+ __glXVersionMinor = reply.minorVersion;
+ }
+ else {
+ if (reply.majorVersion < __glXVersionMajor) {
+ __glXVersionMajor = reply.majorVersion;
+ __glXVersionMinor = reply.minorVersion;
+ }
+ else if ((reply.majorVersion == __glXVersionMajor) &&
+ (reply.minorVersion < __glXVersionMinor)) {
+ __glXVersionMinor = reply.minorVersion;
+ }
+ }
+
+ }
+
+ if (GLX_SERVER_MAJOR_VERSION < __glXVersionMajor) {
+ __glXVersionMajor = GLX_SERVER_MAJOR_VERSION;
+ __glXVersionMinor = GLX_SERVER_MINOR_VERSION;
+ }
+ else if ((GLX_SERVER_MAJOR_VERSION == __glXVersionMajor) &&
+ (GLX_SERVER_MINOR_VERSION < __glXVersionMinor)) {
+ __glXVersionMinor = GLX_SERVER_MINOR_VERSION;
+ }
+
+ snprintf(GLXServerVersion, sizeof(GLXServerVersion),
"%d.%d DMX %d back-end server(s)",
- __glXVersionMajor, __glXVersionMinor, __glXNumActiveScreens );
- /*
- * set the ExtensionsString to the minimum extensions string
- */
- ExtensionsString[0] = '\0';
-
- /*
- * read extensions strings of all back-end servers
- */
- be_extensions = (char **)malloc( __glXNumActiveScreens * sizeof(char *) );
- if (!be_extensions)
- return;
-
- for (s=0; s<__glXNumActiveScreens; s++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[s];
- Display *dpy = dmxScreen->beDisplay;
- xGLXQueryServerStringReq *req;
- xGLXQueryServerStringReply reply;
- int length, numbytes, slop;
-
- /* Send the glXQueryServerString request */
- LockDisplay(dpy);
- GetReq(GLXQueryServerString,req);
- req->reqType = dmxScreen->glxMajorOpcode;
- req->glxCode = X_GLXQueryServerString;
- req->screen = DefaultScreen(dpy);
- req->name = GLX_EXTENSIONS;
- _XReply(dpy, (xReply*) &reply, 0, False);
-
- length = (int)reply.length;
- numbytes = (int)reply.n;
- slop = numbytes * __GLX_SIZE_INT8 & 3;
- be_extensions[s] = (char *)malloc(numbytes);
- if (!be_extensions[s]) {
- /* Throw data on the floor */
- _XEatData(dpy, length);
- } else {
- _XRead(dpy, (char *)be_extensions[s], numbytes);
- if (slop) _XEatData(dpy,4-slop);
- }
- UnlockDisplay(dpy);
- SyncHandle();
- }
-
- /*
- * extensions string will include only extensions that our
- * server supports as well as all back-end servers supports.
- * extensions that are in the DMX_DENY_EXTENSIONS string will
- * not be supported.
- */
- denied_extensions = getenv("DMX_DENY_GLX_EXTENSIONS");
- ext = strtok(GLXServerExtensions, " ");
- while( ext ) {
- int supported = 1;
-
- if (denied_extensions && strstr(denied_extensions, ext)) {
- supported = 0;
- }
- else {
- for (s=0; s<__glXNumActiveScreens && supported; s++) {
- if ( !strstr(be_extensions[s], ext) ) {
- supported = 0;
- }
- }
- }
-
- if (supported) {
- strcat(ExtensionsString, ext);
- strcat(ExtensionsString, " ");
- }
-
- ext = strtok(NULL, " ");
- }
-
- /*
- * release temporary storage
- */
- for (s=0; s<__glXNumActiveScreens; s++) {
- free(be_extensions[s]);
- }
- free( be_extensions );
-
- if (dmxGLXSwapGroupSupport) {
- if (!denied_extensions ||
- !strstr(denied_extensions, "GLX_SGIX_swap_group")) {
- strcat(ExtensionsString, "GLX_SGIX_swap_group");
- if (!denied_extensions ||
- !strstr(denied_extensions, "GLX_SGIX_swap_barrier")) {
- strcat(ExtensionsString, " GLX_SGIX_swap_barrier");
- }
- }
- }
+ __glXVersionMajor, __glXVersionMinor, __glXNumActiveScreens);
+ /*
+ * set the ExtensionsString to the minimum extensions string
+ */
+ ExtensionsString[0] = '\0';
+
+ /*
+ * read extensions strings of all back-end servers
+ */
+ be_extensions = (char **) malloc(__glXNumActiveScreens * sizeof(char *));
+ if (!be_extensions)
+ return;
+
+ for (s = 0; s < __glXNumActiveScreens; s++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[s];
+ Display *dpy = dmxScreen->beDisplay;
+ xGLXQueryServerStringReq *req;
+ xGLXQueryServerStringReply reply;
+ int length, numbytes, slop;
+
+ /* Send the glXQueryServerString request */
+ LockDisplay(dpy);
+ GetReq(GLXQueryServerString, req);
+ req->reqType = dmxScreen->glxMajorOpcode;
+ req->glxCode = X_GLXQueryServerString;
+ req->screen = DefaultScreen(dpy);
+ req->name = GLX_EXTENSIONS;
+ _XReply(dpy, (xReply *) & reply, 0, False);
+
+ length = (int) reply.length;
+ numbytes = (int) reply.n;
+ slop = numbytes * __GLX_SIZE_INT8 & 3;
+ be_extensions[s] = (char *) malloc(numbytes);
+ if (!be_extensions[s]) {
+ /* Throw data on the floor */
+ _XEatData(dpy, length);
+ }
+ else {
+ _XRead(dpy, (char *) be_extensions[s], numbytes);
+ if (slop)
+ _XEatData(dpy, 4 - slop);
+ }
+ UnlockDisplay(dpy);
+ SyncHandle();
+ }
+
+ /*
+ * extensions string will include only extensions that our
+ * server supports as well as all back-end servers supports.
+ * extensions that are in the DMX_DENY_EXTENSIONS string will
+ * not be supported.
+ */
+ denied_extensions = getenv("DMX_DENY_GLX_EXTENSIONS");
+ ext = strtok(GLXServerExtensions, " ");
+ while (ext) {
+ int supported = 1;
+
+ if (denied_extensions && strstr(denied_extensions, ext)) {
+ supported = 0;
+ }
+ else {
+ for (s = 0; s < __glXNumActiveScreens && supported; s++) {
+ if (!strstr(be_extensions[s], ext)) {
+ supported = 0;
+ }
+ }
+ }
+
+ if (supported) {
+ strcat(ExtensionsString, ext);
+ strcat(ExtensionsString, " ");
+ }
+
+ ext = strtok(NULL, " ");
+ }
+
+ /*
+ * release temporary storage
+ */
+ for (s = 0; s < __glXNumActiveScreens; s++) {
+ free(be_extensions[s]);
+ }
+ free(be_extensions);
+
+ if (dmxGLXSwapGroupSupport) {
+ if (!denied_extensions ||
+ !strstr(denied_extensions, "GLX_SGIX_swap_group")) {
+ strcat(ExtensionsString, "GLX_SGIX_swap_group");
+ if (!denied_extensions ||
+ !strstr(denied_extensions, "GLX_SGIX_swap_barrier")) {
+ strcat(ExtensionsString, " GLX_SGIX_swap_barrier");
+ }
+ }
+ }
}
-void __glXScreenInit(GLint numscreens)
+void
+__glXScreenInit(GLint numscreens)
{
- int s;
- int c;
- DMXScreenInfo *dmxScreen0 = &dmxScreens[0];
- __glXNumActiveScreens = numscreens;
-
+ int s;
+ int c;
+ DMXScreenInfo *dmxScreen0 = &dmxScreens[0];
- CalcServerVersionAndExtensions();
+ __glXNumActiveScreens = numscreens;
+ CalcServerVersionAndExtensions();
- __glXFBConfigs = NULL;
- __glXNumFBConfigs = 0;
+ __glXFBConfigs = NULL;
+ __glXNumFBConfigs = 0;
- if ( (__glXVersionMajor == 1 && __glXVersionMinor >= 3) ||
+ if ((__glXVersionMajor == 1 && __glXVersionMinor >= 3) ||
(__glXVersionMajor > 1) ||
- ( strstr(ExtensionsString, "GLX_SGIX_fbconfig") ) ) {
-
- /*
- // Initialize FBConfig info.
- // find the set of FBConfigs that are present on all back-end
- // servers - only those configs will be supported
- */
- __glXFBConfigs = (__GLXFBConfig **)malloc( dmxScreen0->numFBConfigs *
- (numscreens+1) * sizeof(__GLXFBConfig *) );
- __glXNumFBConfigs = 0;
-
- for (c=0; c<dmxScreen0->numFBConfigs; c++) {
- __GLXFBConfig *cfg = NULL;
-
- if (numscreens > 1) {
- for (s=1; s<numscreens; s++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[s];
-
- cfg = FindMatchingFBConfig( &dmxScreen0->fbconfigs[c],
- dmxScreen->fbconfigs,
- dmxScreen->numFBConfigs );
- __glXFBConfigs[ __glXNumFBConfigs * (numscreens+1) + s + 1 ] = cfg;
- if (!cfg) {
- dmxLog(dmxInfo,"screen0 FBConfig 0x%x is missing on screen#%d\n", dmxScreen0->fbconfigs[c].id, s);
- break;
- }
- else {
- dmxLog(dmxInfo,"screen0 FBConfig 0x%x matched to 0x%x on screen#%d\n", dmxScreen0->fbconfigs[c].id, cfg->id, s);
- }
- }
- }
- else {
- cfg = &dmxScreen0->fbconfigs[c];
- }
-
- if (cfg) {
-
- /* filter out overlay visuals */
- if (cfg->level == 0) {
- __GLXFBConfig *proxy_cfg;
-
- __glXFBConfigs[ __glXNumFBConfigs * (numscreens+1) + 1 ] =
- &dmxScreen0->fbconfigs[c];
-
- proxy_cfg = malloc( sizeof(__GLXFBConfig) );
- memcpy( proxy_cfg, cfg, sizeof(__GLXFBConfig) );
- proxy_cfg->id = FakeClientID(0);
- /* visual will be associated later in __glXGetFBConfigs */
- proxy_cfg->associatedVisualId = (unsigned int)-1;
-
- __glXFBConfigs[ __glXNumFBConfigs * (numscreens+1) + 0 ] = proxy_cfg;
-
- __glXNumFBConfigs++;
- }
-
- }
-
- }
+ (strstr(ExtensionsString, "GLX_SGIX_fbconfig"))) {
+
+ /*
+ // Initialize FBConfig info.
+ // find the set of FBConfigs that are present on all back-end
+ // servers - only those configs will be supported
+ */
+ __glXFBConfigs = (__GLXFBConfig **) malloc(dmxScreen0->numFBConfigs *
+ (numscreens +
+ 1) *
+ sizeof(__GLXFBConfig *));
+ __glXNumFBConfigs = 0;
+
+ for (c = 0; c < dmxScreen0->numFBConfigs; c++) {
+ __GLXFBConfig *cfg = NULL;
+
+ if (numscreens > 1) {
+ for (s = 1; s < numscreens; s++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[s];
+
+ cfg = FindMatchingFBConfig(&dmxScreen0->fbconfigs[c],
+ dmxScreen->fbconfigs,
+ dmxScreen->numFBConfigs);
+ __glXFBConfigs[__glXNumFBConfigs * (numscreens + 1) + s +
+ 1] = cfg;
+ if (!cfg) {
+ dmxLog(dmxInfo,
+ "screen0 FBConfig 0x%x is missing on screen#%d\n",
+ dmxScreen0->fbconfigs[c].id, s);
+ break;
+ }
+ else {
+ dmxLog(dmxInfo,
+ "screen0 FBConfig 0x%x matched to 0x%x on screen#%d\n",
+ dmxScreen0->fbconfigs[c].id, cfg->id, s);
+ }
+ }
+ }
+ else {
+ cfg = &dmxScreen0->fbconfigs[c];
+ }
+
+ if (cfg) {
+
+ /* filter out overlay visuals */
+ if (cfg->level == 0) {
+ __GLXFBConfig *proxy_cfg;
+
+ __glXFBConfigs[__glXNumFBConfigs * (numscreens + 1) + 1] =
+ &dmxScreen0->fbconfigs[c];
+
+ proxy_cfg = malloc(sizeof(__GLXFBConfig));
+ memcpy(proxy_cfg, cfg, sizeof(__GLXFBConfig));
+ proxy_cfg->id = FakeClientID(0);
+ /* visual will be associated later in __glXGetFBConfigs */
+ proxy_cfg->associatedVisualId = (unsigned int) -1;
+
+ __glXFBConfigs[__glXNumFBConfigs * (numscreens + 1) + 0] =
+ proxy_cfg;
+
+ __glXNumFBConfigs++;
+ }
+
+ }
+
+ }
}
}
-void __glXScreenReset(void)
+void
+__glXScreenReset(void)
{
- __glXNumActiveScreens = 0;
+ __glXNumActiveScreens = 0;
}
-char *__glXGetServerString( unsigned int name )
+char *
+__glXGetServerString(unsigned int name)
{
- char *ret = NULL;
+ char *ret = NULL;
- switch( name) {
+ switch (name) {
- case GLX_VENDOR:
- ret = GLXServerVendorName;
- break;
+ case GLX_VENDOR:
+ ret = GLXServerVendorName;
+ break;
- case GLX_VERSION:
- ret = GLXServerVersion;
- break;
+ case GLX_VERSION:
+ ret = GLXServerVersion;
+ break;
- case GLX_EXTENSIONS:
- ret = ExtensionsString;
- break;
+ case GLX_EXTENSIONS:
+ ret = ExtensionsString;
+ break;
- default:
- break;
- }
+ default:
+ break;
+ }
- return ret;
+ return ret;
}
-int glxIsExtensionSupported( char *ext )
+int
+glxIsExtensionSupported(char *ext)
{
- return( strstr(ExtensionsString, ext) != NULL );
+ return (strstr(ExtensionsString, ext) != NULL);
}
diff --git a/hw/dmx/glxProxy/glxscreens.h b/hw/dmx/glxProxy/glxscreens.h
index da50bdc85..a9fe2a9db 100644
--- a/hw/dmx/glxProxy/glxscreens.h
+++ b/hw/dmx/glxProxy/glxscreens.h
@@ -33,8 +33,6 @@
#include "GL/internal/glcore.h"
-
-
typedef struct {
__GLXvisualConfig *pGlxVisual;
@@ -47,10 +45,9 @@ typedef struct {
} __GLXscreenInfo;
-
extern void __glXScreenInit(GLint);
extern void __glXScreenReset(void);
-extern char *__glXGetServerString( unsigned int name );
+extern char *__glXGetServerString(unsigned int name);
-#endif /* !__GLX_screens_h__ */
+#endif /* !__GLX_screens_h__ */
diff --git a/hw/dmx/glxProxy/glxserver.h b/hw/dmx/glxProxy/glxserver.h
index 03e95b865..ad9496619 100644
--- a/hw/dmx/glxProxy/glxserver.h
+++ b/hw/dmx/glxProxy/glxserver.h
@@ -41,8 +41,7 @@
#include <resource.h>
#include <scrnintstr.h>
-
-#define GL_GLEXT_PROTOTYPES /* we want prototypes */
+#define GL_GLEXT_PROTOTYPES /* we want prototypes */
#include <GL/gl.h>
#include <GL/glxproto.h>
#include <GL/glxint.h>
@@ -52,7 +51,6 @@
#include "glxcontext.h"
#include "glxerror.h"
-
#define GLX_SERVER_MAJOR_VERSION 1
#define GLX_SERVER_MINOR_VERSION 3
@@ -84,14 +82,15 @@ extern GLint __glXNumActiveScreens;
** The last context used (from the server's persective) is cached.
*/
extern __GLXcontext *__glXLastContext;
-extern __GLXcontext *__glXForceCurrent(__GLXclientState*, GLXContextTag, int*);
+extern __GLXcontext *__glXForceCurrent(__GLXclientState *, GLXContextTag,
+ int *);
/************************************************************************/
typedef struct {
- int elem_size; /* element size in bytes */
- int nelems; /* number of elements to swap */
- void (*swapfunc)(GLbyte *pc);
+ int elem_size; /* element size in bytes */
+ int nelems; /* number of elements to swap */
+ void (*swapfunc) (GLbyte * pc);
} __GLXRenderSwapInfo;
/*
@@ -99,20 +98,20 @@ typedef struct {
*/
struct __GLXclientStateRec {
/*
- ** Whether this structure is currently being used to support a client.
- */
+ ** Whether this structure is currently being used to support a client.
+ */
Bool inUse;
/*
- ** Buffer for returned data.
- */
+ ** Buffer for returned data.
+ */
GLbyte *returnBuf;
GLint returnBufSize;
/*
- ** Keep a list of all the contexts that are current for this client's
- ** threads.
- */
+ ** Keep a list of all the contexts that are current for this client's
+ ** threads.
+ */
__GLXcontext **currentContexts;
DrawablePtr *currentDrawables;
GLint numCurrentContexts;
@@ -124,18 +123,18 @@ struct __GLXclientStateRec {
int GLClientminorVersion;
char *GLClientextensions;
- GLXContextTag *be_currentCTag;
+ GLXContextTag *be_currentCTag;
Display **be_displays;
/*
- ** Keep track of large rendering commands, which span multiple requests.
- */
- GLint largeCmdBytesSoFar; /* bytes received so far */
- GLint largeCmdBytesTotal; /* total bytes expected */
- GLint largeCmdRequestsSoFar; /* requests received so far */
- GLint largeCmdRequestsTotal; /* total requests expected */
- void (*largeCmdRequestsSwapProc)(GLbyte *);
- __GLXRenderSwapInfo *largeCmdRequestsSwap_info;
+ ** Keep track of large rendering commands, which span multiple requests.
+ */
+ GLint largeCmdBytesSoFar; /* bytes received so far */
+ GLint largeCmdBytesTotal; /* total bytes expected */
+ GLint largeCmdRequestsSoFar; /* requests received so far */
+ GLint largeCmdRequestsTotal; /* total requests expected */
+ void (*largeCmdRequestsSwapProc) (GLbyte *);
+ __GLXRenderSwapInfo *largeCmdRequestsSwap_info;
GLbyte *largeCmdBuf;
GLint largeCmdBufSize;
GLint largeCmdMaxReqDataSize;
@@ -149,9 +148,9 @@ extern __GLXclientState *__glXClients[];
/*
** Dispatch tables.
*/
-typedef void (*__GLXdispatchRenderProcPtr)(GLbyte *);
-typedef int (*__GLXdispatchSingleProcPtr)(__GLXclientState *, GLbyte *);
-typedef int (*__GLXdispatchVendorPrivProcPtr)(__GLXclientState *, GLbyte *);
+typedef void (*__GLXdispatchRenderProcPtr) (GLbyte *);
+typedef int (*__GLXdispatchSingleProcPtr) (__GLXclientState *, GLbyte *);
+typedef int (*__GLXdispatchVendorPrivProcPtr) (__GLXclientState *, GLbyte *);
extern __GLXdispatchSingleProcPtr __glXSingleTable[];
extern __GLXdispatchVendorPrivProcPtr __glXVendorPrivTable_EXT[];
extern __GLXdispatchSingleProcPtr __glXSwapSingleTable[];
@@ -163,7 +162,7 @@ extern __GLXRenderSwapInfo __glXSwapRenderTable_EXT[];
/*
* Dispatch for GLX commands.
*/
-typedef int (*__GLXprocPtr)(__GLXclientState *, char *pc);
+typedef int (*__GLXprocPtr) (__GLXclientState *, char *pc);
extern __GLXprocPtr __glXProcTable[];
/*
@@ -171,7 +170,7 @@ extern __GLXprocPtr __glXProcTable[];
*/
typedef struct {
int bytes;
- int (*varsize)(GLbyte *pc, Bool swap);
+ int (*varsize) (GLbyte * pc, Bool swap);
} __GLXrenderSizeData;
extern __GLXrenderSizeData __glXRenderSizeTable[];
extern __GLXrenderSizeData __glXRenderSizeTable_EXT[];
@@ -194,37 +193,38 @@ extern RESTYPE __glXPbufferRes;
** Prototypes.
*/
-
extern char *__glXcombine_strings(const char *, const char *);
-extern void __glXDisp_DrawArrays(GLbyte*);
-extern void __glXDispSwap_DrawArrays(GLbyte*);
-
+extern void __glXDisp_DrawArrays(GLbyte *);
+extern void __glXDispSwap_DrawArrays(GLbyte *);
/*
** Routines for sending swapped replies.
*/
-extern void __glXSwapMakeCurrentReply(ClientPtr client,
- xGLXMakeCurrentReadSGIReply *reply);
+extern void __glXSwapMakeCurrentReply(ClientPtr client,
+ xGLXMakeCurrentReadSGIReply * reply);
-extern void __glXSwapIsDirectReply(ClientPtr client,
- xGLXIsDirectReply *reply);
+extern void __glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply * reply);
extern void __glXSwapQueryVersionReply(ClientPtr client,
- xGLXQueryVersionReply *reply);
+ xGLXQueryVersionReply * reply);
extern void __glXSwapQueryContextInfoEXTReply(ClientPtr client,
- xGLXQueryContextInfoEXTReply *reply,
- int *buf);
+ xGLXQueryContextInfoEXTReply *
+ reply, int *buf);
extern void glxSwapQueryExtensionsStringReply(ClientPtr client,
- xGLXQueryExtensionsStringReply *reply, char *buf);
+ xGLXQueryExtensionsStringReply *
+ reply, char *buf);
extern void glxSwapQueryServerStringReply(ClientPtr client,
- xGLXQueryServerStringReply *reply, char *buf);
+ xGLXQueryServerStringReply * reply,
+ char *buf);
extern void __glXSwapQueryContextReply(ClientPtr client,
- xGLXQueryContextReply *reply, int *buf);
+ xGLXQueryContextReply * reply, int *buf);
extern void __glXSwapGetDrawableAttributesReply(ClientPtr client,
- xGLXGetDrawableAttributesReply *reply, int *buf);
+ xGLXGetDrawableAttributesReply *
+ reply, int *buf);
extern void __glXSwapQueryMaxSwapBarriersSGIXReply(ClientPtr client,
- xGLXQueryMaxSwapBarriersSGIXReply *reply);
+ xGLXQueryMaxSwapBarriersSGIXReply
+ * reply);
/*
* Routines for computing the size of variably-sized rendering commands.
@@ -232,55 +232,54 @@ extern void __glXSwapQueryMaxSwapBarriersSGIXReply(ClientPtr client,
extern int __glXTypeSize(GLenum enm);
extern int __glXImageSize(GLenum format, GLenum type, GLsizei w, GLsizei h,
- GLint rowLength, GLint skipRows, GLint alignment);
+ GLint rowLength, GLint skipRows, GLint alignment);
extern int __glXImage3DSize(GLenum format, GLenum type,
- GLsizei w, GLsizei h, GLsizei d,
- GLint imageHeight, GLint rowLength,
- GLint skipImages, GLint skipRows,
- GLint alignment);
-
-extern int __glXCallListsReqSize(GLbyte *pc, Bool swap);
-extern int __glXBitmapReqSize(GLbyte *pc, Bool swap);
-extern int __glXFogfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXFogivReqSize(GLbyte *pc, Bool swap);
-extern int __glXLightfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXLightivReqSize(GLbyte *pc, Bool swap);
-extern int __glXLightModelfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXLightModelivReqSize(GLbyte *pc, Bool swap);
-extern int __glXMaterialfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXMaterialivReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexParameterfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexParameterivReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexImage1DReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexImage2DReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexEnvfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexEnvivReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexGendvReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexGenfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexGenivReqSize(GLbyte *pc, Bool swap);
-extern int __glXMap1dReqSize(GLbyte *pc, Bool swap);
-extern int __glXMap1fReqSize(GLbyte *pc, Bool swap);
-extern int __glXMap2dReqSize(GLbyte *pc, Bool swap);
-extern int __glXMap2fReqSize(GLbyte *pc, Bool swap);
-extern int __glXPixelMapfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXPixelMapuivReqSize(GLbyte *pc, Bool swap);
-extern int __glXPixelMapusvReqSize(GLbyte *pc, Bool swap);
-extern int __glXDrawPixelsReqSize(GLbyte *pc, Bool swap);
-extern int __glXDrawArraysSize(GLbyte *pc, Bool swap);
-extern int __glXPrioritizeTexturesReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexSubImage1DReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexSubImage2DReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexImage3DReqSize(GLbyte *pc, Bool swap );
-extern int __glXTexSubImage3DReqSize(GLbyte *pc, Bool swap);
-extern int __glXConvolutionFilter1DReqSize(GLbyte *pc, Bool swap);
-extern int __glXConvolutionFilter2DReqSize(GLbyte *pc, Bool swap);
-extern int __glXConvolutionParameterivReqSize(GLbyte *pc, Bool swap);
-extern int __glXConvolutionParameterfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXSeparableFilter2DReqSize(GLbyte *pc, Bool swap);
-extern int __glXColorTableReqSize(GLbyte *pc, Bool swap);
-extern int __glXColorSubTableReqSize(GLbyte *pc, Bool swap);
-extern int __glXColorTableParameterfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXColorTableParameterivReqSize(GLbyte *pc, Bool swap);
+ GLsizei w, GLsizei h, GLsizei d,
+ GLint imageHeight, GLint rowLength,
+ GLint skipImages, GLint skipRows, GLint alignment);
+
+extern int __glXCallListsReqSize(GLbyte * pc, Bool swap);
+extern int __glXBitmapReqSize(GLbyte * pc, Bool swap);
+extern int __glXFogfvReqSize(GLbyte * pc, Bool swap);
+extern int __glXFogivReqSize(GLbyte * pc, Bool swap);
+extern int __glXLightfvReqSize(GLbyte * pc, Bool swap);
+extern int __glXLightivReqSize(GLbyte * pc, Bool swap);
+extern int __glXLightModelfvReqSize(GLbyte * pc, Bool swap);
+extern int __glXLightModelivReqSize(GLbyte * pc, Bool swap);
+extern int __glXMaterialfvReqSize(GLbyte * pc, Bool swap);
+extern int __glXMaterialivReqSize(GLbyte * pc, Bool swap);
+extern int __glXTexParameterfvReqSize(GLbyte * pc, Bool swap);
+extern int __glXTexParameterivReqSize(GLbyte * pc, Bool swap);
+extern int __glXTexImage1DReqSize(GLbyte * pc, Bool swap);
+extern int __glXTexImage2DReqSize(GLbyte * pc, Bool swap);
+extern int __glXTexEnvfvReqSize(GLbyte * pc, Bool swap);
+extern int __glXTexEnvivReqSize(GLbyte * pc, Bool swap);
+extern int __glXTexGendvReqSize(GLbyte * pc, Bool swap);
+extern int __glXTexGenfvReqSize(GLbyte * pc, Bool swap);
+extern int __glXTexGenivReqSize(GLbyte * pc, Bool swap);
+extern int __glXMap1dReqSize(GLbyte * pc, Bool swap);
+extern int __glXMap1fReqSize(GLbyte * pc, Bool swap);
+extern int __glXMap2dReqSize(GLbyte * pc, Bool swap);
+extern int __glXMap2fReqSize(GLbyte * pc, Bool swap);
+extern int __glXPixelMapfvReqSize(GLbyte * pc, Bool swap);
+extern int __glXPixelMapuivReqSize(GLbyte * pc, Bool swap);
+extern int __glXPixelMapusvReqSize(GLbyte * pc, Bool swap);
+extern int __glXDrawPixelsReqSize(GLbyte * pc, Bool swap);
+extern int __glXDrawArraysSize(GLbyte * pc, Bool swap);
+extern int __glXPrioritizeTexturesReqSize(GLbyte * pc, Bool swap);
+extern int __glXTexSubImage1DReqSize(GLbyte * pc, Bool swap);
+extern int __glXTexSubImage2DReqSize(GLbyte * pc, Bool swap);
+extern int __glXTexImage3DReqSize(GLbyte * pc, Bool swap);
+extern int __glXTexSubImage3DReqSize(GLbyte * pc, Bool swap);
+extern int __glXConvolutionFilter1DReqSize(GLbyte * pc, Bool swap);
+extern int __glXConvolutionFilter2DReqSize(GLbyte * pc, Bool swap);
+extern int __glXConvolutionParameterivReqSize(GLbyte * pc, Bool swap);
+extern int __glXConvolutionParameterfvReqSize(GLbyte * pc, Bool swap);
+extern int __glXSeparableFilter2DReqSize(GLbyte * pc, Bool swap);
+extern int __glXColorTableReqSize(GLbyte * pc, Bool swap);
+extern int __glXColorSubTableReqSize(GLbyte * pc, Bool swap);
+extern int __glXColorTableParameterfvReqSize(GLbyte * pc, Bool swap);
+extern int __glXColorTableParameterivReqSize(GLbyte * pc, Bool swap);
/*
* Routines for computing the size of returned data.
@@ -290,8 +289,8 @@ extern int __glXConvolutionParameterfvSize(GLenum pname);
extern int __glXColorTableParameterfvSize(GLenum pname);
extern int __glXColorTableParameterivSize(GLenum pname);
-extern void __glXFreeGLXWindow(__glXWindow *pGlxWindow);
-extern void __glXFreeGLXPbuffer(__glXPbuffer *pGlxPbuffer);
+extern void __glXFreeGLXWindow(__glXWindow * pGlxWindow);
+extern void __glXFreeGLXPbuffer(__glXPbuffer * pGlxPbuffer);
extern int __glXVersionMajor;
extern int __glXVersionMinor;
@@ -300,4 +299,4 @@ extern int __glXVersionMinor;
( (__glXVersionMajor > (major)) || \
((__glXVersionMajor == (major)) && (__glXVersionMinor >= (minor))) )
-#endif /* !__GLX_server_h__ */
+#endif /* !__GLX_server_h__ */
diff --git a/hw/dmx/glxProxy/glxsingle.c b/hw/dmx/glxProxy/glxsingle.c
index 33cc612a7..63786cf79 100644
--- a/hw/dmx/glxProxy/glxsingle.c
+++ b/hw/dmx/glxProxy/glxsingle.c
@@ -68,7 +68,7 @@
dpy->bufptr += SIZEOF(x##name##Req);\
dpy->request++
-#else /* non-ANSI C uses empty comment instead of "##" for token concatenation */
+#else /* non-ANSI C uses empty comment instead of "##" for token concatenation */
#define GetReqSingle(name, req) \
WORD64ALIGN\
if ((dpy->bufptr + SIZEOF(x/**/name/**/Req)) > dpy->bufmax)\
@@ -79,100 +79,101 @@
dpy->request++
#endif
-#define X_GLXSingle 0 /* needed by GetReqExtra */
+#define X_GLXSingle 0 /* needed by GetReqExtra */
-extern Display *GetBackEndDisplay( __GLXclientState *cl, int s );
-extern int GetCurrentBackEndTag(__GLXclientState *cl, GLXContextTag tag, int s);
+extern Display *GetBackEndDisplay(__GLXclientState * cl, int s);
+extern int GetCurrentBackEndTag(__GLXclientState * cl, GLXContextTag tag,
+ int s);
static int swap_vec_element_size = 0;
-static void SendSwappedReply( ClientPtr client,
- xGLXSingleReply *reply,
- char *buf,
- int buf_size )
+static void
+SendSwappedReply(ClientPtr client,
+ xGLXSingleReply * reply, char *buf, int buf_size)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_SHORT(&reply->sequenceNumber);
- __GLX_SWAP_INT(&reply->length);
- __GLX_SWAP_INT(&reply->retval);
- __GLX_SWAP_INT(&reply->size);
-
- if ( (buf_size == 0) && (swap_vec_element_size > 0) ) {
- /*
- * the reply has single component - need to swap pad3
- */
- if (swap_vec_element_size == 2) {
- __GLX_SWAP_SHORT(&reply->pad3);
- }
- else if (swap_vec_element_size == 4) {
- __GLX_SWAP_INT(&reply->pad3);
- __GLX_SWAP_INT(&reply->pad4); /* some requests use also pad4
- * i.e GetConvolutionFilter
- */
- }
- else if (swap_vec_element_size == 8) {
- __GLX_SWAP_DOUBLE(&reply->pad3);
- }
- }
- else if ( (buf_size > 0) && (swap_vec_element_size > 0) ) {
- /*
- * the reply has vector of elements which needs to be swapped
- */
- int vsize = buf_size / swap_vec_element_size;
- char *p = buf;
- int i;
-
- for (i=0; i<vsize; i++) {
- if (swap_vec_element_size == 2) {
- __GLX_SWAP_SHORT(p);
- }
- else if (swap_vec_element_size == 4) {
- __GLX_SWAP_INT(p);
- }
- else if (swap_vec_element_size == 8) {
- __GLX_SWAP_DOUBLE(p);
- }
-
- p += swap_vec_element_size;
- }
-
- /*
- * swap pad words as well - for case that some single reply uses
- * them as well
- */
- __GLX_SWAP_INT(&reply->pad3);
- __GLX_SWAP_INT(&reply->pad4);
- __GLX_SWAP_INT(&reply->pad5);
- __GLX_SWAP_INT(&reply->pad6);
-
- }
-
- WriteToClient(client, sizeof(xGLXSingleReply),(char *)reply);
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_SWAP_SHORT(&reply->sequenceNumber);
+ __GLX_SWAP_INT(&reply->length);
+ __GLX_SWAP_INT(&reply->retval);
+ __GLX_SWAP_INT(&reply->size);
+
+ if ((buf_size == 0) && (swap_vec_element_size > 0)) {
+ /*
+ * the reply has single component - need to swap pad3
+ */
+ if (swap_vec_element_size == 2) {
+ __GLX_SWAP_SHORT(&reply->pad3);
+ }
+ else if (swap_vec_element_size == 4) {
+ __GLX_SWAP_INT(&reply->pad3);
+ __GLX_SWAP_INT(&reply->pad4); /* some requests use also pad4
+ * i.e GetConvolutionFilter
+ */
+ }
+ else if (swap_vec_element_size == 8) {
+ __GLX_SWAP_DOUBLE(&reply->pad3);
+ }
+ }
+ else if ((buf_size > 0) && (swap_vec_element_size > 0)) {
+ /*
+ * the reply has vector of elements which needs to be swapped
+ */
+ int vsize = buf_size / swap_vec_element_size;
+ char *p = buf;
+ int i;
+
+ for (i = 0; i < vsize; i++) {
+ if (swap_vec_element_size == 2) {
+ __GLX_SWAP_SHORT(p);
+ }
+ else if (swap_vec_element_size == 4) {
+ __GLX_SWAP_INT(p);
+ }
+ else if (swap_vec_element_size == 8) {
+ __GLX_SWAP_DOUBLE(p);
+ }
+
+ p += swap_vec_element_size;
+ }
+
+ /*
+ * swap pad words as well - for case that some single reply uses
+ * them as well
+ */
+ __GLX_SWAP_INT(&reply->pad3);
+ __GLX_SWAP_INT(&reply->pad4);
+ __GLX_SWAP_INT(&reply->pad5);
+ __GLX_SWAP_INT(&reply->pad6);
+
+ }
+
+ WriteToClient(client, sizeof(xGLXSingleReply), (char *) reply);
if (buf_size > 0)
- WriteToClient(client, buf_size, (char *)buf);
+ WriteToClient(client, buf_size, (char *) buf);
}
-int __glXForwardSingleReq( __GLXclientState *cl, GLbyte *pc )
+int
+__glXForwardSingleReq(__GLXclientState * cl, GLbyte * pc)
{
- xGLXSingleReq *req = (xGLXSingleReq *)pc;
- xGLXSingleReq *be_req;
+ xGLXSingleReq *req = (xGLXSingleReq *) pc;
+ xGLXSingleReq *be_req;
__GLXcontext *glxc;
- int from_screen = 0;
- int to_screen = 0;
- int buf_size;
- int s;
+ int from_screen = 0;
+ int to_screen = 0;
+ int buf_size;
+ int s;
glxc = __glXLookupContextByTag(cl, req->contextTag);
if (!glxc) {
- return 0;
+ return 0;
}
from_screen = to_screen = glxc->pScreen->myNum;
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
- from_screen = 0;
- to_screen = screenInfo.numScreens - 1;
+ from_screen = 0;
+ to_screen = screenInfo.numScreens - 1;
}
#endif
@@ -182,47 +183,48 @@ int __glXForwardSingleReq( __GLXclientState *cl, GLbyte *pc )
/*
* just forward the request to back-end server(s)
*/
- for (s=from_screen; s<=to_screen; s++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[s];
- Display *dpy = GetBackEndDisplay(cl,s);
-
- LockDisplay(dpy);
- GetReqSingle(GLXSingle,be_req);
- be_req->reqType = dmxScreen->glxMajorOpcode;
- be_req->glxCode = req->glxCode;
- be_req->length = req->length;
- be_req->contextTag = GetCurrentBackEndTag(cl,req->contextTag,s);
- if (buf_size > 0)
- _XSend(dpy, (const char *)pc, buf_size);
- UnlockDisplay(dpy);
- SyncHandle();
-
- if (req->glxCode == X_GLsop_Flush) {
- XFlush(dpy);
- }
+ for (s = from_screen; s <= to_screen; s++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[s];
+ Display *dpy = GetBackEndDisplay(cl, s);
+
+ LockDisplay(dpy);
+ GetReqSingle(GLXSingle, be_req);
+ be_req->reqType = dmxScreen->glxMajorOpcode;
+ be_req->glxCode = req->glxCode;
+ be_req->length = req->length;
+ be_req->contextTag = GetCurrentBackEndTag(cl, req->contextTag, s);
+ if (buf_size > 0)
+ _XSend(dpy, (const char *) pc, buf_size);
+ UnlockDisplay(dpy);
+ SyncHandle();
+
+ if (req->glxCode == X_GLsop_Flush) {
+ XFlush(dpy);
+ }
}
return Success;
}
-int __glXForwardPipe0WithReply( __GLXclientState *cl, GLbyte *pc )
+int
+__glXForwardPipe0WithReply(__GLXclientState * cl, GLbyte * pc)
{
- ClientPtr client = cl->client;
- xGLXSingleReq *req = (xGLXSingleReq *)pc;
- xGLXSingleReq *be_req;
- xGLXSingleReply reply;
- xGLXSingleReply be_reply;
+ ClientPtr client = cl->client;
+ xGLXSingleReq *req = (xGLXSingleReq *) pc;
+ xGLXSingleReq *be_req;
+ xGLXSingleReply reply;
+ xGLXSingleReply be_reply;
__GLXcontext *glxc;
- int buf_size;
- char *be_buf = NULL;
- int be_buf_size;
- DMXScreenInfo *dmxScreen;
- Display *dpy;
+ int buf_size;
+ char *be_buf = NULL;
+ int be_buf_size;
+ DMXScreenInfo *dmxScreen;
+ Display *dpy;
glxc = __glXLookupContextByTag(cl, req->contextTag);
if (!glxc) {
- return __glXBadContext;
+ return __glXBadContext;
}
pc += sz_xGLXSingleReq;
@@ -235,29 +237,30 @@ int __glXForwardPipe0WithReply( __GLXclientState *cl, GLbyte *pc )
* send the request to the first back-end server
*/
LockDisplay(dpy);
- GetReqSingle(GLXSingle,be_req);
+ GetReqSingle(GLXSingle, be_req);
be_req->reqType = dmxScreen->glxMajorOpcode;
be_req->glxCode = req->glxCode;
be_req->length = req->length;
- be_req->contextTag = GetCurrentBackEndTag(cl,req->contextTag,glxc->pScreen->myNum);
- if (buf_size > 0)
- _XSend(dpy, (const char *)pc, buf_size);
+ be_req->contextTag =
+ GetCurrentBackEndTag(cl, req->contextTag, glxc->pScreen->myNum);
+ if (buf_size > 0)
+ _XSend(dpy, (const char *) pc, buf_size);
/*
* get the reply from the back-end server
*/
- _XReply(dpy, (xReply*) &be_reply, 0, False);
+ _XReply(dpy, (xReply *) & be_reply, 0, False);
be_buf_size = be_reply.length << 2;
if (be_buf_size > 0) {
- be_buf = (char *)malloc( be_buf_size );
- if (be_buf) {
- _XRead(dpy, be_buf, be_buf_size);
- }
- else {
- /* Throw data on the floor */
- _XEatData(dpy, be_buf_size);
- return BadAlloc;
- }
+ be_buf = (char *) malloc(be_buf_size);
+ if (be_buf) {
+ _XRead(dpy, be_buf, be_buf_size);
+ }
+ else {
+ /* Throw data on the floor */
+ _XEatData(dpy, be_buf_size);
+ return BadAlloc;
+ }
}
UnlockDisplay(dpy);
@@ -275,47 +278,49 @@ int __glXForwardPipe0WithReply( __GLXclientState *cl, GLbyte *pc )
reply.pad4 = be_reply.pad4;
if (client->swapped) {
- SendSwappedReply( client, &reply, be_buf, be_buf_size );
+ SendSwappedReply(client, &reply, be_buf, be_buf_size);
}
else {
- WriteToClient(client, sizeof(xGLXSingleReply),(char *)&reply);
- if (be_buf_size > 0)
- WriteToClient(client, be_buf_size, (char *)be_buf);
+ WriteToClient(client, sizeof(xGLXSingleReply), (char *) &reply);
+ if (be_buf_size > 0)
+ WriteToClient(client, be_buf_size, (char *) be_buf);
}
- if (be_buf_size > 0) free(be_buf);
+ if (be_buf_size > 0)
+ free(be_buf);
return Success;
}
-int __glXForwardAllWithReply( __GLXclientState *cl, GLbyte *pc )
+int
+__glXForwardAllWithReply(__GLXclientState * cl, GLbyte * pc)
{
- ClientPtr client = cl->client;
- xGLXSingleReq *req = (xGLXSingleReq *)pc;
- xGLXSingleReq *be_req;
- xGLXSingleReply reply;
- xGLXSingleReply be_reply;
+ ClientPtr client = cl->client;
+ xGLXSingleReq *req = (xGLXSingleReq *) pc;
+ xGLXSingleReq *be_req;
+ xGLXSingleReply reply;
+ xGLXSingleReply be_reply;
__GLXcontext *glxc;
- int buf_size;
- char *be_buf = NULL;
- int be_buf_size = 0;
- int from_screen = 0;
- int to_screen = 0;
- int s;
+ int buf_size;
+ char *be_buf = NULL;
+ int be_buf_size = 0;
+ int from_screen = 0;
+ int to_screen = 0;
+ int s;
- DMXScreenInfo *dmxScreen;
- Display *dpy;
+ DMXScreenInfo *dmxScreen;
+ Display *dpy;
glxc = __glXLookupContextByTag(cl, req->contextTag);
if (!glxc) {
- return 0;
+ return 0;
}
from_screen = to_screen = glxc->pScreen->myNum;
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
- from_screen = 0;
- to_screen = screenInfo.numScreens - 1;
+ from_screen = 0;
+ to_screen = screenInfo.numScreens - 1;
}
#endif
@@ -325,42 +330,42 @@ int __glXForwardAllWithReply( __GLXclientState *cl, GLbyte *pc )
/*
* send the request to the first back-end server(s)
*/
- for (s=to_screen; s>=from_screen; s--) {
- dmxScreen = &dmxScreens[s];
- dpy = GetBackEndDisplay(cl,s);
-
- LockDisplay(dpy);
- GetReqSingle(GLXSingle,be_req);
- be_req->reqType = dmxScreen->glxMajorOpcode;
- be_req->glxCode = req->glxCode;
- be_req->length = req->length;
- be_req->contextTag = GetCurrentBackEndTag(cl,req->contextTag,s);
- if (buf_size > 0)
- _XSend(dpy, (const char *)pc, buf_size);
-
- /*
- * get the reply from the back-end server
- */
- _XReply(dpy, (xReply*) &be_reply, 0, False);
- be_buf_size = be_reply.length << 2;
- if (be_buf_size > 0) {
- be_buf = (char *)malloc( be_buf_size );
- if (be_buf) {
- _XRead(dpy, be_buf, be_buf_size);
- }
- else {
- /* Throw data on the floor */
- _XEatData(dpy, be_buf_size);
- return BadAlloc;
- }
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
-
- if (s > from_screen && be_buf_size > 0) {
- free(be_buf);
- }
+ for (s = to_screen; s >= from_screen; s--) {
+ dmxScreen = &dmxScreens[s];
+ dpy = GetBackEndDisplay(cl, s);
+
+ LockDisplay(dpy);
+ GetReqSingle(GLXSingle, be_req);
+ be_req->reqType = dmxScreen->glxMajorOpcode;
+ be_req->glxCode = req->glxCode;
+ be_req->length = req->length;
+ be_req->contextTag = GetCurrentBackEndTag(cl, req->contextTag, s);
+ if (buf_size > 0)
+ _XSend(dpy, (const char *) pc, buf_size);
+
+ /*
+ * get the reply from the back-end server
+ */
+ _XReply(dpy, (xReply *) & be_reply, 0, False);
+ be_buf_size = be_reply.length << 2;
+ if (be_buf_size > 0) {
+ be_buf = (char *) malloc(be_buf_size);
+ if (be_buf) {
+ _XRead(dpy, be_buf, be_buf_size);
+ }
+ else {
+ /* Throw data on the floor */
+ _XEatData(dpy, be_buf_size);
+ return BadAlloc;
+ }
+ }
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+
+ if (s > from_screen && be_buf_size > 0) {
+ free(be_buf);
+ }
}
/*
@@ -375,380 +380,409 @@ int __glXForwardAllWithReply( __GLXclientState *cl, GLbyte *pc )
reply.pad4 = be_reply.pad4;
if (client->swapped) {
- SendSwappedReply( client, &reply, be_buf, be_buf_size );
+ SendSwappedReply(client, &reply, be_buf, be_buf_size);
}
else {
- WriteToClient(client, sizeof(xGLXSingleReply),(char *)&reply);
- if (be_buf_size > 0)
- WriteToClient(client, be_buf_size, (char *)be_buf);
+ WriteToClient(client, sizeof(xGLXSingleReply), (char *) &reply);
+ if (be_buf_size > 0)
+ WriteToClient(client, be_buf_size, (char *) be_buf);
}
- if (be_buf_size > 0) free(be_buf);
+ if (be_buf_size > 0)
+ free(be_buf);
return Success;
}
-int __glXForwardSingleReqSwap( __GLXclientState *cl, GLbyte *pc )
+int
+__glXForwardSingleReqSwap(__GLXclientState * cl, GLbyte * pc)
{
- xGLXSingleReq *req = (xGLXSingleReq *)pc;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->contextTag);
-
- swap_vec_element_size = 0;
-
- /*
- * swap extra data in request - assuming all data
- * (if available) are arrays of 4 bytes components !
- */
- if (req->length > sz_xGLXSingleReq/4) {
- int *data = (int *)(req+1);
- int count = req->length - sz_xGLXSingleReq/4;
- __GLX_SWAP_INT_ARRAY(data, count );
- }
-
- return( __glXForwardSingleReq( cl, pc ) );
+ xGLXSingleReq *req = (xGLXSingleReq *) pc;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->contextTag);
+
+ swap_vec_element_size = 0;
+
+ /*
+ * swap extra data in request - assuming all data
+ * (if available) are arrays of 4 bytes components !
+ */
+ if (req->length > sz_xGLXSingleReq / 4) {
+ int *data = (int *) (req + 1);
+ int count = req->length - sz_xGLXSingleReq / 4;
+
+ __GLX_SWAP_INT_ARRAY(data, count);
+ }
+
+ return (__glXForwardSingleReq(cl, pc));
}
-int __glXForwardPipe0WithReplySwap( __GLXclientState *cl, GLbyte *pc )
+int
+__glXForwardPipe0WithReplySwap(__GLXclientState * cl, GLbyte * pc)
{
- xGLXSingleReq *req = (xGLXSingleReq *)pc;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->contextTag);
-
- swap_vec_element_size = 0;
-
- /*
- * swap extra data in request - assuming all data
- * (if available) are arrays of 4 bytes components !
- */
- if (req->length > sz_xGLXSingleReq/4) {
- int *data = (int *)(req+1);
- int count = req->length - sz_xGLXSingleReq/4;
- __GLX_SWAP_INT_ARRAY(data, count );
- }
-
- return( __glXForwardPipe0WithReply( cl, pc ) );
+ xGLXSingleReq *req = (xGLXSingleReq *) pc;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->contextTag);
+
+ swap_vec_element_size = 0;
+
+ /*
+ * swap extra data in request - assuming all data
+ * (if available) are arrays of 4 bytes components !
+ */
+ if (req->length > sz_xGLXSingleReq / 4) {
+ int *data = (int *) (req + 1);
+ int count = req->length - sz_xGLXSingleReq / 4;
+
+ __GLX_SWAP_INT_ARRAY(data, count);
+ }
+
+ return (__glXForwardPipe0WithReply(cl, pc));
}
-int __glXForwardPipe0WithReplySwapsv( __GLXclientState *cl, GLbyte *pc )
+int
+__glXForwardPipe0WithReplySwapsv(__GLXclientState * cl, GLbyte * pc)
{
- xGLXSingleReq *req = (xGLXSingleReq *)pc;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ xGLXSingleReq *req = (xGLXSingleReq *) pc;
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->contextTag);
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->contextTag);
- swap_vec_element_size = 2;
+ swap_vec_element_size = 2;
- /*
- * swap extra data in request - assuming all data
- * (if available) are arrays of 4 bytes components !
- */
- if (req->length > sz_xGLXSingleReq/4) {
- int *data = (int *)(req+1);
- int count = req->length - sz_xGLXSingleReq/4;
- __GLX_SWAP_INT_ARRAY(data, count );
- }
+ /*
+ * swap extra data in request - assuming all data
+ * (if available) are arrays of 4 bytes components !
+ */
+ if (req->length > sz_xGLXSingleReq / 4) {
+ int *data = (int *) (req + 1);
+ int count = req->length - sz_xGLXSingleReq / 4;
+ __GLX_SWAP_INT_ARRAY(data, count);
+ }
- return( __glXForwardPipe0WithReply( cl, pc ) );
+ return (__glXForwardPipe0WithReply(cl, pc));
}
-int __glXForwardPipe0WithReplySwapiv( __GLXclientState *cl, GLbyte *pc )
+int
+__glXForwardPipe0WithReplySwapiv(__GLXclientState * cl, GLbyte * pc)
{
- xGLXSingleReq *req = (xGLXSingleReq *)pc;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ xGLXSingleReq *req = (xGLXSingleReq *) pc;
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->contextTag);
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- swap_vec_element_size = 4;
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->contextTag);
- /*
- * swap extra data in request - assuming all data
- * (if available) are arrays of 4 bytes components !
- */
- if (req->length > sz_xGLXSingleReq/4) {
- int *data = (int *)(req+1);
- int count = req->length - sz_xGLXSingleReq/4;
- __GLX_SWAP_INT_ARRAY(data, count );
- }
+ swap_vec_element_size = 4;
+ /*
+ * swap extra data in request - assuming all data
+ * (if available) are arrays of 4 bytes components !
+ */
+ if (req->length > sz_xGLXSingleReq / 4) {
+ int *data = (int *) (req + 1);
+ int count = req->length - sz_xGLXSingleReq / 4;
- return( __glXForwardPipe0WithReply( cl, pc ) );
+ __GLX_SWAP_INT_ARRAY(data, count);
+ }
+
+ return (__glXForwardPipe0WithReply(cl, pc));
}
-int __glXForwardPipe0WithReplySwapdv( __GLXclientState *cl, GLbyte *pc )
+int
+__glXForwardPipe0WithReplySwapdv(__GLXclientState * cl, GLbyte * pc)
{
- xGLXSingleReq *req = (xGLXSingleReq *)pc;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ xGLXSingleReq *req = (xGLXSingleReq *) pc;
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->contextTag);
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- swap_vec_element_size = 8;
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->contextTag);
- /*
- * swap extra data in request - assuming all data
- * (if available) are arrays of 4 bytes components !
- */
- if (req->length > sz_xGLXSingleReq/4) {
- int *data = (int *)(req+1);
- int count = req->length - sz_xGLXSingleReq/4;
- __GLX_SWAP_INT_ARRAY(data, count );
- }
+ swap_vec_element_size = 8;
+ /*
+ * swap extra data in request - assuming all data
+ * (if available) are arrays of 4 bytes components !
+ */
+ if (req->length > sz_xGLXSingleReq / 4) {
+ int *data = (int *) (req + 1);
+ int count = req->length - sz_xGLXSingleReq / 4;
- return( __glXForwardPipe0WithReply( cl, pc ) );
+ __GLX_SWAP_INT_ARRAY(data, count);
+ }
+
+ return (__glXForwardPipe0WithReply(cl, pc));
}
-int __glXForwardAllWithReplySwap( __GLXclientState *cl, GLbyte *pc )
+int
+__glXForwardAllWithReplySwap(__GLXclientState * cl, GLbyte * pc)
{
- xGLXSingleReq *req = (xGLXSingleReq *)pc;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ xGLXSingleReq *req = (xGLXSingleReq *) pc;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->contextTag);
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->contextTag);
- swap_vec_element_size = 0;
+ swap_vec_element_size = 0;
- /*
- * swap extra data in request - assuming all data
- * (if available) are arrays of 4 bytes components !
- */
- if (req->length > sz_xGLXSingleReq/4) {
- int *data = (int *)(req+1);
- int count = req->length - sz_xGLXSingleReq/4;
- __GLX_SWAP_INT_ARRAY(data, count );
- }
+ /*
+ * swap extra data in request - assuming all data
+ * (if available) are arrays of 4 bytes components !
+ */
+ if (req->length > sz_xGLXSingleReq / 4) {
+ int *data = (int *) (req + 1);
+ int count = req->length - sz_xGLXSingleReq / 4;
+ __GLX_SWAP_INT_ARRAY(data, count);
+ }
- return( __glXForwardAllWithReply( cl, pc ) );
+ return (__glXForwardAllWithReply(cl, pc));
}
-int __glXForwardAllWithReplySwapsv( __GLXclientState *cl, GLbyte *pc )
+int
+__glXForwardAllWithReplySwapsv(__GLXclientState * cl, GLbyte * pc)
{
- xGLXSingleReq *req = (xGLXSingleReq *)pc;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ xGLXSingleReq *req = (xGLXSingleReq *) pc;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->contextTag);
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->contextTag);
- swap_vec_element_size = 2;
+ swap_vec_element_size = 2;
- /*
- * swap extra data in request - assuming all data
- * (if available) are arrays of 4 bytes components !
- */
- if (req->length > sz_xGLXSingleReq/4) {
- int *data = (int *)(req+1);
- int count = req->length - sz_xGLXSingleReq/4;
- __GLX_SWAP_INT_ARRAY(data, count );
- }
+ /*
+ * swap extra data in request - assuming all data
+ * (if available) are arrays of 4 bytes components !
+ */
+ if (req->length > sz_xGLXSingleReq / 4) {
+ int *data = (int *) (req + 1);
+ int count = req->length - sz_xGLXSingleReq / 4;
+ __GLX_SWAP_INT_ARRAY(data, count);
+ }
- return( __glXForwardAllWithReply( cl, pc ) );
+ return (__glXForwardAllWithReply(cl, pc));
}
-int __glXForwardAllWithReplySwapiv( __GLXclientState *cl, GLbyte *pc )
+int
+__glXForwardAllWithReplySwapiv(__GLXclientState * cl, GLbyte * pc)
{
- xGLXSingleReq *req = (xGLXSingleReq *)pc;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ xGLXSingleReq *req = (xGLXSingleReq *) pc;
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->contextTag);
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- swap_vec_element_size = 4;
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->contextTag);
- /*
- * swap extra data in request - assuming all data
- * (if available) are arrays of 4 bytes components !
- */
- if (req->length > sz_xGLXSingleReq/4) {
- int *data = (int *)(req+1);
- int count = req->length - sz_xGLXSingleReq/4;
- __GLX_SWAP_INT_ARRAY(data, count );
- }
+ swap_vec_element_size = 4;
+ /*
+ * swap extra data in request - assuming all data
+ * (if available) are arrays of 4 bytes components !
+ */
+ if (req->length > sz_xGLXSingleReq / 4) {
+ int *data = (int *) (req + 1);
+ int count = req->length - sz_xGLXSingleReq / 4;
+
+ __GLX_SWAP_INT_ARRAY(data, count);
+ }
- return( __glXForwardAllWithReply( cl, pc ) );
+ return (__glXForwardAllWithReply(cl, pc));
}
-int __glXForwardAllWithReplySwapdv( __GLXclientState *cl, GLbyte *pc )
+int
+__glXForwardAllWithReplySwapdv(__GLXclientState * cl, GLbyte * pc)
{
- xGLXSingleReq *req = (xGLXSingleReq *)pc;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+ xGLXSingleReq *req = (xGLXSingleReq *) pc;
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->contextTag);
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
- swap_vec_element_size = 8;
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->contextTag);
- /*
- * swap extra data in request - assuming all data
- * (if available) are arrays of 4 bytes components !
- */
- if (req->length > sz_xGLXSingleReq/4) {
- int *data = (int *)(req+1);
- int count = req->length - sz_xGLXSingleReq/4;
- __GLX_SWAP_INT_ARRAY(data, count );
- }
+ swap_vec_element_size = 8;
+ /*
+ * swap extra data in request - assuming all data
+ * (if available) are arrays of 4 bytes components !
+ */
+ if (req->length > sz_xGLXSingleReq / 4) {
+ int *data = (int *) (req + 1);
+ int count = req->length - sz_xGLXSingleReq / 4;
+
+ __GLX_SWAP_INT_ARRAY(data, count);
+ }
- return( __glXForwardAllWithReply( cl, pc ) );
+ return (__glXForwardAllWithReply(cl, pc));
}
-static GLint __glReadPixels_size(GLenum format, GLenum type, GLint w, GLint h,
- int *elementbits_return, int *rowbytes_return )
+static GLint
+__glReadPixels_size(GLenum format, GLenum type, GLint w, GLint h,
+ int *elementbits_return, int *rowbytes_return)
{
GLint elements, esize;
GLint rowsize, padding;
if (w < 0 || h < 0) {
- return -1;
+ return -1;
}
switch (format) {
- case GL_COLOR_INDEX:
- case GL_STENCIL_INDEX:
- case GL_DEPTH_COMPONENT:
- elements = 1;
- break;
- case GL_RED:
- case GL_GREEN:
- case GL_BLUE:
- case GL_ALPHA:
- case GL_LUMINANCE:
- elements = 1;
- break;
- case GL_LUMINANCE_ALPHA:
- elements = 2;
- break;
- case GL_RGB:
- case GL_BGR:
- elements = 3;
- break;
- case GL_RGBA:
- case GL_BGRA:
- case GL_ABGR_EXT:
- elements = 4;
- break;
- default:
- return -1;
+ case GL_COLOR_INDEX:
+ case GL_STENCIL_INDEX:
+ case GL_DEPTH_COMPONENT:
+ elements = 1;
+ break;
+ case GL_RED:
+ case GL_GREEN:
+ case GL_BLUE:
+ case GL_ALPHA:
+ case GL_LUMINANCE:
+ elements = 1;
+ break;
+ case GL_LUMINANCE_ALPHA:
+ elements = 2;
+ break;
+ case GL_RGB:
+ case GL_BGR:
+ elements = 3;
+ break;
+ case GL_RGBA:
+ case GL_BGRA:
+ case GL_ABGR_EXT:
+ elements = 4;
+ break;
+ default:
+ return -1;
}
/*
- ** According to the GLX protocol, each row must be padded to a multiple of
- ** 4 bytes. 4 bytes also happens to be the default alignment in the pixel
- ** store modes of the GL.
- */
+ ** According to the GLX protocol, each row must be padded to a multiple of
+ ** 4 bytes. 4 bytes also happens to be the default alignment in the pixel
+ ** store modes of the GL.
+ */
switch (type) {
- case GL_BITMAP:
- if (format == GL_COLOR_INDEX || format == GL_STENCIL_INDEX) {
- rowsize = ((w * elements)+7)/8;
- padding = rowsize % 4;
- if (padding) {
- rowsize += 4 - padding;
- }
- if (elementbits_return) *elementbits_return = elements;
- if (rowbytes_return) *rowbytes_return = rowsize;
- return rowsize * h;
- } else {
- return -1;
- }
- case GL_BYTE:
- case GL_UNSIGNED_BYTE:
- esize = 1;
- break;
- case GL_UNSIGNED_BYTE_3_3_2:
- case GL_UNSIGNED_BYTE_2_3_3_REV:
- esize = 1;
- elements = 1;
- break;
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- esize = 2;
- break;
- case GL_UNSIGNED_SHORT_5_6_5:
- case GL_UNSIGNED_SHORT_5_6_5_REV:
- case GL_UNSIGNED_SHORT_4_4_4_4:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- case GL_UNSIGNED_SHORT_5_5_5_1:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- esize = 2;
- elements = 1;
- break;
- case GL_INT:
- case GL_UNSIGNED_INT:
- case GL_FLOAT:
- esize = 4;
- break;
- case GL_UNSIGNED_INT_8_8_8_8:
- case GL_UNSIGNED_INT_8_8_8_8_REV:
- case GL_UNSIGNED_INT_10_10_10_2:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- esize = 4;
- elements = 1;
- break;
- default:
- return -1;
+ case GL_BITMAP:
+ if (format == GL_COLOR_INDEX || format == GL_STENCIL_INDEX) {
+ rowsize = ((w * elements) + 7) / 8;
+ padding = rowsize % 4;
+ if (padding) {
+ rowsize += 4 - padding;
+ }
+ if (elementbits_return)
+ *elementbits_return = elements;
+ if (rowbytes_return)
+ *rowbytes_return = rowsize;
+ return rowsize * h;
+ }
+ else {
+ return -1;
+ }
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ esize = 1;
+ break;
+ case GL_UNSIGNED_BYTE_3_3_2:
+ case GL_UNSIGNED_BYTE_2_3_3_REV:
+ esize = 1;
+ elements = 1;
+ break;
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ esize = 2;
+ break;
+ case GL_UNSIGNED_SHORT_5_6_5:
+ case GL_UNSIGNED_SHORT_5_6_5_REV:
+ case GL_UNSIGNED_SHORT_4_4_4_4:
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV:
+ case GL_UNSIGNED_SHORT_5_5_5_1:
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV:
+ esize = 2;
+ elements = 1;
+ break;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ case GL_FLOAT:
+ esize = 4;
+ break;
+ case GL_UNSIGNED_INT_8_8_8_8:
+ case GL_UNSIGNED_INT_8_8_8_8_REV:
+ case GL_UNSIGNED_INT_10_10_10_2:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ esize = 4;
+ elements = 1;
+ break;
+ default:
+ return -1;
}
rowsize = w * elements * esize;
padding = rowsize % 4;
if (padding) {
- rowsize += 4 - padding;
+ rowsize += 4 - padding;
}
- if (elementbits_return) *elementbits_return = esize*elements*8;
- if (rowbytes_return) *rowbytes_return = rowsize;
+ if (elementbits_return)
+ *elementbits_return = esize * elements * 8;
+ if (rowbytes_return)
+ *rowbytes_return = rowsize;
return rowsize * h;
}
-static int intersectRect( int x1, int x2, int y1, int y2,
- int X1, int X2, int Y1, int Y2,
- int *ix1, int *ix2, int *iy1, int *iy2 )
+static int
+intersectRect(int x1, int x2, int y1, int y2,
+ int X1, int X2, int Y1, int Y2,
+ int *ix1, int *ix2, int *iy1, int *iy2)
{
- int right = (x2 < X2 ? x2 : X2);
- int bottom = (y2 < Y2 ? y2 : Y2);
- int left = (x1 > X1 ? x1 : X1);
- int top = (y1 > Y1 ? y1 : Y1);
- int width = right - left + 1;
- int height = bottom - top + 1;
-
- if ( (width <= 0) || (height <= 0) ) {
- *ix1 = *ix2 = *iy1 = *iy2 = 0;
- return 0;
- }
- else {
- *ix1 = left;
- *ix2 = right;
- *iy1 = top;
- *iy2 = bottom;
- return width * height;
- }
+ int right = (x2 < X2 ? x2 : X2);
+ int bottom = (y2 < Y2 ? y2 : Y2);
+ int left = (x1 > X1 ? x1 : X1);
+ int top = (y1 > Y1 ? y1 : Y1);
+ int width = right - left + 1;
+ int height = bottom - top + 1;
+
+ if ((width <= 0) || (height <= 0)) {
+ *ix1 = *ix2 = *iy1 = *iy2 = 0;
+ return 0;
+ }
+ else {
+ *ix1 = left;
+ *ix2 = right;
+ *iy1 = top;
+ *iy2 = bottom;
+ return width * height;
+ }
}
-int __glXDisp_ReadPixels(__GLXclientState *cl, GLbyte *pc)
+int
+__glXDisp_ReadPixels(__GLXclientState * cl, GLbyte * pc)
{
- xGLXSingleReq *req = (xGLXSingleReq *)pc;
+ xGLXSingleReq *req = (xGLXSingleReq *) pc;
xGLXSingleReq *be_req;
xGLXReadPixelsReply reply;
xGLXReadPixelsReply be_reply;
GLbyte *be_pc;
- GLint x,y;
+ GLint x, y;
GLsizei width, height;
GLenum format, type;
GLboolean swapBytes, lsbFirst;
@@ -763,254 +797,262 @@ int __glXDisp_ReadPixels(__GLXclientState *cl, GLbyte *pc)
int win_x1, win_x2;
int win_y1, win_y2;
int ebits, rowsize;
+
__GLX_DECLARE_SWAP_VARIABLES;
if (client->swapped) {
- __GLX_SWAP_INT(&req->contextTag);
+ __GLX_SWAP_INT(&req->contextTag);
}
glxc = __glXLookupContextByTag(cl, req->contextTag);
if (!glxc) {
- return 0;
+ return 0;
}
from_screen = to_screen = glxc->pScreen->myNum;
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
- from_screen = 0;
- to_screen = screenInfo.numScreens - 1;
+ from_screen = 0;
+ to_screen = screenInfo.numScreens - 1;
}
#endif
pc += sz_xGLXSingleReq;
- x = *(GLint *)(pc + 0);
- y = *(GLint *)(pc + 4);
- width = *(GLsizei *)(pc + 8);
- height = *(GLsizei *)(pc + 12);
- format = *(GLenum *)(pc + 16);
- type = *(GLenum *)(pc + 20);
- swapBytes = *(GLboolean *)(pc + 24);
- lsbFirst = *(GLboolean *)(pc + 25);
+ x = *(GLint *) (pc + 0);
+ y = *(GLint *) (pc + 4);
+ width = *(GLsizei *) (pc + 8);
+ height = *(GLsizei *) (pc + 12);
+ format = *(GLenum *) (pc + 16);
+ type = *(GLenum *) (pc + 20);
+ swapBytes = *(GLboolean *) (pc + 24);
+ lsbFirst = *(GLboolean *) (pc + 25);
if (client->swapped) {
- __GLX_SWAP_INT(&x);
- __GLX_SWAP_INT(&y);
- __GLX_SWAP_INT(&width);
- __GLX_SWAP_INT(&height);
- __GLX_SWAP_INT(&format);
- __GLX_SWAP_INT(&type);
- swapBytes = !swapBytes;
+ __GLX_SWAP_INT(&x);
+ __GLX_SWAP_INT(&y);
+ __GLX_SWAP_INT(&width);
+ __GLX_SWAP_INT(&height);
+ __GLX_SWAP_INT(&format);
+ __GLX_SWAP_INT(&type);
+ swapBytes = !swapBytes;
}
- buf_size = __glReadPixels_size(format,type,width,height, &ebits, &rowsize);
+ buf_size =
+ __glReadPixels_size(format, type, width, height, &ebits, &rowsize);
if (buf_size > 0) {
- buf = (char *) malloc( buf_size );
- if ( !buf ) {
- return BadAlloc;
- }
+ buf = (char *) malloc(buf_size);
+ if (!buf) {
+ return BadAlloc;
+ }
}
else {
- buf_size = 0;
- buf = NULL;
+ buf_size = 0;
+ buf = NULL;
}
if (buf_size > 0) {
- /*
- * Get the current drawable this context is bound to
- */
- pDraw = __glXLookupDrawableByTag( cl, req->contextTag );
- win_x1 = pDraw->x + x;
- win_x2 = win_x1 + width - 1;
- win_y1 = (dmxGlobalHeight - pDraw->y - pDraw->height) + y;
- win_y2 = win_y1 + height - 1;
- if (pDraw->type != DRAWABLE_WINDOW) {
- from_screen = to_screen = 0;
- }
-
- for (s=from_screen; s<=to_screen; s++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[s];
- Display *dpy = GetBackEndDisplay(cl,s);
- int scr_x1 = dmxScreen->rootXOrigin;
- int scr_x2 = dmxScreen->rootXOrigin + dmxScreen->scrnWidth - 1;
- int scr_y1 = dmxScreen->rootYOrigin;
- int scr_y2 = dmxScreen->rootYOrigin + dmxScreen->scrnHeight - 1;
- int wx1, wx2, wy1, wy2;
- int sx, sy, sw, sh;
- int npixels;
-
- /*
- * find the window portion that is on the current screen
- */
- if (pDraw->type == DRAWABLE_WINDOW) {
- npixels = intersectRect( scr_x1, scr_x2, scr_y1, scr_y2,
- win_x1, win_x2, win_y1, win_y2,
- &wx1, &wx2, &wy1, &wy2 );
- }
- else {
- wx1 = win_x1;
- wx2 = win_x2;
- wy1 = win_y1;
- wy2 = win_y2;
- npixels = (wx2-wx1+1) * (wy2-wy1+1);
- }
-
- if (npixels > 0) {
-
- /* send the request to the back-end server */
- LockDisplay(dpy);
- GetReqExtra(GLXSingle,__GLX_PAD(26),be_req);
- be_req->reqType = dmxScreen->glxMajorOpcode;
- be_req->glxCode = X_GLsop_ReadPixels;
- be_req->contextTag = GetCurrentBackEndTag(cl,req->contextTag,s);
- be_pc = ((GLbyte *)(be_req) + sz_xGLXSingleReq);
-
- sx = wx1 - pDraw->x;
- sy = wy1 - (dmxGlobalHeight - pDraw->y - pDraw->height);
- sw = (wx2-wx1+1);
- sh = (wy2-wy1+1);
-
- *(GLint *)(be_pc + 0) = sx; /* x */
- *(GLint *)(be_pc + 4) = sy; /* y */
- *(GLsizei *)(be_pc + 8) = sw; /* width */
- *(GLsizei *)(be_pc + 12) = sh; /* height */
- *(GLenum *)(be_pc + 16) = format;
- *(GLenum *)(be_pc + 20) = type;
- *(GLboolean *)(be_pc + 24) = swapBytes;
- *(GLboolean *)(be_pc + 25) = lsbFirst;
-
- _XReply(dpy, (xReply*) &be_reply, 0, False);
-
- if (be_reply.length > 0) {
- char *be_buf;
- int be_buf_size = be_reply.length << 2;
-
- be_buf = (char *) malloc( be_buf_size );
- if (be_buf) {
- _XRead(dpy, be_buf, be_buf_size);
-
- /* copy pixels data to the right location of the */
- /* reply buffer */
- if ( type != GL_BITMAP ) {
- int pbytes = ebits / 8;
- char *dst = buf + (sy-y)*rowsize + (sx-x)*pbytes;
- char *src = be_buf;
- int pad = (pbytes * sw) % 4;
- int r;
-
- for (r=0; r<sh; r++) {
- memcpy( dst, src, pbytes*sw );
- dst += rowsize;
- src += (pbytes*sw + (pad ? 4-pad : 0) );
- }
- }
- else {
- /* this is a GL_BITMAP pixel type, should copy bits */
- int r;
- int src_rowsize = bits_to_bytes(sw * ebits);
- int src_pad = src_rowsize % 4;
- if ( src_pad ) {
- src_rowsize += (4 - src_pad);
- }
-
- for (r=0; r<sh; r++) {
- unsigned char dst_mask = 0x80 >> (sx % 8);
- unsigned char src_mask = 0x80;
- char *dst = buf + (sy-y+r)*rowsize + (sx-x)/8;
- char *src = be_buf + r*src_rowsize;
- int b;
-
- for (b=0; b<sw*ebits; b++) {
- if ( *src & src_mask ) {
- *dst |= dst_mask;
- }
- else {
- *dst &= ~dst_mask;
- }
-
- if (dst_mask > 1) dst_mask >>= 1;
- else {
- dst_mask = 0x80;
- dst++;
- }
-
- if (src_mask > 1) src_mask >>= 1;
- else {
- src_mask = 0x80;
- src++;
- }
- }
- }
-
- }
-
- free( be_buf );
- }
- else {
- /* Throw data on the floor */
- _XEatData(dpy, be_buf_size);
- free( buf );
- return BadAlloc;
- }
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
-
- } /* of npixels > 0 */
-
- } /* of for loop */
-
- } /* of if buf_size > 0 */
+ /*
+ * Get the current drawable this context is bound to
+ */
+ pDraw = __glXLookupDrawableByTag(cl, req->contextTag);
+ win_x1 = pDraw->x + x;
+ win_x2 = win_x1 + width - 1;
+ win_y1 = (dmxGlobalHeight - pDraw->y - pDraw->height) + y;
+ win_y2 = win_y1 + height - 1;
+ if (pDraw->type != DRAWABLE_WINDOW) {
+ from_screen = to_screen = 0;
+ }
+
+ for (s = from_screen; s <= to_screen; s++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[s];
+ Display *dpy = GetBackEndDisplay(cl, s);
+ int scr_x1 = dmxScreen->rootXOrigin;
+ int scr_x2 = dmxScreen->rootXOrigin + dmxScreen->scrnWidth - 1;
+ int scr_y1 = dmxScreen->rootYOrigin;
+ int scr_y2 = dmxScreen->rootYOrigin + dmxScreen->scrnHeight - 1;
+ int wx1, wx2, wy1, wy2;
+ int sx, sy, sw, sh;
+ int npixels;
+
+ /*
+ * find the window portion that is on the current screen
+ */
+ if (pDraw->type == DRAWABLE_WINDOW) {
+ npixels = intersectRect(scr_x1, scr_x2, scr_y1, scr_y2,
+ win_x1, win_x2, win_y1, win_y2,
+ &wx1, &wx2, &wy1, &wy2);
+ }
+ else {
+ wx1 = win_x1;
+ wx2 = win_x2;
+ wy1 = win_y1;
+ wy2 = win_y2;
+ npixels = (wx2 - wx1 + 1) * (wy2 - wy1 + 1);
+ }
+
+ if (npixels > 0) {
+
+ /* send the request to the back-end server */
+ LockDisplay(dpy);
+ GetReqExtra(GLXSingle, __GLX_PAD(26), be_req);
+ be_req->reqType = dmxScreen->glxMajorOpcode;
+ be_req->glxCode = X_GLsop_ReadPixels;
+ be_req->contextTag =
+ GetCurrentBackEndTag(cl, req->contextTag, s);
+ be_pc = ((GLbyte *) (be_req) + sz_xGLXSingleReq);
+
+ sx = wx1 - pDraw->x;
+ sy = wy1 - (dmxGlobalHeight - pDraw->y - pDraw->height);
+ sw = (wx2 - wx1 + 1);
+ sh = (wy2 - wy1 + 1);
+
+ *(GLint *) (be_pc + 0) = sx; /* x */
+ *(GLint *) (be_pc + 4) = sy; /* y */
+ *(GLsizei *) (be_pc + 8) = sw; /* width */
+ *(GLsizei *) (be_pc + 12) = sh; /* height */
+ *(GLenum *) (be_pc + 16) = format;
+ *(GLenum *) (be_pc + 20) = type;
+ *(GLboolean *) (be_pc + 24) = swapBytes;
+ *(GLboolean *) (be_pc + 25) = lsbFirst;
+
+ _XReply(dpy, (xReply *) & be_reply, 0, False);
+
+ if (be_reply.length > 0) {
+ char *be_buf;
+ int be_buf_size = be_reply.length << 2;
+
+ be_buf = (char *) malloc(be_buf_size);
+ if (be_buf) {
+ _XRead(dpy, be_buf, be_buf_size);
+
+ /* copy pixels data to the right location of the */
+ /* reply buffer */
+ if (type != GL_BITMAP) {
+ int pbytes = ebits / 8;
+ char *dst =
+ buf + (sy - y) * rowsize + (sx - x) * pbytes;
+ char *src = be_buf;
+ int pad = (pbytes * sw) % 4;
+ int r;
+
+ for (r = 0; r < sh; r++) {
+ memcpy(dst, src, pbytes * sw);
+ dst += rowsize;
+ src += (pbytes * sw + (pad ? 4 - pad : 0));
+ }
+ }
+ else {
+ /* this is a GL_BITMAP pixel type, should copy bits */
+ int r;
+ int src_rowsize = bits_to_bytes(sw * ebits);
+ int src_pad = src_rowsize % 4;
+
+ if (src_pad) {
+ src_rowsize += (4 - src_pad);
+ }
+
+ for (r = 0; r < sh; r++) {
+ unsigned char dst_mask = 0x80 >> (sx % 8);
+ unsigned char src_mask = 0x80;
+ char *dst =
+ buf + (sy - y + r) * rowsize + (sx - x) / 8;
+ char *src = be_buf + r * src_rowsize;
+ int b;
+
+ for (b = 0; b < sw * ebits; b++) {
+ if (*src & src_mask) {
+ *dst |= dst_mask;
+ }
+ else {
+ *dst &= ~dst_mask;
+ }
+
+ if (dst_mask > 1)
+ dst_mask >>= 1;
+ else {
+ dst_mask = 0x80;
+ dst++;
+ }
+
+ if (src_mask > 1)
+ src_mask >>= 1;
+ else {
+ src_mask = 0x80;
+ src++;
+ }
+ }
+ }
+
+ }
+
+ free(be_buf);
+ }
+ else {
+ /* Throw data on the floor */
+ _XEatData(dpy, be_buf_size);
+ free(buf);
+ return BadAlloc;
+ }
+ }
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+
+ } /* of npixels > 0 */
+
+ } /* of for loop */
+
+ } /* of if buf_size > 0 */
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
reply.length = buf_size >> 2;
if (client->swapped) {
- __GLX_SWAP_SHORT(&reply.sequenceNumber);
- __GLX_SWAP_INT(&reply.length);
+ __GLX_SWAP_SHORT(&reply.sequenceNumber);
+ __GLX_SWAP_INT(&reply.length);
}
- WriteToClient(client, sizeof(xGLXReadPixelsReply),(char *)&reply);
+ WriteToClient(client, sizeof(xGLXReadPixelsReply), (char *) &reply);
if (buf_size > 0) {
- WriteToClient(client, buf_size, (char *)buf);
- free( buf );
+ WriteToClient(client, buf_size, (char *) buf);
+ free(buf);
}
return Success;
}
-int __glXDispSwap_GetTexImage(__GLXclientState *cl, GLbyte *pc)
+int
+__glXDispSwap_GetTexImage(__GLXclientState * cl, GLbyte * pc)
{
__GLX_DECLARE_SWAP_VARIABLES;
GLbyte *lpc = pc;
lpc += sz_xGLXSingleReq;
- __GLX_SWAP_INT(lpc+0);
- __GLX_SWAP_INT(lpc+4);
- __GLX_SWAP_INT(lpc+8);
- __GLX_SWAP_INT(lpc+12);
+ __GLX_SWAP_INT(lpc + 0);
+ __GLX_SWAP_INT(lpc + 4);
+ __GLX_SWAP_INT(lpc + 8);
+ __GLX_SWAP_INT(lpc + 12);
/* reverse swapBytes */
- *(GLboolean *)(lpc + 16) = ! *(GLboolean *)(lpc + 16);
+ *(GLboolean *) (lpc + 16) = !*(GLboolean *) (lpc + 16);
- return( __glXForwardPipe0WithReplySwap( cl, pc ) );
+ return (__glXForwardPipe0WithReplySwap(cl, pc));
}
-int __glXDispSwap_GetColorTable(__GLXclientState *cl, GLbyte *pc)
+int
+__glXDispSwap_GetColorTable(__GLXclientState * cl, GLbyte * pc)
{
__GLX_DECLARE_SWAP_VARIABLES;
GLbyte *lpc = pc;
lpc += sz_xGLXSingleReq;
- __GLX_SWAP_INT(lpc+0);
- __GLX_SWAP_INT(lpc+4);
- __GLX_SWAP_INT(lpc+8);
+ __GLX_SWAP_INT(lpc + 0);
+ __GLX_SWAP_INT(lpc + 4);
+ __GLX_SWAP_INT(lpc + 8);
/* reverse swapBytes */
- *(GLboolean *)(lpc + 12) = ! *(GLboolean *)(lpc + 12);
+ *(GLboolean *) (lpc + 12) = !*(GLboolean *) (lpc + 12);
- return( __glXForwardPipe0WithReplySwap( cl, pc ) );
+ return (__glXForwardPipe0WithReplySwap(cl, pc));
}
-
-
diff --git a/hw/dmx/glxProxy/glxsingle.h b/hw/dmx/glxProxy/glxsingle.h
index 7c23537e8..32a9d4921 100644
--- a/hw/dmx/glxProxy/glxsingle.h
+++ b/hw/dmx/glxProxy/glxsingle.h
@@ -31,24 +31,24 @@
#ifndef __GLXSINGLE_H
#define __GLXSINGLE_H
-extern int __glXForwardSingleReq( __GLXclientState *cl, GLbyte *pc );
-extern int __glXForwardPipe0WithReply( __GLXclientState *cl, GLbyte *pc );
-extern int __glXForwardAllWithReply( __GLXclientState *cl, GLbyte *pc );
+extern int __glXForwardSingleReq(__GLXclientState * cl, GLbyte * pc);
+extern int __glXForwardPipe0WithReply(__GLXclientState * cl, GLbyte * pc);
+extern int __glXForwardAllWithReply(__GLXclientState * cl, GLbyte * pc);
-extern int __glXForwardSingleReqSwap( __GLXclientState *cl, GLbyte *pc );
+extern int __glXForwardSingleReqSwap(__GLXclientState * cl, GLbyte * pc);
-extern int __glXForwardPipe0WithReplySwap( __GLXclientState *cl, GLbyte *pc );
-extern int __glXForwardPipe0WithReplySwapsv( __GLXclientState *cl, GLbyte *pc );
-extern int __glXForwardPipe0WithReplySwapiv( __GLXclientState *cl, GLbyte *pc );
-extern int __glXForwardPipe0WithReplySwapdv( __GLXclientState *cl, GLbyte *pc );
+extern int __glXForwardPipe0WithReplySwap(__GLXclientState * cl, GLbyte * pc);
+extern int __glXForwardPipe0WithReplySwapsv(__GLXclientState * cl, GLbyte * pc);
+extern int __glXForwardPipe0WithReplySwapiv(__GLXclientState * cl, GLbyte * pc);
+extern int __glXForwardPipe0WithReplySwapdv(__GLXclientState * cl, GLbyte * pc);
-extern int __glXForwardAllWithReplySwap( __GLXclientState *cl, GLbyte *pc );
-extern int __glXForwardAllWithReplySwapsv( __GLXclientState *cl, GLbyte *pc );
-extern int __glXForwardAllWithReplySwapiv( __GLXclientState *cl, GLbyte *pc );
-extern int __glXForwardAllWithReplySwapdv( __GLXclientState *cl, GLbyte *pc );
+extern int __glXForwardAllWithReplySwap(__GLXclientState * cl, GLbyte * pc);
+extern int __glXForwardAllWithReplySwapsv(__GLXclientState * cl, GLbyte * pc);
+extern int __glXForwardAllWithReplySwapiv(__GLXclientState * cl, GLbyte * pc);
+extern int __glXForwardAllWithReplySwapdv(__GLXclientState * cl, GLbyte * pc);
-extern int __glXDisp_ReadPixels(__GLXclientState *cl, GLbyte *pc);
-extern int __glXDispSwap_GetTexImage(__GLXclientState *cl, GLbyte *pc);
-extern int __glXDispSwap_GetColorTable(__GLXclientState *cl, GLbyte *pc);
+extern int __glXDisp_ReadPixels(__GLXclientState * cl, GLbyte * pc);
+extern int __glXDispSwap_GetTexImage(__GLXclientState * cl, GLbyte * pc);
+extern int __glXDispSwap_GetColorTable(__GLXclientState * cl, GLbyte * pc);
#endif
diff --git a/hw/dmx/glxProxy/glxswap.c b/hw/dmx/glxProxy/glxswap.c
index 6d9b4fc55..87a748621 100644
--- a/hw/dmx/glxProxy/glxswap.c
+++ b/hw/dmx/glxProxy/glxswap.c
@@ -40,17 +40,15 @@
#include "glxserver.h"
#include "glxswap.h"
-extern int __glXDoSwapBuffers(__GLXclientState *cl, XID drawId,
- GLXContextTag tag);
+extern int __glXDoSwapBuffers(__GLXclientState * cl, XID drawId,
+ GLXContextTag tag);
typedef struct _SwapGroup *SwapGroupPtr;
static Bool SwapBarrierIsReadyToSwap(GLuint barrier);
static void SwapSwapBarrier(GLuint barrier);
static void UpdateSwapBarrierList(GLuint barrier,
- SwapGroupPtr pOldSwap,
- SwapGroupPtr pNewSwap);
-
+ SwapGroupPtr pOldSwap, SwapGroupPtr pNewSwap);
/************************************************************************
*
@@ -59,58 +57,60 @@ static void UpdateSwapBarrierList(GLuint barrier,
************************************************************************/
typedef struct _SwapGroup {
- WindowPtr pWin;
- SwapGroupPtr pNext;
+ WindowPtr pWin;
+ SwapGroupPtr pNext;
- Bool swapping;
- Bool sleeping;
- GLuint barrier;
+ Bool swapping;
+ Bool sleeping;
+ GLuint barrier;
- XID drawable;
- GLXContextTag tag;
+ XID drawable;
+ GLXContextTag tag;
__GLXclientState *clState;
} SwapGroupRec;
-
-static void SwapSwapGroup(SwapGroupPtr pSwap)
+static void
+SwapSwapGroup(SwapGroupPtr pSwap)
{
- SwapGroupPtr pCur;
+ SwapGroupPtr pCur;
/* All drawables in swap group are ready to swap, so just swap all
* drawables buffers and then wake up those clients that were
* previously sleeping */
for (pCur = pSwap; pCur; pCur = pCur->pNext) {
- if (pCur->swapping) {
- /* Swap pCur's buffers */
- __glXDoSwapBuffers(pCur->clState, pCur->drawable, pCur->tag);
- pCur->swapping = FALSE;
- }
-
- /* Wakeup client */
- if (pCur->sleeping) {
- ClientWakeup(pCur->clState->client);
- pCur->sleeping = FALSE;
- }
+ if (pCur->swapping) {
+ /* Swap pCur's buffers */
+ __glXDoSwapBuffers(pCur->clState, pCur->drawable, pCur->tag);
+ pCur->swapping = FALSE;
+ }
+
+ /* Wakeup client */
+ if (pCur->sleeping) {
+ ClientWakeup(pCur->clState->client);
+ pCur->sleeping = FALSE;
+ }
}
}
-static Bool SwapGroupIsReadyToSwap(SwapGroupPtr pSwap)
+static Bool
+SwapGroupIsReadyToSwap(SwapGroupPtr pSwap)
{
- Bool isReady = TRUE;
+ Bool isReady = TRUE;
/* The swap group is ready to swap when all drawables are ready to
* swap. NOTE: A drawable is also ready to swap if it is not
* currently mapped */
for (; pSwap; pSwap = pSwap->pNext) {
- isReady &= (pSwap->swapping || !pSwap->pWin->mapped);
- /* FIXME: Should we use pSwap->pWin->mapped or ...->realized ??? */
+ isReady &= (pSwap->swapping || !pSwap->pWin->mapped);
+ /* FIXME: Should we use pSwap->pWin->mapped or ...->realized ??? */
}
return isReady;
}
-static Bool SGSwapCleanup(ClientPtr client, pointer closure)
+static Bool
+SGSwapCleanup(ClientPtr client, pointer closure)
{
/* SwapGroupPtr pSwap = (SwapGroupPtr)closure; */
@@ -120,78 +120,86 @@ static Bool SGSwapCleanup(ClientPtr client, pointer closure)
return TRUE;
}
-int SGSwapBuffers(__GLXclientState *cl, XID drawId, GLXContextTag tag,
- DrawablePtr pDraw)
+int
+SGSwapBuffers(__GLXclientState * cl, XID drawId, GLXContextTag tag,
+ DrawablePtr pDraw)
{
- WindowPtr pWin = (WindowPtr)pDraw;
- dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWin);
- SwapGroupPtr pSwap = pWinPriv->swapGroup;
- SwapGroupPtr pCur;
+ WindowPtr pWin = (WindowPtr) pDraw;
+ dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWin);
+ SwapGroupPtr pSwap = pWinPriv->swapGroup;
+ SwapGroupPtr pCur;
for (pCur = pSwap; pCur && pCur->pWin != pWin; pCur = pCur->pNext);
if (!pCur)
- return BadDrawable;
+ return BadDrawable;
- pCur->clState = cl;
+ pCur->clState = cl;
pCur->drawable = drawId;
- pCur->tag = tag;
+ pCur->tag = tag;
/* We are now in the process of swapping */
pCur->swapping = TRUE;
if (pSwap->barrier && SwapBarrierIsReadyToSwap(pSwap->barrier)) {
- /* The swap group is bound to a barrier and the barrier is ready
- * to swap, so swap all the swap groups that are bound to this
- * group's swap barrier */
- SwapSwapBarrier(pSwap->barrier);
- } else if (!pSwap->barrier && SwapGroupIsReadyToSwap(pSwap)) {
- /* Do the swap if the entire swap group is ready to swap and the
- * group is not bound to a swap barrier */
- SwapSwapGroup(pSwap);
- } else {
- /* The swap group/barrier is not yet ready to swap, so put
- * client to sleep until the rest are ready to swap */
- ClientSleep(cl->client, SGSwapCleanup, (pointer)pWin);
- pCur->sleeping = TRUE;
+ /* The swap group is bound to a barrier and the barrier is ready
+ * to swap, so swap all the swap groups that are bound to this
+ * group's swap barrier */
+ SwapSwapBarrier(pSwap->barrier);
+ }
+ else if (!pSwap->barrier && SwapGroupIsReadyToSwap(pSwap)) {
+ /* Do the swap if the entire swap group is ready to swap and the
+ * group is not bound to a swap barrier */
+ SwapSwapGroup(pSwap);
+ }
+ else {
+ /* The swap group/barrier is not yet ready to swap, so put
+ * client to sleep until the rest are ready to swap */
+ ClientSleep(cl->client, SGSwapCleanup, (pointer) pWin);
+ pCur->sleeping = TRUE;
}
return Success;
}
-static void SGWindowUnmapped(WindowPtr pWin)
+static void
+SGWindowUnmapped(WindowPtr pWin)
{
- dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWin);
- SwapGroupPtr pSwap = pWinPriv->swapGroup;
+ dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWin);
+ SwapGroupPtr pSwap = pWinPriv->swapGroup;
/* Now that one of the windows in the swap group has been unmapped,
* see if the entire swap group/barrier is ready to swap */
if (pSwap->barrier && SwapBarrierIsReadyToSwap(pSwap->barrier)) {
- SwapSwapBarrier(pSwap->barrier);
- } else if (!pSwap->barrier && SwapGroupIsReadyToSwap(pSwap)) {
- SwapSwapGroup(pSwap);
+ SwapSwapBarrier(pSwap->barrier);
+ }
+ else if (!pSwap->barrier && SwapGroupIsReadyToSwap(pSwap)) {
+ SwapSwapGroup(pSwap);
}
}
-static void SGWindowDestroyed(WindowPtr pWin)
+static void
+SGWindowDestroyed(WindowPtr pWin)
{
- JoinSwapGroupSGIX((DrawablePtr)pWin, NULL);
+ JoinSwapGroupSGIX((DrawablePtr) pWin, NULL);
}
-static SwapGroupPtr CreateSwapEntry(WindowPtr pWin)
+static SwapGroupPtr
+CreateSwapEntry(WindowPtr pWin)
{
- SwapGroupPtr pEntry;
+ SwapGroupPtr pEntry;
/* Allocate new swap group */
pEntry = malloc(sizeof(*pEntry));
- if (!pEntry) return NULL;
+ if (!pEntry)
+ return NULL;
/* Initialize swap group */
- pEntry->pWin = pWin;
- pEntry->pNext = NULL;
+ pEntry->pWin = pWin;
+ pEntry->pNext = NULL;
pEntry->swapping = FALSE;
pEntry->sleeping = FALSE;
- pEntry->barrier = 0;
+ pEntry->barrier = 0;
/* The following are not initialized until SwapBuffers is called:
* pEntry->drawable
* pEntry->tag
@@ -201,7 +209,8 @@ static SwapGroupPtr CreateSwapEntry(WindowPtr pWin)
return pEntry;
}
-static void FreeSwapEntry(SwapGroupPtr pEntry)
+static void
+FreeSwapEntry(SwapGroupPtr pEntry)
{
/* Since we have removed the drawable from its previous swap group
* and it won't be added to another swap group, the only thing that
@@ -215,164 +224,168 @@ static void FreeSwapEntry(SwapGroupPtr pEntry)
/* Handle swap buffer request */
if (pEntry->swapping)
- __glXDoSwapBuffers(pEntry->clState, pEntry->drawable, pEntry->tag);
+ __glXDoSwapBuffers(pEntry->clState, pEntry->drawable, pEntry->tag);
/* Wake up client */
if (pEntry->sleeping)
- ClientWakeup(pEntry->clState->client);
+ ClientWakeup(pEntry->clState->client);
/* We can free the pEntry entry since it has already been removed
* from the swap group list and it won't be needed any longer */
free(pEntry);
}
-int JoinSwapGroupSGIX(DrawablePtr pDraw, DrawablePtr pMember)
+int
+JoinSwapGroupSGIX(DrawablePtr pDraw, DrawablePtr pMember)
{
if (pDraw->type == DRAWABLE_WINDOW) {
- WindowPtr pWin = (WindowPtr)pDraw;
- dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWin);
- SwapGroupPtr pOldSwap = NULL;
- SwapGroupPtr pEntry;
-
- /* If pDraw and pMember are already members of the same swap
- * group, just return Success since there is nothing to do */
- for (pEntry = pWinPriv->swapGroup; pEntry; pEntry = pEntry->pNext)
- if (pEntry->pWin == (WindowPtr)pMember)
- return Success;
-
- /* Remove pDraw from its current swap group */
- if (pWinPriv->swapGroup) {
- SwapGroupPtr pSwapGroup = pWinPriv->swapGroup;
- SwapGroupPtr pPrev;
-
- /* Find old swap entry in swap group and save in pOldSwap
- * for later use */
- for (pOldSwap = pWinPriv->swapGroup, pPrev = NULL;
- pOldSwap && pOldSwap->pWin != pWin;
- pPrev = pOldSwap, pOldSwap = pOldSwap->pNext);
- if (!pOldSwap)
- return BadDrawable;
-
- /* Remove pDraw's swap group entry from swap group list */
- if (pPrev) {
- pPrev->pNext = pOldSwap->pNext;
- } else {
- /* pWin is at the head of the swap group list, so we
- * need to update all other members of this swap
- * group */
- for (pEntry = pOldSwap->pNext; pEntry; pEntry = pEntry->pNext)
- DMX_GET_WINDOW_PRIV(pEntry->pWin)->swapGroup
- = pOldSwap->pNext;
-
- /* Update the barrier list as well */
- if (pOldSwap->barrier)
- UpdateSwapBarrierList(pOldSwap->barrier,
- pOldSwap, pOldSwap->pNext);
-
- /* Set pSwapGroup to point to the swap group without
- * pOldSwap */
- pSwapGroup = pOldSwap->pNext;
- }
-
- /* Check to see if current swap group can now swap since we
- * know at this point that pDraw and pMember are guaranteed
- * to previously be in different swap groups */
- if (pSwapGroup && SwapGroupIsReadyToSwap(pSwapGroup)) {
- SwapSwapGroup(pSwapGroup);
- }
-
- /* Make the old swap entry a standalone group */
- pOldSwap->pNext = NULL;
- pOldSwap->barrier = 0;
-
- /* Reset pWin's swap group */
- pWinPriv->swapGroup = NULL;
- pWinPriv->windowDestroyed = NULL;
- pWinPriv->windowUnmapped = NULL;
- }
-
- if (!pMember || pMember->type != DRAWABLE_WINDOW) {
- /* Free old swap group since it is no longer needed */
- if (pOldSwap) FreeSwapEntry(pOldSwap);
- } else if (pDraw == pMember && pOldSwap) {
- /* Special case where pDraw was previously created and we
- * are now just putting it to its own swap group */
- pWinPriv->swapGroup = pOldSwap;
- pWinPriv->windowDestroyed = SGWindowDestroyed;
- pWinPriv->windowUnmapped = SGWindowUnmapped;
-
- /* Check to see if pDraw is ready to swap */
- if (SwapGroupIsReadyToSwap(pOldSwap))
- SwapSwapGroup(pOldSwap);
- } else if (pMember->type == DRAWABLE_WINDOW) {
- WindowPtr pMemberWin = (WindowPtr)pMember;
- dmxWinPrivPtr pMemberPriv = DMX_GET_WINDOW_PRIV(pMemberWin);
- SwapGroupPtr pMemberSwapGroup = pMemberPriv->swapGroup;
-
- /* Finally, how we can add pDraw to pMember's swap group */
-
- /* If pMember is not currently in a swap group, then create
- * one for it since we are just about to add pDraw to it. */
- if (!pMemberSwapGroup) {
- /* Create new swap group */
- pMemberSwapGroup = CreateSwapEntry(pMemberWin);
- if (!pMemberSwapGroup) {
- if (pOldSwap) FreeSwapEntry(pOldSwap);
- return BadAlloc;
- }
-
- /* Set pMember's swap group */
- pMemberPriv->swapGroup = pMemberSwapGroup;
- pMemberPriv->windowDestroyed = SGWindowDestroyed;
- pMemberPriv->windowUnmapped = SGWindowUnmapped;
- }
-
- /* If pDraw == pMember, that means pDraw was not a member of
- * a group previously (or it would have been handled by the
- * special case above), so no additional work is required
- * since we just created a new swap group for pMember (i.e.,
- * pDraw). */
-
- if (pDraw != pMember) {
- /* If pDraw was not previously in a swap group, then create
- * an entry for it */
- if (!pOldSwap) {
- /* Create new swap group */
- pOldSwap = CreateSwapEntry(pWin);
- if (!pOldSwap) {
- /* If we just created a swap group for pMember, we
- * need to free it here */
- if (pMemberSwapGroup->pNext == NULL) {
- FreeSwapEntry(pMemberSwapGroup);
- pMemberPriv->swapGroup = NULL;
- }
- return BadAlloc;
- }
- }
-
- /* Find last entry in pMember's swap group */
- for (pEntry = pMemberSwapGroup;
- pEntry->pNext;
- pEntry = pEntry->pNext);
-
- /* Add pDraw's swap group entry to pMember's swap group list */
- pEntry->pNext = pOldSwap;
-
- /* Add pDraw to pMember's swap barrier */
- pOldSwap->barrier = pEntry->barrier;
-
- /* Set pDraw's swap group */
- pWinPriv->swapGroup = pMemberSwapGroup;
- pWinPriv->windowDestroyed = SGWindowDestroyed;
- pWinPriv->windowUnmapped = SGWindowUnmapped;
- }
- }
+ WindowPtr pWin = (WindowPtr) pDraw;
+ dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWin);
+ SwapGroupPtr pOldSwap = NULL;
+ SwapGroupPtr pEntry;
+
+ /* If pDraw and pMember are already members of the same swap
+ * group, just return Success since there is nothing to do */
+ for (pEntry = pWinPriv->swapGroup; pEntry; pEntry = pEntry->pNext)
+ if (pEntry->pWin == (WindowPtr) pMember)
+ return Success;
+
+ /* Remove pDraw from its current swap group */
+ if (pWinPriv->swapGroup) {
+ SwapGroupPtr pSwapGroup = pWinPriv->swapGroup;
+ SwapGroupPtr pPrev;
+
+ /* Find old swap entry in swap group and save in pOldSwap
+ * for later use */
+ for (pOldSwap = pWinPriv->swapGroup, pPrev = NULL;
+ pOldSwap && pOldSwap->pWin != pWin;
+ pPrev = pOldSwap, pOldSwap = pOldSwap->pNext);
+ if (!pOldSwap)
+ return BadDrawable;
+
+ /* Remove pDraw's swap group entry from swap group list */
+ if (pPrev) {
+ pPrev->pNext = pOldSwap->pNext;
+ }
+ else {
+ /* pWin is at the head of the swap group list, so we
+ * need to update all other members of this swap
+ * group */
+ for (pEntry = pOldSwap->pNext; pEntry; pEntry = pEntry->pNext)
+ DMX_GET_WINDOW_PRIV(pEntry->pWin)->swapGroup
+ = pOldSwap->pNext;
+
+ /* Update the barrier list as well */
+ if (pOldSwap->barrier)
+ UpdateSwapBarrierList(pOldSwap->barrier,
+ pOldSwap, pOldSwap->pNext);
+
+ /* Set pSwapGroup to point to the swap group without
+ * pOldSwap */
+ pSwapGroup = pOldSwap->pNext;
+ }
+
+ /* Check to see if current swap group can now swap since we
+ * know at this point that pDraw and pMember are guaranteed
+ * to previously be in different swap groups */
+ if (pSwapGroup && SwapGroupIsReadyToSwap(pSwapGroup)) {
+ SwapSwapGroup(pSwapGroup);
+ }
+
+ /* Make the old swap entry a standalone group */
+ pOldSwap->pNext = NULL;
+ pOldSwap->barrier = 0;
+
+ /* Reset pWin's swap group */
+ pWinPriv->swapGroup = NULL;
+ pWinPriv->windowDestroyed = NULL;
+ pWinPriv->windowUnmapped = NULL;
+ }
+
+ if (!pMember || pMember->type != DRAWABLE_WINDOW) {
+ /* Free old swap group since it is no longer needed */
+ if (pOldSwap)
+ FreeSwapEntry(pOldSwap);
+ }
+ else if (pDraw == pMember && pOldSwap) {
+ /* Special case where pDraw was previously created and we
+ * are now just putting it to its own swap group */
+ pWinPriv->swapGroup = pOldSwap;
+ pWinPriv->windowDestroyed = SGWindowDestroyed;
+ pWinPriv->windowUnmapped = SGWindowUnmapped;
+
+ /* Check to see if pDraw is ready to swap */
+ if (SwapGroupIsReadyToSwap(pOldSwap))
+ SwapSwapGroup(pOldSwap);
+ }
+ else if (pMember->type == DRAWABLE_WINDOW) {
+ WindowPtr pMemberWin = (WindowPtr) pMember;
+ dmxWinPrivPtr pMemberPriv = DMX_GET_WINDOW_PRIV(pMemberWin);
+ SwapGroupPtr pMemberSwapGroup = pMemberPriv->swapGroup;
+
+ /* Finally, how we can add pDraw to pMember's swap group */
+
+ /* If pMember is not currently in a swap group, then create
+ * one for it since we are just about to add pDraw to it. */
+ if (!pMemberSwapGroup) {
+ /* Create new swap group */
+ pMemberSwapGroup = CreateSwapEntry(pMemberWin);
+ if (!pMemberSwapGroup) {
+ if (pOldSwap)
+ FreeSwapEntry(pOldSwap);
+ return BadAlloc;
+ }
+
+ /* Set pMember's swap group */
+ pMemberPriv->swapGroup = pMemberSwapGroup;
+ pMemberPriv->windowDestroyed = SGWindowDestroyed;
+ pMemberPriv->windowUnmapped = SGWindowUnmapped;
+ }
+
+ /* If pDraw == pMember, that means pDraw was not a member of
+ * a group previously (or it would have been handled by the
+ * special case above), so no additional work is required
+ * since we just created a new swap group for pMember (i.e.,
+ * pDraw). */
+
+ if (pDraw != pMember) {
+ /* If pDraw was not previously in a swap group, then create
+ * an entry for it */
+ if (!pOldSwap) {
+ /* Create new swap group */
+ pOldSwap = CreateSwapEntry(pWin);
+ if (!pOldSwap) {
+ /* If we just created a swap group for pMember, we
+ * need to free it here */
+ if (pMemberSwapGroup->pNext == NULL) {
+ FreeSwapEntry(pMemberSwapGroup);
+ pMemberPriv->swapGroup = NULL;
+ }
+ return BadAlloc;
+ }
+ }
+
+ /* Find last entry in pMember's swap group */
+ for (pEntry = pMemberSwapGroup;
+ pEntry->pNext; pEntry = pEntry->pNext);
+
+ /* Add pDraw's swap group entry to pMember's swap group list */
+ pEntry->pNext = pOldSwap;
+
+ /* Add pDraw to pMember's swap barrier */
+ pOldSwap->barrier = pEntry->barrier;
+
+ /* Set pDraw's swap group */
+ pWinPriv->swapGroup = pMemberSwapGroup;
+ pWinPriv->windowDestroyed = SGWindowDestroyed;
+ pWinPriv->windowUnmapped = SGWindowUnmapped;
+ }
+ }
}
return Success;
}
-
/************************************************************************
*
* Swap Barriers
@@ -383,47 +396,51 @@ int JoinSwapGroupSGIX(DrawablePtr pDraw, DrawablePtr pMember)
typedef struct _SwapBarrier *SwapBarrierPtr;
typedef struct _SwapBarrier {
- SwapGroupPtr pSwap;
- SwapBarrierPtr pNext;
+ SwapGroupPtr pSwap;
+ SwapBarrierPtr pNext;
} SwapBarrierRec;
-static SwapBarrierPtr SwapBarrierList[GLX_MAX_SWAP_BARRIERS+1];
+static SwapBarrierPtr SwapBarrierList[GLX_MAX_SWAP_BARRIERS + 1];
-void SwapBarrierInit(void)
+void
+SwapBarrierInit(void)
{
- int i;
+ int i;
for (i = 0; i <= GLX_MAX_SWAP_BARRIERS; i++)
- SwapBarrierList[i] = NULL;
+ SwapBarrierList[i] = NULL;
}
-void SwapBarrierReset(void)
+void
+SwapBarrierReset(void)
{
- int i;
+ int i;
for (i = 0; i <= GLX_MAX_SWAP_BARRIERS; i++) {
- SwapBarrierPtr pBarrier, pNextBarrier;
- for (pBarrier = SwapBarrierList[i];
- pBarrier;
- pBarrier = pNextBarrier) {
- pNextBarrier = pBarrier->pNext;
- free(pBarrier);
- }
- SwapBarrierList[i] = NULL;
+ SwapBarrierPtr pBarrier, pNextBarrier;
+
+ for (pBarrier = SwapBarrierList[i]; pBarrier; pBarrier = pNextBarrier) {
+ pNextBarrier = pBarrier->pNext;
+ free(pBarrier);
+ }
+ SwapBarrierList[i] = NULL;
}
}
-int QueryMaxSwapBarriersSGIX(int screen)
+int
+QueryMaxSwapBarriersSGIX(int screen)
{
return GLX_MAX_SWAP_BARRIERS;
}
-static Bool BindSwapGroupToBarrier(GLuint barrier, SwapGroupPtr pSwapGroup)
+static Bool
+BindSwapGroupToBarrier(GLuint barrier, SwapGroupPtr pSwapGroup)
{
- SwapBarrierPtr pBarrier;
+ SwapBarrierPtr pBarrier;
pBarrier = malloc(sizeof(*pBarrier));
- if (!pBarrier) return FALSE;
+ if (!pBarrier)
+ return FALSE;
/* Add the swap group to barrier's list */
pBarrier->pSwap = pSwapGroup;
@@ -433,19 +450,23 @@ static Bool BindSwapGroupToBarrier(GLuint barrier, SwapGroupPtr pSwapGroup)
return TRUE;
}
-static Bool UnbindSwapGroupFromBarrier(GLuint barrier, SwapGroupPtr pSwapGroup)
+static Bool
+UnbindSwapGroupFromBarrier(GLuint barrier, SwapGroupPtr pSwapGroup)
{
- SwapBarrierPtr pBarrier, pPrevBarrier;
+ SwapBarrierPtr pBarrier, pPrevBarrier;
/* Find the swap group in barrier's list */
for (pBarrier = SwapBarrierList[barrier], pPrevBarrier = NULL;
- pBarrier && pBarrier->pSwap != pSwapGroup;
- pPrevBarrier = pBarrier, pBarrier = pBarrier->pNext);
- if (!pBarrier) return FALSE;
+ pBarrier && pBarrier->pSwap != pSwapGroup;
+ pPrevBarrier = pBarrier, pBarrier = pBarrier->pNext);
+ if (!pBarrier)
+ return FALSE;
/* Remove the swap group from barrier's list */
- if (pPrevBarrier) pPrevBarrier->pNext = pBarrier->pNext;
- else SwapBarrierList[barrier] = pBarrier->pNext;
+ if (pPrevBarrier)
+ pPrevBarrier->pNext = pBarrier->pNext;
+ else
+ SwapBarrierList[barrier] = pBarrier->pNext;
/* Free memory */
free(pBarrier);
@@ -453,85 +474,88 @@ static Bool UnbindSwapGroupFromBarrier(GLuint barrier, SwapGroupPtr pSwapGroup)
return TRUE;
}
-static void UpdateSwapBarrierList(GLuint barrier,
- SwapGroupPtr pOldSwap,
- SwapGroupPtr pNewSwap)
+static void
+UpdateSwapBarrierList(GLuint barrier,
+ SwapGroupPtr pOldSwap, SwapGroupPtr pNewSwap)
{
- SwapBarrierPtr pBarrier;
+ SwapBarrierPtr pBarrier;
/* If the old swap group is being destroyed, then we need to remove
* the swap group from the list entirely */
if (!pNewSwap) {
- UnbindSwapGroupFromBarrier(barrier, pOldSwap);
- return;
+ UnbindSwapGroupFromBarrier(barrier, pOldSwap);
+ return;
}
/* Otherwise, find the old swap group in the barrier list and change
* it to the new swap group */
for (pBarrier = SwapBarrierList[barrier];
- pBarrier;
- pBarrier = pBarrier->pNext) {
- if (pBarrier->pSwap == pOldSwap) {
- pBarrier->pSwap = pNewSwap;
- return;
- }
+ pBarrier; pBarrier = pBarrier->pNext) {
+ if (pBarrier->pSwap == pOldSwap) {
+ pBarrier->pSwap = pNewSwap;
+ return;
+ }
}
}
-static Bool SwapBarrierIsReadyToSwap(GLuint barrier)
+static Bool
+SwapBarrierIsReadyToSwap(GLuint barrier)
{
- SwapBarrierPtr pBarrier;
- Bool isReady = TRUE;
+ SwapBarrierPtr pBarrier;
+ Bool isReady = TRUE;
/* The swap barier is ready to swap when swap groups that are bound
* to barrier are ready to swap */
for (pBarrier = SwapBarrierList[barrier];
- pBarrier;
- pBarrier = pBarrier->pNext)
- isReady &= SwapGroupIsReadyToSwap(pBarrier->pSwap);
+ pBarrier; pBarrier = pBarrier->pNext)
+ isReady &= SwapGroupIsReadyToSwap(pBarrier->pSwap);
return isReady;
}
-static void SwapSwapBarrier(GLuint barrier)
+static void
+SwapSwapBarrier(GLuint barrier)
{
- SwapBarrierPtr pBarrier;
+ SwapBarrierPtr pBarrier;
/* Swap each group that is a member of this barrier */
for (pBarrier = SwapBarrierList[barrier];
- pBarrier;
- pBarrier = pBarrier->pNext)
- SwapSwapGroup(pBarrier->pSwap);
+ pBarrier; pBarrier = pBarrier->pNext)
+ SwapSwapGroup(pBarrier->pSwap);
}
-int BindSwapBarrierSGIX(DrawablePtr pDraw, int barrier)
+int
+BindSwapBarrierSGIX(DrawablePtr pDraw, int barrier)
{
/* FIXME: Check for errors when pDraw->type != DRAWABLE_WINDOW */
if (barrier < 0 || barrier > GLX_MAX_SWAP_BARRIERS)
- return BadValue;
+ return BadValue;
if (pDraw->type == DRAWABLE_WINDOW) {
- WindowPtr pWin = (WindowPtr)pDraw;
- dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWin);
- SwapGroupPtr pSwapGroup = pWinPriv->swapGroup;
- SwapGroupPtr pCur;
-
- if (!pSwapGroup) return BadDrawable;
- if (barrier && pSwapGroup->barrier) return BadValue;
-
- /* Update the swap barrier list */
- if (barrier) {
- if (!BindSwapGroupToBarrier(barrier, pSwapGroup))
- return BadAlloc;
- } else {
- if (!UnbindSwapGroupFromBarrier(pSwapGroup->barrier, pSwapGroup))
- return BadDrawable;
- }
-
- /* Set the barrier for each member of this swap group */
- for (pCur = pSwapGroup; pCur; pCur = pCur->pNext)
- pCur->barrier = barrier;
+ WindowPtr pWin = (WindowPtr) pDraw;
+ dmxWinPrivPtr pWinPriv = DMX_GET_WINDOW_PRIV(pWin);
+ SwapGroupPtr pSwapGroup = pWinPriv->swapGroup;
+ SwapGroupPtr pCur;
+
+ if (!pSwapGroup)
+ return BadDrawable;
+ if (barrier && pSwapGroup->barrier)
+ return BadValue;
+
+ /* Update the swap barrier list */
+ if (barrier) {
+ if (!BindSwapGroupToBarrier(barrier, pSwapGroup))
+ return BadAlloc;
+ }
+ else {
+ if (!UnbindSwapGroupFromBarrier(pSwapGroup->barrier, pSwapGroup))
+ return BadDrawable;
+ }
+
+ /* Set the barrier for each member of this swap group */
+ for (pCur = pSwapGroup; pCur; pCur = pCur->pNext)
+ pCur->barrier = barrier;
}
return Success;
diff --git a/hw/dmx/glxProxy/glxswap.h b/hw/dmx/glxProxy/glxswap.h
index 08e38df7b..1e1fea14f 100644
--- a/hw/dmx/glxProxy/glxswap.h
+++ b/hw/dmx/glxProxy/glxswap.h
@@ -34,13 +34,13 @@
#ifndef __GLX_swap_h__
#define __GLX_swap_h__
-extern int JoinSwapGroupSGIX(DrawablePtr pDraw, DrawablePtr pMember);
-extern int SGSwapBuffers(__GLXclientState *cl, XID drawId, GLXContextTag tag,
- DrawablePtr pDraw);
+extern int JoinSwapGroupSGIX(DrawablePtr pDraw, DrawablePtr pMember);
+extern int SGSwapBuffers(__GLXclientState * cl, XID drawId, GLXContextTag tag,
+ DrawablePtr pDraw);
extern void SwapBarrierInit(void);
extern void SwapBarrierReset(void);
-extern int QueryMaxSwapBarriersSGIX(int screen);
-extern int BindSwapBarrierSGIX(DrawablePtr pDraw, int barrier);
+extern int QueryMaxSwapBarriersSGIX(int screen);
+extern int BindSwapBarrierSGIX(DrawablePtr pDraw, int barrier);
-#endif /* !__GLX_swap_h__ */
+#endif /* !__GLX_swap_h__ */
diff --git a/hw/dmx/glxProxy/glxutil.c b/hw/dmx/glxProxy/glxutil.c
index c519d14a2..f90dbf141 100644
--- a/hw/dmx/glxProxy/glxutil.c
+++ b/hw/dmx/glxProxy/glxutil.c
@@ -31,4 +31,7 @@
#include "glxserver.h"
#include "glxutil.h"
-void __glXNop(void) {}
+void
+__glXNop(void)
+{
+}
diff --git a/hw/dmx/glxProxy/glxutil.h b/hw/dmx/glxProxy/glxutil.h
index 54582122b..d3c72862d 100644
--- a/hw/dmx/glxProxy/glxutil.h
+++ b/hw/dmx/glxProxy/glxutil.h
@@ -34,9 +34,8 @@
extern void __glXNop(void);
/* context helper routines */
-extern __GLXcontext *__glXLookupContextByTag(__GLXclientState*, GLXContextTag);
-extern DrawablePtr __glXLookupDrawableByTag(__GLXclientState *cl, GLXContextTag tag);
-
-
-#endif /* _glxcmds_h_ */
+extern __GLXcontext *__glXLookupContextByTag(__GLXclientState *, GLXContextTag);
+extern DrawablePtr __glXLookupDrawableByTag(__GLXclientState * cl,
+ GLXContextTag tag);
+#endif /* _glxcmds_h_ */
diff --git a/hw/dmx/glxProxy/glxvendor.c b/hw/dmx/glxProxy/glxvendor.c
index 0b6ba4134..963c92e87 100644
--- a/hw/dmx/glxProxy/glxvendor.c
+++ b/hw/dmx/glxProxy/glxvendor.c
@@ -67,7 +67,7 @@
dpy->bufptr += SIZEOF(x##name##Req);\
dpy->request++
-#else /* non-ANSI C uses empty comment instead of "##" for token concatenation */
+#else /* non-ANSI C uses empty comment instead of "##" for token concatenation */
#define GetReqVendorPrivate(name, req) \
WORD64ALIGN\
if ((dpy->bufptr + SIZEOF(x/**/name/**/Req)) > dpy->bufmax)\
@@ -78,92 +78,93 @@
dpy->request++
#endif
-extern Display *GetBackEndDisplay( __GLXclientState *cl, int s );
-extern int GetCurrentBackEndTag(__GLXclientState *cl, GLXContextTag tag, int s);
+extern Display *GetBackEndDisplay(__GLXclientState * cl, int s);
+extern int GetCurrentBackEndTag(__GLXclientState * cl, GLXContextTag tag,
+ int s);
static int swap_vec_element_size = 0;
-static void SendSwappedReply( ClientPtr client,
- xGLXVendorPrivReply *reply,
- char *buf,
- int buf_size )
+static void
+SendSwappedReply(ClientPtr client,
+ xGLXVendorPrivReply * reply, char *buf, int buf_size)
{
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_SHORT(&reply->sequenceNumber);
- __GLX_SWAP_INT(&reply->length);
- __GLX_SWAP_INT(&reply->retval);
- __GLX_SWAP_INT(&reply->size);
-
- if ( (buf_size == 0) && (swap_vec_element_size > 0) ) {
- /*
- * the reply has single component - need to swap pad3
- */
- if (swap_vec_element_size == 2) {
- __GLX_SWAP_SHORT(&reply->pad3);
- }
- else if (swap_vec_element_size == 4) {
- __GLX_SWAP_INT(&reply->pad3);
- __GLX_SWAP_INT(&reply->pad4);
- }
- else if (swap_vec_element_size == 8) {
- __GLX_SWAP_DOUBLE(&reply->pad3);
- }
- }
- else if ( (buf_size > 0) && (swap_vec_element_size > 0) ) {
- /*
- * the reply has vector of elements which needs to be swapped
- */
- int vsize = buf_size / swap_vec_element_size;
- char *p = buf;
- int i;
-
- for (i=0; i<vsize; i++) {
- if (swap_vec_element_size == 2) {
- __GLX_SWAP_SHORT(p);
- }
- else if (swap_vec_element_size == 4) {
- __GLX_SWAP_INT(p);
- }
- else if (swap_vec_element_size == 8) {
- __GLX_SWAP_DOUBLE(p);
- }
-
- p += swap_vec_element_size;
- }
-
- __GLX_SWAP_INT(&reply->pad3);
- __GLX_SWAP_INT(&reply->pad4);
- __GLX_SWAP_INT(&reply->pad5);
- __GLX_SWAP_INT(&reply->pad6);
-
- }
-
- WriteToClient(client, sizeof(xGLXVendorPrivReply),(char *)reply);
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_SWAP_SHORT(&reply->sequenceNumber);
+ __GLX_SWAP_INT(&reply->length);
+ __GLX_SWAP_INT(&reply->retval);
+ __GLX_SWAP_INT(&reply->size);
+
+ if ((buf_size == 0) && (swap_vec_element_size > 0)) {
+ /*
+ * the reply has single component - need to swap pad3
+ */
+ if (swap_vec_element_size == 2) {
+ __GLX_SWAP_SHORT(&reply->pad3);
+ }
+ else if (swap_vec_element_size == 4) {
+ __GLX_SWAP_INT(&reply->pad3);
+ __GLX_SWAP_INT(&reply->pad4);
+ }
+ else if (swap_vec_element_size == 8) {
+ __GLX_SWAP_DOUBLE(&reply->pad3);
+ }
+ }
+ else if ((buf_size > 0) && (swap_vec_element_size > 0)) {
+ /*
+ * the reply has vector of elements which needs to be swapped
+ */
+ int vsize = buf_size / swap_vec_element_size;
+ char *p = buf;
+ int i;
+
+ for (i = 0; i < vsize; i++) {
+ if (swap_vec_element_size == 2) {
+ __GLX_SWAP_SHORT(p);
+ }
+ else if (swap_vec_element_size == 4) {
+ __GLX_SWAP_INT(p);
+ }
+ else if (swap_vec_element_size == 8) {
+ __GLX_SWAP_DOUBLE(p);
+ }
+
+ p += swap_vec_element_size;
+ }
+
+ __GLX_SWAP_INT(&reply->pad3);
+ __GLX_SWAP_INT(&reply->pad4);
+ __GLX_SWAP_INT(&reply->pad5);
+ __GLX_SWAP_INT(&reply->pad6);
+
+ }
+
+ WriteToClient(client, sizeof(xGLXVendorPrivReply), (char *) reply);
if (buf_size > 0)
- WriteToClient(client, buf_size, (char *)buf);
+ WriteToClient(client, buf_size, (char *) buf);
}
-int __glXVForwardSingleReq( __GLXclientState *cl, GLbyte *pc )
+int
+__glXVForwardSingleReq(__GLXclientState * cl, GLbyte * pc)
{
- xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *)pc;
- xGLXVendorPrivateReq *be_req;
+ xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
+ xGLXVendorPrivateReq *be_req;
__GLXcontext *glxc;
- int from_screen = 0;
- int to_screen = 0;
- int buf_size;
- int s;
+ int from_screen = 0;
+ int to_screen = 0;
+ int buf_size;
+ int s;
glxc = __glXLookupContextByTag(cl, req->contextTag);
if (!glxc) {
- return 0;
+ return 0;
}
from_screen = to_screen = glxc->pScreen->myNum;
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
- from_screen = 0;
- to_screen = screenInfo.numScreens - 1;
+ from_screen = 0;
+ to_screen = screenInfo.numScreens - 1;
}
#endif
@@ -173,43 +174,44 @@ int __glXVForwardSingleReq( __GLXclientState *cl, GLbyte *pc )
/*
* just forward the request to back-end server(s)
*/
- for (s=from_screen; s<=to_screen; s++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[s];
- Display *dpy = GetBackEndDisplay(cl,s);
-
- LockDisplay(dpy);
- GetReqVendorPrivate(GLXVendorPrivate,be_req);
- be_req->reqType = dmxScreen->glxMajorOpcode;
- be_req->glxCode = req->glxCode;
- be_req->length = req->length;
- be_req->vendorCode = req->vendorCode;
- be_req->contextTag = GetCurrentBackEndTag(cl,req->contextTag,s);
- if (buf_size > 0)
- _XSend(dpy, (const char *)pc, buf_size);
- UnlockDisplay(dpy);
- SyncHandle();
+ for (s = from_screen; s <= to_screen; s++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[s];
+ Display *dpy = GetBackEndDisplay(cl, s);
+
+ LockDisplay(dpy);
+ GetReqVendorPrivate(GLXVendorPrivate, be_req);
+ be_req->reqType = dmxScreen->glxMajorOpcode;
+ be_req->glxCode = req->glxCode;
+ be_req->length = req->length;
+ be_req->vendorCode = req->vendorCode;
+ be_req->contextTag = GetCurrentBackEndTag(cl, req->contextTag, s);
+ if (buf_size > 0)
+ _XSend(dpy, (const char *) pc, buf_size);
+ UnlockDisplay(dpy);
+ SyncHandle();
}
return Success;
}
-int __glXVForwardPipe0WithReply( __GLXclientState *cl, GLbyte *pc )
+int
+__glXVForwardPipe0WithReply(__GLXclientState * cl, GLbyte * pc)
{
- ClientPtr client = cl->client;
- xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *)pc;
- xGLXVendorPrivateReq *be_req;
- xGLXVendorPrivReply reply;
- xGLXVendorPrivReply be_reply;
+ ClientPtr client = cl->client;
+ xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
+ xGLXVendorPrivateReq *be_req;
+ xGLXVendorPrivReply reply;
+ xGLXVendorPrivReply be_reply;
__GLXcontext *glxc;
- int buf_size;
- char *be_buf = NULL;
- int be_buf_size;
- DMXScreenInfo *dmxScreen;
- Display *dpy;
+ int buf_size;
+ char *be_buf = NULL;
+ int be_buf_size;
+ DMXScreenInfo *dmxScreen;
+ Display *dpy;
glxc = __glXLookupContextByTag(cl, req->contextTag);
if (!glxc) {
- return __glXBadContext;
+ return __glXBadContext;
}
pc += sz_xGLXVendorPrivateReq;
@@ -222,30 +224,31 @@ int __glXVForwardPipe0WithReply( __GLXclientState *cl, GLbyte *pc )
* send the request to the first back-end server
*/
LockDisplay(dpy);
- GetReqVendorPrivate(GLXVendorPrivate,be_req);
+ GetReqVendorPrivate(GLXVendorPrivate, be_req);
be_req->reqType = dmxScreen->glxMajorOpcode;
be_req->glxCode = req->glxCode;
be_req->length = req->length;
be_req->vendorCode = req->vendorCode;
- be_req->contextTag = GetCurrentBackEndTag(cl,req->contextTag, glxc->pScreen->myNum);
- if (buf_size > 0)
- _XSend(dpy, (const char *)pc, buf_size);
+ be_req->contextTag =
+ GetCurrentBackEndTag(cl, req->contextTag, glxc->pScreen->myNum);
+ if (buf_size > 0)
+ _XSend(dpy, (const char *) pc, buf_size);
/*
* get the reply from the back-end server
*/
- _XReply(dpy, (xReply*) &be_reply, 0, False);
+ _XReply(dpy, (xReply *) & be_reply, 0, False);
be_buf_size = be_reply.length << 2;
if (be_buf_size > 0) {
- be_buf = (char *)malloc( be_buf_size );
- if (be_buf) {
- _XRead(dpy, be_buf, be_buf_size);
- }
- else {
- /* Throw data on the floor */
- _XEatData(dpy, be_buf_size);
- return BadAlloc;
- }
+ be_buf = (char *) malloc(be_buf_size);
+ if (be_buf) {
+ _XRead(dpy, be_buf, be_buf_size);
+ }
+ else {
+ /* Throw data on the floor */
+ _XEatData(dpy, be_buf_size);
+ return BadAlloc;
+ }
}
UnlockDisplay(dpy);
@@ -254,52 +257,54 @@ int __glXVForwardPipe0WithReply( __GLXclientState *cl, GLbyte *pc )
/*
* send the reply to the client
*/
- memcpy( &reply, &be_reply, sz_xGLXVendorPrivReply );
+ memcpy(&reply, &be_reply, sz_xGLXVendorPrivReply);
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
if (client->swapped) {
- SendSwappedReply( client, &reply, be_buf, be_buf_size );
+ SendSwappedReply(client, &reply, be_buf, be_buf_size);
}
else {
- WriteToClient(client, sizeof(xGLXVendorPrivReply),(char *)&reply);
- if (be_buf_size > 0)
- WriteToClient(client, be_buf_size, (char *)be_buf);
+ WriteToClient(client, sizeof(xGLXVendorPrivReply), (char *) &reply);
+ if (be_buf_size > 0)
+ WriteToClient(client, be_buf_size, (char *) be_buf);
}
- if (be_buf_size > 0) free(be_buf);
+ if (be_buf_size > 0)
+ free(be_buf);
return Success;
}
-int __glXVForwardAllWithReply( __GLXclientState *cl, GLbyte *pc )
+int
+__glXVForwardAllWithReply(__GLXclientState * cl, GLbyte * pc)
{
- ClientPtr client = cl->client;
- xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *)pc;
- xGLXVendorPrivateReq *be_req;
- xGLXVendorPrivReply reply;
- xGLXVendorPrivReply be_reply;
+ ClientPtr client = cl->client;
+ xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
+ xGLXVendorPrivateReq *be_req;
+ xGLXVendorPrivReply reply;
+ xGLXVendorPrivReply be_reply;
__GLXcontext *glxc;
- int buf_size;
- char *be_buf = NULL;
- int be_buf_size = 0;
- int from_screen = 0;
- int to_screen = 0;
- int s;
+ int buf_size;
+ char *be_buf = NULL;
+ int be_buf_size = 0;
+ int from_screen = 0;
+ int to_screen = 0;
+ int s;
- DMXScreenInfo *dmxScreen;
- Display *dpy;
+ DMXScreenInfo *dmxScreen;
+ Display *dpy;
glxc = __glXLookupContextByTag(cl, req->contextTag);
if (!glxc) {
- return 0;
+ return 0;
}
from_screen = to_screen = glxc->pScreen->myNum;
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
- from_screen = 0;
- to_screen = screenInfo.numScreens - 1;
+ from_screen = 0;
+ to_screen = screenInfo.numScreens - 1;
}
#endif
@@ -309,277 +314,303 @@ int __glXVForwardAllWithReply( __GLXclientState *cl, GLbyte *pc )
/*
* send the request to the first back-end server(s)
*/
- for (s=to_screen; s>=from_screen; s--) {
- dmxScreen = &dmxScreens[s];
- dpy = GetBackEndDisplay(cl,s);
-
- LockDisplay(dpy);
- GetReqVendorPrivate(GLXVendorPrivate,be_req);
- be_req->reqType = dmxScreen->glxMajorOpcode;
- be_req->glxCode = req->glxCode;
- be_req->length = req->length;
- be_req->vendorCode = req->vendorCode;
- be_req->contextTag = GetCurrentBackEndTag(cl,req->contextTag,s);
- if (buf_size > 0)
- _XSend(dpy, (const char *)pc, buf_size);
-
- /*
- * get the reply from the back-end server
- */
- _XReply(dpy, (xReply*) &be_reply, 0, False);
- be_buf_size = be_reply.length << 2;
- if (be_buf_size > 0) {
- be_buf = (char *)malloc( be_buf_size );
- if (be_buf) {
- _XRead(dpy, be_buf, be_buf_size);
- }
- else {
- /* Throw data on the floor */
- _XEatData(dpy, be_buf_size);
- return BadAlloc;
- }
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
-
- if (s > from_screen && be_buf_size > 0) {
- free(be_buf);
- }
+ for (s = to_screen; s >= from_screen; s--) {
+ dmxScreen = &dmxScreens[s];
+ dpy = GetBackEndDisplay(cl, s);
+
+ LockDisplay(dpy);
+ GetReqVendorPrivate(GLXVendorPrivate, be_req);
+ be_req->reqType = dmxScreen->glxMajorOpcode;
+ be_req->glxCode = req->glxCode;
+ be_req->length = req->length;
+ be_req->vendorCode = req->vendorCode;
+ be_req->contextTag = GetCurrentBackEndTag(cl, req->contextTag, s);
+ if (buf_size > 0)
+ _XSend(dpy, (const char *) pc, buf_size);
+
+ /*
+ * get the reply from the back-end server
+ */
+ _XReply(dpy, (xReply *) & be_reply, 0, False);
+ be_buf_size = be_reply.length << 2;
+ if (be_buf_size > 0) {
+ be_buf = (char *) malloc(be_buf_size);
+ if (be_buf) {
+ _XRead(dpy, be_buf, be_buf_size);
+ }
+ else {
+ /* Throw data on the floor */
+ _XEatData(dpy, be_buf_size);
+ return BadAlloc;
+ }
+ }
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+
+ if (s > from_screen && be_buf_size > 0) {
+ free(be_buf);
+ }
}
/*
* send the reply to the client
*/
- memcpy( &reply, &be_reply, sz_xGLXVendorPrivReply );
+ memcpy(&reply, &be_reply, sz_xGLXVendorPrivReply);
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
if (client->swapped) {
- SendSwappedReply( client, &reply, be_buf, be_buf_size );
+ SendSwappedReply(client, &reply, be_buf, be_buf_size);
}
else {
- WriteToClient(client, sizeof(xGLXVendorPrivReply),(char *)&reply);
- if (be_buf_size > 0)
- WriteToClient(client, be_buf_size, (char *)be_buf);
+ WriteToClient(client, sizeof(xGLXVendorPrivReply), (char *) &reply);
+ if (be_buf_size > 0)
+ WriteToClient(client, be_buf_size, (char *) be_buf);
}
- if (be_buf_size > 0) free(be_buf);
+ if (be_buf_size > 0)
+ free(be_buf);
return Success;
}
-int __glXVForwardSingleReqSwap( __GLXclientState *cl, GLbyte *pc )
+int
+__glXVForwardSingleReqSwap(__GLXclientState * cl, GLbyte * pc)
{
- xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *)pc;
- __GLX_DECLARE_SWAP_VARIABLES;
+ xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->vendorCode);
- __GLX_SWAP_INT(&req->contextTag);
+ __GLX_DECLARE_SWAP_VARIABLES;
- swap_vec_element_size = 0;
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->vendorCode);
+ __GLX_SWAP_INT(&req->contextTag);
- return( __glXVForwardSingleReq( cl, pc ) );
+ swap_vec_element_size = 0;
+
+ return (__glXVForwardSingleReq(cl, pc));
}
-int __glXVForwardPipe0WithReplySwap( __GLXclientState *cl, GLbyte *pc )
+int
+__glXVForwardPipe0WithReplySwap(__GLXclientState * cl, GLbyte * pc)
{
- xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *)pc;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->vendorCode);
- __GLX_SWAP_INT(&req->contextTag);
-
- swap_vec_element_size = 0;
-
- /*
- * swap extra data in request - assuming all data
- * (if available) are arrays of 4 bytes components !
- */
- if (req->length > sz_xGLXVendorPrivateReq/4) {
- int *data = (int *)(req+1);
- int count = req->length - sz_xGLXVendorPrivateReq/4;
- __GLX_SWAP_INT_ARRAY(data, count );
- }
-
- return( __glXVForwardPipe0WithReply( cl, pc ) );
+ xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->vendorCode);
+ __GLX_SWAP_INT(&req->contextTag);
+
+ swap_vec_element_size = 0;
+
+ /*
+ * swap extra data in request - assuming all data
+ * (if available) are arrays of 4 bytes components !
+ */
+ if (req->length > sz_xGLXVendorPrivateReq / 4) {
+ int *data = (int *) (req + 1);
+ int count = req->length - sz_xGLXVendorPrivateReq / 4;
+
+ __GLX_SWAP_INT_ARRAY(data, count);
+ }
+
+ return (__glXVForwardPipe0WithReply(cl, pc));
}
-int __glXVForwardPipe0WithReplySwapsv( __GLXclientState *cl, GLbyte *pc )
+int
+__glXVForwardPipe0WithReplySwapsv(__GLXclientState * cl, GLbyte * pc)
{
- xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *)pc;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->vendorCode);
- __GLX_SWAP_INT(&req->contextTag);
-
- swap_vec_element_size = 2;
-
- /*
- * swap extra data in request - assuming all data
- * (if available) are arrays of 4 bytes components !
- */
- if (req->length > sz_xGLXVendorPrivateReq/4) {
- int *data = (int *)(req+1);
- int count = req->length - sz_xGLXVendorPrivateReq/4;
- __GLX_SWAP_INT_ARRAY(data, count );
- }
-
- return( __glXVForwardPipe0WithReply( cl, pc ) );
+ xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->vendorCode);
+ __GLX_SWAP_INT(&req->contextTag);
+
+ swap_vec_element_size = 2;
+
+ /*
+ * swap extra data in request - assuming all data
+ * (if available) are arrays of 4 bytes components !
+ */
+ if (req->length > sz_xGLXVendorPrivateReq / 4) {
+ int *data = (int *) (req + 1);
+ int count = req->length - sz_xGLXVendorPrivateReq / 4;
+
+ __GLX_SWAP_INT_ARRAY(data, count);
+ }
+
+ return (__glXVForwardPipe0WithReply(cl, pc));
}
-int __glXVForwardPipe0WithReplySwapiv( __GLXclientState *cl, GLbyte *pc )
+int
+__glXVForwardPipe0WithReplySwapiv(__GLXclientState * cl, GLbyte * pc)
{
- xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *)pc;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->vendorCode);
- __GLX_SWAP_INT(&req->contextTag);
-
- swap_vec_element_size = 4;
-
- /*
- * swap extra data in request - assuming all data
- * (if available) are arrays of 4 bytes components !
- */
- if (req->length > sz_xGLXVendorPrivateReq/4) {
- int *data = (int *)(req+1);
- int count = req->length - sz_xGLXVendorPrivateReq/4;
- __GLX_SWAP_INT_ARRAY(data, count );
- }
-
- return( __glXVForwardPipe0WithReply( cl, pc ) );
+ xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->vendorCode);
+ __GLX_SWAP_INT(&req->contextTag);
+
+ swap_vec_element_size = 4;
+
+ /*
+ * swap extra data in request - assuming all data
+ * (if available) are arrays of 4 bytes components !
+ */
+ if (req->length > sz_xGLXVendorPrivateReq / 4) {
+ int *data = (int *) (req + 1);
+ int count = req->length - sz_xGLXVendorPrivateReq / 4;
+
+ __GLX_SWAP_INT_ARRAY(data, count);
+ }
+
+ return (__glXVForwardPipe0WithReply(cl, pc));
}
-int __glXVForwardPipe0WithReplySwapdv( __GLXclientState *cl, GLbyte *pc )
+int
+__glXVForwardPipe0WithReplySwapdv(__GLXclientState * cl, GLbyte * pc)
{
- xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *)pc;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->vendorCode);
- __GLX_SWAP_INT(&req->contextTag);
-
- swap_vec_element_size = 8;
-
- /*
- * swap extra data in request - assuming all data
- * (if available) are arrays of 4 bytes components !
- */
- if (req->length > sz_xGLXVendorPrivateReq/4) {
- int *data = (int *)(req+1);
- int count = req->length - sz_xGLXVendorPrivateReq/4;
- __GLX_SWAP_INT_ARRAY(data, count );
- }
-
- return( __glXVForwardPipe0WithReply( cl, pc ) );
+ xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->vendorCode);
+ __GLX_SWAP_INT(&req->contextTag);
+
+ swap_vec_element_size = 8;
+
+ /*
+ * swap extra data in request - assuming all data
+ * (if available) are arrays of 4 bytes components !
+ */
+ if (req->length > sz_xGLXVendorPrivateReq / 4) {
+ int *data = (int *) (req + 1);
+ int count = req->length - sz_xGLXVendorPrivateReq / 4;
+
+ __GLX_SWAP_INT_ARRAY(data, count);
+ }
+
+ return (__glXVForwardPipe0WithReply(cl, pc));
}
-int __glXVForwardAllWithReplySwap( __GLXclientState *cl, GLbyte *pc )
+int
+__glXVForwardAllWithReplySwap(__GLXclientState * cl, GLbyte * pc)
{
- xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *)pc;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->vendorCode);
- __GLX_SWAP_INT(&req->contextTag);
-
- swap_vec_element_size = 0;
-
- /*
- * swap extra data in request - assuming all data
- * (if available) are arrays of 4 bytes components !
- */
- if (req->length > sz_xGLXVendorPrivateReq/4) {
- int *data = (int *)(req+1);
- int count = req->length - sz_xGLXVendorPrivateReq/4;
- __GLX_SWAP_INT_ARRAY(data, count );
- }
-
- return( __glXVForwardAllWithReply( cl, pc ) );
+ xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->vendorCode);
+ __GLX_SWAP_INT(&req->contextTag);
+
+ swap_vec_element_size = 0;
+
+ /*
+ * swap extra data in request - assuming all data
+ * (if available) are arrays of 4 bytes components !
+ */
+ if (req->length > sz_xGLXVendorPrivateReq / 4) {
+ int *data = (int *) (req + 1);
+ int count = req->length - sz_xGLXVendorPrivateReq / 4;
+
+ __GLX_SWAP_INT_ARRAY(data, count);
+ }
+
+ return (__glXVForwardAllWithReply(cl, pc));
}
-int __glXVForwardAllWithReplySwapsv( __GLXclientState *cl, GLbyte *pc )
+int
+__glXVForwardAllWithReplySwapsv(__GLXclientState * cl, GLbyte * pc)
{
- xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *)pc;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->vendorCode);
- __GLX_SWAP_INT(&req->contextTag);
-
- swap_vec_element_size = 2;
-
- /*
- * swap extra data in request - assuming all data
- * (if available) are arrays of 4 bytes components !
- */
- if (req->length > sz_xGLXVendorPrivateReq/4) {
- int *data = (int *)(req+1);
- int count = req->length - sz_xGLXVendorPrivateReq/4;
- __GLX_SWAP_INT_ARRAY(data, count );
- }
-
- return( __glXVForwardAllWithReply( cl, pc ) );
+ xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->vendorCode);
+ __GLX_SWAP_INT(&req->contextTag);
+
+ swap_vec_element_size = 2;
+
+ /*
+ * swap extra data in request - assuming all data
+ * (if available) are arrays of 4 bytes components !
+ */
+ if (req->length > sz_xGLXVendorPrivateReq / 4) {
+ int *data = (int *) (req + 1);
+ int count = req->length - sz_xGLXVendorPrivateReq / 4;
+
+ __GLX_SWAP_INT_ARRAY(data, count);
+ }
+
+ return (__glXVForwardAllWithReply(cl, pc));
}
-int __glXVForwardAllWithReplySwapiv( __GLXclientState *cl, GLbyte *pc )
+int
+__glXVForwardAllWithReplySwapiv(__GLXclientState * cl, GLbyte * pc)
{
- xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *)pc;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->vendorCode);
- __GLX_SWAP_INT(&req->contextTag);
-
- swap_vec_element_size = 4;
-
- /*
- * swap extra data in request - assuming all data
- * (if available) are arrays of 4 bytes components !
- */
- if (req->length > sz_xGLXVendorPrivateReq/4) {
- int *data = (int *)(req+1);
- int count = req->length - sz_xGLXVendorPrivateReq/4;
- __GLX_SWAP_INT_ARRAY(data, count );
- }
-
- return( __glXVForwardAllWithReply( cl, pc ) );
+ xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
+
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->vendorCode);
+ __GLX_SWAP_INT(&req->contextTag);
+
+ swap_vec_element_size = 4;
+
+ /*
+ * swap extra data in request - assuming all data
+ * (if available) are arrays of 4 bytes components !
+ */
+ if (req->length > sz_xGLXVendorPrivateReq / 4) {
+ int *data = (int *) (req + 1);
+ int count = req->length - sz_xGLXVendorPrivateReq / 4;
+
+ __GLX_SWAP_INT_ARRAY(data, count);
+ }
+
+ return (__glXVForwardAllWithReply(cl, pc));
}
-int __glXVForwardAllWithReplySwapdv( __GLXclientState *cl, GLbyte *pc )
+int
+__glXVForwardAllWithReplySwapdv(__GLXclientState * cl, GLbyte * pc)
{
- xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *)pc;
- __GLX_DECLARE_SWAP_VARIABLES;
- __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
-
- __GLX_SWAP_SHORT(&req->length);
- __GLX_SWAP_INT(&req->vendorCode);
- __GLX_SWAP_INT(&req->contextTag);
-
- swap_vec_element_size = 8;
-
- /*
- * swap extra data in request - assuming all data
- * (if available) are arrays of 4 bytes components !
- */
- if (req->length > sz_xGLXVendorPrivateReq/4) {
- int *data = (int *)(req+1);
- int count = req->length - sz_xGLXVendorPrivateReq/4;
- __GLX_SWAP_INT_ARRAY(data, count );
- }
-
- return( __glXVForwardAllWithReply( cl, pc ) );
-}
+ xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc;
+ __GLX_DECLARE_SWAP_VARIABLES;
+ __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
+
+ __GLX_SWAP_SHORT(&req->length);
+ __GLX_SWAP_INT(&req->vendorCode);
+ __GLX_SWAP_INT(&req->contextTag);
+
+ swap_vec_element_size = 8;
+
+ /*
+ * swap extra data in request - assuming all data
+ * (if available) are arrays of 4 bytes components !
+ */
+ if (req->length > sz_xGLXVendorPrivateReq / 4) {
+ int *data = (int *) (req + 1);
+ int count = req->length - sz_xGLXVendorPrivateReq / 4;
+
+ __GLX_SWAP_INT_ARRAY(data, count);
+ }
+
+ return (__glXVForwardAllWithReply(cl, pc));
+}
diff --git a/hw/dmx/glxProxy/glxvendor.h b/hw/dmx/glxProxy/glxvendor.h
index fbc901cef..0d160ab9f 100644
--- a/hw/dmx/glxProxy/glxvendor.h
+++ b/hw/dmx/glxProxy/glxvendor.h
@@ -31,20 +31,23 @@
#ifndef __GLXVENDOR_H
#define __GLXVENDOR_H
-extern int __glXVForwardSingleReq( __GLXclientState *cl, GLbyte *pc );
-extern int __glXVForwardPipe0WithReply( __GLXclientState *cl, GLbyte *pc );
-extern int __glXVForwardAllWithReply( __GLXclientState *cl, GLbyte *pc );
+extern int __glXVForwardSingleReq(__GLXclientState * cl, GLbyte * pc);
+extern int __glXVForwardPipe0WithReply(__GLXclientState * cl, GLbyte * pc);
+extern int __glXVForwardAllWithReply(__GLXclientState * cl, GLbyte * pc);
-extern int __glXVForwardSingleReqSwap( __GLXclientState *cl, GLbyte *pc );
+extern int __glXVForwardSingleReqSwap(__GLXclientState * cl, GLbyte * pc);
-extern int __glXVForwardPipe0WithReplySwap( __GLXclientState *cl, GLbyte *pc );
-extern int __glXVForwardPipe0WithReplySwapsv( __GLXclientState *cl, GLbyte *pc );
-extern int __glXVForwardPipe0WithReplySwapiv( __GLXclientState *cl, GLbyte *pc );
-extern int __glXVForwardPipe0WithReplySwapdv( __GLXclientState *cl, GLbyte *pc );
+extern int __glXVForwardPipe0WithReplySwap(__GLXclientState * cl, GLbyte * pc);
+extern int __glXVForwardPipe0WithReplySwapsv(__GLXclientState * cl,
+ GLbyte * pc);
+extern int __glXVForwardPipe0WithReplySwapiv(__GLXclientState * cl,
+ GLbyte * pc);
+extern int __glXVForwardPipe0WithReplySwapdv(__GLXclientState * cl,
+ GLbyte * pc);
-extern int __glXVForwardAllWithReplySwap( __GLXclientState *cl, GLbyte *pc );
-extern int __glXVForwardAllWithReplySwapsv( __GLXclientState *cl, GLbyte *pc );
-extern int __glXVForwardAllWithReplySwapiv( __GLXclientState *cl, GLbyte *pc );
-extern int __glXVForwardAllWithReplySwapdv( __GLXclientState *cl, GLbyte *pc );
+extern int __glXVForwardAllWithReplySwap(__GLXclientState * cl, GLbyte * pc);
+extern int __glXVForwardAllWithReplySwapsv(__GLXclientState * cl, GLbyte * pc);
+extern int __glXVForwardAllWithReplySwapiv(__GLXclientState * cl, GLbyte * pc);
+extern int __glXVForwardAllWithReplySwapdv(__GLXclientState * cl, GLbyte * pc);
#endif
diff --git a/hw/dmx/glxProxy/glxvisuals.c b/hw/dmx/glxProxy/glxvisuals.c
index 8a2e5574e..3fca04f0d 100644
--- a/hw/dmx/glxProxy/glxvisuals.c
+++ b/hw/dmx/glxProxy/glxvisuals.c
@@ -35,117 +35,123 @@
#include "glxserver.h"
#include "glxvisuals.h"
-int glxVisualsMatch( __GLXvisualConfig *v1, __GLXvisualConfig *v2 )
+int
+glxVisualsMatch(__GLXvisualConfig * v1, __GLXvisualConfig * v2)
{
- if ( (v1->class == v2->class) &&
- (v1->rgba == v2->rgba) &&
- (v1->redSize == v2->redSize) &&
- (v1->greenSize == v2->greenSize) &&
- (v1->blueSize == v2->blueSize) &&
- (v1->alphaSize == v2->alphaSize) &&
- (v1->redMask == v2->redMask) &&
- (v1->greenMask == v2->greenMask) &&
- (v1->blueMask == v2->blueMask) &&
- (v1->alphaMask == v2->alphaMask) &&
- (v1->accumRedSize == v2->accumRedSize) &&
- (v1->accumGreenSize == v2->accumGreenSize) &&
- (v1->accumBlueSize == v2->accumBlueSize) &&
- (v1->accumAlphaSize == v2->accumAlphaSize) &&
- (v1->doubleBuffer == v2->doubleBuffer) &&
- (v1->stereo == v2->stereo) &&
- (v1->bufferSize == v2->bufferSize) &&
- (v1->depthSize == v2->depthSize) &&
- (v1->stencilSize == v2->stencilSize) &&
- (v1->auxBuffers == v2->auxBuffers) &&
- (v1->level == v2->level) &&
- (v1->visualRating == v2->visualRating) &&
- (v1->transparentPixel == v2->transparentPixel) &&
- (v1->transparentRed == v2->transparentRed) &&
- (v1->transparentGreen == v2->transparentGreen) &&
- (v1->transparentBlue == v2->transparentBlue) &&
- (v1->transparentAlpha == v2->transparentAlpha) &&
- (v1->transparentIndex == v2->transparentIndex) &&
- (v1->multiSampleSize == v2->multiSampleSize) &&
- (v1->nMultiSampleBuffers == v2->nMultiSampleBuffers) &&
- (v1->visualSelectGroup == v2->visualSelectGroup) ) {
-
- return 1;
-
- }
-
- return 0;
+ if ((v1->class == v2->class) &&
+ (v1->rgba == v2->rgba) &&
+ (v1->redSize == v2->redSize) &&
+ (v1->greenSize == v2->greenSize) &&
+ (v1->blueSize == v2->blueSize) &&
+ (v1->alphaSize == v2->alphaSize) &&
+ (v1->redMask == v2->redMask) &&
+ (v1->greenMask == v2->greenMask) &&
+ (v1->blueMask == v2->blueMask) &&
+ (v1->alphaMask == v2->alphaMask) &&
+ (v1->accumRedSize == v2->accumRedSize) &&
+ (v1->accumGreenSize == v2->accumGreenSize) &&
+ (v1->accumBlueSize == v2->accumBlueSize) &&
+ (v1->accumAlphaSize == v2->accumAlphaSize) &&
+ (v1->doubleBuffer == v2->doubleBuffer) &&
+ (v1->stereo == v2->stereo) &&
+ (v1->bufferSize == v2->bufferSize) &&
+ (v1->depthSize == v2->depthSize) &&
+ (v1->stencilSize == v2->stencilSize) &&
+ (v1->auxBuffers == v2->auxBuffers) &&
+ (v1->level == v2->level) &&
+ (v1->visualRating == v2->visualRating) &&
+ (v1->transparentPixel == v2->transparentPixel) &&
+ (v1->transparentRed == v2->transparentRed) &&
+ (v1->transparentGreen == v2->transparentGreen) &&
+ (v1->transparentBlue == v2->transparentBlue) &&
+ (v1->transparentAlpha == v2->transparentAlpha) &&
+ (v1->transparentIndex == v2->transparentIndex) &&
+ (v1->multiSampleSize == v2->multiSampleSize) &&
+ (v1->nMultiSampleBuffers == v2->nMultiSampleBuffers) &&
+ (v1->visualSelectGroup == v2->visualSelectGroup)) {
+
+ return 1;
+
+ }
+
+ return 0;
}
-VisualID glxMatchGLXVisualInConfigList( __GLXvisualConfig *pGlxVisual, __GLXvisualConfig *configs, int nconfigs )
+VisualID
+glxMatchGLXVisualInConfigList(__GLXvisualConfig * pGlxVisual,
+ __GLXvisualConfig * configs, int nconfigs)
{
int i;
- for (i=0; i<nconfigs; i++) {
+ for (i = 0; i < nconfigs; i++) {
- if (glxVisualsMatch( pGlxVisual, &configs[i] )) {
+ if (glxVisualsMatch(pGlxVisual, &configs[i])) {
- return configs[i].vid;
+ return configs[i].vid;
- }
+ }
}
return 0;
}
-VisualID glxMatchVisualInConfigList( ScreenPtr pScreen, VisualPtr pVisual, __GLXvisualConfig *configs, int nconfigs )
+VisualID
+glxMatchVisualInConfigList(ScreenPtr pScreen, VisualPtr pVisual,
+ __GLXvisualConfig * configs, int nconfigs)
{
__GLXscreenInfo *pGlxScreen;
__GLXvisualConfig *pGlxVisual;
int i;
/* check that the glx extension has been initialized */
- if ( !__glXActiveScreens )
- return 0;
+ if (!__glXActiveScreens)
+ return 0;
pGlxScreen = &__glXActiveScreens[pScreen->myNum];
pGlxVisual = pGlxScreen->pGlxVisual;
/* find the glx visual info for pVisual */
for (i = 0; i < pGlxScreen->numVisuals; i++, pGlxVisual++) {
- if (pGlxVisual->vid == pVisual->vid) {
- break;
- }
+ if (pGlxVisual->vid == pVisual->vid) {
+ break;
+ }
}
if (i == pGlxScreen->numVisuals) {
- /*
- * the visual is not supported by glx
- */
+ /*
+ * the visual is not supported by glx
+ */
return 0;
}
- return( glxMatchGLXVisualInConfigList(pGlxVisual, configs, nconfigs) );
+ return (glxMatchGLXVisualInConfigList(pGlxVisual, configs, nconfigs));
}
-VisualPtr glxMatchVisual( ScreenPtr pScreen, VisualPtr pVisual, ScreenPtr pMatchScreen )
+VisualPtr
+glxMatchVisual(ScreenPtr pScreen, VisualPtr pVisual, ScreenPtr pMatchScreen)
{
__GLXscreenInfo *pGlxScreen2;
int j;
VisualID vid;
/* check that the glx extension has been initialized */
- if ( !__glXActiveScreens )
- return NULL;
+ if (!__glXActiveScreens)
+ return NULL;
pGlxScreen2 = &__glXActiveScreens[pMatchScreen->myNum];
- vid = glxMatchVisualInConfigList( pScreen, pVisual,
- pGlxScreen2->pGlxVisual,
- pGlxScreen2->numVisuals );
+ vid = glxMatchVisualInConfigList(pScreen, pVisual,
+ pGlxScreen2->pGlxVisual,
+ pGlxScreen2->numVisuals);
if (vid) {
- /*
- * find the X visual of the matching glx visual
- */
- for (j=0; j<pMatchScreen->numVisuals; j++) {
- if (vid == pMatchScreen->visuals[j].vid) {
- return &pMatchScreen->visuals[j];
- }
- }
+ /*
+ * find the X visual of the matching glx visual
+ */
+ for (j = 0; j < pMatchScreen->numVisuals; j++) {
+ if (vid == pMatchScreen->visuals[j].vid) {
+ return &pMatchScreen->visuals[j];
+ }
+ }
}
return 0;
diff --git a/hw/dmx/glxProxy/glxvisuals.h b/hw/dmx/glxProxy/glxvisuals.h
index 0529d9414..e1e023878 100644
--- a/hw/dmx/glxProxy/glxvisuals.h
+++ b/hw/dmx/glxProxy/glxvisuals.h
@@ -31,12 +31,16 @@
#ifndef _GLX_VISUALS_H
#define _GLX_VISUALS_H
-int glxVisualsMatch( __GLXvisualConfig *v1, __GLXvisualConfig *v2 );
+int glxVisualsMatch(__GLXvisualConfig * v1, __GLXvisualConfig * v2);
-VisualID glxMatchGLXVisualInConfigList( __GLXvisualConfig *pGlxVisual, __GLXvisualConfig *configs, int nconfigs );
+VisualID glxMatchGLXVisualInConfigList(__GLXvisualConfig * pGlxVisual,
+ __GLXvisualConfig * configs,
+ int nconfigs);
-VisualID glxMatchVisualInConfigList( ScreenPtr pScreen, VisualPtr pVisual, __GLXvisualConfig *configs, int nconfigs );
+VisualID glxMatchVisualInConfigList(ScreenPtr pScreen, VisualPtr pVisual,
+ __GLXvisualConfig * configs, int nconfigs);
-VisualPtr glxMatchVisual( ScreenPtr pScreen, VisualPtr pVisual, ScreenPtr pMatchScreen );
+VisualPtr glxMatchVisual(ScreenPtr pScreen, VisualPtr pVisual,
+ ScreenPtr pMatchScreen);
#endif
diff --git a/hw/dmx/glxProxy/render2swap.c b/hw/dmx/glxProxy/render2swap.c
index da9b565de..166ec8882 100644
--- a/hw/dmx/glxProxy/render2swap.c
+++ b/hw/dmx/glxProxy/render2swap.c
@@ -32,7 +32,8 @@
#include "unpack.h"
#include "g_disptab.h"
-static GLint __glEvalComputeK(GLenum target)
+static GLint
+__glEvalComputeK(GLenum target)
{
switch (target) {
case GL_MAP1_VERTEX_4:
@@ -41,33 +42,35 @@ static GLint __glEvalComputeK(GLenum target)
case GL_MAP2_VERTEX_4:
case GL_MAP2_COLOR_4:
case GL_MAP2_TEXTURE_COORD_4:
- return 4;
+ return 4;
case GL_MAP1_VERTEX_3:
case GL_MAP1_TEXTURE_COORD_3:
case GL_MAP1_NORMAL:
case GL_MAP2_VERTEX_3:
case GL_MAP2_TEXTURE_COORD_3:
case GL_MAP2_NORMAL:
- return 3;
+ return 3;
case GL_MAP1_TEXTURE_COORD_2:
case GL_MAP2_TEXTURE_COORD_2:
- return 2;
+ return 2;
case GL_MAP1_TEXTURE_COORD_1:
case GL_MAP2_TEXTURE_COORD_1:
case GL_MAP1_INDEX:
case GL_MAP2_INDEX:
- return 1;
+ return 1;
default:
- return 0;
+ return 0;
}
}
-void __glXDispSwap_Map1f(GLbyte *pc)
+void
+__glXDispSwap_Map1f(GLbyte * pc)
{
GLint order, k;
GLfloat u1, u2, *points;
GLenum target;
GLint compsize;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
@@ -75,30 +78,33 @@ void __glXDispSwap_Map1f(GLbyte *pc)
__GLX_SWAP_INT(pc + 12);
__GLX_SWAP_FLOAT(pc + 4);
__GLX_SWAP_FLOAT(pc + 8);
-
- target = *(GLenum *)(pc + 0);
- order = *(GLint *)(pc + 12);
- u1 = *(GLfloat *)(pc + 4);
- u2 = *(GLfloat *)(pc + 8);
- points = (GLfloat *)(pc + 16);
+
+ target = *(GLenum *) (pc + 0);
+ order = *(GLint *) (pc + 12);
+ u1 = *(GLfloat *) (pc + 4);
+ u2 = *(GLfloat *) (pc + 8);
+ points = (GLfloat *) (pc + 16);
k = __glEvalComputeK(target);
if (order <= 0 || k < 0) {
- /* Erroneous command. */
- compsize = 0;
- } else {
- compsize = order * k;
+ /* Erroneous command. */
+ compsize = 0;
+ }
+ else {
+ compsize = order * k;
}
__GLX_SWAP_FLOAT_ARRAY(points, compsize);
}
-void __glXDispSwap_Map2f(GLbyte *pc)
+void
+__glXDispSwap_Map2f(GLbyte * pc)
{
GLint uorder, vorder, ustride, vstride, k;
GLfloat u1, u2, v1, v2, *points;
GLenum target;
GLint compsize;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
@@ -109,35 +115,38 @@ void __glXDispSwap_Map2f(GLbyte *pc)
__GLX_SWAP_FLOAT(pc + 8);
__GLX_SWAP_FLOAT(pc + 16);
__GLX_SWAP_FLOAT(pc + 20);
-
- target = *(GLenum *)(pc + 0);
- uorder = *(GLint *)(pc + 12);
- vorder = *(GLint *)(pc + 24);
- u1 = *(GLfloat *)(pc + 4);
- u2 = *(GLfloat *)(pc + 8);
- v1 = *(GLfloat *)(pc + 16);
- v2 = *(GLfloat *)(pc + 20);
- points = (GLfloat *)(pc + 28);
+
+ target = *(GLenum *) (pc + 0);
+ uorder = *(GLint *) (pc + 12);
+ vorder = *(GLint *) (pc + 24);
+ u1 = *(GLfloat *) (pc + 4);
+ u2 = *(GLfloat *) (pc + 8);
+ v1 = *(GLfloat *) (pc + 16);
+ v2 = *(GLfloat *) (pc + 20);
+ points = (GLfloat *) (pc + 28);
k = __glEvalComputeK(target);
ustride = vorder * k;
vstride = k;
if (vorder <= 0 || uorder <= 0 || k < 0) {
- /* Erroneous command. */
- compsize = 0;
- } else {
- compsize = uorder * vorder * k;
+ /* Erroneous command. */
+ compsize = 0;
+ }
+ else {
+ compsize = uorder * vorder * k;
}
__GLX_SWAP_FLOAT_ARRAY(points, compsize);
}
-void __glXDispSwap_Map1d(GLbyte *pc)
+void
+__glXDispSwap_Map1d(GLbyte * pc)
{
GLint order, k, compsize;
GLenum target;
GLdouble u1, u2, *points;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
@@ -146,41 +155,45 @@ void __glXDispSwap_Map1d(GLbyte *pc)
__GLX_SWAP_INT(pc + 16);
__GLX_SWAP_INT(pc + 20);
- target = *(GLenum*) (pc + 16);
- order = *(GLint*) (pc + 20);
+ target = *(GLenum *) (pc + 16);
+ order = *(GLint *) (pc + 20);
k = __glEvalComputeK(target);
if (order <= 0 || k < 0) {
- /* Erroneous command. */
- compsize = 0;
- } else {
- compsize = order * k;
+ /* Erroneous command. */
+ compsize = 0;
}
- __GLX_GET_DOUBLE(u1,pc);
- __GLX_GET_DOUBLE(u2,pc+8);
- __GLX_SWAP_DOUBLE_ARRAY(pc+24, compsize);
+ else {
+ compsize = order * k;
+ }
+ __GLX_GET_DOUBLE(u1, pc);
+ __GLX_GET_DOUBLE(u2, pc + 8);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 24, compsize);
pc += 24;
#ifdef __GLX_ALIGN64
- if (((unsigned long)pc) & 7) {
- /*
- ** Copy the doubles up 4 bytes, trashing the command but aligning
- ** the data in the process
- */
- __GLX_MEM_COPY(pc-4, pc, compsize*8);
- points = (GLdouble*) (pc - 4);
- } else {
- points = (GLdouble*) pc;
+ if (((unsigned long) pc) & 7) {
+ /*
+ ** Copy the doubles up 4 bytes, trashing the command but aligning
+ ** the data in the process
+ */
+ __GLX_MEM_COPY(pc - 4, pc, compsize * 8);
+ points = (GLdouble *) (pc - 4);
+ }
+ else {
+ points = (GLdouble *) pc;
}
#else
- points = (GLdouble*) pc;
+ points = (GLdouble *) pc;
#endif
}
-void __glXDispSwap_Map2d(GLbyte *pc)
+void
+__glXDispSwap_Map2d(GLbyte * pc)
{
GLdouble u1, u2, v1, v2, *points;
GLint uorder, vorder, ustride, vstride, k, compsize;
GLenum target;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
@@ -192,80 +205,86 @@ void __glXDispSwap_Map2d(GLbyte *pc)
__GLX_SWAP_INT(pc + 36);
__GLX_SWAP_INT(pc + 40);
- target = *(GLenum *)(pc + 32);
- uorder = *(GLint *)(pc + 36);
- vorder = *(GLint *)(pc + 40);
+ target = *(GLenum *) (pc + 32);
+ uorder = *(GLint *) (pc + 36);
+ vorder = *(GLint *) (pc + 40);
k = __glEvalComputeK(target);
if (vorder <= 0 || uorder <= 0 || k < 0) {
- /* Erroneous command. */
- compsize = 0;
- } else {
- compsize = uorder * vorder * k;
+ /* Erroneous command. */
+ compsize = 0;
+ }
+ else {
+ compsize = uorder * vorder * k;
}
- __GLX_GET_DOUBLE(u1,pc);
- __GLX_GET_DOUBLE(u2,pc+8);
- __GLX_GET_DOUBLE(v1,pc+16);
- __GLX_GET_DOUBLE(v2,pc+24);
- __GLX_SWAP_DOUBLE_ARRAY(pc+44, compsize);
+ __GLX_GET_DOUBLE(u1, pc);
+ __GLX_GET_DOUBLE(u2, pc + 8);
+ __GLX_GET_DOUBLE(v1, pc + 16);
+ __GLX_GET_DOUBLE(v2, pc + 24);
+ __GLX_SWAP_DOUBLE_ARRAY(pc + 44, compsize);
pc += 44;
ustride = vorder * k;
vstride = k;
#ifdef __GLX_ALIGN64
- if (((unsigned long)pc) & 7) {
- /*
- ** Copy the doubles up 4 bytes, trashing the command but aligning
- ** the data in the process
- */
- __GLX_MEM_COPY(pc-4, pc, compsize*8);
- points = (GLdouble*) (pc - 4);
- } else {
- points = (GLdouble*) pc;
+ if (((unsigned long) pc) & 7) {
+ /*
+ ** Copy the doubles up 4 bytes, trashing the command but aligning
+ ** the data in the process
+ */
+ __GLX_MEM_COPY(pc - 4, pc, compsize * 8);
+ points = (GLdouble *) (pc - 4);
+ }
+ else {
+ points = (GLdouble *) pc;
}
#else
- points = (GLdouble*) pc;
+ points = (GLdouble *) pc;
#endif
}
-void __glXDispSwap_CallLists(GLbyte *pc)
+void
+__glXDispSwap_CallLists(GLbyte * pc)
{
GLenum type;
GLsizei n;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_INT(pc + 4);
__GLX_SWAP_INT(pc + 0);
- type = *(GLenum *)(pc + 4);
- n = *(GLsizei *)(pc + 0);
+ type = *(GLenum *) (pc + 4);
+ n = *(GLsizei *) (pc + 0);
switch (type) {
- case GL_BYTE:
- case GL_UNSIGNED_BYTE:
- case GL_2_BYTES:
- case GL_3_BYTES:
- case GL_4_BYTES:
- break;
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- __GLX_SWAP_SHORT_ARRAY(pc+8, n);
- break;
- case GL_INT:
- case GL_UNSIGNED_INT:
- __GLX_SWAP_INT_ARRAY(pc+8, n);
- break;
- case GL_FLOAT:
- __GLX_SWAP_FLOAT_ARRAY(pc+8, n);
- break;
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ case GL_2_BYTES:
+ case GL_3_BYTES:
+ case GL_4_BYTES:
+ break;
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ __GLX_SWAP_SHORT_ARRAY(pc + 8, n);
+ break;
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ __GLX_SWAP_INT_ARRAY(pc + 8, n);
+ break;
+ case GL_FLOAT:
+ __GLX_SWAP_FLOAT_ARRAY(pc + 8, n);
+ break;
}
}
-void __glXDispSwap_DrawArrays(GLbyte *pc)
+void
+__glXDispSwap_DrawArrays(GLbyte * pc)
{
- __GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *)pc;
+ __GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *) pc;
__GLXdispatchDrawArraysComponentHeader *compHeader;
int i;
+
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_INT(&hdr->numVertexes);
@@ -276,10 +295,10 @@ void __glXDispSwap_DrawArrays(GLbyte *pc)
compHeader = (__GLXdispatchDrawArraysComponentHeader *) pc;
/* compute stride (same for all component arrays) */
- for (i=0; i<hdr->numComponents; i++) {
- __GLX_SWAP_INT(&compHeader[i].datatype);
- __GLX_SWAP_INT(&compHeader[i].numVals);
- __GLX_SWAP_INT(&compHeader[i].component);
+ for (i = 0; i < hdr->numComponents; i++) {
+ __GLX_SWAP_INT(&compHeader[i].datatype);
+ __GLX_SWAP_INT(&compHeader[i].numVals);
+ __GLX_SWAP_INT(&compHeader[i].component);
}
diff --git a/hw/dmx/glxProxy/renderpixswap.c b/hw/dmx/glxProxy/renderpixswap.c
index 9deb30d4b..3458e611c 100644
--- a/hw/dmx/glxProxy/renderpixswap.c
+++ b/hw/dmx/glxProxy/renderpixswap.c
@@ -32,352 +32,375 @@
#include "unpack.h"
#include "g_disptab.h"
-void __glXDispSwap_PolygonStipple(GLbyte *pc)
+void
+__glXDispSwap_PolygonStipple(GLbyte * pc)
{
__GLXpixelHeader *hdr = (__GLXpixelHeader *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
+ __GLX_SWAP_INT((GLbyte *) & hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *) & hdr->alignment);
hdr->swapBytes = !hdr->swapBytes;
}
-void __glXDispSwap_Bitmap(GLbyte *pc)
+void
+__glXDispSwap_Bitmap(GLbyte * pc)
{
__GLXdispatchBitmapHeader *hdr = (__GLXdispatchBitmapHeader *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
+ __GLX_SWAP_INT((GLbyte *) & hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *) & hdr->alignment);
- __GLX_SWAP_INT((GLbyte *)&hdr->width);
- __GLX_SWAP_INT((GLbyte *)&hdr->height);
- __GLX_SWAP_FLOAT((GLbyte *)&hdr->xorig);
- __GLX_SWAP_FLOAT((GLbyte *)&hdr->yorig);
- __GLX_SWAP_FLOAT((GLbyte *)&hdr->xmove);
- __GLX_SWAP_FLOAT((GLbyte *)&hdr->ymove);
+ __GLX_SWAP_INT((GLbyte *) & hdr->width);
+ __GLX_SWAP_INT((GLbyte *) & hdr->height);
+ __GLX_SWAP_FLOAT((GLbyte *) & hdr->xorig);
+ __GLX_SWAP_FLOAT((GLbyte *) & hdr->yorig);
+ __GLX_SWAP_FLOAT((GLbyte *) & hdr->xmove);
+ __GLX_SWAP_FLOAT((GLbyte *) & hdr->ymove);
hdr->swapBytes = !hdr->swapBytes;
}
-void __glXDispSwap_TexImage1D(GLbyte *pc)
+void
+__glXDispSwap_TexImage1D(GLbyte * pc)
{
__GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
+ __GLX_SWAP_INT((GLbyte *) & hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *) & hdr->alignment);
- __GLX_SWAP_INT((GLbyte *)&hdr->target);
- __GLX_SWAP_INT((GLbyte *)&hdr->level);
- __GLX_SWAP_INT((GLbyte *)&hdr->components);
- __GLX_SWAP_INT((GLbyte *)&hdr->width);
- __GLX_SWAP_INT((GLbyte *)&hdr->height);
- __GLX_SWAP_INT((GLbyte *)&hdr->border);
- __GLX_SWAP_INT((GLbyte *)&hdr->format);
- __GLX_SWAP_INT((GLbyte *)&hdr->type);
+ __GLX_SWAP_INT((GLbyte *) & hdr->target);
+ __GLX_SWAP_INT((GLbyte *) & hdr->level);
+ __GLX_SWAP_INT((GLbyte *) & hdr->components);
+ __GLX_SWAP_INT((GLbyte *) & hdr->width);
+ __GLX_SWAP_INT((GLbyte *) & hdr->height);
+ __GLX_SWAP_INT((GLbyte *) & hdr->border);
+ __GLX_SWAP_INT((GLbyte *) & hdr->format);
+ __GLX_SWAP_INT((GLbyte *) & hdr->type);
/*
- ** Just invert swapBytes flag; the GL will figure out if it needs to swap
- ** the pixel data.
- */
+ ** Just invert swapBytes flag; the GL will figure out if it needs to swap
+ ** the pixel data.
+ */
hdr->swapBytes = !hdr->swapBytes;
}
-void __glXDispSwap_TexImage2D(GLbyte *pc)
+void
+__glXDispSwap_TexImage2D(GLbyte * pc)
{
__GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
+ __GLX_SWAP_INT((GLbyte *) & hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *) & hdr->alignment);
- __GLX_SWAP_INT((GLbyte *)&hdr->target);
- __GLX_SWAP_INT((GLbyte *)&hdr->level);
- __GLX_SWAP_INT((GLbyte *)&hdr->components);
- __GLX_SWAP_INT((GLbyte *)&hdr->width);
- __GLX_SWAP_INT((GLbyte *)&hdr->height);
- __GLX_SWAP_INT((GLbyte *)&hdr->border);
- __GLX_SWAP_INT((GLbyte *)&hdr->format);
- __GLX_SWAP_INT((GLbyte *)&hdr->type);
+ __GLX_SWAP_INT((GLbyte *) & hdr->target);
+ __GLX_SWAP_INT((GLbyte *) & hdr->level);
+ __GLX_SWAP_INT((GLbyte *) & hdr->components);
+ __GLX_SWAP_INT((GLbyte *) & hdr->width);
+ __GLX_SWAP_INT((GLbyte *) & hdr->height);
+ __GLX_SWAP_INT((GLbyte *) & hdr->border);
+ __GLX_SWAP_INT((GLbyte *) & hdr->format);
+ __GLX_SWAP_INT((GLbyte *) & hdr->type);
/*
- ** Just invert swapBytes flag; the GL will figure out if it needs to swap
- ** the pixel data.
- */
+ ** Just invert swapBytes flag; the GL will figure out if it needs to swap
+ ** the pixel data.
+ */
hdr->swapBytes = !hdr->swapBytes;
}
-void __glXDispSwap_TexImage3D(GLbyte *pc)
+void
+__glXDispSwap_TexImage3D(GLbyte * pc)
{
__GLXdispatchTexImage3DHeader *hdr = (__GLXdispatchTexImage3DHeader *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->imageHeight);
- __GLX_SWAP_INT((GLbyte *)&hdr->imageDepth);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipImages);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipVolumes);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
-
- __GLX_SWAP_INT((GLbyte *)&hdr->target);
- __GLX_SWAP_INT((GLbyte *)&hdr->level);
- __GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
- __GLX_SWAP_INT((GLbyte *)&hdr->width);
- __GLX_SWAP_INT((GLbyte *)&hdr->height);
- __GLX_SWAP_INT((GLbyte *)&hdr->depth);
- __GLX_SWAP_INT((GLbyte *)&hdr->size4d);
- __GLX_SWAP_INT((GLbyte *)&hdr->border);
- __GLX_SWAP_INT((GLbyte *)&hdr->format);
- __GLX_SWAP_INT((GLbyte *)&hdr->type);
+ __GLX_SWAP_INT((GLbyte *) & hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *) & hdr->imageHeight);
+ __GLX_SWAP_INT((GLbyte *) & hdr->imageDepth);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipImages);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipVolumes);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *) & hdr->alignment);
+
+ __GLX_SWAP_INT((GLbyte *) & hdr->target);
+ __GLX_SWAP_INT((GLbyte *) & hdr->level);
+ __GLX_SWAP_INT((GLbyte *) & hdr->internalformat);
+ __GLX_SWAP_INT((GLbyte *) & hdr->width);
+ __GLX_SWAP_INT((GLbyte *) & hdr->height);
+ __GLX_SWAP_INT((GLbyte *) & hdr->depth);
+ __GLX_SWAP_INT((GLbyte *) & hdr->size4d);
+ __GLX_SWAP_INT((GLbyte *) & hdr->border);
+ __GLX_SWAP_INT((GLbyte *) & hdr->format);
+ __GLX_SWAP_INT((GLbyte *) & hdr->type);
/*
- ** Just invert swapBytes flag; the GL will figure out if it needs to swap
- ** the pixel data.
- */
+ ** Just invert swapBytes flag; the GL will figure out if it needs to swap
+ ** the pixel data.
+ */
hdr->swapBytes = !hdr->swapBytes;
}
-void __glXDispSwap_DrawPixels(GLbyte *pc)
+void
+__glXDispSwap_DrawPixels(GLbyte * pc)
{
__GLXdispatchDrawPixelsHeader *hdr = (__GLXdispatchDrawPixelsHeader *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
+ __GLX_SWAP_INT((GLbyte *) & hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *) & hdr->alignment);
- __GLX_SWAP_INT((GLbyte *)&hdr->width);
- __GLX_SWAP_INT((GLbyte *)&hdr->height);
- __GLX_SWAP_INT((GLbyte *)&hdr->format);
- __GLX_SWAP_INT((GLbyte *)&hdr->type);
+ __GLX_SWAP_INT((GLbyte *) & hdr->width);
+ __GLX_SWAP_INT((GLbyte *) & hdr->height);
+ __GLX_SWAP_INT((GLbyte *) & hdr->format);
+ __GLX_SWAP_INT((GLbyte *) & hdr->type);
/*
- ** Just invert swapBytes flag; the GL will figure out if it needs to swap
- ** the pixel data.
- */
+ ** Just invert swapBytes flag; the GL will figure out if it needs to swap
+ ** the pixel data.
+ */
hdr->swapBytes = !hdr->swapBytes;
}
-void __glXDispSwap_TexSubImage1D(GLbyte *pc)
+void
+__glXDispSwap_TexSubImage1D(GLbyte * pc)
{
__GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
+ __GLX_SWAP_INT((GLbyte *) & hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *) & hdr->alignment);
- __GLX_SWAP_INT((GLbyte *)&hdr->target);
- __GLX_SWAP_INT((GLbyte *)&hdr->level);
- __GLX_SWAP_INT((GLbyte *)&hdr->xoffset);
- __GLX_SWAP_INT((GLbyte *)&hdr->width);
- __GLX_SWAP_INT((GLbyte *)&hdr->format);
- __GLX_SWAP_INT((GLbyte *)&hdr->type);
+ __GLX_SWAP_INT((GLbyte *) & hdr->target);
+ __GLX_SWAP_INT((GLbyte *) & hdr->level);
+ __GLX_SWAP_INT((GLbyte *) & hdr->xoffset);
+ __GLX_SWAP_INT((GLbyte *) & hdr->width);
+ __GLX_SWAP_INT((GLbyte *) & hdr->format);
+ __GLX_SWAP_INT((GLbyte *) & hdr->type);
/*
- ** Just invert swapBytes flag; the GL will figure out if it needs to swap
- ** the pixel data.
- */
+ ** Just invert swapBytes flag; the GL will figure out if it needs to swap
+ ** the pixel data.
+ */
hdr->swapBytes = !hdr->swapBytes;
}
-void __glXDispSwap_TexSubImage2D(GLbyte *pc)
+void
+__glXDispSwap_TexSubImage2D(GLbyte * pc)
{
__GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
+ __GLX_SWAP_INT((GLbyte *) & hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *) & hdr->alignment);
- __GLX_SWAP_INT((GLbyte *)&hdr->target);
- __GLX_SWAP_INT((GLbyte *)&hdr->level);
- __GLX_SWAP_INT((GLbyte *)&hdr->xoffset);
- __GLX_SWAP_INT((GLbyte *)&hdr->yoffset);
- __GLX_SWAP_INT((GLbyte *)&hdr->width);
- __GLX_SWAP_INT((GLbyte *)&hdr->height);
- __GLX_SWAP_INT((GLbyte *)&hdr->format);
- __GLX_SWAP_INT((GLbyte *)&hdr->type);
+ __GLX_SWAP_INT((GLbyte *) & hdr->target);
+ __GLX_SWAP_INT((GLbyte *) & hdr->level);
+ __GLX_SWAP_INT((GLbyte *) & hdr->xoffset);
+ __GLX_SWAP_INT((GLbyte *) & hdr->yoffset);
+ __GLX_SWAP_INT((GLbyte *) & hdr->width);
+ __GLX_SWAP_INT((GLbyte *) & hdr->height);
+ __GLX_SWAP_INT((GLbyte *) & hdr->format);
+ __GLX_SWAP_INT((GLbyte *) & hdr->type);
/*
- ** Just invert swapBytes flag; the GL will figure out if it needs to swap
- ** the pixel data.
- */
+ ** Just invert swapBytes flag; the GL will figure out if it needs to swap
+ ** the pixel data.
+ */
hdr->swapBytes = !hdr->swapBytes;
}
-void __glXDispSwap_TexSubImage3D(GLbyte *pc)
+void
+__glXDispSwap_TexSubImage3D(GLbyte * pc)
{
__GLXdispatchTexSubImage3DHeader *hdr =
- (__GLXdispatchTexSubImage3DHeader *) pc;
+ (__GLXdispatchTexSubImage3DHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->imageHeight);
- __GLX_SWAP_INT((GLbyte *)&hdr->imageDepth);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipImages);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipVolumes);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
-
- __GLX_SWAP_INT((GLbyte *)&hdr->target);
- __GLX_SWAP_INT((GLbyte *)&hdr->level);
- __GLX_SWAP_INT((GLbyte *)&hdr->xoffset);
- __GLX_SWAP_INT((GLbyte *)&hdr->yoffset);
- __GLX_SWAP_INT((GLbyte *)&hdr->zoffset);
- __GLX_SWAP_INT((GLbyte *)&hdr->width);
- __GLX_SWAP_INT((GLbyte *)&hdr->height);
- __GLX_SWAP_INT((GLbyte *)&hdr->depth);
- __GLX_SWAP_INT((GLbyte *)&hdr->size4d);
- __GLX_SWAP_INT((GLbyte *)&hdr->format);
- __GLX_SWAP_INT((GLbyte *)&hdr->type);
+ __GLX_SWAP_INT((GLbyte *) & hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *) & hdr->imageHeight);
+ __GLX_SWAP_INT((GLbyte *) & hdr->imageDepth);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipImages);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipVolumes);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *) & hdr->alignment);
+
+ __GLX_SWAP_INT((GLbyte *) & hdr->target);
+ __GLX_SWAP_INT((GLbyte *) & hdr->level);
+ __GLX_SWAP_INT((GLbyte *) & hdr->xoffset);
+ __GLX_SWAP_INT((GLbyte *) & hdr->yoffset);
+ __GLX_SWAP_INT((GLbyte *) & hdr->zoffset);
+ __GLX_SWAP_INT((GLbyte *) & hdr->width);
+ __GLX_SWAP_INT((GLbyte *) & hdr->height);
+ __GLX_SWAP_INT((GLbyte *) & hdr->depth);
+ __GLX_SWAP_INT((GLbyte *) & hdr->size4d);
+ __GLX_SWAP_INT((GLbyte *) & hdr->format);
+ __GLX_SWAP_INT((GLbyte *) & hdr->type);
/*
- ** Just invert swapBytes flag; the GL will figure out if it needs to swap
- ** the pixel data.
- */
+ ** Just invert swapBytes flag; the GL will figure out if it needs to swap
+ ** the pixel data.
+ */
hdr->swapBytes = !hdr->swapBytes;
}
-void __glXDispSwap_ColorTable(GLbyte *pc)
+void
+__glXDispSwap_ColorTable(GLbyte * pc)
{
- __GLXdispatchColorTableHeader *hdr =
- (__GLXdispatchColorTableHeader *) pc;
+ __GLXdispatchColorTableHeader *hdr = (__GLXdispatchColorTableHeader *) pc;
+
__GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
+ __GLX_SWAP_INT((GLbyte *) & hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *) & hdr->alignment);
- __GLX_SWAP_INT((GLbyte *)&hdr->target);
- __GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
- __GLX_SWAP_INT((GLbyte *)&hdr->width);
- __GLX_SWAP_INT((GLbyte *)&hdr->format);
- __GLX_SWAP_INT((GLbyte *)&hdr->type);
+ __GLX_SWAP_INT((GLbyte *) & hdr->target);
+ __GLX_SWAP_INT((GLbyte *) & hdr->internalformat);
+ __GLX_SWAP_INT((GLbyte *) & hdr->width);
+ __GLX_SWAP_INT((GLbyte *) & hdr->format);
+ __GLX_SWAP_INT((GLbyte *) & hdr->type);
/*
- ** Just invert swapBytes flag; the GL will figure out if it needs to swap
- ** the pixel data.
- */
+ ** Just invert swapBytes flag; the GL will figure out if it needs to swap
+ ** the pixel data.
+ */
hdr->swapBytes = !hdr->swapBytes;
}
-void __glXDispSwap_ColorSubTable(GLbyte *pc)
+void
+__glXDispSwap_ColorSubTable(GLbyte * pc)
{
__GLXdispatchColorSubTableHeader *hdr =
- (__GLXdispatchColorSubTableHeader *) pc;
+ (__GLXdispatchColorSubTableHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
+ __GLX_SWAP_INT((GLbyte *) & hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *) & hdr->alignment);
- __GLX_SWAP_INT((GLbyte *)&hdr->target);
- __GLX_SWAP_INT((GLbyte *)&hdr->start);
- __GLX_SWAP_INT((GLbyte *)&hdr->count);
- __GLX_SWAP_INT((GLbyte *)&hdr->format);
- __GLX_SWAP_INT((GLbyte *)&hdr->type);
+ __GLX_SWAP_INT((GLbyte *) & hdr->target);
+ __GLX_SWAP_INT((GLbyte *) & hdr->start);
+ __GLX_SWAP_INT((GLbyte *) & hdr->count);
+ __GLX_SWAP_INT((GLbyte *) & hdr->format);
+ __GLX_SWAP_INT((GLbyte *) & hdr->type);
/*
- ** Just invert swapBytes flag; the GL will figure out if it needs to swap
- ** the pixel data.
- */
+ ** Just invert swapBytes flag; the GL will figure out if it needs to swap
+ ** the pixel data.
+ */
hdr->swapBytes = !hdr->swapBytes;
}
-void __glXDispSwap_ConvolutionFilter1D(GLbyte *pc)
+void
+__glXDispSwap_ConvolutionFilter1D(GLbyte * pc)
{
__GLXdispatchConvolutionFilterHeader *hdr =
- (__GLXdispatchConvolutionFilterHeader *) pc;
+ (__GLXdispatchConvolutionFilterHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
+ __GLX_SWAP_INT((GLbyte *) & hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *) & hdr->alignment);
- __GLX_SWAP_INT((GLbyte *)&hdr->target);
- __GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
- __GLX_SWAP_INT((GLbyte *)&hdr->width);
- __GLX_SWAP_INT((GLbyte *)&hdr->format);
- __GLX_SWAP_INT((GLbyte *)&hdr->type);
+ __GLX_SWAP_INT((GLbyte *) & hdr->target);
+ __GLX_SWAP_INT((GLbyte *) & hdr->internalformat);
+ __GLX_SWAP_INT((GLbyte *) & hdr->width);
+ __GLX_SWAP_INT((GLbyte *) & hdr->format);
+ __GLX_SWAP_INT((GLbyte *) & hdr->type);
/*
- ** Just invert swapBytes flag; the GL will figure out if it needs to swap
- ** the pixel data.
- */
+ ** Just invert swapBytes flag; the GL will figure out if it needs to swap
+ ** the pixel data.
+ */
hdr->swapBytes = !hdr->swapBytes;
}
-void __glXDispSwap_ConvolutionFilter2D(GLbyte *pc)
+void
+__glXDispSwap_ConvolutionFilter2D(GLbyte * pc)
{
__GLXdispatchConvolutionFilterHeader *hdr =
- (__GLXdispatchConvolutionFilterHeader *) pc;
+ (__GLXdispatchConvolutionFilterHeader *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
+ __GLX_SWAP_INT((GLbyte *) & hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *) & hdr->alignment);
- __GLX_SWAP_INT((GLbyte *)&hdr->target);
- __GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
- __GLX_SWAP_INT((GLbyte *)&hdr->width);
- __GLX_SWAP_INT((GLbyte *)&hdr->height);
- __GLX_SWAP_INT((GLbyte *)&hdr->format);
- __GLX_SWAP_INT((GLbyte *)&hdr->type);
+ __GLX_SWAP_INT((GLbyte *) & hdr->target);
+ __GLX_SWAP_INT((GLbyte *) & hdr->internalformat);
+ __GLX_SWAP_INT((GLbyte *) & hdr->width);
+ __GLX_SWAP_INT((GLbyte *) & hdr->height);
+ __GLX_SWAP_INT((GLbyte *) & hdr->format);
+ __GLX_SWAP_INT((GLbyte *) & hdr->type);
/*
- ** Just invert swapBytes flag; the GL will figure out if it needs to swap
- ** the pixel data.
- */
+ ** Just invert swapBytes flag; the GL will figure out if it needs to swap
+ ** the pixel data.
+ */
hdr->swapBytes = !hdr->swapBytes;
}
-void __glXDispSwap_SeparableFilter2D(GLbyte *pc)
+void
+__glXDispSwap_SeparableFilter2D(GLbyte * pc)
{
__GLXdispatchConvolutionFilterHeader *hdr =
- (__GLXdispatchConvolutionFilterHeader *) pc;
+ (__GLXdispatchConvolutionFilterHeader *) pc;
GLint hdrlen;
+
__GLX_DECLARE_SWAP_VARIABLES;
hdrlen = __GLX_PAD(__GLX_CONV_FILT_CMD_HDR_SIZE);
- __GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
- __GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
- __GLX_SWAP_INT((GLbyte *)&hdr->alignment);
+ __GLX_SWAP_INT((GLbyte *) & hdr->rowLength);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipRows);
+ __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels);
+ __GLX_SWAP_INT((GLbyte *) & hdr->alignment);
- __GLX_SWAP_INT((GLbyte *)&hdr->target);
- __GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
- __GLX_SWAP_INT((GLbyte *)&hdr->width);
- __GLX_SWAP_INT((GLbyte *)&hdr->height);
- __GLX_SWAP_INT((GLbyte *)&hdr->format);
- __GLX_SWAP_INT((GLbyte *)&hdr->type);
+ __GLX_SWAP_INT((GLbyte *) & hdr->target);
+ __GLX_SWAP_INT((GLbyte *) & hdr->internalformat);
+ __GLX_SWAP_INT((GLbyte *) & hdr->width);
+ __GLX_SWAP_INT((GLbyte *) & hdr->height);
+ __GLX_SWAP_INT((GLbyte *) & hdr->format);
+ __GLX_SWAP_INT((GLbyte *) & hdr->type);
/*
- ** Just invert swapBytes flag; the GL will figure out if it needs to swap
- ** the pixel data.
- */
+ ** Just invert swapBytes flag; the GL will figure out if it needs to swap
+ ** the pixel data.
+ */
hdr->swapBytes = !hdr->swapBytes;
}
diff --git a/hw/dmx/glxProxy/unpack.h b/hw/dmx/glxProxy/unpack.h
index f4a957206..b4b73580c 100644
--- a/hw/dmx/glxProxy/unpack.h
+++ b/hw/dmx/glxProxy/unpack.h
@@ -63,7 +63,7 @@ extern xGLXSingleReply __glXReply;
#define __GLX_PUT_RETVAL(a) \
__glXReply.retval = (a);
-
+
#define __GLX_PUT_SIZE(a) \
__glXReply.size = (a);
@@ -98,35 +98,34 @@ extern xGLXSingleReply __glXReply;
#define __GLX_PUT_BYTE() \
*(GLbyte *)&__glXReply.pad3 = *(GLbyte *)answer
-
+
#define __GLX_PUT_SHORT() \
*(GLshort *)&__glXReply.pad3 = *(GLshort *)answer
-
+
#define __GLX_PUT_INT() \
*(GLint *)&__glXReply.pad3 = *(GLint *)answer
-
+
#define __GLX_PUT_FLOAT() \
*(GLfloat *)&__glXReply.pad3 = *(GLfloat *)answer
-
+
#define __GLX_PUT_DOUBLE() \
*(GLdouble *)&__glXReply.pad3 = *(GLdouble *)answer
-
+
#define __GLX_SEND_BYTE_ARRAY(len) \
WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT8), (char *)answer)
#define __GLX_SEND_SHORT_ARRAY(len) \
WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT16), (char *)answer)
-
+
#define __GLX_SEND_INT_ARRAY(len) \
WriteToClient(client, (len)*__GLX_SIZE_INT32, (char *)answer)
-
+
#define __GLX_SEND_FLOAT_ARRAY(len) \
WriteToClient(client, (len)*__GLX_SIZE_FLOAT32, (char *)answer)
-
+
#define __GLX_SEND_DOUBLE_ARRAY(len) \
WriteToClient(client, (len)*__GLX_SIZE_FLOAT64, (char *)answer)
-
#define __GLX_SEND_VOID_ARRAY(len) __GLX_SEND_BYTE_ARRAY(len)
#define __GLX_SEND_UBYTE_ARRAY(len) __GLX_SEND_BYTE_ARRAY(len)
#define __GLX_SEND_USHORT_ARRAY(len) __GLX_SEND_SHORT_ARRAY(len)
@@ -144,19 +143,18 @@ extern xGLXSingleReply __glXReply;
GLbyte *swapPC; \
GLbyte *swapEnd
-
#define __GLX_SWAP_INT(pc) \
sw = ((GLbyte *)(pc))[0]; \
((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[3]; \
((GLbyte *)(pc))[3] = sw; \
sw = ((GLbyte *)(pc))[1]; \
((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[2]; \
- ((GLbyte *)(pc))[2] = sw;
+ ((GLbyte *)(pc))[2] = sw;
#define __GLX_SWAP_SHORT(pc) \
sw = ((GLbyte *)(pc))[0]; \
((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[1]; \
- ((GLbyte *)(pc))[1] = sw;
+ ((GLbyte *)(pc))[1] = sw;
#define __GLX_SWAP_DOUBLE(pc) \
sw = ((GLbyte *)(pc))[0]; \
@@ -170,7 +168,7 @@ extern xGLXSingleReply __glXReply;
((GLbyte *)(pc))[5] = sw; \
sw = ((GLbyte *)(pc))[3]; \
((GLbyte *)(pc))[3] = ((GLbyte *)(pc))[4]; \
- ((GLbyte *)(pc))[4] = sw;
+ ((GLbyte *)(pc))[4] = sw;
#define __GLX_SWAP_FLOAT(pc) \
sw = ((GLbyte *)(pc))[0]; \
@@ -178,7 +176,7 @@ extern xGLXSingleReply __glXReply;
((GLbyte *)(pc))[3] = sw; \
sw = ((GLbyte *)(pc))[1]; \
((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[2]; \
- ((GLbyte *)(pc))[2] = sw;
+ ((GLbyte *)(pc))[2] = sw;
#define __GLX_SWAP_INT_ARRAY(pc, count) \
swapPC = ((GLbyte *)(pc)); \
@@ -187,7 +185,7 @@ extern xGLXSingleReply __glXReply;
__GLX_SWAP_INT(swapPC); \
swapPC += __GLX_SIZE_INT32; \
}
-
+
#define __GLX_SWAP_SHORT_ARRAY(pc, count) \
swapPC = ((GLbyte *)(pc)); \
swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_INT16;\
@@ -195,7 +193,7 @@ extern xGLXSingleReply __glXReply;
__GLX_SWAP_SHORT(swapPC); \
swapPC += __GLX_SIZE_INT16; \
}
-
+
#define __GLX_SWAP_DOUBLE_ARRAY(pc, count) \
swapPC = ((GLbyte *)(pc)); \
swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_FLOAT64;\
@@ -203,7 +201,7 @@ extern xGLXSingleReply __glXReply;
__GLX_SWAP_DOUBLE(swapPC); \
swapPC += __GLX_SIZE_FLOAT64; \
}
-
+
#define __GLX_SWAP_FLOAT_ARRAY(pc, count) \
swapPC = ((GLbyte *)(pc)); \
swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_FLOAT32;\
@@ -222,9 +220,4 @@ extern xGLXSingleReply __glXReply;
#define __GLX_SWAP_REPLY_SIZE() \
__GLX_SWAP_INT(&__glXReply.size)
-#endif /* !__GLX_unpack_h__ */
-
-
-
-
-
+#endif /* !__GLX_unpack_h__ */
diff --git a/hw/dmx/input/ChkNotMaskEv.c b/hw/dmx/input/ChkNotMaskEv.c
index 635332e63..bde04ae23 100644
--- a/hw/dmx/input/ChkNotMaskEv.c
+++ b/hw/dmx/input/ChkNotMaskEv.c
@@ -67,40 +67,40 @@ extern long const _Xevent_to_mask[];
* If not, flush buffer and see if any more events are readable. If one
* matches, return. If all else fails, tell the user no events found.
*/
-Bool XCheckNotMaskEvent (Display *dpy, long mask, XEvent *event)
+Bool
+XCheckNotMaskEvent(Display * dpy, long mask, XEvent * event)
{
- register _XQEvent *prev, *qelt;
- unsigned long qe_serial = 0;
- int n; /* time through count */
+ register _XQEvent *prev, *qelt;
+ unsigned long qe_serial = 0;
+ int n; /* time through count */
- LockDisplay(dpy);
- prev = NULL;
- for (n = 3; --n >= 0;) {
- for (qelt = prev ? prev->next : dpy->head;
- qelt;
- prev = qelt, qelt = qelt->next) {
- if (qelt->event.type >= LASTEvent
- || !(_Xevent_to_mask[qelt->event.type] & mask)) {
- *event = qelt->event;
- _XDeq(dpy, prev, qelt);
- UnlockDisplay(dpy);
- return True;
- }
- }
- if (prev)
- qe_serial = prev->qserial_num;
- switch (n) {
- case 2:
- _XEventsQueued(dpy, QueuedAfterReading);
- break;
- case 1:
- _XFlush(dpy);
- break;
- }
- if (prev && prev->qserial_num != qe_serial)
- /* another thread has snatched this event */
- prev = NULL;
- }
- UnlockDisplay(dpy);
- return False;
+ LockDisplay(dpy);
+ prev = NULL;
+ for (n = 3; --n >= 0;) {
+ for (qelt = prev ? prev->next : dpy->head;
+ qelt; prev = qelt, qelt = qelt->next) {
+ if (qelt->event.type >= LASTEvent
+ || !(_Xevent_to_mask[qelt->event.type] & mask)) {
+ *event = qelt->event;
+ _XDeq(dpy, prev, qelt);
+ UnlockDisplay(dpy);
+ return True;
+ }
+ }
+ if (prev)
+ qe_serial = prev->qserial_num;
+ switch (n) {
+ case 2:
+ _XEventsQueued(dpy, QueuedAfterReading);
+ break;
+ case 1:
+ _XFlush(dpy);
+ break;
+ }
+ if (prev && prev->qserial_num != qe_serial)
+ /* another thread has snatched this event */
+ prev = NULL;
+ }
+ UnlockDisplay(dpy);
+ return False;
}
diff --git a/hw/dmx/input/ChkNotMaskEv.h b/hw/dmx/input/ChkNotMaskEv.h
index f79075e1d..78ad51f91 100644
--- a/hw/dmx/input/ChkNotMaskEv.h
+++ b/hw/dmx/input/ChkNotMaskEv.h
@@ -36,5 +36,5 @@
#ifndef _CHKNOTMASKEV_H_
#define _CHKNOTMASKEV_H_
-extern Bool XCheckNotMaskEvent (Display *dpy, long mask, XEvent *event);
+extern Bool XCheckNotMaskEvent(Display * dpy, long mask, XEvent * event);
#endif
diff --git a/hw/dmx/input/atKeynames.h b/hw/dmx/input/atKeynames.h
index 6aea1edec..68e2eb31d 100644
--- a/hw/dmx/input/atKeynames.h
+++ b/hw/dmx/input/atKeynames.h
@@ -90,20 +90,20 @@
* ---------------- ---------- ------- ------ ------
*/
-#define KEY_Escape /* Escape 0x01 */ 1
-#define KEY_1 /* 1 ! 0x02 */ 2
-#define KEY_2 /* 2 @ 0x03 */ 3
-#define KEY_3 /* 3 # 0x04 */ 4
-#define KEY_4 /* 4 $ 0x05 */ 5
-#define KEY_5 /* 5 % 0x06 */ 6
-#define KEY_6 /* 6 ^ 0x07 */ 7
-#define KEY_7 /* 7 & 0x08 */ 8
-#define KEY_8 /* 8 * 0x09 */ 9
-#define KEY_9 /* 9 ( 0x0a */ 10
-#define KEY_0 /* 0 ) 0x0b */ 11
+#define KEY_Escape /* Escape 0x01 */ 1
+#define KEY_1 /* 1 ! 0x02 */ 2
+#define KEY_2 /* 2 @ 0x03 */ 3
+#define KEY_3 /* 3 # 0x04 */ 4
+#define KEY_4 /* 4 $ 0x05 */ 5
+#define KEY_5 /* 5 % 0x06 */ 6
+#define KEY_6 /* 6 ^ 0x07 */ 7
+#define KEY_7 /* 7 & 0x08 */ 8
+#define KEY_8 /* 8 * 0x09 */ 9
+#define KEY_9 /* 9 ( 0x0a */ 10
+#define KEY_0 /* 0 ) 0x0b */ 11
#define KEY_Minus /* - (Minus) _ (Under) 0x0c */ 12
-#define KEY_Equal /* = (Equal) + 0x0d */ 13
-#define KEY_BackSpace /* Back Space 0x0e */ 14
+#define KEY_Equal /* = (Equal) + 0x0d */ 13
+#define KEY_BackSpace /* Back Space 0x0e */ 14
#define KEY_Tab /* Tab 0x0f */ 15
#define KEY_Q /* Q 0x10 */ 16
#define KEY_W /* W 0x11 */ 17
@@ -116,12 +116,12 @@
#define KEY_O /* O 0x18 */ 24
#define KEY_P /* P 0x19 */ 25
#define KEY_LBrace /* [ { 0x1a */ 26
-#define KEY_RBrace /* ] } 0x1b */ 27
+#define KEY_RBrace /* ] } 0x1b */ 27
#define KEY_Enter /* Enter 0x1c */ 28
#define KEY_LCtrl /* Ctrl(left) 0x1d */ 29
#define KEY_A /* A 0x1e */ 30
#define KEY_S /* S 0x1f */ 31
-#define KEY_D /* D 0x20 */ 32
+#define KEY_D /* D 0x20 */ 32
#define KEY_F /* F 0x21 */ 33
#define KEY_G /* G 0x22 */ 34
#define KEY_H /* H 0x23 */ 35
@@ -160,9 +160,9 @@
#define KEY_F10 /* F10 0x44 */ 68
#define KEY_NumLock /* NumLock 0x45 */ 69
#define KEY_ScrollLock /* ScrollLock 0x46 */ 70
-#define KEY_KP_7 /* 7 Home 0x47 */ 71
-#define KEY_KP_8 /* 8 Up 0x48 */ 72
-#define KEY_KP_9 /* 9 PgUp 0x49 */ 73
+#define KEY_KP_7 /* 7 Home 0x47 */ 71
+#define KEY_KP_8 /* 8 Up 0x48 */ 72
+#define KEY_KP_9 /* 9 PgUp 0x49 */ 73
#define KEY_KP_Minus /* - (Minus) 0x4a */ 74
#define KEY_KP_4 /* 4 Left 0x4b */ 75
#define KEY_KP_5 /* 5 0x4c */ 76
@@ -172,7 +172,7 @@
#define KEY_KP_2 /* 2 Down 0x50 */ 80
#define KEY_KP_3 /* 3 PgDown 0x51 */ 81
#define KEY_KP_0 /* 0 Insert 0x52 */ 82
-#define KEY_KP_Decimal /* . (Decimal) Delete 0x53 */ 83
+#define KEY_KP_Decimal /* . (Decimal) Delete 0x53 */ 83
#define KEY_SysReqest /* SysReqest 0x54 */ 84
/* NOTUSED 0x55 */
#define KEY_Less /* < (Less) >(Greater) 0x56 */ 86
@@ -289,4 +289,4 @@
#define KEY_NOTUSED 0
#define KEY_UNKNOWN 255
-#endif /* _ATKEYNAMES_H */
+#endif /* _ATKEYNAMES_H */
diff --git a/hw/dmx/input/dmxarg.c b/hw/dmx/input/dmxarg.c
index 49a1da9af..4a74b4c9e 100644
--- a/hw/dmx/input/dmxarg.c
+++ b/hw/dmx/input/dmxarg.c
@@ -51,86 +51,99 @@
/** Stores the parsed argument list. */
struct _dmxArg {
- int argc; /**< Number of arguments in argv */
- int argm; /**< Maximum number of arguments store-able in argv */
+ int argc; /**< Number of arguments in argv */
+ int argm; /**< Maximum number of arguments store-able in argv */
const char **argv; /**< Arguments */
};
/** Create an (externally opaque) \a dmxArg object. */
-dmxArg dmxArgCreate(void)
+dmxArg
+dmxArgCreate(void)
{
- dmxArg a = malloc(sizeof(*a));
- a->argc = 0;
- a->argm = 2;
- a->argv = malloc(a->argm * sizeof(*a->argv));
+ dmxArg a = malloc(sizeof(*a));
+
+ a->argc = 0;
+ a->argm = 2;
+ a->argv = malloc(a->argm * sizeof(*a->argv));
a->argv[0] = NULL;
return a;
}
/** Free the specified \a dmxArg object. */
-void dmxArgFree(dmxArg a)
+void
+dmxArgFree(dmxArg a)
{
int i;
- for (i = 0; i < a->argc; i++) free((char *)a->argv[i]);
+ for (i = 0; i < a->argc; i++)
+ free((char *) a->argv[i]);
free(a->argv);
free(a);
}
/** Add the \a string as the next argument in the \a dmxArg object. */
-void dmxArgAdd(dmxArg a, const char *string)
+void
+dmxArgAdd(dmxArg a, const char *string)
{
if (a->argm <= a->argc + 2)
a->argv = realloc(a->argv, sizeof(*a->argv) * (a->argm *= 2));
a->argv[a->argc++] = strdup(string);
- a->argv[a->argc] = NULL;
+ a->argv[a->argc] = NULL;
}
/** Return the argument number \a item in the \a dmxArg object.
* Arguments are 0 based. NULL will be returned for values less than 0
* or equal to or greater than the number of arguments in the object. */
-const char *dmxArgV(dmxArg a, int item)
+const char *
+dmxArgV(dmxArg a, int item)
{
- if (item < 0 || item >= a->argc) return NULL;
+ if (item < 0 || item >= a->argc)
+ return NULL;
return a->argv[item];
}
/** Return the number of arguments in the \a dmxArg object. */
-int dmxArgC(dmxArg a)
+int
+dmxArgC(dmxArg a)
{
return a->argc;
}
/** Parse a string into arguments delimited by commas. Return a new \a
* dmxArg object containing the arguments. */
-dmxArg dmxArgParse(const char *string)
+dmxArg
+dmxArgParse(const char *string)
{
- char *tmp;
- char *start, *pt;
+ char *tmp;
+ char *start, *pt;
dmxArg a = dmxArgCreate();
- int done;
- int len;
+ int done;
+ int len;
- if (!string) return a;
+ if (!string)
+ return a;
len = strlen(string) + 2;
tmp = malloc(len);
strncpy(tmp, string, len);
for (start = pt = tmp, done = 0; !done && *pt; start = ++pt) {
- for (;*pt && *pt != ','; pt++);
- if (!*pt) done = 1;
+ for (; *pt && *pt != ','; pt++);
+ if (!*pt)
+ done = 1;
*pt = '\0';
dmxArgAdd(a, start);
}
- if (!done) dmxArgAdd(a, ""); /* Final comma */
-
+ if (!done)
+ dmxArgAdd(a, ""); /* Final comma */
+
free(tmp);
return a;
}
#if DMX_ARG_TEST
-static void dmxArgPrint(dmxArg a)
+static void
+dmxArgPrint(dmxArg a)
{
int i;
@@ -139,7 +152,8 @@ static void dmxArgPrint(dmxArg a)
printf(" argv[%d] = \"%s\"\n", i, dmxArgV(a, i));
}
-static void dmxArgTest(const char *string)
+static void
+dmxArgTest(const char *string)
{
dmxArg a;
@@ -155,7 +169,8 @@ static void dmxArgTest(const char *string)
dmxArgFree(a);
}
-int main(void)
+int
+main(void)
{
dmxArgTest(NULL);
dmxArgTest("");
diff --git a/hw/dmx/input/dmxarg.h b/hw/dmx/input/dmxarg.h
index ca76f9272..acd8805b6 100644
--- a/hw/dmx/input/dmxarg.h
+++ b/hw/dmx/input/dmxarg.h
@@ -39,11 +39,11 @@
typedef struct _dmxArg *dmxArg;
-extern dmxArg dmxArgCreate(void);
-extern void dmxArgFree(dmxArg a);
-extern void dmxArgAdd(dmxArg a, const char *string);
+extern dmxArg dmxArgCreate(void);
+extern void dmxArgFree(dmxArg a);
+extern void dmxArgAdd(dmxArg a, const char *string);
extern const char *dmxArgV(dmxArg a, int item);
-extern int dmxArgC(dmxArg a);
-extern dmxArg dmxArgParse(const char *string);
+extern int dmxArgC(dmxArg a);
+extern dmxArg dmxArgParse(const char *string);
#endif
diff --git a/hw/dmx/input/dmxbackend.c b/hw/dmx/input/dmxbackend.c
index e917a5c42..9463c87d3 100644
--- a/hw/dmx/input/dmxbackend.c
+++ b/hw/dmx/input/dmxbackend.c
@@ -63,17 +63,17 @@
/* Private area for backend devices. */
typedef struct _myPrivate {
DMX_COMMON_PRIVATE;
- int myScreen;
- DMXScreenInfo *grabbedScreen;
-
- int lastX, lastY;
- int centerX, centerY;
- int relative;
- int newscreen;
- int initialized;
- DevicePtr mou, kbd;
- int entered;
- int offX, offY;
+ int myScreen;
+ DMXScreenInfo *grabbedScreen;
+
+ int lastX, lastY;
+ int centerX, centerY;
+ int relative;
+ int newscreen;
+ int initialized;
+ DevicePtr mou, kbd;
+ int entered;
+ int offX, offY;
} myPrivate;
#if DMX_BACKEND_DEBUG
@@ -101,27 +101,32 @@ typedef struct _myPrivate {
#endif
/** Create and return a private data structure. */
-pointer dmxBackendCreatePrivate(DeviceIntPtr pDevice)
+pointer
+dmxBackendCreatePrivate(DeviceIntPtr pDevice)
{
GETDMXLOCALFROMPDEVICE;
myPrivate *priv = calloc(1, sizeof(*priv));
- priv->dmxLocal = dmxLocal;
+
+ priv->dmxLocal = dmxLocal;
return priv;
}
/** Destroy the private data structure. No checking is performed to
* verify that the structure was actually created by
* #dmxBackendCreatePrivate. */
-void dmxBackendDestroyPrivate(pointer private)
+void
+dmxBackendDestroyPrivate(pointer private)
{
free(private);
}
-static void *dmxBackendTestScreen(DMXScreenInfo *dmxScreen, void *closure)
+static void *
+dmxBackendTestScreen(DMXScreenInfo * dmxScreen, void *closure)
{
- long target = (long)closure;
+ long target = (long) closure;
- if (dmxScreen->index == target) return dmxScreen;
+ if (dmxScreen->index == target)
+ return dmxScreen;
return NULL;
}
@@ -130,51 +135,59 @@ static void *dmxBackendTestScreen(DMXScreenInfo *dmxScreen, void *closure)
* different screens). Since this is a common operation, the results
* are cached. The cache is invalidated if \a priv is NULL (this should
* be done with each server generation and reconfiguration). */
-static int dmxBackendSameDisplay(myPrivate *priv, long screen)
+static int
+dmxBackendSameDisplay(myPrivate * priv, long screen)
{
- static myPrivate *oldpriv = NULL;
- static int oldscreen = -1;
- static int retcode = 0;
+ static myPrivate *oldpriv = NULL;
+ static int oldscreen = -1;
+ static int retcode = 0;
- if (priv == oldpriv && screen == oldscreen) return retcode;
+ if (priv == oldpriv && screen == oldscreen)
+ return retcode;
if (!priv) { /* Invalidate cache */
- oldpriv = NULL;
+ oldpriv = NULL;
oldscreen = -1;
- retcode = 0;
+ retcode = 0;
return 0;
}
- if (screen == priv->myScreen) retcode = 1;
- else if (screen < 0 || screen >= dmxNumScreens) retcode = 0;
+ if (screen == priv->myScreen)
+ retcode = 1;
+ else if (screen < 0 || screen >= dmxNumScreens)
+ retcode = 0;
else if (dmxPropertyIterate(priv->be,
- dmxBackendTestScreen,
- (void *)screen)) retcode = 2;
- else retcode = 0;
+ dmxBackendTestScreen, (void *) screen))
+ retcode = 2;
+ else
+ retcode = 0;
- oldpriv = priv;
+ oldpriv = priv;
oldscreen = screen;
return retcode;
}
-static void *dmxBackendTestEvents(DMXScreenInfo *dmxScreen, void *closure)
+static void *
+dmxBackendTestEvents(DMXScreenInfo * dmxScreen, void *closure)
{
- XEvent *X = (XEvent *)closure;
-
+ XEvent *X = (XEvent *) closure;
+
if (XCheckNotMaskEvent(dmxScreen->beDisplay, ExposureMask, X))
return dmxScreen;
return NULL;
}
-static void *dmxBackendTestMotionEvent(DMXScreenInfo *dmxScreen, void *closure)
+static void *
+dmxBackendTestMotionEvent(DMXScreenInfo * dmxScreen, void *closure)
{
- XEvent *X = (XEvent *)closure;
+ XEvent *X = (XEvent *) closure;
if (XCheckTypedEvent(dmxScreen->beDisplay, MotionNotify, X))
return dmxScreen;
return NULL;
}
-static DMXScreenInfo *dmxBackendGetEvent(myPrivate *priv, XEvent *X)
+static DMXScreenInfo *
+dmxBackendGetEvent(myPrivate * priv, XEvent * X)
{
DMXScreenInfo *dmxScreen;
@@ -183,52 +196,63 @@ static DMXScreenInfo *dmxBackendGetEvent(myPrivate *priv, XEvent *X)
return NULL;
}
-static DMXScreenInfo *dmxBackendPendingMotionEvent(myPrivate *priv, int save)
+static DMXScreenInfo *
+dmxBackendPendingMotionEvent(myPrivate * priv, int save)
{
DMXScreenInfo *dmxScreen;
- XEvent N;
+ XEvent N;
if ((dmxScreen = dmxPropertyIterate(priv->be,
dmxBackendTestMotionEvent, &N))) {
- if (save) XPutBackEvent(dmxScreen->beDisplay, &N);
+ if (save)
+ XPutBackEvent(dmxScreen->beDisplay, &N);
return dmxScreen;
}
return NULL;
}
-static void *dmxBackendTestWindow(DMXScreenInfo *dmxScreen, void *closure)
+static void *
+dmxBackendTestWindow(DMXScreenInfo * dmxScreen, void *closure)
{
- Window win = (Window)(long)closure;
- if (dmxScreen->scrnWin == win) return dmxScreen;
+ Window win = (Window) (long) closure;
+
+ if (dmxScreen->scrnWin == win)
+ return dmxScreen;
return NULL;
}
-static DMXScreenInfo *dmxBackendFindWindow(myPrivate *priv, Window win)
+static DMXScreenInfo *
+dmxBackendFindWindow(myPrivate * priv, Window win)
{
return dmxPropertyIterate(priv->be, dmxBackendTestWindow,
- (void *)(long)win);
+ (void *) (long) win);
}
/* If the cursor is over a set of overlapping screens and one of those
* screens takes backend input, then we want that particular screen to
* be current, not one of the other ones. */
-static int dmxBackendFindOverlapping(myPrivate *priv, int screen, int x, int y)
+static int
+dmxBackendFindOverlapping(myPrivate * priv, int screen, int x, int y)
{
DMXScreenInfo *start = &dmxScreens[screen];
DMXScreenInfo *pt;
- if (!start->over) return screen;
-
- for (pt = start->over; /* condition at end of loop */; pt = pt->over) {
+ if (!start->over)
+ return screen;
+
+ for (pt = start->over; /* condition at end of loop */ ; pt = pt->over) {
if (pt->index == priv->myScreen
- && dmxOnScreen(x, y, &dmxScreens[pt->index])) return pt->index;
- if (pt == start) break;
+ && dmxOnScreen(x, y, &dmxScreens[pt->index]))
+ return pt->index;
+ if (pt == start)
+ break;
}
return screen;
}
/* Return non-zero if \a x and \a y are off \a screen. */
-static int dmxBackendOffscreen(int screen, int x, int y)
+static int
+dmxBackendOffscreen(int screen, int x, int y)
{
DMXScreenInfo *dmxScreen = &dmxScreens[screen];
@@ -237,16 +261,17 @@ static int dmxBackendOffscreen(int screen, int x, int y)
/** This routine is called from #dmxCoreMotion for each motion
* event. \a x and \a y are global coordinants. */
-void dmxBackendUpdatePosition(pointer private, int x, int y)
+void
+dmxBackendUpdatePosition(pointer private, int x, int y)
{
GETPRIVFROMPRIVATE;
- int screen = miPointerGetScreen(inputInfo.pointer)->myNum;
- DMXScreenInfo *dmxScreen = &dmxScreens[priv->myScreen];
- int oldRelative = priv->relative;
- int topscreen = dmxBackendFindOverlapping(priv, screen, x, y);
- int same = dmxBackendSameDisplay(priv, topscreen);
- int offscreen = dmxBackendOffscreen(priv->myScreen, x, y);
- int offthis = dmxBackendOffscreen(screen, x, y);
+ int screen = miPointerGetScreen(inputInfo.pointer)->myNum;
+ DMXScreenInfo *dmxScreen = &dmxScreens[priv->myScreen];
+ int oldRelative = priv->relative;
+ int topscreen = dmxBackendFindOverlapping(priv, screen, x, y);
+ int same = dmxBackendSameDisplay(priv, topscreen);
+ int offscreen = dmxBackendOffscreen(priv->myScreen, x, y);
+ int offthis = dmxBackendOffscreen(screen, x, y);
DMXDBG9("dmxBackendUpdatePosition(%d,%d) my=%d mi=%d rel=%d"
" topscreen=%d same=%d offscreen=%d offthis=%d\n",
@@ -262,13 +287,15 @@ void dmxBackendUpdatePosition(pointer private, int x, int y)
DMXDBG0(" Off screen, but not absolute\n");
priv->relative = 0;
}
- } else {
+ }
+ else {
if (!priv->relative) {
DMXDBG0(" Off screen, but not relative\n");
priv->relative = 1;
}
}
- } else {
+ }
+ else {
if (topscreen != screen) {
DMXDBG2(" Using screen %d instead of %d (from mi)\n",
topscreen, screen);
@@ -278,7 +305,8 @@ void dmxBackendUpdatePosition(pointer private, int x, int y)
DMXDBG0(" On screen, but not absolute\n");
priv->relative = 0;
}
- } else {
+ }
+ else {
if (!priv->relative) {
DMXDBG0(" Not on screen, but not relative\n");
priv->relative = 1;
@@ -287,12 +315,11 @@ void dmxBackendUpdatePosition(pointer private, int x, int y)
}
if (oldRelative != priv->relative) {
- DMXDBG2(" Do switch, relative=%d same=%d\n",
- priv->relative, same);
+ DMXDBG2(" Do switch, relative=%d same=%d\n", priv->relative, same);
/* Discard all pre-switch events */
dmxSync(dmxScreen, TRUE);
while (dmxBackendPendingMotionEvent(priv, FALSE));
-
+
if (dmxInput->console && offscreen) {
/* Our special case is a console window and a backend window
* share a display. In this case, the cursor is either on
@@ -309,7 +336,8 @@ void dmxBackendUpdatePosition(pointer private, int x, int y)
}
DMXDBG0(" Capturing console\n");
dmxConsoleCapture(dmxInput);
- } else {
+ }
+ else {
priv->newscreen = 1;
if (priv->relative && !dmxInput->console) {
DMXDBG5(" Hide cursor; warp from %d,%d to %d,%d on %d\n",
@@ -317,12 +345,13 @@ void dmxBackendUpdatePosition(pointer private, int x, int y)
priv->myScreen);
dmxConsoleUncapture(dmxInput);
dmxHideCursor(dmxScreen);
- priv->lastX = priv->centerX;
- priv->lastY = priv->centerY;
+ priv->lastX = priv->centerX;
+ priv->lastY = priv->centerY;
XWarpPointer(priv->display, None, priv->window,
0, 0, 0, 0, priv->lastX, priv->lastY);
dmxSync(dmxScreen, TRUE);
- } else {
+ }
+ else {
DMXDBG0(" Check cursor\n");
dmxCheckCursor();
}
@@ -332,37 +361,37 @@ void dmxBackendUpdatePosition(pointer private, int x, int y)
/** Get events from the X queue on the backend servers and put the
* events into the DMX event queue. */
-void dmxBackendCollectEvents(DevicePtr pDev,
- dmxMotionProcPtr motion,
- dmxEnqueueProcPtr enqueue,
- dmxCheckSpecialProcPtr checkspecial,
- DMXBlockType block)
+void
+dmxBackendCollectEvents(DevicePtr pDev,
+ dmxMotionProcPtr motion,
+ dmxEnqueueProcPtr enqueue,
+ dmxCheckSpecialProcPtr checkspecial, DMXBlockType block)
{
GETPRIVFROMPDEV;
GETDMXINPUTFROMPRIV;
- XEvent X;
- DMXScreenInfo *dmxScreen;
- int left = 0;
- int entered = priv->entered;
- int ignoreLeave = 0;
- int v[2];
- int retcode;
+ XEvent X;
+ DMXScreenInfo *dmxScreen;
+ int left = 0;
+ int entered = priv->entered;
+ int ignoreLeave = 0;
+ int v[2];
+ int retcode;
while ((dmxScreen = dmxBackendGetEvent(priv, &X))) {
- switch (X.type) {
+ switch (X.type) {
case EnterNotify:
dmxCommonSaveState(priv);
if (entered++)
continue;
priv->entered = 1;
- ignoreLeave = 1;
+ ignoreLeave = 1;
DMXDBG5("dmxBackendCollectEvents: Enter %lu %d,%d; GRAB %s %p\n",
X.xcrossing.root, X.xcrossing.x, X.xcrossing.y,
dmxScreen->name, dmxScreen->beDisplay);
XRaiseWindow(dmxScreen->beDisplay, dmxScreen->scrnWin);
priv->grabbedScreen = dmxScreen;
if ((retcode = XGrabPointer(dmxScreen->beDisplay,
- dmxScreen->scrnWin,
+ dmxScreen->scrnWin,
True, 0, GrabModeAsync,
GrabModeAsync, None, None,
CurrentTime))) {
@@ -382,15 +411,14 @@ void dmxBackendCollectEvents(DevicePtr pDev,
DMXDBG7("dmxBackendCollectEvents: Leave %lu %d,%d %d %d %s %s\n",
X.xcrossing.root, X.xcrossing.x, X.xcrossing.y,
X.xcrossing.detail, X.xcrossing.focus,
- priv->grabbedScreen ? "UNGRAB" : "",
- dmxScreen->name);
+ priv->grabbedScreen ? "UNGRAB" : "", dmxScreen->name);
if (priv->grabbedScreen) {
XUngrabPointer(priv->grabbedScreen->beDisplay, CurrentTime);
dmxSync(priv->grabbedScreen, TRUE);
priv->grabbedScreen = NULL;
}
break;
- case MotionNotify:
+ case MotionNotify:
DMXDBG9("dmxBackendCollectEvents: MotionNotify %d/%d (mi %d)"
" newscreen=%d: %d %d (e=%d; last=%d,%d)\n",
dmxScreen->index, priv->myScreen,
@@ -409,12 +437,17 @@ void dmxBackendCollectEvents(DevicePtr pDev,
int newY = X.xmotion.y - dmxScreen->rootY;
if (!priv->newscreen) {
- int width = dmxScreen->rootWidth;
+ int width = dmxScreen->rootWidth;
int height = dmxScreen->rootHeight;
- if (!newX) newX = -1;
- if (newX == width - 1) newX = width;
- if (!newY) newY = -1;
- if (newY == height - 1) newY = height;
+
+ if (!newX)
+ newX = -1;
+ if (newX == width - 1)
+ newX = width;
+ if (!newY)
+ newY = -1;
+ if (newY == height - 1)
+ newY = height;
}
priv->newscreen = 0;
v[0] = dmxScreen->rootXOrigin + newX;
@@ -426,13 +459,15 @@ void dmxBackendCollectEvents(DevicePtr pDev,
priv->be->scrnWidth, priv->be->scrnHeight);
motion(priv->mou, v, 0, 2, DMX_ABSOLUTE, block);
priv->entered = 0;
- } else {
+ }
+ else {
int newX = priv->lastX - X.xmotion.x;
int newY = priv->lastY - X.xmotion.y;
+
priv->lastX = X.xmotion.x;
priv->lastY = X.xmotion.y;
- v[0] = newX;
- v[1] = newY;
+ v[0] = newX;
+ v[1] = newY;
DMXDBG2(" Relative move: %d, %d\n", v[0], v[1]);
motion(priv->mou, v, 0, 2, DMX_RELATIVE, block);
}
@@ -444,7 +479,7 @@ void dmxBackendCollectEvents(DevicePtr pDev,
(dmxScreen->rootYOrigin + X.xmotion.y
- dmxScreen->rootY));
}
- break;
+ break;
case KeyPress:
case KeyRelease:
@@ -453,71 +488,77 @@ void dmxBackendCollectEvents(DevicePtr pDev,
case ButtonPress:
case ButtonRelease:
/* fall-through */
- default:
- /* Pass the whole event here, because
- * this may be an extension event. */
+ default:
+ /* Pass the whole event here, because
+ * this may be an extension event. */
enqueue(priv->mou, X.type, X.xbutton.button, 0, &X, block);
- break;
- }
+ break;
+ }
}
}
/** Called after input events are processed from the DMX queue. No
* event processing actually takes place here, but this is a convenient
* place to update the pointer. */
-void dmxBackendProcessInput(pointer private)
+void
+dmxBackendProcessInput(pointer private)
{
GETPRIVFROMPRIVATE;
DMXDBG6("dmxBackendProcessInput: myScreen=%d relative=%d"
" last=%d,%d center=%d,%d\n",
priv->myScreen, priv->relative,
- priv->lastX, priv->lastY,
- priv->centerX, priv->centerY);
+ priv->lastX, priv->lastY, priv->centerX, priv->centerY);
if (priv->relative
&& !dmxInput->console
&& (priv->lastX != priv->centerX || priv->lastY != priv->centerY)) {
DMXDBG4(" warping pointer from last=%d,%d to center=%d,%d\n",
priv->lastX, priv->lastY, priv->centerX, priv->centerY);
- priv->lastX = priv->centerX;
- priv->lastY = priv->centerY;
+ priv->lastX = priv->centerX;
+ priv->lastY = priv->centerY;
XWarpPointer(priv->display, None, priv->window,
0, 0, 0, 0, priv->lastX, priv->lastY);
dmxSync(&dmxScreens[priv->myScreen], TRUE);
}
}
-static void dmxBackendComputeCenter(myPrivate *priv)
+static void
+dmxBackendComputeCenter(myPrivate * priv)
{
int centerX;
int centerY;
-
- centerX = priv->be->rootWidth / 2 + priv->be->rootX;
- centerY = priv->be->rootHeight / 2 + priv->be->rootY;
- if (centerX > priv->be->rootWidth) centerX = priv->be->rootWidth - 1;
- if (centerY > priv->be->rootHeight) centerY = priv->be->rootHeight - 1;
- if (centerX < 1) centerX = 1;
- if (centerY < 1) centerY = 1;
+ centerX = priv->be->rootWidth / 2 + priv->be->rootX;
+ centerY = priv->be->rootHeight / 2 + priv->be->rootY;
+
+ if (centerX > priv->be->rootWidth)
+ centerX = priv->be->rootWidth - 1;
+ if (centerY > priv->be->rootHeight)
+ centerY = priv->be->rootHeight - 1;
+ if (centerX < 1)
+ centerX = 1;
+ if (centerY < 1)
+ centerY = 1;
priv->centerX = centerX;
priv->centerY = centerY;
}
-static DMXScreenInfo *dmxBackendInitPrivate(DevicePtr pDev)
+static DMXScreenInfo *
+dmxBackendInitPrivate(DevicePtr pDev)
{
GETPRIVFROMPDEV;
- DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx];
- DMXScreenInfo *dmxScreen;
- int i;
+ DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx];
+ DMXScreenInfo *dmxScreen;
+ int i;
/* Fill in myPrivate */
- for (i = 0,dmxScreen = &dmxScreens[0]; i<dmxNumScreens; i++,dmxScreen++) {
+ for (i = 0, dmxScreen = &dmxScreens[0]; i < dmxNumScreens; i++, dmxScreen++) {
if (dmxPropertySameDisplay(dmxScreen, dmxInput->name)) {
- priv->display = dmxScreen->beDisplay;
- priv->window = dmxScreen->scrnWin;
- priv->be = dmxScreen;
+ priv->display = dmxScreen->beDisplay;
+ priv->window = dmxScreen->scrnWin;
+ priv->be = dmxScreen;
break;
}
}
@@ -532,80 +573,88 @@ static DMXScreenInfo *dmxBackendInitPrivate(DevicePtr pDev)
/** Re-initialized the backend device described by \a pDev (after a
* reconfig). */
-void dmxBackendLateReInit(DevicePtr pDev)
+void
+dmxBackendLateReInit(DevicePtr pDev)
{
GETPRIVFROMPDEV;
- int x, y;
+ int x, y;
DMXDBG1("dmxBackendLateReInit miPointerCurrentScreen() = %p\n",
miPointerCurrentScreen());
- dmxBackendSameDisplay(NULL, 0); /* Invalidate cache */
+ dmxBackendSameDisplay(NULL, 0); /* Invalidate cache */
dmxBackendInitPrivate(pDev);
dmxBackendComputeCenter(priv);
dmxGetGlobalPosition(&x, &y);
- dmxInvalidateGlobalPosition(); /* To force event processing */
+ dmxInvalidateGlobalPosition(); /* To force event processing */
dmxBackendUpdatePosition(priv, x, y);
}
/** Initialized the backend device described by \a pDev. */
-void dmxBackendInit(DevicePtr pDev)
+void
+dmxBackendInit(DevicePtr pDev)
{
GETPRIVFROMPDEV;
- DMXScreenInfo *dmxScreen;
+ DMXScreenInfo *dmxScreen;
- dmxBackendSameDisplay(NULL, 0); /* Invalidate cache */
+ dmxBackendSameDisplay(NULL, 0); /* Invalidate cache */
- if (dmxLocal->type == DMX_LOCAL_MOUSE) priv->mou = pDev;
- if (dmxLocal->type == DMX_LOCAL_KEYBOARD) priv->kbd = pDev;
- if (priv->initialized++) return; /* Only do once for mouse/keyboard pair */
+ if (dmxLocal->type == DMX_LOCAL_MOUSE)
+ priv->mou = pDev;
+ if (dmxLocal->type == DMX_LOCAL_KEYBOARD)
+ priv->kbd = pDev;
+ if (priv->initialized++)
+ return; /* Only do once for mouse/keyboard pair */
dmxScreen = dmxBackendInitPrivate(pDev);
/* Finish initialization using computed values or constants. */
dmxBackendComputeCenter(priv);
- priv->eventMask = (EnterWindowMask|LeaveWindowMask);
- priv->myScreen = dmxScreen->index;
- priv->lastX = priv->centerX;
- priv->lastY = priv->centerY;
- priv->relative = 0;
- priv->newscreen = 0;
+ priv->eventMask = (EnterWindowMask | LeaveWindowMask);
+ priv->myScreen = dmxScreen->index;
+ priv->lastX = priv->centerX;
+ priv->lastY = priv->centerY;
+ priv->relative = 0;
+ priv->newscreen = 0;
}
/** Get information about the backend pointer (for initialization). */
-void dmxBackendMouGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
+void
+dmxBackendMouGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
{
const DMXScreenInfo *dmxScreen = dmxBackendInitPrivate(pDev);
- info->buttonClass = 1;
+ info->buttonClass = 1;
dmxCommonMouGetMap(pDev, info->map, &info->numButtons);
- info->valuatorClass = 1;
- info->numRelAxes = 2;
- info->minval[0] = 0;
- info->minval[1] = 0;
- info->maxval[0] = dmxScreen->beWidth;
- info->maxval[1] = dmxScreen->beHeight;
- info->res[0] = 1;
- info->minres[0] = 0;
- info->maxres[0] = 1;
+ info->valuatorClass = 1;
+ info->numRelAxes = 2;
+ info->minval[0] = 0;
+ info->minval[1] = 0;
+ info->maxval[0] = dmxScreen->beWidth;
+ info->maxval[1] = dmxScreen->beHeight;
+ info->res[0] = 1;
+ info->minres[0] = 0;
+ info->maxres[0] = 1;
info->ptrFeedbackClass = 1;
}
/** Get information about the backend keyboard (for initialization). */
-void dmxBackendKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
+void
+dmxBackendKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
{
dmxCommonKbdGetInfo(pDev, info);
- info->keyboard = 1;
- info->keyClass = 1;
+ info->keyboard = 1;
+ info->keyClass = 1;
dmxCommonKbdGetMap(pDev, &info->keySyms, info->modMap);
- info->freemap = 1;
- info->focusClass = 1;
+ info->freemap = 1;
+ info->focusClass = 1;
info->kbdFeedbackClass = 1;
}
/** Process #DMXFunctionType functions. The only function handled here
* is to acknowledge a pending server shutdown. */
-int dmxBackendFunctions(pointer private, DMXFunctionType function)
+int
+dmxBackendFunctions(pointer private, DMXFunctionType function)
{
switch (function) {
case DMX_FUNCTION_TERMINATE:
diff --git a/hw/dmx/input/dmxbackend.h b/hw/dmx/input/dmxbackend.h
index ee78f0014..6a49a56d6 100644
--- a/hw/dmx/input/dmxbackend.h
+++ b/hw/dmx/input/dmxbackend.h
@@ -39,18 +39,18 @@
#define _DMXBACKEND_H_
extern pointer dmxBackendCreatePrivate(DeviceIntPtr pDevice);
-extern void dmxBackendDestroyPrivate(pointer private);
-extern void dmxBackendInit(DevicePtr pDev);
-extern void dmxBackendLateReInit(DevicePtr pDev);
-extern void dmxBackendMouGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
-extern void dmxBackendKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
-extern void dmxBackendCollectEvents(DevicePtr pDev,
- dmxMotionProcPtr motion,
- dmxEnqueueProcPtr enqueue,
- dmxCheckSpecialProcPtr checkspecial,
- DMXBlockType block);
-extern void dmxBackendProcessInput(pointer private);
-extern int dmxBackendFunctions(pointer private, DMXFunctionType function);
-extern void dmxBackendUpdatePosition(pointer private, int x, int y);
+extern void dmxBackendDestroyPrivate(pointer private);
+extern void dmxBackendInit(DevicePtr pDev);
+extern void dmxBackendLateReInit(DevicePtr pDev);
+extern void dmxBackendMouGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
+extern void dmxBackendKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
+extern void dmxBackendCollectEvents(DevicePtr pDev,
+ dmxMotionProcPtr motion,
+ dmxEnqueueProcPtr enqueue,
+ dmxCheckSpecialProcPtr checkspecial,
+ DMXBlockType block);
+extern void dmxBackendProcessInput(pointer private);
+extern int dmxBackendFunctions(pointer private, DMXFunctionType function);
+extern void dmxBackendUpdatePosition(pointer private, int x, int y);
#endif
diff --git a/hw/dmx/input/dmxcommon.c b/hw/dmx/input/dmxcommon.c
index c665dad90..5f25e8832 100644
--- a/hw/dmx/input/dmxcommon.c
+++ b/hw/dmx/input/dmxcommon.c
@@ -66,23 +66,23 @@
#endif
/** Each device has a private area that is visible only from inside the
- * driver code. */
+ * driver code. */
typedef struct _myPrivate {
DMX_COMMON_PRIVATE;
} myPrivate;
-static void dmxCommonKbdSetAR(Display *display,
- unsigned char *old, unsigned char *new)
+static void
+dmxCommonKbdSetAR(Display * display, unsigned char *old, unsigned char *new)
{
XKeyboardControl kc;
- XKeyboardState ks;
- unsigned long mask = KBKey | KBAutoRepeatMode;
- int i, j;
- int minKeycode, maxKeycode;
+ XKeyboardState ks;
+ unsigned long mask = KBKey | KBAutoRepeatMode;
+ int i, j;
+ int minKeycode, maxKeycode;
if (!old) {
XGetKeyboardControl(display, &ks);
- old = (unsigned char *)ks.auto_repeats;
+ old = (unsigned char *) ks.auto_repeats;
}
XDisplayKeycodes(display, &minKeycode, &maxKeycode);
@@ -90,7 +90,7 @@ static void dmxCommonKbdSetAR(Display *display,
if (!old || old[i] != new[i]) {
for (j = 0; j < 8; j++) {
if ((new[i] & (1 << j)) != (old[i] & (1 << j))) {
- kc.key = i * 8 + j;
+ kc.key = i * 8 + j;
kc.auto_repeat_mode = ((new[i] & (1 << j))
? AutoRepeatModeOn
: AutoRepeatModeOff);
@@ -102,48 +102,46 @@ static void dmxCommonKbdSetAR(Display *display,
}
}
-static void dmxCommonKbdSetLeds(Display *display, unsigned long new)
+static void
+dmxCommonKbdSetLeds(Display * display, unsigned long new)
{
- int i;
+ int i;
XKeyboardControl kc;
for (i = 0; i < 32; i++) {
- kc.led = i + 1;
+ kc.led = i + 1;
kc.led_mode = (new & (1 << i)) ? LedModeOn : LedModeOff;
XChangeKeyboardControl(display, KBLed | KBLedMode, &kc);
}
}
-static void dmxCommonKbdSetCtrl(Display *display,
- KeybdCtrl *old, KeybdCtrl *new)
+static void
+dmxCommonKbdSetCtrl(Display * display, KeybdCtrl * old, KeybdCtrl * new)
{
XKeyboardControl kc;
- unsigned long mask = KBKeyClickPercent | KBAutoRepeatMode;
+ unsigned long mask = KBKeyClickPercent | KBAutoRepeatMode;
+
+ if (!old || old->click != new->click || old->autoRepeat != new->autoRepeat) {
- if (!old
- || old->click != new->click
- || old->autoRepeat != new->autoRepeat) {
-
kc.key_click_percent = new->click;
- kc.auto_repeat_mode = new->autoRepeat;
+ kc.auto_repeat_mode = new->autoRepeat;
XChangeKeyboardControl(display, mask, &kc);
}
dmxCommonKbdSetLeds(display, new->leds);
- dmxCommonKbdSetAR(display, old ? old->autoRepeats : NULL,
- new->autoRepeats);
+ dmxCommonKbdSetAR(display, old ? old->autoRepeats : NULL, new->autoRepeats);
}
-static void dmxCommonMouSetCtrl(Display *display, PtrCtrl *old, PtrCtrl *new)
+static void
+dmxCommonMouSetCtrl(Display * display, PtrCtrl * old, PtrCtrl * new)
{
Bool do_accel, do_threshold;
-
+
if (!old
|| old->num != new->num
- || old->den != new->den
- || old->threshold != new->threshold) {
- do_accel = (new->num > 0 && new->den > 0);
+ || old->den != new->den || old->threshold != new->threshold) {
+ do_accel = (new->num > 0 && new->den > 0);
do_threshold = (new->threshold > 0);
if (do_accel || do_threshold) {
XChangePointerControl(display, do_accel, do_threshold,
@@ -153,100 +151,105 @@ static void dmxCommonMouSetCtrl(Display *display, PtrCtrl *old, PtrCtrl *new)
}
/** Update the keyboard control. */
-void dmxCommonKbdCtrl(DevicePtr pDev, KeybdCtrl *ctrl)
+void
+dmxCommonKbdCtrl(DevicePtr pDev, KeybdCtrl * ctrl)
{
GETPRIVFROMPDEV;
- if (!priv->stateSaved && priv->be) dmxCommonSaveState(priv);
- if (!priv->display || !priv->stateSaved) return;
+ if (!priv->stateSaved && priv->be)
+ dmxCommonSaveState(priv);
+ if (!priv->display || !priv->stateSaved)
+ return;
dmxCommonKbdSetCtrl(priv->display,
- priv->kctrlset ? &priv->kctrl : NULL,
- ctrl);
- priv->kctrl = *ctrl;
+ priv->kctrlset ? &priv->kctrl : NULL, ctrl);
+ priv->kctrl = *ctrl;
priv->kctrlset = 1;
}
/** Update the mouse control. */
-void dmxCommonMouCtrl(DevicePtr pDev, PtrCtrl *ctrl)
+void
+dmxCommonMouCtrl(DevicePtr pDev, PtrCtrl * ctrl)
{
GETPRIVFROMPDEV;
- /* Don't set the acceleration for the
- * console, because that should be
- * controlled by the X server that the
- * console is running on. Otherwise,
- * the acceleration for the console
- * window would be unexpected for the
- * scale of the window. */
+ /* Don't set the acceleration for the
+ * console, because that should be
+ * controlled by the X server that the
+ * console is running on. Otherwise,
+ * the acceleration for the console
+ * window would be unexpected for the
+ * scale of the window. */
if (priv->be) {
dmxCommonMouSetCtrl(priv->display,
- priv->mctrlset ? &priv->mctrl : NULL,
- ctrl);
- priv->mctrl = *ctrl;
+ priv->mctrlset ? &priv->mctrl : NULL, ctrl);
+ priv->mctrl = *ctrl;
priv->mctrlset = 1;
}
}
/** Sound they keyboard bell. */
-void dmxCommonKbdBell(DevicePtr pDev, int percent,
- int volume, int pitch, int duration)
+void
+dmxCommonKbdBell(DevicePtr pDev, int percent,
+ int volume, int pitch, int duration)
{
GETPRIVFROMPDEV;
XKeyboardControl kc;
- XKeyboardState ks;
- unsigned long mask = KBBellPercent | KBBellPitch | KBBellDuration;
-
- if (!priv->be) XGetKeyboardControl(priv->display, &ks);
- kc.bell_percent = volume;
- kc.bell_pitch = pitch;
+ XKeyboardState ks;
+ unsigned long mask = KBBellPercent | KBBellPitch | KBBellDuration;
+
+ if (!priv->be)
+ XGetKeyboardControl(priv->display, &ks);
+ kc.bell_percent = volume;
+ kc.bell_pitch = pitch;
kc.bell_duration = duration;
XChangeKeyboardControl(priv->display, mask, &kc);
XBell(priv->display, percent);
if (!priv->be) {
- kc.bell_percent = ks.bell_percent;
- kc.bell_pitch = ks.bell_pitch;
+ kc.bell_percent = ks.bell_percent;
+ kc.bell_pitch = ks.bell_pitch;
kc.bell_duration = ks.bell_duration;
XChangeKeyboardControl(priv->display, mask, &kc);
}
}
/** Get the keyboard mapping. */
-void dmxCommonKbdGetMap(DevicePtr pDev, KeySymsPtr pKeySyms, CARD8 *pModMap)
+void
+dmxCommonKbdGetMap(DevicePtr pDev, KeySymsPtr pKeySyms, CARD8 *pModMap)
{
GETPRIVFROMPDEV;
- int min_keycode;
- int max_keycode;
- int map_width;
- KeySym *keyboard_mapping;
+ int min_keycode;
+ int max_keycode;
+ int map_width;
+ KeySym *keyboard_mapping;
XModifierKeymap *modifier_mapping;
- int i, j;
+ int i, j;
- /* Compute pKeySyms. Cast
- * XGetKeyboardMapping because of
- * compiler warning on 64-bit machines.
- * We assume pointers to 32-bit and
- * 64-bit ints are the same. */
+ /* Compute pKeySyms. Cast
+ * XGetKeyboardMapping because of
+ * compiler warning on 64-bit machines.
+ * We assume pointers to 32-bit and
+ * 64-bit ints are the same. */
XDisplayKeycodes(priv->display, &min_keycode, &max_keycode);
- keyboard_mapping = (KeySym *)XGetKeyboardMapping(priv->display,
- min_keycode,
- max_keycode
- - min_keycode + 1,
- &map_width);
+ keyboard_mapping = (KeySym *) XGetKeyboardMapping(priv->display,
+ min_keycode,
+ max_keycode
+ - min_keycode + 1,
+ &map_width);
pKeySyms->minKeyCode = min_keycode;
pKeySyms->maxKeyCode = max_keycode;
- pKeySyms->mapWidth = map_width;
- pKeySyms->map = keyboard_mapping;
+ pKeySyms->mapWidth = map_width;
+ pKeySyms->map = keyboard_mapping;
-
- /* Compute pModMap */
- modifier_mapping = XGetModifierMapping(priv->display);
+ /* Compute pModMap */
+ modifier_mapping = XGetModifierMapping(priv->display);
for (i = 0; i < MAP_LENGTH; i++)
pModMap[i] = 0;
for (j = 0; j < 8; j++) {
int max_keypermod = modifier_mapping->max_keypermod;
-
+
for (i = 0; i < max_keypermod; i++) {
- CARD8 keycode = modifier_mapping->modifiermap[j*max_keypermod + i];
+ CARD8 keycode =
+ modifier_mapping->modifiermap[j * max_keypermod + i];
if (keycode)
pModMap[keycode] |= 1 << j;
}
@@ -256,7 +259,8 @@ void dmxCommonKbdGetMap(DevicePtr pDev, KeySymsPtr pKeySyms, CARD8 *pModMap)
/** Fill in the XKEYBOARD parts of the \a info structure for the
* specified \a pDev. */
-void dmxCommonKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
+void
+dmxCommonKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
{
GETPRIVFROMPDEV;
GETDMXINPUTFROMPRIV;
@@ -267,11 +271,11 @@ void dmxCommonKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
#define NAME(x) \
priv->xkb->names->x ? XGetAtomName(priv->display,priv->xkb->names->x) : NULL
info->names.keycodes = NAME(keycodes);
- info->names.types = NAME(types);
- info->names.compat = NAME(compat);
- info->names.symbols = NAME(symbols);
+ info->names.types = NAME(types);
+ info->names.compat = NAME(compat);
+ info->names.symbols = NAME(symbols);
info->names.geometry = NAME(geometry);
- info->freenames = 1;
+ info->freenames = 1;
#undef NAME
dmxLogInput(dmxInput,
"XKEYBOARD: keycodes = %s\n", info->names.keycodes);
@@ -279,16 +283,19 @@ void dmxCommonKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
"XKEYBOARD: symbols = %s\n", info->names.symbols);
dmxLogInput(dmxInput,
"XKEYBOARD: geometry = %s\n", info->names.geometry);
- if ((pt = strchr(info->names.keycodes, '+'))) *pt = '\0';
+ if ((pt = strchr(info->names.keycodes, '+')))
+ *pt = '\0';
}
dmxCommonRestoreState(priv);
}
/** Turn \a pDev on (i.e., take input from \a pDev). */
-int dmxCommonKbdOn(DevicePtr pDev)
+int
+dmxCommonKbdOn(DevicePtr pDev)
{
GETPRIVFROMPDEV;
- if (priv->be) dmxCommonSaveState(priv);
+ if (priv->be)
+ dmxCommonSaveState(priv);
priv->eventMask |= DMX_KEYBOARD_EVENT_MASK;
XSelectInput(priv->display, priv->window, priv->eventMask);
if (priv->be)
@@ -298,7 +305,8 @@ int dmxCommonKbdOn(DevicePtr pDev)
}
/** Turn \a pDev off. */
-void dmxCommonKbdOff(DevicePtr pDev)
+void
+dmxCommonKbdOff(DevicePtr pDev)
{
GETPRIVFROMPDEV;
priv->eventMask &= ~DMX_KEYBOARD_EVENT_MASK;
@@ -307,13 +315,14 @@ void dmxCommonKbdOff(DevicePtr pDev)
}
/** Turn \a pDev on (i.e., take input from \a pDev). */
-int dmxCommonOthOn(DevicePtr pDev)
+int
+dmxCommonOthOn(DevicePtr pDev)
{
GETPRIVFROMPDEV;
GETDMXINPUTFROMPRIV;
XEventClass event_list[DMX_MAX_XINPUT_EVENT_TYPES];
- int event_type[DMX_MAX_XINPUT_EVENT_TYPES];
- int count = 0;
+ int event_type[DMX_MAX_XINPUT_EVENT_TYPES];
+ int count = 0;
#define ADD(type) \
if (count < DMX_MAX_XINPUT_EVENT_TYPES) { \
@@ -346,93 +355,97 @@ int dmxCommonOthOn(DevicePtr pDev)
ADD(DeviceMappingNotify);
ADD(ChangeDeviceNotify);
XSelectExtensionEvent(priv->display, priv->window, event_list, count);
-
+
return -1;
}
/** Turn \a pDev off. */
-void dmxCommonOthOff(DevicePtr pDev)
+void
+dmxCommonOthOff(DevicePtr pDev)
{
GETPRIVFROMPDEV;
-
- if (priv->xi) XCloseDevice(priv->display, priv->xi);
+
+ if (priv->xi)
+ XCloseDevice(priv->display, priv->xi);
priv->xi = NULL;
}
/** Fill the \a info structure with information needed to initialize \a
- * pDev. */
-void dmxCommonOthGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
+ * pDev. */
+void
+dmxCommonOthGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
{
GETPRIVFROMPDEV;
GETDMXINPUTFROMPRIV;
- XExtensionVersion *ext;
- XDeviceInfo *devices;
- Display *display = priv->display;
- int num;
- int i, j, k;
- XextErrorHandler handler;
+ XExtensionVersion *ext;
+ XDeviceInfo *devices;
+ Display *display = priv->display;
+ int num;
+ int i, j, k;
+ XextErrorHandler handler;
if (!display && !(display = XOpenDisplay(dmxInput->name)))
return;
-
+
/* Print out information about the XInput Extension. */
handler = XSetExtensionErrorHandler(dmxInputExtensionErrorHandler);
- ext = XGetExtensionVersion(display, INAME);
+ ext = XGetExtensionVersion(display, INAME);
XSetExtensionErrorHandler(handler);
- if (ext && ext != (XExtensionVersion *)NoSuchExtension) {
+ if (ext && ext != (XExtensionVersion *) NoSuchExtension) {
XFree(ext);
devices = XListInputDevices(display, &num);
for (i = 0; i < num; i++) {
- if (devices[i].id == (XID)dmxLocal->deviceId) {
- XAnyClassPtr any;
- XKeyInfoPtr ki;
- XButtonInfoPtr bi;
+ if (devices[i].id == (XID) dmxLocal->deviceId) {
+ XAnyClassPtr any;
+ XKeyInfoPtr ki;
+ XButtonInfoPtr bi;
XValuatorInfoPtr vi;
+
for (j = 0, any = devices[i].inputclassinfo;
j < devices[i].num_classes;
- any = (XAnyClassPtr)((char *)any + any->length), j++) {
+ any = (XAnyClassPtr) ((char *) any + any->length), j++) {
switch (any->class) {
case KeyClass:
- ki = (XKeyInfoPtr)any;
- info->keyboard = 1;
- info->keyClass = 1;
+ ki = (XKeyInfoPtr) any;
+ info->keyboard = 1;
+ info->keyClass = 1;
info->keySyms.minKeyCode = ki->min_keycode;
info->keySyms.maxKeyCode = ki->max_keycode;
- info->kbdFeedbackClass = 1;
+ info->kbdFeedbackClass = 1;
break;
case ButtonClass:
- bi = (XButtonInfoPtr)any;
- info->buttonClass = 1;
- info->numButtons = bi->num_buttons;
- info->ptrFeedbackClass = 1;
+ bi = (XButtonInfoPtr) any;
+ info->buttonClass = 1;
+ info->numButtons = bi->num_buttons;
+ info->ptrFeedbackClass = 1;
break;
case ValuatorClass:
- /* This assume all axes are either
- * Absolute or Relative. */
- vi = (XValuatorInfoPtr)any;
- info->valuatorClass = 1;
+ /* This assume all axes are either
+ * Absolute or Relative. */
+ vi = (XValuatorInfoPtr) any;
+ info->valuatorClass = 1;
if (vi->mode == Absolute)
- info->numAbsAxes = vi->num_axes;
+ info->numAbsAxes = vi->num_axes;
else
- info->numRelAxes = vi->num_axes;
+ info->numRelAxes = vi->num_axes;
for (k = 0; k < vi->num_axes; k++) {
- info->res[k] = vi->axes[k].resolution;
- info->minres[k] = vi->axes[k].resolution;
- info->maxres[k] = vi->axes[k].resolution;
- info->minval[k] = vi->axes[k].min_value;
- info->maxval[k] = vi->axes[k].max_value;
+ info->res[k] = vi->axes[k].resolution;
+ info->minres[k] = vi->axes[k].resolution;
+ info->maxres[k] = vi->axes[k].resolution;
+ info->minval[k] = vi->axes[k].min_value;
+ info->maxval[k] = vi->axes[k].max_value;
}
break;
case FeedbackClass:
- /* Only keyboard and pointer feedback
- * are handled at this time. */
+ /* Only keyboard and pointer feedback
+ * are handled at this time. */
break;
case ProximityClass:
- info->proximityClass = 1;
+ info->proximityClass = 1;
break;
case FocusClass:
- info->focusClass = 1;
+ info->focusClass = 1;
break;
case OtherClass:
break;
@@ -442,41 +455,48 @@ void dmxCommonOthGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
}
XFreeDeviceList(devices);
}
- if (display != priv->display) XCloseDisplay(display);
+ if (display != priv->display)
+ XCloseDisplay(display);
}
/** Obtain the mouse button mapping. */
-void dmxCommonMouGetMap(DevicePtr pDev, unsigned char *map, int *nButtons)
+void
+dmxCommonMouGetMap(DevicePtr pDev, unsigned char *map, int *nButtons)
{
GETPRIVFROMPDEV;
int i;
-
+
*nButtons = XGetPointerMapping(priv->display, map, DMX_MAX_BUTTONS);
- for (i = 0; i <= *nButtons; i++) map[i] = i;
+ for (i = 0; i <= *nButtons; i++)
+ map[i] = i;
}
-static void *dmxCommonXSelect(DMXScreenInfo *dmxScreen, void *closure)
+static void *
+dmxCommonXSelect(DMXScreenInfo * dmxScreen, void *closure)
{
myPrivate *priv = closure;
+
XSelectInput(dmxScreen->beDisplay, dmxScreen->scrnWin, priv->eventMask);
return NULL;
}
-static void *dmxCommonAddEnabledDevice(DMXScreenInfo *dmxScreen, void *closure)
+static void *
+dmxCommonAddEnabledDevice(DMXScreenInfo * dmxScreen, void *closure)
{
AddEnabledDevice(XConnectionNumber(dmxScreen->beDisplay));
return NULL;
}
-static void *dmxCommonRemoveEnabledDevice(DMXScreenInfo *dmxScreen,
- void *closure)
+static void *
+dmxCommonRemoveEnabledDevice(DMXScreenInfo * dmxScreen, void *closure)
{
RemoveEnabledDevice(XConnectionNumber(dmxScreen->beDisplay));
return NULL;
}
/** Turn \a pDev on (i.e., take input from \a pDev). */
-int dmxCommonMouOn(DevicePtr pDev)
+int
+dmxCommonMouOn(DevicePtr pDev)
{
GETPRIVFROMPDEV;
GETDMXINPUTFROMPRIV;
@@ -484,33 +504,34 @@ int dmxCommonMouOn(DevicePtr pDev)
priv->eventMask |= DMX_POINTER_EVENT_MASK;
if (dmxShadowFB) {
XWarpPointer(priv->display, priv->window, priv->window,
- 0, 0, 0, 0,
- priv->initPointerX,
- priv->initPointerY);
+ 0, 0, 0, 0, priv->initPointerX, priv->initPointerY);
dmxSync(&dmxScreens[dmxInput->scrnIdx], TRUE);
}
if (!priv->be) {
XSelectInput(priv->display, priv->window, priv->eventMask);
AddEnabledDevice(XConnectionNumber(priv->display));
- } else {
+ }
+ else {
dmxPropertyIterate(priv->be, dmxCommonXSelect, priv);
dmxPropertyIterate(priv->be, dmxCommonAddEnabledDevice, dmxInput);
}
-
+
return -1;
}
/** Turn \a pDev off. */
-void dmxCommonMouOff(DevicePtr pDev)
+void
+dmxCommonMouOff(DevicePtr pDev)
{
GETPRIVFROMPDEV;
GETDMXINPUTFROMPRIV;
-
+
priv->eventMask &= ~DMX_POINTER_EVENT_MASK;
if (!priv->be) {
RemoveEnabledDevice(XConnectionNumber(priv->display));
XSelectInput(priv->display, priv->window, priv->eventMask);
- } else {
+ }
+ else {
dmxPropertyIterate(priv->be, dmxCommonRemoveEnabledDevice, dmxInput);
dmxPropertyIterate(priv->be, dmxCommonXSelect, priv);
}
@@ -521,15 +542,17 @@ void dmxCommonMouOff(DevicePtr pDev)
* not on any screen, return -1. The number returned is an index into
* \a dmxScreenInfo and is between -1 and \a dmxNumScreens - 1,
* inclusive. */
-int dmxFindPointerScreen(int x, int y)
+int
+dmxFindPointerScreen(int x, int y)
{
int i;
for (i = 0; i < dmxNumScreens; i++) {
- ScreenPtr pScreen = screenInfo.screens[i];
- if (x >= pScreen->x && x < pScreen->x + pScreen->width &&
- y >= pScreen->y && y < pScreen->y + pScreen->height)
- return i;
+ ScreenPtr pScreen = screenInfo.screens[i];
+
+ if (x >= pScreen->x && x < pScreen->x + pScreen->width &&
+ y >= pScreen->y && y < pScreen->y + pScreen->height)
+ return i;
}
return -1;
}
@@ -540,15 +563,16 @@ int dmxFindPointerScreen(int x, int y)
* (e.g., when a keyboard and mouse form a pair that should share the
* same private area). If the requested private area cannot be located,
* then NULL is returned. */
-pointer dmxCommonCopyPrivate(DeviceIntPtr pDevice)
+pointer
+dmxCommonCopyPrivate(DeviceIntPtr pDevice)
{
GETDMXLOCALFROMPDEVICE;
DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx];
- int i;
+ int i;
for (i = 0; i < dmxInput->numDevs; i++)
if (dmxInput->devs[i] == dmxLocal && i)
- return dmxInput->devs[i-1]->private;
+ return dmxInput->devs[i - 1]->private;
return NULL;
}
@@ -563,15 +587,18 @@ pointer dmxCommonCopyPrivate(DeviceIntPtr pDevice)
* active or not active (for a full-screen window, this only happens at
* server startup and server shutdown).
*/
-void dmxCommonSaveState(pointer private)
+void
+dmxCommonSaveState(pointer private)
{
GETPRIVFROMPRIVATE;
- XKeyboardState ks;
- unsigned long i;
- XModifierKeymap *modmap;
+ XKeyboardState ks;
+ unsigned long i;
+ XModifierKeymap *modmap;
- if (dmxInput->console) priv = dmxInput->devs[0]->private;
- if (!priv->display || priv->stateSaved) return;
+ if (dmxInput->console)
+ priv = dmxInput->devs[0]->private;
+ if (!priv->display || priv->stateSaved)
+ return;
DMXDBG0("dmxCommonSaveState\n");
if (dmxUseXKB && (priv->xkb = XkbAllocKeyboard())) {
if (XkbGetIndicatorMap(priv->display, XkbAllIndicatorsMask, priv->xkb)
@@ -579,7 +606,8 @@ void dmxCommonSaveState(pointer private)
dmxLogInput(dmxInput, "Could not get XKB information\n");
XkbFreeKeyboard(priv->xkb, 0, True);
priv->xkb = NULL;
- } else {
+ }
+ else {
if (priv->xkb->indicators) {
priv->savedIndicators = *priv->xkb->indicators;
for (i = 0; i < XkbNumIndicators; i++)
@@ -593,21 +621,21 @@ void dmxCommonSaveState(pointer private)
}
XGetKeyboardControl(priv->display, &ks);
- priv->savedKctrl.click = ks.key_click_percent;
- priv->savedKctrl.bell = ks.bell_percent;
- priv->savedKctrl.bell_pitch = ks.bell_pitch;
- priv->savedKctrl.bell_duration = ks.bell_duration;
- priv->savedKctrl.leds = ks.led_mask;
- priv->savedKctrl.autoRepeat = ks.global_auto_repeat;
+ priv->savedKctrl.click = ks.key_click_percent;
+ priv->savedKctrl.bell = ks.bell_percent;
+ priv->savedKctrl.bell_pitch = ks.bell_pitch;
+ priv->savedKctrl.bell_duration = ks.bell_duration;
+ priv->savedKctrl.leds = ks.led_mask;
+ priv->savedKctrl.autoRepeat = ks.global_auto_repeat;
for (i = 0; i < 32; i++)
priv->savedKctrl.autoRepeats[i] = ks.auto_repeats[i];
-
+
dmxCommonKbdSetCtrl(priv->display, &priv->savedKctrl,
&priv->dmxLocal->kctrl);
- priv->savedModMap = XGetModifierMapping(priv->display);
+ priv->savedModMap = XGetModifierMapping(priv->display);
- modmap = XNewModifiermap(0);
+ modmap = XNewModifiermap(0);
XSetModifierMapping(priv->display, modmap);
if (dmxInput->scrnIdx != -1)
dmxSync(&dmxScreens[dmxInput->scrnIdx], TRUE);
@@ -617,7 +645,8 @@ void dmxCommonSaveState(pointer private)
}
/** This routine restores all the information saved by #dmxCommonSaveState. */
-void dmxCommonRestoreState(pointer private)
+void
+dmxCommonRestoreState(pointer private)
{
GETPRIVFROMPRIVATE;
int retcode = -1;
@@ -628,7 +657,7 @@ void dmxCommonRestoreState(pointer private)
if (!priv->stateSaved)
return;
priv->stateSaved = 0;
-
+
DMXDBG0("dmxCommonRestoreState\n");
if (priv->xkb) {
*priv->xkb->indicators = priv->savedIndicators;
@@ -639,7 +668,7 @@ void dmxCommonRestoreState(pointer private)
for (start = GetTimeInMillis(); GetTimeInMillis() - start < 5000;) {
CARD32 tmp;
-
+
retcode = XSetModifierMapping(priv->display, priv->savedModMap);
if (retcode == MappingSuccess)
break;
@@ -648,19 +677,19 @@ void dmxCommonRestoreState(pointer private)
else
dmxLogInput(dmxInput, "Keyboard error, waiting\n");
- /* Don't generate X11 protocol for a bit */
+ /* Don't generate X11 protocol for a bit */
for (tmp = GetTimeInMillis(); GetTimeInMillis() - tmp < 250;) {
- usleep(250); /* This ends up sleeping only until
- * the next key press generates an
- * interruption. We make the delay
- * relatively short in case the user
- * pressed they keys quickly. */
+ usleep(250); /* This ends up sleeping only until
+ * the next key press generates an
+ * interruption. We make the delay
+ * relatively short in case the user
+ * pressed they keys quickly. */
}
}
if (retcode != MappingSuccess)
dmxLog(dmxWarning, "Unable to restore keyboard modifier state!\n");
-
+
XFreeModifiermap(priv->savedModMap);
priv->savedModMap = NULL;
diff --git a/hw/dmx/input/dmxcommon.h b/hw/dmx/input/dmxcommon.h
index 68f2b520d..d4f8d3c89 100644
--- a/hw/dmx/input/dmxcommon.h
+++ b/hw/dmx/input/dmxcommon.h
@@ -98,27 +98,27 @@
#define DMX_POINTER_EVENT_MASK \
(ButtonPressMask | ButtonReleaseMask | PointerMotionMask)
-extern void dmxCommonKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
-extern void dmxCommonKbdGetMap(DevicePtr pDev,
- KeySymsPtr pKeySyms, CARD8 *pModMap);
-extern void dmxCommonKbdCtrl(DevicePtr pDev, KeybdCtrl *ctrl);
-extern void dmxCommonKbdBell(DevicePtr pDev, int percent,
- int volume, int pitch, int duration);
-extern int dmxCommonKbdOn(DevicePtr pDev);
-extern void dmxCommonKbdOff(DevicePtr pDev);
-extern void dmxCommonMouGetMap(DevicePtr pDev,
- unsigned char *map, int *nButtons);
-extern void dmxCommonMouCtrl(DevicePtr pDev, PtrCtrl *ctrl);
-extern int dmxCommonMouOn(DevicePtr pDev);
-extern void dmxCommonMouOff(DevicePtr pDev);
-extern int dmxFindPointerScreen(int x, int y);
-
-extern int dmxCommonOthOn(DevicePtr pDev);
-extern void dmxCommonOthOff(DevicePtr pDev);
-extern void dmxCommonOthGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
+extern void dmxCommonKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
+extern void dmxCommonKbdGetMap(DevicePtr pDev,
+ KeySymsPtr pKeySyms, CARD8 *pModMap);
+extern void dmxCommonKbdCtrl(DevicePtr pDev, KeybdCtrl * ctrl);
+extern void dmxCommonKbdBell(DevicePtr pDev, int percent,
+ int volume, int pitch, int duration);
+extern int dmxCommonKbdOn(DevicePtr pDev);
+extern void dmxCommonKbdOff(DevicePtr pDev);
+extern void dmxCommonMouGetMap(DevicePtr pDev,
+ unsigned char *map, int *nButtons);
+extern void dmxCommonMouCtrl(DevicePtr pDev, PtrCtrl * ctrl);
+extern int dmxCommonMouOn(DevicePtr pDev);
+extern void dmxCommonMouOff(DevicePtr pDev);
+extern int dmxFindPointerScreen(int x, int y);
+
+extern int dmxCommonOthOn(DevicePtr pDev);
+extern void dmxCommonOthOff(DevicePtr pDev);
+extern void dmxCommonOthGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
/* helper functions */
extern pointer dmxCommonCopyPrivate(DeviceIntPtr pDevice);
-extern void dmxCommonSaveState(pointer private);
-extern void dmxCommonRestoreState(pointer private);
+extern void dmxCommonSaveState(pointer private);
+extern void dmxCommonRestoreState(pointer private);
#endif
diff --git a/hw/dmx/input/dmxconsole.c b/hw/dmx/input/dmxconsole.c
index 7ec209df0..f63772b17 100644
--- a/hw/dmx/input/dmxconsole.c
+++ b/hw/dmx/input/dmxconsole.c
@@ -93,130 +93,136 @@
/* Private area for consoles. */
typedef struct _myPrivate {
DMX_COMMON_PRIVATE;
- int lastX;
- int lastY;
- int globalX;
- int globalY;
- int curX;
- int curY;
- int width;
- int height;
- int consWidth;
- int consHeight;
- double xScale;
- double yScale;
- XlibGC gc, gcDet, gcRev, gcCur;
- int grabbed, fine, captured;
- Cursor cursorNormal, cursorGrabbed, cursorEmpty;
- Pixmap pixmap;
-
- CloseScreenProcPtr CloseScreen;
- struct _myPrivate *next; /* for closing multiple consoles */
- int initialized;
- DevicePtr mou, kbd;
+ int lastX;
+ int lastY;
+ int globalX;
+ int globalY;
+ int curX;
+ int curY;
+ int width;
+ int height;
+ int consWidth;
+ int consHeight;
+ double xScale;
+ double yScale;
+ XlibGC gc, gcDet, gcRev, gcCur;
+ int grabbed, fine, captured;
+ Cursor cursorNormal, cursorGrabbed, cursorEmpty;
+ Pixmap pixmap;
+
+ CloseScreenProcPtr CloseScreen;
+ struct _myPrivate *next; /* for closing multiple consoles */
+ int initialized;
+ DevicePtr mou, kbd;
} myPrivate;
-static int scalex(myPrivate *priv, int x)
+static int
+scalex(myPrivate * priv, int x)
{
- return (int)((x * priv->xScale) + .5);
+ return (int) ((x * priv->xScale) + .5);
}
-static int scaley(myPrivate *priv, int y)
+static int
+scaley(myPrivate * priv, int y)
{
- return (int)((y * priv->yScale) + .5);
+ return (int) ((y * priv->yScale) + .5);
}
-static int unscalex(myPrivate *priv, int x)
+static int
+unscalex(myPrivate * priv, int x)
{
- return (int)((x / priv->xScale) + .5);
+ return (int) ((x / priv->xScale) + .5);
}
-static int unscaley(myPrivate *priv, int y)
+static int
+unscaley(myPrivate * priv, int y)
{
- return (int)((y / priv->yScale) + .5);
+ return (int) ((y / priv->yScale) + .5);
}
/** Create the private area for \a pDevice. */
-pointer dmxConsoleCreatePrivate(DeviceIntPtr pDevice)
+pointer
+dmxConsoleCreatePrivate(DeviceIntPtr pDevice)
{
GETDMXLOCALFROMPDEVICE;
myPrivate *priv = calloc(1, sizeof(*priv));
- priv->dmxLocal = dmxLocal;
+
+ priv->dmxLocal = dmxLocal;
return priv;
}
/** If \a private is non-NULL, free its associated memory. */
-void dmxConsoleDestroyPrivate(pointer private)
+void
+dmxConsoleDestroyPrivate(pointer private)
{
free(private);
}
-static void dmxConsoleDrawFineCursor(myPrivate *priv, XRectangle *rect)
+static void
+dmxConsoleDrawFineCursor(myPrivate * priv, XRectangle * rect)
{
- int size = 6;
+ int size = 6;
int x, y;
-
+
XDrawLine(priv->display, priv->pixmap, priv->gcCur,
x = scalex(priv, priv->globalX) - size,
scaley(priv, priv->globalY),
- scalex(priv, priv->globalX) + size,
- scaley(priv, priv->globalY));
+ scalex(priv, priv->globalX) + size, scaley(priv, priv->globalY));
XDrawLine(priv->display, priv->pixmap, priv->gcCur,
scalex(priv, priv->globalX),
y = scaley(priv, priv->globalY) - size,
- scalex(priv, priv->globalX),
- scaley(priv, priv->globalY) + size);
+ scalex(priv, priv->globalX), scaley(priv, priv->globalY) + size);
if (priv->grabbed) {
XDrawLine(priv->display, priv->pixmap, priv->gcCur,
- scalex(priv, priv->globalX) - (int)(size / 1.4),
- scaley(priv, priv->globalY) - (int)(size / 1.4),
- scalex(priv, priv->globalX) + (int)(size / 1.4),
- scaley(priv, priv->globalY) + (int)(size / 1.4));
+ scalex(priv, priv->globalX) - (int) (size / 1.4),
+ scaley(priv, priv->globalY) - (int) (size / 1.4),
+ scalex(priv, priv->globalX) + (int) (size / 1.4),
+ scaley(priv, priv->globalY) + (int) (size / 1.4));
XDrawLine(priv->display, priv->pixmap, priv->gcCur,
- scalex(priv, priv->globalX) - (int)(size / 1.4),
- scaley(priv, priv->globalY) + (int)(size / 1.4),
- scalex(priv, priv->globalX) + (int)(size / 1.4),
- scaley(priv, priv->globalY) - (int)(size / 1.4));
+ scalex(priv, priv->globalX) - (int) (size / 1.4),
+ scaley(priv, priv->globalY) + (int) (size / 1.4),
+ scalex(priv, priv->globalX) + (int) (size / 1.4),
+ scaley(priv, priv->globalY) - (int) (size / 1.4));
}
if (rect) {
- rect->x = x;
- rect->y = y;
- rect->width = 2 * size;
+ rect->x = x;
+ rect->y = y;
+ rect->width = 2 * size;
rect->height = 2 * size;
}
}
-static void dmxConsoleDrawWindows(pointer private)
+static void
+dmxConsoleDrawWindows(pointer private)
{
GETONLYPRIVFROMPRIVATE;
- Display *dpy = priv->display;
- int i;
- Region whole, used, avail;
+ Display *dpy = priv->display;
+ int i;
+ Region whole, used, avail;
XRectangle rect;
- whole = XCreateRegion();
- used = XCreateRegion();
- avail = XCreateRegion();
- rect.x = 0;
- rect.y = 0;
- rect.width = priv->consWidth;
+ whole = XCreateRegion();
+ used = XCreateRegion();
+ avail = XCreateRegion();
+ rect.x = 0;
+ rect.y = 0;
+ rect.width = priv->consWidth;
rect.height = priv->consHeight;
XUnionRectWithRegion(&rect, whole, whole);
-
+
for (i = 0; i < dmxNumScreens; i++) {
- ScreenPtr pScreen = screenInfo.screens[i];
- WindowPtr pRoot = pScreen->root;
- WindowPtr pChild;
+ ScreenPtr pScreen = screenInfo.screens[i];
+ WindowPtr pRoot = pScreen->root;
+ WindowPtr pChild;
#if DMX_WINDOW_DEBUG
dmxLog(dmxDebug, "%lu %p %p %p 2\n",
pRoot->drawable.id,
pRoot->parent, pRoot->firstChild, pRoot->lastChild);
#endif
-
+
for (pChild = pRoot->firstChild; pChild; pChild = pChild->nextSib) {
- if (pChild->mapped
- && pChild->realized) {
+ if (pChild->mapped && pChild->realized) {
#if DMX_WINDOW_DEBUG
dmxLog(dmxDebug, " %p %d,%d %dx%d %d %d %d RECTS\n",
pChild,
@@ -228,9 +234,9 @@ static void dmxConsoleDrawWindows(pointer private)
pChild->overrideRedirect,
RegionNumRects(&pChild->clipList));
#endif
- rect.x = scalex(priv, pChild->drawable.x + pScreen->x);
- rect.y = scaley(priv, pChild->drawable.y + pScreen->y);
- rect.width = scalex(priv, pChild->drawable.width);
+ rect.x = scalex(priv, pChild->drawable.x + pScreen->x);
+ rect.y = scaley(priv, pChild->drawable.y + pScreen->y);
+ rect.width = scalex(priv, pChild->drawable.width);
rect.height = scaley(priv, pChild->drawable.height);
XDrawRectangle(dpy, priv->pixmap, priv->gc,
rect.x, rect.y, rect.width, rect.height);
@@ -240,7 +246,8 @@ static void dmxConsoleDrawWindows(pointer private)
}
}
#ifdef PANORAMIX
- if (!noPanoramiXExtension) break; /* Screen 0 valid with Xinerama */
+ if (!noPanoramiXExtension)
+ break; /* Screen 0 valid with Xinerama */
#endif
}
XDestroyRegion(avail);
@@ -249,18 +256,20 @@ static void dmxConsoleDrawWindows(pointer private)
XSetClipMask(dpy, priv->gc, None);
}
-static void dmxConsoleDraw(myPrivate *priv, int updateCursor, int update)
+static void
+dmxConsoleDraw(myPrivate * priv, int updateCursor, int update)
{
GETDMXINPUTFROMPRIV;
- Display *dpy = priv->display;
- int i;
+ Display *dpy = priv->display;
+ int i;
XFillRectangle(dpy, priv->pixmap, priv->gc, 0, 0,
priv->consWidth, priv->consHeight);
for (i = 0; i < dmxNumScreens; i++) {
DMXScreenInfo *dmxScreen = &dmxScreens[i];
- XFillRectangle(dpy, priv->pixmap,
+
+ XFillRectangle(dpy, priv->pixmap,
dmxScreen->beDisplay ? priv->gcRev : priv->gcDet,
scalex(priv, screenInfo.screens[i]->x),
scaley(priv, screenInfo.screens[i]->y),
@@ -274,23 +283,25 @@ static void dmxConsoleDraw(myPrivate *priv, int updateCursor, int update)
scalex(priv, screenInfo.screens[i]->width),
scaley(priv, screenInfo.screens[i]->height));
}
- if (dmxInput->windows) dmxConsoleDrawWindows(priv);
- if (priv->fine && updateCursor) dmxConsoleDrawFineCursor(priv, 0);
+ if (dmxInput->windows)
+ dmxConsoleDrawWindows(priv);
+ if (priv->fine && updateCursor)
+ dmxConsoleDrawFineCursor(priv, 0);
if (update) {
XCopyArea(priv->display, priv->pixmap, priv->window, priv->gc,
0, 0, priv->consWidth, priv->consHeight, 0, 0);
- XSync(priv->display, False); /* Not a backend display */
+ XSync(priv->display, False); /* Not a backend display */
}
}
-static void dmxConsoleClearCursor(myPrivate *priv, int x, int y,
- XRectangle *rect)
+static void
+dmxConsoleClearCursor(myPrivate * priv, int x, int y, XRectangle * rect)
{
- int cw = 14, ch = 14; /* Clear width and height */
-
- rect->x = scalex(priv, x) - cw/2;
- rect->y = scaley(priv, y) - ch/2;
- rect->width = cw;
+ int cw = 14, ch = 14; /* Clear width and height */
+
+ rect->x = scalex(priv, x) - cw / 2;
+ rect->y = scaley(priv, y) - ch / 2;
+ rect->width = cw;
rect->height = ch;
XSetClipRectangles(priv->display, priv->gc, 0, 0, rect, 1, Unsorted);
XSetClipRectangles(priv->display, priv->gcDet, 0, 0, rect, 1, Unsorted);
@@ -301,39 +312,44 @@ static void dmxConsoleClearCursor(myPrivate *priv, int x, int y,
XSetClipMask(priv->display, priv->gcRev, None);
}
-
-static void dmxConsoleUpdateFineCursor(myPrivate *priv)
+static void
+dmxConsoleUpdateFineCursor(myPrivate * priv)
{
- int leave = 0;
+ int leave = 0;
XRectangle rects[2];
dmxConsoleClearCursor(priv, priv->globalX, priv->globalY, &rects[0]);
if (priv->dmxLocal->sendsCore) {
dmxGetGlobalPosition(&priv->globalX, &priv->globalY);
- } else {
+ }
+ else {
priv->globalX = priv->dmxLocal->lastX;
priv->globalY = priv->dmxLocal->lastY;
}
-
- priv->lastX = scalex(priv, priv->width / 2);
- priv->lastY = scaley(priv, priv->height / 2);
- /* Compute new warp position, which may be
- outside the window */
+ priv->lastX = scalex(priv, priv->width / 2);
+ priv->lastY = scaley(priv, priv->height / 2);
+
+ /* Compute new warp position, which may be
+ outside the window */
if (priv->globalX < 1 || priv->globalX >= priv->width) {
- if (priv->globalX < 1) priv->lastX = 0;
- else priv->lastX = scalex(priv, priv->width);
+ if (priv->globalX < 1)
+ priv->lastX = 0;
+ else
+ priv->lastX = scalex(priv, priv->width);
priv->lastY = scaley(priv, priv->globalY);
++leave;
}
if (priv->globalY < 1 || priv->globalY >= priv->height) {
- if (priv->globalY < 1) priv->lastY = 0;
- else priv->lastY = scaley(priv, priv->height);
+ if (priv->globalY < 1)
+ priv->lastY = 0;
+ else
+ priv->lastY = scaley(priv, priv->height);
priv->lastX = scalex(priv, priv->globalX);
++leave;
}
- /* Draw pseudo cursor in window */
+ /* Draw pseudo cursor in window */
dmxConsoleDrawFineCursor(priv, &rects[1]);
XSetClipRectangles(priv->display, priv->gc, 0, 0, rects, 2, Unsorted);
@@ -345,18 +361,19 @@ static void dmxConsoleUpdateFineCursor(myPrivate *priv)
priv->lastX, priv->lastY);
XWarpPointer(priv->display, priv->window, priv->window,
0, 0, 0, 0, priv->lastX, priv->lastY);
- XSync(priv->display, False); /* Not a backend display */
+ XSync(priv->display, False); /* Not a backend display */
if (leave) {
XEvent X;
+
while (XCheckMaskEvent(priv->display, PointerMotionMask, &X)) {
if (X.type == MotionNotify) {
if (X.xmotion.x != priv->lastX || X.xmotion.y != priv->lastY) {
DMXDBG4("Ignoring motion to %d %d after leave frm %d %d\n",
- X.xmotion.x, X.xmotion.y,
- priv->lastX, priv->lastY);
+ X.xmotion.x, X.xmotion.y, priv->lastX, priv->lastY);
}
- } else {
+ }
+ else {
dmxLog(dmxInfo, "Ignoring event (%d): %s ****************\n",
X.type, dmxEventName(X.type));
}
@@ -365,8 +382,7 @@ static void dmxConsoleUpdateFineCursor(myPrivate *priv)
DMXDBG6("dmxConsoleUpdateFineCursor: Warp %d %d on %d %d [%d %d]\n",
priv->lastX, priv->lastY,
scalex(priv, priv->width),
- scaley(priv, priv->height),
- priv->globalX, priv->globalY);
+ scaley(priv, priv->height), priv->globalX, priv->globalY);
}
/** Whenever the window layout (size, position, stacking order) might be
@@ -374,16 +390,17 @@ static void dmxConsoleUpdateFineCursor(myPrivate *priv)
* the \a type of change. This routine is called in a conservative
* fashion: the actual layout of the windows of the screen might not
* have had any human-visible changes. */
-void dmxConsoleUpdateInfo(pointer private, DMXUpdateType type,
- WindowPtr pWindow)
+void
+dmxConsoleUpdateInfo(pointer private, DMXUpdateType type, WindowPtr pWindow)
{
GETONLYPRIVFROMPRIVATE;
dmxConsoleDraw(priv, 1, 1);
}
-static void dmxConsoleMoveAbsolute(myPrivate *priv, int x, int y,
- DevicePtr pDev, dmxMotionProcPtr motion,
- DMXBlockType block)
+static void
+dmxConsoleMoveAbsolute(myPrivate * priv, int x, int y,
+ DevicePtr pDev, dmxMotionProcPtr motion,
+ DMXBlockType block)
{
int tmpX, tmpY, v[2];
@@ -391,20 +408,24 @@ static void dmxConsoleMoveAbsolute(myPrivate *priv, int x, int y,
tmpY = unscalex(priv, y);
DMXDBG6("dmxConsoleMoveAbsolute(,%d,%d) %d %d =? %d %d\n",
x, y, tmpX, tmpY, priv->curX, priv->curY);
- if (tmpX == priv->curX && tmpY == priv->curY) return;
+ if (tmpX == priv->curX && tmpY == priv->curY)
+ return;
v[0] = unscalex(priv, x);
v[1] = unscaley(priv, y);
motion(pDev, v, 0, 2, DMX_ABSOLUTE_CONFINED, block);
/* dmxConsoleUpdatePosition gets called here by dmxCoreMotion */
}
-static void dmxConsoleMoveRelative(myPrivate *priv, int x, int y,
- DevicePtr pDev, dmxMotionProcPtr motion,
- DMXBlockType block)
+static void
+dmxConsoleMoveRelative(myPrivate * priv, int x, int y,
+ DevicePtr pDev, dmxMotionProcPtr motion,
+ DMXBlockType block)
{
int v[2];
+
/* Ignore the event generated from * warping back to middle */
- if (x == priv->lastX && y == priv->lastY) return;
+ if (x == priv->lastX && y == priv->lastY)
+ return;
v[0] = priv->lastX - x;
v[1] = priv->lastY - y;
motion(pDev, v, 0, 2, DMX_RELATIVE, block);
@@ -414,35 +435,40 @@ static void dmxConsoleMoveRelative(myPrivate *priv, int x, int y,
/** This routine gets called from #dmxCoreMotion for each motion. This
* allows the console's notion of the cursor postion to change when
* another input device actually caused the change. */
-void dmxConsoleUpdatePosition(pointer private, int x, int y)
+void
+dmxConsoleUpdatePosition(pointer private, int x, int y)
{
GETONLYPRIVFROMPRIVATE;
- int tmpX, tmpY;
- Display *dpy = priv->display;
+ int tmpX, tmpY;
+ Display *dpy = priv->display;
static unsigned long dmxGeneration = 0;
-
tmpX = scalex(priv, x);
tmpY = scaley(priv, y);
DMXDBG6("dmxConsoleUpdatePosition(,%d,%d) new=%d,%d dims=%d,%d\n",
x, y, tmpX, tmpY, priv->consWidth, priv->consHeight);
-
- if (priv->fine) dmxConsoleUpdateFineCursor(priv);
+
+ if (priv->fine)
+ dmxConsoleUpdateFineCursor(priv);
if (tmpX != priv->curX || tmpY != priv->curY) {
- if (tmpX < 0) tmpX = 0;
- if (tmpY < 0) tmpY = 0;
- if (tmpX >= priv->consWidth) tmpX = priv->consWidth - 1;
- if (tmpY >= priv->consHeight) tmpY = priv->consHeight - 1;
+ if (tmpX < 0)
+ tmpX = 0;
+ if (tmpY < 0)
+ tmpY = 0;
+ if (tmpX >= priv->consWidth)
+ tmpX = priv->consWidth - 1;
+ if (tmpY >= priv->consHeight)
+ tmpY = priv->consHeight - 1;
priv->curX = tmpX;
priv->curY = tmpY;
if (!priv->fine) {
DMXDBG2(" WARP B %d %d\n", priv->curX, priv->curY);
XWarpPointer(dpy, priv->window,
priv->window, 0, 0, 0, 0, tmpX, tmpY);
- XSync(dpy, False); /* Not a backend display */
+ XSync(dpy, False); /* Not a backend display */
}
}
-
+
if (dmxGeneration != serverGeneration) {
dmxGeneration = serverGeneration;
dmxConsoleDraw(priv, 1, 1);
@@ -454,42 +480,43 @@ void dmxConsoleUpdatePosition(pointer private, int x, int y)
* routines. The \a checkspecial routine is used to check for special
* keys that need handling. \a block tells if signals should be blocked
* when updating the event queue. */
-void dmxConsoleCollectEvents(DevicePtr pDev,
- dmxMotionProcPtr motion,
- dmxEnqueueProcPtr enqueue,
- dmxCheckSpecialProcPtr checkspecial,
- DMXBlockType block)
+void
+dmxConsoleCollectEvents(DevicePtr pDev,
+ dmxMotionProcPtr motion,
+ dmxEnqueueProcPtr enqueue,
+ dmxCheckSpecialProcPtr checkspecial, DMXBlockType block)
{
GETPRIVFROMPDEV;
GETDMXINPUTFROMPRIV;
- Display *dpy = priv->display;
- Window win = priv->window;
- int width = priv->width;
- int height = priv->height;
- XEvent X, N;
+ Display *dpy = priv->display;
+ Window win = priv->window;
+ int width = priv->width;
+ int height = priv->height;
+ XEvent X, N;
XSetWindowAttributes attribs;
- static int rInitialized = 0;
- static Region r;
- XRectangle rect;
- static int raising = 0, raiseX, raiseY; /* FIXME */
+ static int rInitialized = 0;
+ static Region r;
+ XRectangle rect;
+ static int raising = 0, raiseX, raiseY; /* FIXME */
while (XPending(dpy)) {
XNextEvent(dpy, &X);
- switch(X.type) {
+ switch (X.type) {
case VisibilityNotify:
break;
- case Expose:
+ case Expose:
DMXDBG5("dmxConsoleCollectEvents: Expose #%d %d %d %d %d\n",
X.xexpose.count,
X.xexpose.x, X.xexpose.y,
X.xexpose.width, X.xexpose.height);
- if (!rInitialized++) r = XCreateRegion();
- rect.x = X.xexpose.x;
- rect.y = X.xexpose.y;
- rect.width = X.xexpose.width;
+ if (!rInitialized++)
+ r = XCreateRegion();
+ rect.x = X.xexpose.x;
+ rect.y = X.xexpose.y;
+ rect.width = X.xexpose.width;
rect.height = X.xexpose.height;
XUnionRectWithRegion(&rect, r, r);
- if (X.xexpose.count == 0) {
+ if (X.xexpose.count == 0) {
XSetRegion(dpy, priv->gc, r);
XSetRegion(dpy, priv->gcDet, r);
XSetRegion(dpy, priv->gcRev, r);
@@ -500,31 +527,32 @@ void dmxConsoleCollectEvents(DevicePtr pDev,
XDestroyRegion(r);
rInitialized = 0;
}
- break;
- case ResizeRequest:
+ break;
+ case ResizeRequest:
DMXDBG2("dmxConsoleCollectEvents: Resize %d %d\n",
X.xresizerequest.width, X.xresizerequest.height);
- priv->consWidth = X.xresizerequest.width;
- priv->consHeight = X.xresizerequest.height;
- priv->xScale = (double)priv->consWidth / width;
- priv->yScale = (double)priv->consHeight / height;
- attribs.override_redirect = True;
- XChangeWindowAttributes(dpy, win, CWOverrideRedirect, &attribs);
- XResizeWindow(dpy, win, priv->consWidth, priv->consHeight);
+ priv->consWidth = X.xresizerequest.width;
+ priv->consHeight = X.xresizerequest.height;
+ priv->xScale = (double) priv->consWidth / width;
+ priv->yScale = (double) priv->consHeight / height;
+ attribs.override_redirect = True;
+ XChangeWindowAttributes(dpy, win, CWOverrideRedirect, &attribs);
+ XResizeWindow(dpy, win, priv->consWidth, priv->consHeight);
XFreePixmap(dpy, priv->pixmap);
priv->pixmap = XCreatePixmap(dpy,
RootWindow(dpy, DefaultScreen(dpy)),
priv->consWidth,
priv->consHeight,
- DefaultDepth(dpy,DefaultScreen(dpy)));
- dmxConsoleDraw(priv, 1, 1);
- attribs.override_redirect = False;
- XChangeWindowAttributes(dpy, win, CWOverrideRedirect, &attribs);
- break;
+ DefaultDepth(dpy, DefaultScreen(dpy)));
+ dmxConsoleDraw(priv, 1, 1);
+ attribs.override_redirect = False;
+ XChangeWindowAttributes(dpy, win, CWOverrideRedirect, &attribs);
+ break;
case LeaveNotify:
DMXDBG4("dmxConsoleCollectEvents: Leave @ %d,%d; r=%d f=%d\n",
X.xcrossing.x, X.xcrossing.y, raising, priv->fine);
- if (!priv->captured) dmxCommonRestoreState(priv);
+ if (!priv->captured)
+ dmxCommonRestoreState(priv);
else {
dmxConsoleUncapture(dmxInput);
dmxCommonRestoreState(priv);
@@ -539,7 +567,8 @@ void dmxConsoleCollectEvents(DevicePtr pDev,
raising = 0;
dmxConsoleMoveAbsolute(priv, raiseX, raiseY,
priv->mou, motion, block);
- } else {
+ }
+ else {
if (priv->fine) {
/* The raise will generate an event near the center,
* which is not where the cursor should be. So we
@@ -551,18 +580,19 @@ void dmxConsoleCollectEvents(DevicePtr pDev,
raiseY = X.xcrossing.y;
XRaiseWindow(dpy, priv->window);
}
- XSync(dpy, False); /* Not a backend display */
+ XSync(dpy, False); /* Not a backend display */
if (!X.xcrossing.x && !X.xcrossing.y)
dmxConsoleMoveAbsolute(priv, priv->curX, priv->curY,
priv->mou, motion, block);
}
break;
- case MotionNotify:
+ case MotionNotify:
if (priv->curX == X.xmotion.x && priv->curY == X.xmotion.y)
continue;
- if (XPending(dpy)) { /* do motion compression */
+ if (XPending(dpy)) { /* do motion compression */
XPeekEvent(dpy, &N);
- if (N.type == MotionNotify) continue;
+ if (N.type == MotionNotify)
+ continue;
}
DMXDBG2("dmxConsoleCollectEvents: Motion %d %d\n",
X.xmotion.x, X.xmotion.y);
@@ -570,7 +600,8 @@ void dmxConsoleCollectEvents(DevicePtr pDev,
raising = 0;
dmxConsoleMoveAbsolute(priv, raiseX, raiseY,
priv->mou, motion, block);
- } else {
+ }
+ else {
if (priv->fine)
dmxConsoleMoveRelative(priv, X.xmotion.x, X.xmotion.y,
priv->mou, motion, block);
@@ -578,21 +609,22 @@ void dmxConsoleCollectEvents(DevicePtr pDev,
dmxConsoleMoveAbsolute(priv, X.xmotion.x, X.xmotion.y,
priv->mou, motion, block);
}
- break;
+ break;
case KeyPress:
case KeyRelease:
enqueue(priv->kbd, X.type, X.xkey.keycode, 0, NULL, block);
break;
default:
- /* Pass the whole event here, because
- * this may be an extension event. */
+ /* Pass the whole event here, because
+ * this may be an extension event. */
enqueue(priv->mou, X.type, X.xbutton.button, 0, &X, block);
- break;
- }
+ break;
+ }
}
}
-static void dmxCloseConsole(myPrivate *priv)
+static void
+dmxCloseConsole(myPrivate * priv)
{
GETDMXINPUTFROMPRIV;
dmxCommonRestoreState(priv);
@@ -601,102 +633,110 @@ static void dmxCloseConsole(myPrivate *priv)
XFreeGC(priv->display, priv->gcDet);
XFreeGC(priv->display, priv->gcRev);
XFreeGC(priv->display, priv->gcCur);
- if (!dmxInput->console) XCloseDisplay(priv->display);
+ if (!dmxInput->console)
+ XCloseDisplay(priv->display);
}
priv->display = NULL;
}
-static Bool dmxCloseConsoleScreen(int idx, ScreenPtr pScreen)
+static Bool
+dmxCloseConsoleScreen(int idx, ScreenPtr pScreen)
{
myPrivate *priv, *last;
- for (last = priv = (myPrivate *)dixLookupPrivate(&pScreen->devPrivates,
- dmxScreenPrivateKey);
- priv;
- priv = priv->next) dmxCloseConsole(last = priv);
-
+ for (last = priv = (myPrivate *) dixLookupPrivate(&pScreen->devPrivates,
+ dmxScreenPrivateKey);
+ priv; priv = priv->next)
+ dmxCloseConsole(last = priv);
+
DMX_UNWRAP(CloseScreen, last, pScreen);
return pScreen->CloseScreen(idx, pScreen);
}
-static Cursor dmxConsoleCreateEmptyCursor(myPrivate *priv)
+static Cursor
+dmxConsoleCreateEmptyCursor(myPrivate * priv)
{
- char noCursorData[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
- Pixmap pixmap;
- Cursor cursor;
- XColor color, tmpColor;
+ char noCursorData[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+ Pixmap pixmap;
+ Cursor cursor;
+ XColor color, tmpColor;
Display *dpy = priv->display;
- /* Create empty cursor for window */
+ /* Create empty cursor for window */
pixmap = XCreateBitmapFromData(priv->display, priv->window,
noCursorData, 8, 8);
if (!XAllocNamedColor(dpy, DefaultColormap(dpy, DefaultScreen(dpy)),
- "black",
- &color,
- &tmpColor))
+ "black", &color, &tmpColor))
dmxLog(dmxFatal, "Cannot allocate color for cursor\n");
cursor = XCreatePixmapCursor(dpy, pixmap, pixmap, &color, &color, 0, 0);
XFreePixmap(dpy, pixmap);
return cursor;
}
-static void dmxConsoleComputeWidthHeight(myPrivate *priv,
- int *width, int *height,
- double *xScale, double *yScale,
- int *consWidth, int *consHeight)
+static void
+dmxConsoleComputeWidthHeight(myPrivate * priv,
+ int *width, int *height,
+ double *xScale, double *yScale,
+ int *consWidth, int *consHeight)
{
- int screen;
+ int screen;
Display *dpy = priv->display;
- *width = 0;
- *height = 0;
- *xScale = 1.0;
- *yScale = 1.0;
+ *width = 0;
+ *height = 0;
+ *xScale = 1.0;
+ *yScale = 1.0;
- screen = DefaultScreen(dpy);
- *consWidth = DisplayWidth(dpy, screen) * CONSOLE_NUM / CONSOLE_DEN;
+ screen = DefaultScreen(dpy);
+ *consWidth = DisplayWidth(dpy, screen) * CONSOLE_NUM / CONSOLE_DEN;
*consHeight = DisplayHeight(dpy, screen) * CONSOLE_NUM / CONSOLE_DEN;
- if (*consWidth < 1) *consWidth = 1;
- if (*consHeight < 1) *consHeight = 1;
+ if (*consWidth < 1)
+ *consWidth = 1;
+ if (*consHeight < 1)
+ *consHeight = 1;
#if 1
- /* Always keep the console size similar
- * to the global bounding box. */
- *width = dmxGlobalWidth;
+ /* Always keep the console size similar
+ * to the global bounding box. */
+ *width = dmxGlobalWidth;
*height = dmxGlobalHeight;
#else
- /* Make the console window as big as
- * possible by computing the visible
- * bounding box. */
+ /* Make the console window as big as
+ * possible by computing the visible
+ * bounding box. */
for (i = 0; i < dmxNumScreens; i++) {
- if (screenInfo.screens[i]->x+screenInfo.screens[i]->width > *width)
- *width = screenInfo.screens[i]->x+screenInfo.screens[i]->width;
-
- if (screenInfo.screens[i]->y+screenInfo.screens[i]->height > *height)
- *height = screenInfo.screens[i]->y+screenInfo.screens[i]->height;
+ if (screenInfo.screens[i]->x + screenInfo.screens[i]->width > *width)
+ *width = screenInfo.screens[i]->x + screenInfo.screens[i]->width;
+
+ if (screenInfo.screens[i]->y + screenInfo.screens[i]->height > *height)
+ *height = screenInfo.screens[i]->y + screenInfo.screens[i]->height;
}
#endif
- if ((double)*consWidth / *width < (double)*consHeight / *height)
- *xScale = *yScale = (double)*consWidth / *width;
+ if ((double) *consWidth / *width < (double) *consHeight / *height)
+ *xScale = *yScale = (double) *consWidth / *width;
else
- *xScale = *yScale = (double)*consHeight / *height;
+ *xScale = *yScale = (double) *consHeight / *height;
- *consWidth = scalex(priv, *width);
+ *consWidth = scalex(priv, *width);
*consHeight = scaley(priv, *height);
- if (*consWidth < 1) *consWidth = 1;
- if (*consHeight < 1) *consHeight = 1;
+ if (*consWidth < 1)
+ *consWidth = 1;
+ if (*consHeight < 1)
+ *consHeight = 1;
}
/** Re-initialized the console device described by \a pDev (after a
* reconfig). */
-void dmxConsoleReInit(DevicePtr pDev)
+void
+dmxConsoleReInit(DevicePtr pDev)
{
GETPRIVFROMPDEV;
Display *dpy;
- if (!priv || !priv->initialized) return;
+ if (!priv || !priv->initialized)
+ return;
dpy = priv->display;
dmxConsoleComputeWidthHeight(priv,
@@ -709,28 +749,32 @@ void dmxConsoleReInit(DevicePtr pDev)
RootWindow(dpy, DefaultScreen(dpy)),
priv->consWidth,
priv->consHeight,
- DefaultDepth(dpy,DefaultScreen(dpy)));
+ DefaultDepth(dpy, DefaultScreen(dpy)));
dmxConsoleDraw(priv, 1, 1);
}
/** Initialized the console device described by \a pDev. */
-void dmxConsoleInit(DevicePtr pDev)
+void
+dmxConsoleInit(DevicePtr pDev)
{
GETPRIVFROMPDEV;
- DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx];
- int screen;
- unsigned long mask;
+ DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx];
+ int screen;
+ unsigned long mask;
XSetWindowAttributes attribs;
- Display *dpy;
- Window win;
- XGCValues gcvals;
- XColor color;
- XClassHint class_hints;
- unsigned long tmp;
-
- if (dmxLocal->type == DMX_LOCAL_MOUSE) priv->mou = pDev;
- if (dmxLocal->type == DMX_LOCAL_KEYBOARD) priv->kbd = pDev;
- if (priv->initialized++) return; /* Only do once for mouse/keyboard pair */
+ Display *dpy;
+ Window win;
+ XGCValues gcvals;
+ XColor color;
+ XClassHint class_hints;
+ unsigned long tmp;
+
+ if (dmxLocal->type == DMX_LOCAL_MOUSE)
+ priv->mou = pDev;
+ if (dmxLocal->type == DMX_LOCAL_KEYBOARD)
+ priv->kbd = pDev;
+ if (priv->initialized++)
+ return; /* Only do once for mouse/keyboard pair */
if (!(dpy = priv->display = XOpenDisplay(dmxInput->name)))
dmxLog(dmxFatal,
@@ -744,30 +788,29 @@ void dmxConsoleInit(DevicePtr pDev)
&priv->consWidth, &priv->consHeight);
/* Private initialization using computed values or constants. */
- screen = DefaultScreen(dpy);
- priv->initPointerX = scalex(priv, priv->width / 2);
- priv->initPointerY = scaley(priv, priv->height / 2);
- priv->eventMask = (ButtonPressMask
- | ButtonReleaseMask
- | PointerMotionMask
- | EnterWindowMask
- | LeaveWindowMask
- | KeyPressMask
- | KeyReleaseMask
- | ExposureMask
- | ResizeRedirectMask);
+ screen = DefaultScreen(dpy);
+ priv->initPointerX = scalex(priv, priv->width / 2);
+ priv->initPointerY = scaley(priv, priv->height / 2);
+ priv->eventMask = (ButtonPressMask
+ | ButtonReleaseMask
+ | PointerMotionMask
+ | EnterWindowMask
+ | LeaveWindowMask
+ | KeyPressMask
+ | KeyReleaseMask | ExposureMask | ResizeRedirectMask);
mask = CWBackPixel | CWEventMask | CWColormap | CWOverrideRedirect;
attribs.colormap = DefaultColormap(dpy, screen);
if (XParseColor(dpy, attribs.colormap, CONSOLE_BG_COLOR, &color)
&& XAllocColor(dpy, attribs.colormap, &color)) {
- attribs.background_pixel = color.pixel;
- } else
+ attribs.background_pixel = color.pixel;
+ }
+ else
attribs.background_pixel = WhitePixel(dpy, screen);
- attribs.event_mask = priv->eventMask;
+ attribs.event_mask = priv->eventMask;
attribs.override_redirect = False;
-
+
win = priv->window = XCreateWindow(dpy,
RootWindow(dpy, screen),
0, 0, priv->consWidth, priv->consHeight,
@@ -780,122 +823,129 @@ void dmxConsoleInit(DevicePtr pDev)
priv->consWidth, priv->consHeight,
DefaultDepth(dpy, screen));
- /* Set up properties */
+ /* Set up properties */
XStoreName(dpy, win, DMX_CONSOLE_NAME);
- class_hints.res_name = DMX_RES_NAME;
+ class_hints.res_name = DMX_RES_NAME;
class_hints.res_class = DMX_RES_CLASS;
XSetClassHint(dpy, win, &class_hints);
-
- /* Map the window */
+ /* Map the window */
XMapWindow(dpy, win);
- /* Create cursors */
- priv->cursorNormal = XCreateFontCursor(dpy, XC_circle);
+ /* Create cursors */
+ priv->cursorNormal = XCreateFontCursor(dpy, XC_circle);
priv->cursorGrabbed = XCreateFontCursor(dpy, XC_spider);
- priv->cursorEmpty = dmxConsoleCreateEmptyCursor(priv);
+ priv->cursorEmpty = dmxConsoleCreateEmptyCursor(priv);
XDefineCursor(dpy, priv->window, priv->cursorNormal);
- /* Create GC */
+ /* Create GC */
mask = (GCFunction | GCPlaneMask | GCClipMask | GCForeground |
- GCBackground | GCLineWidth | GCLineStyle | GCCapStyle |
- GCFillStyle | GCGraphicsExposures);
+ GCBackground | GCLineWidth | GCLineStyle | GCCapStyle |
+ GCFillStyle | GCGraphicsExposures);
gcvals.function = GXcopy;
gcvals.plane_mask = AllPlanes;
gcvals.clip_mask = None;
if (XParseColor(dpy, attribs.colormap, CONSOLE_SCREEN_FG_COLOR, &color)
&& XAllocColor(dpy, attribs.colormap, &color)) {
- gcvals.foreground = color.pixel;
- } else
- gcvals.foreground = BlackPixel(dpy, screen);
+ gcvals.foreground = color.pixel;
+ }
+ else
+ gcvals.foreground = BlackPixel(dpy, screen);
if (XParseColor(dpy, attribs.colormap, CONSOLE_SCREEN_BG_COLOR, &color)
&& XAllocColor(dpy, attribs.colormap, &color)) {
- gcvals.background = color.pixel;
- } else
- gcvals.background = WhitePixel(dpy, screen);
- gcvals.line_width = 0;
- gcvals.line_style = LineSolid;
- gcvals.cap_style = CapNotLast;
- gcvals.fill_style = FillSolid;
+ gcvals.background = color.pixel;
+ }
+ else
+ gcvals.background = WhitePixel(dpy, screen);
+ gcvals.line_width = 0;
+ gcvals.line_style = LineSolid;
+ gcvals.cap_style = CapNotLast;
+ gcvals.fill_style = FillSolid;
gcvals.graphics_exposures = False;
-
+
priv->gc = XCreateGC(dpy, win, mask, &gcvals);
- tmp = gcvals.foreground;
+ tmp = gcvals.foreground;
if (XParseColor(dpy, attribs.colormap, CONSOLE_SCREEN_DET_COLOR, &color)
&& XAllocColor(dpy, attribs.colormap, &color)) {
gcvals.foreground = color.pixel;
- } else
+ }
+ else
gcvals.foreground = BlackPixel(dpy, screen);
priv->gcDet = XCreateGC(dpy, win, mask, &gcvals);
gcvals.foreground = tmp;
- tmp = gcvals.background;
+ tmp = gcvals.background;
gcvals.background = gcvals.foreground;
gcvals.foreground = tmp;
priv->gcRev = XCreateGC(dpy, win, mask, &gcvals);
-
+
gcvals.background = gcvals.foreground;
if (XParseColor(dpy, attribs.colormap, CONSOLE_SCREEN_CUR_COLOR, &color)
&& XAllocColor(dpy, attribs.colormap, &color)) {
gcvals.foreground = color.pixel;
- } else
+ }
+ else
gcvals.foreground = BlackPixel(dpy, screen);
priv->gcCur = XCreateGC(dpy, win, mask, &gcvals);
dmxConsoleDraw(priv, 1, 1);
if (dixLookupPrivate(&screenInfo.screens[0]->devPrivates,
- dmxScreenPrivateKey))
+ dmxScreenPrivateKey))
priv->next = dixLookupPrivate(&screenInfo.screens[0]->devPrivates,
- dmxScreenPrivateKey);
- else
+ dmxScreenPrivateKey);
+ else
DMX_WRAP(CloseScreen, dmxCloseConsoleScreen,
priv, screenInfo.screens[0]);
dixSetPrivate(&screenInfo.screens[0]->devPrivates, dmxScreenPrivateKey,
- priv);
+ priv);
}
/** Fill in the \a info structure for the specified \a pDev. Only used
* for pointers. */
-void dmxConsoleMouGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
+void
+dmxConsoleMouGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
{
GETPRIVFROMPDEV;
- info->buttonClass = 1;
+ info->buttonClass = 1;
dmxCommonMouGetMap(pDev, info->map, &info->numButtons);
- info->valuatorClass = 1;
- info->numRelAxes = 2;
+ info->valuatorClass = 1;
+ info->numRelAxes = 2;
info->minval[0] = 0;
info->minval[1] = 0;
/* max possible console window size: */
info->maxval[0] = DisplayWidth(priv->display, DefaultScreen(priv->display));
- info->maxval[1] = DisplayHeight(priv->display, DefaultScreen(priv->display));
- info->res[0] = 1;
- info->minres[0] = 0;
- info->maxres[0] = 1;
+ info->maxval[1] =
+ DisplayHeight(priv->display, DefaultScreen(priv->display));
+ info->res[0] = 1;
+ info->minres[0] = 0;
+ info->maxres[0] = 1;
info->ptrFeedbackClass = 1;
}
/** Fill in the \a info structure for the specified \a pDev. Only used
* for keyboard. */
-void dmxConsoleKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
+void
+dmxConsoleKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
{
dmxCommonKbdGetInfo(pDev, info);
- info->keyboard = 1;
- info->keyClass = 1;
+ info->keyboard = 1;
+ info->keyClass = 1;
dmxCommonKbdGetMap(pDev, &info->keySyms, info->modMap);
- info->freemap = 1;
- info->focusClass = 1;
+ info->freemap = 1;
+ info->focusClass = 1;
info->kbdFeedbackClass = 1;
}
/** Handle special console-only keys. */
-int dmxConsoleFunctions(pointer private, DMXFunctionType function)
+int
+dmxConsoleFunctions(pointer private, DMXFunctionType function)
{
GETONLYPRIVFROMPRIVATE;
XRectangle rect;
- Display *dpy = priv->display;
+ Display *dpy = priv->display;
switch (function) {
case DMX_FUNCTION_FINE:
@@ -906,17 +956,17 @@ int dmxConsoleFunctions(pointer private, DMXFunctionType function)
XCopyArea(dpy, priv->pixmap, priv->window, priv->gc,
0, 0, priv->consWidth, priv->consHeight, 0, 0);
XSetClipMask(dpy, priv->gc, None);
-
+
XDefineCursor(dpy, priv->window,
priv->grabbed
- ? priv->cursorGrabbed
- : priv->cursorNormal);
+ ? priv->cursorGrabbed : priv->cursorNormal);
XWarpPointer(dpy, priv->window, priv->window,
0, 0, 0, 0,
scalex(priv, priv->globalX),
scaley(priv, priv->globalY));
- XSync(dpy, False); /* Not a backend display */
- } else {
+ XSync(dpy, False); /* Not a backend display */
+ }
+ else {
priv->fine = 1;
XRaiseWindow(dpy, priv->window);
XDefineCursor(dpy, priv->window, priv->cursorEmpty);
@@ -928,10 +978,9 @@ int dmxConsoleFunctions(pointer private, DMXFunctionType function)
XUngrabKeyboard(dpy, CurrentTime);
XUngrabPointer(dpy, CurrentTime);
XDefineCursor(dpy, priv->window,
- priv->fine
- ? priv->cursorEmpty
- : priv->cursorNormal);
- } else {
+ priv->fine ? priv->cursorEmpty : priv->cursorNormal);
+ }
+ else {
if (XGrabPointer(dpy, priv->window, True,
0, GrabModeAsync, GrabModeAsync, priv->window,
None, CurrentTime)) {
@@ -945,12 +994,11 @@ int dmxConsoleFunctions(pointer private, DMXFunctionType function)
return 0;
}
XDefineCursor(dpy, priv->window,
- priv->fine
- ? priv->cursorEmpty
- : priv->cursorGrabbed);
+ priv->fine ? priv->cursorEmpty : priv->cursorGrabbed);
}
priv->grabbed = !priv->grabbed;
- if (priv->fine) dmxConsoleUpdateFineCursor(priv);
+ if (priv->fine)
+ dmxConsoleUpdateFineCursor(priv);
return 1;
case DMX_FUNCTION_TERMINATE:
return 1;
@@ -959,16 +1007,18 @@ int dmxConsoleFunctions(pointer private, DMXFunctionType function)
}
}
-static void dmxDump(void)
+static void
+dmxDump(void)
{
- int i, j;
+ int i, j;
DMXInputInfo *dmxInput;
- XEvent X;
-
+ XEvent X;
+
for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++) {
for (j = 0; j < dmxInput->numDevs; j++) {
DMXLocalInputInfoPtr dmxLocal = dmxInput->devs[j];
- myPrivate *priv = dmxLocal->private;
+ myPrivate *priv = dmxLocal->private;
+
while (priv
&& priv->display
&& XCheckTypedEvent(priv->display, MotionNotify, &X)) {
@@ -982,36 +1032,43 @@ static void dmxDump(void)
/** This routine is used to warp the pointer into the console window
* from anywhere on the screen. It is used when backend and console
* input are both being taken from the same X display. */
-void dmxConsoleCapture(DMXInputInfo *dmxInput)
+void
+dmxConsoleCapture(DMXInputInfo * dmxInput)
{
- int i;
- XEvent X;
+ int i;
+ XEvent X;
DMXDBG0("dmxConsoleCapture\n");
dmxSync(NULL, TRUE);
for (i = 0; i < dmxInput->numDevs; i++) {
DMXLocalInputInfoPtr dmxLocal = dmxInput->devs[i];
- myPrivate *priv = dmxLocal->private;
- if (dmxLocal->extType != DMX_LOCAL_TYPE_CONSOLE) continue;
- if (dmxLocal->type != DMX_LOCAL_MOUSE) continue;
- if (priv->captured) continue;
+ myPrivate *priv = dmxLocal->private;
+
+ if (dmxLocal->extType != DMX_LOCAL_TYPE_CONSOLE)
+ continue;
+ if (dmxLocal->type != DMX_LOCAL_MOUSE)
+ continue;
+ if (priv->captured)
+ continue;
priv->captured = 2; /* Ungrab only after proximal events. */
XRaiseWindow(priv->display, priv->window);
- XSync(priv->display, False); /* Not a backend display */
+ XSync(priv->display, False); /* Not a backend display */
while (XCheckTypedEvent(priv->display, MotionNotify, &X)) {
DMXDBG3(" Ignoring motion to %d %d after capture on %s\n",
X.xmotion.x, X.xmotion.y, dmxInput->name);
}
XWarpPointer(priv->display, None,
priv->window, 0, 0, 0, 0, priv->curX, priv->curY);
- XSync(priv->display, False); /* Not a backend display */
+ XSync(priv->display, False); /* Not a backend display */
dmxDump();
- if (priv->fine) dmxConsoleUpdateFineCursor(priv);
+ if (priv->fine)
+ dmxConsoleUpdateFineCursor(priv);
}
}
/** Undo the capture that was done by #dmxConsoleCapture. */
-void dmxConsoleUncapture(DMXInputInfo *dmxInput)
+void
+dmxConsoleUncapture(DMXInputInfo * dmxInput)
{
int i;
@@ -1019,11 +1076,15 @@ void dmxConsoleUncapture(DMXInputInfo *dmxInput)
dmxSync(NULL, TRUE);
for (i = 0; i < dmxInput->numDevs; i++) {
DMXLocalInputInfoPtr dmxLocal = dmxInput->devs[i];
- myPrivate *priv = dmxLocal->private;
- if (dmxLocal->extType != DMX_LOCAL_TYPE_CONSOLE) continue;
- if (dmxLocal->type != DMX_LOCAL_MOUSE) continue;
- if (!priv->captured) continue;
+ myPrivate *priv = dmxLocal->private;
+
+ if (dmxLocal->extType != DMX_LOCAL_TYPE_CONSOLE)
+ continue;
+ if (dmxLocal->type != DMX_LOCAL_MOUSE)
+ continue;
+ if (!priv->captured)
+ continue;
priv->captured = 0;
- XSync(priv->display, False); /* Not a backend display */
+ XSync(priv->display, False); /* Not a backend display */
}
}
diff --git a/hw/dmx/input/dmxconsole.h b/hw/dmx/input/dmxconsole.h
index cd545d39b..1c5261101 100644
--- a/hw/dmx/input/dmxconsole.h
+++ b/hw/dmx/input/dmxconsole.h
@@ -38,22 +38,22 @@
#define _DMXCONSOLE_H_
extern pointer dmxConsoleCreatePrivate(DeviceIntPtr pDevice);
-extern void dmxConsoleDestroyPrivate(pointer private);
-extern void dmxConsoleInit(DevicePtr pDev);
-extern void dmxConsoleReInit(DevicePtr pDev);
-extern void dmxConsoleMouGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
-extern void dmxConsoleKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
-extern void dmxConsoleCollectEvents(DevicePtr pDev,
- dmxMotionProcPtr motion,
- dmxEnqueueProcPtr enqueue,
- dmxCheckSpecialProcPtr checkspecial,
- DMXBlockType block);
-extern int dmxConsoleFunctions(pointer private, DMXFunctionType function);
-extern void dmxConsoleUpdatePosition(pointer private, int x, int y);
-extern void dmxConsoleKbdSetCtrl(pointer private, KeybdCtrl *ctrl);
-extern void dmxConsoleCapture(DMXInputInfo *dmxInput);
-extern void dmxConsoleUncapture(DMXInputInfo *dmxInput);
-extern void dmxConsoleUpdateInfo(pointer private,
- DMXUpdateType, WindowPtr pWindow);
+extern void dmxConsoleDestroyPrivate(pointer private);
+extern void dmxConsoleInit(DevicePtr pDev);
+extern void dmxConsoleReInit(DevicePtr pDev);
+extern void dmxConsoleMouGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
+extern void dmxConsoleKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
+extern void dmxConsoleCollectEvents(DevicePtr pDev,
+ dmxMotionProcPtr motion,
+ dmxEnqueueProcPtr enqueue,
+ dmxCheckSpecialProcPtr checkspecial,
+ DMXBlockType block);
+extern int dmxConsoleFunctions(pointer private, DMXFunctionType function);
+extern void dmxConsoleUpdatePosition(pointer private, int x, int y);
+extern void dmxConsoleKbdSetCtrl(pointer private, KeybdCtrl * ctrl);
+extern void dmxConsoleCapture(DMXInputInfo * dmxInput);
+extern void dmxConsoleUncapture(DMXInputInfo * dmxInput);
+extern void dmxConsoleUpdateInfo(pointer private,
+ DMXUpdateType, WindowPtr pWindow);
#endif
diff --git a/hw/dmx/input/dmxdetach.c b/hw/dmx/input/dmxdetach.c
index cc2250683..469f9c8d0 100644
--- a/hw/dmx/input/dmxdetach.c
+++ b/hw/dmx/input/dmxdetach.c
@@ -42,12 +42,14 @@
#include "dmxextension.h" /* For dmxInputCount */
/** Search for input associated with \a dmxScreen, and detach. */
-void dmxInputDetach(DMXScreenInfo *dmxScreen, Bool reserveId)
+void
+dmxInputDetach(DMXScreenInfo * dmxScreen, Bool reserveId)
{
int i;
for (i = 0; i < dmxNumInputs; i++) {
DMXInputInfo *dmxInput = &dmxInputs[i];
+
if (dmxInput->scrnIdx == dmxScreen->index) {
dmxLogInput(dmxInput, "Detaching (%sreserved)\n",
reserveId ? "" : "not ");
diff --git a/hw/dmx/input/dmxdummy.c b/hw/dmx/input/dmxdummy.c
index 971892b9f..0690177f8 100644
--- a/hw/dmx/input/dmxdummy.c
+++ b/hw/dmx/input/dmxdummy.c
@@ -47,40 +47,42 @@
/** Return information about the dummy keyboard device specified in \a pDev
* into the structure pointed to by \a info. The keyboard is set up to
* have 1 valid key code that is \a NoSymbol */
-void dmxDummyKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
+void
+dmxDummyKbdGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
{
static KeySym keyboard_mapping = NoSymbol;
- info->keyboard = 1;
- info->keyClass = 1;
+ info->keyboard = 1;
+ info->keyClass = 1;
info->keySyms.minKeyCode = 8;
info->keySyms.maxKeyCode = 8;
- info->keySyms.mapWidth = 1;
- info->keySyms.map = &keyboard_mapping;
- info->freemap = 0;
- info->focusClass = 1;
- info->kbdFeedbackClass = 1;
- info->force = 1;
+ info->keySyms.mapWidth = 1;
+ info->keySyms.map = &keyboard_mapping;
+ info->freemap = 0;
+ info->focusClass = 1;
+ info->kbdFeedbackClass = 1;
+ info->force = 1;
}
/** Return information about the dummy mouse device specified in \a pDev
* into the structure pointed to by \a info. They mouse has 3 buttons
* and two axes. */
-void dmxDummyMouGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
+void
+dmxDummyMouGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
{
- info->buttonClass = 1;
- info->numButtons = 3;
- info->map[0] = 1;
- info->map[1] = 2;
- info->map[2] = 3;
- info->valuatorClass = 1;
- info->numRelAxes = 2;
- info->minval[0] = 0;
- info->minval[1] = 0;
- info->maxval[0] = 0;
- info->maxval[1] = 0;
- info->res[0] = 1;
- info->minres[0] = 0;
- info->maxres[0] = 1;
+ info->buttonClass = 1;
+ info->numButtons = 3;
+ info->map[0] = 1;
+ info->map[1] = 2;
+ info->map[2] = 3;
+ info->valuatorClass = 1;
+ info->numRelAxes = 2;
+ info->minval[0] = 0;
+ info->minval[1] = 0;
+ info->maxval[0] = 0;
+ info->maxval[1] = 0;
+ info->res[0] = 1;
+ info->minres[0] = 0;
+ info->maxres[0] = 1;
info->ptrFeedbackClass = 1;
}
diff --git a/hw/dmx/input/dmxevents.c b/hw/dmx/input/dmxevents.c
index 41bc4bf2d..f73480824 100644
--- a/hw/dmx/input/dmxevents.c
+++ b/hw/dmx/input/dmxevents.c
@@ -61,9 +61,9 @@
#include "xkbsrv.h"
#include "XIstubs.h"
-static int dmxGlobalX, dmxGlobalY; /* Global cursor position */
-static int dmxGlobalInvalid; /* Flag indicating dmxCoreMotion
- * should move the mouse anyway. */
+static int dmxGlobalX, dmxGlobalY; /* Global cursor position */
+static int dmxGlobalInvalid; /* Flag indicating dmxCoreMotion
+ * should move the mouse anyway. */
#if DMX_EVENTS_DEBUG
#define DMXDBG0(f) dmxLog(dmxDebug,f)
@@ -85,25 +85,26 @@ static int dmxGlobalInvalid; /* Flag indicating dmxCoreMotion
#define DMXDBG7(f,a,b,c,d,e,g,h)
#endif
-static int dmxApplyFunctions(DMXInputInfo *dmxInput, DMXFunctionType f)
+static int
+dmxApplyFunctions(DMXInputInfo * dmxInput, DMXFunctionType f)
{
int i;
int rc = 0;
- for (i = 0; i < dmxInput->numDevs; i+= dmxInput->devs[i]->binding)
+ for (i = 0; i < dmxInput->numDevs; i += dmxInput->devs[i]->binding)
if (dmxInput->devs[i]->functions)
rc += dmxInput->devs[i]->functions(dmxInput->devs[i]->private, f);
return rc;
}
-static int dmxCheckFunctionKeys(DMXLocalInputInfoPtr dmxLocal,
- int type,
- KeySym keySym)
+static int
+dmxCheckFunctionKeys(DMXLocalInputInfoPtr dmxLocal, int type, KeySym keySym)
{
- DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx];
+ DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx];
-#if 1 /* hack to detect ctrl-alt-q, etc */
+#if 1 /* hack to detect ctrl-alt-q, etc */
static int ctrl = 0, alt = 0;
+
/* keep track of ctrl/alt key status */
if (type == KeyPress && keySym == 0xffe3) {
ctrl = 1;
@@ -126,11 +127,11 @@ static int dmxCheckFunctionKeys(DMXLocalInputInfoPtr dmxLocal,
state = dmxLocalCoreKeyboard->pDevice->key->state;
else if (dmxLocal->pDevice->key)
state = dmxLocal->pDevice->key->state;
-
+
DMXDBG3("dmxCheckFunctionKeys: keySym=0x%04x %s state=0x%04x\n",
keySym, type == KeyPress ? "press" : "release", state);
- if ((state & (ControlMask|Mod1Mask)) != (ControlMask|Mod1Mask))
+ if ((state & (ControlMask | Mod1Mask)) != (ControlMask | Mod1Mask))
return 0;
#endif
@@ -151,34 +152,36 @@ static int dmxCheckFunctionKeys(DMXLocalInputInfoPtr dmxLocal,
}
return 1;
}
-
+
return 0;
}
-
-DMXScreenInfo *dmxFindFirstScreen(int x, int y)
+DMXScreenInfo *
+dmxFindFirstScreen(int x, int y)
{
int i;
for (i = 0; i < dmxNumScreens; i++) {
DMXScreenInfo *dmxScreen = &dmxScreens[i];
+
if (dmxOnScreen(x, y, dmxScreen))
return dmxScreen;
}
return NULL;
}
-
/**
* Enqueue a motion event.
*/
-static void enqueueMotion(DevicePtr pDev, int x, int y)
+static void
+enqueueMotion(DevicePtr pDev, int x, int y)
{
GETDMXLOCALFROMPDEV;
DeviceIntPtr p = dmxLocal->pDevice;
int valuators[3];
- int detail = 0; /* XXX should this be mask of pressed buttons? */
+ int detail = 0; /* XXX should this be mask of pressed buttons? */
ValuatorMask mask;
+
valuators[0] = x;
valuators[1] = y;
@@ -188,50 +191,50 @@ static void enqueueMotion(DevicePtr pDev, int x, int y)
return;
}
-
void
dmxCoreMotion(DevicePtr pDev, int x, int y, int delta, DMXBlockType block)
{
DMXScreenInfo *dmxScreen;
- DMXInputInfo *dmxInput;
- ScreenPtr pScreen;
- int localX;
- int localY;
- int i;
+ DMXInputInfo *dmxInput;
+ ScreenPtr pScreen;
+ int localX;
+ int localY;
+ int i;
if (!dmxGlobalInvalid && dmxGlobalX == x && dmxGlobalY == y)
return;
-
+
DMXDBG5("dmxCoreMotion(%d,%d,%d) dmxGlobalX=%d dmxGlobalY=%d\n",
x, y, delta, dmxGlobalX, dmxGlobalY);
dmxGlobalInvalid = 0;
- dmxGlobalX = x;
- dmxGlobalY = y;
+ dmxGlobalX = x;
+ dmxGlobalY = y;
if (dmxGlobalX < 0)
dmxGlobalX = 0;
if (dmxGlobalY < 0)
dmxGlobalY = 0;
if (dmxGlobalX >= dmxGlobalWidth)
- dmxGlobalX = dmxGlobalWidth + delta -1;
+ dmxGlobalX = dmxGlobalWidth + delta - 1;
if (dmxGlobalY >= dmxGlobalHeight)
- dmxGlobalY = dmxGlobalHeight + delta -1;
-
+ dmxGlobalY = dmxGlobalHeight + delta - 1;
+
if ((dmxScreen = dmxFindFirstScreen(dmxGlobalX, dmxGlobalY))) {
localX = dmxGlobalX - dmxScreen->rootXOrigin;
localY = dmxGlobalY - dmxScreen->rootYOrigin;
if ((pScreen = miPointerGetScreen(inputInfo.pointer))
&& pScreen->myNum == dmxScreen->index) {
- /* Screen is old screen */
+ /* Screen is old screen */
if (block)
dmxSigioBlock();
if (pDev)
- enqueueMotion(pDev, localX, localY);
+ enqueueMotion(pDev, localX, localY);
if (block)
dmxSigioUnblock();
- } else {
- /* Screen is new */
+ }
+ else {
+ /* Screen is new */
DMXDBG4(" New screen: old=%d new=%d localX=%d localY=%d\n",
pScreen->myNum, dmxScreen->index, localX, localY);
if (block)
@@ -240,7 +243,7 @@ dmxCoreMotion(DevicePtr pDev, int x, int y, int delta, DMXBlockType block)
miPointerSetScreen(inputInfo.pointer, dmxScreen->index,
localX, localY);
if (pDev)
- enqueueMotion(pDev, localX, localY);
+ enqueueMotion(pDev, localX, localY);
if (block)
dmxSigioUnblock();
}
@@ -260,10 +263,11 @@ dmxCoreMotion(DevicePtr pDev, int x, int y, int delta, DMXBlockType block)
}
#endif
}
- /* Send updates down to all core input
- * drivers */
+ /* Send updates down to all core input
+ * drivers */
for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++) {
int j;
+
for (j = 0; j < dmxInput->numDevs; j += dmxInput->devs[j]->binding)
if (!dmxInput->detached
&& dmxInput->devs[j]->sendsCore
@@ -271,34 +275,35 @@ dmxCoreMotion(DevicePtr pDev, int x, int y, int delta, DMXBlockType block)
dmxInput->devs[j]->update_position(dmxInput->devs[j]->private,
dmxGlobalX, dmxGlobalY);
}
- if (!dmxScreen) ProcessInputEvents();
+ if (!dmxScreen)
+ ProcessInputEvents();
}
-
-
#define DMX_MAX_AXES 32 /* Max axes reported by this routine */
-static void dmxExtMotion(DMXLocalInputInfoPtr dmxLocal,
- int *v, int firstAxis, int axesCount,
- DMXMotionType type, DMXBlockType block)
+static void
+dmxExtMotion(DMXLocalInputInfoPtr dmxLocal,
+ int *v, int firstAxis, int axesCount,
+ DMXMotionType type, DMXBlockType block)
{
- DeviceIntPtr pDevice = dmxLocal->pDevice;
- xEvent xE[2 * DMX_MAX_AXES/6];
- deviceKeyButtonPointer *xev = (deviceKeyButtonPointer *)xE;
- deviceValuator *xv = (deviceValuator *)xev+1;
- int thisX = 0;
- int thisY = 0;
- int count;
- ValuatorMask mask;
+ DeviceIntPtr pDevice = dmxLocal->pDevice;
+ xEvent xE[2 * DMX_MAX_AXES / 6];
+ deviceKeyButtonPointer *xev = (deviceKeyButtonPointer *) xE;
+ deviceValuator *xv = (deviceValuator *) xev + 1;
+ int thisX = 0;
+ int thisY = 0;
+ int count;
+ ValuatorMask mask;
memset(xE, 0, sizeof(xE));
- if (axesCount > DMX_MAX_AXES) axesCount = DMX_MAX_AXES;
+ if (axesCount > DMX_MAX_AXES)
+ axesCount = DMX_MAX_AXES;
- if ((valuator_get_mode(pDevice,0) == Relative) && axesCount == 2) {
- /* The dmx console is a relative mode
- * device that sometimes reports
- * absolute motion. It only has two
- * axes. */
+ if ((valuator_get_mode(pDevice, 0) == Relative) && axesCount == 2) {
+ /* The dmx console is a relative mode
+ * device that sometimes reports
+ * absolute motion. It only has two
+ * axes. */
if (type == DMX_RELATIVE) {
thisX = -v[0];
thisY = -v[1];
@@ -307,7 +312,8 @@ static void dmxExtMotion(DMXLocalInputInfoPtr dmxLocal,
if (dmxLocal->update_position)
dmxLocal->update_position(dmxLocal->private,
dmxLocal->lastX, dmxLocal->lastY);
- } else { /* Convert to relative */
+ }
+ else { /* Convert to relative */
if (dmxLocal->lastX || dmxLocal->lastY) {
thisX = v[0] - dmxLocal->lastX;
thisY = v[1] - dmxLocal->lastY;
@@ -320,110 +326,155 @@ static void dmxExtMotion(DMXLocalInputInfoPtr dmxLocal,
}
if (axesCount <= 6) {
- /* Optimize for the common case when
- * only 1 or 2 axes change. */
- xev->time = GetTimeInMillis();
- xev->type = DeviceMotionNotify;
- xev->detail = 0;
- xev->deviceid = pDevice->id | MORE_EVENTS;
-
- xv->type = DeviceValuator;
- xv->deviceid = pDevice->id;
- xv->num_valuators = axesCount;
- xv->first_valuator = firstAxis;
- switch (xv->num_valuators) {
- case 6: xv->valuator5 = v[5];
- case 5: xv->valuator4 = v[4];
- case 4: xv->valuator3 = v[3];
- case 3: xv->valuator2 = v[2];
- case 2: xv->valuator1 = v[1];
- case 1: xv->valuator0 = v[0];
- }
- count = 2;
- } else {
+ /* Optimize for the common case when
+ * only 1 or 2 axes change. */
+ xev->time = GetTimeInMillis();
+ xev->type = DeviceMotionNotify;
+ xev->detail = 0;
+ xev->deviceid = pDevice->id | MORE_EVENTS;
+
+ xv->type = DeviceValuator;
+ xv->deviceid = pDevice->id;
+ xv->num_valuators = axesCount;
+ xv->first_valuator = firstAxis;
+ switch (xv->num_valuators) {
+ case 6:
+ xv->valuator5 = v[5];
+ case 5:
+ xv->valuator4 = v[4];
+ case 4:
+ xv->valuator3 = v[3];
+ case 3:
+ xv->valuator2 = v[2];
+ case 2:
+ xv->valuator1 = v[1];
+ case 1:
+ xv->valuator0 = v[0];
+ }
+ count = 2;
+ }
+ else {
int i;
+
for (i = 0, count = 0; i < axesCount; i += 6) {
- xev->time = GetTimeInMillis();
- xev->type = DeviceMotionNotify;
- xev->detail = 0;
- xev->deviceid = pDevice->id | MORE_EVENTS;
- xev += 2;
-
- xv->type = DeviceValuator;
- xv->deviceid = pDevice->id;
- xv->num_valuators = (i+6 >= axesCount ? axesCount - i : 6);
+ xev->time = GetTimeInMillis();
+ xev->type = DeviceMotionNotify;
+ xev->detail = 0;
+ xev->deviceid = pDevice->id | MORE_EVENTS;
+ xev += 2;
+
+ xv->type = DeviceValuator;
+ xv->deviceid = pDevice->id;
+ xv->num_valuators = (i + 6 >= axesCount ? axesCount - i : 6);
xv->first_valuator = firstAxis + i;
switch (xv->num_valuators) {
- case 6: xv->valuator5 = v[i+5];
- case 5: xv->valuator4 = v[i+4];
- case 4: xv->valuator3 = v[i+3];
- case 3: xv->valuator2 = v[i+2];
- case 2: xv->valuator1 = v[i+1];
- case 1: xv->valuator0 = v[i+0];
+ case 6:
+ xv->valuator5 = v[i + 5];
+ case 5:
+ xv->valuator4 = v[i + 4];
+ case 4:
+ xv->valuator3 = v[i + 3];
+ case 3:
+ xv->valuator2 = v[i + 2];
+ case 2:
+ xv->valuator1 = v[i + 1];
+ case 1:
+ xv->valuator0 = v[i + 0];
}
- xv += 2;
- count += 2;
+ xv += 2;
+ count += 2;
}
}
if (block)
dmxSigioBlock();
valuator_mask_set_range(&mask, firstAxis, axesCount, v);
- QueuePointerEvents(pDevice, MotionNotify, 0,
- POINTER_ABSOLUTE, &mask);
+ QueuePointerEvents(pDevice, MotionNotify, 0, POINTER_ABSOLUTE, &mask);
if (block)
dmxSigioUnblock();
}
-static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
- XEvent *e, DMXBlockType block)
+static int
+dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
+ XEvent * e, DMXBlockType block)
{
- int type;
- int event = -1;
- XDeviceKeyEvent *ke = (XDeviceKeyEvent *)e;
- XDeviceMotionEvent *me = (XDeviceMotionEvent *)e;
- DeviceIntPtr pDevice = dmxLocal->pDevice;
- int valuators[MAX_VALUATORS];
- ValuatorMask mask;
+ int type;
+ int event = -1;
+ XDeviceKeyEvent *ke = (XDeviceKeyEvent *) e;
+ XDeviceMotionEvent *me = (XDeviceMotionEvent *) e;
+ DeviceIntPtr pDevice = dmxLocal->pDevice;
+ int valuators[MAX_VALUATORS];
+ ValuatorMask mask;
if (!e)
- return -1; /* No extended event passed, cannot handle */
+ return -1; /* No extended event passed, cannot handle */
- if ((XID)dmxLocal->deviceId != ke->deviceid) {
- /* Search for the correct dmxLocal,
- * since backend and console events are
- * picked up for the first device on
- * that X server. */
+ if ((XID) dmxLocal->deviceId != ke->deviceid) {
+ /* Search for the correct dmxLocal,
+ * since backend and console events are
+ * picked up for the first device on
+ * that X server. */
int i;
DMXInputInfo *dmxInput = &dmxInputs[dmxLocal->inputIdx];
+
for (i = 0; i < dmxInput->numDevs; i++) {
dmxLocal = dmxInput->devs[i];
- if ((XID)dmxLocal->deviceId == ke->deviceid)
+ if ((XID) dmxLocal->deviceId == ke->deviceid)
break;
}
}
- if ((XID)dmxLocal->deviceId != ke->deviceid
+ if ((XID) dmxLocal->deviceId != ke->deviceid
|| (type = dmxMapLookup(dmxLocal, e->type)) < 0)
- return -1; /* No mapping, so this event is unhandled */
+ return -1; /* No mapping, so this event is unhandled */
switch (type) {
- case XI_DeviceValuator: event = DeviceValuator; break;
- case XI_DeviceKeyPress: event = KeyPress; break;
- case XI_DeviceKeyRelease: event = KeyRelease; break;
- case XI_DeviceButtonPress: event = ButtonPress; break;
- case XI_DeviceButtonRelease: event = ButtonRelease; break;
- case XI_DeviceMotionNotify: event = MotionNotify; break;
- case XI_DeviceFocusIn: event = DeviceFocusIn; break;
- case XI_DeviceFocusOut: event = DeviceFocusOut; break;
- case XI_ProximityIn: event = ProximityIn; break;
- case XI_ProximityOut: event = ProximityOut; break;
- case XI_DeviceStateNotify: event = DeviceStateNotify; break;
- case XI_DeviceMappingNotify: event = DeviceMappingNotify; break;
- case XI_ChangeDeviceNotify: event = ChangeDeviceNotify; break;
- case XI_DeviceKeystateNotify: event = DeviceStateNotify; break;
- case XI_DeviceButtonstateNotify: event = DeviceStateNotify; break;
+ case XI_DeviceValuator:
+ event = DeviceValuator;
+ break;
+ case XI_DeviceKeyPress:
+ event = KeyPress;
+ break;
+ case XI_DeviceKeyRelease:
+ event = KeyRelease;
+ break;
+ case XI_DeviceButtonPress:
+ event = ButtonPress;
+ break;
+ case XI_DeviceButtonRelease:
+ event = ButtonRelease;
+ break;
+ case XI_DeviceMotionNotify:
+ event = MotionNotify;
+ break;
+ case XI_DeviceFocusIn:
+ event = DeviceFocusIn;
+ break;
+ case XI_DeviceFocusOut:
+ event = DeviceFocusOut;
+ break;
+ case XI_ProximityIn:
+ event = ProximityIn;
+ break;
+ case XI_ProximityOut:
+ event = ProximityOut;
+ break;
+ case XI_DeviceStateNotify:
+ event = DeviceStateNotify;
+ break;
+ case XI_DeviceMappingNotify:
+ event = DeviceMappingNotify;
+ break;
+ case XI_ChangeDeviceNotify:
+ event = ChangeDeviceNotify;
+ break;
+ case XI_DeviceKeystateNotify:
+ event = DeviceStateNotify;
+ break;
+ case XI_DeviceButtonstateNotify:
+ event = DeviceStateNotify;
+ break;
}
#define EXTRACT_VALUATORS(ke, valuators) \
@@ -438,7 +489,8 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
case XI_DeviceKeyPress:
case XI_DeviceKeyRelease:
EXTRACT_VALUATORS(ke, valuators);
- valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators);
+ valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count,
+ valuators);
if (block)
dmxSigioBlock();
QueueKeyboardEvents(pDevice, event, ke->keycode, &mask);
@@ -448,7 +500,8 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
case XI_DeviceButtonPress:
case XI_DeviceButtonRelease:
EXTRACT_VALUATORS(ke, valuators);
- valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators);
+ valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count,
+ valuators);
if (block)
dmxSigioBlock();
QueuePointerEvents(pDevice, event, ke->keycode,
@@ -459,7 +512,8 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
case XI_ProximityIn:
case XI_ProximityOut:
EXTRACT_VALUATORS(ke, valuators);
- valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators);
+ valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count,
+ valuators);
if (block)
dmxSigioBlock();
QueueProximityEvents(pDevice, event, &mask);
@@ -480,13 +534,13 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
case XI_ChangeDeviceNotify:
case XI_DeviceKeystateNotify:
case XI_DeviceButtonstateNotify:
- /* These are ignored, since DMX will
- * generate its own events of these
- * types, as necessary.
+ /* These are ignored, since DMX will
+ * generate its own events of these
+ * types, as necessary.
- * Perhaps ChangeDeviceNotify should
- * generate an error, because it is
- * unexpected? */
+ * Perhaps ChangeDeviceNotify should
+ * generate an error, because it is
+ * unexpected? */
break;
case XI_DeviceValuator:
default:
@@ -498,11 +552,12 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
return 0;
}
-static int dmxGetButtonMapping(DMXLocalInputInfoPtr dmxLocal, int button)
+static int
+dmxGetButtonMapping(DMXLocalInputInfoPtr dmxLocal, int button)
{
ButtonClassPtr b = dmxLocal->pDevice->button;
- if (button > b->numButtons) { /* This shouldn't happen. */
+ if (button > b->numButtons) { /* This shouldn't happen. */
dmxLog(dmxWarning, "Button %d pressed, but only %d buttons?!?\n",
button, b->numButtons);
return button;
@@ -512,14 +567,16 @@ static int dmxGetButtonMapping(DMXLocalInputInfoPtr dmxLocal, int button)
/** Return DMX's notion of the pointer position in the global coordinate
* space. */
-void dmxGetGlobalPosition(int *x, int *y)
+void
+dmxGetGlobalPosition(int *x, int *y)
{
*x = dmxGlobalX;
*y = dmxGlobalY;
}
/** Invalidate the global position for #dmxCoreMotion. */
-void dmxInvalidateGlobalPosition(void)
+void
+dmxInvalidateGlobalPosition(void)
{
dmxGlobalInvalid = 1;
}
@@ -534,8 +591,9 @@ void dmxInvalidateGlobalPosition(void)
*
* If \a block is set to \a DMX_BLOCK, then the SIGIO handler will be
* blocked around calls to \a enqueueMotion(). */
-void dmxMotion(DevicePtr pDev, int *v, int firstAxes, int axesCount,
- DMXMotionType type, DMXBlockType block)
+void
+dmxMotion(DevicePtr pDev, int *v, int firstAxes, int axesCount,
+ DMXMotionType type, DMXBlockType block)
{
GETDMXLOCALFROMPDEV;
@@ -558,8 +616,8 @@ void dmxMotion(DevicePtr pDev, int *v, int firstAxes, int axesCount,
}
}
-static KeySym dmxKeyCodeToKeySym(DMXLocalInputInfoPtr dmxLocal,
- KeyCode keyCode)
+static KeySym
+dmxKeyCodeToKeySym(DMXLocalInputInfoPtr dmxLocal, KeyCode keyCode)
{
KeySym keysym = NoSymbol;
int effectiveGroup;
@@ -578,21 +636,21 @@ static KeySym dmxKeyCodeToKeySym(DMXLocalInputInfoPtr dmxLocal,
DMXDBG2("dmxKeyCodeToKeySym: Translated keyCode=%d to keySym=0x%04x\n",
keyCode, keysym);
-out:
+ out:
return keysym;
}
-static KeyCode dmxKeySymToKeyCode(DMXLocalInputInfoPtr dmxLocal, KeySym keySym,
- int tryFirst)
+static KeyCode
+dmxKeySymToKeyCode(DMXLocalInputInfoPtr dmxLocal, KeySym keySym, int tryFirst)
{
/* FIXME: this is quite ineffective, converting to a core map first and
* then extracting the info from there. It'd be better to run the actual
* xkb map */
XkbSrvInfoPtr xkbi = dmxLocal->pDevice->key->xkbInfo;
KeySymsPtr pKeySyms = XkbGetCoreMap(dmxLocal->pDevice);
- int i;
+ int i;
- /* Optimize for similar maps */
+ /* Optimize for similar maps */
if (XkbKeycodeInRange(xkbi->desc, tryFirst)
&& pKeySyms->map[(tryFirst - xkbi->desc->min_key_code)
* pKeySyms->mapWidth] == keySym)
@@ -603,18 +661,19 @@ static KeyCode dmxKeySymToKeyCode(DMXLocalInputInfoPtr dmxLocal, KeySym keySym,
* pKeySyms->mapWidth] == keySym) {
DMXDBG3("dmxKeySymToKeyCode: Translated keySym=0x%04x to"
" keyCode=%d (reverses to core keySym=0x%04x)\n",
- keySym, i, dmxKeyCodeToKeySym(dmxLocalCoreKeyboard,i));
+ keySym, i, dmxKeyCodeToKeySym(dmxLocalCoreKeyboard, i));
return i;
}
}
return 0;
}
-static int dmxFixup(DevicePtr pDev, int detail, KeySym keySym)
+static int
+dmxFixup(DevicePtr pDev, int detail, KeySym keySym)
{
GETDMXLOCALFROMPDEV;
int keyCode;
-
+
if (!dmxLocal->pDevice->key) {
dmxLog(dmxWarning, "dmxFixup: not a keyboard device (%s)\n",
dmxLocal->pDevice->name);
@@ -636,9 +695,10 @@ static int dmxFixup(DevicePtr pDev, int detail, KeySym keySym)
* FIXME: make the code do what the comment says, or remove this comment.
* If \a block is set to \a DMX_BLOCK, then the SIGIO handler will be
* blocked around calls to dmxeqEnqueue(). */
-
-void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
- XEvent *e, DMXBlockType block)
+
+void
+dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
+ XEvent * e, DMXBlockType block)
{
GETDMXINPUTFROMPDEV;
xEvent xE;
@@ -658,7 +718,7 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
if (dmxLocal->sendsCore && dmxLocal != dmxLocalCoreKeyboard)
xE.u.u.detail = dmxFixup(pDev, detail, keySym);
- /*ErrorF("KEY %d sym %d\n", detail, (int) keySym);*/
+ /*ErrorF("KEY %d sym %d\n", detail, (int) keySym); */
QueueKeyboardEvents(p, type, detail, NULL);
return;
@@ -673,7 +733,7 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
case MotionNotify:
valuators[0] = e->xmotion.x;
valuators[1] = e->xmotion.y;
- valuators[2] = e->xmotion.state; /* FIXME: WTF?? */
+ valuators[2] = e->xmotion.state; /* FIXME: WTF?? */
valuator_mask_set_range(&mask, 0, 3, valuators);
QueuePointerEvents(p, type, detail,
POINTER_ABSOLUTE | POINTER_SCREEN, &mask);
@@ -682,7 +742,7 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
case EnterNotify:
case LeaveNotify:
case KeymapNotify:
- case MappingNotify: /* This is sent because we change the
+ case MappingNotify: /* This is sent because we change the
* modifier map on the backend/console
* input device so that we have complete
* control of the input device LEDs. */
@@ -690,13 +750,14 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
default:
if (type == ProximityIn || type == ProximityOut) {
if (dmxLocal->sendsCore)
- return; /* Not a core event */
+ return; /* Not a core event */
break;
}
if (type >= LASTEvent) {
if (dmxTranslateAndEnqueueExtEvent(dmxLocal, e, block))
dmxLogInput(dmxInput, "Unhandled extension event: %d\n", type);
- } else {
+ }
+ else {
dmxLogInput(dmxInput, "Unhandled event: %d (%s)\n",
type, dmxEventName(type));
}
@@ -711,23 +772,28 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
* requested termination of the DMX server, -1 is returned. If the user
* has requested a switch to a VT, then the (1-based) number of that VT
* is returned. */
-int dmxCheckSpecialKeys(DevicePtr pDev, KeySym keySym)
+int
+dmxCheckSpecialKeys(DevicePtr pDev, KeySym keySym)
{
GETDMXINPUTFROMPDEV;
- int vt = 0;
+ int vt = 0;
unsigned short state = 0;
if (dmxLocal->sendsCore)
- state = XkbStateFieldFromRec(&dmxLocalCoreKeyboard->pDevice->key->xkbInfo->state);
+ state =
+ XkbStateFieldFromRec(&dmxLocalCoreKeyboard->pDevice->key->xkbInfo->
+ state);
else if (dmxLocal->pDevice->key)
state = XkbStateFieldFromRec(&dmxLocal->pDevice->key->xkbInfo->state);
- if (!dmxLocal->sendsCore) return 0; /* Only for core devices */
+ if (!dmxLocal->sendsCore)
+ return 0; /* Only for core devices */
+
+ DMXDBG2("dmxCheckSpecialKeys: keySym=0x%04x state=0x%04x\n", keySym, state);
+
+ if ((state & (ControlMask | Mod1Mask)) != (ControlMask | Mod1Mask))
+ return 0;
- DMXDBG2("dmxCheckSpecialKeys: keySym=0x%04x state=0x%04x\n", keySym,state);
-
- if ((state & (ControlMask|Mod1Mask)) != (ControlMask|Mod1Mask)) return 0;
-
switch (keySym) {
case XK_F1:
case XK_F2:
@@ -747,7 +813,7 @@ int dmxCheckSpecialKeys(DevicePtr pDev, KeySym keySym)
vt = keySym - XK_F11 + 11;
break;
- case XK_q: /* To avoid confusion */
+ case XK_q: /* To avoid confusion */
case XK_BackSpace:
case XK_Delete:
case XK_KP_Delete:
diff --git a/hw/dmx/input/dmxevents.h b/hw/dmx/input/dmxevents.h
index fe8712ebe..4877cf49c 100644
--- a/hw/dmx/input/dmxevents.h
+++ b/hw/dmx/input/dmxevents.h
@@ -40,7 +40,7 @@
extern void dmxMotion(DevicePtr pDev, int *v, int firstAxis, int axesCount,
DMXMotionType type, DMXBlockType block);
extern void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
- XEvent *e, DMXBlockType block);
-extern int dmxCheckSpecialKeys(DevicePtr pDev, KeySym keySym);
+ XEvent * e, DMXBlockType block);
+extern int dmxCheckSpecialKeys(DevicePtr pDev, KeySym keySym);
extern void dmxInvalidateGlobalPosition(void);
#endif
diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c
index 16ecae38d..b22a41f56 100644
--- a/hw/dmx/input/dmxinputinit.c
+++ b/hw/dmx/input/dmxinputinit.c
@@ -102,7 +102,7 @@ static DMXLocalInputInfoRec DMXBackendMou = {
static DMXLocalInputInfoRec DMXBackendKbd = {
"backend-kbd", DMX_LOCAL_KEYBOARD, DMX_LOCAL_TYPE_BACKEND,
- 1, /* With backend-mou or console-mou */
+ 1, /* With backend-mou or console-mou */
dmxCommonCopyPrivate, NULL,
dmxBackendInit, NULL, NULL, dmxBackendKbdGetInfo,
dmxCommonKbdOn, dmxCommonKbdOff, NULL,
@@ -123,7 +123,7 @@ static DMXLocalInputInfoRec DMXConsoleMou = {
static DMXLocalInputInfoRec DMXConsoleKbd = {
"console-kbd", DMX_LOCAL_KEYBOARD, DMX_LOCAL_TYPE_CONSOLE,
- 1, /* With backend-mou or console-mou */
+ 1, /* With backend-mou or console-mou */
dmxCommonCopyPrivate, NULL,
dmxConsoleInit, dmxConsoleReInit, NULL, dmxConsoleKbdGetInfo,
dmxCommonKbdOn, dmxCommonKbdOff, NULL,
@@ -133,87 +133,78 @@ static DMXLocalInputInfoRec DMXConsoleKbd = {
};
static DMXLocalInputInfoRec DMXLocalDevices[] = {
- /* Dummy drivers that can compile on any OS */
+ /* Dummy drivers that can compile on any OS */
#ifdef __linux__
- /* Linux-specific drivers */
+ /* Linux-specific drivers */
{
- "kbd", DMX_LOCAL_KEYBOARD, DMX_LOCAL_TYPE_LOCAL, 1,
- kbdLinuxCreatePrivate, kbdLinuxDestroyPrivate,
- kbdLinuxInit, NULL, NULL, kbdLinuxGetInfo,
- kbdLinuxOn, kbdLinuxOff, NULL,
- kbdLinuxVTPreSwitch, kbdLinuxVTPostSwitch, kbdLinuxVTSwitch,
- kbdLinuxRead, NULL, NULL, NULL,
- NULL, kbdLinuxCtrl, kbdLinuxBell
- },
+ "kbd", DMX_LOCAL_KEYBOARD, DMX_LOCAL_TYPE_LOCAL, 1,
+ kbdLinuxCreatePrivate, kbdLinuxDestroyPrivate,
+ kbdLinuxInit, NULL, NULL, kbdLinuxGetInfo,
+ kbdLinuxOn, kbdLinuxOff, NULL,
+ kbdLinuxVTPreSwitch, kbdLinuxVTPostSwitch, kbdLinuxVTSwitch,
+ kbdLinuxRead, NULL, NULL, NULL,
+ NULL, kbdLinuxCtrl, kbdLinuxBell},
{
- "ms", DMX_LOCAL_MOUSE, DMX_LOCAL_TYPE_LOCAL, 1,
- msLinuxCreatePrivate, msLinuxDestroyPrivate,
- msLinuxInit, NULL, NULL, msLinuxGetInfo,
- msLinuxOn, msLinuxOff, NULL,
- msLinuxVTPreSwitch, msLinuxVTPostSwitch, NULL,
- msLinuxRead
- },
+ "ms", DMX_LOCAL_MOUSE, DMX_LOCAL_TYPE_LOCAL, 1,
+ msLinuxCreatePrivate, msLinuxDestroyPrivate,
+ msLinuxInit, NULL, NULL, msLinuxGetInfo,
+ msLinuxOn, msLinuxOff, NULL,
+ msLinuxVTPreSwitch, msLinuxVTPostSwitch, NULL,
+ msLinuxRead},
{
- "ps2", DMX_LOCAL_MOUSE, DMX_LOCAL_TYPE_LOCAL, 1,
- ps2LinuxCreatePrivate, ps2LinuxDestroyPrivate,
- ps2LinuxInit, NULL, NULL, ps2LinuxGetInfo,
- ps2LinuxOn, ps2LinuxOff, NULL,
- ps2LinuxVTPreSwitch, ps2LinuxVTPostSwitch, NULL,
- ps2LinuxRead
- },
+ "ps2", DMX_LOCAL_MOUSE, DMX_LOCAL_TYPE_LOCAL, 1,
+ ps2LinuxCreatePrivate, ps2LinuxDestroyPrivate,
+ ps2LinuxInit, NULL, NULL, ps2LinuxGetInfo,
+ ps2LinuxOn, ps2LinuxOff, NULL,
+ ps2LinuxVTPreSwitch, ps2LinuxVTPostSwitch, NULL,
+ ps2LinuxRead},
#endif
#ifdef __linux__
- /* USB drivers, currently only for
- Linux, but relatively easy to port to
- other OSs */
+ /* USB drivers, currently only for
+ Linux, but relatively easy to port to
+ other OSs */
{
- "usb-kbd", DMX_LOCAL_KEYBOARD, DMX_LOCAL_TYPE_LOCAL, 1,
- usbCreatePrivate, usbDestroyPrivate,
- kbdUSBInit, NULL, NULL, kbdUSBGetInfo,
- kbdUSBOn, usbOff, NULL,
- NULL, NULL, NULL,
- kbdUSBRead, NULL, NULL, NULL,
- NULL, kbdUSBCtrl
- },
+ "usb-kbd", DMX_LOCAL_KEYBOARD, DMX_LOCAL_TYPE_LOCAL, 1,
+ usbCreatePrivate, usbDestroyPrivate,
+ kbdUSBInit, NULL, NULL, kbdUSBGetInfo,
+ kbdUSBOn, usbOff, NULL,
+ NULL, NULL, NULL,
+ kbdUSBRead, NULL, NULL, NULL,
+ NULL, kbdUSBCtrl},
{
- "usb-mou", DMX_LOCAL_MOUSE, DMX_LOCAL_TYPE_LOCAL, 1,
- usbCreatePrivate, usbDestroyPrivate,
- mouUSBInit, NULL, NULL, mouUSBGetInfo,
- mouUSBOn, usbOff, NULL,
- NULL, NULL, NULL,
- mouUSBRead
- },
+ "usb-mou", DMX_LOCAL_MOUSE, DMX_LOCAL_TYPE_LOCAL, 1,
+ usbCreatePrivate, usbDestroyPrivate,
+ mouUSBInit, NULL, NULL, mouUSBGetInfo,
+ mouUSBOn, usbOff, NULL,
+ NULL, NULL, NULL,
+ mouUSBRead},
{
- "usb-oth", DMX_LOCAL_OTHER, DMX_LOCAL_TYPE_LOCAL, 1,
- usbCreatePrivate, usbDestroyPrivate,
- othUSBInit, NULL, NULL, othUSBGetInfo,
- othUSBOn, usbOff, NULL,
- NULL, NULL, NULL,
- othUSBRead
- },
+ "usb-oth", DMX_LOCAL_OTHER, DMX_LOCAL_TYPE_LOCAL, 1,
+ usbCreatePrivate, usbDestroyPrivate,
+ othUSBInit, NULL, NULL, othUSBGetInfo,
+ othUSBOn, usbOff, NULL,
+ NULL, NULL, NULL,
+ othUSBRead},
#endif
{
- "dummy-mou", DMX_LOCAL_MOUSE, DMX_LOCAL_TYPE_LOCAL, 1,
- NULL, NULL, NULL, NULL, NULL, dmxDummyMouGetInfo
- },
+ "dummy-mou", DMX_LOCAL_MOUSE, DMX_LOCAL_TYPE_LOCAL, 1,
+ NULL, NULL, NULL, NULL, NULL, dmxDummyMouGetInfo},
{
- "dummy-kbd", DMX_LOCAL_KEYBOARD, DMX_LOCAL_TYPE_LOCAL, 1,
- NULL, NULL, NULL, NULL, NULL, dmxDummyKbdGetInfo
- },
- { NULL } /* Must be last */
+ "dummy-kbd", DMX_LOCAL_KEYBOARD, DMX_LOCAL_TYPE_LOCAL, 1,
+ NULL, NULL, NULL, NULL, NULL, dmxDummyKbdGetInfo},
+ {NULL} /* Must be last */
};
-
#if 11 /*BP*/
-void
+ void
DDXRingBell(int volume, int pitch, int duration)
{
- /* NO-OP */
+ /* NO-OP */
}
/* taken from kdrive/src/kinput.c: */
static void
-dmxKbdCtrl (DeviceIntPtr pDevice, KeybdCtrl *ctrl)
+dmxKbdCtrl(DeviceIntPtr pDevice, KeybdCtrl * ctrl)
{
#if 0
KdKeyboardInfo *ki;
@@ -228,7 +219,7 @@ dmxKbdCtrl (DeviceIntPtr pDevice, KeybdCtrl *ctrl)
KdSetLeds(ki, ctrl->leds);
ki->bellPitch = ctrl->bell_pitch;
- ki->bellDuration = ctrl->bell_duration;
+ ki->bellDuration = ctrl->bell_duration;
#endif
}
@@ -239,7 +230,7 @@ dmxBell(int volume, DeviceIntPtr pDev, pointer arg, int something)
#if 0
KeybdCtrl *ctrl = arg;
KdKeyboardInfo *ki = NULL;
-
+
for (ki = kdKeyboards; ki; ki = ki->next) {
if (ki->dixdev && ki->dixdev->id == pDev->id)
break;
@@ -247,50 +238,56 @@ dmxBell(int volume, DeviceIntPtr pDev, pointer arg, int something)
if (!ki || !ki->dixdev || ki->dixdev->id != pDev->id || !ki->driver)
return;
-
+
KdRingBell(ki, volume, ctrl->bell_pitch, ctrl->bell_duration);
#endif
}
#endif /*BP*/
-
-static void _dmxChangePointerControl(DMXLocalInputInfoPtr dmxLocal,
- PtrCtrl *ctrl)
+ static void
+_dmxChangePointerControl(DMXLocalInputInfoPtr dmxLocal, PtrCtrl * ctrl)
{
- if (!dmxLocal) return;
+ if (!dmxLocal)
+ return;
dmxLocal->mctrl = *ctrl;
- if (dmxLocal->mCtrl) dmxLocal->mCtrl(&dmxLocal->pDevice->public, ctrl);
+ if (dmxLocal->mCtrl)
+ dmxLocal->mCtrl(&dmxLocal->pDevice->public, ctrl);
}
/** Change the pointer control information for the \a pDevice. If the
* device sends core events, then also change the control information
* for all of the pointer devices that send core events. */
-void dmxChangePointerControl(DeviceIntPtr pDevice, PtrCtrl *ctrl)
+void
+dmxChangePointerControl(DeviceIntPtr pDevice, PtrCtrl * ctrl)
{
GETDMXLOCALFROMPDEVICE;
int i, j;
- if (dmxLocal->sendsCore) { /* Do for all core devices */
+ if (dmxLocal->sendsCore) { /* Do for all core devices */
for (i = 0; i < dmxNumInputs; i++) {
DMXInputInfo *dmxInput = &dmxInputs[i];
- if (dmxInput->detached) continue;
+
+ if (dmxInput->detached)
+ continue;
for (j = 0; j < dmxInput->numDevs; j++)
if (dmxInput->devs[j]->sendsCore)
_dmxChangePointerControl(dmxInput->devs[j], ctrl);
}
- } else { /* Do for this device only */
+ }
+ else { /* Do for this device only */
_dmxChangePointerControl(dmxLocal, ctrl);
}
}
-static void _dmxKeyboardKbdCtrlProc(DMXLocalInputInfoPtr dmxLocal,
- KeybdCtrl *ctrl)
+static void
+_dmxKeyboardKbdCtrlProc(DMXLocalInputInfoPtr dmxLocal, KeybdCtrl * ctrl)
{
dmxLocal->kctrl = *ctrl;
if (dmxLocal->kCtrl) {
dmxLocal->kCtrl(&dmxLocal->pDevice->public, ctrl);
if (dmxLocal->pDevice->kbdfeed) {
XkbEventCauseRec cause;
+
XkbSetCauseUnknown(&cause);
/* Generate XKB events, as necessary */
XkbUpdateIndicators(dmxLocal->pDevice, XkbAllIndicatorsMask, False,
@@ -299,69 +296,84 @@ static void _dmxKeyboardKbdCtrlProc(DMXLocalInputInfoPtr dmxLocal,
}
}
-
/** Change the keyboard control information for the \a pDevice. If the
* device sends core events, then also change the control information
* for all of the keyboard devices that send core events. */
-void dmxKeyboardKbdCtrlProc(DeviceIntPtr pDevice, KeybdCtrl *ctrl)
+void
+dmxKeyboardKbdCtrlProc(DeviceIntPtr pDevice, KeybdCtrl * ctrl)
{
GETDMXLOCALFROMPDEVICE;
int i, j;
- if (dmxLocal->sendsCore) { /* Do for all core devices */
+ if (dmxLocal->sendsCore) { /* Do for all core devices */
for (i = 0; i < dmxNumInputs; i++) {
DMXInputInfo *dmxInput = &dmxInputs[i];
- if (dmxInput->detached) continue;
+
+ if (dmxInput->detached)
+ continue;
for (j = 0; j < dmxInput->numDevs; j++)
if (dmxInput->devs[j]->sendsCore)
_dmxKeyboardKbdCtrlProc(dmxInput->devs[j], ctrl);
}
- } else { /* Do for this device only */
+ }
+ else { /* Do for this device only */
_dmxKeyboardKbdCtrlProc(dmxLocal, ctrl);
}
}
-static void _dmxKeyboardBellProc(DMXLocalInputInfoPtr dmxLocal, int percent)
+static void
+_dmxKeyboardBellProc(DMXLocalInputInfoPtr dmxLocal, int percent)
{
- if (dmxLocal->kBell) dmxLocal->kBell(&dmxLocal->pDevice->public,
- percent,
- dmxLocal->kctrl.bell,
- dmxLocal->kctrl.bell_pitch,
- dmxLocal->kctrl.bell_duration);
+ if (dmxLocal->kBell)
+ dmxLocal->kBell(&dmxLocal->pDevice->public,
+ percent,
+ dmxLocal->kctrl.bell,
+ dmxLocal->kctrl.bell_pitch,
+ dmxLocal->kctrl.bell_duration);
}
/** Sound the bell on the device. If the device send core events, then
* sound the bell on all of the devices that send core events. */
-void dmxKeyboardBellProc(int percent, DeviceIntPtr pDevice,
- pointer ctrl, int unknown)
+void
+dmxKeyboardBellProc(int percent, DeviceIntPtr pDevice,
+ pointer ctrl, int unknown)
{
GETDMXLOCALFROMPDEVICE;
int i, j;
- if (dmxLocal->sendsCore) { /* Do for all core devices */
+ if (dmxLocal->sendsCore) { /* Do for all core devices */
for (i = 0; i < dmxNumInputs; i++) {
DMXInputInfo *dmxInput = &dmxInputs[i];
- if (dmxInput->detached) continue;
+
+ if (dmxInput->detached)
+ continue;
for (j = 0; j < dmxInput->numDevs; j++)
if (dmxInput->devs[j]->sendsCore)
_dmxKeyboardBellProc(dmxInput->devs[j], percent);
}
- } else { /* Do for this device only */
+ }
+ else { /* Do for this device only */
_dmxKeyboardBellProc(dmxLocal, percent);
}
}
-static void dmxKeyboardFreeNames(XkbComponentNamesPtr names)
+static void
+dmxKeyboardFreeNames(XkbComponentNamesPtr names)
{
- if (names->keycodes) XFree(names->keycodes);
- if (names->types) XFree(names->types);
- if (names->compat) XFree(names->compat);
- if (names->symbols) XFree(names->symbols);
- if (names->geometry) XFree(names->geometry);
+ if (names->keycodes)
+ XFree(names->keycodes);
+ if (names->types)
+ XFree(names->types);
+ if (names->compat)
+ XFree(names->compat);
+ if (names->symbols)
+ XFree(names->symbols);
+ if (names->geometry)
+ XFree(names->geometry);
}
-
-static int dmxKeyboardOn(DeviceIntPtr pDevice, DMXLocalInitInfo *info)
+static int
+dmxKeyboardOn(DeviceIntPtr pDevice, DMXLocalInitInfo * info)
{
GETDMXINPUTFROMPDEVICE;
XkbRMLVOSet rmlvo;
@@ -374,14 +386,14 @@ static int dmxKeyboardOn(DeviceIntPtr pDevice, DMXLocalInitInfo *info)
XkbSetRulesDflts(&rmlvo);
if (!info->force && (dmxInput->keycodes
- || dmxInput->symbols
- || dmxInput->geometry)) {
- if (info->freenames) dmxKeyboardFreeNames(&info->names);
- info->freenames = 0;
+ || dmxInput->symbols || dmxInput->geometry)) {
+ if (info->freenames)
+ dmxKeyboardFreeNames(&info->names);
+ info->freenames = 0;
info->names.keycodes = dmxInput->keycodes;
- info->names.types = NULL;
- info->names.compat = NULL;
- info->names.symbols = dmxInput->symbols;
+ info->names.types = NULL;
+ info->names.compat = NULL;
+ info->names.symbols = dmxInput->symbols;
info->names.geometry = dmxInput->geometry;
dmxLogInput(dmxInput, "XKEYBOARD: From command line: %s",
@@ -391,7 +403,8 @@ static int dmxKeyboardOn(DeviceIntPtr pDevice, DMXLocalInitInfo *info)
if (info->names.geometry && *info->names.geometry)
dmxLogInputCont(dmxInput, " %s", info->names.geometry);
dmxLogInputCont(dmxInput, "\n");
- } else if (info->names.keycodes) {
+ }
+ else if (info->names.keycodes) {
dmxLogInput(dmxInput, "XKEYBOARD: From device: %s",
info->names.keycodes);
if (info->names.symbols && *info->names.symbols)
@@ -399,36 +412,36 @@ static int dmxKeyboardOn(DeviceIntPtr pDevice, DMXLocalInitInfo *info)
if (info->names.geometry && *info->names.geometry)
dmxLogInputCont(dmxInput, " %s", info->names.geometry);
dmxLogInputCont(dmxInput, "\n");
- } else {
+ }
+ else {
dmxLogInput(dmxInput, "XKEYBOARD: Defaults: %s %s %s %s %s\n",
dmxConfigGetXkbRules(),
dmxConfigGetXkbLayout(),
- dmxConfigGetXkbModel(),
- dmxConfigGetXkbVariant()
- ? dmxConfigGetXkbVariant() : "",
- dmxConfigGetXkbOptions()
+ dmxConfigGetXkbModel(), dmxConfigGetXkbVariant()
+ ? dmxConfigGetXkbVariant() : "", dmxConfigGetXkbOptions()
? dmxConfigGetXkbOptions() : "");
}
InitKeyboardDeviceStruct(pDevice, &rmlvo,
- dmxKeyboardBellProc,
- dmxKeyboardKbdCtrlProc);
+ dmxKeyboardBellProc, dmxKeyboardKbdCtrlProc);
- if (info->freenames) dmxKeyboardFreeNames(&info->names);
+ if (info->freenames)
+ dmxKeyboardFreeNames(&info->names);
return Success;
}
-
-static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what)
+static int
+dmxDeviceOnOff(DeviceIntPtr pDevice, int what)
{
GETDMXINPUTFROMPDEVICE;
- int fd;
+ int fd;
DMXLocalInitInfo info;
- int i;
- Atom btn_labels[MAX_BUTTONS] = {0}; /* FIXME */
- Atom axis_labels[MAX_VALUATORS] = {0}; /* FIXME */
+ int i;
+ Atom btn_labels[MAX_BUTTONS] = { 0 }; /* FIXME */
+ Atom axis_labels[MAX_VALUATORS] = { 0 }; /* FIXME */
- if (dmxInput->detached) return Success;
+ if (dmxInput->detached)
+ return Success;
memset(&info, 0, sizeof(info));
switch (what) {
@@ -450,9 +463,7 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what)
rmlvo.variant = dmxConfigGetXkbVariant();
rmlvo.options = dmxConfigGetXkbOptions();
- InitKeyboardDeviceStruct(pDevice,
- &rmlvo,
- dmxBell, dmxKbdCtrl);
+ InitKeyboardDeviceStruct(pDevice, &rmlvo, dmxBell, dmxKbdCtrl);
}
if (info.buttonClass) {
InitButtonClassDeviceStruct(pDevice, info.numButtons,
@@ -462,15 +473,15 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what)
if (info.numRelAxes && dmxLocal->sendsCore) {
InitValuatorClassDeviceStruct(pDevice, info.numRelAxes,
axis_labels,
- GetMaximumEventsNum(),
- Relative);
+ GetMaximumEventsNum(), Relative);
for (i = 0; i < info.numRelAxes; i++)
InitValuatorAxisStruct(pDevice, i, axis_labels[i],
info.minval[i], info.maxval[i],
info.res[i],
info.minres[i], info.maxres[i],
Relative);
- } else if (info.numRelAxes) {
+ }
+ else if (info.numRelAxes) {
InitValuatorClassDeviceStruct(pDevice, info.numRelAxes,
axis_labels,
dmxPointerGetMotionBufferSize(),
@@ -481,7 +492,8 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what)
info.maxval[i], info.res[i],
info.minres[i], info.maxres[i],
Relative);
- } else if (info.numAbsAxes) {
+ }
+ else if (info.numAbsAxes) {
InitValuatorClassDeviceStruct(pDevice, info.numAbsAxes,
axis_labels,
dmxPointerGetMotionBufferSize(),
@@ -494,8 +506,10 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what)
info.maxres[i], Absolute);
}
}
- if (info.focusClass) InitFocusClassDeviceStruct(pDevice);
- if (info.proximityClass) InitProximityClassDeviceStruct(pDevice);
+ if (info.focusClass)
+ InitFocusClassDeviceStruct(pDevice);
+ if (info.proximityClass)
+ InitProximityClassDeviceStruct(pDevice);
if (info.ptrFeedbackClass)
InitPtrFeedbackClassDeviceStruct(pDevice, dmxChangePointerControl);
if (info.intFeedbackClass || info.strFeedbackClass)
@@ -516,12 +530,13 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what)
break;
case DEVICE_OFF:
case DEVICE_CLOSE:
- /* This can get called twice consecutively: once for a
- * detached screen (DEVICE_OFF), and then again at server
- * generation time (DEVICE_CLOSE). */
+ /* This can get called twice consecutively: once for a
+ * detached screen (DEVICE_OFF), and then again at server
+ * generation time (DEVICE_CLOSE). */
if (pDev->on) {
dmxSigioUnregister(dmxInput);
- if (dmxLocal->off) dmxLocal->off(pDev);
+ if (dmxLocal->off)
+ dmxLocal->off(pDev);
pDev->on = FALSE;
}
break;
@@ -530,17 +545,19 @@ static int dmxDeviceOnOff(DeviceIntPtr pDevice, int what)
XFree(info.keySyms.map);
info.keySyms.map = NULL;
}
- if (info.xkb) XkbFreeKeyboard(info.xkb, 0, True);
+ if (info.xkb)
+ XkbFreeKeyboard(info.xkb, 0, True);
return Success;
}
-static void dmxProcessInputEvents(DMXInputInfo *dmxInput)
+static void
+dmxProcessInputEvents(DMXInputInfo * dmxInput)
{
int i;
mieqProcessInputEvents();
#if 00 /*BP*/
- miPointerUpdate();
+ miPointerUpdate();
#endif
if (dmxInput->detached)
return;
@@ -550,30 +567,44 @@ static void dmxProcessInputEvents(DMXInputInfo *dmxInput)
}
#if 11 /*BP*/
- mieqProcessInputEvents();
+ mieqProcessInputEvents();
#endif
}
-static void dmxUpdateWindowInformation(DMXInputInfo *dmxInput,
- DMXUpdateType type,
- WindowPtr pWindow)
+static void
+dmxUpdateWindowInformation(DMXInputInfo * dmxInput,
+ DMXUpdateType type, WindowPtr pWindow)
{
int i;
#ifdef PANORAMIX
- if (!noPanoramiXExtension && pWindow && pWindow->parent != screenInfo.screens[0]->root)
+ if (!noPanoramiXExtension && pWindow &&
+ pWindow->parent != screenInfo.screens[0]->root)
return;
#endif
#if DMX_WINDOW_DEBUG
{
const char *name = "Unknown";
+
switch (type) {
- case DMX_UPDATE_REALIZE: name = "Realize"; break;
- case DMX_UPDATE_UNREALIZE: name = "Unrealize"; break;
- case DMX_UPDATE_RESTACK: name = "Restack"; break;
- case DMX_UPDATE_COPY: name = "Copy"; break;
- case DMX_UPDATE_RESIZE: name = "Resize"; break;
- case DMX_UPDATE_REPARENT: name = "Repaint"; break;
+ case DMX_UPDATE_REALIZE:
+ name = "Realize";
+ break;
+ case DMX_UPDATE_UNREALIZE:
+ name = "Unrealize";
+ break;
+ case DMX_UPDATE_RESTACK:
+ name = "Restack";
+ break;
+ case DMX_UPDATE_COPY:
+ name = "Copy";
+ break;
+ case DMX_UPDATE_RESIZE:
+ name = "Resize";
+ break;
+ case DMX_UPDATE_REPARENT:
+ name = "Repaint";
+ break;
}
dmxLog(dmxDebug, "Window %p changed: %s\n", pWindow, name);
}
@@ -587,7 +618,8 @@ static void dmxUpdateWindowInformation(DMXInputInfo *dmxInput,
type, pWindow);
}
-static void dmxCollectAll(DMXInputInfo *dmxInput)
+static void
+dmxCollectAll(DMXInputInfo * dmxInput)
{
int i;
@@ -595,29 +627,29 @@ static void dmxCollectAll(DMXInputInfo *dmxInput)
return;
for (i = 0; i < dmxInput->numDevs; i += dmxInput->devs[i]->binding)
if (dmxInput->devs[i]->collect_events)
- dmxInput->devs[i]->collect_events(&dmxInput->devs[i]->pDevice->public,
- dmxMotion,
- dmxEnqueue,
+ dmxInput->devs[i]->collect_events(&dmxInput->devs[i]->pDevice->
+ public, dmxMotion, dmxEnqueue,
dmxCheckSpecialKeys, DMX_BLOCK);
}
-static void dmxBlockHandler(pointer blockData, OSTimePtr pTimeout,
- pointer pReadMask)
+static void
+dmxBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadMask)
{
- DMXInputInfo *dmxInput = &dmxInputs[(uintptr_t)blockData];
+ DMXInputInfo *dmxInput = &dmxInputs[(uintptr_t) blockData];
static unsigned long generation = 0;
-
+
if (generation != serverGeneration) {
generation = serverGeneration;
dmxCollectAll(dmxInput);
}
}
-static void dmxSwitchReturn(pointer p)
+static void
+dmxSwitchReturn(pointer p)
{
DMXInputInfo *dmxInput = p;
- int i;
-
+ int i;
+
dmxLog(dmxInfo, "Returning from VT %d\n", dmxInput->vt_switched);
if (!dmxInput->vt_switched)
@@ -629,25 +661,25 @@ static void dmxSwitchReturn(pointer p)
dmxInput->vt_switched = 0;
}
-static void dmxWakeupHandler(pointer blockData, int result, pointer pReadMask)
+static void
+dmxWakeupHandler(pointer blockData, int result, pointer pReadMask)
{
- DMXInputInfo *dmxInput = &dmxInputs[(uintptr_t)blockData];
- int i;
+ DMXInputInfo *dmxInput = &dmxInputs[(uintptr_t) blockData];
+ int i;
if (dmxInput->vt_switch_pending) {
dmxLog(dmxInfo, "Switching to VT %d\n", dmxInput->vt_switch_pending);
for (i = 0; i < dmxInput->numDevs; i++)
if (dmxInput->devs[i]->vt_pre_switch)
dmxInput->devs[i]->vt_pre_switch(dmxInput->devs[i]->private);
- dmxInput->vt_switched = dmxInput->vt_switch_pending;
+ dmxInput->vt_switched = dmxInput->vt_switch_pending;
dmxInput->vt_switch_pending = 0;
for (i = 0; i < dmxInput->numDevs; i++) {
if (dmxInput->devs[i]->vt_switch) {
dmxSigioDisableInput();
if (!dmxInput->devs[i]->vt_switch(dmxInput->devs[i]->private,
dmxInput->vt_switched,
- dmxSwitchReturn,
- dmxInput))
+ dmxSwitchReturn, dmxInput))
dmxSwitchReturn(dmxInput);
break; /* Only call one vt_switch routine */
}
@@ -656,35 +688,44 @@ static void dmxWakeupHandler(pointer blockData, int result, pointer pReadMask)
dmxCollectAll(dmxInput);
}
-static char *dmxMakeUniqueDeviceName(DMXLocalInputInfoPtr dmxLocal)
+static char *
+dmxMakeUniqueDeviceName(DMXLocalInputInfoPtr dmxLocal)
{
- static int k = 0;
- static int m = 0;
- static int o = 0;
+ static int k = 0;
+ static int m = 0;
+ static int o = 0;
static unsigned long dmxGeneration = 0;
+
#define LEN 32
- char * buf = malloc(LEN);
+ char *buf = malloc(LEN);
if (dmxGeneration != serverGeneration) {
- k = m = o = 0;
+ k = m = o = 0;
dmxGeneration = serverGeneration;
}
switch (dmxLocal->type) {
- case DMX_LOCAL_KEYBOARD: snprintf(buf, LEN, "Keyboard%d", k++); break;
- case DMX_LOCAL_MOUSE: snprintf(buf, LEN, "Mouse%d", m++); break;
- default: snprintf(buf, LEN, "Other%d", o++); break;
+ case DMX_LOCAL_KEYBOARD:
+ snprintf(buf, LEN, "Keyboard%d", k++);
+ break;
+ case DMX_LOCAL_MOUSE:
+ snprintf(buf, LEN, "Mouse%d", m++);
+ break;
+ default:
+ snprintf(buf, LEN, "Other%d", o++);
+ break;
}
return buf;
}
-static DeviceIntPtr dmxAddDevice(DMXLocalInputInfoPtr dmxLocal)
+static DeviceIntPtr
+dmxAddDevice(DMXLocalInputInfoPtr dmxLocal)
{
DeviceIntPtr pDevice;
- Atom atom;
- const char *name = NULL;
- char *devname;
+ Atom atom;
+ const char *name = NULL;
+ char *devname;
DMXInputInfo *dmxInput;
if (!dmxLocal)
@@ -693,41 +734,41 @@ static DeviceIntPtr dmxAddDevice(DMXLocalInputInfoPtr dmxLocal)
if (dmxLocal->sendsCore) {
if (dmxLocal->type == DMX_LOCAL_KEYBOARD && !dmxLocalCoreKeyboard) {
- dmxLocal->isCore = 1;
+ dmxLocal->isCore = 1;
dmxLocalCoreKeyboard = dmxLocal;
- name = "keyboard";
+ name = "keyboard";
}
if (dmxLocal->type == DMX_LOCAL_MOUSE && !dmxLocalCorePointer) {
- dmxLocal->isCore = 1;
- dmxLocalCorePointer = dmxLocal;
- name = "pointer";
+ dmxLocal->isCore = 1;
+ dmxLocalCorePointer = dmxLocal;
+ name = "pointer";
}
}
if (!name) {
- name = "extension";
+ name = "extension";
}
if (!name)
dmxLog(dmxFatal, "Cannot add device %s\n", dmxLocal->name);
- pDevice = AddInputDevice(serverClient, dmxDeviceOnOff, TRUE);
+ pDevice = AddInputDevice(serverClient, dmxDeviceOnOff, TRUE);
if (!pDevice) {
dmxLog(dmxError, "Too many devices -- cannot add device %s\n",
dmxLocal->name);
return NULL;
}
pDevice->public.devicePrivate = dmxLocal;
- dmxLocal->pDevice = pDevice;
+ dmxLocal->pDevice = pDevice;
- devname = dmxMakeUniqueDeviceName(dmxLocal);
- atom = MakeAtom((char *)devname, strlen(devname), TRUE);
+ devname = dmxMakeUniqueDeviceName(dmxLocal);
+ atom = MakeAtom((char *) devname, strlen(devname), TRUE);
pDevice->type = atom;
pDevice->name = devname;
if (dmxLocal->isCore && dmxLocal->type == DMX_LOCAL_MOUSE) {
-#if 00 /*BP*/
- miRegisterPointerDevice(screenInfo.screens[0], pDevice);
+#if 00 /*BP*/
+ miRegisterPointerDevice(screenInfo.screens[0], pDevice);
#else
/* Nothing? dmxDeviceOnOff() should get called to init, right? */
#endif
@@ -740,60 +781,62 @@ static DeviceIntPtr dmxAddDevice(DMXLocalInputInfoPtr dmxLocal)
dmxLocal->name, name, devname,
dmxLocal->isCore
? " [core]"
- : (dmxLocal->sendsCore
- ? " [sends core events]"
- : ""));
+ : (dmxLocal->sendsCore ? " [sends core events]" : ""));
return pDevice;
}
-static DMXLocalInputInfoPtr dmxLookupLocal(const char *name)
+static DMXLocalInputInfoPtr
+dmxLookupLocal(const char *name)
{
DMXLocalInputInfoPtr pt;
-
+
for (pt = &DMXLocalDevices[0]; pt->name; ++pt)
- if (!strcmp(pt->name, name)) return pt; /* search for device name */
+ if (!strcmp(pt->name, name))
+ return pt; /* search for device name */
return NULL;
}
/** Copy the local input information from \a s into a new \a devs slot
* in \a dmxInput. */
-DMXLocalInputInfoPtr dmxInputCopyLocal(DMXInputInfo *dmxInput,
- DMXLocalInputInfoPtr s)
+DMXLocalInputInfoPtr
+dmxInputCopyLocal(DMXInputInfo * dmxInput, DMXLocalInputInfoPtr s)
{
DMXLocalInputInfoPtr dmxLocal = malloc(sizeof(*dmxLocal));
-
+
if (!dmxLocal)
dmxLog(dmxFatal, "DMXLocalInputInfoPtr: out of memory\n");
memcpy(dmxLocal, s, sizeof(*dmxLocal));
- dmxLocal->inputIdx = dmxInput->inputIdx;
- dmxLocal->sendsCore = dmxInput->core;
+ dmxLocal->inputIdx = dmxInput->inputIdx;
+ dmxLocal->sendsCore = dmxInput->core;
dmxLocal->savedSendsCore = dmxInput->core;
- dmxLocal->deviceId = -1;
+ dmxLocal->deviceId = -1;
++dmxInput->numDevs;
dmxInput->devs = realloc(dmxInput->devs,
- dmxInput->numDevs * sizeof(*dmxInput->devs));
- dmxInput->devs[dmxInput->numDevs-1] = dmxLocal;
-
+ dmxInput->numDevs * sizeof(*dmxInput->devs));
+ dmxInput->devs[dmxInput->numDevs - 1] = dmxLocal;
+
return dmxLocal;
}
-static void dmxPopulateLocal(DMXInputInfo *dmxInput, dmxArg a)
+static void
+dmxPopulateLocal(DMXInputInfo * dmxInput, dmxArg a)
{
- int i;
- int help = 0;
+ int i;
+ int help = 0;
DMXLocalInputInfoRec *pt;
for (i = 1; i < dmxArgC(a); i++) {
const char *name = dmxArgV(a, i);
+
if ((pt = dmxLookupLocal(name))) {
dmxInputCopyLocal(dmxInput, pt);
- } else {
+ }
+ else {
if (strlen(name))
- dmxLog(dmxWarning,
- "Could not find a driver called %s\n", name);
+ dmxLog(dmxWarning, "Could not find a driver called %s\n", name);
++help;
}
}
@@ -801,10 +844,17 @@ static void dmxPopulateLocal(DMXInputInfo *dmxInput, dmxArg a)
dmxLog(dmxInfo, "Available local device drivers:\n");
for (pt = &DMXLocalDevices[0]; pt->name; ++pt) {
const char *type;
+
switch (pt->type) {
- case DMX_LOCAL_KEYBOARD: type = "keyboard"; break;
- case DMX_LOCAL_MOUSE: type = "pointer"; break;
- default: type = "unknown"; break;
+ case DMX_LOCAL_KEYBOARD:
+ type = "keyboard";
+ break;
+ case DMX_LOCAL_MOUSE:
+ type = "pointer";
+ break;
+ default:
+ type = "unknown";
+ break;
}
dmxLog(dmxInfo, " %s (%s)\n", pt->name, type);
}
@@ -812,30 +862,35 @@ static void dmxPopulateLocal(DMXInputInfo *dmxInput, dmxArg a)
}
}
-int dmxInputExtensionErrorHandler(Display *dsp, _Xconst char *name, _Xconst char *reason)
+int
+dmxInputExtensionErrorHandler(Display * dsp, _Xconst char *name,
+ _Xconst char *reason)
{
return 0;
}
-static void dmxInputScanForExtensions(DMXInputInfo *dmxInput, int doXI)
+static void
+dmxInputScanForExtensions(DMXInputInfo * dmxInput, int doXI)
{
- XExtensionVersion *ext;
- XDeviceInfo *devices;
- Display *display;
- int num;
- int i, j;
- XextErrorHandler handler;
-
- if (!(display = XOpenDisplay(dmxInput->name))) return;
-
+ XExtensionVersion *ext;
+ XDeviceInfo *devices;
+ Display *display;
+ int num;
+ int i, j;
+ XextErrorHandler handler;
+
+ if (!(display = XOpenDisplay(dmxInput->name)))
+ return;
+
/* Print out information about the XInput Extension. */
handler = XSetExtensionErrorHandler(dmxInputExtensionErrorHandler);
- ext = XGetExtensionVersion(display, INAME);
+ ext = XGetExtensionVersion(display, INAME);
XSetExtensionErrorHandler(handler);
-
- if (!ext || ext == (XExtensionVersion *)NoSuchExtension) {
+
+ if (!ext || ext == (XExtensionVersion *) NoSuchExtension) {
dmxLogInput(dmxInput, "%s is not available\n", INAME);
- } else {
+ }
+ else {
dmxLogInput(dmxInput, "Locating devices on %s (%s version %d.%d)\n",
dmxInput->name, INAME,
ext->major_version, ext->minor_version);
@@ -844,31 +899,41 @@ static void dmxInputScanForExtensions(DMXInputInfo *dmxInput, int doXI)
XFree(ext);
ext = NULL;
- /* Print a list of all devices */
+ /* Print a list of all devices */
for (i = 0; i < num; i++) {
const char *use = "Unknown";
+
switch (devices[i].use) {
- case IsXPointer: use = "XPointer"; break;
- case IsXKeyboard: use = "XKeyboard"; break;
- case IsXExtensionDevice: use = "XExtensionDevice"; break;
- case IsXExtensionPointer: use = "XExtensionPointer"; break;
- case IsXExtensionKeyboard: use = "XExtensionKeyboard"; break;
+ case IsXPointer:
+ use = "XPointer";
+ break;
+ case IsXKeyboard:
+ use = "XKeyboard";
+ break;
+ case IsXExtensionDevice:
+ use = "XExtensionDevice";
+ break;
+ case IsXExtensionPointer:
+ use = "XExtensionPointer";
+ break;
+ case IsXExtensionKeyboard:
+ use = "XExtensionKeyboard";
+ break;
}
dmxLogInput(dmxInput, " %2d %-10.10s %-16.16s\n",
devices[i].id,
- devices[i].name ? devices[i].name : "",
- use);
+ devices[i].name ? devices[i].name : "", use);
}
- /* Search for extensions */
+ /* Search for extensions */
for (i = 0; i < num; i++) {
switch (devices[i].use) {
case IsXKeyboard:
for (j = 0; j < dmxInput->numDevs; j++) {
DMXLocalInputInfoPtr dmxL = dmxInput->devs[j];
- if (dmxL->type == DMX_LOCAL_KEYBOARD
- && dmxL->deviceId < 0) {
- dmxL->deviceId = devices[i].id;
+
+ if (dmxL->type == DMX_LOCAL_KEYBOARD && dmxL->deviceId < 0) {
+ dmxL->deviceId = devices[i].id;
dmxL->deviceName = (devices[i].name
? strdup(devices[i].name)
: NULL);
@@ -878,8 +943,9 @@ static void dmxInputScanForExtensions(DMXInputInfo *dmxInput, int doXI)
case IsXPointer:
for (j = 0; j < dmxInput->numDevs; j++) {
DMXLocalInputInfoPtr dmxL = dmxInput->devs[j];
+
if (dmxL->type == DMX_LOCAL_MOUSE && dmxL->deviceId < 0) {
- dmxL->deviceId = devices[i].id;
+ dmxL->deviceId = devices[i].id;
dmxL->deviceName = (devices[i].name
? xstrdup(devices[i].name)
: NULL);
@@ -895,12 +961,14 @@ static void dmxInputScanForExtensions(DMXInputInfo *dmxInput, int doXI)
/** Re-initialize all the devices described in \a dmxInput. Called from
#dmxAdjustCursorBoundaries before the cursor is redisplayed. */
-void dmxInputReInit(DMXInputInfo *dmxInput)
+void
+dmxInputReInit(DMXInputInfo * dmxInput)
{
int i;
for (i = 0; i < dmxInput->numDevs; i++) {
DMXLocalInputInfoPtr dmxLocal = dmxInput->devs[i];
+
if (dmxLocal->reinit)
dmxLocal->reinit(&dmxLocal->pDevice->public);
}
@@ -908,28 +976,31 @@ void dmxInputReInit(DMXInputInfo *dmxInput)
/** Re-initialize all the devices described in \a dmxInput. Called from
#dmxAdjustCursorBoundaries after the cursor is redisplayed. */
-void dmxInputLateReInit(DMXInputInfo *dmxInput)
+void
+dmxInputLateReInit(DMXInputInfo * dmxInput)
{
int i;
for (i = 0; i < dmxInput->numDevs; i++) {
DMXLocalInputInfoPtr dmxLocal = dmxInput->devs[i];
+
if (dmxLocal->latereinit)
dmxLocal->latereinit(&dmxLocal->pDevice->public);
}
}
/** Initialize all of the devices described in \a dmxInput. */
-void dmxInputInit(DMXInputInfo *dmxInput)
+void
+dmxInputInit(DMXInputInfo * dmxInput)
{
- DeviceIntPtr pPointer = NULL, pKeyboard = NULL;
- dmxArg a;
- const char *name;
- int i;
- int doXI = 1; /* Include by default */
- int forceConsole = 0;
- int doWindows = 1; /* On by default */
- int hasXkb = 0;
+ DeviceIntPtr pPointer = NULL, pKeyboard = NULL;
+ dmxArg a;
+ const char *name;
+ int i;
+ int doXI = 1; /* Include by default */
+ int forceConsole = 0;
+ int doWindows = 1; /* On by default */
+ int hasXkb = 0;
a = dmxArgParse(dmxInput->name);
@@ -940,7 +1011,7 @@ void dmxInputInit(DMXInputInfo *dmxInput)
++hasXkb;
break;
case 2:
- dmxInput->symbols = xstrdup(dmxArgV(a, i));
+ dmxInput->symbols = xstrdup(dmxArgV(a, i));
++hasXkb;
break;
case 3:
@@ -948,16 +1019,22 @@ void dmxInputInit(DMXInputInfo *dmxInput)
hasXkb = 0;
break;
case 0:
- if (!strcmp(dmxArgV(a, i), "noxi")) doXI = 0;
- else if (!strcmp(dmxArgV(a, i), "xi")) doXI = 1;
- else if (!strcmp(dmxArgV(a, i), "console")) forceConsole = 1;
- else if (!strcmp(dmxArgV(a, i), "noconsole")) forceConsole = 0;
- else if (!strcmp(dmxArgV(a, i), "windows")) doWindows = 1;
- else if (!strcmp(dmxArgV(a, i), "nowindows")) doWindows = 0;
- else if (!strcmp(dmxArgV(a, i), "xkb")) hasXkb = 1;
+ if (!strcmp(dmxArgV(a, i), "noxi"))
+ doXI = 0;
+ else if (!strcmp(dmxArgV(a, i), "xi"))
+ doXI = 1;
+ else if (!strcmp(dmxArgV(a, i), "console"))
+ forceConsole = 1;
+ else if (!strcmp(dmxArgV(a, i), "noconsole"))
+ forceConsole = 0;
+ else if (!strcmp(dmxArgV(a, i), "windows"))
+ doWindows = 1;
+ else if (!strcmp(dmxArgV(a, i), "nowindows"))
+ doWindows = 0;
+ else if (!strcmp(dmxArgV(a, i), "xkb"))
+ hasXkb = 1;
else {
- dmxLog(dmxFatal,
- "Unknown input argument: %s\n", dmxArgV(a, i));
+ dmxLog(dmxFatal, "Unknown input argument: %s\n", dmxArgV(a, i));
}
}
}
@@ -966,11 +1043,13 @@ void dmxInputInit(DMXInputInfo *dmxInput)
if (!strcmp(name, "local")) {
dmxPopulateLocal(dmxInput, a);
- } else if (!strcmp(name, "dummy")) {
+ }
+ else if (!strcmp(name, "dummy")) {
dmxInputCopyLocal(dmxInput, &DMXDummyMou);
dmxInputCopyLocal(dmxInput, &DMXDummyKbd);
dmxLogInput(dmxInput, "Using dummy input\n");
- } else {
+ }
+ else {
int found;
for (found = 0, i = 0; i < dmxNumScreens; i++) {
@@ -983,10 +1062,13 @@ void dmxInputInit(DMXInputInfo *dmxInput)
dmxLog(dmxWarning,
"Cannot use core devices on a backend (%s)"
" as XInput devices\n", name);
- } else {
+ }
+ else {
char *pt;
- for (pt = (char *)dmxInput->name; pt && *pt; pt++)
- if (*pt == ',') *pt = '\0';
+
+ for (pt = (char *) dmxInput->name; pt && *pt; pt++)
+ if (*pt == ',')
+ *pt = '\0';
dmxInputCopyLocal(dmxInput, &DMXBackendMou);
dmxInputCopyLocal(dmxInput, &DMXBackendKbd);
dmxInput->scrnIdx = i;
@@ -999,13 +1081,16 @@ void dmxInputInit(DMXInputInfo *dmxInput)
}
if (!found || forceConsole) {
char *pt;
- if (found) dmxInput->console = TRUE;
- for (pt = (char *)dmxInput->name; pt && *pt; pt++)
- if (*pt == ',') *pt = '\0';
+
+ if (found)
+ dmxInput->console = TRUE;
+ for (pt = (char *) dmxInput->name; pt && *pt; pt++)
+ if (*pt == ',')
+ *pt = '\0';
dmxInputCopyLocal(dmxInput, &DMXConsoleMou);
dmxInputCopyLocal(dmxInput, &DMXConsoleKbd);
if (doWindows) {
- dmxInput->windows = TRUE;
+ dmxInput->windows = TRUE;
dmxInput->updateWindowInfo = dmxUpdateWindowInformation;
}
dmxLogInput(dmxInput,
@@ -1016,50 +1101,56 @@ void dmxInputInit(DMXInputInfo *dmxInput)
dmxArgFree(a);
- /* Locate extensions we may be interested in */
+ /* Locate extensions we may be interested in */
dmxInputScanForExtensions(dmxInput, doXI);
-
+
for (i = 0; i < dmxInput->numDevs; i++) {
DMXLocalInputInfoPtr dmxLocal = dmxInput->devs[i];
+
dmxLocal->pDevice = dmxAddDevice(dmxLocal);
if (dmxLocal->isCore) {
if (dmxLocal->type == DMX_LOCAL_MOUSE)
- pPointer = dmxLocal->pDevice;
+ pPointer = dmxLocal->pDevice;
if (dmxLocal->type == DMX_LOCAL_KEYBOARD)
pKeyboard = dmxLocal->pDevice;
}
}
-
- dmxInput->processInputEvents = dmxProcessInputEvents;
- dmxInput->detached = False;
-
+
+ dmxInput->processInputEvents = dmxProcessInputEvents;
+ dmxInput->detached = False;
+
RegisterBlockAndWakeupHandlers(dmxBlockHandler, dmxWakeupHandler,
- (void *)(uintptr_t)dmxInput->inputIdx);
+ (void *) (uintptr_t) dmxInput->inputIdx);
}
-static void dmxInputFreeLocal(DMXLocalInputInfoRec *local)
+static void
+dmxInputFreeLocal(DMXLocalInputInfoRec * local)
{
- if (!local) return;
+ if (!local)
+ return;
if (local->isCore && local->type == DMX_LOCAL_MOUSE)
- dmxLocalCorePointer = NULL;
+ dmxLocalCorePointer = NULL;
if (local->isCore && local->type == DMX_LOCAL_KEYBOARD)
dmxLocalCoreKeyboard = NULL;
- if (local->destroy_private) local->destroy_private(local->private);
+ if (local->destroy_private)
+ local->destroy_private(local->private);
free(local->history);
free(local->valuators);
free(local->deviceName);
- local->private = NULL;
- local->history = NULL;
+ local->private = NULL;
+ local->history = NULL;
local->deviceName = NULL;
free(local);
}
/** Free all of the memory associated with \a dmxInput */
-void dmxInputFree(DMXInputInfo *dmxInput)
+void
+dmxInputFree(DMXInputInfo * dmxInput)
{
int i;
-
- if (!dmxInput) return;
+
+ if (!dmxInput)
+ return;
free(dmxInput->keycodes);
free(dmxInput->symbols);
@@ -1070,14 +1161,16 @@ void dmxInputFree(DMXInputInfo *dmxInput)
dmxInput->devs[i] = NULL;
}
free(dmxInput->devs);
- dmxInput->devs = NULL;
+ dmxInput->devs = NULL;
dmxInput->numDevs = 0;
- if (dmxInput->freename) free(dmxInput->name);
- dmxInput->name = NULL;
+ if (dmxInput->freename)
+ free(dmxInput->name);
+ dmxInput->name = NULL;
}
/** Log information about all of the known devices using #dmxLog(). */
-void dmxInputLogDevices(void)
+void
+dmxInputLogDevices(void)
{
int i, j;
@@ -1085,34 +1178,43 @@ void dmxInputLogDevices(void)
dmxLog(dmxInfo, " Id Name Classes\n");
for (j = 0; j < dmxNumInputs; j++) {
DMXInputInfo *dmxInput = &dmxInputs[j];
- const char *pt = strchr(dmxInput->name, ',');
- int len = (pt
- ? (size_t)(pt-dmxInput->name)
- : strlen(dmxInput->name));
+ const char *pt = strchr(dmxInput->name, ',');
+ int len = (pt ? (size_t) (pt - dmxInput->name)
+ : strlen(dmxInput->name));
for (i = 0; i < dmxInput->numDevs; i++) {
DeviceIntPtr pDevice = dmxInput->devs[i]->pDevice;
+
if (pDevice) {
dmxLog(dmxInfo, " %2d%c %-20.20s",
pDevice->id,
- dmxInput->detached ? 'D' : ' ',
- pDevice->name);
- if (pDevice->key) dmxLogCont(dmxInfo, " key");
- if (pDevice->valuator) dmxLogCont(dmxInfo, " val");
- if (pDevice->button) dmxLogCont(dmxInfo, " btn");
- if (pDevice->focus) dmxLogCont(dmxInfo, " foc");
- if (pDevice->kbdfeed) dmxLogCont(dmxInfo, " fb/kbd");
- if (pDevice->ptrfeed) dmxLogCont(dmxInfo, " fb/ptr");
- if (pDevice->intfeed) dmxLogCont(dmxInfo, " fb/int");
- if (pDevice->stringfeed) dmxLogCont(dmxInfo, " fb/str");
- if (pDevice->bell) dmxLogCont(dmxInfo, " fb/bel");
- if (pDevice->leds) dmxLogCont(dmxInfo, " fb/led");
+ dmxInput->detached ? 'D' : ' ', pDevice->name);
+ if (pDevice->key)
+ dmxLogCont(dmxInfo, " key");
+ if (pDevice->valuator)
+ dmxLogCont(dmxInfo, " val");
+ if (pDevice->button)
+ dmxLogCont(dmxInfo, " btn");
+ if (pDevice->focus)
+ dmxLogCont(dmxInfo, " foc");
+ if (pDevice->kbdfeed)
+ dmxLogCont(dmxInfo, " fb/kbd");
+ if (pDevice->ptrfeed)
+ dmxLogCont(dmxInfo, " fb/ptr");
+ if (pDevice->intfeed)
+ dmxLogCont(dmxInfo, " fb/int");
+ if (pDevice->stringfeed)
+ dmxLogCont(dmxInfo, " fb/str");
+ if (pDevice->bell)
+ dmxLogCont(dmxInfo, " fb/bel");
+ if (pDevice->leds)
+ dmxLogCont(dmxInfo, " fb/led");
if (!pDevice->key && !pDevice->valuator && !pDevice->button
&& !pDevice->focus && !pDevice->kbdfeed
&& !pDevice->ptrfeed && !pDevice->intfeed
- && !pDevice->stringfeed && !pDevice->bell
- && !pDevice->leds) dmxLogCont(dmxInfo, " (none)");
-
+ && !pDevice->stringfeed && !pDevice->bell && !pDevice->leds)
+ dmxLogCont(dmxInfo, " (none)");
+
dmxLogCont(dmxInfo, "\t[i%d/%*.*s",
dmxInput->inputIdx, len, len, dmxInput->name);
if (dmxInput->devs[i]->deviceId >= 0)
@@ -1123,30 +1225,30 @@ void dmxInputLogDevices(void)
dmxInput->devs[i]->isCore
? "core"
: (dmxInput->devs[i]->sendsCore
- ? "extension (sends core events)"
- : "extension"));
+ ? "extension (sends core events)" : "extension"));
}
}
}
}
/** Detach an input */
-int dmxInputDetach(DMXInputInfo *dmxInput)
+int
+dmxInputDetach(DMXInputInfo * dmxInput)
{
int i;
- if (dmxInput->detached) return BadAccess;
-
+ if (dmxInput->detached)
+ return BadAccess;
+
for (i = 0; i < dmxInput->numDevs; i++) {
DMXLocalInputInfoPtr dmxLocal = dmxInput->devs[i];
+
dmxLogInput(dmxInput, "Detaching device id %d: %s%s\n",
dmxLocal->pDevice->id,
dmxLocal->pDevice->name,
dmxLocal->isCore
? " [core]"
- : (dmxLocal->sendsCore
- ? " [sends core events]"
- : ""));
+ : (dmxLocal->sendsCore ? " [sends core events]" : ""));
DisableDevice(dmxLocal->pDevice, TRUE);
}
dmxInput->detached = True;
@@ -1155,116 +1257,133 @@ int dmxInputDetach(DMXInputInfo *dmxInput)
}
/** Search for input associated with \a dmxScreen, and detach. */
-void dmxInputDetachAll(DMXScreenInfo *dmxScreen)
+void
+dmxInputDetachAll(DMXScreenInfo * dmxScreen)
{
int i;
for (i = 0; i < dmxNumInputs; i++) {
DMXInputInfo *dmxInput = &dmxInputs[i];
- if (dmxInput->scrnIdx == dmxScreen->index) dmxInputDetach(dmxInput);
+
+ if (dmxInput->scrnIdx == dmxScreen->index)
+ dmxInputDetach(dmxInput);
}
}
/** Search for input associated with \a deviceId, and detach. */
-int dmxInputDetachId(int id)
+int
+dmxInputDetachId(int id)
{
DMXInputInfo *dmxInput = dmxInputLocateId(id);
- if (!dmxInput) return BadValue;
-
+ if (!dmxInput)
+ return BadValue;
+
return dmxInputDetach(dmxInput);
}
-DMXInputInfo *dmxInputLocateId(int id)
+DMXInputInfo *
+dmxInputLocateId(int id)
{
int i, j;
-
+
for (i = 0; i < dmxNumInputs; i++) {
DMXInputInfo *dmxInput = &dmxInputs[i];
+
for (j = 0; j < dmxInput->numDevs; j++) {
DMXLocalInputInfoPtr dmxLocal = dmxInput->devs[j];
- if (dmxLocal->pDevice->id == id) return dmxInput;
+
+ if (dmxLocal->pDevice->id == id)
+ return dmxInput;
}
}
return NULL;
}
-static int dmxInputAttachNew(DMXInputInfo *dmxInput, int *id)
+static int
+dmxInputAttachNew(DMXInputInfo * dmxInput, int *id)
{
dmxInputInit(dmxInput);
InitAndStartDevices();
- if (id && dmxInput->devs) *id = dmxInput->devs[0]->pDevice->id;
+ if (id && dmxInput->devs)
+ *id = dmxInput->devs[0]->pDevice->id;
dmxInputLogDevices();
return 0;
}
-static int dmxInputAttachOld(DMXInputInfo *dmxInput, int *id)
+static int
+dmxInputAttachOld(DMXInputInfo * dmxInput, int *id)
{
int i;
-
+
dmxInput->detached = False;
for (i = 0; i < dmxInput->numDevs; i++) {
DMXLocalInputInfoPtr dmxLocal = dmxInput->devs[i];
- if (id) *id = dmxLocal->pDevice->id;
+
+ if (id)
+ *id = dmxLocal->pDevice->id;
dmxLogInput(dmxInput,
"Attaching device id %d: %s%s\n",
dmxLocal->pDevice->id,
dmxLocal->pDevice->name,
dmxLocal->isCore
? " [core]"
- : (dmxLocal->sendsCore
- ? " [sends core events]"
- : ""));
+ : (dmxLocal->sendsCore ? " [sends core events]" : ""));
EnableDevice(dmxLocal->pDevice, TRUE);
}
dmxInputLogDevices();
return 0;
}
-int dmxInputAttachConsole(const char *name, int isCore, int *id)
+int
+dmxInputAttachConsole(const char *name, int isCore, int *id)
{
- DMXInputInfo *dmxInput;
- int i;
+ DMXInputInfo *dmxInput;
+ int i;
for (i = 0; i < dmxNumInputs; i++) {
dmxInput = &dmxInputs[i];
if (dmxInput->scrnIdx == -1
- && dmxInput->detached
- && !strcmp(dmxInput->name, name)) {
- /* Found match */
+ && dmxInput->detached && !strcmp(dmxInput->name, name)) {
+ /* Found match */
dmxLogInput(dmxInput, "Reattaching detached console input\n");
return dmxInputAttachOld(dmxInput, id);
}
}
- /* No match found */
+ /* No match found */
dmxInput = dmxConfigAddInput(xstrdup(name), isCore);
dmxInput->freename = TRUE;
dmxLogInput(dmxInput, "Attaching new console input\n");
return dmxInputAttachNew(dmxInput, id);
}
-int dmxInputAttachBackend(int physicalScreen, int isCore, int *id)
+int
+dmxInputAttachBackend(int physicalScreen, int isCore, int *id)
{
- DMXInputInfo *dmxInput;
+ DMXInputInfo *dmxInput;
DMXScreenInfo *dmxScreen;
- int i;
-
- if (physicalScreen < 0 || physicalScreen >= dmxNumScreens) return BadValue;
+ int i;
+
+ if (physicalScreen < 0 || physicalScreen >= dmxNumScreens)
+ return BadValue;
for (i = 0; i < dmxNumInputs; i++) {
dmxInput = &dmxInputs[i];
if (dmxInput->scrnIdx != -1 && dmxInput->scrnIdx == physicalScreen) {
- /* Found match */
- if (!dmxInput->detached) return BadAccess; /* Already attached */
+ /* Found match */
+ if (!dmxInput->detached)
+ return BadAccess; /* Already attached */
dmxScreen = &dmxScreens[physicalScreen];
- if (!dmxScreen->beDisplay) return BadAccess; /* Screen detached */
+ if (!dmxScreen->beDisplay)
+ return BadAccess; /* Screen detached */
dmxLogInput(dmxInput, "Reattaching detached backend input\n");
return dmxInputAttachOld(dmxInput, id);
}
}
- /* No match found */
+ /* No match found */
dmxScreen = &dmxScreens[physicalScreen];
- if (!dmxScreen->beDisplay) return BadAccess; /* Screen detached */
+ if (!dmxScreen->beDisplay)
+ return BadAccess; /* Screen detached */
dmxInput = dmxConfigAddInput(dmxScreen->name, isCore);
dmxLogInput(dmxInput, "Attaching new backend input\n");
return dmxInputAttachNew(dmxInput, id);
diff --git a/hw/dmx/input/dmxinputinit.h b/hw/dmx/input/dmxinputinit.h
index 5a4a4106c..94ec1019b 100644
--- a/hw/dmx/input/dmxinputinit.h
+++ b/hw/dmx/input/dmxinputinit.h
@@ -41,7 +41,6 @@
#include "dmxinput.h"
#include "dmxlog.h"
-
#define DMX_LOCAL_DEFAULT_KEYBOARD "kbd"
#define DMX_LOCAL_DEFAULT_POINTER "ps2"
#define DMX_MAX_BUTTONS 256
@@ -49,7 +48,7 @@
#define DMX_MAX_VALUATORS 32
#define DMX_MAX_AXES 32
#define DMX_MAX_XINPUT_EVENT_TYPES 100
-#define DMX_MAP_ENTRIES 16 /* Must be a power of 2 */
+#define DMX_MAP_ENTRIES 16 /* Must be a power of 2 */
#define DMX_MAP_MASK (DMX_MAP_ENTRIES - 1)
typedef enum {
@@ -81,93 +80,91 @@ typedef enum {
/** Stores information from low-level device that is used to initialize
* the device at the dix level. */
typedef struct _DMXLocalInitInfo {
- int keyboard; /**< Non-zero if the device is a keyboard */
-
- int keyClass; /**< Non-zero if keys are present */
- KeySymsRec keySyms; /**< Key symbols */
- int freemap; /**< If non-zero, free keySyms.map */
- CARD8 modMap[MAP_LENGTH]; /**< Modifier map */
- XkbDescPtr xkb; /**< XKB description */
+ int keyboard; /**< Non-zero if the device is a keyboard */
+
+ int keyClass; /**< Non-zero if keys are present */
+ KeySymsRec keySyms; /**< Key symbols */
+ int freemap; /**< If non-zero, free keySyms.map */
+ CARD8 modMap[MAP_LENGTH]; /**< Modifier map */
+ XkbDescPtr xkb; /**< XKB description */
XkbComponentNamesRec names; /**< XKB component names */
- int freenames; /**< Non-zero if names should be free'd */
- int force; /**< Do not allow command line override */
+ int freenames; /**< Non-zero if names should be free'd */
+ int force; /**< Do not allow command line override */
- int buttonClass; /**< Non-zero if buttons are present */
- int numButtons; /**< Number of buttons */
- unsigned char map[DMX_MAX_BUTTONS]; /**< Button map */
+ int buttonClass; /**< Non-zero if buttons are present */
+ int numButtons; /**< Number of buttons */
+ unsigned char map[DMX_MAX_BUTTONS]; /**< Button map */
- int valuatorClass; /**< Non-zero if valuators are
+ int valuatorClass; /**< Non-zero if valuators are
* present */
- int numRelAxes; /**< Number of relative axes */
- int numAbsAxes; /**< Number of absolute axes */
- int minval[DMX_MAX_AXES]; /**< Minimum values */
- int maxval[DMX_MAX_AXES]; /**< Maximum values */
- int res[DMX_MAX_AXES]; /**< Resolution */
- int minres[DMX_MAX_AXES]; /**< Minimum resolutions */
- int maxres[DMX_MAX_AXES]; /**< Maximum resolutions */
-
- int focusClass; /**< Non-zero if device can
+ int numRelAxes; /**< Number of relative axes */
+ int numAbsAxes; /**< Number of absolute axes */
+ int minval[DMX_MAX_AXES]; /**< Minimum values */
+ int maxval[DMX_MAX_AXES]; /**< Maximum values */
+ int res[DMX_MAX_AXES]; /**< Resolution */
+ int minres[DMX_MAX_AXES]; /**< Minimum resolutions */
+ int maxres[DMX_MAX_AXES]; /**< Maximum resolutions */
+
+ int focusClass; /**< Non-zero if device can
* cause focus */
- int proximityClass; /**< Non-zero if device
+ int proximityClass; /**< Non-zero if device
* causes proximity events */
- int kbdFeedbackClass; /**< Non-zero if device has
- * keyboard feedback */
- int ptrFeedbackClass; /**< Non-zero if device has
+ int kbdFeedbackClass; /**< Non-zero if device has
+ * keyboard feedback */
+ int ptrFeedbackClass; /**< Non-zero if device has
* pointer feedback */
- int ledFeedbackClass; /**< Non-zero if device has
+ int ledFeedbackClass; /**< Non-zero if device has
* LED indicators */
- int belFeedbackClass; /**< Non-zero if device has a
- * bell */
- int intFeedbackClass; /**< Non-zero if device has
+ int belFeedbackClass; /**< Non-zero if device has a
+ * bell */
+ int intFeedbackClass; /**< Non-zero if device has
* integer feedback */
- int strFeedbackClass; /**< Non-zero if device has
+ int strFeedbackClass; /**< Non-zero if device has
* string feedback */
- int maxSymbols; /**< Maximum symbols */
- int maxSymbolsSupported; /**< Maximum symbols supported */
- KeySym *symbols; /**< Key symbols */
+ int maxSymbols; /**< Maximum symbols */
+ int maxSymbolsSupported; /**< Maximum symbols supported */
+ KeySym *symbols; /**< Key symbols */
} DMXLocalInitInfo, *DMXLocalInitInfoPtr;
-typedef pointer (*dmxCreatePrivateProcPtr)(DeviceIntPtr);
-typedef void (*dmxDestroyPrivateProcPtr)(pointer);
-
-typedef void (*dmxInitProcPtr)(DevicePtr);
-typedef void (*dmxReInitProcPtr)(DevicePtr);
-typedef void (*dmxLateReInitProcPtr)(DevicePtr);
-typedef void (*dmxGetInfoProcPtr)(DevicePtr, DMXLocalInitInfoPtr);
-typedef int (*dmxOnProcPtr)(DevicePtr);
-typedef void (*dmxOffProcPtr)(DevicePtr);
-typedef void (*dmxUpdatePositionProcPtr)(pointer, int x, int y);
-
-typedef void (*dmxVTPreSwitchProcPtr)(pointer); /* Turn I/O Off */
-typedef void (*dmxVTPostSwitchProcPtr)(pointer); /* Turn I/O On */
-typedef void (*dmxVTSwitchReturnProcPtr)(pointer);
-typedef int (*dmxVTSwitchProcPtr)(pointer, int vt,
- dmxVTSwitchReturnProcPtr, pointer);
-
-typedef void (*dmxMotionProcPtr)(DevicePtr,
- int *valuators,
- int firstAxis,
- int axesCount,
- DMXMotionType type,
- DMXBlockType block);
-typedef void (*dmxEnqueueProcPtr)(DevicePtr, int type, int detail,
- KeySym keySym, XEvent *e,
- DMXBlockType block);
-typedef int (*dmxCheckSpecialProcPtr)(DevicePtr, KeySym keySym);
-typedef void (*dmxCollectEventsProcPtr)(DevicePtr,
- dmxMotionProcPtr,
- dmxEnqueueProcPtr,
- dmxCheckSpecialProcPtr,
- DMXBlockType);
-typedef void (*dmxProcessInputProcPtr)(pointer);
-typedef void (*dmxUpdateInfoProcPtr)(pointer, DMXUpdateType, WindowPtr);
-typedef int (*dmxFunctionsProcPtr)(pointer, DMXFunctionType);
-
-typedef void (*dmxKBCtrlProcPtr)(DevicePtr, KeybdCtrl *ctrl);
-typedef void (*dmxMCtrlProcPtr)(DevicePtr, PtrCtrl *ctrl);
-typedef void (*dmxKBBellProcPtr)(DevicePtr, int percent,
- int volume, int pitch, int duration);
+typedef pointer (*dmxCreatePrivateProcPtr) (DeviceIntPtr);
+typedef void (*dmxDestroyPrivateProcPtr) (pointer);
+
+typedef void (*dmxInitProcPtr) (DevicePtr);
+typedef void (*dmxReInitProcPtr) (DevicePtr);
+typedef void (*dmxLateReInitProcPtr) (DevicePtr);
+typedef void (*dmxGetInfoProcPtr) (DevicePtr, DMXLocalInitInfoPtr);
+typedef int (*dmxOnProcPtr) (DevicePtr);
+typedef void (*dmxOffProcPtr) (DevicePtr);
+typedef void (*dmxUpdatePositionProcPtr) (pointer, int x, int y);
+
+typedef void (*dmxVTPreSwitchProcPtr) (pointer); /* Turn I/O Off */
+typedef void (*dmxVTPostSwitchProcPtr) (pointer); /* Turn I/O On */
+typedef void (*dmxVTSwitchReturnProcPtr) (pointer);
+typedef int (*dmxVTSwitchProcPtr) (pointer, int vt,
+ dmxVTSwitchReturnProcPtr, pointer);
+
+typedef void (*dmxMotionProcPtr) (DevicePtr,
+ int *valuators,
+ int firstAxis,
+ int axesCount,
+ DMXMotionType type, DMXBlockType block);
+typedef void (*dmxEnqueueProcPtr) (DevicePtr, int type, int detail,
+ KeySym keySym, XEvent * e,
+ DMXBlockType block);
+typedef int (*dmxCheckSpecialProcPtr) (DevicePtr, KeySym keySym);
+typedef void (*dmxCollectEventsProcPtr) (DevicePtr,
+ dmxMotionProcPtr,
+ dmxEnqueueProcPtr,
+ dmxCheckSpecialProcPtr, DMXBlockType);
+typedef void (*dmxProcessInputProcPtr) (pointer);
+typedef void (*dmxUpdateInfoProcPtr) (pointer, DMXUpdateType, WindowPtr);
+typedef int (*dmxFunctionsProcPtr) (pointer, DMXFunctionType);
+
+typedef void (*dmxKBCtrlProcPtr) (DevicePtr, KeybdCtrl * ctrl);
+typedef void (*dmxMCtrlProcPtr) (DevicePtr, PtrCtrl * ctrl);
+typedef void (*dmxKBBellProcPtr) (DevicePtr, int percent,
+ int volume, int pitch, int duration);
/** Stores a mapping between the device id on the remote X server and
* the id on the DMX server */
@@ -180,112 +177,108 @@ typedef struct _DMXEventMap {
* routines. The contents are not exposed to top-level .c files (except
* dmxextensions.c). \see dmxinput.h \see dmxextensions.c */
typedef struct _DMXLocalInputInfo {
- const char *name; /**< Device name */
- DMXLocalInputType type; /**< Device type */
- DMXLocalInputExtType extType; /**< Extended device type */
- int binding; /**< Count of how many consecutive
+ const char *name; /**< Device name */
+ DMXLocalInputType type; /**< Device type */
+ DMXLocalInputExtType extType; /**< Extended device type */
+ int binding; /**< Count of how many consecutive
* structs are bound to the same
* device */
-
- /* Low-level (e.g., keyboard/mouse drivers) */
- dmxCreatePrivateProcPtr create_private; /**< Create
+ /* Low-level (e.g., keyboard/mouse drivers) */
+
+ dmxCreatePrivateProcPtr create_private; /**< Create
* device-dependent
* private */
dmxDestroyPrivateProcPtr destroy_private; /**< Destroy
* device-dependent
* private */
- dmxInitProcPtr init; /**< Initialize device */
- dmxReInitProcPtr reinit; /**< Reinitialize device
+ dmxInitProcPtr init; /**< Initialize device */
+ dmxReInitProcPtr reinit; /**< Reinitialize device
* (during a
* reconfiguration) */
- dmxLateReInitProcPtr latereinit; /**< Reinitialize a device
+ dmxLateReInitProcPtr latereinit; /**< Reinitialize a device
* (called very late
* during a
* reconfiguration) */
- dmxGetInfoProcPtr get_info; /**< Get device information */
- dmxOnProcPtr on; /**< Turn device on */
- dmxOffProcPtr off; /**< Turn device off */
+ dmxGetInfoProcPtr get_info; /**< Get device information */
+ dmxOnProcPtr on; /**< Turn device on */
+ dmxOffProcPtr off; /**< Turn device off */
dmxUpdatePositionProcPtr update_position; /**< Called when another
* device updates the
* cursor position */
- dmxVTPreSwitchProcPtr vt_pre_switch; /**< Called before a VT switch */
- dmxVTPostSwitchProcPtr vt_post_switch; /**< Called after a VT switch */
- dmxVTSwitchProcPtr vt_switch; /**< Causes a VT switch */
+ dmxVTPreSwitchProcPtr vt_pre_switch; /**< Called before a VT switch */
+ dmxVTPostSwitchProcPtr vt_post_switch; /**< Called after a VT switch */
+ dmxVTSwitchProcPtr vt_switch; /**< Causes a VT switch */
- dmxCollectEventsProcPtr collect_events; /**< Collect and enqueue
+ dmxCollectEventsProcPtr collect_events; /**< Collect and enqueue
* events from the
* device*/
- dmxProcessInputProcPtr process_input; /**< Process event (from
+ dmxProcessInputProcPtr process_input; /**< Process event (from
* queue) */
- dmxFunctionsProcPtr functions;
- dmxUpdateInfoProcPtr update_info; /**< Update window layout
+ dmxFunctionsProcPtr functions;
+ dmxUpdateInfoProcPtr update_info; /**< Update window layout
* information */
- dmxMCtrlProcPtr mCtrl; /**< Pointer control */
- dmxKBCtrlProcPtr kCtrl; /**< Keyboard control */
- dmxKBBellProcPtr kBell; /**< Bell control */
+ dmxMCtrlProcPtr mCtrl; /**< Pointer control */
+ dmxKBCtrlProcPtr kCtrl; /**< Keyboard control */
+ dmxKBBellProcPtr kBell; /**< Bell control */
- pointer private; /**< Device-dependent private */
- int isCore; /**< Is a DMX core device */
- int sendsCore; /**< Sends DMX core events */
- KeybdCtrl kctrl; /**< Keyboard control */
- PtrCtrl mctrl; /**< Pointer control */
+ pointer private; /**< Device-dependent private */
+ int isCore; /**< Is a DMX core device */
+ int sendsCore; /**< Sends DMX core events */
+ KeybdCtrl kctrl; /**< Keyboard control */
+ PtrCtrl mctrl; /**< Pointer control */
- DeviceIntPtr pDevice; /**< X-level device */
- int inputIdx; /**< High-level index */
- int lastX, lastY; /**< Last known position;
+ DeviceIntPtr pDevice; /**< X-level device */
+ int inputIdx; /**< High-level index */
+ int lastX, lastY; /**< Last known position;
* for XInput in
- * dmxevents.c */
+ * dmxevents.c */
- int head; /**< XInput motion history
+ int head; /**< XInput motion history
* head */
- int tail; /**< XInput motion history
+ int tail; /**< XInput motion history
* tail */
- unsigned long *history; /**< XInput motion history */
- int *valuators; /**< Cache of previous values */
-
- /* for XInput ChangePointerDevice */
- int (*savedMotionProc)(DeviceIntPtr,
- xTimecoord *,
- unsigned long,
- unsigned long,
- ScreenPtr);
- int savedMotionEvents; /**< Saved motion events */
- int savedSendsCore; /**< Saved sends-core flag */
-
- DMXEventMap map[DMX_MAP_ENTRIES]; /**< XInput device id map */
- int mapOptimize; /**< XInput device id
+ unsigned long *history; /**< XInput motion history */
+ int *valuators; /**< Cache of previous values */
+
+ /* for XInput ChangePointerDevice */
+ int (*savedMotionProc) (DeviceIntPtr,
+ xTimecoord *,
+ unsigned long, unsigned long, ScreenPtr);
+ int savedMotionEvents; /**< Saved motion events */
+ int savedSendsCore; /**< Saved sends-core flag */
+
+ DMXEventMap map[DMX_MAP_ENTRIES]; /**< XInput device id map */
+ int mapOptimize; /**< XInput device id
* map
* optimization */
- long deviceId; /**< device id on remote side,
+ long deviceId; /**< device id on remote side,
* if any */
- const char *deviceName; /**< devive name on remote
+ const char *deviceName; /**< devive name on remote
* side, if any */
} DMXLocalInputInfoRec;
extern DMXLocalInputInfoPtr dmxLocalCorePointer, dmxLocalCoreKeyboard;
-extern void dmxLocalInitInput(DMXInputInfo *dmxInput);
-extern DMXLocalInputInfoPtr dmxInputCopyLocal(DMXInputInfo *dmxInput,
+extern void dmxLocalInitInput(DMXInputInfo * dmxInput);
+extern DMXLocalInputInfoPtr dmxInputCopyLocal(DMXInputInfo * dmxInput,
DMXLocalInputInfoPtr s);
-extern void dmxChangePointerControl(DeviceIntPtr pDevice, PtrCtrl *ctrl);
-extern void dmxKeyboardKbdCtrlProc(DeviceIntPtr pDevice, KeybdCtrl *ctrl);
+extern void dmxChangePointerControl(DeviceIntPtr pDevice, PtrCtrl * ctrl);
+extern void dmxKeyboardKbdCtrlProc(DeviceIntPtr pDevice, KeybdCtrl * ctrl);
extern void dmxKeyboardBellProc(int percent, DeviceIntPtr pDevice,
pointer ctrl, int unknown);
-extern int dmxInputExtensionErrorHandler(Display *dsp, _Xconst char *name,
- _Xconst char *reason);
+extern int dmxInputExtensionErrorHandler(Display * dsp, _Xconst char *name,
+ _Xconst char *reason);
-extern int dmxInputDetach(DMXInputInfo *dmxInput);
-extern void dmxInputDetachAll(DMXScreenInfo *dmxScreen);
-extern int dmxInputDetachId(int id);
+extern int dmxInputDetach(DMXInputInfo * dmxInput);
+extern void dmxInputDetachAll(DMXScreenInfo * dmxScreen);
+extern int dmxInputDetachId(int id);
extern DMXInputInfo *dmxInputLocateId(int id);
-extern int dmxInputAttachConsole(const char *name, int isCore,
- int *id);
-extern int dmxInputAttachBackend(int physicalScreen, int isCore,
- int *id);
+extern int dmxInputAttachConsole(const char *name, int isCore, int *id);
+extern int dmxInputAttachBackend(int physicalScreen, int isCore, int *id);
#endif
diff --git a/hw/dmx/input/dmxmap.c b/hw/dmx/input/dmxmap.c
index 1eccd3d28..1a8d4c937 100644
--- a/hw/dmx/input/dmxmap.c
+++ b/hw/dmx/input/dmxmap.c
@@ -59,15 +59,16 @@
* remoteEvent is the type returned from the remote server. The \a
* serverEvent is from the XI_* list of events in
* include/extensions/XIproto.h. */
-void dmxMapInsert(DMXLocalInputInfoPtr dmxLocal,
- int remoteEvent, int serverEvent)
+void
+dmxMapInsert(DMXLocalInputInfoPtr dmxLocal, int remoteEvent, int serverEvent)
{
int hash = remoteEvent & DMX_MAP_MASK;
int i;
- /* Return if this has already been mapped */
+ /* Return if this has already been mapped */
if (dmxLocal->map[hash].remote == remoteEvent
- && dmxLocal->map[hash].server == serverEvent) return;
+ && dmxLocal->map[hash].server == serverEvent)
+ return;
if (dmxLocal->map[hash].remote) {
dmxLocal->mapOptimize = 0;
@@ -81,18 +82,21 @@ void dmxMapInsert(DMXLocalInputInfoPtr dmxLocal,
dmxLog(dmxWarning,
"Out of map entries, cannot map remove event type %d\n",
remoteEvent);
- } else {
+ }
+ else {
dmxLocal->map[hash].remote = remoteEvent;
dmxLocal->map[hash].server = serverEvent;
}
}
/** Remove all mappings there were inserted with #dmxMapInsert. */
-void dmxMapClear(DMXLocalInputInfoPtr dmxLocal)
+void
+dmxMapClear(DMXLocalInputInfoPtr dmxLocal)
{
int i;
- for (i = 0; i < DMX_MAP_ENTRIES; i++) dmxLocal->map[i].remote = 0;
+ for (i = 0; i < DMX_MAP_ENTRIES; i++)
+ dmxLocal->map[i].remote = 0;
dmxLocal->mapOptimize = 1;
}
@@ -100,16 +104,18 @@ void dmxMapClear(DMXLocalInputInfoPtr dmxLocal)
* returned from the remote server. The return value is that which was
* passed into #dmxMapInsert (i.e., a value from the XI_* list in
* include/extensions/XIproto.h). If a mapping is not available, -1 is
- * returned. */
-int dmxMapLookup(DMXLocalInputInfoPtr dmxLocal, int remoteEvent)
+ * returned. */
+int
+dmxMapLookup(DMXLocalInputInfoPtr dmxLocal, int remoteEvent)
{
- int hash = remoteEvent & DMX_MAP_MASK;
+ int hash = remoteEvent & DMX_MAP_MASK;
int serverEvent = -1;
int i;
if (dmxLocal->mapOptimize && dmxLocal->map[hash].remote == remoteEvent) {
serverEvent = dmxLocal->map[hash].server;
- } else {
+ }
+ else {
for (i = 0; i < DMX_MAP_ENTRIES; i++)
if (dmxLocal->map[i].remote == remoteEvent) {
serverEvent = dmxLocal->map[hash].server;
diff --git a/hw/dmx/input/dmxmap.h b/hw/dmx/input/dmxmap.h
index aad30d1bd..62da1ed36 100644
--- a/hw/dmx/input/dmxmap.h
+++ b/hw/dmx/input/dmxmap.h
@@ -38,5 +38,5 @@
extern void dmxMapInsert(DMXLocalInputInfoPtr dmxLocal,
int remoteEvent, int serverEvent);
extern void dmxMapClear(DMXLocalInputInfoPtr dmxLocal);
-extern int dmxMapLookup(DMXLocalInputInfoPtr dmxLocal, int remoteEvent);
+extern int dmxMapLookup(DMXLocalInputInfoPtr dmxLocal, int remoteEvent);
#endif
diff --git a/hw/dmx/input/dmxmotion.c b/hw/dmx/input/dmxmotion.c
index 1aae5feb5..1642894a2 100644
--- a/hw/dmx/input/dmxmotion.c
+++ b/hw/dmx/input/dmxmotion.c
@@ -50,7 +50,8 @@
#define OFFSET(offset,element) ((offset) * (numAxes + 1) + (element))
/** Return size of motion buffer. \see DMX_MOTION_SIZE */
-int dmxPointerGetMotionBufferSize(void)
+int
+dmxPointerGetMotionBufferSize(void)
{
return DMX_MOTION_SIZE;
}
@@ -71,27 +72,30 @@ int dmxPointerGetMotionBufferSize(void)
* only has to support extension devices using the polymorphic coords.
* Because compatibility with miPointerGetMotionEvents is not possible,
* it is not provided. */
-int dmxPointerGetMotionEvents(DeviceIntPtr pDevice,
- xTimecoord *coords,
- unsigned long start,
- unsigned long stop,
- ScreenPtr pScreen)
+int
+dmxPointerGetMotionEvents(DeviceIntPtr pDevice,
+ xTimecoord * coords,
+ unsigned long start,
+ unsigned long stop, ScreenPtr pScreen)
{
GETDMXLOCALFROMPDEVICE;
- int numAxes = pDevice->valuator->numAxes;
- unsigned long *c = (unsigned long *)coords;
- int count = 0;
- int i, j;
+ int numAxes = pDevice->valuator->numAxes;
+ unsigned long *c = (unsigned long *) coords;
+ int count = 0;
+ int i, j;
- if (!dmxLocal->history) return 0;
+ if (!dmxLocal->history)
+ return 0;
for (i = dmxLocal->head; i != dmxLocal->tail;) {
- if (dmxLocal->history[OFFSET(i,0)] >= stop) break;
- if (dmxLocal->history[OFFSET(i,0)] >= start) {
+ if (dmxLocal->history[OFFSET(i, 0)] >= stop)
+ break;
+ if (dmxLocal->history[OFFSET(i, 0)] >= start) {
for (j = 0; j < numAxes + 1; j++)
- c[OFFSET(count,j)] = dmxLocal->history[OFFSET(i,j)];
+ c[OFFSET(count, j)] = dmxLocal->history[OFFSET(i, j)];
++count;
}
- if (++i >= DMX_MOTION_SIZE) i = 0;
+ if (++i >= DMX_MOTION_SIZE)
+ i = 0;
}
return count;
}
@@ -99,43 +103,47 @@ int dmxPointerGetMotionEvents(DeviceIntPtr pDevice,
/** This routine adds an event to the motion history. A similar
* function is performed by miPointerMove for the mi versions of these
* routines. */
-void dmxPointerPutMotionEvent(DeviceIntPtr pDevice,
- int firstAxis, int axesCount, int *v,
- unsigned long time)
+void
+dmxPointerPutMotionEvent(DeviceIntPtr pDevice,
+ int firstAxis, int axesCount, int *v,
+ unsigned long time)
{
GETDMXLOCALFROMPDEVICE;
- int numAxes = pDevice->valuator->numAxes;
- int i;
+ int numAxes = pDevice->valuator->numAxes;
+ int i;
if (!dmxLocal->history) {
- dmxLocal->history = malloc(sizeof(*dmxLocal->history)
- * (numAxes + 1)
- * DMX_MOTION_SIZE);
- dmxLocal->head = 0;
- dmxLocal->tail = 0;
+ dmxLocal->history = malloc(sizeof(*dmxLocal->history)
+ * (numAxes + 1)
+ * DMX_MOTION_SIZE);
+ dmxLocal->head = 0;
+ dmxLocal->tail = 0;
dmxLocal->valuators = calloc(sizeof(*dmxLocal->valuators), numAxes);
- } else {
- if (++dmxLocal->tail >= DMX_MOTION_SIZE) dmxLocal->tail = 0;
+ }
+ else {
+ if (++dmxLocal->tail >= DMX_MOTION_SIZE)
+ dmxLocal->tail = 0;
if (dmxLocal->head == dmxLocal->tail)
- if (++dmxLocal->head >= DMX_MOTION_SIZE) dmxLocal->head = 0;
+ if (++dmxLocal->head >= DMX_MOTION_SIZE)
+ dmxLocal->head = 0;
}
- dmxLocal->history[OFFSET(dmxLocal->tail,0)] = time;
+ dmxLocal->history[OFFSET(dmxLocal->tail, 0)] = time;
- /* Initialize the data from the known
- * values (if Absolute) or to zero (if
- * Relative) */
+ /* Initialize the data from the known
+ * values (if Absolute) or to zero (if
+ * Relative) */
for (i = 0; i < numAxes; i++) {
if (pDevice->valuator->axes[i].mode == Absolute)
- dmxLocal->history[OFFSET(dmxLocal->tail,i+1)]
+ dmxLocal->history[OFFSET(dmxLocal->tail, i + 1)]
= dmxLocal->valuators[i];
else
- dmxLocal->history[OFFSET(dmxLocal->tail,i+1)] = 0;
+ dmxLocal->history[OFFSET(dmxLocal->tail, i + 1)] = 0;
}
-
+
for (i = firstAxis; i < axesCount; i++) {
- dmxLocal->history[OFFSET(dmxLocal->tail,i+i)]
- = (unsigned long)v[i-firstAxis];
- dmxLocal->valuators[i] = v[i-firstAxis];
+ dmxLocal->history[OFFSET(dmxLocal->tail, i + i)]
+ = (unsigned long) v[i - firstAxis];
+ dmxLocal->valuators[i] = v[i - firstAxis];
}
}
diff --git a/hw/dmx/input/dmxmotion.h b/hw/dmx/input/dmxmotion.h
index 88aeb3d09..5ccdbe4ad 100644
--- a/hw/dmx/input/dmxmotion.h
+++ b/hw/dmx/input/dmxmotion.h
@@ -37,12 +37,11 @@
#ifndef _DMXMOTION_H_
#define _DMXMOTION_H_
-extern int dmxPointerGetMotionBufferSize(void);
-extern int dmxPointerGetMotionEvents(DeviceIntPtr pDevice,
- xTimecoord *coords,
- unsigned long start,
- unsigned long stop,
- ScreenPtr pScreen);
+extern int dmxPointerGetMotionBufferSize(void);
+extern int dmxPointerGetMotionEvents(DeviceIntPtr pDevice,
+ xTimecoord * coords,
+ unsigned long start,
+ unsigned long stop, ScreenPtr pScreen);
extern void dmxPointerPutMotionEvent(DeviceIntPtr pDevice,
int firstAxis, int axesCount, int *v,
unsigned long time);
diff --git a/hw/dmx/input/dmxsigio.c b/hw/dmx/input/dmxsigio.c
index 03c3070d7..9b1b493b8 100644
--- a/hw/dmx/input/dmxsigio.c
+++ b/hw/dmx/input/dmxsigio.c
@@ -47,36 +47,37 @@
#include <unistd.h>
#include <fcntl.h>
-static int dmxFdCount = 0;
+static int dmxFdCount = 0;
static Bool dmxInputEnabled = TRUE;
/* Define equivalents for non-POSIX systems (e.g., SGI IRIX, Solaris) */
#ifndef O_ASYNC
-# ifdef FASYNC
-# define O_ASYNC FASYNC
-# else
-# define O_ASYNC 0
-# endif
+#ifdef FASYNC
+#define O_ASYNC FASYNC
+#else
+#define O_ASYNC 0
+#endif
#endif
#ifndef O_NONBLOCK
#define O_NONBLOCK FNONBLK
#endif
-static void dmxSigioHandler(int sig)
+static void
+dmxSigioHandler(int sig)
{
- int i, j;
+ int i, j;
DMXInputInfo *dmxInput;
for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++) {
if (dmxInput->sigioState == DMX_ACTIVESIGIO) {
for (j = 0; j < dmxInput->numDevs; j++) {
DMXLocalInputInfoPtr dmxLocal = dmxInput->devs[j];
+
if (dmxLocal->collect_events) {
dmxLocal->collect_events(&dmxLocal->pDevice->public,
dmxMotion,
dmxEnqueue,
- dmxCheckSpecialKeys,
- DMX_NO_BLOCK);
+ dmxCheckSpecialKeys, DMX_NO_BLOCK);
}
}
}
@@ -84,7 +85,8 @@ static void dmxSigioHandler(int sig)
}
/** Block SIGIO handling. */
-void dmxSigioBlock(void)
+void
+dmxSigioBlock(void)
{
sigset_t s;
@@ -94,7 +96,8 @@ void dmxSigioBlock(void)
}
/** Unblock SIGIO handling. */
-void dmxSigioUnblock(void)
+void
+dmxSigioUnblock(void)
{
sigset_t s;
@@ -103,10 +106,11 @@ void dmxSigioUnblock(void)
sigprocmask(SIG_UNBLOCK, &s, 0);
}
-static void dmxSigioHook(void)
+static void
+dmxSigioHook(void)
{
struct sigaction a;
- sigset_t s;
+ sigset_t s;
memset(&a, 0, sizeof(a));
a.sa_handler = dmxSigioHandler;
@@ -115,81 +119,95 @@ static void dmxSigioHook(void)
sigaddset(&a.sa_mask, SIGALRM);
sigaddset(&a.sa_mask, SIGVTALRM);
sigaction(SIGIO, &a, 0);
-
+
sigemptyset(&s);
sigprocmask(SIG_SETMASK, &s, 0);
}
-static void dmxSigioUnhook(void)
+static void
+dmxSigioUnhook(void)
{
struct sigaction a;
- memset (&a, 0, sizeof(a));
+ memset(&a, 0, sizeof(a));
a.sa_handler = SIG_IGN;
sigemptyset(&a.sa_mask);
sigaction(SIGIO, &a, 0);
}
-static void dmxSigioAdd(DMXInputInfo *dmxInput)
+static void
+dmxSigioAdd(DMXInputInfo * dmxInput)
{
int flags;
int i;
switch (dmxInput->sigioState) {
- case DMX_NOSIGIO: return;
- case DMX_USESIGIO: dmxInput->sigioState = DMX_ACTIVESIGIO; break;
- case DMX_ACTIVESIGIO: return;
+ case DMX_NOSIGIO:
+ return;
+ case DMX_USESIGIO:
+ dmxInput->sigioState = DMX_ACTIVESIGIO;
+ break;
+ case DMX_ACTIVESIGIO:
+ return;
}
for (i = 0; i < dmxInput->sigioFdCount; i++) {
if (!dmxInput->sigioAdded[i]) {
int fd = dmxInput->sigioFd[i];
-
+
fcntl(fd, F_SETOWN, getpid());
flags = fcntl(fd, F_GETFL);
- flags |= O_ASYNC|O_NONBLOCK;
+ flags |= O_ASYNC | O_NONBLOCK;
fcntl(fd, F_SETFL, flags);
-
+
AddEnabledDevice(fd);
dmxInput->sigioAdded[i] = TRUE;
- if (++dmxFdCount == 1) dmxSigioHook();
+ if (++dmxFdCount == 1)
+ dmxSigioHook();
}
}
}
-static void dmxSigioRemove(DMXInputInfo *dmxInput)
+static void
+dmxSigioRemove(DMXInputInfo * dmxInput)
{
int flags;
int i;
-
+
switch (dmxInput->sigioState) {
- case DMX_NOSIGIO: return;
- case DMX_USESIGIO: return;
- case DMX_ACTIVESIGIO: dmxInput->sigioState = DMX_USESIGIO; break;
+ case DMX_NOSIGIO:
+ return;
+ case DMX_USESIGIO:
+ return;
+ case DMX_ACTIVESIGIO:
+ dmxInput->sigioState = DMX_USESIGIO;
+ break;
}
for (i = 0; i < dmxInput->sigioFdCount; i++) {
if (dmxInput->sigioAdded[i]) {
int fd = dmxInput->sigioFd[i];
-
+
dmxInput->sigioAdded[i] = FALSE;
RemoveEnabledDevice(fd);
-
+
flags = fcntl(fd, F_GETFL);
- flags &= ~(O_ASYNC|O_NONBLOCK);
+ flags &= ~(O_ASYNC | O_NONBLOCK);
fcntl(fd, F_SETFL, flags);
- if (!--dmxFdCount) dmxSigioUnhook();
+ if (!--dmxFdCount)
+ dmxSigioUnhook();
}
}
}
/** Enable SIGIO handling. This instantiates the handler with the OS. */
-void dmxSigioEnableInput(void)
+void
+dmxSigioEnableInput(void)
{
- int i;
- DMXInputInfo *dmxInput;
+ int i;
+ DMXInputInfo *dmxInput;
dmxInputEnabled = TRUE;
for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++)
@@ -197,10 +215,11 @@ void dmxSigioEnableInput(void)
}
/** Disable SIGIO handling. This removes the hanlder from the OS. */
-void dmxSigioDisableInput(void)
+void
+dmxSigioDisableInput(void)
{
- int i;
- DMXInputInfo *dmxInput;
+ int i;
+ DMXInputInfo *dmxInput;
dmxInputEnabled = FALSE;
for (i = 0, dmxInput = &dmxInputs[0]; i < dmxNumInputs; i++, dmxInput++)
@@ -211,23 +230,27 @@ void dmxSigioDisableInput(void)
* using the file descriptor \a fd for SIGIO signals. Calls
* AddEnabledDevice ifi SIGIO handling has been enabled with
* #dmxSigioEnableInput(). */
-void dmxSigioRegister(DMXInputInfo *dmxInput, int fd)
+void
+dmxSigioRegister(DMXInputInfo * dmxInput, int fd)
{
dmxInput->sigioState = DMX_USESIGIO;
if (dmxInput->sigioFdCount >= DMX_MAX_SIGIO_FDS)
dmxLog(dmxFatal, "Too many SIGIO file descriptors (%d >= %d)\n",
dmxInput->sigioFdCount, DMX_MAX_SIGIO_FDS);
-
+
dmxInput->sigioFd[dmxInput->sigioFdCount++] = fd;
- if (dmxInputEnabled) dmxSigioAdd(dmxInput);
+ if (dmxInputEnabled)
+ dmxSigioAdd(dmxInput);
}
/** Remove the notes that \a dmxInput is using any file descriptors for
* SIGIO signals. Calls RemoveEnabledDevice. */
-void dmxSigioUnregister(DMXInputInfo *dmxInput)
+void
+dmxSigioUnregister(DMXInputInfo * dmxInput)
{
- if (dmxInput->sigioState == DMX_NOSIGIO) return;
+ if (dmxInput->sigioState == DMX_NOSIGIO)
+ return;
dmxSigioRemove(dmxInput);
- dmxInput->sigioState = DMX_NOSIGIO;
+ dmxInput->sigioState = DMX_NOSIGIO;
dmxInput->sigioFdCount = 0;
}
diff --git a/hw/dmx/input/dmxsigio.h b/hw/dmx/input/dmxsigio.h
index 83f8060ae..4e4874929 100644
--- a/hw/dmx/input/dmxsigio.h
+++ b/hw/dmx/input/dmxsigio.h
@@ -40,6 +40,6 @@ extern void dmxSigioBlock(void);
extern void dmxSigioUnblock(void);
extern void dmxSigioEnableInput(void);
extern void dmxSigioDisableInput(void);
-extern void dmxSigioRegister(DMXInputInfo *dmxInput, int fd);
-extern void dmxSigioUnregister(DMXInputInfo *dmxInput);
+extern void dmxSigioRegister(DMXInputInfo * dmxInput, int fd);
+extern void dmxSigioUnregister(DMXInputInfo * dmxInput);
#endif
diff --git a/hw/dmx/input/dmxxinput.c b/hw/dmx/input/dmxxinput.c
index 54381b2e0..fccab5ff1 100644
--- a/hw/dmx/input/dmxxinput.c
+++ b/hw/dmx/input/dmxxinput.c
@@ -52,25 +52,24 @@
#include "exevents.h"
/** Set device mode to \a mode. This is not implemented. */
-int SetDeviceMode(ClientPtr client, DeviceIntPtr dev, int mode)
+int
+SetDeviceMode(ClientPtr client, DeviceIntPtr dev, int mode)
{
return BadMatch;
}
/** Set device valuators. This is not implemented. */
-int SetDeviceValuators (ClientPtr client,
- DeviceIntPtr dev,
- int *valuators,
- int first_valuator,
- int num_valuators)
+int
+SetDeviceValuators(ClientPtr client,
+ DeviceIntPtr dev,
+ int *valuators, int first_valuator, int num_valuators)
{
return BadMatch;
}
/** Change device control. This is not implemented. */
-int ChangeDeviceControl(ClientPtr client,
- DeviceIntPtr dev,
- xDeviceCtl *control)
+int
+ChangeDeviceControl(ClientPtr client, DeviceIntPtr dev, xDeviceCtl * control)
{
return BadMatch;
}
diff --git a/hw/dmx/input/lnx-keyboard.c b/hw/dmx/input/lnx-keyboard.c
index 06e9ec722..ecf4f591c 100644
--- a/hw/dmx/input/lnx-keyboard.c
+++ b/hw/dmx/input/lnx-keyboard.c
@@ -172,26 +172,25 @@
#define NUM_AT2LNX (sizeof(at2lnx) / sizeof(at2lnx[0]))
#define NUM_STATE_ENTRIES (256/32)
-
/* Private area for Linux-style keyboards. */
typedef struct _myPrivate {
- int fd;
- int vtno;
- int vtcurrent;
- int kbdtrans;
+ int fd;
+ int vtno;
+ int vtcurrent;
+ int kbdtrans;
struct termios kbdtty;
- int kbdType;
- CARD32 kbdState[NUM_STATE_ENTRIES];
- DeviceIntPtr pKeyboard;
- unsigned char prefix;
-
- int switched;
- SWITCHRETPROC switch_return;
- void *switch_return_data;
-
- /* For bell */
- int pitch;
- unsigned long duration;
+ int kbdType;
+ CARD32 kbdState[NUM_STATE_ENTRIES];
+ DeviceIntPtr pKeyboard;
+ unsigned char prefix;
+
+ int switched;
+ SWITCHRETPROC switch_return;
+ void *switch_return_data;
+
+ /* For bell */
+ int pitch;
+ unsigned long duration;
} myPrivate;
static myPrivate *PRIV = NULL;
@@ -199,174 +198,182 @@ static myPrivate *PRIV = NULL;
#undef SYSCALL
#define SYSCALL(call) while(((call) == -1) && (errno == EINTR))
-static int kbdLinuxKeyDown(myPrivate *priv, int keyCode)
+static int
+kbdLinuxKeyDown(myPrivate * priv, int keyCode)
{
- CARD8 byte = keyCode >> 5;
- CARD32 bit = 1 << (keyCode & 0x1f);
+ CARD8 byte = keyCode >> 5;
+ CARD32 bit = 1 << (keyCode & 0x1f);
- if (byte > NUM_STATE_ENTRIES) return 0;
+ if (byte > NUM_STATE_ENTRIES)
+ return 0;
return priv->kbdState[byte] & bit;
}
-static void kbdLinuxKeyState(myPrivate *priv, int type, int keyCode)
+static void
+kbdLinuxKeyState(myPrivate * priv, int type, int keyCode)
{
- CARD8 byte = keyCode >> 5;
- CARD32 bit = 1 << (keyCode & 0x1f);
-
- if (byte > NUM_STATE_ENTRIES) return;
- if (type == KeyPress) priv->kbdState[byte] |= bit;
- else priv->kbdState[byte] &= ~bit;
+ CARD8 byte = keyCode >> 5;
+ CARD32 bit = 1 << (keyCode & 0x1f);
+
+ if (byte > NUM_STATE_ENTRIES)
+ return;
+ if (type == KeyPress)
+ priv->kbdState[byte] |= bit;
+ else
+ priv->kbdState[byte] &= ~bit;
}
static KeySym linux_to_x[256] = {
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, XK_Escape,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_space, XK_exclam, XK_quotedbl, XK_numbersign,
- XK_dollar, XK_percent, XK_ampersand, XK_apostrophe,
- XK_parenleft, XK_parenright, XK_asterisk, XK_plus,
- XK_comma, XK_minus, XK_period, XK_slash,
- XK_0, XK_1, XK_2, XK_3,
- XK_4, XK_5, XK_6, XK_7,
- XK_8, XK_9, XK_colon, XK_semicolon,
- XK_less, XK_equal, XK_greater, XK_question,
- XK_at, XK_A, XK_B, XK_C,
- XK_D, XK_E, XK_F, XK_G,
- XK_H, XK_I, XK_J, XK_K,
- XK_L, XK_M, XK_N, XK_O,
- XK_P, XK_Q, XK_R, XK_S,
- XK_T, XK_U, XK_V, XK_W,
- XK_X, XK_Y, XK_Z, XK_bracketleft,
- XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore,
- XK_grave, XK_a, XK_b, XK_c,
- XK_d, XK_e, XK_f, XK_g,
- XK_h, XK_i, XK_j, XK_k,
- XK_l, XK_m, XK_n, XK_o,
- XK_p, XK_q, XK_r, XK_s,
- XK_t, XK_u, XK_v, XK_w,
- XK_x, XK_y, XK_z, XK_braceleft,
- XK_bar, XK_braceright, XK_asciitilde, XK_BackSpace,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_nobreakspace,XK_exclamdown, XK_cent, XK_sterling,
- XK_currency, XK_yen, XK_brokenbar, XK_section,
- XK_diaeresis, XK_copyright, XK_ordfeminine, XK_guillemotleft,
- XK_notsign, XK_hyphen, XK_registered, XK_macron,
- XK_degree, XK_plusminus, XK_twosuperior, XK_threesuperior,
- XK_acute, XK_mu, XK_paragraph, XK_periodcentered,
- XK_cedilla, XK_onesuperior, XK_masculine, XK_guillemotright,
- XK_onequarter, XK_onehalf, XK_threequarters,XK_questiondown,
- XK_Agrave, XK_Aacute, XK_Acircumflex, XK_Atilde,
- XK_Adiaeresis, XK_Aring, XK_AE, XK_Ccedilla,
- XK_Egrave, XK_Eacute, XK_Ecircumflex, XK_Ediaeresis,
- XK_Igrave, XK_Iacute, XK_Icircumflex, XK_Idiaeresis,
- XK_ETH, XK_Ntilde, XK_Ograve, XK_Oacute,
- XK_Ocircumflex, XK_Otilde, XK_Odiaeresis, XK_multiply,
- XK_Ooblique, XK_Ugrave, XK_Uacute, XK_Ucircumflex,
- XK_Udiaeresis, XK_Yacute, XK_THORN, XK_ssharp,
- XK_agrave, XK_aacute, XK_acircumflex, XK_atilde,
- XK_adiaeresis, XK_aring, XK_ae, XK_ccedilla,
- XK_egrave, XK_eacute, XK_ecircumflex, XK_ediaeresis,
- XK_igrave, XK_iacute, XK_icircumflex, XK_idiaeresis,
- XK_eth, XK_ntilde, XK_ograve, XK_oacute,
- XK_ocircumflex, XK_otilde, XK_odiaeresis, XK_division,
- XK_oslash, XK_ugrave, XK_uacute, XK_ucircumflex,
- XK_udiaeresis, XK_yacute, XK_thorn, XK_ydiaeresis
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, XK_Escape,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ XK_space, XK_exclam, XK_quotedbl, XK_numbersign,
+ XK_dollar, XK_percent, XK_ampersand, XK_apostrophe,
+ XK_parenleft, XK_parenright, XK_asterisk, XK_plus,
+ XK_comma, XK_minus, XK_period, XK_slash,
+ XK_0, XK_1, XK_2, XK_3,
+ XK_4, XK_5, XK_6, XK_7,
+ XK_8, XK_9, XK_colon, XK_semicolon,
+ XK_less, XK_equal, XK_greater, XK_question,
+ XK_at, XK_A, XK_B, XK_C,
+ XK_D, XK_E, XK_F, XK_G,
+ XK_H, XK_I, XK_J, XK_K,
+ XK_L, XK_M, XK_N, XK_O,
+ XK_P, XK_Q, XK_R, XK_S,
+ XK_T, XK_U, XK_V, XK_W,
+ XK_X, XK_Y, XK_Z, XK_bracketleft,
+ XK_backslash, XK_bracketright, XK_asciicircum, XK_underscore,
+ XK_grave, XK_a, XK_b, XK_c,
+ XK_d, XK_e, XK_f, XK_g,
+ XK_h, XK_i, XK_j, XK_k,
+ XK_l, XK_m, XK_n, XK_o,
+ XK_p, XK_q, XK_r, XK_s,
+ XK_t, XK_u, XK_v, XK_w,
+ XK_x, XK_y, XK_z, XK_braceleft,
+ XK_bar, XK_braceright, XK_asciitilde, XK_BackSpace,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ XK_nobreakspace, XK_exclamdown, XK_cent, XK_sterling,
+ XK_currency, XK_yen, XK_brokenbar, XK_section,
+ XK_diaeresis, XK_copyright, XK_ordfeminine, XK_guillemotleft,
+ XK_notsign, XK_hyphen, XK_registered, XK_macron,
+ XK_degree, XK_plusminus, XK_twosuperior, XK_threesuperior,
+ XK_acute, XK_mu, XK_paragraph, XK_periodcentered,
+ XK_cedilla, XK_onesuperior, XK_masculine, XK_guillemotright,
+ XK_onequarter, XK_onehalf, XK_threequarters, XK_questiondown,
+ XK_Agrave, XK_Aacute, XK_Acircumflex, XK_Atilde,
+ XK_Adiaeresis, XK_Aring, XK_AE, XK_Ccedilla,
+ XK_Egrave, XK_Eacute, XK_Ecircumflex, XK_Ediaeresis,
+ XK_Igrave, XK_Iacute, XK_Icircumflex, XK_Idiaeresis,
+ XK_ETH, XK_Ntilde, XK_Ograve, XK_Oacute,
+ XK_Ocircumflex, XK_Otilde, XK_Odiaeresis, XK_multiply,
+ XK_Ooblique, XK_Ugrave, XK_Uacute, XK_Ucircumflex,
+ XK_Udiaeresis, XK_Yacute, XK_THORN, XK_ssharp,
+ XK_agrave, XK_aacute, XK_acircumflex, XK_atilde,
+ XK_adiaeresis, XK_aring, XK_ae, XK_ccedilla,
+ XK_egrave, XK_eacute, XK_ecircumflex, XK_ediaeresis,
+ XK_igrave, XK_iacute, XK_icircumflex, XK_idiaeresis,
+ XK_eth, XK_ntilde, XK_ograve, XK_oacute,
+ XK_ocircumflex, XK_otilde, XK_odiaeresis, XK_division,
+ XK_oslash, XK_ugrave, XK_uacute, XK_ucircumflex,
+ XK_udiaeresis, XK_yacute, XK_thorn, XK_ydiaeresis
};
/*
* Maps the AT keycodes to Linux keycodes
*/
-static unsigned char at2lnx[NUM_KEYCODES] =
-{
- 0x01, /* KEY_Escape */ 0x02, /* KEY_1 */
- 0x03, /* KEY_2 */ 0x04, /* KEY_3 */
- 0x05, /* KEY_4 */ 0x06, /* KEY_5 */
- 0x07, /* KEY_6 */ 0x08, /* KEY_7 */
- 0x09, /* KEY_8 */ 0x0a, /* KEY_9 */
- 0x0b, /* KEY_0 */ 0x0c, /* KEY_Minus */
- 0x0d, /* KEY_Equal */ 0x0e, /* KEY_BackSpace */
- 0x0f, /* KEY_Tab */ 0x10, /* KEY_Q */
- 0x11, /* KEY_W */ 0x12, /* KEY_E */
- 0x13, /* KEY_R */ 0x14, /* KEY_T */
- 0x15, /* KEY_Y */ 0x16, /* KEY_U */
- 0x17, /* KEY_I */ 0x18, /* KEY_O */
- 0x19, /* KEY_P */ 0x1a, /* KEY_LBrace */
- 0x1b, /* KEY_RBrace */ 0x1c, /* KEY_Enter */
- 0x1d, /* KEY_LCtrl */ 0x1e, /* KEY_A */
- 0x1f, /* KEY_S */ 0x20, /* KEY_D */
- 0x21, /* KEY_F */ 0x22, /* KEY_G */
- 0x23, /* KEY_H */ 0x24, /* KEY_J */
- 0x25, /* KEY_K */ 0x26, /* KEY_L */
- 0x27, /* KEY_SemiColon */ 0x28, /* KEY_Quote */
- 0x29, /* KEY_Tilde */ 0x2a, /* KEY_ShiftL */
- 0x2b, /* KEY_BSlash */ 0x2c, /* KEY_Z */
- 0x2d, /* KEY_X */ 0x2e, /* KEY_C */
- 0x2f, /* KEY_V */ 0x30, /* KEY_B */
- 0x31, /* KEY_N */ 0x32, /* KEY_M */
- 0x33, /* KEY_Comma */ 0x34, /* KEY_Period */
- 0x35, /* KEY_Slash */ 0x36, /* KEY_ShiftR */
- 0x37, /* KEY_KP_Multiply */ 0x38, /* KEY_Alt */
- 0x39, /* KEY_Space */ 0x3a, /* KEY_CapsLock */
- 0x3b, /* KEY_F1 */ 0x3c, /* KEY_F2 */
- 0x3d, /* KEY_F3 */ 0x3e, /* KEY_F4 */
- 0x3f, /* KEY_F5 */ 0x40, /* KEY_F6 */
- 0x41, /* KEY_F7 */ 0x42, /* KEY_F8 */
- 0x43, /* KEY_F9 */ 0x44, /* KEY_F10 */
- 0x45, /* KEY_NumLock */ 0x46, /* KEY_ScrollLock */
- 0x47, /* KEY_KP_7 */ 0x48, /* KEY_KP_8 */
- 0x49, /* KEY_KP_9 */ 0x4a, /* KEY_KP_Minus */
- 0x4b, /* KEY_KP_4 */ 0x4c, /* KEY_KP_5 */
- 0x4d, /* KEY_KP_6 */ 0x4e, /* KEY_KP_Plus */
- 0x4f, /* KEY_KP_1 */ 0x50, /* KEY_KP_2 */
- 0x51, /* KEY_KP_3 */ 0x52, /* KEY_KP_0 */
- 0x53, /* KEY_KP_Decimal */ 0x54, /* KEY_SysReqest */
- 0x00, /* 0x55 */ 0x56, /* KEY_Less */
- 0x57, /* KEY_F11 */ 0x58, /* KEY_F12 */
- 0x66, /* KEY_Home */ 0x67, /* KEY_Up */
- 0x68, /* KEY_PgUp */ 0x69, /* KEY_Left */
- 0x5d, /* KEY_Begin */ 0x6a, /* KEY_Right */
- 0x6b, /* KEY_End */ 0x6c, /* KEY_Down */
- 0x6d, /* KEY_PgDown */ 0x6e, /* KEY_Insert */
- 0x6f, /* KEY_Delete */ 0x60, /* KEY_KP_Enter */
- 0x61, /* KEY_RCtrl */ 0x77, /* KEY_Pause */
- 0x63, /* KEY_Print */ 0x62, /* KEY_KP_Divide */
- 0x64, /* KEY_AltLang */ 0x65, /* KEY_Break */
- 0x00, /* KEY_LMeta */ 0x00, /* KEY_RMeta */
- 0x7A, /* KEY_Menu/FOCUS_PF11*/0x00, /* 0x6e */
- 0x7B, /* FOCUS_PF12 */ 0x00, /* 0x70 */
- 0x00, /* 0x71 */ 0x00, /* 0x72 */
- 0x59, /* FOCUS_PF2 */ 0x78, /* FOCUS_PF9 */
- 0x00, /* 0x75 */ 0x00, /* 0x76 */
- 0x5A, /* FOCUS_PF3 */ 0x5B, /* FOCUS_PF4 */
- 0x5C, /* FOCUS_PF5 */ 0x5D, /* FOCUS_PF6 */
- 0x5E, /* FOCUS_PF7 */ 0x5F, /* FOCUS_PF8 */
- 0x7C, /* JAP_86 */ 0x79, /* FOCUS_PF10 */
- 0x00, /* 0x7f */
+static unsigned char at2lnx[NUM_KEYCODES] = {
+ 0x01, /* KEY_Escape */ 0x02, /* KEY_1 */
+ 0x03, /* KEY_2 */ 0x04, /* KEY_3 */
+ 0x05, /* KEY_4 */ 0x06, /* KEY_5 */
+ 0x07, /* KEY_6 */ 0x08, /* KEY_7 */
+ 0x09, /* KEY_8 */ 0x0a, /* KEY_9 */
+ 0x0b, /* KEY_0 */ 0x0c, /* KEY_Minus */
+ 0x0d, /* KEY_Equal */ 0x0e, /* KEY_BackSpace */
+ 0x0f, /* KEY_Tab */ 0x10, /* KEY_Q */
+ 0x11, /* KEY_W */ 0x12, /* KEY_E */
+ 0x13, /* KEY_R */ 0x14, /* KEY_T */
+ 0x15, /* KEY_Y */ 0x16, /* KEY_U */
+ 0x17, /* KEY_I */ 0x18, /* KEY_O */
+ 0x19, /* KEY_P */ 0x1a, /* KEY_LBrace */
+ 0x1b, /* KEY_RBrace */ 0x1c, /* KEY_Enter */
+ 0x1d, /* KEY_LCtrl */ 0x1e, /* KEY_A */
+ 0x1f, /* KEY_S */ 0x20, /* KEY_D */
+ 0x21, /* KEY_F */ 0x22, /* KEY_G */
+ 0x23, /* KEY_H */ 0x24, /* KEY_J */
+ 0x25, /* KEY_K */ 0x26, /* KEY_L */
+ 0x27, /* KEY_SemiColon */ 0x28, /* KEY_Quote */
+ 0x29, /* KEY_Tilde */ 0x2a, /* KEY_ShiftL */
+ 0x2b, /* KEY_BSlash */ 0x2c, /* KEY_Z */
+ 0x2d, /* KEY_X */ 0x2e, /* KEY_C */
+ 0x2f, /* KEY_V */ 0x30, /* KEY_B */
+ 0x31, /* KEY_N */ 0x32, /* KEY_M */
+ 0x33, /* KEY_Comma */ 0x34, /* KEY_Period */
+ 0x35, /* KEY_Slash */ 0x36, /* KEY_ShiftR */
+ 0x37, /* KEY_KP_Multiply */ 0x38, /* KEY_Alt */
+ 0x39, /* KEY_Space */ 0x3a, /* KEY_CapsLock */
+ 0x3b, /* KEY_F1 */ 0x3c, /* KEY_F2 */
+ 0x3d, /* KEY_F3 */ 0x3e, /* KEY_F4 */
+ 0x3f, /* KEY_F5 */ 0x40, /* KEY_F6 */
+ 0x41, /* KEY_F7 */ 0x42, /* KEY_F8 */
+ 0x43, /* KEY_F9 */ 0x44, /* KEY_F10 */
+ 0x45, /* KEY_NumLock */ 0x46, /* KEY_ScrollLock */
+ 0x47, /* KEY_KP_7 */ 0x48, /* KEY_KP_8 */
+ 0x49, /* KEY_KP_9 */ 0x4a, /* KEY_KP_Minus */
+ 0x4b, /* KEY_KP_4 */ 0x4c, /* KEY_KP_5 */
+ 0x4d, /* KEY_KP_6 */ 0x4e, /* KEY_KP_Plus */
+ 0x4f, /* KEY_KP_1 */ 0x50, /* KEY_KP_2 */
+ 0x51, /* KEY_KP_3 */ 0x52, /* KEY_KP_0 */
+ 0x53, /* KEY_KP_Decimal */ 0x54, /* KEY_SysReqest */
+ 0x00, /* 0x55 */ 0x56, /* KEY_Less */
+ 0x57, /* KEY_F11 */ 0x58, /* KEY_F12 */
+ 0x66, /* KEY_Home */ 0x67, /* KEY_Up */
+ 0x68, /* KEY_PgUp */ 0x69, /* KEY_Left */
+ 0x5d, /* KEY_Begin */ 0x6a, /* KEY_Right */
+ 0x6b, /* KEY_End */ 0x6c, /* KEY_Down */
+ 0x6d, /* KEY_PgDown */ 0x6e, /* KEY_Insert */
+ 0x6f, /* KEY_Delete */ 0x60, /* KEY_KP_Enter */
+ 0x61, /* KEY_RCtrl */ 0x77, /* KEY_Pause */
+ 0x63, /* KEY_Print */ 0x62, /* KEY_KP_Divide */
+ 0x64, /* KEY_AltLang */ 0x65, /* KEY_Break */
+ 0x00, /* KEY_LMeta */ 0x00, /* KEY_RMeta */
+ 0x7A, /* KEY_Menu/FOCUS_PF11 */ 0x00, /* 0x6e */
+ 0x7B, /* FOCUS_PF12 */ 0x00, /* 0x70 */
+ 0x00, /* 0x71 */ 0x00, /* 0x72 */
+ 0x59, /* FOCUS_PF2 */ 0x78, /* FOCUS_PF9 */
+ 0x00, /* 0x75 */ 0x00, /* 0x76 */
+ 0x5A, /* FOCUS_PF3 */ 0x5B, /* FOCUS_PF4 */
+ 0x5C, /* FOCUS_PF5 */ 0x5D, /* FOCUS_PF6 */
+ 0x5E, /* FOCUS_PF7 */ 0x5F, /* FOCUS_PF8 */
+ 0x7C, /* JAP_86 */ 0x79, /* FOCUS_PF10 */
+ 0x00, /* 0x7f */
};
/** Create a private structure for use within this file. */
-pointer kbdLinuxCreatePrivate(DeviceIntPtr pKeyboard)
+pointer
+kbdLinuxCreatePrivate(DeviceIntPtr pKeyboard)
{
myPrivate *priv = calloc(1, sizeof(*priv));
- priv->fd = -1;
+
+ priv->fd = -1;
priv->pKeyboard = pKeyboard;
return priv;
}
/** Destroy a private structure. */
-void kbdLinuxDestroyPrivate(pointer priv)
+void
+kbdLinuxDestroyPrivate(pointer priv)
{
free(priv);
}
@@ -387,36 +394,37 @@ void kbdLinuxDestroyPrivate(pointer priv)
* if we ignore the volume and set the duration correctly, then we'll
* get one parameter "wrong" -- but if we use the volume to scale the
* duration, then we'll get both parameters "wrong"). */
-void kbdLinuxBell(DevicePtr pDev, int percent,
- int volume, int pitch, int duration)
+void
+kbdLinuxBell(DevicePtr pDev, int percent, int volume, int pitch, int duration)
{
GETPRIV;
if (duration && pitch) {
- ioctl(priv->fd,
- KDMKTONE,
- ((1193190 / pitch) & 0xffff) /* Low bits specify cycle time */
- | (duration << 16)); /* High bits are duration in msec */
+ ioctl(priv->fd, KDMKTONE, ((1193190 / pitch) & 0xffff) /* Low bits specify cycle time */
+ |(duration << 16)); /* High bits are duration in msec */
}
}
/** Set the LEDs. */
-void kbdLinuxCtrl(DevicePtr pDev, KeybdCtrl *ctrl)
+void
+kbdLinuxCtrl(DevicePtr pDev, KeybdCtrl * ctrl)
{
GETPRIV;
ioctl(priv->fd, KDSETLED, ctrl->leds & 0x07);
}
-static int kbdLinuxGetFreeVTNumber(void)
+static int
+kbdLinuxGetFreeVTNumber(void)
{
- int fd = -1;
- int vtno;
- int i;
+ int fd = -1;
+ int vtno;
+ int i;
const char *tty0[] = { "/dev/tty0", "/dev/vc/0", NULL };
-
+
for (i = 0; tty0[i]; i++)
- if ((fd = open(tty0[i], O_WRONLY, 0)) >= 0) break;
+ if ((fd = open(tty0[i], O_WRONLY, 0)) >= 0)
+ break;
if (fd < 0)
FATAL1("kbdLinuxGetFreeVTNumber: Cannot open tty0 (%s)\n",
strerror(errno));
@@ -425,16 +433,18 @@ static int kbdLinuxGetFreeVTNumber(void)
return vtno;
}
-static int kbdLinuxOpenVT(int vtno)
+static int
+kbdLinuxOpenVT(int vtno)
{
- int fd = -1;
- int i;
+ int fd = -1;
+ int i;
const char *vcs[] = { "/dev/vc/", "/dev/tty", NULL };
- char name[64]; /* RATS: Only used in snprintf */
+ char name[64]; /* RATS: Only used in snprintf */
for (i = 0; vcs[i]; i++) {
snprintf(name, sizeof(name), "%s%d", vcs[i], vtno);
- if ((fd = open(name, O_RDWR | O_NONBLOCK, 0)) >= 0) break;
+ if ((fd = open(name, O_RDWR | O_NONBLOCK, 0)) >= 0)
+ break;
}
if (fd < 0)
FATAL2("kbdLinuxOpenVT: Cannot open VT %d (%s)\n",
@@ -442,23 +452,27 @@ static int kbdLinuxOpenVT(int vtno)
return fd;
}
-static int kbdLinuxGetCurrentVTNumber(int fd)
+static int
+kbdLinuxGetCurrentVTNumber(int fd)
{
struct vt_stat vts;
-
- if (!ioctl(fd, VT_GETSTATE, &vts)) return vts.v_active;
+
+ if (!ioctl(fd, VT_GETSTATE, &vts))
+ return vts.v_active;
return -1;
}
static int kbdLinuxActivate(int fd, int vtno, int setSig);
/** Currently unused hook called prior to an VT switch. */
-void kbdLinuxVTPreSwitch(pointer p)
+void
+kbdLinuxVTPreSwitch(pointer p)
{
}
/** Currently unused hook called after returning from a VT switch. */
-void kbdLinuxVTPostSwitch(pointer p)
+void
+kbdLinuxVTPostSwitch(pointer p)
{
}
@@ -466,28 +480,31 @@ void kbdLinuxVTPostSwitch(pointer p)
* function is called with the \a switch_return_data when the VT is
* switched back to the pre-switch VT (i.e., the user returns to the DMX
* session). */
-int kbdLinuxVTSwitch(pointer p, int vt,
- void (*switch_return)(pointer),
- pointer switch_return_data)
+int
+kbdLinuxVTSwitch(pointer p, int vt,
+ void (*switch_return) (pointer), pointer switch_return_data)
{
myPrivate *priv = p;
- if (priv->switched) FATAL0("kbdLinuxVTSwitch: already switched...\n");
- if (priv->vtno == vt) return 0;
+ if (priv->switched)
+ FATAL0("kbdLinuxVTSwitch: already switched...\n");
+ if (priv->vtno == vt)
+ return 0;
- PRIV = priv;
- priv->switched = 0; /* Will switch to 1 in handler */
- priv->switch_return = switch_return;
+ PRIV = priv;
+ priv->switched = 0; /* Will switch to 1 in handler */
+ priv->switch_return = switch_return;
priv->switch_return_data = switch_return_data;
kbdLinuxActivate(priv->fd, vt, 0);
return 1;
}
/* RATS: This function is only ever used to handle SIGUSR1. */
-static void kbdLinuxVTSignalHandler(int sig)
+static void
+kbdLinuxVTSignalHandler(int sig)
{
myPrivate *priv = PRIV;
-
+
signal(sig, kbdLinuxVTSignalHandler);
if (priv) {
ioctl(priv->fd, VT_RELDISP, VT_ACKACQ);
@@ -499,19 +516,23 @@ static void kbdLinuxVTSignalHandler(int sig)
}
}
-static int kbdLinuxActivate(int fd, int vtno, int setSig)
+static int
+kbdLinuxActivate(int fd, int vtno, int setSig)
{
- int result;
+ int result;
struct vt_mode VT;
SYSCALL(result = ioctl(fd, VT_ACTIVATE, vtno));
- if (result) FATAL0("kbdLinuxActivate: VT_ACTIVATE failed\n");
+ if (result)
+ FATAL0("kbdLinuxActivate: VT_ACTIVATE failed\n");
SYSCALL(result = ioctl(fd, VT_WAITACTIVE, vtno));
- if (result) FATAL0("kbdLinuxActivate: VT_WAITACTIVE failed\n");
+ if (result)
+ FATAL0("kbdLinuxActivate: VT_WAITACTIVE failed\n");
if (setSig) {
SYSCALL(result = ioctl(fd, VT_GETMODE, &VT));
- if (result < 0) FATAL0("kbdLinuxActivate: VT_GETMODE failed\n");
- VT.mode = VT_PROCESS;
+ if (result < 0)
+ FATAL0("kbdLinuxActivate: VT_GETMODE failed\n");
+ VT.mode = VT_PROCESS;
VT.relsig = SIGUSR1;
VT.acqsig = SIGUSR1;
if (ioctl(fd, VT_SETMODE, &VT))
@@ -521,86 +542,148 @@ static int kbdLinuxActivate(int fd, int vtno, int setSig)
return Success;
}
-static void kbdLinuxOpenConsole(DevicePtr pDev)
+static void
+kbdLinuxOpenConsole(DevicePtr pDev)
{
GETPRIV;
const char *msg = MESSAGE;
- if (priv->fd >= 0) return;
- priv->vtno = kbdLinuxGetFreeVTNumber();
- priv->fd = kbdLinuxOpenVT(priv->vtno);
+ if (priv->fd >= 0)
+ return;
+ priv->vtno = kbdLinuxGetFreeVTNumber();
+ priv->fd = kbdLinuxOpenVT(priv->vtno);
priv->vtcurrent = kbdLinuxGetCurrentVTNumber(priv->fd);
LOG2("kbdLinuxOpenConsole: current VT %d; using free VT %d\n",
priv->vtcurrent, priv->vtno);
kbdLinuxActivate(priv->fd, priv->vtno, 1);
- ioctl(priv->fd, KDSETMODE, KD_GRAPHICS); /* To turn off gpm */
- if (msg) write(priv->fd, msg, strlen(msg));
+ ioctl(priv->fd, KDSETMODE, KD_GRAPHICS); /* To turn off gpm */
+ if (msg)
+ write(priv->fd, msg, strlen(msg));
}
-static void kbdLinuxCloseConsole(DevicePtr pDev)
+static void
+kbdLinuxCloseConsole(DevicePtr pDev)
{
GETPRIV;
struct vt_mode VT;
- const char *msg = FINALMESSAGE;
+ const char *msg = FINALMESSAGE;
- if (priv->fd < 0) return;
+ if (priv->fd < 0)
+ return;
ioctl(priv->fd, KDSETMODE, KD_TEXT);
- if (msg) write(priv->fd, msg, strlen(msg));
+ if (msg)
+ write(priv->fd, msg, strlen(msg));
if (ioctl(priv->fd, VT_GETMODE, &VT) != -1) {
VT.mode = VT_AUTO;
ioctl(priv->fd, VT_SETMODE, &VT);
}
LOG1("kbdLinuxCloseConsole: switching to VT %d\n", priv->vtcurrent);
- if (priv->vtcurrent >= 0) kbdLinuxActivate(priv->fd, priv->vtcurrent, 0);
-
+ if (priv->vtcurrent >= 0)
+ kbdLinuxActivate(priv->fd, priv->vtcurrent, 0);
+
close(priv->fd);
priv->fd = -1;
}
/** Initialize the \a pDev as a Linux keyboard. */
-void kbdLinuxInit(DevicePtr pDev)
+void
+kbdLinuxInit(DevicePtr pDev)
{
GETPRIV;
- if (priv->fd <= 0) kbdLinuxOpenConsole(pDev);
-
+ if (priv->fd <= 0)
+ kbdLinuxOpenConsole(pDev);
+
ioctl(priv->fd, KDGKBMODE, &priv->kbdtrans);
if (tcgetattr(priv->fd, &priv->kbdtty) < 0)
FATAL1("kbdLinuxInit: tcgetattr failed (%s)\n", strerror(errno));
}
-static int kbdLinuxPrefix0Mapping(unsigned char *scanCode)
+static int
+kbdLinuxPrefix0Mapping(unsigned char *scanCode)
{
- /* Table from xfree86/common/xf86Events.c */
+ /* Table from xfree86/common/xf86Events.c */
switch (*scanCode) {
- case KEY_KP_7: *scanCode = KEY_Home; break; /* curs home */
- case KEY_KP_8: *scanCode = KEY_Up; break; /* curs up */
- case KEY_KP_9: *scanCode = KEY_PgUp; break; /* curs pgup */
- case KEY_KP_4: *scanCode = KEY_Left; break; /* curs left */
- case KEY_KP_5: *scanCode = KEY_Begin; break; /* curs begin */
- case KEY_KP_6: *scanCode = KEY_Right; break; /* curs right */
- case KEY_KP_1: *scanCode = KEY_End; break; /* curs end */
- case KEY_KP_2: *scanCode = KEY_Down; break; /* curs down */
- case KEY_KP_3: *scanCode = KEY_PgDown; break; /* curs pgdown */
- case KEY_KP_0: *scanCode = KEY_Insert; break; /* curs insert */
- case KEY_KP_Decimal: *scanCode = KEY_Delete; break; /* curs delete */
- case KEY_Enter: *scanCode = KEY_KP_Enter; break; /* keypad enter */
- case KEY_LCtrl: *scanCode = KEY_RCtrl; break; /* right ctrl */
- case KEY_KP_Multiply: *scanCode = KEY_Print; break; /* print */
- case KEY_Slash: *scanCode = KEY_KP_Divide; break; /* keyp divide */
- case KEY_Alt: *scanCode = KEY_AltLang; break; /* right alt */
- case KEY_ScrollLock: *scanCode = KEY_Break; break; /* curs break */
- case 0x5b: *scanCode = KEY_LMeta; break;
- case 0x5c: *scanCode = KEY_RMeta; break;
- case 0x5d: *scanCode = KEY_Menu; break;
- case KEY_F3: *scanCode = KEY_F13; break;
- case KEY_F4: *scanCode = KEY_F14; break;
- case KEY_F5: *scanCode = KEY_F15; break;
- case KEY_F6: *scanCode = KEY_F16; break;
- case KEY_F7: *scanCode = KEY_F17; break;
- case KEY_KP_Plus: *scanCode = KEY_KP_DEC; break;
+ case KEY_KP_7:
+ *scanCode = KEY_Home;
+ break; /* curs home */
+ case KEY_KP_8:
+ *scanCode = KEY_Up;
+ break; /* curs up */
+ case KEY_KP_9:
+ *scanCode = KEY_PgUp;
+ break; /* curs pgup */
+ case KEY_KP_4:
+ *scanCode = KEY_Left;
+ break; /* curs left */
+ case KEY_KP_5:
+ *scanCode = KEY_Begin;
+ break; /* curs begin */
+ case KEY_KP_6:
+ *scanCode = KEY_Right;
+ break; /* curs right */
+ case KEY_KP_1:
+ *scanCode = KEY_End;
+ break; /* curs end */
+ case KEY_KP_2:
+ *scanCode = KEY_Down;
+ break; /* curs down */
+ case KEY_KP_3:
+ *scanCode = KEY_PgDown;
+ break; /* curs pgdown */
+ case KEY_KP_0:
+ *scanCode = KEY_Insert;
+ break; /* curs insert */
+ case KEY_KP_Decimal:
+ *scanCode = KEY_Delete;
+ break; /* curs delete */
+ case KEY_Enter:
+ *scanCode = KEY_KP_Enter;
+ break; /* keypad enter */
+ case KEY_LCtrl:
+ *scanCode = KEY_RCtrl;
+ break; /* right ctrl */
+ case KEY_KP_Multiply:
+ *scanCode = KEY_Print;
+ break; /* print */
+ case KEY_Slash:
+ *scanCode = KEY_KP_Divide;
+ break; /* keyp divide */
+ case KEY_Alt:
+ *scanCode = KEY_AltLang;
+ break; /* right alt */
+ case KEY_ScrollLock:
+ *scanCode = KEY_Break;
+ break; /* curs break */
+ case 0x5b:
+ *scanCode = KEY_LMeta;
+ break;
+ case 0x5c:
+ *scanCode = KEY_RMeta;
+ break;
+ case 0x5d:
+ *scanCode = KEY_Menu;
+ break;
+ case KEY_F3:
+ *scanCode = KEY_F13;
+ break;
+ case KEY_F4:
+ *scanCode = KEY_F14;
+ break;
+ case KEY_F5:
+ *scanCode = KEY_F15;
+ break;
+ case KEY_F6:
+ *scanCode = KEY_F16;
+ break;
+ case KEY_F7:
+ *scanCode = KEY_F17;
+ break;
+ case KEY_KP_Plus:
+ *scanCode = KEY_KP_DEC;
+ break;
/*
* Ignore virtual shifts (E0 2A, E0 AA, E0 36, E0 B6)
*/
@@ -618,12 +701,13 @@ static int kbdLinuxPrefix0Mapping(unsigned char *scanCode)
return 0;
}
-static int kbdLinuxPrefixMapping(myPrivate *priv, unsigned char *scanCode)
+static int
+kbdLinuxPrefixMapping(myPrivate * priv, unsigned char *scanCode)
{
- int pressed = *scanCode & 0x80;
- unsigned char code = *scanCode & 0x7f;
+ int pressed = *scanCode & 0x80;
+ unsigned char code = *scanCode & 0x7f;
- /* If we don't have a prefix, check for one */
+ /* If we don't have a prefix, check for one */
if (!priv->prefix) {
switch (code) {
case KEY_Prefix0:
@@ -634,43 +718,45 @@ static int kbdLinuxPrefixMapping(myPrivate *priv, unsigned char *scanCode)
return 0; /* No change */
}
- /* We have a prefix from the last scanCode */
+ /* We have a prefix from the last scanCode */
switch (priv->prefix) {
case KEY_Prefix0:
priv->prefix = 0;
- if (kbdLinuxPrefix0Mapping(&code)) return 1; /* Skip sequence */
+ if (kbdLinuxPrefix0Mapping(&code))
+ return 1; /* Skip sequence */
break;
case KEY_Prefix1:
priv->prefix = (code = KEY_LCtrl) ? KEY_LCtrl : 0;
- return 1; /* Use new prefix */
+ return 1; /* Use new prefix */
case KEY_LCtrl:
priv->prefix = 0;
- if (code != KEY_NumLock) return 1; /* Skip sequence*/
+ if (code != KEY_NumLock)
+ return 1; /* Skip sequence */
code = KEY_Pause;
break;
}
*scanCode = code | (pressed ? 0x80 : 0x00);
- return 0; /* Use old scanCode */
+ return 0; /* Use old scanCode */
}
-static void kbdLinuxConvert(DevicePtr pDev,
- unsigned char scanCode,
- ENQUEUEPROC enqueue,
- CHECKPROC checkspecial,
- BLOCK block)
+static void
+kbdLinuxConvert(DevicePtr pDev,
+ unsigned char scanCode,
+ ENQUEUEPROC enqueue, CHECKPROC checkspecial, BLOCK block)
{
GETPRIV;
- XkbSrvInfoPtr xkbi = priv->pKeyboard->key->xkbInfo;
- int type;
- KeySym keySym = NoSymbol;
- int keyCode;
- int switching;
+ XkbSrvInfoPtr xkbi = priv->pKeyboard->key->xkbInfo;
+ int type;
+ KeySym keySym = NoSymbol;
+ int keyCode;
+ int switching;
/* Do special PC/AT prefix mapping -- may change scanCode! */
- if (kbdLinuxPrefixMapping(priv, &scanCode)) return;
+ if (kbdLinuxPrefixMapping(priv, &scanCode))
+ return;
- type = (scanCode & 0x80) ? KeyRelease : KeyPress;
+ type = (scanCode & 0x80) ? KeyRelease : KeyPress;
keyCode = (scanCode & 0x7f) + MIN_KEYCODE;
/* Handle repeats */
@@ -681,6 +767,7 @@ static void kbdLinuxConvert(DevicePtr pDev,
int effectiveGroup = XkbGetEffectiveGroup(xkbi,
&xkbi->state,
scanCode);
+
keySym = XkbKeySym(xkbi->desc, scanCode, effectiveGroup);
#if 0
switch (keySym) {
@@ -689,9 +776,12 @@ static void kbdLinuxConvert(DevicePtr pDev,
case XK_Shift_Lock:
case XK_Caps_Lock:
/* Ignore releases and all but first press */
- if (kbdLinuxModIgnore(priv, &xE, keySym)) return;
- if (kbdLinuxKeyDown(priv, &xE)) xE.u.u.type = KeyRelease;
- else xE.u.u.type = KeyPress;
+ if (kbdLinuxModIgnore(priv, &xE, keySym))
+ return;
+ if (kbdLinuxKeyDown(priv, &xE))
+ xE.u.u.type = KeyRelease;
+ else
+ xE.u.u.type = KeyPress;
break;
}
#endif
@@ -703,17 +793,18 @@ static void kbdLinuxConvert(DevicePtr pDev,
/* No auto-repeat? */
if ((feed && !feed->ctrl.autoRepeat)
|| priv->pKeyboard->key->xkbInfo->desc->map->modmap[keyCode]
- || (feed
- && !(feed->ctrl.autoRepeats[keyCode >> 3]
- & (1 << (keyCode & 7))))) return; /* Ignore */
-
+ || (feed && !(feed->ctrl.autoRepeats[keyCode >> 3]
+ & (1 << (keyCode & 7)))))
+ return; /* Ignore */
+
/* Do auto-repeat */
enqueue(pDev, KeyRelease, keyCode, keySym, NULL, block);
type = KeyPress;
}
-
+
/* If key is already up, ignore */
- if (type == KeyRelease && !kbdLinuxKeyDown(priv, keyCode)) return;
+ if (type == KeyRelease && !kbdLinuxKeyDown(priv, keyCode))
+ return;
}
switching = 0;
@@ -722,7 +813,7 @@ static void kbdLinuxConvert(DevicePtr pDev,
if (!switching) {
if (enqueue)
enqueue(pDev, type, keyCode, keySym, NULL, block);
- kbdLinuxKeyState(priv, type, keyCode); /* Update our state bitmap */
+ kbdLinuxKeyState(priv, type, keyCode); /* Update our state bitmap */
}
}
@@ -732,16 +823,15 @@ static void kbdLinuxConvert(DevicePtr pDev,
* with the \a enqueue function. The \a block type is passed to the
* functions so that they may block SIGIO handling as appropriate to the
* caller of this function. */
-void kbdLinuxRead(DevicePtr pDev,
- MOTIONPROC motion,
- ENQUEUEPROC enqueue,
- CHECKPROC checkspecial,
- BLOCK block)
+void
+kbdLinuxRead(DevicePtr pDev,
+ MOTIONPROC motion,
+ ENQUEUEPROC enqueue, CHECKPROC checkspecial, BLOCK block)
{
GETPRIV;
unsigned char buf[256]; /* RATS: Only used in length-limited call */
unsigned char *pt;
- int n;
+ int n;
while ((n = read(priv->fd, buf, sizeof(buf))) > 0)
for (pt = buf; n; --n, ++pt)
@@ -749,20 +839,21 @@ void kbdLinuxRead(DevicePtr pDev,
}
/** Turn \a pDev on (i.e., take input from \a pDev). */
-int kbdLinuxOn(DevicePtr pDev)
+int
+kbdLinuxOn(DevicePtr pDev)
{
GETPRIV;
struct termios nTty;
ioctl(priv->fd, KDSKBMODE, K_RAW);
- nTty = priv->kbdtty;
- nTty.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP);
- nTty.c_oflag = 0;
- nTty.c_cflag = CREAD | CS8;
- nTty.c_lflag = 0;
+ nTty = priv->kbdtty;
+ nTty.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP);
+ nTty.c_oflag = 0;
+ nTty.c_cflag = CREAD | CS8;
+ nTty.c_lflag = 0;
nTty.c_cc[VTIME] = 0;
- nTty.c_cc[VMIN] = 1;
+ nTty.c_cc[VMIN] = 1;
cfsetispeed(&nTty, B9600);
cfsetospeed(&nTty, B9600);
if (tcsetattr(priv->fd, TCSANOW, &nTty) < 0)
@@ -771,7 +862,8 @@ int kbdLinuxOn(DevicePtr pDev)
}
/** Turn \a pDev off (i.e., stop taking input from \a pDev). */
-void kbdLinuxOff(DevicePtr pDev)
+void
+kbdLinuxOff(DevicePtr pDev)
{
GETPRIV;
@@ -780,165 +872,261 @@ void kbdLinuxOff(DevicePtr pDev)
kbdLinuxCloseConsole(pDev);
}
-
-static void kbdLinuxReadKernelMapping(int fd, KeySymsPtr pKeySyms)
+static void
+kbdLinuxReadKernelMapping(int fd, KeySymsPtr pKeySyms)
{
- KeySym *k;
- int i;
- int maxkey;
- static unsigned char tbl[GLYPHS_PER_KEY] = { /* RATS: Use ok */
- 0, /* unshifted */
- 1, /* shifted */
- 0, /* modeswitch unshifted */
- 0 /* modeswitch shifted */
+ KeySym *k;
+ int i;
+ int maxkey;
+
+ static unsigned char tbl[GLYPHS_PER_KEY] = { /* RATS: Use ok */
+ 0, /* unshifted */
+ 1, /* shifted */
+ 0, /* modeswitch unshifted */
+ 0 /* modeswitch shifted */
};
- /*
- * Read the mapping from the kernel.
- * Since we're still using the XFree86 scancode->AT keycode mapping
- * routines, we need to convert the AT keycodes to Linux keycodes,
- * then translate the Linux keysyms into X keysyms.
- *
- * First, figure out which tables to use for the modeswitch columns
- * above, from the XF86Config fields.
- */
- tbl[2] = 8; /* alt */
- tbl[3] = tbl[2] | 1;
-
-#if 00/*BP*/
- k = map+GLYPHS_PER_KEY;
+ /*
+ * Read the mapping from the kernel.
+ * Since we're still using the XFree86 scancode->AT keycode mapping
+ * routines, we need to convert the AT keycodes to Linux keycodes,
+ * then translate the Linux keysyms into X keysyms.
+ *
+ * First, figure out which tables to use for the modeswitch columns
+ * above, from the XF86Config fields.
+ */
+ tbl[2] = 8; /* alt */
+ tbl[3] = tbl[2] | 1;
+
+#if 00 /*BP*/
+ k = map + GLYPHS_PER_KEY;
#else
- ErrorF("kbdLinuxReadKernelMapping() is broken/no-op'd\n");
- return;
+ ErrorF("kbdLinuxReadKernelMapping() is broken/no-op'd\n");
+ return;
#endif
- maxkey = NUM_AT2LNX;
-
- for (i = 0; i < maxkey; ++i) {
- struct kbentry kbe;
- int j;
-
- kbe.kb_index = at2lnx[i];
-
- for (j = 0; j < GLYPHS_PER_KEY; ++j, ++k) {
- unsigned short kval;
-
- *k = NoSymbol;
-
- kbe.kb_table = tbl[j];
- if (kbe.kb_index == 0 || ioctl(fd, KDGKBENT, &kbe)) continue;
-
- kval = KVAL(kbe.kb_value);
- switch (KTYP(kbe.kb_value)) {
- case KT_LATIN:
- case KT_LETTER: *k = linux_to_x[kval]; break;
- case KT_FN:
- if (kval <= 19) *k = XK_F1 + kval;
- else switch (kbe.kb_value) {
- case K_FIND: *k = XK_Home; /* or XK_Find */ break;
- case K_INSERT: *k = XK_Insert; break;
- case K_REMOVE: *k = XK_Delete; break;
- case K_SELECT: *k = XK_End; /* or XK_Select */ break;
- case K_PGUP: *k = XK_Prior; break;
- case K_PGDN: *k = XK_Next; break;
- case K_HELP: *k = XK_Help; break;
- case K_DO: *k = XK_Execute; break;
- case K_PAUSE: *k = XK_Pause; break;
- case K_MACRO: *k = XK_Menu; break;
- default: break;
- }
- break;
- case KT_SPEC:
- switch (kbe.kb_value) {
- case K_ENTER: *k = XK_Return; break;
- case K_BREAK: *k = XK_Break; break;
- case K_CAPS: *k = XK_Caps_Lock; break;
- case K_NUM: *k = XK_Num_Lock; break;
- case K_HOLD: *k = XK_Scroll_Lock; break;
- case K_COMPOSE: *k = XK_Multi_key; break;
- default: break;
- }
- break;
- case KT_PAD:
- switch (kbe.kb_value) {
- case K_PPLUS: *k = XK_KP_Add; break;
- case K_PMINUS: *k = XK_KP_Subtract; break;
- case K_PSTAR: *k = XK_KP_Multiply; break;
- case K_PSLASH: *k = XK_KP_Divide; break;
- case K_PENTER: *k = XK_KP_Enter; break;
- case K_PCOMMA: *k = XK_KP_Separator; break;
- case K_PDOT: *k = XK_KP_Decimal; break;
- case K_PPLUSMINUS: *k = XK_KP_Subtract; break;
- default: if (kval <= 9) *k = XK_KP_0 + kval; break;
- }
- break;
- case KT_DEAD:
- /* KT_DEAD keys are for accelerated diacritical creation. */
- switch (kbe.kb_value) {
- case K_DGRAVE: *k = XK_dead_grave; break;
- case K_DACUTE: *k = XK_dead_acute; break;
- case K_DCIRCM: *k = XK_dead_circumflex; break;
- case K_DTILDE: *k = XK_dead_tilde; break;
- case K_DDIERE: *k = XK_dead_diaeresis; break;
- }
- break;
- case KT_CUR:
- switch (kbe.kb_value) {
- case K_DOWN: *k = XK_Down; break;
- case K_LEFT: *k = XK_Left; break;
- case K_RIGHT: *k = XK_Right; break;
- case K_UP: *k = XK_Up; break;
- }
- break;
- case KT_SHIFT:
- switch (kbe.kb_value) {
- case K_ALTGR: *k = XK_Alt_R; break;
- case K_ALT:
- *k = (kbe.kb_index == 0x64 ? XK_Alt_R : XK_Alt_L);
- break;
- case K_CTRL:
- *k = (kbe.kb_index == 0x61 ? XK_Control_R : XK_Control_L);
- break;
- case K_CTRLL: *k = XK_Control_L; break;
- case K_CTRLR: *k = XK_Control_R; break;
- case K_SHIFT:
- *k = (kbe.kb_index == 0x36 ? XK_Shift_R : XK_Shift_L);
- break;
- case K_SHIFTL: *k = XK_Shift_L; break;
- case K_SHIFTR: *k = XK_Shift_R; break;
- default: break;
- }
- break;
- case KT_ASCII:
- /* KT_ASCII keys accumulate a 3 digit decimal number that
- * gets emitted when the shift state changes. We can't
- * emulate that.
- */
- break;
- case KT_LOCK:
- if (kbe.kb_value == K_SHIFTLOCK) *k = XK_Shift_Lock;
- break;
- default: break;
- }
- }
-
- if (k[-1] == k[-2]) k[-1] = NoSymbol;
- if (k[-2] == k[-3]) k[-2] = NoSymbol;
- if (k[-3] == k[-4]) k[-3] = NoSymbol;
- if (k[-4] == k[-2] && k[-3] == k[-1]) k[-2] = k[-1] = NoSymbol;
- if (k[-1] == k[-4] && k[-2] == k[-3]
- && k[-2] == NoSymbol) k[-1] = NoSymbol;
- }
+ maxkey = NUM_AT2LNX;
+
+ for (i = 0; i < maxkey; ++i) {
+ struct kbentry kbe;
+ int j;
+
+ kbe.kb_index = at2lnx[i];
+
+ for (j = 0; j < GLYPHS_PER_KEY; ++j, ++k) {
+ unsigned short kval;
+
+ *k = NoSymbol;
+
+ kbe.kb_table = tbl[j];
+ if (kbe.kb_index == 0 || ioctl(fd, KDGKBENT, &kbe))
+ continue;
+
+ kval = KVAL(kbe.kb_value);
+ switch (KTYP(kbe.kb_value)) {
+ case KT_LATIN:
+ case KT_LETTER:
+ *k = linux_to_x[kval];
+ break;
+ case KT_FN:
+ if (kval <= 19)
+ *k = XK_F1 + kval;
+ else
+ switch (kbe.kb_value) {
+ case K_FIND:
+ *k = XK_Home; /* or XK_Find */
+ break;
+ case K_INSERT:
+ *k = XK_Insert;
+ break;
+ case K_REMOVE:
+ *k = XK_Delete;
+ break;
+ case K_SELECT:
+ *k = XK_End; /* or XK_Select */
+ break;
+ case K_PGUP:
+ *k = XK_Prior;
+ break;
+ case K_PGDN:
+ *k = XK_Next;
+ break;
+ case K_HELP:
+ *k = XK_Help;
+ break;
+ case K_DO:
+ *k = XK_Execute;
+ break;
+ case K_PAUSE:
+ *k = XK_Pause;
+ break;
+ case K_MACRO:
+ *k = XK_Menu;
+ break;
+ default:
+ break;
+ }
+ break;
+ case KT_SPEC:
+ switch (kbe.kb_value) {
+ case K_ENTER:
+ *k = XK_Return;
+ break;
+ case K_BREAK:
+ *k = XK_Break;
+ break;
+ case K_CAPS:
+ *k = XK_Caps_Lock;
+ break;
+ case K_NUM:
+ *k = XK_Num_Lock;
+ break;
+ case K_HOLD:
+ *k = XK_Scroll_Lock;
+ break;
+ case K_COMPOSE:
+ *k = XK_Multi_key;
+ break;
+ default:
+ break;
+ }
+ break;
+ case KT_PAD:
+ switch (kbe.kb_value) {
+ case K_PPLUS:
+ *k = XK_KP_Add;
+ break;
+ case K_PMINUS:
+ *k = XK_KP_Subtract;
+ break;
+ case K_PSTAR:
+ *k = XK_KP_Multiply;
+ break;
+ case K_PSLASH:
+ *k = XK_KP_Divide;
+ break;
+ case K_PENTER:
+ *k = XK_KP_Enter;
+ break;
+ case K_PCOMMA:
+ *k = XK_KP_Separator;
+ break;
+ case K_PDOT:
+ *k = XK_KP_Decimal;
+ break;
+ case K_PPLUSMINUS:
+ *k = XK_KP_Subtract;
+ break;
+ default:
+ if (kval <= 9)
+ *k = XK_KP_0 + kval;
+ break;
+ }
+ break;
+ case KT_DEAD:
+ /* KT_DEAD keys are for accelerated diacritical creation. */
+ switch (kbe.kb_value) {
+ case K_DGRAVE:
+ *k = XK_dead_grave;
+ break;
+ case K_DACUTE:
+ *k = XK_dead_acute;
+ break;
+ case K_DCIRCM:
+ *k = XK_dead_circumflex;
+ break;
+ case K_DTILDE:
+ *k = XK_dead_tilde;
+ break;
+ case K_DDIERE:
+ *k = XK_dead_diaeresis;
+ break;
+ }
+ break;
+ case KT_CUR:
+ switch (kbe.kb_value) {
+ case K_DOWN:
+ *k = XK_Down;
+ break;
+ case K_LEFT:
+ *k = XK_Left;
+ break;
+ case K_RIGHT:
+ *k = XK_Right;
+ break;
+ case K_UP:
+ *k = XK_Up;
+ break;
+ }
+ break;
+ case KT_SHIFT:
+ switch (kbe.kb_value) {
+ case K_ALTGR:
+ *k = XK_Alt_R;
+ break;
+ case K_ALT:
+ *k = (kbe.kb_index == 0x64 ? XK_Alt_R : XK_Alt_L);
+ break;
+ case K_CTRL:
+ *k = (kbe.kb_index == 0x61 ? XK_Control_R : XK_Control_L);
+ break;
+ case K_CTRLL:
+ *k = XK_Control_L;
+ break;
+ case K_CTRLR:
+ *k = XK_Control_R;
+ break;
+ case K_SHIFT:
+ *k = (kbe.kb_index == 0x36 ? XK_Shift_R : XK_Shift_L);
+ break;
+ case K_SHIFTL:
+ *k = XK_Shift_L;
+ break;
+ case K_SHIFTR:
+ *k = XK_Shift_R;
+ break;
+ default:
+ break;
+ }
+ break;
+ case KT_ASCII:
+ /* KT_ASCII keys accumulate a 3 digit decimal number that
+ * gets emitted when the shift state changes. We can't
+ * emulate that.
+ */
+ break;
+ case KT_LOCK:
+ if (kbe.kb_value == K_SHIFTLOCK)
+ *k = XK_Shift_Lock;
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (k[-1] == k[-2])
+ k[-1] = NoSymbol;
+ if (k[-2] == k[-3])
+ k[-2] = NoSymbol;
+ if (k[-3] == k[-4])
+ k[-3] = NoSymbol;
+ if (k[-4] == k[-2] && k[-3] == k[-1])
+ k[-2] = k[-1] = NoSymbol;
+ if (k[-1] == k[-4] && k[-2] == k[-3]
+ && k[-2] == NoSymbol)
+ k[-1] = NoSymbol;
+ }
}
-static void kbdLinuxGetMap(DevicePtr pDev, KeySymsPtr pKeySyms, CARD8 *pModMap)
+static void
+kbdLinuxGetMap(DevicePtr pDev, KeySymsPtr pKeySyms, CARD8 *pModMap)
{
GETPRIV;
- KeySym *k, *mapCopy;
- char type;
- int i;
+ KeySym *k, *mapCopy;
+ char type;
+ int i;
-#if 00/*BP*/
- mapCopy = malloc(sizeof(map));
+#if 00 /*BP*/
+ mapCopy = malloc(sizeof(map));
memcpy(mapCopy, map, sizeof(map));
#else
ErrorF("kbdLinuxGetMap() is broken/no-op'd\n");
@@ -950,41 +1138,57 @@ static void kbdLinuxGetMap(DevicePtr pDev, KeySymsPtr pKeySyms, CARD8 *pModMap)
/* compute the modifier map */
for (i = 0; i < MAP_LENGTH; i++)
pModMap[i] = NoSymbol; /* make sure it is restored */
-
+
for (k = mapCopy, i = MIN_KEYCODE;
- i < NUM_KEYCODES + MIN_KEYCODE;
- i++, k += 4) {
- switch(*k) {
+ i < NUM_KEYCODES + MIN_KEYCODE; i++, k += 4) {
+ switch (*k) {
case XK_Shift_L:
- case XK_Shift_R: pModMap[i] = ShiftMask; break;
+ case XK_Shift_R:
+ pModMap[i] = ShiftMask;
+ break;
case XK_Control_L:
- case XK_Control_R: pModMap[i] = ControlMask; break;
- case XK_Caps_Lock: pModMap[i] = LockMask; break;
+ case XK_Control_R:
+ pModMap[i] = ControlMask;
+ break;
+ case XK_Caps_Lock:
+ pModMap[i] = LockMask;
+ break;
case XK_Alt_L:
- case XK_Alt_R: pModMap[i] = AltMask; break;
- case XK_Num_Lock: pModMap[i] = NumLockMask; break;
- case XK_Scroll_Lock: pModMap[i] = ScrollLockMask; break;
+ case XK_Alt_R:
+ pModMap[i] = AltMask;
+ break;
+ case XK_Num_Lock:
+ pModMap[i] = NumLockMask;
+ break;
+ case XK_Scroll_Lock:
+ pModMap[i] = ScrollLockMask;
+ break;
case XK_Kana_Lock:
- case XK_Kana_Shift: pModMap[i] = KanaMask; break;
- case XK_Mode_switch: pModMap[i] = AltLangMask; break;
+ case XK_Kana_Shift:
+ pModMap[i] = KanaMask;
+ break;
+ case XK_Mode_switch:
+ pModMap[i] = AltLangMask;
+ break;
}
}
priv->kbdType = (ioctl(priv->fd, KDGKBTYPE, &type) < 0) ? KB_101 : type;
- pKeySyms->map = mapCopy; /* Must be XFree'able */
- pKeySyms->mapWidth = GLYPHS_PER_KEY;
+ pKeySyms->map = mapCopy; /* Must be XFree'able */
+ pKeySyms->mapWidth = GLYPHS_PER_KEY;
pKeySyms->minKeyCode = MIN_KEYCODE;
pKeySyms->maxKeyCode = MAX_KEYCODE;
}
/** Fill the \a info structure with information needed to initialize \a
- * pDev. */
-void kbdLinuxGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
+ * pDev. */
+void
+kbdLinuxGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
{
- info->keyboard = 1;
- info->keyClass = 1;
+ info->keyboard = 1;
+ info->keyClass = 1;
kbdLinuxGetMap(pDev, &info->keySyms, info->modMap);
- info->focusClass = 1;
+ info->focusClass = 1;
info->kbdFeedbackClass = 1;
}
diff --git a/hw/dmx/input/lnx-keyboard.h b/hw/dmx/input/lnx-keyboard.h
index e36a50499..891c6a9a4 100644
--- a/hw/dmx/input/lnx-keyboard.h
+++ b/hw/dmx/input/lnx-keyboard.h
@@ -38,26 +38,26 @@
#define _LNX_KEYBOARD_H_
extern pointer kbdLinuxCreatePrivate(DeviceIntPtr pKeyboard);
-extern void kbdLinuxDestroyPrivate(pointer private);
-
-extern void kbdLinuxInit(DevicePtr pDev);
-extern void kbdLinuxGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
-extern int kbdLinuxOn(DevicePtr pDev);
-extern void kbdLinuxOff(DevicePtr pDev);
-
-extern void kbdLinuxVTPreSwitch(pointer p);
-extern void kbdLinuxVTPostSwitch(pointer p);
-extern int kbdLinuxVTSwitch(pointer p, int vt,
- dmxVTSwitchReturnProcPtr switch_return,
- pointer switch_return_data);
-
-extern void kbdLinuxRead(DevicePtr pDev,
- dmxMotionProcPtr motion,
- dmxEnqueueProcPtr enqueue,
- dmxCheckSpecialProcPtr checkspecial,
- DMXBlockType block);
-
-extern void kbdLinuxCtrl(DevicePtr pDev, KeybdCtrl *ctrl);
-extern void kbdLinuxBell(DevicePtr pDev, int percent,
- int volume, int pitch, int duration);
+extern void kbdLinuxDestroyPrivate(pointer private);
+
+extern void kbdLinuxInit(DevicePtr pDev);
+extern void kbdLinuxGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
+extern int kbdLinuxOn(DevicePtr pDev);
+extern void kbdLinuxOff(DevicePtr pDev);
+
+extern void kbdLinuxVTPreSwitch(pointer p);
+extern void kbdLinuxVTPostSwitch(pointer p);
+extern int kbdLinuxVTSwitch(pointer p, int vt,
+ dmxVTSwitchReturnProcPtr switch_return,
+ pointer switch_return_data);
+
+extern void kbdLinuxRead(DevicePtr pDev,
+ dmxMotionProcPtr motion,
+ dmxEnqueueProcPtr enqueue,
+ dmxCheckSpecialProcPtr checkspecial,
+ DMXBlockType block);
+
+extern void kbdLinuxCtrl(DevicePtr pDev, KeybdCtrl * ctrl);
+extern void kbdLinuxBell(DevicePtr pDev, int percent,
+ int volume, int pitch, int duration);
#endif
diff --git a/hw/dmx/input/lnx-ms.c b/hw/dmx/input/lnx-ms.c
index ee187072c..7e1acf450 100644
--- a/hw/dmx/input/lnx-ms.c
+++ b/hw/dmx/input/lnx-ms.c
@@ -104,8 +104,8 @@
/* Private area for MS mouse devices. */
typedef struct _myPrivate {
- DeviceIntPtr pMouse;
- int fd;
+ DeviceIntPtr pMouse;
+ int fd;
struct termios tty;
enum {
button1 = 0x0001,
@@ -113,36 +113,39 @@ typedef struct _myPrivate {
button3 = 0x0004,
button4 = 0x0008,
button5 = 0x0010
- } buttons;
+ } buttons;
} myPrivate;
-static int msLinuxReadBytes(int fd, unsigned char *buf, int len, int min)
+static int
+msLinuxReadBytes(int fd, unsigned char *buf, int len, int min)
{
- int n, tot;
- fd_set set;
- struct timeval tv;
-
+ int n, tot;
+ fd_set set;
+ struct timeval tv;
+
tot = 0;
while (len) {
n = read(fd, buf, len);
if (n > 0) {
tot += n;
- buf += n;
- len -= n;
- }
- if (tot % min == 0) break;
- FD_ZERO(&set);
- FD_SET(fd, &set);
- tv.tv_sec = 0;
- tv.tv_usec = 100 * 1000;
- n = select(fd + 1, &set, 0, 0, &tv);
- if (n <= 0) break;
+ buf += n;
+ len -= n;
+ }
+ if (tot % min == 0)
+ break;
+ FD_ZERO(&set);
+ FD_SET(fd, &set);
+ tv.tv_sec = 0;
+ tv.tv_usec = 100 * 1000;
+ n = select(fd + 1, &set, 0, 0, &tv);
+ if (n <= 0)
+ break;
}
return tot;
}
-static void msLinuxButton(DevicePtr pDev, ENQUEUEPROC enqueue, int buttons,
- BLOCK block)
+static void
+msLinuxButton(DevicePtr pDev, ENQUEUEPROC enqueue, int buttons, BLOCK block)
{
GETPRIV;
@@ -155,21 +158,31 @@ static void msLinuxButton(DevicePtr pDev, ENQUEUEPROC enqueue, int buttons,
do { \
enqueue(pDev, ButtonRelease, 0, 0, NULL, block); \
} while (0)
-
- if ((buttons & button1) && !(priv->buttons & button1)) PRESS(1);
- if (!(buttons & button1) && (priv->buttons & button1)) RELEASE(1);
- if ((buttons & button2) && !(priv->buttons & button2)) PRESS(2);
- if (!(buttons & button2) && (priv->buttons & button2)) RELEASE(2);
+ if ((buttons & button1) && !(priv->buttons & button1))
+ PRESS(1);
+ if (!(buttons & button1) && (priv->buttons & button1))
+ RELEASE(1);
+
+ if ((buttons & button2) && !(priv->buttons & button2))
+ PRESS(2);
+ if (!(buttons & button2) && (priv->buttons & button2))
+ RELEASE(2);
+
+ if ((buttons & button3) && !(priv->buttons & button3))
+ PRESS(3);
+ if (!(buttons & button3) && (priv->buttons & button3))
+ RELEASE(3);
- if ((buttons & button3) && !(priv->buttons & button3)) PRESS(3);
- if (!(buttons & button3) && (priv->buttons & button3)) RELEASE(3);
+ if ((buttons & button4) && !(priv->buttons & button4))
+ PRESS(4);
+ if (!(buttons & button4) && (priv->buttons & button4))
+ RELEASE(4);
- if ((buttons & button4) && !(priv->buttons & button4)) PRESS(4);
- if (!(buttons & button4) && (priv->buttons & button4)) RELEASE(4);
-
- if ((buttons & button5) && !(priv->buttons & button5)) PRESS(5);
- if (!(buttons & button5) && (priv->buttons & button5)) RELEASE(5);
+ if ((buttons & button5) && !(priv->buttons & button5))
+ PRESS(5);
+ if (!(buttons & button5) && (priv->buttons & button5))
+ RELEASE(5);
priv->buttons = buttons;
}
@@ -180,52 +193,53 @@ static void msLinuxButton(DevicePtr pDev, ENQUEUEPROC enqueue, int buttons,
* with the \a enqueue function. The \a block type is passed to the
* functions so that they may block SIGIO handling as appropriate to the
* caller of this function. */
-void msLinuxRead(DevicePtr pDev,
- MOTIONPROC motion,
- ENQUEUEPROC enqueue,
- CHECKPROC checkspecial,
- BLOCK block)
+void
+msLinuxRead(DevicePtr pDev,
+ MOTIONPROC motion,
+ ENQUEUEPROC enqueue, CHECKPROC checkspecial, BLOCK block)
{
GETPRIV;
- unsigned char buf[3 * 200]; /* RATS: Use ok */
- unsigned char *b;
- int n;
- int dx, dy, v[2];
+ unsigned char buf[3 * 200]; /* RATS: Use ok */
+ unsigned char *b;
+ int n;
+ int dx, dy, v[2];
while ((n = msLinuxReadBytes(priv->fd, buf, sizeof(buf), 3)) > 0) {
- b = buf;
- while (n >= 3) {
- dx = (char)(((b[0] & 0x03) << 6) | (b[1] & 0x3f));
- dy = (char)(((b[0] & 0x0c) << 4) | (b[2] & 0x3f));
+ b = buf;
+ while (n >= 3) {
+ dx = (char) (((b[0] & 0x03) << 6) | (b[1] & 0x3f));
+ dy = (char) (((b[0] & 0x0c) << 4) | (b[2] & 0x3f));
v[0] = -dx;
v[1] = -dy;
-
+
motion(pDev, v, 0, 2, 1, block);
msLinuxButton(pDev, enqueue, (((b[0] & 0x10) ? button3 : 0)
| ((b[0] & 0x20) ? button1 : 0)),
block);
n -= 3;
b += 3;
- }
+ }
}
}
/** Initialize \a pDev. */
-void msLinuxInit(DevicePtr pDev)
+void
+msLinuxInit(DevicePtr pDev)
{
GETPRIV;
const char *names[] = { "/dev/serialmouse", "/dev/mouse", NULL };
- int i;
+ int i;
- if (priv->fd >=0) return;
+ if (priv->fd >= 0)
+ return;
for (i = 0; names[i]; i++) {
- if ((priv->fd = open(names[i], O_RDWR | O_NONBLOCK, 0)) >= 0) break;
+ if ((priv->fd = open(names[i], O_RDWR | O_NONBLOCK, 0)) >= 0)
+ break;
}
if (priv->fd < 0)
- FATAL1("msLinuxInit: Cannot open mouse port (%s)\n",
- strerror(errno));
-
+ FATAL1("msLinuxInit: Cannot open mouse port (%s)\n", strerror(errno));
+
if (!isatty(priv->fd))
FATAL1("msLinuxInit: Mouse port %s is not a tty\n", names[i]);
@@ -237,24 +251,26 @@ void msLinuxInit(DevicePtr pDev)
}
/** Turn \a pDev on (i.e., take input from \a pDev). */
-int msLinuxOn(DevicePtr pDev)
+int
+msLinuxOn(DevicePtr pDev)
{
GETPRIV;
struct termios nTty;
- if (priv->fd < 0) msLinuxInit(pDev);
-
- nTty = priv->tty;
- nTty.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR
- | IGNCR | ICRNL | IXON | IXOFF);
- nTty.c_oflag &= ~OPOST;
- nTty.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
- nTty.c_cflag &= ~(CSIZE | PARENB);
- nTty.c_cflag |= CS8 | CLOCAL | CSTOPB;
+ if (priv->fd < 0)
+ msLinuxInit(pDev);
+
+ nTty = priv->tty;
+ nTty.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR
+ | IGNCR | ICRNL | IXON | IXOFF);
+ nTty.c_oflag &= ~OPOST;
+ nTty.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
+ nTty.c_cflag &= ~(CSIZE | PARENB);
+ nTty.c_cflag |= CS8 | CLOCAL | CSTOPB;
nTty.c_cc[VTIME] = 0;
- nTty.c_cc[VMIN] = 1;
- cfsetispeed (&nTty, B1200);
- cfsetospeed (&nTty, B1200);
+ nTty.c_cc[VMIN] = 1;
+ cfsetispeed(&nTty, B1200);
+ cfsetospeed(&nTty, B1200);
if (tcsetattr(priv->fd, TCSANOW, &nTty) < 0)
FATAL1("msLinuxInit: tcsetattr failed (%s)\n", strerror(errno));
write(priv->fd, "*V", 2); /* 2 button 3 byte protocol */
@@ -262,7 +278,8 @@ int msLinuxOn(DevicePtr pDev)
}
/** Turn \a pDev off (i.e., stop taking input from \a pDev). */
-void msLinuxOff(DevicePtr pDev)
+void
+msLinuxOff(DevicePtr pDev)
{
GETPRIV;
@@ -271,51 +288,61 @@ void msLinuxOff(DevicePtr pDev)
priv->fd = -1;
}
-static void msLinuxGetMap(DevicePtr pDev, unsigned char *map, int *nButtons)
+static void
+msLinuxGetMap(DevicePtr pDev, unsigned char *map, int *nButtons)
{
int i;
-
- if (nButtons) *nButtons = 3;
- if (map) for (i = 0; i <= *nButtons; i++) map[i] = i;
+
+ if (nButtons)
+ *nButtons = 3;
+ if (map)
+ for (i = 0; i <= *nButtons; i++)
+ map[i] = i;
}
/** Currently unused hook called prior to an VT switch. */
-void msLinuxVTPreSwitch(pointer p)
+void
+msLinuxVTPreSwitch(pointer p)
{
}
/** Currently unused hook called after returning from a VT switch. */
-void msLinuxVTPostSwitch(pointer p)
+void
+msLinuxVTPostSwitch(pointer p)
{
}
/** Create a private structure for use within this file. */
-pointer msLinuxCreatePrivate(DeviceIntPtr pMouse)
+pointer
+msLinuxCreatePrivate(DeviceIntPtr pMouse)
{
myPrivate *priv = calloc(1, sizeof(*priv));
- priv->fd = -1;
+
+ priv->fd = -1;
priv->pMouse = pMouse;
return priv;
}
/** Destroy a private structure. */
-void msLinuxDestroyPrivate(pointer priv)
+void
+msLinuxDestroyPrivate(pointer priv)
{
free(priv);
}
/** Fill the \a info structure with information needed to initialize \a
- * pDev. */
-void msLinuxGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
+ * pDev. */
+void
+msLinuxGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
{
- info->buttonClass = 1;
+ info->buttonClass = 1;
msLinuxGetMap(pDev, info->map, &info->numButtons);
- info->valuatorClass = 1;
- info->numRelAxes = 2;
- info->minval[0] = 0;
- info->maxval[0] = 0;
- info->res[0] = 1;
- info->minres[0] = 0;
- info->maxres[0] = 1;
+ info->valuatorClass = 1;
+ info->numRelAxes = 2;
+ info->minval[0] = 0;
+ info->maxval[0] = 0;
+ info->res[0] = 1;
+ info->minres[0] = 0;
+ info->maxres[0] = 1;
info->ptrFeedbackClass = 1;
}
diff --git a/hw/dmx/input/lnx-ms.h b/hw/dmx/input/lnx-ms.h
index 9042fc293..28ed09557 100644
--- a/hw/dmx/input/lnx-ms.h
+++ b/hw/dmx/input/lnx-ms.h
@@ -38,18 +38,18 @@
#define _LNX_MS_H_
extern pointer msLinuxCreatePrivate(DeviceIntPtr pMouse);
-extern void msLinuxDestroyPrivate(pointer priv);
-extern void msLinuxRead(DevicePtr pDev,
- dmxMotionProcPtr motion,
- dmxEnqueueProcPtr enqueue,
- dmxCheckSpecialProcPtr checkspecial,
- DMXBlockType block);
-extern void msLinuxInit(DevicePtr pDev);
-extern void msLinuxGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
-extern int msLinuxOn(DevicePtr pDev);
-extern void msLinuxOff(DevicePtr pDev);
-extern void msLinuxCtrl(DevicePtr pDev, PtrCtrl *ctrl);
-extern void msLinuxVTPreSwitch(pointer p);
-extern void msLinuxVTPostSwitch(pointer p);
+extern void msLinuxDestroyPrivate(pointer priv);
+extern void msLinuxRead(DevicePtr pDev,
+ dmxMotionProcPtr motion,
+ dmxEnqueueProcPtr enqueue,
+ dmxCheckSpecialProcPtr checkspecial,
+ DMXBlockType block);
+extern void msLinuxInit(DevicePtr pDev);
+extern void msLinuxGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
+extern int msLinuxOn(DevicePtr pDev);
+extern void msLinuxOff(DevicePtr pDev);
+extern void msLinuxCtrl(DevicePtr pDev, PtrCtrl * ctrl);
+extern void msLinuxVTPreSwitch(pointer p);
+extern void msLinuxVTPostSwitch(pointer p);
#endif
diff --git a/hw/dmx/input/lnx-ps2.c b/hw/dmx/input/lnx-ps2.c
index 3a220cf01..67c73a0c5 100644
--- a/hw/dmx/input/lnx-ps2.c
+++ b/hw/dmx/input/lnx-ps2.c
@@ -101,47 +101,50 @@
/* Private area for PS/2 devices. */
typedef struct _myPrivate {
- DeviceIntPtr pMouse;
- int fd;
+ DeviceIntPtr pMouse;
+ int fd;
enum {
button1 = 0x0001,
button2 = 0x0002,
button3 = 0x0004,
button4 = 0x0008,
button5 = 0x0010
- } buttons;
+ } buttons;
} myPrivate;
-static int ps2LinuxReadBytes(int fd, unsigned char *buf, int len, int min)
+static int
+ps2LinuxReadBytes(int fd, unsigned char *buf, int len, int min)
{
- int n, tot;
- fd_set set;
- struct timeval tv;
-
+ int n, tot;
+ fd_set set;
+ struct timeval tv;
+
tot = 0;
while (len) {
n = read(fd, buf, len);
if (n > 0) {
tot += n;
- buf += n;
- len -= n;
- }
- if (tot % min == 0) break;
- FD_ZERO(&set);
- FD_SET(fd, &set);
- tv.tv_sec = 0;
- tv.tv_usec = 100 * 1000;
- n = select(fd + 1, &set, 0, 0, &tv);
- if (n <= 0) break;
+ buf += n;
+ len -= n;
+ }
+ if (tot % min == 0)
+ break;
+ FD_ZERO(&set);
+ FD_SET(fd, &set);
+ tv.tv_sec = 0;
+ tv.tv_usec = 100 * 1000;
+ n = select(fd + 1, &set, 0, 0, &tv);
+ if (n <= 0)
+ break;
}
return tot;
}
-static void ps2LinuxButton(DevicePtr pDev, ENQUEUEPROC enqueue,
- int buttons, BLOCK block)
+static void
+ps2LinuxButton(DevicePtr pDev, ENQUEUEPROC enqueue, int buttons, BLOCK block)
{
GETPRIV;
-
+
#define PRESS(b) \
do { \
enqueue(pDev, ButtonPress, 0, 0, NULL, block); \
@@ -151,21 +154,31 @@ static void ps2LinuxButton(DevicePtr pDev, ENQUEUEPROC enqueue,
do { \
enqueue(pDev, ButtonRelease, 0, 0, NULL, block); \
} while (0)
-
- if ((buttons & button1) && !(priv->buttons & button1)) PRESS(1);
- if (!(buttons & button1) && (priv->buttons & button1)) RELEASE(1);
- if ((buttons & button2) && !(priv->buttons & button2)) PRESS(2);
- if (!(buttons & button2) && (priv->buttons & button2)) RELEASE(2);
+ if ((buttons & button1) && !(priv->buttons & button1))
+ PRESS(1);
+ if (!(buttons & button1) && (priv->buttons & button1))
+ RELEASE(1);
+
+ if ((buttons & button2) && !(priv->buttons & button2))
+ PRESS(2);
+ if (!(buttons & button2) && (priv->buttons & button2))
+ RELEASE(2);
- if ((buttons & button3) && !(priv->buttons & button3)) PRESS(3);
- if (!(buttons & button3) && (priv->buttons & button3)) RELEASE(3);
+ if ((buttons & button3) && !(priv->buttons & button3))
+ PRESS(3);
+ if (!(buttons & button3) && (priv->buttons & button3))
+ RELEASE(3);
- if ((buttons & button4) && !(priv->buttons & button4)) PRESS(4);
- if (!(buttons & button4) && (priv->buttons & button4)) RELEASE(4);
-
- if ((buttons & button5) && !(priv->buttons & button5)) PRESS(5);
- if (!(buttons & button5) && (priv->buttons & button5)) RELEASE(5);
+ if ((buttons & button4) && !(priv->buttons & button4))
+ PRESS(4);
+ if (!(buttons & button4) && (priv->buttons & button4))
+ RELEASE(4);
+
+ if ((buttons & button5) && !(priv->buttons & button5))
+ PRESS(5);
+ if (!(buttons & button5) && (priv->buttons & button5))
+ RELEASE(5);
priv->buttons = buttons;
}
@@ -176,20 +189,21 @@ static void ps2LinuxButton(DevicePtr pDev, ENQUEUEPROC enqueue,
* with the \a enqueue function. The \a block type is passed to the
* functions so that they may block SIGIO handling as appropriate to the
* caller of this function. */
-void ps2LinuxRead(DevicePtr pDev, MOTIONPROC motion,
- ENQUEUEPROC enqueue, CHECKPROC checkspecial, BLOCK block)
+void
+ps2LinuxRead(DevicePtr pDev, MOTIONPROC motion,
+ ENQUEUEPROC enqueue, CHECKPROC checkspecial, BLOCK block)
{
GETPRIV;
- unsigned char buf[3 * 200]; /* RATS: Use ok */
- unsigned char *b;
- int n;
- int dx, dy, v[2];
+ unsigned char buf[3 * 200]; /* RATS: Use ok */
+ unsigned char *b;
+ int n;
+ int dx, dy, v[2];
while ((n = ps2LinuxReadBytes(priv->fd, buf, sizeof(buf), 3)) > 0) {
- b = buf;
- while (n >= 3) {
- dx = b[1] - ((b[0] & 0x10) ? 256 : 0);
- dy = -b[2] + ((b[0] & 0x20) ? 256 : 0);
+ b = buf;
+ while (n >= 3) {
+ dx = b[1] - ((b[0] & 0x10) ? 256 : 0);
+ dy = -b[2] + ((b[0] & 0x20) ? 256 : 0);
v[0] = -dx;
v[1] = -dy;
@@ -200,38 +214,43 @@ void ps2LinuxRead(DevicePtr pDev, MOTIONPROC motion,
block);
n -= 3;
b += 3;
- }
+ }
}
}
/** Initialize \a pDev. */
-void ps2LinuxInit(DevicePtr pDev)
+void
+ps2LinuxInit(DevicePtr pDev)
{
GETPRIV;
const char *names[] = { "/dev/mouse", "/dev/psaux", NULL };
- int i;
+ int i;
- if (priv->fd >=0) return;
+ if (priv->fd >= 0)
+ return;
for (i = 0; names[i]; i++) {
- if ((priv->fd = open(names[i], O_RDWR | O_NONBLOCK, 0)) >= 0) break;
+ if ((priv->fd = open(names[i], O_RDWR | O_NONBLOCK, 0)) >= 0)
+ break;
}
if (priv->fd < 0)
- FATAL1("ps2LinuxInit: Cannot open mouse port (%s)\n",
- strerror(errno));
+ FATAL1("ps2LinuxInit: Cannot open mouse port (%s)\n", strerror(errno));
}
/** Turn \a pDev on (i.e., take input from \a pDev). */
-int ps2LinuxOn(DevicePtr pDev)
+int
+ps2LinuxOn(DevicePtr pDev)
{
GETPRIV;
- if (priv->fd < 0) ps2LinuxInit(pDev);
+ if (priv->fd < 0)
+ ps2LinuxInit(pDev);
return priv->fd;
}
/** Turn \a pDev off (i.e., stop taking input from \a pDev). */
-void ps2LinuxOff(DevicePtr pDev)
+void
+ps2LinuxOff(DevicePtr pDev)
{
GETPRIV;
@@ -239,51 +258,61 @@ void ps2LinuxOff(DevicePtr pDev)
priv->fd = -1;
}
-static void ps2LinuxGetMap(DevicePtr pDev, unsigned char *map, int *nButtons)
+static void
+ps2LinuxGetMap(DevicePtr pDev, unsigned char *map, int *nButtons)
{
int i;
-
- if (nButtons) *nButtons = 3;
- if (map) for (i = 0; i <= *nButtons; i++) map[i] = i;
+
+ if (nButtons)
+ *nButtons = 3;
+ if (map)
+ for (i = 0; i <= *nButtons; i++)
+ map[i] = i;
}
/** Currently unused hook called prior to an VT switch. */
-void ps2LinuxVTPreSwitch(pointer p)
+void
+ps2LinuxVTPreSwitch(pointer p)
{
}
/** Currently unused hook called after returning from a VT switch. */
-void ps2LinuxVTPostSwitch(pointer p)
+void
+ps2LinuxVTPostSwitch(pointer p)
{
}
/** Create a private structure for use within this file. */
-pointer ps2LinuxCreatePrivate(DeviceIntPtr pMouse)
+pointer
+ps2LinuxCreatePrivate(DeviceIntPtr pMouse)
{
myPrivate *priv = calloc(1, sizeof(*priv));
- priv->fd = -1;
+
+ priv->fd = -1;
priv->pMouse = pMouse;
return priv;
}
/** Destroy a private structure. */
-void ps2LinuxDestroyPrivate(pointer priv)
+void
+ps2LinuxDestroyPrivate(pointer priv)
{
free(priv);
}
/** Fill the \a info structure with information needed to initialize \a
- * pDev. */
-void ps2LinuxGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
+ * pDev. */
+void
+ps2LinuxGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
{
- info->buttonClass = 1;
+ info->buttonClass = 1;
ps2LinuxGetMap(pDev, info->map, &info->numButtons);
- info->valuatorClass = 1;
- info->numRelAxes = 2;
- info->minval[0] = 0;
- info->maxval[0] = 0;
- info->res[0] = 1;
- info->minres[0] = 0;
- info->maxres[0] = 1;
+ info->valuatorClass = 1;
+ info->numRelAxes = 2;
+ info->minval[0] = 0;
+ info->maxval[0] = 0;
+ info->res[0] = 1;
+ info->minres[0] = 0;
+ info->maxres[0] = 1;
info->ptrFeedbackClass = 1;
}
diff --git a/hw/dmx/input/lnx-ps2.h b/hw/dmx/input/lnx-ps2.h
index 5772e03d0..93f0f0219 100644
--- a/hw/dmx/input/lnx-ps2.h
+++ b/hw/dmx/input/lnx-ps2.h
@@ -38,18 +38,18 @@
#define _LNX_PS2_H_
extern pointer ps2LinuxCreatePrivate(DeviceIntPtr pMouse);
-extern void ps2LinuxDestroyPrivate(pointer priv);
-extern void ps2LinuxRead(DevicePtr pDev,
- dmxMotionProcPtr motion,
- dmxEnqueueProcPtr enqueue,
- dmxCheckSpecialProcPtr checkspecial,
- DMXBlockType block);
-extern void ps2LinuxInit(DevicePtr pDev);
-extern void ps2LinuxGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
-extern int ps2LinuxOn(DevicePtr pDev);
-extern void ps2LinuxOff(DevicePtr pDev);
-extern void ps2LinuxCtrl(DevicePtr pDev, PtrCtrl *ctrl);
-extern void ps2LinuxVTPreSwitch(pointer p);
-extern void ps2LinuxVTPostSwitch(pointer p);
+extern void ps2LinuxDestroyPrivate(pointer priv);
+extern void ps2LinuxRead(DevicePtr pDev,
+ dmxMotionProcPtr motion,
+ dmxEnqueueProcPtr enqueue,
+ dmxCheckSpecialProcPtr checkspecial,
+ DMXBlockType block);
+extern void ps2LinuxInit(DevicePtr pDev);
+extern void ps2LinuxGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
+extern int ps2LinuxOn(DevicePtr pDev);
+extern void ps2LinuxOff(DevicePtr pDev);
+extern void ps2LinuxCtrl(DevicePtr pDev, PtrCtrl * ctrl);
+extern void ps2LinuxVTPreSwitch(pointer p);
+extern void ps2LinuxVTPostSwitch(pointer p);
#endif
diff --git a/hw/dmx/input/usb-common.c b/hw/dmx/input/usb-common.c
index 944033eba..c7c166cce 100644
--- a/hw/dmx/input/usb-common.c
+++ b/hw/dmx/input/usb-common.c
@@ -74,7 +74,6 @@
/* End of interface definitions. */
/*****************************************************************************/
-
/** Read an event from the \a pDev device. If the event is a motion
* event, enqueue it with the \a motion function. Otherwise, enqueue
* the event with the \a enqueue function. The \a block type is passed
@@ -84,16 +83,14 @@
* Since USB devices return EV_KEY events for buttons and keys, \a
* minButton is used to decide if a Button or Key event should be
* queued.*/
-void usbRead(DevicePtr pDev,
- MOTIONPROC motion,
- ENQUEUEPROC enqueue,
- int minButton,
- BLOCK block)
+void
+usbRead(DevicePtr pDev,
+ MOTIONPROC motion, ENQUEUEPROC enqueue, int minButton, BLOCK block)
{
GETPRIV;
struct input_event raw;
- int v[DMX_MAX_AXES];
- int axis;
+ int v[DMX_MAX_AXES];
+ int axis;
#define PRESS(b) \
do { \
@@ -112,11 +109,14 @@ void usbRead(DevicePtr pDev,
#endif
switch (raw.type) {
case EV_KEY:
- /* raw.value = 1 for first, 2 for repeat */
+ /* raw.value = 1 for first, 2 for repeat */
if (raw.code > minButton) {
- if (raw.value) PRESS((raw.code & 0x0f) + 1);
- else RELEASE((raw.code & 0x0f) + 1);
- } else {
+ if (raw.value)
+ PRESS((raw.code & 0x0f) + 1);
+ else
+ RELEASE((raw.code & 0x0f) + 1);
+ }
+ else {
enqueue(pDev, raw.value ? KeyPress : KeyRelease,
0, 0, NULL, block);
}
@@ -134,10 +134,11 @@ void usbRead(DevicePtr pDev,
motion(pDev, v, 0, 2, DMX_RELATIVE, block);
break;
case REL_WHEEL:
- if ((int)raw.value > 0) {
+ if ((int) raw.value > 0) {
PRESS(4);
RELEASE(4);
- } else if ((int)raw.value < 0) {
+ }
+ else if ((int) raw.value < 0) {
PRESS(5);
RELEASE(5);
}
@@ -162,126 +163,228 @@ void usbRead(DevicePtr pDev,
#define test_bit(bit) (priv->mask[(bit)/8] & (1 << ((bit)%8)))
#define test_bits(bit) (bits[(bit)/8] & (1 << ((bit)%8)))
-static void usbPrint(myPrivate *priv,
- const char *filename, const char *devname, int fd)
+static void
+usbPrint(myPrivate * priv, const char *filename, const char *devname, int fd)
{
- int j, k;
- DeviceIntPtr pDevice = priv->pDevice;
- unsigned char bits[KEY_MAX/8 + 1]; /* RATS: Use ok assuming that
- * KEY_MAX is greater than
- * REL_MAX, ABS_MAX, SND_MAX, and
- * LED_MAX. */
+ int j, k;
+ DeviceIntPtr pDevice = priv->pDevice;
+ unsigned char bits[KEY_MAX / 8 + 1]; /* RATS: Use ok assuming that
+ * KEY_MAX is greater than
+ * REL_MAX, ABS_MAX, SND_MAX, and
+ * LED_MAX. */
LOG3INPUT(priv, "%s (%s) using %s\n", pDevice->name, GETNAME, filename);
LOG1INPUT(priv, " %s\n", devname);
for (j = 0; j < EV_MAX; j++) {
if (test_bit(j)) {
- const char *type = "unknown";
- char extra[256]; /* FIXME: may cause buffer overflow */
+ const char *type = "unknown";
+ char extra[256]; /* FIXME: may cause buffer overflow */
+
extra[0] = '\0';
- switch(j) {
- case EV_KEY: type = "keys/buttons"; break;
- case EV_REL: type = "relative";
+ switch (j) {
+ case EV_KEY:
+ type = "keys/buttons";
+ break;
+ case EV_REL:
+ type = "relative";
memset(bits, 0, sizeof(bits));
ioctl(priv->fd, EVIOCGBIT(EV_REL, sizeof(bits)), bits);
for (k = 0; k < REL_MAX; k++) {
- if (test_bits(k)) switch (k) {
- case REL_X: strcat(extra, " X"); break;
- case REL_Y: strcat(extra, " Y"); break;
- case REL_Z: strcat(extra, " Z"); break;
- case REL_HWHEEL: strcat(extra, " HWheel"); break;
- case REL_DIAL: strcat(extra, " Dial"); break;
- case REL_WHEEL: strcat(extra, " Wheel"); break;
- case REL_MISC: strcat(extra, " Misc"); break;
- }
+ if (test_bits(k))
+ switch (k) {
+ case REL_X:
+ strcat(extra, " X");
+ break;
+ case REL_Y:
+ strcat(extra, " Y");
+ break;
+ case REL_Z:
+ strcat(extra, " Z");
+ break;
+ case REL_HWHEEL:
+ strcat(extra, " HWheel");
+ break;
+ case REL_DIAL:
+ strcat(extra, " Dial");
+ break;
+ case REL_WHEEL:
+ strcat(extra, " Wheel");
+ break;
+ case REL_MISC:
+ strcat(extra, " Misc");
+ break;
+ }
}
break;
- case EV_ABS: type = "absolute";
+ case EV_ABS:
+ type = "absolute";
memset(bits, 0, sizeof(bits));
ioctl(priv->fd, EVIOCGBIT(EV_ABS, sizeof(bits)), bits);
for (k = 0; k < ABS_MAX; k++) {
- if (test_bits(k)) switch (k) {
- case ABS_X: strcat(extra," X"); break;
- case ABS_Y: strcat(extra," Y"); break;
- case ABS_Z: strcat(extra," Z"); break;
- case ABS_RX: strcat(extra," RX"); break;
- case ABS_RY: strcat(extra," RY"); break;
- case ABS_RZ: strcat(extra," RZ"); break;
- case ABS_THROTTLE: strcat(extra," Throttle");break;
- case ABS_RUDDER: strcat(extra," Rudder"); break;
- case ABS_WHEEL: strcat(extra," Wheel"); break;
- case ABS_GAS: strcat(extra," Gas"); break;
- case ABS_BRAKE: strcat(extra," Break"); break;
- case ABS_HAT0X: strcat(extra," Hat0X"); break;
- case ABS_HAT0Y: strcat(extra," Hat0Y"); break;
- case ABS_HAT1X: strcat(extra," Hat1X"); break;
- case ABS_HAT1Y: strcat(extra," Hat1Y"); break;
- case ABS_HAT2X: strcat(extra," Hat2X"); break;
- case ABS_HAT2Y: strcat(extra," Hat2Y"); break;
- case ABS_HAT3X: strcat(extra," Hat3X"); break;
- case ABS_HAT3Y: strcat(extra," Hat3Y"); break;
- case ABS_PRESSURE: strcat(extra," Pressure");break;
- case ABS_DISTANCE: strcat(extra," Distance");break;
- case ABS_TILT_X: strcat(extra," TiltX"); break;
- case ABS_TILT_Y: strcat(extra," TiltY"); break;
- case ABS_MISC: strcat(extra," Misc"); break;
- }
+ if (test_bits(k))
+ switch (k) {
+ case ABS_X:
+ strcat(extra, " X");
+ break;
+ case ABS_Y:
+ strcat(extra, " Y");
+ break;
+ case ABS_Z:
+ strcat(extra, " Z");
+ break;
+ case ABS_RX:
+ strcat(extra, " RX");
+ break;
+ case ABS_RY:
+ strcat(extra, " RY");
+ break;
+ case ABS_RZ:
+ strcat(extra, " RZ");
+ break;
+ case ABS_THROTTLE:
+ strcat(extra, " Throttle");
+ break;
+ case ABS_RUDDER:
+ strcat(extra, " Rudder");
+ break;
+ case ABS_WHEEL:
+ strcat(extra, " Wheel");
+ break;
+ case ABS_GAS:
+ strcat(extra, " Gas");
+ break;
+ case ABS_BRAKE:
+ strcat(extra, " Break");
+ break;
+ case ABS_HAT0X:
+ strcat(extra, " Hat0X");
+ break;
+ case ABS_HAT0Y:
+ strcat(extra, " Hat0Y");
+ break;
+ case ABS_HAT1X:
+ strcat(extra, " Hat1X");
+ break;
+ case ABS_HAT1Y:
+ strcat(extra, " Hat1Y");
+ break;
+ case ABS_HAT2X:
+ strcat(extra, " Hat2X");
+ break;
+ case ABS_HAT2Y:
+ strcat(extra, " Hat2Y");
+ break;
+ case ABS_HAT3X:
+ strcat(extra, " Hat3X");
+ break;
+ case ABS_HAT3Y:
+ strcat(extra, " Hat3Y");
+ break;
+ case ABS_PRESSURE:
+ strcat(extra, " Pressure");
+ break;
+ case ABS_DISTANCE:
+ strcat(extra, " Distance");
+ break;
+ case ABS_TILT_X:
+ strcat(extra, " TiltX");
+ break;
+ case ABS_TILT_Y:
+ strcat(extra, " TiltY");
+ break;
+ case ABS_MISC:
+ strcat(extra, " Misc");
+ break;
+ }
}
break;
- case EV_MSC: type = "reserved"; break;
- case EV_LED: type = "leds";
+ case EV_MSC:
+ type = "reserved";
+ break;
+ case EV_LED:
+ type = "leds";
memset(bits, 0, sizeof(bits));
ioctl(priv->fd, EVIOCGBIT(EV_LED, sizeof(bits)), bits);
for (k = 0; k < LED_MAX; k++) {
- if (test_bits(k)) switch (k) {
- case LED_NUML: strcat(extra," NumLock"); break;
- case LED_CAPSL: strcat(extra," CapsLock"); break;
- case LED_SCROLLL: strcat(extra," ScrlLock"); break;
- case LED_COMPOSE: strcat(extra," Compose"); break;
- case LED_KANA: strcat(extra," Kana"); break;
- case LED_SLEEP: strcat(extra," Sleep"); break;
- case LED_SUSPEND: strcat(extra," Suspend"); break;
- case LED_MUTE: strcat(extra," Mute"); break;
- case LED_MISC: strcat(extra," Misc"); break;
- }
+ if (test_bits(k))
+ switch (k) {
+ case LED_NUML:
+ strcat(extra, " NumLock");
+ break;
+ case LED_CAPSL:
+ strcat(extra, " CapsLock");
+ break;
+ case LED_SCROLLL:
+ strcat(extra, " ScrlLock");
+ break;
+ case LED_COMPOSE:
+ strcat(extra, " Compose");
+ break;
+ case LED_KANA:
+ strcat(extra, " Kana");
+ break;
+ case LED_SLEEP:
+ strcat(extra, " Sleep");
+ break;
+ case LED_SUSPEND:
+ strcat(extra, " Suspend");
+ break;
+ case LED_MUTE:
+ strcat(extra, " Mute");
+ break;
+ case LED_MISC:
+ strcat(extra, " Misc");
+ break;
+ }
}
break;
- case EV_SND: type = "sound";
+ case EV_SND:
+ type = "sound";
memset(bits, 0, sizeof(bits));
ioctl(priv->fd, EVIOCGBIT(EV_SND, sizeof(bits)), bits);
for (k = 0; k < SND_MAX; k++) {
- if (test_bits(k)) switch (k) {
- case SND_CLICK: strcat(extra," Click"); break;
- case SND_BELL: strcat(extra," Bell"); break;
- }
+ if (test_bits(k))
+ switch (k) {
+ case SND_CLICK:
+ strcat(extra, " Click");
+ break;
+ case SND_BELL:
+ strcat(extra, " Bell");
+ break;
+ }
}
break;
- case EV_REP: type = "repeat"; break;
- case EV_FF: type = "feedback"; break;
+ case EV_REP:
+ type = "repeat";
+ break;
+ case EV_FF:
+ type = "feedback";
+ break;
}
LOG5INPUT(priv, " Feature 0x%02x = %s%s%s%s\n", j, type,
extra[0] ? " [" : "",
- extra[0] ? extra+1 : "",
- extra[0] ? "]" : "");
+ extra[0] ? extra + 1 : "", extra[0] ? "]" : "");
}
}
}
/** Initialized \a pDev as a \a usbMouse, \a usbKeyboard, or \a usbOther
-device. */
-void usbInit(DevicePtr pDev, usbType type)
+device. */
+void
+usbInit(DevicePtr pDev, usbType type)
{
GETPRIV;
- char name[64]; /* RATS: Only used in snprintf */
- int i, j, k;
- char buf[256] = { 0, }; /* RATS: Use ok */
- int version;
- unsigned char bits[KEY_MAX/8 + 1]; /* RATS: Use ok assuming that
- * KEY_MAX is greater than
- * REL_MAX, ABS_MAX, SND_MAX, and
- * LED_MAX. */
+ char name[64]; /* RATS: Only used in snprintf */
+ int i, j, k;
+ char buf[256] = { 0, }; /* RATS: Use ok */
+ int version;
+ unsigned char bits[KEY_MAX / 8 + 1]; /* RATS: Use ok assuming that
+ * KEY_MAX is greater than
+ * REL_MAX, ABS_MAX, SND_MAX, and
+ * LED_MAX. */
- if (priv->fd >=0) return;
+ if (priv->fd >= 0)
+ return;
for (i = 0; i < 32; i++) {
snprintf(name, sizeof(name), "/dev/input/event%d", i);
@@ -293,15 +396,18 @@ void usbInit(DevicePtr pDev, usbType type)
for (j = 0; j < EV_MAX; j++) {
if (test_bit(j)) {
- switch(j) {
+ switch (j) {
case EV_REL:
memset(bits, 0, sizeof(bits));
ioctl(priv->fd, EVIOCGBIT(EV_REL, sizeof(bits)), bits);
for (k = 0; k < REL_MAX; k++) {
if (test_bits(k)) {
- if (k == REL_X) priv->relmap[k] = 0;
- else if (k == REL_Y) priv->relmap[k] = 1;
- else priv->relmap[k] = 2 + priv->numAbs;
+ if (k == REL_X)
+ priv->relmap[k] = 0;
+ else if (k == REL_Y)
+ priv->relmap[k] = 1;
+ else
+ priv->relmap[k] = 2 + priv->numAbs;
++priv->numRel;
}
}
@@ -320,7 +426,8 @@ void usbInit(DevicePtr pDev, usbType type)
memset(bits, 0, sizeof(bits));
ioctl(priv->fd, EVIOCGBIT(EV_LED, sizeof(bits)), bits);
for (k = 0; k < LED_MAX; k++) {
- if (test_bits(k)) ++priv->numLeds;
+ if (test_bits(k))
+ ++priv->numLeds;
}
break;
}
@@ -350,32 +457,36 @@ void usbInit(DevicePtr pDev, usbType type)
FATAL1("usbInit: Cannot open /dev/input/event* port (%s)\n"
" If you have not done so, you may need to:\n"
" rmmod mousedev; rmmod keybdev\n"
- " modprobe evdev\n",
- strerror(errno));
- found:
+ " modprobe evdev\n", strerror(errno));
+ found:
usbPrint(priv, name, buf, priv->fd);
}
/** Turn \a pDev off (i.e., stop taking input from \a pDev). */
-void usbOff(DevicePtr pDev)
+void
+usbOff(DevicePtr pDev)
{
GETPRIV;
- if (priv->fd >= 0) close(priv->fd);
+ if (priv->fd >= 0)
+ close(priv->fd);
priv->fd = -1;
}
/** Create a private structure for use within this file. */
-pointer usbCreatePrivate(DeviceIntPtr pDevice)
+pointer
+usbCreatePrivate(DeviceIntPtr pDevice)
{
myPrivate *priv = calloc(1, sizeof(*priv));
- priv->fd = -1;
- priv->pDevice = pDevice;
+
+ priv->fd = -1;
+ priv->pDevice = pDevice;
return priv;
}
/** Destroy a private structure. */
-void usbDestroyPrivate(pointer priv)
+void
+usbDestroyPrivate(pointer priv)
{
free(priv);
}
diff --git a/hw/dmx/input/usb-common.h b/hw/dmx/input/usb-common.h
index 5ebfd1e78..eea98afbe 100644
--- a/hw/dmx/input/usb-common.h
+++ b/hw/dmx/input/usb-common.h
@@ -44,12 +44,11 @@ typedef enum {
} usbType;
extern pointer usbCreatePrivate(DeviceIntPtr pDevice);
-extern void usbDestroyPrivate(pointer priv);
-extern void usbRead(DevicePtr pDev,
- dmxMotionProcPtr motion,
- dmxEnqueueProcPtr enqueue,
- int minButton,
- DMXBlockType block);
-extern void usbInit(DevicePtr pDev, usbType type);
-extern void usbOff(DevicePtr pDev);
+extern void usbDestroyPrivate(pointer priv);
+extern void usbRead(DevicePtr pDev,
+ dmxMotionProcPtr motion,
+ dmxEnqueueProcPtr enqueue,
+ int minButton, DMXBlockType block);
+extern void usbInit(DevicePtr pDev, usbType type);
+extern void usbOff(DevicePtr pDev);
#endif
diff --git a/hw/dmx/input/usb-keyboard.c b/hw/dmx/input/usb-keyboard.c
index 9db1adbfc..65bfcd00d 100644
--- a/hw/dmx/input/usb-keyboard.c
+++ b/hw/dmx/input/usb-keyboard.c
@@ -112,199 +112,209 @@
static KeySym map[NUM_KEYCODES * GLYPHS_PER_KEY] = {
/* Table modified from xc/programs/Xserver/hw/xfree86/common/xf86Keymap.h */
- /* 0x00 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x01 */ XK_Escape, NoSymbol, NoSymbol, NoSymbol,
- /* 0x02 */ XK_1, XK_exclam, NoSymbol, NoSymbol,
- /* 0x03 */ XK_2, XK_at, NoSymbol, NoSymbol,
- /* 0x04 */ XK_3, XK_numbersign, NoSymbol, NoSymbol,
- /* 0x05 */ XK_4, XK_dollar, NoSymbol, NoSymbol,
- /* 0x06 */ XK_5, XK_percent, NoSymbol, NoSymbol,
- /* 0x07 */ XK_6, XK_asciicircum, NoSymbol, NoSymbol,
- /* 0x08 */ XK_7, XK_ampersand, NoSymbol, NoSymbol,
- /* 0x09 */ XK_8, XK_asterisk, NoSymbol, NoSymbol,
- /* 0x0a */ XK_9, XK_parenleft, NoSymbol, NoSymbol,
- /* 0x0b */ XK_0, XK_parenright, NoSymbol, NoSymbol,
- /* 0x0c */ XK_minus, XK_underscore, NoSymbol, NoSymbol,
- /* 0x0d */ XK_equal, XK_plus, NoSymbol, NoSymbol,
- /* 0x0e */ XK_BackSpace, NoSymbol, NoSymbol, NoSymbol,
- /* 0x0f */ XK_Tab, XK_ISO_Left_Tab,NoSymbol, NoSymbol,
- /* 0x10 */ XK_Q, NoSymbol, NoSymbol, NoSymbol,
- /* 0x11 */ XK_W, NoSymbol, NoSymbol, NoSymbol,
- /* 0x12 */ XK_E, NoSymbol, NoSymbol, NoSymbol,
- /* 0x13 */ XK_R, NoSymbol, NoSymbol, NoSymbol,
- /* 0x14 */ XK_T, NoSymbol, NoSymbol, NoSymbol,
- /* 0x15 */ XK_Y, NoSymbol, NoSymbol, NoSymbol,
- /* 0x16 */ XK_U, NoSymbol, NoSymbol, NoSymbol,
- /* 0x17 */ XK_I, NoSymbol, NoSymbol, NoSymbol,
- /* 0x18 */ XK_O, NoSymbol, NoSymbol, NoSymbol,
- /* 0x19 */ XK_P, NoSymbol, NoSymbol, NoSymbol,
- /* 0x1a */ XK_bracketleft, XK_braceleft, NoSymbol, NoSymbol,
- /* 0x1b */ XK_bracketright,XK_braceright, NoSymbol, NoSymbol,
- /* 0x1c */ XK_Return, NoSymbol, NoSymbol, NoSymbol,
- /* 0x1d */ XK_Control_L, NoSymbol, NoSymbol, NoSymbol,
- /* 0x1e */ XK_A, NoSymbol, NoSymbol, NoSymbol,
- /* 0x1f */ XK_S, NoSymbol, NoSymbol, NoSymbol,
- /* 0x20 */ XK_D, NoSymbol, NoSymbol, NoSymbol,
- /* 0x21 */ XK_F, NoSymbol, NoSymbol, NoSymbol,
- /* 0x22 */ XK_G, NoSymbol, NoSymbol, NoSymbol,
- /* 0x23 */ XK_H, NoSymbol, NoSymbol, NoSymbol,
- /* 0x24 */ XK_J, NoSymbol, NoSymbol, NoSymbol,
- /* 0x25 */ XK_K, NoSymbol, NoSymbol, NoSymbol,
- /* 0x26 */ XK_L, NoSymbol, NoSymbol, NoSymbol,
- /* 0x27 */ XK_semicolon, XK_colon, NoSymbol, NoSymbol,
- /* 0x28 */ XK_quoteright, XK_quotedbl, NoSymbol, NoSymbol,
- /* 0x29 */ XK_quoteleft, XK_asciitilde, NoSymbol, NoSymbol,
- /* 0x2a */ XK_Shift_L, NoSymbol, NoSymbol, NoSymbol,
- /* 0x2b */ XK_backslash, XK_bar, NoSymbol, NoSymbol,
- /* 0x2c */ XK_Z, NoSymbol, NoSymbol, NoSymbol,
- /* 0x2d */ XK_X, NoSymbol, NoSymbol, NoSymbol,
- /* 0x2e */ XK_C, NoSymbol, NoSymbol, NoSymbol,
- /* 0x2f */ XK_V, NoSymbol, NoSymbol, NoSymbol,
- /* 0x30 */ XK_B, NoSymbol, NoSymbol, NoSymbol,
- /* 0x31 */ XK_N, NoSymbol, NoSymbol, NoSymbol,
- /* 0x32 */ XK_M, NoSymbol, NoSymbol, NoSymbol,
- /* 0x33 */ XK_comma, XK_less, NoSymbol, NoSymbol,
- /* 0x34 */ XK_period, XK_greater, NoSymbol, NoSymbol,
- /* 0x35 */ XK_slash, XK_question, NoSymbol, NoSymbol,
- /* 0x36 */ XK_Shift_R, NoSymbol, NoSymbol, NoSymbol,
- /* 0x37 */ XK_KP_Multiply, NoSymbol, NoSymbol, NoSymbol,
- /* 0x38 */ XK_Alt_L, XK_Meta_L, NoSymbol, NoSymbol,
- /* 0x39 */ XK_space, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3a */ XK_Caps_Lock, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3b */ XK_F1, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3c */ XK_F2, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3d */ XK_F3, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3e */ XK_F4, NoSymbol, NoSymbol, NoSymbol,
- /* 0x3f */ XK_F5, NoSymbol, NoSymbol, NoSymbol,
- /* 0x40 */ XK_F6, NoSymbol, NoSymbol, NoSymbol,
- /* 0x41 */ XK_F7, NoSymbol, NoSymbol, NoSymbol,
- /* 0x42 */ XK_F8, NoSymbol, NoSymbol, NoSymbol,
- /* 0x43 */ XK_F9, NoSymbol, NoSymbol, NoSymbol,
- /* 0x44 */ XK_F10, NoSymbol, NoSymbol, NoSymbol,
- /* 0x45 */ XK_Num_Lock, NoSymbol, NoSymbol, NoSymbol,
- /* 0x46 */ XK_Scroll_Lock, NoSymbol, NoSymbol, NoSymbol,
- /* 0x47 */ XK_KP_Home, XK_KP_7, NoSymbol, NoSymbol,
- /* 0x48 */ XK_KP_Up, XK_KP_8, NoSymbol, NoSymbol,
- /* 0x49 */ XK_KP_Prior, XK_KP_9, NoSymbol, NoSymbol,
- /* 0x4a */ XK_KP_Subtract, NoSymbol, NoSymbol, NoSymbol,
- /* 0x4b */ XK_KP_Left, XK_KP_4, NoSymbol, NoSymbol,
- /* 0x4c */ XK_KP_Begin, XK_KP_5, NoSymbol, NoSymbol,
- /* 0x4d */ XK_KP_Right, XK_KP_6, NoSymbol, NoSymbol,
- /* 0x4e */ XK_KP_Add, NoSymbol, NoSymbol, NoSymbol,
- /* 0x4f */ XK_KP_End, XK_KP_1, NoSymbol, NoSymbol,
- /* 0x50 */ XK_KP_Down, XK_KP_2, NoSymbol, NoSymbol,
- /* 0x51 */ XK_KP_Next, XK_KP_3, NoSymbol, NoSymbol,
- /* 0x52 */ XK_KP_Insert, XK_KP_0, NoSymbol, NoSymbol,
- /* 0x53 */ XK_KP_Delete, XK_KP_Decimal, NoSymbol, NoSymbol,
- /* 0x54 */ XK_Sys_Req, NoSymbol, NoSymbol, NoSymbol,
- /* 0x55 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x56 */ XK_less, XK_greater, NoSymbol, NoSymbol,
- /* 0x57 */ XK_F11, NoSymbol, NoSymbol, NoSymbol,
- /* 0x58 */ XK_F12, NoSymbol, NoSymbol, NoSymbol,
- /* 0x59 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x5a */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x5b */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x5c */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x5d */ XK_Begin, NoSymbol, NoSymbol, NoSymbol,
- /* 0x5e */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x5f */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x60 */ XK_KP_Enter, NoSymbol, NoSymbol, NoSymbol,
- /* 0x61 */ XK_Control_R, NoSymbol, NoSymbol, NoSymbol,
- /* 0x62 */ XK_KP_Divide, NoSymbol, NoSymbol, NoSymbol,
- /* 0x63 */ XK_Print, NoSymbol, NoSymbol, NoSymbol,
- /* 0x64 */ XK_Alt_R, XK_Meta_R, NoSymbol, NoSymbol,
- /* 0x65 */ XK_Break, NoSymbol, NoSymbol, NoSymbol,
- /* 0x66 */ XK_Home, NoSymbol, NoSymbol, NoSymbol,
- /* 0x67 */ XK_Up, NoSymbol, NoSymbol, NoSymbol,
- /* 0x68 */ XK_Prior, NoSymbol, NoSymbol, NoSymbol,
- /* 0x69 */ XK_Left, NoSymbol, NoSymbol, NoSymbol,
- /* 0x6a */ XK_Right, NoSymbol, NoSymbol, NoSymbol,
- /* 0x6b */ XK_End, NoSymbol, NoSymbol, NoSymbol,
- /* 0x6c */ XK_Down, NoSymbol, NoSymbol, NoSymbol,
- /* 0x6d */ XK_Next, NoSymbol, NoSymbol, NoSymbol,
- /* 0x6e */ XK_Insert, NoSymbol, NoSymbol, NoSymbol,
- /* 0x6f */ XK_Delete, NoSymbol, NoSymbol, NoSymbol,
- /* 0x70 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x71 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x72 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x73 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x74 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x75 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x76 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x77 */ XK_Pause, NoSymbol, NoSymbol, NoSymbol,
- /* 0x78 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x79 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7a */ XK_Menu, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7b */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7c */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7d */ XK_Super_L, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7e */ XK_Super_R, NoSymbol, NoSymbol, NoSymbol,
- /* 0x7f */ XK_Menu, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x00 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x01 */ XK_Escape, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x02 */ XK_1, XK_exclam, NoSymbol, NoSymbol,
+ /* 0x03 */ XK_2, XK_at, NoSymbol, NoSymbol,
+ /* 0x04 */ XK_3, XK_numbersign, NoSymbol, NoSymbol,
+ /* 0x05 */ XK_4, XK_dollar, NoSymbol, NoSymbol,
+ /* 0x06 */ XK_5, XK_percent, NoSymbol, NoSymbol,
+ /* 0x07 */ XK_6, XK_asciicircum, NoSymbol, NoSymbol,
+ /* 0x08 */ XK_7, XK_ampersand, NoSymbol, NoSymbol,
+ /* 0x09 */ XK_8, XK_asterisk, NoSymbol, NoSymbol,
+ /* 0x0a */ XK_9, XK_parenleft, NoSymbol, NoSymbol,
+ /* 0x0b */ XK_0, XK_parenright, NoSymbol, NoSymbol,
+ /* 0x0c */ XK_minus, XK_underscore, NoSymbol, NoSymbol,
+ /* 0x0d */ XK_equal, XK_plus, NoSymbol, NoSymbol,
+ /* 0x0e */ XK_BackSpace, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x0f */ XK_Tab, XK_ISO_Left_Tab, NoSymbol, NoSymbol,
+ /* 0x10 */ XK_Q, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x11 */ XK_W, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x12 */ XK_E, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x13 */ XK_R, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x14 */ XK_T, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x15 */ XK_Y, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x16 */ XK_U, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x17 */ XK_I, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x18 */ XK_O, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x19 */ XK_P, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x1a */ XK_bracketleft, XK_braceleft, NoSymbol, NoSymbol,
+ /* 0x1b */ XK_bracketright, XK_braceright, NoSymbol, NoSymbol,
+ /* 0x1c */ XK_Return, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x1d */ XK_Control_L, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x1e */ XK_A, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x1f */ XK_S, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x20 */ XK_D, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x21 */ XK_F, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x22 */ XK_G, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x23 */ XK_H, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x24 */ XK_J, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x25 */ XK_K, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x26 */ XK_L, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x27 */ XK_semicolon, XK_colon, NoSymbol, NoSymbol,
+ /* 0x28 */ XK_quoteright, XK_quotedbl, NoSymbol, NoSymbol,
+ /* 0x29 */ XK_quoteleft, XK_asciitilde, NoSymbol, NoSymbol,
+ /* 0x2a */ XK_Shift_L, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x2b */ XK_backslash, XK_bar, NoSymbol, NoSymbol,
+ /* 0x2c */ XK_Z, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x2d */ XK_X, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x2e */ XK_C, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x2f */ XK_V, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x30 */ XK_B, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x31 */ XK_N, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x32 */ XK_M, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x33 */ XK_comma, XK_less, NoSymbol, NoSymbol,
+ /* 0x34 */ XK_period, XK_greater, NoSymbol, NoSymbol,
+ /* 0x35 */ XK_slash, XK_question, NoSymbol, NoSymbol,
+ /* 0x36 */ XK_Shift_R, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x37 */ XK_KP_Multiply, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x38 */ XK_Alt_L, XK_Meta_L, NoSymbol, NoSymbol,
+ /* 0x39 */ XK_space, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x3a */ XK_Caps_Lock, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x3b */ XK_F1, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x3c */ XK_F2, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x3d */ XK_F3, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x3e */ XK_F4, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x3f */ XK_F5, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x40 */ XK_F6, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x41 */ XK_F7, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x42 */ XK_F8, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x43 */ XK_F9, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x44 */ XK_F10, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x45 */ XK_Num_Lock, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x46 */ XK_Scroll_Lock, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x47 */ XK_KP_Home, XK_KP_7, NoSymbol, NoSymbol,
+ /* 0x48 */ XK_KP_Up, XK_KP_8, NoSymbol, NoSymbol,
+ /* 0x49 */ XK_KP_Prior, XK_KP_9, NoSymbol, NoSymbol,
+ /* 0x4a */ XK_KP_Subtract, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x4b */ XK_KP_Left, XK_KP_4, NoSymbol, NoSymbol,
+ /* 0x4c */ XK_KP_Begin, XK_KP_5, NoSymbol, NoSymbol,
+ /* 0x4d */ XK_KP_Right, XK_KP_6, NoSymbol, NoSymbol,
+ /* 0x4e */ XK_KP_Add, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x4f */ XK_KP_End, XK_KP_1, NoSymbol, NoSymbol,
+ /* 0x50 */ XK_KP_Down, XK_KP_2, NoSymbol, NoSymbol,
+ /* 0x51 */ XK_KP_Next, XK_KP_3, NoSymbol, NoSymbol,
+ /* 0x52 */ XK_KP_Insert, XK_KP_0, NoSymbol, NoSymbol,
+ /* 0x53 */ XK_KP_Delete, XK_KP_Decimal, NoSymbol, NoSymbol,
+ /* 0x54 */ XK_Sys_Req, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x55 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x56 */ XK_less, XK_greater, NoSymbol, NoSymbol,
+ /* 0x57 */ XK_F11, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x58 */ XK_F12, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x59 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x5a */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x5b */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x5c */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x5d */ XK_Begin, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x5e */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x5f */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x60 */ XK_KP_Enter, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x61 */ XK_Control_R, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x62 */ XK_KP_Divide, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x63 */ XK_Print, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x64 */ XK_Alt_R, XK_Meta_R, NoSymbol, NoSymbol,
+ /* 0x65 */ XK_Break, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x66 */ XK_Home, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x67 */ XK_Up, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x68 */ XK_Prior, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x69 */ XK_Left, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x6a */ XK_Right, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x6b */ XK_End, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x6c */ XK_Down, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x6d */ XK_Next, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x6e */ XK_Insert, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x6f */ XK_Delete, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x70 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x71 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x72 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x73 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x74 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x75 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x76 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x77 */ XK_Pause, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x78 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x79 */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x7a */ XK_Menu, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x7b */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x7c */ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x7d */ XK_Super_L, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x7e */ XK_Super_R, NoSymbol, NoSymbol, NoSymbol,
+ /* 0x7f */ XK_Menu, NoSymbol, NoSymbol, NoSymbol,
};
-static int kbdUSBKeyDown(myPrivate *priv, int keyCode)
+static int
+kbdUSBKeyDown(myPrivate * priv, int keyCode)
{
- CARD8 byte = keyCode >> 5;
- CARD32 bit = 1 << (keyCode & 0x1f);
+ CARD8 byte = keyCode >> 5;
+ CARD32 bit = 1 << (keyCode & 0x1f);
- if (byte > NUM_STATE_ENTRIES) return 0;
+ if (byte > NUM_STATE_ENTRIES)
+ return 0;
return priv->kbdState[byte] & bit;
}
-static void kbdUSBKeyState(myPrivate *priv, int type, int keyCode)
+static void
+kbdUSBKeyState(myPrivate * priv, int type, int keyCode)
{
- CARD8 byte = keyCode >> 5;
- CARD32 bit = 1 << (keyCode & 0x1f);
-
- if (byte > NUM_STATE_ENTRIES) return;
- if (type == KeyPress) priv->kbdState[byte] |= bit;
- else priv->kbdState[byte] &= ~bit;
+ CARD8 byte = keyCode >> 5;
+ CARD32 bit = 1 << (keyCode & 0x1f);
+
+ if (byte > NUM_STATE_ENTRIES)
+ return;
+ if (type == KeyPress)
+ priv->kbdState[byte] |= bit;
+ else
+ priv->kbdState[byte] &= ~bit;
}
/** Set the LEDs. */
-void kbdUSBCtrl(DevicePtr pDev, KeybdCtrl *ctrl)
+void
+kbdUSBCtrl(DevicePtr pDev, KeybdCtrl * ctrl)
{
GETPRIV;
- struct timeval tv;
+ struct timeval tv;
struct input_event event;
- int i, led;
+ int i, led;
gettimeofday(&tv, NULL);
for (i = 0; i < 5; i++) {
- event.time.tv_sec = tv.tv_sec;
- event.time.tv_usec = tv.tv_usec;
- event.type = EV_LED;
- if (i == 0) led = 1; /* LED_CAPSL == 0x01 */
- else if (i == 1) led = 0; /* LED_NUML == 0x00 */
- else led = i;
- event.code = led;
- event.value = !!(ctrl->leds & (1 << led));
+ event.time.tv_sec = tv.tv_sec;
+ event.time.tv_usec = tv.tv_usec;
+ event.type = EV_LED;
+ if (i == 0)
+ led = 1; /* LED_CAPSL == 0x01 */
+ else if (i == 1)
+ led = 0; /* LED_NUML == 0x00 */
+ else
+ led = i;
+ event.code = led;
+ event.value = ! !(ctrl->leds & (1 << led));
write(priv->fd, &event, sizeof(event));
}
}
/** Initialize \a pDev using #usbInit. */
-void kbdUSBInit(DevicePtr pDev)
+void
+kbdUSBInit(DevicePtr pDev)
{
usbInit(pDev, usbKeyboard);
}
-static void kbdUSBConvert(DevicePtr pDev,
- unsigned int scanCode,
- int value,
- ENQUEUEPROC enqueue,
- CHECKPROC checkspecial,
- BLOCK block)
+static void
+kbdUSBConvert(DevicePtr pDev,
+ unsigned int scanCode,
+ int value,
+ ENQUEUEPROC enqueue, CHECKPROC checkspecial, BLOCK block)
{
GETPRIV;
- XkbSrvInfoPtr xkbi = priv->pKeyboard->key->xkbInfo;
- int type;
- int keyCode;
- KeySym keySym = NoSymbol;
- int switching;
+ XkbSrvInfoPtr xkbi = priv->pKeyboard->key->xkbInfo;
+ int type;
+ int keyCode;
+ KeySym keySym = NoSymbol;
+ int switching;
/* Set up xEvent information */
- type = value ? KeyPress : KeyRelease;
+ type = value ? KeyPress : KeyRelease;
keyCode = (scanCode & 0xff) + MIN_KEYCODE;
/* Handle repeats */
@@ -315,6 +325,7 @@ static void kbdUSBConvert(DevicePtr pDev,
int effectiveGroup = XkbGetEffectiveGroup(xkbi,
&xkbi->state,
scanCode);
+
keySym = XkbKeySym(xkbi->desc, scanCode, effectiveGroup);
#if 0
switch (keySym) {
@@ -323,13 +334,16 @@ static void kbdUSBConvert(DevicePtr pDev,
case XK_Shift_Lock:
case XK_Caps_Lock:
/* Ignore releases and all but first press */
- if (kbdLinuxModIgnore(priv, &xE, keySym)) return;
- if (kbdLinuxKeyDown(priv, &xE)) xE.u.u.type = KeyRelease;
- else xE.u.u.type = KeyPress;
+ if (kbdLinuxModIgnore(priv, &xE, keySym))
+ return;
+ if (kbdLinuxKeyDown(priv, &xE))
+ xE.u.u.type = KeyRelease;
+ else
+ xE.u.u.type = KeyPress;
break;
}
#endif
-
+
/* If key is already down, ignore or autorepeat */
if (type == KeyPress && kbdUSBKeyDown(priv, keyCode)) {
KbdFeedbackClassRec *feed = priv->pDevice->kbdfeed;
@@ -337,17 +351,18 @@ static void kbdUSBConvert(DevicePtr pDev,
/* No auto-repeat? */
if ((feed && !feed->ctrl.autoRepeat)
|| priv->pDevice->key->xkbInfo->desc->map->modmap[keyCode]
- || (feed
- && !(feed->ctrl.autoRepeats[keyCode >> 3]
- & (1 << (keyCode & 7))))) return; /* Ignore */
-
+ || (feed && !(feed->ctrl.autoRepeats[keyCode >> 3]
+ & (1 << (keyCode & 7)))))
+ return; /* Ignore */
+
/* Do auto-repeat */
enqueue(pDev, KeyRelease, keyCode, keySym, NULL, block);
type = KeyPress;
}
-
+
/* If key is already up, ignore */
- if (type == KeyRelease && !kbdUSBKeyDown(priv, keyCode)) return;
+ if (type == KeyRelease && !kbdUSBKeyDown(priv, keyCode))
+ return;
}
switching = 0;
@@ -356,7 +371,7 @@ static void kbdUSBConvert(DevicePtr pDev,
if (!switching) {
if (enqueue)
enqueue(pDev, type, keyCode, keySym, NULL, block);
- kbdUSBKeyState(priv, type, keyCode); /* Update our state bitmap */
+ kbdUSBKeyState(priv, type, keyCode); /* Update our state bitmap */
}
}
@@ -366,11 +381,10 @@ static void kbdUSBConvert(DevicePtr pDev,
* with the \a enqueue function. The \a block type is passed to the
* functions so that they may block SIGIO handling as appropriate to the
* caller of this function. */
-void kbdUSBRead(DevicePtr pDev,
- MOTIONPROC motion,
- ENQUEUEPROC enqueue,
- CHECKPROC checkspecial,
- BLOCK block)
+void
+kbdUSBRead(DevicePtr pDev,
+ MOTIONPROC motion,
+ ENQUEUEPROC enqueue, CHECKPROC checkspecial, BLOCK block)
{
GETPRIV;
struct input_event raw;
@@ -385,18 +399,21 @@ void kbdUSBRead(DevicePtr pDev,
}
/** Turn \a pDev on (i.e., take input from \a pDev). */
-int kbdUSBOn(DevicePtr pDev)
+int
+kbdUSBOn(DevicePtr pDev)
{
GETPRIV;
- if (priv->fd < 0) kbdUSBInit(pDev);
+ if (priv->fd < 0)
+ kbdUSBInit(pDev);
return priv->fd;
}
-static void kbdUSBGetMap(DevicePtr pDev, KeySymsPtr pKeySyms, CARD8 *pModMap)
+static void
+kbdUSBGetMap(DevicePtr pDev, KeySymsPtr pKeySyms, CARD8 *pModMap)
{
- KeySym *k, *mapCopy;
- int i;
+ KeySym *k, *mapCopy;
+ int i;
mapCopy = malloc(sizeof(map));
memcpy(mapCopy, map, sizeof(map));
@@ -406,39 +423,55 @@ static void kbdUSBGetMap(DevicePtr pDev, KeySymsPtr pKeySyms, CARD8 *pModMap)
pModMap[i] = NoSymbol; /* make sure it is restored */
for (k = mapCopy, i = MIN_KEYCODE;
- i < NUM_KEYCODES + MIN_KEYCODE;
- i++, k += 4) {
- switch(*k) {
+ i < NUM_KEYCODES + MIN_KEYCODE; i++, k += 4) {
+ switch (*k) {
case XK_Shift_L:
- case XK_Shift_R: pModMap[i] = ShiftMask; break;
+ case XK_Shift_R:
+ pModMap[i] = ShiftMask;
+ break;
case XK_Control_L:
- case XK_Control_R: pModMap[i] = ControlMask; break;
- case XK_Caps_Lock: pModMap[i] = LockMask; break;
+ case XK_Control_R:
+ pModMap[i] = ControlMask;
+ break;
+ case XK_Caps_Lock:
+ pModMap[i] = LockMask;
+ break;
case XK_Alt_L:
- case XK_Alt_R: pModMap[i] = AltMask; break;
- case XK_Num_Lock: pModMap[i] = NumLockMask; break;
- case XK_Scroll_Lock: pModMap[i] = ScrollLockMask; break;
+ case XK_Alt_R:
+ pModMap[i] = AltMask;
+ break;
+ case XK_Num_Lock:
+ pModMap[i] = NumLockMask;
+ break;
+ case XK_Scroll_Lock:
+ pModMap[i] = ScrollLockMask;
+ break;
case XK_Kana_Lock:
- case XK_Kana_Shift: pModMap[i] = KanaMask; break;
- case XK_Mode_switch: pModMap[i] = AltLangMask; break;
+ case XK_Kana_Shift:
+ pModMap[i] = KanaMask;
+ break;
+ case XK_Mode_switch:
+ pModMap[i] = AltLangMask;
+ break;
}
}
- pKeySyms->map = mapCopy; /* Must be XFree'able */
- pKeySyms->mapWidth = GLYPHS_PER_KEY;
+ pKeySyms->map = mapCopy; /* Must be XFree'able */
+ pKeySyms->mapWidth = GLYPHS_PER_KEY;
pKeySyms->minKeyCode = MIN_KEYCODE;
pKeySyms->maxKeyCode = MAX_KEYCODE;
}
/** Fill the \a info structure with information needed to initialize \a
- * pDev. */
-void kbdUSBGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
+ * pDev. */
+void
+kbdUSBGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
{
- info->keyboard = 1;
- info->keyClass = 1;
+ info->keyboard = 1;
+ info->keyClass = 1;
kbdUSBGetMap(pDev, &info->keySyms, info->modMap);
- info->focusClass = 1;
+ info->focusClass = 1;
info->kbdFeedbackClass = 1;
- info->names.keycodes = strdup("powerpcps2");
- info->force = 1;
+ info->names.keycodes = strdup("powerpcps2");
+ info->force = 1;
}
diff --git a/hw/dmx/input/usb-keyboard.h b/hw/dmx/input/usb-keyboard.h
index 1f9614eef..e14cca1c2 100644
--- a/hw/dmx/input/usb-keyboard.h
+++ b/hw/dmx/input/usb-keyboard.h
@@ -36,13 +36,12 @@
#ifndef _USB_KEYBOARD_H_
#define _USB_KEYBOARD_H_
-extern void kbdUSBInit(DevicePtr pDev);
-extern void kbdUSBGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
-extern int kbdUSBOn(DevicePtr pDev);
-extern void kbdUSBRead(DevicePtr pDev,
- dmxMotionProcPtr motion,
- dmxEnqueueProcPtr enqueue,
- dmxCheckSpecialProcPtr checkspecial,
- DMXBlockType block);
-extern void kbdUSBCtrl(DevicePtr pDev, KeybdCtrl *ctrl);
+extern void kbdUSBInit(DevicePtr pDev);
+extern void kbdUSBGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
+extern int kbdUSBOn(DevicePtr pDev);
+extern void kbdUSBRead(DevicePtr pDev,
+ dmxMotionProcPtr motion,
+ dmxEnqueueProcPtr enqueue,
+ dmxCheckSpecialProcPtr checkspecial, DMXBlockType block);
+extern void kbdUSBCtrl(DevicePtr pDev, KeybdCtrl * ctrl);
#endif
diff --git a/hw/dmx/input/usb-mouse.c b/hw/dmx/input/usb-mouse.c
index efa9d00ec..644342ee3 100644
--- a/hw/dmx/input/usb-mouse.c
+++ b/hw/dmx/input/usb-mouse.c
@@ -66,61 +66,68 @@
/*****************************************************************************/
/** Read the USB device using #usbRead. */
-void mouUSBRead(DevicePtr pDev,
- MOTIONPROC motion,
- ENQUEUEPROC enqueue,
- CHECKPROC checkspecial,
- BLOCK block)
+void
+mouUSBRead(DevicePtr pDev,
+ MOTIONPROC motion,
+ ENQUEUEPROC enqueue, CHECKPROC checkspecial, BLOCK block)
{
usbRead(pDev, motion, enqueue, BTN_MISC, block);
}
/** Initialize \a pDev using #usbInit. */
-void mouUSBInit(DevicePtr pDev)
+void
+mouUSBInit(DevicePtr pDev)
{
usbInit(pDev, usbMouse);
}
/** Turn \a pDev on (i.e., take input from \a pDev). */
-int mouUSBOn(DevicePtr pDev)
+int
+mouUSBOn(DevicePtr pDev)
{
GETPRIV;
- if (priv->fd < 0) mouUSBInit(pDev);
+ if (priv->fd < 0)
+ mouUSBInit(pDev);
return priv->fd;
}
-static void mouUSBGetMap(DevicePtr pDev, unsigned char *map, int *nButtons)
+static void
+mouUSBGetMap(DevicePtr pDev, unsigned char *map, int *nButtons)
{
int i;
-
- if (nButtons) *nButtons = 5;
- if (map) for (i = 0; i <= *nButtons; i++) map[i] = i;
+
+ if (nButtons)
+ *nButtons = 5;
+ if (map)
+ for (i = 0; i <= *nButtons; i++)
+ map[i] = i;
}
/** Fill the \a info structure with information needed to initialize \a
- * pDev. */
-void mouUSBGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
+ * pDev. */
+void
+mouUSBGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
{
static KeySym keyboard_mapping = NoSymbol;
- info->buttonClass = 1;
+ info->buttonClass = 1;
mouUSBGetMap(pDev, info->map, &info->numButtons);
- info->valuatorClass = 1;
- info->numRelAxes = 2;
- info->minval[0] = 0;
- info->maxval[0] = 0;
- info->res[0] = 1;
- info->minres[0] = 0;
- info->maxres[0] = 1;
- info->ptrFeedbackClass = 1;
-
- /* Some USB mice devices return key
- * events from their pair'd
- * keyboard... */
- info->keyClass = 1;
+ info->valuatorClass = 1;
+ info->numRelAxes = 2;
+ info->minval[0] = 0;
+ info->maxval[0] = 0;
+ info->res[0] = 1;
+ info->minres[0] = 0;
+ info->maxres[0] = 1;
+ info->ptrFeedbackClass = 1;
+
+ /* Some USB mice devices return key
+ * events from their pair'd
+ * keyboard... */
+ info->keyClass = 1;
info->keySyms.minKeyCode = 8;
info->keySyms.maxKeyCode = 8;
- info->keySyms.mapWidth = 1;
- info->keySyms.map = &keyboard_mapping;
+ info->keySyms.mapWidth = 1;
+ info->keySyms.map = &keyboard_mapping;
}
diff --git a/hw/dmx/input/usb-mouse.h b/hw/dmx/input/usb-mouse.h
index 918bf6481..91f6fcf86 100644
--- a/hw/dmx/input/usb-mouse.h
+++ b/hw/dmx/input/usb-mouse.h
@@ -36,13 +36,12 @@
#ifndef _USB_MOU_H_
#define _USB_MOU_H_
-extern void mouUSBRead(DevicePtr pDev,
- dmxMotionProcPtr motion,
- dmxEnqueueProcPtr enqueue,
- dmxCheckSpecialProcPtr checkspecial,
- DMXBlockType block);
-extern void mouUSBInit(DevicePtr pDev);
-extern void mouUSBGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
-extern int mouUSBOn(DevicePtr pDev);
-extern void mouUSBCtrl(DevicePtr pDev, PtrCtrl *ctrl);
+extern void mouUSBRead(DevicePtr pDev,
+ dmxMotionProcPtr motion,
+ dmxEnqueueProcPtr enqueue,
+ dmxCheckSpecialProcPtr checkspecial, DMXBlockType block);
+extern void mouUSBInit(DevicePtr pDev);
+extern void mouUSBGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
+extern int mouUSBOn(DevicePtr pDev);
+extern void mouUSBCtrl(DevicePtr pDev, PtrCtrl * ctrl);
#endif
diff --git a/hw/dmx/input/usb-other.c b/hw/dmx/input/usb-other.c
index d1074b8e1..f24f259c1 100644
--- a/hw/dmx/input/usb-other.c
+++ b/hw/dmx/input/usb-other.c
@@ -68,92 +68,97 @@
/*****************************************************************************/
/** Read the USB device using #usbRead. */
-void othUSBRead(DevicePtr pDev,
- MOTIONPROC motion,
- ENQUEUEPROC enqueue,
- CHECKPROC checkspecial,
- BLOCK block)
+void
+othUSBRead(DevicePtr pDev,
+ MOTIONPROC motion,
+ ENQUEUEPROC enqueue, CHECKPROC checkspecial, BLOCK block)
{
usbRead(pDev, motion, enqueue, 0xffff, block);
}
/** Initialize \a pDev using #usbInit. */
-void othUSBInit(DevicePtr pDev)
+void
+othUSBInit(DevicePtr pDev)
{
usbInit(pDev, usbOther);
}
/** Turn \a pDev on (i.e., take input from \a pDev). */
-int othUSBOn(DevicePtr pDev)
+int
+othUSBOn(DevicePtr pDev)
{
GETPRIV;
- if (priv->fd < 0) othUSBInit(pDev);
+ if (priv->fd < 0)
+ othUSBInit(pDev);
return priv->fd;
}
/** Fill the \a info structure with information needed to initialize \a
- * pDev. */
-void othUSBGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
+ * pDev. */
+void
+othUSBGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
{
GETPRIV;
- int i, j;
+ int i, j;
static KeySym keyboard_mapping = NoSymbol;
- int absolute[5];
-
+ int absolute[5];
+
#define test_bit(bit) (priv->mask[(bit)/8] & (1 << ((bit)%8)))
- /* Some USB mice devices return key
- * events from their pair'd
- * keyboard... */
- info->keyClass = 1;
+ /* Some USB mice devices return key
+ * events from their pair'd
+ * keyboard... */
+ info->keyClass = 1;
info->keySyms.minKeyCode = 8;
info->keySyms.maxKeyCode = 8;
- info->keySyms.mapWidth = 1;
- info->keySyms.map = &keyboard_mapping;
+ info->keySyms.mapWidth = 1;
+ info->keySyms.map = &keyboard_mapping;
for (i = 0; i < EV_MAX; i++) {
if (test_bit(i)) {
switch (i) {
case EV_KEY:
- /* See above */
+ /* See above */
break;
case EV_REL:
- info->valuatorClass = 1;
+ info->valuatorClass = 1;
if (info->numRelAxes + info->numAbsAxes > DMX_MAX_AXES - 1) {
- info->numRelAxes = DMX_MAX_AXES - info->numAbsAxes - 1;
+ info->numRelAxes = DMX_MAX_AXES - info->numAbsAxes - 1;
dmxLog(dmxWarning, "Can only use %d relative axes\n",
info->numRelAxes);
- } else
- info->numRelAxes = priv->numRel;
- info->minval[0] = 0;
- info->maxval[0] = 0;
- info->res[0] = 1;
- info->minres[0] = 0;
- info->maxres[0] = 1;
+ }
+ else
+ info->numRelAxes = priv->numRel;
+ info->minval[0] = 0;
+ info->maxval[0] = 0;
+ info->res[0] = 1;
+ info->minres[0] = 0;
+ info->maxres[0] = 1;
break;
case EV_ABS:
- info->valuatorClass = 1;
+ info->valuatorClass = 1;
if (info->numRelAxes + info->numAbsAxes > DMX_MAX_AXES - 1) {
- info->numAbsAxes = DMX_MAX_AXES - info->numRelAxes - 1;
+ info->numAbsAxes = DMX_MAX_AXES - info->numRelAxes - 1;
dmxLog(dmxWarning, "Can only use %d absolute axes\n",
info->numAbsAxes);
- } else
- info->numAbsAxes = priv->numAbs;
+ }
+ else
+ info->numAbsAxes = priv->numAbs;
for (j = 0; j < info->numAbsAxes; j++) {
ioctl(priv->fd, EVIOCGABS(j), absolute);
- info->minval[1+j] = absolute[1];
- info->maxval[1+j] = absolute[2];
- info->res[1+j] = absolute[3];
- info->minres[1+j] = absolute[3];
- info->maxres[1+j] = absolute[3];
+ info->minval[1 + j] = absolute[1];
+ info->maxval[1 + j] = absolute[2];
+ info->res[1 + j] = absolute[3];
+ info->minres[1 + j] = absolute[3];
+ info->maxres[1 + j] = absolute[3];
}
break;
case EV_LED:
- info->ledFeedbackClass = 0; /* Not supported at this time */
+ info->ledFeedbackClass = 0; /* Not supported at this time */
break;
case EV_SND:
- info->belFeedbackClass = 0; /* Not supported at this time */
+ info->belFeedbackClass = 0; /* Not supported at this time */
break;
}
}
diff --git a/hw/dmx/input/usb-other.h b/hw/dmx/input/usb-other.h
index b69e65933..89939a0a2 100644
--- a/hw/dmx/input/usb-other.h
+++ b/hw/dmx/input/usb-other.h
@@ -36,13 +36,12 @@
#ifndef _USB_OTHER_H_
#define _USB_OTHER_H_
-extern void othUSBRead(DevicePtr pDev,
- dmxMotionProcPtr motion,
- dmxEnqueueProcPtr enqueue,
- dmxCheckSpecialProcPtr checkspecial,
- DMXBlockType block);
-extern void othUSBInit(DevicePtr pDev);
-extern void othUSBGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
-extern int othUSBOn(DevicePtr pDev);
-extern void othUSBCtrl(DevicePtr pDev, PtrCtrl *ctrl);
+extern void othUSBRead(DevicePtr pDev,
+ dmxMotionProcPtr motion,
+ dmxEnqueueProcPtr enqueue,
+ dmxCheckSpecialProcPtr checkspecial, DMXBlockType block);
+extern void othUSBInit(DevicePtr pDev);
+extern void othUSBGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info);
+extern int othUSBOn(DevicePtr pDev);
+extern void othUSBCtrl(DevicePtr pDev, PtrCtrl * ctrl);
#endif
diff --git a/hw/dmx/input/usb-private.h b/hw/dmx/input/usb-private.h
index c70668ce5..096607a34 100644
--- a/hw/dmx/input/usb-private.h
+++ b/hw/dmx/input/usb-private.h
@@ -98,20 +98,20 @@
/* Private area for USB devices. */
typedef struct _myPrivate {
- DeviceIntPtr pDevice; /**< Device (mouse or other) */
- int fd; /**< File descriptor */
- unsigned char mask[EV_MAX/8 + 1]; /**< Mask */
- int numRel, numAbs, numLeds; /**< Counts */
- int relmap[DMX_MAX_AXES]; /**< Relative axis map */
- int absmap[DMX_MAX_AXES]; /**< Absolute axis map */
+ DeviceIntPtr pDevice; /**< Device (mouse or other) */
+ int fd; /**< File descriptor */
+ unsigned char mask[EV_MAX / 8 + 1]; /**< Mask */
+ int numRel, numAbs, numLeds; /**< Counts */
+ int relmap[DMX_MAX_AXES]; /**< Relative axis map */
+ int absmap[DMX_MAX_AXES]; /**< Absolute axis map */
- CARD32 kbdState[NUM_STATE_ENTRIES]; /**< Keyboard state */
- DeviceIntPtr pKeyboard; /** Keyboard device */
+ CARD32 kbdState[NUM_STATE_ENTRIES]; /**< Keyboard state */
+ DeviceIntPtr pKeyboard; /** Keyboard device */
- int pitch; /**< Bell pitch */
- unsigned long duration; /**< Bell duration */
+ int pitch; /**< Bell pitch */
+ unsigned long duration; /**< Bell duration */
/* FIXME: dmxInput is never initialized */
- DMXInputInfo *dmxInput; /**< For pretty-printing */
+ DMXInputInfo *dmxInput; /**< For pretty-printing */
} myPrivate;
#endif