2019-08-24 08:28:56 -07:00
|
|
|
#ifndef __UI_H__
|
2018-06-04 03:11:21 -07:00
|
|
|
#define __UI_H__
|
|
|
|
|
|
|
|
#include <Elementary.h>
|
2019-09-05 15:01:00 -07:00
|
|
|
#include "process.h"
|
2018-06-04 03:11:21 -07:00
|
|
|
|
2019-08-24 08:28:56 -07:00
|
|
|
#define EVISUM_SIZE_WIDTH 500
|
2020-02-16 07:57:26 -08:00
|
|
|
#define EVISUM_SIZE_HEIGHT 600
|
2019-08-24 08:28:56 -07:00
|
|
|
|
2018-06-04 03:11:21 -07:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
PROCESS_INFO_FIELD_PID,
|
|
|
|
PROCESS_INFO_FIELD_UID,
|
|
|
|
PROCESS_INFO_FIELD_SIZE,
|
|
|
|
PROCESS_INFO_FIELD_RSS,
|
|
|
|
PROCESS_INFO_FIELD_COMMAND,
|
|
|
|
PROCESS_INFO_FIELD_STATE,
|
|
|
|
PROCESS_INFO_FIELD_CPU_USAGE,
|
|
|
|
|
|
|
|
// Not displayed in the main UI.
|
|
|
|
PROCESS_INFO_FIELD_NICE,
|
|
|
|
PROCESS_INFO_FIELD_PRI,
|
|
|
|
PROCESS_INFO_FIELD_CPU,
|
|
|
|
PROCESS_INFO_FIELD_THREADS,
|
|
|
|
// Not used yet in UI.
|
|
|
|
PROCESS_INFO_FIELD_CPU_TIME,
|
|
|
|
} Proc_Stats_Field;
|
|
|
|
|
|
|
|
#define PROCESS_INFO_FIELDS 7
|
|
|
|
|
2018-10-02 06:56:25 -07:00
|
|
|
typedef enum
|
|
|
|
{
|
2018-10-24 05:27:53 -07:00
|
|
|
DATA_UNIT_KB = 'K',
|
|
|
|
DATA_UNIT_MB = 'M',
|
|
|
|
DATA_UNIT_GB = 'G',
|
2018-10-02 06:56:25 -07:00
|
|
|
} Data_Unit;
|
|
|
|
|
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;
|
|
|
|
|
2020-02-15 07:30:31 -08:00
|
|
|
#define TEXT_FIELD_MAX 65535
|
|
|
|
#define TAB_BTN_SIZE 75
|
|
|
|
|
2018-06-04 03:11:21 -07:00
|
|
|
typedef struct Ui
|
|
|
|
{
|
2018-10-02 07:38:06 -07:00
|
|
|
Evas_Object *win;
|
|
|
|
Evas_Object *panel;
|
|
|
|
Evas_Object *scroller;
|
|
|
|
Evas_Object *content;
|
2019-06-08 15:39:15 -07:00
|
|
|
Evas_Object *btn_general;
|
|
|
|
Evas_Object *btn_cpu;
|
|
|
|
Evas_Object *btn_mem;
|
|
|
|
Evas_Object *btn_storage;
|
|
|
|
Evas_Object *btn_misc;
|
|
|
|
|
2018-10-02 07:38:06 -07:00
|
|
|
Evas_Object *disk_view;
|
|
|
|
Evas_Object *disk_activity;
|
|
|
|
Evas_Object *cpu_view;
|
|
|
|
Evas_Object *cpu_activity;
|
|
|
|
Evas_Object *mem_view;
|
|
|
|
Evas_Object *mem_activity;
|
2019-06-08 15:39:15 -07:00
|
|
|
Evas_Object *misc_view;
|
|
|
|
Evas_Object *misc_activity;
|
2018-10-02 07:38:06 -07:00
|
|
|
Evas_Object *system_activity;
|
|
|
|
|
|
|
|
Eina_Bool cpu_visible;
|
2019-06-08 15:39:15 -07:00
|
|
|
Eina_Bool misc_visible;
|
2018-10-02 07:38:06 -07:00
|
|
|
Eina_Bool disk_visible;
|
|
|
|
Eina_Bool mem_visible;
|
|
|
|
|
|
|
|
Evas_Object *progress_cpu;
|
|
|
|
Evas_Object *progress_mem;
|
|
|
|
|
2018-10-24 03:49:27 -07:00
|
|
|
Evas_Object *progress_mem_used;
|
|
|
|
Evas_Object *progress_mem_cached;
|
|
|
|
Evas_Object *progress_mem_buffered;
|
|
|
|
Evas_Object *progress_mem_shared;
|
2019-06-08 15:39:15 -07:00
|
|
|
Evas_Object *progress_mem_swap;
|
2018-10-24 03:49:27 -07:00
|
|
|
|
2018-10-02 07:38:06 -07:00
|
|
|
Evas_Object *entry_pid;
|
|
|
|
Evas_Object *entry_uid;
|
|
|
|
Evas_Object *entry_size;
|
|
|
|
Evas_Object *entry_rss;
|
|
|
|
Evas_Object *entry_cmd;
|
|
|
|
Evas_Object *entry_state;
|
|
|
|
Evas_Object *entry_cpu_usage;
|
|
|
|
|
|
|
|
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-02-15 07:30:31 -08:00
|
|
|
Evas_Object *btn_expand;
|
2018-10-02 07:38:06 -07:00
|
|
|
|
|
|
|
Evas_Object *entry_pid_cmd;
|
|
|
|
Evas_Object *entry_pid_user;
|
|
|
|
Evas_Object *entry_pid_pid;
|
|
|
|
Evas_Object *entry_pid_uid;
|
|
|
|
Evas_Object *entry_pid_cpu;
|
|
|
|
Evas_Object *entry_pid_threads;
|
|
|
|
Evas_Object *entry_pid_size;
|
|
|
|
Evas_Object *entry_pid_rss;
|
|
|
|
Evas_Object *entry_pid_nice;
|
|
|
|
Evas_Object *entry_pid_pri;
|
|
|
|
Evas_Object *entry_pid_state;
|
|
|
|
Evas_Object *entry_pid_cpu_usage;
|
2020-02-15 09:12:02 -08:00
|
|
|
Evas_Object *entry_search;
|
2018-06-04 03:11:21 -07:00
|
|
|
|
2018-06-16 07:09:10 -07:00
|
|
|
Ecore_Thread *thread_system;
|
|
|
|
Ecore_Thread *thread_process;
|
|
|
|
|
2018-10-02 07:38:06 -07:00
|
|
|
Ecore_Timer *timer_pid;
|
|
|
|
pid_t selected_pid;
|
|
|
|
pid_t program_pid;
|
2018-06-04 03:11:21 -07:00
|
|
|
|
2018-10-02 07:38:06 -07:00
|
|
|
Data_Unit data_unit;
|
2018-10-02 06:56:25 -07:00
|
|
|
|
2019-09-05 14:33:38 -07:00
|
|
|
char *text_fields[PROCESS_INFO_FIELDS];
|
2020-02-15 07:30:31 -08:00
|
|
|
char *search_text;
|
2018-10-02 07:38:06 -07:00
|
|
|
Evas_Object *list_pid;
|
2018-06-04 03:11:21 -07:00
|
|
|
|
2018-10-02 07:38:06 -07:00
|
|
|
Eina_Bool first_run;
|
2018-10-03 09:37:57 -07:00
|
|
|
Eina_Bool skip_wait;
|
2018-06-04 03:11:21 -07:00
|
|
|
|
2018-10-02 07:38:06 -07:00
|
|
|
int64_t cpu_times[PID_MAX];
|
|
|
|
int64_t pid_cpu_time;
|
2018-06-04 03:11:21 -07:00
|
|
|
|
2018-10-02 07:38:06 -07:00
|
|
|
int poll_delay;
|
2018-06-04 03:11:21 -07:00
|
|
|
|
2018-10-02 07:38:06 -07:00
|
|
|
Sort_Type sort_type;
|
|
|
|
Eina_Bool sort_reverse;
|
|
|
|
Eina_Bool panel_visible;
|
2018-10-17 02:20:54 -07:00
|
|
|
Eina_Bool shutting_down;
|
2020-02-16 11:34:41 -08:00
|
|
|
Eina_Bool searching;
|
2020-02-15 18:03:32 -08:00
|
|
|
|
|
|
|
uint64_t incoming_max;
|
|
|
|
uint64_t outgoing_max;
|
2018-06-04 03:11:21 -07:00
|
|
|
} Ui;
|
|
|
|
|
2018-06-16 13:31:49 -07:00
|
|
|
Ui *
|
2018-10-02 07:38:06 -07:00
|
|
|
ui_add(Evas_Object *win);
|
2018-06-04 03:11:21 -07:00
|
|
|
|
2018-06-16 13:31:49 -07:00
|
|
|
void
|
2018-10-02 07:38:06 -07:00
|
|
|
ui_shutdown(Ui *ui);
|
2018-06-16 13:31:49 -07:00
|
|
|
|
2018-06-04 03:11:21 -07:00
|
|
|
#endif
|