1 /* 2 (c) Copyright 2001-2009 The world wide DirectFB Open Source Community (directfb.org) 3 (c) Copyright 2000-2004 Convergence (integrated media) GmbH 4 5 All rights reserved. 6 7 Written by Denis Oliver Kropp <dok@directfb.org>, 8 Andreas Hundt <andi@fischlustig.de>, 9 Sven Neumann <neo@directfb.org>, 10 Ville Syrjälä <syrjala@sci.fi> and 11 Claudio Ciccani <klan@users.sf.net>. 12 13 This library is free software; you can redistribute it and/or 14 modify it under the terms of the GNU Lesser General Public 15 License as published by the Free Software Foundation; either 16 version 2 of the License, or (at your option) any later version. 17 18 This library is distributed in the hope that it will be useful, 19 but WITHOUT ANY WARRANTY; without even the implied warranty of 20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 Lesser General Public License for more details. 22 23 You should have received a copy of the GNU Lesser General Public 24 License along with this library; if not, write to the 25 Free Software Foundation, Inc., 59 Temple Place - Suite 330, 26 Boston, MA 02111-1307, USA. 27 */ 28 29 #ifndef __UNIQUE__INPUT_EVENTS_H__ 30 #define __UNIQUE__INPUT_EVENTS_H__ 31 32 #include <directfb.h> 33 34 #include <unique/types.h> 35 #include <unique/device.h> 36 37 typedef enum { 38 UIET_NONE = 0x00000000, 39 40 UIET_MOTION = 0x00000001, 41 UIET_BUTTON = 0x00000002, 42 43 UIET_WHEEL = 0x00000010, 44 45 UIET_KEY = 0x00000100, 46 47 UIET_CHANNEL = 0x00001000, 48 49 UIET_ALL = 0x00001113 50 } UniqueInputEventType; 51 52 53 typedef struct { 54 UniqueInputEventType type; 55 56 DFBInputDeviceID device_id; 57 58 bool press; 59 60 int x; 61 int y; 62 63 DFBInputDeviceButtonIdentifier button; 64 65 DFBInputDeviceButtonMask buttons; 66 } UniqueInputPointerEvent; 67 68 typedef struct { 69 UniqueInputEventType type; 70 71 DFBInputDeviceID device_id; 72 73 int value; 74 } UniqueInputWheelEvent; 75 76 typedef enum { 77 UIKF_NONE = 0x00000000, 78 79 UIKF_REPEAT = 0x00000001, 80 81 UIKF_ALL = 0x00000001 82 } UniqueInputKeyboardEventFlags; 83 84 typedef struct { 85 UniqueInputEventType type; 86 87 DFBInputDeviceID device_id; 88 89 bool press; 90 UniqueInputKeyboardEventFlags flags; 91 92 int key_code; 93 DFBInputDeviceKeyIdentifier key_id; 94 DFBInputDeviceKeySymbol key_symbol; 95 96 DFBInputDeviceModifierMask modifiers; 97 DFBInputDeviceLockState locks; 98 } UniqueInputKeyboardEvent; 99 100 typedef struct { 101 UniqueInputEventType type; 102 103 bool selected; 104 105 UniqueDeviceClassIndex index; 106 107 int x; 108 int y; 109 } UniqueInputChannelEvent; 110 111 112 union __UniQuE_UniqueInputEvent { 113 UniqueInputEventType type; 114 115 UniqueInputPointerEvent pointer; 116 UniqueInputWheelEvent wheel; 117 UniqueInputKeyboardEvent keyboard; 118 UniqueInputChannelEvent channel; 119 }; 120 121 122 #endif 123 124