general: rearrange a few things.

This commit is contained in:
Alastair Poole 2021-02-06 08:50:53 +00:00
parent 6a3a789e6f
commit 5bc6f2984a
7 changed files with 535 additions and 543 deletions

View File

@ -1218,3 +1218,166 @@ proc_info_pid_children_free(Proc_Info *proc)
proc_info_free(proc);
}
int
proc_sort_by_pid(const void *p1, const void *p2)
{
const Proc_Info *inf1, *inf2;
inf1 = p1; inf2 = p2;
return inf1->pid - inf2->pid;
}
int
proc_sort_by_uid(const void *p1, const void *p2)
{
const Proc_Info *inf1, *inf2;
inf1 = p1; inf2 = p2;
return inf1->uid - inf2->uid;
}
int
proc_sort_by_nice(const void *p1, const void *p2)
{
const Proc_Info *inf1, *inf2;
inf1 = p1; inf2 = p2;
return inf1->nice - inf2->nice;
}
int
proc_sort_by_pri(const void *p1, const void *p2)
{
const Proc_Info *inf1, *inf2;
inf1 = p1; inf2 = p2;
return inf1->priority - inf2->priority;
}
int
proc_sort_by_cpu(const void *p1, const void *p2)
{
const Proc_Info *inf1, *inf2;
inf1 = p1; inf2 = p2;
return inf1->cpu_id - inf2->cpu_id;
}
int
proc_sort_by_threads(const void *p1, const void *p2)
{
const Proc_Info *inf1, *inf2;
inf1 = p1; inf2 = p2;
return inf1->numthreads - inf2->numthreads;
}
int
proc_sort_by_size(const void *p1, const void *p2)
{
const Proc_Info *inf1, *inf2;
int64_t size1, size2;
inf1 = p1; inf2 = p2;
size1 = inf1->mem_size;
size2 = inf2->mem_size;
if (size1 > size2)
return 1;
if (size1 < size2)
return -1;
return 0;
}
int
proc_sort_by_rss(const void *p1, const void *p2)
{
const Proc_Info *inf1, *inf2;
int64_t size1, size2;
inf1 = p1; inf2 = p2;
size1 = inf1->mem_rss;
size2 = inf2->mem_rss;
if (size1 > size2)
return 1;
if (size1 < size2)
return -1;
return 0;
}
int
proc_sort_by_time(const void *p1, const void *p2)
{
const Proc_Info *inf1, *inf2;
int64_t t1, t2;
inf1 = p1; inf2 = p2;
t1 = inf1->run_time;
t2 = inf2->run_time;
if (t1 > t2)
return 1;
if (t1 < t2)
return -1;
return 0;
}
int
proc_sort_by_cpu_usage(const void *p1, const void *p2)
{
const Proc_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;
}
int
proc_sort_by_cmd(const void *p1, const void *p2)
{
const Proc_Info *inf1, *inf2;
inf1 = p1; inf2 = p2;
return strcasecmp(inf1->command, inf2->command);
}
int
proc_sort_by_state(const void *p1, const void *p2)
{
const Proc_Info *inf1, *inf2;
inf1 = p1; inf2 = p2;
return strcmp(inf1->state, inf2->state);
}
int
proc_sort_by_age(const void *p1, const void *p2)
{
const Proc_Info *c1 = p1, *c2 = p2;
return c1->start - c2->start;
}

View File

@ -64,4 +64,43 @@ proc_info_pid_children_get(pid_t pid);
void
proc_info_pid_children_free(Proc_Info *procs);
int
proc_sort_by_pid(const void *p1, const void *p2);
int
proc_sort_by_uid(const void *p1, const void *p2);
int
proc_sort_by_nice(const void *p1, const void *p2);
int
proc_sort_by_pri(const void *p1, const void *p2);
int
proc_sort_by_cpu(const void *p1, const void *p2);
int
proc_sort_by_threads(const void *p1, const void *p2);
int
proc_sort_by_size(const void *p1, const void *p2);
int
proc_sort_by_rss(const void *p1, const void *p2);
int
proc_sort_by_time(const void *p1, const void *p2);
int
proc_sort_by_cpu_usage(const void *p1, const void *p2);
int
proc_sort_by_cmd(const void *p1, const void *p2);
int
proc_sort_by_state(const void *p1, const void *p2);
int
proc_sort_by_age(const void *p1, const void *p2);
#endif

View File

