efl_ui_theme: Introduce Efl.Ui.Theme class

Summary:
Efl.Ui.Theme class is required to support language bindings.
Efl.Ui.Theme works based on current elm_theme features.

This patch fixes T7357.

Reviewers: segfaultxavi, cedric, lauromoura, woohyun, zmike, SanghyeonLee

Reviewed By: segfaultxavi, SanghyeonLee

Subscribers: SanghyeonLee, herdsman, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7357

Differential Revision: https://phab.enlightenment.org/D7244
This commit is contained in:
Jaehyun Cho 2018-11-20 13:56:37 +09:00
parent 0611620301
commit 4f9c8d524c
84 changed files with 953 additions and 361 deletions

View File

@ -110,6 +110,7 @@ elm_public_eolian_files = \
lib/elementary/efl_access_value.eo \
lib/elementary/efl_access_widget_action.eo \
lib/elementary/efl_access_window.eo \
lib/elementary/efl_ui_theme.eo \
lib/elementary/efl_config_global.eo \
lib/elementary/elm_code_widget.eo \
lib/elementary/efl_selection.eo \

View File

@ -123,7 +123,9 @@ elementary/efl_ui_list_example_1.c \
elementary/efl_ui_list_view_example_1.c \
elementary/efl_ui_list_view_example_2.c \
elementary/efl_ui_list_view_example_3.c \
elementary/efl_canvas_layout_text.c
elementary/efl_canvas_layout_text.c \
elementary/efl_ui_theme_example_01.c \
elementary/efl_ui_theme_example_02.c
ELM_SRCS += \
elementary/bg_cxx_example_01.cc \
@ -156,7 +158,8 @@ elementary/layout_example.edc \
elementary/codegen_example.edc \
elementary/efl_ui_list_view_example.edc \
elementary/prefs_example_03.edc \
elementary/efl_canvas_layout_text.edc
elementary/efl_canvas_layout_text.edc \
elementary/efl_ui_theme_example.edc
ELM_EPCS = \
elementary/prefs_example_01.epc \
@ -339,7 +342,9 @@ elementary/efl_ui_list_example_1 \
elementary/efl_ui_list_view_example_1 \
elementary/efl_ui_list_view_example_2 \
elementary/efl_ui_list_view_example_3 \
elementary/efl_canvas_layout_text
elementary/efl_canvas_layout_text \
elementary/efl_ui_theme_example_01 \
elementary/efl_ui_theme_example_02
#benchmark3d
#sphere-hunter

View File

@ -0,0 +1,190 @@
collections {
group { "efl/button:custom";
alias: "efl/button";
parts {
rect { "border";
desc { "default";
color: 0 0 0 255;
}
desc { "in";
color: 50 180 180 255;
}
}
rect { "base";
mouse_events: 1;
desc { "default";
rel1.to: "border";
rel1.offset: 1 1;
rel2.to: "border";
rel2.offset: -2 -2;
}
desc { "disabled";
inherit: "default";
color: 230 230 230 255;
}
}
swallow { "efl.swallow.content";
mouse_events: 0;
desc { "default";
fixed: 1 0;
hid;
align: 0.0 0.5;
rel1.offset: 4 4;
rel2.offset: 3 -5;
rel2.relative: 0.0 1.0;
}
desc { "visible";
inherit: "default";
vis;
aspect: 1.0 1.0;
aspect_preference: VERTICAL;
rel2.offset: 4 -5;
}
desc { "icononly";
inherit: "default";
fixed: 0 0;
vis;
align: 0.5 0.5;
aspect: 1.0 1.0;
aspect_preference: VERTICAL;
rel2.offset: -5 -5;
rel2.relative: 1.0 1.0;
}
}
text { "efl.text";
mouse_events: 0;
scale: 1;
desc { "default";
vis;
rel1.to_x: "efl.swallow.content";
rel1.relative: 1.0 0.0;
rel1.offset: 0 4;
rel2.offset: -5 -5;
color: 0 0 0 255;
text {
font: "Sans";
size: 10;
min: 0 0;
text_class: "button";
}
}
desc { "visible";
inherit: "default";
vis;
text.min: 1 1;
text.ellipsis: -1;
}
desc { "disabled";
inherit: "default";
}
desc { "disabled_visible";
inherit: "default";
vis;
text.min: 1 1;
text.ellipsis: -1;
}
}
programs {
program { "button_mouse_in";
signal: "mouse,in";
source: "base";
action: STATE_SET "in" 0.0;
target: "border";
}
program { "button_mouse_out";
signal: "mouse,out";
source: "base";
action: STATE_SET "default" 0.0;
target: "border";
}
program { "button_unclick";
signal: "mouse,up,1";
source: "base";
action: SIGNAL_EMIT "efl,action,click" "";
}
program { "button_click";
signal: "mouse,down,1";
source: "base";
}
program { "text_show";
signal: "efl,state,text,visible";
source: "efl";
script {
new st[31];
new Float:vl;
get_state(PART:"efl.swallow.content", st, 30, vl);
if (!strcmp(st, "icononly"))
set_state(PART:"efl.swallow.content", "visible", 0.0);
set_state(PART:"efl.text", "visible", 0.0);
}
}
program { "text_hide";
signal: "efl,state,text,hidden";
source: "efl";
script {
new st[31];
new Float:vl;
get_state(PART:"efl.swallow.content", st, 30, vl);
if (!strcmp(st, "visible"))
set_state(PART:"efl.swallow.content", "icononly", 0.0);
set_state(PART:"efl.text", "default", 0.0);
}
}
program { "icon_show";
signal: "efl,state,icon,visible";
source: "efl";
script {
new st[31];
new Float:vl;
get_state(PART:"efl.text", st, 30, vl);
if (!strcmp(st, "visible"))
set_state(PART:"efl.swallow.content", "visible", 0.0);
else
set_state(PART:"efl.swallow.content", "icononly", 0.0);
}
}
program { "icon_hide";
signal: "efl,state,icon,hidden";
source: "efl";
action: STATE_SET "default" 0.0;
target: "efl.swallow.content";
}
program { "disable";
signal: "efl,state,disabled";
source: "efl";
action: STATE_SET "disabled" 0.0;
target: "base";
after: "disable_text";
}
program { "disable_text";
script {
new st[31];
new Float:vl;
get_state(PART:"efl.text", st, 30, vl);
if (!strcmp(st, "visible"))
set_state(PART:"efl.text", "disabled_visible", 0.0);
else if (!strcmp(st, "default"))
set_state(PART:"efl.text", "disabled", 0.0);
}
}
program { "enable";
signal: "efl,state,enabled";
source: "efl";
action: STATE_SET "default" 0.0;
target: "base";
after: "enable_text";
}
program { "enable_text";
script {
new st[31];
new Float:vl;
get_state(PART:"efl.text", st, 30, vl);
if (!strcmp(st, "disabled_visible"))
set_state(PART:"efl.text", "visible", 0.0);
else if (!strcmp(st, "disabled"))
set_state(PART:"efl.text", "default", 0.0);
}
}
}
}
}

View File

@ -0,0 +1,84 @@
/*
* edje_cc efl_ui_theme_example.edc efl_ui_theme_example.edj
* gcc -o efl_ui_theme_example_01 efl_ui_theme_example_01.c `pkg-config --cflags --libs elementary`
*/
#define EFL_BETA_API_SUPPORT 1
#define EFL_EO_API_SUPPORT 1
#define EFL_UI_WIDGET_PROTECTED
#include <Elementary.h>
#define EXAMPLE_EDJ_FILE_PATH "./efl_ui_theme_example.edj"
static void
_btn_extension_clicked_cb(void *data EINA_UNUSED, const Efl_Event *event)
{
static Eina_Bool loaded = EINA_TRUE;
Efl_Ui_Theme *default_theme;
default_theme = efl_ui_theme_default_get(efl_ui_theme_class_get());
if (loaded)
{
efl_ui_theme_extension_del(default_theme, EXAMPLE_EDJ_FILE_PATH);
efl_text_set(event->object, "Load extension");
}
else
{
efl_ui_theme_extension_add(default_theme, EXAMPLE_EDJ_FILE_PATH);
efl_text_set(event->object, "Unload extension");
}
loaded = !loaded;
}
EAPI_MAIN void
efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
{
Eo *win, *box;
Efl_Ui_Theme *default_theme;
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
if (!ecore_file_exists(EXAMPLE_EDJ_FILE_PATH))
{
printf("efl_ui_theme_example.edj does not exist!\n"
"Please execute the following command first!\n"
"edje_cc efl_ui_theme_example.edc efl_ui_theme_example.edj\n");
efl_exit(0);
}
default_theme = efl_ui_theme_default_get(efl_ui_theme_class_get());
efl_ui_theme_extension_add(default_theme, EXAMPLE_EDJ_FILE_PATH);
win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
efl_text_set(efl_added, "Efl.Ui.Theme example"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE)
);
box = efl_add(EFL_UI_BOX_CLASS, win,
efl_content_set(win, efl_added));
efl_add(EFL_UI_BUTTON_CLASS, box,
efl_text_set(efl_added, "Unload extension"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_extension_clicked_cb, NULL),
efl_pack_end(box, efl_added));
efl_add(EFL_UI_BUTTON_CLASS, box,
efl_ui_widget_style_set(efl_added, "custom"),
efl_text_set(efl_added, "custom style"),
efl_pack_end(box, efl_added));
efl_add(EFL_UI_BUTTON_CLASS, box,
efl_text_set(efl_added, "default style"),
efl_pack_end(box, efl_added));
efl_add(EFL_UI_BUTTON_CLASS, box,
efl_ui_widget_style_set(efl_added, "anchor"),
efl_text_set(efl_added, "anchor style"),
efl_pack_end(box, efl_added));
efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 320));
}
EFL_MAIN()

View File

