forked from enlightenment/efl
efl_ui_popup: Replace class Efl.Ui.Popup_Part with Efl.Ui.Popup_Part_Backwall
Class Efl.Ui.Popup_Part is used only for part "backwall". Therefore, class Efl.Ui.Popup_Part is replaced with class Efl.Ui.Popup_Part_Backwall.
This commit is contained in:
parent
4067fafe07
commit
743e0468e9
|
@ -42,7 +42,7 @@ elm_public_eolian_files = \
|
||||||
lib/elementary/efl_text_interactive.eo \
|
lib/elementary/efl_text_interactive.eo \
|
||||||
lib/elementary/efl_ui_text.eo \
|
lib/elementary/efl_ui_text.eo \
|
||||||
lib/elementary/efl_ui_popup.eo \
|
lib/elementary/efl_ui_popup.eo \
|
||||||
lib/elementary/efl_ui_popup_part.eo \
|
lib/elementary/efl_ui_popup_part_backwall.eo \
|
||||||
lib/elementary/efl_ui_popup_alert.eo \
|
lib/elementary/efl_ui_popup_alert.eo \
|
||||||
lib/elementary/efl_ui_popup_alert_part.eo \
|
lib/elementary/efl_ui_popup_alert_part.eo \
|
||||||
lib/elementary/efl_ui_popup_alert_scroll.eo \
|
lib/elementary/efl_ui_popup_alert_scroll.eo \
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
#include "elm_priv.h"
|
#include "elm_priv.h"
|
||||||
#include "efl_ui_popup_private.h"
|
#include "efl_ui_popup_private.h"
|
||||||
#include "efl_ui_popup_part.eo.h"
|
#include "efl_ui_popup_part_backwall.eo.h"
|
||||||
#include "elm_part_helper.h"
|
#include "elm_part_helper.h"
|
||||||
|
|
||||||
#define MY_CLASS EFL_UI_POPUP_CLASS
|
#define MY_CLASS EFL_UI_POPUP_CLASS
|
||||||
|
@ -327,69 +327,58 @@ _efl_ui_popup_efl_part_part_get(const Eo *obj, Efl_Ui_Popup_Data *_pd EINA_UNUSE
|
||||||
{
|
{
|
||||||
EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
|
EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
|
||||||
|
|
||||||
if (eina_streq(part, "backwall"))
|
if (eina_streq(part, PART_NAME_BACKWALL))
|
||||||
return ELM_PART_IMPLEMENT(EFL_UI_POPUP_PART_CLASS, obj, part);
|
return ELM_PART_IMPLEMENT(EFL_UI_POPUP_PART_BACKWALL_CLASS, obj, part);
|
||||||
|
|
||||||
return efl_part_get(efl_super(obj, MY_CLASS), part);
|
return efl_part_get(efl_super(obj, MY_CLASS), part);
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_efl_ui_popup_part_efl_canvas_object_repeat_events_set(Eo *obj, void *_pd EINA_UNUSED, Eina_Bool repeat)
|
_efl_ui_popup_part_backwall_efl_canvas_object_repeat_events_set(Eo *obj, void *_pd EINA_UNUSED, Eina_Bool repeat)
|
||||||
{
|
{
|
||||||
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
|
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
|
||||||
Efl_Ui_Popup_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_POPUP_CLASS);
|
Efl_Ui_Popup_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_POPUP_CLASS);
|
||||||
|
|
||||||
if (eina_streq(pd->part, "backwall"))
|
efl_canvas_object_repeat_events_set(sd->backwall, repeat);
|
||||||
efl_canvas_object_repeat_events_set(sd->backwall, repeat);
|
|
||||||
else
|
|
||||||
efl_canvas_object_repeat_events_set(efl_part(efl_super(pd->obj, MY_CLASS), pd->part), repeat);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Eina_Bool
|
EOLIAN static Eina_Bool
|
||||||
_efl_ui_popup_part_efl_canvas_object_repeat_events_get(const Eo *obj, void *_pd EINA_UNUSED)
|
_efl_ui_popup_part_backwall_efl_canvas_object_repeat_events_get(const Eo *obj, void *_pd EINA_UNUSED)
|
||||||
{
|
{
|
||||||
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
|
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
|
||||||
Efl_Ui_Popup_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_POPUP_CLASS);
|
Efl_Ui_Popup_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_POPUP_CLASS);
|
||||||
|
|
||||||
if (eina_streq(pd->part, "backwall"))
|
return efl_canvas_object_repeat_events_get(sd->backwall);
|
||||||
return efl_canvas_object_repeat_events_get(sd->backwall);
|
|
||||||
|
|
||||||
return efl_canvas_object_repeat_events_get(efl_part(efl_super(pd->obj, MY_CLASS), pd->part));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Eina_Bool
|
EOLIAN static Eina_Bool
|
||||||
_efl_ui_popup_part_efl_file_file_set(Eo *obj, void *_pd EINA_UNUSED, const char *file, const char *group)
|
_efl_ui_popup_part_backwall_efl_file_file_set(Eo *obj, void *_pd EINA_UNUSED, const char *file, const char *group)
|
||||||
{
|
{
|
||||||
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
|
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
|
||||||
Efl_Ui_Popup_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_POPUP_CLASS);
|
Efl_Ui_Popup_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_POPUP_CLASS);
|
||||||
|
|
||||||
if (eina_streq(pd->part, "backwall"))
|
Eo *prev_obj = edje_object_part_swallow_get(sd->backwall, "efl.content");
|
||||||
|
if (prev_obj)
|
||||||
{
|
{
|
||||||
Eo *prev_obj = edje_object_part_swallow_get(sd->backwall, "efl.content");
|
edje_object_signal_emit(sd->backwall, "efl,state,content,unset", "efl");
|
||||||
if (prev_obj)
|
edje_object_part_unswallow(sd->backwall, prev_obj);
|
||||||
{
|
efl_del(prev_obj);
|
||||||
edje_object_signal_emit(sd->backwall, "efl,state,content,unset", "efl");
|
|
||||||
edje_object_part_unswallow(sd->backwall, prev_obj);
|
|
||||||
efl_del(prev_obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
Eo *image = elm_image_add(pd->obj);
|
|
||||||
Eina_Bool ret = elm_image_file_set(image, file, group);
|
|
||||||
if (!ret)
|
|
||||||
{
|
|
||||||
efl_del(image);
|
|
||||||
return EINA_FALSE;
|
|
||||||
}
|
|
||||||
edje_object_part_swallow(sd->backwall, "efl.content", image);
|
|
||||||
edje_object_signal_emit(sd->backwall, "efl,state,content,set", "efl");
|
|
||||||
|
|
||||||
return EINA_TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return efl_file_set(efl_part(efl_super(pd->obj, MY_CLASS), pd->part), file, group);
|
Eo *image = elm_image_add(pd->obj);
|
||||||
|
Eina_Bool ret = elm_image_file_set(image, file, group);
|
||||||
|
if (!ret)
|
||||||
|
{
|
||||||
|
efl_del(image);
|
||||||
|
return EINA_FALSE;
|
||||||
|
}
|
||||||
|
edje_object_part_swallow(sd->backwall, "efl.content", image);
|
||||||
|
edje_object_signal_emit(sd->backwall, "efl,state,content,set", "efl");
|
||||||
|
|
||||||
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "efl_ui_popup_part.eo.c"
|
#include "efl_ui_popup_part_backwall.eo.c"
|
||||||
|
|
||||||
/* Efl.Part end */
|
/* Efl.Part end */
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ class Efl.Ui.Popup(Efl.Ui.Layout.Object, Efl.Content)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
parts {
|
parts {
|
||||||
backwall: Efl.Ui.Popup_Part; [[A backwall behind the popup.]]
|
backwall: Efl.Ui.Popup_Part_Backwall; [[A backwall behind the popup.]]
|
||||||
}
|
}
|
||||||
implements {
|
implements {
|
||||||
Efl.Object.constructor;
|
Efl.Object.constructor;
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
class Efl.Ui.Popup_Part (Efl.Ui.Layout.Part, Efl.Canvas.Object, Efl.File)
|
|
||||||
{
|
|
||||||
[[Efl UI Popup internal part class]]
|
|
||||||
data: null;
|
|
||||||
implements {
|
|
||||||
Efl.Canvas.Object.repeat_events { set; get; }
|
|
||||||
Efl.File.file { set; }
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
class Efl.Ui.Popup_Part_Backwall (Efl.Ui.Layout.Part, Efl.Canvas.Object, Efl.File)
|
||||||
|
{
|
||||||
|
[[Efl UI Popup internal part backwall class]]
|
||||||
|
data: null;
|
||||||
|
implements {
|
||||||
|
Efl.Canvas.Object.repeat_events { set; get; }
|
||||||
|
Efl.File.file { set; }
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue