[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 206/473: Rename PanelPlugin class to Plugin.

noreply at xfce.org noreply at xfce.org
Mon Feb 16 23:56:16 CET 2015


This is an automated email from the git hooks/post-receive script.

gottcode pushed a commit to branch master
in repository panel-plugins/xfce4-whiskermenu-plugin.

commit 87255c398372fb99d82316fe996710804c5165f8
Author: Graeme Gott <graeme at gottcode.org>
Date:   Thu Oct 31 11:25:38 2013 -0400

    Rename PanelPlugin class to Plugin.
---
 src/CMakeLists.txt                   |    3 +-
 src/configuration_dialog.cpp         |   10 +++---
 src/configuration_dialog.hpp         |    6 ++--
 src/{panel_plugin.cpp => plugin.cpp} |   56 +++++++++++++++++-----------------
 src/{panel_plugin.hpp => plugin.hpp} |   28 ++++++++---------
 5 files changed, 52 insertions(+), 51 deletions(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6e361c9..c7455b5 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -63,6 +63,7 @@ add_library(whiskermenu MODULE
 	category.cpp
 	command_button.cpp
 	configuration_dialog.cpp
+	element.hpp
 	favorites_page.cpp
 	icon_size.cpp
 	launcher.cpp
@@ -70,7 +71,7 @@ add_library(whiskermenu MODULE
 	launcher_view.cpp
 	list_page.cpp
 	page.cpp
-	panel_plugin.cpp
+	plugin.cpp
 	query.cpp
 	recent_page.cpp
 	register_plugin.c
diff --git a/src/configuration_dialog.cpp b/src/configuration_dialog.cpp
index 229e7d0..563aea3 100644
--- a/src/configuration_dialog.cpp
+++ b/src/configuration_dialog.cpp
@@ -21,7 +21,7 @@
 #include "icon_size.hpp"
 #include "launcher.hpp"
 #include "launcher_view.hpp"
-#include "panel_plugin.hpp"
+#include "plugin.hpp"
 #include "section_button.hpp"
 #include "window.hpp"
 
@@ -44,7 +44,7 @@ static void whiskermenu_config_dialog_delete(ConfigurationDialog* dialog)
 
 //-----------------------------------------------------------------------------
 
-ConfigurationDialog::ConfigurationDialog(PanelPlugin* plugin) :
+ConfigurationDialog::ConfigurationDialog(Plugin* plugin) :
 	m_plugin(plugin)
 {
 	// Create dialog window
@@ -134,7 +134,7 @@ void ConfigurationDialog::item_icon_size_changed(GtkComboBox* combo)
 
 void ConfigurationDialog::style_changed(GtkComboBox* combo)
 {
-	m_plugin->set_button_style(PanelPlugin::ButtonStyle(gtk_combo_box_get_active(combo) + 1));
+	m_plugin->set_button_style(Plugin::ButtonStyle(gtk_combo_box_get_active(combo) + 1));
 }
 
 //-----------------------------------------------------------------------------
@@ -237,9 +237,9 @@ void ConfigurationDialog::logout_command_changed()
 
 void ConfigurationDialog::response(int response_id)
 {
-	if ((m_plugin->get_button_style() == PanelPlugin::ShowText) && m_plugin->get_button_title().empty())
+	if ((m_plugin->get_button_style() == Plugin::ShowText) && m_plugin->get_button_title().empty())
 	{
-		m_plugin->set_button_title(PanelPlugin::get_button_title_default());
+		m_plugin->set_button_title(Plugin::get_button_title_default());
 	}
 
 	if (response_id == GTK_RESPONSE_CLOSE)
diff --git a/src/configuration_dialog.hpp b/src/configuration_dialog.hpp
index 888e163..088fe0a 100644
--- a/src/configuration_dialog.hpp
+++ b/src/configuration_dialog.hpp
@@ -25,12 +25,12 @@ extern "C"
 namespace WhiskerMenu
 {
 
-class PanelPlugin;
+class Plugin;
 
 class ConfigurationDialog
 {
 public:
-	explicit ConfigurationDialog(PanelPlugin* plugin);
+	explicit ConfigurationDialog(Plugin* plugin);
 	~ConfigurationDialog();
 
 	GtkWidget* get_widget() const
@@ -66,7 +66,7 @@ private:
 	GtkWidget* init_commands_tab();
 
 private:
-	PanelPlugin* m_plugin;
+	Plugin* m_plugin;
 	GtkWidget* m_window;
 
 	GtkWidget* m_show_names;
diff --git a/src/panel_plugin.cpp b/src/plugin.cpp
similarity index 87%
rename from src/panel_plugin.cpp
rename to src/plugin.cpp
index c3a5ccc..66430a4 100644
--- a/src/panel_plugin.cpp
+++ b/src/plugin.cpp
@@ -14,7 +14,7 @@
 // along with this library.  If not, see <http://www.gnu.org/licenses/>.
 
 
-#include "panel_plugin.hpp"
+#include "plugin.hpp"
 
 #include "applications_page.hpp"
 #include "configuration_dialog.hpp"
@@ -32,10 +32,10 @@ using namespace WhiskerMenu;
 extern "C" void whiskermenu_construct(XfcePanelPlugin* plugin)
 {
 	xfce_textdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
-	new PanelPlugin(plugin);
+	new Plugin(plugin);
 }
 
-static void whiskermenu_free(XfcePanelPlugin*, PanelPlugin* whiskermenu)
+static void whiskermenu_free(XfcePanelPlugin*, Plugin* whiskermenu)
 {
 	delete whiskermenu;
 	whiskermenu = NULL;
@@ -43,7 +43,7 @@ static void whiskermenu_free(XfcePanelPlugin*, PanelPlugin* whiskermenu)
 
 //-----------------------------------------------------------------------------
 
-PanelPlugin::PanelPlugin(XfcePanelPlugin* plugin) :
+Plugin::Plugin(XfcePanelPlugin* plugin) :
 	m_plugin(plugin),
 	m_window(NULL),
 	m_button_title(get_button_title_default()),
@@ -84,7 +84,7 @@ PanelPlugin::PanelPlugin(XfcePanelPlugin* plugin) :
 	{
 		m_window = new Window(NULL);
 	}
-	g_signal_connect(m_window->get_widget(), "unmap", G_CALLBACK(PanelPlugin::menu_hidden_slot), this);
+	g_signal_connect(m_window->get_widget(), "unmap", G_CALLBACK(Plugin::menu_hidden_slot), this);
 
 	// Prevent empty panel button
 	if (!m_button_icon_visible)
@@ -102,7 +102,7 @@ PanelPlugin::PanelPlugin(XfcePanelPlugin* plugin) :
 	// Create toggle button
 	m_button = xfce_create_panel_toggle_button();
 	gtk_button_set_relief(GTK_BUTTON(m_button), GTK_RELIEF_NONE);
-	g_signal_connect(m_button, "button-press-event", G_CALLBACK(PanelPlugin::button_clicked_slot), this);
+	g_signal_connect(m_button, "button-press-event", G_CALLBACK(Plugin::button_clicked_slot), this);
 	gtk_widget_show(m_button);
 
 	m_button_box = GTK_BOX(gtk_hbox_new(false, 1));
@@ -130,21 +130,21 @@ PanelPlugin::PanelPlugin(XfcePanelPlugin* plugin) :
 
 	// Connect plugin signals to functions
 	g_signal_connect(plugin, "free-data", G_CALLBACK(whiskermenu_free), this);
-	g_signal_connect(plugin, "configure-plugin", G_CALLBACK(PanelPlugin::configure_slot), this);
+	g_signal_connect(plugin, "configure-plugin", G_CALLBACK(Plugin::configure_slot), this);
 #if (LIBXFCE4PANEL_CHECK_VERSION(4,10,0))
-	g_signal_connect(plugin, "mode-changed", G_CALLBACK(PanelPlugin::mode_changed_slot), this);
+	g_signal_connect(plugin, "mode-changed", G_CALLBACK(Plugin::mode_changed_slot), this);
 #else
-	g_signal_connect(plugin, "orientation-changed", G_CALLBACK(PanelPlugin::orientation_changed_slot), this);
+	g_signal_connect(plugin, "orientation-changed", G_CALLBACK(Plugin::orientation_changed_slot), this);
 #endif
-	g_signal_connect(plugin, "remote-event", G_CALLBACK(PanelPlugin::remote_event_slot), this);
-	g_signal_connect_swapped(plugin, "save", G_CALLBACK(PanelPlugin::save_slot), this);
-	g_signal_connect(plugin, "size-changed", G_CALLBACK(PanelPlugin::size_changed_slot), this);
+	g_signal_connect(plugin, "remote-event", G_CALLBACK(Plugin::remote_event_slot), this);
+	g_signal_connect_swapped(plugin, "save", G_CALLBACK(Plugin::save_slot), this);
+	g_signal_connect(plugin, "size-changed", G_CALLBACK(Plugin::size_changed_slot), this);
 	xfce_panel_plugin_menu_show_configure(plugin);
 }
 
 //-----------------------------------------------------------------------------
 
-PanelPlugin::~PanelPlugin()
+Plugin::~Plugin()
 {
 	save();
 
@@ -156,14 +156,14 @@ PanelPlugin::~PanelPlugin()
 
 //-----------------------------------------------------------------------------
 
-std::string PanelPlugin::get_button_title_default()
+std::string Plugin::get_button_title_default()
 {
 	return _("Applications Menu");
 }
 
 //-----------------------------------------------------------------------------
 
-void PanelPlugin::reload()
+void Plugin::reload()
 {
 	m_window->hide();
 	m_window->get_applications()->invalidate_applications();
@@ -171,7 +171,7 @@ void PanelPlugin::reload()
 
 //-----------------------------------------------------------------------------
 
-void PanelPlugin::set_button_style(ButtonStyle style)
+void Plugin::set_button_style(ButtonStyle style)
 {
 	m_button_icon_visible = style & ShowIcon;
 	if (m_button_icon_visible)
@@ -198,7 +198,7 @@ void PanelPlugin::set_button_style(ButtonStyle style)
 
 //-----------------------------------------------------------------------------
 
-void PanelPlugin::set_button_title(const std::string& title)
+void Plugin::set_button_title(const std::string& title)
 {
 	m_button_title = title;
 	gtk_label_set_markup(m_button_label, m_button_title.c_str());
@@ -207,7 +207,7 @@ void PanelPlugin::set_button_title(const std::string& title)
 
 //-----------------------------------------------------------------------------
 
-void PanelPlugin::set_button_icon_name(const std::string& icon)
+void Plugin::set_button_icon_name(const std::string& icon)
 {
 	m_button_icon_name = icon;
 	xfce_panel_image_set_from_source(m_button_icon, icon.c_str());
@@ -216,7 +216,7 @@ void PanelPlugin::set_button_icon_name(const std::string& icon)
 
 //-----------------------------------------------------------------------------
 
-void PanelPlugin::set_configure_enabled(bool enabled)
+void Plugin::set_configure_enabled(bool enabled)
 {
 	if (enabled)
 	{
@@ -230,7 +230,7 @@ void PanelPlugin::set_configure_enabled(bool enabled)
 
 //-----------------------------------------------------------------------------
 
-bool PanelPlugin::button_clicked(GdkEventButton* event)
+bool Plugin::button_clicked(GdkEventButton* event)
 {
 	if (event->button != 1 || event->state & GDK_CONTROL_MASK)
 	{
@@ -251,7 +251,7 @@ bool PanelPlugin::button_clicked(GdkEventButton* event)
 
 //-----------------------------------------------------------------------------
 
-void PanelPlugin::menu_hidden()
+void Plugin::menu_hidden()
 {
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(m_button), false);
 	xfce_panel_plugin_block_autohide(m_plugin, false);
@@ -263,15 +263,15 @@ void PanelPlugin::menu_hidden()
 
 //-----------------------------------------------------------------------------
 
-void PanelPlugin::configure()
+void Plugin::configure()
 {
 	ConfigurationDialog* dialog = new ConfigurationDialog(this);
-	g_signal_connect_swapped(dialog->get_widget(), "destroy", G_CALLBACK(PanelPlugin::save_slot), this);
+	g_signal_connect_swapped(dialog->get_widget(), "destroy", G_CALLBACK(Plugin::save_slot), this);
 }
 
 //-----------------------------------------------------------------------------
 
-void PanelPlugin::orientation_changed(bool vertical)
+void Plugin::orientation_changed(bool vertical)
 {
 	gtk_label_set_angle(m_button_label, vertical ? 270: 0);
 
@@ -280,7 +280,7 @@ void PanelPlugin::orientation_changed(bool vertical)
 
 //-----------------------------------------------------------------------------
 
-bool PanelPlugin::remote_event(gchar* name, GValue* value)
+bool Plugin::remote_event(gchar* name, GValue* value)
 {
 	if (strcmp(name, "popup"))
 	{
@@ -301,7 +301,7 @@ bool PanelPlugin::remote_event(gchar* name, GValue* value)
 
 //-----------------------------------------------------------------------------
 
-void PanelPlugin::save()
+void Plugin::save()
 {
 	gchar* file = xfce_panel_plugin_save_location(m_plugin, true);
 	if (!file)
@@ -335,7 +335,7 @@ void PanelPlugin::save()
 
 //-----------------------------------------------------------------------------
 
-bool PanelPlugin::size_changed(int size)
+bool Plugin::size_changed(int size)
 {
 #if (LIBXFCE4PANEL_CHECK_VERSION(4,10,0))
 	gint row_size = size / xfce_panel_plugin_get_nrows(m_plugin);
@@ -391,7 +391,7 @@ bool PanelPlugin::size_changed(int size)
 
 //-----------------------------------------------------------------------------
 
-void PanelPlugin::popup_menu(bool at_cursor)
+void Plugin::popup_menu(bool at_cursor)
 {
 	if (!at_cursor)
 	{
diff --git a/src/panel_plugin.hpp b/src/plugin.hpp
similarity index 85%
rename from src/panel_plugin.hpp
rename to src/plugin.hpp
index 88b71d9..9b2f283 100644
--- a/src/panel_plugin.hpp
+++ b/src/plugin.hpp
@@ -14,8 +14,8 @@
 // along with this library.  If not, see <http://www.gnu.org/licenses/>.
 
 
-#ifndef WHISKERMENU_PANEL_PLUGIN_HPP
-#define WHISKERMENU_PANEL_PLUGIN_HPP
+#ifndef WHISKERMENU_PLUGIN_HPP
+#define WHISKERMENU_PLUGIN_HPP
 
 #include <string>
 
@@ -30,11 +30,11 @@ namespace WhiskerMenu
 
 class Window;
 
-class PanelPlugin
+class Plugin
 {
 public:
-	explicit PanelPlugin(XfcePanelPlugin* plugin);
-	~PanelPlugin();
+	explicit Plugin(XfcePanelPlugin* plugin);
+	~Plugin();
 
 	GtkWidget* get_button() const
 	{
@@ -102,43 +102,43 @@ private:
 
 
 private:
-	static gboolean button_clicked_slot(GtkWidget*, GdkEventButton* event, PanelPlugin* obj)
+	static gboolean button_clicked_slot(GtkWidget*, GdkEventButton* event, Plugin* obj)
 	{
 		return obj->button_clicked(event);
 	}
 
-	static void menu_hidden_slot(GtkWidget*, PanelPlugin* obj)
+	static void menu_hidden_slot(GtkWidget*, Plugin* obj)
 	{
 		obj->menu_hidden();
 	}
 
-	static void configure_slot(XfcePanelPlugin*, PanelPlugin* obj)
+	static void configure_slot(XfcePanelPlugin*, Plugin* obj)
 	{
 		obj->configure();
 	}
 
-	static gboolean remote_event_slot(XfcePanelPlugin*, gchar* name, GValue* value, PanelPlugin* obj)
+	static gboolean remote_event_slot(XfcePanelPlugin*, gchar* name, GValue* value, Plugin* obj)
 	{
 		return obj->remote_event(name, value);
 	}
 
-	static void save_slot(PanelPlugin* obj)
+	static void save_slot(Plugin* obj)
 	{
 		obj->save();
 	}
 
-	static gboolean size_changed_slot(XfcePanelPlugin*, gint size, PanelPlugin* obj)
+	static gboolean size_changed_slot(XfcePanelPlugin*, gint size, Plugin* obj)
 	{
 		return obj->size_changed(size);
 	}
 
 #if (LIBXFCE4PANEL_CHECK_VERSION(4,10,0))
-	static void mode_changed_slot(XfcePanelPlugin*, XfcePanelPluginMode mode, PanelPlugin* obj)
+	static void mode_changed_slot(XfcePanelPlugin*, XfcePanelPluginMode mode, Plugin* obj)
 	{
 		obj->orientation_changed(mode == XFCE_PANEL_PLUGIN_MODE_VERTICAL);
 	}
 #else
-	static void orientation_changed_slot(XfcePanelPlugin*, GtkOrientation orientation, PanelPlugin* obj)
+	static void orientation_changed_slot(XfcePanelPlugin*, GtkOrientation orientation, Plugin* obj)
 	{
 		obj->orientation_changed(orientation == GTK_ORIENTATION_VERTICAL);
 	}
@@ -147,4 +147,4 @@ private:
 
 }
 
-#endif // WHISKERMENU_PANEL_PLUGIN_HPP
+#endif // WHISKERMENU_PLUGIN_HPP

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list