@ -0,0 +1,84 @@
/*
* edje_cc efl_ui_theme_example.edc efl_ui_theme_example.edj
* gcc -o efl_ui_theme_example_02 efl_ui_theme_example_02.c `pkg-config --cflags --libs elementary`
*/
#define EFL_BETA_API_SUPPORT 1
#define EFL_EO_API_SUPPORT 1
#define EFL_UI_WIDGET_PROTECTED
#include <Elementary.h>
#define EXAMPLE_EDJ_FILE_PATH "./efl_ui_theme_example.edj"
static void
_btn_overlay_clicked_cb(void *data EINA_UNUSED, const Efl_Event *event)
{
static Eina_Bool loaded = EINA_TRUE;
Efl_Ui_Theme *default_theme;
default_theme = efl_ui_theme_default_get(efl_ui_theme_class_get());
if (loaded)
{
efl_ui_theme_overlay_del(default_theme, EXAMPLE_EDJ_FILE_PATH);
efl_text_set(event->object, "Load overlay");
}
else
{
efl_ui_theme_overlay_add(default_theme, EXAMPLE_EDJ_FILE_PATH);
efl_text_set(event->object, "Unload overlay");
}
loaded = !loaded;
}
EAPI_MAIN void
efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
{
Eo *win, *box;
Efl_Ui_Theme *default_theme;
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
if (!ecore_file_exists(EXAMPLE_EDJ_FILE_PATH))
{
printf("efl_ui_theme_example.edj does not exist!\n"
"Please execute the following command first!\n"
"edje_cc efl_ui_theme_example.edc efl_ui_theme_example.edj\n");
efl_exit(0);
}
default_theme = efl_ui_theme_default_get(efl_ui_theme_class_get());
efl_ui_theme_overlay_add(default_theme, EXAMPLE_EDJ_FILE_PATH);
win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
efl_text_set(efl_added, "Efl.Ui.Theme example"),
efl_ui_win_autodel_set(efl_added, EINA_TRUE)
);
box = efl_add(EFL_UI_BOX_CLASS, win,
efl_content_set(win, efl_added));
efl_add(EFL_UI_BUTTON_CLASS, box,
efl_text_set(efl_added, "Unload overlay"),
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_overlay_clicked_cb, NULL),
efl_pack_end(box, efl_added));
efl_add(EFL_UI_BUTTON_CLASS, box,
efl_ui_widget_style_set(efl_added, "custom"),
efl_text_set(efl_added, "custom style"),
efl_pack_end(box, efl_added));
efl_add(EFL_UI_BUTTON_CLASS, box,
efl_text_set(efl_added, "default style"),
efl_pack_end(box, efl_added));
efl_add(EFL_UI_BUTTON_CLASS, box,
efl_ui_widget_style_set(efl_added, "anchor"),
efl_text_set(efl_added, "anchor style"),
efl_pack_end(box, efl_added));
efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 320));
}
EFL_MAIN()

View File

@ -171,6 +171,7 @@ typedef Eo Efl_Ui_Focus_Manager;
# include <efl_access_selection.eo.h>
# include <efl_access_value.eo.h>
# include <efl_ui_theme.eo.h>
# include <efl_config_global.eo.h>
# include <efl_ui_widget_part.eo.h>
# include <efl_ui_layout_part.eo.h>

View File

@ -281,6 +281,7 @@ typedef Eo Efl_Ui_Focus_Manager;
#ifdef EFL_EO_API_SUPPORT
# include <efl_selection_types.eot.h>
# include <efl_ui_theme.eo.h>
# include <efl_config_global.eo.h>
# include <efl_ui_widget.eo.h>
# include <efl_ui_widget_part.eo.h>

View File

@ -1,9 +1,9 @@
/* Efl.Ui enum and struct types */
enum Efl.Ui.Theme.Apply
enum Efl.Ui.Theme_Apply_Result
{
[[Return error code when setting the style on a widget.]]
failed = 0, [[Failed to apply theme. The widget may become unusable.]]
fail = 0, [[Failed to apply theme. The widget may become unusable.]]
default = 1, [[Successfully applied the default style. The widget may
look different from the rest of the UI if a custom theme
is in use, but it should be usable.]]

View File

@ -442,13 +442,13 @@ _icon_signal_emit(Evas_Object *obj)
/* FIXME: replicated from elm_layout just because button's icon spot
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
* can changed the theme API */
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_efl_ui_button_legacy_efl_ui_widget_theme_apply(Eo *obj, void *_pd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_BUTTON_LEGACY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
_icon_signal_emit(obj);
return int_ret;

View File

@ -510,13 +510,13 @@ _spinner_buttons_add(Evas_Object *obj, Efl_Ui_Calendar_Data *sd)
}
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_efl_ui_calendar_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Calendar_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
_spinner_buttons_add(obj, sd);

View File

@ -135,16 +135,16 @@ _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
return EINA_TRUE;
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_efl_ui_check_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Check_Data *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL);
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
if (elm_widget_is_legacy(obj))
{
@ -492,13 +492,13 @@ _icon_signal_emit(Evas_Object *obj)
/* FIXME: replicated from elm_layout just because check's icon spot
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
* can changed the theme API */
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_efl_ui_check_legacy_efl_ui_widget_theme_apply(Eo *obj, void *_pd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_CHECK_LEGACY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
_icon_signal_emit(obj);

View File

@ -531,10 +531,10 @@ _efl_ui_clock_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Clock_Data *sd)
evas_object_size_hint_max_set(obj, -1, -1);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_efl_ui_clock_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Clock_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
Clock_Field *field;
char buf[BUFFER_SIZE];
@ -544,7 +544,7 @@ _efl_ui_clock_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Clock_Data *sd)
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
dt_mod = _dt_mod_init();
if ((!dt_mod) || (!dt_mod->field_value_display)) return EINA_TRUE;

View File

@ -97,12 +97,12 @@ _sizing_eval(Evas_Object *obj)
evas_object_size_hint_max_set(obj, maxw, maxh);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_efl_ui_flip_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Flip_Data *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
_sizing_eval(obj);

View File

@ -717,16 +717,16 @@ _efl_ui_image_efl_canvas_object_clip_set(Eo *obj, Efl_Ui_Image_Data *sd, Evas_Ob
if (sd->prev_img) evas_object_clip_set(sd->prev_img, clip);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_efl_ui_image_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Image_Data *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
if (sd->stdicon)
_elm_theme_object_icon_set(obj, sd->stdicon, elm_widget_style_get(obj));
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
_efl_ui_image_sizing_eval(obj);

View File

@ -923,17 +923,17 @@ _efl_ui_image_zoomable_efl_ui_focus_object_on_focus_update(Eo *obj, Efl_Ui_Image
return EINA_TRUE;
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_efl_ui_image_zoomable_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
Eina_Bool fdo = EINA_FALSE;
if (sd->stdicon)
_internal_efl_ui_image_zoomable_icon_set(obj, sd->stdicon, &fdo, EINA_TRUE);
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
efl_ui_mirrored_set(sd->smanager, efl_ui_mirrored_get(obj));

View File

@ -441,12 +441,12 @@ _efl_ui_layout_efl_ui_widget_on_disabled_update(Eo *obj, Efl_Ui_Layout_Data *_pd
return EINA_TRUE;
}
static Efl_Ui_Theme_Apply
static Efl_Ui_Theme_Apply_Result
_efl_ui_layout_theme_internal(Eo *obj, Efl_Ui_Layout_Data *sd)
{
Efl_Ui_Theme_Apply ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL);
/* function already prints error messages, if any */
if (!sd->file_set)
@ -462,21 +462,21 @@ _efl_ui_layout_theme_internal(Eo *obj, Efl_Ui_Layout_Data *sd)
efl_event_callback_legacy_call(obj, EFL_UI_LAYOUT_EVENT_THEME_CHANGED, NULL);
if (!_visuals_refresh(obj, sd))
ret = EFL_UI_THEME_APPLY_FAILED;
ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
return ret;
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_efl_ui_layout_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Layout_Data *sd)
{
Efl_Ui_Theme_Apply theme_apply = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result theme_apply_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
theme_apply = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!theme_apply) return EFL_UI_THEME_APPLY_FAILED;
theme_apply_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!theme_apply_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
theme_apply &= _efl_ui_layout_theme_internal(obj, sd);
return theme_apply;
theme_apply_ret &= _efl_ui_layout_theme_internal(obj, sd);
return theme_apply_ret;
}
EOLIAN static Eina_Bool
@ -904,7 +904,7 @@ _efl_ui_layout_efl_file_mmap_get(const Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUS
efl_file_mmap_get(wd->resize_obj, file, group);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_efl_ui_layout_theme_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *klass, const char *group, const char *style)
{
Eina_Bool changed = EINA_FALSE;
@ -912,7 +912,7 @@ _efl_ui_layout_theme_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *klass, con
if (!elm_widget_is_legacy(obj) && efl_finalized_get(obj))
{
ERR("Efl.Ui.Layout_theme can only be set before finalize!");
return EFL_UI_THEME_APPLY_FAILED;
return EFL_UI_THEME_APPLY_RESULT_FAIL;
}
if (sd->file_set) sd->file_set = EINA_FALSE;
@ -923,7 +923,7 @@ _efl_ui_layout_theme_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *klass, con
if (changed)
return efl_ui_widget_theme_apply(obj);
return EFL_UI_THEME_APPLY_SUCCESS;
return EFL_UI_THEME_APPLY_RESULT_SUCCESS;
}
EOLIAN static void
@ -2786,10 +2786,10 @@ elm_layout_data_get(const Evas_Object *obj, const char *key)
EAPI Eina_Bool
elm_layout_theme_set(Evas_Object *obj, const char *klass, const char *group, const char *style)
{
Efl_Ui_Theme_Apply ta;
Efl_Ui_Theme_Apply_Result theme_apply_ret;
ta = efl_ui_layout_theme_set(obj, klass, group, style);
return (ta != EFL_UI_THEME_APPLY_FAILED);
theme_apply_ret = efl_ui_layout_theme_set(obj, klass, group, style);
return (theme_apply_ret != EFL_UI_THEME_APPLY_RESULT_FAIL);
}
#include "efl_ui_layout_legacy.eo.c"

View File

@ -27,9 +27,9 @@ class Efl.Ui.Layout (Efl.Ui.Widget, Efl.Part, Efl.Container, Efl.File,
If this returns $false the widget is very likely to become
non-functioning.
]]
return: Efl.Ui.Theme.Apply(0);
return: Efl.Ui.Theme_Apply_Result(0);
[[Whether the style was successfully applied or not, see
the values of @Efl.Ui.Theme.Apply for more information.]]
the values of @Efl.Ui.Theme_Apply_Result for more information.]]
}
/*
TODO:

View File

@ -427,8 +427,8 @@ _efl_ui_list_efl_object_finalize(Eo *obj,
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
Efl_Ui_Theme_Apply theme_apply = efl_ui_layout_theme_set(obj, "list", "base", efl_ui_widget_style_get(obj));
if (theme_apply == EFL_UI_THEME_APPLY_FAILED)
Efl_Ui_Theme_Apply_Result theme_apply_ret = efl_ui_layout_theme_set(obj, "list", "base", efl_ui_widget_style_get(obj));
if (theme_apply_ret == EFL_UI_THEME_APPLY_RESULT_FAIL)
CRI("list(%p) failed to set theme [efl/list:%s]!", obj, efl_ui_widget_style_get(obj) ?: "NULL");
pd->smanager = efl_add(EFL_UI_SCROLL_MANAGER_CLASS, obj);
@ -599,12 +599,12 @@ _efl_ui_list_efl_container_content_iterate(Eo *obj EINA_UNUSED, Efl_Ui_List_Data
}
*/
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_efl_ui_list_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_List_Data *pd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
efl_ui_mirrored_set(pd->smanager, efl_ui_mirrored_get(obj));

View File

@ -23,9 +23,9 @@ _efl_ui_list_default_item_efl_object_finalize(Eo *obj, void *pd EINA_UNUSED)
Eo *eo;
eo = efl_finalize(efl_super(obj, MY_CLASS));
ELM_WIDGET_DATA_GET_OR_RETURN(eo, wd, eo);
Efl_Ui_Theme_Apply theme_apply = efl_ui_layout_theme_set(obj, "list_item", NULL, NULL);
Efl_Ui_Theme_Apply_Result theme_apply_ret = efl_ui_layout_theme_set(obj, "list_item", NULL, NULL);
if (theme_apply == EFL_UI_THEME_APPLY_FAILED)
if (theme_apply_ret == EFL_UI_THEME_APPLY_RESULT_FAIL)
CRI("Default Item(%p) failed to set theme [efl/list_item]!", eo);
return eo;
}

