evisum/src/bin/ui/ui.h

138 lines
2.4 KiB
C
Raw Normal View History

2020-04-14 10:24:27 -07:00
#ifndef __UI_H__
2018-06-04 03:11:21 -07:00
#define __UI_H__
#include <Elementary.h>
2020-04-23 04:28:07 -07:00
#include "gettext.h"
#include "system/machine.h"
#include "system/process.h"
#include "../evisum_config.h"
#include "../evisum_server.h"
#include "ui/ui_util.h"
#include "ui/ui_cache.h"
2018-06-04 03:11:21 -07:00
2020-04-23 04:28:07 -07:00
#define _(STR) gettext(STR)
2020-06-02 05:23:41 -07:00
#define EVISUM_WIN_WIDTH 600
2020-06-28 12:04:03 -07:00
#define EVISUM_WIN_HEIGHT 600
2019-08-24 08:28:56 -07:00
2018-06-04 03:11:21 -07:00
typedef enum
{
SORT_BY_NONE,
SORT_BY_PID,
SORT_BY_UID,
SORT_BY_NICE,
SORT_BY_PRI,
SORT_BY_CPU,
SORT_BY_THREADS,
SORT_BY_SIZE,
SORT_BY_RSS,
SORT_BY_CMD,
SORT_BY_STATE,
SORT_BY_CPU_USAGE,
} Sort_Type;
typedef struct Ui
{
Evas_Object *win;
2020-09-01 09:03:20 -07:00
Evas_Object *bg;
2020-09-02 08:10:08 -07:00
Evas_Object *main_menu;
Evas_Object *menu;
Evas_Object *scroller;
Evas_Object *content;
Evas_Object *win_about;
Evas_Object *progress_cpu;
Evas_Object *progress_mem;
Evas_Object *btn_pid;
Evas_Object *btn_uid;
Evas_Object *btn_size;
Evas_Object *btn_rss;
Evas_Object *btn_cmd;
Evas_Object *btn_state;
Evas_Object *btn_cpu_usage;
2020-04-14 10:24:27 -07:00
Evisum_Ui_Cache *cache;
Eina_Hash *icon_cache;
Evas_Object *genlist_procs;
Evas_Object *entry_search;
2018-06-04 03:11:21 -07:00
Ecore_Thread *thread_system;
Ecore_Thread *thread_process;
2018-06-04 03:11:21 -07:00
2020-10-03 07:44:32 -07:00
pid_t selected_pid;
pid_t program_pid;
char *search_text;
Eina_List *cpu_times;
Eina_List *cpu_list;
Ecore_Animator *animator;
uint8_t cpu_usage;
struct
{
Evas_Object *win;
Ecore_Thread *thread;
} cpu;
struct
{
Evas_Object *win;
Ecore_Timer *timer;
Eina_Bool zfs_mounted;
} mem;
struct
{
Evas_Object *win;
Evas_Object *box;
Ecore_Timer *timer;
} disk;
struct
{
Evas_Object *win;
Evas_Object *box;
Evas_Object *timer;
2020-10-05 08:11:26 -07:00
} sensors;
2020-10-03 07:44:32 -07:00
struct
{
Eina_Bool skip_wait;
Eina_Bool ready;
Eina_Bool shutdown_now;
} state;
2020-09-01 09:03:20 -07:00
2020-10-03 07:44:32 -07:00
struct
{
int poll_delay;
Sort_Type sort_type;
Eina_Bool sort_reverse;
Eina_Bool show_self;
Eina_Bool show_kthreads;
Eina_Bool show_user;
Eina_Bool show_desktop;
2020-10-03 07:44:32 -07:00
} settings;
2018-06-04 03:11:21 -07:00
} Ui;
Ui *
evisum_ui_init(void);
2018-06-04 03:11:21 -07:00
void
evisum_ui_del(Ui *ui);
Eina_Bool
evisum_ui_can_exit(Ui *ui);
void
evisum_ui_activate(Ui *ui, Evisum_Action action, int pid);
2020-10-27 10:52:24 -07:00
void
evisum_restart(void);
2018-06-04 03:11:21 -07:00
#endif