summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlastair Poole <mail@alastairpoole.com>2021-11-02 20:31:01 +0000
committerAlastair Poole <mail@alastairpoole.com>2021-11-02 20:31:01 +0000
commit7422659f0bd50651c22fcc6441bae2d7e54f04bb (patch)
tree21cecb725027ca68fcfa97d4990154ae2b00d236
parente24890f736f7d080da050827f30dc55ba162b428 (diff)
name: epdum pisdualization naming...
At least pretend to name properly. Adding more visuals...it wasn't designed with this in mind...
-rw-r--r--src/bin/ui/ui_cpu.c64
-rw-r--r--src/bin/ui/ui_cpu.h8
-rw-r--r--src/bin/ui/visuals/cpu_basic.c26
-rw-r--r--src/bin/ui/visuals/cpu_basic.h2
-rw-r--r--src/bin/ui/visuals/cpu_default.c62
-rw-r--r--src/bin/ui/visuals/cpu_default.h2
-rw-r--r--src/bin/ui/visuals/visuals.x2
7 files changed, 83 insertions, 83 deletions
diff --git a/src/bin/ui/ui_cpu.c b/src/bin/ui/ui_cpu.c
index 19e65cd..0718c12 100644
--- a/src/bin/ui/ui_cpu.c
+++ b/src/bin/ui/ui_cpu.c
@@ -42,23 +42,23 @@ _win_mouse_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
42{ 42{
43 Evas_Coord w, h; 43 Evas_Coord w, h;
44 Evas_Event_Mouse_Move *ev; 44 Evas_Event_Mouse_Move *ev;
45 Cpu_Visual *vis = data; 45 Ui_Cpu_Data *pd = data;
46 46
47 ev = event_info; 47 ev = event_info;
48 evas_object_geometry_get(obj, NULL, NULL, &w, &h); 48 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
49 49
50 if ((ev->cur.canvas.x >= (w - 128)) && (ev->cur.canvas.y <= 128)) 50 if ((ev->cur.canvas.x >= (w - 128)) && (ev->cur.canvas.y <= 128))
51 { 51 {
52 if (!vis->btn_visible) 52 if (!pd->btn_visible)
53 { 53 {
54 elm_object_signal_emit(vis->btn_menu, "menu,show", "evisum/menu"); 54 elm_object_signal_emit(pd->btn_menu, "menu,show", "evisum/menu");
55 vis->btn_visible = 1; 55 pd->btn_visible = 1;
56 } 56 }
57 } 57 }
58 else if ((vis->btn_visible) && (!vis->menu)) 58 else if ((pd->btn_visible) && (!pd->menu))
59 { 59 {
60 elm_object_signal_emit(vis->btn_menu, "menu,hide", "evisum/menu"); 60 elm_object_signal_emit(pd->btn_menu, "menu,hide", "evisum/menu");
61 vis->btn_visible = 0; 61 pd->btn_visible = 0;
62 } 62 }
63} 63}
64 64
@@ -85,15 +85,15 @@ _btn_menu_clicked_cb(void *data, Evas_Object *obj,
85 void *event_info EINA_UNUSED) 85 void *event_info EINA_UNUSED)
86{ 86{
87 Evisum_Ui *ui; 87 Evisum_Ui *ui;
88 Cpu_Visual *vis = data; 88 Ui_Cpu_Data *pd = data;
89 89
90 ui = vis->ui; 90 ui = pd->ui;
91 if (!vis->menu) 91 if (!pd->menu)
92 vis->menu = evisum_ui_main_menu_create(ui, ui->cpu.win, obj); 92 pd->menu = evisum_ui_main_menu_create(ui, ui->cpu.win, obj);
93 else 93 else
94 { 94 {
95 evas_object_del(vis->menu); 95 evas_object_del(pd->menu);
96 vis->menu = NULL; 96 pd->menu = NULL;
97 } 97 }
98} 98}
99 99
@@ -116,17 +116,17 @@ _win_move_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info
116static void 116static void
117_win_del_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 117_win_del_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
118{ 118{
119 Cpu_Visual *vis = data; 119 Ui_Cpu_Data *pd = data;
120 Evisum_Ui *ui = vis->ui; 120 Evisum_Ui *ui = pd->ui;
121 121
122 evisum_ui_config_save(ui); 122 evisum_ui_config_save(ui);
123 ecore_thread_cancel(vis->thread); 123 ecore_thread_cancel(pd->thread);
124 ecore_thread_wait(vis->thread, 0.5); 124 ecore_thread_wait(pd->thread, 0.5);
125 125
126 if (vis->ext_free_cb) 126 if (pd->ext_free_cb)
127 vis->ext_free_cb(vis->ext); 127 pd->ext_free_cb(pd->ext);
128 128
129 free(vis); 129 free(pd);
130 ui->cpu.win = NULL; 130 ui->cpu.win = NULL;
131} 131}
132 132
@@ -177,7 +177,7 @@ ui_cpu_visuals_get(void)
177{ 177{
178 Eina_List *l = NULL; 178 Eina_List *l = NULL;
179 179
180 for (int i = 0; (i < sizeof(visualizations) / sizeof(Visualization)); i++) 180 for (int i = 0; (i < sizeof(visualizations) / sizeof(Cpu_Visual)); i++)
181 { 181 {
182 l = eina_list_append(l, strdup(visualizations[i].name)); 182 l = eina_list_append(l, strdup(visualizations[i].name));
183 } 183 }
@@ -185,10 +185,10 @@ ui_cpu_visuals_get(void)
185 return l; 185 return l;
186} 186}
187 187
188Visualization * 188Cpu_Visual *
189ui_cpu_visual_by_name(const char *name) 189ui_cpu_visual_by_name(const char *name)
190{ 190{
191 for (int i = 0; (i < sizeof(visualizations) / sizeof(Visualization)); i++) 191 for (int i = 0; (i < sizeof(visualizations) / sizeof(Cpu_Visual)); i++)
192 { 192 {
193 if (!strcmp(name, visualizations[i].name)) 193 if (!strcmp(name, visualizations[i].name))
194 return &visualizations[i]; 194 return &visualizations[i];
@@ -206,11 +206,11 @@ ui_cpu_win_restart(Evisum_Ui *ui)
206void 206void
207ui_cpu_win_add(Evisum_Ui *ui) 207ui_cpu_win_add(Evisum_Ui *ui)
208{ 208{
209 Cpu_Visual *vis; 209 Ui_Cpu_Data *pd;
210 Evas_Object *win, *box, *scr, *btn, *ic; 210 Evas_Object *win, *box, *scr, *btn, *ic;
211 Evas_Object *tb; 211 Evas_Object *tb;
212 Elm_Layout *lay; 212 Elm_Layout *lay;
213 Visualization *visualization; 213 Cpu_Visual *vis;
214 static Eina_Bool init = 0; 214 static Eina_Bool init = 0;
215 215
216 if (ui->cpu.win) 216 if (ui->cpu.win)
@@ -253,9 +253,9 @@ ui_cpu_win_add(Evisum_Ui *ui)
253 253
254 elm_table_pack(tb, box, 0, 0, 1, 1); 254 elm_table_pack(tb, box, 0, 0, 1, 1);
255 255
256 visualization = ui_cpu_visual_by_name(ui->cpu.visual); 256 vis = ui_cpu_visual_by_name(ui->cpu.visual);
257 vis = visualization->func(box); 257 pd = vis->func(box);
258 vis->ui = ui; 258 pd->ui = ui;
259 259
260 elm_object_content_set(scr, tb); 260 elm_object_content_set(scr, tb);
261 elm_object_content_set(win, scr); 261 elm_object_content_set(win, scr);
@@ -267,9 +267,9 @@ ui_cpu_win_add(Evisum_Ui *ui)
267 evas_object_show(ic); 267 evas_object_show(ic);
268 elm_object_focus_allow_set(btn, 0); 268 elm_object_focus_allow_set(btn, 0);
269 evas_object_size_hint_min_set(btn, ELM_SCALE_SIZE(BTN_HEIGHT), ELM_SCALE_SIZE(BTN_HEIGHT)); 269 evas_object_size_hint_min_set(btn, ELM_SCALE_SIZE(BTN_HEIGHT), ELM_SCALE_SIZE(BTN_HEIGHT));
270 evas_object_smart_callback_add(btn, "clicked", _btn_menu_clicked_cb, vis); 270 evas_object_smart_callback_add(btn, "clicked", _btn_menu_clicked_cb, pd);
271 271
272 vis->btn_menu = lay = elm_layout_add(win); 272 pd->btn_menu = lay = elm_layout_add(win);
273 evas_object_size_hint_weight_set(lay, 1.0, 1.0); 273 evas_object_size_hint_weight_set(lay, 1.0, 1.0);
274 evas_object_size_hint_align_set(lay, 0.99, 0.01); 274 evas_object_size_hint_align_set(lay, 0.99, 0.01);
275 elm_layout_file_set(lay, PACKAGE_DATA_DIR "/themes/evisum.edj", "cpu"); 275 elm_layout_file_set(lay, PACKAGE_DATA_DIR "/themes/evisum.edj", "cpu");
@@ -277,11 +277,11 @@ ui_cpu_win_add(Evisum_Ui *ui)
277 elm_table_pack(tb, lay, 0, 0, 1, 1); 277 elm_table_pack(tb, lay, 0, 0, 1, 1);
278 evas_object_show(lay); 278 evas_object_show(lay);
279 279
280 evas_object_event_callback_add(scr, EVAS_CALLBACK_MOUSE_MOVE, _win_mouse_move_cb, vis); 280 evas_object_event_callback_add(scr, EVAS_CALLBACK_MOUSE_MOVE, _win_mouse_move_cb, pd);
281 evas_object_event_callback_add(scr, EVAS_CALLBACK_KEY_DOWN, _win_key_down_cb, ui); 281 evas_object_event_callback_add(scr, EVAS_CALLBACK_KEY_DOWN, _win_key_down_cb, ui);
282 evas_object_event_callback_add(win, EVAS_CALLBACK_RESIZE, _win_resize_cb, ui); 282 evas_object_event_callback_add(win, EVAS_CALLBACK_RESIZE, _win_resize_cb, ui);
283 evas_object_event_callback_add(win, EVAS_CALLBACK_RESIZE, _win_move_cb, ui); 283 evas_object_event_callback_add(win, EVAS_CALLBACK_RESIZE, _win_move_cb, ui);
284 evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _win_del_cb, vis); 284 evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _win_del_cb, pd);
285 285
286 if ((ui->cpu.width > 0) && (ui->cpu.height > 0)) 286 if ((ui->cpu.width > 0) && (ui->cpu.height > 0))
287 evas_object_resize(win, ui->cpu.width, ui->cpu.height); 287 evas_object_resize(win, ui->cpu.width, ui->cpu.height);
diff --git a/src/bin/ui/ui_cpu.h b/src/bin/ui/ui_cpu.h
index 9f31a6b..34ae496 100644
--- a/src/bin/ui/ui_cpu.h
+++ b/src/bin/ui/ui_cpu.h
@@ -38,12 +38,12 @@ typedef struct {
38 void (*ext_free_cb)(void *); 38 void (*ext_free_cb)(void *);
39 void *ext; 39 void *ext;
40 40
41} Cpu_Visual; 41} Ui_Cpu_Data;
42 42
43typedef struct { 43typedef struct {
44 const char *name; 44 const char *name;
45 Cpu_Visual *(*func)(Evas_Object *parent); 45 Ui_Cpu_Data *(*func)(Evas_Object *parent);
46} Visualization; 46} Cpu_Visual;
47 47
48void 48void
49ui_cpu_win_add(Evisum_Ui *ui); 49ui_cpu_win_add(Evisum_Ui *ui);
@@ -54,7 +54,7 @@ ui_cpu_win_restart(Evisum_Ui *ui);
54Eina_List * 54Eina_List *
55ui_cpu_visuals_get(void); 55ui_cpu_visuals_get(void);
56 56
57Visualization * 57Cpu_Visual *
58ui_cpu_visual_by_name(const char *name); 58ui_cpu_visual_by_name(const char *name);
59 59
60#endif 60#endif
diff --git a/src/bin/ui/visuals/cpu_basic.c b/src/bin/ui/visuals/cpu_basic.c
index a69ac28..9a31de5 100644
--- a/src/bin/ui/visuals/cpu_basic.c
+++ b/src/bin/ui/visuals/cpu_basic.c
@@ -10,8 +10,8 @@ static void
10_core_times_main_cb(void *data, Ecore_Thread *thread) 10_core_times_main_cb(void *data, Ecore_Thread *thread)
11{ 11{
12 int ncpu; 12 int ncpu;
13 Cpu_Visual *vis = data; 13 Ui_Cpu_Data *pd = data;
14 Ext *ext = vis->ext; 14 Ext *ext = pd->ext;
15 15
16 while (!ecore_thread_check(thread)) 16 while (!ecore_thread_check(thread))
17 { 17 {
@@ -37,12 +37,12 @@ _core_times_main_cb(void *data, Ecore_Thread *thread)
37static void 37static void
38_core_times_feedback_cb(void *data, Ecore_Thread *thread EINA_UNUSED, void *msgdata) 38_core_times_feedback_cb(void *data, Ecore_Thread *thread EINA_UNUSED, void *msgdata)
39{ 39{
40 Cpu_Visual *vis; 40 Ui_Cpu_Data *pd;
41 Core *cores; 41 Core *cores;
42 Ext *ext; 42 Ext *ext;
43 43
44 vis = data; 44 pd = data;
45 ext = vis->ext; 45 ext = pd->ext;
46 cores = msgdata; 46 cores = msgdata;
47 47
48 for (int i = 0; i < ext->cpu_count; i++) 48 for (int i = 0; i < ext->cpu_count; i++)
@@ -70,18 +70,18 @@ _cb_free(void *data)
70 free(ext); 70 free(ext);
71} 71}
72 72
73Cpu_Visual * 73Ui_Cpu_Data *
74cpu_visual_basic(Evas_Object *parent_bx) 74cpu_visual_basic(Evas_Object *parent_bx)
75{ 75{
76 Evas_Object *tb; 76 Evas_Object *tb;
77 Ext *ext; 77 Ext *ext;
78 78
79 Cpu_Visual *vis = calloc(1, sizeof(Cpu_Visual)); 79 Ui_Cpu_Data *pd = calloc(1, sizeof(Ui_Cpu_Data));
80 if (!vis) return NULL; 80 if (!pd) return NULL;
81 81
82 vis->ext = ext = calloc(1, sizeof(Ext)); 82 pd->ext = ext = calloc(1, sizeof(Ext));
83 EINA_SAFETY_ON_NULL_RETURN_VAL(ext, NULL); 83 EINA_SAFETY_ON_NULL_RETURN_VAL(ext, NULL);
84 vis->ext_free_cb = _cb_free; 84 pd->ext_free_cb = _cb_free;
85 85
86 /* Populate lookup table to match id with topology core id */ 86 /* Populate lookup table to match id with topology core id */
87 ext->cpu_count = system_cpu_count_get(); 87 ext->cpu_count = system_cpu_count_get();
@@ -120,11 +120,11 @@ cpu_visual_basic(Evas_Object *parent_bx)
120 120
121 elm_box_pack_end(parent_bx, tb); 121 elm_box_pack_end(parent_bx, tb);
122 122
123 vis->thread = ecore_thread_feedback_run(_core_times_main_cb, 123 pd->thread = ecore_thread_feedback_run(_core_times_main_cb,
124 _core_times_feedback_cb, 124 _core_times_feedback_cb,
125 NULL, 125 NULL,
126 NULL, 126 NULL,
127 vis, 1); 127 pd, 1);
128 return vis; 128 return pd;
129} 129}
130 130
diff --git a/src/bin/ui/visuals/cpu_basic.h b/src/bin/ui/visuals/cpu_basic.h
index c3c6396..a586001 100644
--- a/src/bin/ui/visuals/cpu_basic.h
+++ b/src/bin/ui/visuals/cpu_basic.h
@@ -3,7 +3,7 @@
3 3
4#include "ui/ui_cpu.h" 4#include "ui/ui_cpu.h"
5 5
6Cpu_Visual * 6Ui_Cpu_Data *
7cpu_visual_basic(Evas_Object *parent); 7cpu_visual_basic(Evas_Object *parent);
8 8
9#endif 9#endif
diff --git a/src/bin/ui/visuals/cpu_default.c b/src/bin/ui/visuals/cpu_default.c
index e39f135..1aed737 100644
--- a/src/bin/ui/visuals/cpu_default.c
+++ b/src/bin/ui/visuals/cpu_default.c
@@ -30,9 +30,9 @@ typedef struct {
30static void 30static void
31_core_times_main_cb(void *data, Ecore_Thread *thread) 31_core_times_main_cb(void *data, Ecore_Thread *thread)
32{ 32{
33 Cpu_Visual *vis = data; 33 Ui_Cpu_Data *pd = data;
34 int ncpu; 34 int ncpu;
35 Ext *ext = vis->ext; 35 Ext *ext = pd->ext;
36 36
37 if (!system_cpu_frequency_min_max_get(&ext->freq_min, &ext->freq_max)) 37 if (!system_cpu_frequency_min_max_get(&ext->freq_min, &ext->freq_max))
38 ext->cpu_freq = 1; 38 ext->cpu_freq = 1;
@@ -67,14 +67,14 @@ _core_times_main_cb(void *data, Ecore_Thread *thread)
67} 67}
68 68
69static void 69static void
70_update(Cpu_Visual *vis, Core *cores) 70_update(Ui_Cpu_Data *pd, Core *cores)
71{ 71{
72 Evas_Object *obj; 72 Evas_Object *obj;
73 unsigned int *pixels, *pix; 73 unsigned int *pixels, *pix;
74 Evas_Coord x, y, w, h; 74 Evas_Coord x, y, w, h;
75 int iw, stride; 75 int iw, stride;
76 Eina_Bool clear = 0; 76 Eina_Bool clear = 0;
77 Ext *ext = vis->ext; 77 Ext *ext = pd->ext;
78 obj = ext->obj; 78 obj = ext->obj;
79 79
80 evas_object_geometry_get(obj, &x, &y, &w, &h); 80 evas_object_geometry_get(obj, &x, &y, &w, &h);
@@ -166,7 +166,7 @@ _update(Cpu_Visual *vis, Core *cores)
166 } 166 }
167 // hand back pixel data ptr so evas knows we are done with it 167 // hand back pixel data ptr so evas knows we are done with it
168 evas_object_image_data_set(obj, pixels); 168 evas_object_image_data_set(obj, pixels);
169 // now visd update region for all pixels in the image at the end as we 169 // now update region for all pixels in the image at the end as we
170 // changed everything 170 // changed everything
171 evas_object_image_data_update_add(obj, 0, 0, w, ext->cpu_count * 3); 171 evas_object_image_data_update_add(obj, 0, 0, w, ext->cpu_count * 3);
172} 172}
@@ -178,14 +178,14 @@ typedef struct
178} Explainer; 178} Explainer;
179 179
180static void 180static void
181_explain(Cpu_Visual *vis, Core *cores) 181_explain(Ui_Cpu_Data *pd, Core *cores)
182{ 182{
183 Eina_Strbuf *buf; 183 Eina_Strbuf *buf;
184 Explainer *exp; 184 Explainer *exp;
185 Ext *ext; 185 Ext *ext;
186 Evas_Object *lb, *rec; 186 Evas_Object *lb, *rec;
187 187
188 ext = vis->ext; 188 ext = pd->ext;
189 189
190 if (!ext->explainers) return; 190 if (!ext->explainers) return;
191 191
@@ -224,20 +224,20 @@ _explain(Cpu_Visual *vis, Core *cores)
224static void 224static void
225_core_times_feedback_cb(void *data, Ecore_Thread *thread EINA_UNUSED, void *msgdata) 225_core_times_feedback_cb(void *data, Ecore_Thread *thread EINA_UNUSED, void *msgdata)
226{ 226{
227 Cpu_Visual *vis; 227 Ui_Cpu_Data *pd;
228 Core *cores; 228 Core *cores;
229 Ext *ext; 229 Ext *ext;
230 static Eina_Bool was_confused = 0; 230 static Eina_Bool was_confused = 0;
231 231
232 vis = data; 232 pd = data;
233 ext = vis->ext; 233 ext = pd->ext;
234 cores = msgdata; 234 cores = msgdata;
235 235
236 _update(vis, cores); 236 _update(pd, cores);
237 237
238 if (ext->confused || was_confused) 238 if (ext->confused || was_confused)
239 { 239 {
240 _explain(vis, cores); 240 _explain(pd, cores);
241 was_confused = 1; 241 was_confused = 1;
242 } 242 }
243 243
@@ -262,8 +262,8 @@ static void
262_check_changed_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, 262_check_changed_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
263 void *event_info EINA_UNUSED) 263 void *event_info EINA_UNUSED)
264{ 264{
265 Cpu_Visual *vis = data; 265 Ui_Cpu_Data *pd = data;
266 Ext *ext = vis->ext; 266 Ext *ext = pd->ext;
267 267
268 ext->show_cpufreq = elm_check_state_get(obj); 268 ext->show_cpufreq = elm_check_state_get(obj);
269} 269}
@@ -272,8 +272,8 @@ static void
272_temp_check_changed_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, 272_temp_check_changed_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
273 void *event_info EINA_UNUSED) 273 void *event_info EINA_UNUSED)
274{ 274{
275 Cpu_Visual *vis = data; 275 Ui_Cpu_Data *pd = data;
276 Ext *ext = vis->ext; 276 Ext *ext = pd->ext;
277 277
278 ext->show_cputemp = elm_check_state_get(obj); 278 ext->show_cputemp = elm_check_state_get(obj);
279} 279}
@@ -282,8 +282,8 @@ static void
282_confused_check_changed_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, 282_confused_check_changed_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
283 void *event_info EINA_UNUSED) 283 void *event_info EINA_UNUSED)
284{ 284{
285 Cpu_Visual *vis = data; 285 Ui_Cpu_Data *pd = data;
286 Ext *ext = vis->ext; 286 Ext *ext = pd->ext;
287 287
288 ext->confused = elm_check_state_get(obj); 288 ext->confused = elm_check_state_get(obj);
289} 289}
@@ -291,7 +291,7 @@ _confused_check_changed_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
291static void 291static void
292_colors_fill(Evas_Object *colors) 292_colors_fill(Evas_Object *colors)
293{ 293{
294 // fill a 3 pixel high (and 100 wide) image with 3 grvisients matching 294 // fill a 3 pixel high (and 100 wide) image with 3 grpdients matching
295 // the colormaps we calculated as a legend 295 // the colormaps we calculated as a legend
296 int x, stride; 296 int x, stride;
297 unsigned int *pixels; 297 unsigned int *pixels;
@@ -311,7 +311,7 @@ _colors_fill(Evas_Object *colors)
311 evas_object_image_data_update_add(colors, 0, 0, 101, 1); 311 evas_object_image_data_update_add(colors, 0, 0, 101, 1);
312} 312}
313 313
314Cpu_Visual * 314Ui_Cpu_Data *
315cpu_visual_default(Evas_Object *parent_box) 315cpu_visual_default(Evas_Object *parent_box)
316{ 316{
317 Evas_Object *tbl, *tbl2, *box, *obj, *ic, *lb, *rec; 317 Evas_Object *tbl, *tbl2, *box, *obj, *ic, *lb, *rec;
@@ -322,10 +322,10 @@ cpu_visual_default(Evas_Object *parent_box)
322 char buf[128]; 322 char buf[128];
323 Eina_Bool show_icons = 1; 323 Eina_Bool show_icons = 1;
324 324
325 Cpu_Visual *vis = calloc(1, sizeof(Cpu_Visual)); 325 Ui_Cpu_Data *pd = calloc(1, sizeof(Ui_Cpu_Data));
326 if (!vis) return NULL; 326 if (!pd) return NULL;
327 327
328 vis->ext = ext = calloc(1, sizeof(Ext)); 328 pd->ext = ext = calloc(1, sizeof(Ext));
329 EINA_SAFETY_ON_NULL_RETURN_VAL(ext, NULL); 329 EINA_SAFETY_ON_NULL_RETURN_VAL(ext, NULL);
330 330
331 ext->cpu_count = system_cpu_count_get(); 331 ext->cpu_count = system_cpu_count_get();
@@ -439,8 +439,8 @@ cpu_visual_default(Evas_Object *parent_box)
439 ext->explainers = eina_list_append(ext->explainers, exp); 439 ext->explainers = eina_list_append(ext->explainers, exp);
440 } 440 }
441 441
442 // Callback to free anything extra we pass around via the ext pointer in (Cpu_Visual *). 442 // Callback to free anything extra we pass around via the ext pointer in (Ui_Cpu_Data *).
443 vis->ext_free_cb = _cb_free; 443 pd->ext_free_cb = _cb_free;
444 444
445 bx = elm_box_add(box); 445 bx = elm_box_add(box);
446 evas_object_size_hint_align_set(bx, FILL, FILL); 446 evas_object_size_hint_align_set(bx, FILL, FILL);
@@ -554,14 +554,14 @@ cpu_visual_default(Evas_Object *parent_box)
554 if (!ext->cpu_freq) elm_object_disabled_set(check, 1); 554 if (!ext->cpu_freq) elm_object_disabled_set(check, 1);
555 evas_object_show(check); 555 evas_object_show(check);
556 elm_box_pack_end(hbx, check); 556 elm_box_pack_end(hbx, check);
557 evas_object_smart_callback_add(check, "changed", _check_changed_cb, vis); 557 evas_object_smart_callback_add(check, "changed", _check_changed_cb, pd);
558 558
559 check = elm_check_add(fr); 559 check = elm_check_add(fr);
560 evas_object_size_hint_align_set(check, FILL, FILL); 560 evas_object_size_hint_align_set(check, FILL, FILL);
561 evas_object_size_hint_weight_set(check, EXPAND, 0); 561 evas_object_size_hint_weight_set(check, EXPAND, 0);
562 elm_object_text_set(check, _("Overlay CPU temperatures?")); 562 elm_object_text_set(check, _("Overlay CPU temperatures?"));
563 if (!ext->cpu_temp) elm_object_disabled_set(check, 1); 563 if (!ext->cpu_temp) elm_object_disabled_set(check, 1);
564 evas_object_smart_callback_add(check, "changed", _temp_check_changed_cb, vis); 564 evas_object_smart_callback_add(check, "changed", _temp_check_changed_cb, pd);
565 evas_object_show(check); 565 evas_object_show(check);
566 elm_box_pack_end(hbx, check); 566 elm_box_pack_end(hbx, check);
567 567
@@ -569,7 +569,7 @@ cpu_visual_default(Evas_Object *parent_box)
569 evas_object_size_hint_align_set(check, FILL, FILL); 569 evas_object_size_hint_align_set(check, FILL, FILL);
570 evas_object_size_hint_weight_set(check, EXPAND, 0); 570 evas_object_size_hint_weight_set(check, EXPAND, 0);
571 elm_object_text_set(check, _("Confused?")); 571 elm_object_text_set(check, _("Confused?"));
572 evas_object_smart_callback_add(check, "changed", _confused_check_changed_cb, vis); 572 evas_object_smart_callback_add(check, "changed", _confused_check_changed_cb, pd);
573 evas_object_show(check); 573 evas_object_show(check);
574 elm_box_pack_end(hbx, check); 574 elm_box_pack_end(hbx, check);
575 575
@@ -581,11 +581,11 @@ cpu_visual_default(Evas_Object *parent_box)
581 (obj, 100, (BAR_HEIGHT * ext->cpu_count) * elm_config_scale_get()); 581 (obj, 100, (BAR_HEIGHT * ext->cpu_count) * elm_config_scale_get());
582 582
583 // run a feedback thread that sends feedback to the mainloop 583 // run a feedback thread that sends feedback to the mainloop
584 vis->thread = ecore_thread_feedback_run(_core_times_main_cb, 584 pd->thread = ecore_thread_feedback_run(_core_times_main_cb,
585 _core_times_feedback_cb, 585 _core_times_feedback_cb,
586 NULL, 586 NULL,
587 NULL, 587 NULL,
588 vis, 1); 588 pd, 1);
589 return vis; 589 return pd;
590} 590}
591 591
diff --git a/src/bin/ui/visuals/cpu_default.h b/src/bin/ui/visuals/cpu_default.h
index 86e05c9..347e9b1 100644
--- a/src/bin/ui/visuals/cpu_default.h
+++ b/src/bin/ui/visuals/cpu_default.h
@@ -3,7 +3,7 @@
3 3
4#include "ui/ui_cpu.h" 4#include "ui/ui_cpu.h"
5 5
6Cpu_Visual * 6Ui_Cpu_Data *
7cpu_visual_default(Evas_Object *parent); 7cpu_visual_default(Evas_Object *parent);
8 8
9#endif 9#endif
diff --git a/src/bin/ui/visuals/visuals.x b/src/bin/ui/visuals/visuals.x
index 429d297..408fc98 100644
--- a/src/bin/ui/visuals/visuals.x
+++ b/src/bin/ui/visuals/visuals.x
@@ -1,7 +1,7 @@
1#include "cpu_default.h" 1#include "cpu_default.h"
2#include "cpu_basic.h" 2#include "cpu_basic.h"
3 3
4Visualization visualizations[] = { 4Cpu_Visual visualizations[] = {
5 { .name = "default", .func = cpu_visual_default }, 5 { .name = "default", .func = cpu_visual_default },
6 { .name = "basic", .func = cpu_visual_basic }, 6 { .name = "basic", .func = cpu_visual_basic },
7}; 7};