From: Kim Shinwoo <kimcinoo.efl@gmail.com>

Subject: Re: [E-devel] [Patch][elementary] elm_cofig, setting
accessibility mode



SVN revision: 73073
This commit is contained in:
Kim Shinwoo 2012-06-30 06:01:25 +00:00 committed by Carsten Haitzler
parent ec3dd6cdc6
commit 577a646924
8 changed files with 117 additions and 3 deletions

View File

@ -241,3 +241,8 @@
* Add support for a new toolbar style with icon and text
aligned in center. "item_centered".
2012-06-30 Shinwoo Kim (kimcinoo)
* Add elm_config_access_set/get() to allow for a config tool to enable
ot diasbale access mode.

View File

@ -30,7 +30,7 @@ group "Elm_Config" struct {
value "finger_size" int: 40;
value "fps" double: 60.0;
value "theme" string: "default";
value "modules" string: "datetime_input_ctxpopup>datetime/api";
value "modules" string: "access_output>access/api:datetime_input_ctxpopup>datetime/api";
value "tooltip_delay" double: 1.0;
value "cursor_engine_only" uchar: 1;
value "focus_highlight_enable" uchar: 0;

View File

@ -30,7 +30,7 @@ group "Elm_Config" struct {
value "finger_size" int: 40;
value "fps" double: 60.0;
value "theme" string: "default";
value "modules" string: "datetime_input_ctxpopup>datetime/api";
value "modules" string: "access_output>access/api:datetime_input_ctxpopup>datetime/api";
value "tooltip_delay" double: 1.0;
value "cursor_engine_only" uchar: 1;
value "focus_highlight_enable" uchar: 0;

View File

@ -30,7 +30,7 @@ group "Elm_Config" struct {
value "finger_size" int: 5;
value "fps" double: 60.0;
value "theme" string: "default-desktop";
value "modules" string: "datetime_input_ctxpopup>datetime/api";
value "modules" string: "access_output>access/api:datetime_input_ctxpopup>datetime/api";
value "tooltip_delay" double: 1.0;
value "cursor_engine_only" uchar: 1;
value "focus_highlight_enable" uchar: 0;

View File

@ -585,6 +585,19 @@ ecc_change(void *data __UNUSED__,
elm_config_all_flush();
}
static void
ac_change(void *data __UNUSED__,
Evas_Object *obj,
void *event_info __UNUSED__)
{
Eina_Bool val = elm_check_state_get(obj);
Eina_Bool ac = elm_config_access_get();
if (val == ac) return;
elm_config_access_set(val);
elm_config_all_flush();
}
static void
_status_basic(Evas_Object *win,
Evas_Object *bx0)
@ -734,6 +747,14 @@ _cf_caches(void *data,
_flip_to(data, "caches");
}
static void
_cf_access(void *data,
Evas_Object *obj __UNUSED__,
void *event_info __UNUSED__)
{
_flip_to(data, "access");
}
const char *
_elm_theme_current_get(const char *theme_search_order)
{
@ -1219,6 +1240,33 @@ _status_config_sizing(Evas_Object *win,
elm_naviframe_item_simple_push(naviframe, bx);
}
static void
_status_config_access(Evas_Object *win,
Evas_Object *naviframe)
{
Evas_Object *bx, *ck;
bx = elm_box_add(win);
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, 0.5);
ck = elm_check_add(win);
elm_object_tooltip_text_set(ck, "Set access mode");
elm_object_text_set(ck, "Enable Access Mode");
evas_object_data_set(win, "access_check", ck);
evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5);
elm_check_state_set(ck, elm_config_access_get());
elm_box_pack_end(bx, ck);
evas_object_show(ck);
evas_object_smart_callback_add(ck, "changed", ac_change, NULL);
evas_object_data_set(win, "access", bx);
elm_naviframe_item_simple_push(naviframe, bx);
}
static Evas_Object *
_sample_theme_new(Evas_Object *win)
{
@ -2997,6 +3045,7 @@ _status_config_full(Evas_Object *win,
elm_toolbar_item_append(tb, "video-display", "Rendering",
_cf_rendering, win);
elm_toolbar_item_append(tb, "appointment-new", "Caches", _cf_caches, win);
elm_toolbar_item_append(tb, "stock_spellcheck", "Access", _cf_access, win);
elm_box_pack_end(bx0, tb);
evas_object_show(tb);
@ -3013,6 +3062,7 @@ _status_config_full(Evas_Object *win,
_status_config_scrolling(win, naviframe);
_status_config_caches(win, naviframe);
_status_config_sizing(win, naviframe);
_status_config_access(win, naviframe);
// FIXME uncomment after flip style fix, please
//elm_object_style_set(naviframe, "flip");

View File

@ -526,6 +526,18 @@ _elm_config_font_overlays_list(void)
return _elm_config->font_overlays;
}
Eina_Bool _elm_config_access_get(void)
{
return _elm_config->access_mode;
}
void _elm_config_access_set(Eina_Bool is_access)
{
is_access = !!is_access;
if (_elm_config->access_mode == is_access) return;
_elm_config->access_mode = is_access;
}
void
_elm_config_font_overlay_set(const char *text_class,
const char *font,
@ -1035,6 +1047,7 @@ _config_load(void)
_elm_config->glayer_long_tap_start_timeout = 1.2; /* 1.2 second to start long-tap */
_elm_config->glayer_double_tap_timeout = 0.25; /* 0.25 seconds between 2 mouse downs of a tap. */
_elm_config->glayer_continues_enable = EINA_TRUE; /* Continue gestures default */
_elm_config->access_mode = ELM_ACCESS_MODE_OFF;
_elm_config->week_start = 1; /* monday */
_elm_config->weekend_start = 6; /* saturday */
_elm_config->weekend_len = 2;
@ -1693,6 +1706,18 @@ elm_config_font_overlay_list_get(void)
return _elm_config_font_overlays_list();
}
EAPI Eina_Bool
elm_config_access_get(void)
{
return _elm_config_access_get();
}
EAPI void
elm_config_access_set(Eina_Bool is_access)
{
_elm_config_access_set(is_access);
}
EAPI void
elm_config_font_overlay_set(const char *text_class,
const char *font,

View File

@ -688,6 +688,36 @@ EAPI const Eina_List *elm_config_font_overlay_list_get(void);
*/
EAPI void elm_config_font_overlay_set(const char *text_class, const char *font, Evas_Font_Size size);
/**
* Get access mode
*
* @return the access mode bouncing state
*
* @since 1.1
*
* @ingroup Access
*
* @see elm_config_access_set()
*/
EAPI Eina_Bool elm_config_access_get(void);
/**
* Set access mode
*
* @param is_accesss If EINA_TRUE enables access mode
*
* @note Elementary objects may have information (e.g. label on the elm_button)
* to be read. This information is read by access module when an object
* receives EVAS_CALLBACK_MOUSE_IN event
*
* @since 1.1
*
* @ingroup Access
*
* @see elm_config_access_get()
*/
EAPI void elm_config_access_set(Eina_Bool is_access);
/**
* Unset a font overlay for a given Elementary text class.
*

View File

@ -224,6 +224,7 @@ void _elm_ews_wm_rescale(Elm_Theme *th, Eina_Bool use_theme);
void _elm_win_shutdown(void);
void _elm_win_rescale(Elm_Theme *th, Eina_Bool use_theme);
void _elm_win_access(Eina_Bool is_access);
void _elm_win_translate(void);
Eina_Bool _elm_theme_object_set(Evas_Object *parent, Evas_Object *o, const char *clas, const char *group, const char *style);
@ -278,6 +279,9 @@ void _elm_config_font_overlay_apply(void);
Eina_List *_elm_config_text_classes_get(void);
void _elm_config_text_classes_free(Eina_List *l);
Eina_Bool _elm_config_access_get(void);
void _elm_config_access_set(Eina_Bool is_access);
Elm_Font_Properties *_elm_font_properties_get(Eina_Hash **font_hash, const char *font);
Eina_Hash *_elm_font_available_hash_add(Eina_Hash *font_hash, const char *full_name);
void _elm_font_available_hash_del(Eina_Hash *hash);