[gnome-settings-daemon] common: Add helper to create test apps for plugins
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] common: Add helper to create test apps for plugins
- Date: Thu, 26 Apr 2012 16:23:35 +0000 (UTC)
commit 82e7462a966ae70932859c36dd68e7521ec25dcc
Author: Bastien Nocera <hadess hadess net>
Date: Thu Apr 26 17:19:39 2012 +0100
common: Add helper to create test apps for plugins
plugins/common/test-plugin.h | 47 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 47 insertions(+), 0 deletions(-)
---
diff --git a/plugins/common/test-plugin.h b/plugins/common/test-plugin.h
new file mode 100644
index 0000000..be877a2
--- /dev/null
+++ b/plugins/common/test-plugin.h
@@ -0,0 +1,47 @@
+/**
+ * Create a test app for your plugin quickly.
+ *
+ * #define NEW gsd_media_keys_manager_new
+ * #define START gsd_media_keys_manager_start
+ * #define MANAGER GsdMediaKeysManager
+ * #include "gsd-media-keys-manager.h"
+ *
+ * #include "test-plugin.h"
+ */
+
+#include "config.h"
+
+#include <stdlib.h>
+
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+
+static MANAGER *manager = NULL;
+
+int
+main (int argc, char **argv)
+{
+ GError *error;
+
+ bindtextdomain (GETTEXT_PACKAGE, GNOME_SETTINGS_LOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ textdomain (GETTEXT_PACKAGE);
+
+ 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 = NEW ();
+
+ error = NULL;
+ START (manager, &error);
+
+ gtk_main ();
+
+ return 0;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]