View File

@ -21,9 +21,9 @@ _efl_ui_list_empty_item_efl_object_finalize(Eo *obj, void *pd EINA_UNUSED)
Eo *eo;
eo = efl_finalize(efl_super(obj, MY_CLASS));
ELM_WIDGET_DATA_GET_OR_RETURN(eo, wd, eo);
Efl_Ui_Theme_Apply theme_apply = efl_ui_layout_theme_set(obj, "list_item", NULL, "empty");
Efl_Ui_Theme_Apply_Result theme_apply_ret = efl_ui_layout_theme_set(obj, "list_item", NULL, "empty");
if (theme_apply == EFL_UI_THEME_APPLY_FAILED)
if (theme_apply_ret == EFL_UI_THEME_APPLY_RESULT_FAIL)
CRI("Empty Item(%p) failed to set theme [efl/list_item:empty]!", eo);
return eo;
}

View File

@ -116,13 +116,13 @@ _efl_ui_nstate_value_set(Eo *obj, Efl_Ui_Nstate_Data *pd, int state)
_state_active(obj, pd);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_efl_ui_nstate_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Nstate_Data *pd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
_state_signal_emit(obj, pd);

View File

@ -110,14 +110,14 @@ _efl_ui_panes_theme_group_get(Evas_Object *obj, Efl_Ui_Panes_Data *sd)
return eina_strbuf_release(new_group);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_efl_ui_panes_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Panes_Data *sd)
{
double size;
Evas_Coord minw = 0, minh = 0;
char *group;
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
group = _efl_ui_panes_theme_group_get(obj, sd);
if (group)
@ -131,7 +131,7 @@ _efl_ui_panes_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Panes_Data *sd)
evas_object_size_hint_min_set(sd->event, minw, minh);
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
size = elm_panes_content_left_size_get(obj);

View File

