[gnome-settings-daemon] wacom: Add test application to list tablets
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] wacom: Add test application to list tablets
- Date: Fri, 18 Nov 2011 18:30:56 +0000 (UTC)
commit bc1442b4093d97e145a2e94d9c12758622ebf721
Author: Bastien Nocera <hadess hadess net>
Date: Fri Nov 18 18:25:07 2011 +0000
wacom: Add test application to list tablets
And their associated properties.
plugins/wacom/Makefile.am | 30 +++++++++++++++++++++-
plugins/wacom/list-wacom.c | 59 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 88 insertions(+), 1 deletions(-)
---
diff --git a/plugins/wacom/Makefile.am b/plugins/wacom/Makefile.am
index 5e649c3..28f5382 100644
--- a/plugins/wacom/Makefile.am
+++ b/plugins/wacom/Makefile.am
@@ -31,7 +31,7 @@ libwacom_la_LIBADD = \
$(SETTINGS_PLUGIN_LIBS) \
$(XINPUT_LIBS)
-noinst_PROGRAMS = test-wacom
+noinst_PROGRAMS = test-wacom list-wacom
test_wacom_SOURCES = \
test-wacom.c \
@@ -61,6 +61,34 @@ test_wacom_LDADD = \
$(SETTINGS_PLUGIN_LIBS) \
-lm
+list_wacom_SOURCES = \
+ list-wacom.c \
+ gsd-wacom-manager.c \
+ gsd-wacom-manager.h \
+ gsd-wacom-device.c \
+ gsd-wacom-device.h
+
+list_wacom_CPPFLAGS = \
+ -I$(top_srcdir)/data/ \
+ -I$(top_srcdir)/gnome-settings-daemon \
+ -I$(top_srcdir)/plugins/common \
+ -DBINDIR=\"$(bindir)\" \
+ -DPIXMAPDIR=\""$(pkgdatadir)"\" \
+ -DGTKBUILDERDIR=\""$(pkgdatadir)"\" \
+ -DGNOME_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\" \
+ $(AM_CPPFLAGS)
+
+list_wacom_CFLAGS = \
+ $(SETTINGS_PLUGIN_CFLAGS) \
+ $(AM_CFLAGS)
+
+list_wacom_LDADD = \
+ $(top_builddir)/gnome-settings-daemon/libgsd-profile.la \
+ $(top_builddir)/plugins/common/libcommon.la \
+ $(SETTINGS_DAEMON_LIBS) \
+ $(SETTINGS_PLUGIN_LIBS) \
+ -lm
+
plugin_in_files = wacom.gnome-settings-plugin.in
plugin_DATA = $(plugin_in_files:.gnome-settings-plugin.in=.gnome-settings-plugin)
diff --git a/plugins/wacom/list-wacom.c b/plugins/wacom/list-wacom.c
new file mode 100644
index 0000000..227fe2c
--- /dev/null
+++ b/plugins/wacom/list-wacom.c
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2011 Red Hat, Inc.
+ *
+ * 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: Bastien Nocera <hadess hadess net>
+ *
+ */
+
+#include "config.h"
+
+#include <gtk/gtk.h>
+
+#include "gsd-wacom-device.h"
+
+int main (int argc, char **argv)
+{
+ GdkDeviceManager *mgr;
+ GList *list, *l;
+
+ gtk_init (&argc, &argv);
+
+ mgr = gdk_display_get_device_manager (gdk_display_get_default ());
+
+ list = gdk_device_manager_list_devices (mgr, GDK_DEVICE_TYPE_SLAVE);
+ for (l = list; l ; l = l->next) {
+ GsdWacomDevice *device;
+
+ device = gsd_wacom_device_new (l->data);
+ g_message ("Device '%s'", gsd_wacom_device_get_name (device));
+ /* FIXME print properties */
+ if (gsd_wacom_device_get_device_type (device) == WACOM_TYPE_STYLUS) {
+ GList *styli, *j;
+
+ styli = gsd_wacom_device_list_styli (device);
+ for (j = styli; j; j = j->next) {
+ g_message ("\tStylus '%s'", gsd_wacom_stylus_get_name (j->data));
+ /* FIXME print properties */
+ }
+ g_list_free (styli);
+ }
+ g_object_unref (device);
+ }
+ g_list_free (list);
+
+ return 0;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]