Eolian: Integration of Inwin
This commit is contained in:
parent
f3e7478a08
commit
3ba96095e6
|
@ -599,7 +599,9 @@ BUILT_SOURCES = \
|
|||
elm_icon.eo.c \
|
||||
elm_icon.eo.h \
|
||||
elm_index.eo.c \
|
||||
elm_index.eo.h
|
||||
elm_index.eo.h \
|
||||
elm_inwin.eo.c \
|
||||
elm_inwin.eo.h
|
||||
|
||||
EXTRA_DIST += \
|
||||
elm_widget.eo \
|
||||
|
@ -639,7 +641,8 @@ EXTRA_DIST += \
|
|||
elc_hoversel.eo \
|
||||
elm_image.eo \
|
||||
elm_icon.eo \
|
||||
elm_index.eo
|
||||
elm_index.eo \
|
||||
elm_inwin.eo
|
||||
|
||||
nodist_includesunstable_HEADERS = \
|
||||
elm_widget.eo.h \
|
||||
|
@ -679,5 +682,6 @@ nodist_includesunstable_HEADERS = \
|
|||
elc_hoversel.eo.h \
|
||||
elm_image.eo.h \
|
||||
elm_icon.eo.h \
|
||||
elm_index.eo.h
|
||||
elm_index.eo.h \
|
||||
elm_inwin.eo.h
|
||||
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
#include "elm_widget_inwin.h"
|
||||
#include "elm_widget_layout.h"
|
||||
|
||||
EAPI Eo_Op ELM_OBJ_WIN_INWIN_BASE_ID = EO_NOOP;
|
||||
|
||||
#define MY_CLASS ELM_OBJ_WIN_INWIN_CLASS
|
||||
|
||||
#define MY_CLASS_NAME "Elm_Inwin"
|
||||
|
@ -21,8 +19,8 @@ static const Elm_Layout_Part_Alias_Description _content_aliases[] =
|
|||
{NULL, NULL}
|
||||
};
|
||||
|
||||
static void
|
||||
_elm_inwin_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
|
||||
EOLIAN static void
|
||||
_elm_inwin_elm_layout_sizing_eval(Eo *obj, void *_pd EINA_UNUSED)
|
||||
{
|
||||
Evas_Object *content;
|
||||
Evas_Coord minw = -1, minh = -1;
|
||||
|
@ -39,20 +37,15 @@ _elm_inwin_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_
|
|||
evas_object_size_hint_max_set(obj, -1, -1);
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_inwin_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_inwin_elm_widget_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED)
|
||||
{
|
||||
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
||||
*ret = EINA_TRUE;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_inwin_smart_focus_next(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_inwin_elm_widget_focus_next(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, Elm_Focus_Direction dir, Evas_Object **next)
|
||||
{
|
||||
Elm_Focus_Direction dir = va_arg(*list, Elm_Focus_Direction);
|
||||
Evas_Object **next = va_arg(*list, Evas_Object **);
|
||||
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
|
||||
if (ret) *ret = EINA_FALSE;
|
||||
Evas_Object *content;
|
||||
|
||||
content = elm_layout_content_get(obj, NULL);
|
||||
|
@ -61,18 +54,16 @@ _elm_inwin_smart_focus_next(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list
|
|||
if (content)
|
||||
{
|
||||
elm_widget_focus_next_get(content, dir, next);
|
||||
if (*next)
|
||||
{
|
||||
if (ret) *ret = EINA_TRUE;
|
||||
return;
|
||||
}
|
||||
if (*next) return EINA_TRUE;
|
||||
}
|
||||
|
||||
*next = (Evas_Object *)obj;
|
||||
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_inwin_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
|
||||
EOLIAN static void
|
||||
_elm_inwin_evas_smart_add(Eo *obj, void *_pd EINA_UNUSED)
|
||||
{
|
||||
eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
|
||||
elm_widget_sub_object_parent_add(obj);
|
||||
|
@ -86,20 +77,18 @@ _elm_inwin_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
|
|||
CRI("Failed to set layout!");
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_inwin_smart_parent_set(Eo *obj, void *_pd EINA_UNUSED, va_list *list)
|
||||
EOLIAN static void
|
||||
_elm_inwin_elm_widget_parent_set(Eo *obj, void *_pd EINA_UNUSED, Evas_Object *parent)
|
||||
{
|
||||
Evas_Object *parent = va_arg(*list, Evas_Object *);
|
||||
elm_win_resize_object_add(parent, obj);
|
||||
|
||||
elm_layout_sizing_eval(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_inwin_smart_content_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
|
||||
EOLIAN static const Elm_Layout_Part_Alias_Description*
|
||||
_elm_inwin_elm_layout_content_aliases_get(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED)
|
||||
{
|
||||
const Elm_Layout_Part_Alias_Description **aliases = va_arg(*list, const Elm_Layout_Part_Alias_Description **);
|
||||
*aliases = _content_aliases;
|
||||
return _content_aliases;
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
|
@ -111,8 +100,8 @@ elm_win_inwin_add(Evas_Object *parent)
|
|||
return obj;
|
||||
}
|
||||
|
||||
static void
|
||||
_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
|
||||
EOLIAN static void
|
||||
_elm_inwin_eo_base_constructor(Eo *obj, void *_pd EINA_UNUSED)
|
||||
{
|
||||
Evas_Object *parent;
|
||||
|
||||
|
@ -128,15 +117,8 @@ _constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
|
|||
eo_do(obj, evas_obj_type_set(MY_CLASS_NAME_LEGACY));
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_win_inwin_activate(Evas_Object *obj)
|
||||
{
|
||||
ELM_INWIN_CHECK(obj);
|
||||
eo_do(obj, elm_obj_win_inwin_activate());
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_inwin_smart_activate(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
|
||||
EOLIAN static void
|
||||
_elm_inwin_activate(Eo *obj, void *_pd EINA_UNUSED)
|
||||
{
|
||||
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
||||
|
||||
|
@ -176,40 +158,9 @@ elm_win_inwin_content_unset(Evas_Object *obj)
|
|||
}
|
||||
|
||||
static void
|
||||
_class_constructor(Eo_Class *klass)
|
||||
_elm_inwin_class_constructor(Eo_Class *klass)
|
||||
{
|
||||
const Eo_Op_Func_Description func_desc[] = {
|
||||
EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
|
||||
|
||||
EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_ADD), _elm_inwin_smart_add),
|
||||
|
||||
EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_inwin_smart_focus_next_manager_is),
|
||||
EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_FOCUS_NEXT), _elm_inwin_smart_focus_next),
|
||||
EO_OP_FUNC(ELM_OBJ_WIDGET_ID(ELM_OBJ_WIDGET_SUB_ID_PARENT_SET), _elm_inwin_smart_parent_set),
|
||||
|
||||
EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_inwin_smart_sizing_eval),
|
||||
EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_CONTENT_ALIASES_GET), _elm_inwin_smart_content_aliases_get),
|
||||
|
||||
EO_OP_FUNC(ELM_OBJ_WIN_INWIN_ID(ELM_OBJ_WIN_INWIN_SUB_ID_ACTIVATE), _elm_inwin_smart_activate),
|
||||
EO_OP_FUNC_SENTINEL
|
||||
};
|
||||
eo_class_funcs_set(klass, func_desc);
|
||||
|
||||
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
|
||||
}
|
||||
static const Eo_Op_Description op_desc[] = {
|
||||
EO_OP_DESCRIPTION(ELM_OBJ_WIN_INWIN_SUB_ID_ACTIVATE, "Activates an inwin object, ensuring its visibility."),
|
||||
EO_OP_DESCRIPTION_SENTINEL
|
||||
};
|
||||
static const Eo_Class_Description class_desc = {
|
||||
EO_VERSION,
|
||||
MY_CLASS_NAME,
|
||||
EO_CLASS_TYPE_REGULAR,
|
||||
EO_CLASS_DESCRIPTION_OPS(&ELM_OBJ_WIN_INWIN_BASE_ID, op_desc, ELM_OBJ_WIN_INWIN_SUB_ID_LAST),
|
||||
NULL,
|
||||
0,
|
||||
_class_constructor,
|
||||
NULL
|
||||
};
|
||||
|
||||
EO_DEFINE_CLASS(elm_obj_win_inwin_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, NULL);
|
||||
#include "elm_inwin.eo.c"
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
class Elm_Inwin (Elm_Layout)
|
||||
{
|
||||
eo_prefix: elm_obj_win_inwin;
|
||||
data: null;
|
||||
methods {
|
||||
activate {
|
||||
/*@
|
||||
Activates an inwin object, ensuring its visibility
|
||||
|
||||
This function will make sure that the inwin @p obj is completely visible
|
||||
by calling evas_object_show() and evas_object_raise() on it, to bring it
|
||||
to the front. It also sets the keyboard focus to it, which will be passed
|
||||
onto its content.
|
||||
|
||||
The object's theme will also receive the signal "elm,action,show" with
|
||||
source "elm".
|
||||
|
||||
@ingroup Inwin */
|
||||
|
||||
legacy elm_win_inwin_activate;
|
||||
}
|
||||
}
|
||||
implements {
|
||||
class::constructor;
|
||||
Eo_Base::constructor;
|
||||
Evas_Smart::add;
|
||||
Elm_Widget::parent::set;
|
||||
Elm_Widget::focus_next_manager_is;
|
||||
Elm_Widget::focus_next;
|
||||
Elm_Layout::content_aliases::get;
|
||||
Elm_Layout::sizing_eval;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,3 +1,6 @@
|
|||
#include "elm_inwin.eo.h"
|
||||
|
||||
#if 0
|
||||
#define ELM_OBJ_WIN_INWIN_CLASS elm_obj_win_inwin_class_get()
|
||||
|
||||
const Eo_Class *elm_obj_win_inwin_class_get(void) EINA_CONST;
|
||||
|
@ -21,3 +24,4 @@ enum
|
|||
* @ingroup Inwin
|
||||
*/
|
||||
#define elm_obj_win_inwin_activate() ELM_OBJ_WIN_INWIN_ID(ELM_OBJ_WIN_INWIN_SUB_ID_ACTIVATE)
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue