[Xfce4-commits] [panel-plugins/xfce4-hardware-monitor-plugin] 11/18: Rename applet to plugin now that its no longer a GNOME applet
noreply at xfce.org
noreply at xfce.org
Tue Jun 28 21:33:33 CEST 2016
This is an automated email from the git hooks/post-receive script.
omegaphil pushed a commit to branch omegaphil/graph-disk-io
in repository panel-plugins/xfce4-hardware-monitor-plugin.
commit f36a2971d7425796a1e45aec973a2ec627478ef0
Author: OmegaPhil <OmegaPhil at startmail.com>
Date: Thu Jun 23 21:21:48 2016 +0100
Rename applet to plugin now that its no longer a GNOME applet
---
README | 6 +-
debian/control | 4 +-
debian/copyright | 2 +-
module.xml | 2 +-
po/POTFILES.in | 2 +-
src/Makefile.am | 2 +-
src/applet.cpp | 848 ------------------------------------------
src/applet.hpp | 143 -------
src/bar-view.cpp | 16 +-
src/canvas-view.cpp | 24 +-
src/choose-monitor-window.cpp | 14 +-
src/choose-monitor-window.hpp | 8 +-
src/column-view.cpp | 16 +-
src/curve-view.cpp | 40 +-
src/flame-view.cpp | 16 +-
src/monitor-impls.cpp | 16 +-
src/monitor-impls.hpp | 12 +-
src/monitor.hpp | 2 +-
src/preferences-window.cpp | 96 ++---
src/preferences-window.hpp | 6 +-
src/register_plugin.c | 8 +-
src/text-view.cpp | 6 +-
src/value-history.cpp | 4 +-
src/view.cpp | 4 +-
src/view.hpp | 8 +-
25 files changed, 157 insertions(+), 1148 deletions(-)
diff --git a/README b/README
index 7658c17..8a2cfd8 100644
--- a/README
+++ b/README
@@ -4,7 +4,7 @@
Hardware Monitor
----------------
-Hardware Monitor is a monitor applet for the XFCE4 panel (originally
+Hardware Monitor is a monitor plugin for the XFCE4 panel (originally
the GNOME panel). It supports a variety of monitoring capabilities
(CPU usage, network throughput etc.) and different kinds of viewers
(curves, bars, columns, text, flames).
@@ -57,13 +57,13 @@ Compiling from source
Note that when you compile from source, the file
hardware-monitor.desktop must end up a place where the panel can find
-it. Else you will not be able to find the applet in the right-click
+it. Else you will not be able to find the plugin in the right-click
panel menu. This place is usually /usr/share/xfce4/panel/plugins/. If you
run configure with
./configure --prefix=/usr
-and install the applet, it will work.
+and install the plugin, it will work.
To set up the build environment for the usual ./configure && make &&
make install, run the provided autogen.sh script first - autoconf, libtool
diff --git a/debian/control b/debian/control
index 0d3cd8f..87def5f 100644
--- a/debian/control
+++ b/debian/control
@@ -12,7 +12,7 @@ Homepage: http://git.xfce.org/panel-plugins/xfce4-hardware-monitor-plugin/
Package: xfce4-hardware-monitor-plugin
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: Monitor applet for the XFCE4 panel
- Hardware Monitor is a monitor applet for the XFCE4 panel. It supports
+Description: Monitor plugin for the XFCE4 panel
+ Hardware Monitor is a monitor plugin for the XFCE4 panel. It supports
a variety of monitoring capabilities (CPU usage, network throughput
etc.) and different kinds of viewers (curves, bars, text, flames).
diff --git a/debian/copyright b/debian/copyright
index 509f34f..aa9a264 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,5 +1,5 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Upstream-Name: hardware-monitor-applet
+Upstream-Name: xfce4-hardware-monitor-plugin
Upstream-Contact: OmegaPhil <OmegaPhil at startmail.com>
Source: http://git.xfce.org/panel-plugins/xfce4-hardware-monitor-plugin/
diff --git a/module.xml b/module.xml
index 93b413d..2c94519 100644
--- a/module.xml
+++ b/module.xml
@@ -1,7 +1,7 @@
<Project>
<name xml:lang="en">xfce4-hardware-monitor-plugin</name>
<shortdesc xml:lang="en">Port of the venerable GNOME Hardware Monitor applet - display various stats graphically or with text</shortdesc>
- <homepage rdf:resource="http://www.fnxweb.com/hardware-monitor-applet"/>
+ <homepage rdf:resource="http://goodies.xfce.org/projects/panel-plugins/xfce4-hardware-monitor-plugin"/>
<maintainer>
<foaf:Person>
<foaf:name>OmegaPhil</foaf:name>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 76c64e3..16d36df 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,7 +1,6 @@
# List of source files containing translatable strings.
# Please keep this file sorted alphabetically.
xfce4-hardware-monitor-plugin.desktop.in
-src/applet.cpp
src/bar-view.cpp
src/choose-monitor-window.cpp
src/column-view.cpp
@@ -10,6 +9,7 @@ src/flame-view.cpp
src/gui-helpers.cpp
src/helpers.cpp
src/monitor-impls.cpp
+src/plugin.cpp
src/preferences-window.cpp
src/text-view.cpp
src/ui.glade
diff --git a/src/Makefile.am b/src/Makefile.am
index 0dc4a5b..9650750 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -13,7 +13,6 @@ plugin_LTLIBRARIES = libhardwaremonitor.la
# List of source files needed to build the library
libhardwaremonitor_la_SOURCES = \
- applet.cpp applet.hpp \
bar-view.cpp bar-view.hpp \
choose-monitor-window.cpp choose-monitor-window.hpp \
canvas-view.cpp canvas-view.hpp \
@@ -25,6 +24,7 @@ libhardwaremonitor_la_SOURCES = \
i18n.hpp \
monitor.hpp \
monitor-impls.cpp monitor-impls.hpp \
+ plugin.cpp plugin.hpp \
preferences-window.cpp preferences-window.hpp \
pixbuf-drawing.hpp \
register_plugin.c \
diff --git a/src/applet.cpp b/src/applet.cpp
deleted file mode 100644
index 78be4ae..0000000
--- a/src/applet.cpp
+++ /dev/null
@@ -1,848 +0,0 @@
-/* Implementation of the Applet class.
- *
- * Copyright (c) 2003, 04, 05 Ole Laursen.
- * Copyright (c) 2013-2015 OmegaPhil (OmegaPhil at startmail.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-// autoconf-generated, above source directory
-#include <config.h>
-
-#include <algorithm>
-#include <vector>
-#include <iostream>
-
-#include <gtkmm/main.h>
-#include <cassert>
-#include <cerrno> // Dealing with nice error
-#include <cstring> // Dealing with nice error
-#include <unistd.h> // For nice
-#include <libgnomecanvasmm/init.h>
-
-extern "C"
-{
-#include <libxfce4util/libxfce4util.h>
-}
-
-#include "ucompose.hpp"
-#include "helpers.hpp"
-
-#include "applet.hpp"
-
-#include "column-view.hpp"
-#include "curve-view.hpp"
-#include "bar-view.hpp"
-#include "text-view.hpp"
-#include "flame-view.hpp"
-#include "monitor.hpp"
-#include "preferences-window.hpp"
-#include "i18n.hpp"
-
-
-// XFCE4 functions to create and destroy applet
-extern "C" void applet_construct(XfcePanelPlugin* plugin)
-{
- // Don't eat up too much CPU
- if (nice(5) == -1)
- {
- std::cerr << "Unable to nice hardware-monitor-applet: %s" <<
- std::strerror(errno) << "\n";
- }
-
- try {
-
- // Initialising GTK and GNOME canvas
- /* Testing not initialising GTK, as this isn't a standalone application
- * but a library? Otherwise seems to fail */
- //Gtk::Main main(NULL, NULL);
- Gnome::Canvas::init();
-
- // i18n
- xfce_textdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
-
- // Actually creating the applet/plugin
- Applet *applet = new Applet(plugin);
- applet->show();
- }
- catch(const Glib::Error &ex)
- {
- // From helpers
- fatal_error(ex.what());
- }
-}
-
-// Does not need C linkage as its called via a function pointer?
-void applet_free(XfcePanelPlugin*, Applet* applet)
-{
- // Called by 'free-data' signal
- delete applet;
- applet = NULL;
-}
-
-// Helpers for popping up the various things
-void display_preferences(Applet *applet)
-{
- applet->on_preferences_activated();
-}
-
-void display_about(Applet *applet)
-{
- applet->on_about_activated();
-}
-
-/* Function declared here as its a callback for a C signal, so cant be a
- * method */
-void save_monitors(Applet *applet)
-{
- // Getting at applet/plugin objects
- XfcePanelPlugin *panel_applet = applet->panel_applet;
-
- // Search for a writeable settings file, create one if it doesnt exist
- gchar* file = xfce_panel_plugin_save_location(panel_applet, true);
-
- if (file)
- {
- // Opening setting file
- XfceRc* settings_w = xfce_rc_simple_open(file, false);
- g_free(file);
-
- // Looping for all monitors and calling save on each
- for (monitor_iter i = applet->monitors.begin(),
- end = applet->monitors.end(); i != end; ++i)
- (*i)->save(settings_w);
-
- // Close settings file
- xfce_rc_close(settings_w);
- }
- else
- {
- // Unable to obtain writeable config file - informing user and exiting
- std::cerr << _("Unable to obtain writeable config file path in order to"
- " save monitors!\n");
- }
-}
-
-// Same for this function
-// Not needed as the canvas resizes on the fly
-/*
-gboolean size_changed(XfcePanelPlugin* plugin, gint size, Applet* applet)
-{
- // Debug code
- std::cout << "Size changed event detected: " << size << "\n";
-
- return true;
-}
-* */
-
-
-Applet::Applet(XfcePanelPlugin *plugin)
- : panel_applet(plugin),
-
- // Setting defaults
- icon_path("/usr/share/pixmaps/xfce4-hardware-monitor-plugin.png"),
- viewer_type("curve"),
- viewer_font(""),
- viewer_size(96), // Arbitrary default, see later in this function for notes
- background_color(0x000000FF), // Black as the night - note that the
- // transparency bits need to be set to max to
- // ensure the colour is visible
- use_background_color(false),
- next_color(0),
- viewer_text_overlay_enabled(false),
- viewer_text_overlay_format_string("%a %m"),
- viewer_text_overlay_separator(" "),
- viewer_text_overlay_font(""),
- viewer_text_overlay_color(0x000000FF),
- viewer_text_overlay_position(CurveView::top_left)
-{
- // Search for settings file
- XfceRc* settings_ro = NULL;
- gchar* file = xfce_panel_plugin_lookup_rc_file(panel_applet);
-
- if (file)
- {
- // One exists - loading settings
- settings_ro = xfce_rc_simple_open(file, true);
- g_free(file);
-
- // Ensuring default group is in focus
- xfce_rc_set_group(settings_ro, NULL);
-
- icon_path = xfce_rc_read_entry(settings_ro, "icon-path", icon_path.c_str());
- viewer_type = xfce_rc_read_entry(settings_ro, "viewer_type",
- viewer_type.c_str());
- viewer_size = xfce_rc_read_int_entry(settings_ro, "viewer_size",
- viewer_size);
- viewer_font = xfce_rc_read_entry(settings_ro, "viewer_font",
- viewer_font.c_str());
- background_color = xfce_rc_read_int_entry(settings_ro, "background_color",
- background_color);
- use_background_color = xfce_rc_read_bool_entry(settings_ro,
- "use_background_color", use_background_color);
- next_color = xfce_rc_read_int_entry(settings_ro, "next_color",
- next_color);
- viewer_text_overlay_enabled = xfce_rc_read_bool_entry(settings_ro,
- "viewer_text_overlay_enabled", viewer_text_overlay_enabled);
- viewer_text_overlay_format_string = xfce_rc_read_entry(settings_ro,
- "viewer_text_overlay_format_string",
- viewer_text_overlay_format_string.c_str());
- viewer_text_overlay_separator = xfce_rc_read_entry(settings_ro,
- "viewer_text_overlay_separator", viewer_text_overlay_separator.c_str());
- viewer_text_overlay_font = xfce_rc_read_entry(settings_ro,
- "viewer_text_overlay_font", viewer_text_overlay_font.c_str());
- viewer_text_overlay_color = xfce_rc_read_int_entry(settings_ro,
- "viewer_text_overlay_color", viewer_text_overlay_color);
-
- // Enum is validated in set_viewer_text_overlay_position
- CurveView::TextOverlayPosition text_overlay_position =
- static_cast<CurveView::TextOverlayPosition>(
- xfce_rc_read_int_entry(settings_ro, "viewer_text_overlay_position",
- CurveView::top_left));
- set_viewer_text_overlay_position(text_overlay_position);
- }
-
- // Loading icon
- try
- {
- icon = Gdk::Pixbuf::create_from_file(icon_path);
- }
- catch (...)
- {
- std::cerr <<
- String::ucompose(_("Hardware Monitor: cannot load the icon '%1'.\n"),
- icon_path);
-
- // It's a minor problem if we can't find the icon
- icon = Glib::RefPtr<Gdk::Pixbuf>();
- }
-
- // Configuring viewer type
- viewer_type_listener(viewer_type);
-
- /* Actually setting the viewer size has no effect in this function -
- * seems that it needs to be done in or after the mainloop kicks off */
-
- // Loading up monitors
- monitor_seq mon = load_monitors(settings_ro, plugin);
- for (monitor_iter i = mon.begin(), end = mon.end(); i != end; ++i)
- add_monitor(*i);
-
- // All settings loaded
- if (settings_ro)
- xfce_rc_close(settings_ro);
-
- /* Connect plugin signals to functions - since I'm not really interested
- * in the plugin but the applet pointer, swapped results in the signal
- * handler getting the applet reference first - the plugin pointer is
- * passed next, but since the handler only takes one parameter this is
- * discarded */
- // Providing About option
- g_signal_connect_swapped(panel_applet, "about", G_CALLBACK(display_about),
- this);
-
- // Hooking into Properties option
- g_signal_connect_swapped(panel_applet, "configure-plugin",
- G_CALLBACK(display_preferences), this);
-
- // Hooking into plugin destruction signal
- g_signal_connect_swapped(panel_applet, "free-data", G_CALLBACK(applet_free),
- this);
-
- // Hooking into save signal
- g_signal_connect_swapped(panel_applet, "save", G_CALLBACK(save_monitors),
- this);
-
- /* Not needed as the canvas resizes on the fly
- // Hooking into size changed signal
- g_signal_connect(panel_applet, "size-changed", G_CALLBACK(size_changed),
- this);
- */
-
- // Adding configure and about to the applet's right-click menu
- xfce_panel_plugin_menu_show_configure(panel_applet);
- xfce_panel_plugin_menu_show_about(panel_applet);
-
- /* Add applet to panel - I need to turn the Applet (which inherits from
- * Gtk::EventBox) into a GtkWidget* - to do this I get at the GObject
- * pointer underneath the gtkmm layer */
- gtk_container_add(GTK_CONTAINER(plugin), GTK_WIDGET(this->gobj()));
-
- // Initialising timer to run every second (by default) to trigger main_loop
- timer =
- Glib::signal_timeout().connect(sigc::mem_fun(*this, &Applet::main_loop),
- update_interval);
-
- // Initial main_loop run
- main_loop();
-}
-
-Applet::~Applet()
-{
- timer.disconnect();
-
- // Make sure noone is trying to read the monitors before we kill them
- if (view.get())
- for (monitor_iter i = monitors.begin(), end = monitors.end(); i != end; ++i)
- view->detach(*i);
-
- view.reset();
-
- // Save monitors configuration
- save_monitors(this);
-
- // Delete monitors
- for (monitor_iter i = monitors.begin(), end = monitors.end(); i != end; ++i) {
- delete *i;
- }
-}
-
-void Applet::set_view(View *v)
-{
- if (view.get())
- for (monitor_iter i = monitors.begin(), end = monitors.end(); i != end; ++i)
- view->detach(*i);
-
- view.reset(v);
- view->display(*this);
-
- for (monitor_iter i = monitors.begin(), end = monitors.end(); i != end; ++i)
- view->attach(*i);
-}
-
-void Applet::viewer_type_listener(const Glib::ustring viewer_type)
-{
- if (viewer_type == "curve")
- {
- // Setting view to CurveView if it isnt already
- if (!dynamic_cast<CurveView *>(view.get()))
- set_view(new CurveView);
- }
- else if (viewer_type == "bar")
- {
- // Setting view to horizontal BarView if it isnt already
- // It gets tricky here because them BarView can render 2 viewers.
- // Thus, we much also check the oriententation
- BarView *bar_view = dynamic_cast<BarView *>(view.get());
- if (!(bar_view && bar_view->is_horizontal()) )
- set_view(new BarView);
- }
- else if (viewer_type == "vbar")
- {
- // Setting view to vertical BarView if it isnt already
- // Same situation as with "bar"
- BarView *bar_view = dynamic_cast<BarView *>(view.get());
- if (!(bar_view && !bar_view->is_horizontal()) )
- set_view(new BarView(false));
- }
- else if (viewer_type == "text") {
-
- // Setting view to TextView if it isnt already
- if (!dynamic_cast<TextView *>(view.get()))
- set_view(new TextView);
- }
- else if (viewer_type == "flame") {
-
- // Setting view to FlameView if it isnt already
- if (!dynamic_cast<FlameView *>(view.get()))
- set_view(new FlameView);
- }
- else if (viewer_type == "column") {
-
- // Setting view to ColumnView if it isnt already
- if (!dynamic_cast<ColumnView *>(view.get()))
- set_view(new ColumnView);
- }
-
- // Make sure the view sets the background
- background_color_listener(background_color);
-
- // Update recorded viewer type
- this->viewer_type = viewer_type;
-}
-
-void Applet::background_color_listener(unsigned int background_color)
-{
- if (use_background_color && view.get())
- view->set_background(background_color);
-
- // Update background_color
- this->background_color = background_color;
-}
-
-void Applet::use_background_color_listener(gboolean use_background_color)
-{
- if (view.get())
- {
- if (use_background_color)
- view->set_background(background_color);
- else
- view->unset_background();
- }
-
- // Update use_background_color
- this->use_background_color = use_background_color;
-}
-
-bool Applet::main_loop()
-{
- // Update view
- if (view.get())
- view->update();
-
- // Update tooltip
- Glib::ustring tip;
- for (monitor_iter i = monitors.begin(), end = monitors.end(); i != end; ++i) {
- Monitor &mon = **i;
-
- // Note to translators: %1 is the name of a monitor, e.g. "CPU 1", and %2 is
- // the current measurement, e.g. "78%"
- Glib::ustring next = String::ucompose(_("%1: %2"), mon.get_short_name(),
- mon.format_value(mon.value()));
- if (tip.empty())
- tip = next;
- else
- // Note to translators: this is used for composing a list of monitors; %1
- // is the previous part of the list and %2 is the part to append
- tip = String::ucompose(_("%1\n%2"), tip, next);
- }
- tooltips.set_tip(get_container(), tip);
-
- return true;
-}
-
-Gtk::Container &Applet::get_container()
-{
- return *this;
-}
-
-unsigned int Applet::get_fg_color()
-{
- static unsigned int colors[] = {
- 0x83A67FB0, 0xC1665AB0, 0x7590AEB0, 0xE0C39ED0, 0x887FA3B0
- };
-
- /* Saving 'current' next color - note that this is an index into the colors,
- * not a color itself */
- int color = next_color;
-
- // Updating next_color
- next_color = int((next_color + 1) %
- (sizeof(colors) / sizeof(unsigned int)));
-
- // Search for a writeable settings file, create one if it doesnt exist
- gchar* file = xfce_panel_plugin_save_location(panel_applet, true);
-
- if (file)
- {
- // Opening setting file
- XfceRc* settings_w = xfce_rc_simple_open(file, false);
- g_free(file);
-
- // Ensuring default group is in focus
- xfce_rc_set_group(settings_w, NULL);
-
- // Saving next_color
- xfce_rc_write_int_entry(settings_w, "next_color", next_color);
-
- // Close settings file
- xfce_rc_close(settings_w);
- }
- else
- {
- // Unable to obtain writeable config file - informing user and exiting
- std::cerr << _("Unable to obtain writeable config file path in order to"
- " save next_color!\n");
- }
-
- // Returning actual next color
- return colors[color];
-}
-
-int Applet::get_size() const
-{
- /* Returns the thickness of the panel (i.e. height in the normal
- * orientation or width in the vertical orientation) */
- return xfce_panel_plugin_get_size(panel_applet);
-}
-
-bool Applet::horizontal() const
-{
- GtkOrientation orient = xfce_panel_plugin_get_orientation(panel_applet);
- return orient == GTK_ORIENTATION_HORIZONTAL;
-}
-
-Glib::RefPtr<Gdk::Pixbuf> Applet::get_icon()
-{
- return icon;
-}
-
-const Glib::ustring Applet::get_viewer_type()
-{
- return viewer_type;
-}
-
-unsigned int Applet::get_background_color() const
-{
- return background_color;
-}
-
-gboolean Applet::get_use_background_color() const
-{
- return use_background_color;
-}
-
-int Applet::get_viewer_size() const
-{
- return viewer_size;
-}
-
-void Applet::set_viewer_size(const int size)
-{
- // See header file viewer_size_configured notes
-
- // Obtaining current widget dimensions
- GtkRequisition req_size;
- gtk_widget_size_request(GTK_WIDGET(panel_applet), &req_size);
-
- /*
- // Debug code
- std::cout << "Size information: " << req_size.width << "x"
- << req_size.height << "\n";
- */
-
- // Make sure on every call that the viewer size is being honoured
- if (horizontal())
- {
- if (req_size.width != size)
- gtk_widget_set_size_request(GTK_WIDGET(panel_applet), size, -1);
- }
- else
- {
- if (req_size.height != size)
- gtk_widget_set_size_request(GTK_WIDGET(panel_applet), -1, size);
- }
-
- // Exiting if the size hasn't changed from this program's perspective
- if (viewer_size == size)
- return;
-
- viewer_size = size;
-
- // Debug code
- //std::cout << "Viewer size set to " << viewer_size << "\n";
-}
-
-const Glib::ustring Applet::get_viewer_font()
-{
- return viewer_font;
-}
-
-void Applet::set_viewer_font(const Glib::ustring font_details)
-{
- viewer_font = font_details;
-}
-
-bool Applet::get_viewer_text_overlay_enabled() const
-{
- return viewer_text_overlay_enabled;
-}
-
-void Applet::set_viewer_text_overlay_enabled(bool enabled)
-{
- viewer_text_overlay_enabled = enabled;
-}
-
-const Glib::ustring Applet::get_viewer_text_overlay_format_string()
-{
- return viewer_text_overlay_format_string;
-}
-
-void Applet::set_viewer_text_overlay_format_string(const Glib::ustring format_string)
-{
- viewer_text_overlay_format_string = format_string;
-}
-
-const Glib::ustring Applet::get_viewer_text_overlay_separator() const
-{
- return viewer_text_overlay_separator;
-}
-
-void Applet::set_viewer_text_overlay_separator(const Glib::ustring separator)
-{
- viewer_text_overlay_separator = separator;
-}
-
-bool Applet::get_viewer_text_overlay_use_font() const
-{
- return viewer_text_overlay_use_font;
-}
-
-void Applet::set_viewer_text_overlay_use_font(bool enabled)
-{
- viewer_text_overlay_use_font = enabled;
-}
-
-const Glib::ustring Applet::get_viewer_text_overlay_font()
-{
- return viewer_text_overlay_font;
-}
-
-void Applet::set_viewer_text_overlay_font(const Glib::ustring font_details)
-{
- viewer_text_overlay_font = font_details;
-}
-
-const unsigned int Applet::get_viewer_text_overlay_color() const
-{
- return viewer_text_overlay_color;
-}
-
-void Applet::set_viewer_text_overlay_color(const unsigned int color)
-{
- viewer_text_overlay_color = color;
-}
-
-const CurveView::TextOverlayPosition Applet::get_viewer_text_overlay_position()
-{
- return viewer_text_overlay_position;
-}
-
-void Applet::set_viewer_text_overlay_position(CurveView::TextOverlayPosition
- position)
-{
- // Validating input - an enum does not enforce a range!!
- if (position < CurveView::top_left ||
- position >= CurveView::NUM_TEXT_OVERLAY_POSITIONS)
- {
- std::cerr << "Applet::set_viewer_text_overlay_position was called with an "
- "invalid position: " << position << "!\n";
- position = CurveView::top_left;
- }
-
- viewer_text_overlay_position = position;
-}
-
-void Applet::add_monitor(Monitor *monitor)
-{
- add_sync_for(monitor);
- monitors.push_back(monitor);
-
- /* Checking if monitor has a defined settings directory and therefore
- * settings to load */
- if (monitor->get_settings_dir().empty())
- {
- // It hasn't - creating one and saving
- monitor->set_settings_dir(find_empty_monitor_dir());
-
- // Search for a writeable settings file, create one if it doesnt exist
- gchar* file = xfce_panel_plugin_save_location(panel_applet, true);
-
- if (file)
- {
- // Opening setting file
- XfceRc* settings_w = xfce_rc_simple_open(file, false);
- g_free(file);
-
- // Saving monitor
- monitor->save(settings_w);
-
- // Close settings file
- xfce_rc_close(settings_w);
- }
- else
- {
- // Unable to obtain writeable config file - informing user
- std::cerr << _("Unable to obtain writeable config file path in "
- "order to save monitor in add_monitor call!\n");
- }
- }
-
- // Attaching monitor to view
- if (view.get())
- view->attach(monitor);
-}
-
-void Applet::remove_monitor(Monitor *monitor)
-{
- // Detatching monitor
- if (view.get())
- view->detach(monitor);
-
- // Search for a writeable settings file, create one if it doesnt exist
- gchar* file = xfce_panel_plugin_save_location(panel_applet, true);
-
- if (file)
- {
- // Opening setting file
- XfceRc* settings_w = xfce_rc_simple_open(file, false);
- g_free(file);
-
- // Removing settings group associated with the monitor if it exists
- if (xfce_rc_has_group(settings_w, monitor->get_settings_dir().c_str()))
- xfce_rc_delete_group(settings_w, monitor->get_settings_dir().c_str(),
- FALSE);
-
- // Close settings file
- xfce_rc_close(settings_w);
- }
- else
- {
- // Unable to obtain writeable config file - informing user
- std::cerr << _("Unable to obtain writeable config file path in "
- "order to remove a monitor!\n");
- }
-
- // Everyone has been notified, it's now safe to remove and delete
- // the monitor
- monitors.remove(monitor);
- remove_sync_for(monitor);
-
- delete monitor;
-}
-
-void Applet::replace_monitor(Monitor *prev_mon, Monitor *new_mon)
-{
- // Locating monitor of interest
- monitor_iter i = std::find(monitors.begin(), monitors.end(), prev_mon);
- assert(i != monitors.end());
-
- // Basic configuration
- add_sync_for(new_mon);
- *i = new_mon;
- new_mon->set_settings_dir(prev_mon->get_settings_dir());
-
- // Search for a writeable settings file, create one if it doesnt exist
- gchar* file = xfce_panel_plugin_save_location(panel_applet, true);
-
- if (file)
- {
- // Opening setting file
- XfceRc* settings_w = xfce_rc_simple_open(file, false);
- g_free(file);
-
- // Saving settings
- new_mon->save(settings_w);
-
- // Close settings file
- xfce_rc_close(settings_w);
- }
- else
- {
- // Unable to obtain writeable config file - informing user
- std::cerr << _("Unable to obtain writeable config file path in "
- "order to save monitor settings in replace_monitor call!\n");
- }
-
- // Reattach monitor if its attached to the current view
- if (view.get()) {
- view->detach(prev_mon);
- view->attach(new_mon);
- }
-
- // Deleting previous monitor
- remove_sync_for(prev_mon);
- delete prev_mon;
-}
-
-void Applet::add_sync_for(Monitor *monitor)
-{
- for (monitor_iter i = monitors.begin(), end = monitors.end(); i != end; ++i)
- (*i)->possibly_add_sync_with(monitor);
-}
-
-void Applet::remove_sync_for(Monitor *monitor)
-{
- for (monitor_iter i = monitors.begin(), end = monitors.end(); i != end; ++i)
- (*i)->remove_sync_with(monitor);
-}
-
-Glib::ustring Applet::find_empty_monitor_dir()
-{
- Glib::ustring mon_dir;
- int c = 1;
-
- // Search for read-only settings file
- gchar* file = xfce_panel_plugin_lookup_rc_file(panel_applet);
-
- if (file)
- {
- // One exists - loading readonly settings
- XfceRc* settings_ro = xfce_rc_simple_open(file, true);
- g_free(file);
-
- do {
- mon_dir = String::ucompose("%1", c++);
- } while (xfce_rc_has_group(settings_ro, mon_dir.c_str()));
-
- // Close settings file
- xfce_rc_close(settings_ro);
- }
- else
- {
- /* No configuration file exists yet - setting mon_dir to 1 and
- * informing user */
- mon_dir = String::ucompose("%1", c);
- }
-
- // Returning next free monitor directory (number)
- return mon_dir;
-}
-
-void Applet::on_preferences_activated()
-{
- preferences_window.reset(new PreferencesWindow(*this, monitors));
- preferences_window->show();
-}
-
-void Applet::on_about_activated()
-{
- std::vector<Glib::ustring> authors;
- authors.push_back("Ole Laursen <olau at hardworking.dk>");
- authors.push_back("OmegaPhil <OmegaPhil at startmail.com>");
-
- std::vector<Glib::ustring> documenters;
- // add documenters here
-
- Glib::ustring description =
- _("Monitor various hardware-related information, such as CPU usage, "
- "memory usage etc. Supports curve graphs, bar plots, "
- "column diagrams, textual monitoring and fluctuating flames.");
-
- if (about.get() == 0) {
- about.reset(new Gtk::AboutDialog());
- about->set_name(_("Hardware Monitor"));
- about->set_version(VERSION);
- // %1 is the copyright symbol
- about->set_copyright(String::ucompose(_("Copyright %1 2003 Ole "
- "Laursen\nCopyright %1 2013-2015 OmegaPhil"), "\xc2\xa9"));
- about->set_authors(authors);
- if (!documenters.empty())
- about->set_documenters(documenters);
- about->set_comments(description);
- // note to translators: please fill in your names and email addresses
- about->set_translator_credits(_("translator-credits"));
- about->set_logo(icon);
- about->set_icon(icon);
- about->signal_response().connect(
- sigc::hide(sigc::mem_fun(*about, &Gtk::Widget::hide)));
- about->show();
- }
- else {
- about->show();
- about->raise();
- }
-}
diff --git a/src/applet.hpp b/src/applet.hpp
deleted file mode 100644
index ffd748c..0000000
--- a/src/applet.hpp
+++ /dev/null
@@ -1,143 +0,0 @@
-/* The applet class which coordinates everything.
- *
- * Copyright (c) 2003, 04, 05 Ole Laursen.
- * Copyright (c) 2013-2015 OmegaPhil (OmegaPhil at startmail.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA.
- */
-
-#ifndef APPLET_HPP
-#define APPLET_HPP
-
-#include <memory>
-#include <list>
-
-#include <sigc++/connection.h>
-
-#include <gtkmm/eventbox.h>
-#include <gtkmm/window.h>
-#include <gtkmm/tooltips.h>
-#include <gtkmm/aboutdialog.h>
-
-#include <glibmm/ustring.h>
-
-extern "C"
-{
-#include <libxfce4panel/libxfce4panel.h>
-}
-
-#include "monitor.hpp"
-#include "curve-view.hpp"
-
-class PreferencesWindow;
-class View;
-
-
-// main monster GUI class
-class Applet: public Gtk::EventBox
-{
-public:
- Applet(XfcePanelPlugin *plugin);
- ~Applet();
-
- Gtk::Container &get_container();
-
- unsigned int get_fg_color(); // return varying foreground colours
- int get_size() const; // in pixels
- bool horizontal() const; // whether we're in horizontal mode
- void set_view(View *view); // use this view to monitor
-
- /* The following have been created to access properties that used to
- * be publically available through GConf, but are private data in the
- * object */
- const Glib::ustring get_viewer_type();
- unsigned int get_background_color() const;
- gboolean get_use_background_color() const;
- int get_viewer_size() const;
- void set_viewer_size(const int size);
- const Glib::ustring get_viewer_font();
- void set_viewer_font(const Glib::ustring font_details);
- bool get_viewer_text_overlay_enabled() const;
- void set_viewer_text_overlay_enabled(bool enabled);
- const Glib::ustring get_viewer_text_overlay_format_string();
- void set_viewer_text_overlay_format_string(const Glib::ustring format_string);
- const Glib::ustring get_viewer_text_overlay_separator() const;
- void set_viewer_text_overlay_separator(const Glib::ustring separator);
- bool get_viewer_text_overlay_use_font() const;
- void set_viewer_text_overlay_use_font(bool enabled);
- const Glib::ustring get_viewer_text_overlay_font();
- void set_viewer_text_overlay_font(const Glib::ustring font_details);
- const unsigned int get_viewer_text_overlay_color() const;
- void set_viewer_text_overlay_color(const unsigned int color);
- const CurveView::TextOverlayPosition get_viewer_text_overlay_position();
- void set_viewer_text_overlay_position(CurveView::TextOverlayPosition
- position);
- void viewer_type_listener(const Glib::ustring viewer_type);
- void background_color_listener(unsigned int background_color);
- void use_background_color_listener(gboolean use_background_color);
-
- Glib::RefPtr<Gdk::Pixbuf> get_icon(); // get the application icon
-
- void add_monitor(Monitor *monitor); // take over ownership of monitor
- void remove_monitor(Monitor *monitor); // get rid of the monitor
- void replace_monitor(Monitor *prev_monitor, Monitor *new_monitor);
-
- // For opening settings file associated with the plugin
- XfcePanelPlugin *panel_applet;
-
- static int const update_interval = 1000;
-
-private:
- // monitors
- monitor_seq monitors;
- void add_sync_for(Monitor *monitor);
- void remove_sync_for(Monitor *monitor);
-
- // the context menu
- void on_preferences_activated();
- void on_about_activated();
-
- // looping
- bool main_loop();
- sigc::connection timer;
-
- Glib::ustring find_empty_monitor_dir();
-
- // data
- Glib::ustring icon_path, viewer_type, viewer_font;
- bool viewer_text_overlay_enabled, viewer_text_overlay_use_font;
- Glib::ustring viewer_text_overlay_format_string, viewer_text_overlay_separator,
- viewer_text_overlay_font;
- unsigned int viewer_text_overlay_color;
- CurveView::TextOverlayPosition viewer_text_overlay_position;
-
- unsigned int background_color;
- int viewer_size, next_color;
- gboolean use_background_color;
- Glib::RefPtr<Gdk::Pixbuf> icon;
- std::auto_ptr<Gtk::AboutDialog> about;
- std::auto_ptr<View> view;
- std::auto_ptr<PreferencesWindow> preferences_window;
- Gtk::Tooltips tooltips;
-
- friend void display_preferences(Applet *applet);
- friend void display_about(Applet *applet);
- friend void save_monitors(Applet *applet);
- friend gboolean size_changed(XfcePanelPlugin* plugin, gint size,
- Applet* applet);
-};
-
-#endif
diff --git a/src/bar-view.cpp b/src/bar-view.cpp
index 71911f4..cd18275 100644
--- a/src/bar-view.cpp
+++ b/src/bar-view.cpp
@@ -26,7 +26,7 @@
#include <libgnomecanvasmm/rect.h>
#include "bar-view.hpp"
-#include "applet.hpp"
+#include "plugin.hpp"
#include "monitor.hpp"
@@ -42,7 +42,7 @@ public:
void update();
void draw(Gnome::Canvas::Canvas &canvas,
- Applet *applet, int width, int height, int no, int total,
+ Plugin *plugin, int width, int height, int no, int total,
double time_offset);
Monitor *monitor;
@@ -99,7 +99,7 @@ unsigned int outlineified(unsigned int color)
}
void Bar::draw(Gnome::Canvas::Canvas &canvas,
- Applet *applet, int width, int height, int no, int total,
+ Plugin *plugin, int width, int height, int no, int total,
double time_offset)
{
unsigned int outline_color = outlineified(fill_color);
@@ -225,7 +225,7 @@ void BarView::do_attach(Monitor *monitor)
Glib::ustring dir = monitor->get_settings_dir();
// Search for settings file
- gchar* file = xfce_panel_plugin_lookup_rc_file(applet->panel_applet);
+ gchar* file = xfce_panel_plugin_lookup_rc_file(plugin->xfce_plugin);
if (file)
{
@@ -238,7 +238,7 @@ void BarView::do_attach(Monitor *monitor)
if (xfce_rc_has_entry(settings_ro, "fill_color"))
{
fill_color = xfce_rc_read_int_entry(settings_ro, "fill_color",
- applet->get_fg_color());
+ plugin->get_fg_color());
color_missing = false;
}
@@ -251,10 +251,10 @@ void BarView::do_attach(Monitor *monitor)
if (color_missing)
{
// Setting color
- fill_color = applet->get_fg_color();
+ fill_color = plugin->get_fg_color();
// Search for a writeable settings file, create one if it doesnt exist
- file = xfce_panel_plugin_save_location(applet->panel_applet, true);
+ file = xfce_panel_plugin_save_location(plugin->xfce_plugin, true);
if (file)
{
@@ -301,7 +301,7 @@ void BarView::do_draw_loop()
int no = 0;
for (bar_iterator i = bars.begin(), end = bars.end(); i != end; ++i)
- (*i)->draw(*canvas, applet, width(), height(), no++, total, time_offset);
+ (*i)->draw(*canvas, plugin, width(), height(), no++, total, time_offset);
++draws_since_update;
}
diff --git a/src/canvas-view.cpp b/src/canvas-view.cpp
index 0a65ff1..67b9ea2 100644
--- a/src/canvas-view.cpp
+++ b/src/canvas-view.cpp
@@ -26,7 +26,7 @@
#include <libgnomecanvasmm/pixbuf.h>
#include "canvas-view.hpp"
-#include "applet.hpp"
+#include "plugin.hpp"
int const CanvasView::draw_interval = 100;
@@ -46,7 +46,7 @@ void CanvasView::do_display()
{
// canvas creation magic
canvas.reset(new Gnome::Canvas::CanvasAA);
- applet->get_container().add(*canvas);
+ plugin->get_container().add(*canvas);
draw_timer = Glib::signal_timeout()
.connect(sigc::mem_fun(*this, &CanvasView::draw_loop), draw_interval);
@@ -60,12 +60,12 @@ void CanvasView::do_update()
// Debug code
//std::cout << "In CanvasView::do_update!\n";
- // Size is maintained in applet
- size = applet->get_viewer_size();
+ // Size is maintained in plugin
+ size = plugin->get_viewer_size();
/* Ensure that the widget's requested size is being honoured on every
* call */
- applet->set_viewer_size(size);
+ plugin->set_viewer_size(size);
// Ensure the canvas is shown
resize_canvas();
@@ -97,26 +97,26 @@ void CanvasView::do_unset_background()
int CanvasView::width() const
{
- /* Remember that applet->get_size returns the thickness of the panel
+ /* Remember that plugin->get_size returns the thickness of the panel
* (i.e. height in the normal orientation or width in the vertical
* orientation) */
// Debug code
- //std::cout << "CanvasView::width: " << ((applet->horizontal()) ? size : applet->get_size()) << "\n";
+ //std::cout << "CanvasView::width: " << ((plugin->horizontal()) ? size : plugin->get_size()) << "\n";
- if (applet->horizontal())
+ if (plugin->horizontal())
return size;
else
- return applet->get_size();
+ return plugin->get_size();
}
int CanvasView::height() const
{
// Debug code
- //std::cout << "CanvasView::height: " << ((applet->horizontal()) ? applet->get_size() : size) << "\n";
+ //std::cout << "CanvasView::height: " << ((plugin->horizontal()) ? plugin->get_size() : size) << "\n";
- if (applet->horizontal())
- return applet->get_size();
+ if (plugin->horizontal())
+ return plugin->get_size();
else
return size;
}
diff --git a/src/choose-monitor-window.cpp b/src/choose-monitor-window.cpp
index 0ba794e..e790893 100644
--- a/src/choose-monitor-window.cpp
+++ b/src/choose-monitor-window.cpp
@@ -36,9 +36,9 @@
// Static intialisation
ChooseMonitorWindow::NetworkInterfacesNamesCols ChooseMonitorWindow::nc;
-ChooseMonitorWindow::ChooseMonitorWindow(XfcePanelPlugin* panel_applet_local,
+ChooseMonitorWindow::ChooseMonitorWindow(XfcePanelPlugin* xfce_plugin,
Gtk::Window &parent)
- : panel_applet(panel_applet_local)
+ : xfce_plugin(xfce_plugin)
{
// Now we are forced to use top-level widgets this is much more over the top...
std::vector<Glib::ustring> objects(2);
@@ -341,7 +341,7 @@ Monitor *ChooseMonitorWindow::run(const Glib::ustring &mon_dir)
{
// Set up monitor
// Search for settings file
- gchar* file = xfce_panel_plugin_lookup_rc_file(panel_applet);
+ gchar* file = xfce_panel_plugin_lookup_rc_file(xfce_plugin);
if (file)
{
// Loading settings
@@ -677,7 +677,7 @@ Monitor *ChooseMonitorWindow::run(const Glib::ustring &mon_dir)
(*iter)[nc.interface_type] = NetworkLoadMonitor::
interface_type_to_string(interface_type, false);
(*iter)[nc.interface_name] = NetworkLoadMonitor::
- get_interface_name(interface_type, panel_applet);
+ get_interface_name(interface_type, xfce_plugin);
}
}
@@ -821,7 +821,7 @@ Monitor *ChooseMonitorWindow::run(const Glib::ustring &mon_dir)
}
mon = new NetworkLoadMonitor(interface_type, dir,
- network_load_tag->get_text(), panel_applet);
+ network_load_tag->get_text(), xfce_plugin);
}
else if (temperature_radiobutton->get_active())
mon = new TemperatureMonitor(temperature_combobox->get_active_row_number(),
@@ -1055,7 +1055,7 @@ void ChooseMonitorWindow::on_network_interface_name_edited(
// Setting and saving the real value
NetworkLoadMonitor::set_interface_name(inter_type, new_text);
- gchar* file = xfce_panel_plugin_save_location(panel_applet, true);
+ gchar* file = xfce_panel_plugin_save_location(xfce_plugin, true);
if (file)
{
XfceRc* settings_w = xfce_rc_simple_open(file, false);
@@ -1098,7 +1098,7 @@ void ChooseMonitorWindow::on_network_interfaces_restore_defaults_button_clicked(
}
// Updating storage vector and saving
- gchar* file = xfce_panel_plugin_save_location(panel_applet, true);
+ gchar* file = xfce_panel_plugin_save_location(xfce_plugin, true);
if (file)
{
XfceRc* settings_w = xfce_rc_simple_open(file, false);
diff --git a/src/choose-monitor-window.hpp b/src/choose-monitor-window.hpp
index cb9b86a..fcb62b5 100644
--- a/src/choose-monitor-window.hpp
+++ b/src/choose-monitor-window.hpp
@@ -45,16 +45,16 @@ extern "C"
#include <libxfce4panel/libxfce4panel.h>
}
-class Applet;
+class Plugin;
class Monitor;
class ChooseMonitorWindow: public sigc::trackable
{
public:
- /* panel_applet is required here as the user can edit NetworkLoadMonitor
+ /* xfce_plugin is required here as the user can edit NetworkLoadMonitor
* interface names through a settings dialog, and this needs special saving */
- ChooseMonitorWindow(XfcePanelPlugin* panel_applet_local, Gtk::Window &parent);
+ ChooseMonitorWindow(XfcePanelPlugin* xfce_plugin, Gtk::Window &parent);
~ChooseMonitorWindow();
// given a monitor directory (may be ""), return a new monitor or 0
@@ -108,7 +108,7 @@ private:
*generic_change_in_value_negative_radiobutton,
*generic_change_in_value_both_radiobutton;
- XfcePanelPlugin* panel_applet;
+ XfcePanelPlugin* xfce_plugin;
// For disk statistics device name combobox
class DiskStatsDeviceNameCols: public Gtk::TreeModel::ColumnRecord
diff --git a/src/column-view.cpp b/src/column-view.cpp
index 289fa8e..abbc2c0 100644
--- a/src/column-view.cpp
+++ b/src/column-view.cpp
@@ -24,7 +24,7 @@
#include <libgnomecanvasmm/pixbuf.h>
#include "column-view.hpp"
-#include "applet.hpp"
+#include "plugin.hpp"
#include "monitor.hpp"
#include "value-history.hpp"
@@ -42,7 +42,7 @@ public:
void update(unsigned int max_samples); // gather info from monitor
void draw(Gnome::Canvas::Canvas &canvas, // redraw columns on canvas
- Applet *applet, int width, int height);
+ Plugin *plugin, int width, int height);
Monitor *monitor;
@@ -70,7 +70,7 @@ void ColumnGraph::update(unsigned int max_samples)
}
void ColumnGraph::draw(Gnome::Canvas::Canvas &canvas,
- Applet *applet, int width, int height)
+ Plugin *plugin, int width, int height)
{
if (remaining_draws <= 0)
return;
@@ -185,7 +185,7 @@ void ColumnView::do_attach(Monitor *monitor)
Glib::ustring dir = monitor->get_settings_dir();
// Search for settings file
- gchar* file = xfce_panel_plugin_lookup_rc_file(applet->panel_applet);
+ gchar* file = xfce_panel_plugin_lookup_rc_file(plugin->xfce_plugin);
if (file)
{
@@ -198,7 +198,7 @@ void ColumnView::do_attach(Monitor *monitor)
if (xfce_rc_has_entry(settings_ro, "color"))
{
color = xfce_rc_read_int_entry(settings_ro, "color",
- applet->get_fg_color());
+ plugin->get_fg_color());
color_missing = false;
}
@@ -211,10 +211,10 @@ void ColumnView::do_attach(Monitor *monitor)
if (color_missing)
{
// Setting color
- color = applet->get_fg_color();
+ color = plugin->get_fg_color();
// Search for a writeable settings file, create one if it doesnt exist
- file = xfce_panel_plugin_save_location(applet->panel_applet, true);
+ file = xfce_panel_plugin_save_location(plugin->xfce_plugin, true);
if (file)
{
@@ -256,5 +256,5 @@ void ColumnView::do_detach(Monitor *monitor)
void ColumnView::do_draw_loop()
{
for (column_iterator i = columns.begin(), end = columns.end(); i != end; ++i)
- (*i)->draw(*canvas, applet, width(), height());
+ (*i)->draw(*canvas, plugin, width(), height());
}
diff --git a/src/curve-view.cpp b/src/curve-view.cpp
index 97c1dab..832ed88 100644
--- a/src/curve-view.cpp
+++ b/src/curve-view.cpp
@@ -25,7 +25,7 @@
#include <libgnomecanvasmm/point.h>
#include "curve-view.hpp"
-#include "applet.hpp"
+#include "plugin.hpp"
#include "helpers.hpp"
#include "monitor.hpp"
#include "ucompose.hpp"
@@ -184,7 +184,7 @@ void CurveView::do_attach(Monitor *monitor)
Glib::ustring dir = monitor->get_settings_dir();
// Search for settings file
- gchar* file = xfce_panel_plugin_lookup_rc_file(applet->panel_applet);
+ gchar* file = xfce_panel_plugin_lookup_rc_file(plugin->xfce_plugin);
if (file)
{
@@ -197,7 +197,7 @@ void CurveView::do_attach(Monitor *monitor)
if (xfce_rc_has_entry(settings_ro, "color"))
{
color = xfce_rc_read_int_entry(settings_ro, "color",
- applet->get_fg_color());
+ plugin->get_fg_color());
color_missing = false;
}
@@ -210,10 +210,10 @@ void CurveView::do_attach(Monitor *monitor)
if (color_missing)
{
// Setting color
- color = applet->get_fg_color();
+ color = plugin->get_fg_color();
// Search for a writeable settings file, create one if it doesnt exist
- file = xfce_panel_plugin_save_location(applet->panel_applet, true);
+ file = xfce_panel_plugin_save_location(plugin->xfce_plugin, true);
if (file)
{
@@ -257,10 +257,10 @@ void CurveView::do_draw_loop()
double max = 0;
Glib::ustring max_formatted, max_formatted_compact, monitor_data,
monitor_data_compact, text_overlay_format_string, tag_string,
- separator_string = applet->get_viewer_text_overlay_separator();
+ separator_string = plugin->get_viewer_text_overlay_separator();
bool graph_max_needed = false, graph_max_compact_needed = false,
monitor_data_needed = false, monitor_data_compact_needed = false,
- text_overlay_enabled = applet->get_viewer_text_overlay_enabled();
+ text_overlay_enabled = plugin->get_viewer_text_overlay_enabled();
// Obtain maximum value of all curves in the view
for (curve_iterator i = curves.begin(), end = curves.end(); i != end; ++i)
@@ -270,7 +270,7 @@ void CurveView::do_draw_loop()
// If the text overlay is enabled, detecting all information required to output
if (text_overlay_enabled)
{
- text_overlay_format_string = applet->get_viewer_text_overlay_format_string();
+ text_overlay_format_string = plugin->get_viewer_text_overlay_format_string();
/* Glib::ustring::npos is the strange way C++ flags as a failure to find a
* string */
@@ -375,19 +375,19 @@ void CurveView::do_draw_loop()
/* Setting/fixing changed font and colour - doing it here since the CurveView
* updates so frequently that its not worth also setting it directly from the
* UI etc */
- Glib::ustring font_details = applet->get_viewer_text_overlay_font();
+ Glib::ustring font_details = plugin->get_viewer_text_overlay_font();
if (font_details.empty())
font_details = "Sans 8";
if (text_overlay->property_font() != font_details)
text_overlay->property_font() = font_details;
- unsigned int color = applet->get_viewer_text_overlay_color();
+ unsigned int color = plugin->get_viewer_text_overlay_color();
if (text_overlay->property_fill_color_rgba() != color)
text_overlay->property_fill_color_rgba() = color;
// Positioning text
int x, y;
- text_overlay_calc_position(x, y, applet->get_viewer_text_overlay_position());
+ text_overlay_calc_position(x, y, plugin->get_viewer_text_overlay_position());
if (text_overlay->property_x() != x)
text_overlay->property_x() = x;
if (text_overlay->property_y() != y)
@@ -436,33 +436,33 @@ void CurveView::text_overlay_calc_position(int& x, int& y,
break;
case top_center:
- x = (applet->get_width() - text_overlay->property_text_width()) / 2;
+ x = (plugin->get_width() - text_overlay->property_text_width()) / 2;
y = 0;
break;
case top_right:
- x = applet->get_width() - text_overlay->property_text_width();
+ x = plugin->get_width() - text_overlay->property_text_width();
y = 0;
break;
case center:
- x = (applet->get_width() - text_overlay->property_text_width()) / 2;
- y = (applet->get_height() - text_overlay->property_text_height()) / 2;
+ x = (plugin->get_width() - text_overlay->property_text_width()) / 2;
+ y = (plugin->get_height() - text_overlay->property_text_height()) / 2;
break;
case bottom_left:
x = 0;
- y = applet->get_height() - text_overlay->property_text_height();
+ y = plugin->get_height() - text_overlay->property_text_height();
break;
case bottom_center:
- x = (applet->get_width() - text_overlay->property_text_width()) / 2;
- y = applet->get_height() - text_overlay->property_text_height();
+ x = (plugin->get_width() - text_overlay->property_text_width()) / 2;
+ y = plugin->get_height() - text_overlay->property_text_height();
break;
case bottom_right:
- x = applet->get_width() - text_overlay->property_text_width();
- y = applet->get_height() - text_overlay->property_text_height();
+ x = plugin->get_width() - text_overlay->property_text_width();
+ y = plugin->get_height() - text_overlay->property_text_height();
break;
default:
diff --git a/src/flame-view.cpp b/src/flame-view.cpp
index b25db6e..38b4c85 100644
--- a/src/flame-view.cpp
+++ b/src/flame-view.cpp
@@ -28,7 +28,7 @@
#include "pixbuf-drawing.hpp"
#include "flame-view.hpp"
-#include "applet.hpp"
+#include "plugin.hpp"
#include "monitor.hpp"
@@ -42,7 +42,7 @@ public:
Flame(Monitor *monitor, unsigned int color);
void update(Gnome::Canvas::Canvas &canvas,
- Applet *applet, int width, int height, int no, int total);
+ Plugin *plugin, int width, int height, int no, int total);
void burn();
@@ -66,7 +66,7 @@ Flame::Flame(Monitor *m, unsigned int c)
{}
void Flame::update(Gnome::Canvas::Canvas &canvas,
- Applet *applet, int width, int height, int no, int total)
+ Plugin *plugin, int width, int height, int no, int total)
{
// Then make sure layer is correctly setup
if (flame.get() == 0)
@@ -257,7 +257,7 @@ void FlameView::do_update()
for (flame_iterator i = flames.begin(), end = flames.end(); i != end; ++i) {
Flame &flame = **i;
- flame.update(*canvas, applet, width(), height(), no++, total);
+ flame.update(*canvas, plugin, width(), height(), no++, total);
}
}
@@ -271,7 +271,7 @@ void FlameView::do_attach(Monitor *monitor)
Glib::ustring dir = monitor->get_settings_dir();
// Search for settings file
- gchar* file = xfce_panel_plugin_lookup_rc_file(applet->panel_applet);
+ gchar* file = xfce_panel_plugin_lookup_rc_file(plugin->xfce_plugin);
if (file)
{
@@ -284,7 +284,7 @@ void FlameView::do_attach(Monitor *monitor)
if (xfce_rc_has_entry(settings_ro, "color"))
{
color = xfce_rc_read_int_entry(settings_ro, "color",
- applet->get_fg_color());
+ plugin->get_fg_color());
color_missing = false;
}
@@ -297,10 +297,10 @@ void FlameView::do_attach(Monitor *monitor)
if (color_missing)
{
// Setting color
- color = applet->get_fg_color();
+ color = plugin->get_fg_color();
// Search for a writeable settings file, create one if it doesnt exist
- file = xfce_panel_plugin_save_location(applet->panel_applet, true);
+ file = xfce_panel_plugin_save_location(plugin->xfce_plugin, true);
if (file)
{
diff --git a/src/monitor-impls.cpp b/src/monitor-impls.cpp
index 20717ca..4df711f 100644
--- a/src/monitor-impls.cpp
+++ b/src/monitor-impls.cpp
@@ -1115,10 +1115,10 @@ bool NetworkLoadMonitor::interface_names_configured = false;
NetworkLoadMonitor::NetworkLoadMonitor(InterfaceType &inter_type, Direction dir,
const Glib::ustring &tag_string,
- XfcePanelPlugin* panel_applet)
+ XfcePanelPlugin* xfce_plugin)
: Monitor(tag_string), max_value(1), byte_count(0), time_stamp_secs(0),
time_stamp_usecs(0),interface_type(inter_type), direction(dir),
- pnl_applet(panel_applet)
+ xfce_plugin(xfce_plugin)
{
}
@@ -1128,7 +1128,7 @@ double NetworkLoadMonitor::do_measure()
/* Obtaining interface name - this can change after monitor is instantiated
* hence fetching each time */
- Glib::ustring interface = get_interface_name(interface_type, pnl_applet);
+ Glib::ustring interface = get_interface_name(interface_type, xfce_plugin);
glibtop_get_netload(&netload, interface.c_str());
guint64 val, measured_bytes;
@@ -1290,7 +1290,7 @@ void NetworkLoadMonitor::remove_sync_with(Monitor *other)
sync_monitors.erase(i);
}
-void NetworkLoadMonitor::configure_interface_names(XfcePanelPlugin *panel_applet)
+void NetworkLoadMonitor::configure_interface_names(XfcePanelPlugin *xfce_plugin)
{
if (interface_names_configured)
return;
@@ -1300,7 +1300,7 @@ void NetworkLoadMonitor::configure_interface_names(XfcePanelPlugin *panel_applet
write_settings_serial_link = false, write_settings_wireless_first = false,
write_settings_wireless_second = false, write_settings_wireless_third = false;
- gchar* file = xfce_panel_plugin_lookup_rc_file(panel_applet);
+ gchar* file = xfce_panel_plugin_lookup_rc_file(xfce_plugin);
if (file)
{
XfceRc* settings_ro = xfce_rc_simple_open(file, true);
@@ -1424,7 +1424,7 @@ void NetworkLoadMonitor::configure_interface_names(XfcePanelPlugin *panel_applet
|| write_settings_wireless_second || write_settings_wireless_third)
{
// Search for a writeable settings file, create one if it doesnt exist
- gchar* file = xfce_panel_plugin_save_location(panel_applet, true);
+ gchar* file = xfce_panel_plugin_save_location(xfce_plugin, true);
if (file)
{
@@ -1516,10 +1516,10 @@ void NetworkLoadMonitor::configure_interface_names(XfcePanelPlugin *panel_applet
}
Glib::ustring NetworkLoadMonitor::get_interface_name(InterfaceType type,
- XfcePanelPlugin *panel_applet)
+ XfcePanelPlugin *xfce_plugin)
{
// Load saved interface names if not done yet and enforcing defaults
- configure_interface_names(panel_applet);
+ configure_interface_names(xfce_plugin);
// Debug code
/* std::cout << "get_interface_name called for " << interface_type_to_string(type,
diff --git a/src/monitor-impls.hpp b/src/monitor-impls.hpp
index 2c17ff7..d461879 100644
--- a/src/monitor-impls.hpp
+++ b/src/monitor-impls.hpp
@@ -245,7 +245,7 @@ public:
NetworkLoadMonitor(InterfaceType &interface_type,
Direction direction, const Glib::ustring &tag_string,
- XfcePanelPlugin *panel_applet);
+ XfcePanelPlugin *xfce_plugin);
virtual double max();
virtual bool fixed_max();
@@ -260,9 +260,9 @@ public:
/* Allow to maintain list of interface names separate to individual monitor
* objects
* configure_interface_names needs to read and possibly write the configuration
- * file hence takes an applet pointer */
+ * file hence takes an XFCE4 plugin pointer */
static Glib::ustring get_interface_name(InterfaceType type,
- XfcePanelPlugin *panel_applet);
+ XfcePanelPlugin *xfce_plugin);
static Glib::ustring get_default_interface_name(InterfaceType type);
static void set_interface_name(InterfaceType type,
const Glib::ustring interface_name);
@@ -283,10 +283,10 @@ private:
// Can't initialise a static vector properly so trying this
static std::vector<Glib::ustring> initialise_default_interface_names();
- static void configure_interface_names(XfcePanelPlugin *panel_applet);
+ static void configure_interface_names(XfcePanelPlugin *xfce_plugin);
- XfcePanelPlugin *pnl_applet; // Needed to allow do_measure to call
- // get_interface_name(*panel_applet)
+ XfcePanelPlugin *xfce_plugin; // Needed to allow do_measure to call
+ // get_interface_name(xfce_plugin)
guint64 max_value; // maximum measured capacity of line
long int time_difference; // no. of msecs. between the last two calls
diff --git a/src/monitor.hpp b/src/monitor.hpp
index fe6e324..eaa5cd5 100644
--- a/src/monitor.hpp
+++ b/src/monitor.hpp
@@ -128,7 +128,7 @@ typedef monitor_seq::iterator monitor_iter;
/* Forward declaration for load_monitors - including the panel header at the top
* causes glibmm/object.h to complain that X11/Xlib.h has been included ahead
- * of it?? Why is the include tolerated in applet.hpp then? */
+ * of it?? Why is the include tolerated in plugin.hpp then? */
typedef struct _XfcePanelPlugin XfcePanelPlugin;
monitor_seq load_monitors(XfceRc *settings_ro, XfcePanelPlugin *panel_plugin);
diff --git a/src/preferences-window.cpp b/src/preferences-window.cpp
index 1956b4f..8b4dc7f 100644
--- a/src/preferences-window.cpp
+++ b/src/preferences-window.cpp
@@ -31,7 +31,7 @@
#include "preferences-window.hpp"
#include "choose-monitor-window.hpp"
#include "gui-helpers.hpp"
-#include "applet.hpp"
+#include "plugin.hpp"
#include "monitor.hpp"
#include "curve-view.hpp"
#include "i18n.hpp"
@@ -45,8 +45,8 @@ void PreferencesWindow::connect_monitor_colorbutton(Gtk::ColorButton
colorbutton));
}
-PreferencesWindow::PreferencesWindow(Applet &applet_, monitor_seq monitors)
- : applet(applet_)
+PreferencesWindow::PreferencesWindow(Plugin &plugin_, monitor_seq monitors)
+ : plugin(plugin_)
{
// Now we are forced to use top-level widgets this is much more over the top...
std::vector<Glib::ustring> objects(2);
@@ -56,7 +56,7 @@ PreferencesWindow::PreferencesWindow(Applet &applet_, monitor_seq monitors)
ui->get_widget("preferences_window", window);
window->set_type_hint(Gdk::WINDOW_TYPE_HINT_DIALOG);
- window->set_icon(applet.get_icon());
+ window->set_icon(plugin.get_icon());
// Connect the Viewer tab widgets
@@ -225,20 +225,20 @@ PreferencesWindow::PreferencesWindow(Applet &applet_, monitor_seq monitors)
link_button->set_relief(Gtk::RELIEF_NORMAL);
// Fill in values
- viewer_type_listener(applet.get_viewer_type(), true);
- background_color_listener(applet.get_background_color());
- use_background_color_listener(applet.get_use_background_color());
- size_listener(applet.get_viewer_size());
- font_listener(font_checkbutton, fontbutton, applet.get_viewer_font());
- if (applet.get_viewer_text_overlay_enabled())
+ viewer_type_listener(plugin.get_viewer_type(), true);
+ background_color_listener(plugin.get_background_color());
+ use_background_color_listener(plugin.get_use_background_color());
+ size_listener(plugin.get_viewer_size());
+ font_listener(font_checkbutton, fontbutton, plugin.get_viewer_font());
+ if (plugin.get_viewer_text_overlay_enabled())
text_overlay_checkbutton->set_active();
text_overlay_format_string_entry->
- set_text(applet.get_viewer_text_overlay_format_string());
+ set_text(plugin.get_viewer_text_overlay_format_string());
text_overlay_separator_entry->
- set_text(applet.get_viewer_text_overlay_separator());
+ set_text(plugin.get_viewer_text_overlay_separator());
font_listener(text_overlay_font_checkbutton, text_overlay_fontbutton,
- applet.get_viewer_text_overlay_font());
- text_overlay_color_listener(applet.get_viewer_text_overlay_color());
+ plugin.get_viewer_text_overlay_font());
+ text_overlay_color_listener(plugin.get_viewer_text_overlay_color());
for (monitor_iter i = monitors.begin(), end = monitors.end();
i != end; ++i)
@@ -250,7 +250,7 @@ PreferencesWindow::PreferencesWindow(Applet &applet_, monitor_seq monitors)
// Populating text overlay position combobox and selecting the correct position
CurveView::TextOverlayPosition current_pos, position =
- applet.get_viewer_text_overlay_position();
+ plugin.get_viewer_text_overlay_position();
store_iter i;
for (int r = 0; r < CurveView::NUM_TEXT_OVERLAY_POSITIONS; ++r)
{
@@ -364,7 +364,7 @@ void PreferencesWindow::viewer_type_listener(const Glib::ustring viewer_type,
/* Actually changing the viewer type - background color use etc is set
* separately */
- applet.viewer_type_listener(viewer_type);
+ plugin.viewer_type_listener(viewer_type);
}
void PreferencesWindow::background_color_listener(unsigned int background_color)
@@ -377,7 +377,7 @@ void PreferencesWindow::background_color_listener(unsigned int background_color)
update_colorbutton_if_different(background_colorbutton, r, g, b, a);
// Actually updating the background color
- applet.background_color_listener(background_color);
+ plugin.background_color_listener(background_color);
}
void PreferencesWindow::use_background_color_listener(bool use_background_color)
@@ -388,7 +388,7 @@ void PreferencesWindow::use_background_color_listener(bool use_background_color)
panel_background_radiobutton->set_active();
// Actually updating the background color usage state
- applet.use_background_color_listener(use_background_color);
+ plugin.use_background_color_listener(use_background_color);
}
void PreferencesWindow::size_listener(int viewer_size)
@@ -397,7 +397,7 @@ void PreferencesWindow::size_listener(int viewer_size)
size_scale->set_value(pixels_to_size_scale(viewer_size));
// Actually change the size...
- applet.set_viewer_size(viewer_size);
+ plugin.set_viewer_size(viewer_size);
}
// This works with more than one font button now
@@ -442,7 +442,7 @@ void PreferencesWindow::text_overlay_color_listener(unsigned int color)
update_colorbutton_if_different(text_overlay_colorbutton, r, g, b, a);
// Actually updating the text overlay color
- applet.set_viewer_text_overlay_color(color);
+ plugin.set_viewer_text_overlay_color(color);
}
@@ -480,7 +480,7 @@ void PreferencesWindow::sync_conf_with_colorbutton(Glib::ustring settings_dir,
{
// Search for a writeable settings file, create one if it doesnt exist
- gchar* file = xfce_panel_plugin_save_location(applet.panel_applet, true);
+ gchar* file = xfce_panel_plugin_save_location(plugin.xfce_plugin, true);
if (file)
{
@@ -519,7 +519,7 @@ void PreferencesWindow::on_background_colorbutton_set()
background_colorbutton);
// Actually apply the color change
- applet.background_color_listener(
+ plugin.background_color_listener(
get_colorbutton_int(background_colorbutton));
}
@@ -531,7 +531,7 @@ void PreferencesWindow::on_background_color_radiobutton_toggled()
use_background_color_listener(on);
// Search for a writeable settings file, create one if it doesnt exist
- gchar* file = xfce_panel_plugin_save_location(applet.panel_applet, true);
+ gchar* file = xfce_panel_plugin_save_location(plugin.xfce_plugin, true);
if (file)
{
@@ -564,7 +564,7 @@ void PreferencesWindow::on_curve_radiobutton_toggled()
if (active)
{
// Search for a writeable settings file, create one if it doesnt exist
- gchar* file = xfce_panel_plugin_save_location(applet.panel_applet, true);
+ gchar* file = xfce_panel_plugin_save_location(plugin.xfce_plugin, true);
if (file)
{
@@ -601,7 +601,7 @@ void PreferencesWindow::on_bar_radiobutton_toggled()
if (active)
{
// Search for a writeable settings file, create one if it doesnt exist
- gchar* file = xfce_panel_plugin_save_location(applet.panel_applet, true);
+ gchar* file = xfce_panel_plugin_save_location(plugin.xfce_plugin, true);
if (file)
{
@@ -638,7 +638,7 @@ void PreferencesWindow::on_vbar_radiobutton_toggled()
if (active)
{
// Search for a writeable settings file, create one if it doesnt exist
- gchar* file = xfce_panel_plugin_save_location(applet.panel_applet, true);
+ gchar* file = xfce_panel_plugin_save_location(plugin.xfce_plugin, true);
if (file)
{
@@ -675,7 +675,7 @@ void PreferencesWindow::on_column_radiobutton_toggled()
if (active)
{
// Search for a writeable settings file, create one if it doesnt exist
- gchar* file = xfce_panel_plugin_save_location(applet.panel_applet, true);
+ gchar* file = xfce_panel_plugin_save_location(plugin.xfce_plugin, true);
if (file)
{
@@ -712,7 +712,7 @@ void PreferencesWindow::on_text_radiobutton_toggled()
if (active)
{
// Search for a writeable settings file, create one if it doesnt exist
- gchar* file = xfce_panel_plugin_save_location(applet.panel_applet, true);
+ gchar* file = xfce_panel_plugin_save_location(plugin.xfce_plugin, true);
if (file)
{
@@ -749,7 +749,7 @@ void PreferencesWindow::on_flame_radiobutton_toggled()
if (active)
{
// Search for a writeable settings file, create one if it doesnt exist
- gchar* file = xfce_panel_plugin_save_location(applet.panel_applet, true);
+ gchar* file = xfce_panel_plugin_save_location(plugin.xfce_plugin, true);
if (file)
{
@@ -790,7 +790,7 @@ void PreferencesWindow::on_size_scale_changed()
/* Saving pixel value of scale
* Search for a writeable settings file, create one if it doesnt exist */
- gchar* file = xfce_panel_plugin_save_location(applet.panel_applet, true);
+ gchar* file = xfce_panel_plugin_save_location(plugin.xfce_plugin, true);
if (file)
{
@@ -902,7 +902,7 @@ void PreferencesWindow::on_text_overlay_colorbutton_set()
text_overlay_colorbutton);
// Actually apply the color change
- applet.set_viewer_text_overlay_color(
+ plugin.set_viewer_text_overlay_color(
get_colorbutton_int(text_overlay_colorbutton));
}
@@ -910,11 +910,11 @@ void PreferencesWindow::on_text_overlay_position_combobox_changed()
{
int position = text_overlay_position_combobox->get_active_row_number();
- applet.set_viewer_text_overlay_position(
+ plugin.set_viewer_text_overlay_position(
static_cast<CurveView::TextOverlayPosition>(position));
// Search for a writeable settings file, create one if it doesnt exist */
- gchar* file = xfce_panel_plugin_save_location(applet.panel_applet, true);
+ gchar* file = xfce_panel_plugin_save_location(plugin.xfce_plugin, true);
if (file)
{
@@ -946,7 +946,7 @@ void PreferencesWindow::on_add_button_clicked()
Monitor *monitor = run_choose_monitor_window(Glib::ustring());
if (monitor) {
- applet.add_monitor(monitor);
+ plugin.add_monitor(monitor);
add_to_monitors_list(monitor);
}
}
@@ -960,7 +960,7 @@ void PreferencesWindow::on_remove_button_clicked()
if (i) {
Monitor *mon = (*i)[mc.monitor];
monitor_store->erase(i);
- applet.remove_monitor(mon);
+ plugin.remove_monitor(mon);
}
}
@@ -976,7 +976,7 @@ void PreferencesWindow::on_change_button_clicked()
= run_choose_monitor_window(prev_monitor->get_settings_dir());
if (new_monitor) {
- applet.replace_monitor(prev_monitor, new_monitor);
+ plugin.replace_monitor(prev_monitor, new_monitor);
(*i)[mc.name] = new_monitor->get_name();
(*i)[mc.monitor] = new_monitor;
@@ -1008,7 +1008,7 @@ void PreferencesWindow::on_selection_changed()
Glib::ustring mon_dir = (*(*i)[mc.monitor]).get_settings_dir();
// Search for settings file
- gchar* file = xfce_panel_plugin_lookup_rc_file(applet.panel_applet);
+ gchar* file = xfce_panel_plugin_lookup_rc_file(plugin.xfce_plugin);
if (file)
{
@@ -1061,7 +1061,7 @@ bool PreferencesWindow::on_closed(GdkEventAny *)
Monitor *PreferencesWindow::run_choose_monitor_window(const Glib::ustring &str)
{
- ChooseMonitorWindow chooser(applet.panel_applet, *window);
+ ChooseMonitorWindow chooser(plugin.xfce_plugin, *window);
return chooser.run(str);
}
@@ -1108,10 +1108,10 @@ int PreferencesWindow::pixels_to_size_scale(int pixels)
void PreferencesWindow::save_font_details(Glib::ustring font_details)
{
- applet.set_viewer_font(font_details);
+ plugin.set_viewer_font(font_details);
// Search for a writeable settings file, create one if it doesnt exist */
- gchar* file = xfce_panel_plugin_save_location(applet.panel_applet, true);
+ gchar* file = xfce_panel_plugin_save_location(plugin.xfce_plugin, true);
if (file)
{
@@ -1138,10 +1138,10 @@ void PreferencesWindow::save_font_details(Glib::ustring font_details)
void PreferencesWindow::save_text_overlay_font_details(Glib::ustring font_details)
{
- applet.set_viewer_text_overlay_font(font_details);
+ plugin.set_viewer_text_overlay_font(font_details);
// Search for a writeable settings file, create one if it doesnt exist */
- gchar* file = xfce_panel_plugin_save_location(applet.panel_applet, true);
+ gchar* file = xfce_panel_plugin_save_location(plugin.xfce_plugin, true);
if (file)
{
@@ -1169,10 +1169,10 @@ void PreferencesWindow::save_text_overlay_font_details(Glib::ustring font_detail
void PreferencesWindow::save_text_overlay_enabled(bool enabled)
{
- applet.set_viewer_text_overlay_enabled(enabled);
+ plugin.set_viewer_text_overlay_enabled(enabled);
// Search for a writeable settings file, create one if it doesnt exist */
- gchar* file = xfce_panel_plugin_save_location(applet.panel_applet, true);
+ gchar* file = xfce_panel_plugin_save_location(plugin.xfce_plugin, true);
if (file)
{
@@ -1199,10 +1199,10 @@ void PreferencesWindow::save_text_overlay_enabled(bool enabled)
void PreferencesWindow::save_text_overlay_format_string(const Glib::ustring format_string)
{
- applet.set_viewer_text_overlay_format_string(format_string);
+ plugin.set_viewer_text_overlay_format_string(format_string);
// Search for a writeable settings file, create one if it doesnt exist */
- gchar* file = xfce_panel_plugin_save_location(applet.panel_applet, true);
+ gchar* file = xfce_panel_plugin_save_location(plugin.xfce_plugin, true);
if (file)
{
@@ -1231,10 +1231,10 @@ void PreferencesWindow::save_text_overlay_format_string(const Glib::ustring form
void PreferencesWindow::save_text_overlay_separator(const Glib::ustring separator)
{
- applet.set_viewer_text_overlay_separator(separator);
+ plugin.set_viewer_text_overlay_separator(separator);
// Search for a writeable settings file, create one if it doesnt exist */
- gchar* file = xfce_panel_plugin_save_location(applet.panel_applet, true);
+ gchar* file = xfce_panel_plugin_save_location(plugin.xfce_plugin, true);
if (file)
{
diff --git a/src/preferences-window.hpp b/src/preferences-window.hpp
index 294e1f6..79de055 100644
--- a/src/preferences-window.hpp
+++ b/src/preferences-window.hpp
@@ -44,12 +44,12 @@
#include "monitor.hpp"
-class Applet;
+class Plugin;
class PreferencesWindow: public sigc::trackable
{
public:
- PreferencesWindow(Applet &applet, monitor_seq monitors);
+ PreferencesWindow(Plugin &plugin, monitor_seq monitors);
~PreferencesWindow();
void show();
@@ -168,7 +168,7 @@ private:
void save_text_overlay_format_string(const Glib::ustring format_string);
void save_text_overlay_separator(const Glib::ustring separator);
- Applet &applet;
+ Plugin &plugin;
};
#endif
diff --git a/src/register_plugin.c b/src/register_plugin.c
index 9d181bf..8f7832b 100644
--- a/src/register_plugin.c
+++ b/src/register_plugin.c
@@ -20,10 +20,10 @@
#include <libxfce4panel/xfce-panel-plugin.h>
/* It looks like plugin registration MUST happen in a pure C file - doing
- * this in a C linkage block in applet.cpp is not good enough. Because
+ * this in a C linkage block in plugin.cpp is not good enough. Because
* of this, AC_PROG_CC must be present in configure.ac as well */
-extern void applet_construct(XfcePanelPlugin* plugin);
+extern void plugin_construct(XfcePanelPlugin* xfce_plugin);
-/* 'Registering' the applet - in reality this substitutes into a load
+/* 'Registering' the plugin - in reality this substitutes into a load
* of functions including a main */
-XFCE_PANEL_PLUGIN_REGISTER(applet_construct)
+XFCE_PANEL_PLUGIN_REGISTER(plugin_construct)
diff --git a/src/text-view.cpp b/src/text-view.cpp
index 1caf32a..be836a6 100644
--- a/src/text-view.cpp
+++ b/src/text-view.cpp
@@ -30,7 +30,7 @@
#include "text-view.hpp"
#include "monitor.hpp"
-#include "applet.hpp"
+#include "plugin.hpp"
#include "ucompose.hpp"
#include "i18n.hpp"
@@ -92,7 +92,7 @@ TextView::TextView()
void TextView::do_display()
{
background_box.add(table);
- applet->get_container().add(background_box);
+ plugin->get_container().add(background_box);
table.show();
background_box.show();
@@ -102,7 +102,7 @@ void TextView::do_update()
{
// Update
for (text_iterator i = texts.begin(), end = texts.end(); i != end; ++i)
- (*i)->update(applet->get_viewer_font());
+ (*i)->update(plugin->get_viewer_font());
}
void TextView::do_attach(Monitor *monitor)
diff --git a/src/value-history.cpp b/src/value-history.cpp
index 33b72e9..4a696a6 100644
--- a/src/value-history.cpp
+++ b/src/value-history.cpp
@@ -24,13 +24,13 @@
#include "value-history.hpp"
#include "monitor.hpp"
-#include "applet.hpp"
+#include "plugin.hpp"
ValueHistory::ValueHistory(Monitor *mon)
: monitor(mon), max_value(0), waits_remaining(0)
{
- wait_iterations = monitor->update_interval() / Applet::update_interval;
+ wait_iterations = monitor->update_interval() / Plugin::update_interval;
}
double ValueHistory::get_max_value()
diff --git a/src/view.cpp b/src/view.cpp
index 0a54a49..b685d38 100644
--- a/src/view.cpp
+++ b/src/view.cpp
@@ -30,9 +30,9 @@ View::View::~View()
{
}
-void View::display(Applet &a)
+void View::display(Plugin &a)
{
- applet = &a;
+ plugin = &a;
do_display();
}
diff --git a/src/view.hpp b/src/view.hpp
index 1847b7b..acc31a7 100644
--- a/src/view.hpp
+++ b/src/view.hpp
@@ -31,17 +31,17 @@
#include "helpers.hpp"
-class Applet;
+class Plugin;
class Monitor;
-// something that can show something in an applet widget
+// Something that can show something in an plugin widget
class View: noncopyable
{
public:
View(bool keeps_history);
virtual ~View();
- void display(Applet &applet);
+ void display(Plugin &plugin);
void update();
void attach(Monitor *monitor);
void detach(Monitor *monitor);
@@ -52,7 +52,7 @@ public:
bool const keeps_history;
protected:
- Applet *applet; // store pointer for reference
+ Plugin *plugin; // store pointer for reference
private:
// for derived classes to override
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list