summaryrefslogtreecommitdiff
path: root/src/bin/controls.c
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2018-01-01 22:57:54 +0100
committerBoris Faure <billiob@gmail.com>2018-01-05 00:27:25 +0100
commit080ff8e261e4ed94485f17ece87762812b28c9d4 (patch)
tree3fe9652dec76431f0b47a4b3fcdae655c66c537e /src/bin/controls.c
parentd20e32c26f71caacf523db3d5117fce7ee75db06 (diff)
controls: simplify code
Diffstat (limited to 'src/bin/controls.c')
-rw-r--r--src/bin/controls.c363
1 files changed, 149 insertions, 214 deletions
diff --git a/src/bin/controls.c b/src/bin/controls.c
index a1f67c3..f6a01ad 100644
--- a/src/bin/controls.c
+++ b/src/bin/controls.c
@@ -1,6 +1,7 @@
1#include "private.h" 1#include "private.h"
2 2
3#include <Elementary.h> 3#include <Elementary.h>
4#include <assert.h>
4#include "controls.h" 5#include "controls.h"
5#include "options.h" 6#include "options.h"
6#include "about.h" 7#include "about.h"
@@ -9,13 +10,14 @@
9 10
10static Evas_Object *ct_frame = NULL, *ct_boxh = NULL, *ct_boxv = NULL; 11static Evas_Object *ct_frame = NULL, *ct_boxh = NULL, *ct_boxv = NULL;
11static Evas_Object *ct_box = NULL, *ct_box2 = NULL, *ct_box3 = NULL, *ct_over = NULL; 12static Evas_Object *ct_box = NULL, *ct_box2 = NULL, *ct_box3 = NULL, *ct_over = NULL;
12static Eina_Bool ct_out = EINA_FALSE;
13static Ecore_Timer *ct_del_timer = NULL;
14static Evas_Object *ct_win = NULL, *ct_bg = NULL, *ct_term = NULL; 13static Evas_Object *ct_win = NULL, *ct_bg = NULL, *ct_term = NULL;
15static void (*ct_donecb) (void *data) = NULL; 14static void (*ct_donecb) (void *data) = NULL;
16static void *ct_donedata = NULL; 15static void *ct_donedata = NULL;
17 16
18static void 17static void
18controls_hide(Eina_Bool call_cb);
19
20static void
19_cb_sel_on(void *_data EINA_UNUSED, 21_cb_sel_on(void *_data EINA_UNUSED,
20 Evas_Object *_term EINA_UNUSED, 22 Evas_Object *_term EINA_UNUSED,
21 void *_ev EINA_UNUSED) 23 void *_ev EINA_UNUSED)
@@ -36,19 +38,10 @@ _cb_sel_off(void *_data EINA_UNUSED,
36} 38}
37 39
38static Eina_Bool 40static Eina_Bool
39_cb_ct_del_delay(void *_data EINA_UNUSED) 41_cb_ct_del_delay(void *data)
40{ 42{
41 if (ct_over) 43 Evas_Object *frame = data;
42 { 44 evas_object_del(frame);
43 evas_object_del(ct_over);
44 ct_over = NULL;
45 }
46 if (ct_frame)
47 {
48 evas_object_del(ct_frame);
49 ct_frame = NULL;
50 }
51 ct_del_timer = NULL;
52 elm_cache_all_flush(); 45 elm_cache_all_flush();
53 return EINA_FALSE; 46 return EINA_FALSE;
54} 47}
@@ -58,8 +51,8 @@ _cb_ct_copy(void *_data EINA_UNUSED,
58 Evas_Object *_obj EINA_UNUSED, 51 Evas_Object *_obj EINA_UNUSED,
59 void *_event EINA_UNUSED) 52 void *_event EINA_UNUSED)
60{ 53{
54 controls_hide(EINA_TRUE);
61 termio_take_selection(ct_term, ELM_SEL_TYPE_CLIPBOARD); 55 termio_take_selection(ct_term, ELM_SEL_TYPE_CLIPBOARD);
62 controls_toggle(ct_win, ct_bg, ct_term, ct_donecb, ct_donedata);
63} 56}
64 57
65static void 58static void
@@ -67,8 +60,8 @@ _cb_ct_paste(void *_data EINA_UNUSED,
67 Evas_Object *_obj EINA_UNUSED, 60 Evas_Object *_obj EINA_UNUSED,
68 void *_event EINA_UNUSED) 61 void *_event EINA_UNUSED)
69{ 62{
63 controls_hide(EINA_TRUE);
70 termio_paste_selection(ct_term, ELM_SEL_TYPE_CLIPBOARD); 64 termio_paste_selection(ct_term, ELM_SEL_TYPE_CLIPBOARD);
71 controls_toggle(ct_win, ct_bg, ct_term, ct_donecb, ct_donedata);
72} 65}
73 66
74static void 67static void
@@ -108,7 +101,8 @@ _cb_ct_set_title(void *_data EINA_UNUSED,
108 Evas_Object *_obj EINA_UNUSED, 101 Evas_Object *_obj EINA_UNUSED,
109 void *_event EINA_UNUSED) 102 void *_event EINA_UNUSED)
110{ 103{
111 term_set_title(termio_term_get(ct_term)); 104 controls_hide(EINA_TRUE);
105 term_set_title(termio_term_get(ct_term));
112} 106}
113 107
114static void 108static void
@@ -116,6 +110,7 @@ _cb_ct_close(void *_data EINA_UNUSED,
116 Evas_Object *_obj EINA_UNUSED, 110 Evas_Object *_obj EINA_UNUSED,
117 void *_event EINA_UNUSED) 111 void *_event EINA_UNUSED)
118{ 112{
113 controls_hide(EINA_TRUE);
119 term_close(ct_win, ct_term, EINA_FALSE); 114 term_close(ct_win, ct_term, EINA_FALSE);
120} 115}
121 116
@@ -124,7 +119,7 @@ _cb_ct_options(void *_data EINA_UNUSED,
124 Evas_Object *_obj EINA_UNUSED, 119 Evas_Object *_obj EINA_UNUSED,
125 void *_event EINA_UNUSED) 120 void *_event EINA_UNUSED)
126{ 121{
127 controls_toggle(ct_win, ct_bg, ct_term, ct_donecb, ct_donedata); 122 controls_hide(EINA_FALSE);
128 options_toggle(ct_win, ct_bg, ct_term, ct_donecb, ct_donedata); 123 options_toggle(ct_win, ct_bg, ct_term, ct_donecb, ct_donedata);
129} 124}
130 125
@@ -133,7 +128,7 @@ _cb_ct_about(void *_data EINA_UNUSED,
133 Evas_Object *_obj EINA_UNUSED, 128 Evas_Object *_obj EINA_UNUSED,
134 void *_event EINA_UNUSED) 129 void *_event EINA_UNUSED)
135{ 130{
136 controls_toggle(ct_win, ct_bg, ct_term, ct_donecb, ct_donedata); 131 controls_hide(EINA_FALSE);
137 about_toggle(ct_win, ct_bg, ct_term, ct_donecb, ct_donedata); 132 about_toggle(ct_win, ct_bg, ct_term, ct_donecb, ct_donedata);
138} 133}
139 134
@@ -143,82 +138,34 @@ _cb_mouse_down(void *_data EINA_UNUSED,
143 Evas_Object *_obj EINA_UNUSED, 138 Evas_Object *_obj EINA_UNUSED,
144 void *_ev EINA_UNUSED) 139 void *_ev EINA_UNUSED)
145{ 140{
146 controls_toggle(ct_win, ct_bg, ct_term, ct_donecb, ct_donedata); 141 controls_hide(EINA_TRUE);
147} 142}
148 143
149static void 144static void
150_cb_frame_del(void *_data EINA_UNUSED, 145_cb_saved_del(void *data,
151 Evas *_e EINA_UNUSED, 146 Evas *_e EINA_UNUSED,
152 Evas_Object *_obj EINA_UNUSED, 147 Evas_Object *obj EINA_UNUSED,
153 void *_ev EINA_UNUSED) 148 void *_ev EINA_UNUSED)
154{ 149{
155 if (ct_win) 150 if (data == ct_win)
156 { 151 ct_win = NULL;
157 evas_object_smart_callback_del(ct_win, "selection,on", _cb_sel_on); 152 else if (data == ct_term)
158 evas_object_smart_callback_del(ct_win, "selection,off", _cb_sel_off); 153 ct_term = NULL;
159 }
160 ct_frame = NULL;
161}
162
163static void
164_cb_over_del(void *_data EINA_UNUSED,
165 Evas *_e EINA_UNUSED,
166 Evas_Object *_obj EINA_UNUSED,
167 void *_ev EINA_UNUSED)
168{
169 ct_over = NULL;
170}
171 154
172static void 155 controls_hide(EINA_FALSE);
173_cb_saved_del(void *_data EINA_UNUSED,
174 Evas *_e EINA_UNUSED,
175 Evas_Object *obj,
176 void *_ev EINA_UNUSED)
177{
178 if ((obj == ct_win) || (obj == ct_term))
179 {
180 if (obj == ct_term)
181 {
182 if (ct_out)
183 controls_toggle(ct_win, ct_bg, ct_term, ct_donecb, ct_donedata);
184 ct_term = NULL;
185 }
186 else
187 {
188 if (ct_frame)
189 {
190 evas_object_del(ct_frame);
191 ct_frame = NULL;
192 }
193 if (ct_del_timer)
194 {
195 ecore_timer_del(ct_del_timer);
196 ct_del_timer = NULL;
197 }
198 if (ct_over)
199 {
200 evas_object_del(ct_over);
201 ct_over = NULL;
202 }
203 evas_object_event_callback_del(ct_win, EVAS_CALLBACK_DEL, _cb_saved_del);
204 ct_win = NULL;
205 }
206 evas_object_event_callback_del(ct_term, EVAS_CALLBACK_DEL, _cb_saved_del);
207 ct_bg = NULL;
208 }
209} 156}
210 157
211static Evas_Object * 158static Evas_Object *
212_button_add(Evas_Object *win, const char *label, const char *icon, Evas_Smart_Cb cb, void *cbdata) 159_button_add(Evas_Object *win, const char *label, const char *icon, Evas_Smart_Cb cb, void *cbdata)
213{ 160{
214 Evas_Object *o, *bt; 161 Evas_Object *o, *bt;
215 162
216 bt = o = elm_button_add(win); 163 bt = o = elm_button_add(win);
217 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0); 164 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
218 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); 165 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
219 if (label) elm_object_text_set(o, label); 166 if (label) elm_object_text_set(o, label);
220 evas_object_smart_callback_add(o, "clicked", cb, cbdata); 167 evas_object_smart_callback_add(o, "clicked", cb, cbdata);
221 168
222 if (icon) 169 if (icon)
223 { 170 {
224 o = elm_icon_add(win); 171 o = elm_icon_add(win);
@@ -227,7 +174,7 @@ _button_add(Evas_Object *win, const char *label, const char *icon, Evas_Smart_Cb
227 elm_object_part_content_set(bt, "icon", o); 174 elm_object_part_content_set(bt, "icon", o);
228 evas_object_show(o); 175 evas_object_show(o);
229 } 176 }
230 177
231 evas_object_show(bt); 178 evas_object_show(bt);
232 return bt; 179 return bt;
233} 180}
@@ -236,7 +183,7 @@ static Evas_Object *
236_sep_add_v(Evas_Object *win) 183_sep_add_v(Evas_Object *win)
237{ 184{
238 Evas_Object *o = elm_separator_add(win); 185 Evas_Object *o = elm_separator_add(win);
239 186
240 evas_object_size_hint_weight_set(o, 0.0, EVAS_HINT_EXPAND); 187 evas_object_size_hint_weight_set(o, 0.0, EVAS_HINT_EXPAND);
241 evas_object_size_hint_align_set(o, 0.5, EVAS_HINT_FILL); 188 evas_object_size_hint_align_set(o, 0.5, EVAS_HINT_FILL);
242 elm_separator_horizontal_set(o, EINA_FALSE); 189 elm_separator_horizontal_set(o, EINA_FALSE);
@@ -248,7 +195,7 @@ static Evas_Object *
248_sep_add_h(Evas_Object *win) 195_sep_add_h(Evas_Object *win)
249{ 196{
250 Evas_Object *o = elm_separator_add(win); 197 Evas_Object *o = elm_separator_add(win);
251 198
252 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0); 199 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
253 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.5); 200 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.5);
254 elm_separator_horizontal_set(o, EINA_TRUE); 201 elm_separator_horizontal_set(o, EINA_TRUE);
@@ -256,167 +203,155 @@ _sep_add_h(Evas_Object *win)
256 return o; 203 return o;
257} 204}
258 205
259void 206static void
260controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term, 207controls_hide(Eina_Bool call_cb)
261 void (*donecb) (void *data), void *donedata)
262{ 208{
263 Evas_Object *o; 209 if (!ct_frame)
210 return;
264 211
265 if (!ct_out) 212 if (ct_win)
266 { 213 {
267 if (options_is_active()) 214 evas_object_event_callback_del(ct_win, EVAS_CALLBACK_DEL, _cb_saved_del);
268 { 215 evas_object_smart_callback_del(ct_win, "selection,on", _cb_sel_on);
269 options_toggle(win, bg, term, ct_donecb, ct_donedata); 216 evas_object_smart_callback_del(ct_win, "selection,off", _cb_sel_off);
270 return;
271 }
272 } 217 }
273 if ((win != ct_win) && (ct_frame)) 218 if (ct_term)
274 { 219 {
275 evas_object_del(ct_frame); 220 evas_object_event_callback_del(ct_term, EVAS_CALLBACK_DEL, _cb_saved_del);
276 ct_frame = NULL;
277 ct_win = NULL;
278 ct_term = NULL;
279 } 221 }
280 if (!ct_frame) 222
223 if (ct_over)
281 { 224 {
282 ct_frame = o = elm_frame_add(win); 225 evas_object_del(ct_over);
283 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 226 }
284 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); 227 ct_over = NULL;
285 elm_object_text_set(o, _("Controls")); 228 edje_object_signal_emit(ct_bg, "controls,hide", "terminology");
286 229 elm_object_focus_set(ct_frame, EINA_FALSE);
287 ct_boxv = o = elm_box_add(win);
288 elm_box_horizontal_set(o, EINA_FALSE);
289 elm_object_content_set(ct_frame, o);
290 evas_object_show(o);
291 230
292 ct_boxh = o = elm_box_add(win); 231 ecore_timer_add(10.0, _cb_ct_del_delay, ct_frame);
293 elm_box_pack_end(ct_boxv, o); 232 ct_frame = NULL;
294 elm_box_horizontal_set(o, EINA_TRUE);
295 evas_object_show(o);
296 233
297 ct_box = o = elm_box_add(win); 234 ct_win = NULL;
298 elm_box_pack_end(ct_boxh, o);
299 evas_object_show(o);
300 235
301 o = _button_add(win, _("New"), "window-new", _cb_ct_new, NULL); 236 if (call_cb && ct_donecb)
302 elm_box_pack_end(ct_box, o); 237 ct_donecb(ct_donedata);
238 ct_donecb = NULL;
239 ct_donedata = NULL;
240}
303 241
304 o = _sep_add_h(win); 242void
305 elm_box_pack_end(ct_box, o); 243controls_show(Evas_Object *win, Evas_Object *bg, Evas_Object *term,
244 void (*donecb) (void *data), void *donedata)
245{
246 Evas_Object *o;
306 247
307 o = _button_add(win, _("Split V"), "object-flip-vertical", _cb_ct_split_v, NULL); 248 if ((options_is_active()) || (ct_win && win != ct_win) || (ct_frame))
308 elm_box_pack_end(ct_box, o); 249 {
309 o = _button_add(win, _("Split H"), "object-flip-horizontal", _cb_ct_split_h, NULL); 250 donecb(donedata);
310 elm_box_pack_end(ct_box, o); 251 return;
252 }
311 253
312 o = _sep_add_h(win); 254 ct_frame = o = elm_frame_add(win);
313 elm_box_pack_end(ct_box, o); 255 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
256 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
257 elm_object_text_set(o, _("Controls"));
314 258
315 o = _button_add(win, _("Miniview"), "view-restore", _cb_ct_miniview, NULL); 259 ct_boxv = o = elm_box_add(win);
316 elm_box_pack_end(ct_box, o); 260 elm_box_horizontal_set(o, EINA_FALSE);
261 elm_object_content_set(ct_frame, o);
262 evas_object_show(o);
317 263
318 o = _sep_add_h(win); 264 ct_boxh = o = elm_box_add(win);
319 elm_box_pack_end(ct_box, o); 265 elm_box_pack_end(ct_boxv, o);
266 elm_box_horizontal_set(o, EINA_TRUE);
267 evas_object_show(o);
320 268
321 o = _button_add(win, _("Set title"), "format-text-underline", _cb_ct_set_title, NULL); 269 ct_box = o = elm_box_add(win);
322 elm_box_pack_end(ct_box, o); 270 elm_box_pack_end(ct_boxh, o);
271 evas_object_show(o);
323 272
324 o = _sep_add_v(win); 273 o = _button_add(win, _("New"), "window-new", _cb_ct_new, NULL);
325 elm_box_pack_end(ct_boxh, o); 274 elm_box_pack_end(ct_box, o);
326 275
327 ct_box2 = o = elm_box_add(win); 276 o = _sep_add_h(win);
328 elm_box_pack_end(ct_boxh, o); 277 elm_box_pack_end(ct_box, o);
329 evas_object_show(o);
330 278
331 o = _button_add(win, _("Copy"), "edit-copy", _cb_ct_copy, NULL); 279 o = _button_add(win, _("Split V"), "object-flip-vertical", _cb_ct_split_v, NULL);
332 evas_object_data_set(ct_frame, "bt_copy", o); 280 elm_box_pack_end(ct_box, o);
333 if (!termio_selection_exists(term)) 281 o = _button_add(win, _("Split H"), "object-flip-horizontal", _cb_ct_split_h, NULL);
334 elm_object_disabled_set(o, EINA_TRUE); 282 elm_box_pack_end(ct_box, o);
335 elm_box_pack_end(ct_box2, o);
336 283
337 o = _button_add(win, _("Paste"), "edit-paste", _cb_ct_paste, NULL); 284 o = _sep_add_h(win);
338 elm_box_pack_end(ct_box2, o); 285 elm_box_pack_end(ct_box, o);
339 286
340 o = _sep_add_h(win); 287 o = _button_add(win, _("Miniview"), "view-restore", _cb_ct_miniview, NULL);
341 elm_box_pack_end(ct_box2, o); 288 elm_box_pack_end(ct_box, o);
342 289
343 o = _button_add(win, _("Settings"), "preferences-desktop", _cb_ct_options, NULL); 290 o = _sep_add_h(win);
344 elm_box_pack_end(ct_box2, o); 291 elm_box_pack_end(ct_box, o);
345 292
346 o = _sep_add_h(win); 293 o = _button_add(win, _("Set title"), "format-text-underline", _cb_ct_set_title, NULL);
347 elm_box_pack_end(ct_box2, o); 294 elm_box_pack_end(ct_box, o);
348 295
349 o = _button_add(win, _("About"), "help-about", _cb_ct_about, NULL); 296 o = _sep_add_v(win);
350 elm_box_pack_end(ct_box2, o); 297 elm_box_pack_end(ct_boxh, o);
351 298
352 o = _sep_add_h(win); 299 ct_box2 = o = elm_box_add(win);
353 elm_box_pack_end(ct_boxv, o); 300 elm_box_pack_end(ct_boxh, o);
301 evas_object_show(o);
354 302
355 ct_box3 = o = elm_box_add(win); 303 o = _button_add(win, _("Copy"), "edit-copy", _cb_ct_copy, NULL);
356 elm_box_pack_end(ct_boxv, o); 304 evas_object_data_set(ct_frame, "bt_copy", o);
357 evas_object_show(o); 305 if (!termio_selection_exists(term))
306 elm_object_disabled_set(o, EINA_TRUE);
307 elm_box_pack_end(ct_box2, o);
358 308
359 o = _button_add(win, _("Close Terminal"), "window-close", _cb_ct_close, NULL); 309 o = _button_add(win, _("Paste"), "edit-paste", _cb_ct_paste, NULL);
360 elm_box_pack_end(ct_box3, o); 310 elm_box_pack_end(ct_box2, o);
361 311
362 evas_object_event_callback_add(ct_frame, EVAS_CALLBACK_DEL, 312 o = _sep_add_h(win);
363 _cb_frame_del, NULL); 313 elm_box_pack_end(ct_box2, o);
364 314
365 evas_object_smart_callback_add(win, "selection,on", _cb_sel_on, 315 o = _button_add(win, _("Settings"), "preferences-desktop", _cb_ct_options, NULL);
366 NULL); 316 elm_box_pack_end(ct_box2, o);
367 evas_object_smart_callback_add(win, "selection,off", _cb_sel_off, 317
368 NULL); 318 o = _sep_add_h(win);
369 } 319 elm_box_pack_end(ct_box2, o);
370 if (!ct_out) 320
371 { 321 o = _button_add(win, _("About"), "help-about", _cb_ct_about, NULL);
372 edje_object_part_swallow(bg, "terminology.controls", ct_frame); 322 elm_box_pack_end(ct_box2, o);
373 evas_object_show(ct_frame); 323
374 ct_over = o = evas_object_rectangle_add(evas_object_evas_get(win)); 324 o = _sep_add_h(win);
375 evas_object_color_set(o, 0, 0, 0, 0); 325 elm_box_pack_end(ct_boxv, o);
376 edje_object_part_swallow(bg, "terminology.dismiss", o); 326
377 evas_object_show(o); 327 ct_box3 = o = elm_box_add(win);
378 evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, 328 elm_box_pack_end(ct_boxv, o);
379 _cb_mouse_down, NULL); 329 evas_object_show(o);
380 evas_object_event_callback_add(o, EVAS_CALLBACK_DEL, 330
381 _cb_over_del, NULL); 331 o = _button_add(win, _("Close Terminal"), "window-close", _cb_ct_close, NULL);
382 332 elm_box_pack_end(ct_box3, o);
383 ct_win = win; 333
384 ct_bg = bg; 334 evas_object_smart_callback_add(win, "selection,on", _cb_sel_on,
385 ct_term = term; 335 NULL);
386 ct_donecb = donecb; 336 evas_object_smart_callback_add(win, "selection,off", _cb_sel_off,
387 ct_donedata = donedata; 337 NULL);
388 edje_object_signal_emit(bg, "controls,show", "terminology"); 338
389 ct_out = EINA_TRUE; 339 edje_object_part_swallow(bg, "terminology.controls", ct_frame);
390 elm_object_focus_set(ct_frame, EINA_TRUE); 340 evas_object_show(ct_frame);
391 if (ct_del_timer) 341 ct_over = o = evas_object_rectangle_add(evas_object_evas_get(win));
392 { 342 evas_object_color_set(o, 0, 0, 0, 0);
393 ecore_timer_del(ct_del_timer); 343 edje_object_part_swallow(bg, "terminology.dismiss", o);
394 ct_del_timer = NULL; 344 evas_object_show(o);
395 } 345 evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,
396 } 346 _cb_mouse_down, NULL);
397 else 347
398 { 348 ct_win = win;
399 if (ct_over) 349 ct_bg = bg;
400 { 350 ct_term = term;
401 evas_object_del(ct_over); 351 ct_donecb = donecb;
402 ct_over = NULL; 352 ct_donedata = donedata;
403 } 353 edje_object_signal_emit(bg, "controls,show", "terminology");
404 edje_object_signal_emit(ct_bg, "controls,hide", "terminology"); 354 elm_object_focus_set(ct_frame, EINA_TRUE);
405 ct_out = EINA_FALSE; 355 evas_object_event_callback_add(ct_win, EVAS_CALLBACK_DEL, _cb_saved_del, ct_win);
406 elm_object_focus_set(ct_frame, EINA_FALSE); 356 evas_object_event_callback_add(ct_term, EVAS_CALLBACK_DEL, _cb_saved_del, ct_term);
407 if (ct_donecb) ct_donecb(ct_donedata);
408// elm_object_focus_set(ct_term, EINA_TRUE);
409 if (ct_del_timer) ecore_timer_del(ct_del_timer);
410 ct_del_timer = ecore_timer_add(10.0, _cb_ct_del_delay, NULL);
411 }
412 if (ct_win)
413 {
414 evas_object_event_callback_del(ct_win, EVAS_CALLBACK_DEL, _cb_saved_del);
415 evas_object_event_callback_del(ct_term, EVAS_CALLBACK_DEL, _cb_saved_del);
416 }
417 if (ct_out)
418 {
419 evas_object_event_callback_add(ct_win, EVAS_CALLBACK_DEL, _cb_saved_del, NULL);
420 evas_object_event_callback_add(ct_term, EVAS_CALLBACK_DEL, _cb_saved_del, NULL);
421 }
422} 357}