efl_ui_navigation_layout: Add Efl.Ui.Navigation_Layout class

Efl.Ui.Navigation_Layout is a widget which provides a layout form useful
for navigation.
This commit is contained in:
Jaehyun Cho 2018-04-12 21:30:05 +09:00
parent ab4fa83f62
commit 7e8722be00
8 changed files with 141 additions and 0 deletions

View File

@ -1022,6 +1022,7 @@ elementary/themes/edc/efl/uiclock.edc \
elementary/themes/edc/efl/cursor.edc \
elementary/themes/edc/efl/focus.edc \
elementary/themes/edc/efl/frame.edc \
elementary/themes/edc/efl/navigation_layout.edc \
elementary/themes/edc/efl/multibuttonentry.edc \
elementary/themes/edc/efl/nstate.edc \
elementary/themes/edc/efl/panes.edc \

View File

@ -168,6 +168,7 @@ collections {
#include "edc/efl/bg.edc"
#include "edc/efl/button.edc"
#include "edc/efl/calendar.edc"
#include "edc/efl/navigation_layout.edc"
#include "edc/efl/nstate.edc"
// XXX: mobile mode needs invisible scrollers... make signals that do this
#include "edc/efl/scroller.edc"

View File

@ -0,0 +1,27 @@
//Efl.Ui.Navigation_Layout Themes
group { "efl/navigation_layout";
parts {
spacer { "base";
desc { "default";
}
}
swallow { "bar";
desc { "default";
fixed: 0 1;
min: 0 40;
rel2.relative: 1.0 0.0;
align: 0.5 0.0;
}
}
swallow { "content";
desc { "default";
rel1 {
to_x: "base";
to_y: "bar";
relative: 0.0 1.0;
}
rel2.to_x: "base";
}
}
}
}

View File

@ -16,6 +16,7 @@ elm_public_eolian_files = \
lib/elementary/efl_ui_image_zoomable.eo \
lib/elementary/efl_ui_layout.eo \
lib/elementary/efl_ui_nstate.eo \
lib/elementary/efl_ui_navigation_layout.eo \
lib/elementary/efl_ui_panes.eo \
lib/elementary/efl_ui_progressbar.eo \
lib/elementary/efl_ui_radio.eo \
@ -351,6 +352,7 @@ includesunstable_HEADERS = \
lib/elementary/elm_widget_menu.h \
lib/elementary/elm_widget_multibuttonentry.h \
lib/elementary/elm_widget_naviframe.h \
lib/elementary/efl_ui_navigation_layout_private.h \
lib/elementary/elm_widget_notify.h \
lib/elementary/elm_widget_panel.h \
lib/elementary/efl_ui_panes_private.h \
@ -625,6 +627,7 @@ lib_elementary_libelementary_la_SOURCES = \
lib/elementary/elc_hoversel.c \
lib/elementary/elc_multibuttonentry.c \
lib/elementary/elc_naviframe.c \
lib/elementary/efl_ui_navigation_layout.c \
lib/elementary/elc_player.c \
lib/elementary/elc_popup.c \
lib/elementary/elc_scrolled_entry.c \

View File

@ -336,6 +336,7 @@ typedef Eo Efl_Ui_Focus_Manager;
# include <efl_selection.eo.h>
# include <efl_ui_dnd.eo.h>
# include <efl_ui_dnd_container.eo.h>
# include <efl_ui_navigation_layout.eo.h>
# include <efl_ui_stack.eo.h>
#endif

View File

@ -0,0 +1,59 @@
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif
#include <Elementary.h>
#include "elm_priv.h"
#include "efl_ui_navigation_layout_private.h"
#include "elm_part_helper.h"
#define MY_CLASS EFL_UI_NAVIGATION_LAYOUT_CLASS
#define MY_CLASS_NAME "Efl.Ui.Navigation_Layout"
EOLIAN static void
_efl_ui_navigation_layout_bar_set(Eo *obj, Efl_Ui_Navigation_Layout_Data *pd, Efl_Ui_Layout *bar)
{
EINA_SAFETY_ON_FALSE_RETURN(efl_isa(bar, EFL_UI_LAYOUT_CLASS));
efl_content_set(efl_part(obj, "bar"), bar);
pd->bar = bar;
}
EOLIAN static Efl_Ui_Layout *
_efl_ui_navigation_layout_bar_get(const Eo *obj EINA_UNUSED, Efl_Ui_Navigation_Layout_Data *pd)
{
return pd->bar;
}
EOLIAN static Eo *
_efl_ui_navigation_layout_efl_object_constructor(Eo *obj, Efl_Ui_Navigation_Layout_Data *pd EINA_UNUSED)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
if (!elm_widget_theme_klass_get(obj))
elm_widget_theme_klass_set(obj, "navigation_layout");
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME);
elm_widget_sub_object_parent_add(obj);
elm_widget_can_focus_set(obj, EINA_TRUE);
if (!elm_widget_theme_object_set(obj, wd->resize_obj,
elm_widget_theme_klass_get(obj),
elm_widget_theme_element_get(obj),
elm_widget_theme_style_get(obj)))
CRI("Failed to set layout!");
return obj;
}
/* Standard widget overrides */
ELM_PART_CONTENT_DEFAULT_GET(efl_ui_navigation_layout, "content")
ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_navigation_layout, Efl_Ui_Navigation_Layout_Data)
/* Internal EO APIs and hidden overrides */
#define EFL_UI_NAVIGATION_LAYOUT_EXTRA_OPS \
ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_navigation_layout)
#include "efl_ui_navigation_layout.eo.c"

View File

@ -0,0 +1,29 @@
class Efl.Ui.Navigation_Layout (Efl.Ui.Layout, Efl.Content)
{
[[Navigation_Layout widget.
Navigation_Layout widget provides a layout form useful for navigation.
Navigation_Layout widget is used to be pushed to or popped from Stack
widget(Efl.Ui.Stack class) as a content.
]]
methods {
@property bar {
[[The bar object which is located at the top area as a title.
]]
set {
}
get {
}
values {
value: Efl.Ui.Layout;
[[The bar object located at the top area of the Navigation Layout.
]]
}
}
}
implements {
Efl.Object.constructor;
Efl.Content.content { set; get; }
Efl.Content.content_unset;
}
}

View File

@ -0,0 +1,20 @@
#ifndef EFL_UI_WIDGET_NAVIGATION_LAYOUT_H
#define EFL_UI_WIDGET_NAVIGATION_LAYOUT_H
typedef struct _Efl_Ui_Navigation_Layout_Data Efl_Ui_Navigation_Layout_Data;
struct _Efl_Ui_Navigation_Layout_Data
{
Efl_Ui_Layout *bar;
};
#define EFL_UI_NAVIGATION_LAYOUT_DATA_GET_OR_RETURN(o, ptr, ...) \
Efl_Ui_Navigation_Layout_Data *ptr; \
ptr = efl_data_scope_get(o, EFL_UI_NAVIGATION_LAYOUT_CLASS); \
if (EINA_UNLIKELY(!ptr)) \
{ \
CRI("no ui navigation layout data for object %p (%s)", \
o, evas_object_type_get(o)); \
return __VA_ARGS__; \
}
#endif