summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2013-10-08 02:15:47 -0700
committerStefano Karapetsas <[email protected]>2013-10-08 02:15:47 -0700
commit84ae373c1c412eb260fcfdaf57be7ddf4942d310 (patch)
tree89f123a23715430462a055868061ee8ed42fb340
parent82314dfe634a141792a4b274bebb63901730bf98 (diff)
parent01999fa43ecc9a5a1432cbbee0e69925e1d8c1fb (diff)
downloadmate-system-monitor-84ae373c1c412eb260fcfdaf57be7ddf4942d310.tar.bz2
mate-system-monitor-84ae373c1c412eb260fcfdaf57be7ddf4942d310.tar.xz
Merge pull request #24 from infirit/master
back to libwnck
-rw-r--r--configure.ac4
-rw-r--r--src/prettytable.cpp21
-rw-r--r--src/prettytable.h9
-rw-r--r--src/procman.h2
-rw-r--r--src/proctable.cpp4
5 files changed, 21 insertions, 19 deletions
diff --git a/configure.ac b/configure.ac
index 9291a09..07f7105 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,7 +24,7 @@ AC_HEADER_STDC
MATE_COMPILE_WARNINGS
GLIB_REQUIRED=2.28.0
-LIBMATEWNCK_REQUIRED=1.3.0
+LIBWNCK_REQUIRED=2.5.0
LIBGTOP_REQUIRED=2.23.1
GTK_REQUIRED=2.20.0
MATE_ICON_THEME_REQUIRED=1.1.0
@@ -36,7 +36,7 @@ RSVG_REQUIRED=2.12
DBUS_REQUIRED=0.7
PKG_CHECK_MODULES(GMODULE,gmodule-2.0,[GMODULE_ADD="gmodule-2.0"],[GMODULE_ADD=""])
-PKG_CHECK_MODULES(PROCMAN,$GMODULE_ADD glib-2.0 >= $GLIB_REQUIRED libgtop-2.0 >= $LIBGTOP_REQUIRED libmatewnck >= $LIBMATEWNCK_REQUIRED gtk+-2.0 >= $GTK_REQUIRED mate-icon-theme >= $MATE_ICON_THEME_REQUIRED gtkmm-2.4 >= $GTKMM_REQUIRED libxml-2.0 >= $LIBXML_REQUIRED librsvg-2.0 >= $RSVG_REQUIRED glibmm-2.4 >= $GLIBMM_REQUIRED giomm-2.4 >= $GIOMM_REQUIRED dbus-glib-1 >= $DBUS_REQUIRED)
+PKG_CHECK_MODULES(PROCMAN,$GMODULE_ADD glib-2.0 >= $GLIB_REQUIRED libgtop-2.0 >= $LIBGTOP_REQUIRED libwnck-1.0 >= $LIBWNCK_REQUIRED gtk+-2.0 >= $GTK_REQUIRED mate-icon-theme >= $MATE_ICON_THEME_REQUIRED gtkmm-2.4 >= $GTKMM_REQUIRED libxml-2.0 >= $LIBXML_REQUIRED librsvg-2.0 >= $RSVG_REQUIRED glibmm-2.4 >= $GLIBMM_REQUIRED giomm-2.4 >= $GIOMM_REQUIRED dbus-glib-1 >= $DBUS_REQUIRED)
AC_ARG_ENABLE(more-warnings,
diff --git a/src/prettytable.cpp b/src/prettytable.cpp
index 4a9b922..604ce09 100644
--- a/src/prettytable.cpp
+++ b/src/prettytable.cpp
@@ -1,5 +1,6 @@
#include <config.h>
-#include <libmatewnck/libmatewnck.h>
+#define WNCK_I_KNOW_THIS_IS_UNSTABLE
+#include <libwnck/libwnck.h>
#include <dirent.h>
#include <sys/stat.h>
#include <stdio.h>
@@ -23,7 +24,7 @@ namespace
PrettyTable::PrettyTable()
{
- MatewnckScreen* screen = matewnck_screen_get_default();
+ WnckScreen* screen = wnck_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",
@@ -37,17 +38,17 @@ PrettyTable::~PrettyTable()
void
-PrettyTable::on_application_opened(MatewnckScreen* screen, MatewnckApplication* app, gpointer data)
+PrettyTable::on_application_opened(WnckScreen* screen, WnckApplication* app, gpointer data)
{
PrettyTable * const that = static_cast<PrettyTable*>(data);
FILE *f;
- pid_t pid = matewnck_application_get_pid(app);
+ pid_t pid = wnck_application_get_pid(app);
if (pid == 0)
return;
- const char* icon_name = matewnck_application_get_icon_name(app);
+ const char* icon_name = wnck_application_get_icon_name(app);
Glib::RefPtr<Gdk::Pixbuf> icon;
@@ -60,7 +61,7 @@ PrettyTable::on_application_opened(MatewnckScreen* screen, MatewnckApplication*
}
if (not icon) {
- icon = Glib::wrap(matewnck_application_get_icon(app), /* take_copy */ true);
+ icon = Glib::wrap(wnck_application_get_icon(app), /* take_copy */ true);
icon = icon->scale_simple(APP_ICON_SIZE, APP_ICON_SIZE, Gdk::INTERP_HYPER);
}
@@ -89,9 +90,9 @@ PrettyTable::register_application(pid_t pid, Glib::RefPtr<Gdk::Pixbuf> icon)
void
-PrettyTable::on_application_closed(MatewnckScreen* screen, MatewnckApplication* app, gpointer data)
+PrettyTable::on_application_closed(WnckScreen* screen, WnckApplication* app, gpointer data)
{
- pid_t pid = matewnck_application_get_pid(app);
+ pid_t pid = wnck_application_get_pid(app);
if (pid == 0)
return;
@@ -161,7 +162,7 @@ PrettyTable::get_icon_from_default(const ProcInfo &info)
Glib::RefPtr<Gdk::Pixbuf>
-PrettyTable::get_icon_from_matewnck(const ProcInfo &info)
+PrettyTable::get_icon_from_wnck(const ProcInfo &info)
{
Glib::RefPtr<Gdk::Pixbuf> icon;
@@ -228,7 +229,7 @@ PrettyTable::set_icon(ProcInfo &info)
if (getters.empty())
{
- getters.push_back(&PrettyTable::get_icon_from_matewnck);
+ getters.push_back(&PrettyTable::get_icon_from_wnck);
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 bfb45f5..7884cdd 100644
--- a/src/prettytable.h
+++ b/src/prettytable.h
@@ -12,7 +12,8 @@
#include <string>
extern "C" {
-#include <libmatewnck/libmatewnck.h>
+#define WNCK_I_KNOW_THIS_IS_UNSTABLE
+#include <libwnck/libwnck.h>
}
#include "iconthemewrapper.h"
@@ -33,8 +34,8 @@ class PrettyTable
private:
- static void on_application_opened(MatewnckScreen* screen, MatewnckApplication* app, gpointer data);
- static void on_application_closed(MatewnckScreen* screen, MatewnckApplication* app, gpointer data);
+ static void on_application_opened(WnckScreen* screen, WnckApplication* app, gpointer data);
+ static void on_application_closed(WnckScreen* screen, WnckApplication* app, gpointer data);
void register_application(pid_t pid, Glib::RefPtr<Gdk::Pixbuf> icon);
void unregister_application(pid_t pid);
@@ -42,7 +43,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_matewnck(const ProcInfo &);
+ Glib::RefPtr<Gdk::Pixbuf> get_icon_from_wnck(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 c71cff2..b838fc2 100644
--- a/src/procman.h
+++ b/src/procman.h
@@ -116,7 +116,7 @@ struct MutableProcInfo
gulong memwritable;
gulong mem;
- // matewnck gives an unsigned long
+ // wnck gives an unsigned long
gulong memxserver;
gulong start_time;
diff --git a/src/proctable.cpp b/src/proctable.cpp
index 3a0a129..ee018bd 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;
- MatewnckResourceUsage xresources;
+ WnckResourceUsage xresources;
- matewnck_pid_read_resource_usage (gdk_screen_get_display (gdk_screen_get_default ()),
+ wnck_pid_read_resource_usage (gdk_screen_get_display (gdk_screen_get_default ()),
info->pid,
&xresources);