1
/*****************************************************************************
3
* utouch-frame - Touch Frame Library
5
* Copyright (C) 2010-2011 Canonical Ltd.
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.
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.
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/>.
20
****************************************************************************/
22
#ifndef UTOUCH_FRAME_XI2_H
23
#define UTOUCH_FRAME_XI2_H
25
#include <utouch/frame.h>
36
* @defgroup v2-x11 X11
41
* Create a new uTouch Frame context for an X11 window server
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
47
UFStatus frame_x11_new(Display *display, UFHandle *handle);
50
* Delete an X11 uTouch Frame instance
52
* @param [in] handle The object for the uTouch Frame instance
54
void frame_x11_delete(UFHandle handle);
57
* Process an X11 input event into the uTouch Frame instance
59
* @param [in] handle The uTouch Frame context
60
* @param [in] event The X11 generic input event cookie
61
* @return UFStatusSuccess or UFStatusErrorGeneric
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.
68
* This function will silently ignore any events other than those listed above.
70
UFStatus frame_x11_process_event(UFHandle handle, XGenericEventCookie *xcookie);
73
* Accept ownership of a touch
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
80
UFStatus frame_x11_accept_touch(UFDevice device, UFWindowId window,
84
* Reject ownership of a touch
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
91
UFStatus frame_x11_reject_touch(UFDevice device, UFWindowId window,
95
* Get the X11 Window ID of a uTouch Frame window
97
* @param [in] window_id The uTouch Frame window ID object (const)
98
* @return The X11 window ID
100
Window frame_x11_get_window_id(UFWindowId window_id);
103
* Create a new uTouch Frame window ID object for an X11 window ID
105
* @param [in] id The X11 ID of the window
106
* @return The new uTouch Frame window ID object
108
UFWindowId frame_x11_create_window_id(Window id);
111
* Get the X11 touch ID of a uTouch Frame touch
113
* @param [in] touch_id The uTouch Frame touch ID object (const)
114
* @return The X11 touch ID
116
unsigned int frame_x11_get_touch_id(UFTouchId touch_id);
119
* Create a new uTouch Frame touch ID object for an X11 touch ID
121
* @param [in] id The X11 ID of the touch
122
* @return The new uTouch Frame touch ID object
124
UFTouchId frame_x11_create_touch_id(unsigned int id);