Lines Matching defs:dmxInput
275 DMXInputInfo *dmxInput = &dmxInputs[i];
276 if (dmxInput->detached) continue;
277 for (j = 0; j < dmxInput->numDevs; j++)
278 if (dmxInput->devs[j]->sendsCore)
279 _dmxChangePointerControl(dmxInput->devs[j], ctrl);
313 DMXInputInfo *dmxInput = &dmxInputs[i];
314 if (dmxInput->detached) continue;
315 for (j = 0; j < dmxInput->numDevs; j++)
316 if (dmxInput->devs[j]->sendsCore)
317 _dmxKeyboardKbdCtrlProc(dmxInput->devs[j], ctrl);
343 DMXInputInfo *dmxInput = &dmxInputs[i];
344 if (dmxInput->detached) continue;
345 for (j = 0; j < dmxInput->numDevs; j++)
346 if (dmxInput->devs[j]->sendsCore)
347 _dmxKeyboardBellProc(dmxInput->devs[j], percent);
376 if (!info->force && (dmxInput->keycodes
377 || dmxInput->symbols
378 || dmxInput->geometry)) {
381 info->names.keycodes = dmxInput->keycodes;
384 info->names.symbols = dmxInput->symbols;
385 info->names.geometry = dmxInput->geometry;
387 dmxLogInput(dmxInput, "XKEYBOARD: From command line: %s",
390 dmxLogInputCont(dmxInput, " %s", info->names.symbols);
392 dmxLogInputCont(dmxInput, " %s", info->names.geometry);
393 dmxLogInputCont(dmxInput, "\n");
395 dmxLogInput(dmxInput, "XKEYBOARD: From device: %s",
398 dmxLogInputCont(dmxInput, " %s", info->names.symbols);
400 dmxLogInputCont(dmxInput, " %s", info->names.geometry);
401 dmxLogInputCont(dmxInput, "\n");
403 dmxLogInput(dmxInput, "XKEYBOARD: Defaults: %s %s %s %s %s\n",
431 if (dmxInput->detached) return Success;
513 dmxSigioRegister(dmxInput, fd);
523 dmxSigioUnregister(dmxInput);
537 static void dmxProcessInputEvents(DMXInputInfo *dmxInput)
545 if (dmxInput->detached)
547 for (i = 0; i < dmxInput->numDevs; i += dmxInput->devs[i]->binding)
548 if (dmxInput->devs[i]->process_input) {
550 miPointerUpdateSprite(dmxInput->devs[i]->pDevice);
552 dmxInput->devs[i]->process_input(dmxInput->devs[i]->private);
560 static void dmxUpdateWindowInformation(DMXInputInfo *dmxInput,
585 if (dmxInput->detached)
587 for (i = 0; i < dmxInput->numDevs; i += dmxInput->devs[i]->binding)
588 if (dmxInput->devs[i]->update_info)
589 dmxInput->devs[i]->update_info(dmxInput->devs[i]->private,
593 static void dmxCollectAll(DMXInputInfo *dmxInput)
597 if (dmxInput->detached)
599 for (i = 0; i < dmxInput->numDevs; i += dmxInput->devs[i]->binding)
600 if (dmxInput->devs[i]->collect_events)
601 dmxInput->devs[i]->collect_events(&dmxInput->devs[i]->pDevice->public,
610 DMXInputInfo *dmxInput = &dmxInputs[(uintptr_t)blockData];
615 dmxCollectAll(dmxInput);
621 DMXInputInfo *dmxInput = p;
624 dmxLog(dmxInfo, "Returning from VT %d\n", dmxInput->vt_switched);
626 if (!dmxInput->vt_switched)
629 for (i = 0; i < dmxInput->numDevs; i++)
630 if (dmxInput->devs[i]->vt_post_switch)
631 dmxInput->devs[i]->vt_post_switch(dmxInput->devs[i]->private);
632 dmxInput->vt_switched = 0;
637 DMXInputInfo *dmxInput = &dmxInputs[(uintptr_t)blockData];
640 if (dmxInput->vt_switch_pending) {
641 dmxLog(dmxInfo, "Switching to VT %d\n", dmxInput->vt_switch_pending);
642 for (i = 0; i < dmxInput->numDevs; i++)
643 if (dmxInput->devs[i]->vt_pre_switch)
644 dmxInput->devs[i]->vt_pre_switch(dmxInput->devs[i]->private);
645 dmxInput->vt_switched = dmxInput->vt_switch_pending;
646 dmxInput->vt_switch_pending = 0;
647 for (i = 0; i < dmxInput->numDevs; i++) {
648 if (dmxInput->devs[i]->vt_switch) {
650 if (!dmxInput->devs[i]->vt_switch(dmxInput->devs[i]->private,
651 dmxInput->vt_switched,
653 dmxInput))
654 dmxSwitchReturn(dmxInput);
659 dmxCollectAll(dmxInput);
691 DMXInputInfo *dmxInput;
695 dmxInput = &dmxInputs[dmxLocal->inputIdx];
742 dmxLogInput(dmxInput, "Added %s as %s device called %s%s\n",
763 * in \a dmxInput. */
764 DMXLocalInputInfoPtr dmxInputCopyLocal(DMXInputInfo *dmxInput,
773 dmxLocal->inputIdx = dmxInput->inputIdx;
774 dmxLocal->sendsCore = dmxInput->core;
775 dmxLocal->savedSendsCore = dmxInput->core;
778 ++dmxInput->numDevs;
779 dmxInput->devs = realloc(dmxInput->devs,
780 dmxInput->numDevs * sizeof(*dmxInput->devs));
781 dmxInput->devs[dmxInput->numDevs-1] = dmxLocal;
786 static void dmxPopulateLocal(DMXInputInfo *dmxInput, dmxArg a)
795 dmxInputCopyLocal(dmxInput, pt);
823 static void dmxInputScanForExtensions(DMXInputInfo *dmxInput, int doXI)
832 if (!(display = XOpenDisplay(dmxInput->name))) return;
840 dmxLogInput(dmxInput, "%s is not available\n", INAME);
842 dmxLogInput(dmxInput, "Locating devices on %s (%s version %d.%d)\n",
843 dmxInput->name, INAME,
860 dmxLogInput(dmxInput, " %2d %-10.10s %-16.16s\n",
870 for (j = 0; j < dmxInput->numDevs; j++) {
871 DMXLocalInputInfoPtr dmxL = dmxInput->devs[j];
882 for (j = 0; j < dmxInput->numDevs; j++) {
883 DMXLocalInputInfoPtr dmxL = dmxInput->devs[j];
899 /** Re-initialize all the devices described in \a dmxInput. Called from
901 void dmxInputReInit(DMXInputInfo *dmxInput)
905 for (i = 0; i < dmxInput->numDevs; i++) {
906 DMXLocalInputInfoPtr dmxLocal = dmxInput->devs[i];
912 /** Re-initialize all the devices described in \a dmxInput. Called from
914 void dmxInputLateReInit(DMXInputInfo *dmxInput)
918 for (i = 0; i < dmxInput->numDevs; i++) {
919 DMXLocalInputInfoPtr dmxLocal = dmxInput->devs[i];
925 /** Initialize all of the devices described in \a dmxInput. */
926 void dmxInputInit(DMXInputInfo *dmxInput)
937 a = dmxArgParse(dmxInput->name);
942 dmxInput->keycodes = xstrdup(dmxArgV(a, i));
946 dmxInput->symbols = xstrdup(dmxArgV(a, i));
950 dmxInput->geometry = xstrdup(dmxArgV(a, i));
971 dmxPopulateLocal(dmxInput, a);
973 dmxInputCopyLocal(dmxInput, &DMXDummyMou);
974 dmxInputCopyLocal(dmxInput, &DMXDummyKbd);
975 dmxLogInput(dmxInput, "Using dummy input\n");
985 if (!dmxInput->core) {
991 for (pt = (char *)dmxInput->name; pt && *pt; pt++)
993 dmxInputCopyLocal(dmxInput, &DMXBackendMou);
994 dmxInputCopyLocal(dmxInput, &DMXBackendKbd);
995 dmxInput->scrnIdx = i;
996 dmxLogInput(dmxInput,
1005 if (found) dmxInput->console = TRUE;
1006 for (pt = (char *)dmxInput->name; pt && *pt; pt++)
1008 dmxInputCopyLocal(dmxInput, &DMXConsoleMou);
1009 dmxInputCopyLocal(dmxInput, &DMXConsoleKbd);
1011 dmxInput->windows = TRUE;
1012 dmxInput->updateWindowInfo = dmxUpdateWindowInformation;
1014 dmxLogInput(dmxInput,
1023 dmxInputScanForExtensions(dmxInput, doXI);
1025 for (i = 0; i < dmxInput->numDevs; i++) {
1026 DMXLocalInputInfoPtr dmxLocal = dmxInput->devs[i];
1036 dmxInput->processInputEvents = dmxProcessInputEvents;
1037 dmxInput->detached = False;
1040 (void *)(uintptr_t)dmxInput->inputIdx);
1060 /** Free all of the memory associated with \a dmxInput */
1061 void dmxInputFree(DMXInputInfo *dmxInput)
1065 if (!dmxInput) return;
1067 free(dmxInput->keycodes);
1068 free(dmxInput->symbols);
1069 free(dmxInput->geometry);
1071 for (i = 0; i < dmxInput->numDevs; i++) {
1072 dmxInputFreeLocal(dmxInput->devs[i]);
1073 dmxInput->devs[i] = NULL;
1075 free(dmxInput->devs);
1076 dmxInput->devs = NULL;
1077 dmxInput->numDevs = 0;
1078 if (dmxInput->freename) free(dmxInput->name);
1079 dmxInput->name = NULL;
1090 DMXInputInfo *dmxInput = &dmxInputs[j];
1091 const char *pt = strchr(dmxInput->name, ',');
1093 ? (size_t)(pt-dmxInput->name)
1094 : strlen(dmxInput->name));
1096 for (i = 0; i < dmxInput->numDevs; i++) {
1097 DeviceIntPtr pDevice = dmxInput->devs[i]->pDevice;
1101 dmxInput->detached ? 'D' : ' ',
1120 dmxInput->inputIdx, len, len, dmxInput->name);
1121 if (dmxInput->devs[i]->deviceId >= 0)
1122 dmxLogCont(dmxInfo, "/id%d", dmxInput->devs[i]->deviceId);
1123 if (dmxInput->devs[i]->deviceName)
1124 dmxLogCont(dmxInfo, "=%s", dmxInput->devs[i]->deviceName);
1126 dmxInput->devs[i]->isCore
1128 : (dmxInput->devs[i]->sendsCore
1137 int dmxInputDetach(DMXInputInfo *dmxInput)
1141 if (dmxInput->detached) return BadAccess;
1143 for (i = 0; i < dmxInput->numDevs; i++) {
1144 DMXLocalInputInfoPtr dmxLocal = dmxInput->devs[i];
1145 dmxLogInput(dmxInput, "Detaching device id %d: %s%s\n",
1155 dmxInput->detached = True;
1166 DMXInputInfo *dmxInput = &dmxInputs[i];
1167 if (dmxInput->scrnIdx == dmxScreen->index) dmxInputDetach(dmxInput);
1174 DMXInputInfo *dmxInput = dmxInputLocateId(id);
1176 if (!dmxInput) return BadValue;
1178 return dmxInputDetach(dmxInput);
1186 DMXInputInfo *dmxInput = &dmxInputs[i];
1187 for (j = 0; j < dmxInput->numDevs; j++) {
1188 DMXLocalInputInfoPtr dmxLocal = dmxInput->devs[j];
1189 if (dmxLocal->pDevice->id == id) return dmxInput;
1195 static int dmxInputAttachNew(DMXInputInfo *dmxInput, int *id)
1197 dmxInputInit(dmxInput);
1199 if (id && dmxInput->devs) *id = dmxInput->devs[0]->pDevice->id;
1204 static int dmxInputAttachOld(DMXInputInfo *dmxInput, int *id)
1208 dmxInput->detached = False;
1209 for (i = 0; i < dmxInput->numDevs; i++) {
1210 DMXLocalInputInfoPtr dmxLocal = dmxInput->devs[i];
1212 dmxLogInput(dmxInput,
1229 DMXInputInfo *dmxInput;
1233 dmxInput = &dmxInputs[i];
1234 if (dmxInput->scrnIdx == -1
1235 && dmxInput->detached
1236 && !strcmp(dmxInput->name, name)) {
1238 dmxLogInput(dmxInput, "Reattaching detached console input\n");
1239 return dmxInputAttachOld(dmxInput, id);
1244 dmxInput = dmxConfigAddInput(xstrdup(name), isCore);
1245 dmxInput->freename = TRUE;
1246 dmxLogInput(dmxInput, "Attaching new console input\n");
1247 return dmxInputAttachNew(dmxInput, id);
1252 DMXInputInfo *dmxInput;
1258 dmxInput = &dmxInputs[i];
1259 if (dmxInput->scrnIdx != -1 && dmxInput->scrnIdx == physicalScreen) {
1261 if (!dmxInput->detached) return BadAccess; /* Already attached */
1264 dmxLogInput(dmxInput, "Reattaching detached backend input\n");
1265 return dmxInputAttachOld(dmxInput, id);
1271 dmxInput = dmxConfigAddInput(dmxScreen->name, isCore);
1272 dmxLogInput(dmxInput, "Attaching new backend input\n");
1273 return dmxInputAttachNew(dmxInput, id);