summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2013-01-27 01:58:12 +0000
committerCarsten Haitzler <raster@rasterman.com>2013-01-27 01:58:12 +0000
commit524d62d2f37ccbcb7fd349aedf053256ad20ad14 (patch)
treec1d701cc37a2963bd02dc6258ccfc9dc0798b375 /src/bin
parentd9d731804162bf023b569676cd5d52ec94677432 (diff)
move options/controls out of term edj into separate one for the window
SVN revision: 83361
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/controls.c67
-rw-r--r--src/bin/main.c187
2 files changed, 128 insertions, 126 deletions
diff --git a/src/bin/controls.c b/src/bin/controls.c
index 5781822..edf2674 100644
--- a/src/bin/controls.c
+++ b/src/bin/controls.c
@@ -11,8 +11,6 @@ static Evas_Object *ct_frame = NULL, *ct_boxh = NULL, *ct_box = NULL;
11static Evas_Object *ct_box2 = NULL, *ct_over = NULL; 11static Evas_Object *ct_box2 = NULL, *ct_over = NULL;
12static Eina_Bool ct_out = EINA_FALSE; 12static Eina_Bool ct_out = EINA_FALSE;
13static Ecore_Timer *ct_del_timer = NULL; 13static Ecore_Timer *ct_del_timer = NULL;
14static Evas_Object *saved_win = NULL;
15static Evas_Object *saved_bg = NULL;
16static Evas_Object *ct_win = NULL, *ct_bg = NULL, *ct_term = NULL; 14static Evas_Object *ct_win = NULL, *ct_bg = NULL, *ct_term = NULL;
17 15
18static Eina_Bool 16static Eina_Bool
@@ -80,38 +78,40 @@ static void
80_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *ev __UNUSED__) 78_cb_mouse_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *ev __UNUSED__)
81{ 79{
82 controls_toggle(ct_win, ct_bg, ct_term); 80 controls_toggle(ct_win, ct_bg, ct_term);
83 options_toggle(ct_win, ct_bg, ct_term);
84} 81}
85 82
86static void 83static void
87_cb_saved_del(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *ev __UNUSED__) 84_cb_saved_del(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *ev __UNUSED__)
88{ 85{
89 if ((obj == saved_win) || (obj == saved_bg) || (obj == ct_term)) 86 if ((obj == ct_win) || (obj == ct_term))
90 { 87 {
91 if (ct_frame) 88 if (obj == ct_term)
92 { 89 {
93 evas_object_del(ct_frame); 90 if (ct_out) controls_toggle(ct_win, ct_bg, ct_term);
94 ct_frame = NULL; 91 ct_term = NULL;
95 } 92 }
96 if (ct_del_timer) 93 else
97 { 94 {
98 ecore_timer_del(ct_del_timer); 95 if (ct_frame)
99 ct_del_timer = NULL; 96 {
97 evas_object_del(ct_frame);
98 ct_frame = NULL;
99 }
100 if (ct_del_timer)
101 {
102 ecore_timer_del(ct_del_timer);
103 ct_del_timer = NULL;
104 }
105 if (ct_over)
106 {
107 evas_object_del(ct_over);
108 ct_over = NULL;
109 }
110 evas_object_event_callback_del(ct_win, EVAS_CALLBACK_DEL, _cb_saved_del);
111 ct_win = NULL;
100 } 112 }
101 if (ct_over)
102 {
103 evas_object_del(ct_over);
104 ct_over = NULL;
105 }
106 evas_object_event_callback_del(saved_win, EVAS_CALLBACK_DEL, _cb_saved_del);
107 evas_object_event_callback_del(saved_bg, EVAS_CALLBACK_DEL, _cb_saved_del);
108 evas_object_event_callback_del(ct_term, EVAS_CALLBACK_DEL, _cb_saved_del); 113 evas_object_event_callback_del(ct_term, EVAS_CALLBACK_DEL, _cb_saved_del);
109 saved_win = NULL;
110 saved_bg = NULL;
111 ct_win = NULL;
112 ct_bg = NULL; 114 ct_bg = NULL;
113 ct_term = NULL;
114 ct_out = EINA_FALSE;
115 } 115 }
116} 116}
117 117
@@ -240,8 +240,6 @@ controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
240 ct_win = win; 240 ct_win = win;
241 ct_bg = bg; 241 ct_bg = bg;
242 ct_term = term; 242 ct_term = term;
243 saved_win = win;
244 saved_bg = bg;
245 edje_object_signal_emit(bg, "controls,show", "terminology"); 243 edje_object_signal_emit(bg, "controls,show", "terminology");
246 ct_out = EINA_TRUE; 244 ct_out = EINA_TRUE;
247 elm_object_focus_set(ct_frame, EINA_TRUE); 245 elm_object_focus_set(ct_frame, EINA_TRUE);
@@ -258,34 +256,21 @@ controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
258 evas_object_del(ct_over); 256 evas_object_del(ct_over);
259 ct_over = NULL; 257 ct_over = NULL;
260 } 258 }
261 edje_object_signal_emit(saved_bg, "controls,hide", "terminology"); 259 edje_object_signal_emit(ct_bg, "controls,hide", "terminology");
262 ct_out = EINA_FALSE; 260 ct_out = EINA_FALSE;
263 elm_object_focus_set(ct_frame, EINA_FALSE); 261 elm_object_focus_set(ct_frame, EINA_FALSE);
264 elm_object_focus_set(ct_term, EINA_TRUE); 262 elm_object_focus_set(ct_term, EINA_TRUE);
265 if (ct_del_timer) ecore_timer_del(ct_del_timer); 263 if (ct_del_timer) ecore_timer_del(ct_del_timer);
266 ct_del_timer = ecore_timer_add(10.0, _cb_ct_del_delay, NULL); 264 ct_del_timer = ecore_timer_add(10.0, _cb_ct_del_delay, NULL);
267// ct_term = NULL;
268// ct_bg = NULL;
269// ct_win = NULL;
270 } 265 }
271 if (saved_win) 266 if (ct_win)
272 { 267 {
273 evas_object_event_callback_del(saved_win, EVAS_CALLBACK_DEL, _cb_saved_del); 268 evas_object_event_callback_del(ct_win, EVAS_CALLBACK_DEL, _cb_saved_del);
274 evas_object_event_callback_del(saved_bg, EVAS_CALLBACK_DEL, _cb_saved_del);
275 evas_object_event_callback_del(ct_term, EVAS_CALLBACK_DEL, _cb_saved_del); 269 evas_object_event_callback_del(ct_term, EVAS_CALLBACK_DEL, _cb_saved_del);
276 } 270 }
277 if (ct_out) 271 if (ct_out)
278 { 272 {
279 evas_object_event_callback_add(saved_win, EVAS_CALLBACK_DEL, _cb_saved_del, NULL); 273 evas_object_event_callback_add(ct_win, EVAS_CALLBACK_DEL, _cb_saved_del, NULL);
280 evas_object_event_callback_add(saved_bg, EVAS_CALLBACK_DEL, _cb_saved_del, NULL);
281 evas_object_event_callback_add(ct_term, EVAS_CALLBACK_DEL, _cb_saved_del, NULL); 274 evas_object_event_callback_add(ct_term, EVAS_CALLBACK_DEL, _cb_saved_del, NULL);
282 } 275 }
283 else
284 {
285 saved_win = NULL;
286 saved_bg = NULL;
287// ct_term = NULL;
288// ct_bg = NULL;
289// ct_win = NULL;
290 }
291} 276}
diff --git a/src/bin/main.c b/src/bin/main.c
index 22c0943..15994a0 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -21,11 +21,15 @@ struct _Win
21 Evas_Object *win; 21 Evas_Object *win;
22 Evas_Object *conform; 22 Evas_Object *conform;
23 Evas_Object *backbg; 23 Evas_Object *backbg;
24 Evas_Object *table; 24 Evas_Object *base;
25 Config *config;
25 Eina_List *terms; 26 Eina_List *terms;
26 Split *split; 27 Split *split;
27 Ecore_Job *size_job; 28 Ecore_Job *size_job;
29 Evas_Object *cmdbox;
30 Ecore_Timer *cmdbox_focus_timer;
28 Eina_Bool focused : 1; 31 Eina_Bool focused : 1;
32 Eina_Bool cmdbox_up : 1;
29}; 33};
30 34
31struct _Term 35struct _Term
@@ -36,15 +40,12 @@ struct _Term
36 Evas_Object *term; 40 Evas_Object *term;
37 Evas_Object *media; 41 Evas_Object *media;
38 Evas_Object *popmedia; 42 Evas_Object *popmedia;
39 Evas_Object *cmdbox;
40 Ecore_Timer *cmdbox_focus_timer;
41 Eina_List *popmedia_queue; 43 Eina_List *popmedia_queue;
42 int step_x, step_y, min_w, min_h, req_w, req_h; 44 int step_x, step_y, min_w, min_h, req_w, req_h;
43 struct { 45 struct {
44 int x, y; 46 int x, y;
45 } down; 47 } down;
46 Eina_Bool focused : 1; 48 Eina_Bool focused : 1;
47 Eina_Bool cmdbox_up : 1;
48 Eina_Bool hold : 1; 49 Eina_Bool hold : 1;
49}; 50};
50 51
@@ -134,7 +135,7 @@ _split_split(Split *sp, Eina_Bool horizontal)
134 sp2->wn = sp->wn; 135 sp2->wn = sp->wn;
135 sp2->term = sp->term; 136 sp2->term = sp->term;
136 137
137 if (!sp->parent) elm_table_unpack(sp->wn->table, sp->term->bg); 138 if (!sp->parent) edje_object_part_unswallow(sp->wn->base, sp->term->bg);
138 main_term_bg_redo(sp->term); 139 main_term_bg_redo(sp->term);
139 140
140 sp2 = sp->s2 = calloc(1, sizeof(Split)); 141 sp2 = sp->s2 = calloc(1, sizeof(Split));
@@ -151,7 +152,7 @@ _split_split(Split *sp, Eina_Bool horizontal)
151 elm_object_part_content_set(sp->panes, "bottom", sp->s2->term->bg); 152 elm_object_part_content_set(sp->panes, "bottom", sp->s2->term->bg);
152 153
153 if (!sp->parent) 154 if (!sp->parent)
154 elm_table_pack(sp->wn->table, sp->panes, 0, 0, 1, 1); 155 edje_object_part_swallow(sp->wn->base, "terminology.content", sp->panes);
155 else 156 else
156 { 157 {
157 if (sp == sp->parent->s1) 158 if (sp == sp->parent->s1)
@@ -282,7 +283,7 @@ _split_merge(Split *spp, Split *sp, const char *slot)
282 elm_object_part_content_set(spp->parent->panes, slot, o); 283 elm_object_part_content_set(spp->parent->panes, slot, o);
283 } 284 }
284 else 285 else
285 elm_table_pack(spp->wn->table, o, 0, 0, 1, 1); 286 edje_object_part_swallow(spp->wn->base, "terminology.content", o);
286 } 287 }
287 else 288 else
288 { 289 {
@@ -298,7 +299,7 @@ _split_merge(Split *spp, Split *sp, const char *slot)
298 elm_object_part_content_set(spp->parent->panes, slot, o); 299 elm_object_part_content_set(spp->parent->panes, slot, o);
299 } 300 }
300 else 301 else
301 elm_table_pack(spp->wn->table, o, 0, 0, 1, 1); 302 edje_object_part_swallow(spp->wn->base, "terminology.content", o);
302 evas_object_del(spp->panes); 303 evas_object_del(spp->panes);
303 spp->panes = o; 304 spp->panes = o;
304 sp->s1 = NULL; 305 sp->s1 = NULL;
@@ -368,7 +369,7 @@ main_close(Evas_Object *win, Evas_Object *term)
368 } 369 }
369 else 370 else
370 { 371 {
371 elm_table_unpack(sp->wn->table, sp->term->bg); 372 edje_object_part_unswallow(sp->wn->base, sp->term->bg);
372 main_term_free(sp->term); 373 main_term_free(sp->term);
373 sp->term = NULL; 374 sp->term = NULL;
374 if (!sp->wn->terms) evas_object_del(sp->wn->win); 375 if (!sp->wn->terms) evas_object_del(sp->wn->win);
@@ -406,11 +407,11 @@ _cb_focus_in(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
406 407
407 if (!wn->focused) elm_win_urgent_set(wn->win, EINA_FALSE); 408 if (!wn->focused) elm_win_urgent_set(wn->win, EINA_FALSE);
408 wn->focused = EINA_TRUE; 409 wn->focused = EINA_TRUE;
410 if (wn->cmdbox_up) elm_object_focus_set(wn->cmdbox, EINA_TRUE);
409 term = main_win_focused_term_get(wn); 411 term = main_win_focused_term_get(wn);
410 if (!term) return; 412 if (!term) return;
411 edje_object_signal_emit(term->bg, "focus,in", "terminology"); 413 edje_object_signal_emit(term->bg, "focus,in", "terminology");
412 if (term->cmdbox_up) elm_object_focus_set(term->cmdbox, EINA_TRUE); 414 if (!wn->cmdbox_up) elm_object_focus_set(term->term, EINA_TRUE);
413 else elm_object_focus_set(term->term, EINA_TRUE);
414} 415}
415 416
416static void 417static void
@@ -420,11 +421,11 @@ _cb_focus_out(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
420 Term *term; 421 Term *term;
421 422
422 wn->focused = EINA_FALSE; 423 wn->focused = EINA_FALSE;
424 if (wn->cmdbox_up) elm_object_focus_set(wn->cmdbox, EINA_FALSE);
423 term = main_win_focused_term_get(wn); 425 term = main_win_focused_term_get(wn);
424 if (!term) return; 426 if (!term) return;
425 edje_object_signal_emit(term->bg, "focus,out", "terminology"); 427 edje_object_signal_emit(term->bg, "focus,out", "terminology");
426 if (term->cmdbox_up) elm_object_focus_set(term->cmdbox, EINA_FALSE); 428 if (!wn->cmdbox_up) elm_object_focus_set(term->term, EINA_FALSE);
427 else elm_object_focus_set(term->term, EINA_FALSE);
428 elm_cache_all_flush(); 429 elm_cache_all_flush();
429} 430}
430 431
@@ -610,7 +611,7 @@ _cb_options(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
610{ 611{
611 Term *term = data; 612 Term *term = data;
612 613
613 controls_toggle(term->wn->win, term->bg, term->term); 614 controls_toggle(term->wn->win, term->wn->base, term->term);
614} 615}
615 616
616static Eina_Bool 617static Eina_Bool
@@ -882,83 +883,93 @@ _cb_split_v(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
882static Eina_Bool 883static Eina_Bool
883_cb_cmd_focus(void *data) 884_cb_cmd_focus(void *data)
884{ 885{
885 Term *term = data; 886 Win *wn = data;
887 Term *term;
886 888
887 term->cmdbox_focus_timer = NULL; 889 wn->cmdbox_focus_timer = NULL;
888 elm_object_focus_set(term->cmdbox, EINA_TRUE); 890 term = main_win_focused_term_get(wn);
891 if (term) elm_object_focus_set(term->term, EINA_FALSE);
892 elm_object_focus_set(wn->cmdbox, EINA_TRUE);
889 return EINA_FALSE; 893 return EINA_FALSE;
890} 894}
891 895
892static void 896static void
893_cb_cmdbox(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__) 897_cb_cmdbox(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
894{ 898{
895 Term *term = data; 899 Win *wn = data;
900 Term *term;
896 901
897 term->cmdbox_up = EINA_TRUE; 902 wn->cmdbox_up = EINA_TRUE;
898 elm_object_focus_set(term->term, EINA_FALSE); 903 edje_object_signal_emit(wn->base, "cmdbox,show", "terminology");
899 edje_object_signal_emit(term->bg, "cmdbox,show", "terminology"); 904 term = main_win_focused_term_get(wn);
900 elm_entry_entry_set(term->cmdbox, ""); 905 if (term) elm_object_focus_set(term->term, EINA_TRUE);
901 evas_object_show(term->cmdbox); 906 elm_entry_entry_set(wn->cmdbox, "");
902 if (term->cmdbox_focus_timer) ecore_timer_del(term->cmdbox_focus_timer); 907 evas_object_show(wn->cmdbox);
903 term->cmdbox_focus_timer = ecore_timer_add(0.1, _cb_cmd_focus, term); 908 if (wn->cmdbox_focus_timer) ecore_timer_del(wn->cmdbox_focus_timer);
909 wn->cmdbox_focus_timer = ecore_timer_add(0.2, _cb_cmd_focus, wn);
904} 910}
905 911
906static void 912static void
907_cb_cmd_activated(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__) 913_cb_cmd_activated(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
908{ 914{
909 Term *term = data; 915 Win *wn = data;
910 char *cmd; 916 char *cmd;
917 Term *term;
911 918
912 elm_object_focus_set(term->cmdbox, EINA_FALSE); 919 elm_object_focus_set(wn->cmdbox, EINA_FALSE);
913 edje_object_signal_emit(term->bg, "cmdbox,hide", "terminology"); 920 edje_object_signal_emit(wn->base, "cmdbox,hide", "terminology");
914 elm_object_focus_set(term->term, EINA_TRUE); 921 term = main_win_focused_term_get(wn);
915 cmd = (char *)elm_entry_entry_get(term->cmdbox); 922 if (term) elm_object_focus_set(term->term, EINA_TRUE);
923 cmd = (char *)elm_entry_entry_get(wn->cmdbox);
916 if (cmd) 924 if (cmd)
917 { 925 {
918 cmd = elm_entry_markup_to_utf8(cmd); 926 cmd = elm_entry_markup_to_utf8(cmd);
919 if (cmd) 927 if (cmd)
920 { 928 {
921 termcmd_do(term->term, term->wn->win, term->bg, cmd); 929 if (term) termcmd_do(term->term, term->wn->win, term->bg, cmd);
922 free(cmd); 930 free(cmd);
923 } 931 }
924 } 932 }
925 if (term->cmdbox_focus_timer) 933 if (wn->cmdbox_focus_timer)
926 { 934 {
927 ecore_timer_del(term->cmdbox_focus_timer); 935 ecore_timer_del(wn->cmdbox_focus_timer);
928 term->cmdbox_focus_timer = NULL; 936 wn->cmdbox_focus_timer = NULL;
929 } 937 }
930 term->cmdbox_up = EINA_FALSE; 938 wn->cmdbox_up = EINA_FALSE;
931} 939}
932 940
933static void 941static void
934_cb_cmd_aborted(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__) 942_cb_cmd_aborted(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
935{ 943{
936 Term *term = data; 944 Win *wn = data;
945 Term *term;
937 946
938 elm_object_focus_set(term->cmdbox, EINA_FALSE); 947 elm_object_focus_set(wn->cmdbox, EINA_FALSE);
939 edje_object_signal_emit(term->bg, "cmdbox,hide", "terminology"); 948 edje_object_signal_emit(wn->base, "cmdbox,hide", "terminology");
940 elm_object_focus_set(term->term, EINA_TRUE); 949 term = main_win_focused_term_get(wn);
941 if (term->cmdbox_focus_timer) 950 if (term) elm_object_focus_set(term->term, EINA_TRUE);
951 if (wn->cmdbox_focus_timer)
942 { 952 {
943 ecore_timer_del(term->cmdbox_focus_timer); 953 ecore_timer_del(wn->cmdbox_focus_timer);
944 term->cmdbox_focus_timer = NULL; 954 wn->cmdbox_focus_timer = NULL;
945 } 955 }
946 term->cmdbox_up = EINA_FALSE; 956 wn->cmdbox_up = EINA_FALSE;
947} 957}
948 958
949static void 959static void
950_cb_cmd_changed(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__) 960_cb_cmd_changed(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
951{ 961{
952 Term *term = data; 962 Win *wn = data;
953 char *cmd; 963 char *cmd;
964 Term *term;
954 965
955 cmd = (char *)elm_entry_entry_get(term->cmdbox); 966 cmd = (char *)elm_entry_entry_get(wn->cmdbox);
956 if (cmd) 967 if (cmd)
957 { 968 {
958 cmd = elm_entry_markup_to_utf8(cmd); 969 cmd = elm_entry_markup_to_utf8(cmd);
959 if (cmd) 970 if (cmd)
960 { 971 {
961 termcmd_watch(term->term, term->wn->win, term->bg, cmd); 972 if (term) termcmd_watch(term->term, term->wn->win, term->bg, cmd);
962 free(cmd); 973 free(cmd);
963 } 974 }
964 } 975 }
@@ -967,10 +978,10 @@ _cb_cmd_changed(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
967static void 978static void
968_cb_cmd_hints_changed(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) 979_cb_cmd_hints_changed(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
969{ 980{
970 Term *term = data; 981 Win *wn = data;
971 982
972 evas_object_show(term->cmdbox); 983 evas_object_show(wn->cmdbox);
973 edje_object_part_swallow(term->bg, "terminology.cmdbox", term->cmdbox); 984 edje_object_part_swallow(wn->base, "terminology.cmdbox", wn->cmdbox);
974} 985}
975 986
976void 987void
@@ -1097,6 +1108,13 @@ main_win_free(Win *wn)
1097 { 1108 {
1098 main_term_free(term); 1109 main_term_free(term);
1099 } 1110 }
1111 if (wn->cmdbox_focus_timer)
1112 {
1113 ecore_timer_del(wn->cmdbox_focus_timer);
1114 wn->cmdbox_focus_timer = NULL;
1115 }
1116 evas_object_del(wn->cmdbox);
1117 wn->cmdbox = NULL;
1100 if (wn->split) _split_free(wn->split); 1118 if (wn->split) _split_free(wn->split);
1101 if (wn->win) 1119 if (wn->win)
1102 { 1120 {
@@ -1104,12 +1122,13 @@ main_win_free(Win *wn)
1104 evas_object_del(wn->win); 1122 evas_object_del(wn->win);
1105 } 1123 }
1106 if (wn->size_job) ecore_job_del(wn->size_job); 1124 if (wn->size_job) ecore_job_del(wn->size_job);
1125 if (wn->config) config_del(wn->config);
1107 free(wn); 1126 free(wn);
1108} 1127}
1109 1128
1110static Win * 1129static Win *
1111main_win_new(const char *name, const char *role, 1130main_win_new(const char *name, const char *role, const char *title,
1112 const char *title, const char *icon_name, 1131 const char *icon_name, Config *config,
1113 Eina_Bool fullscreen, Eina_Bool iconic, 1132 Eina_Bool fullscreen, Eina_Bool iconic,
1114 Eina_Bool borderless, Eina_Bool override, 1133 Eina_Bool borderless, Eina_Bool override,
1115 Eina_Bool maximized) 1134 Eina_Bool maximized)
@@ -1127,6 +1146,8 @@ main_win_new(const char *name, const char *role,
1127 return NULL; 1146 return NULL;
1128 } 1147 }
1129 1148
1149 wn->config = config;
1150
1130 evas_object_event_callback_add(wn->win, EVAS_CALLBACK_DEL, _cb_del, wn); 1151 evas_object_event_callback_add(wn->win, EVAS_CALLBACK_DEL, _cb_del, wn);
1131 1152
1132 if (fullscreen) elm_win_fullscreen_set(wn->win, EINA_TRUE); 1153 if (fullscreen) elm_win_fullscreen_set(wn->win, EINA_TRUE);
@@ -1147,12 +1168,31 @@ main_win_new(const char *name, const char *role,
1147 evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); 1168 evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
1148 elm_win_resize_object_add(wn->win, o); 1169 elm_win_resize_object_add(wn->win, o);
1149 evas_object_show(o); 1170 evas_object_show(o);
1150 1171
1151 wn->table = o = elm_table_add(wn->win); 1172 wn->base = o = edje_object_add(evas_object_evas_get(wn->win));
1173 theme_apply(o, config, "terminology/base");
1152 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1174 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1153 evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); 1175 evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
1154 elm_object_content_set(wn->conform, o); 1176 elm_object_content_set(wn->conform, o);
1155 evas_object_show(o); 1177 evas_object_show(o);
1178
1179 wn->cmdbox = o = elm_entry_add(wn->win);
1180 elm_entry_single_line_set(o, EINA_TRUE);
1181 elm_entry_scrollable_set(o, EINA_FALSE);
1182 elm_scroller_policy_set(o, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
1183 elm_entry_input_panel_layout_set(o, ELM_INPUT_PANEL_LAYOUT_TERMINAL);
1184 elm_entry_autocapital_type_set(o, ELM_AUTOCAPITAL_TYPE_NONE);
1185 elm_entry_input_panel_enabled_set(o, EINA_TRUE);
1186 elm_entry_input_panel_language_set(o, ELM_INPUT_PANEL_LANG_ALPHABET);
1187 elm_entry_input_panel_return_key_type_set(o, ELM_INPUT_PANEL_RETURN_KEY_TYPE_GO);
1188 elm_entry_prediction_allow_set(o, EINA_FALSE);
1189 evas_object_show(o);
1190 evas_object_smart_callback_add(o, "activated", _cb_cmd_activated, wn);
1191 evas_object_smart_callback_add(o, "aborted", _cb_cmd_aborted, wn);
1192 evas_object_smart_callback_add(o, "changed,user", _cb_cmd_changed, wn);
1193 evas_object_event_callback_add(o, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1194 _cb_cmd_hints_changed, wn);
1195 edje_object_part_swallow(wn->base, "terminology.cmdbox", o);
1156 1196
1157 evas_object_smart_callback_add(wn->win, "focus,in", _cb_focus_in, wn); 1197 evas_object_smart_callback_add(wn->win, "focus,in", _cb_focus_in, wn);
1158 evas_object_smart_callback_add(wn->win, "focus,out", _cb_focus_out, wn); 1198 evas_object_smart_callback_add(wn->win, "focus,out", _cb_focus_out, wn);
@@ -1170,15 +1210,8 @@ main_term_free(Term *term)
1170 { 1210 {
1171 eina_stringshare_del(s); 1211 eina_stringshare_del(s);
1172 } 1212 }
1173 if (term->cmdbox_focus_timer)
1174 {
1175 ecore_timer_del(term->cmdbox_focus_timer);
1176 term->cmdbox_focus_timer = NULL;
1177 }
1178 evas_object_del(term->term); 1213 evas_object_del(term->term);
1179 term->term = NULL; 1214 term->term = NULL;
1180 evas_object_del(term->cmdbox);
1181 term->cmdbox = NULL;
1182 evas_object_del(term->bg); 1215 evas_object_del(term->bg);
1183 term->bg = NULL; 1216 term->bg = NULL;
1184 if (term->popmedia) evas_object_del(term->popmedia); 1217 if (term->popmedia) evas_object_del(term->popmedia);
@@ -1207,7 +1240,6 @@ main_term_bg_redo(Term *term)
1207 1240
1208 edje_object_signal_callback_add(o, "popmedia,done", "terminology", 1241 edje_object_signal_callback_add(o, "popmedia,done", "terminology",
1209 _cb_popmedia_done, term); 1242 _cb_popmedia_done, term);
1210 edje_object_part_swallow(term->bg, "terminology.cmdbox", term->cmdbox);
1211 termio_theme_set(term->term, term->bg); 1243 termio_theme_set(term->term, term->bg);
1212 edje_object_part_swallow(term->bg, "terminology.content", term->term); 1244 edje_object_part_swallow(term->bg, "terminology.content", term->term);
1213 if ((term->focused) && (term->wn->focused)) 1245 if ((term->focused) && (term->wn->focused))
@@ -1253,24 +1285,6 @@ main_term_new(Win *wn, Config *config, const char *cmd,
1253 edje_object_signal_callback_add(o, "popmedia,done", "terminology", 1285 edje_object_signal_callback_add(o, "popmedia,done", "terminology",
1254 _cb_popmedia_done, term); 1286 _cb_popmedia_done, term);
1255 1287
1256 term->cmdbox = o = elm_entry_add(wn->win);
1257 elm_entry_single_line_set(o, EINA_TRUE);
1258 elm_entry_scrollable_set(o, EINA_FALSE);
1259 elm_scroller_policy_set(o, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
1260 elm_entry_input_panel_layout_set(o, ELM_INPUT_PANEL_LAYOUT_TERMINAL);
1261 elm_entry_autocapital_type_set(o, ELM_AUTOCAPITAL_TYPE_NONE);
1262 elm_entry_input_panel_enabled_set(o, EINA_TRUE);
1263 elm_entry_input_panel_language_set(o, ELM_INPUT_PANEL_LANG_ALPHABET);
1264 elm_entry_input_panel_return_key_type_set(o, ELM_INPUT_PANEL_RETURN_KEY_TYPE_GO);
1265 elm_entry_prediction_allow_set(o, EINA_FALSE);
1266 evas_object_show(o);
1267 evas_object_smart_callback_add(o, "activated", _cb_cmd_activated, term);
1268 evas_object_smart_callback_add(o, "aborted", _cb_cmd_aborted, term);
1269 evas_object_smart_callback_add(o, "changed,user", _cb_cmd_changed, term);
1270 evas_object_event_callback_add(o, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1271 _cb_cmd_hints_changed, term);
1272 edje_object_part_swallow(term->bg, "terminology.cmdbox", o);
1273
1274 term->term = o = termio_add(wn->win, config, cmd, login_shell, cd, 1288 term->term = o = termio_add(wn->win, config, cmd, login_shell, cd,
1275 size_w, size_h); 1289 size_w, size_h);
1276 colors_term_init(termio_textgrid_get(term->term), term->bg); 1290 colors_term_init(termio_textgrid_get(term->term), term->bg);
@@ -1472,18 +1486,20 @@ main_ipc_new(Ipc_Instance *inst)
1472 nargv[i++] = "-e"; 1486 nargv[i++] = "-e";
1473 nargv[i++] = (char *)inst->cmd; 1487 nargv[i++] = (char *)inst->cmd;
1474 } 1488 }
1489 config = config_load("config");
1475 ecore_app_args_set(nargc, (const char **)nargv); 1490 ecore_app_args_set(nargc, (const char **)nargv);
1476 wn = main_win_new(inst->name, inst->role, inst->title, inst->icon_name, 1491 wn = main_win_new(inst->name, inst->role, inst->title, inst->icon_name,
1477 inst->fullscreen, inst->iconic, inst->borderless, 1492 config, inst->fullscreen, inst->iconic,
1478 inst->override, inst->maximized); 1493 inst->borderless, inst->override, inst->maximized);
1479 if (!wn) 1494 if (!wn)
1480 { 1495 {
1481 ecore_app_args_set(pargc, (const char **)pargv); 1496 ecore_app_args_set(pargc, (const char **)pargv);
1482 free(nargv); 1497 free(nargv);
1498 config_del(config);
1483 return; 1499 return;
1484 } 1500 }
1485 config = config_load("config");
1486 1501
1502 config = config_load("config");
1487 unsetenv("DESKTOP_STARTUP_ID"); 1503 unsetenv("DESKTOP_STARTUP_ID");
1488 if (inst->background) 1504 if (inst->background)
1489 { 1505 {
@@ -1550,7 +1566,7 @@ main_ipc_new(Ipc_Instance *inst)
1550 } 1566 }
1551 else 1567 else
1552 { 1568 {
1553 elm_table_pack(wn->table, term->bg, 0, 0, 1, 1); 1569 edje_object_part_swallow(wn->base, "terminology.content", term->bg);
1554 _cb_size_hint(term, evas_object_evas_get(wn->win), term->term, NULL); 1570 _cb_size_hint(term, evas_object_evas_get(wn->win), term->term, NULL);
1555 } 1571 }
1556 1572
@@ -1993,7 +2009,7 @@ remote:
1993 } 2009 }
1994 } 2010 }
1995 2011
1996 wn = main_win_new(name, role, title, icon_name, 2012 wn = main_win_new(name, role, title, icon_name, config,
1997 fullscreen, iconic, borderless, override, maximized); 2013 fullscreen, iconic, borderless, override, maximized);
1998 // set an env so terminal apps can detect they are in terminology :) 2014 // set an env so terminal apps can detect they are in terminology :)
1999 putenv("TERMINOLOGY=1"); 2015 putenv("TERMINOLOGY=1");
@@ -2006,6 +2022,7 @@ remote:
2006 goto end; 2022 goto end;
2007 } 2023 }
2008 2024
2025 config = config_load("config");
2009 term = main_term_new(wn, config, cmd, login_shell, cd, 2026 term = main_term_new(wn, config, cmd, login_shell, cd,
2010 size_w, size_h, hold); 2027 size_w, size_h, hold);
2011 if (!term) 2028 if (!term)
@@ -2015,7 +2032,7 @@ remote:
2015 } 2032 }
2016 else 2033 else
2017 { 2034 {
2018 elm_table_pack(wn->table, term->bg, 0, 0, 1, 1); 2035 edje_object_part_swallow(wn->base, "terminology.content", term->bg);
2019 _cb_size_hint(term, evas_object_evas_get(wn->win), term->term, NULL); 2036 _cb_size_hint(term, evas_object_evas_get(wn->win), term->term, NULL);
2020 } 2037 }
2021 2038