@ -231,11 +231,11 @@ _efl_ui_progressbar_theme_group_get(Evas_Object *obj, Efl_Ui_Progressbar_Data *s
return eina_strbuf_release(new_group);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_efl_ui_progressbar_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Progressbar_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL);
char *group;
group = _efl_ui_progressbar_theme_group_get(obj, sd);
@ -246,7 +246,7 @@ _efl_ui_progressbar_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Progressbar_Data *
}
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
if (elm_widget_is_legacy(obj))
{
@ -819,13 +819,13 @@ _icon_signal_emit(Evas_Object *obj)
/* FIXME: replicated from elm_layout just because progressbar's icon spot
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
* can changed the theme API */
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_efl_ui_progressbar_legacy_efl_ui_widget_theme_apply(Eo *obj, void *_pd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_PROGRESSBAR_LEGACY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
_icon_signal_emit(obj);
return int_ret;

View File

@ -147,13 +147,13 @@ _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
return EINA_TRUE;
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_efl_ui_radio_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Radio_Data *sd)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL);
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_CHECK_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
if (elm_widget_is_legacy(obj))
{
@ -414,12 +414,12 @@ _icon_signal_emit(Evas_Object *obj)
elm_layout_sizing_eval(obj);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_efl_ui_radio_legacy_efl_ui_widget_theme_apply(Eo *obj, void *_pd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_RADIO_LEGACY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
/* FIXME: replicated from elm_layout just because radio's icon
* spot is elm.swallow.content, not elm.swallow.icon. Fix that

View File

@ -514,12 +514,12 @@ _efl_ui_scroller_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Scroller_Data *sd)
efl_gfx_size_hint_min_set(obj, size);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_efl_ui_scroller_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Scroller_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
efl_ui_mirrored_set(sd->smanager, efl_ui_mirrored_get(obj));

View File

@ -423,11 +423,11 @@ _efl_ui_slider_theme_group_get(Evas_Object *obj, Efl_Ui_Slider_Data *sd)
return eina_strbuf_release(new_group);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_efl_ui_slider_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Slider_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL);
char *group;
group = _efl_ui_slider_theme_group_get(obj, sd);
@ -438,7 +438,7 @@ _efl_ui_slider_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Slider_Data *sd)
}
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
if (elm_widget_is_legacy(obj))
{

View File

@ -788,10 +788,10 @@ _efl_ui_spin_button_theme_group_get(Evas_Object *obj, Efl_Ui_Spin_Button_Data *s
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_efl_ui_spin_button_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Spin_Button_Data *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
char *group;
group = _efl_ui_spin_button_theme_group_get(obj, sd);
@ -802,7 +802,7 @@ _efl_ui_spin_button_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Spin_Button_Data *
}
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
if (sd->ent)
elm_widget_element_update(obj, sd->ent, PART_NAME_ENTRY);
@ -821,7 +821,7 @@ _efl_ui_spin_button_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Spin_Button_Data *
_label_write(obj);
elm_layout_sizing_eval(obj);
return EFL_UI_THEME_APPLY_SUCCESS;
return EFL_UI_THEME_APPLY_RESULT_SUCCESS;
}
EOLIAN static Eo *

View File

@ -214,7 +214,7 @@ _tab_add(Eo *obj, const char *label, const char *icon)
{
Eo *tab, *icon_obj;
Tab_Info *ti;
Efl_Ui_Theme_Apply theme_apply;
Efl_Ui_Theme_Apply_Result theme_apply;
ti = calloc(1, sizeof(*ti));
@ -239,7 +239,7 @@ _tab_add(Eo *obj, const char *label, const char *icon)
theme_apply = elm_widget_element_update(obj, tab, PART_NAME_TAB);
if (theme_apply == EFL_UI_THEME_APPLY_FAILED)
if (theme_apply == EFL_UI_THEME_APPLY_RESULT_FAIL)
CRI("Failed to set layout!");
efl_layout_signal_callback_add

View File

@ -28,12 +28,12 @@ _mirrored_set(Evas_Object *obj, Eina_Bool rtl)
evas_object_table_mirrored_set(wd->resize_obj, rtl);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_efl_ui_table_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
_mirrored_set(obj, efl_ui_mirrored_get(obj));

View File

@ -719,17 +719,17 @@ _efl_ui_text_efl_ui_widget_on_disabled_update(Eo *obj, Efl_Ui_Text_Data *sd, Ein
/* we can't issue the layout's theming code here, cause it assumes an
* unique edje object, always */
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_efl_ui_text_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Text_Data *sd)
{
Efl_Ui_Theme_Apply theme_apply;
Efl_Ui_Theme_Apply_Result theme_apply;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
// Note: We are skipping elm_layout here! This is by design.
// This assumes the following inheritance: my_class -> layout -> widget ...
theme_apply = efl_ui_widget_theme_apply(efl_cast(obj, EFL_UI_WIDGET_CLASS));
if (!theme_apply) return EFL_UI_THEME_APPLY_FAILED;
if (!theme_apply) return EFL_UI_THEME_APPLY_RESULT_FAIL;
efl_event_freeze(obj);

View File

@ -655,13 +655,13 @@ _efl_ui_textpath_efl_text_text_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textpath_Da
return edje_object_part_text_get(pd->text_obj, "efl.text");
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_efl_ui_textpath_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Textpath_Data *pd)
{
Efl_Ui_Theme_Apply ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!ret) return EFL_UI_THEME_APPLY_FAILED;
if (!ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
elm_widget_theme_object_set(obj, pd->text_obj, "textpath", "base",
elm_widget_style_get(obj));

View File

@ -0,0 +1,71 @@
class Efl.Ui.Theme (Efl.Object)
{
[[Efl Ui Theme class]]
eo_prefix: efl_ui_theme;
data: Efl_Ui_Theme_Data;
methods {
@property default @class {
[[This is the default theme.
All widgets use the default theme implicitly unless a specific theme
is set.
]]
get {
[[Gets the default theme handle.]]
}
values {
theme: Efl.Ui.Theme; [[The default theme handle]]
}
}
extension_add {
[[Appends a theme extension to the list of extensions.
This is intended when an application needs more styles of widgets or new
widget themes that the default does not provide (or may not provide). The
application has "extended" usage by coming up with new custom style names
for widgets for specific uses, but as these are not "standard", they are
not guaranteed to be provided by a default theme. This means the
application is required to provide these extra elements itself in specific
Edje files. This call adds one of those Edje files to the theme search
path to be searched after the default theme. The use of this call is
encouraged when default styles do not meet the needs of the application.
Use this call instead of @.overlay_add for almost all cases.
]]
params {
item: string; [[The Edje file path to be used]]
}
}
extension_del {
[[Deletes a theme extension from the list of extensions.
]]
params {
item: string; [[The Edje file path not to be used]]
}
}
overlay_add {
[[Prepends a theme overlay to the list of overlays.
Use this if your application needs to provide some custom overlay theme
(An Edje file that replaces some default styles of widgets) where adding
new styles, or changing system theme configuration is not possible. Do
NOT use this instead of a proper system theme configuration. Use proper
configuration files, profiles, environment variables etc. to set a theme
so that the theme can be altered by simple configuration by a user. Using
this call to achieve that effect is abusing the API and will create lots
of trouble.
]]
params {
item: string; [[The Edje file path to be used]]
}
}
overlay_del {
[[Delete a theme overlay from the list of overlays.
]]
params {
item: string; [[The Edje file path not to be used]]
}
}
}
implements {
Efl.Object.constructor;
Efl.Object.destructor;
}
}

View File

@ -1290,16 +1290,16 @@ _efl_ui_widget_on_access_update(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd
{
}
EAPI Efl_Ui_Theme_Apply
EAPI Efl_Ui_Theme_Apply_Result
elm_widget_theme(Evas_Object *obj)
{
const Eina_List *l;
Evas_Object *child;
Elm_Tooltip *tt;
Elm_Cursor *cur;
Efl_Ui_Theme_Apply ret = EFL_UI_THEME_APPLY_SUCCESS;
Efl_Ui_Theme_Apply_Result ret = EFL_UI_THEME_APPLY_RESULT_SUCCESS;
API_ENTRY return EFL_UI_THEME_APPLY_FAILED;
API_ENTRY return EFL_UI_THEME_APPLY_RESULT_FAIL;
EINA_LIST_FOREACH(sd->subobjs, l, child)
if (_elm_widget_is(child))
@ -1362,14 +1362,14 @@ elm_widget_theme_specific(Evas_Object *obj,
efl_ui_widget_theme_apply(obj);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_efl_ui_widget_theme_apply(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED)
{
_elm_widget_mirrored_reload(obj);
if (elm_widget_disabled_get(obj))
elm_widget_disabled_internal(obj, elm_widget_disabled_get(obj));
return EFL_UI_THEME_APPLY_SUCCESS;
return EFL_UI_THEME_APPLY_RESULT_SUCCESS;
}
/**
@ -2828,7 +2828,7 @@ elm_widget_theme_set(Evas_Object *obj, Elm_Theme *th)
if (elm_widget_theme_get(obj) != th) apply = EINA_TRUE;
if (sd->theme) elm_theme_free(sd->theme);
sd->theme = th;
if (th) th->ref++;
if (th) efl_ref(th->eo_theme);
if (apply) elm_widget_theme(obj);
}
}
@ -3049,19 +3049,19 @@ elm_widget_theme_get(const Evas_Object *obj)
return sd->theme;
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_efl_ui_widget_style_set(Eo *obj, Elm_Widget_Smart_Data *sd, const char *style)
{
if (!elm_widget_is_legacy(obj) && efl_finalized_get(obj))
{
ERR("Efl.Ui.Widget.style can only be set before finalize!");
return EFL_UI_THEME_APPLY_FAILED;
return EFL_UI_THEME_APPLY_RESULT_FAIL;
}
if (eina_stringshare_replace(&sd->style, style))
return elm_widget_theme(obj);
return EFL_UI_THEME_APPLY_SUCCESS;
return EFL_UI_THEME_APPLY_RESULT_SUCCESS;
}
EOLIAN static const char*
@ -3160,20 +3160,20 @@ elm_widget_scroll_child_locked_y_get(const Eo *obj)
return sd->child_drag_y_locked;
}
EAPI Efl_Ui_Theme_Apply
EAPI Efl_Ui_Theme_Apply_Result
elm_widget_theme_object_set(Evas_Object *obj, Evas_Object *edj, const char *wname, const char *welement, const char *wstyle)
{
Elm_Widget_Smart_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
if (!sd) return EFL_UI_THEME_APPLY_FAILED;
if (!sd) return EFL_UI_THEME_APPLY_RESULT_FAIL;
if (eina_streq(welement, "base"))
welement = NULL;
if (eina_streq(wstyle, "default"))
wstyle = NULL;
Efl_Ui_Theme_Apply ret = _elm_theme_object_set(obj, edj, wname, welement, wstyle);
Efl_Ui_Theme_Apply_Result ret = _elm_theme_object_set(obj, edj, wname, welement, wstyle);
if (!ret)
{
return EFL_UI_THEME_APPLY_FAILED;
return EFL_UI_THEME_APPLY_RESULT_FAIL;
}
if (sd->orient_mode != -1)
@ -3870,10 +3870,10 @@ elm_widget_theme_style_get(const Evas_Object *obj)
* @param name An element name of sub object.
* @return Whether the style was successfully applied or not.
*/
EAPI Efl_Ui_Theme_Apply
EAPI Efl_Ui_Theme_Apply_Result
elm_widget_element_update(Evas_Object *obj, Evas_Object *component, const char *name)
{
Efl_Ui_Theme_Apply ret = EFL_UI_THEME_APPLY_SUCCESS;
Efl_Ui_Theme_Apply_Result ret = EFL_UI_THEME_APPLY_RESULT_SUCCESS;
Eina_Bool changed = EINA_FALSE;
const char *obj_group;
Eina_Stringshare *group;

View File

@ -78,9 +78,9 @@ abstract Efl.Ui.Widget (Efl.Canvas.Group, Efl.Access.Object,
]]
set @protected {
[[Can only be called during construction, before finalize.]]
return: Efl.Ui.Theme.Apply(0);
return: Efl.Ui.Theme_Apply_Result(0);
[[Whether the style was successfully applied or not, see
the values of @Efl.Ui.Theme.Apply for more information.]]
the values of @Efl.Ui.Theme_Apply_Result for more information.]]
}
get {
[[Returns the current style of a widget.]]
@ -310,7 +310,7 @@ abstract Efl.Ui.Widget (Efl.Canvas.Group, Efl.Access.Object,
Note: even widgets not based on layouts may override this method
to handle widget updates (scale, mirrored mode, etc...).
]]
return: Efl.Ui.Theme.Apply; [[Indicates success, and if the current
return: Efl.Ui.Theme_Apply_Result; [[Indicates success, and if the current
theme or default theme was used.]]
}

View File

@ -376,7 +376,7 @@ _elm_win_on_resize_obj_changed_size_hints(void *data,
void *event_info);
static void
_elm_win_img_callbacks_del(Evas_Object *obj, Evas_Object *imgobj);
static Efl_Ui_Theme_Apply _elm_win_theme_internal(Eo *obj, Efl_Ui_Win_Data *sd);
static Efl_Ui_Theme_Apply_Result _elm_win_theme_internal(Eo *obj, Efl_Ui_Win_Data *sd);
static void _elm_win_frame_add(Efl_Ui_Win_Data *sd, const char *element, const char *style);
static void _elm_win_frame_style_update(Efl_Ui_Win_Data *sd, Eina_Bool force_emit, Eina_Bool calc);
static inline void _elm_win_need_frame_adjust(Efl_Ui_Win_Data *sd, const char *engine);
@ -6855,16 +6855,16 @@ _efl_ui_win_efl_ui_widget_focus_highlight_enabled_get(const Eo *obj EINA_UNUSED,
return sd->focus_highlight.enabled;
}
static Efl_Ui_Theme_Apply
static Efl_Ui_Theme_Apply_Result
_elm_win_theme_internal(Eo *obj, Efl_Ui_Win_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
Eina_Bool ret = EINA_FALSE, prev_alpha;
const char *s;
int_ret = elm_widget_theme_object_set(obj, sd->legacy.edje, "win", "base",
elm_widget_style_get(obj));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
edje_object_mirrored_set(sd->legacy.edje, efl_ui_mirrored_get(obj));
edje_object_scale_set(sd->legacy.edje,
@ -6873,7 +6873,7 @@ _elm_win_theme_internal(Eo *obj, Efl_Ui_Win_Data *sd)
efl_event_callback_legacy_call(obj, EFL_UI_WIN_EVENT_THEME_CHANGED, NULL);
ret = efl_ui_widget_on_disabled_update(obj, elm_widget_disabled_get(obj));
if (!ret) int_ret = EFL_UI_THEME_APPLY_FAILED;
if (!ret) int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
prev_alpha = sd->theme_alpha;
s = edje_object_data_get(sd->legacy.edje, "alpha");
@ -6884,17 +6884,17 @@ _elm_win_theme_internal(Eo *obj, Efl_Ui_Win_Data *sd)
return int_ret;
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_efl_ui_win_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Win_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
sd->focus_highlight.theme_changed = EINA_TRUE;
int_ret = _elm_win_theme_internal(obj, sd) & int_ret;
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
_elm_win_focus_highlight_reconfigure_job_start(sd);
return int_ret;

View File

@ -60,15 +60,15 @@ _elm_combobox_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Co
efl_ui_translatable_translation_update(sd->hover);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_combobox_efl_ui_widget_theme_apply(Eo *obj, Elm_Combobox_Data *sd)
{
const char *style;
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
Eina_Bool mirrored;
char buf[128];
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL);
style = eina_stringshare_add(elm_widget_style_get(obj));
@ -78,7 +78,7 @@ _elm_combobox_efl_ui_widget_theme_apply(Eo *obj, Elm_Combobox_Data *sd)
eina_stringshare_replace(&(wd->style), buf);
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
eina_stringshare_replace(&(wd->style), style);

View File

@ -668,13 +668,13 @@ _on_content_resized(void *data,
}
//FIXME: lost the content size when theme hook is called.
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_ctxpopup_efl_ui_widget_theme_apply(Eo *obj, Elm_Ctxpopup_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
elm_widget_theme_object_set
(obj, sd->bg, "ctxpopup", "bg", elm_widget_style_get(obj));

View File

@ -227,16 +227,16 @@ _model_str_property_set(Efl_Model *model, const char *property_name, const char
return efl_model_property_set(model, property_name, eina_value_string_new(property_value));
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_fileselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Fileselector_Data *sd)
{
const char *style;
const char *data;
char buf[1024];
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
style = elm_widget_style_get(obj);
_mirrored_set(obj, efl_ui_mirrored_get(obj));

View File

@ -39,15 +39,15 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
};
#undef ELM_PRIV_FILESELECTOR_BUTTON_SIGNALS
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_fileselector_button_efl_ui_widget_theme_apply(Eo *obj, Elm_Fileselector_Button_Data *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
char buf[4096];
const char *style;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL);
style = eina_stringshare_add(elm_widget_style_get(obj));
@ -57,7 +57,7 @@ _elm_fileselector_button_efl_ui_widget_theme_apply(Eo *obj, Elm_Fileselector_But
eina_stringshare_replace(&(wd->style), buf);
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
eina_stringshare_replace(&(wd->style), style);

View File

@ -128,17 +128,17 @@ _elm_fileselector_entry_elm_layout_sizing_eval(Eo *obj, Elm_Fileselector_Entry_D
evas_object_size_hint_max_set(obj, -1, -1);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_fileselector_entry_efl_ui_widget_theme_apply(Eo *obj, Elm_Fileselector_Entry_Data *sd)
{
const char *style;
char buf[1024];
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL);
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
style = elm_widget_style_get(obj);

View File

@ -63,14 +63,14 @@ _elm_hoversel_efl_ui_translatable_translation_update(Eo *obj EINA_UNUSED, Elm_Ho
efl_ui_translatable_translation_update(efl_super(obj, MY_CLASS));
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_hoversel_efl_ui_widget_theme_apply(Eo *obj, Elm_Hoversel_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
Eina_List *l;
Elm_Object_Item *eo_item;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL);
char buf[4096];
const char *style;
@ -86,7 +86,7 @@ _elm_hoversel_efl_ui_widget_theme_apply(Eo *obj, Elm_Hoversel_Data *sd)
elm_widget_theme_style_set(obj, buf);
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
elm_widget_theme_style_set(obj, style);

View File

@ -91,7 +91,7 @@ _format_count(int count, void *data EINA_UNUSED)
return strdup(buf);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_multibuttonentry_efl_ui_widget_theme_apply(Eo *obj, Elm_Multibuttonentry_Data *sd)
{
const char *str;
@ -100,9 +100,9 @@ _elm_multibuttonentry_efl_ui_widget_theme_apply(Eo *obj, Elm_Multibuttonentry_Da
Elm_Object_Item *eo_item;
double pad_scale;
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
str = elm_layout_data_get(obj, "horizontal_pad");
if (str) hpad = atoi(str);

View File

@ -366,7 +366,7 @@ _item_title_enabled_update(Elm_Naviframe_Item_Data *nit, Eina_Bool transition)
edje_object_message_signal_process(elm_layout_edje_get(VIEW(nit)));
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_naviframe_efl_ui_widget_theme_apply(Eo *obj, Elm_Naviframe_Data *sd)
{
Elm_Naviframe_Item_Data *it;
@ -384,7 +384,7 @@ _elm_naviframe_efl_ui_widget_theme_apply(Eo *obj, Elm_Naviframe_Data *sd)
}
elm_layout_sizing_eval(obj);
return EFL_UI_THEME_APPLY_SUCCESS;
return EFL_UI_THEME_APPLY_RESULT_SUCCESS;
}
static char *

View File

@ -185,12 +185,12 @@ _update_theme_slider(Evas_Object *obj, Evas_Object *sl, const char *name, const
elm_object_disabled_set(sl, elm_widget_disabled_get(obj));
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_player_efl_ui_widget_theme_apply(Eo *obj, Elm_Player_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
_update_theme_button(obj, sd->forward, "forward");
_update_theme_button(obj, sd->info, "info");

View File

@ -365,7 +365,7 @@ _populate_theme_scroll(Elm_Popup_Data *sd)
sd->theme_scroll = EINA_FALSE;
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_popup_efl_ui_widget_theme_apply(Eo *obj, Elm_Popup_Data *sd)
{
Elm_Popup_Item_Data *it;
@ -439,7 +439,7 @@ _elm_popup_efl_ui_widget_theme_apply(Eo *obj, Elm_Popup_Data *sd)
/* access */
if (_elm_config->access_mode) _access_obj_process(obj, EINA_TRUE);
return EFL_UI_THEME_APPLY_SUCCESS;
return EFL_UI_THEME_APPLY_RESULT_SUCCESS;
}
static void

View File

@ -113,18 +113,18 @@ _mirroredness_change_eval(Evas_Object *obj)
(wd->resize_obj, "elm.drag_button_base", 1.0 - pos, 0.5);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_actionslider_efl_ui_widget_theme_apply(Eo *obj, Elm_Actionslider_Data *sd EINA_UNUSED)
{
Eina_Bool mirrored;
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL);
mirrored = elm_object_mirrored_get(obj);
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
if (elm_object_mirrored_get(obj) != mirrored)
_mirroredness_change_eval(obj);

View File

@ -57,15 +57,15 @@ _child_removed_cb_proxy(void *data, const Efl_Event *event)
efl_event_callback_legacy_call(box, ELM_BOX_EVENT_CHILD_REMOVED, child);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_box_efl_ui_widget_theme_apply(Eo *obj, Elm_Box_Data *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL);
evas_object_smart_calculate(wd->resize_obj);
return int_ret;

View File

@ -842,13 +842,13 @@ _spinner_buttons_add(Evas_Object *obj, Elm_Calendar_Data *sd)
}
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_calendar_efl_ui_widget_theme_apply(Eo *obj, Elm_Calendar_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
_spinner_buttons_add(obj, sd);

View File

@ -627,13 +627,13 @@ _time_update(Evas_Object *obj, Eina_Bool theme_update)
sd->cur.ampm = -1;
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_clock_efl_ui_widget_theme_apply(Eo *obj, Elm_Clock_Data *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
_time_update(obj, EINA_TRUE);

View File

@ -2346,15 +2346,15 @@ _elm_code_widget_theme_refresh(Eo *obj, Elm_Code_Widget_Data *pd)
}
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_code_widget_efl_ui_widget_theme_apply(Eo *obj, Elm_Code_Widget_Data *pd)
{
if (!efl_ui_widget_theme_apply(efl_cast(obj, EFL_UI_WIDGET_CLASS)))
return EFL_UI_THEME_APPLY_FAILED;
return EFL_UI_THEME_APPLY_RESULT_FAIL;
_elm_code_widget_theme_refresh(obj, pd);
return EFL_UI_THEME_APPLY_SUCCESS;
return EFL_UI_THEME_APPLY_RESULT_SUCCESS;
}
EOLIAN static int

View File

@ -1317,7 +1317,7 @@ _color_bars_add(Evas_Object *obj)
}
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_colorselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Colorselector_Data *sd)
{
int i;
@ -1328,11 +1328,11 @@ _elm_colorselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Colorselector_Data *sd
unsigned int h_pad = DEFAULT_HOR_PAD;
unsigned int v_pad = DEFAULT_VER_PAD;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL);
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
if ((sd->mode == ELM_COLORSELECTOR_PALETTE) ||
(sd->mode == ELM_COLORSELECTOR_ALL) ||

View File

@ -573,13 +573,13 @@ _on_rotation_changed(void *data, const Efl_Event *event EINA_UNUSED)
}
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_conformant_efl_ui_widget_theme_apply(Eo *obj, Elm_Conformant_Data *_pd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
_conformant_parts_swallow(obj);

View File

@ -123,17 +123,17 @@ _item_location_get(Elm_Dayselector_Data *sd,
ELM_DAYSELECTOR_MAX;
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_dayselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Dayselector_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
Eina_List *l;
char buf[1024];
Elm_Dayselector_Item_Data *it;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
EINA_LIST_FOREACH(sd->items, l, it)
{

View File

@ -811,18 +811,18 @@ _theme_data_get(Evas_Object *obj)
else sd->minh = -1;
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_diskselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Diskselector_Data *sd)
{
Eina_List *l;
Elm_Diskselector_Item_Data *it;
Evas_Object *blank;
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
Evas *evas;
const char *style = elm_widget_style_get(obj);
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
evas = evas_object_evas_get(obj);
evas_event_freeze(evas);

View File

@ -855,22 +855,22 @@ _elm_entry_background_switch(Evas_Object *from_edje, Evas_Object *to_edje)
/* we can't issue the layout's theming code here, cause it assumes an
* unique edje object, always */
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_entry_efl_ui_widget_theme_apply(Eo *obj, Elm_Entry_Data *sd)
{
const char *str;
const char *t;
const char *stl_user;
const char *style = elm_widget_style_get(obj);
Efl_Ui_Theme_Apply theme_apply;
Efl_Ui_Theme_Apply_Result theme_apply;
int cursor_pos;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL);
// Note: We are skipping elm_layout here! This is by design.
// This assumes the following inheritance: my_class -> layout -> widget ...
theme_apply = efl_ui_widget_theme_apply(efl_cast(obj, EFL_UI_WIDGET_CLASS));
if (!theme_apply) return EFL_UI_THEME_APPLY_FAILED;
if (!theme_apply) return EFL_UI_THEME_APPLY_RESULT_FAIL;
evas_event_freeze(evas_object_evas_get(obj));
@ -957,7 +957,7 @@ _elm_entry_efl_ui_widget_theme_apply(Eo *obj, Elm_Entry_Data *sd)
if (sd->scroll)
{
Efl_Ui_Theme_Apply ok = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result ok = EFL_UI_THEME_APPLY_RESULT_FAIL;
efl_ui_mirrored_set(obj, efl_ui_mirrored_get(obj));

View File

@ -350,16 +350,16 @@ _item_new(Evas_Object *obj,
return eo_item;
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_flipselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Flipselector_Data *sd)
{
const char *max_len;
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL);
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
max_len = edje_object_data_get(wd->resize_obj, "max_len");
if (!max_len) sd->max_len = MAX_LEN_DEFAULT;

View File

@ -1154,10 +1154,10 @@ _view_style_update(Elm_Gen_Item *it, Evas_Object *view, const char *style)
ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd);
snprintf(buf, sizeof(buf), "item/%s", style ? style : "default");
Efl_Ui_Theme_Apply th_ret =
Efl_Ui_Theme_Apply_Result th_ret =
elm_widget_theme_object_set(WIDGET(it), view, "gengrid", buf,
elm_widget_style_get(WIDGET(it)));
if (th_ret == EFL_UI_THEME_APPLY_FAILED)
if (th_ret == EFL_UI_THEME_APPLY_RESULT_FAIL)
{
ERR("%s is not a valid gengrid item style. "
"Automatically falls back into default style.",
@ -3574,12 +3574,12 @@ _mirrored_set(Evas_Object *obj,
}
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_gengrid_efl_ui_widget_theme_apply(Eo *obj, Elm_Gengrid_Data *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
_mirrored_set(obj, efl_ui_mirrored_get(obj));

View File

@ -563,10 +563,10 @@ _view_style_update(Elm_Gen_Item *it, Evas_Object *view, const char *style)
"",style ? : "default");
}
Efl_Ui_Theme_Apply th_ret =
Efl_Ui_Theme_Apply_Result th_ret =
elm_widget_theme_object_set(WIDGET(it), view, "genlist", buf,
elm_widget_style_get(WIDGET(it)));
if (th_ret == EFL_UI_THEME_APPLY_FAILED)
if (th_ret == EFL_UI_THEME_APPLY_RESULT_FAIL)
{
ERR("%s is not a valid genlist item style. "
"Automatically falls back into default style.",
@ -3465,17 +3465,17 @@ _mirrored_set(Evas_Object *obj,
efl_ui_mirrored_set(obj, rtl);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_genlist_efl_ui_widget_theme_apply(Eo *obj, Elm_Genlist_Data *sd)
{
Item_Block *itb;
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
Eina_List *l;
Elm_Gen_Item *it;
Evas *e;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
e = evas_object_evas_get(obj);
evas_event_freeze(e);

View File

@ -40,13 +40,13 @@ _mirrored_set(Evas_Object *obj, Eina_Bool rtl)
evas_object_grid_mirrored_set(wd->resize_obj, rtl);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_grid_efl_ui_widget_theme_apply(Eo *obj, void *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
_mirrored_set(obj, efl_ui_mirrored_get(obj));

View File

@ -298,12 +298,12 @@ _hov_show_do(Evas_Object *obj)
}
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_hover_efl_ui_widget_theme_apply(Eo *obj, Elm_Hover_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
if (sd->smt_sub) _elm_hover_smt_sub_re_eval(obj);

View File

@ -363,16 +363,16 @@ _elm_icon_efl_file_file_set(Eo *obj, Elm_Icon_Data *sd, const char *file, const
return EINA_TRUE;
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_icon_efl_ui_widget_theme_apply(Eo *obj, Elm_Icon_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
if (sd->stdicon)
_elm_theme_object_icon_set(obj, sd->stdicon, elm_widget_style_get(obj));
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
return int_ret;
}

View File

@ -432,13 +432,13 @@ _index_priority_change(void *data, Elm_Index_Item_Data *it)
}
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_index_efl_ui_widget_theme_apply(Eo *obj, Elm_Index_Data *sd)
{
Evas_Coord minw = 0, minh = 0;
Elm_Object_Item *eo_item;
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
@ -451,7 +451,7 @@ _elm_index_efl_ui_widget_theme_apply(Eo *obj, Elm_Index_Data *sd)
elm_widget_theme_element_set(obj, "base/vertical");
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
evas_object_size_hint_min_set(sd->event_rect[0], minw, minh);

View File

@ -182,17 +182,17 @@ _elm_label_horizontal_size_policy_update(Eo *obj, Elm_Label_Data *sd)
edje_object_message_signal_process(wd->resize_obj);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_label_efl_ui_widget_theme_apply(Eo *obj, Elm_Label_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL);
evas_event_freeze(evas_object_evas_get(obj));
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
_elm_label_horizontal_size_policy_update(obj, sd);

View File

@ -1118,15 +1118,15 @@ _mirrored_set(Evas_Object *obj,
}
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_list_efl_ui_widget_theme_apply(Eo *obj, Elm_List_Data *sd)
{
Elm_Object_Item *eo_it;
Eina_List *n;
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
_mirrored_set(obj, efl_ui_mirrored_get(obj));

View File

@ -751,6 +751,8 @@ elm_quicklaunch_init(int argc EINA_UNUSED,
EINA_SAFETY_ON_FALSE_GOTO(ecore_file_init(), fail_ecore_file);
_elm_theme_init();
_elm_exit_handler =
ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, _elm_signal_exit, NULL);

View File

@ -3978,13 +3978,13 @@ _elm_map_pan_class_constructor(Efl_Class *klass)
#include "elm_map_pan.eo.c"
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_map_efl_ui_widget_theme_apply(Eo *obj, Elm_Map_Data *sd EINA_UNUSED)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL);
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
elm_widget_theme_object_set

View File

@ -36,12 +36,12 @@ _sizing_eval(Evas_Object *obj)
evas_object_size_hint_max_set(obj, maxw, maxh);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_mapbuf_efl_ui_widget_theme_apply(Eo *obj, Elm_Mapbuf_Data *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
_sizing_eval(obj);

View File

@ -232,10 +232,10 @@ _sizing_eval(Evas_Object *obj)
}
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_menu_efl_ui_widget_theme_apply(Eo *obj, Elm_Menu_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
Eina_List *l, *_l, *_ll, *ll = NULL;
Elm_Object_Item *eo_item;
@ -243,7 +243,7 @@ _elm_menu_efl_ui_widget_theme_apply(Eo *obj, Elm_Menu_Data *sd)
char style[1024];
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
if (sd->menu_bar)
snprintf(style, sizeof(style), "main_menu/%s", elm_widget_style_get(obj));

View File

@ -20,7 +20,7 @@
#define MY_CLASS_NAME "Elm_Notify"
#define MY_CLASS_NAME_LEGACY "elm_notify"
static Efl_Ui_Theme_Apply
static Efl_Ui_Theme_Apply_Result
_notify_theme_apply(Evas_Object *obj)
{
const char *style = elm_widget_style_get(obj);
@ -141,12 +141,12 @@ _sizing_eval(Evas_Object *obj)
evas_object_resize(obj, w, h);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_notify_efl_ui_widget_theme_apply(Eo *obj, Elm_Notify_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
_mirrored_set(obj, efl_ui_mirrored_get(obj));

View File

@ -216,18 +216,18 @@ _scrollable_layout_theme_set(Eo *obj, Elm_Panel_Data *sd)
_access_obj_process(obj, EINA_TRUE);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_panel_efl_ui_widget_theme_apply(Eo *obj, Elm_Panel_Data *sd)
{
const char *str;
Evas_Coord minw = 0, minh = 0;
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL);
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
_mirrored_set(obj, efl_ui_mirrored_get(obj));

View File

@ -49,14 +49,14 @@ _sizing_eval(Evas_Object *obj)
evas_object_size_hint_max_set(obj, maxw, maxh);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_photo_efl_ui_widget_theme_apply(Eo *obj, Elm_Photo_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
edje_object_mirrored_set
(wd->resize_obj, efl_ui_mirrored_get(obj));

View File

@ -80,12 +80,12 @@ _elm_plug_efl_ui_focus_object_on_focus_update(Eo *obj, void *sd EINA_UNUSED)
return EINA_TRUE;
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_plug_efl_ui_widget_theme_apply(Eo *obj, void *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
_sizing_eval(obj);

View File

@ -108,6 +108,7 @@ typedef struct _Elm_Config_Bindings_Widget Elm_Config_Bindings_Widget;
typedef struct _Elm_Config_Binding_Key Elm_Config_Binding_Key;
typedef struct _Elm_Config_Binding_Modifier Elm_Config_Binding_Modifier;
typedef struct _Elm_Module Elm_Module;
typedef struct _Efl_Ui_Theme_Data Efl_Ui_Theme_Data;
struct _Edje_Signal_Data
{
@ -142,13 +143,19 @@ struct _Elm_Theme
Elm_Theme *ref_theme;
Eina_List *referrers;
const char *theme;
int ref;
Eina_Hash *cache_style_load_failed;
/* these only exist to preserve compat with bad elm_theme_XYZ_list_get() api */
Eina_List *overlay_items;
Eina_List *theme_items;
Eina_List *extension_items;
Efl_Ui_Theme *eo_theme; //for accessing through the Eo interface
};
struct _Efl_Ui_Theme_Data
{
Elm_Theme *th;
};
/* increment this whenever we change config enough that you need new
@ -568,7 +575,7 @@ void _elm_win_standard_init(Eo *win);
Ecore_X_Window _elm_ee_xwin_get(const Ecore_Evas *ee);
Efl_Ui_Theme_Apply _elm_theme_object_set(Evas_Object *parent,
Efl_Ui_Theme_Apply_Result _elm_theme_object_set(Evas_Object *parent,
Evas_Object *o,
const char *clas,
const char *group,
@ -576,7 +583,7 @@ Efl_Ui_Theme_Apply _elm_theme_object_set(Evas_Object *parent,
Eina_Bool _elm_theme_object_icon_set(Evas_Object *o,
const char *group,
const char *style);
Efl_Ui_Theme_Apply _elm_theme_set(Elm_Theme *th,
Efl_Ui_Theme_Apply_Result _elm_theme_set(Elm_Theme *th,
Evas_Object *o,
const char *clas,
const char *group,
@ -590,6 +597,7 @@ Eina_File *_elm_theme_group_file_find(Elm_Theme *th,
const char *group);
void _elm_theme_parse(Elm_Theme *th,
const char *theme);
void _elm_theme_init(void);
void _elm_theme_shutdown(void);
void _elm_module_init(void);

View File

@ -86,12 +86,12 @@ _move_resize_cb(void *data EINA_UNUSED,
_sizing_eval(obj);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_route_efl_ui_widget_theme_apply(Eo *obj, Elm_Route_Data *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
//TODO

View File

@ -388,12 +388,12 @@ _mirrored_set(Evas_Object *obj,
efl_ui_mirrored_set(obj, mirrored);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_scroller_efl_ui_widget_theme_apply(Eo *obj, Elm_Scroller_Data *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
_mirrored_set(obj, efl_ui_mirrored_get(obj));

View File

@ -216,16 +216,16 @@ _update_list(Elm_Segment_Control_Data *sd)
}
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_segment_control_efl_ui_widget_theme_apply(Eo *obj, Elm_Segment_Control_Data *sd)
{
Eina_List *l;
Eina_Bool rtl;
Elm_Object_Item *eo_item;
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
rtl = efl_ui_mirrored_get(obj);

View File

@ -16,10 +16,10 @@
#define MY_CLASS_NAME "Elm_Separator"
#define MY_CLASS_NAME_LEGACY "elm_separator"
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_separator_efl_ui_widget_theme_apply(Eo *obj, Elm_Separator_Data *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
if (sd->horizontal)
elm_widget_theme_element_set(obj, "horizontal");
@ -27,7 +27,7 @@ _elm_separator_efl_ui_widget_theme_apply(Eo *obj, Elm_Separator_Data *sd EINA_UN
elm_widget_theme_element_set(obj, "vertical");
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
return int_ret;
}

View File

@ -804,12 +804,12 @@ _elm_slider_theme_group_get(Evas_Object *obj, Elm_Slider_Data *sd)
return eina_strbuf_release(new_group);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_slider_efl_ui_widget_theme_apply(Eo *obj, Elm_Slider_Data *sd)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd2, EFL_UI_THEME_APPLY_FAILED);
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL);
EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd2, EFL_UI_THEME_APPLY_RESULT_FAIL);
char *group;
group = _elm_slider_theme_group_get(obj, sd);
@ -820,7 +820,7 @@ _elm_slider_efl_ui_widget_theme_apply(Eo *obj, Elm_Slider_Data *sd)
}
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
if (_is_horizontal(sd2->dir))
evas_object_size_hint_min_set

View File

@ -1299,15 +1299,15 @@ _elm_spinner_efl_canvas_group_group_del(Eo *obj, Elm_Spinner_Data *sd)
efl_canvas_group_del(efl_super(obj, MY_CLASS));
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_spinner_efl_ui_widget_theme_apply(Eo *obj, Elm_Spinner_Data *sd)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL);
if (!efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)))
{
CRI("Failed to set layout!");
return EFL_UI_THEME_APPLY_FAILED;
return EFL_UI_THEME_APPLY_RESULT_FAIL;
}
if (edje_object_part_exists(wd->resize_obj, "elm.swallow.dec_button"))
@ -1351,7 +1351,7 @@ _elm_spinner_efl_ui_widget_theme_apply(Eo *obj, Elm_Spinner_Data *sd)
_access_spinner_register(obj, EINA_TRUE);
elm_layout_sizing_eval(obj);
return EFL_UI_THEME_APPLY_SUCCESS;
return EFL_UI_THEME_APPLY_RESULT_SUCCESS;
}
static Eina_Bool _elm_spinner_smart_focus_next_enable = EINA_FALSE;

View File

@ -41,12 +41,12 @@ _mirrored_set(Evas_Object *obj, Eina_Bool rtl)
evas_object_table_mirrored_set(wd->resize_obj, rtl);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_table_efl_ui_widget_theme_apply(Eo *obj, void *sd EINA_UNUSED)
{
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
_mirrored_set(obj, efl_ui_mirrored_get(obj));

View File

@ -7,12 +7,9 @@
#include "elm_priv.h"
#include "elm_icon.eo.h"
static Elm_Theme theme_default =
{
NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, 1, NULL,
NULL, NULL, NULL
};
#include "efl_ui_theme.eo.h"
static Elm_Theme *theme_default = NULL;
static Eina_List *themes = NULL;
@ -198,6 +195,8 @@ _elm_theme_file_clean(Eina_Inlist **files)
static void
_elm_theme_clear(Elm_Theme *th)
{
Efl_Ui_Theme_Data *td;
_elm_theme_file_clean(&th->themes);
_elm_theme_file_clean(&th->overlay);
_elm_theme_file_clean(&th->extension);
@ -217,6 +216,10 @@ _elm_theme_clear(Elm_Theme *th)
elm_theme_free(th->ref_theme);
th->ref_theme = NULL;
}
td = efl_data_scope_get(th->eo_theme, EFL_UI_THEME_CLASS);
td->th = NULL;
th->eo_theme = NULL;
}
static Eina_File *
@ -299,7 +302,7 @@ _elm_theme_data_find(Elm_Theme *th, const char *key)
return NULL;
}
Efl_Ui_Theme_Apply
Efl_Ui_Theme_Apply_Result
_elm_theme_object_set(Evas_Object *parent, Evas_Object *o, const char *clas, const char *group, const char *style)
{
Elm_Theme *th = NULL;
@ -320,7 +323,7 @@ _elm_theme_object_icon_set(Evas_Object *o,
return _elm_theme_icon_set(th, o, group, style);
}
Efl_Ui_Theme_Apply
Efl_Ui_Theme_Apply_Result
_elm_theme_set(Elm_Theme *th, Evas_Object *o, const char *clas, const char *group, const char *style, Eina_Bool is_legacy)
{
Eina_File *file;
@ -328,8 +331,9 @@ _elm_theme_set(Elm_Theme *th, Evas_Object *o, const char *clas, const char *grou
const char *group_sep = "/";
const char *style_sep = ":";
if ((!clas) || !o) return EFL_UI_THEME_APPLY_FAILED;
if (!th) th = &(theme_default);
if ((!clas) || !o) return EFL_UI_THEME_APPLY_RESULT_FAIL;
if (!th) th = theme_default;
if (!th) return EFL_UI_THEME_APPLY_RESULT_FAIL;
if (eina_streq(style, "default")) style = NULL;
@ -344,7 +348,7 @@ _elm_theme_set(Elm_Theme *th, Evas_Object *o, const char *clas, const char *grou
file = _elm_theme_group_file_find(th, buf2);
if (file)
{
if (edje_object_mmap_set(o, file, buf2)) return EFL_UI_THEME_APPLY_SUCCESS;
if (edje_object_mmap_set(o, file, buf2)) return EFL_UI_THEME_APPLY_RESULT_SUCCESS;
else
{
ERR("could not set theme group '%s' from file '%s': %s",
@ -358,10 +362,10 @@ _elm_theme_set(Elm_Theme *th, Evas_Object *o, const char *clas, const char *grou
}
if (!style)
return EFL_UI_THEME_APPLY_FAILED;
return EFL_UI_THEME_APPLY_RESULT_FAIL;
// Use the elementary default style.
return (EFL_UI_THEME_APPLY_DEFAULT &
return (EFL_UI_THEME_APPLY_RESULT_DEFAULT &
_elm_theme_set(th, o, clas, group, NULL, is_legacy));
}
@ -382,7 +386,9 @@ _elm_theme_icon_set(Elm_Theme *th,
return EINA_TRUE;
}
if (!th) th = &(theme_default);
if (!th) th = theme_default;
if (!th) return EINA_FALSE;
snprintf(buf2, sizeof(buf2), "elm/icon/%s/%s", group, style);
file = _elm_theme_group_file_find(th, buf2);
if (file)
@ -408,7 +414,9 @@ _elm_theme_parse(Elm_Theme *th, const char *theme)
Eina_List *names = NULL;
const char *p, *pe;
if (!th) th = &(theme_default);
if (!th) th = theme_default;
if (!th) return;
if (theme)
{
Eina_Strbuf *buf;
@ -478,40 +486,53 @@ _elm_theme_parse(Elm_Theme *th, const char *theme)
elm_theme_get(th);
}
void
_elm_theme_init(void)
{
Eo *theme_default_obj;
Efl_Ui_Theme_Data *td;
if (theme_default) return;
theme_default_obj = efl_add(EFL_UI_THEME_CLASS, efl_main_loop_get());
td = efl_data_scope_get(theme_default_obj, EFL_UI_THEME_CLASS);
theme_default = td->th;
}
void
_elm_theme_shutdown(void)
{
Elm_Theme *th;
_elm_theme_clear(&(theme_default));
EINA_LIST_FREE(themes, th)
while (themes)
{
_elm_theme_clear(th);
free(th);
th = eina_list_data_get(themes);
/* In theme object destructor, theme is deallocated and the theme is
* removed from themes list in _elm_theme_free_internal().
* Consequently, themes list is updated.
*/
efl_del(th->eo_theme);
}
}
EAPI Elm_Theme *
elm_theme_new(void)
{
Elm_Theme *th = calloc(1, sizeof(Elm_Theme));
if (!th) return NULL;
th->ref = 1;
_elm_theme_file_item_add(&th->themes, "default", EINA_FALSE, EINA_TRUE);
themes = eina_list_append(themes, th);
return th;
Eo *obj = efl_add(EFL_UI_THEME_CLASS, efl_main_loop_get());
Efl_Ui_Theme_Data *td = efl_data_scope_get(obj, EFL_UI_THEME_CLASS);
return td->th;
}
EAPI void
elm_theme_free(Elm_Theme *th)
{
EINA_SAFETY_ON_NULL_RETURN(th);
th->ref--;
if (th->ref < 1)
{
_elm_theme_clear(th);
themes = eina_list_remove(themes, th);
free(th);
}
/* Destructs theme object and theme is deallocated in
* _elm_theme_free_internal() in theme object desctructor.
*/
efl_unref(th->eo_theme);
}
static void
@ -531,15 +552,27 @@ elm_theme_files_copy(Eina_Inlist **dst, Eina_Inlist **src)
EAPI void
elm_theme_copy(Elm_Theme *th, Elm_Theme *thdst)
{
if (!th) th = &(theme_default);
if (!thdst) thdst = &(theme_default);
Eo *thdst_obj;
Efl_Ui_Theme_Data *thdst_td;
if (!th) th = theme_default;
if (!th) return;
if (!thdst) thdst = theme_default;
if (!thdst) return;
//Clear the given theme and restore the relationship with theme object.
thdst_obj = thdst->eo_theme;
_elm_theme_clear(thdst);
thdst->eo_theme = thdst_obj;
thdst_td = efl_data_scope_get(thdst_obj, EFL_UI_THEME_CLASS);
thdst_td->th = thdst;
if (th->ref_theme)
{
thdst->ref_theme = th->ref_theme;
thdst->ref_theme->referrers =
eina_list_append(thdst->ref_theme->referrers, thdst);
thdst->ref_theme->ref++;
efl_ref(thdst->ref_theme->eo_theme);
}
elm_theme_files_copy(&thdst->overlay, &th->overlay);
elm_theme_files_copy(&thdst->themes, &th->themes);
@ -552,14 +585,26 @@ elm_theme_copy(Elm_Theme *th, Elm_Theme *thdst)
EAPI void
elm_theme_ref_set(Elm_Theme *th, Elm_Theme *thref)
{
if (!th) th = &(theme_default);
if (!thref) thref = &(theme_default);
Eo *th_obj;
Efl_Ui_Theme_Data *th_td;
if (!th) th = theme_default;
if (!th) return;
if (!thref) thref = theme_default;
if (!thref) return;
if (th->ref_theme == thref) return;
//Clear the given theme and restore the relationship with theme object.
th_obj = th->eo_theme;
_elm_theme_clear(th);
th->eo_theme = th_obj;
th_td = efl_data_scope_get(th_obj, EFL_UI_THEME_CLASS);
th_td->th = th;
if (thref)
{
thref->referrers = eina_list_append(thref->referrers, th);
thref->ref++;
efl_ref(thref->eo_theme);
}
th->ref_theme = thref;
elm_theme_flush(th);
@ -568,34 +613,31 @@ elm_theme_ref_set(Elm_Theme *th, Elm_Theme *thref)
EAPI Elm_Theme *
elm_theme_ref_get(const Elm_Theme *th)
{
if (!th) th = &(theme_default);
if (!th) th = theme_default;
if (!th) return NULL;
return th->ref_theme;
}
EAPI Elm_Theme *
elm_theme_default_get(void)
{
return &theme_default;
return theme_default;
}
EAPI void
elm_theme_overlay_add(Elm_Theme *th, const char *item)
{
if (!item) return;
if (!th) th = &(theme_default);
th->overlay_items = eina_list_free(th->overlay_items);
_elm_theme_file_item_add(&th->overlay, item, EINA_TRUE, EINA_FALSE);
elm_theme_flush(th);
if (!th) th = theme_default;
if (!th) return;
efl_ui_theme_overlay_add(th->eo_theme, item);
}
EAPI void
elm_theme_overlay_del(Elm_Theme *th, const char *item)
{
if (!item) return;
if (!th) th = &(theme_default);
th->overlay_items = eina_list_free(th->overlay_items);
_elm_theme_file_item_del(&th->overlay, item);
elm_theme_flush(th);
if (!th) th = theme_default;
if (!th) return;
efl_ui_theme_overlay_del(th->eo_theme, item);
}
EAPI void
@ -603,7 +645,8 @@ elm_theme_overlay_mmap_add(Elm_Theme *th, const Eina_File *f)
{
Eina_File *file = eina_file_dup(f);
if (!th) th = &(theme_default);
if (!th) th = theme_default;
if (!th) return;
th->overlay_items = eina_list_free(th->overlay_items);
_elm_theme_item_finalize(&th->overlay, eina_file_filename_get(file), file, EINA_TRUE, EINA_FALSE);
elm_theme_flush(th);
@ -613,7 +656,8 @@ EAPI void
elm_theme_overlay_mmap_del(Elm_Theme *th, const Eina_File *f)
{
if (!f) return;
if (!th) th = &(theme_default);
if (!th) th = theme_default;
if (!th) return;
th->overlay_items = eina_list_free(th->overlay_items);
_elm_theme_file_mmap_del(&th->overlay, f);
elm_theme_flush(th);
@ -622,7 +666,8 @@ elm_theme_overlay_mmap_del(Elm_Theme *th, const Eina_File *f)
EAPI const Eina_List *
elm_theme_overlay_list_get(const Elm_Theme *th)
{
if (!th) th = &(theme_default);
if (!th) th = theme_default;
if (!th) return NULL;
if (!th->overlay_items)
{
Elm_Theme_File *etf;
@ -636,21 +681,17 @@ elm_theme_overlay_list_get(const Elm_Theme *th)
EAPI void
elm_theme_extension_add(Elm_Theme *th, const char *item)
{
if (!item) return;
if (!th) th = &(theme_default);
th->extension_items = eina_list_free(th->extension_items);
_elm_theme_file_item_add(&th->extension, item, EINA_FALSE, EINA_FALSE);
elm_theme_flush(th);
if (!th) th = theme_default;
if (!th) return;
efl_ui_theme_extension_add(th->eo_theme, item);
}
EAPI void
elm_theme_extension_del(Elm_Theme *th, const char *item)
{
if (!item) return;
if (!th) th = &(theme_default);
th->extension_items = eina_list_free(th->extension_items);
_elm_theme_file_item_del(&th->extension, item);
elm_theme_flush(th);
if (!th) th = theme_default;
if (!th) return;
efl_ui_theme_extension_del(th->eo_theme, item);
}
EAPI void
@ -659,7 +700,8 @@ elm_theme_extension_mmap_add(Elm_Theme *th, const Eina_File *f)
Eina_File *file = eina_file_dup(f);
if (!f) return;
if (!th) th = &(theme_default);
if (!th) th = theme_default;
if (!th) return;
th->extension_items = eina_list_free(th->extension_items);
_elm_theme_item_finalize(&th->extension, eina_file_filename_get(file), file, EINA_FALSE, EINA_FALSE);
elm_theme_flush(th);
@ -669,7 +711,8 @@ EAPI void
elm_theme_extension_mmap_del(Elm_Theme *th, const Eina_File *f)
{
if (!f) return;
if (!th) th = &(theme_default);
if (!th) th = theme_default;
if (!th) return;
th->extension_items = eina_list_free(th->extension_items);
_elm_theme_file_mmap_del(&th->extension, f);
elm_theme_flush(th);
@ -678,7 +721,8 @@ elm_theme_extension_mmap_del(Elm_Theme *th, const Eina_File *f)
EAPI const Eina_List *
elm_theme_extension_list_get(const Elm_Theme *th)
{
if (!th) th = &(theme_default);
if (!th) th = theme_default;
if (!th) return NULL;
if (!th->extension_items)
{
Elm_Theme_File *etf;
@ -692,18 +736,20 @@ elm_theme_extension_list_get(const Elm_Theme *th)
EAPI void
elm_theme_set(Elm_Theme *th, const char *theme)
{
if (!th) th = &(theme_default);
if (!th) th = theme_default;
if (!th) return;
_elm_theme_parse(th, theme);
ELM_SAFE_FREE(th->theme, eina_stringshare_del);
elm_theme_flush(th);
if (th == &(theme_default))
if (th == theme_default)
eina_stringshare_replace(&_elm_config->theme, theme);
}
EAPI const char *
elm_theme_get(Elm_Theme *th)
{
if (!th) th = &(theme_default);
if (!th) th = theme_default;
if (!th) return NULL;
if (!th->theme)
{
Eina_Strbuf *buf;
@ -734,7 +780,8 @@ elm_theme_get(Elm_Theme *th)
EAPI const Eina_List *
elm_theme_list_get(const Elm_Theme *th)
{
if (!th) th = &(theme_default);
if (!th) th = theme_default;
if (!th) return NULL;
if (!th->theme_items)
{
Elm_Theme_File *etf;
@ -797,7 +844,8 @@ elm_theme_list_item_path_get(const char *f, Eina_Bool *in_search_path)
EAPI void
elm_theme_flush(Elm_Theme *th)
{
if (!th) th = &(theme_default);
if (!th) th = theme_default;
if (!th) return;
if (th->cache) eina_hash_free(th->cache);
th->cache = eina_hash_string_superfast_new(EINA_FREE_CB(eina_file_close));
if (th->cache_data) eina_hash_free(th->cache_data);
@ -825,7 +873,7 @@ elm_theme_full_flush(void)
{
elm_theme_flush(th);
}
elm_theme_flush(&(theme_default));
elm_theme_flush(theme_default);
}
EAPI Eina_List *
@ -917,7 +965,8 @@ elm_object_theme_get(const Evas_Object *obj)
EAPI const char *
elm_theme_data_get(Elm_Theme *th, const char *key)
{
if (!th) th = &(theme_default);
if (!th) th = theme_default;
if (!th) return NULL;
return _elm_theme_data_find(th, key);
}
@ -926,7 +975,8 @@ elm_theme_group_path_find(Elm_Theme *th, const char *group)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(group, NULL);
Eina_File *th_file = NULL;
if (!th) th = &(theme_default);
if (!th) th = theme_default;
if (!th) return NULL;
th_file = _elm_theme_group_file_find(th, group);
if (th_file)
@ -975,7 +1025,8 @@ elm_theme_group_base_list(Elm_Theme *th, const char *base)
int len;
EINA_SAFETY_ON_NULL_RETURN_VAL(base, NULL);
if (!th) th = &(theme_default);
if (!th) th = theme_default;
if (!th) return NULL;
// XXX: look results up in a hash for speed
len = strlen(base);
@ -1022,3 +1073,96 @@ elm_theme_user_dir_get(void)
return path;
}
/* Allocates memory for theme and appends the theme to themes list. */
static Elm_Theme *
_elm_theme_new_internal(Eo *obj)
{
Elm_Theme *th = calloc(1, sizeof(Elm_Theme));
if (!th) return NULL;
_elm_theme_file_item_add(&th->themes, "default", EINA_FALSE, EINA_TRUE);
themes = eina_list_append(themes, th);
th->eo_theme = obj;
return th;
}
EOLIAN static Eo *
_efl_ui_theme_efl_object_constructor(Eo *obj, Efl_Ui_Theme_Data *pd)
{
obj = efl_constructor(efl_super(obj, EFL_UI_THEME_CLASS));
pd->th = _elm_theme_new_internal(obj);
return obj;
}
/* Removes the given theme from themes list and deallocates the given theme. */
static void
_elm_theme_free_internal(Elm_Theme *th)
{
_elm_theme_clear(th);
themes = eina_list_remove(themes, th);
free(th);
}
EOLIAN static void
_efl_ui_theme_efl_object_destructor(Eo *obj, Efl_Ui_Theme_Data *pd)
{
Eina_Bool is_theme_default = EINA_FALSE;
if (pd->th == theme_default)
is_theme_default = EINA_TRUE;
_elm_theme_free_internal(pd->th);
if (is_theme_default) theme_default = NULL;
efl_destructor(efl_super(obj, EFL_UI_THEME_CLASS));
}
EOLIAN static Efl_Ui_Theme *
_efl_ui_theme_default_get(const Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
{
if (theme_default)
return theme_default->eo_theme;
return NULL;
}
EOLIAN static void
_efl_ui_theme_extension_add(Eo *obj EINA_UNUSED, Efl_Ui_Theme_Data *pd, const char *item)
{
if (!item) return;
pd->th->extension_items = eina_list_free(pd->th->extension_items);
_elm_theme_file_item_add(&pd->th->extension, item, EINA_FALSE, EINA_FALSE);
elm_theme_flush(pd->th);
}
EOLIAN static void
_efl_ui_theme_extension_del(Eo *obj EINA_UNUSED, Efl_Ui_Theme_Data *pd, const char *item)
{
if (!item) return;
pd->th->extension_items = eina_list_free(pd->th->extension_items);
_elm_theme_file_item_del(&pd->th->extension, item);
elm_theme_flush(pd->th);
}
EOLIAN static void
_efl_ui_theme_overlay_add(Eo *obj EINA_UNUSED, Efl_Ui_Theme_Data *pd, const char *item)
{
if (!item) return;
pd->th->overlay_items = eina_list_free(pd->th->overlay_items);
_elm_theme_file_item_add(&pd->th->overlay, item, EINA_TRUE, EINA_FALSE);
elm_theme_flush(pd->th);
}
EOLIAN static void
_efl_ui_theme_overlay_del(Eo *obj EINA_UNUSED, Efl_Ui_Theme_Data *pd, const char *item)
{
if (!item) return;
pd->th->overlay_items = eina_list_free(pd->th->overlay_items);
_elm_theme_file_item_del(&pd->th->overlay, item);
elm_theme_flush(pd->th);
}
#include "efl_ui_theme.eo.c"

View File

@ -1478,18 +1478,18 @@ _elm_toolbar_highlight_in_theme(Evas_Object *obj)
elm_widget_highlight_in_theme_set(obj, EINA_FALSE);
}
EOLIAN static Efl_Ui_Theme_Apply
EOLIAN static Efl_Ui_Theme_Apply_Result
_elm_toolbar_efl_ui_widget_theme_apply(Eo *obj, Elm_Toolbar_Data *sd)
{
Elm_Toolbar_Item_Data *it;
double scale = 0;
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_RESULT_FAIL);
if (sd->delete_me) return EFL_UI_THEME_APPLY_SUCCESS;
if (sd->delete_me) return EFL_UI_THEME_APPLY_RESULT_SUCCESS;
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL;
int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL;
elm_widget_theme_object_set
(obj, wd->resize_obj, "toolbar", "base",

View File

@ -642,7 +642,7 @@ struct _Elm_Widget_Item_Data
EAPI Evas_Object *elm_widget_add(Evas_Smart *, Evas_Object *);
EAPI Eina_Bool elm_widget_api_check(int ver);
EAPI Eina_Bool elm_widget_access(Evas_Object *obj, Eina_Bool is_access);
EAPI Efl_Ui_Theme_Apply elm_widget_theme(Evas_Object *obj);
EAPI Efl_Ui_Theme_Apply_Result elm_widget_theme(Evas_Object *obj);
EAPI void elm_widget_theme_specific(Evas_Object *obj, Elm_Theme *th, Eina_Bool force);
EAPI void elm_widget_on_show_region_hook_set(Evas_Object *obj, void *data, Efl_Ui_Scrollable_On_Show_Region func, Eina_Free_Cb data_free);
EAPI Eina_Bool elm_widget_sub_object_parent_add(Evas_Object *sobj);
@ -710,7 +710,7 @@ EAPI void elm_widget_scroll_freeze_pop(Evas_Object *obj);
EAPI int elm_widget_scroll_freeze_get(const Evas_Object *obj);
EAPI void elm_widget_theme_set(Evas_Object *obj, Elm_Theme *th);
EAPI Elm_Theme *elm_widget_theme_get(const Evas_Object *obj);
EAPI Efl_Ui_Theme_Apply elm_widget_style_set(Evas_Object *obj, const char *style);
EAPI Efl_Ui_Theme_Apply_Result elm_widget_style_set(Evas_Object *obj, const char *style);
EAPI const char *elm_widget_style_get(const Evas_Object *obj);
EAPI void elm_widget_type_set(Evas_Object *obj, const char *type);
EAPI const char *elm_widget_type_get(const Evas_Object *obj);
@ -722,7 +722,7 @@ EAPI void elm_widget_scroll_lock_set(Evas_Object *obj, Efl_Ui_Scroll
EAPI Efl_Ui_Scroll_Block elm_widget_scroll_lock_get(const Evas_Object *obj);
EAPI int elm_widget_scroll_child_locked_x_get(const Evas_Object *obj);
EAPI int elm_widget_scroll_child_locked_y_get(const Evas_Object *obj);
EAPI Efl_Ui_Theme_Apply elm_widget_theme_object_set(Evas_Object *obj, Evas_Object *edj, const char *wname, const char *welement, const char *wstyle);
EAPI Efl_Ui_Theme_Apply_Result elm_widget_theme_object_set(Evas_Object *obj, Evas_Object *edj, const char *wname, const char *welement, const char *wstyle);
EAPI Eina_Bool elm_widget_type_check(const Evas_Object *obj, const char *type, const char *func);
EAPI Evas_Object *elm_widget_name_find(const Evas_Object *obj, const char *name, int recurse);
EAPI Eina_List *elm_widget_stringlist_get(const char *str);
@ -751,7 +751,7 @@ EAPI Eina_Bool elm_widget_theme_element_set(Evas_Object *obj, const char
EAPI const char *elm_widget_theme_element_get(const Evas_Object *obj);
EAPI Eina_Bool elm_widget_theme_style_set(Evas_Object *obj, const char *name);
EAPI const char *elm_widget_theme_style_get(const Evas_Object *obj);
EAPI Efl_Ui_Theme_Apply elm_widget_element_update(Evas_Object *obj, Evas_Object *component, const char *name);
EAPI Efl_Ui_Theme_Apply_Result elm_widget_element_update(Evas_Object *obj, Evas_Object *component, const char *name);
/* debug function. don't use it unless you are tracking parenting issues */
EAPI void elm_widget_tree_dump(const Evas_Object *top);

View File

@ -237,6 +237,7 @@ pub_eo_files = [
'efl_access_value.eo',
'efl_access_widget_action.eo',
'efl_access_window.eo',
'efl_ui_theme.eo',
'efl_config_global.eo',
'elm_code_widget.eo',
'efl_selection.eo',