From d72b28afcb1e1e5d630a214eb6a9217e30d90d50 Mon Sep 17 00:00:00 2001 From: Charles Lehner Date: Sun, 22 Nov 2015 17:24:15 -0500 Subject: Add LXPanel plugin --- lxpanel-plugin/Makefile.am | 11 +++++++++ lxpanel-plugin/topmenu-lxpanel-plugin.c | 41 +++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 lxpanel-plugin/Makefile.am create mode 100644 lxpanel-plugin/topmenu-lxpanel-plugin.c (limited to 'lxpanel-plugin') 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 + * + * 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 . + */ + +#include +#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, +}; -- cgit v1.2.3