Move gplugin-gtk-viewer to it's own directory
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin-gtk-viewer/data/gplugin-gtk-viewer.gresource.xml Mon Oct 01 21:11:06 2018 -0500
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?> + <gresource prefix="/org/bitbucket/gplugin/gplugin/viewer/"> + <file compressed="true">window.ui</file> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin-gtk-viewer/data/window.ui Mon Oct 01 21:11:06 2018 -0500
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.22.1 --> + <requires lib="gtk+" version="3.20"/> + <requires lib="gplugin-gtk" version="0.28"/> + <template class="viewer" parent="GtkWindow"> + <property name="can_focus">False</property> + <property name="border_width">12</property> + <property name="title" translatable="yes">GPlugin Viewer</property> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="spacing">12</property> + <object class="GtkScrolledWindow"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">never</property> + <property name="shadow_type">in</property> + <object class="GPluginGtkView" id="view"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="headers_visible">False</property> + <property name="headers_clickable">False</property> + <child internal-child="selection"> + <object class="GtkTreeSelection"/> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + <object class="GPluginGtkPluginInfo" id="info"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">__glade_unnamed_5</property> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin-gtk-viewer/gplugin-gtk-viewer.c Mon Oct 01 21:11:06 2018 -0500
@@ -0,0 +1,215 @@
+ * Copyright (C) 2011-2014 Gary Kramlich <grim@reaperworld.com> + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * This library 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 + * Lesser General Public License for more details. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <http://www.gnu.org/licenses/>. +#include <gplugin/gplugin.h> +#include <gplugin-gtk/gplugin-gtk.h> +/****************************************************************************** + *****************************************************************************/ +static gboolean show_internal = FALSE; +static gboolean add_default_paths = TRUE, version_only = FALSE; +static gchar **paths = NULL; +/****************************************************************************** + *****************************************************************************/ +window_closed_cb(GPLUGIN_UNUSED GtkWidget *w, + GPLUGIN_UNUSED GdkEvent *e, + GPLUGIN_UNUSED gpointer d) +selection_changed_cb(GtkTreeSelection *sel, gpointer data) { + GPluginGtkPluginInfo *info = GPLUGIN_GTK_PLUGIN_INFO(data); + GPluginPlugin *plugin = NULL; + GtkTreeModel *model = NULL; + if(gtk_tree_selection_get_selected(sel, &model, &iter)) { + gtk_tree_model_get(model, &iter, + GPLUGIN_GTK_STORE_PLUGIN_COLUMN, &plugin, + gplugin_gtk_plugin_info_set_plugin(info, plugin); +/****************************************************************************** + *****************************************************************************/ +internal_cb(GPLUGIN_UNUSED const gchar *n, + GPLUGIN_UNUSED const gchar *v, + GPLUGIN_UNUSED gpointer d, + GPLUGIN_UNUSED GError **e) +no_default_cb(GPLUGIN_UNUSED const gchar *n, + GPLUGIN_UNUSED const gchar *v, + GPLUGIN_UNUSED gpointer d, + GPLUGIN_UNUSED GError **e) + add_default_paths = FALSE; +version_cb(GPLUGIN_UNUSED const gchar *n, + GPLUGIN_UNUSED const gchar *v, + GPLUGIN_UNUSED gpointer d, + GPLUGIN_UNUSED GError **e) + printf("gplugin-gtk-viewer %s\n", GPLUGIN_VERSION); + GtkWidget *window = NULL, *grid = NULL, *sw = NULL; + GtkWidget *view = NULL, *info = NULL; + GtkTreeSelection *sel = NULL; + window = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_window_set_title(GTK_WINDOW(window), "GPlugin Viewer"); + gtk_container_set_border_width(GTK_CONTAINER(window), 12); + g_signal_connect(G_OBJECT(window), "delete-event", + G_CALLBACK(window_closed_cb), NULL); + gtk_grid_set_row_homogeneous(GTK_GRID(grid), TRUE); + gtk_grid_set_column_spacing(GTK_GRID(grid), 12); + gtk_container_add(GTK_CONTAINER(window), grid); + sw = gtk_scrolled_window_new(NULL, NULL); + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), + GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), + gtk_grid_attach(GTK_GRID(grid), sw, 0, 0, 1, 1); + view = gplugin_gtk_view_new(); + gplugin_gtk_view_set_show_internal(GPLUGIN_GTK_VIEW(view), show_internal); + gtk_container_add(GTK_CONTAINER(sw), view); + info = gplugin_gtk_plugin_info_new(); + gtk_grid_attach(GTK_GRID(grid), info, 1, 0, 1, 1); + sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(view)); + g_signal_connect(G_OBJECT(sel), "changed", + G_CALLBACK(selection_changed_cb), info); +/****************************************************************************** + *****************************************************************************/ +static GOptionEntry entries[] = { + "internal", 'i', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, + internal_cb, "Show internal plugins", + "no-default-paths", 'D', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, + no_default_cb, "Do not search the default plugin paths", + "path", 'p', 0, G_OPTION_ARG_STRING_ARRAY, + &paths, "Additional paths to look for plugins", + "version", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, + version_cb, "Display the version and exit", + NULL, 0, 0, 0, NULL, NULL, NULL, +main(gint argc, gchar **argv) { + GOptionContext *ctx = NULL; + GtkWidget *window = NULL; + ctx = g_option_context_new(""); + g_option_context_add_main_entries(ctx, entries, NULL); + g_option_context_add_group(ctx, gtk_get_option_group(TRUE)); + g_option_context_parse(ctx, &argc, &argv, &error); + g_option_context_free(ctx); + fprintf(stderr, "%s\n", error->message); + gtk_init(&argc, &argv); + gplugin_manager_add_default_paths(); + for(i = 0; paths[i]; i++) + gplugin_manager_prepend_path(paths[i]); + gplugin_manager_refresh(); + /* now create and show the window */ + window = create_window(); + gtk_widget_show_all(window); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin-gtk-viewer/meson.build Mon Oct 01 21:11:06 2018 -0500
@@ -0,0 +1,27 @@
+gplugin_gtk_viewer_resources = gnome.compile_resources( + 'gplugin-gtk-viewer-resources', + 'data/gplugin-gtk-viewer.gresource.xml', + c_name: 'gplugin_gtk_viewer', +gplugin_gtk_viewer = executable('gplugin-gtk-viewer', + 'gplugin-gtk-viewer.c', + dependencies : [gplugin_dep, gplugin_gtk_dep], +if get_option('help2man') + gplugin_gtk_viewer_man = custom_target('gplugin-gtk-viewer.1', + '--name=View installed plugins', '--section=1', + '--help-option=--help-all', '--no-info', + '--output', '@OUTPUT@', + output : 'gplugin-gtk-viewer.1', + install_dir : join_paths(get_option('mandir'), 'man1')) --- a/gplugin-gtk/gplugin-gtk-viewer.c Mon Oct 01 00:35:22 2018 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,215 +0,0 @@
- * Copyright (C) 2011-2014 Gary Kramlich <grim@reaperworld.com>
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- * This library 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
- * Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, see <http://www.gnu.org/licenses/>.
-#include <gplugin/gplugin.h>
-#include <gplugin-gtk/gplugin-gtk.h>
-/******************************************************************************
- *****************************************************************************/
-static gboolean show_internal = FALSE;
-static gboolean add_default_paths = TRUE, version_only = FALSE;
-static gchar **paths = NULL;
-/******************************************************************************
- *****************************************************************************/
-window_closed_cb(GPLUGIN_UNUSED GtkWidget *w,
- GPLUGIN_UNUSED GdkEvent *e,
- GPLUGIN_UNUSED gpointer d)
-selection_changed_cb(GtkTreeSelection *sel, gpointer data) {
- GPluginGtkPluginInfo *info = GPLUGIN_GTK_PLUGIN_INFO(data);
- GPluginPlugin *plugin = NULL;
- GtkTreeModel *model = NULL;
- if(gtk_tree_selection_get_selected(sel, &model, &iter)) {
- gtk_tree_model_get(model, &iter,
- GPLUGIN_GTK_STORE_PLUGIN_COLUMN, &plugin,
- gplugin_gtk_plugin_info_set_plugin(info, plugin);
-/******************************************************************************
- *****************************************************************************/
-internal_cb(GPLUGIN_UNUSED const gchar *n,
- GPLUGIN_UNUSED const gchar *v,
- GPLUGIN_UNUSED gpointer d,
- GPLUGIN_UNUSED GError **e)
-no_default_cb(GPLUGIN_UNUSED const gchar *n,
- GPLUGIN_UNUSED const gchar *v,
- GPLUGIN_UNUSED gpointer d,
- GPLUGIN_UNUSED GError **e)
- add_default_paths = FALSE;
-version_cb(GPLUGIN_UNUSED const gchar *n,
- GPLUGIN_UNUSED const gchar *v,
- GPLUGIN_UNUSED gpointer d,
- GPLUGIN_UNUSED GError **e)
- printf("gplugin-gtk-viewer %s\n", GPLUGIN_VERSION);
- GtkWidget *window = NULL, *grid = NULL, *sw = NULL;
- GtkWidget *view = NULL, *info = NULL;
- GtkTreeSelection *sel = NULL;
- window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- gtk_window_set_title(GTK_WINDOW(window), "GPlugin Viewer");
- gtk_container_set_border_width(GTK_CONTAINER(window), 12);
- g_signal_connect(G_OBJECT(window), "delete-event",
- G_CALLBACK(window_closed_cb), NULL);
- gtk_grid_set_row_homogeneous(GTK_GRID(grid), TRUE);
- gtk_grid_set_column_spacing(GTK_GRID(grid), 12);
- gtk_container_add(GTK_CONTAINER(window), grid);
- sw = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
- GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
- gtk_grid_attach(GTK_GRID(grid), sw, 0, 0, 1, 1);
- view = gplugin_gtk_view_new();
- gplugin_gtk_view_set_show_internal(GPLUGIN_GTK_VIEW(view), show_internal);
- gtk_container_add(GTK_CONTAINER(sw), view);
- info = gplugin_gtk_plugin_info_new();
- gtk_grid_attach(GTK_GRID(grid), info, 1, 0, 1, 1);
- sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
- g_signal_connect(G_OBJECT(sel), "changed",
- G_CALLBACK(selection_changed_cb), info);
-/******************************************************************************
- *****************************************************************************/
-static GOptionEntry entries[] = {
- "internal", 'i', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
- internal_cb, "Show internal plugins",
- "no-default-paths", 'D', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
- no_default_cb, "Do not search the default plugin paths",
- "path", 'p', 0, G_OPTION_ARG_STRING_ARRAY,
- &paths, "Additional paths to look for plugins",
- "version", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
- version_cb, "Display the version and exit",
- NULL, 0, 0, 0, NULL, NULL, NULL,
-main(gint argc, gchar **argv) {
- GOptionContext *ctx = NULL;
- GtkWidget *window = NULL;
- ctx = g_option_context_new("");
- g_option_context_add_main_entries(ctx, entries, NULL);
- g_option_context_add_group(ctx, gtk_get_option_group(TRUE));
- g_option_context_parse(ctx, &argc, &argv, &error);
- g_option_context_free(ctx);
- fprintf(stderr, "%s\n", error->message);
- gtk_init(&argc, &argv);
- gplugin_manager_add_default_paths();
- for(i = 0; paths[i]; i++)
- gplugin_manager_prepend_path(paths[i]);
- gplugin_manager_refresh();
- /* now create and show the window */
- window = create_window();
- gtk_widget_show_all(window);
--- a/gplugin-gtk/meson.build Mon Oct 01 00:35:22 2018 -0500
+++ b/gplugin-gtk/meson.build Mon Oct 01 21:11:06 2018 -0500
@@ -101,27 +101,6 @@
###############################################################################
-###############################################################################
-gplugin_gtk_viewer = executable('gplugin-gtk-viewer',
- 'gplugin-gtk-viewer.c',
- dependencies : [gplugin_dep, gplugin_gtk_dep],
-if get_option('help2man')
- gplugin_gtk_viewer_man = custom_target('gplugin-gtk-viewer.1',
- '--name=View installed plugins', '--section=1',
- '--help-option=--help-all', '--no-info',
- '--output', '@OUTPUT@',
- output : 'gplugin-gtk-viewer.1',
- install_dir : join_paths(get_option('mandir'), 'man1'))
-###############################################################################
###############################################################################
if get_option('gobject-introspection')
--- a/meson.build Mon Oct 01 00:35:22 2018 -0500
+++ b/meson.build Mon Oct 01 21:11:06 2018 -0500
@@ -112,6 +112,7 @@
###############################################################################
+subdir('gplugin-gtk-viewer')