summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_win.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-09-19 20:02:26 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-09-21 12:27:33 +0900
commit0339ad7740b169683990aa8ce0dbf7c9489ab505 (patch)
treeef61ff37735abba8cd0a8c6cb86fb310f5d66d27 /src/lib/elementary/efl_ui_win.c
parent1a854d892f83b6933d3523cf7d188215600df04d (diff)
elm: Move base implementation for efl_part in widget
This means that ALL part handles inherit from the base part class Efl.Ui.Widget.Part. Layout is the only exception where Efl.Part is specially overridden. This is a first step towards generic part APIs, including background in all widgets.
Diffstat (limited to '')
-rw-r--r--src/lib/elementary/efl_ui_win.c71
1 files changed, 41 insertions, 30 deletions
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index d7dab7c39d..3d6abd8483 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -6994,60 +6994,71 @@ _efl_ui_win_part_file_get(Eo *obj, Efl_Ui_Win_Data *sd, const char *part, const
6994 return EINA_FALSE; 6994 return EINA_FALSE;
6995} 6995}
6996 6996
6997/* Efl.Part begin */ 6997/* Default content */
6998 6998
6999static void 6999EOLIAN static Eina_Bool
7000_efl_ui_win_part_efl_gfx_color_set(Eo *obj, Elm_Part_Data *pd, int r, int g, int b, int a) 7000_efl_ui_win_efl_container_content_set(Eo *obj, Efl_Ui_Win_Data *sd, Evas_Object *content)
7001{ 7001{
7002 if (EVAS_COLOR_SANITIZE(r, g, b, a)) 7002 return _efl_ui_win_content_set(obj, sd, "content", content);
7003 ERR("Evas only handles premultiplied colors (0 <= R,G,B <= A <= 255)");
7004
7005 _efl_ui_win_part_color_set(pd->obj, pd->sd, pd->part, r, g, b, a);
7006 ELM_PART_RETURN_VOID;
7007} 7003}
7008 7004
7009static void 7005EOLIAN static Evas_Object*
7010_efl_ui_win_part_efl_gfx_color_get(Eo *obj, Elm_Part_Data *pd, int *r, int *g, int *b, int *a) 7006_efl_ui_win_efl_container_content_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
7011{ 7007{
7012 _efl_ui_win_part_color_get(pd->obj, pd->sd, pd->part, r, g, b, a); 7008 return _efl_ui_win_content_get(obj, sd, "content");
7013 ELM_PART_RETURN_VOID;
7014} 7009}
7015 7010
7016static Eina_Bool 7011EOLIAN static Evas_Object*
7017_efl_ui_win_part_efl_file_file_set(Eo *obj, Elm_Part_Data *pd, const char *file, const char *key) 7012_efl_ui_win_efl_container_content_unset(Eo *obj, Efl_Ui_Win_Data *sd)
7018{ 7013{
7019 ELM_PART_RETURN_VAL(_efl_ui_win_part_file_set(pd->obj, pd->sd, pd->part, file, key)); 7014 return _efl_ui_win_content_unset(obj, sd, "content");
7020} 7015}
7021 7016
7017/* Efl.Part begin */
7018
7022static void 7019static void
7023_efl_ui_win_part_efl_file_file_get(Eo *obj, Elm_Part_Data *pd, const char **file, const char **key) 7020_efl_ui_win_part_efl_gfx_color_set(Eo *obj, void *_pd EINA_UNUSED, int r, int g, int b, int a)
7024{ 7021{
7025 _efl_ui_win_part_file_get(pd->obj, pd->sd, pd->part, file, key); 7022 Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
7023 Efl_Ui_Win_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
7024
7025 if (EVAS_COLOR_SANITIZE(r, g, b, a))
7026 ERR("Evas only handles premultiplied colors (0 <= R,G,B <= A <= 255)");
7027
7028 _efl_ui_win_part_color_set(pd->obj, sd, pd->part, r, g, b, a);
7026 ELM_PART_RETURN_VOID; 7029 ELM_PART_RETURN_VOID;
7027} 7030}
7028 7031
7029EOLIAN static Eina_Bool 7032static void
7030_efl_ui_win_efl_container_content_set(Eo *obj, Efl_Ui_Win_Data *sd, Evas_Object *content) 7033_efl_ui_win_part_efl_gfx_color_get(Eo *obj, void *_pd EINA_UNUSED, int *r, int *g, int *b, int *a)
7031{ 7034{
7032 return _efl_ui_win_content_set(obj, sd, "content", content); 7035 Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
7036 Efl_Ui_Win_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
7037 _efl_ui_win_part_color_get(pd->obj, sd, pd->part, r, g, b, a);
7038 ELM_PART_RETURN_VOID;
7033} 7039}
7034 7040
7035EOLIAN static Evas_Object* 7041static Eina_Bool
7036_efl_ui_win_efl_container_content_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) 7042_efl_ui_win_part_efl_file_file_set(Eo *obj, void *_pd EINA_UNUSED, const char *file, const char *key)
7037{ 7043{
7038 return _efl_ui_win_content_get(obj, sd, "content"); 7044 Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
7045 Efl_Ui_Win_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
7046 ELM_PART_RETURN_VAL(_efl_ui_win_part_file_set(pd->obj, sd, pd->part, file, key));
7039} 7047}
7040 7048
7041EOLIAN static Evas_Object* 7049static void
7042_efl_ui_win_efl_container_content_unset(Eo *obj, Efl_Ui_Win_Data *sd) 7050_efl_ui_win_part_efl_file_file_get(Eo *obj, void *_pd EINA_UNUSED, const char **file, const char **key)
7043{ 7051{
7044 return _efl_ui_win_content_unset(obj, sd, "content"); 7052 Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
7053 Efl_Ui_Win_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
7054 _efl_ui_win_part_file_get(pd->obj, sd, pd->part, file, key);
7055 ELM_PART_RETURN_VOID;
7045} 7056}
7046 7057
7047ELM_PART_IMPLEMENT(efl_ui_win, EFL_UI_WIN, Efl_Ui_Win_Data, Elm_Part_Data) 7058ELM_PART_OVERRIDE(efl_ui_win, EFL_UI_WIN, Efl_Ui_Win_Data)
7048ELM_PART_IMPLEMENT_CONTENT_SET(efl_ui_win, EFL_UI_WIN, Efl_Ui_Win_Data, Elm_Part_Data) 7059ELM_PART_OVERRIDE_CONTENT_SET(efl_ui_win, EFL_UI_WIN, Efl_Ui_Win_Data)
7049ELM_PART_IMPLEMENT_CONTENT_GET(efl_ui_win, EFL_UI_WIN, Efl_Ui_Win_Data, Elm_Part_Data) 7060ELM_PART_OVERRIDE_CONTENT_GET(efl_ui_win, EFL_UI_WIN, Efl_Ui_Win_Data)
7050ELM_PART_IMPLEMENT_CONTENT_UNSET(efl_ui_win, EFL_UI_WIN, Efl_Ui_Win_Data, Elm_Part_Data) 7061ELM_PART_OVERRIDE_CONTENT_UNSET(efl_ui_win, EFL_UI_WIN, Efl_Ui_Win_Data)
7051ELM_PART_CONTENT_DEFAULT_SET(efl_ui_win, "content") 7062ELM_PART_CONTENT_DEFAULT_SET(efl_ui_win, "content")
7052#include "efl_ui_win_part.eo.c" 7063#include "efl_ui_win_part.eo.c"
7053 7064