| 1 |
#ifndef _GSM_PRETTY_TABLE_H_ |
| 2 |
#define _GSM_PRETTY_TABLE_H_ |
| 3 |
|
| 4 |
#include <glib.h> |
| 5 |
#include <gio/gio.h> |
| 6 |
#include <giomm.h> |
| 7 |
#include <glibmm/refptr.h> |
| 8 |
#include <giomm/filemonitor.h> |
| 9 |
#include <gdkmm/texture.h> |
| 10 |
|
| 11 |
#include <map> |
| 12 |
#include <string> |
| 13 |
|
| 14 |
class ProcInfo; |
| 15 |
|
| 16 |
using std::string; |
| 17 |
|
| 18 |
class PrettyTable |
| 19 |
{ |
| 20 |
public: |
| 21 |
PrettyTable(); |
| 22 |
~PrettyTable(); |
| 23 |
|
| 24 |
void set_icon (ProcInfo &); |
| 25 |
|
| 26 |
private: |
| 27 |
Glib::RefPtr<Gdk::Texture> get_icon_from_theme (const ProcInfo &); |
| 28 |
Glib::RefPtr<Gdk::Texture> get_icon_from_default (const ProcInfo &); |
| 29 |
Glib::RefPtr<Gdk::Texture> get_icon_from_gio (const ProcInfo &); |
| 30 |
Glib::RefPtr<Gdk::Texture> get_icon_from_name (const ProcInfo &); |
| 31 |
Glib::RefPtr<Gdk::Texture> get_icon_for_kernel (const ProcInfo &); |
| 32 |
Glib::RefPtr<Gdk::Texture> get_icon_dummy (const ProcInfo &); |
| 33 |
|
| 34 |
bool get_default_icon_name (const string &cmd, |
| 35 |
string & name); |
| 36 |
void file_monitor_event (Glib::RefPtr<Gio::File>, |
| 37 |
Glib::RefPtr<Gio::File>, |
| 38 |
Gio::FileMonitor::Event); |
| 39 |
void init_gio_app_cache (); |
| 40 |
|
| 41 |
typedef std::map<string, Glib::RefPtr<Gdk::Texture> > IconCache; |
| 42 |
typedef std::map<pid_t, Glib::RefPtr<Gdk::Texture> > IconsForPID; |
| 43 |
typedef std::map<string, Glib::RefPtr<Gio::AppInfo> > AppCache; |
| 44 |
typedef std::map<string, Glib::RefPtr<Gio::FileMonitor> > DesktopDirMonitors; |
| 45 |
|
| 46 |
IconsForPID apps; |
| 47 |
IconCache defaults; |
| 48 |
DesktopDirMonitors monitors; |
| 49 |
AppCache gio_apps; |
| 50 |
}; |
| 51 |
|
| 52 |
#endif |