Line |
Branch |
Exec |
Source |
1 |
|
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- |
2 |
|
|
* |
3 |
|
|
* Copyright (C) 2014 Carlos Garnacho <carlosg@gnome.org> |
4 |
|
|
* |
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. |
9 |
|
|
* |
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. |
14 |
|
|
* |
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. |
18 |
|
|
*/ |
19 |
|
|
|
20 |
|
|
#pragma once |
21 |
|
|
|
22 |
|
|
#include <gdk/gdk.h> |
23 |
|
|
#include <glib-object.h> |
24 |
|
|
#include <gio/gio.h> |
25 |
|
|
|
26 |
|
|
G_BEGIN_DECLS |
27 |
|
|
|
28 |
|
|
#define GSD_TYPE_DEVICE (gsd_device_get_type ()) |
29 |
|
✗ |
G_DECLARE_DERIVABLE_TYPE (GsdDevice, gsd_device, GSD, DEVICE, GObject) |
30 |
|
|
|
31 |
|
|
#define GSD_TYPE_DEVICE_MANAGER (gsd_device_manager_get_type ()) |
32 |
|
✗ |
G_DECLARE_DERIVABLE_TYPE (GsdDeviceManager, gsd_device_manager, GSD, DEVICE_MANAGER, GObject) |
33 |
|
|
|
34 |
|
|
typedef enum { |
35 |
|
|
GSD_DEVICE_TYPE_MOUSE = 1 << 0, |
36 |
|
|
GSD_DEVICE_TYPE_KEYBOARD = 1 << 1, |
37 |
|
|
GSD_DEVICE_TYPE_TOUCHPAD = 1 << 2, |
38 |
|
|
GSD_DEVICE_TYPE_TABLET = 1 << 3, |
39 |
|
|
GSD_DEVICE_TYPE_TOUCHSCREEN = 1 << 4, |
40 |
|
|
GSD_DEVICE_TYPE_PAD = 1 << 5 |
41 |
|
|
} GsdDeviceType; |
42 |
|
|
|
43 |
|
|
struct _GsdDeviceClass { |
44 |
|
|
GObjectClass parent_class; |
45 |
|
|
}; |
46 |
|
|
|
47 |
|
|
struct _GsdDeviceManagerClass |
48 |
|
|
{ |
49 |
|
|
GObjectClass parent_class; |
50 |
|
|
|
51 |
|
|
GList * (* list_devices) (GsdDeviceManager *manager, |
52 |
|
|
GsdDeviceType type); |
53 |
|
|
|
54 |
|
|
void (* device_added) (GsdDeviceManager *manager, |
55 |
|
|
GsdDevice *device); |
56 |
|
|
void (* device_removed) (GsdDeviceManager *manager, |
57 |
|
|
GsdDevice *device); |
58 |
|
|
void (* device_changed) (GsdDeviceManager *manager, |
59 |
|
|
GsdDevice *device); |
60 |
|
|
|
61 |
|
|
GsdDevice * (* lookup_device) (GsdDeviceManager *manager, |
62 |
|
|
GdkDevice *gdk_device); |
63 |
|
|
}; |
64 |
|
|
|
65 |
|
|
GsdDeviceManager * gsd_device_manager_get (void); |
66 |
|
|
GList * gsd_device_manager_list_devices (GsdDeviceManager *manager, |
67 |
|
|
GsdDeviceType type); |
68 |
|
|
|
69 |
|
|
const gchar * gsd_device_get_name (GsdDevice *device); |
70 |
|
|
GsdDeviceType gsd_device_get_device_type (GsdDevice *device); |
71 |
|
|
void gsd_device_get_device_ids (GsdDevice *device, |
72 |
|
|
const gchar **vendor, |
73 |
|
|
const gchar **product); |
74 |
|
|
GSettings * gsd_device_get_settings (GsdDevice *device); |
75 |
|
|
|
76 |
|
|
const gchar * gsd_device_get_device_file (GsdDevice *device); |
77 |
|
|
gboolean gsd_device_get_dimensions (GsdDevice *device, |
78 |
|
|
guint *width, |
79 |
|
|
guint *height); |
80 |
|
|
|
81 |
|
|
GsdDevice * gsd_device_manager_lookup_gdk_device (GsdDeviceManager *manager, |
82 |
|
|
GdkDevice *gdk_device); |
83 |
|
|
gboolean gsd_device_shares_group (GsdDevice *device1, |
84 |
|
|
GsdDevice *device2); |
85 |
|
|
|
86 |
|
|
G_END_DECLS |
87 |
|
|
|