config: rename Config_Color type to Color + reorganise eet setup

This commit is contained in:
Boris Faure 2020-09-09 21:31:17 +02:00
parent ff9b4aacc5
commit b1bdf50671
Signed by: borisfaure
GPG Key ID: 35C0410516166BE8
3 changed files with 13 additions and 21 deletions

View File

@ -4,16 +4,6 @@
#include "config.h"
#include "colors.h"
typedef struct _Color Color;
struct _Color
{
unsigned char r;
unsigned char g;
unsigned char b;
unsigned char a;
};
static const Color default_colors[2][2][12] =
{
{ // normal

View File

@ -36,22 +36,19 @@ config_init(void)
_config_home_get());
ecore_file_mkpath(path);
eet_eina_stream_data_descriptor_class_set
(&eddc, sizeof(eddc), "Config", sizeof(Config));
edd_base = eet_data_descriptor_stream_new(&eddc);
eet_eina_stream_data_descriptor_class_set
(&eddc, sizeof(eddc), "Config_Color", sizeof(Config_Color));
(&eddc, sizeof(eddc), "Config_Color", sizeof(Color));
edd_color = eet_data_descriptor_stream_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_BASIC
(edd_color, Config_Color, "r", r, EET_T_UCHAR);
(edd_color, Color, "r", r, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC
(edd_color, Config_Color, "g", g, EET_T_UCHAR);
(edd_color, Color, "g", g, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC
(edd_color, Config_Color, "b", b, EET_T_UCHAR);
(edd_color, Color, "b", b, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC
(edd_color, Config_Color, "a", a, EET_T_UCHAR);
(edd_color, Color, "a", a, EET_T_UCHAR);
eet_eina_stream_data_descriptor_class_set
@ -75,6 +72,11 @@ config_init(void)
EET_DATA_DESCRIPTOR_ADD_BASIC
(edd_keys, Config_Keys, "cb", cb, EET_T_STRING);
eet_eina_stream_data_descriptor_class_set
(&eddc, sizeof(eddc), "Config", sizeof(Config));
edd_base = eet_data_descriptor_stream_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_BASIC
(edd_base, Config, "version", version, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC

View File

@ -4,7 +4,7 @@
#include <Evas.h>
typedef struct _Config Config;
typedef struct _Config_Color Config_Color;
typedef struct _Color Color;
typedef struct _Config_Keys Config_Keys;
struct _Config_Keys
@ -20,7 +20,7 @@ struct _Config_Keys
};
/* TODO: separate config per terminal (tab, window) and global. */
struct _Config_Color
struct _Color
{
unsigned char r, g, b, a;
};
@ -97,7 +97,7 @@ struct _Config
Eina_Bool changedir_to_current;
Eina_Bool emoji_dbl_width;
Eina_Bool group_all;
Config_Color colors[(4 * 12)];
Color colors[(4 * 12)];
Eina_List *keys;
Eina_Bool temporary; /* not in EET */