@ -47,19 +47,19 @@ _item_del(void *data, Evas_Object *obj EINA_UNUSED)
}
static Evas_Object *
_item_column_add(Evas_Object *tbl, const char *text, int col)
_item_column_add(Evas_Object *tb, const char *text, int col)
{
Evas_Object *rec, *lb;
lb = elm_label_add(tbl);
evas_object_data_set(tbl, text, lb);
lb = elm_label_add(tb);
evas_object_data_set(tb, text, lb);
evas_object_show(lb);
rec = evas_object_rectangle_add(tbl);
rec = evas_object_rectangle_add(evas_object_evas_get(tb));
evas_object_data_set(lb, "rect", rec);
elm_table_pack(tbl, lb, col, 0, 1, 1);
elm_table_pack(tbl, rec, col, 0, 1, 1);
elm_table_pack(tb, lb, col, 0, 1, 1);
elm_table_pack(tb, rec, col, 0, 1, 1);
return lb;
}
@ -67,34 +67,34 @@ _item_column_add(Evas_Object *tbl, const char *text, int col)
static Evas_Object *
_item_create(Evas_Object *parent)
{
Evas_Object *tbl, *lb, *pb;
Evas_Object *tb, *lb, *pb;
tbl = elm_table_add(parent);
evas_object_size_hint_weight_set(tbl, EXPAND, EXPAND);
evas_object_size_hint_align_set(tbl, FILL, FILL);
evas_object_show(tbl);
tb = elm_table_add(parent);
evas_object_size_hint_weight_set(tb, EXPAND, EXPAND);
evas_object_size_hint_align_set(tb, FILL, FILL);
evas_object_show(tb);
lb = _item_column_add(tbl, "device", 0);
lb = _item_column_add(tb, "device", 0);
evas_object_size_hint_weight_set(lb, EXPAND, 0);
evas_object_size_hint_align_set(lb, 0, FILL);
lb = _item_column_add(tbl, "mount", 1);
lb = _item_column_add(tb, "mount", 1);
evas_object_size_hint_align_set(lb, 0, FILL);
lb = _item_column_add(tbl, "fs", 2);
lb = _item_column_add(tb, "fs", 2);
evas_object_size_hint_align_set(lb, 0, FILL);
lb = _item_column_add(tbl, "total", 3);
lb = _item_column_add(tb, "total", 3);
evas_object_size_hint_align_set(lb, 0, FILL);
lb = _item_column_add(tbl, "used", 4);
lb = _item_column_add(tb, "used", 4);
evas_object_size_hint_align_set(lb, 0, FILL);
lb = _item_column_add(tbl, "free", 5);
lb = _item_column_add(tb, "free", 5);
evas_object_size_hint_align_set(lb, 0, FILL);
pb = elm_progressbar_add(tbl);
pb = elm_progressbar_add(tb);
evas_object_size_hint_weight_set(pb, EXPAND, EXPAND);
evas_object_size_hint_align_set(pb, FILL, FILL);
evas_object_data_set(tbl, "usage", pb);
elm_table_pack(tbl, pb, 6, 0, 1, 1);
evas_object_data_set(tb, "usage", pb);
elm_table_pack(tb, pb, 6, 0, 1, 1);
return tbl;
return tb;
}
static Evas_Object *
@ -553,7 +553,7 @@ _btn_min_size(Evas_Object *parent)
void
ui_disk_win_add(Ui *ui)
{
Evas_Object *win, *tbl, *scr;
Evas_Object *win, *tb, *scr;
Evas_Object *genlist, *rec, *btn;
int i = 0;
@ -574,10 +574,10 @@ ui_disk_win_add(Ui *ui)
pd->ui = ui;
pd->skip_wait = 1;
tbl = elm_table_add(win);
evas_object_size_hint_weight_set(tbl, EXPAND, EXPAND);
evas_object_size_hint_align_set(tbl, FILL, FILL);
evas_object_show(tbl);
tb = elm_table_add(win);
evas_object_size_hint_weight_set(tb, EXPAND, EXPAND);
evas_object_size_hint_align_set(tb, FILL, FILL);
evas_object_show(tb);
pd->btn_device = btn = elm_button_add(win);
evas_object_size_hint_weight_set(btn, EXPAND, 0);
@ -586,7 +586,7 @@ ui_disk_win_add(Ui *ui)
elm_object_text_set(btn, _("device"));
evas_object_smart_callback_add(btn, "clicked", _btn_device_clicked_cb, pd);
_btn_icon_state_set(btn, 0);
elm_table_pack(tbl, btn, i++, 0, 1, 1);
elm_table_pack(tb, btn, i++, 0, 1, 1);
pd->btn_mount = btn = elm_button_add(win);
evas_object_size_hint_weight_set(btn, EXPAND, 0);
@ -595,7 +595,7 @@ ui_disk_win_add(Ui *ui)
elm_object_text_set(btn, _("mount"));
evas_object_smart_callback_add(btn, "clicked", _btn_mount_clicked_cb, pd);
_btn_icon_state_set(btn, 0);
elm_table_pack(tbl, btn, i++, 0, 1, 1);
elm_table_pack(tb, btn, i++, 0, 1, 1);
pd->btn_fs = btn = elm_button_add(win);
evas_object_size_hint_weight_set(btn, EXPAND, 0);
@ -604,7 +604,7 @@ ui_disk_win_add(Ui *ui)
elm_object_text_set(btn, _("type"));
evas_object_smart_callback_add(btn, "clicked", _btn_fs_clicked_cb, pd);
_btn_icon_state_set(btn, 0);
elm_table_pack(tbl, btn, i++, 0, 1, 1);
elm_table_pack(tb, btn, i++, 0, 1, 1);
pd->btn_total = btn = elm_button_add(win);
evas_object_size_hint_weight_set(btn, 0, 0);
@ -614,8 +614,8 @@ ui_disk_win_add(Ui *ui)
evas_object_smart_callback_add(btn, "clicked", _btn_total_clicked_cb, pd);
_btn_icon_state_set(btn, 0);
rec = _btn_min_size(btn);
elm_table_pack(tbl, rec, i, i, 1, 1);
elm_table_pack(tbl, btn, i++, 0, 1, 1);
elm_table_pack(tb, rec, i, i, 1, 1);
elm_table_pack(tb, btn, i++, 0, 1, 1);
pd->btn_used = btn = elm_button_add(win);
evas_object_size_hint_weight_set(btn, 0, 0);
@ -625,8 +625,8 @@ ui_disk_win_add(Ui *ui)
evas_object_smart_callback_add(btn, "clicked", _btn_used_clicked_cb, pd);
_btn_icon_state_set(btn, 0);
rec = _btn_min_size(btn);
elm_table_pack(tbl, rec, i, i, 1, 1);
elm_table_pack(tbl, btn, i++, 0, 1, 1);
elm_table_pack(tb, rec, i, i, 1, 1);
elm_table_pack(tb, btn, i++, 0, 1, 1);
pd->btn_free = btn = elm_button_add(win);
evas_object_size_hint_weight_set(btn, 0, 0);
@ -636,8 +636,8 @@ ui_disk_win_add(Ui *ui)
evas_object_smart_callback_add(btn, "clicked", _btn_free_clicked_cb, pd);
_btn_icon_state_set(btn, 0);
rec = _btn_min_size(btn);
elm_table_pack(tbl, rec, i, i, 1, 1);
elm_table_pack(tbl, btn, i++, 0, 1, 1);
elm_table_pack(tb, rec, i, i, 1, 1);
elm_table_pack(tb, btn, i++, 0, 1, 1);
pd->btn_usage = btn = elm_button_add(win);
evas_object_size_hint_weight_set(btn, EXPAND, EXPAND);
@ -646,7 +646,7 @@ ui_disk_win_add(Ui *ui)
elm_object_text_set(btn, _("usage"));
evas_object_smart_callback_add(btn, "clicked", _btn_usage_clicked_cb, pd);
_btn_icon_state_set(btn, 0);
elm_table_pack(tbl, btn, i++, 0, 1, 1);
elm_table_pack(tb, btn, i++, 0, 1, 1);
scr = elm_scroller_add(win);
evas_object_size_hint_weight_set(scr, EXPAND, EXPAND);
@ -668,8 +668,8 @@ ui_disk_win_add(Ui *ui)
pd->cache = evisum_ui_item_cache_new(genlist, _item_create, 10);
elm_table_pack(tbl, scr, 0, 1, 7, 2);
elm_object_content_set(win, tbl);
elm_table_pack(tb, scr, 0, 1, 7, 2);
elm_object_content_set(win, tb);
if (ui->disk.width > 0 && ui->disk.height > 0)
evas_object_resize(win, ui->disk.width, ui->disk.height);
@ -684,7 +684,7 @@ ui_disk_win_add(Ui *ui)
evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _win_del_cb, pd);
evas_object_event_callback_add(win, EVAS_CALLBACK_MOVE, _win_move_cb, pd);
evas_object_event_callback_add(win, EVAS_CALLBACK_RESIZE, _win_resize_cb, pd);
evas_object_event_callback_add(tbl, EVAS_CALLBACK_KEY_DOWN, _win_key_down_cb, pd);
evas_object_event_callback_add(tb, EVAS_CALLBACK_KEY_DOWN, _win_key_down_cb, pd);
evas_object_show(win);
pd->thread = ecore_thread_feedback_run(_disks_poll,

View File

@ -206,7 +206,7 @@ _win_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
void
ui_mem_win_add(Ui *ui)
{
Evas_Object *win, *lb, *bx, *tbl, *pb;
Evas_Object *win, *lb, *bx, *tb, *pb;
Evas_Object *fr;
int i;
meminfo_t memory;
@ -244,46 +244,46 @@ ui_mem_win_add(Ui *ui)
elm_object_style_set(fr, "pad_medium");
evas_object_show(fr);
tbl = elm_table_add(win);
evas_object_size_hint_weight_set(tbl, EXPAND, EXPAND);
evas_object_size_hint_align_set(tbl, FILL, FILL);
elm_table_padding_set(tbl, 8, 2);
evas_object_show(tbl);
tb = elm_table_add(win);
evas_object_size_hint_weight_set(tb, EXPAND, EXPAND);
evas_object_size_hint_align_set(tb, FILL, FILL);
elm_table_padding_set(tb, 8, 2);
evas_object_show(tb);
elm_object_content_set(fr, tbl);
elm_object_content_set(fr, tb);
elm_box_pack_end(bx, fr);
lb = _label_mem(tbl, _("Used"));
pd->used = pb = _progress_add(tbl);
elm_table_pack(tbl, lb, 1, 1, 1, 1);
elm_table_pack(tbl, pb, 2, 1, 1, 1);
lb = _label_mem(tb, _("Used"));
pd->used = pb = _progress_add(tb);
elm_table_pack(tb, lb, 1, 1, 1, 1);
elm_table_pack(tb, pb, 2, 1, 1, 1);
lb = _label_mem(tbl, _("Cached"));
pd->cached = pb = _progress_add(tbl);
elm_table_pack(tbl, lb, 1, 2, 1, 1);
elm_table_pack(tbl, pb, 2, 2, 1, 1);
lb = _label_mem(tb, _("Cached"));
pd->cached = pb = _progress_add(tb);
elm_table_pack(tb, lb, 1, 2, 1, 1);
elm_table_pack(tb, pb, 2, 2, 1, 1);
lb = _label_mem(tbl, _("Buffered"));
pd->buffered = pb = _progress_add(tbl);
elm_table_pack(tbl, lb, 1, 3, 1, 1);
elm_table_pack(tbl, pb, 2, 3, 1, 1);
lb = _label_mem(tb, _("Buffered"));
pd->buffered = pb = _progress_add(tb);
elm_table_pack(tb, lb, 1, 3, 1, 1);
elm_table_pack(tb, pb, 2, 3, 1, 1);
lb = _label_mem(tbl, _("Shared"));
pd->shared = pb = _progress_add(tbl);
elm_table_pack(tbl, lb, 1, 4, 1, 1);
elm_table_pack(tbl, pb, 2, 4, 1, 1);
lb = _label_mem(tb, _("Shared"));
pd->shared = pb = _progress_add(tb);
elm_table_pack(tb, lb, 1, 4, 1, 1);
elm_table_pack(tb, pb, 2, 4, 1, 1);
lb = _label_mem(tbl, _("Swapped"));
pd->swap = pb = _progress_add(tbl);
elm_table_pack(tbl, lb, 1, 5, 1, 1);
elm_table_pack(tbl, pb, 2, 5, 1, 1);
lb = _label_mem(tb, _("Swapped"));
pd->swap = pb = _progress_add(tb);
elm_table_pack(tb, lb, 1, 5, 1, 1);
elm_table_pack(tb, pb, 2, 5, 1, 1);
for (i = 0; i < memory.video_count; i++)
{
lb = _label_mem(tbl, _("Video"));
pd->video[i] = pb = _progress_add(tbl);
elm_table_pack(tbl, lb, 1, 6 + i, 1, 1);
elm_table_pack(tbl, pb, 2, 6 + i, 1, 1);
lb = _label_mem(tb, _("Video"));
pd->video[i] = pb = _progress_add(tb);
elm_table_pack(tb, lb, 1, 6 + i, 1, 1);
elm_table_pack(tb, pb, 2, 6 + i, 1, 1);
}
if (ui->mem.width > 0 && ui->mem.height > 0)

View File

@ -60,14 +60,13 @@ typedef struct
Evas_Object *btn_cmd;
Evas_Object *btn_uid;
Evas_Object *btn_pid;
Evas_Object *btn_threads;
Evas_Object *btn_pri;
Evas_Object *btn_nice;
Evas_Object *btn_size;
Evas_Object *btn_rss;
Evas_Object *btn_threads;
Evas_Object *btn_cpu_n;
Evas_Object *btn_time;
Evas_Object *btn_state;
Evas_Object *btn_time;
Evas_Object *btn_cpu_usage;
} Ui_Data;
@ -79,161 +78,6 @@ static double _cpu_usage = 0.0;
#endif
static int
_sort_by_pid(const void *p1, const void *p2)
{
const Proc_Info *inf1, *inf2;
inf1 = p1; inf2 = p2;
return inf1->pid - inf2->pid;
}
static int
_sort_by_uid(const void *p1, const void *p2)
{
const Proc_Info *inf1, *inf2;
inf1 = p1; inf2 = p2;
return inf1->uid - inf2->uid;
}
static int
_sort_by_nice(const void *p1, const void *p2)
{
const Proc_Info *inf1, *inf2;
inf1 = p1; inf2 = p2;
return inf1->nice - inf2->nice;
}
static int
_sort_by_pri(const void *p1, const void *p2)
{
const Proc_Info *inf1, *inf2;
inf1 = p1; inf2 = p2;
return inf1->priority - inf2->priority;
}
static int
_sort_by_cpu(const void *p1, const void *p2)
{
const Proc_Info *inf1, *inf2;
inf1 = p1; inf2 = p2;
return inf1->cpu_id - inf2->cpu_id;
}
static int
_sort_by_threads(const void *p1, const void *p2)
{
const Proc_Info *inf1, *inf2;
inf1 = p1; inf2 = p2;
return inf1->numthreads - inf2->numthreads;
}
static int
_sort_by_size(const void *p1, const void *p2)
{
const Proc_Info *inf1, *inf2;
int64_t size1, size2;
inf1 = p1; inf2 = p2;
size1 = inf1->mem_size;
size2 = inf2->mem_size;
if (size1 > size2)
return 1;
if (size1 < size2)
return -1;
return 0;
}
static int
_sort_by_rss(const void *p1, const void *p2)
{
const Proc_Info *inf1, *inf2;
int64_t size1, size2;
inf1 = p1; inf2 = p2;
size1 = inf1->mem_rss;
size2 = inf2->mem_rss;
if (size1 > size2)
return 1;
if (size1 < size2)
return -1;
return 0;
}
static int
_sort_by_time(const void *p1, const void *p2)
{
const Proc_Info *inf1, *inf2;
int64_t t1, t2;
inf1 = p1; inf2 = p2;
t1 = inf1->run_time;
t2 = inf2->run_time;
if (t1 > t2)
return 1;
if (t1 < t2)
return -1;
return 0;
}
static int
_sort_by_cpu_usage(const void *p1, const void *p2)
{
const Proc_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_cmd(const void *p1, const void *p2)
{
const Proc_Info *inf1, *inf2;
inf1 = p1; inf2 = p2;
return strcasecmp(inf1->command, inf2->command);
}
static int
_sort_by_state(const void *p1, const void *p2)
{
const Proc_Info *inf1, *inf2;
inf1 = p1; inf2 = p2;
return strcmp(inf1->state, inf2->state);
}
static void
_item_unrealized_cb(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
@ -263,21 +107,21 @@ _item_del(void *data, Evas_Object *obj EINA_UNUSED)
}
static Evas_Object *
_item_column_add(Evas_Object *tbl, const char *text, int col)
_item_column_add(Evas_Object *tb, const char *text, int col)
{
Evas_Object *rec, *lb;
lb = elm_label_add(tbl);
evas_object_data_set(tbl, text, lb);
lb = elm_label_add(tb);
evas_object_data_set(tb, text, lb);
evas_object_size_hint_align_set(lb, FILL, FILL);
evas_object_size_hint_weight_set(lb, EXPAND, EXPAND);
evas_object_show(lb);
rec = evas_object_rectangle_add(tbl);
rec = evas_object_rectangle_add(evas_object_evas_get(tb));
evas_object_data_set(lb, "rec", rec);
elm_table_pack(tbl, rec, col, 0, 1, 1);
elm_table_pack(tbl, lb, col, 0, 1, 1);
elm_table_pack(tb, rec, col, 0, 1, 1);
elm_table_pack(tb, lb, col, 0, 1, 1);
return lb;
}
@ -303,68 +147,63 @@ _pb_format_free_cb(char *str)
static Evas_Object *
_item_create(Evas_Object *obj)
{
Evas_Object *tbl, *lb, *ic, *rec;
Evas_Object *tb, *lb, *ic, *rec;
Evas_Object *hbx, *pb;
int i = 0;
tbl = elm_table_add(obj);
evas_object_size_hint_align_set(tbl, FILL, 0);
evas_object_size_hint_weight_set(tbl, EXPAND, EXPAND);
tb = elm_table_add(obj);
evas_object_size_hint_align_set(tb, FILL, 0);
evas_object_size_hint_weight_set(tb, EXPAND, EXPAND);
hbx = elm_box_add(tbl);
hbx = elm_box_add(tb);
elm_box_horizontal_set(hbx, 1);
evas_object_size_hint_align_set(hbx, 0.0, FILL);
evas_object_size_hint_weight_set(hbx, EXPAND, EXPAND);
evas_object_show(hbx);
ic = elm_icon_add(tbl);
ic = elm_icon_add(tb);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
evas_object_size_hint_align_set(ic, FILL, FILL);
evas_object_size_hint_min_set(ic, ELM_SCALE_SIZE(16), ELM_SCALE_SIZE(16));
evas_object_size_hint_max_set(ic, ELM_SCALE_SIZE(16), ELM_SCALE_SIZE(16));
evas_object_show(ic);
evas_object_data_set(tbl, "icon", ic);
evas_object_data_set(tb, "icon", ic);
elm_box_pack_end(hbx, ic);
elm_table_pack(tbl, hbx, i, 0, 1, 1);
elm_table_pack(tb, hbx, i, 0, 1, 1);
rec = evas_object_rectangle_add(tbl);
rec = evas_object_rectangle_add(evas_object_evas_get(tb));
evas_object_size_hint_min_set(rec, ELM_SCALE_SIZE(4), 1);
elm_box_pack_end(hbx, rec);
rec = evas_object_rectangle_add(evas_object_rectangle_add(tbl));
rec = evas_object_rectangle_add(evas_object_evas_get(tb));
evas_object_data_set(ic, "rec", rec);
elm_table_pack(tbl, rec, i++, 0, 1, 1);
elm_table_pack(tb, rec, i++, 0, 1, 1);
lb = elm_label_add(tbl);
lb = elm_label_add(tb);
evas_object_size_hint_weight_set(lb, 0, EXPAND);
evas_object_data_set(tbl, "proc_cmd", lb);
evas_object_data_set(tb, "proc_cmd", lb);
evas_object_data_set(lb, "hbx", hbx);
evas_object_show(lb);
elm_box_pack_end(hbx, lb);
lb = _item_column_add(tbl, "proc_uid", i++);
lb = _item_column_add(tb, "proc_uid", i++);
evas_object_size_hint_align_set(lb, 1.0, FILL);
lb = _item_column_add(tbl, "proc_pid", i++);
lb = _item_column_add(tb, "proc_pid", i++);
evas_object_size_hint_align_set(lb, 1.0, FILL);
lb = _item_column_add(tbl, "proc_prio", i++);
lb = _item_column_add(tb, "proc_threads", i++);
evas_object_size_hint_align_set(lb, 1.0, FILL);
lb = _item_column_add(tbl, "proc_nice", i++);
lb = _item_column_add(tb, "proc_prio", i++);
evas_object_size_hint_align_set(lb, 1.0, FILL);
lb = _item_column_add(tbl, "proc_size", i++);
lb = _item_column_add(tb, "proc_nice", i++);
evas_object_size_hint_align_set(lb, 1.0, FILL);
lb = _item_column_add(tbl, "proc_rss", i++);
lb = _item_column_add(tb, "proc_size", i++);
evas_object_size_hint_align_set(lb, 1.0, FILL);
lb = _item_column_add(tbl, "proc_threads", i++);
lb = _item_column_add(tb, "proc_rss", i++);
evas_object_size_hint_align_set(lb, 1.0, FILL);
lb = _item_column_add(tbl, "proc_cpuid", i++);
lb = _item_column_add(tb, "proc_state", i++);
evas_object_size_hint_align_set(lb, 1.0, FILL);
lb = _item_column_add(tb, "proc_time", i++);
evas_object_size_hint_align_set(lb, 1.0, FILL);
lb = _item_column_add(tbl, "proc_time", i++);
evas_object_size_hint_align_set(lb, 0.5, FILL);
rec = evas_object_rectangle_add(evas_object_evas_get(tbl));
elm_table_pack(tbl, rec, i++, 0, 1, 1);
lb = _item_column_add(tbl, "proc_state", i++);
evas_object_size_hint_align_set(lb, 0.5, FILL);
elm_table_pack(tbl, rec, i++, 0, 1, 1);
pb = elm_progressbar_add(hbx);
evas_object_size_hint_weight_set(pb, EXPAND, EXPAND);
@ -375,10 +214,10 @@ _item_create(Evas_Object *obj)
_pb_format_cb,
_pb_format_free_cb);
#endif
elm_table_pack(tbl, pb, i++, 0, 1, 1);
evas_object_data_set(tbl, "proc_cpu_usage", pb);
elm_table_pack(tb, pb, i++, 0, 1, 1);
evas_object_data_set(tb, "proc_cpu_usage", pb);
return tbl;
return tb;
}
static void
@ -476,6 +315,15 @@ _content_get(void *data, Evas_Object *obj, const char *source)
evas_object_size_hint_min_set(rec, w, 1);
evas_object_show(lb);
evas_object_geometry_get(pd->btn_threads, NULL, NULL, &w, NULL);
lb = evas_object_data_get(it->obj, "proc_threads");
snprintf(buf, sizeof(buf), "%d", proc->numthreads);
if (strcmp(buf, elm_object_text_get(lb)))
elm_object_text_set(lb, buf);
rec = evas_object_data_get(lb, "rec");
evas_object_size_hint_min_set(rec, w, 1);
evas_object_show(lb);
evas_object_geometry_get(pd->btn_pri, NULL, NULL, &w, NULL);
lb = evas_object_data_get(it->obj, "proc_prio");
snprintf(buf, sizeof(buf), "%d", proc->priority);
@ -512,18 +360,9 @@ _content_get(void *data, Evas_Object *obj, const char *source)
evas_object_size_hint_min_set(rec, w, 1);
evas_object_show(lb);
evas_object_geometry_get(pd->btn_cpu_n, NULL, NULL, &w, NULL);
lb = evas_object_data_get(it->obj, "proc_cpuid");
snprintf(buf, sizeof(buf), "%d", proc->cpu_id);
if (strcmp(buf, elm_object_text_get(lb)))
elm_object_text_set(lb, buf);
rec = evas_object_data_get(lb, "rec");
evas_object_size_hint_min_set(rec, w, 1);
evas_object_show(lb);
evas_object_geometry_get(pd->btn_threads, NULL, NULL, &w, NULL);
lb = evas_object_data_get(it->obj, "proc_threads");
snprintf(buf, sizeof(buf), "%d", proc->numthreads);
evas_object_geometry_get(pd->btn_state, NULL, NULL, &w, NULL);
lb = evas_object_data_get(it->obj, "proc_state");
snprintf(buf, sizeof(buf), "%s", proc->state);
if (strcmp(buf, elm_object_text_get(lb)))
elm_object_text_set(lb, buf);
rec = evas_object_data_get(lb, "rec");
@ -539,15 +378,6 @@ _content_get(void *data, Evas_Object *obj, const char *source)
evas_object_size_hint_min_set(rec, w, 1);
evas_object_show(lb);
evas_object_geometry_get(pd->btn_state, NULL, NULL, &w, NULL);
lb = evas_object_data_get(it->obj, "proc_state");
snprintf(buf, sizeof(buf), "%s", proc->state);
if (strcmp(buf, elm_object_text_get(lb)))
elm_object_text_set(lb, buf);
rec = evas_object_data_get(lb, "rec");
evas_object_size_hint_min_set(rec, w, 1);
evas_object_show(lb);
pb = evas_object_data_get(it->obj, "proc_cpu_usage");
#if PROGRESS_CUSTOM_FORMAT
_cpu_usage = proc->cpu_usage;
@ -650,12 +480,9 @@ _cpu_times_free_cb(void *data)
static Eina_List *
_process_list_search_trim(Eina_List *list, Ui_Data *pd)
{
Ui *ui;
Eina_List *l, *l_next;
Proc_Info *proc;
int64_t id;
ui = pd->ui;
Ui *ui = pd->ui;
EINA_LIST_FOREACH_SAFE(list, l, l_next, proc)
{
@ -670,21 +497,23 @@ _process_list_search_trim(Eina_List *list, Ui_Data *pd)
}
else
{
int64_t *cpu_time;
int64_t *cpu_time, id = proc->pid;
id = proc->pid;
if (!(cpu_time = eina_hash_find(pd->cpu_times, &id)))
if ((cpu_time = eina_hash_find(pd->cpu_times, &id)))
{
cpu_time = malloc(sizeof(int64_t));
if (*cpu_time)
proc->cpu_usage = (double) (proc->cpu_time - *cpu_time) /
pd->ui->proc.poll_delay;
*cpu_time = proc->cpu_time;
eina_hash_add(pd->cpu_times, &id, cpu_time);
}
else
{
if (*cpu_time)
proc->cpu_usage = (double) (proc->cpu_time - *cpu_time) /
pd->ui->proc.poll_delay;
*cpu_time = proc->cpu_time;
cpu_time = malloc(sizeof(int64_t));
if (cpu_time)
{
*cpu_time = proc->cpu_time;
eina_hash_add(pd->cpu_times, &id, cpu_time);
}
}
}
}
@ -744,7 +573,6 @@ _process_list(void *data, Ecore_Thread *thread)
EINA_LIST_FREE(list, proc)
proc_info_free(proc);
}
delay = ui->proc.poll_delay;
}
}
@ -954,19 +782,6 @@ _btn_cmd_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
_btn_clicked_state_save(pd, pd->btn_cmd);
}
static void
_btn_cpu_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Ui_Data *pd = data;
Ui *ui = pd->ui;
if (ui->proc.sort_type == SORT_BY_CPU)
ui->proc.sort_reverse = !ui->proc.sort_reverse;
ui->proc.sort_type = SORT_BY_CPU;
_btn_clicked_state_save(pd, pd->btn_cpu_n);
}
static void
_btn_threads_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
@ -1307,27 +1122,27 @@ static Evas_Object
static Evas_Object *
_ui_content_system_add(Ui_Data *pd, Evas_Object *parent)
{
Evas_Object *tbl, *btn, *list, *rec;
Evas_Object *tb, *btn, *list, *rec;
Ui *ui = pd->ui;
int i = 0;
tbl = elm_table_add(parent);
evas_object_size_hint_weight_set(tbl, EXPAND, EXPAND);
evas_object_size_hint_align_set(tbl, FILL, FILL);
evas_object_show(tbl);
tb = elm_table_add(parent);
evas_object_size_hint_weight_set(tb, EXPAND, EXPAND);
evas_object_size_hint_align_set(tb, FILL, FILL);
evas_object_show(tb);
rec = evas_object_rectangle_add(evas_object_evas_get(parent));
evas_object_size_hint_min_set(rec, 1, ELM_SCALE_SIZE(24));
evas_object_size_hint_max_set(rec, 1, ELM_SCALE_SIZE(24));
elm_table_pack(tbl, rec, i, 1, 1, 1);
elm_table_pack(tb, rec, i, 1, 1, 1);
pd->btn_menu = btn = _btn_create(tbl, "menu", _("Menu"),
pd->btn_menu = btn = _btn_create(tb, "menu", _("Menu"),
_btn_menu_clicked_cb, pd);
rec = evas_object_rectangle_add(evas_object_evas_get(parent));
evas_object_size_hint_min_set(rec, ELM_SCALE_SIZE(20), 1);
evas_object_size_hint_max_set(rec, ELM_SCALE_SIZE(20), -1);
elm_table_pack(tbl, rec, i, 1, 1, 1);
elm_table_pack(tbl, btn, i++, 1, 1, 1);
elm_table_pack(tb, rec, i, 1, 1, 1);
elm_table_pack(tb, btn, i++, 1, 1, 1);
pd->btn_cmd = btn = elm_button_add(parent);
_btn_icon_state_init(btn,
@ -1338,7 +1153,7 @@ _ui_content_system_add(Ui_Data *pd, Evas_Object *parent)
evas_object_size_hint_align_set(btn, FILL, FILL);
elm_object_text_set(btn, _("command"));
evas_object_show(btn);
elm_table_pack(tbl, btn, i++, 1, 1, 1);
elm_table_pack(tb, btn, i++, 1, 1, 1);
evas_object_smart_callback_add(btn, "clicked",
_btn_cmd_clicked_cb, pd);
@ -1353,8 +1168,8 @@ _ui_content_system_add(Ui_Data *pd, Evas_Object *parent)
evas_object_show(btn);
rec = _btn_min_size(pd, btn);
evas_object_size_hint_min_set(rec, ELM_SCALE_SIZE(90), 1);
elm_table_pack(tbl, rec, i, 1, 1, 1);
elm_table_pack(tbl, btn, i++, 1, 1, 1);
elm_table_pack(tb, rec, i, 1, 1, 1);
elm_table_pack(tb, btn, i++, 1, 1, 1);
evas_object_smart_callback_add(btn, "clicked",
_btn_uid_clicked_cb, pd);
@ -1368,11 +1183,26 @@ _ui_content_system_add(Ui_Data *pd, Evas_Object *parent)
elm_object_text_set(btn, _("pid"));
evas_object_show(btn);
rec = _btn_min_size(pd, btn);
elm_table_pack(tbl, rec, i, 1, 1, 1);
elm_table_pack(tbl, btn, i++, 1, 1, 1);
elm_table_pack(tb, rec, i, 1, 1, 1);
elm_table_pack(tb, btn, i++, 1, 1, 1);
evas_object_smart_callback_add(btn, "clicked",
_btn_pid_clicked_cb, pd);
pd->btn_threads = btn = elm_button_add(parent);
_btn_icon_state_init(btn,
(ui->proc.sort_type == SORT_BY_THREADS ?
ui->proc.sort_reverse : 0),
ui->proc.sort_type == SORT_BY_THREADS);
evas_object_size_hint_weight_set(btn, 1.0, 0);
evas_object_size_hint_align_set(btn, FILL, FILL);
elm_object_text_set(btn, _("thr"));
evas_object_show(btn);
rec = _btn_min_size(pd, btn);
elm_table_pack(tb, rec, i, 1, 1, 1);
elm_table_pack(tb, btn, i++, 1, 1, 1);
evas_object_smart_callback_add(btn, "clicked",
_btn_threads_clicked_cb, pd);
pd->btn_pri = btn = elm_button_add(parent);
_btn_icon_state_init(btn,
(ui->proc.sort_type == SORT_BY_PRI ?
@ -1383,8 +1213,8 @@ _ui_content_system_add(Ui_Data *pd, Evas_Object *parent)
elm_object_text_set(btn, _("prio"));
evas_object_show(btn);
rec = _btn_min_size(pd, btn);
elm_table_pack(tbl, rec, i, 1, 1, 1);
elm_table_pack(tbl, btn, i++, 1, 1, 1);
elm_table_pack(tb, rec, i, 1, 1, 1);
elm_table_pack(tb, btn, i++, 1, 1, 1);
evas_object_smart_callback_add(btn, "clicked",
_btn_pri_clicked_cb, pd);
@ -1398,8 +1228,8 @@ _ui_content_system_add(Ui_Data *pd, Evas_Object *parent)
elm_object_text_set(btn, _("nice"));
evas_object_show(btn);
rec = _btn_min_size(pd, btn);
elm_table_pack(tbl, rec, i, 1, 1, 1);
elm_table_pack(tbl, btn, i++, 1, 1, 1);
elm_table_pack(tb, rec, i, 1, 1, 1);
elm_table_pack(tb, btn, i++, 1, 1, 1);
evas_object_smart_callback_add(btn, "clicked",
_btn_nice_clicked_cb, pd);
@ -1413,8 +1243,8 @@ _ui_content_system_add(Ui_Data *pd, Evas_Object *parent)
elm_object_text_set(btn, _("size"));
evas_object_show(btn);
rec = _btn_min_size(pd, btn);
elm_table_pack(tbl, rec, i, 1, 1, 1);
elm_table_pack(tbl, btn, i++, 1, 1, 1);
elm_table_pack(tb, rec, i, 1, 1, 1);
elm_table_pack(tb, btn, i++, 1, 1, 1);
evas_object_smart_callback_add(btn, "clicked",
_btn_size_clicked_cb, pd);
@ -1428,56 +1258,11 @@ _ui_content_system_add(Ui_Data *pd, Evas_Object *parent)
elm_object_text_set(btn, _("res"));
evas_object_show(btn);
rec = _btn_min_size(pd, btn);
elm_table_pack(tbl, rec, i, 1, 1, 1);
elm_table_pack(tbl, btn, i++, 1, 1, 1);
elm_table_pack(tb, rec, i, 1, 1, 1);
elm_table_pack(tb, btn, i++, 1, 1, 1);
evas_object_smart_callback_add(btn, "clicked",
_btn_rss_clicked_cb, pd);
pd->btn_threads = btn = elm_button_add(parent);
_btn_icon_state_init(btn,
(ui->proc.sort_type == SORT_BY_THREADS ?
ui->proc.sort_reverse : 0),
ui->proc.sort_type == SORT_BY_THREADS);
evas_object_size_hint_weight_set(btn, 1.0, 0);
evas_object_size_hint_align_set(btn, FILL, FILL);
elm_object_text_set(btn, _("thr"));
evas_object_show(btn);
rec = _btn_min_size(pd, btn);
elm_table_pack(tbl, rec, i, 1, 1, 1);
elm_table_pack(tbl, btn, i++, 1, 1, 1);
evas_object_smart_callback_add(btn, "clicked",
_btn_threads_clicked_cb, pd);
pd->btn_cpu_n = btn = elm_button_add(parent);
_btn_icon_state_init(btn,
(ui->proc.sort_type == SORT_BY_CPU ?
ui->proc.sort_reverse : 0),
ui->proc.sort_type == SORT_BY_CPU);
evas_object_size_hint_weight_set(btn, 1.0, 0);
evas_object_size_hint_align_set(btn, FILL, FILL);
elm_object_text_set(btn, _("cpu"));
evas_object_show(btn);
rec = _btn_min_size(pd, btn);
elm_table_pack(tbl, rec, i, 1, 1, 1);
elm_table_pack(tbl, btn, i++, 1, 1, 1);
evas_object_smart_callback_add(btn, "clicked",
_btn_cpu_clicked_cb, pd);
pd->btn_time = btn = elm_button_add(parent);
_btn_icon_state_init(btn,
(ui->proc.sort_type == SORT_BY_TIME ?
ui->proc.sort_reverse : 0),
ui->proc.sort_type == SORT_BY_TIME);
evas_object_size_hint_weight_set(btn, 1.0, 0);
evas_object_size_hint_align_set(btn, FILL, FILL);
elm_object_text_set(btn, _("time"));
evas_object_show(btn);
rec = _btn_min_size(pd, btn);
elm_table_pack(tbl, rec, i, 1, 1, 1);
elm_table_pack(tbl, btn, i++, 1, 1, 1);
evas_object_smart_callback_add(btn, "clicked",
_btn_time_clicked_cb, pd);
pd->btn_state = btn = elm_button_add(parent);
_btn_icon_state_init(btn,
(ui->proc.sort_type == SORT_BY_STATE ?
@ -1488,11 +1273,26 @@ _ui_content_system_add(Ui_Data *pd, Evas_Object *parent)
elm_object_text_set(btn, _("state"));
evas_object_show(btn);
rec = _btn_min_size(pd, btn);
elm_table_pack(tbl, rec, i, 1, 1, 1);
elm_table_pack(tbl, btn, i++, 1, 1, 1);
elm_table_pack(tb, rec, i, 1, 1, 1);
elm_table_pack(tb, btn, i++, 1, 1, 1);
evas_object_smart_callback_add(btn, "clicked",
_btn_state_clicked_cb, pd);
pd->btn_time = btn = elm_button_add(parent);
_btn_icon_state_init(btn,
(ui->proc.sort_type == SORT_BY_TIME ?
ui->proc.sort_reverse : 0),
ui->proc.sort_type == SORT_BY_TIME);
evas_object_size_hint_weight_set(btn, 1.0, 0);
evas_object_size_hint_align_set(btn, FILL, FILL);
elm_object_text_set(btn, _("time"));
evas_object_show(btn);
rec = _btn_min_size(pd, btn);
elm_table_pack(tb, rec, i, 1, 1, 1);
elm_table_pack(tb, btn, i++, 1, 1, 1);
evas_object_smart_callback_add(btn, "clicked",
_btn_time_clicked_cb, pd);
pd->btn_cpu_usage = btn = elm_button_add(parent);
_btn_icon_state_init(btn,
(ui->proc.sort_type == SORT_BY_CPU_USAGE ?
@ -1504,8 +1304,8 @@ _ui_content_system_add(Ui_Data *pd, Evas_Object *parent)
evas_object_show(btn);
rec = _btn_min_size(pd, btn);
evas_object_size_hint_min_set(rec, ELM_SCALE_SIZE(80), 1);
elm_table_pack(tbl, rec, i, 1, 1, 1);
elm_table_pack(tbl, btn, i++, 1, 1, 1);
elm_table_pack(tb, rec, i, 1, 1, 1);
elm_table_pack(tb, btn, i++, 1, 1, 1);
evas_object_smart_callback_add(btn, "clicked",
_btn_cpu_usage_clicked_cb, pd);
@ -1520,7 +1320,7 @@ _ui_content_system_add(Ui_Data *pd, Evas_Object *parent)
elm_genlist_multi_select_set(list, 0);
evas_object_size_hint_weight_set(list, EXPAND, EXPAND);
evas_object_size_hint_align_set(list, FILL, FILL);
elm_table_pack(tbl, list, 0, 2, i, 1);
elm_table_pack(tb, list, 0, 2, i, 1);
pd->itc.item_style = "full";
pd->itc.func.text_get = NULL;
@ -1535,7 +1335,7 @@ _ui_content_system_add(Ui_Data *pd, Evas_Object *parent)
evas_object_smart_callback_add(pd->genlist, "unrealized",
_item_unrealized_cb, pd);
return tbl;
return tb;
}
static Eina_Bool
@ -1600,15 +1400,15 @@ _search_key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
static void
_search_add(Ui_Data *pd)
{
Evas_Object *tbl, *fr, *rec, *entry;
Evas_Object *tb, *fr, *rec, *entry;
pd->search.pop = tbl = elm_table_add(pd->win);
evas_object_lower(tbl);
pd->search.pop = tb = elm_table_add(pd->win);
evas_object_lower(tb);
rec = evas_object_rectangle_add(evas_object_evas_get(pd->win));
evas_object_size_hint_min_set(rec, ELM_SCALE_SIZE(220), ELM_SCALE_SIZE(128));
evas_object_size_hint_max_set(rec, ELM_SCALE_SIZE(220), ELM_SCALE_SIZE(128));
elm_table_pack(tbl, rec, 0, 0, 1, 1);
elm_table_pack(tb, rec, 0, 0, 1, 1);
fr = elm_frame_add(pd->win);
elm_object_text_set(fr, _("Search"));
@ -1625,7 +1425,7 @@ _search_add(Ui_Data *pd)
elm_object_focus_allow_set(entry, 0);
evas_object_show(entry);
elm_object_content_set(fr, entry);
elm_table_pack(tbl, fr, 0, 0, 1, 1);
elm_table_pack(tb, fr, 0, 0, 1, 1);
evas_object_event_callback_add(entry, EVAS_CALLBACK_KEY_DOWN,
_search_key_down_cb, pd);
@ -1721,8 +1521,6 @@ _win_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
pd->skip_wait = 1;
evas_object_geometry_get(obj, NULL, NULL,
&ui->proc.width, &ui->proc.height);
if (pd->resize_timer)
ecore_timer_reset(pd->resize_timer);
else pd->resize_timer = ecore_timer_add(0.2, _resize_cb, pd);
@ -1730,8 +1528,10 @@ _win_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
evas_object_lower(pd->search.pop);
if (pd->main_menu)
_main_menu_dismissed_cb(pd, NULL, NULL);
}
evas_object_geometry_get(obj, NULL, NULL,
&ui->proc.width, &ui->proc.height);
}
static Eina_Bool
_evisum_config_changed_cb(void *data, int type EINA_UNUSED,
@ -1750,7 +1550,6 @@ _evisum_config_changed_cb(void *data, int type EINA_UNUSED,
int64_t *t = d;
*t = 0;
}
eina_iterator_free(it);
elm_scroller_policy_set(pd->genlist, ELM_SCROLLER_POLICY_OFF,
@ -1819,19 +1618,19 @@ _win_del_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
static void
_init(Ui_Data *pd)
{
pd->sorters[SORT_BY_NONE].sort_cb = _sort_by_pid;
pd->sorters[SORT_BY_PID].sort_cb = _sort_by_pid;
pd->sorters[SORT_BY_UID].sort_cb = _sort_by_uid;
pd->sorters[SORT_BY_NICE].sort_cb = _sort_by_nice;
pd->sorters[SORT_BY_PRI].sort_cb = _sort_by_pri;
pd->sorters[SORT_BY_CPU].sort_cb = _sort_by_cpu;
pd->sorters[SORT_BY_THREADS].sort_cb = _sort_by_threads;
pd->sorters[SORT_BY_SIZE].sort_cb = _sort_by_size;
pd->sorters[SORT_BY_RSS].sort_cb = _sort_by_rss;
pd->sorters[SORT_BY_CMD].sort_cb = _sort_by_cmd;
pd->sorters[SORT_BY_STATE].sort_cb = _sort_by_state;
pd->sorters[SORT_BY_TIME].sort_cb = _sort_by_time;
pd->sorters[SORT_BY_CPU_USAGE].sort_cb = _sort_by_cpu_usage;
pd->sorters[SORT_BY_NONE].sort_cb = proc_sort_by_pid;
pd->sorters[SORT_BY_PID].sort_cb = proc_sort_by_pid;
pd->sorters[SORT_BY_UID].sort_cb = proc_sort_by_uid;
pd->sorters[SORT_BY_NICE].sort_cb = proc_sort_by_nice;
pd->sorters[SORT_BY_PRI].sort_cb = proc_sort_by_pri;
pd->sorters[SORT_BY_CPU].sort_cb = proc_sort_by_cpu;
pd->sorters[SORT_BY_THREADS].sort_cb = proc_sort_by_threads;
pd->sorters[SORT_BY_SIZE].sort_cb = proc_sort_by_size;
pd->sorters[SORT_BY_RSS].sort_cb = proc_sort_by_rss;
pd->sorters[SORT_BY_CMD].sort_cb = proc_sort_by_cmd;
pd->sorters[SORT_BY_STATE].sort_cb = proc_sort_by_state;
pd->sorters[SORT_BY_TIME].sort_cb = proc_sort_by_time;
pd->sorters[SORT_BY_CPU_USAGE].sort_cb = proc_sort_by_cpu_usage;
}
void

View File

@ -244,21 +244,21 @@ _item_del(void *data, Evas_Object *obj EINA_UNUSED)
}
static Evas_Object *
_item_column_add(Evas_Object *tbl, const char *text, int col)
_item_column_add(Evas_Object *tb, const char *text, int col)
{
Evas_Object *rec, *lb;
lb = elm_label_add(tbl);
lb = elm_label_add(tb);
evas_object_size_hint_weight_set(lb, 0, EXPAND);
evas_object_size_hint_align_set(lb, 0.0, FILL);
evas_object_data_set(tbl, text, lb);
evas_object_data_set(tb, text, lb);
evas_object_show(lb);
rec = evas_object_rectangle_add(tbl);
rec = evas_object_rectangle_add(evas_object_evas_get(tb));
evas_object_data_set(lb, "rect", rec);
elm_table_pack(tbl, lb, col, 0, 1, 1);
elm_table_pack(tbl, rec, col, 0, 1, 1);
elm_table_pack(tb, lb, col, 0, 1, 1);
elm_table_pack(tb, rec, col, 0, 1, 1);
return lb;
}
@ -274,29 +274,29 @@ _hash_free_cb(void *data)
static Evas_Object *
_item_create(Evas_Object *parent)
{
Evas_Object *tbl, *lb, *pb;
Evas_Object *tb, *lb, *pb;
tbl = elm_table_add(parent);
evas_object_size_hint_weight_set(tbl, EXPAND, EXPAND);
evas_object_size_hint_align_set(tbl, FILL, FILL);
evas_object_show(tbl);
tb = elm_table_add(parent);
evas_object_size_hint_weight_set(tb, EXPAND, EXPAND);
evas_object_size_hint_align_set(tb, FILL, FILL);
evas_object_show(tb);
lb = _item_column_add(tbl, "tid", 0);
lb = _item_column_add(tb, "tid", 0);
evas_object_size_hint_align_set(lb, 0.5, FILL);
_item_column_add(tbl, "name", 1);
lb = _item_column_add(tbl, "state", 2);
_item_column_add(tb, "name", 1);
lb = _item_column_add(tb, "state", 2);
evas_object_size_hint_align_set(lb, 0.0, FILL);
lb = _item_column_add(tbl, "cpu_id", 3);
lb = _item_column_add(tb, "cpu_id", 3);
evas_object_size_hint_align_set(lb, 0.5, FILL);
pb = elm_progressbar_add(parent);
evas_object_size_hint_align_set(pb, FILL, FILL);
evas_object_size_hint_weight_set(pb, EXPAND, EXPAND);
elm_progressbar_unit_format_set(pb, "%1.0f %%");
evas_object_data_set(tbl, "cpu_usage", pb);
elm_table_pack(tbl, pb, 4, 0, 1, 1);
evas_object_data_set(tb, "cpu_usage", pb);
elm_table_pack(tb, pb, 4, 0, 1, 1);
return tbl;
return tb;
}
static Evas_Object *
@ -578,14 +578,6 @@ _children_del(void *data, Evas_Object *obj EINA_UNUSED)
proc_info_free(proc);
}
static int
_sort_by_age(const void *p1, const void *p2)
{
const Proc_Info *c1 = p1, *c2 = p2;
return c1->start - c2->start;
}
static void
_children_populate(Evas_Object *genlist_children, Elm_Object_Item *parent,
Eina_List *children)
@ -613,7 +605,7 @@ _children_populate(Evas_Object *genlist_children, Elm_Object_Item *parent,
{
child->children = eina_list_sort(child->children,
eina_list_count(child->children),
_sort_by_age);
proc_sort_by_age);
_children_populate(genlist_children, it, child->children);
}
}
@ -639,7 +631,7 @@ _children_view_update(void *data)
{
child->children = eina_list_sort(child->children,
eina_list_count(child->children),
_sort_by_age);
proc_sort_by_age);
_children_populate(pd->genlist_children, NULL, child->children);
break;
}
@ -719,14 +711,14 @@ _graph_update(Ui_Data *pd, Proc_Info *proc)
static Evas_Object *
_graph(Evas_Object *parent, Ui_Data *pd)
{
Evas_Object *tbl, *obj, *tbl2, *lb, *scr, *fr, *rec;
Evas_Object *tb, *obj, *tb2, *lb, *scr, *fr, *rec;
pd->graph.cpu_count = system_cpu_count_get();
tbl = elm_table_add(parent);
evas_object_size_hint_align_set(tbl, FILL, FILL);
evas_object_size_hint_weight_set(tbl, EXPAND, EXPAND);
evas_object_show(tbl);
tb = elm_table_add(parent);
evas_object_size_hint_align_set(tb, FILL, FILL);
evas_object_size_hint_weight_set(tb, EXPAND, EXPAND);
evas_object_show(tb);
scr = elm_scroller_add(parent);
evas_object_size_hint_align_set(scr, FILL, FILL);
@ -756,10 +748,10 @@ _graph(Evas_Object *parent, Ui_Data *pd)
evas_object_size_hint_weight_set(fr, EXPAND, EXPAND);
evas_object_show(fr);
tbl2 = elm_table_add(parent);
evas_object_size_hint_weight_set(tbl2, EXPAND, 0);
evas_object_size_hint_align_set(tbl2, 0.0, 0.0);
evas_object_show(tbl2);
tb2 = elm_table_add(parent);
evas_object_size_hint_weight_set(tb2, EXPAND, 0);
evas_object_size_hint_align_set(tb2, 0.0, 0.0);
evas_object_show(tb2);
rec = evas_object_rectangle_add(evas_object_evas_get(parent));
evas_object_color_set(rec, 0, 0, 0, 64);
@ -776,14 +768,14 @@ _graph(Evas_Object *parent, Ui_Data *pd)
evas_object_size_hint_align_set(lb, 0.5, 0.5);
evas_object_show(lb);
elm_table_pack(tbl2, rec, 0, 0, 1, 1);
elm_table_pack(tbl2, lb, 0, 0, 1, 1);
elm_object_content_set(fr, tbl2);
elm_table_pack(tb2, rec, 0, 0, 1, 1);
elm_table_pack(tb2, lb, 0, 0, 1, 1);
elm_object_content_set(fr, tb2);
elm_table_pack(tbl, scr, 0, 0, 1, 1);
elm_table_pack(tbl, fr, 0, 0, 1, 1);
elm_table_pack(tb, scr, 0, 0, 1, 1);
elm_table_pack(tb, fr, 0, 0, 1, 1);
return tbl;
return tb;
}
static char *
@ -1020,7 +1012,7 @@ _lb_add(Evas_Object *parent, const char *text)
static Evas_Object *
_process_tab_add(Evas_Object *parent, Ui_Data *pd)
{
Evas_Object *fr, *hbx, *tbl;
Evas_Object *fr, *hbx, *tb;
Evas_Object *lb, *entry, *btn, *pad, *ic;
Evas_Object *rec;
Proc_Info *proc;
@ -1031,18 +1023,18 @@ _process_tab_add(Evas_Object *parent, Ui_Data *pd)
evas_object_size_hint_weight_set(fr, EXPAND, EXPAND);
evas_object_size_hint_align_set(fr, FILL, FILL);
tbl = elm_table_add(parent);
evas_object_size_hint_weight_set(tbl, EXPAND, EXPAND);
evas_object_size_hint_align_set(tbl, FILL, FILL);
evas_object_show(tbl);
elm_object_focus_allow_set(tbl, 1);
elm_object_content_set(fr, tbl);
tb = elm_table_add(parent);
evas_object_size_hint_weight_set(tb, EXPAND, EXPAND);
evas_object_size_hint_align_set(tb, FILL, FILL);
evas_object_show(tb);
elm_object_focus_allow_set(tb, 1);
elm_object_content_set(fr, tb);
rec = evas_object_rectangle_add(evas_object_evas_get(tbl));
rec = evas_object_rectangle_add(evas_object_evas_get(tb));
evas_object_size_hint_min_set(rec, ELM_SCALE_SIZE(64), ELM_SCALE_SIZE(64));
evas_object_size_hint_max_set(rec, ELM_SCALE_SIZE(64), ELM_SCALE_SIZE(64));
evas_object_size_hint_align_set(rec, FILL, 1.0);
elm_table_pack(tbl, rec, 0, i, 1, 1);
elm_table_pack(tb, rec, 0, i, 1, 1);
proc = proc_info_by_pid(pd->selected_pid);
ic = elm_icon_add(parent);
@ -1055,106 +1047,106 @@ _process_tab_add(Evas_Object *parent, Ui_Data *pd)
evisum_icon_cache_find(proc)));
evas_object_show(ic);
proc_info_free(proc);
elm_table_pack(tbl, ic, 0, i, 1, 1);
elm_table_pack(tb, ic, 0, i, 1, 1);
}
lb = _lb_add(parent, _("Command:"));
elm_table_pack(tbl, lb, 0, i, 1, 1);
elm_table_pack(tb, lb, 0, i, 1, 1);
pd->entry_pid_cmd = entry = elm_label_add(parent);
evas_object_size_hint_weight_set(entry, EXPAND, EXPAND);
evas_object_size_hint_align_set(entry, 0.0, 0.5);
evas_object_show(entry);
evas_object_hide(lb);
elm_table_pack(tbl, entry, 1, i++, 1, 1);
elm_table_pack(tb, entry, 1, i++, 1, 1);
lb = _lb_add(parent, _("Command line:"));
elm_table_pack(tbl, lb, 0, i, 1, 1);
elm_table_pack(tb, lb, 0, i, 1, 1);
pd->entry_pid_cmd_args = entry = _entry_add(parent);
elm_table_pack(tbl, entry, 1, i++, 1, 1);
elm_table_pack(tb, entry, 1, i++, 1, 1);
lb = _lb_add(parent, _("PID:"));
elm_table_pack(tbl, lb, 0, i, 1, 1);
elm_table_pack(tb, lb, 0, i, 1, 1);
pd->entry_pid_pid = entry = _entry_add(parent);
elm_table_pack(tbl, entry, 1, i++, 1, 1);
elm_table_pack(tb, entry, 1, i++, 1, 1);
lb = _lb_add(parent, _("Username:"));
elm_table_pack(tbl, lb, 0, i, 1, 1);
elm_table_pack(tb, lb, 0, i, 1, 1);
pd->entry_pid_user = entry = _entry_add(parent);
elm_table_pack(tbl, entry, 1, i++, 1, 1);
elm_table_pack(tb, entry, 1, i++, 1, 1);
lb = _lb_add(parent, _("UID:"));
elm_table_pack(tbl, lb, 0, i, 1, 1);
elm_table_pack(tb, lb, 0, i, 1, 1);
pd->entry_pid_uid = entry = _entry_add(parent);
elm_table_pack(tbl, entry, 1, i++, 1, 1);
elm_table_pack(tb, entry, 1, i++, 1, 1);
lb = _lb_add(parent, _("PPID:"));
elm_table_pack(tbl, lb, 0, i, 1, 1);
elm_table_pack(tb, lb, 0, i, 1, 1);
pd->entry_pid_ppid = entry = _entry_add(parent);
elm_table_pack(tbl, entry, 1, i++, 1, 1);
elm_table_pack(tb, entry, 1, i++, 1, 1);
#if defined(__MacOS__)
lb = _lb_add(parent, _("WQ #:"));
#else
lb = _lb_add(parent, _("CPU #:"));
#endif
elm_table_pack(tbl, lb, 0, i, 1, 1);
elm_table_pack(tb, lb, 0, i, 1, 1);
pd->entry_pid_cpu = entry = _entry_add(parent);
elm_table_pack(tbl, entry, 1, i++, 1, 1);
elm_table_pack(tb, entry, 1, i++, 1, 1);
lb = _lb_add(parent, _("Threads:"));
elm_table_pack(tbl, lb, 0, i, 1, 1);
elm_table_pack(tb, lb, 0, i, 1, 1);
pd->entry_pid_threads = entry = _entry_add(parent);
elm_table_pack(tbl, entry, 1, i++, 1, 1);
elm_table_pack(tb, entry, 1, i++, 1, 1);
lb = _lb_add(parent, _(" Memory :"));
elm_table_pack(tbl, lb, 0, i, 1, 1);
elm_table_pack(tb, lb, 0, i, 1, 1);
pd->entry_pid_size = entry = _entry_add(parent);
elm_table_pack(tbl, entry, 1, i++, 1, 1);
elm_table_pack(tb, entry, 1, i++, 1, 1);
lb = _lb_add(parent, _(" Shared memory:"));
elm_table_pack(tbl, lb, 0, i, 1, 1);
elm_table_pack(tb, lb, 0, i, 1, 1);
pd->entry_pid_shared = entry = _entry_add(parent);
elm_table_pack(tbl, entry, 1, i++, 1, 1);
elm_table_pack(tb, entry, 1, i++, 1, 1);
lb = _lb_add(parent, _(" Resident memory:"));
elm_table_pack(tbl, lb, 0, i, 1, 1);
elm_table_pack(tb, lb, 0, i, 1, 1);
pd->entry_pid_rss = entry = _entry_add(parent);
elm_table_pack(tbl, entry, 1, i++, 1, 1);
elm_table_pack(tb, entry, 1, i++, 1, 1);
lb = _lb_add(parent, _(" Virtual memory:"));
elm_table_pack(tbl, lb, 0, i, 1, 1);
elm_table_pack(tb, lb, 0, i, 1, 1);
pd->entry_pid_virt = entry = _entry_add(parent);
elm_table_pack(tbl, entry, 1, i++, 1, 1);
elm_table_pack(tb, entry, 1, i++, 1, 1);
lb = _lb_add(parent, _(" Start time:"));
elm_table_pack(tbl, lb, 0, i, 1, 1);
elm_table_pack(tb, lb, 0, i, 1, 1);
pd->entry_pid_started = entry = _entry_add(parent);
elm_table_pack(tbl, entry, 1, i++, 1, 1);
elm_table_pack(tb, entry, 1, i++, 1, 1);
lb = _lb_add(parent, _(" Run time:"));
elm_table_pack(tbl, lb, 0, i, 1, 1);
elm_table_pack(tb, lb, 0, i, 1, 1);
pd->entry_pid_run_time = entry = _entry_add(parent);
elm_table_pack(tbl, entry, 1, i++, 1, 1);
elm_table_pack(tb, entry, 1, i++, 1, 1);
lb = _lb_add(parent, _("Nice:"));
elm_table_pack(tbl, lb, 0, i, 1, 1);
elm_table_pack(tb, lb, 0, i, 1, 1);
pd->entry_pid_nice = entry = _entry_add(parent);
elm_table_pack(tbl, entry, 1, i++, 1, 1);
elm_table_pack(tb, entry, 1, i++, 1, 1);
lb = _lb_add(parent, _("Priority:"));
elm_table_pack(tbl, lb, 0, i, 1, 1);
elm_table_pack(tb, lb, 0, i, 1, 1);
pd->entry_pid_pri = entry = _entry_add(parent);
elm_table_pack(tbl, entry, 1, i++, 1, 1);
elm_table_pack(tb, entry, 1, i++, 1, 1);
lb = _lb_add(parent, _("State:"));
elm_table_pack(tbl, lb, 0, i, 1, 1);
elm_table_pack(tb, lb, 0, i, 1, 1);
pd->entry_pid_state = entry = _entry_add(parent);
elm_table_pack(tbl, entry, 1, i++, 1, 1);
elm_table_pack(tb, entry, 1, i++, 1, 1);
lb = _lb_add(parent, _("CPU %:"));
elm_table_pack(tbl, lb, 0, i, 1, 1);
elm_table_pack(tb, lb, 0, i, 1, 1);
pd->entry_pid_cpu_usage = entry = _entry_add(parent);
elm_table_pack(tbl, entry, 1, i++, 1, 1);
elm_table_pack(tb, entry, 1, i++, 1, 1);
hbx = elm_box_add(parent);
evas_object_size_hint_weight_set(hbx, EXPAND, 0);
@ -1162,7 +1154,7 @@ _process_tab_add(Evas_Object *parent, Ui_Data *pd)
elm_box_horizontal_set(hbx, 1);
elm_box_homogeneous_set(hbx, 1);
evas_object_show(hbx);
elm_table_pack(tbl, hbx, 1, i, 1, 1);
elm_table_pack(tb, hbx, 1, i, 1, 1);
pad = elm_frame_add(parent);
evas_object_size_hint_weight_set(pad, EXPAND, EXPAND);
@ -1285,7 +1277,7 @@ _btn_cpu_usage_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
static Evas_Object *
_threads_tab_add(Evas_Object *parent, Ui_Data *pd)
{
Evas_Object *fr, *bx, *bx2, *tbl, *rec, *btn, *genlist;
Evas_Object *fr, *bx, *bx2, *tb, *rec, *btn, *genlist;
Evas_Object *graph;
int i = 0;
@ -1309,59 +1301,59 @@ _threads_tab_add(Evas_Object *parent, Ui_Data *pd)
evas_object_size_hint_align_set(bx2, FILL, FILL);
evas_object_show(bx2);
tbl = elm_table_add(bx2);
evas_object_size_hint_weight_set(tbl, EXPAND, 0);
evas_object_size_hint_align_set(tbl, FILL, FILL);
evas_object_show(tbl);
elm_box_pack_end(bx2, tbl);
tb = elm_table_add(bx2);
evas_object_size_hint_weight_set(tb, EXPAND, 0);
evas_object_size_hint_align_set(tb, FILL, FILL);
evas_object_show(tb);
elm_box_pack_end(bx2, tb);
pd->tab_thread_id = btn = elm_button_add(tbl);
pd->tab_thread_id = btn = elm_button_add(tb);
evas_object_size_hint_weight_set(btn, EXPAND, EXPAND);
evas_object_size_hint_align_set(btn, FILL, FILL);
elm_object_text_set(btn, _("id"));
_btn_icon_state_set(btn, pd->sort_reverse);
evas_object_show(btn);
evas_object_smart_callback_add(btn, "clicked", _btn_thread_clicked_cb, pd);
elm_table_pack(tbl, btn, i++, 0, 1, 1);
elm_table_pack(tb, btn, i++, 0, 1, 1);
pd->tab_thread_name = btn = elm_button_add(tbl);
pd->tab_thread_name = btn = elm_button_add(tb);
evas_object_size_hint_weight_set(btn, EXPAND, EXPAND);
evas_object_size_hint_align_set(btn, FILL, FILL);
elm_object_text_set(btn, _("name"));
_btn_icon_state_set(btn, pd->sort_reverse);
evas_object_show(btn);
evas_object_smart_callback_add(btn, "clicked", _btn_name_clicked_cb, pd);
elm_table_pack(tbl, btn, i++, 0, 1, 1);
elm_table_pack(tb, btn, i++, 0, 1, 1);
pd->tab_thread_state = btn = elm_button_add(tbl);
pd->tab_thread_state = btn = elm_button_add(tb);
evas_object_size_hint_weight_set(btn, EXPAND, EXPAND);
evas_object_size_hint_align_set(btn, FILL, FILL);
elm_object_text_set(btn, _("state"));
_btn_icon_state_set(btn, pd->sort_reverse);
evas_object_show(btn);
evas_object_smart_callback_add(btn, "clicked", _btn_state_clicked_cb, pd);
elm_table_pack(tbl, btn, i++, 0, 1, 1);
elm_table_pack(tb, btn, i++, 0, 1, 1);
pd->tab_thread_cpu_id = btn = elm_button_add(tbl);
pd->tab_thread_cpu_id = btn = elm_button_add(tb);
evas_object_size_hint_weight_set(btn, 0, EXPAND);
evas_object_size_hint_align_set(btn, FILL, FILL);
elm_object_text_set(btn, _("cpu id"));
_btn_icon_state_set(btn, pd->sort_reverse);
evas_object_show(btn);
evas_object_smart_callback_add(btn, "clicked", _btn_cpu_id_clicked_cb, pd);
rec = evas_object_rectangle_add(evas_object_evas_get(tbl));
rec = evas_object_rectangle_add(evas_object_evas_get(tb));
evas_object_size_hint_min_set(rec, ELM_SCALE_SIZE(BTN_WIDTH), 1);
elm_table_pack(tbl, rec, i, 0, 1, 1);
elm_table_pack(tbl, btn, i++, 0, 1, 1);
elm_table_pack(tb, rec, i, 0, 1, 1);
elm_table_pack(tb, btn, i++, 0, 1, 1);
pd->tab_thread_cpu_usage = btn = elm_button_add(tbl);
pd->tab_thread_cpu_usage = btn = elm_button_add(tb);
evas_object_size_hint_weight_set(btn, EXPAND, EXPAND);
evas_object_size_hint_align_set(btn, FILL, FILL);
elm_object_text_set(btn, _("cpu %"));
_btn_icon_state_set(btn, pd->sort_reverse);
evas_object_show(btn);
evas_object_smart_callback_add(btn, "clicked", _btn_cpu_usage_clicked_cb, pd);
elm_table_pack(tbl, btn, i++, 0, 1, 1);
elm_table_pack(tb, btn, i++, 0, 1, 1);
pd->genlist_threads = genlist = elm_genlist_add(parent);
evas_object_data_set(genlist, "ui", pd);
@ -1544,7 +1536,6 @@ _tab_manual_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
int n = 1;
elm_entry_entry_append(ent, "<code>");
EINA_LIST_FREE(lines, line)
{
if (n++ > 1)

View File

@ -15,13 +15,13 @@ Evas_Object *
evisum_ui_tab_add(Evas_Object *parent, Evas_Object **alias, const char *text,
Evas_Smart_Cb clicked_cb, void *data)
{
Evas_Object *tbl, *rect, *btn, *lb;
Evas_Object *tb, *rect, *btn, *lb;
tbl = elm_table_add(parent);
evas_object_size_hint_weight_set(tbl, EXPAND, EXPAND);
evas_object_size_hint_align_set(tbl, FILL, FILL);
tb = elm_table_add(parent);
evas_object_size_hint_weight_set(tb, EXPAND, EXPAND);
evas_object_size_hint_align_set(tb, FILL, FILL);
rect = evas_object_rectangle_add(tbl);
rect = evas_object_rectangle_add(evas_object_evas_get(tb));
evas_object_size_hint_weight_set(rect, EXPAND, EXPAND);
evas_object_size_hint_align_set(rect, FILL, FILL);
evas_object_size_hint_min_set(rect,
@ -42,26 +42,26 @@ evisum_ui_tab_add(Evas_Object *parent, Evas_Object **alias, const char *text,
eina_slstr_printf("%s", text));
elm_layout_content_set(btn, "elm.swallow.content", lb);
elm_table_pack(tbl, rect, 0, 0, 1, 1);
elm_table_pack(tbl, btn, 0, 0, 1, 1);
elm_table_pack(tb, rect, 0, 0, 1, 1);
elm_table_pack(tb, btn, 0, 0, 1, 1);
if (alias)
*alias = btn;
return tbl;
return tb;
}
Evas_Object *
evisum_ui_button_add(Evas_Object *parent, Evas_Object **alias, const char *text,
const char *icon, Evas_Smart_Cb clicked_cb, void *data)
{
Evas_Object *tbl, *rect, *btn, *lb, *hbx, *ic;
Evas_Object *tb, *rect, *btn, *lb, *hbx, *ic;
tbl = elm_table_add(parent);
evas_object_size_hint_weight_set(tbl, EXPAND, EXPAND);
evas_object_size_hint_align_set(tbl, FILL, FILL);
tb = elm_table_add(parent);
evas_object_size_hint_weight_set(tb, EXPAND, EXPAND);
evas_object_size_hint_align_set(tb, FILL, FILL);
rect = evas_object_rectangle_add(tbl);
rect = evas_object_rectangle_add(evas_object_evas_get(tb));
evas_object_size_hint_min_set(rect, ELM_SCALE_SIZE(BTN_WIDTH),
ELM_SCALE_SIZE(BTN_HEIGHT));
@ -95,13 +95,13 @@ evisum_ui_button_add(Evas_Object *parent, Evas_Object **alias, const char *text,
elm_box_pack_end(hbx, lb);
elm_layout_content_set(btn, "elm.swallow.content", hbx);
elm_table_pack(tbl, rect, 0, 0, 1, 1);
elm_table_pack(tbl, btn, 0, 0, 1, 1);
elm_table_pack(tb, rect, 0, 0, 1, 1);
elm_table_pack(tb, btn, 0, 0, 1, 1);
if (alias)
*alias = btn;
return tbl;
return tb;
}
const char *
@ -391,7 +391,7 @@ evisum_about_window_show(void *data)
{
Ui *ui;
Animate_Data *about;
Evas_Object *win, *bg, *tbl, *version, *lb, *btn, *im;
Evas_Object *win, *bg, *tb, *version, *lb, *btn, *im;
Evas_Object *hbx, *rec, *pad, *br;
Evas_Coord x, y, w, h;
Evas_Coord iw, ih;
@ -452,10 +452,10 @@ evisum_about_window_show(void *data)
evas_object_size_hint_max_set(bg, ELM_SCALE_SIZE(320),
ELM_SCALE_SIZE(400));
tbl = elm_table_add(win);
evas_object_show(tbl);
elm_win_resize_object_add(win, tbl);
elm_table_align_set(tbl, 0, 0);
tb = elm_table_add(win);
evas_object_show(tb);
elm_win_resize_object_add(win, tb);
elm_table_align_set(tb, 0, 0);
pad = elm_frame_add(win);
evas_object_size_hint_weight_set(pad, EXPAND, EXPAND);
@ -549,11 +549,11 @@ evisum_about_window_show(void *data)
evas_object_smart_callback_add(btn, "clicked", _btn_close_cb, about);
elm_object_part_content_set(bg, "elm.swallow.content", pad);
elm_table_pack(tbl, im, 0, 1, 1, 1);
elm_table_pack(tbl, rec, 0, 0, 1, 1);
elm_table_pack(tbl, hbx, 0, 0, 1, 1);
elm_object_content_set(win, tbl);
evas_object_event_callback_add(tbl, EVAS_CALLBACK_KEY_DOWN, _win_key_down_cb, about);
elm_table_pack(tb, im, 0, 1, 1, 1);
elm_table_pack(tb, rec, 0, 0, 1, 1);
elm_table_pack(tb, hbx, 0, 0, 1, 1);
elm_object_content_set(win, tb);
evas_object_event_callback_add(tb, EVAS_CALLBACK_KEY_DOWN, _win_key_down_cb, about);
evas_object_show(win);
}