char *_elm_profile = NULL;
static Eet_Data_Descriptor *_config_edd = NULL;
static Eet_Data_Descriptor *_config_font_overlay_edd = NULL;
-<<<<<<< HEAD
-=======
+static Eet_Data_Descriptor *_config_color_edd = NULL;
+static Eet_Data_Descriptor *_config_color_palette_edd = NULL;
const char *_elm_preferred_engine = NULL;
->>>>>>> remotes/origin/upstream
static Ecore_Poller *_elm_cache_flush_poller = NULL;
eet_data_descriptor_free(_config_edd);
return;
}
+
+ memset(&eddc, 0, sizeof(eddc)); /* just in case... */
+ EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Elm_Color_RGBA);
+ eddc.func.str_direct_alloc = NULL;
+ eddc.func.str_direct_free = NULL;
+
+ _config_color_edd = eet_data_descriptor_stream_new(&eddc);
+ if (!_config_color_edd)
+ {
+ printf("EEEK! eet_data_descriptor_stream_new() failed\n");
+ eet_data_descriptor_free(_config_edd);
+ return;
+ }
+
+ memset(&eddc, 0, sizeof(eddc)); /* just in case... */
+ EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Elm_Custom_Palette);
+ eddc.func.str_direct_alloc = NULL;
+ eddc.func.str_direct_free = NULL;
+
+ _config_color_palette_edd = eet_data_descriptor_stream_new(&eddc);
+ if (!_config_color_palette_edd)
+ {
+ printf("EEEK! eet_data_descriptor_stream_new() failed\n");
+ eet_data_descriptor_free(_config_edd);
+ return;
+ }
+
#define T_INT EET_T_INT
#define T_DOUBLE EET_T_DOUBLE
#define T_STRING EET_T_STRING
#undef T
#undef D
+#define T Elm_Color_RGBA
+#define D _config_color_edd
+ ELM_CONFIG_VAL(D, T, r, EET_T_UINT);
+ ELM_CONFIG_VAL(D, T, g, EET_T_UINT);
+ ELM_CONFIG_VAL(D, T, b, EET_T_UINT);
+ ELM_CONFIG_VAL(D, T, a, EET_T_UINT);
+#undef T
+#undef D
+
+#define T Elm_Custom_Palette
+#define D _config_color_palette_edd
+ ELM_CONFIG_VAL(D, T, palette_name, EET_T_STRING);
+ ELM_CONFIG_LIST(D, T, color_list, _config_color_edd);
+#undef T
+#undef D
+
#define T Elm_Config
#define D _config_edd
ELM_CONFIG_VAL(D, T, config_version, T_INT);
ELM_CONFIG_VAL(D, T, bring_in_scroll_friction, T_DOUBLE);
ELM_CONFIG_VAL(D, T, zoom_friction, T_DOUBLE);
ELM_CONFIG_VAL(D, T, thumbscroll_bounce_enable, T_UCHAR);
-<<<<<<< HEAD
ELM_CONFIG_VAL(D, T, scroll_smooth_time_interval, T_DOUBLE);
-=======
->>>>>>> remotes/origin/upstream
ELM_CONFIG_VAL(D, T, scroll_smooth_amount, T_DOUBLE);
ELM_CONFIG_VAL(D, T, scroll_smooth_history_weight, T_DOUBLE);
ELM_CONFIG_VAL(D, T, scroll_smooth_future_time, T_DOUBLE);
ELM_CONFIG_VAL(D, T, glayer_long_tap_start_timeout, T_DOUBLE);
ELM_CONFIG_VAL(D, T, access_mode, T_INT);
ELM_CONFIG_VAL(D, T, glayer_continues_enable, T_UCHAR);
-<<<<<<< HEAD
-=======
ELM_CONFIG_VAL(D, T, week_start, T_INT);
ELM_CONFIG_VAL(D, T, weekend_start, T_INT);
ELM_CONFIG_VAL(D, T, weekend_len, T_INT);
->>>>>>> remotes/origin/upstream
+ ELM_CONFIG_LIST(D, T, color_palette, _config_color_palette_edd);
#undef T
#undef D
#undef T_INT
eet_data_descriptor_free(_config_font_overlay_edd);
_config_font_overlay_edd = NULL;
}
+
+ if (_config_color_edd)
+ {
+ eet_data_descriptor_free(_config_color_edd);
+ _config_color_edd = NULL;
+ }
+
+ if (_config_color_palette_edd)
+ {
+ eet_data_descriptor_free(_config_color_palette_edd);
+ _config_color_palette_edd = NULL;
+ }
}
static int
{
Elm_Text_Class *tc;
tc = malloc(sizeof(*tc));
-<<<<<<< HEAD
-=======
if (!tc) continue;
->>>>>>> remotes/origin/upstream
*tc = _elm_text_classes[i];
}
Eina_List *
+_elm_config_color_list_get(const char *palette_name)
+{
+ Eina_List *plist;
+ Elm_Custom_Palette *cpalette;
+ EINA_LIST_FOREACH(_elm_config->color_palette, plist, cpalette)
+ {
+ if (strcmp(cpalette->palette_name, palette_name))
+ continue;
+ return cpalette->color_list;
+ }
+ return NULL;
+}
+
+void
+_elm_config_color_set(const char *palette_name,
+ int r,
+ int g,
+ int b,
+ int a)
+{
+ Eina_List *plist;
+ Elm_Custom_Palette *cpalette;
+ Elm_Color_RGBA *color;
+ EINA_LIST_FOREACH(_elm_config->color_palette, plist, cpalette)
+ {
+ if (strcmp(cpalette->palette_name, palette_name))
+ continue;
+
+ color = calloc(1, sizeof(Elm_Color_RGBA));
+ color->r = r;
+ color->g = g;
+ color->b = b;
+ color->a = a;
+ cpalette->color_list = eina_list_prepend(cpalette->color_list,
+ color);
+ }
+}
+
+void
+_elm_config_colors_free(const char *palette_name)
+{
+ Eina_List *plist;
+ Elm_Custom_Palette *cpalette;
+ Elm_Color_RGBA *color;
+ EINA_LIST_FOREACH(_elm_config->color_palette, plist, cpalette)
+ {
+ if (strcmp(cpalette->palette_name, palette_name))
+ continue;
+
+ EINA_LIST_FREE(cpalette->color_list, color)
+ {
+ free(color);
+ }
+ }
+}
+
+Eina_List *
_elm_config_profiles_list(void)
{
-<<<<<<< HEAD
- const Eina_File_Direct_Info *info;
-=======
Eina_File_Direct_Info *info;
->>>>>>> remotes/origin/upstream
Eina_List *flist = NULL;
Eina_Iterator *file_it;
char buf[PATH_MAX];
EINA_ITERATOR_FOREACH(file_it, info)
{
-<<<<<<< HEAD
-=======
Eina_Stat st;
if (eina_file_statat(eina_iterator_container_get(file_it), info, &st))
ERR("this is bad.");
continue;
}
->>>>>>> remotes/origin/upstream
if (info->name_length >= len)
continue;
{
Elm_Font_Overlay *fo;
const char *fontdir;
+ Elm_Custom_Palette *palette;
+ Elm_Color_RGBA *color;
if (!_elm_config) return;
EINA_LIST_FREE(_elm_config->font_dirs, fontdir)
if (fo->font) eina_stringshare_del(fo->font);
free(fo);
}
+ EINA_LIST_FREE(_elm_config->color_palette, palette)
+ {
+ if (palette->palette_name) eina_stringshare_del(palette->palette_name);
+ EINA_LIST_FREE(palette->color_list, color) free(color);
+ free(palette);
+ }
if (_elm_config->theme) eina_stringshare_del(_elm_config->theme);
if (_elm_config->modules) eina_stringshare_del(_elm_config->modules);
free(_elm_config);
static Eina_Bool
_elm_cache_flush_cb(void *data __UNUSED__)
{
-<<<<<<< HEAD
- elm_all_flush();
-=======
elm_cache_all_flush();
->>>>>>> remotes/origin/upstream
return ECORE_CALLBACK_RENEW;
}
Eina_List *l;
Evas_Object *win;
-<<<<<<< HEAD
- elm_all_flush();
-=======
elm_cache_all_flush();
->>>>>>> remotes/origin/upstream
EINA_LIST_FOREACH(_elm_win_list, l, win)
{
* profile. Fallback to default before moving on */
// config load fail - defaults
-<<<<<<< HEAD
- /* XXX: do these make sense? Only if it's valid to install the lib
- * without the config, but do we want that? */
-=======
// why are these here? well if they are, it means you can make a gui
// config recovery app i guess...
->>>>>>> remotes/origin/upstream
_elm_config = ELM_NEW(Elm_Config);
_elm_config->config_version = ELM_CONFIG_VERSION;
_elm_config->engine = eina_stringshare_add("software_x11");
_elm_config->zoom_friction = 0.5;
_elm_config->thumbscroll_border_friction = 0.5;
_elm_config->thumbscroll_sensitivity_friction = 0.25; // magic number! just trial and error shows this makes it behave "nicer" and not run off at high speed all the time
-<<<<<<< HEAD
_elm_config->scroll_smooth_time_interval = 0.008;
-=======
->>>>>>> remotes/origin/upstream
_elm_config->scroll_smooth_amount = 1.0;
_elm_config->scroll_smooth_history_weight = 0.3;
_elm_config->scroll_smooth_future_time = 0.0;
_elm_config->glayer_flick_time_limit_ms = 120; /* ms to finish flick */
_elm_config->glayer_long_tap_start_timeout = 1.2; /* 1.2 second to start long-tap */
_elm_config->glayer_continues_enable = EINA_TRUE; /* Continue gestures default */
-<<<<<<< HEAD
-=======
_elm_config->week_start = 1; /* monday */
_elm_config->weekend_start = 6; /* saturday */
_elm_config->weekend_len = 2;
->>>>>>> remotes/origin/upstream
+ _elm_config->color_palette = NULL;
}
static const char *
ok = ecore_file_mkpath(buf);
if (!ok)
{
-<<<<<<< HEAD
- ERR("Problem acessing Elementary's user configuration directory: %s",
-=======
ERR("Problem accessing Elementary's user configuration directory: %s",
->>>>>>> remotes/origin/upstream
buf);
return EINA_FALSE;
}
_elm_config->thumbscroll_sensitivity_friction = friction;
}
-<<<<<<< HEAD
s = getenv("ELM_SCROLL_SMOOTH_TIME_INTERVAL");
if (s) _elm_config->scroll_smooth_time_interval = atof(s);
-=======
->>>>>>> remotes/origin/upstream
s = getenv("ELM_SCROLL_SMOOTH_AMOUNT");
if (s) _elm_config->scroll_smooth_amount = atof(s);
s = getenv("ELM_SCROLL_SMOOTH_HISTORY_WEIGHT");
}
EAPI Eina_Bool
-<<<<<<< HEAD
-elm_mirrored_get(void)
-=======
elm_config_mirrored_get(void)
->>>>>>> remotes/origin/upstream
{
return _elm_config->is_mirrored;
}
EAPI void
-<<<<<<< HEAD
-elm_mirrored_set(Eina_Bool mirrored)
-=======
elm_config_mirrored_set(Eina_Bool mirrored)
->>>>>>> remotes/origin/upstream
{
_elm_config->is_mirrored = mirrored;
_elm_rescale();
}
-<<<<<<< HEAD
-=======
EAPI Eina_Bool
elm_config_cursor_engine_only_get(void)
{
}
EAPI double
+elm_scale_get(void)
+{
+ return elm_config_scale_get();
+}
+
+EAPI double
elm_config_scale_get(void)
{
return _elm_config->scale;
}
EAPI void
+elm_scale_set(double scale)
+{
+ elm_config_scale_set(scale);
+}
+
+EAPI void
elm_config_scale_set(double scale)
{
if (_elm_config->scale == scale) return;
{
_elm_config_font_overlay_apply();
}
+// WRAPPER:: will be removed soon.
+EAPI Evas_Coord
+elm_finger_size_get(void)
+{
+ return elm_config_finger_size_get();
+}
EAPI Evas_Coord
elm_config_finger_size_get(void)
return _elm_config->finger_size;
}
+// WRAPPER:: will be removed soon.
+EAPI void
+elm_finger_size_set(Evas_Coord size)
+{
+ elm_config_finger_size_set(size);
+}
+
EAPI void
elm_config_finger_size_set(Evas_Coord size)
{
#endif
}
->>>>>>> remotes/origin/upstream
static void
_translation_init()
{
_desc_init();
_profile_fetch_from_conf();
_config_load();
-<<<<<<< HEAD
-=======
if (_elm_preferred_engine) eina_stringshare_del(_elm_preferred_engine);
if (_elm_config->engine)
_elm_preferred_engine = eina_stringshare_add(_elm_config->engine);
else
_elm_preferred_engine = NULL;
->>>>>>> remotes/origin/upstream
_translation_init();
_env_get();
_config_apply();
_elm_config->engine = eina_stringshare_add(engine);
}
-<<<<<<< HEAD
-void
-_elm_config_all_update(void)
-{
-#ifdef HAVE_ELEMENTARY_X
- if (_prop_all_update_timer) ecore_timer_del(_prop_all_update_timer);
- _prop_all_update_timer = ecore_timer_add(0.1, _prop_all_update_cb, NULL);
- _prop_config_set();
- ecore_x_window_prop_string_set(_root_1st, _atom[ATOM_E_PROFILE],
- _elm_profile);
-#endif
-=======
EAPI const char *
elm_config_preferred_engine_get(void)
{
if (_elm_preferred_engine) eina_stringshare_del(_elm_preferred_engine);
_elm_preferred_engine = eina_stringshare_add(_elm_config->engine);
}
->>>>>>> remotes/origin/upstream
}
void
if (_prop_all_update_timer)
{
ecore_timer_del(_prop_all_update_timer);
-<<<<<<< HEAD
- _prop_all_update_cb(NULL);
- }
- _prop_all_update_timer = NULL;
-=======
_prop_all_update_timer = NULL;
_prop_all_update_cb(NULL);
}
->>>>>>> remotes/origin/upstream
if (_prop_change_delay_timer) ecore_timer_del(_prop_change_delay_timer);
_prop_change_delay_timer = NULL;
#endif
#endif
}
_config_free();
-<<<<<<< HEAD
-=======
if (_elm_preferred_engine)
{
eina_stringshare_del(_elm_preferred_engine);
_elm_preferred_engine = NULL;
}
->>>>>>> remotes/origin/upstream
if (_elm_profile)
{
free(_elm_profile);