Commit be8d68c5 authored by Carlos Garnacho's avatar Carlos Garnacho

Update device configuration from gnome-settings-daemon

GsdWacomDevice has been updated, dragging GsdDeviceManager as a dependency
from g-s-d, which has been added to panels/common, and compiled as a
separate static libary, which is used by the wacom and mouse modules.

gsd-input-helper.[ch] is now in such library and has been removed from
the panel directories.

https://bugzilla.gnome.org/show_bug.cgi?id=743196
parent 9ffaff74
......@@ -177,6 +177,13 @@ AM_CONDITIONAL(HAVE_INTROSPECTION, false)
GDESKTOP_PREFIX=`$PKG_CONFIG --variable prefix gsettings-desktop-schemas`
AC_SUBST(GDESKTOP_PREFIX)
PKG_CHECK_MODULES(DEVICES, $COMMON_MODULES)
PKG_CHECK_MODULES(UDEV, gudev-1.0, have_udev=yes, have_udev=no)
if test "x$have_udev" = xyes ; then
AC_DEFINE(HAVE_UDEV, 1, [System has udev])
AM_CONDITIONAL(HAVE_UDEV, [test "x$have_udev" = "xyes"])
fi
PKG_CHECK_MODULES(NETWORK_MANAGER, NetworkManager >= $NETWORK_MANAGER_REQUIRED_VERSION
libnm-glib >= $NETWORK_MANAGER_REQUIRED_VERSION
libnm-glib-vpn >= $NETWORK_MANAGER_REQUIRED_VERSION
......
# This is used in PANEL_CFLAGS
cappletname = common
noinst_LTLIBRARIES = liblanguage.la
noinst_LTLIBRARIES = liblanguage.la libdevice.la
AM_CPPFLAGS = \
$(DEVICES_CFLAGS) \
$(PANEL_CFLAGS) \
$(LIBLANGUAGE_CFLAGS)
......@@ -23,6 +24,47 @@ liblanguage_la_SOURCES = \
liblanguage_la_LIBADD = \
$(LIBLANGUAGE_LIBS)
#libdevice
GSD_COMMON_ENUM_FILES = gsd-common-enums.c gsd-common-enums.h
gsd-common-enums.h: gsd-device-manager.h Makefile
$(AM_V_GEN)($(GLIB_MKENUMS) \
--fhead "#ifndef GSD_COMMON_ENUMS_H\n#define GSD_COMMON_ENUMS_H\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
--fprod "/* enumerations from \"@filename@\" */\n" \
--vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define GSD_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
--ftail "G_END_DECLS\n\n#endif /* !GSD_COMMON_ENUMS_H */" \
$(srcdir)/gsd-device-manager.h > $@)
gsd-common-enums.c: gsd-device-manager.h Makefile gsd-common-enums.h
$(AM_V_GEN)($(GLIB_MKENUMS) \
--fhead "#include \"gsd-device-manager.h\"\n#include \"gsd-common-enums.h\"\n" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \
$(srcdir)/gsd-device-manager.h > $@)
libdevice_la_SOURCES = \
gsd-common-enums.c \
gsd-common-enums.h \
gsd-input-helper.c \
gsd-input-helper.h \
gsd-device-manager.c \
gsd-device-manager.h \
gsd-device-manager-x11.c \
gsd-device-manager-x11.h
libdevice_la_LIBADD = \
$(DEVICES_LIBS)
if HAVE_UDEV
AM_CPPFLAGS += $(UDEV_CFLAGS)
libdevice_la_LIBADD += $(UDEV_LIBS)
libdevice_la_SOURCES += \
gsd-device-manager-udev.c \
gsd-device-manager-udev.h
endif
resource_files = $(shell glib-compile-resources --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/common.gresource.xml)
cc-common-resources.c: common.gresource.xml $(resource_files)
$(AM_V_GEN) glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-source --c-name cc_common $<
......@@ -33,6 +75,21 @@ rulesdir = $(datadir)/polkit-1/rules.d/
rules_DATA = gnome-control-center.rules
EXTRA_DIST = $(rules_DATA) $(resource_files) common.gresource.xml
CLEANFILES = $(BUILT_SOURCES)
CLEANFILES = $(BUILT_SOURCES) $(GSD_COMMON_ENUM_FILES)
INPUTDIR=$(top_srcdir)/../gnome-settings-daemon/plugins/common/
INPUTFILES= \
gsd-input-helper.c \
gsd-input-helper.h \
gsd-device-manager.c \
gsd-device-manager.h \
gsd-device-manager-x11.c \
gsd-device-manager-x11.h \
gsd-device-manager-udev.c \
gsd-device-manager-udev.h
update-from-gsd:
FILES="$(INPUTFILES)" DIR="$(INPUTDIR)" $(top_srcdir)/update-from-gsd.sh && changed=true ; \
git commit -m "mouse: Update from gnome-settings-daemon" $(INPUTFILES)
-include $(top_srcdir)/git.mk
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2015 Red Hat
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Author: Carlos Garnacho <carlosg@gnome.org>
*/
#include "config.h"
#include <string.h>
#include <gudev/gudev.h>
#include "gsd-device-manager-udev.h"
struct _GsdUdevDeviceManager
{
GsdDeviceManager parent_instance;
GHashTable *devices;
GUdevClient *udev_client;
};
struct _GsdUdevDeviceManagerClass
{
GsdDeviceManagerClass parent_class;
};
G_DEFINE_TYPE (GsdUdevDeviceManager, gsd_udev_device_manager, GSD_TYPE_DEVICE_MANAGER)
/* Index matches GsdDeviceType */
const gchar *udev_ids[] = {
"ID_INPUT_MOUSE",
"ID_INPUT_KEYBOARD",
"ID_INPUT_TOUCHPAD",
"ID_INPUT_TABLET",
"ID_INPUT_TOUCHSCREEN"
};
static GsdDeviceType
udev_device_get_device_type (GUdevDevice *device)
{
GsdDeviceType type = 0;
gint i;
for (i = 0; i < G_N_ELEMENTS (udev_ids); i++) {
if (g_udev_device_get_property_as_boolean (device, udev_ids[i]))
type |= (1 << i);
}
return type;
}
static gboolean
device_is_evdev (GUdevDevice *device)
{
const gchar *device_file;
device_file = g_udev_device_get_device_file (device);
if (!device_file || strstr (device_file, "/event") == NULL)
return FALSE;
return g_udev_device_get_property_as_boolean (device, "ID_INPUT");
}
static GsdDevice *
create_device (GUdevDevice *udev_device)
{
const gchar *vendor, *product, *name;
guint width, height;
GUdevDevice *parent;
GsdDevice *device;
parent = g_udev_device_get_parent (udev_device);
g_assert (parent != NULL);
name = g_udev_device_get_sysfs_attr (parent, "name");
vendor = g_udev_device_get_property (udev_device, "ID_VENDOR_ID");
product = g_udev_device_get_property (udev_device, "ID_MODEL_ID");
width = g_udev_device_get_property_as_int (udev_device, "ID_INPUT_WIDTH_MM");
height = g_udev_device_get_property_as_int (udev_device, "ID_INPUT_WIDTH_MM");
device = g_object_new (GSD_TYPE_DEVICE,
"name", name,
"device-file", g_udev_device_get_device_file (udev_device),
"type", udev_device_get_device_type (udev_device),
"vendor-id", vendor,
"product-id", product,
"width", width,
"height", height,
NULL);
g_object_unref (parent);
return device;
}
static void
add_device (GsdUdevDeviceManager *manager,
GUdevDevice *udev_device)
{
GUdevDevice *parent;
GsdDevice *device;
parent = g_udev_device_get_parent (udev_device);
if (!parent)
return;
device = create_device (udev_device);
g_hash_table_insert (manager->devices, g_object_ref (udev_device), device);
g_signal_emit_by_name (manager, "device-added", device);
}
static void
remove_device (GsdUdevDeviceManager *manager,
GUdevDevice *udev_device)
{
GsdDevice *device;
device = g_hash_table_lookup (manager->devices, udev_device);
if (!device)
return;
g_hash_table_steal (manager->devices, udev_device);
g_signal_emit_by_name (manager, "device-removed", device);
g_object_unref (device);
g_object_unref (udev_device);
}
static void
udev_event_cb (GUdevClient *client,
gchar *action,
GUdevDevice *device,
GsdUdevDeviceManager *manager)
{
if (!device_is_evdev (device))
return;
if (g_strcmp0 (action, "add") == 0) {
add_device (manager, device);
} else if (g_strcmp0 (action, "remove") == 0) {
remove_device (manager, device);
}
}
static void
gsd_udev_device_manager_init (GsdUdevDeviceManager *manager)
{
const gchar *subsystems[] = { "input", NULL };
GList *devices, *l;
manager->devices = g_hash_table_new_full (NULL, NULL,
(GDestroyNotify) g_object_unref,
(GDestroyNotify) g_object_unref);
manager->udev_client = g_udev_client_new (subsystems);
g_signal_connect (manager->udev_client, "uevent",
G_CALLBACK (udev_event_cb), manager);
devices = g_udev_client_query_by_subsystem (manager->udev_client,
subsystems[0]);
for (l = devices; l; l = l->next) {
GUdevDevice *device = l->data;
if (device_is_evdev (device))
add_device (manager, device);
g_object_unref (device);
}
g_list_free (devices);
}
static void
gsd_udev_device_manager_finalize (GObject *object)
{
GsdUdevDeviceManager *manager = GSD_UDEV_DEVICE_MANAGER (object);
g_hash_table_destroy (manager->devices);
g_object_unref (manager->udev_client);
G_OBJECT_CLASS (gsd_udev_device_manager_parent_class)->finalize (object);
}
static GList *
gsd_udev_device_manager_list_devices (GsdDeviceManager *manager,
GsdDeviceType type)
{
GsdUdevDeviceManager *manager_udev = GSD_UDEV_DEVICE_MANAGER (manager);
GsdDeviceType device_type;
GList *devices = NULL;
GHashTableIter iter;
GsdDevice *device;
g_hash_table_iter_init (&iter, manager_udev->devices);
while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &device)) {
device_type = gsd_device_get_device_type (device);
if ((device_type & type) == type)
devices = g_list_prepend (devices, device);
}
return devices;
}
static void
gsd_udev_device_manager_class_init (GsdUdevDeviceManagerClass *klass)
{
GsdDeviceManagerClass *manager_class = GSD_DEVICE_MANAGER_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gsd_udev_device_manager_finalize;
manager_class->list_devices = gsd_udev_device_manager_list_devices;
}
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2015 Red Hat
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Author: Carlos Garnacho <carlosg@gnome.org>
*/
#ifndef __GSD_UDEV_DEVICE_MANAGER_H__
#define __GSD_UDEV_DEVICE_MANAGER_H__
#include "gsd-device-manager.h"
G_BEGIN_DECLS
#define GSD_TYPE_UDEV_DEVICE_MANAGER (gsd_udev_device_manager_get_type ())
#define GSD_UDEV_DEVICE_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_UDEV_DEVICE_MANAGER, GsdUdevDeviceManager))
#define GSD_UDEV_DEVICE_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GSD_TYPE_UDEV_DEVICE_MANAGER, GsdUdevDeviceManagerClass))
#define GSD_IS_UDEV_DEVICE_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_UDEV_DEVICE_MANAGER))
#define GSD_IS_UDEV_DEVICE_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSD_TYPE_UDEV_DEVICE_MANAGER))
#define GSD_UDEV_DEVICE_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSD_TYPE_UDEV_DEVICE_MANAGER, GsdUdevDeviceManagerClass))
typedef struct _GsdUdevDeviceManager GsdUdevDeviceManager;
typedef struct _GsdUdevDeviceManagerClass GsdUdevDeviceManagerClass;
GType gsd_udev_device_manager_get_type (void) G_GNUC_CONST;
G_END_DECLS
#endif /* __GSD_UDEV_DEVICE_MANAGER_H__ */
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2015 Red Hat
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Author: Carlos Garnacho <carlosg@gnome.org>
*/
#include "config.h"
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
#include "gsd-input-helper.h"
#include "gsd-device-manager-x11.h"
struct _GsdX11DeviceManager
{
GsdDeviceManager parent_instance;
GdkDeviceManager *device_manager;
GHashTable *devices;
GHashTable *gdk_devices;
};
struct _GsdX11DeviceManagerClass
{
GsdDeviceManagerClass parent_class;
};
G_DEFINE_TYPE (GsdX11DeviceManager, gsd_x11_device_manager, GSD_TYPE_DEVICE_MANAGER)
static GsdDeviceType
device_get_device_type (GdkDevice *gdk_device)
{
GdkInputSource source;
source = gdk_device_get_source (gdk_device);
switch (source) {
case GDK_SOURCE_MOUSE:
return GSD_DEVICE_TYPE_MOUSE;
case GDK_SOURCE_PEN:
case GDK_SOURCE_ERASER:
case GDK_SOURCE_CURSOR:
return GSD_DEVICE_TYPE_TABLET;
case GDK_SOURCE_KEYBOARD:
return GSD_DEVICE_TYPE_KEYBOARD;
case GDK_SOURCE_TOUCHSCREEN:
return GSD_DEVICE_TYPE_TOUCHSCREEN;
case GDK_SOURCE_TOUCHPAD:
return GSD_DEVICE_TYPE_TOUCHPAD;
default:
g_warning ("Unhandled input source %d\n", source);
}
return 0;
}
static GsdDevice *
create_device (GdkDevice *gdk_device,
const gchar *device_file)
{
guint width, height;
GsdDevice *device;
gint id;
id = gdk_x11_device_get_id (gdk_device);
xdevice_get_dimensions (id, &width, &height);
device = g_object_new (GSD_TYPE_DEVICE,
"name", gdk_device_get_name (gdk_device),
"device-file", device_file,
"type", device_get_device_type (gdk_device),
"vendor-id", gdk_device_get_vendor_id (gdk_device),
"product-id", gdk_device_get_product_id (gdk_device),
"width", width,
"height", height,
NULL);
return device;
}
static void
add_device (GsdX11DeviceManager *manager,
GdkDevice *gdk_device)
{
gchar *device_file;
GsdDevice *device;
gint id;
if (gdk_device_get_device_type (gdk_device) == GDK_DEVICE_TYPE_MASTER)
return;
id = gdk_x11_device_get_id (gdk_device);
device_file = xdevice_get_device_node (id);
if (!device_file)
return;
if (!g_hash_table_lookup (manager->devices, device_file)) {
device = create_device (gdk_device, device_file);
g_hash_table_insert (manager->devices, g_strdup (device_file), device);
g_signal_emit_by_name (manager, "device-added", device);
}
/* Takes ownership of device_file */
g_hash_table_insert (manager->gdk_devices, gdk_device, device_file);
}
static void
remove_device (GsdX11DeviceManager *manager,
GdkDevice *gdk_device)
{
const gchar *device_file;
GsdDevice *device;
device_file = g_hash_table_lookup (manager->gdk_devices, gdk_device);
if (!device_file)
return;
device = g_hash_table_lookup (manager->devices, device_file);
if (device)
g_object_ref (device);
g_hash_table_remove (manager->devices, device_file);
g_hash_table_remove (manager->gdk_devices, gdk_device);
if (device) {
g_signal_emit_by_name (manager, "device-removed", device);
g_object_unref (device);
}
}
static void
init_devices (GsdX11DeviceManager *manager,
GdkDeviceType device_type)
{
GList *devices, *l;
devices = gdk_device_manager_list_devices (manager->device_manager,
device_type);
for (l = devices; l; l = l->next)
add_device (manager, l->data);
g_list_free (devices);
}
static void
gsd_x11_device_manager_init (GsdX11DeviceManager *manager)
{
GdkDisplay *display;
manager->devices = g_hash_table_new_full (g_str_hash, g_str_equal,
(GDestroyNotify) g_free,
(GDestroyNotify) g_object_unref);
manager->gdk_devices = g_hash_table_new_full (NULL, NULL, NULL,
(GDestroyNotify) g_free);
display = gdk_display_get_default ();
manager->device_manager = gdk_display_get_device_manager (display);
g_signal_connect_swapped (manager->device_manager, "device-added",
G_CALLBACK (add_device), manager);
g_signal_connect_swapped (manager->device_manager, "device-removed",
G_CALLBACK (remove_device), manager);
init_devices (manager, GDK_DEVICE_TYPE_SLAVE);
init_devices (manager, GDK_DEVICE_TYPE_FLOATING);
}
static GList *
gsd_x11_device_manager_list_devices (GsdDeviceManager *manager,
GsdDeviceType type)
{
GsdX11DeviceManager *manager_x11 = GSD_X11_DEVICE_MANAGER (manager);
GsdDeviceType device_type;
GList *devices = NULL;
GHashTableIter iter;
GsdDevice *device;
g_hash_table_iter_init (&iter, manager_x11->devices);
while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &device)) {
device_type = gsd_device_get_device_type (device);
if ((device_type & type) == type)
devices = g_list_prepend (devices, device);
}
return devices;
}
static void
gsd_x11_device_manager_class_init (GsdX11DeviceManagerClass *klass)
{
GsdDeviceManagerClass *manager_class = GSD_DEVICE_MANAGER_CLASS (klass);
manager_class->list_devices = gsd_x11_device_manager_list_devices;
}
GdkDevice **
gsd_x11_device_manager_get_gdk_devices (GsdX11DeviceManager *manager,
GsdDevice *device,
guint *n_gdk_devices)
{
const gchar *device_node;
GPtrArray *gdk_devices;
GdkDevice *gdk_device;
GHashTableIter iter;
if (n_gdk_devices)
*n_gdk_devices = 0;
g_return_val_if_fail (GSD_IS_X11_DEVICE_MANAGER (manager), NULL);
g_return_val_if_fail (GSD_IS_DEVICE (device), NULL);
gdk_devices = g_ptr_array_new ();
g_hash_table_iter_init (&iter, manager->gdk_devices);
while (g_hash_table_iter_next (&iter, (gpointer *) &gdk_device, (gpointer *) &device_node)) {
if (g_strcmp0 (gsd_device_get_device_file (device), device_node) == 0)
g_ptr_array_add (gdk_devices, gdk_device);
}
if (n_gdk_devices)
*n_gdk_devices = gdk_devices->len;
return (GdkDevice **) g_ptr_array_free (gdk_devices, FALSE);
}
GsdDevice *
gsd_x11_device_manager_lookup_gdk_device (GsdX11DeviceManager *manager,
GdkDevice *gdk_device)
{
const gchar *device_node;
g_return_val_if_fail (GSD_IS_X11_DEVICE_MANAGER (manager), NULL);
g_return_val_if_fail (GDK_IS_DEVICE (gdk_device), NULL);
device_node = g_hash_table_lookup (manager->gdk_devices, gdk_device);
if (!device_node)
return NULL;
return g_hash_table_lookup (manager->devices, device_node);
}
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2015 Red Hat
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Author: Carlos Garnacho <carlosg@gnome.org>
*/
#ifndef __GSD_X11_DEVICE_MANAGER_H__
#define __GSD_X11_DEVICE_MANAGER_H__
#include <gdk/gdk.h>
#include "gsd-device-manager.h"
G_BEGIN_DECLS
#define GSD_TYPE_X11_DEVICE_MANAGER (gsd_x11_device_manager_get_type ())
#define GSD_X11_DEVICE_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_X11_DEVICE_MANAGER, GsdX11DeviceManager))
#define GSD_X11_DEVICE_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GSD_TYPE_X11_DEVICE_MANAGER, GsdX11DeviceManagerClass))
#define GSD_IS_X11_DEVICE_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_X11_DEVICE_MANAGER))
#define GSD_IS_X11_DEVICE_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSD_TYPE_X11_DEVICE_MANAGER))
#define GSD_X11_DEVICE_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSD_TYPE_X11_DEVICE_MANAGER, GsdX11DeviceManagerClass))
typedef struct _GsdX11DeviceManager GsdX11DeviceManager;
typedef struct _GsdX11DeviceManagerClass GsdX11DeviceManagerClass;
GType gsd_x11_device_manager_get_type (void) G_GNUC_CONST;
GdkDevice ** gsd_x11_device_manager_get_gdk_devices (GsdX11DeviceManager *manager,
GsdDevice *device,
guint *n_gdk_devices);
GsdDevice * gsd_x11_device_manager_lookup_gdk_device (GsdX11DeviceManager *manager,
GdkDevice *gdk_device);
G_END_DECLS
#endif /* __GSD_X11_DEVICE_MANAGER_H__ */
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2014 Red Hat
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Author: Carlos Garnacho <carlosg@gnome.org>
*/
#include "config.h"
#include <string.h>
#include "gsd-device-manager-x11.h"
#include "gsd-device-manager-udev.h"
#include "gsd-common-enums.h"
typedef struct _GsdDevicePrivate GsdDevicePrivate;
typedef struct _GsdDeviceManagerPrivate GsdDeviceManagerPrivate;
struct _GsdDevicePrivate
{
gchar *name;
gchar *device_file;
gchar *vendor_id;
gchar *product_id;
GsdDeviceType type;
guint width;
guint height;
};
enum {
PROP_NAME = 1,