summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/controls.c18
-rw-r--r--src/bin/main.c190
-rw-r--r--src/bin/main.h1
-rw-r--r--src/bin/termio.c33
-rw-r--r--src/bin/termio.h1
-rw-r--r--src/bin/termptyesc.c3
6 files changed, 217 insertions, 29 deletions
diff --git a/src/bin/controls.c b/src/bin/controls.c
index 73b30a4..567cd1d 100644
--- a/src/bin/controls.c
+++ b/src/bin/controls.c
@@ -43,6 +43,12 @@ _cb_ct_paste(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
43} 43}
44 44
45static void 45static void
46_cb_ct_new(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
47{
48 main_new(ct_win, ct_term);
49}
50
51static void
46_cb_ct_split_v(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__) 52_cb_ct_split_v(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
47{ 53{
48 main_split_v(ct_win, ct_term); 54 main_split_v(ct_win, ct_term);
@@ -144,6 +150,16 @@ controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
144 elm_box_pack_end(ct_boxh, o); 150 elm_box_pack_end(ct_boxh, o);
145 evas_object_show(o); 151 evas_object_show(o);
146 152
153 // XXX: need real icon
154 o = elm_button_add(win);
155 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
156 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
157 elm_object_text_set(o, "*");
158 elm_box_pack_end(ct_box2, o);
159 evas_object_show(o);
160 evas_object_smart_callback_add(o, "clicked", _cb_ct_new, NULL);
161
162 // XXX: need real icon
147 o = elm_button_add(win); 163 o = elm_button_add(win);
148 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);
149 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);
@@ -152,6 +168,7 @@ controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
152 evas_object_show(o); 168 evas_object_show(o);
153 evas_object_smart_callback_add(o, "clicked", _cb_ct_split_v, NULL); 169 evas_object_smart_callback_add(o, "clicked", _cb_ct_split_v, NULL);
154 170
171 // XXX: need real icon
155 o = elm_button_add(win); 172 o = elm_button_add(win);
156 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0); 173 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
157 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); 174 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
@@ -160,6 +177,7 @@ controls_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term)
160 evas_object_show(o); 177 evas_object_show(o);
161 evas_object_smart_callback_add(o, "clicked", _cb_ct_split_h, NULL); 178 evas_object_smart_callback_add(o, "clicked", _cb_ct_split_h, NULL);
162 179
180 // XXX: need real icon
163 o = elm_button_add(win); 181 o = elm_button_add(win);
164 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0); 182 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
165 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); 183 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
diff --git a/src/bin/main.c b/src/bin/main.c
index d929d7b..36d9e8a 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -65,8 +65,9 @@ struct _Split
65 Win *wn; // win this split belongs to 65 Win *wn; // win this split belongs to
66 Split *parent; // the parent split or null if toplevel 66 Split *parent; // the parent split or null if toplevel
67 Split *s1, *s2; // left/right or top/bottom child splits, null if leaf 67 Split *s1, *s2; // left/right or top/bottom child splits, null if leaf
68 Term *term; // if leaf node this is not null 68 Term *term; // if leaf node this is not null - the CURRENT term from terms list
69 Evas_Object *panes; 69 Eina_List *terms; // list of terms in the "tabs"
70 Evas_Object *panes; // null if a leaf node
70 Eina_Bool horizontal : 1; 71 Eina_Bool horizontal : 1;
71}; 72};
72 73
@@ -98,10 +99,16 @@ static Split *
98_split_split_find(Split *sp, Evas_Object *term) 99_split_split_find(Split *sp, Evas_Object *term)
99{ 100{
100 Split *sp2; 101 Split *sp2;
102 Eina_List *l;
103 Term *tm;
101 104
102 if (sp->term) 105 if (sp->term)
103 { 106 {
104 if (sp->term->term == term) return sp; 107 if (sp->term->term == term) return sp;
108 EINA_LIST_FOREACH(sp->terms, l, tm)
109 {
110 if (tm->term == term) return sp;
111 }
105 } 112 }
106 if (sp->s1) 113 if (sp->s1)
107 { 114 {
@@ -149,9 +156,11 @@ _split_split(Split *sp, Eina_Bool horizontal)
149 sp2->parent = sp; 156 sp2->parent = sp;
150 sp2->wn = sp->wn; 157 sp2->wn = sp->wn;
151 sp2->term = sp->term; 158 sp2->term = sp->term;
159 sp2->terms = sp->terms;
160 sp->terms = NULL;
152 161
153 if (!sp->parent) edje_object_part_unswallow(sp->wn->base, sp->term->bg); 162 if (!sp->parent) edje_object_part_unswallow(sp->wn->base, sp->term->bg);
154 main_term_bg_redo(sp->term); 163 main_term_bg_redo(sp2->term);
155 164
156 sp2 = sp->s2 = calloc(1, sizeof(Split)); 165 sp2 = sp->s2 = calloc(1, sizeof(Split));
157 sp2->parent = sp; 166 sp2->parent = sp;
@@ -160,6 +169,7 @@ _split_split(Split *sp, Eina_Bool horizontal)
160 sp2->term = main_term_new(sp->wn, config, 169 sp2->term = main_term_new(sp->wn, config,
161 NULL, EINA_FALSE, NULL, 170 NULL, EINA_FALSE, NULL,
162 80, 24, EINA_FALSE); 171 80, 24, EINA_FALSE);
172 sp2->terms = eina_list_append(sp2->terms, sp2->term);
163 _term_focus(sp2->term); 173 _term_focus(sp2->term);
164 _term_media_update(sp2->term, config); 174 _term_media_update(sp2->term, config);
165 evas_object_data_set(sp2->term->term, "sizedone", sp2->term->term); 175 evas_object_data_set(sp2->term->term, "sizedone", sp2->term->term);
@@ -185,6 +195,56 @@ _split_split(Split *sp, Eina_Bool horizontal)
185 sp->term = NULL; 195 sp->term = NULL;
186} 196}
187 197
198static void
199_term_focus_show(Split *sp, Term *term)
200{
201 if (term != sp->term)
202 {
203 evas_object_hide(sp->term->bg);
204 sp->term = term;
205 }
206 if (!sp->parent)
207 edje_object_part_swallow(sp->wn->base, "terminology.content",
208 sp->term->bg);
209 else
210 {
211 if (sp == sp->parent->s1)
212 {
213 elm_object_part_content_unset(sp->parent->panes, PANES_TOP);
214 elm_object_part_content_set(sp->parent->panes, PANES_TOP,
215 sp->term->bg);
216 }
217 else
218 {
219 elm_object_part_content_unset(sp->parent->panes, PANES_BOTTOM);
220 elm_object_part_content_set(sp->parent->panes, PANES_BOTTOM,
221 sp->term->bg);
222 }
223 }
224 evas_object_show(sp->term->bg);
225}
226
227void
228main_new(Evas_Object *win, Evas_Object *term)
229{
230 Split *sp = _split_find(win, term);
231 Config *config;
232 int w, h;
233
234 if (!sp) return;
235 evas_object_hide(sp->term->bg);
236 config = config_fork(sp->term->config);
237 termio_size_get(sp->term->term, &w, &h);
238 sp->term = main_term_new(sp->wn, config,
239 NULL, EINA_FALSE, NULL,
240 w, h, EINA_FALSE);
241 sp->terms = eina_list_append(sp->terms, sp->term);
242 _term_focus(sp->term);
243 _term_media_update(sp->term, config);
244 evas_object_data_set(sp->term->term, "sizedone", sp->term->term);
245 _term_focus_show(sp, sp->term);
246}
247
188void 248void
189main_split_h(Evas_Object *win, Evas_Object *term) 249main_split_h(Evas_Object *win, Evas_Object *term)
190{ 250{
@@ -206,7 +266,8 @@ main_split_v(Evas_Object *win, Evas_Object *term)
206static void 266static void
207_split_append(Split *sp, Eina_List **flat) 267_split_append(Split *sp, Eina_List **flat)
208{ 268{
209 if (sp->term) *flat = eina_list_append(*flat, sp); 269 if (sp->term)
270 *flat = eina_list_append(*flat, sp);
210 else 271 else
211 { 272 {
212 _split_append(sp->s1, flat); 273 _split_append(sp->s1, flat);
@@ -230,6 +291,8 @@ _term_next_get(Term *termin)
230 Eina_List *flat, *l; 291 Eina_List *flat, *l;
231 292
232 sp = _split_find(termin->wn->win, termin->term); 293 sp = _split_find(termin->wn->win, termin->term);
294 l = eina_list_data_find_list(sp->terms, termin);
295 if ((l) && (l->next)) return l->next->data;
233 if (!sp->parent) return NULL; 296 if (!sp->parent) return NULL;
234 flat = _split_flatten(termin->wn->split); 297 flat = _split_flatten(termin->wn->split);
235 if (!flat) return NULL; 298 if (!flat) return NULL;
@@ -243,10 +306,12 @@ _term_next_get(Term *termin)
243 { 306 {
244 sp = l->next->data; 307 sp = l->next->data;
245 eina_list_free(flat); 308 eina_list_free(flat);
309 if (sp->terms) return sp->terms->data;
246 return sp->term; 310 return sp->term;
247 } 311 }
248 sp = flat->data; 312 sp = flat->data;
249 eina_list_free(flat); 313 eina_list_free(flat);
314 if (sp->terms) return sp->terms->data;
250 return sp->term; 315 return sp->term;
251} 316}
252 317
@@ -257,6 +322,8 @@ _term_prev_get(Term *termin)
257 Eina_List *flat, *l; 322 Eina_List *flat, *l;
258 323
259 sp = _split_find(termin->wn->win, termin->term); 324 sp = _split_find(termin->wn->win, termin->term);
325 l = eina_list_data_find_list(sp->terms, termin);
326 if ((l) && (l->prev)) return l->prev->data;
260 if (!sp->parent) return NULL; 327 if (!sp->parent) return NULL;
261 flat = _split_flatten(termin->wn->split); 328 flat = _split_flatten(termin->wn->split);
262 if (!flat) return NULL; 329 if (!flat) return NULL;
@@ -270,6 +337,8 @@ _term_prev_get(Term *termin)
270 { 337 {
271 sp = l->prev->data; 338 sp = l->prev->data;
272 eina_list_free(flat); 339 eina_list_free(flat);
340 l = eina_list_last(sp->terms);
341 if (l) return l->data;
273 return sp->term; 342 return sp->term;
274 } 343 }
275#if (EINA_VERSION_MAJOR > 1) || (EINA_VERSION_MINOR >= 8) 344#if (EINA_VERSION_MAJOR > 1) || (EINA_VERSION_MINOR >= 8)
@@ -278,6 +347,8 @@ _term_prev_get(Term *termin)
278 sp = eina_list_data_get(eina_list_last(flat)); 347 sp = eina_list_data_get(eina_list_last(flat));
279#endif 348#endif
280 eina_list_free(flat); 349 eina_list_free(flat);
350 l = eina_list_last(sp->terms);
351 if (l) return l->data;
281 return sp->term; 352 return sp->term;
282} 353}
283 354
@@ -291,6 +362,8 @@ _split_merge(Split *spp, Split *sp, const char *slot)
291 main_term_bg_redo(sp->term); 362 main_term_bg_redo(sp->term);
292 spp->term = sp->term; 363 spp->term = sp->term;
293 sp->term = NULL; 364 sp->term = NULL;
365 spp->terms = sp->terms;
366 sp->terms = NULL;
294 o = spp->term->bg; 367 o = spp->term->bg;
295 spp->s1 = NULL; 368 spp->s1 = NULL;
296 spp->s2 = NULL; 369 spp->s2 = NULL;
@@ -358,47 +431,91 @@ main_close(Evas_Object *win, Evas_Object *term)
358 Split *sp = _split_find(win, term); 431 Split *sp = _split_find(win, term);
359 Split *spp, *spkeep = NULL; 432 Split *spp, *spkeep = NULL;
360 Term *termfoc = NULL; 433 Term *termfoc = NULL;
361#ifdef ELM_PANE_BUG_1_7 434 Eina_List *l;
362 const char *slot = "left"; 435 const char *slot = PANES_TOP;
363#else
364 const char *slot = "top";
365#endif
366 436
367 if (!sp) return; 437 if (!sp) return;
368 if (!sp->term) return; 438 if (!sp->term) return;
369 spp = sp->parent; 439 spp = sp->parent;
370 if ((sp->term->focused) && (spp)) termfoc = _term_next_get(sp->term); 440 if ((sp->term->focused) && (spp)) termfoc = _term_next_get(sp->term);
371 sp->wn->terms = eina_list_remove(sp->wn->terms, sp->term); 441 sp->wn->terms = eina_list_remove(sp->wn->terms, sp->term);
442// printf("main_close %p %p\n", win, term);
372 if (spp) 443 if (spp)
373 { 444 {
374 if (sp == spp->s2) 445 if (eina_list_count(sp->terms) <= 1)
375 {
376 spkeep = spp->s1;
377 spp->s2 = NULL;
378 }
379 else
380 { 446 {
381 spkeep = spp->s2; 447 if (sp == spp->s2)
382 spp->s1 = NULL; 448 {
449 spkeep = spp->s1;
450 spp->s2 = NULL;
451 }
452 else
453 {
454 spkeep = spp->s2;
455 spp->s1 = NULL;
456 }
383 } 457 }
384 458 l = eina_list_data_find_list(sp->terms, sp->term);
385 main_term_free(sp->term); 459 main_term_free(sp->term);
386 sp->term = NULL; 460 sp->term = NULL;
387 _split_free(sp); 461 if (l)
388
389 if ((spp->parent) && (spp->parent->s2 == spp))
390 { 462 {
391 slot = PANES_BOTTOM; 463 if (l->next) sp->term = l->next->data;
464 else if (l->prev) sp->term = l->prev->data;
465 sp->terms = eina_list_remove_list(sp->terms, l);
392 } 466 }
393 _split_merge(spp, spkeep, slot); 467// printf("sp->term = %p foc %p\n", sp->term, termfoc);
468 if (!sp->term)
469 {
470 _split_free(sp);
471 if ((spp->parent) && (spp->parent->s2 == spp))
472 slot = PANES_BOTTOM;
473 _split_merge(spp, spkeep, slot);
394 474
395 if (termfoc) _term_focus(termfoc); 475 if (termfoc)
476 {
477 _term_focus(termfoc);
478 sp = _split_find(win, termfoc->term);
479 if (sp) _term_focus_show(sp, termfoc);
480 }
481 }
482 else
483 {
484 if ((sp->parent) && (sp->parent->s2 == sp)) slot = PANES_BOTTOM;
485/*
486 printf("slot '%s' par: %p s1=%p s2=%p\n",
487 slot, sp->parent,
488 sp->parent->s1, sp->parent->s2);
489 */
490 elm_object_part_content_set(sp->parent->panes, slot,
491 sp->term->bg);
492 evas_object_show(sp->term->bg);
493 _term_focus(sp->term);
494 _term_focus_show(sp, sp->term);
495 }
396 } 496 }
397 else 497 else
398 { 498 {
399 edje_object_part_unswallow(sp->wn->base, sp->term->bg); 499 edje_object_part_unswallow(sp->wn->base, sp->term->bg);
500 l = eina_list_data_find_list(sp->terms, sp->term);
400 main_term_free(sp->term); 501 main_term_free(sp->term);
401 sp->term = NULL; 502 sp->term = NULL;
503 if (l)
504 {
505 if (l->next)
506 sp->term = l->next->data;
507 else if (l->prev)
508 sp->term = l->prev->data;
509 sp->terms = eina_list_remove_list(sp->terms, l);
510 }
511 if (sp->term)
512 {
513 edje_object_part_swallow(sp->wn->base, "terminology.content",
514 sp->term->bg);
515 evas_object_show(sp->term->bg);
516 _term_focus(sp->term);
517 _term_focus_show(sp, sp->term);
518 }
402 if (!sp->wn->terms) evas_object_del(sp->wn->win); 519 if (!sp->wn->terms) evas_object_del(sp->wn->win);
403 } 520 }
404} 521}
@@ -523,6 +640,7 @@ _split_size_walk(Split *sp, Sizeinfo *info)
523 info->step_y = sp->term->step_y; 640 info->step_y = sp->term->step_y;
524 info->req_w = sp->term->req_w; 641 info->req_w = sp->term->req_w;
525 info->req_h = sp->term->req_h; 642 info->req_h = sp->term->req_h;
643 // XXXX sp->terms sizedone too?
526 if (!evas_object_data_get(sp->term->term, "sizedone")) 644 if (!evas_object_data_get(sp->term->term, "sizedone"))
527 { 645 {
528 evas_object_data_set(sp->term->term, "sizedone", sp->term->term); 646 evas_object_data_set(sp->term->term, "sizedone", sp->term->term);
@@ -885,7 +1003,14 @@ _cb_prev(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
885 Term *term2 = NULL; 1003 Term *term2 = NULL;
886 1004
887 if (term->focused) term2 = _term_prev_get(term); 1005 if (term->focused) term2 = _term_prev_get(term);
888 if (term2) _term_focus(term2); 1006 if (term2)
1007 {
1008 Split *sp;
1009
1010 _term_focus(term2);
1011 sp = _split_find(term2->wn->win, term2->term);
1012 if (sp) _term_focus_show(sp, term2);
1013 }
889} 1014}
890 1015
891static void 1016static void
@@ -895,13 +1020,22 @@ _cb_next(void *data, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
895 Term *term2 = NULL; 1020 Term *term2 = NULL;
896 1021
897 if (term->focused) term2 = _term_next_get(term); 1022 if (term->focused) term2 = _term_next_get(term);
898 if (term2) _term_focus(term2); 1023 if (term2)
1024 {
1025 Split *sp;
1026
1027 _term_focus(term2);
1028 sp = _split_find(term2->wn->win, term2->term);
1029 if (sp) _term_focus_show(sp, term2);
1030 }
899} 1031}
900 1032
901static void 1033static void
902_cb_new(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__) 1034_cb_new(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
903{ 1035{
904// Term *term = data; 1036 Term *term = data;
1037
1038 main_new(term->wn->win, term->term);
905} 1039}
906 1040
907static void 1041static void
@@ -1763,6 +1897,7 @@ main_ipc_new(Ipc_Instance *inst)
1763 sp = wn->split = calloc(1, sizeof(Split)); 1897 sp = wn->split = calloc(1, sizeof(Split));
1764 sp->wn = wn; 1898 sp->wn = wn;
1765 sp->term = term; 1899 sp->term = term;
1900 sp->terms = eina_list_append(sp->terms, sp->term);
1766 1901
1767 main_trans_update(config); 1902 main_trans_update(config);
1768 main_media_update(config); 1903 main_media_update(config);
@@ -2230,6 +2365,7 @@ remote:
2230 sp = wn->split = calloc(1, sizeof(Split)); 2365 sp = wn->split = calloc(1, sizeof(Split));
2231 sp->wn = wn; 2366 sp->wn = wn;
2232 sp->term = term; 2367 sp->term = term;
2368 sp->terms = eina_list_append(sp->terms, sp->term);
2233 2369
2234 main_trans_update(config); 2370 main_trans_update(config);
2235 main_media_update(config); 2371 main_media_update(config);
diff --git a/src/bin/main.h b/src/bin/main.h
index a5a8d75..fdb7eb7 100644
--- a/src/bin/main.h
+++ b/src/bin/main.h
@@ -3,6 +3,7 @@
3 3
4#include "config.h" 4#include "config.h"
5 5
6void main_new(Evas_Object *win, Evas_Object *term);
6void main_split_h(Evas_Object *win, Evas_Object *term); 7void main_split_h(Evas_Object *win, Evas_Object *term);
7void main_split_v(Evas_Object *win, Evas_Object *term); 8void main_split_v(Evas_Object *win, Evas_Object *term);
8void main_close(Evas_Object *win, Evas_Object *term); 9void main_close(Evas_Object *win, Evas_Object *term);
diff --git a/src/bin/termio.c b/src/bin/termio.c
index 3add31d..1cd9e2d 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -63,6 +63,7 @@ struct _Termio
63 int zoom_fontsize_start; 63 int zoom_fontsize_start;
64 int scroll; 64 int scroll;
65 unsigned int last_keyup; 65 unsigned int last_keyup;
66 Eina_List *mirrors;
66 Eina_List *seq; 67 Eina_List *seq;
67 Evas_Object *event; 68 Evas_Object *event;
68 Termpty *pty; 69 Termpty *pty;
@@ -89,6 +90,7 @@ static Evas_Smart *_smart = NULL;
89static Evas_Smart_Class _parent_sc = EVAS_SMART_CLASS_INIT_NULL; 90static Evas_Smart_Class _parent_sc = EVAS_SMART_CLASS_INIT_NULL;
90 91
91static void _smart_calculate(Evas_Object *obj); 92static void _smart_calculate(Evas_Object *obj);
93static void _smart_mirror_del(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *info __UNUSED__);
92 94
93static inline Eina_Bool 95static inline Eina_Bool
94_should_inline(const Evas_Object *obj) 96_should_inline(const Evas_Object *obj)
@@ -2716,6 +2718,12 @@ _smart_del(Evas_Object *obj)
2716 Termio *sd = evas_object_smart_data_get(obj); 2718 Termio *sd = evas_object_smart_data_get(obj);
2717 2719
2718 if (!sd) return; 2720 if (!sd) return;
2721 EINA_LIST_FREE(sd->mirrors, o)
2722 {
2723 evas_object_event_callback_del_full(o, EVAS_CALLBACK_DEL,
2724 _smart_mirror_del, obj);
2725 evas_object_del(o);
2726 }
2719 if (sd->imf) 2727 if (sd->imf)
2720 { 2728 {
2721 ecore_imf_context_event_callback_del 2729 ecore_imf_context_event_callback_del
@@ -3479,3 +3487,28 @@ termio_textgrid_get(Evas_Object *obj)
3479 3487
3480 return sd->grid.obj; 3488 return sd->grid.obj;
3481} 3489}
3490
3491static void
3492_smart_mirror_del(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *info __UNUSED__)
3493{
3494 Termio *sd = evas_object_smart_data_get(data);
3495 if (!sd) return;
3496 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_DEL,
3497 _smart_mirror_del, data);
3498 sd->mirrors = eina_list_remove(sd->mirrors, obj);
3499}
3500
3501Evas_Object *
3502termio_mirror_add(Evas_Object *obj)
3503{
3504 Evas_Object *img;
3505 Termio *sd = evas_object_smart_data_get(obj);
3506 if (!sd) return NULL;
3507 img = evas_object_image_filled_add(evas_object_evas_get(obj));
3508 evas_object_image_source_set(img, obj);
3509 sd->mirrors = eina_list_append(sd->mirrors, img);
3510 evas_object_data_set(img, "termio", obj);
3511 evas_object_event_callback_add(img, EVAS_CALLBACK_DEL,
3512 _smart_mirror_del, obj);
3513 return obj;
3514}
diff --git a/src/bin/termio.h b/src/bin/termio.h
index fe27b5f..de4015b 100644
--- a/src/bin/termio.h
+++ b/src/bin/termio.h
@@ -22,5 +22,6 @@ void termio_grid_size_set(Evas_Object *obj, int w, int h);
22pid_t termio_pid_get(const Evas_Object *obj); 22pid_t termio_pid_get(const Evas_Object *obj);
23Eina_Bool termio_cwd_get(const Evas_Object *obj, char *buf, size_t size); 23Eina_Bool termio_cwd_get(const Evas_Object *obj, char *buf, size_t size);
24Evas_Object *termio_textgrid_get(Evas_Object *obj); 24Evas_Object *termio_textgrid_get(Evas_Object *obj);
25Evas_Object *termio_mirror_add(Evas_Object *obj);
25 26
26#endif 27#endif
diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index a6c42a5..1753d33 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -959,7 +959,7 @@ _handle_esc_xterm(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
959static int 959static int
960_handle_esc_terminology(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce) 960_handle_esc_terminology(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *ce)
961{ 961{
962 Eina_Unicode *cc, *be; 962 Eina_Unicode *cc;
963 Eina_Unicode *buf, bufsmall[1024], *b; 963 Eina_Unicode *buf, bufsmall[1024], *b;
964 char *s; 964 char *s;
965 int blen = 0, slen = 0; 965 int blen = 0, slen = 0;
@@ -975,7 +975,6 @@ _handle_esc_terminology(Termpty *ty, const Eina_Unicode *c, const Eina_Unicode *
975 buf = malloc((blen * sizeof(Eina_Unicode)) + 40); 975 buf = malloc((blen * sizeof(Eina_Unicode)) + 40);
976 cc = (Eina_Unicode *)c; 976 cc = (Eina_Unicode *)c;
977 b = buf; 977 b = buf;
978 be = buf + blen + 1;
979 while ((cc < ce) && (*cc != 0x0)) 978 while ((cc < ce) && (*cc != 0x0))
980 { 979 {
981 *b = *cc; 980 *b = *cc;