summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorGustavo Lima Chaves <glima@profusion.mobi>2010-11-23 06:10:58 +0000
committerGustavo Lima Chaves <glima@profusion.mobi>2010-11-23 06:10:58 +0000
commitc02bf77559823f4436f233ecb404293f81d5651b (patch)
tree6cd33a37837cbc6fa6fddc1e56cd8c10c8b5ab20 /src/bin
parentcf588e11f6e1012488836c86bd08e58f70e0cf87 (diff)
Elm caching settings exposed, part II.
Edje caching primitives exposed in Elm, too, now, and stored at config. Also, there's now a poller running for all Elm apps doing cache flushing. All these things have configurable values, of course. Testing config version bumping too, it should work. SVN revision: 54851
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/config.c204
1 files changed, 198 insertions, 6 deletions
diff --git a/src/bin/config.c b/src/bin/config.c
index b20d65130..33c53ee06 100644
--- a/src/bin/config.c
+++ b/src/bin/config.c
@@ -119,6 +119,26 @@ config_exit(void *data __UNUSED__,
119} 119}
120 120
121static void 121static void
122cf_round(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
123{
124 double val = elm_slider_value_get(obj);
125 double v;
126
127 v = ((double)((int)(val * 5.0))) / 5.0;
128 if (v != val) elm_slider_value_set(obj, v);
129}
130
131static void
132cf_change(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
133{
134 double scale = elm_scale_get();
135 double val = elm_slider_value_get(obj);
136
137 if (scale == val) return;
138 elm_cache_flush_interval_all_set(val);
139}
140
141static void
122fc_round(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) 142fc_round(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
123{ 143{
124 double val = elm_slider_value_get(obj); 144 double val = elm_slider_value_get(obj);
@@ -199,6 +219,46 @@ fs_change(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
199} 219}
200 220
201static void 221static void
222efc_round(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
223{
224 double val = elm_slider_value_get(obj);
225 double v;
226
227 v = ((double)((int)(val * 5.0))) / 5.0;
228 if (v != val) elm_slider_value_set(obj, v);
229}
230
231static void
232efc_change(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
233{
234 double scale = elm_scale_get();
235 double val = elm_slider_value_get(obj);
236
237 if (scale == val) return;
238 elm_edje_file_cache_all_set(val);
239}
240
241static void
242ecc_round(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
243{
244 double val = elm_slider_value_get(obj);
245 double v;
246
247 v = ((double)((int)(val * 5.0))) / 5.0;
248 if (v != val) elm_slider_value_set(obj, v);
249}
250
251static void
252ecc_change(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
253{
254 double scale = elm_scale_get();
255 double val = elm_slider_value_get(obj);
256
257 if (scale == val) return;
258 elm_edje_collection_cache_all_set(val);
259}
260
261static void
202_status_basic(Evas_Object *win, Evas_Object *bx0) 262_status_basic(Evas_Object *win, Evas_Object *bx0)
203{ 263{
204 Evas_Object *lb, *fr; 264 Evas_Object *lb, *fr;
@@ -493,6 +553,7 @@ _font_overlay_change(void *data __UNUSED__,
493static void 553static void
494_profile_change_do(Evas_Object *win, const char *profile) 554_profile_change_do(Evas_Object *win, const char *profile)
495{ 555{
556 int flush_interval, font_c, image_c, edje_file_c, edje_col_c;
496 const char *curr_theme, *curr_engine; 557 const char *curr_theme, *curr_engine;
497 const Eina_List *l_items, *l; 558 const Eina_List *l_items, *l;
498 Elm_List_Item *it; 559 Elm_List_Item *it;
@@ -504,6 +565,11 @@ _profile_change_do(Evas_Object *win, const char *profile)
504 565
505 scale = elm_scale_get(); 566 scale = elm_scale_get();
506 fs = elm_finger_size_get(); 567 fs = elm_finger_size_get();
568 flush_interval = elm_cache_flush_interval_get();
569 font_c = elm_font_cache_get();
570 image_c = elm_image_cache_get();
571 edje_file_c = elm_edje_file_cache_get();
572 edje_col_c = elm_edje_collection_cache_get();
507 573
508 /* gotta update root windows' atoms */ 574 /* gotta update root windows' atoms */
509 elm_scale_all_set(scale); 575 elm_scale_all_set(scale);
@@ -511,6 +577,24 @@ _profile_change_do(Evas_Object *win, const char *profile)
511 elm_finger_size_all_set(fs); 577 elm_finger_size_all_set(fs);
512 elm_slider_value_set(evas_object_data_get(win, "fs_slider"), fs); 578 elm_slider_value_set(evas_object_data_get(win, "fs_slider"), fs);
513 579
580 elm_cache_flush_interval_all_set(flush_interval);
581 elm_slider_value_set(evas_object_data_get(win,
582 "cache_flush_interval_slider"),
583 flush_interval);
584 elm_font_cache_all_set(font_c);
585 elm_slider_value_set(evas_object_data_get(win, "font_cache_slider"),
586 font_c / 1024.0);
587 elm_image_cache_all_set(image_c);
588 elm_slider_value_set(evas_object_data_get(win, "image_cache_slider"),
589 image_c / 1024.0);
590 elm_edje_file_cache_all_set(edje_file_c);
591 elm_slider_value_set(evas_object_data_get(win, "edje_file_cache_slider"),
592 edje_file_c);
593 elm_edje_collection_cache_all_set(edje_col_c);
594 elm_slider_value_set(evas_object_data_get(win,
595 "edje_collection_cache_slider"),
596 edje_col_c);
597
514 curr_theme = _elm_theme_current_get(elm_theme_get(NULL)); 598 curr_theme = _elm_theme_current_get(elm_theme_get(NULL));
515 elm_theme_all_set(curr_theme); 599 elm_theme_all_set(curr_theme);
516 600
@@ -2049,6 +2133,42 @@ _status_config_caches(Evas_Object *win, Evas_Object *pager)
2049 lb = elm_label_add(win); 2133 lb = elm_label_add(win);
2050 evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, 0.0); 2134 evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, 0.0);
2051 evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, 0.5); 2135 evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, 0.5);
2136 elm_label_label_set(lb,"<hilight>Cache Flush Interval</>");
2137 elm_frame_content_set(pd, lb);
2138 evas_object_show(lb);
2139
2140 sl = elm_slider_add(win);
2141 evas_object_data_set(win, "cache_flush_interval_slider", sl);
2142 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2143 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2144 elm_slider_span_size_set(sl, 120);
2145 elm_slider_unit_format_set(sl, "%1.0f ticks");
2146 elm_slider_indicator_format_set(sl, "%1.0f");
2147 elm_slider_min_max_set(sl, 8.0, 4096.0);
2148 elm_slider_value_set(sl, elm_cache_flush_interval_get());
2149 elm_box_pack_end(bx, sl);
2150 evas_object_show(sl);
2151
2152 evas_object_smart_callback_add(sl, "changed", cf_round, NULL);
2153 evas_object_smart_callback_add(sl, "delay,changed", cf_change, NULL);
2154
2155 sp = elm_separator_add(win);
2156 elm_separator_horizontal_set(sp, 1);
2157 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
2158 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
2159 elm_box_pack_end(bx, sp);
2160 evas_object_show(sp);
2161
2162 pd = elm_frame_add(win);
2163 evas_object_size_hint_weight_set(pd, EVAS_HINT_EXPAND, 0.0);
2164 evas_object_size_hint_align_set(pd, EVAS_HINT_FILL, 0.5);
2165 elm_object_style_set(pd, "pad_medium");
2166 elm_box_pack_end(bx, pd);
2167 evas_object_show(pd);
2168
2169 lb = elm_label_add(win);
2170 evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, 0.0);
2171 evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, 0.5);
2052 elm_label_label_set(lb,"<hilight>Font Cache Size</>"); 2172 elm_label_label_set(lb,"<hilight>Font Cache Size</>");
2053 elm_frame_content_set(pd, lb); 2173 elm_frame_content_set(pd, lb);
2054 evas_object_show(lb); 2174 evas_object_show(lb);
@@ -2058,10 +2178,10 @@ _status_config_caches(Evas_Object *win, Evas_Object *pager)
2058 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0); 2178 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2059 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); 2179 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2060 elm_slider_span_size_set(sl, 120); 2180 elm_slider_span_size_set(sl, 120);
2061 elm_slider_unit_format_set(sl, "%1.1f"); 2181 elm_slider_unit_format_set(sl, "%1.1f MB");
2062 elm_slider_indicator_format_set(sl, "%1.1f MB"); 2182 elm_slider_indicator_format_set(sl, "%1.1f");
2063 elm_slider_min_max_set(sl, 0.0, 4.0); 2183 elm_slider_min_max_set(sl, 0.0, 4.0);
2064 elm_slider_value_set(sl, (double)elm_font_cache_get() / 1024); 2184 elm_slider_value_set(sl, (double)elm_font_cache_get() / 1024.0);
2065 elm_box_pack_end(bx, sl); 2185 elm_box_pack_end(bx, sl);
2066 evas_object_show(sl); 2186 evas_object_show(sl);
2067 2187
@@ -2094,16 +2214,88 @@ _status_config_caches(Evas_Object *win, Evas_Object *pager)
2094 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0); 2214 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2095 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5); 2215 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2096 elm_slider_span_size_set(sl, 120); 2216 elm_slider_span_size_set(sl, 120);
2097 elm_slider_unit_format_set(sl, "%1.0f"); 2217 elm_slider_unit_format_set(sl, "%1.0f MB");
2098 elm_slider_indicator_format_set(sl, "%1.0f MB"); 2218 elm_slider_indicator_format_set(sl, "%1.0f");
2099 elm_slider_min_max_set(sl, 0, 32); 2219 elm_slider_min_max_set(sl, 0, 32);
2100 elm_slider_value_set(sl, (double)elm_image_cache_get() / 1024); 2220 elm_slider_value_set(sl, (double)elm_image_cache_get() / 1024.0);
2101 elm_box_pack_end(bx, sl); 2221 elm_box_pack_end(bx, sl);
2102 evas_object_show(sl); 2222 evas_object_show(sl);
2103 2223
2104 evas_object_smart_callback_add(sl, "changed", ic_round, NULL); 2224 evas_object_smart_callback_add(sl, "changed", ic_round, NULL);
2105 evas_object_smart_callback_add(sl, "delay,changed", ic_change, NULL); 2225 evas_object_smart_callback_add(sl, "delay,changed", ic_change, NULL);
2106 2226
2227 sp = elm_separator_add(win);
2228 elm_separator_horizontal_set(sp, 1);
2229 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
2230 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
2231 elm_box_pack_end(bx, sp);
2232 evas_object_show(sp);
2233
2234 pd = elm_frame_add(win);
2235 evas_object_size_hint_weight_set(pd, EVAS_HINT_EXPAND, 0.0);
2236 evas_object_size_hint_align_set(pd, EVAS_HINT_FILL, 0.5);
2237 elm_object_style_set(pd, "pad_medium");
2238 elm_box_pack_end(bx, pd);
2239 evas_object_show(pd);
2240
2241 lb = elm_label_add(win);
2242 evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, 0.0);
2243 evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, 0.5);
2244 elm_label_label_set(lb,"<hilight>Number of Edje Files to Cache</>");
2245 elm_frame_content_set(pd, lb);
2246 evas_object_show(lb);
2247
2248 sl = elm_slider_add(win);
2249 evas_object_data_set(win, "edje_file_cache_slider", sl);
2250 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2251 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2252 elm_slider_span_size_set(sl, 120);
2253 elm_slider_unit_format_set(sl, "%1.0f files");
2254 elm_slider_indicator_format_set(sl, "%1.0f");
2255 elm_slider_min_max_set(sl, 0, 256);
2256 elm_slider_value_set(sl, elm_edje_file_cache_get());
2257 elm_box_pack_end(bx, sl);
2258 evas_object_show(sl);
2259
2260 evas_object_smart_callback_add(sl, "changed", efc_round, NULL);
2261 evas_object_smart_callback_add(sl, "delay,changed", efc_change, NULL);
2262
2263 sp = elm_separator_add(win);
2264 elm_separator_horizontal_set(sp, 1);
2265 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
2266 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
2267 elm_box_pack_end(bx, sp);
2268 evas_object_show(sp);
2269
2270 pd = elm_frame_add(win);
2271 evas_object_size_hint_weight_set(pd, EVAS_HINT_EXPAND, 0.0);
2272 evas_object_size_hint_align_set(pd, EVAS_HINT_FILL, 0.5);
2273 elm_object_style_set(pd, "pad_medium");
2274 elm_box_pack_end(bx, pd);
2275 evas_object_show(pd);
2276
2277 lb = elm_label_add(win);
2278 evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, 0.0);
2279 evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, 0.5);
2280 elm_label_label_set(lb,"<hilight>Number of Edje Collections to Cache</>");
2281 elm_frame_content_set(pd, lb);
2282 evas_object_show(lb);
2283
2284 sl = elm_slider_add(win);
2285 evas_object_data_set(win, "edje_collection_cache_slider", sl);
2286 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2287 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2288 elm_slider_span_size_set(sl, 120);
2289 elm_slider_unit_format_set(sl, "%1.0f collections");
2290 elm_slider_indicator_format_set(sl, "%1.0f");
2291 elm_slider_min_max_set(sl, 0, 512);
2292 elm_slider_value_set(sl, elm_edje_collection_cache_get());
2293 elm_box_pack_end(bx, sl);
2294 evas_object_show(sl);
2295
2296 evas_object_smart_callback_add(sl, "changed", ecc_round, NULL);
2297 evas_object_smart_callback_add(sl, "delay,changed", ecc_change, NULL);
2298
2107 evas_object_data_set(win, "caches", bx); 2299 evas_object_data_set(win, "caches", bx);
2108 2300
2109 elm_pager_content_push(pager, bx); 2301 elm_pager_content_push(pager, bx);