summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2012-07-05 04:36:47 +0000
committerCedric BAIL <cedric.bail@free.fr>2012-07-05 04:36:47 +0000
commit3656913985465d2f849955a07e914e28e9c2d626 (patch)
tree3dca83933b2fee21cc4241d948b08dce2046a68f /src/bin
parentf5bef8a0ed6beb23e81dec5be1a5ee240eb4687f (diff)
terminology: let jump on keypress.
SVN revision: 73323
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/config.c3
-rw-r--r--src/bin/config.h1
-rw-r--r--src/bin/main.c2
-rw-r--r--src/bin/options_behavior.c20
-rw-r--r--src/bin/termio.c8
5 files changed, 34 insertions, 0 deletions
diff --git a/src/bin/config.c b/src/bin/config.c
index ef8dc5b..a060b53 100644
--- a/src/bin/config.c
+++ b/src/bin/config.c
@@ -77,6 +77,8 @@ config_init(void)
77 EET_DATA_DESCRIPTOR_ADD_BASIC 77 EET_DATA_DESCRIPTOR_ADD_BASIC
78 (edd_base, Config, "jump_on_change", jump_on_change, EET_T_UCHAR); 78 (edd_base, Config, "jump_on_change", jump_on_change, EET_T_UCHAR);
79 EET_DATA_DESCRIPTOR_ADD_BASIC 79 EET_DATA_DESCRIPTOR_ADD_BASIC
80 (edd_base, Config, "jump_on_keypress", jump_on_keypress, EET_T_UCHAR);
81 EET_DATA_DESCRIPTOR_ADD_BASIC
80 (edd_base, Config, "flicker_on_key", flicker_on_key, EET_T_UCHAR); 82 (edd_base, Config, "flicker_on_key", flicker_on_key, EET_T_UCHAR);
81 EET_DATA_DESCRIPTOR_ADD_BASIC 83 EET_DATA_DESCRIPTOR_ADD_BASIC
82 (edd_base, Config, "disable_cursor_blink", disable_cursor_blink, EET_T_UCHAR); 84 (edd_base, Config, "disable_cursor_blink", disable_cursor_blink, EET_T_UCHAR);
@@ -221,6 +223,7 @@ config_load(const char *key)
221 config->background = NULL; 223 config->background = NULL;
222 config->translucent = EINA_FALSE; 224 config->translucent = EINA_FALSE;
223 config->jump_on_change = EINA_TRUE; 225 config->jump_on_change = EINA_TRUE;
226 config->jump_on_keypress = EINA_TRUE;
224 config->flicker_on_key = EINA_TRUE; 227 config->flicker_on_key = EINA_TRUE;
225 config->disable_cursor_blink = EINA_FALSE; 228 config->disable_cursor_blink = EINA_FALSE;
226 s = eina_unicode_unicode_to_utf8(sep, &slen); 229 s = eina_unicode_unicode_to_utf8(sep, &slen);
diff --git a/src/bin/config.h b/src/bin/config.h
index 9bb2068..aeaabc3 100644
--- a/src/bin/config.h
+++ b/src/bin/config.h
@@ -26,6 +26,7 @@ struct _Config
26 const char *wordsep; 26 const char *wordsep;
27 int scrollback; 27 int scrollback;
28 int vidmod; 28 int vidmod;
29 Eina_Bool jump_on_keypress;
29 Eina_Bool jump_on_change; 30 Eina_Bool jump_on_change;
30 Eina_Bool flicker_on_key; 31 Eina_Bool flicker_on_key;
31 Eina_Bool disable_cursor_blink; 32 Eina_Bool disable_cursor_blink;
diff --git a/src/bin/main.c b/src/bin/main.c
index 92a79c9..ca71d9b 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -458,6 +458,8 @@ elm_main(int argc, char **argv)
458 config_del(config); 458 config_del(config);
459 config_shutdown(); 459 config_shutdown();
460 460
461 evas_object_del(win);
462
461 eina_log_domain_unregister(_log_domain); 463 eina_log_domain_unregister(_log_domain);
462 _log_domain = -1; 464 _log_domain = -1;
463 465
diff --git a/src/bin/options_behavior.c b/src/bin/options_behavior.c
index 49866f2..458ce45 100644
--- a/src/bin/options_behavior.c
+++ b/src/bin/options_behavior.c
@@ -10,6 +10,16 @@
10static Evas_Object *op_sbslider, *op_jumpcheck, *op_wordsep; 10static Evas_Object *op_sbslider, *op_jumpcheck, *op_wordsep;
11 11
12static void 12static void
13_cb_op_behavior_jump_keypress_chg(void *data, Evas_Object *obj, void *event __UNUSED__)
14{
15 Evas_Object *term = data;
16 Config *config = termio_config_get(term);
17 config->jump_on_keypress = elm_check_state_get(obj);
18 termio_config_update(term);
19 config_save(config, NULL);
20}
21
22static void
13_cb_op_behavior_jump_chg(void *data, Evas_Object *obj, void *event __UNUSED__) 23_cb_op_behavior_jump_chg(void *data, Evas_Object *obj, void *event __UNUSED__)
14{ 24{
15 Evas_Object *term = data; 25 Evas_Object *term = data;
@@ -101,6 +111,16 @@ options_behavior(Evas_Object *opbox, Evas_Object *term)
101 o = elm_check_add(opbox); 111 o = elm_check_add(opbox);
102 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0); 112 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
103 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.5); 113 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.5);
114 elm_object_text_set(o, "Jump to bottom on keypress");
115 elm_check_state_set(o, config->jump_on_keypress);
116 elm_box_pack_end(opbox, o);
117 evas_object_show(o);
118 evas_object_smart_callback_add(o, "changed",
119 _cb_op_behavior_jump_keypress_chg, term);
120
121 o = elm_check_add(opbox);
122 evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0.0);
123 evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.5);
104 elm_object_text_set(o, "React to key press"); 124 elm_object_text_set(o, "React to key press");
105 elm_check_state_set(o, config->flicker_on_key); 125 elm_check_state_set(o, config->flicker_on_key);
106 elm_box_pack_end(opbox, o); 126 elm_box_pack_end(opbox, o);
diff --git a/src/bin/termio.c b/src/bin/termio.c
index 9bf7437..c34952a 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -64,6 +64,7 @@ struct _Termio
64 Config *config; 64 Config *config;
65 Ecore_IMF_Context *imf; 65 Ecore_IMF_Context *imf;
66 Eina_Bool jump_on_change : 1; 66 Eina_Bool jump_on_change : 1;
67 Eina_Bool jump_on_keypress : 1;
67 Eina_Bool have_sel : 1; 68 Eina_Bool have_sel : 1;
68 Eina_Bool noreqsize : 1; 69 Eina_Bool noreqsize : 1;
69 Eina_Bool composing : 1; 70 Eina_Bool composing : 1;
@@ -1056,6 +1057,11 @@ _smart_cb_key_down(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
1056 } 1057 }
1057 } 1058 }
1058 } 1059 }
1060 if (sd->jump_on_keypress)
1061 {
1062 sd->scroll = 0;
1063 _smart_update_queue(data, sd);
1064 }
1059 // if term app asked fro kbd lock - dont handle here 1065 // if term app asked fro kbd lock - dont handle here
1060 if (sd->pty->state.kbd_lock) return; 1066 if (sd->pty->state.kbd_lock) return;
1061 // if app asked us to not do autorepeat - ignore pree is it is the same 1067 // if app asked us to not do autorepeat - ignore pree is it is the same
@@ -1745,6 +1751,7 @@ _termio_config_set(Evas_Object *obj, Config *config)
1745 sd->config = config; 1751 sd->config = config;
1746 1752
1747 sd->jump_on_change = config->jump_on_change; 1753 sd->jump_on_change = config->jump_on_change;
1754 sd->jump_on_keypress = config->jump_on_keypress;
1748 1755
1749 if (config->font.bitmap) 1756 if (config->font.bitmap)
1750 { 1757 {
@@ -2465,6 +2472,7 @@ termio_config_update(Evas_Object *obj)
2465 sd->font.size = sd->config->font.size; 2472 sd->font.size = sd->config->font.size;
2466 2473
2467 sd->jump_on_change = sd->config->jump_on_change; 2474 sd->jump_on_change = sd->config->jump_on_change;
2475 sd->jump_on_keypress = sd->config->jump_on_keypress;
2468 2476
2469 termpty_backscroll_set(sd->pty, sd->config->scrollback); 2477 termpty_backscroll_set(sd->pty, sd->config->scrollback);
2470 sd->scroll = 0; 2478 sd->scroll = 0;