diff options
author | marha <marha@users.sourceforge.net> | 2012-03-26 14:23:28 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-03-26 14:23:28 +0200 |
commit | 76bcc36ed305418a3ddc5752d287ede894243e1b (patch) | |
tree | bacb320c825768471ce56f058f17ce863d592376 /xorg-server/hw/dmx/config/dmxconfig.c | |
parent | 7d894e32566b710952c44cbc71939ad1d9e2fa8d (diff) | |
parent | 0f834b91a4768673833ab4917e87d86c237bb1a6 (diff) | |
download | vcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.tar.gz vcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.tar.bz2 vcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
pixman/pixman/pixman-mmx.c
xorg-server/Xext/shm.c
xorg-server/Xext/syncsrv.h
xorg-server/Xext/xvmain.c
xorg-server/Xi/exevents.c
xorg-server/Xi/opendev.c
xorg-server/composite/compalloc.c
xorg-server/composite/compoverlay.c
xorg-server/dix/colormap.c
xorg-server/dix/devices.c
xorg-server/dix/dispatch.c
xorg-server/dix/dixfonts.c
xorg-server/dix/eventconvert.c
xorg-server/dix/events.c
xorg-server/dix/gc.c
xorg-server/dix/getevents.c
xorg-server/dix/main.c
xorg-server/dix/privates.c
xorg-server/dix/registry.c
xorg-server/dix/resource.c
xorg-server/exa/exa_accel.c
xorg-server/exa/exa_migration_classic.c
xorg-server/exa/exa_unaccel.c
xorg-server/fb/fb.h
xorg-server/fb/fbcopy.c
xorg-server/fb/fbpixmap.c
xorg-server/glx/dispatch.h
xorg-server/glx/glapi.h
xorg-server/glx/glapi_gentable.c
xorg-server/glx/glapitable.h
xorg-server/glx/glprocs.h
xorg-server/glx/glxcmds.c
xorg-server/glx/glxcmdsswap.c
xorg-server/glx/glxdricommon.c
xorg-server/glx/glxdriswrast.c
xorg-server/glx/glxext.c
xorg-server/glx/indirect_dispatch.c
xorg-server/glx/indirect_dispatch.h
xorg-server/glx/indirect_dispatch_swap.c
xorg-server/glx/indirect_size.h
xorg-server/glx/indirect_size_get.h
xorg-server/glx/indirect_table.c
xorg-server/glx/indirect_util.c
xorg-server/glx/rensize.c
xorg-server/glx/single2swap.c
xorg-server/glx/singlepix.c
xorg-server/glx/singlepixswap.c
xorg-server/glx/singlesize.c
xorg-server/hw/dmx/dmxinit.c
xorg-server/hw/kdrive/ephyr/ephyr.c
xorg-server/hw/kdrive/ephyr/hostx.c
xorg-server/hw/kdrive/ephyr/hostx.h
xorg-server/hw/kdrive/src/kinput.c
xorg-server/hw/xfree86/common/compiler.h
xorg-server/hw/xwin/InitInput.c
xorg-server/hw/xwin/InitOutput.c
xorg-server/hw/xwin/ddraw.h
xorg-server/hw/xwin/glx/glwrap.c
xorg-server/hw/xwin/glx/indirect.c
xorg-server/hw/xwin/glx/wgl_ext_api.h
xorg-server/hw/xwin/glx/winpriv.c
xorg-server/hw/xwin/win.h
xorg-server/hw/xwin/winallpriv.c
xorg-server/hw/xwin/winauth.c
xorg-server/hw/xwin/winclipboard.h
xorg-server/hw/xwin/winclipboardinit.c
xorg-server/hw/xwin/winclipboardthread.c
xorg-server/hw/xwin/winclipboardunicode.c
xorg-server/hw/xwin/winclipboardwndproc.c
xorg-server/hw/xwin/winclipboardwrappers.c
xorg-server/hw/xwin/winclipboardxevents.c
xorg-server/hw/xwin/wincmap.c
xorg-server/hw/xwin/winconfig.c
xorg-server/hw/xwin/wincreatewnd.c
xorg-server/hw/xwin/wincursor.c
xorg-server/hw/xwin/windialogs.c
xorg-server/hw/xwin/winengine.c
xorg-server/hw/xwin/winerror.c
xorg-server/hw/xwin/wingc.c
xorg-server/hw/xwin/wingetsp.c
xorg-server/hw/xwin/winkeybd.c
xorg-server/hw/xwin/winkeybd.h
xorg-server/hw/xwin/winlayouts.h
xorg-server/hw/xwin/winmisc.c
xorg-server/hw/xwin/winmonitors.c
xorg-server/hw/xwin/winmouse.c
xorg-server/hw/xwin/winmsg.c
xorg-server/hw/xwin/winmsg.h
xorg-server/hw/xwin/winmultiwindowclass.c
xorg-server/hw/xwin/winmultiwindowicons.c
xorg-server/hw/xwin/winmultiwindowshape.c
xorg-server/hw/xwin/winmultiwindowwindow.c
xorg-server/hw/xwin/winmultiwindowwm.c
xorg-server/hw/xwin/winmultiwindowwndproc.c
xorg-server/hw/xwin/winnativegdi.c
xorg-server/hw/xwin/winpfbdd.c
xorg-server/hw/xwin/winpixmap.c
xorg-server/hw/xwin/winpolyline.c
xorg-server/hw/xwin/winprefs.c
xorg-server/hw/xwin/winprocarg.c
xorg-server/hw/xwin/winregistry.c
xorg-server/hw/xwin/winscrinit.c
xorg-server/hw/xwin/winsetsp.c
xorg-server/hw/xwin/winshaddd.c
xorg-server/hw/xwin/winshadddnl.c
xorg-server/hw/xwin/winshadgdi.c
xorg-server/hw/xwin/wintrayicon.c
xorg-server/hw/xwin/winwin32rootless.c
xorg-server/hw/xwin/winwin32rootlesswindow.c
xorg-server/hw/xwin/winwin32rootlesswndproc.c
xorg-server/hw/xwin/winwindow.c
xorg-server/hw/xwin/winwindow.h
xorg-server/hw/xwin/winwindowswm.c
xorg-server/hw/xwin/winwndproc.c
xorg-server/include/callback.h
xorg-server/include/dixstruct.h
xorg-server/include/misc.h
xorg-server/include/os.h
xorg-server/include/scrnintstr.h
xorg-server/mi/micmap.c
xorg-server/mi/miinitext.c
xorg-server/mi/mioverlay.c
xorg-server/mi/misprite.c
xorg-server/mi/mivaltree.c
xorg-server/mi/miwindow.c
xorg-server/miext/damage/damage.c
xorg-server/miext/rootless/rootlessGC.c
xorg-server/miext/rootless/rootlessWindow.c
xorg-server/os/WaitFor.c
xorg-server/os/access.c
xorg-server/os/connection.c
xorg-server/os/io.c
xorg-server/os/log.c
xorg-server/os/osinit.c
xorg-server/os/utils.c
xorg-server/os/xdmcp.c
xorg-server/os/xprintf.c
xorg-server/os/xstrans.c
xorg-server/render/mipict.c
xorg-server/xkb/xkbActions.c
xorg-server/xkb/xkbInit.c
xorg-server/xkeyboard-config/compat/default.in
Diffstat (limited to 'xorg-server/hw/dmx/config/dmxconfig.c')
-rw-r--r-- | xorg-server/hw/dmx/config/dmxconfig.c | 340 |
1 files changed, 202 insertions, 138 deletions
diff --git a/xorg-server/hw/dmx/config/dmxconfig.c b/xorg-server/hw/dmx/config/dmxconfig.c index a31e5f7f7..2cc9ab396 100644 --- a/xorg-server/hw/dmx/config/dmxconfig.c +++ b/xorg-server/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) |