summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@yahoo.com>2015-03-22 08:13:34 +0200
committerDaniel Zaoui <daniel.zaoui@yahoo.com>2015-03-22 08:22:14 +0200
commit6aee349409c6d2d6cc1327e60c42636aeb6c1e10 (patch)
treef5d9e9e77f31daac32597ee460c26e310c47597b /src
parent0895a1e608b55e34826cf64715479f8261a1c28b (diff)
Revert "have the "xterm" cursor on the textgrid"
This reverts commit 144053f882053cb755144b8d2c1a1a76cc0e5607. It totally breaks the terminal splitting.
Diffstat (limited to 'src')
-rw-r--r--src/bin/win.c73
1 files changed, 36 insertions, 37 deletions
diff --git a/src/bin/win.c b/src/bin/win.c
index 177cdc9..d07e444 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -39,7 +39,7 @@ struct _Term
39 Win *wn; 39 Win *wn;
40 Config *config; 40 Config *config;
41 Evas_Object *bg; 41 Evas_Object *bg;
42 Evas_Object *base; // elm_layout 42 Evas_Object *base;
43 Evas_Object *term; 43 Evas_Object *term;
44 Evas_Object *media; 44 Evas_Object *media;
45 Evas_Object *popmedia; 45 Evas_Object *popmedia;
@@ -189,7 +189,7 @@ _cb_win_focus_in(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUS
189 if (term) 189 if (term)
190 { 190 {
191 edje_object_signal_emit(term->bg, "focus,out", "terminology"); 191 edje_object_signal_emit(term->bg, "focus,out", "terminology");
192 elm_layout_signal_emit(term->base, "focus,out", "terminology"); 192 edje_object_signal_emit(term->base, "focus,out", "terminology");
193 if (!wn->cmdbox_up) elm_object_focus_set(term->term, EINA_FALSE); 193 if (!wn->cmdbox_up) elm_object_focus_set(term->term, EINA_FALSE);
194 } 194 }
195 term = term_mouse; 195 term = term_mouse;
@@ -205,7 +205,7 @@ _cb_win_focus_in(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUS
205 else 205 else
206 { 206 {
207 edje_object_signal_emit(term->bg, "focus,in", "terminology"); 207 edje_object_signal_emit(term->bg, "focus,in", "terminology");
208 elm_layout_signal_emit(term->base, "focus,in", "terminology"); 208 edje_object_signal_emit(term->base, "focus,in", "terminology");
209 if (!wn->cmdbox_up) elm_object_focus_set(term->term, EINA_TRUE); 209 if (!wn->cmdbox_up) elm_object_focus_set(term->term, EINA_TRUE);
210 } 210 }
211} 211}
@@ -223,7 +223,7 @@ _cb_win_focus_out(void *data, Evas_Object *obj EINA_UNUSED,
223 term = win_focused_term_get(wn); 223 term = win_focused_term_get(wn);
224 if (!term) return; 224 if (!term) return;
225 edje_object_signal_emit(term->bg, "focus,out", "terminology"); 225 edje_object_signal_emit(term->bg, "focus,out", "terminology");
226 elm_layout_signal_emit(term->base, "focus,out", "terminology"); 226 edje_object_signal_emit(term->base, "focus,out", "terminology");
227 if (!wn->cmdbox_up) elm_object_focus_set(term->term, EINA_FALSE); 227 if (!wn->cmdbox_up) elm_object_focus_set(term->term, EINA_FALSE);
228} 228}
229 229
@@ -296,7 +296,7 @@ _win_trans(Win *wn, Term *term, Eina_Bool trans)
296 else 296 else
297 msg.val = 100; 297 msg.val = 100;
298 edje_object_message_send(term->bg, EDJE_MESSAGE_INT, 1, &msg); 298 edje_object_message_send(term->bg, EDJE_MESSAGE_INT, 1, &msg);
299 edje_object_message_send(elm_layout_edje_get(term->base), EDJE_MESSAGE_INT, 1, &msg); 299 edje_object_message_send(term->base, EDJE_MESSAGE_INT, 1, &msg);
300 300
301 if (trans) 301 if (trans)
302 { 302 {
@@ -771,7 +771,7 @@ _cb_size_hint(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event EIN
771 771
772 evas_object_size_hint_min_get(obj, &mw, &mh); 772 evas_object_size_hint_min_get(obj, &mw, &mh);
773 evas_object_size_hint_request_get(obj, &rw, &rh); 773 evas_object_size_hint_request_get(obj, &rw, &rh);
774 edje_object_size_min_calc(elm_layout_edje_get(term->base), &w, &h); 774 edje_object_size_min_calc(term->base, &w, &h);
775 evas_object_size_hint_min_set(term->base, w, h); 775 evas_object_size_hint_min_set(term->base, w, h);
776 edje_object_size_min_calc(term->bg, &w, &h); 776 edje_object_size_min_calc(term->bg, &w, &h);
777 evas_object_size_hint_min_set(term->bg, w, h); 777 evas_object_size_hint_min_set(term->bg, w, h);
@@ -1425,14 +1425,14 @@ _term_focus(Term *term)
1425 { 1425 {
1426 term2->focused = EINA_FALSE; 1426 term2->focused = EINA_FALSE;
1427 edje_object_signal_emit(term2->bg, "focus,out", "terminology"); 1427 edje_object_signal_emit(term2->bg, "focus,out", "terminology");
1428 elm_layout_signal_emit(term2->base, "focus,out", "terminology"); 1428 edje_object_signal_emit(term2->base, "focus,out", "terminology");
1429 elm_object_focus_set(term2->term, EINA_FALSE); 1429 elm_object_focus_set(term2->term, EINA_FALSE);
1430 } 1430 }
1431 } 1431 }
1432 } 1432 }
1433 term->focused = EINA_TRUE; 1433 term->focused = EINA_TRUE;
1434 edje_object_signal_emit(term->bg, "focus,in", "terminology"); 1434 edje_object_signal_emit(term->bg, "focus,in", "terminology");
1435 elm_layout_signal_emit(term->base, "focus,in", "terminology"); 1435 edje_object_signal_emit(term->base, "focus,in", "terminology");
1436 if (term->wn->cmdbox) elm_object_focus_set(term->wn->cmdbox, EINA_FALSE); 1436 if (term->wn->cmdbox) elm_object_focus_set(term->wn->cmdbox, EINA_FALSE);
1437 elm_object_focus_set(term->term, EINA_TRUE); 1437 elm_object_focus_set(term->term, EINA_TRUE);
1438 elm_win_title_set(term->wn->win, termio_title_get(term->term)); 1438 elm_win_title_set(term->wn->win, termio_title_get(term->term));
@@ -2241,7 +2241,7 @@ _cb_media_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, voi
2241 if (term->bg) 2241 if (term->bg)
2242 { 2242 {
2243 edje_object_signal_emit(term->bg, "media,off", "terminology"); 2243 edje_object_signal_emit(term->bg, "media,off", "terminology");
2244 elm_layout_signal_emit(term->base, "media,off", "terminology"); 2244 edje_object_signal_emit(term->base, "media,off", "terminology");
2245 } 2245 }
2246 if (!config) return; 2246 if (!config) return;
2247 if (config->temporary) 2247 if (config->temporary)
@@ -2269,26 +2269,26 @@ _term_media_update(Term *term, const Config *config)
2269 MEDIA_BG, type); 2269 MEDIA_BG, type);
2270 evas_object_event_callback_add(o, EVAS_CALLBACK_DEL, 2270 evas_object_event_callback_add(o, EVAS_CALLBACK_DEL,
2271 _cb_media_del, term); 2271 _cb_media_del, term);
2272 elm_layout_content_set(term->base, "terminology.background", o); 2272 edje_object_part_swallow(term->base, "terminology.background", o);
2273 evas_object_show(o); 2273 evas_object_show(o);
2274 term->mediatype = type; 2274 term->mediatype = type;
2275 switch (type) 2275 switch (type)
2276 { 2276 {
2277 case MEDIA_TYPE_IMG: 2277 case MEDIA_TYPE_IMG:
2278 edje_object_signal_emit(term->bg, "media,image", "terminology"); 2278 edje_object_signal_emit(term->bg, "media,image", "terminology");
2279 elm_layout_signal_emit(term->base, "media,image", "terminology"); 2279 edje_object_signal_emit(term->base, "media,image", "terminology");
2280 break; 2280 break;
2281 case MEDIA_TYPE_SCALE: 2281 case MEDIA_TYPE_SCALE:
2282 edje_object_signal_emit(term->bg, "media,scale", "terminology"); 2282 edje_object_signal_emit(term->bg, "media,scale", "terminology");
2283 elm_layout_signal_emit(term->base, "media,scale", "terminology"); 2283 edje_object_signal_emit(term->base, "media,scale", "terminology");
2284 break; 2284 break;
2285 case MEDIA_TYPE_EDJE: 2285 case MEDIA_TYPE_EDJE:
2286 edje_object_signal_emit(term->bg, "media,edje", "terminology"); 2286 edje_object_signal_emit(term->bg, "media,edje", "terminology");
2287 elm_layout_signal_emit(term->base, "media,edje", "terminology"); 2287 edje_object_signal_emit(term->base, "media,edje", "terminology");
2288 break; 2288 break;
2289 case MEDIA_TYPE_MOV: 2289 case MEDIA_TYPE_MOV:
2290 edje_object_signal_emit(term->bg, "media,movie", "terminology"); 2290 edje_object_signal_emit(term->bg, "media,movie", "terminology");
2291 elm_layout_signal_emit(term->base, "media,movie", "terminology"); 2291 edje_object_signal_emit(term->base, "media,movie", "terminology");
2292 break; 2292 break;
2293 case MEDIA_TYPE_UNKNOWN: 2293 case MEDIA_TYPE_UNKNOWN:
2294 default: 2294 default:
@@ -2303,7 +2303,7 @@ _term_media_update(Term *term, const Config *config)
2303 EVAS_CALLBACK_DEL, 2303 EVAS_CALLBACK_DEL,
2304 _cb_media_del); 2304 _cb_media_del);
2305 edje_object_signal_emit(term->bg, "media,off", "terminology"); 2305 edje_object_signal_emit(term->bg, "media,off", "terminology");
2306 elm_layout_signal_emit(term->base, "media,off", "terminology"); 2306 edje_object_signal_emit(term->base, "media,off", "terminology");
2307 evas_object_del(term->media); 2307 evas_object_del(term->media);
2308 term->media = NULL; 2308 term->media = NULL;
2309 } 2309 }
@@ -2479,18 +2479,18 @@ main_term_bg_config(Term *term)
2479 msg.val = 100; 2479 msg.val = 100;
2480 2480
2481 edje_object_message_send(term->bg, EDJE_MESSAGE_INT, 1, &msg); 2481 edje_object_message_send(term->bg, EDJE_MESSAGE_INT, 1, &msg);
2482 edje_object_message_send(elm_layout_edje_get(term->base), EDJE_MESSAGE_INT, 1, &msg); 2482 edje_object_message_send(term->base, EDJE_MESSAGE_INT, 1, &msg);
2483 2483
2484 termio_theme_set(term->term, term->bg); 2484 termio_theme_set(term->term, term->bg);
2485 edje_object_signal_callback_add(term->bg, "popmedia,done", "terminology", 2485 edje_object_signal_callback_add(term->bg, "popmedia,done", "terminology",
2486 _cb_popmedia_done, term); 2486 _cb_popmedia_done, term);
2487 edje_object_signal_callback_add(term->bg, "tabcount,go", "terminology", 2487 edje_object_signal_callback_add(term->bg, "tabcount,go", "terminology",
2488 _cb_tabcount_go, term); 2488 _cb_tabcount_go, term);
2489 edje_object_signal_callback_add(term->bg, "tabcount,prev", "terminology", 2489 edje_object_signal_callback_add(term->bg, "tabcount,prev", "terminology",
2490 _cb_tabcount_prev, term); 2490 _cb_tabcount_prev, term);
2491 edje_object_signal_callback_add(term->bg, "tabcount,next", "terminology", 2491 edje_object_signal_callback_add(term->bg, "tabcount,next", "terminology",
2492 _cb_tabcount_next, term); 2492 _cb_tabcount_next, term);
2493 elm_layout_content_set(term->base, "terminology.content", term->term); 2493 edje_object_part_swallow(term->base, "terminology.content", term->term);
2494 edje_object_part_swallow(term->bg, "terminology.content", term->base); 2494 edje_object_part_swallow(term->bg, "terminology.content", term->base);
2495 edje_object_part_swallow(term->bg, "terminology.miniview", term->miniview); 2495 edje_object_part_swallow(term->bg, "terminology.miniview", term->miniview);
2496 if (term->popmedia) 2496 if (term->popmedia)
@@ -2516,24 +2516,24 @@ main_term_bg_config(Term *term)
2516 } 2516 }
2517 if (term->media) 2517 if (term->media)
2518 { 2518 {
2519 elm_layout_content_set(term->base, "terminology.background", term->media); 2519 edje_object_part_swallow(term->base, "terminology.background", term->media);
2520 switch (term->mediatype) 2520 switch (term->mediatype)
2521 { 2521 {
2522 case MEDIA_TYPE_IMG: 2522 case MEDIA_TYPE_IMG:
2523 edje_object_signal_emit(term->bg, "media,image", "terminology"); 2523 edje_object_signal_emit(term->bg, "media,image", "terminology");
2524 elm_layout_signal_emit(term->base, "media,image", "terminology"); 2524 edje_object_signal_emit(term->base, "media,image", "terminology");
2525 break; 2525 break;
2526 case MEDIA_TYPE_SCALE: 2526 case MEDIA_TYPE_SCALE:
2527 edje_object_signal_emit(term->bg, "media,scale", "terminology"); 2527 edje_object_signal_emit(term->bg, "media,scale", "terminology");
2528 elm_layout_signal_emit(term->base, "media,scale", "terminology"); 2528 edje_object_signal_emit(term->base, "media,scale", "terminology");
2529 break; 2529 break;
2530 case MEDIA_TYPE_EDJE: 2530 case MEDIA_TYPE_EDJE:
2531 edje_object_signal_emit(term->bg, "media,edje", "terminology"); 2531 edje_object_signal_emit(term->bg, "media,edje", "terminology");
2532 elm_layout_signal_emit(term->base, "media,edje", "terminology"); 2532 edje_object_signal_emit(term->base, "media,edje", "terminology");
2533 break; 2533 break;
2534 case MEDIA_TYPE_MOV: 2534 case MEDIA_TYPE_MOV:
2535 edje_object_signal_emit(term->bg, "media,movie", "terminology"); 2535 edje_object_signal_emit(term->bg, "media,movie", "terminology");
2536 elm_layout_signal_emit(term->base, "media,movie", "terminology"); 2536 edje_object_signal_emit(term->base, "media,movie", "terminology");
2537 break; 2537 break;
2538 case MEDIA_TYPE_UNKNOWN: 2538 case MEDIA_TYPE_UNKNOWN:
2539 default: 2539 default:
@@ -2544,7 +2544,7 @@ main_term_bg_config(Term *term)
2544 if ((term->focused) && (term->wn->focused)) 2544 if ((term->focused) && (term->wn->focused))
2545 { 2545 {
2546 edje_object_signal_emit(term->bg, "focus,in", "terminology"); 2546 edje_object_signal_emit(term->bg, "focus,in", "terminology");
2547 elm_layout_signal_emit(term->base, "focus,in", "terminology"); 2547 edje_object_signal_emit(term->base, "focus,in", "terminology");
2548 if (term->wn->cmdbox) 2548 if (term->wn->cmdbox)
2549 elm_object_focus_set(term->wn->cmdbox, EINA_FALSE); 2549 elm_object_focus_set(term->wn->cmdbox, EINA_FALSE);
2550 elm_object_focus_set(term->term, EINA_TRUE); 2550 elm_object_focus_set(term->term, EINA_TRUE);
@@ -2561,7 +2561,7 @@ _cb_tabregion_change(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *in
2561 2561
2562 evas_object_geometry_get(obj, NULL, NULL, &w, &h); 2562 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
2563 evas_object_size_hint_min_set(term->tab_region_base, w, h); 2563 evas_object_size_hint_min_set(term->tab_region_base, w, h);
2564 elm_layout_content_set(term->base, "terminology.tabregion", term->tab_region_base); 2564 edje_object_part_swallow(term->base, "terminology.tabregion", term->tab_region_base);
2565} 2565}
2566 2566
2567static void 2567static void
@@ -2578,7 +2578,7 @@ _term_tabregion_setup(Term *term)
2578 2578
2579 term->tab_region_base = o = evas_object_rectangle_add(evas_object_evas_get(term->bg)); 2579 term->tab_region_base = o = evas_object_rectangle_add(evas_object_evas_get(term->bg));
2580 evas_object_color_set(o, 0, 0, 0, 0); 2580 evas_object_color_set(o, 0, 0, 0, 0);
2581 elm_layout_content_set(term->base, "terminology.tabregion", o); 2581 edje_object_part_swallow(term->base, "terminology.tabregion", o);
2582} 2582}
2583 2583
2584static void 2584static void
@@ -2616,10 +2616,10 @@ _main_term_bg_redo(Term *term)
2616 evas_object_del(term->base); 2616 evas_object_del(term->base);
2617 evas_object_del(term->bg); 2617 evas_object_del(term->bg);
2618 2618
2619 term->base = o = elm_layout_add(term->wn->win); 2619 term->base = o = edje_object_add(evas_object_evas_get(term->wn->win));
2620 theme_apply(o, term->config, "terminology/core"); 2620 theme_apply(o, term->config, "terminology/core");
2621 2621
2622 theme_auto_reload_enable(elm_layout_edje_get(o)); 2622 theme_auto_reload_enable(o);
2623 evas_object_data_set(o, "theme_reload_func", main_term_bg_config); 2623 evas_object_data_set(o, "theme_reload_func", main_term_bg_config);
2624 evas_object_data_set(o, "theme_reload_func_data", term); 2624 evas_object_data_set(o, "theme_reload_func_data", term);
2625 evas_object_show(o); 2625 evas_object_show(o);
@@ -2686,11 +2686,11 @@ _cb_bell(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
2686 Split *sp; 2686 Split *sp;
2687 2687
2688 edje_object_signal_emit(term->bg, "bell", "terminology"); 2688 edje_object_signal_emit(term->bg, "bell", "terminology");
2689 elm_layout_signal_emit(term->base, "bell", "terminology"); 2689 edje_object_signal_emit(term->base, "bell", "terminology");
2690 if (config->bell_rings) 2690 if (config->bell_rings)
2691 { 2691 {
2692 edje_object_signal_emit(term->bg, "bell,ring", "terminology"); 2692 edje_object_signal_emit(term->bg, "bell,ring", "terminology");
2693 elm_layout_signal_emit(term->base, "bell,ring", "terminology"); 2693 edje_object_signal_emit(term->base, "bell,ring", "terminology");
2694 } 2694 }
2695 sp = _split_find(term->wn->win, term->term, NULL); 2695 sp = _split_find(term->wn->win, term->term, NULL);
2696 if (sp) 2696 if (sp)
@@ -2772,8 +2772,8 @@ term_new(Win *wn, Config *config, const char *cmd,
2772{ 2772{
2773 Term *term; 2773 Term *term;
2774 Evas_Object *o; 2774 Evas_Object *o;
2775 Edje_Message_Int msg;
2776 Evas *canvas = evas_object_evas_get(wn->win); 2775 Evas *canvas = evas_object_evas_get(wn->win);
2776 Edje_Message_Int msg;
2777 2777
2778 term = calloc(1, sizeof(Term)); 2778 term = calloc(1, sizeof(Term));
2779 if (!term) return NULL; 2779 if (!term) return NULL;
@@ -2789,12 +2789,11 @@ term_new(Win *wn, Config *config, const char *cmd,
2789 term->wn = wn; 2789 term->wn = wn;
2790 term->hold = hold; 2790 term->hold = hold;
2791 term->config = config; 2791 term->config = config;
2792 2792
2793 term->base = o = elm_layout_add(wn->win); 2793 term->base = o = edje_object_add(canvas);
2794 theme_apply(o, term->config, "terminology/core"); 2794 theme_apply(o, term->config, "terminology/core");
2795 elm_object_cursor_set(o, "xterm");
2796 2795
2797 theme_auto_reload_enable(elm_layout_edje_get(term->base)); 2796 theme_auto_reload_enable(o);
2798 evas_object_data_set(o, "theme_reload_func", main_term_bg_config); 2797 evas_object_data_set(o, "theme_reload_func", main_term_bg_config);
2799 evas_object_data_set(o, "theme_reload_func_data", term); 2798 evas_object_data_set(o, "theme_reload_func_data", term);
2800 evas_object_show(o); 2799 evas_object_show(o);
@@ -2823,7 +2822,7 @@ term_new(Win *wn, Config *config, const char *cmd,
2823 msg.val = 100; 2822 msg.val = 100;
2824 2823
2825 edje_object_message_send(term->bg, EDJE_MESSAGE_INT, 1, &msg); 2824 edje_object_message_send(term->bg, EDJE_MESSAGE_INT, 1, &msg);
2826 edje_object_message_send(elm_layout_edje_get(term->base), EDJE_MESSAGE_INT, 1, &msg); 2825 edje_object_message_send(term->base, EDJE_MESSAGE_INT, 1, &msg);
2827 2826
2828 term->term = o = termio_add(wn->win, config, cmd, login_shell, cd, 2827 term->term = o = termio_add(wn->win, config, cmd, login_shell, cd,
2829 size_w, size_h, term); 2828 size_w, size_h, term);
@@ -2858,7 +2857,7 @@ term_new(Win *wn, Config *config, const char *cmd,
2858 evas_object_size_hint_fill_set(o, 0, EVAS_HINT_FILL); 2857 evas_object_size_hint_fill_set(o, 0, EVAS_HINT_FILL);
2859 evas_object_event_callback_add(o, EVAS_CALLBACK_CHANGED_SIZE_HINTS, 2858 evas_object_event_callback_add(o, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
2860 _cb_size_hint, term); 2859 _cb_size_hint, term);
2861 elm_layout_content_set(term->base, "terminology.content", o); 2860 edje_object_part_swallow(term->base, "terminology.content", o);
2862 edje_object_part_swallow(term->bg, "terminology.content", term->base); 2861 edje_object_part_swallow(term->bg, "terminology.content", term->base);
2863 edje_object_part_swallow(term->bg, "terminology.miniview", term->miniview); 2862 edje_object_part_swallow(term->bg, "terminology.miniview", term->miniview);
2864 evas_object_smart_callback_add(o, "options", _cb_options, term); 2863 evas_object_smart_callback_add(o, "options", _cb_options, term);