summaryrefslogtreecommitdiff
path: root/src/bin/win.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/win.c')
-rw-r--r--src/bin/win.c177
1 files changed, 77 insertions, 100 deletions
diff --git a/src/bin/win.c b/src/bin/win.c
index b155676..f7cab8e 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -91,7 +91,6 @@ struct _Term
91 Evas_Object *sendfile_request; 91 Evas_Object *sendfile_request;
92 Evas_Object *sendfile_progress; 92 Evas_Object *sendfile_progress;
93 Evas_Object *sendfile_progress_bar; 93 Evas_Object *sendfile_progress_bar;
94 Evas_Object *tabcount_spacer;
95 Evas_Object *tab_spacer; 94 Evas_Object *tab_spacer;
96 Evas_Object *tab_region_base; 95 Evas_Object *tab_region_base;
97 Evas_Object *tab_region_bg; 96 Evas_Object *tab_region_bg;
@@ -169,7 +168,6 @@ struct _Win
169 Ecore_Job *size_job; 168 Ecore_Job *size_job;
170 Evas_Object *cmdbox; 169 Evas_Object *cmdbox;
171 Ecore_Timer *cmdbox_del_timer; 170 Ecore_Timer *cmdbox_del_timer;
172 Ecore_Timer *cmdbox_focus_timer;
173 Ecore_Timer *hide_cursor_timer; 171 Ecore_Timer *hide_cursor_timer;
174 unsigned char focused : 1; 172 unsigned char focused : 1;
175 unsigned char cmdbox_up : 1; 173 unsigned char cmdbox_up : 1;
@@ -256,8 +254,6 @@ win_scale_wizard(Evas_Object *win, Term *term)
256 Scale_Ctx *ctx; 254 Scale_Ctx *ctx;
257 255
258 EINA_SAFETY_ON_NULL_RETURN(term); 256 EINA_SAFETY_ON_NULL_RETURN(term);
259 if (!utils_need_scale_wizard())
260 return;
261 257
262 ctx = calloc(1, sizeof(*ctx)); 258 ctx = calloc(1, sizeof(*ctx));
263 if (!ctx) 259 if (!ctx)
@@ -982,11 +978,6 @@ win_free(Win *wn)
982 ecore_timer_del(wn->cmdbox_del_timer); 978 ecore_timer_del(wn->cmdbox_del_timer);
983 wn->cmdbox_del_timer = NULL; 979 wn->cmdbox_del_timer = NULL;
984 } 980 }
985 if (wn->cmdbox_focus_timer)
986 {
987 ecore_timer_del(wn->cmdbox_focus_timer);
988 wn->cmdbox_focus_timer = NULL;
989 }
990 if (wn->cmdbox) 981 if (wn->cmdbox)
991 { 982 {
992 evas_object_del(wn->cmdbox); 983 evas_object_del(wn->cmdbox);
@@ -1001,10 +992,8 @@ win_free(Win *wn)
1001 } 992 }
1002 if (wn->size_job) 993 if (wn->size_job)
1003 ecore_job_del(wn->size_job); 994 ecore_job_del(wn->size_job);
1004 if (wn->config) 995 config_del(wn->config);
1005 config_del(wn->config); 996 eina_stringshare_del(wn->preedit_str);
1006 if (wn->preedit_str)
1007 eina_stringshare_del(wn->preedit_str);
1008 keyin_compose_seq_reset(&wn->khdl); 997 keyin_compose_seq_reset(&wn->khdl);
1009 if (wn->khdl.imf) 998 if (wn->khdl.imf)
1010 { 999 {
@@ -1489,11 +1478,8 @@ _imf_event_commit_cb(void *data,
1489 termpty_write(ty, str, len); 1478 termpty_write(ty, str, len);
1490 } 1479 }
1491 } 1480 }
1492 if (wn->preedit_str) 1481 eina_stringshare_del(wn->preedit_str);
1493 { 1482 wn->preedit_str = NULL;
1494 eina_stringshare_del(wn->preedit_str);
1495 wn->preedit_str = NULL;
1496 }
1497} 1483}
1498 1484
1499 1485
@@ -1521,8 +1507,7 @@ _imf_event_preedit_changed_cb(void *data,
1521 if (!preedit_string) 1507 if (!preedit_string)
1522 return; 1508 return;
1523 DBG("IMF preedit str '%s'", preedit_string); 1509 DBG("IMF preedit str '%s'", preedit_string);
1524 if (wn->preedit_str) 1510 eina_stringshare_del(wn->preedit_str);
1525 eina_stringshare_del(wn->preedit_str);
1526 wn->preedit_str = eina_stringshare_add(preedit_string); 1511 wn->preedit_str = eina_stringshare_add(preedit_string);
1527 free(preedit_string); 1512 free(preedit_string);
1528} 1513}
@@ -1545,8 +1530,7 @@ _cb_win_key_down(void *data,
1545 DBG("GROUP key down (%p) (ctrl:%d)", 1530 DBG("GROUP key down (%p) (ctrl:%d)",
1546 wn, evas_key_modifier_is_set(ev->modifiers, "Control")); 1531 wn, evas_key_modifier_is_set(ev->modifiers, "Control"));
1547 1532
1548 if (wn->on_popover) 1533 if ((wn->on_popover) || (wn->cmdbox_up)) return;
1549 return;
1550 1534
1551 ctrl = evas_key_modifier_is_set(ev->modifiers, "Control"); 1535 ctrl = evas_key_modifier_is_set(ev->modifiers, "Control");
1552 alt = evas_key_modifier_is_set(ev->modifiers, "Alt"); 1536 alt = evas_key_modifier_is_set(ev->modifiers, "Alt");
@@ -3324,6 +3308,7 @@ _tabs_close(Term_Container *tc, Term_Container *child)
3324 3308
3325 l = _tab_item_find(tabs, child); 3309 l = _tab_item_find(tabs, child);
3326 item = l->data; 3310 item = l->data;
3311 tabs->tabs = eina_list_remove_list(tabs->tabs, l);
3327 3312
3328 next = eina_list_next(l); 3313 next = eina_list_next(l);
3329 if (!next) 3314 if (!next)
@@ -3331,7 +3316,6 @@ _tabs_close(Term_Container *tc, Term_Container *child)
3331 next_item = next->data; 3316 next_item = next->data;
3332 next_child = next_item->tc; 3317 next_child = next_item->tc;
3333 assert (next_child->type == TERM_CONTAINER_TYPE_SOLO); 3318 assert (next_child->type == TERM_CONTAINER_TYPE_SOLO);
3334 tabs->tabs = eina_list_remove_list(tabs->tabs, l);
3335 3319
3336 assert (child->type == TERM_CONTAINER_TYPE_SOLO); 3320 assert (child->type == TERM_CONTAINER_TYPE_SOLO);
3337 solo = (Solo*)child; 3321 solo = (Solo*)child;
@@ -3353,11 +3337,13 @@ _tabs_close(Term_Container *tc, Term_Container *child)
3353 next_term = next_solo->term; 3337 next_term = next_solo->term;
3354 config = next_term->config; 3338 config = next_term->config;
3355 3339
3356 edje_object_signal_emit(next_term->bg, "tabcount,off", "terminology"); 3340 edje_object_signal_emit(term->bg, "tab_btn,off", "terminology");
3357 if (next_term->tabcount_spacer && !config->show_tabs) 3341 evas_object_del(term->tab_spacer);
3342 term->tab_spacer = NULL;
3343 if (next_term->tab_spacer && !config->show_tabs)
3358 { 3344 {
3359 evas_object_del(next_term->tabcount_spacer); 3345 evas_object_del(next_term->tab_spacer);
3360 next_term->tabcount_spacer = NULL; 3346 next_term->tab_spacer = NULL;
3361 } 3347 }
3362 if (config->show_tabs) 3348 if (config->show_tabs)
3363 _solo_title_show(next_child); 3349 _solo_title_show(next_child);
@@ -3563,10 +3549,10 @@ _tabs_swallow(Term_Container *tc, Term_Container *orig,
3563 solo = (Solo*)orig; 3549 solo = (Solo*)orig;
3564 term = solo->term; 3550 term = solo->term;
3565 edje_object_signal_emit(term->bg, "tabcount,off", "terminology"); 3551 edje_object_signal_emit(term->bg, "tabcount,off", "terminology");
3566 if (term->tabcount_spacer) 3552 if (term->tab_spacer)
3567 { 3553 {
3568 evas_object_del(term->tabcount_spacer); 3554 evas_object_del(term->tab_spacer);
3569 term->tabcount_spacer = NULL; 3555 term->tab_spacer = NULL;
3570 } 3556 }
3571 3557
3572 o = orig->get_evas_object(orig); 3558 o = orig->get_evas_object(orig);
@@ -3668,8 +3654,7 @@ _cb_close(void *data,
3668} 3654}
3669 3655
3670void 3656void
3671main_new(Evas_Object *_win EINA_UNUSED, 3657main_new(Evas_Object *term)
3672 Evas_Object *term)
3673{ 3658{
3674 Term *tm; 3659 Term *tm;
3675 3660
@@ -3873,56 +3858,48 @@ _tabs_refresh(Tabs *tabs)
3873 3858
3874 _tabbar_clear(term); 3859 _tabbar_clear(term);
3875 3860
3876 if (!term->tabcount_spacer) 3861 if (!term->tab_spacer)
3877 { 3862 {
3878 term->tabcount_spacer = evas_object_rectangle_add(evas_object_evas_get(term->bg)); 3863 term->tab_spacer = evas_object_rectangle_add(evas_object_evas_get(term->bg));
3879 evas_object_color_set(term->tabcount_spacer, 0, 0, 0, 0); 3864 evas_object_color_set(term->tab_spacer, 0, 0, 0, 0);
3880 } 3865 }
3881 elm_coords_finger_size_adjust(1, &w, 1, &h); 3866 elm_coords_finger_size_adjust(1, &w, 1, &h);
3882 evas_object_size_hint_min_set(term->tabcount_spacer, w, h); 3867 evas_object_size_hint_min_set(term->tab_spacer, w, h);
3883 edje_object_part_swallow(term->bg, "terminology.tabcount.control",
3884 term->tabcount_spacer);
3885 edje_object_part_text_set(term->bg, "terminology.tabcount.label", buf);
3886 edje_object_part_text_set(term->bg, "terminology.tabmissed.label", bufmissed);
3887 edje_object_signal_emit(term->bg, "tabcount,on", "terminology");
3888 // this is all below just for tab bar at the top 3868 // this is all below just for tab bar at the top
3889 if (term->config->show_tabs) 3869 if (term->config->show_tabs)
3890 { 3870 {
3891 double v1, v2; 3871 double v1, v2;
3892 3872
3873 edje_object_part_swallow(term->bg, "terminology.tab_btn",
3874 term->tab_spacer);
3875
3893 v1 = (double)(i-1) / (double)n; 3876 v1 = (double)(i-1) / (double)n;
3894 v2 = (double)i / (double)n; 3877 v2 = (double)i / (double)n;
3895 if (!term->tab_spacer) 3878 edje_object_signal_emit(term->bg, "tabcount,off", "terminology");
3896 { 3879
3897 term->tab_spacer = evas_object_rectangle_add( 3880 edje_object_part_swallow(term->bg, "terminology.tab", term->tab_spacer);
3898 evas_object_evas_get(term->bg)); 3881 edje_object_part_drag_value_set(term->bg, "terminology.tabl", v1, 0.0);
3899 evas_object_color_set(term->tab_spacer, 0, 0, 0, 0); 3882 edje_object_part_drag_value_set(term->bg, "terminology.tabr", v2, 0.0);
3900 elm_coords_finger_size_adjust(1, &w, 1, &h); 3883 edje_object_part_text_set(term->bg, "terminology.tab.title",
3901 evas_object_size_hint_min_set(term->tab_spacer, w, h); 3884 solo->tc.title);
3902 edje_object_part_swallow(term->bg, "terminology.tab", term->tab_spacer); 3885 edje_object_signal_emit(term->bg, "tabbar,on", "terminology");
3903 edje_object_part_drag_value_set(term->bg, "terminology.tabl", v1, 0.0); 3886 edje_object_signal_emit(term->bg, "tab_btn,on", "terminology");
3904 edje_object_part_drag_value_set(term->bg, "terminology.tabr", v2, 0.0);
3905 edje_object_part_text_set(term->bg, "terminology.tab.title",
3906 solo->tc.title);
3907 edje_object_signal_emit(term->bg, "tabbar,on", "terminology");
3908 edje_object_message_signal_process(term->bg);
3909 }
3910 else
3911 {
3912 edje_object_part_drag_value_set(term->bg, "terminology.tabl", v1, 0.0);
3913 edje_object_part_drag_value_set(term->bg, "terminology.tabr", v2, 0.0);
3914 edje_object_message_signal_process(term->bg);
3915 }
3916 _tabbar_fill(tabs); 3887 _tabbar_fill(tabs);
3917 } 3888 }
3918 else 3889 else
3919 { 3890 {
3891 edje_object_part_swallow(term->bg, "terminology.tabcount.control",
3892 term->tab_spacer);
3893 edje_object_part_text_set(term->bg, "terminology.tabcount.label", buf);
3894 edje_object_part_text_set(term->bg, "terminology.tabmissed.label", bufmissed);
3895 edje_object_signal_emit(term->bg, "tabcount,on", "terminology");
3920 _tabbar_clear(term); 3896 _tabbar_clear(term);
3897 if (missed > 0)
3898 edje_object_signal_emit(term->bg, "tabmissed,on", "terminology");
3899 else
3900 edje_object_signal_emit(term->bg, "tabmissed,off", "terminology");
3921 } 3901 }
3922 if (missed > 0) 3902 edje_object_message_signal_process(term->bg);
3923 edje_object_signal_emit(term->bg, "tabmissed,on", "terminology");
3924 else
3925 edje_object_signal_emit(term->bg, "tabmissed,off", "terminology");
3926} 3903}
3927 3904
3928static Tab_Item* 3905static Tab_Item*
@@ -5185,15 +5162,25 @@ _cb_command(void *data,
5185} 5162}
5186 5163
5187static void 5164static void
5188_cb_tabcount_go(void *data, 5165_cb_tab_go(void *data,
5189 Evas_Object *_obj EINA_UNUSED, 5166 Evas_Object *_obj EINA_UNUSED,
5190 const char *_sig EINA_UNUSED, 5167 const char *_sig EINA_UNUSED,
5191 const char *_src EINA_UNUSED) 5168 const char *_src EINA_UNUSED)
5192{ 5169{
5193 _cb_select(data, NULL, NULL); 5170 _cb_select(data, NULL, NULL);
5194} 5171}
5195 5172
5196static void 5173static void
5174_cb_tab_new(void *data,
5175 Evas_Object *_obj EINA_UNUSED,
5176 const char *_sig EINA_UNUSED,
5177 const char *_src EINA_UNUSED)
5178{
5179 Term *term = data;
5180 main_new(term->termio);
5181}
5182
5183static void
5197_cb_prev(void *data, 5184_cb_prev(void *data,
5198 Evas_Object *_obj EINA_UNUSED, 5185 Evas_Object *_obj EINA_UNUSED,
5199 void *_event EINA_UNUSED) 5186 void *_event EINA_UNUSED)
@@ -5320,11 +5307,7 @@ _cb_cmd_activated(void *data,
5320 free(cmd); 5307 free(cmd);
5321 } 5308 }
5322 } 5309 }
5323 if (wn->cmdbox_focus_timer) 5310 elm_object_focus_set(wn->base, EINA_TRUE);
5324 {
5325 ecore_timer_del(wn->cmdbox_focus_timer);
5326 wn->cmdbox_focus_timer = NULL;
5327 }
5328 wn->cmdbox_up = EINA_FALSE; 5311 wn->cmdbox_up = EINA_FALSE;
5329 if (wn->cmdbox_del_timer) ecore_timer_del(wn->cmdbox_del_timer); 5312 if (wn->cmdbox_del_timer) ecore_timer_del(wn->cmdbox_del_timer);
5330 wn->cmdbox_del_timer = ecore_timer_add(5.0, _cb_cmd_del, wn); 5313 wn->cmdbox_del_timer = ecore_timer_add(5.0, _cb_cmd_del, wn);
@@ -5338,11 +5321,7 @@ _cb_cmd_aborted(void *data,
5338 Win *wn = data; 5321 Win *wn = data;
5339 5322
5340 elm_layout_signal_emit(wn->base, "cmdbox,hide", "terminology"); 5323 elm_layout_signal_emit(wn->base, "cmdbox,hide", "terminology");
5341 if (wn->cmdbox_focus_timer) 5324 elm_object_focus_set(wn->base, EINA_TRUE);
5342 {
5343 ecore_timer_del(wn->cmdbox_focus_timer);
5344 wn->cmdbox_focus_timer = NULL;
5345 }
5346 wn->cmdbox_up = EINA_FALSE; 5325 wn->cmdbox_up = EINA_FALSE;
5347 if (wn->cmdbox_del_timer) ecore_timer_del(wn->cmdbox_del_timer); 5326 if (wn->cmdbox_del_timer) ecore_timer_del(wn->cmdbox_del_timer);
5348 wn->cmdbox_del_timer = ecore_timer_add(5.0, _cb_cmd_del, wn); 5327 wn->cmdbox_del_timer = ecore_timer_add(5.0, _cb_cmd_del, wn);
@@ -5422,8 +5401,7 @@ _cb_cmdbox(void *data,
5422 elm_layout_signal_emit(term->wn->base, "cmdbox,show", "terminology"); 5401 elm_layout_signal_emit(term->wn->base, "cmdbox,show", "terminology");
5423 elm_entry_entry_set(term->wn->cmdbox, ""); 5402 elm_entry_entry_set(term->wn->cmdbox, "");
5424 evas_object_show(term->wn->cmdbox); 5403 evas_object_show(term->wn->cmdbox);
5425 if (term->wn->cmdbox_focus_timer) 5404 elm_object_focus_set(term->wn->cmdbox, EINA_TRUE);
5426 ecore_timer_del(term->wn->cmdbox_focus_timer);
5427 if (term->wn->cmdbox_del_timer) 5405 if (term->wn->cmdbox_del_timer)
5428 { 5406 {
5429 ecore_timer_del(term->wn->cmdbox_del_timer); 5407 ecore_timer_del(term->wn->cmdbox_del_timer);
@@ -5627,11 +5605,8 @@ _term_free(Term *term)
5627 ecore_timer_del(term->sendfile_progress_hide_timer); 5605 ecore_timer_del(term->sendfile_progress_hide_timer);
5628 term->sendfile_progress_hide_timer = NULL; 5606 term->sendfile_progress_hide_timer = NULL;
5629 } 5607 }
5630 if (term->sendfile_dir) 5608 eina_stringshare_del(term->sendfile_dir);
5631 { 5609 term->sendfile_dir = NULL;
5632 eina_stringshare_del(term->sendfile_dir);
5633 term->sendfile_dir = NULL;
5634 }
5635 _popmedia_queue_free(term); 5610 _popmedia_queue_free(term);
5636 if (term->media) 5611 if (term->media)
5637 { 5612 {
@@ -5660,16 +5635,16 @@ _term_free(Term *term)
5660 5635
5661 _term_tabregion_free(term); 5636 _term_tabregion_free(term);
5662 5637
5663 if (term->tabcount_spacer) 5638 if (term->tab_spacer)
5664 { 5639 {
5665 evas_object_del(term->tabcount_spacer); 5640 evas_object_del(term->tab_spacer);
5666 term->tabcount_spacer = NULL; 5641 term->tab_spacer = NULL;
5667 } 5642 }
5668 free(term); 5643 free(term);
5669} 5644}
5670 5645
5671static void 5646static void
5672_cb_tabcount_prev(void *data, 5647_cb_tab_prev(void *data,
5673 Evas_Object *_obj EINA_UNUSED, 5648 Evas_Object *_obj EINA_UNUSED,
5674 const char *_sig EINA_UNUSED, 5649 const char *_sig EINA_UNUSED,
5675 const char *_src EINA_UNUSED) 5650 const char *_src EINA_UNUSED)
@@ -5678,7 +5653,7 @@ _cb_tabcount_prev(void *data,
5678} 5653}
5679 5654
5680static void 5655static void
5681_cb_tabcount_next(void *data, 5656_cb_tab_next(void *data,
5682 Evas_Object *_obj EINA_UNUSED, 5657 Evas_Object *_obj EINA_UNUSED,
5683 const char *_sig EINA_UNUSED, 5658 const char *_sig EINA_UNUSED,
5684 const char *_src EINA_UNUSED) 5659 const char *_src EINA_UNUSED)
@@ -5696,12 +5671,14 @@ _term_bg_config(Term *term)
5696 termio_theme_set(term->termio, term->bg); 5671 termio_theme_set(term->termio, term->bg);
5697 edje_object_signal_callback_add(term->bg, "popmedia,done", "terminology", 5672 edje_object_signal_callback_add(term->bg, "popmedia,done", "terminology",
5698 _cb_popmedia_done, term); 5673 _cb_popmedia_done, term);
5699 edje_object_signal_callback_add(term->bg, "tabcount,go", "terminology", 5674 edje_object_signal_callback_add(term->bg, "tab,go", "terminology",
5700 _cb_tabcount_go, term); 5675 _cb_tab_go, term);
5701 edje_object_signal_callback_add(term->bg, "tabcount,prev", "terminology", 5676 edje_object_signal_callback_add(term->bg, "tab,new", "terminology",
5702 _cb_tabcount_prev, term); 5677 _cb_tab_new, term);
5703 edje_object_signal_callback_add(term->bg, "tabcount,next", "terminology", 5678 edje_object_signal_callback_add(term->bg, "tab,prev", "terminology",
5704 _cb_tabcount_next, term); 5679 _cb_tab_prev, term);
5680 edje_object_signal_callback_add(term->bg, "tab,next", "terminology",
5681 _cb_tab_next, term);
5705 edje_object_signal_callback_add(term->bg, "tab,close", "terminology", 5682 edje_object_signal_callback_add(term->bg, "tab,close", "terminology",
5706 _cb_tab_close, term); 5683 _cb_tab_close, term);
5707 edje_object_signal_callback_add(term->bg, "tab,title", "terminology", 5684 edje_object_signal_callback_add(term->bg, "tab,title", "terminology",
@@ -6060,11 +6037,11 @@ win_font_update(Term *term)
6060void 6037void
6061windows_free(void) 6038windows_free(void)
6062{ 6039{
6040 Eina_List *l, *l_next;
6063 Win *wn; 6041 Win *wn;
6064 6042
6065 while (wins) 6043 EINA_LIST_FOREACH_SAFE(wins, l, l_next, wn)
6066 { 6044 {
6067 wn = eina_list_data_get(wins);
6068 win_free(wn); 6045 win_free(wn);
6069 } 6046 }
6070 6047