1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
3
* Copyright (C) 2010 Bastien Nocera <hadess@hadess.net>
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
#ifndef __GSD_INPUT_HELPER_H
21
#define __GSD_INPUT_HELPER_H
27
#include <X11/extensions/XInput.h>
28
#include <X11/extensions/XIproto.h>
30
#define WACOM_SERIAL_IDS_PROP "Wacom Serial IDs"
34
COMMAND_DEVICE_REMOVED,
35
COMMAND_DEVICE_PRESENT
38
/* Generic property setting code. Fill up the struct property with the property
39
* data and pass it into device_set_property together with the device to be
40
* changed. Note: doesn't cater for non-zero offsets yet, but we don't have
41
* any settings that require that.
44
const char *name; /* property name */
45
gint nitems; /* number of items in data */
46
gint format; /* CARD8 or CARD32 sized-items */
47
gint type; /* Atom representing data type */
49
const gchar *c; /* 8 bit data */
50
const gint *i; /* 32 bit data */
54
gboolean supports_xinput_devices (void);
55
gboolean supports_xinput2_devices (int *opcode);
56
gboolean supports_xtest (void);
58
gboolean set_device_enabled (int device_id,
61
gboolean device_is_touchpad (XDevice *xdevice);
63
gboolean device_info_is_touchpad (XDeviceInfo *device_info);
64
gboolean device_info_is_touchscreen (XDeviceInfo *device_info);
65
gboolean device_info_is_tablet (XDeviceInfo *device_info);
66
gboolean device_info_is_mouse (XDeviceInfo *device_info);
67
gboolean device_info_is_trackball (XDeviceInfo *device_info);
69
gboolean touchpad_is_present (void);
70
gboolean touchscreen_is_present (void);
71
gboolean mouse_is_present (void);
72
gboolean trackball_is_present (void);
74
gboolean device_set_property (XDevice *xdevice,
75
const char *device_name,
76
PropertyHelper *property);
78
gboolean run_custom_command (GdkDevice *device,
79
CustomCommand command);
81
GList * get_disabled_devices (GdkDeviceManager *manager);
82
char * xdevice_get_device_node (int deviceid);
83
int xdevice_get_last_tool_id (int deviceid);
87
#endif /* __GSD_INPUT_HELPER_H */