summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_widget.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/elementary/elm_widget.c')
-rw-r--r--src/lib/elementary/elm_widget.c108
1 files changed, 104 insertions, 4 deletions
diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/elm_widget.c
index d95b34c..c4e6823 100644
--- a/src/lib/elementary/elm_widget.c
+++ b/src/lib/elementary/elm_widget.c
@@ -10,6 +10,7 @@
10#define EFL_INPUT_EVENT_PROTECTED 10#define EFL_INPUT_EVENT_PROTECTED
11#define EFL_UI_TRANSLATABLE_PROTECTED 11#define EFL_UI_TRANSLATABLE_PROTECTED
12#define EFL_UI_FOCUS_OBJECT_PROTECTED 12#define EFL_UI_FOCUS_OBJECT_PROTECTED
13#define EFL_UI_WIDGET_PART_BG_PROTECTED
13 14
14#include <Elementary.h> 15#include <Elementary.h>
15 16
@@ -814,6 +815,11 @@ _smart_reconfigure(Elm_Widget_Smart_Data *sd)
814 evas_object_move(sd->hover_obj, sd->x, sd->y); 815 evas_object_move(sd->hover_obj, sd->x, sd->y);
815 evas_object_resize(sd->hover_obj, sd->w, sd->h); 816 evas_object_resize(sd->hover_obj, sd->w, sd->h);
816 } 817 }
818 if (sd->bg)
819 {
820 evas_object_move(sd->bg, sd->x, sd->y);
821 evas_object_resize(sd->bg, sd->w, sd->h);
822 }
817} 823}
818 824
819EOLIAN static void 825EOLIAN static void
@@ -902,7 +908,7 @@ _elm_widget_efl_gfx_visible_set(Eo *obj, Elm_Widget_Smart_Data *pd, Eina_Bool vi
902} 908}
903 909
904EOLIAN static void 910EOLIAN static void
905_elm_widget_efl_gfx_color_set(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED, int r, int g, int b, int a) 911_elm_widget_efl_gfx_color_set(Eo *obj, Elm_Widget_Smart_Data *pd, int r, int g, int b, int a)
906{ 912{
907 Eina_Iterator *it; 913 Eina_Iterator *it;
908 Evas_Object *o; 914 Evas_Object *o;
@@ -913,6 +919,7 @@ _elm_widget_efl_gfx_color_set(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED, i
913 it = evas_object_smart_iterator_new(obj); 919 it = evas_object_smart_iterator_new(obj);
914 EINA_ITERATOR_FOREACH(it, o) 920 EINA_ITERATOR_FOREACH(it, o)
915 { 921 {
922 if (pd->bg == o) continue;
916 if (evas_object_data_get(o, "_elm_leaveme")) continue; 923 if (evas_object_data_get(o, "_elm_leaveme")) continue;
917 evas_object_color_set(o, r, g, b, a); 924 evas_object_color_set(o, r, g, b, a);
918 } 925 }
@@ -983,15 +990,18 @@ _elm_widget_efl_canvas_group_group_calculate(Eo *obj EINA_UNUSED, Elm_Widget_Sma
983} 990}
984 991
985EOLIAN static void 992EOLIAN static void
986_elm_widget_efl_canvas_group_group_member_add(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Evas_Object *child) 993_elm_widget_efl_canvas_group_group_member_add(Eo *obj, Elm_Widget_Smart_Data *pd, Evas_Object *child)
987{ 994{
988 int r, g, b, a; 995 int r, g, b, a;
989 efl_canvas_group_member_add(efl_super(obj, MY_CLASS), child); 996 efl_canvas_group_member_add(efl_super(obj, MY_CLASS), child);
990 997
991 if (evas_object_data_get(child, "_elm_leaveme")) return; 998 if (evas_object_data_get(child, "_elm_leaveme")) return;
992 999
993 evas_object_color_get(obj, &r, &g, &b, &a); 1000 if (pd->bg != child)
994 evas_object_color_set(child, r, g, b, a); 1001 {
1002 evas_object_color_get(obj, &r, &g, &b, &a);
1003 evas_object_color_set(child, r, g, b, a);
1004 }
995 1005
996 efl_canvas_object_no_render_set(child, efl_canvas_object_no_render_get(obj)); 1006 efl_canvas_object_no_render_set(child, efl_canvas_object_no_render_get(obj));
997 evas_object_clip_set(child, evas_object_clip_get(obj)); 1007 evas_object_clip_set(child, evas_object_clip_get(obj));
@@ -5522,6 +5532,8 @@ elm_widget_signal_callback_del(Eo *obj, const char *emission, const char *source
5522EOLIAN static Efl_Object * 5532EOLIAN static Efl_Object *
5523_elm_widget_efl_part_part(const Eo *obj, Elm_Widget_Smart_Data *wd EINA_UNUSED, const char *part) 5533_elm_widget_efl_part_part(const Eo *obj, Elm_Widget_Smart_Data *wd EINA_UNUSED, const char *part)
5524{ 5534{
5535 if (eina_streq(part, "background"))
5536 return ELM_PART_IMPLEMENT(EFL_UI_WIDGET_PART_BG_CLASS, obj, part);
5525 return ELM_PART_IMPLEMENT(EFL_UI_WIDGET_PART_CLASS, obj, part); 5537 return ELM_PART_IMPLEMENT(EFL_UI_WIDGET_PART_CLASS, obj, part);
5526} 5538}
5527 5539
@@ -5537,6 +5549,94 @@ _efl_ui_widget_part_efl_object_destructor(Eo *obj, Elm_Part_Data *pd)
5537 5549
5538/* Efl.Part end */ 5550/* Efl.Part end */
5539 5551
5552/* Efl.Part Bg implementation */
5553EOLIAN static void
5554_efl_ui_widget_part_bg_bg_set(Eo *obj, void *_pd EINA_UNUSED, Efl_Canvas_Object *bg)
5555{
5556 Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
5557 Elm_Widget_Smart_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
5558
5559 if (sd->bg == bg)
5560 return;
5561
5562 efl_del(sd->bg);
5563 sd->bg = bg;
5564 if (!sd->bg)
5565 return;
5566
5567 efl_canvas_group_member_add(pd->obj, sd->bg);
5568 evas_object_stack_below(sd->bg, sd->resize_obj);
5569 _smart_reconfigure(sd);
5570}
5571
5572EOLIAN static Efl_Canvas_Object *
5573_efl_ui_widget_part_bg_bg_get(Eo *obj, void *_pd EINA_UNUSED)
5574{
5575 Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
5576 Elm_Widget_Smart_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
5577 Evas_Object *bg_obj = sd->bg;
5578
5579 if (!bg_obj)
5580 {
5581 bg_obj = efl_add(EFL_UI_BG_CLASS, pd->obj);
5582 efl_ui_widget_part_bg_set(obj, bg_obj);
5583 }
5584
5585 return bg_obj;
5586}
5587
5588EOLIAN static Eina_Bool
5589_efl_ui_widget_part_bg_efl_file_file_set(Eo *obj, void *pd EINA_UNUSED, const char *file, const char *key)
5590{
5591 Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj);
5592
5593 return efl_file_set(bg_obj, file, key);
5594}
5595
5596EOLIAN static void
5597_efl_ui_widget_part_bg_efl_file_file_get(Eo *obj, void *pd EINA_UNUSED, const char **file, const char **key)
5598{
5599 Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj);
5600
5601 efl_file_get(bg_obj, file, key);
5602}
5603
5604EOLIAN static void
5605_efl_ui_widget_part_bg_efl_gfx_color_set(Eo *obj, void *pd EINA_UNUSED, int r, int g, int b, int a)
5606{
5607 Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj);
5608
5609 efl_gfx_color_set(bg_obj, r, g, b, a);
5610}
5611
5612EOLIAN static void
5613_efl_ui_widget_part_bg_efl_gfx_color_get(Eo *obj, void *pd EINA_UNUSED, int *r, int *g, int *b, int *a)
5614{
5615 Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj);
5616
5617 efl_gfx_color_get(bg_obj, r, g, b, a);
5618}
5619
5620EOLIAN static void
5621_efl_ui_widget_part_bg_efl_ui_image_scale_type_set(Eo *obj, void *pd EINA_UNUSED, Efl_Ui_Image_Scale_Type scale_type)
5622{
5623 Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj);
5624
5625 efl_ui_image_scale_type_set(bg_obj, scale_type);
5626}
5627
5628EOLIAN static Efl_Ui_Image_Scale_Type
5629_efl_ui_widget_part_bg_efl_ui_image_scale_type_get(Eo *obj, void *pd EINA_UNUSED)
5630{
5631 Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj);
5632
5633 return efl_ui_image_scale_type_get(bg_obj);
5634}
5635
5636#include "efl_ui_widget_part_bg.eo.c"
5637
5638/* Efl.Part Bg end */
5639
5540 5640
5541/* Internal EO APIs and hidden overrides */ 5641/* Internal EO APIs and hidden overrides */
5542 5642