summaryrefslogtreecommitdiff
path: root/src/bin/controls.c
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/controls.c
parentd9d731804162bf023b569676cd5d52ec94677432 (diff)
move options/controls out of term edj into separate one for the window
SVN revision: 83361
Diffstat (limited to 'src/bin/controls.c')
-rw-r--r--src/bin/controls.c67
1 files changed, 26 insertions, 41 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}