summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/elementary/Elementary.h2
-rw-r--r--src/lib/elementary/efl_ui_layout.c79
-rw-r--r--src/lib/elementary/efl_ui_layout_part_bg.eo11
-rw-r--r--src/lib/elementary/efl_ui_widget_part_bg.eo22
-rw-r--r--src/lib/elementary/elm_part_helper.h2
-rw-r--r--src/lib/elementary/elm_widget.c108
-rw-r--r--src/lib/elementary/elm_widget.h1
7 files changed, 220 insertions, 5 deletions
diff --git a/src/lib/elementary/Elementary.h b/src/lib/elementary/Elementary.h
index 9cecb35..431c1e8 100644
--- a/src/lib/elementary/Elementary.h
+++ b/src/lib/elementary/Elementary.h
@@ -282,9 +282,11 @@ EAPI extern Elm_Version *elm_version;
282#ifdef EFL_EO_API_SUPPORT 282#ifdef EFL_EO_API_SUPPORT
283# include <efl_config_global.eo.h> 283# include <efl_config_global.eo.h>
284# include <efl_ui_widget_part.eo.h> 284# include <efl_ui_widget_part.eo.h>
285# include <efl_ui_widget_part_bg.eo.h>
285# include <efl_ui_layout_part.eo.h> 286# include <efl_ui_layout_part.eo.h>
286# include <efl_ui_layout_part_box.eo.h> 287# include <efl_ui_layout_part_box.eo.h>
287# include <efl_ui_layout_part_content.eo.h> 288# include <efl_ui_layout_part_content.eo.h>
289# include <efl_ui_layout_part_bg.eo.h>
288# include <efl_ui_layout_part_text.eo.h> 290# include <efl_ui_layout_part_text.eo.h>
289# include <efl_ui_layout_part_table.eo.h> 291# include <efl_ui_layout_part_table.eo.h>
290# include <efl_ui_win_part.eo.h> 292# include <efl_ui_win_part.eo.h>
diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c
index be0e5c9..a4cd798 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout.c
@@ -4,6 +4,7 @@
4 4
5#define EFL_ACCESS_PROTECTED 5#define EFL_ACCESS_PROTECTED
6#define ELM_LAYOUT_PROTECTED 6#define ELM_LAYOUT_PROTECTED
7#define EFL_UI_WIDGET_PART_BG_PROTECTED
7 8
8#include <Elementary.h> 9#include <Elementary.h>
9 10
@@ -2382,6 +2383,8 @@ _efl_ui_layout_efl_part_part(const Eo *obj, Efl_Ui_Layout_Data *sd, const char *
2382 EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL); 2383 EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
2383 ELM_WIDGET_DATA_GET_OR_RETURN((Eo *) obj, wd, NULL); 2384 ELM_WIDGET_DATA_GET_OR_RETURN((Eo *) obj, wd, NULL);
2384 2385
2386 if (eina_streq(part, "background"))
2387 return ELM_PART_IMPLEMENT(EFL_UI_LAYOUT_PART_BG_CLASS, obj, part);
2385 // Check part type without using edje_object_part_object_get(), as this 2388 // Check part type without using edje_object_part_object_get(), as this
2386 // can cause recalc, which has side effects... and could be slow. 2389 // can cause recalc, which has side effects... and could be slow.
2387 type = efl_canvas_layout_part_type_get(efl_part(wd->resize_obj, part)); 2390 type = efl_canvas_layout_part_type_get(efl_part(wd->resize_obj, part));
@@ -2391,7 +2394,6 @@ _efl_ui_layout_efl_part_part(const Eo *obj, Efl_Ui_Layout_Data *sd, const char *
2391 ERR("Invalid type found for part '%s' in group '%s'", part, sd->group); 2394 ERR("Invalid type found for part '%s' in group '%s'", part, sd->group);
2392 return NULL; 2395 return NULL;
2393 } 2396 }
2394
2395 switch (type) 2397 switch (type)
2396 { 2398 {
2397 case EFL_CANVAS_LAYOUT_PART_TYPE_BOX: 2399 case EFL_CANVAS_LAYOUT_PART_TYPE_BOX:
@@ -2526,9 +2528,84 @@ _efl_ui_layout_part_legacy_efl_ui_translatable_translatable_text_set(Eo *obj, vo
2526 elm_widget_part_translatable_text_set(pd->obj, pd->part, label, domain); 2528 elm_widget_part_translatable_text_set(pd->obj, pd->part, label, domain);
2527} 2529}
2528 2530
2531/* Efl.Ui.Layout.Part.Bg (common) */
2532EOLIAN static void
2533_efl_ui_layout_part_bg_efl_ui_widget_part_bg_bg_set(Eo *obj, void *_pd EINA_UNUSED, Efl_Canvas_Object *bg)
2534{
2535 Efl_Canvas_Layout_Part_Type type;
2536 Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
2537 Efl_Ui_Layout_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
2538 ELM_WIDGET_DATA_GET_OR_RETURN(pd->obj, wd);
2539
2540 // Check part type without using edje_object_part_object_get(), as this
2541 // can cause recalc, which has side effects... and could be slow.
2542 type = efl_canvas_layout_part_type_get(efl_part(wd->resize_obj, "background"));
2543 if (type != EFL_CANVAS_LAYOUT_PART_TYPE_SWALLOW)
2544 efl_ui_widget_part_bg_set(efl_super(obj, EFL_UI_LAYOUT_PART_BG_CLASS), bg);
2545
2546 if (wd->bg == bg)
2547 return;
2548
2549 efl_del(wd->bg);
2550 wd->bg = bg;
2551 if (!wd->bg)
2552 return;
2553
2554 _efl_ui_layout_content_set(pd->obj, sd, "background", bg);
2555}
2556
2557EOLIAN static Eina_Bool
2558_efl_ui_layout_part_bg_efl_file_file_set(Eo *obj, void *pd EINA_UNUSED, const char *file, const char *key)
2559{
2560 Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj);
2561
2562 return efl_file_set(bg_obj, file, key);
2563}
2564
2565EOLIAN static void
2566_efl_ui_layout_part_bg_efl_file_file_get(Eo *obj, void *pd EINA_UNUSED, const char **file, const char **key)
2567{
2568 Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj);
2569
2570 efl_file_get(bg_obj, file, key);
2571}
2572
2573EOLIAN static void
2574_efl_ui_layout_part_bg_efl_gfx_color_set(Eo *obj, void *pd EINA_UNUSED, int r, int g, int b, int a)
2575{
2576 Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj);
2577
2578 efl_gfx_color_set(bg_obj, r, g, b, a);
2579}
2580
2581EOLIAN static void
2582_efl_ui_layout_part_bg_efl_gfx_color_get(Eo *obj, void *pd EINA_UNUSED, int *r, int *g, int *b, int *a)
2583{
2584 Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj);
2585
2586 efl_gfx_color_get(bg_obj, r, g, b, a);
2587}
2588
2589EOLIAN static void
2590_efl_ui_layout_part_bg_efl_ui_image_scale_type_set(Eo *obj, void *pd EINA_UNUSED, Efl_Ui_Image_Scale_Type scale_type)
2591{
2592 Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj);
2593
2594 efl_ui_image_scale_type_set(bg_obj, scale_type);
2595}
2596
2597EOLIAN static Efl_Ui_Image_Scale_Type
2598_efl_ui_layout_part_bg_efl_ui_image_scale_type_get(Eo *obj, void *pd EINA_UNUSED)
2599{
2600 Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj);
2601
2602 return efl_ui_image_scale_type_get(bg_obj);
2603}
2604
2529/* Efl.Ui.Layout.Part_Xxx includes */ 2605/* Efl.Ui.Layout.Part_Xxx includes */
2530#include "efl_ui_layout_part.eo.c" 2606#include "efl_ui_layout_part.eo.c"
2531#include "efl_ui_layout_part_content.eo.c" 2607#include "efl_ui_layout_part_content.eo.c"
2608#include "efl_ui_layout_part_bg.eo.c"
2532#include "efl_ui_layout_part_text.eo.c" 2609#include "efl_ui_layout_part_text.eo.c"
2533#include "efl_ui_layout_part_legacy.eo.c" 2610#include "efl_ui_layout_part_legacy.eo.c"
2534 2611
diff --git a/src/lib/elementary/efl_ui_layout_part_bg.eo b/src/lib/elementary/efl_ui_layout_part_bg.eo
new file mode 100644
index 0000000..9da3921
--- /dev/null
+++ b/src/lib/elementary/efl_ui_layout_part_bg.eo
@@ -0,0 +1,11 @@
1class Efl.Ui.Layout.Part.Bg (Efl.Ui.Widget.Part.Bg, Efl.Ui.Bg)
2{
3 [[Elementary layout internal part background class]]
4 data: null;
5 implements {
6 Efl.Ui.Widget.Part.Bg.bg { set; }
7 Efl.File.file { get; set; }
8 Efl.Gfx.color { set; get; }
9 Efl.Ui.Image.scale_type { get; set; }
10 }
11}
diff --git a/src/lib/elementary/efl_ui_widget_part_bg.eo b/src/lib/elementary/efl_ui_widget_part_bg.eo
new file mode 100644
index 0000000..47e5c6e
--- /dev/null
+++ b/src/lib/elementary/efl_ui_widget_part_bg.eo
@@ -0,0 +1,22 @@
1class Efl.Ui.Widget.Part.Bg (Efl.Ui.Widget.Part, Efl.Ui.Bg)
2{
3 [[Elementary widget internal part background class]]
4 data: null;
5 methods {
6 @property bg @protected {
7 [[Background object]]
8 set {
9 }
10 get {
11 }
12 values {
13 bg: Efl.Canvas.Object;
14 }
15 }
16 }
17 implements {
18 Efl.File.file { get; set; }
19 Efl.Gfx.color { set; get; }
20 Efl.Ui.Image.scale_type { get; set; }
21 }
22}
diff --git a/src/lib/elementary/elm_part_helper.h b/src/lib/elementary/elm_part_helper.h
index 7eb3ae8..b74bd57 100644
--- a/src/lib/elementary/elm_part_helper.h
+++ b/src/lib/elementary/elm_part_helper.h
@@ -90,6 +90,8 @@ EOLIAN static Efl_Object * \
90_ ## type ## _efl_part_part(const Eo *obj, typedata *priv EINA_UNUSED, const char *part) \ 90_ ## type ## _efl_part_part(const Eo *obj, typedata *priv EINA_UNUSED, const char *part) \
91{ \ 91{ \
92 EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL); \ 92 EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL); \
93 if (eina_streq(part, "background")) \
94 return efl_part(efl_super(obj, MY_CLASS), part); \
93 return ELM_PART_IMPLEMENT(TYPE ## _PART_CLASS, obj, part); \ 95 return ELM_PART_IMPLEMENT(TYPE ## _PART_CLASS, obj, part); \
94} 96}
95 97
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
diff --git a/src/lib/elementary/elm_widget.h b/src/lib/elementary/elm_widget.h
index c8ae55b..b37fed5 100644
--- a/src/lib/elementary/elm_widget.h
+++ b/src/lib/elementary/elm_widget.h
@@ -387,6 +387,7 @@ typedef struct _Elm_Widget_Smart_Data
387 Eina_List *subobjs; /**< list of widgets' sub objects in the elementary tree */ 387 Eina_List *subobjs; /**< list of widgets' sub objects in the elementary tree */
388 Evas_Object *resize_obj; /**< an unique object for each widget that shows the look of a widget. Resize object's geometry is same as the widget. This resize object is different from that of window's resize object. */ 388 Evas_Object *resize_obj; /**< an unique object for each widget that shows the look of a widget. Resize object's geometry is same as the widget. This resize object is different from that of window's resize object. */
389 Evas_Object *hover_obj; 389 Evas_Object *hover_obj;
390 Evas_Object *bg;
390 Eina_List *tooltips, *cursors; 391 Eina_List *tooltips, *cursors;
391 Evas_Object *focus_previous, *focus_next; 392 Evas_Object *focus_previous, *focus_next;
392 Evas_Object *focus_up, *focus_down, *focus_right, *focus_left; 393 Evas_Object *focus_up, *focus_down, *focus_right, *focus_left;