diff --git a/src/bin/evisum_config.c b/src/bin/evisum_config.c index c0fe291..15e97d1 100644 --- a/src/bin/evisum_config.c +++ b/src/bin/evisum_config.c @@ -105,5 +105,5 @@ config_save(Evisum_Config *cfg) eet_write(f, "Config", cfg, sizeof(Evisum_Config), 0); eet_close(f); - return EINA_TRUE; + return 1; } diff --git a/src/bin/evisum_server.c b/src/bin/evisum_server.c index 7bf6a8a..e18e50e 100644 --- a/src/bin/evisum_server.c +++ b/src/bin/evisum_server.c @@ -56,15 +56,15 @@ evisum_server_init(void *data) { Ui *ui = data; Evisum_Server *server = calloc(1, sizeof(Evisum_Server)); - if (!server) return EINA_FALSE; + if (!server) return 0; server->srv = ecore_con_server_add(ECORE_CON_LOCAL_USER, LISTEN_SOCKET_NAME, 0, NULL); - if (!server->srv) return EINA_FALSE; + if (!server->srv) return 0; server->handler = ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DATA, _evisum_server_server_client_connect_cb, ui); _evisum_server = server; - return EINA_TRUE; + return 1; } typedef struct _Evisum_Server_Client { @@ -136,10 +136,10 @@ evisum_server_client_add(Evisum_Action action, int pid) Ecore_Con_Server *srv = ecore_con_server_connect(ECORE_CON_LOCAL_USER, LISTEN_SOCKET_NAME, 0, NULL); if (!srv) - return EINA_FALSE; + return 0; client = calloc(1, sizeof(Evisum_Server_Client)); - if (!client) return EINA_FALSE; + if (!client) return 0; client->action = action; client->pid = pid; diff --git a/src/bin/main.c b/src/bin/main.c index 5e1273a..1b246eb 100644 --- a/src/bin/main.c +++ b/src/bin/main.c @@ -20,7 +20,7 @@ _shutdown_cb(void *data, int type, void *event EINA_UNUSED) if (ui->sensors.win) evas_object_del(ui->sensors.win); if (ui->proc.win) evas_object_del(ui->proc.win); - return EINA_FALSE; + return 0; } static void diff --git a/src/bin/system/filesystems.c b/src/bin/system/filesystems.c index e6e350a..35b6499 100644 --- a/src/bin/system/filesystems.c +++ b/src/bin/system/filesystems.c @@ -111,15 +111,15 @@ file_system_in_use(const char *name) { Eina_List *list; File_System *fs; - Eina_Bool mounted = EINA_FALSE; + Eina_Bool mounted = 0; - if (!name) return EINA_FALSE; + if (!name) return 0; list = file_system_info_all_get(); EINA_LIST_FREE(list, fs) { if (fs->type_name && (!strcasecmp(fs->type_name, name))) - mounted = EINA_TRUE; + mounted = 1; file_system_info_free(fs); } diff --git a/src/bin/system/process.c b/src/bin/system/process.c index 4d9627d..18e9637 100644 --- a/src/bin/system/process.c +++ b/src/bin/system/process.c @@ -44,7 +44,7 @@ #include "macros.h" -static Eina_Bool _show_kthreads = EINA_TRUE; +static Eina_Bool _show_kthreads = 1; void proc_info_kthreads_show_set(Eina_Bool enabled) @@ -304,7 +304,7 @@ _stat(const char *path, Stat *st) memset(st, 0, sizeof(Stat)); f = fopen(path, "r"); - if (!f) return EINA_FALSE; + if (!f) return 0; if (fgets(line, sizeof(line), f)) { @@ -325,12 +325,12 @@ _stat(const char *path, Stat *st) } fclose(f); - if (res != 42) return EINA_FALSE; + if (res != 42) return 0; st->start_time /= sysconf(_SC_CLK_TCK); st->start_time += boot_time; - return EINA_TRUE; + return 1; } static Eina_List * @@ -859,7 +859,7 @@ _cmd_get(Proc_Info *p, struct kinfo_proc *kp) kvm_t * kern; char **args; char name[4096]; - Eina_Bool have_command = EINA_FALSE; + Eina_Bool have_command = 0; kern = kvm_open(NULL, "/dev/null", NULL, O_RDONLY, "kvm_open"); if (kern) @@ -875,7 +875,7 @@ _cmd_get(Proc_Info *p, struct kinfo_proc *kp) if (ecore_file_exists(base)) { snprintf(name, sizeof(name), "%s", basename(base)); - have_command = EINA_TRUE; + have_command = 1; } free(base); } @@ -970,7 +970,7 @@ _process_list_freebsd_fallback_get(void) if (kp.ki_flag & P_KPROC && !proc_info_kthreads_show_get()) continue; - Proc_Info *p = _proc_thread_info(&kp, EINA_FALSE); + Proc_Info *p = _proc_thread_info(&kp, 0); if (p) list = eina_list_append(list, p); } @@ -1005,7 +1005,7 @@ _process_list_freebsd_get(void) kp = &kps[i]; - Proc_Info *p = _proc_thread_info(kp, EINA_FALSE); + Proc_Info *p = _proc_thread_info(kp, 0); if (p) list = eina_list_append(list, p); } @@ -1032,7 +1032,7 @@ _proc_info_by_pid_fallback(int pid) if (sysctl(mib, 4, &kp, &len, NULL, 0) == -1) return NULL; - Proc_Info *p = _proc_thread_info(&kp, EINA_FALSE); + Proc_Info *p = _proc_thread_info(&kp, 0); return p; } @@ -1066,10 +1066,10 @@ proc_info_by_pid(int pid) continue; kp = &kps[i]; - Proc_Info *t = _proc_thread_info(kp, EINA_TRUE); + Proc_Info *t = _proc_thread_info(kp, 1); if (!p) { - p = _proc_thread_info(kp, EINA_FALSE); + p = _proc_thread_info(kp, 0); p->cpu_time = 0; } diff --git a/src/bin/ui/ui.c b/src/bin/ui/ui.c index 5b260c6..ee6e6e8 100644 --- a/src/bin/ui/ui.c +++ b/src/bin/ui/ui.c @@ -20,7 +20,7 @@ void evisum_ui_config_save(Ui *ui) { Evas_Coord x, y, w, h; - Eina_Bool notify = EINA_FALSE; + Eina_Bool notify = 0; if (!_evisum_config) return; @@ -35,7 +35,7 @@ evisum_ui_config_save(Ui *ui) (_evisum_config->proc.show_scroller != ui->proc.show_scroller) ) { - notify = EINA_TRUE; + notify = 1; } _evisum_config->proc.width = ui->proc.width; @@ -339,7 +339,7 @@ _main_menu_focus_timer_cb(void *data) elm_object_focus_set(inst->it_focus, 1); inst->timer = NULL; - return EINA_FALSE; + return 0; } Evas_Object * @@ -613,7 +613,7 @@ evisum_ui_init(void) if (!ui) return NULL; ui->proc.poll_delay = 3; - ui->proc.sort_reverse = EINA_FALSE; + ui->proc.sort_reverse = 0; ui->proc.sort_type = SORT_BY_PID; ui->program_pid = getpid(); diff --git a/src/bin/ui/ui_cache.c b/src/bin/ui/ui_cache.c index 47d49e8..4d2bd80 100644 --- a/src/bin/ui/ui_cache.c +++ b/src/bin/ui/ui_cache.c @@ -113,9 +113,9 @@ evisum_ui_item_cache_item_release(Evisum_Ui_Cache *cache, Evas_Object *obj) { Item_Cache *it; Eina_List *l, *l_next; - Eina_Bool released = EINA_FALSE; + Eina_Bool released = 0; - if (!cache->active) return EINA_FALSE; + if (!cache->active) return 0; int n = eina_list_count(cache->inactive); EINA_LIST_FOREACH_SAFE(cache->active, l, l_next, it) @@ -133,7 +133,7 @@ evisum_ui_item_cache_item_release(Evisum_Ui_Cache *cache, Evas_Object *obj) evas_object_hide(it->obj); cache->inactive = eina_list_prepend(cache->inactive, it); } - released = EINA_TRUE; + released = 1; break; } } diff --git a/src/bin/ui/ui_cpu.c b/src/bin/ui/ui_cpu.c index 149c4e3..a3f395c 100644 --- a/src/bin/ui/ui_cpu.c +++ b/src/bin/ui/ui_cpu.c @@ -139,11 +139,11 @@ _core_times_main_cb(void *data, Ecore_Thread *thread) int ncpu; if (!system_cpu_frequency_min_max_get(&ad->freq_min, &ad->freq_max)) - ad->cpu_freq = EINA_TRUE; + ad->cpu_freq = 1; system_cpu_temperature_min_max_get(&ad->temp_min, &ad->temp_max); if ((system_cpu_n_temperature_get(0)) != -1) - ad->cpu_temp = EINA_TRUE; + ad->cpu_temp = 1; while (!ecore_thread_check(thread)) { @@ -177,7 +177,7 @@ _update(Animate *ad, Core *cores) unsigned int *pixels, *pix; Evas_Coord x, y, w, h; int iw, stride; - Eina_Bool clear = EINA_FALSE; + Eina_Bool clear = 0; evas_object_geometry_get(obj, &x, &y, &w, &h); evas_object_image_size_get(obj, &iw, NULL); @@ -186,11 +186,11 @@ _update(Animate *ad, Core *cores) if (iw != w) { evas_object_image_size_set(obj, w, ad->cpu_count * 3); - clear = EINA_TRUE; + clear = 1; } // get pixel data ptr - pixels = evas_object_image_data_get(obj, EINA_TRUE); + pixels = evas_object_image_data_get(obj, 1); if (!pixels) return; // get stride (# of bytes per line) stride = evas_object_image_stride_get(obj); @@ -415,7 +415,7 @@ _colors_fill(Evas_Object *colors) unsigned int *pixels; evas_object_image_size_set(colors, 101, 3); - pixels = evas_object_image_data_get(colors, EINA_TRUE); + pixels = evas_object_image_data_get(colors, 1); if (!pixels) return; stride = evas_object_image_stride_get(colors); // cpu percent (first row) @@ -493,11 +493,11 @@ _graph(Ui *ui, Evas_Object *parent) ad->win = ui->cpu.win; ad->cpu_count = system_cpu_count_get(); if (!system_cpu_frequency_min_max_get(&ad->freq_min, &ad->freq_max)) - ad->cpu_freq = EINA_TRUE; + ad->cpu_freq = 1; system_cpu_temperature_min_max_get(&ad->temp_min, &ad->temp_max); if ((system_cpu_n_temperature_get(0)) != -1) - ad->cpu_temp = EINA_TRUE; + ad->cpu_temp = 1; ad->cpu_order = malloc((ad->cpu_count) * sizeof(int)); for (i = 0; i < ad->cpu_count; i++) @@ -519,9 +519,9 @@ _graph(Ui *ui, Evas_Object *parent) obj = evas_object_image_add(evas_object_evas_get(parent)); evas_object_size_hint_align_set(obj, FILL, FILL); evas_object_size_hint_weight_set(obj, EXPAND, EXPAND); - evas_object_image_smooth_scale_set(obj, EINA_FALSE); - evas_object_image_filled_set(obj, EINA_TRUE); - evas_object_image_alpha_set(obj, EINA_FALSE); + evas_object_image_smooth_scale_set(obj, 0); + evas_object_image_filled_set(obj, 1); + evas_object_image_alpha_set(obj, 0); evas_object_show(obj); elm_table_pack(tbl, obj, 0, 0, 5, ad->cpu_count); @@ -645,9 +645,9 @@ _graph(Ui *ui, Evas_Object *parent) (colors, 100, COLORS_HEIGHT * elm_config_scale_get()); evas_object_size_hint_align_set(colors, FILL, FILL); evas_object_size_hint_weight_set(colors, EXPAND, EXPAND); - evas_object_image_smooth_scale_set(colors, EINA_FALSE); - evas_object_image_filled_set(colors, EINA_TRUE); - evas_object_image_alpha_set(colors, EINA_FALSE); + evas_object_image_smooth_scale_set(colors, 0); + evas_object_image_filled_set(colors, 1); + evas_object_image_alpha_set(colors, 0); _colors_fill(colors); elm_table_pack(tbl, colors, 0, 0, 2, 3); evas_object_show(colors); @@ -709,11 +709,11 @@ _graph(Ui *ui, Evas_Object *parent) elm_box_pack_end(box, fr); fr = elm_frame_add(box); - elm_frame_autocollapse_set(fr, EINA_TRUE); + elm_frame_autocollapse_set(fr, 1); evas_object_size_hint_align_set(fr, FILL, FILL); evas_object_size_hint_weight_set(fr, EXPAND, 0); evas_object_show(fr); - elm_frame_collapse_set(fr, EINA_TRUE); + elm_frame_collapse_set(fr, 1); elm_object_text_set(fr, _("Options")); elm_box_pack_end(box, fr); @@ -766,7 +766,7 @@ _graph(Ui *ui, Evas_Object *parent) _core_times_feedback_cb, NULL, NULL, - ad, EINA_TRUE); + ad, 1); return ad; } @@ -792,7 +792,7 @@ ui_cpu_win_add(Ui *ui) ui->cpu.win = win = elm_win_util_standard_add("evisum", _("CPU Activity")); - elm_win_autodel_set(win, EINA_TRUE); + elm_win_autodel_set(win, 1); evas_object_size_hint_weight_set(win, EXPAND, EXPAND); evas_object_size_hint_align_set(win, FILL, FILL); evisum_ui_background_random_add(win, diff --git a/src/bin/ui/ui_disk.c b/src/bin/ui/ui_disk.c index 8ee0f21..d621d09 100644 --- a/src/bin/ui/ui_disk.c +++ b/src/bin/ui/ui_disk.c @@ -578,7 +578,7 @@ ui_disk_win_add(Ui *ui) } ui->disk.win = win = elm_win_util_standard_add("evisum", _("Storage")); - elm_win_autodel_set(win, EINA_TRUE); + elm_win_autodel_set(win, 1); evas_object_size_hint_weight_set(win, EXPAND, EXPAND); evas_object_size_hint_align_set(win, FILL, FILL); evisum_ui_background_random_add(win, @@ -720,6 +720,6 @@ ui_disk_win_add(Ui *ui) _disks_poll_feedback_cb, NULL, NULL, - pd, EINA_TRUE); + pd, 1); } diff --git a/src/bin/ui/ui_memory.c b/src/bin/ui/ui_memory.c index 91a8ee9..316ece8 100644 --- a/src/bin/ui/ui_memory.c +++ b/src/bin/ui/ui_memory.c @@ -104,13 +104,13 @@ _update_widgets(Ui_Data *pd, meminfo_t *memory) pb = pd->swap; if (memory->swap_total) { - elm_object_disabled_set(pb, EINA_FALSE); + elm_object_disabled_set(pb, 0); ratio = memory->swap_total / 100.0; value = memory->swap_used / ratio; } else { - elm_object_disabled_set(pb, EINA_TRUE); + elm_object_disabled_set(pb, 1); value = 0.0; } @@ -124,8 +124,8 @@ _update_widgets(Ui_Data *pd, meminfo_t *memory) { pb = pd->video[i]; if (!pb) break; - if (memory->video[i].total) elm_object_disabled_set(pb, EINA_FALSE); - else elm_object_disabled_set(pb, EINA_TRUE); + if (memory->video[i].total) elm_object_disabled_set(pb, 0); + else elm_object_disabled_set(pb, 1); ratio = memory->video[i].total / 100.0; value = memory->video[i].used / ratio; elm_progressbar_value_set(pb, value / 100); @@ -226,7 +226,7 @@ ui_mem_win_add(Ui *ui) ui->mem.win = win = elm_win_util_standard_add("evisum", _("Memory Usage")); pd->win = win; - elm_win_autodel_set(win, EINA_TRUE); + elm_win_autodel_set(win, 1); evas_object_size_hint_weight_set(win, EXPAND, EXPAND); evas_object_size_hint_align_set(win, FILL, FILL); evisum_ui_background_random_add(win, @@ -306,5 +306,5 @@ ui_mem_win_add(Ui *ui) _mem_usage_feedback_cb, NULL, NULL, - pd, EINA_TRUE); + pd, 1); } diff --git a/src/bin/ui/ui_process_list.c b/src/bin/ui/ui_process_list.c index 097efa4..30cccf4 100644 --- a/src/bin/ui/ui_process_list.c +++ b/src/bin/ui/ui_process_list.c @@ -585,7 +585,7 @@ _bring_in(void *data) elm_genlist_realized_items_update(pd->genlist); evas_object_show(pd->genlist); - return EINA_FALSE; + return 0; } static Eina_List * @@ -1193,7 +1193,7 @@ _item_pid_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) it = event_info; - elm_genlist_item_selected_set(it, EINA_FALSE); + elm_genlist_item_selected_set(it, 0); if (pd->menu) return; proc = elm_object_item_data_get(it); @@ -1279,7 +1279,7 @@ _ui_content_system_add(Ui_Data *pd, Evas_Object *parent) pd->btn_cmd = btn = elm_button_add(parent); _btn_icon_state_init(btn, (ui->proc.sort_type == SORT_BY_CMD ? - ui->proc.sort_reverse : EINA_FALSE), + ui->proc.sort_reverse : 0), ui->proc.sort_type == SORT_BY_CMD); evas_object_size_hint_weight_set(btn, 1.0, 0); evas_object_size_hint_align_set(btn, FILL, FILL); @@ -1292,7 +1292,7 @@ _ui_content_system_add(Ui_Data *pd, Evas_Object *parent) pd->btn_pid = btn = elm_button_add(parent); _btn_icon_state_init(btn, (ui->proc.sort_type == SORT_BY_PID ? - ui->proc.sort_reverse : EINA_FALSE), + ui->proc.sort_reverse : 0), ui->proc.sort_type == SORT_BY_PID); evas_object_size_hint_weight_set(btn, 0, 0); evas_object_size_hint_align_set(btn, FILL, FILL); @@ -1305,7 +1305,7 @@ _ui_content_system_add(Ui_Data *pd, Evas_Object *parent) pd->btn_pri = btn = elm_button_add(parent); _btn_icon_state_init(btn, (ui->proc.sort_type == SORT_BY_PRI ? - ui->proc.sort_reverse : EINA_FALSE), + ui->proc.sort_reverse : 0), ui->proc.sort_type == SORT_BY_PRI); evas_object_size_hint_weight_set(btn, 0, 0); evas_object_size_hint_align_set(btn, FILL, FILL); @@ -1318,7 +1318,7 @@ _ui_content_system_add(Ui_Data *pd, Evas_Object *parent) pd->btn_nice = btn = elm_button_add(parent); _btn_icon_state_init(btn, (ui->proc.sort_type == SORT_BY_NICE ? - ui->proc.sort_reverse : EINA_FALSE), + ui->proc.sort_reverse : 0), ui->proc.sort_type == SORT_BY_NICE); evas_object_size_hint_weight_set(btn, 0, 0); evas_object_size_hint_align_set(btn, FILL, FILL); @@ -1331,7 +1331,7 @@ _ui_content_system_add(Ui_Data *pd, Evas_Object *parent) pd->btn_uid = btn = elm_button_add(parent); _btn_icon_state_init(btn, (ui->proc.sort_type == SORT_BY_UID ? - ui->proc.sort_reverse : EINA_FALSE), + ui->proc.sort_reverse : 0), ui->proc.sort_type == SORT_BY_UID); evas_object_size_hint_weight_set(btn, 1.0, 0); evas_object_size_hint_align_set(btn, FILL, FILL); @@ -1344,7 +1344,7 @@ _ui_content_system_add(Ui_Data *pd, Evas_Object *parent) pd->btn_size = btn = elm_button_add(parent); _btn_icon_state_init(btn, (ui->proc.sort_type == SORT_BY_SIZE ? - ui->proc.sort_reverse : EINA_FALSE), + ui->proc.sort_reverse : 0), ui->proc.sort_type == SORT_BY_SIZE); evas_object_size_hint_weight_set(btn, 1.0, 0); evas_object_size_hint_align_set(btn, FILL, FILL); @@ -1357,7 +1357,7 @@ _ui_content_system_add(Ui_Data *pd, Evas_Object *parent) pd->btn_rss = btn = elm_button_add(parent); _btn_icon_state_init(btn, (ui->proc.sort_type == SORT_BY_RSS ? - ui->proc.sort_reverse : EINA_FALSE), + ui->proc.sort_reverse : 0), ui->proc.sort_type == SORT_BY_RSS); evas_object_size_hint_weight_set(btn, 1.0, 0); evas_object_size_hint_align_set(btn, FILL, FILL); @@ -1370,7 +1370,7 @@ _ui_content_system_add(Ui_Data *pd, Evas_Object *parent) pd->btn_threads = btn = elm_button_add(parent); _btn_icon_state_init(btn, (ui->proc.sort_type == SORT_BY_STATE ? - ui->proc.sort_reverse : EINA_FALSE), + ui->proc.sort_reverse : 0), ui->proc.sort_type == SORT_BY_STATE); evas_object_size_hint_weight_set(btn, 0, 0); evas_object_size_hint_align_set(btn, FILL, FILL); @@ -1383,7 +1383,7 @@ _ui_content_system_add(Ui_Data *pd, Evas_Object *parent) 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 : EINA_FALSE), + ui->proc.sort_reverse : 0), ui->proc.sort_type == SORT_BY_CPU); evas_object_size_hint_weight_set(btn, 0, 0); evas_object_size_hint_align_set(btn, FILL, FILL); @@ -1396,7 +1396,7 @@ _ui_content_system_add(Ui_Data *pd, Evas_Object *parent) pd->btn_state = btn = elm_button_add(parent); _btn_icon_state_init(btn, (ui->proc.sort_type == SORT_BY_STATE ? - ui->proc.sort_reverse : EINA_FALSE), + ui->proc.sort_reverse : 0), ui->proc.sort_type == SORT_BY_STATE); evas_object_size_hint_weight_set(btn, 0, 0); evas_object_size_hint_align_set(btn, FILL, FILL); @@ -1409,7 +1409,7 @@ _ui_content_system_add(Ui_Data *pd, Evas_Object *parent) pd->btn_cpu_usage = btn = elm_button_add(parent); _btn_icon_state_init(btn, (ui->proc.sort_type == SORT_BY_CPU_USAGE ? - ui->proc.sort_reverse : EINA_FALSE), + ui->proc.sort_reverse : 0), ui->proc.sort_type == SORT_BY_CPU_USAGE); evas_object_size_hint_weight_set(btn, EXPAND, 0); evas_object_size_hint_align_set(btn, FILL, FILL); @@ -1427,7 +1427,7 @@ _ui_content_system_add(Ui_Data *pd, Evas_Object *parent) (ui->proc.show_scroller ? ELM_SCROLLER_POLICY_AUTO : ELM_SCROLLER_POLICY_OFF)); - elm_genlist_multi_select_set(glist, EINA_FALSE); + elm_genlist_multi_select_set(glist, 0); evas_object_size_hint_weight_set(glist, EXPAND, EXPAND); evas_object_size_hint_align_set(glist, FILL, FILL); elm_table_pack(tbl, glist, 0, 2, i, 1); @@ -1468,7 +1468,7 @@ _search_empty_cb(void *data) pd->search_visible = 0; pd->search_timer = NULL; pd->skip_wait = 1; - return EINA_FALSE; + return 0; } if (pd->search_keytime && @@ -1478,7 +1478,7 @@ _search_empty_cb(void *data) pd->search_keytime = 0; } - return EINA_TRUE; + return 1; } static void @@ -1621,7 +1621,7 @@ _resize_cb(void *data) pd->skip_wait = 0; pd->resize_timer = NULL; - return EINA_FALSE; + return 0; } static void @@ -1675,7 +1675,7 @@ _evisum_config_changed_cb(void *data, int type EINA_UNUSED, ELM_SCROLLER_POLICY_OFF)); pd->skip_wait = 1; - return EINA_TRUE; + return 1; } static void @@ -1767,7 +1767,7 @@ ui_process_list_win_add(Ui *ui) _init(pd); ui->proc.win = pd->win = win = elm_win_util_standard_add("evisum", "evisum"); - elm_win_autodel_set(win, EINA_TRUE); + elm_win_autodel_set(win, 1); elm_win_title_set(win, _("Process Explorer")); icon = elm_icon_add(win); elm_icon_standard_set(icon, "evisum"); @@ -1806,6 +1806,6 @@ ui_process_list_win_add(Ui *ui) _process_list_feedback_cb, NULL, NULL, - pd, EINA_FALSE); + pd, 0); } diff --git a/src/bin/ui/ui_process_view.c b/src/bin/ui/ui_process_view.c index 6c51aaf..ca3e8c0 100644 --- a/src/bin/ui/ui_process_view.c +++ b/src/bin/ui/ui_process_view.c @@ -541,7 +541,7 @@ _item_children_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, it = event_info; - elm_genlist_item_selected_set(it, EINA_FALSE); + elm_genlist_item_selected_set(it, 0); proc = elm_object_item_data_get(it); if (!proc) return; @@ -641,7 +641,7 @@ _children_view_update(void *data) elm_genlist_clear(pd->genlist_children); - if (pd->selected_pid == 0) return EINA_FALSE; + if (pd->selected_pid == 0) return 0; children = proc_info_pid_children_get(pd->selected_pid); EINA_LIST_FOREACH(children, l, child) @@ -660,7 +660,7 @@ _children_view_update(void *data) if (child) proc_info_free(child); - return EINA_TRUE; + return 1; } static void @@ -687,7 +687,7 @@ _graph_update(Ui_Data *pd, Proc_Info *proc) unsigned int *pixels, *pix; Evas_Coord x, y, w, h; int iw, stride; - Eina_Bool clear = EINA_FALSE; + Eina_Bool clear = 0; evas_object_geometry_get(obj, &x, &y, &w, &h); evas_object_image_size_get(obj, &iw, NULL); @@ -695,10 +695,10 @@ _graph_update(Ui_Data *pd, Proc_Info *proc) if (iw != w) { evas_object_image_size_set(obj, w, pd->graph.cpu_count); - clear = EINA_TRUE; + clear = 1; } - pixels = evas_object_image_data_get(obj, EINA_TRUE); + pixels = evas_object_image_data_get(obj, 1); if (!pixels) return; stride = evas_object_image_stride_get(obj); @@ -747,9 +747,9 @@ _graph(Evas_Object *parent, Ui_Data *pd) pd->graph.obj = obj = evas_object_image_add(evas_object_evas_get(parent)); evas_object_size_hint_align_set(obj, FILL, FILL); evas_object_size_hint_weight_set(obj, EXPAND, EXPAND); - evas_object_image_smooth_scale_set(obj, EINA_FALSE); - evas_object_image_filled_set(obj, EINA_TRUE); - evas_object_image_alpha_set(obj, EINA_FALSE); + evas_object_image_smooth_scale_set(obj, 0); + evas_object_image_filled_set(obj, 1); + evas_object_image_alpha_set(obj, 0); evas_object_show(obj); evas_object_size_hint_min_set(obj, 100, @@ -807,9 +807,9 @@ _proc_gone(Ui_Data *pd) pd->selected_cmd, pd->selected_pid)); - elm_object_disabled_set(pd->btn_start, EINA_TRUE); - elm_object_disabled_set(pd->btn_stop, EINA_TRUE); - elm_object_disabled_set(pd->btn_kill, EINA_TRUE); + elm_object_disabled_set(pd->btn_start, 1); + elm_object_disabled_set(pd->btn_stop, 1); + elm_object_disabled_set(pd->btn_kill, 1); if (!ecore_thread_check(pd->thread)) ecore_thread_cancel(pd->thread); @@ -850,6 +850,11 @@ _proc_info_feedback_cb(void *data, Ecore_Thread *thread, void *msg) return; } + if (proc->children) + elm_object_focus_allow_set(pd->genlist_children, 1); + else + elm_object_focus_allow_set(pd->genlist_children, 0); + if (pd->pid_cpu_time && proc->cpu_time >= pd->pid_cpu_time) cpu_usage = (double)(proc->cpu_time - pd->pid_cpu_time) / pd->poll_delay; @@ -869,13 +874,13 @@ _proc_info_feedback_cb(void *data, Ecore_Thread *thread, void *msg) pd->poll_count++; if (!strcmp(proc->state, "stop")) { - elm_object_disabled_set(pd->btn_stop, EINA_TRUE); - elm_object_disabled_set(pd->btn_start, EINA_FALSE); + elm_object_disabled_set(pd->btn_stop, 1); + elm_object_disabled_set(pd->btn_start, 0); } else { - elm_object_disabled_set(pd->btn_stop, EINA_FALSE); - elm_object_disabled_set(pd->btn_start, EINA_TRUE); + elm_object_disabled_set(pd->btn_stop, 0); + elm_object_disabled_set(pd->btn_start, 1); } elm_object_text_set(pd->entry_pid_cmd, @@ -970,9 +975,9 @@ _entry_add(Evas_Object *parent) Evas_Object *entry = elm_entry_add(parent); evas_object_size_hint_weight_set(entry, EXPAND, EXPAND); evas_object_size_hint_align_set(entry, FILL, FILL); - elm_entry_single_line_set(entry, EINA_TRUE); - elm_entry_scrollable_set(entry, EINA_TRUE); - elm_entry_editable_set(entry, EINA_FALSE); + elm_entry_single_line_set(entry, 1); + elm_entry_scrollable_set(entry, 1); + elm_entry_editable_set(entry, 0); elm_entry_line_wrap_set(entry, ELM_WRAP_NONE); evas_object_show(entry); @@ -1126,8 +1131,8 @@ _process_tab_add(Evas_Object *parent, Ui_Data *pd) hbx = elm_box_add(parent); evas_object_size_hint_weight_set(hbx, EXPAND, 0); evas_object_size_hint_align_set(hbx, 1.0, FILL); - elm_box_horizontal_set(hbx, EINA_TRUE); - elm_box_homogeneous_set(hbx, EINA_TRUE); + 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); @@ -1278,7 +1283,7 @@ _threads_tab_add(Evas_Object *parent, Ui_Data *pd) hbx = elm_box_add(bx2); evas_object_size_hint_weight_set(hbx, EXPAND, 0); evas_object_size_hint_align_set(hbx, FILL, FILL); - elm_box_horizontal_set(hbx, EINA_TRUE); + elm_box_horizontal_set(hbx, 1); evas_object_show(hbx); elm_box_pack_end(bx2, hbx); @@ -1329,8 +1334,8 @@ _threads_tab_add(Evas_Object *parent, Ui_Data *pd) pd->genlist_threads = genlist = elm_genlist_add(parent); evas_object_data_set(genlist, "ui", pd); - elm_object_focus_allow_set(genlist, EINA_FALSE); - elm_genlist_homogeneous_set(genlist, EINA_TRUE); + elm_object_focus_allow_set(genlist, 0); + elm_genlist_homogeneous_set(genlist, 1); elm_genlist_select_mode_set(genlist, ELM_OBJECT_SELECT_MODE_NONE); elm_scroller_policy_set(genlist, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO); @@ -1364,8 +1369,8 @@ _children_tab_add(Evas_Object *parent, Ui_Data *pd) pd->genlist_children = genlist = elm_genlist_add(parent); evas_object_data_set(genlist, "ui", pd); - elm_object_focus_allow_set(genlist, EINA_TRUE); - elm_genlist_homogeneous_set(genlist, EINA_TRUE); + elm_object_focus_allow_set(genlist, 1); + elm_genlist_homogeneous_set(genlist, 1); elm_genlist_select_mode_set(genlist, ELM_OBJECT_SELECT_MODE_DEFAULT); evas_object_size_hint_weight_set(genlist, EXPAND, EXPAND); evas_object_size_hint_align_set(genlist, FILL, FILL); @@ -1398,10 +1403,10 @@ _manual_tab_add(Evas_Object *parent, Ui_Data *pd) pd->entry_manual = entry = elm_entry_add(bx); evas_object_size_hint_weight_set(entry, EXPAND, EXPAND); evas_object_size_hint_align_set(entry, FILL, FILL); - elm_entry_single_line_set(entry, EINA_FALSE); + elm_entry_single_line_set(entry, 0); elm_entry_line_wrap_set(entry, ELM_WRAP_NONE); - elm_entry_editable_set(entry, EINA_FALSE); - elm_entry_scrollable_set(entry, EINA_TRUE); + elm_entry_editable_set(entry, 0); + elm_entry_scrollable_set(entry, 1); evas_object_show(entry); elm_box_pack_end(bx, entry); @@ -1417,10 +1422,10 @@ _tab_change(Ui_Data *pd, Evas_Object *view, Evas_Object *obj) { Elm_Transit *trans; - elm_object_disabled_set(pd->tab_main, EINA_FALSE); - elm_object_disabled_set(pd->tab_children, EINA_FALSE); - elm_object_disabled_set(pd->tab_thread, EINA_FALSE); - elm_object_disabled_set(pd->tab_manual, EINA_FALSE); + elm_object_disabled_set(pd->tab_main, 0); + elm_object_disabled_set(pd->tab_children, 0); + elm_object_disabled_set(pd->tab_thread, 0); + elm_object_disabled_set(pd->tab_manual, 0); evas_object_hide(pd->main_view); evas_object_hide(pd->children_view); evas_object_hide(pd->manual_view); @@ -1436,7 +1441,7 @@ _tab_change(Ui_Data *pd, Evas_Object *view, Evas_Object *obj) evas_object_show(view); elm_transit_go(trans); - elm_object_disabled_set(obj, EINA_TRUE); + elm_object_disabled_set(obj, 1); } static void @@ -1520,7 +1525,7 @@ _tab_manual_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, unsetenv("MANWIDTH"); - pd->manual_init = EINA_TRUE; + pd->manual_init = 1; } static Evas_Object * @@ -1534,7 +1539,7 @@ _tabs_add(Evas_Object *parent, Ui_Data *pd) hbx = elm_box_add(parent); evas_object_size_hint_weight_set(hbx, EXPAND, 0); evas_object_size_hint_align_set(hbx, FILL, 0.5); - elm_box_horizontal_set(hbx, EINA_TRUE); + elm_box_horizontal_set(hbx, 1); evas_object_show(hbx); pad = elm_frame_add(parent); @@ -1685,7 +1690,7 @@ ui_process_view_win_add(int pid, Evisum_Proc_Action action) pd->selected_pid = pid; pd->poll_delay = 1; pd->cache = NULL; - pd->sort_reverse = EINA_TRUE; + pd->sort_reverse = 1; pd->sort_cb = _sort_by_cpu_usage; proc = proc_info_by_pid(pid); @@ -1699,7 +1704,7 @@ ui_process_view_win_add(int pid, Evisum_Proc_Action action) } pd->win = win = elm_win_util_standard_add("evisum", "evisum"); - elm_win_autodel_set(win, EINA_TRUE); + elm_win_autodel_set(win, 1); ic = elm_icon_add(win); elm_icon_standard_set(ic, "evisum"); elm_win_icon_object_set(win, ic); @@ -1748,6 +1753,6 @@ ui_process_view_win_add(int pid, Evisum_Proc_Action action) _proc_info_feedback_cb, NULL, NULL, - pd, EINA_FALSE); + pd, 0); } diff --git a/src/bin/ui/ui_sensors.c b/src/bin/ui/ui_sensors.c index ee951b7..ee7238f 100644 --- a/src/bin/ui/ui_sensors.c +++ b/src/bin/ui/ui_sensors.c @@ -279,7 +279,7 @@ ui_sensors_win_add(Ui *ui) pd->ui = ui; ui->sensors.win = win = elm_win_util_standard_add("evisum", _("Sensors")); - elm_win_autodel_set(win, EINA_TRUE); + elm_win_autodel_set(win, 1); evas_object_size_hint_weight_set(win, EXPAND, EXPAND); evas_object_size_hint_align_set(win, FILL, FILL); evisum_ui_background_random_add(win, @@ -401,6 +401,6 @@ ui_sensors_win_add(Ui *ui) _sensors_update_feedback_cb, NULL, NULL, - pd, EINA_TRUE); + pd, 1); } diff --git a/src/bin/ui/ui_util.c b/src/bin/ui/ui_util.c index 8eb0823..634874c 100644 --- a/src/bin/ui/ui_util.c +++ b/src/bin/ui/ui_util.c @@ -5,7 +5,7 @@ #define ARRAY_SIZE(n) sizeof(n) / sizeof(n[0]) -Eina_Bool _backgrounds_enabled = EINA_FALSE; +Eina_Bool _backgrounds_enabled = 0; #if !defined(__OpenBSD__) static #endif @@ -72,7 +72,7 @@ evisum_ui_button_add(Evas_Object *parent, Evas_Object **alias, const char *text, evas_object_smart_callback_add(btn, "clicked", clicked_cb, data); hbx = elm_box_add(parent); - elm_box_horizontal_set(hbx, EINA_TRUE); + elm_box_horizontal_set(hbx, 1); evas_object_size_hint_weight_set(hbx, 0.0, EXPAND); evas_object_size_hint_align_set(hbx, FILL, FILL); evas_object_show(hbx); @@ -336,7 +336,7 @@ about_anim(void *data) evas_object_geometry_get(ad->bg, NULL, NULL, &w, &h); if (!ix) ix = w / 3; - if (w <= 0 || h <= 0) return EINA_TRUE; + if (w <= 0 || h <= 0) return 1; evas_object_geometry_get(ad->obj, NULL, NULL, NULL, &oh); evas_object_move(ad->obj, 0, ad->pos); evas_object_show(ad->obj); @@ -349,7 +349,7 @@ about_anim(void *data) begin = 1; } - if (!begin) return EINA_TRUE; + if (!begin) return 1; ad->pos2 += 10; @@ -367,7 +367,7 @@ about_anim(void *data) begin = 0; } - return EINA_TRUE; + return 1; } static void @@ -435,7 +435,7 @@ evisum_about_window_show(void *data) } ui->win_about = win = elm_win_util_standard_add("evisum", "evisum"); - elm_win_autodel_set(win, EINA_TRUE); + elm_win_autodel_set(win, 1); elm_win_center(win, 1, 1); elm_win_title_set(win, _("About"));