summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_layout.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/elementary/efl_ui_layout.c')
-rw-r--r--src/lib/elementary/efl_ui_layout.c79
1 files changed, 78 insertions, 1 deletions
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