~chasedouglas/frame/ubuntu-upstream-xi

« back to all changes in this revision

Viewing changes to include/utouch/frame_x11.h

  • Committer: Chase Douglas
  • Date: 2011-12-09 01:36:45 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: chase.douglas@ubuntu.com-20111209013645-n24l4myiumblzsfu
* New upstream release.
  - Version 2 adds a new API built on top of XInput multitouch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************************
 
2
 *
 
3
 * utouch-frame - Touch Frame Library
 
4
 *
 
5
 * Copyright (C) 2010-2011 Canonical Ltd.
 
6
 *
 
7
 * This program is free software: you can redistribute it and/or modify it
 
8
 * under the terms of the GNU General Public License as published by the
 
9
 * Free Software Foundation, either version 3 of the License, or (at your
 
10
 * option) any later version.
 
11
 *
 
12
 * This program is distributed in the hope that it will be useful, but
 
13
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
15
 * General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License along
 
18
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 
19
 *
 
20
 ****************************************************************************/
 
21
 
 
22
#ifndef UTOUCH_FRAME_XI2_H
 
23
#define UTOUCH_FRAME_XI2_H
 
24
 
 
25
#include <utouch/frame.h>
 
26
#include <X11/Xlib.h>
 
27
 
 
28
#ifdef __cplusplus
 
29
extern "C" {
 
30
#endif
 
31
 
 
32
/**
 
33
 * @addtogroup v2
 
34
 * @{
 
35
 *
 
36
 * @defgroup v2-x11 X11
 
37
 * @{
 
38
 */
 
39
 
 
40
/**
 
41
 * Create a new uTouch Frame context for an X11 window server
 
42
 *
 
43
 * @param [in] display The X11 server connection
 
44
 * @param [out] handle The object for the new uTouch Frame instance
 
45
 * @return UFStatusSuccess, UFStatusErrorResources, or UFStatusErrorGeneric
 
46
 */
 
47
UFStatus frame_x11_new(Display *display, UFHandle *handle);
 
48
 
 
49
/**
 
50
 * Delete an X11 uTouch Frame instance
 
51
 *
 
52
 * @param [in] handle The object for the uTouch Frame instance
 
53
 */
 
54
void frame_x11_delete(UFHandle handle);
 
55
 
 
56
/**
 
57
 * Process an X11 input event into the uTouch Frame instance
 
58
 *
 
59
 * @param [in] handle The uTouch Frame context
 
60
 * @param [in] event The X11 generic input event cookie
 
61
 * @return UFStatusSuccess or UFStatusErrorGeneric
 
62
 *
 
63
 * The uTouch-Frame library can process XIDeviceEvent and
 
64
 * XIHierarchyEvent events. Processing these events requires additional event
 
65
 * data. This data is obtained by calling XGetEventData on the XEvent. See the
 
66
 * XGetEventData and XFreeEventData man pages for more details.
 
67
 *
 
68
 * This function will silently ignore any events other than those listed above.
 
69
 */
 
70
UFStatus frame_x11_process_event(UFHandle handle, XGenericEventCookie *xcookie);
 
71
 
 
72
/**
 
73
 * Accept ownership of a touch
 
74
 *
 
75
 * @param [in] device The device object for the touch (const)
 
76
 * @param [in] window The window to accept the touch for
 
77
 * @param [in] touch_id The touch ID object for the touch
 
78
 * @return UFStatusSuccess, UFStatusErrorInvalidTouch
 
79
 */
 
80
UFStatus frame_x11_accept_touch(UFDevice device, UFWindowId window,
 
81
                                UFTouchId touch_id);
 
82
 
 
83
/**
 
84
 * Reject ownership of a touch
 
85
 *
 
86
 * @param [in] device The device object for the touch (const)
 
87
 * @param [in] window The window to reject the touch for
 
88
 * @param [in] touch_id The touch ID object for the touch
 
89
 * @return UFStatusSuccess, UFStatusErrorInvalidTouch
 
90
 */
 
91
UFStatus frame_x11_reject_touch(UFDevice device, UFWindowId window,
 
92
                                UFTouchId touch_id);
 
93
 
 
94
/**
 
95
 * Get the X11 Window ID of a uTouch Frame window
 
96
 *
 
97
 * @param [in] window_id The uTouch Frame window ID object (const)
 
98
 * @return The X11 window ID
 
99
 */
 
100
Window frame_x11_get_window_id(UFWindowId window_id);
 
101
 
 
102
/**
 
103
 * Create a new uTouch Frame window ID object for an X11 window ID
 
104
 *
 
105
 * @param [in] id The X11 ID of the window
 
106
 * @return The new uTouch Frame window ID object
 
107
 */
 
108
UFWindowId frame_x11_create_window_id(Window id);
 
109
 
 
110
/**
 
111
 * Get the X11 touch ID of a uTouch Frame touch
 
112
 *
 
113
 * @param [in] touch_id The uTouch Frame touch ID object (const)
 
114
 * @return The X11 touch ID
 
115
 */
 
116
unsigned int frame_x11_get_touch_id(UFTouchId touch_id);
 
117
 
 
118
/**
 
119
 * Create a new uTouch Frame touch ID object for an X11 touch ID
 
120
 *
 
121
 * @param [in] id The X11 ID of the touch
 
122
 * @return The new uTouch Frame touch ID object
 
123
 */
 
124
UFTouchId frame_x11_create_touch_id(unsigned int id);
 
125
 
 
126
/**
 
127
 * @}
 
128
 *
 
129
 * @}
 
130
 */
 
131
 
 
132
#ifdef __cplusplus
 
133
}
 
134
#endif
 
135
 
 
136
#endif