Lines Matching full:pi

100     KdPointerInfo *pi;  in KdResetInputMachine()  local
102 for (pi = kdPointers; pi; pi = pi->next) { in KdResetInputMachine()
103 pi->mouseState = start; in KdResetInputMachine()
104 pi->eventHeld = FALSE; in KdResetInputMachine()
112 KdPointerInfo *pi; in KdDisableInput() local
121 for (pi = kdPointers; pi; pi = pi->next) { in KdDisableInput()
122 if (pi->driver && pi->driver->Disable) in KdDisableInput()
123 (*pi->driver->Disable) (pi); in KdDisableInput()
134 KdPointerInfo *pi; in KdEnableInput() local
147 for (pi = kdPointers; pi; pi = pi->next) { in KdEnableInput()
148 if (pi->driver && pi->driver->Enable) in KdEnableInput()
149 (*pi->driver->Enable) (pi); in KdEnableInput()
151 NoticeEventTime (&ev, pi->dixdev); in KdEnableInput()
195 KdPointerInfo *pi; in KdPointerProc() local
203 for (pi = kdPointers; pi; pi = pi->next) { in KdPointerProc()
204 if (pi->dixdev && pi->dixdev->id == pDevice->id) in KdPointerProc()
208 if (!pi || !pi->dixdev || pi->dixdev->id != pDevice->id) { in KdPointerProc()
217 ErrorF("initialising pointer %s ...\n", pi->name); in KdPointerProc()
219 if (!pi->driver) { in KdPointerProc()
220 if (!pi->driverPrivate) { in KdPointerProc()
222 pi->name ? pi->name : "(unnamed)", pi->path); in KdPointerProc()
226 pi->driver = KdFindPointerDriver(pi->driverPrivate); in KdPointerProc()
227 if (!pi->driver) { in KdPointerProc()
229 pi->driverPrivate ? (char *) pi->driverPrivate : in KdPointerProc()
233 free(pi->driverPrivate); in KdPointerProc()
234 pi->driverPrivate = NULL; in KdPointerProc()
237 if (!pi->driver->Init) { in KdPointerProc()
242 if ((*pi->driver->Init) (pi) != Success) { in KdPointerProc()
246 btn_labels = calloc(pi->nButtons, sizeof(Atom)); in KdPointerProc()
249 axes_labels = calloc(pi->nAxes, sizeof(Atom)); in KdPointerProc()
255 switch (pi->nAxes) { in KdPointerProc()
275 if (pi->nAxes >= 2) { in KdPointerProc()
280 InitPointerDeviceStruct(pDev, pi->map, pi->nButtons, btn_labels, in KdPointerProc()
282 GetMotionHistorySize(), pi->nAxes, axes_labels); in KdPointerProc()
287 if (pi->inputClass == KD_TOUCHSCREEN) { in KdPointerProc()
294 AssignTypeAndName(pi->dixdev, xiclass, in KdPointerProc()
295 pi->name ? pi->name : "Generic KDrive Pointer"); in KdPointerProc()
303 if (!pi->driver->Enable) { in KdPointerProc()
308 if ((*pi->driver->Enable) (pi) == Success) { in KdPointerProc()
323 if (!pi->driver->Disable) { in KdPointerProc()
327 (*pi->driver->Disable) (pi); in KdPointerProc()
336 if (!pi->driver->Disable) { in KdPointerProc()
339 (*pi->driver->Disable) (pi); in KdPointerProc()
343 if (!pi->driver->Fini) in KdPointerProc()
346 (*pi->driver->Fini) (pi); in KdPointerProc()
348 KdRemovePointer(pi); in KdPointerProc()
795 KdAddPointer(KdPointerInfo * pi) in KdAddPointer() argument
799 if (!pi) in KdAddPointer()
802 pi->mouseState = start; in KdAddPointer()
803 pi->eventHeld = FALSE; in KdAddPointer()
805 pi->dixdev = AddInputDevice(serverClient, KdPointerProc, TRUE); in KdAddPointer()
806 if (!pi->dixdev) { in KdAddPointer()
808 pi->name ? pi->name : "(unnamed)"); in KdAddPointer()
813 *prev = pi; in KdAddPointer()
819 KdRemovePointer(KdPointerInfo * pi) in KdRemovePointer() argument
823 if (!pi) in KdRemovePointer()
827 if (*prev == pi) { in KdRemovePointer()
828 *prev = pi->next; in KdRemovePointer()
833 KdFreePointer(pi); in KdRemovePointer()
1003 KdParsePointerOptions(KdPointerInfo * pi) in KdParsePointerOptions() argument
1007 nt_list_for_each_entry(option, pi->options, list.next) { in KdParsePointerOptions()
1012 pi->emulateMiddleButton = TRUE; in KdParsePointerOptions()
1014 pi->emulateMiddleButton = FALSE; in KdParsePointerOptions()
1016 pi->transformCoordinates = TRUE; in KdParsePointerOptions()
1018 pi->transformCoordinates = FALSE; in KdParsePointerOptions()
1020 if (pi->path != NULL) in KdParsePointerOptions()
1021 free(pi->path); in KdParsePointerOptions()
1022 pi->path = strdup(value); in KdParsePointerOptions()
1026 if (pi->path != NULL) in KdParsePointerOptions()
1027 free(pi->path); in KdParsePointerOptions()
1028 pi->path = strdup(value); in KdParsePointerOptions()
1031 free(pi->name); in KdParsePointerOptions()
1032 pi->name = strdup(value); in KdParsePointerOptions()
1036 pi->protocol = strdup(value); in KdParsePointerOptions()
1038 pi->driver = KdFindPointerDriver(value); in KdParsePointerOptions()
1050 KdPointerInfo *pi = NULL; in KdParsePointer() local
1054 pi = KdNewPointer(); in KdParsePointer()
1055 if (!pi) in KdParsePointer()
1057 pi->emulateMiddleButton = kdEmulateMiddleButton; in KdParsePointer()
1058 pi->transformCoordinates = !kdRawPointerCoordinates; in KdParsePointer()
1059 pi->protocol = NULL; in KdParsePointer()
1060 pi->nButtons = 5; /* XXX should not be hardcoded */ in KdParsePointer()
1061 pi->inputClass = KD_MOUSE; in KdParsePointer()
1065 KdFreePointer(pi); in KdParsePointer()
1071 KdFreePointer(pi); in KdParsePointer()
1077 KdFreePointer(pi); in KdParsePointer()
1082 pi->driverPrivate = NULL; in KdParsePointer()
1084 pi->driverPrivate = strdup(save); in KdParsePointer()
1087 return pi; in KdParsePointer()
1099 if ('1' <= *s && *s <= '0' + pi->nButtons) in KdParsePointer()
1100 pi->map[i] = *s - '0'; in KdParsePointer()
1108 KdFreePointer(pi); in KdParsePointer()
1115 pi->options = options; in KdParsePointer()
1116 KdParsePointerOptions(pi); in KdParsePointer()
1119 return pi; in KdParsePointer()
1125 KdPointerInfo *pi; in KdInitInput() local
1135 pi = KdParsePointer(dev->line); in KdInitInput()
1136 if (!pi) in KdInitInput()
1138 if (KdAddPointer(pi) != Success) in KdInitInput()
1473 KdInsideEmulationWindow(KdPointerInfo * pi, int x, int y, int z) in KdInsideEmulationWindow() argument
1475 pi->emulationDx = pi->heldEvent.x - x; in KdInsideEmulationWindow()
1476 pi->emulationDy = pi->heldEvent.y - y; in KdInsideEmulationWindow()
1478 return (abs(pi->emulationDx) < EMULATION_WINDOW && in KdInsideEmulationWindow()
1479 abs(pi->emulationDy) < EMULATION_WINDOW); in KdInsideEmulationWindow()
1483 KdClassifyInput(KdPointerInfo * pi, int type, int x, int y, int z, int b) in KdClassifyInput() argument
1511 if (pi->eventHeld && !KdInsideEmulationWindow(pi, x, y, z)) in KdClassifyInput()
1522 _KdEnqueuePointerEvent(KdPointerInfo * pi, int type, int x, int y, int z,
1526 KdRunMouseMachine(KdPointerInfo * pi, KdInputClass c, int type, int x, int y, in KdRunMouseMachine() argument
1532 c = KdClassifyInput(pi, type, x, y, z, b); in KdRunMouseMachine()
1533 t = &kdInputMachine[pi->mouseState][c]; in KdRunMouseMachine()
1539 pi->eventHeld = TRUE; in KdRunMouseMachine()
1540 pi->emulationDx = 0; in KdRunMouseMachine()
1541 pi->emulationDy = 0; in KdRunMouseMachine()
1542 pi->heldEvent.type = type; in KdRunMouseMachine()
1543 pi->heldEvent.x = x; in KdRunMouseMachine()
1544 pi->heldEvent.y = y; in KdRunMouseMachine()
1545 pi->heldEvent.z = z; in KdRunMouseMachine()
1546 pi->heldEvent.flags = b; in KdRunMouseMachine()
1547 pi->heldEvent.absrel = absrel; in KdRunMouseMachine()
1551 pi->emulationTimeout = GetTimeInMillis() + EMULATION_TIMEOUT; in KdRunMouseMachine()
1552 pi->timeoutPending = TRUE; in KdRunMouseMachine()
1555 _KdEnqueuePointerEvent(pi, pi->heldEvent.type, pi->heldEvent.x, in KdRunMouseMachine()
1556 pi->heldEvent.y, pi->heldEvent.z, in KdRunMouseMachine()
1557 pi->heldEvent.flags, pi->heldEvent.absrel, in KdRunMouseMachine()
1561 pi->eventHeld = FALSE; in KdRunMouseMachine()
1562 pi->timeoutPending = FALSE; in KdRunMouseMachine()
1563 _KdEnqueuePointerEvent(pi, pi->heldEvent.type, pi->heldEvent.x, in KdRunMouseMachine()
1564 pi->heldEvent.y, pi->heldEvent.z, in KdRunMouseMachine()
1565 pi->heldEvent.flags, pi->heldEvent.absrel, in KdRunMouseMachine()
1570 pi->timeoutPending = FALSE; in KdRunMouseMachine()
1573 _KdEnqueuePointerEvent(pi, ButtonPress, x, y, z, 2, absrel, TRUE); in KdRunMouseMachine()
1574 pi->eventHeld = FALSE; in KdRunMouseMachine()
1578 _KdEnqueuePointerEvent(pi, ButtonRelease, x, y, z, 2, absrel, TRUE); in KdRunMouseMachine()
1583 pi->mouseState = t->nextState; in KdRunMouseMachine()
1588 KdHandlePointerEvent(KdPointerInfo * pi, int type, int x, int y, int z, int b, in KdHandlePointerEvent() argument
1591 if (pi->emulateMiddleButton) in KdHandlePointerEvent()
1592 return KdRunMouseMachine(pi, KdClassifyInput(pi, type, x, y, z, b), in KdHandlePointerEvent()
1598 _KdEnqueuePointerEvent(KdPointerInfo * pi, int type, int x, int y, int z, in _KdEnqueuePointerEvent() argument
1605 if (!force && KdHandlePointerEvent(pi, type, x, y, z, b, absrel)) in _KdEnqueuePointerEvent()
1610 QueuePointerEvents(pi->dixdev, type, b, absrel, &mask); in _KdEnqueuePointerEvent()
1614 KdReceiveTimeout(KdPointerInfo * pi) in KdReceiveTimeout() argument
1616 KdRunMouseMachine(pi, timeout, 0, 0, 0, 0, 0, 0); in KdReceiveTimeout()
1681 KdEnqueuePointerEvent(KdPointerInfo * pi, unsigned long flags, int rx, int ry, in KdEnqueuePointerEvent() argument
1691 if (!pi) in KdEnqueuePointerEvent()
1696 if (pi->transformCoordinates) { in KdEnqueuePointerEvent()
1706 if (pi->transformCoordinates) { in KdEnqueuePointerEvent()
1720 _KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, in KdEnqueuePointerEvent()
1728 if (x != pi->dixdev->last.valuators[0] || in KdEnqueuePointerEvent()
1729 y != pi->dixdev->last.valuators[1]) in KdEnqueuePointerEvent()
1730 _KdEnqueuePointerEvent(pi, MotionNotify, x, y, z, 0, dixflags, in KdEnqueuePointerEvent()
1736 for (button = KD_BUTTON_1, n = 1; n <= pi->nButtons; button <<= 1, n++) { in KdEnqueuePointerEvent()
1737 if (((pi->buttonState & button) ^ (buttons & button)) && in KdEnqueuePointerEvent()
1739 _KdEnqueuePointerEvent(pi, ButtonRelease, x, y, z, n, in KdEnqueuePointerEvent()
1743 for (button = KD_BUTTON_1, n = 1; n <= pi->nButtons; button <<= 1, n++) { in KdEnqueuePointerEvent()
1744 if (((pi->buttonState & button) ^ (buttons & button)) && in KdEnqueuePointerEvent()
1746 _KdEnqueuePointerEvent(pi, ButtonPress, x, y, z, n, in KdEnqueuePointerEvent()
1751 pi->buttonState = buttons; in KdEnqueuePointerEvent()
1757 KdPointerInfo *pi; in KdBlockHandler() local
1760 for (pi = kdPointers; pi; pi = pi->next) { in KdBlockHandler()
1761 if (pi->timeoutPending) { in KdBlockHandler()
1764 ms = pi->emulationTimeout - GetTimeInMillis(); in KdBlockHandler()
1778 KdPointerInfo *pi; in KdWakeupHandler() local
1780 for (pi = kdPointers; pi; pi = pi->next) { in KdWakeupHandler()
1781 if (pi->timeoutPending) { in KdWakeupHandler()
1782 if ((long) (GetTimeInMillis() - pi->emulationTimeout) >= 0) { in KdWakeupHandler()
1783 pi->timeoutPending = FALSE; in KdWakeupHandler()
1785 KdReceiveTimeout(pi); in KdWakeupHandler()
1940 KdPointerInfo *pi = NULL; in NewInputDeviceRequest() local
1950 pi = KdNewPointer(); in NewInputDeviceRequest()
1951 if (!pi) { in NewInputDeviceRequest()
1974 pi = KdNewPointer(); in NewInputDeviceRequest()
1975 if (!pi) { in NewInputDeviceRequest()
2001 pi = KdNewPointer(); in NewInputDeviceRequest()
2002 if (!pi) { in NewInputDeviceRequest()
2024 if (pi) { in NewInputDeviceRequest()
2025 pi->options = optionsdup; in NewInputDeviceRequest()
2026 KdParsePointerOptions(pi); in NewInputDeviceRequest()
2028 if (!pi->driver) { in NewInputDeviceRequest()
2030 pi->name ? pi->name : "(unnamed)", pi->path); in NewInputDeviceRequest()
2031 KdFreePointer(pi); in NewInputDeviceRequest()
2035 if (KdAddPointer(pi) != Success || in NewInputDeviceRequest()
2036 ActivateDevice(pi->dixdev, TRUE) != Success || in NewInputDeviceRequest()
2037 EnableDevice(pi->dixdev, TRUE) != TRUE) { in NewInputDeviceRequest()
2039 pi->name ? pi->name : "(unnamed)", pi->path); in NewInputDeviceRequest()
2040 KdFreePointer(pi); in NewInputDeviceRequest()
2044 *pdev = pi->dixdev; in NewInputDeviceRequest()