[gnome-settings-daemon] wacom: Add stand-alone test program
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] wacom: Add stand-alone test program
- Date: Fri, 18 Nov 2011 18:29:45 +0000 (UTC)
commit 9de93807b1fdca7512fdbf2be15c93e19a3ad802
Author: Bastien Nocera <hadess hadess net>
Date: Thu Nov 17 14:50:13 2011 +0000
wacom: Add stand-alone test program
plugins/wacom/Makefile.am | 28 +++++++++++++++++++
plugins/wacom/test-wacom.c | 65 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 93 insertions(+), 0 deletions(-)
---
diff --git a/plugins/wacom/Makefile.am b/plugins/wacom/Makefile.am
index 2880b70..1ee66e7 100644
--- a/plugins/wacom/Makefile.am
+++ b/plugins/wacom/Makefile.am
@@ -29,6 +29,34 @@ libwacom_la_LIBADD = \
$(SETTINGS_PLUGIN_LIBS) \
$(XINPUT_LIBS)
+noinst_PROGRAMS = test-wacom
+
+test_wacom_SOURCES = \
+ test-wacom.c \
+ gsd-wacom-manager.c \
+ gsd-wacom-manager.h
+
+test_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)
+
+test_wacom_CFLAGS = \
+ $(SETTINGS_PLUGIN_CFLAGS) \
+ $(AM_CFLAGS)
+
+test_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/test-wacom.c b/plugins/wacom/test-wacom.c
new file mode 100644
index 0000000..2859615
--- /dev/null
+++ b/plugins/wacom/test-wacom.c
@@ -0,0 +1,65 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2007 William Jon McCann <mccann jhu edu>
+ *
+ * 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.
+ *
+ *
+ */
+
+#include "config.h"
+
+#include <stdlib.h>
+
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+
+#include "gsd-wacom-manager.h"
+
+static GsdWacomManager *manager = NULL;
+
+int
+main (int argc,
+ char **argv)
+{
+ GError *error;
+
+#ifdef ENABLE_NLS
+ bindtextdomain (GETTEXT_PACKAGE, GNOME_SETTINGS_LOCALEDIR);
+# ifdef HAVE_BIND_TEXTDOMAIN_CODESET
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+# endif
+ textdomain (GETTEXT_PACKAGE);
+#endif
+
+ g_setenv ("G_MESSAGES_DEBUG", "all", TRUE);
+
+ error = NULL;
+ if (! gtk_init_with_args (&argc, &argv, NULL, NULL, NULL, &error)) {
+ fprintf (stderr, "%s", error->message);
+ g_error_free (error);
+ exit (1);
+ }
+
+ manager = gsd_wacom_manager_new ();
+
+ error = NULL;
+ gsd_wacom_manager_start (manager, &error);
+
+ gtk_main ();
+
+ return 0;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]