2020-05-17 08:33:27 -07:00
|
|
|
#include "ui_process_view.h"
|
2020-05-12 16:51:30 -07:00
|
|
|
#include "../system/process.h"
|
2020-05-18 10:48:53 -07:00
|
|
|
#include "util.c"
|
2020-05-12 16:51:30 -07:00
|
|
|
|
2020-05-18 04:16:35 -07:00
|
|
|
typedef struct {
|
|
|
|
int tid;
|
|
|
|
char *name;
|
|
|
|
char *state;
|
|
|
|
int cpu_id;
|
|
|
|
double cpu_usage;
|
|
|
|
} Thread_Info;
|
|
|
|
|
|
|
|
static Thread_Info *
|
|
|
|
_thread_info_new(Proc_Info *thr, double cpu_usage)
|
|
|
|
{
|
|
|
|
Thread_Info *t = calloc(1, sizeof(Thread_Info));
|
|
|
|
if (!t) return NULL;
|
|
|
|
|
|
|
|
t->tid = thr->tid;
|
|
|
|
t->name = strdup(thr->thread_name);
|
|
|
|
t->state = strdup(thr->state);
|
|
|
|
t->cpu_id = thr->cpu_id;
|
|
|
|
t->cpu_usage = cpu_usage;
|
|
|
|
|
|
|
|
return t;
|
|
|
|
}
|
|
|
|
|
2020-05-14 06:43:44 -07:00
|
|
|
Eina_List *
|
|
|
|
_exe_response(const char *command)
|
2020-05-12 16:51:30 -07:00
|
|
|
{
|
2020-05-14 06:43:44 -07:00
|
|
|
FILE *p;
|
|
|
|
Eina_List *lines;
|
|
|
|
char buf[8192];
|
2020-05-12 16:51:30 -07:00
|
|
|
|
2020-05-14 06:43:44 -07:00
|
|
|
p = popen(command, "r");
|
|
|
|
if (!p)
|
|
|
|
return NULL;
|
2020-05-12 16:51:30 -07:00
|
|
|
|
2020-05-14 06:43:44 -07:00
|
|
|
lines = NULL;
|
2020-05-12 16:51:30 -07:00
|
|
|
|
2020-05-14 06:43:44 -07:00
|
|
|
while ((fgets(buf, sizeof(buf), p)) != NULL)
|
2020-05-12 16:51:30 -07:00
|
|
|
{
|
2020-05-18 10:48:53 -07:00
|
|
|
lines = eina_list_append(lines, _man2entry(buf));
|
2020-05-12 16:51:30 -07:00
|
|
|
}
|
|
|
|
|
2020-05-14 06:43:44 -07:00
|
|
|
pclose(p);
|
2020-05-12 16:51:30 -07:00
|
|
|
|
2020-05-14 06:43:44 -07:00
|
|
|
return lines;
|
2020-05-12 16:51:30 -07:00
|
|
|
}
|
|
|
|
|
2020-05-17 05:56:21 -07:00
|
|
|
static void
|
2020-05-23 05:51:26 -07:00
|
|
|
_item_unrealized_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2020-05-17 05:56:21 -07:00
|
|
|
{
|
|
|
|
Ui_Process *ui;
|
|
|
|
Evas_Object *o;
|
2020-05-18 04:16:35 -07:00
|
|
|
Eina_List *contents = NULL;
|
2020-05-17 05:56:21 -07:00
|
|
|
|
|
|
|
ui = data;
|
|
|
|
|
|
|
|
elm_genlist_item_all_contents_unset(event_info, &contents);
|
2020-05-18 04:16:35 -07:00
|
|
|
|
2020-05-17 05:56:21 -07:00
|
|
|
EINA_LIST_FREE(contents, o)
|
2020-05-18 14:31:40 -07:00
|
|
|
{
|
|
|
|
evisum_ui_item_cache_item_release(ui->cache, o);
|
|
|
|
}
|
2020-05-17 05:56:21 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_item_del(void *data, Evas_Object *obj EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Thread_Info *t = data;
|
|
|
|
|
2020-05-18 04:16:35 -07:00
|
|
|
if (t->name)
|
|
|
|
free(t->name);
|
|
|
|
if (t->state)
|
|
|
|
free(t->state);
|
2020-05-17 05:56:21 -07:00
|
|
|
free(t);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
|
|
|
_item_column_add(Evas_Object *table, const char *text, int col)
|
|
|
|
{
|
2020-05-17 08:33:27 -07:00
|
|
|
Evas_Object *rect, *label;
|
2020-05-17 05:56:21 -07:00
|
|
|
|
|
|
|
label = elm_label_add(table);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_align_set(label, 0.0, EXPAND);
|
|
|
|
evas_object_size_hint_weight_set(label, FILL, FILL);
|
2020-05-17 05:56:21 -07:00
|
|
|
evas_object_data_set(table, text, label);
|
|
|
|
evas_object_show(label);
|
|
|
|
|
|
|
|
rect = evas_object_rectangle_add(table);
|
|
|
|
evas_object_data_set(label, "rect", rect);
|
|
|
|
|
2020-05-17 08:33:27 -07:00
|
|
|
elm_table_pack(table, label, col, 0, 1, 1);
|
2020-05-17 05:56:21 -07:00
|
|
|
elm_table_pack(table, rect, col, 0, 1, 1);
|
|
|
|
|
2020-05-17 08:33:27 -07:00
|
|
|
return label;
|
2020-05-17 05:56:21 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
|
|
|
_item_create(Evas_Object *parent)
|
|
|
|
{
|
2020-05-17 08:33:27 -07:00
|
|
|
Evas_Object *table, *label;
|
2020-05-17 05:56:21 -07:00
|
|
|
|
|
|
|
table = elm_table_add(parent);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_align_set(table, EXPAND, EXPAND);
|
|
|
|
evas_object_size_hint_weight_set(table, FILL, FILL);
|
2020-05-17 05:56:21 -07:00
|
|
|
evas_object_show(table);
|
|
|
|
|
2020-05-17 08:33:27 -07:00
|
|
|
label = _item_column_add(table, "tid", 0);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_align_set(label, 0.5, EXPAND);
|
2020-05-17 05:56:21 -07:00
|
|
|
_item_column_add(table, "name", 1);
|
2020-05-17 08:33:27 -07:00
|
|
|
label = _item_column_add(table, "state", 2);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_align_set(label, 0.5, EXPAND);
|
2020-05-17 08:33:27 -07:00
|
|
|
label = _item_column_add(table, "cpu_id", 3);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_align_set(label, 0.5, EXPAND);
|
2020-05-17 08:33:27 -07:00
|
|
|
label = _item_column_add(table, "cpu_usage", 4);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_align_set(label, 0.5, EXPAND);
|
2020-05-17 05:56:21 -07:00
|
|
|
|
|
|
|
return table;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
|
|
|
_content_get(void *data, Evas_Object *obj, const char *source)
|
|
|
|
{
|
|
|
|
Ui_Process *ui;
|
|
|
|
Thread_Info *th;
|
|
|
|
Evas_Object *l, *r;
|
|
|
|
Evas_Coord w;
|
|
|
|
|
|
|
|
th = (void *) data;
|
|
|
|
|
|
|
|
if (strcmp(source, "elm.swallow.content")) return NULL;
|
|
|
|
if (!th) return NULL;
|
|
|
|
ui = evas_object_data_get(obj, "ui");
|
|
|
|
if (!ui) return NULL;
|
2020-05-17 08:33:27 -07:00
|
|
|
if (!ui->threads_ready) return NULL;
|
2020-05-17 05:56:21 -07:00
|
|
|
|
2020-05-18 04:16:35 -07:00
|
|
|
Item_Cache *it = evisum_ui_item_cache_item_get(ui->cache);
|
2020-05-17 05:56:21 -07:00
|
|
|
if (!it)
|
|
|
|
{
|
|
|
|
fprintf(stderr, "Error: Object cache creation failed.\n");
|
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
2020-05-17 08:33:27 -07:00
|
|
|
evas_object_geometry_get(ui->btn_thread_id, NULL, NULL, &w, NULL);
|
2020-05-17 05:56:21 -07:00
|
|
|
l = evas_object_data_get(it->obj, "tid");
|
|
|
|
elm_object_text_set(l, eina_slstr_printf("%d", th->tid));
|
|
|
|
r = evas_object_data_get(l, "rect");
|
|
|
|
evas_object_size_hint_min_set(r, w, 1);
|
|
|
|
|
2020-05-17 08:33:27 -07:00
|
|
|
evas_object_geometry_get(ui->btn_thread_name, NULL, NULL, &w, NULL);
|
2020-05-17 05:56:21 -07:00
|
|
|
l = evas_object_data_get(it->obj, "name");
|
|
|
|
elm_object_text_set(l, eina_slstr_printf("%s", th->name));
|
|
|
|
r = evas_object_data_get(l, "rect");
|
|
|
|
evas_object_size_hint_min_set(r, w, 1);
|
|
|
|
|
2020-05-17 08:33:27 -07:00
|
|
|
evas_object_geometry_get(ui->btn_thread_state, NULL, NULL, &w, NULL);
|
2020-05-17 05:56:21 -07:00
|
|
|
l = evas_object_data_get(it->obj, "state");
|
|
|
|
elm_object_text_set(l, eina_slstr_printf("%s", th->state));
|
|
|
|
r = evas_object_data_get(l, "rect");
|
|
|
|
evas_object_size_hint_min_set(r, w, 1);
|
|
|
|
|
2020-05-17 08:33:27 -07:00
|
|
|
evas_object_geometry_get(ui->btn_thread_cpu_id, NULL, NULL, &w, NULL);
|
2020-05-17 05:56:21 -07:00
|
|
|
l = evas_object_data_get(it->obj, "cpu_id");
|
|
|
|
elm_object_text_set(l, eina_slstr_printf("%d", th->cpu_id));
|
|
|
|
r = evas_object_data_get(l, "rect");
|
|
|
|
evas_object_size_hint_min_set(r, w, 1);
|
|
|
|
|
2020-05-17 08:33:27 -07:00
|
|
|
evas_object_geometry_get(ui->btn_thread_cpu_usage, NULL, NULL, &w, NULL);
|
2020-05-17 05:56:21 -07:00
|
|
|
l = evas_object_data_get(it->obj, "cpu_usage");
|
|
|
|
elm_object_text_set(l, eina_slstr_printf("%1.1f%%", th->cpu_usage));
|
|
|
|
r = evas_object_data_get(l, "rect");
|
|
|
|
evas_object_size_hint_min_set(r, w, 1);
|
|
|
|
|
|
|
|
return it->obj;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_genlist_ensure_n_items(Evas_Object *genlist, unsigned int items)
|
|
|
|
{
|
|
|
|
Elm_Object_Item *it;
|
|
|
|
Elm_Genlist_Item_Class *itc;
|
|
|
|
unsigned int i, existing = elm_genlist_items_count(genlist);
|
|
|
|
|
|
|
|
if (items < existing)
|
|
|
|
{
|
|
|
|
for (i = existing - items; i > 0; i--)
|
|
|
|
{
|
|
|
|
it = elm_genlist_last_item_get(genlist);
|
|
|
|
if (it)
|
|
|
|
elm_object_item_del(it);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (items == existing) return;
|
|
|
|
|
|
|
|
itc = elm_genlist_item_class_new();
|
|
|
|
itc->item_style = "full";
|
|
|
|
itc->func.text_get = NULL;
|
|
|
|
itc->func.content_get = _content_get;
|
|
|
|
itc->func.filter_get = NULL;
|
|
|
|
itc->func.del = _item_del;
|
|
|
|
|
|
|
|
for (i = existing; i < items; i++)
|
|
|
|
{
|
2020-05-24 05:34:26 -07:00
|
|
|
elm_genlist_item_append(genlist, itc, NULL, NULL,
|
|
|
|
ELM_GENLIST_ITEM_NONE, NULL, NULL);
|
2020-05-17 05:56:21 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
elm_genlist_item_class_free(itc);
|
|
|
|
}
|
|
|
|
|
2020-05-17 11:30:00 -07:00
|
|
|
static int
|
|
|
|
_sort_by_cpu_usage(const void *p1, const void *p2)
|
|
|
|
{
|
|
|
|
const Thread_Info *inf1, *inf2;
|
|
|
|
double one, two;
|
|
|
|
|
|
|
|
inf1 = p1; inf2 = p2;
|
|
|
|
one = inf1->cpu_usage; two = inf2->cpu_usage;
|
|
|
|
|
|
|
|
if (one > two)
|
|
|
|
return 1;
|
|
|
|
else if (one < two)
|
|
|
|
return -1;
|
|
|
|
else return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
_sort_by_cpu_id(const void *p1, const void *p2)
|
|
|
|
{
|
|
|
|
const Thread_Info *inf1, *inf2;
|
|
|
|
|
|
|
|
inf1 = p1; inf2 = p2;
|
|
|
|
|
|
|
|
return inf1->cpu_id - inf2->cpu_id;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
_sort_by_state(const void *p1, const void *p2)
|
|
|
|
{
|
|
|
|
const Thread_Info *inf1, *inf2;
|
|
|
|
|
|
|
|
inf1 = p1; inf2 = p2;
|
|
|
|
|
|
|
|
return strcmp(inf1->state, inf2->state);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
_sort_by_name(const void *p1, const void *p2)
|
|
|
|
{
|
|
|
|
const Thread_Info *inf1, *inf2;
|
|
|
|
|
|
|
|
inf1 = p1; inf2 = p2;
|
|
|
|
|
|
|
|
return strcmp(inf1->name, inf2->name);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
_sort_by_tid(const void *p1, const void *p2)
|
|
|
|
{
|
|
|
|
const Thread_Info *inf1, *inf2;
|
|
|
|
|
|
|
|
inf1 = p1; inf2 = p2;
|
|
|
|
|
|
|
|
return inf1->tid - inf2->tid;
|
|
|
|
}
|
|
|
|
|
2020-05-15 05:48:59 -07:00
|
|
|
static void
|
|
|
|
_hash_free_cb(void *data)
|
|
|
|
{
|
|
|
|
long *cpu_time = data;
|
|
|
|
if (cpu_time)
|
|
|
|
free(cpu_time);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_thread_info_set(Ui_Process *ui, Proc_Info *proc)
|
|
|
|
{
|
2020-05-17 11:30:00 -07:00
|
|
|
Proc_Info *p;
|
|
|
|
Thread_Info *t;
|
2020-05-17 05:56:21 -07:00
|
|
|
Elm_Object_Item *it;
|
2020-05-18 14:31:40 -07:00
|
|
|
Eina_List *l, *threads = NULL;
|
2020-05-15 05:48:59 -07:00
|
|
|
|
|
|
|
if (!ui->hash_cpu_times)
|
2020-05-17 11:30:00 -07:00
|
|
|
ui->hash_cpu_times = eina_hash_string_superfast_new(_hash_free_cb);
|
2020-05-15 05:48:59 -07:00
|
|
|
|
2020-05-17 05:56:21 -07:00
|
|
|
_genlist_ensure_n_items(ui->genlist_threads, eina_list_count(proc->threads));
|
|
|
|
|
2020-05-17 11:30:00 -07:00
|
|
|
EINA_LIST_FOREACH(proc->threads, l, p)
|
2020-05-15 05:48:59 -07:00
|
|
|
{
|
|
|
|
long *cpu_time, *cpu_time_prev;
|
|
|
|
double cpu_usage = 0.0;
|
2020-05-17 11:30:00 -07:00
|
|
|
const char *key = eina_slstr_printf("%s:%d", p->thread_name, p->tid);
|
2020-05-15 05:48:59 -07:00
|
|
|
|
|
|
|
if ((cpu_time_prev = eina_hash_find(ui->hash_cpu_times, key)) == NULL)
|
|
|
|
{
|
|
|
|
cpu_time = malloc(sizeof(long));
|
2020-05-17 11:30:00 -07:00
|
|
|
*cpu_time = p->cpu_time;
|
2020-05-15 05:48:59 -07:00
|
|
|
eina_hash_add(ui->hash_cpu_times, key, cpu_time);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-06-02 05:19:08 -07:00
|
|
|
cpu_usage = (double) (p->cpu_time - *cpu_time_prev)
|
|
|
|
/ ui->poll_delay;
|
2020-05-17 11:30:00 -07:00
|
|
|
*cpu_time_prev = p->cpu_time;
|
2020-05-15 05:48:59 -07:00
|
|
|
}
|
|
|
|
|
2020-05-17 11:30:00 -07:00
|
|
|
t = _thread_info_new(p, cpu_usage);
|
|
|
|
if (t)
|
|
|
|
threads = eina_list_append(threads, t);
|
|
|
|
}
|
2020-05-15 05:48:59 -07:00
|
|
|
|
2020-05-17 11:30:00 -07:00
|
|
|
if (ui->sort_cb)
|
|
|
|
threads = eina_list_sort(threads, eina_list_count(threads), ui->sort_cb);
|
|
|
|
if (ui->sort_reverse)
|
|
|
|
threads = eina_list_reverse(threads);
|
2020-05-17 05:56:21 -07:00
|
|
|
|
2020-05-17 11:30:00 -07:00
|
|
|
it = elm_genlist_first_item_get(ui->genlist_threads);
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(threads, l, t)
|
|
|
|
{
|
|
|
|
Thread_Info *prev = elm_object_item_data_get(it);
|
2020-05-18 14:31:40 -07:00
|
|
|
if (prev)
|
|
|
|
_item_del(prev, NULL);
|
2020-05-17 11:30:00 -07:00
|
|
|
elm_object_item_data_set(it, t);
|
2020-05-18 04:16:35 -07:00
|
|
|
elm_genlist_item_update(it);
|
2020-05-17 05:56:21 -07:00
|
|
|
it = elm_genlist_item_next_get(it);
|
|
|
|
}
|
2020-05-17 11:30:00 -07:00
|
|
|
eina_list_free(threads);
|
2020-05-15 05:48:59 -07:00
|
|
|
}
|
|
|
|
|
2020-05-14 08:30:29 -07:00
|
|
|
static void
|
|
|
|
_win_title_set(Evas_Object *win, const char *fmt, const char *cmd, int pid)
|
|
|
|
{
|
|
|
|
elm_win_title_set(win, eina_slstr_printf(fmt, cmd, pid));
|
|
|
|
}
|
|
|
|
|
2020-05-14 06:43:44 -07:00
|
|
|
static Eina_Bool
|
|
|
|
_proc_info_update(void *data)
|
2020-05-12 16:51:30 -07:00
|
|
|
{
|
2020-05-14 06:43:44 -07:00
|
|
|
Ui_Process *ui;
|
2020-05-12 16:51:30 -07:00
|
|
|
struct passwd *pwd_entry;
|
|
|
|
Proc_Info *proc;
|
|
|
|
double cpu_usage = 0.0;
|
|
|
|
|
|
|
|
ui = data;
|
|
|
|
|
2020-05-14 06:43:44 -07:00
|
|
|
if (!ui->timer_pid)
|
|
|
|
ui->timer_pid = ecore_timer_add(ui->poll_delay, _proc_info_update, ui);
|
|
|
|
|
2020-05-12 16:51:30 -07:00
|
|
|
proc = proc_info_by_pid(ui->selected_pid);
|
|
|
|
if (!proc)
|
|
|
|
{
|
2020-05-14 08:30:29 -07:00
|
|
|
if (ui->timer_pid)
|
|
|
|
ecore_timer_del(ui->timer_pid);
|
|
|
|
ui->timer_pid = NULL;
|
|
|
|
|
2020-05-23 05:51:26 -07:00
|
|
|
_win_title_set(ui->win, _("%s (%d) - Not running"), ui->selected_cmd,
|
|
|
|
ui->selected_pid);
|
2020-05-14 08:30:29 -07:00
|
|
|
|
2020-05-12 16:51:30 -07:00
|
|
|
return ECORE_CALLBACK_CANCEL;
|
|
|
|
}
|
|
|
|
|
|
|
|
elm_object_text_set(ui->entry_pid_cmd, proc->command);
|
|
|
|
pwd_entry = getpwuid(proc->uid);
|
|
|
|
if (pwd_entry)
|
|
|
|
elm_object_text_set(ui->entry_pid_user, pwd_entry->pw_name);
|
|
|
|
|
|
|
|
if (proc->arguments)
|
|
|
|
elm_object_text_set(ui->entry_pid_cmd_args, proc->arguments);
|
|
|
|
else
|
|
|
|
elm_object_text_set(ui->entry_pid_cmd_args, "");
|
|
|
|
|
|
|
|
elm_object_text_set(ui->entry_pid_pid, eina_slstr_printf("%d", proc->pid));
|
|
|
|
elm_object_text_set(ui->entry_pid_uid, eina_slstr_printf("%d", proc->uid));
|
2020-06-02 05:19:08 -07:00
|
|
|
elm_object_text_set(ui->entry_pid_cpu,
|
|
|
|
eina_slstr_printf("%d", proc->cpu_id));
|
|
|
|
elm_object_text_set(ui->entry_pid_threads,
|
|
|
|
eina_slstr_printf("%d", proc->numthreads));
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_object_text_set(ui->entry_pid_virt, evisum_size_format(proc->mem_virt));
|
|
|
|
elm_object_text_set(ui->entry_pid_rss, evisum_size_format(proc->mem_rss));
|
2020-06-02 05:19:08 -07:00
|
|
|
#if !defined(__linux__)
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_object_text_set(ui->entry_pid_shared, "N/A");
|
|
|
|
#else
|
2020-06-02 05:19:08 -07:00
|
|
|
elm_object_text_set(ui->entry_pid_shared,
|
|
|
|
evisum_size_format(proc->mem_shared));
|
2020-05-12 16:51:30 -07:00
|
|
|
#endif
|
|
|
|
elm_object_text_set(ui->entry_pid_size, evisum_size_format(proc->mem_size));
|
|
|
|
elm_object_text_set(ui->entry_pid_nice, eina_slstr_printf("%d", proc->nice));
|
2020-06-02 05:19:08 -07:00
|
|
|
elm_object_text_set(ui->entry_pid_pri,
|
|
|
|
eina_slstr_printf("%d", proc->priority));
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_object_text_set(ui->entry_pid_state, proc->state);
|
|
|
|
|
|
|
|
if (ui->pid_cpu_time && proc->cpu_time >= ui->pid_cpu_time)
|
|
|
|
cpu_usage = (double)(proc->cpu_time - ui->pid_cpu_time) / ui->poll_delay;
|
|
|
|
|
2020-06-02 05:19:08 -07:00
|
|
|
elm_object_text_set(ui->entry_pid_cpu_usage,
|
|
|
|
eina_slstr_printf("%.1f%%", cpu_usage));
|
2020-05-12 16:51:30 -07:00
|
|
|
|
|
|
|
ui->pid_cpu_time = proc->cpu_time;
|
|
|
|
|
2020-05-15 05:48:59 -07:00
|
|
|
_thread_info_set(ui, proc);
|
|
|
|
|
2020-05-12 16:51:30 -07:00
|
|
|
proc_info_free(proc);
|
|
|
|
|
|
|
|
return ECORE_CALLBACK_RENEW;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2020-05-23 05:51:26 -07:00
|
|
|
_btn_start_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2020-05-12 16:51:30 -07:00
|
|
|
{
|
2020-05-14 08:38:35 -07:00
|
|
|
Ui_Process *ui = data;
|
2020-05-12 16:51:30 -07:00
|
|
|
|
|
|
|
if (ui->selected_pid == -1)
|
|
|
|
return;
|
|
|
|
|
|
|
|
kill(ui->selected_pid, SIGCONT);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2020-05-23 05:51:26 -07:00
|
|
|
_btn_stop_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2020-05-12 16:51:30 -07:00
|
|
|
{
|
2020-05-14 08:38:35 -07:00
|
|
|
Ui_Process *ui = data;
|
2020-05-12 16:51:30 -07:00
|
|
|
|
|
|
|
if (ui->selected_pid == -1)
|
|
|
|
return;
|
|
|
|
|
|
|
|
kill(ui->selected_pid, SIGSTOP);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2020-05-23 05:51:26 -07:00
|
|
|
_btn_kill_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2020-05-12 16:51:30 -07:00
|
|
|
{
|
2020-05-14 08:38:35 -07:00
|
|
|
Ui_Process *ui = data;
|
2020-05-12 16:51:30 -07:00
|
|
|
|
|
|
|
if (ui->selected_pid == -1)
|
|
|
|
return;
|
|
|
|
|
|
|
|
kill(ui->selected_pid, SIGKILL);
|
|
|
|
}
|
|
|
|
|
2020-05-14 11:21:23 -07:00
|
|
|
static Evas_Object *
|
|
|
|
_entry_add(Evas_Object *parent)
|
|
|
|
{
|
|
|
|
Evas_Object *entry = elm_entry_add(parent);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(entry, EXPAND, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(entry, FILL, FILL);
|
2020-05-14 11:21:23 -07:00
|
|
|
elm_entry_single_line_set(entry, EINA_TRUE);
|
|
|
|
elm_entry_scrollable_set(entry, EINA_TRUE);
|
|
|
|
elm_entry_editable_set(entry, EINA_FALSE);
|
|
|
|
elm_entry_line_wrap_set(entry, ELM_WRAP_NONE);
|
|
|
|
evas_object_show(entry);
|
|
|
|
|
|
|
|
return entry;
|
|
|
|
}
|
|
|
|
|
2020-05-14 12:49:31 -07:00
|
|
|
static Evas_Object *
|
|
|
|
_label_add(Evas_Object *parent, const char *text)
|
|
|
|
{
|
|
|
|
Evas_Object *label = elm_label_add(parent);
|
|
|
|
elm_object_text_set(label, text);
|
|
|
|
evas_object_show(label);
|
|
|
|
|
|
|
|
return label;
|
|
|
|
}
|
|
|
|
|
2020-05-14 06:43:44 -07:00
|
|
|
static Evas_Object *
|
|
|
|
_process_tab_add(Evas_Object *parent, Ui_Process *ui)
|
2020-05-12 16:51:30 -07:00
|
|
|
{
|
2020-05-18 07:52:35 -07:00
|
|
|
Evas_Object *frame, *hbox, *table;
|
2020-05-14 06:43:44 -07:00
|
|
|
Evas_Object *label, *entry, *button, *border;
|
2020-05-12 16:51:30 -07:00
|
|
|
int i = 0;
|
2020-05-14 12:49:31 -07:00
|
|
|
|
2020-05-18 07:52:35 -07:00
|
|
|
frame = elm_frame_add(parent);
|
|
|
|
elm_object_text_set(frame, _("General"));
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(frame, EXPAND, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(frame, FILL, FILL);
|
2020-05-18 07:52:35 -07:00
|
|
|
evas_object_show(frame);
|
|
|
|
|
2020-05-14 06:43:44 -07:00
|
|
|
table = elm_table_add(parent);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(table, EXPAND, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(table, FILL, FILL);
|
2020-05-18 07:52:35 -07:00
|
|
|
evas_object_show(table);
|
|
|
|
elm_object_content_set(frame, table);
|
2020-05-12 16:51:30 -07:00
|
|
|
|
2020-05-14 12:49:31 -07:00
|
|
|
label = _label_add(parent, _("Command:"));
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, label, 0, i, 1, 1);
|
2020-05-14 11:21:23 -07:00
|
|
|
ui->entry_pid_cmd = entry = _entry_add(parent);
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, entry, 1, i++, 1, 1);
|
|
|
|
|
2020-05-14 12:49:31 -07:00
|
|
|
label = _label_add(parent, _("Command line:"));
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, label, 0, i, 1, 1);
|
2020-05-14 11:21:23 -07:00
|
|
|
ui->entry_pid_cmd_args = entry = _entry_add(parent);
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, entry, 1, i++, 1, 1);
|
|
|
|
|
2020-05-14 12:49:31 -07:00
|
|
|
label = _label_add(parent, _("PID:"));
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, label, 0, i, 1, 1);
|
2020-05-14 11:21:23 -07:00
|
|
|
ui->entry_pid_pid = entry = _entry_add(parent);
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, entry, 1, i++, 1, 1);
|
|
|
|
|
2020-05-14 12:49:31 -07:00
|
|
|
label = _label_add(parent, _("Username:"));
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, label, 0, i, 1, 1);
|
2020-05-14 11:21:23 -07:00
|
|
|
ui->entry_pid_user = entry = _entry_add(parent);
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, entry, 1, i++, 1, 1);
|
|
|
|
|
2020-05-14 12:49:31 -07:00
|
|
|
label = _label_add(parent, _("UID:"));
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, label, 0, i, 1, 1);
|
2020-05-14 11:21:23 -07:00
|
|
|
ui->entry_pid_uid = entry = _entry_add(parent);
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, entry, 1, i++, 1, 1);
|
|
|
|
|
|
|
|
#if defined(__MacOS__)
|
2020-05-14 12:49:31 -07:00
|
|
|
label = _label_add(parent, _("WQ #:"));
|
2020-05-12 16:51:30 -07:00
|
|
|
#else
|
2020-05-14 12:49:31 -07:00
|
|
|
label = _label_add(parent, _("CPU #:"));
|
2020-05-12 16:51:30 -07:00
|
|
|
#endif
|
|
|
|
elm_table_pack(table, label, 0, i, 1, 1);
|
2020-05-14 11:21:23 -07:00
|
|
|
ui->entry_pid_cpu = entry = _entry_add(parent);
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, entry, 1, i++, 1, 1);
|
|
|
|
|
2020-05-14 12:49:31 -07:00
|
|
|
label = _label_add(parent, _("Threads:"));
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, label, 0, i, 1, 1);
|
2020-05-14 11:21:23 -07:00
|
|
|
ui->entry_pid_threads = entry = _entry_add(parent);
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, entry, 1, i++, 1, 1);
|
|
|
|
|
2020-05-14 12:49:31 -07:00
|
|
|
label = _label_add(parent, _(" Memory :"));
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, label, 0, i, 1, 1);
|
2020-05-14 11:21:23 -07:00
|
|
|
ui->entry_pid_size = entry = _entry_add(parent);
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, entry, 1, i++, 1, 1);
|
|
|
|
|
2020-05-14 12:49:31 -07:00
|
|
|
label = _label_add(parent, _(" Shared memory:"));
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, label, 0, i, 1, 1);
|
2020-05-14 11:21:23 -07:00
|
|
|
ui->entry_pid_shared = entry = _entry_add(parent);
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, entry, 1, i++, 1, 1);
|
|
|
|
|
2020-05-14 12:49:31 -07:00
|
|
|
label = _label_add(parent, _(" Resident memory:"));
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, label, 0, i, 1, 1);
|
2020-05-14 11:21:23 -07:00
|
|
|
ui->entry_pid_rss = entry = _entry_add(parent);
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, entry, 1, i++, 1, 1);
|
|
|
|
|
2020-05-14 12:49:31 -07:00
|
|
|
label = _label_add(parent, _(" Virtual memory:"));
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, label, 0, i, 1, 1);
|
2020-05-14 11:21:23 -07:00
|
|
|
ui->entry_pid_virt = entry = _entry_add(parent);
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, entry, 1, i++, 1, 1);
|
|
|
|
|
2020-05-14 12:49:31 -07:00
|
|
|
label = _label_add(parent, _("Nice:"));
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, label, 0, i, 1, 1);
|
2020-05-14 11:21:23 -07:00
|
|
|
ui->entry_pid_nice = entry = _entry_add(parent);
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, entry, 1, i++, 1, 1);
|
|
|
|
|
2020-05-14 12:49:31 -07:00
|
|
|
label = _label_add(parent, _("Priority:"));
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, label, 0, i, 1, 1);
|
2020-05-14 11:21:23 -07:00
|
|
|
ui->entry_pid_pri = entry = _entry_add(parent);
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, entry, 1, i++, 1, 1);
|
|
|
|
|
2020-05-14 12:49:31 -07:00
|
|
|
label = _label_add(parent, _("State:"));
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, label, 0, i, 1, 1);
|
2020-05-14 11:21:23 -07:00
|
|
|
ui->entry_pid_state = entry = _entry_add(parent);
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, entry, 1, i++, 1, 1);
|
|
|
|
|
2020-05-14 12:49:31 -07:00
|
|
|
label = _label_add(parent, _("CPU %:"));
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, label, 0, i, 1, 1);
|
2020-05-14 11:21:23 -07:00
|
|
|
ui->entry_pid_cpu_usage = entry = _entry_add(parent);
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_table_pack(table, entry, 1, i++, 1, 1);
|
|
|
|
|
|
|
|
hbox = elm_box_add(parent);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(hbox, 0.5, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(hbox, FILL, FILL);
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_box_horizontal_set(hbox, EINA_TRUE);
|
|
|
|
evas_object_show(hbox);
|
2020-05-18 07:52:35 -07:00
|
|
|
elm_table_pack(table, hbox, 0, i, 2, 1);
|
2020-05-12 16:51:30 -07:00
|
|
|
|
|
|
|
border = elm_frame_add(parent);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(border, EXPAND, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(border, FILL, 0.5);
|
2020-05-14 09:08:07 -07:00
|
|
|
elm_object_style_set(border, "pad_small");
|
|
|
|
evas_object_show(border);
|
|
|
|
elm_box_pack_end(hbox, border);
|
|
|
|
|
|
|
|
border = elm_frame_add(parent);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(border, 0.2, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(border, FILL, 0.5);
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_object_style_set(border, "pad_small");
|
|
|
|
evas_object_show(border);
|
|
|
|
|
|
|
|
button = elm_button_add(parent);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(button, EXPAND, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(button, FILL, FILL);
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_object_text_set(button, _("Stop"));
|
|
|
|
evas_object_show(button);
|
|
|
|
evas_object_smart_callback_add(button, "clicked", _btn_stop_clicked_cb, ui);
|
|
|
|
elm_object_content_set(border, button);
|
|
|
|
elm_box_pack_end(hbox, border);
|
|
|
|
|
|
|
|
border = elm_frame_add(parent);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(border, 0.2, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(border, FILL, 0.5);
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_object_style_set(border, "pad_small");
|
|
|
|
evas_object_show(border);
|
|
|
|
|
|
|
|
button = elm_button_add(parent);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(button, EXPAND, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(button, FILL, FILL);
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_object_text_set(button, _("Start"));
|
|
|
|
elm_object_content_set(border, button);
|
|
|
|
evas_object_show(button);
|
|
|
|
elm_box_pack_end(hbox, border);
|
|
|
|
evas_object_smart_callback_add(button, "clicked", _btn_start_clicked_cb, ui);
|
|
|
|
|
|
|
|
border = elm_frame_add(parent);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(border, 0.2, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(border, FILL, 0.5);
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_object_style_set(border, "pad_small");
|
|
|
|
evas_object_show(border);
|
|
|
|
|
|
|
|
button = elm_button_add(parent);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(button, EXPAND, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(button, FILL, FILL);
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_object_text_set(button, _("Kill"));
|
|
|
|
elm_box_pack_end(hbox, border);
|
|
|
|
evas_object_show(button);
|
2020-05-18 07:52:35 -07:00
|
|
|
|
2020-05-12 16:51:30 -07:00
|
|
|
elm_object_content_set(border, button);
|
|
|
|
evas_object_smart_callback_add(button, "clicked", _btn_kill_clicked_cb, ui);
|
2020-05-14 06:43:44 -07:00
|
|
|
|
2020-05-18 07:52:35 -07:00
|
|
|
return frame;
|
2020-05-14 06:43:44 -07:00
|
|
|
}
|
|
|
|
|
2020-05-17 11:30:00 -07:00
|
|
|
static void
|
|
|
|
_btn_icon_state_set(Evas_Object *button, Eina_Bool reverse)
|
|
|
|
{
|
|
|
|
Evas_Object *icon = elm_icon_add(button);
|
|
|
|
|
|
|
|
if (reverse)
|
|
|
|
elm_icon_standard_set(icon, evisum_icon_path_get("go-down"));
|
|
|
|
else
|
|
|
|
elm_icon_standard_set(icon, evisum_icon_path_get("go-up"));
|
|
|
|
|
|
|
|
elm_object_part_content_set(button, "icon", icon);
|
|
|
|
|
|
|
|
evas_object_show(icon);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_btn_name_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
2020-05-23 05:51:26 -07:00
|
|
|
void *event_info EINA_UNUSED)
|
2020-05-17 11:30:00 -07:00
|
|
|
{
|
|
|
|
Ui_Process *ui = data;
|
|
|
|
|
|
|
|
if (ui->sort_cb == _sort_by_name)
|
|
|
|
ui->sort_reverse = !ui->sort_reverse;
|
|
|
|
|
|
|
|
_btn_icon_state_set(obj, ui->sort_reverse);
|
|
|
|
ui->sort_cb = _sort_by_name;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_btn_thread_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Ui_Process *ui = data;
|
|
|
|
|
|
|
|
if (ui->sort_cb == _sort_by_tid)
|
|
|
|
ui->sort_reverse = !ui->sort_reverse;
|
|
|
|
|
|
|
|
_btn_icon_state_set(obj, ui->sort_reverse);
|
|
|
|
ui->sort_cb = _sort_by_tid;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_btn_state_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
2020-05-23 05:51:26 -07:00
|
|
|
void *event_info EINA_UNUSED)
|
2020-05-17 11:30:00 -07:00
|
|
|
{
|
|
|
|
Ui_Process *ui = data;
|
|
|
|
|
|
|
|
if (ui->sort_cb == _sort_by_state)
|
|
|
|
ui->sort_reverse = !ui->sort_reverse;
|
|
|
|
|
|
|
|
_btn_icon_state_set(obj, ui->sort_reverse);
|
|
|
|
ui->sort_cb = _sort_by_state;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_btn_cpu_id_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Ui_Process *ui = data;
|
|
|
|
|
|
|
|
if (ui->sort_cb == _sort_by_cpu_id)
|
|
|
|
ui->sort_reverse = !ui->sort_reverse;
|
|
|
|
|
|
|
|
ui->sort_cb = _sort_by_cpu_id;
|
|
|
|
_btn_icon_state_set(obj, ui->sort_reverse);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_btn_cpu_usage_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
2020-05-23 05:51:26 -07:00
|
|
|
void *event_info EINA_UNUSED)
|
2020-05-17 11:30:00 -07:00
|
|
|
{
|
|
|
|
Ui_Process *ui = data;
|
|
|
|
|
|
|
|
if (ui->sort_cb == _sort_by_cpu_usage)
|
|
|
|
ui->sort_reverse = !ui->sort_reverse;
|
|
|
|
|
|
|
|
ui->sort_cb = _sort_by_cpu_usage;
|
|
|
|
_btn_icon_state_set(obj, ui->sort_reverse);
|
|
|
|
}
|
|
|
|
|
2020-05-14 06:43:44 -07:00
|
|
|
static Evas_Object *
|
2020-05-15 05:48:59 -07:00
|
|
|
_threads_tab_add(Evas_Object *parent, Ui_Process *ui)
|
2020-05-14 06:43:44 -07:00
|
|
|
{
|
2020-05-18 07:52:35 -07:00
|
|
|
Evas_Object *frame, *box, *hbox, *btn, *genlist;
|
|
|
|
|
|
|
|
frame = elm_frame_add(parent);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(frame, EXPAND, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(frame, FILL, FILL);
|
2020-05-18 07:52:35 -07:00
|
|
|
elm_object_text_set(frame, _("Threads"));
|
2020-05-14 06:43:44 -07:00
|
|
|
|
|
|
|
box = elm_box_add(parent);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(box, EXPAND, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(box, FILL, FILL);
|
2020-05-18 07:52:35 -07:00
|
|
|
evas_object_show(box);
|
|
|
|
elm_object_content_set(frame, box);
|
2020-05-14 06:43:44 -07:00
|
|
|
|
2020-05-17 08:33:27 -07:00
|
|
|
hbox = elm_box_add(box);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(hbox, EXPAND, 0);
|
|
|
|
evas_object_size_hint_align_set(hbox, FILL, FILL);
|
2020-05-17 08:33:27 -07:00
|
|
|
elm_box_horizontal_set(hbox, EINA_TRUE);
|
|
|
|
elm_box_homogeneous_set(hbox, EINA_TRUE);
|
|
|
|
evas_object_show(hbox);
|
|
|
|
|
|
|
|
ui->btn_thread_id = btn = elm_button_add(hbox);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(btn, EXPAND, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(btn, FILL, FILL);
|
2020-05-17 08:33:27 -07:00
|
|
|
elm_object_text_set(btn, _("ID"));
|
2020-05-17 11:30:00 -07:00
|
|
|
_btn_icon_state_set(btn, ui->sort_reverse);
|
2020-05-17 08:33:27 -07:00
|
|
|
evas_object_show(btn);
|
2020-05-17 11:30:00 -07:00
|
|
|
evas_object_smart_callback_add(btn, "clicked", _btn_thread_clicked_cb, ui);
|
2020-05-17 08:33:27 -07:00
|
|
|
elm_box_pack_end(hbox, btn);
|
|
|
|
|
|
|
|
ui->btn_thread_name = btn = elm_button_add(hbox);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(btn, EXPAND, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(btn, FILL, FILL);
|
2020-05-17 08:33:27 -07:00
|
|
|
elm_object_text_set(btn, _("Name"));
|
2020-05-17 11:30:00 -07:00
|
|
|
_btn_icon_state_set(btn, ui->sort_reverse);
|
2020-05-17 08:33:27 -07:00
|
|
|
evas_object_show(btn);
|
2020-05-17 11:30:00 -07:00
|
|
|
evas_object_smart_callback_add(btn, "clicked", _btn_name_clicked_cb, ui);
|
2020-05-17 08:33:27 -07:00
|
|
|
elm_box_pack_end(hbox, btn);
|
|
|
|
|
|
|
|
ui->btn_thread_state = btn = elm_button_add(hbox);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(btn, EXPAND, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(btn, FILL, FILL);
|
2020-05-17 08:33:27 -07:00
|
|
|
elm_object_text_set(btn, _("State"));
|
2020-05-17 11:30:00 -07:00
|
|
|
_btn_icon_state_set(btn, ui->sort_reverse);
|
2020-05-17 08:33:27 -07:00
|
|
|
evas_object_show(btn);
|
2020-05-17 11:30:00 -07:00
|
|
|
evas_object_smart_callback_add(btn, "clicked", _btn_state_clicked_cb, ui);
|
2020-05-17 08:33:27 -07:00
|
|
|
elm_box_pack_end(hbox, btn);
|
|
|
|
|
|
|
|
ui->btn_thread_cpu_id = btn = elm_button_add(hbox);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(btn, EXPAND, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(btn, FILL, FILL);
|
2020-05-17 08:33:27 -07:00
|
|
|
elm_object_text_set(btn, _("CPU ID"));
|
2020-05-17 11:30:00 -07:00
|
|
|
_btn_icon_state_set(btn, ui->sort_reverse);
|
2020-05-17 08:33:27 -07:00
|
|
|
evas_object_show(btn);
|
2020-05-17 11:30:00 -07:00
|
|
|
evas_object_smart_callback_add(btn, "clicked", _btn_cpu_id_clicked_cb, ui);
|
2020-05-17 08:33:27 -07:00
|
|
|
elm_box_pack_end(hbox, btn);
|
|
|
|
|
|
|
|
ui->btn_thread_cpu_usage = btn = elm_button_add(hbox);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(btn, EXPAND, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(btn, FILL, FILL);
|
2020-05-17 08:33:27 -07:00
|
|
|
elm_object_text_set(btn, _("CPU Usage"));
|
2020-05-17 11:30:00 -07:00
|
|
|
_btn_icon_state_set(btn, ui->sort_reverse);
|
2020-05-17 08:33:27 -07:00
|
|
|
evas_object_show(btn);
|
2020-06-02 05:19:08 -07:00
|
|
|
evas_object_smart_callback_add(btn, "clicked",
|
|
|
|
_btn_cpu_usage_clicked_cb, ui);
|
2020-05-17 08:33:27 -07:00
|
|
|
elm_box_pack_end(hbox, btn);
|
|
|
|
|
2020-05-17 05:56:21 -07:00
|
|
|
ui->genlist_threads = genlist = elm_genlist_add(parent);
|
|
|
|
evas_object_data_set(genlist, "ui", ui);
|
|
|
|
elm_object_focus_allow_set(genlist, EINA_FALSE);
|
|
|
|
elm_genlist_homogeneous_set(genlist, EINA_TRUE);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(genlist, EXPAND, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(genlist, FILL, FILL);
|
2020-05-17 05:56:21 -07:00
|
|
|
evas_object_show(genlist);
|
2020-05-14 06:43:44 -07:00
|
|
|
|
2020-06-02 05:19:08 -07:00
|
|
|
evas_object_smart_callback_add(ui->genlist_threads, "unrealized",
|
|
|
|
_item_unrealized_cb, ui);
|
2020-05-17 05:56:21 -07:00
|
|
|
|
2020-05-17 08:33:27 -07:00
|
|
|
elm_box_pack_end(box, hbox);
|
2020-05-17 05:56:21 -07:00
|
|
|
elm_box_pack_end(box, genlist);
|
2020-05-14 06:43:44 -07:00
|
|
|
|
2020-05-18 07:52:35 -07:00
|
|
|
return frame;
|
2020-05-14 06:43:44 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
2020-05-14 09:35:57 -07:00
|
|
|
_info_tab_add(Evas_Object *parent, Ui_Process *ui)
|
2020-05-14 06:43:44 -07:00
|
|
|
{
|
2020-05-18 07:52:35 -07:00
|
|
|
Evas_Object *frame, *box, *entry;
|
|
|
|
|
|
|
|
frame = elm_frame_add(parent);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(frame, EXPAND, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(frame, FILL, FILL);
|
2020-05-18 07:52:35 -07:00
|
|
|
elm_object_text_set(frame, _("Documentation"));
|
2020-05-14 06:43:44 -07:00
|
|
|
|
|
|
|
box = elm_box_add(parent);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(box, EXPAND, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(box, FILL, FILL);
|
2020-05-18 07:52:35 -07:00
|
|
|
evas_object_show(box);
|
|
|
|
elm_object_content_set(frame, box);
|
2020-05-14 06:43:44 -07:00
|
|
|
|
2020-05-14 09:35:57 -07:00
|
|
|
ui->entry_info = entry = elm_entry_add(box);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(entry, EXPAND, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(entry, FILL, FILL);
|
2020-05-14 06:43:44 -07:00
|
|
|
elm_entry_single_line_set(entry, EINA_FALSE);
|
|
|
|
elm_entry_line_wrap_set(entry, ELM_WRAP_NONE);
|
|
|
|
elm_entry_editable_set(entry, EINA_FALSE);
|
|
|
|
elm_entry_scrollable_set(entry, EINA_TRUE);
|
|
|
|
evas_object_show(entry);
|
|
|
|
elm_box_pack_end(box, entry);
|
|
|
|
|
2020-05-18 07:52:35 -07:00
|
|
|
return frame;
|
2020-05-14 06:43:44 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2020-05-14 09:08:07 -07:00
|
|
|
_hide_all(Ui_Process *ui, Evas_Object *btn)
|
2020-05-14 06:43:44 -07:00
|
|
|
{
|
2020-05-14 09:08:07 -07:00
|
|
|
elm_object_disabled_set(ui->btn_main, EINA_FALSE);
|
|
|
|
elm_object_disabled_set(ui->btn_info, EINA_FALSE);
|
|
|
|
elm_object_disabled_set(ui->btn_thread, EINA_FALSE);
|
|
|
|
elm_object_disabled_set(btn, EINA_TRUE);
|
2020-05-14 06:43:44 -07:00
|
|
|
evas_object_hide(ui->main_view);
|
|
|
|
evas_object_hide(ui->info_view);
|
|
|
|
evas_object_hide(ui->thread_view);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2020-05-23 05:51:26 -07:00
|
|
|
_btn_process_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2020-05-14 06:43:44 -07:00
|
|
|
{
|
|
|
|
Ui_Process *ui;
|
|
|
|
|
|
|
|
ui = data;
|
|
|
|
|
2020-05-14 09:08:07 -07:00
|
|
|
_hide_all(ui, obj);
|
2020-05-14 06:43:44 -07:00
|
|
|
evas_object_show(ui->main_view);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2020-05-23 05:51:26 -07:00
|
|
|
_btn_threads_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2020-05-14 06:43:44 -07:00
|
|
|
{
|
|
|
|
Ui_Process *ui;
|
|
|
|
|
|
|
|
ui = data;
|
2020-05-17 08:33:27 -07:00
|
|
|
ui->threads_ready = EINA_TRUE;
|
2020-05-14 06:43:44 -07:00
|
|
|
|
2020-05-14 09:08:07 -07:00
|
|
|
_hide_all(ui, obj);
|
2020-05-14 06:43:44 -07:00
|
|
|
evas_object_show(ui->thread_view);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2020-05-23 05:51:26 -07:00
|
|
|
_btn_info_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2020-05-14 06:43:44 -07:00
|
|
|
{
|
|
|
|
Ui_Process *ui;
|
2020-05-14 12:49:31 -07:00
|
|
|
char *line;
|
|
|
|
Eina_Strbuf *buf;
|
|
|
|
int n;
|
2020-05-14 06:43:44 -07:00
|
|
|
|
|
|
|
ui = data;
|
|
|
|
|
2020-05-14 09:08:07 -07:00
|
|
|
_hide_all(ui, obj);
|
2020-05-14 06:43:44 -07:00
|
|
|
evas_object_show(ui->info_view);
|
2020-05-14 09:35:57 -07:00
|
|
|
|
|
|
|
if (ui->info_init) return;
|
|
|
|
|
2020-05-24 05:34:26 -07:00
|
|
|
Eina_List *lines =
|
|
|
|
_exe_response(eina_slstr_printf("man %s | col -b", ui->selected_cmd));
|
2020-05-14 09:35:57 -07:00
|
|
|
if (lines)
|
|
|
|
{
|
2020-05-14 12:49:31 -07:00
|
|
|
buf = eina_strbuf_new();
|
2020-05-14 09:35:57 -07:00
|
|
|
eina_strbuf_append(buf, "<code>");
|
|
|
|
|
2020-05-14 12:49:31 -07:00
|
|
|
n = 1;
|
2020-05-14 09:35:57 -07:00
|
|
|
EINA_LIST_FREE(lines, line)
|
|
|
|
{
|
2020-05-14 12:49:31 -07:00
|
|
|
if (n++ > 1)
|
|
|
|
eina_strbuf_append_printf(buf, "%s<br>", line);
|
2020-05-14 09:35:57 -07:00
|
|
|
free(line);
|
|
|
|
}
|
|
|
|
|
|
|
|
eina_strbuf_append(buf, "</code>");
|
|
|
|
elm_object_text_set(ui->entry_info, eina_strbuf_string_get(buf));
|
|
|
|
eina_strbuf_free(buf);
|
2020-05-14 12:49:31 -07:00
|
|
|
|
|
|
|
eina_list_free(lines);
|
2020-05-14 09:35:57 -07:00
|
|
|
}
|
2020-05-18 07:52:35 -07:00
|
|
|
else
|
|
|
|
{
|
2020-05-24 05:34:26 -07:00
|
|
|
elm_object_text_set(ui->entry_info,
|
2020-05-31 11:46:51 -07:00
|
|
|
eina_slstr_printf(_("No documentation found for %s."),
|
2020-05-24 05:34:26 -07:00
|
|
|
ui->selected_cmd));
|
2020-05-18 07:52:35 -07:00
|
|
|
}
|
|
|
|
|
2020-05-14 09:35:57 -07:00
|
|
|
ui->info_init = EINA_TRUE;
|
2020-05-14 06:43:44 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
|
|
|
_tabs_add(Evas_Object *parent, Ui_Process *ui)
|
|
|
|
{
|
2020-05-20 03:16:07 -07:00
|
|
|
Evas_Object *hbox, *pad, *btn;
|
2020-05-14 06:43:44 -07:00
|
|
|
|
|
|
|
hbox = elm_box_add(parent);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(hbox, EXPAND, 0);
|
|
|
|
evas_object_size_hint_align_set(hbox, FILL, 0.5);
|
2020-05-14 06:43:44 -07:00
|
|
|
elm_box_horizontal_set(hbox, EINA_TRUE);
|
|
|
|
evas_object_show(hbox);
|
|
|
|
|
2020-05-20 03:16:07 -07:00
|
|
|
pad = elm_frame_add(parent);
|
|
|
|
elm_object_style_set(pad, "pad_medium");
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(pad, EXPAND, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(pad, FILL, FILL);
|
2020-05-20 03:16:07 -07:00
|
|
|
evas_object_show(pad);
|
|
|
|
elm_box_pack_end(hbox, pad);
|
|
|
|
|
|
|
|
pad = elm_frame_add(parent);
|
|
|
|
elm_object_style_set(pad, "pad_small");
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(pad, 0.0, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(pad, FILL, FILL);
|
2020-05-20 03:16:07 -07:00
|
|
|
evas_object_show(pad);
|
2020-05-19 03:20:00 -07:00
|
|
|
|
2020-05-14 09:08:07 -07:00
|
|
|
ui->btn_main = btn = elm_button_add(parent);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(btn, EXPAND, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(btn, FILL, FILL);
|
2020-05-28 02:08:03 -07:00
|
|
|
evas_object_size_hint_min_set(btn, elm_config_scale_get() * TAB_BTN_SIZE, 1);
|
2020-05-14 06:43:44 -07:00
|
|
|
elm_object_text_set(btn, _("Process"));
|
2020-05-14 09:08:07 -07:00
|
|
|
elm_object_disabled_set(btn, EINA_TRUE);
|
2020-05-14 06:43:44 -07:00
|
|
|
evas_object_show(btn);
|
2020-05-20 03:16:07 -07:00
|
|
|
elm_object_content_set(pad, btn);
|
|
|
|
elm_box_pack_end(hbox, pad);
|
2020-05-14 06:43:44 -07:00
|
|
|
evas_object_smart_callback_add(btn, "clicked", _btn_process_clicked_cb, ui);
|
|
|
|
|
2020-05-20 03:16:07 -07:00
|
|
|
pad = elm_frame_add(parent);
|
|
|
|
elm_object_style_set(pad, "pad_small");
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(pad, 0.0, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(pad, FILL, FILL);
|
2020-05-20 03:16:07 -07:00
|
|
|
evas_object_show(pad);
|
2020-05-19 03:20:00 -07:00
|
|
|
|
2020-05-14 09:08:07 -07:00
|
|
|
ui->btn_thread = btn = elm_button_add(parent);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(btn, EXPAND, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(btn, FILL, FILL);
|
2020-05-28 02:08:03 -07:00
|
|
|
evas_object_size_hint_min_set(btn, elm_config_scale_get() * TAB_BTN_SIZE, 1);
|
2020-05-14 06:43:44 -07:00
|
|
|
elm_object_text_set(btn, _("Threads"));
|
2020-05-14 09:08:07 -07:00
|
|
|
elm_object_disabled_set(btn, EINA_FALSE);
|
2020-05-14 06:43:44 -07:00
|
|
|
evas_object_show(btn);
|
2020-05-20 03:16:07 -07:00
|
|
|
elm_object_content_set(pad, btn);
|
|
|
|
elm_box_pack_end(hbox, pad);
|
2020-05-14 06:43:44 -07:00
|
|
|
evas_object_smart_callback_add(btn, "clicked", _btn_threads_clicked_cb, ui);
|
|
|
|
|
2020-05-20 03:16:07 -07:00
|
|
|
pad = elm_frame_add(parent);
|
|
|
|
elm_object_style_set(pad, "pad_small");
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(pad, 0.0, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(pad, FILL, FILL);
|
2020-05-20 03:16:07 -07:00
|
|
|
evas_object_show(pad);
|
2020-05-19 03:20:00 -07:00
|
|
|
|
2020-05-14 09:08:07 -07:00
|
|
|
ui->btn_info = btn = elm_button_add(parent);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(btn, EXPAND, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(btn, FILL, FILL);
|
2020-05-28 02:08:03 -07:00
|
|
|
evas_object_size_hint_min_set(btn, elm_config_scale_get() * TAB_BTN_SIZE, 1);
|
2020-05-14 06:43:44 -07:00
|
|
|
elm_object_text_set(btn, _("Information"));
|
2020-05-14 09:08:07 -07:00
|
|
|
elm_object_disabled_set(btn, EINA_FALSE);
|
2020-05-14 06:43:44 -07:00
|
|
|
evas_object_show(btn);
|
2020-05-20 03:16:07 -07:00
|
|
|
elm_object_content_set(pad, btn);
|
|
|
|
elm_box_pack_end(hbox, pad);
|
2020-05-14 06:43:44 -07:00
|
|
|
evas_object_smart_callback_add(btn, "clicked", _btn_info_clicked_cb, ui);
|
|
|
|
|
2020-05-20 03:16:07 -07:00
|
|
|
pad = elm_frame_add(parent);
|
|
|
|
elm_object_style_set(pad, "pad_medium");
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(pad, EXPAND, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(pad, FILL, FILL);
|
2020-05-20 03:16:07 -07:00
|
|
|
evas_object_show(pad);
|
|
|
|
elm_box_pack_end(hbox, pad);
|
|
|
|
|
2020-05-14 06:43:44 -07:00
|
|
|
return hbox;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2020-05-23 05:51:26 -07:00
|
|
|
_win_del_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
|
|
|
void *event_info EINA_UNUSED)
|
2020-05-14 06:43:44 -07:00
|
|
|
{
|
|
|
|
Evas_Object *win;
|
|
|
|
Ui_Process *ui;
|
|
|
|
|
|
|
|
ui = data;
|
|
|
|
win = obj;
|
|
|
|
|
2020-05-15 05:48:59 -07:00
|
|
|
if (ui->hash_cpu_times)
|
|
|
|
eina_hash_free(ui->hash_cpu_times);
|
2020-05-14 06:43:44 -07:00
|
|
|
if (ui->timer_pid)
|
|
|
|
ecore_timer_del(ui->timer_pid);
|
2020-05-14 08:30:29 -07:00
|
|
|
if (ui->selected_cmd)
|
|
|
|
free(ui->selected_cmd);
|
2020-05-18 04:16:35 -07:00
|
|
|
if (ui->cache)
|
|
|
|
evisum_ui_item_cache_free(ui->cache);
|
2020-05-14 06:43:44 -07:00
|
|
|
|
|
|
|
evas_object_del(win);
|
2020-05-17 14:01:01 -07:00
|
|
|
|
2020-05-14 08:30:29 -07:00
|
|
|
free(ui);
|
2020-05-14 06:43:44 -07:00
|
|
|
}
|
2020-05-17 05:56:21 -07:00
|
|
|
static void
|
|
|
|
_win_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|
|
|
{
|
|
|
|
Ui_Process *ui = data;
|
|
|
|
|
|
|
|
elm_genlist_realized_items_update(ui->genlist_threads);
|
|
|
|
}
|
2020-05-14 06:43:44 -07:00
|
|
|
|
|
|
|
void
|
|
|
|
ui_process_win_add(int pid, const char *cmd)
|
|
|
|
{
|
|
|
|
Evas_Object *win, *ic, *box, *tabs;
|
|
|
|
|
|
|
|
Ui_Process *ui = calloc(1, sizeof(Ui_Process));
|
|
|
|
ui->selected_pid = pid;
|
2020-05-14 08:30:29 -07:00
|
|
|
ui->selected_cmd = strdup(cmd);
|
2020-05-17 11:30:00 -07:00
|
|
|
ui->poll_delay = 3;
|
2020-05-18 04:16:35 -07:00
|
|
|
ui->cache = NULL;
|
2020-05-17 11:30:00 -07:00
|
|
|
ui->sort_reverse = EINA_TRUE;
|
|
|
|
ui->sort_cb = _sort_by_cpu_usage;
|
2020-05-14 06:43:44 -07:00
|
|
|
|
2020-05-14 08:30:29 -07:00
|
|
|
ui->win = win = elm_win_util_standard_add("evisum", "evisum");
|
|
|
|
_win_title_set(win, "%s (%d)", cmd, pid);
|
|
|
|
ic = elm_icon_add(win);
|
|
|
|
elm_icon_standard_set(ic, "evisum");
|
|
|
|
elm_win_icon_object_set(win, ic);
|
2020-05-14 06:43:44 -07:00
|
|
|
tabs = _tabs_add(win, ui);
|
|
|
|
|
|
|
|
box = elm_box_add(win);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(box, EXPAND, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(box, FILL, FILL);
|
2020-05-14 06:43:44 -07:00
|
|
|
evas_object_show(box);
|
|
|
|
elm_box_pack_end(box, tabs);
|
|
|
|
|
|
|
|
ui->content = elm_table_add(box);
|
2020-05-24 05:34:26 -07:00
|
|
|
evas_object_size_hint_weight_set(ui->content, 0.5, EXPAND);
|
|
|
|
evas_object_size_hint_align_set(ui->content, FILL, FILL);
|
2020-05-14 06:43:44 -07:00
|
|
|
evas_object_show(ui->content);
|
|
|
|
|
|
|
|
ui->main_view = _process_tab_add(win, ui);
|
2020-05-15 05:48:59 -07:00
|
|
|
ui->thread_view = _threads_tab_add(win, ui);
|
2020-05-14 09:35:57 -07:00
|
|
|
ui->info_view = _info_tab_add(win, ui);
|
2020-05-14 06:43:44 -07:00
|
|
|
|
|
|
|
elm_table_pack(ui->content, ui->info_view, 0, 0, 1, 1);
|
|
|
|
elm_table_pack(ui->content, ui->main_view, 0, 0, 1, 1);
|
|
|
|
elm_table_pack(ui->content, ui->thread_view, 0, 0, 1, 1);
|
|
|
|
|
|
|
|
elm_box_pack_end(box, ui->content);
|
|
|
|
elm_object_content_set(win, box);
|
|
|
|
evas_object_smart_callback_add(win, "delete,request", _win_del_cb, ui);
|
2020-06-02 05:19:08 -07:00
|
|
|
evas_object_event_callback_add(win, EVAS_CALLBACK_RESIZE,
|
|
|
|
_win_resize_cb, ui);
|
2020-05-14 06:43:44 -07:00
|
|
|
elm_win_center(win, EINA_TRUE, EINA_TRUE);
|
|
|
|
evas_object_show(win);
|
|
|
|
|
2020-05-18 04:16:35 -07:00
|
|
|
ui->cache = evisum_ui_item_cache_new(ui->genlist_threads, _item_create, 10);
|
|
|
|
|
2020-05-14 06:43:44 -07:00
|
|
|
_proc_info_update(ui);
|
2020-05-12 16:51:30 -07:00
|
|
|
}
|
|
|
|
|