summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/controls.c4
-rw-r--r--src/bin/keyin.c365
-rw-r--r--src/bin/keyin.h19
-rw-r--r--src/bin/termio.c454
-rw-r--r--src/bin/termio.h5
5 files changed, 390 insertions, 457 deletions
diff --git a/src/bin/controls.c b/src/bin/controls.c
index d18320e..be279e8 100644
--- a/src/bin/controls.c
+++ b/src/bin/controls.c
@@ -54,7 +54,7 @@ _cb_ct_copy(void *data EINA_UNUSED,
54 Evas_Object *obj EINA_UNUSED, 54 Evas_Object *obj EINA_UNUSED,
55 void *event EINA_UNUSED) 55 void *event EINA_UNUSED)
56{ 56{
57 termio_take_selection(ct_term, ELM_SEL_TYPE_CLIPBOARD); 57 termio_copy_clipboard(ct_term);
58 controls_toggle(ct_win, ct_bg, ct_term, ct_donecb, ct_donedata); 58 controls_toggle(ct_win, ct_bg, ct_term, ct_donecb, ct_donedata);
59} 59}
60 60
@@ -63,7 +63,7 @@ _cb_ct_paste(void *data EINA_UNUSED,
63 Evas_Object *obj EINA_UNUSED, 63 Evas_Object *obj EINA_UNUSED,
64 void *event EINA_UNUSED) 64 void *event EINA_UNUSED)
65{ 65{
66 termio_paste_selection(ct_term, ELM_SEL_TYPE_CLIPBOARD); 66 termio_paste_clipboard(ct_term);
67 controls_toggle(ct_win, ct_bg, ct_term, ct_donecb, ct_donedata); 67 controls_toggle(ct_win, ct_bg, ct_term, ct_donecb, ct_donedata);
68} 68}
69 69
diff --git a/src/bin/keyin.c b/src/bin/keyin.c
index 5c9204f..9a0c44a 100644
--- a/src/bin/keyin.c
+++ b/src/bin/keyin.c
@@ -1,10 +1,5 @@
1#include <Elementary.h> 1#include <Elementary.h>
2#include <Ecore_Input.h>
3#include <Ecore_IMF.h>
4#include <Ecore_IMF_Evas.h>
5#include "termpty.h" 2#include "termpty.h"
6#include "termio.h"
7#include "termcmd.h"
8#include "keyin.h" 3#include "keyin.h"
9 4
10typedef struct _Keyout Keyout; 5typedef struct _Keyout Keyout;
@@ -17,8 +12,6 @@ struct _Keyout
17 int outlen; 12 int outlen;
18}; 13};
19 14
20
21
22#define KEY(in, out) {in, out, sizeof(in) - 1, sizeof(out) - 1} 15#define KEY(in, out) {in, out, sizeof(in) - 1, sizeof(out) - 1}
23 16
24static const Keyout crlf_keyout[] = 17static const Keyout crlf_keyout[] =
@@ -406,107 +399,7 @@ _key_try(Termpty *ty, const Keyout *map, const Evas_Event_Key_Down *ev)
406} 399}
407 400
408void 401void
409keyin_compose_seq_reset(Keys_Handler *khdl) 402keyin_handle(Termpty *ty, const Evas_Event_Key_Down *ev,
410{
411 char *str;
412
413 EINA_LIST_FREE(khdl->seq, str) eina_stringshare_del(str);
414 khdl->composing = EINA_FALSE;
415}
416
417static Eina_Bool
418_handle_alt_ctrl(const char *keyname, Evas_Object *term)
419{
420 if (!strcmp(keyname, "equal"))
421 termcmd_do(term, NULL, NULL, "f+");
422 else if (!strcmp(keyname, "minus"))
423 termcmd_do(term, NULL, NULL, "f-");
424 else if (!strcmp(keyname, "0"))
425 termcmd_do(term, NULL, NULL, "f");
426 else if (!strcmp(keyname, "9"))
427 termcmd_do(term, NULL, NULL, "fb");
428 else
429 return EINA_FALSE;
430
431 return EINA_TRUE;
432}
433
434static Eina_Bool
435_handle_shift(const Evas_Event_Key_Down *ev, Termpty *ty)
436{
437 if (!strcmp(ev->key, "Prior"))
438 {
439 if (!ty->altbuf)
440 {
441 termio_scroll_delta(ty->obj, 1, 1);
442 return EINA_TRUE;
443 }
444 return EINA_FALSE;
445 }
446 else if (!strcmp(ev->key, "Next"))
447 {
448 if (!ty->altbuf)
449 {
450 termio_scroll_delta(ty->obj, -1, 1);
451 return EINA_TRUE;
452 }
453 return EINA_FALSE;
454 }
455 else if (!strcmp(ev->key, "Up"))
456 {
457 if (!ty->altbuf)
458 {
459 termio_scroll_delta(ty->obj, 1, 0);
460 return EINA_TRUE;
461 }
462 return EINA_FALSE;
463 }
464 else if (!strcmp(ev->key, "Down"))
465 {
466 if (!ty->altbuf)
467 {
468 termio_scroll_delta(ty->obj, -1, 0);
469 return EINA_TRUE;
470 }
471 return EINA_FALSE;
472 }
473 else if (!strcmp(ev->key, "Insert"))
474 {
475 /*XXX CTRL*/
476 if (evas_key_modifier_is_set(ev->modifiers, "Control"))
477 termio_paste_selection(ty->obj, ELM_SEL_TYPE_CLIPBOARD);
478 else
479 termio_paste_selection(ty->obj, ELM_SEL_TYPE_PRIMARY);
480 }
481 else if (!strcmp(ev->key, "KP_Add"))
482 {
483 Config *config = termpty_config_get(ty);
484
485 if (config) termio_font_size_set(ty->obj, config->font.size + 1);
486 }
487 else if (!strcmp(ev->key, "KP_Subtract"))
488 {
489 Config *config = termpty_config_get(ty);
490
491 if (config) termio_font_size_set(ty->obj, config->font.size - 1);
492 }
493 else if (!strcmp(ev->key, "KP_Multiply"))
494 {
495 Config *config = termpty_config_get(ty);
496
497 if (config) termio_font_size_set(ty->obj, 10);
498 }
499 else if (!strcmp(ev->key, "KP_Divide"))
500 termio_take_selection(ty->obj, ELM_SEL_TYPE_CLIPBOARD);
501 else
502 return EINA_FALSE;
503
504 return EINA_TRUE;
505}
506
507
508static void
509_handle_key_to_pty(Termpty *ty, const Evas_Event_Key_Down *ev,
510 int alt, int shift, int ctrl) 403 int alt, int shift, int ctrl)
511{ 404{
512 if (!alt) 405 if (!alt)
@@ -620,259 +513,3 @@ _handle_key_to_pty(Termpty *ty, const Evas_Event_Key_Down *ev,
620 termpty_write(ty, ev->string, strlen(ev->string)); 513 termpty_write(ty, ev->string, strlen(ev->string));
621 } 514 }
622} 515}
623
624Eina_Bool
625keyin_handle(Keys_Handler *khdl, Termpty *ty, const Evas_Event_Key_Down *ev,
626 int alt, int shift, int ctrl)
627{
628 if ((!alt) && (ctrl) && (!shift))
629 {
630 if (!strcmp(ev->key, "Prior"))
631 {
632 keyin_compose_seq_reset(khdl);
633 evas_object_smart_callback_call(ty->obj, "prev", NULL);
634 return EINA_TRUE;
635 }
636 else if (!strcmp(ev->key, "Next"))
637 {
638 keyin_compose_seq_reset(khdl);
639 evas_object_smart_callback_call(ty->obj, "next", NULL);
640 return EINA_TRUE;
641 }
642 else if (!strcmp(ev->key, "1"))
643 {
644 keyin_compose_seq_reset(khdl);
645 evas_object_smart_callback_call(ty->obj, "tab,1", NULL);
646 return EINA_TRUE;
647 }
648 else if (!strcmp(ev->key, "2"))
649 {
650 keyin_compose_seq_reset(khdl);
651 evas_object_smart_callback_call(ty->obj, "tab,2", NULL);
652 return EINA_TRUE;
653 }
654 else if (!strcmp(ev->key, "3"))
655 {
656 keyin_compose_seq_reset(khdl);
657 evas_object_smart_callback_call(ty->obj, "tab,3", NULL);
658 return EINA_TRUE;
659 }
660 else if (!strcmp(ev->key, "4"))
661 {
662 keyin_compose_seq_reset(khdl);
663 evas_object_smart_callback_call(ty->obj, "tab,4", NULL);
664 return EINA_TRUE;
665 }
666 else if (!strcmp(ev->key, "5"))
667 {
668 keyin_compose_seq_reset(khdl);
669 evas_object_smart_callback_call(ty->obj, "tab,5", NULL);
670 return EINA_TRUE;
671 }
672 else if (!strcmp(ev->key, "6"))
673 {
674 keyin_compose_seq_reset(khdl);
675 evas_object_smart_callback_call(ty->obj, "tab,6", NULL);
676 return EINA_TRUE;
677 }
678 else if (!strcmp(ev->key, "7"))
679 {
680 keyin_compose_seq_reset(khdl);
681 evas_object_smart_callback_call(ty->obj, "tab,7", NULL);
682 return EINA_TRUE;
683 }
684 else if (!strcmp(ev->key, "8"))
685 {
686 keyin_compose_seq_reset(khdl);
687 evas_object_smart_callback_call(ty->obj, "tab,8", NULL);
688 return EINA_TRUE;
689 }
690 else if (!strcmp(ev->key, "9"))
691 {
692 keyin_compose_seq_reset(khdl);
693 evas_object_smart_callback_call(ty->obj, "tab,9", NULL);
694 return EINA_TRUE;
695 }
696 else if (!strcmp(ev->key, "0"))
697 {
698 keyin_compose_seq_reset(khdl);
699 evas_object_smart_callback_call(ty->obj, "tab,0", NULL);
700 return EINA_TRUE;
701 }
702 }
703 if ((!alt) && (ctrl) && (shift))
704 {
705 if (!strcmp(ev->key, "Prior"))
706 {
707 keyin_compose_seq_reset(khdl);
708 evas_object_smart_callback_call(ty->obj, "split,h", NULL);
709 return EINA_TRUE;
710 }
711 else if (!strcmp(ev->key, "Next"))
712 {
713 keyin_compose_seq_reset(khdl);
714 evas_object_smart_callback_call(ty->obj, "split,v", NULL);
715 return EINA_TRUE;
716 }
717 else if (!strcasecmp(ev->key, "t"))
718 {
719 keyin_compose_seq_reset(khdl);
720 evas_object_smart_callback_call(ty->obj, "new", NULL);
721 return EINA_TRUE;
722 }
723 else if (!strcmp(ev->key, "Home"))
724 {
725 keyin_compose_seq_reset(khdl);
726 evas_object_smart_callback_call(ty->obj, "select", NULL);
727 return EINA_TRUE;
728 }
729 else if (!strcasecmp(ev->key, "c"))
730 {
731 keyin_compose_seq_reset(khdl);
732 termio_take_selection(ty->obj, ELM_SEL_TYPE_CLIPBOARD);
733 return EINA_TRUE;
734 }
735 else if (!strcasecmp(ev->key, "v"))
736 {
737 keyin_compose_seq_reset(khdl);
738 termio_paste_selection(ty->obj, ELM_SEL_TYPE_CLIPBOARD);
739 return EINA_TRUE;
740 }
741 else if (!strcmp(ev->keyname, "h"))
742 {
743 term_miniview_toggle(termio_term_get(ty->obj));
744 return EINA_TRUE;
745 }
746 }
747 if ((alt) && (!shift) && (!ctrl))
748 {
749 if (!strcmp(ev->key, "Home"))
750 {
751 keyin_compose_seq_reset(khdl);
752 evas_object_smart_callback_call(ty->obj, "cmdbox", NULL);
753 return EINA_TRUE;
754 }
755 }
756 if ((alt) && (ctrl) && (!shift))
757 {
758 if (_handle_alt_ctrl(ev->key, ty->obj))
759 {
760 keyin_compose_seq_reset(khdl);
761 return EINA_TRUE;
762 }
763 }
764 if (shift)
765 {
766 if (_handle_shift(ev, ty))
767 {
768 keyin_compose_seq_reset(khdl);
769 return EINA_TRUE;
770 }
771 }
772
773
774 /* actions => return Eina_True */
775
776 /* composing */
777 if (khdl->imf)
778 {
779 // EXCEPTION. Don't filter modifiers alt+shift -> breaks emacs
780 // and jed (alt+shift+5 for search/replace for example)
781 // Don't filter modifiers alt, is used by shells
782 if ((!alt) && (!ctrl))
783 {
784 Ecore_IMF_Event_Key_Down imf_ev;
785
786 ecore_imf_evas_event_key_down_wrap((Evas_Event_Key_Down*)ev, &imf_ev);
787 if (!khdl->composing)
788 {
789 if (ecore_imf_context_filter_event
790 (khdl->imf, ECORE_IMF_EVENT_KEY_DOWN, (Ecore_IMF_Event *)&imf_ev))
791 goto end;
792 }
793 }
794 }
795
796 // if term app asked for kbd lock - dont handle here
797 if (ty->state.kbd_lock) return EINA_TRUE;
798 // if app asked us to not do autorepeat - ignore press if is it is the same
799 // timestamp as last one
800 if ((ty->state.no_autorepeat) &&
801 (ev->timestamp == khdl->last_keyup)) return EINA_TRUE;
802 if (!khdl->composing)
803 {
804 Ecore_Compose_State state;
805 char *compres = NULL;
806
807 keyin_compose_seq_reset(khdl);
808 khdl->seq = eina_list_append(khdl->seq, eina_stringshare_add(ev->key));
809 state = ecore_compose_get(khdl->seq, &compres);
810 if (state == ECORE_COMPOSE_MIDDLE) khdl->composing = EINA_TRUE;
811 else khdl->composing = EINA_FALSE;
812 if (!khdl->composing) keyin_compose_seq_reset(khdl);
813 else goto end;
814 }
815 else
816 {
817 Ecore_Compose_State state;
818 char *compres = NULL;
819
820 if (key_is_modifier(ev->key)) goto end;
821 khdl->seq = eina_list_append(khdl->seq, eina_stringshare_add(ev->key));
822 state = ecore_compose_get(khdl->seq, &compres);
823 if (state == ECORE_COMPOSE_NONE) keyin_compose_seq_reset(khdl);
824 else if (state == ECORE_COMPOSE_DONE)
825 {
826 keyin_compose_seq_reset(khdl);
827 if (compres)
828 {
829 termpty_write(ty, compres, strlen(compres));
830 free(compres);
831 compres = NULL;
832 }
833 goto end;
834 }
835 else goto end;
836 }
837
838
839 _handle_key_to_pty(ty, ev, alt, ctrl, shift);
840
841
842end:
843 return EINA_FALSE;
844}
845
846Eina_Bool
847key_is_modifier(const char *key)
848{
849#define STATIC_STR_EQUAL(STR) (!strncmp(key, STR, strlen(STR)))
850 if ((key != NULL) && (
851 STATIC_STR_EQUAL("Shift") ||
852 STATIC_STR_EQUAL("Control") ||
853 STATIC_STR_EQUAL("Alt") ||
854 STATIC_STR_EQUAL("Meta") ||
855 STATIC_STR_EQUAL("Super") ||
856 STATIC_STR_EQUAL("Hyper") ||
857 STATIC_STR_EQUAL("Scroll_Lock") ||
858 STATIC_STR_EQUAL("Num_Lock") ||
859 STATIC_STR_EQUAL("ISO_Level3_Shift") ||
860 STATIC_STR_EQUAL("Caps_Lock")))
861 return EINA_TRUE;
862#undef STATIC_STR_EQUAL
863 return EINA_FALSE;
864}
865
866void
867keyin_handle_up(Keys_Handler *khdl, Evas_Event_Key_Up *ev)
868{
869 khdl->last_keyup = ev->timestamp;
870 if (khdl->imf)
871 {
872 Ecore_IMF_Event_Key_Up imf_ev;
873 ecore_imf_evas_event_key_up_wrap(ev, &imf_ev);
874 if (ecore_imf_context_filter_event
875 (khdl->imf, ECORE_IMF_EVENT_KEY_UP, (Ecore_IMF_Event *)&imf_ev))
876 return;
877 }
878}
diff --git a/src/bin/keyin.h b/src/bin/keyin.h
index f8d1b5c..c1e6294 100644
--- a/src/bin/keyin.h
+++ b/src/bin/keyin.h
@@ -1,22 +1,7 @@
1#ifndef _KEYIN_H__ 1#ifndef _KEYIN_H__
2#define _KEYIN_H__ 1 2#define _KEYIN_H__ 1
3 3
4typedef struct _Keys_Handler Keys_Handler; 4void keyin_handle(Termpty *ty, const Evas_Event_Key_Down *ev,
5 5 int alt, int shift, int ctrl);
6struct _Keys_Handler
7{
8 Ecore_IMF_Context *imf;
9 unsigned int last_keyup;
10 Eina_List *seq;
11 Eina_Bool composing : 1;
12};
13
14void keyin_compose_seq_reset(Keys_Handler *khdl);
15Eina_Bool key_is_modifier(const char *key);
16Eina_Bool keyin_handle(Keys_Handler *khdl, Termpty *ty, const Evas_Event_Key_Down *ev,
17 int alt, int shift, int ctrl);
18
19void keyin_handle_up(Keys_Handler *khdl, Evas_Event_Key_Up *ev);
20
21 6
22#endif 7#endif
diff --git a/src/bin/termio.c b/src/bin/termio.c
index 324b77f..64e0054 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -1,5 +1,7 @@
1#include "private.h" 1#include "private.h"
2 2
3#include <Ecore_IMF.h>
4#include <Ecore_IMF_Evas.h>
3#include <Elementary.h> 5#include <Elementary.h>
4#include <Ecore_Input.h> 6#include <Ecore_Input.h>
5 7
@@ -46,6 +48,7 @@ struct _Termio
46 int cx, cy; 48 int cx, cy;
47 int button; 49 int button;
48 } mouse; 50 } mouse;
51 unsigned int last_keyup;
49 struct { 52 struct {
50 char *string; 53 char *string;
51 int x1, y1, x2, y2; 54 int x1, y1, x2, y2;
@@ -62,6 +65,7 @@ struct _Termio
62 } link; 65 } link;
63 int zoom_fontsize_start; 66 int zoom_fontsize_start;
64 int scroll; 67 int scroll;
68 Eina_List *seq;
65 Evas_Object *self; 69 Evas_Object *self;
66 Evas_Object *event; 70 Evas_Object *event;
67 Term *term; 71 Term *term;
@@ -75,16 +79,17 @@ struct _Termio
75 Ecore_Timer *mouseover_delay; 79 Ecore_Timer *mouseover_delay;
76 Evas_Object *win, *theme, *glayer; 80 Evas_Object *win, *theme, *glayer;
77 Config *config; 81 Config *config;
82 Ecore_IMF_Context *imf;
78 const char *sel_str; 83 const char *sel_str;
79 Eina_List *cur_chids; 84 Eina_List *cur_chids;
80 Ecore_Job *sel_reset_job; 85 Ecore_Job *sel_reset_job;
81 double set_sel_at; 86 double set_sel_at;
82 Elm_Sel_Type sel_type; 87 Elm_Sel_Type sel_type;
83 Keys_Handler khdl;
84 Eina_Bool jump_on_change : 1; 88 Eina_Bool jump_on_change : 1;
85 Eina_Bool jump_on_keypress : 1; 89 Eina_Bool jump_on_keypress : 1;
86 Eina_Bool have_sel : 1; 90 Eina_Bool have_sel : 1;
87 Eina_Bool noreqsize : 1; 91 Eina_Bool noreqsize : 1;
92 Eina_Bool composing : 1;
88 Eina_Bool didclick : 1; 93 Eina_Bool didclick : 1;
89 Eina_Bool moved : 1; 94 Eina_Bool moved : 1;
90 Eina_Bool bottom_right : 1; 95 Eina_Bool bottom_right : 1;
@@ -109,6 +114,8 @@ static void _smart_apply(Evas_Object *obj);
109static void _smart_size(Evas_Object *obj, int w, int h, Eina_Bool force); 114static void _smart_size(Evas_Object *obj, int w, int h, Eina_Bool force);
110static void _smart_calculate(Evas_Object *obj); 115static void _smart_calculate(Evas_Object *obj);
111static void _take_selection_text(Evas_Object *obj, Elm_Sel_Type type, const char *text); 116static void _take_selection_text(Evas_Object *obj, Elm_Sel_Type type, const char *text);
117static void _take_selection(Evas_Object *obj, Elm_Sel_Type type);
118static void _paste_selection(Evas_Object *obj, Elm_Sel_Type type);
112 119
113 120
114/* {{{ Helpers */ 121/* {{{ Helpers */
@@ -328,32 +335,6 @@ termio_scroll_get(Evas_Object *obj)
328 return sd->scroll; 335 return sd->scroll;
329} 336}
330 337
331
332void termio_scroll_delta(Evas_Object *obj, int delta, int by_page)
333{
334 Termio *sd = evas_object_smart_data_get(obj);
335 EINA_SAFETY_ON_NULL_RETURN(sd);
336
337 if (by_page)
338 {
339 int by = sd->grid.h - 2;
340 if (by > 1)
341 delta *= by;
342 }
343 sd->scroll += delta;
344 if (delta > 0)
345 {
346 if (sd->scroll > sd->pty->backscroll_num)
347 sd->scroll = sd->pty->backscroll_num;
348 }
349 else
350 {
351 if (sd->scroll < 0) sd->scroll = 0;
352 }
353 _smart_update_queue(obj, sd);
354 miniview_position_offset(term_miniview_get(sd->term), delta, EINA_TRUE);
355}
356
357void 338void
358termio_scroll_set(Evas_Object *obj, int scroll) 339termio_scroll_set(Evas_Object *obj, int scroll)
359{ 340{
@@ -1840,8 +1821,129 @@ _smart_cb_key_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
1840 Termio *sd = evas_object_smart_data_get(data); 1821 Termio *sd = evas_object_smart_data_get(data);
1841 1822
1842 EINA_SAFETY_ON_NULL_RETURN(sd); 1823 EINA_SAFETY_ON_NULL_RETURN(sd);
1824 sd->last_keyup = ev->timestamp;
1825 if (sd->imf)
1826 {
1827 Ecore_IMF_Event_Key_Up imf_ev;
1828 ecore_imf_evas_event_key_up_wrap(ev, &imf_ev);
1829 if (ecore_imf_context_filter_event
1830 (sd->imf, ECORE_IMF_EVENT_KEY_UP, (Ecore_IMF_Event *)&imf_ev))
1831 return;
1832 }
1833}
1834static Eina_Bool
1835_is_modifier(const char *key)
1836{
1837#define STATIC_STR_EQUAL(STR) (!strncmp(key, STR, strlen(STR)))
1838 if ((key != NULL) && (
1839 STATIC_STR_EQUAL("Shift") ||
1840 STATIC_STR_EQUAL("Control") ||
1841 STATIC_STR_EQUAL("Alt") ||
1842 STATIC_STR_EQUAL("Meta") ||
1843 STATIC_STR_EQUAL("Super") ||
1844 STATIC_STR_EQUAL("Hyper") ||
1845 STATIC_STR_EQUAL("Scroll_Lock") ||
1846 STATIC_STR_EQUAL("Num_Lock") ||
1847 STATIC_STR_EQUAL("ISO_Level3_Shift") ||
1848 STATIC_STR_EQUAL("Caps_Lock")))
1849 return EINA_TRUE;
1850#undef STATIC_STR_EQUAL
1851 return EINA_FALSE;
1852}
1853
1854static void
1855_compose_seq_reset(Termio *sd)
1856{
1857 char *str;
1858
1859 EINA_LIST_FREE(sd->seq, str) eina_stringshare_del(str);
1860 sd->composing = EINA_FALSE;
1861}
1862
1863static Eina_Bool
1864_handle_alt_ctrl(const char *keyname, Evas_Object *term)
1865{
1866 if (!strcmp(keyname, "equal"))
1867 termcmd_do(term, NULL, NULL, "f+");
1868 else if (!strcmp(keyname, "minus"))
1869 termcmd_do(term, NULL, NULL, "f-");
1870 else if (!strcmp(keyname, "0"))
1871 termcmd_do(term, NULL, NULL, "f");
1872 else if (!strcmp(keyname, "9"))
1873 termcmd_do(term, NULL, NULL, "fb");
1874 else
1875 return EINA_FALSE;
1876
1877 return EINA_TRUE;
1878}
1879
1880static Eina_Bool
1881_handle_shift(const Evas_Event_Key_Down *ev, int by, Evas_Object *term, Termio *sd)
1882{
1883 if (!strcmp(ev->key, "Prior"))
1884 {
1885 if (!(sd->pty->altbuf))
1886 {
1887 sd->scroll += by;
1888 if (sd->scroll > sd->pty->backscroll_num)
1889 sd->scroll = sd->pty->backscroll_num;
1890 _smart_update_queue(term, sd);
1891 miniview_position_offset(term_miniview_get(sd->term), -by, EINA_TRUE);
1892 }
1893 }
1894 else if (!strcmp(ev->key, "Next"))
1895 {
1896 sd->scroll -= by;
1897 if (sd->scroll < 0) sd->scroll = 0;
1898 _smart_update_queue(term, sd);
1899 miniview_position_offset(term_miniview_get(sd->term), by, EINA_TRUE);
1900 }
1901 else if (!strcmp(ev->key, "Up"))
1902 {
1903 sd->scroll += 1;
1904 if (sd->scroll > sd->pty->backscroll_num)
1905 sd->scroll = sd->pty->backscroll_num;
1906 _smart_update_queue(term, sd);
1907 miniview_position_offset(term_miniview_get(sd->term), -1, EINA_TRUE);
1908 }
1909 else if (!strcmp(ev->key, "Down"))
1910 {
1911 sd->scroll -= 1;
1912 if (sd->scroll < 0) sd->scroll = 0;
1913 _smart_update_queue(term, sd);
1914 miniview_position_offset(term_miniview_get(sd->term), 1, EINA_TRUE);
1915 }
1916 else if (!strcmp(ev->key, "Insert"))
1917 {
1918 if (evas_key_modifier_is_set(ev->modifiers, "Control"))
1919 _paste_selection(term, ELM_SEL_TYPE_CLIPBOARD);
1920 else
1921 _paste_selection(term, ELM_SEL_TYPE_PRIMARY);
1922 }
1923 else if (!strcmp(ev->key, "KP_Add"))
1924 {
1925 Config *config = termio_config_get(term);
1926
1927 if (config) _font_size_set(term, config->font.size + 1);
1928 }
1929 else if (!strcmp(ev->key, "KP_Subtract"))
1930 {
1931 Config *config = termio_config_get(term);
1932
1933 if (config) _font_size_set(term, config->font.size - 1);
1934 }
1935 else if (!strcmp(ev->key, "KP_Multiply"))
1936 {
1937 Config *config = termio_config_get(term);
1938
1939 if (config) _font_size_set(term, 10);
1940 }
1941 else if (!strcmp(ev->key, "KP_Divide"))
1942 _take_selection(term, ELM_SEL_TYPE_CLIPBOARD);
1943 else
1944 return EINA_FALSE;
1843 1945
1844 keyin_handle_up(&sd->khdl, ev); 1946 return EINA_TRUE;
1845} 1947}
1846 1948
1847static void 1949static void
@@ -1850,6 +1952,8 @@ _smart_cb_key_down(void *data, Evas *e EINA_UNUSED,
1850{ 1952{
1851 const Evas_Event_Key_Down *ev = event; 1953 const Evas_Event_Key_Down *ev = event;
1852 Termio *sd = evas_object_smart_data_get(data); 1954 Termio *sd = evas_object_smart_data_get(data);
1955 Ecore_Compose_State state;
1956 char *compres = NULL;
1853 int alt = evas_key_modifier_is_set(ev->modifiers, "Alt"); 1957 int alt = evas_key_modifier_is_set(ev->modifiers, "Alt");
1854 int shift = evas_key_modifier_is_set(ev->modifiers, "Shift"); 1958 int shift = evas_key_modifier_is_set(ev->modifiers, "Shift");
1855 int ctrl = evas_key_modifier_is_set(ev->modifiers, "Control"); 1959 int ctrl = evas_key_modifier_is_set(ev->modifiers, "Control");
@@ -1860,18 +1964,215 @@ _smart_cb_key_down(void *data, Evas *e EINA_UNUSED,
1860 if (miniview_handle_key(term_miniview_get(sd->term), ev)) 1964 if (miniview_handle_key(term_miniview_get(sd->term), ev))
1861 return; 1965 return;
1862 1966
1967 if ((!alt) && (ctrl) && (!shift))
1968 {
1969 if (!strcmp(ev->key, "Prior"))
1970 {
1971 evas_object_smart_callback_call(data, "prev", NULL);
1972 goto end;
1973 }
1974 else if (!strcmp(ev->key, "Next"))
1975 {
1976 evas_object_smart_callback_call(data, "next", NULL);
1977 goto end;
1978 }
1979 else if (!strcmp(ev->key, "1"))
1980 {
1981 _compose_seq_reset(sd);
1982 evas_object_smart_callback_call(data, "tab,1", NULL);
1983 goto end;
1984 }
1985 else if (!strcmp(ev->key, "2"))
1986 {
1987 _compose_seq_reset(sd);
1988 evas_object_smart_callback_call(data, "tab,2", NULL);
1989 goto end;
1990 }
1991 else if (!strcmp(ev->key, "3"))
1992 {
1993 _compose_seq_reset(sd);
1994 evas_object_smart_callback_call(data, "tab,3", NULL);
1995 goto end;
1996 }
1997 else if (!strcmp(ev->key, "4"))
1998 {
1999 _compose_seq_reset(sd);
2000 evas_object_smart_callback_call(data, "tab,4", NULL);
2001 goto end;
2002 }
2003 else if (!strcmp(ev->key, "5"))
2004 {
2005 _compose_seq_reset(sd);
2006 evas_object_smart_callback_call(data, "tab,5", NULL);
2007 goto end;
2008 }
2009 else if (!strcmp(ev->key, "6"))
2010 {
2011 _compose_seq_reset(sd);
2012 evas_object_smart_callback_call(data, "tab,6", NULL);
2013 goto end;
2014 }
2015 else if (!strcmp(ev->key, "7"))
2016 {
2017 _compose_seq_reset(sd);
2018 evas_object_smart_callback_call(data, "tab,7", NULL);
2019 goto end;
2020 }
2021 else if (!strcmp(ev->key, "8"))
2022 {
2023 _compose_seq_reset(sd);
2024 evas_object_smart_callback_call(data, "tab,8", NULL);
2025 goto end;
2026 }
2027 else if (!strcmp(ev->key, "9"))
2028 {
2029 _compose_seq_reset(sd);
2030 evas_object_smart_callback_call(data, "tab,9", NULL);
2031 goto end;
2032 }
2033 else if (!strcmp(ev->key, "0"))
2034 {
2035 _compose_seq_reset(sd);
2036 evas_object_smart_callback_call(data, "tab,0", NULL);
2037 goto end;
2038 }
2039 }
2040 if ((!alt) && (ctrl) && (shift))
2041 {
2042 if (!strcmp(ev->key, "Prior"))
2043 {
2044 _compose_seq_reset(sd);
2045 evas_object_smart_callback_call(data, "split,h", NULL);
2046 goto end;
2047 }
2048 else if (!strcmp(ev->key, "Next"))
2049 {
2050 _compose_seq_reset(sd);
2051 evas_object_smart_callback_call(data, "split,v", NULL);
2052 goto end;
2053 }
2054 else if (!strcasecmp(ev->key, "t"))
2055 {
2056 _compose_seq_reset(sd);
2057 evas_object_smart_callback_call(data, "new", NULL);
2058 goto end;
2059 }
2060 else if (!strcmp(ev->key, "Home"))
2061 {
2062 _compose_seq_reset(sd);
2063 evas_object_smart_callback_call(data, "select", NULL);
2064 goto end;
2065 }
2066 else if (!strcasecmp(ev->key, "c"))
2067 {
2068 _compose_seq_reset(sd);
2069 _take_selection(data, ELM_SEL_TYPE_CLIPBOARD);
2070 goto end;
2071 }
2072 else if (!strcasecmp(ev->key, "v"))
2073 {
2074 _compose_seq_reset(sd);
2075 _paste_selection(data, ELM_SEL_TYPE_CLIPBOARD);
2076 goto end;
2077 }
2078 else if (!strcmp(ev->keyname, "h"))
2079 {
2080 term_miniview_toggle(sd->term);
2081 goto end;
2082 }
2083 }
2084 if ((alt) && (!shift) && (!ctrl))
2085 {
2086 if (!strcmp(ev->key, "Home"))
2087 {
2088 _compose_seq_reset(sd);
2089 evas_object_smart_callback_call(data, "cmdbox", NULL);
2090 goto end;
2091 }
2092 }
2093 if ((alt) && (ctrl) && (!shift))
2094 {
2095 if (_handle_alt_ctrl(ev->key, data))
2096 {
2097 _compose_seq_reset(sd);
2098 goto end;
2099 }
2100 }
2101 if (sd->imf)
2102 {
2103 // EXCEPTION. Don't filter modifiers alt+shift -> breaks emacs
2104 // and jed (alt+shift+5 for search/replace for example)
2105 // Don't filter modifiers alt, is used by shells
2106 if ((!alt) && (!ctrl))
2107 {
2108 Ecore_IMF_Event_Key_Down imf_ev;
2109
2110 ecore_imf_evas_event_key_down_wrap((Evas_Event_Key_Down*)ev, &imf_ev);
2111 if (!sd->composing)
2112 {
2113 if (ecore_imf_context_filter_event
2114 (sd->imf, ECORE_IMF_EVENT_KEY_DOWN, (Ecore_IMF_Event *)&imf_ev))
2115 goto end;
2116 }
2117 }
2118 }
2119 if (shift)
2120 {
2121 int by = sd->grid.h - 2;
1863 2122
1864 if (keyin_handle(&sd->khdl, sd->pty, ev, alt, shift, ctrl)) 2123 if (by < 1) by = 1;
1865 goto end;
1866 2124
2125 if (_handle_shift(ev, by, data, sd))
2126 {
2127 _compose_seq_reset(sd);
2128 goto end;
2129 }
2130 }
1867 if (sd->jump_on_keypress) 2131 if (sd->jump_on_keypress)
1868 { 2132 {
1869 if (!key_is_modifier(ev->key)) 2133 if (!_is_modifier(ev->key))
1870 { 2134 {
1871 sd->scroll = 0; 2135 sd->scroll = 0;
1872 _smart_update_queue(data, sd); 2136 _smart_update_queue(data, sd);
1873 } 2137 }
1874 } 2138 }
2139 // if term app asked fro kbd lock - dont handle here
2140 if (sd->pty->state.kbd_lock) return;
2141 // if app asked us to not do autorepeat - ignore pree is it is the same
2142 // timestamp as last one
2143 if ((sd->pty->state.no_autorepeat) &&
2144 (ev->timestamp == sd->last_keyup)) return;
2145 if (!sd->composing)
2146 {
2147 _compose_seq_reset(sd);
2148 sd->seq = eina_list_append(sd->seq, eina_stringshare_add(ev->key));
2149 state = ecore_compose_get(sd->seq, &compres);
2150 if (state == ECORE_COMPOSE_MIDDLE) sd->composing = EINA_TRUE;
2151 else sd->composing = EINA_FALSE;
2152 if (!sd->composing) _compose_seq_reset(sd);
2153 else goto end;
2154 }
2155 else
2156 {
2157 if (_is_modifier(ev->key)) goto end;
2158 sd->seq = eina_list_append(sd->seq, eina_stringshare_add(ev->key));
2159 state = ecore_compose_get(sd->seq, &compres);
2160 if (state == ECORE_COMPOSE_NONE) _compose_seq_reset(sd);
2161 else if (state == ECORE_COMPOSE_DONE)
2162 {
2163 _compose_seq_reset(sd);
2164 if (compres)
2165 {
2166 termpty_write(sd->pty, compres, strlen(compres));
2167 free(compres);
2168 compres = NULL;
2169 }
2170 goto end;
2171 }
2172 else goto end;
2173 }
2174
2175 keyin_handle(sd->pty, ev, alt, shift, ctrl);
1875end: 2176end:
1876 if (sd->config->flicker_on_key) 2177 if (sd->config->flicker_on_key)
1877 edje_object_signal_emit(sd->cursor.obj, "key,down", "terminology"); 2178 edje_object_signal_emit(sd->cursor.obj, "key,down", "terminology");
@@ -1880,6 +2181,18 @@ end:
1880/* }}} */ 2181/* }}} */
1881/* {{{ Selection */ 2182/* {{{ Selection */
1882 2183
2184void
2185termio_copy_clipboard(Evas_Object *obj)
2186{
2187 _take_selection(obj, ELM_SEL_TYPE_CLIPBOARD);
2188}
2189
2190void
2191termio_paste_clipboard(Evas_Object *obj)
2192{
2193 _paste_selection(obj, ELM_SEL_TYPE_CLIPBOARD);
2194}
2195
1883char * 2196char *
1884termio_selection_get(Evas_Object *obj, int c1x, int c1y, int c2x, int c2y, 2197termio_selection_get(Evas_Object *obj, int c1x, int c1y, int c2x, int c2y,
1885 size_t *len) 2198 size_t *len)
@@ -2124,8 +2437,8 @@ _take_selection_text(Evas_Object *obj, Elm_Sel_Type type, const char *text)
2124 sd->sel_str = text; 2437 sd->sel_str = text;
2125} 2438}
2126 2439
2127void 2440static void
2128termio_take_selection(Evas_Object *obj, Elm_Sel_Type type) 2441_take_selection(Evas_Object *obj, Elm_Sel_Type type)
2129{ 2442{
2130 Termio *sd = evas_object_smart_data_get(obj); 2443 Termio *sd = evas_object_smart_data_get(obj);
2131 int start_x = 0, start_y = 0, end_x = 0, end_y = 0; 2444 int start_x = 0, start_y = 0, end_x = 0, end_y = 0;
@@ -2252,8 +2565,8 @@ _getsel_cb(void *data, Evas_Object *obj EINA_UNUSED, Elm_Selection_Data *ev)
2252 return EINA_TRUE; 2565 return EINA_TRUE;
2253} 2566}
2254 2567
2255void 2568static void
2256termio_paste_selection(Evas_Object *obj, Elm_Sel_Type type) 2569_paste_selection(Evas_Object *obj, Elm_Sel_Type type)
2257{ 2570{
2258 Termio *sd = evas_object_smart_data_get(obj); 2571 Termio *sd = evas_object_smart_data_get(obj);
2259 EINA_SAFETY_ON_NULL_RETURN(sd); 2572 EINA_SAFETY_ON_NULL_RETURN(sd);
@@ -2796,8 +3109,8 @@ _imf_cursor_set(Termio *sd)
2796 /* TODO */ 3109 /* TODO */
2797 Evas_Coord cx, cy, cw, ch; 3110 Evas_Coord cx, cy, cw, ch;
2798 evas_object_geometry_get(sd->cursor.obj, &cx, &cy, &cw, &ch); 3111 evas_object_geometry_get(sd->cursor.obj, &cx, &cy, &cw, &ch);
2799 if (sd->khdl.imf) 3112 if (sd->imf)
2800 ecore_imf_context_cursor_location_set(sd->khdl.imf, cx, cy, cw, ch); 3113 ecore_imf_context_cursor_location_set(sd->imf, cx, cy, cw, ch);
2801 /* 3114 /*
2802 ecore_imf_context_cursor_position_set(sd->imf, 0); // how to get it? 3115 ecore_imf_context_cursor_position_set(sd->imf, 0); // how to get it?
2803 */ 3116 */
@@ -2816,11 +3129,11 @@ _smart_cb_focus_in(void *data, Evas *e EINA_UNUSED,
2816 edje_object_signal_emit(sd->cursor.obj, "focus,in", "terminology"); 3129 edje_object_signal_emit(sd->cursor.obj, "focus,in", "terminology");
2817 if (!sd->win) return; 3130 if (!sd->win) return;
2818 elm_win_keyboard_mode_set(sd->win, ELM_WIN_KEYBOARD_TERMINAL); 3131 elm_win_keyboard_mode_set(sd->win, ELM_WIN_KEYBOARD_TERMINAL);
2819 if (sd->khdl.imf) 3132 if (sd->imf)
2820 { 3133 {
2821 ecore_imf_context_input_panel_show(sd->khdl.imf); 3134 ecore_imf_context_input_panel_show(sd->imf);
2822 ecore_imf_context_reset(sd->khdl.imf); 3135 ecore_imf_context_reset(sd->imf);
2823 ecore_imf_context_focus_in(sd->khdl.imf); 3136 ecore_imf_context_focus_in(sd->imf);
2824 _imf_cursor_set(sd); 3137 _imf_cursor_set(sd);
2825 } 3138 }
2826} 3139}
@@ -2837,12 +3150,12 @@ _smart_cb_focus_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj,
2837 edje_object_signal_emit(sd->cursor.obj, "focus,out", "terminology"); 3150 edje_object_signal_emit(sd->cursor.obj, "focus,out", "terminology");
2838 if (!sd->win) return; 3151 if (!sd->win) return;
2839 elm_win_keyboard_mode_set(sd->win, ELM_WIN_KEYBOARD_OFF); 3152 elm_win_keyboard_mode_set(sd->win, ELM_WIN_KEYBOARD_OFF);
2840 if (sd->khdl.imf) 3153 if (sd->imf)
2841 { 3154 {
2842 ecore_imf_context_reset(sd->khdl.imf); 3155 ecore_imf_context_reset(sd->imf);
2843 _imf_cursor_set(sd); 3156 _imf_cursor_set(sd);
2844 ecore_imf_context_focus_out(sd->khdl.imf); 3157 ecore_imf_context_focus_out(sd->imf);
2845 ecore_imf_context_input_panel_hide(sd->khdl.imf); 3158 ecore_imf_context_input_panel_hide(sd->imf);
2846 } 3159 }
2847 _remove_links(sd, obj); 3160 _remove_links(sd, obj);
2848} 3161}
@@ -3279,7 +3592,7 @@ _smart_cb_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUS
3279 { 3592 {
3280 _sel_line(data, cx, cy - sd->scroll); 3593 _sel_line(data, cx, cy - sd->scroll);
3281 if (sd->pty->selection.is_active) 3594 if (sd->pty->selection.is_active)
3282 termio_take_selection(data, ELM_SEL_TYPE_PRIMARY); 3595 _take_selection(data, ELM_SEL_TYPE_PRIMARY);
3283 sd->didclick = EINA_TRUE; 3596 sd->didclick = EINA_TRUE;
3284 } 3597 }
3285 else if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK) 3598 else if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
@@ -3291,7 +3604,7 @@ _smart_cb_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUS
3291 else 3604 else
3292 _sel_word(data, cx, cy - sd->scroll); 3605 _sel_word(data, cx, cy - sd->scroll);
3293 if (sd->pty->selection.is_active) 3606 if (sd->pty->selection.is_active)
3294 termio_take_selection(data, ELM_SEL_TYPE_PRIMARY); 3607 _take_selection(data, ELM_SEL_TYPE_PRIMARY);
3295 sd->didclick = EINA_TRUE; 3608 sd->didclick = EINA_TRUE;
3296 } 3609 }
3297 else 3610 else
@@ -3379,7 +3692,7 @@ _smart_cb_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUS
3379 } 3692 }
3380 else if (ev->button == 2) 3693 else if (ev->button == 2)
3381 { 3694 {
3382 termio_paste_selection(data, ELM_SEL_TYPE_PRIMARY); 3695 _paste_selection(data, ELM_SEL_TYPE_PRIMARY);
3383 } 3696 }
3384 else if (ev->button == 3) 3697 else if (ev->button == 3)
3385 { 3698 {
@@ -3436,13 +3749,13 @@ _smart_cb_mouse_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED
3436 sd->pty->selection.end.x = cx; 3749 sd->pty->selection.end.x = cx;
3437 sd->pty->selection.end.y = cy - sd->scroll; 3750 sd->pty->selection.end.y = cy - sd->scroll;
3438 _smart_update_queue(data, sd); 3751 _smart_update_queue(data, sd);
3439 termio_take_selection(data, ELM_SEL_TYPE_PRIMARY); 3752 _take_selection(data, ELM_SEL_TYPE_PRIMARY);
3440 } 3753 }
3441 else 3754 else
3442 { 3755 {
3443 _selection_newline_extend_fix(data); 3756 _selection_newline_extend_fix(data);
3444 _smart_update_queue(data, sd); 3757 _smart_update_queue(data, sd);
3445 termio_take_selection(data, ELM_SEL_TYPE_PRIMARY); 3758 _take_selection(data, ELM_SEL_TYPE_PRIMARY);
3446 } 3759 }
3447 sd->pty->selection.makesel = EINA_FALSE; 3760 sd->pty->selection.makesel = EINA_FALSE;
3448 } 3761 }
@@ -4285,7 +4598,7 @@ _smart_add(Evas_Object *obj)
4285 const char *imf_id = ecore_imf_context_default_id_get(); 4598 const char *imf_id = ecore_imf_context_default_id_get();
4286 Evas *e; 4599 Evas *e;
4287 4600
4288 if (!imf_id) sd->khdl.imf = NULL; 4601 if (!imf_id) sd->imf = NULL;
4289 else 4602 else
4290 { 4603 {
4291 const Ecore_IMF_Context_Info *imf_info; 4604 const Ecore_IMF_Context_Info *imf_info;
@@ -4293,41 +4606,41 @@ _smart_add(Evas_Object *obj)
4293 imf_info = ecore_imf_context_info_by_id_get(imf_id); 4606 imf_info = ecore_imf_context_info_by_id_get(imf_id);
4294 if ((!imf_info->canvas_type) || 4607 if ((!imf_info->canvas_type) ||
4295 (strcmp(imf_info->canvas_type, "evas") == 0)) 4608 (strcmp(imf_info->canvas_type, "evas") == 0))
4296 sd->khdl.imf = ecore_imf_context_add(imf_id); 4609 sd->imf = ecore_imf_context_add(imf_id);
4297 else 4610 else
4298 { 4611 {
4299 imf_id = ecore_imf_context_default_id_by_canvas_type_get("evas"); 4612 imf_id = ecore_imf_context_default_id_by_canvas_type_get("evas");
4300 if (imf_id) sd->khdl.imf = ecore_imf_context_add(imf_id); 4613 if (imf_id) sd->imf = ecore_imf_context_add(imf_id);
4301 } 4614 }
4302 } 4615 }
4303 4616
4304 if (!sd->khdl.imf) goto imf_done; 4617 if (!sd->imf) goto imf_done;
4305 4618
4306 e = evas_object_evas_get(o); 4619 e = evas_object_evas_get(o);
4307 ecore_imf_context_client_window_set 4620 ecore_imf_context_client_window_set
4308 (sd->khdl.imf, (void *)ecore_evas_window_get(ecore_evas_ecore_evas_get(e))); 4621 (sd->imf, (void *)ecore_evas_window_get(ecore_evas_ecore_evas_get(e)));
4309 ecore_imf_context_client_canvas_set(sd->khdl.imf, e); 4622 ecore_imf_context_client_canvas_set(sd->imf, e);
4310 4623
4311 ecore_imf_context_event_callback_add 4624 ecore_imf_context_event_callback_add
4312 (sd->khdl.imf, ECORE_IMF_CALLBACK_COMMIT, _imf_event_commit_cb, sd); 4625 (sd->imf, ECORE_IMF_CALLBACK_COMMIT, _imf_event_commit_cb, sd);
4313 4626
4314 /* make IMF usable by a terminal - no preedit, prediction... */ 4627 /* make IMF usable by a terminal - no preedit, prediction... */
4315 ecore_imf_context_use_preedit_set 4628 ecore_imf_context_use_preedit_set
4316 (sd->khdl.imf, EINA_FALSE); 4629 (sd->imf, EINA_FALSE);
4317 ecore_imf_context_prediction_allow_set 4630 ecore_imf_context_prediction_allow_set
4318 (sd->khdl.imf, EINA_FALSE); 4631 (sd->imf, EINA_FALSE);
4319 ecore_imf_context_autocapital_type_set 4632 ecore_imf_context_autocapital_type_set
4320 (sd->khdl.imf, ECORE_IMF_AUTOCAPITAL_TYPE_NONE); 4633 (sd->imf, ECORE_IMF_AUTOCAPITAL_TYPE_NONE);
4321 ecore_imf_context_input_panel_layout_set 4634 ecore_imf_context_input_panel_layout_set
4322 (sd->khdl.imf, ECORE_IMF_INPUT_PANEL_LAYOUT_TERMINAL); 4635 (sd->imf, ECORE_IMF_INPUT_PANEL_LAYOUT_TERMINAL);
4323 ecore_imf_context_input_mode_set 4636 ecore_imf_context_input_mode_set
4324 (sd->khdl.imf, ECORE_IMF_INPUT_MODE_FULL); 4637 (sd->imf, ECORE_IMF_INPUT_MODE_FULL);
4325 ecore_imf_context_input_panel_language_set 4638 ecore_imf_context_input_panel_language_set
4326 (sd->khdl.imf, ECORE_IMF_INPUT_PANEL_LANG_ALPHABET); 4639 (sd->imf, ECORE_IMF_INPUT_PANEL_LANG_ALPHABET);
4327 ecore_imf_context_input_panel_return_key_type_set 4640 ecore_imf_context_input_panel_return_key_type_set
4328 (sd->khdl.imf, ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT); 4641 (sd->imf, ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT);
4329imf_done: 4642imf_done:
4330 if (sd->khdl.imf) DBG("Ecore IMF Setup"); 4643 if (sd->imf) DBG("Ecore IMF Setup");
4331 else WRN(_("Ecore IMF failed")); 4644 else WRN(_("Ecore IMF failed"));
4332 } 4645 }
4333 terms = eina_list_append(terms, obj); 4646 terms = eina_list_append(terms, obj);
@@ -4342,11 +4655,11 @@ _smart_del(Evas_Object *obj)
4342 4655
4343 EINA_SAFETY_ON_NULL_RETURN(sd); 4656 EINA_SAFETY_ON_NULL_RETURN(sd);
4344 terms = eina_list_remove(terms, obj); 4657 terms = eina_list_remove(terms, obj);
4345 if (sd->khdl.imf) 4658 if (sd->imf)
4346 { 4659 {
4347 ecore_imf_context_event_callback_del 4660 ecore_imf_context_event_callback_del
4348 (sd->khdl.imf, ECORE_IMF_CALLBACK_COMMIT, _imf_event_commit_cb); 4661 (sd->imf, ECORE_IMF_CALLBACK_COMMIT, _imf_event_commit_cb);
4349 ecore_imf_context_del(sd->khdl.imf); 4662 ecore_imf_context_del(sd->imf);
4350 } 4663 }
4351 if (sd->cursor.obj) evas_object_del(sd->cursor.obj); 4664 if (sd->cursor.obj) evas_object_del(sd->cursor.obj);
4352 if (sd->event) evas_object_del(sd->event); 4665 if (sd->event) evas_object_del(sd->event);
@@ -4371,7 +4684,7 @@ _smart_del(Evas_Object *obj)
4371 evas_object_del(o); 4684 evas_object_del(o);
4372 } 4685 }
4373 if (sd->link.down.dndobj) evas_object_del(sd->link.down.dndobj); 4686 if (sd->link.down.dndobj) evas_object_del(sd->link.down.dndobj);
4374 keyin_compose_seq_reset(&sd->khdl); 4687 _compose_seq_reset(sd);
4375 if (sd->sel_str) eina_stringshare_del(sd->sel_str); 4688 if (sd->sel_str) eina_stringshare_del(sd->sel_str);
4376 if (sd->sel_reset_job) ecore_job_del(sd->sel_reset_job); 4689 if (sd->sel_reset_job) ecore_job_del(sd->sel_reset_job);
4377 EINA_LIST_FREE(sd->cur_chids, chid) eina_stringshare_del(chid); 4690 EINA_LIST_FREE(sd->cur_chids, chid) eina_stringshare_del(chid);
@@ -4387,7 +4700,7 @@ _smart_del(Evas_Object *obj)
4387 sd->delayed_size_timer = NULL; 4700 sd->delayed_size_timer = NULL;
4388 sd->font.name = NULL; 4701 sd->font.name = NULL;
4389 sd->pty = NULL; 4702 sd->pty = NULL;
4390 sd->khdl.imf = NULL; 4703 sd->imf = NULL;
4391 sd->win = NULL; 4704 sd->win = NULL;
4392 sd->glayer = NULL; 4705 sd->glayer = NULL;
4393 ecore_imf_shutdown(); 4706 ecore_imf_shutdown();
@@ -4944,4 +5257,3 @@ termio_add(Evas_Object *parent, Config *config,
4944 _smart_size(obj, w, h, EINA_FALSE); 5257 _smart_size(obj, w, h, EINA_FALSE);
4945 return obj; 5258 return obj;
4946} 5259}
4947
diff --git a/src/bin/termio.h b/src/bin/termio.h
index ecc2513..77de3b9 100644
--- a/src/bin/termio.h
+++ b/src/bin/termio.h
@@ -14,15 +14,14 @@ char *termio_selection_get(Evas_Object *obj,
14 int c1x, int c1y, int c2x, int c2y, 14 int c1x, int c1y, int c2x, int c2y,
15 size_t *len); 15 size_t *len);
16Eina_Bool termio_selection_exists(const Evas_Object *obj); 16Eina_Bool termio_selection_exists(const Evas_Object *obj);
17void termio_scroll_delta(Evas_Object *obj, int delta, int by_page);
18void termio_scroll_set(Evas_Object *obj, int scroll); 17void termio_scroll_set(Evas_Object *obj, int scroll);
19void termio_scroll(Evas_Object *obj, int direction, int start_y, int end_y); 18void termio_scroll(Evas_Object *obj, int direction, int start_y, int end_y);
20void termio_content_change(Evas_Object *obj, Evas_Coord x, Evas_Coord y, int n); 19void termio_content_change(Evas_Object *obj, Evas_Coord x, Evas_Coord y, int n);
21 20
22void termio_config_update(Evas_Object *obj); 21void termio_config_update(Evas_Object *obj);
23Config *termio_config_get(const Evas_Object *obj); 22Config *termio_config_get(const Evas_Object *obj);
24void termio_take_selection(Evas_Object *obj, Elm_Sel_Type); 23void termio_copy_clipboard(Evas_Object *obj);
25void termio_paste_selection(Evas_Object *obj, Elm_Sel_Type); 24void termio_paste_clipboard(Evas_Object *obj);
26const char *termio_link_get(const Evas_Object *obj); 25const char *termio_link_get(const Evas_Object *obj);
27void termio_mouseover_suspend_pushpop(Evas_Object *obj, int dir); 26void termio_mouseover_suspend_pushpop(Evas_Object *obj, int dir);
28void termio_event_feed_mouse_in(Evas_Object *obj); 27void termio_event_feed_mouse_in(Evas_Object *obj);