diff options
author | Stefano Karapetsas <[email protected]> | 2012-06-14 22:27:13 +0200 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2012-06-14 22:27:13 +0200 |
commit | 3fa35a8281ee5088b7e2222b683e5d9191cfd902 (patch) | |
tree | aee88f099ca51514a19a21303bfecefb9a4fe4ef /src | |
parent | 6f24d86e80d059e7d050eae400441029c0e34e59 (diff) | |
download | mate-system-monitor-3fa35a8281ee5088b7e2222b683e5d9191cfd902.tar.bz2 mate-system-monitor-3fa35a8281ee5088b7e2222b683e5d9191cfd902.tar.xz |
port to libmatewnck
Diffstat (limited to 'src')
-rw-r--r-- | src/prettytable.cpp | 23 | ||||
-rw-r--r-- | src/prettytable.h | 9 | ||||
-rw-r--r-- | src/procman.h | 2 | ||||
-rw-r--r-- | src/proctable.cpp | 4 |
4 files changed, 18 insertions, 20 deletions
diff --git a/src/prettytable.cpp b/src/prettytable.cpp index 25f6625..a3c3947 100644 --- a/src/prettytable.cpp +++ b/src/prettytable.cpp @@ -1,6 +1,5 @@ #include <config.h> -#define WNCK_I_KNOW_THIS_IS_UNSTABLE -#include <libwnck/libwnck.h> +#include <libmatewnck/libmatewnck.h> #include <dirent.h> #include <sys/stat.h> #include <stdio.h> @@ -24,7 +23,7 @@ namespace PrettyTable::PrettyTable() { - WnckScreen* screen = wnck_screen_get_default(); + MatewnckScreen* screen = matewnck_screen_get_default(); g_signal_connect(G_OBJECT(screen), "application_opened", G_CALLBACK(PrettyTable::on_application_opened), this); g_signal_connect(G_OBJECT(screen), "application_closed", @@ -38,16 +37,16 @@ PrettyTable::~PrettyTable() void -PrettyTable::on_application_opened(WnckScreen* screen, WnckApplication* app, gpointer data) +PrettyTable::on_application_opened(MatewnckScreen* screen, MatewnckApplication* app, gpointer data) { PrettyTable * const that = static_cast<PrettyTable*>(data); - pid_t pid = wnck_application_get_pid(app); + pid_t pid = matewnck_application_get_pid(app); if (pid == 0) return; - const char* icon_name = wnck_application_get_icon_name(app); + const char* icon_name = matewnck_application_get_icon_name(app); Glib::RefPtr<Gdk::Pixbuf> icon; @@ -55,7 +54,7 @@ PrettyTable::on_application_opened(WnckScreen* screen, WnckApplication* app, gpo icon = that->theme->load_icon(icon_name, APP_ICON_SIZE, Gtk::ICON_LOOKUP_USE_BUILTIN); if (not icon) { - icon = Glib::wrap(wnck_application_get_icon(app), /* take_copy */ true); + icon = Glib::wrap(matewnck_application_get_icon(app), /* take_copy */ true); icon = icon->scale_simple(APP_ICON_SIZE, APP_ICON_SIZE, Gdk::INTERP_HYPER); } @@ -77,16 +76,16 @@ PrettyTable::register_application(pid_t pid, Glib::RefPtr<Gdk::Pixbuf> icon) info->set_icon(icon); // move the ref to the map this->apps[pid] = icon; - procman_debug("WNCK OK for %u", unsigned(pid)); + procman_debug("MATEWNCK OK for %u", unsigned(pid)); } } void -PrettyTable::on_application_closed(WnckScreen* screen, WnckApplication* app, gpointer data) +PrettyTable::on_application_closed(MatewnckScreen* screen, MatewnckApplication* app, gpointer data) { - pid_t pid = wnck_application_get_pid(app); + pid_t pid = matewnck_application_get_pid(app); if (pid == 0) return; @@ -156,7 +155,7 @@ PrettyTable::get_icon_from_default(const ProcInfo &info) Glib::RefPtr<Gdk::Pixbuf> -PrettyTable::get_icon_from_wnck(const ProcInfo &info) +PrettyTable::get_icon_from_matewnck(const ProcInfo &info) { Glib::RefPtr<Gdk::Pixbuf> icon; @@ -223,7 +222,7 @@ PrettyTable::set_icon(ProcInfo &info) if (getters.empty()) { - getters.push_back(&PrettyTable::get_icon_from_wnck); + getters.push_back(&PrettyTable::get_icon_from_matewnck); getters.push_back(&PrettyTable::get_icon_from_theme); getters.push_back(&PrettyTable::get_icon_from_default); getters.push_back(&PrettyTable::get_icon_from_name); diff --git a/src/prettytable.h b/src/prettytable.h index 7884cdd..bfb45f5 100644 --- a/src/prettytable.h +++ b/src/prettytable.h @@ -12,8 +12,7 @@ #include <string> extern "C" { -#define WNCK_I_KNOW_THIS_IS_UNSTABLE -#include <libwnck/libwnck.h> +#include <libmatewnck/libmatewnck.h> } #include "iconthemewrapper.h" @@ -34,8 +33,8 @@ class PrettyTable private: - static void on_application_opened(WnckScreen* screen, WnckApplication* app, gpointer data); - static void on_application_closed(WnckScreen* screen, WnckApplication* app, gpointer data); + static void on_application_opened(MatewnckScreen* screen, MatewnckApplication* app, gpointer data); + static void on_application_closed(MatewnckScreen* screen, MatewnckApplication* app, gpointer data); void register_application(pid_t pid, Glib::RefPtr<Gdk::Pixbuf> icon); void unregister_application(pid_t pid); @@ -43,7 +42,7 @@ private: Glib::RefPtr<Gdk::Pixbuf> get_icon_from_theme(const ProcInfo &); Glib::RefPtr<Gdk::Pixbuf> get_icon_from_default(const ProcInfo &); - Glib::RefPtr<Gdk::Pixbuf> get_icon_from_wnck(const ProcInfo &); + Glib::RefPtr<Gdk::Pixbuf> get_icon_from_matewnck(const ProcInfo &); Glib::RefPtr<Gdk::Pixbuf> get_icon_from_name(const ProcInfo &); Glib::RefPtr<Gdk::Pixbuf> get_icon_for_kernel(const ProcInfo &); Glib::RefPtr<Gdk::Pixbuf> get_icon_dummy(const ProcInfo &); diff --git a/src/procman.h b/src/procman.h index 76c998f..feb1b4a 100644 --- a/src/procman.h +++ b/src/procman.h @@ -114,7 +114,7 @@ struct MutableProcInfo gulong memwritable; gulong mem; - // wnck gives an unsigned long + // matewnck gives an unsigned long gulong memxserver; gulong start_time; diff --git a/src/proctable.cpp b/src/proctable.cpp index 7f192b2..5a8cd7b 100644 --- a/src/proctable.cpp +++ b/src/proctable.cpp @@ -512,9 +512,9 @@ static void get_process_memory_info(ProcInfo *info) { glibtop_proc_mem procmem; - WnckResourceUsage xresources; + MatewnckResourceUsage xresources; - wnck_pid_read_resource_usage (gdk_screen_get_display (gdk_screen_get_default ()), + matewnck_pid_read_resource_usage (gdk_screen_get_display (gdk_screen_get_default ()), info->pid, &xresources); |