aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2018-03-15 14:43:51 +0100
committerBoris Faure <billiob@gmail.com>2018-03-15 14:43:51 +0100
commitc4c769651cbc47589d20fff283e6ea08d67552e1 (patch)
tree5b56a5408f34fb6ec2fdc76cddb74f9779eebcd0 /src
parentChangeLog.theme: add about terminology/{cursor_bar,cursor_underline} groups (diff)
downloadterminology-c4c769651cbc47589d20fff283e6ea08d67552e1.tar.gz
config: add cursor shape
Diffstat (limited to 'src')
-rw-r--r--src/bin/config.c13
-rw-r--r--src/bin/config.h8
2 files changed, 19 insertions, 2 deletions
diff --git a/src/bin/config.c b/src/bin/config.c
index 2033487..92658dd 100644
--- a/src/bin/config.c
+++ b/src/bin/config.c
@@ -7,7 +7,7 @@
#include "col.h"
#include "utils.h"
-#define CONF_VER 18
+#define CONF_VER 19
#define LIM(v, min, max) {if (v >= max) v = max; else if (v <= min) v = min;}
@@ -119,6 +119,8 @@ config_init(void)
EET_DATA_DESCRIPTOR_ADD_BASIC
(edd_base, Config, "disable_cursor_blink", disable_cursor_blink, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC
+ (edd_base, Config, "cursor_shape", cursor_shape, EET_T_INT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC
(edd_base, Config, "disable_visual_bell", disable_visual_bell, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC
(edd_base, Config, "active_links", active_links, EET_T_UCHAR);
@@ -253,6 +255,7 @@ config_sync(const Config *config_src, Config *config)
config->jump_on_change = config_src->jump_on_change;
config->flicker_on_key = config_src->flicker_on_key;
config->disable_cursor_blink = config_src->disable_cursor_blink;
+ config->cursor_shape = config_src->cursor_shape;
config->disable_visual_bell = config_src->disable_visual_bell;
config->bell_rings = config_src->bell_rings;
config->active_links = config_src->active_links;
@@ -513,6 +516,7 @@ config_new(void)
config->jump_on_keypress = EINA_TRUE;
config->flicker_on_key = EINA_FALSE;
config->disable_cursor_blink = EINA_FALSE;
+ config->cursor_shape = CURSOR_SHAPE_BLOCK;
config->disable_visual_bell = EINA_FALSE;
config->bell_rings = EINA_TRUE;
config->active_links = EINA_TRUE;
@@ -662,7 +666,11 @@ config_load(const char *key)
_add_key(config, "g", 0, 1, 1, 0, "all_group");
EINA_FALLTHROUGH;
/*pass through*/
- case CONF_VER: /* 18 */
+ case 18:
+ config->cursor_shape = CURSOR_SHAPE_BLOCK;
+ EINA_FALLTHROUGH;
+ /*pass through*/
+ case CONF_VER: /* 19 */
config->version = CONF_VER;
break;
default:
@@ -734,6 +742,7 @@ config_fork(const Config *config)
CPY(jump_on_keypress);
CPY(flicker_on_key);
CPY(disable_cursor_blink);
+ CPY(cursor_shape);
CPY(disable_visual_bell);
CPY(bell_rings);
CPY(active_links);
diff --git a/src/bin/config.h b/src/bin/config.h
index 21e1bd7..20210ed 100644
--- a/src/bin/config.h
+++ b/src/bin/config.h
@@ -25,6 +25,13 @@ struct _Config_Color
unsigned char r, g, b, a;
};
+typedef enum _Cursor_Shape
+{
+ CURSOR_SHAPE_BLOCK = 0,
+ CURSOR_SHAPE_BAR = 1,
+ CURSOR_SHAPE_UNDERLINE = 2
+} Cursor_Shape;
+
struct _Config
{
int version;
@@ -59,6 +66,7 @@ struct _Config
Eina_Bool jump_on_change;
Eina_Bool flicker_on_key;
Eina_Bool disable_cursor_blink;
+ int cursor_shape;
Eina_Bool disable_visual_bell;
Eina_Bool bell_rings;
Eina_Bool active_links;