aboutsummaryrefslogtreecommitdiff
path: root/lxpanel-plugin
diff options
context:
space:
mode:
authorCharles Lehner <cel@celehner.com>2015-11-22 17:24:15 -0500
committerJavier <dev.git@javispedro.com>2015-12-10 19:56:42 +0100
commitd72b28afcb1e1e5d630a214eb6a9217e30d90d50 (patch)
treedbbff9f13513e2767eb0d581b7a6a87f2e72f265 /lxpanel-plugin
parentf690cd97506f45e02bb6383fde2a7c8f06820408 (diff)
downloadtopmenu-gtk-d72b28afcb1e1e5d630a214eb6a9217e30d90d50.tar.gz
topmenu-gtk-d72b28afcb1e1e5d630a214eb6a9217e30d90d50.zip
Add LXPanel plugin
Diffstat (limited to 'lxpanel-plugin')
-rw-r--r--lxpanel-plugin/Makefile.am11
-rw-r--r--lxpanel-plugin/topmenu-lxpanel-plugin.c41
2 files changed, 52 insertions, 0 deletions
diff --git a/lxpanel-plugin/Makefile.am b/lxpanel-plugin/Makefile.am
new file mode 100644
index 0000000..eb44246
--- /dev/null
+++ b/lxpanel-plugin/Makefile.am
@@ -0,0 +1,11 @@
+if WANT_LXPANEL_PLUGIN
+
+plugindir = $(LXPANEL_PLUGIN_DIR)
+plugin_LTLIBRARIES = libtopmenu.la
+
+libtopmenu_la_SOURCES = topmenu-lxpanel-plugin.c
+libtopmenu_la_CPPFLAGS = $(GTK_CFLAGS) $(LXPANELPLUGIN_CFLAGS) -DG_LOG_DOMAIN=\"topmenu-xfce-panel-applet\"
+libtopmenu_la_LIBADD = $(GTK_LIBS) $(LXPANELPLUGIN_LIBS) ../libtopmenu-server/libtopmenu-server-gtk$(GTK_VERSION).la
+libtopmenu_la_LDFLAGS = -avoid-version -shared -no-undefined
+
+endif
diff --git a/lxpanel-plugin/topmenu-lxpanel-plugin.c b/lxpanel-plugin/topmenu-lxpanel-plugin.c
new file mode 100644
index 0000000..6b0f882
--- /dev/null
+++ b/lxpanel-plugin/topmenu-lxpanel-plugin.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2015 Charles E. Lehner <cel@celehner.com>
+ *
+ * This file is part of TopMenu.
+ *
+ * TopMenu 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * TopMenu 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 TopMenu. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <lxpanel/plugin.h>
+#include "../libtopmenu-server/topmenu-widget.h"
+
+static GtkWidget *topmenu_lxpanel_new_instance(LXPanel *panel, config_setting_t *settings)
+{
+ GtkWidget *menu = GTK_WIDGET(topmenu_widget_new());
+ gtk_widget_set_can_focus(menu, TRUE);
+ gtk_widget_show_all(menu);
+
+ return menu;
+}
+
+FM_DEFINE_MODULE(lxpanel_gtk, topmenu_lxpanel)
+
+LXPanelPluginInit fm_module_init_lxpanel_gtk = {
+ .name = "TopMenu",
+ .description = "Shows the topmenu menu bar",
+ .new_instance = topmenu_lxpanel_new_instance,
+ .expand_available = 1,
+ .expand_default = 1,
+ .one_per_system = 1,
+};