{
const auto layout = Layout::Builder().
setTheme(theme).
+ setIsOwner(false).
build(*m_popup);
if (!layout) {
LOG_RETURN(RES_FAIL, "Layout::build() failed!");
const EdjePart part, const ElmStyle btnStyle,
const LayoutTheme iconTheme, const TString &text)
{
- const auto btn = makeShared<StyledWidget>(elm_button_add(*m_popup));
+ const auto btn = makeShared<StyledWidget>(
+ elm_button_add(*m_popup), false);
btn->setStyle(btnStyle);
m_popup->setContent(*btn, part);
if (isValid(iconTheme)) {
const auto icon = Layout::Builder().
setTheme(iconTheme).
+ setIsOwner(false).
build(*btn);
if (!icon) {
LOG_RETURN(RES_FAIL, "Layout::build() failed!");
LOG_RETURN(RES_FAIL, "elm_popup_add() failed!");
}
- m_popup = makeShared<StyledWidget>(popupEo, true);
+ m_popup = makeShared<StyledWidget>(popupEo);
m_popup->addEventHandler(POPUP_DISMISSED, WEAK_DELEGATE(
Dialog::onPopupDismissed, asWeak(*this)));
if (isValid(option.iconTheme)) {
const auto icon = Layout::Builder().
setTheme(option.iconTheme).
+ setIsOwner(false).
build(*m_widget);
if (!icon) {
LOG_RETURN(RES_FAIL, "Layout::build() failed!");
Result NoContentPage::doPrepare(NaviItem &item)
{
const auto layout = Layout::Builder().
- setIsOwner(true).
setTheme(LAYOUT_NO_CONTENTS).
build(getNaviframe());
if (!layout) {
const auto icon = Layout::Builder().
setTheme(getImageTheme(ICON_NO_PHOTOS)).
+ setIsOwner(false).
build(*layout);
if (!icon) {
LOG_RETURN(RES_FAIL, "Layout::build() failed!");
{
m_widget = Layout::Builder().
setTheme(impl::LAYOUT_PROCESSING_WIDGET).
- setIsOwner(true).
build(parent);
if (!m_widget) {
LOG_RETURN(RES_FAIL, "Layout::build() failed!");
LOG_RETURN(RES_FAIL, "elm_popup_add() failed!");
}
- m_popup = makeShared<StyledWidget>(popupEo, true);
+ m_popup = makeShared<StyledWidget>(popupEo);
m_popup->setStyle(impl::POPUP_STYLE);
m_popup->addEventHandler(POPUP_DISMISSED, WEAK_DELEGATE(
{
const auto icon = Layout::Builder().
setTheme(impl::LAYOUT_POPUP_ICON).
+ setIsOwner(false).
build(*m_popup);
if (!icon) {
LOG_RETURN(RES_FAIL, "Layout::build() failed!");
FAIL_RETURN(GuiPresenter::prepare(parent, PF_DEACTIVATOR),
"GuiPresenter::prepare() failed!");
- m_selectButton = makeShared<StyledWidget>(
- elm_button_add(*m_content), true);
+ m_selectButton = makeShared<StyledWidget>(elm_button_add(*m_content));
m_selectButton->setStyle(impl::SELECT_BTN_STYLE);
m_content->set(*m_selectButton, PageContent::Part::SELECT_BUTTON);
m_content->setSelectButtonVisible(false);
if ((m_flags & FLAG_NO_BOTTOM_BUTTON) == 0) {
m_bottomButton = makeShared<StyledWidget>(
- elm_button_add(*m_content), true);
+ elm_button_add(*m_content));
m_bottomButton->setStyle(impl::BOTTOM_BTN_STYLE);
hide(*m_bottomButton);
{
m_isPopupDismissed = false;
- m_popup = makeShared<StyledWidget>(elm_ctxpopup_add(*m_content), true);
+ m_popup = makeShared<StyledWidget>(elm_ctxpopup_add(*m_content));
m_popup->setStyle(impl::SELECT_POPUP_STYLE);
elm_ctxpopup_direction_priority_set(*m_popup,
{
m_content = Layout::Builder().
setTheme(impl::LAYOUT_VIDEO_PLAYER).
- setIsOwner(true).
build(getNaviframe());
if (!m_content) {
LOG_RETURN(RES_FAIL, "m_content is NULL");
StyledWidgetSRef VideoPlayerPage::createButton(const ElmStyle style,
const EdjePart part, const WidgetEventHandler &handler)
{
- const auto btn = makeShared<StyledWidget>(elm_button_add(*m_content));
+ const auto btn = makeShared<StyledWidget>(
+ elm_button_add(*m_content), false);
btn->setStyle(style);
show(*btn);
ImageGrid::ImageGrid(IRefCountObj *const rc, Evas_Object *const scroller,
const Type type, const bool selectModeStartup) :
- ElmWidget(rc, scroller, true),
+ ElmWidget(rc, scroller),
m_info(getInfo(type)),
- m_scroller(makeShared<StyledWidget>(scroller).get()),
+ m_scroller(makeShared<StyledWidget>(scroller, false).get()),
m_box(elm_box_add(*m_scroller)),
m_rect1(evas_object_rectangle_add(m_box.getEvas())),
m_rect2(evas_object_rectangle_add(m_box.getEvas())),
ImageViewer::ImageViewer(IRefCountObj &rc, Evas_Object *const scroller,
const std::string &highResPath, const int loadSize,
const bool forceLoad) :
- ElmWidget(&rc, scroller, true),
+ ElmWidget(&rc, scroller),
- m_scroller(makeShared<StyledWidget>(scroller).get()),
+ m_scroller(makeShared<StyledWidget>(scroller, false).get()),
m_layout(elm_layout_add(*m_scroller)),
m_grid(evas_object_grid_add(m_layout.getEvas())),
m_lowResImage(evas_object_image_filled_add(m_grid.getEvas())),
{
auto layout = Layout::Builder().
setTheme(impl::LAYOUT_MORE_OPTIONS).
- setIsOwner(true).
build(parent);
if (!layout) {
LOG_RETURN_VALUE(RES_FAIL, {}, "Layout::build() failed!");
PageContent::PageContent(IRefCountObj &rc,
const LayoutSRef &layout, const int flags) :
- ElmWidget(&rc, *layout, true),
+ ElmWidget(&rc, *layout),
m_mainLayout(layout.get())
{
prepare(flags);
m_selectMode = Layout::Builder().
setTheme(impl::LAYOUT_SELECT_MODE).
build(*parent);
- parent->setContent(*m_selectMode);
- parent = m_selectMode.get();
+ if (m_selectMode) {
+ parent->setContent(*m_selectMode);
+ parent = m_selectMode.get();
+ }
}
if (flags & FLAG_BOTTOM_BUTTON) {
m_bottomButton = Layout::Builder().
setTheme(impl::LAYOUT_BOTTOM_BUTTON).
build(*parent);
- parent->setContent(*m_bottomButton);
- parent = m_bottomButton.get();
+ if (m_bottomButton) {
+ parent->setContent(*m_bottomButton);
+ parent = m_bottomButton.get();
+ }
}
}
{
const auto result = Layout::Builder().
setTheme(impl::LAYOUT_FAKE_ACCESS_OBJECT).
- setIsOwner(true).
setNeedBindToEo(true).
build(parent);
if (!result) {
EdjeSignalSrc(""));
protected:
- EdjeWidget(IRefCountObj *rc, Evas_Object *eo, bool isOwner = false);
+ EdjeWidget(IRefCountObj *rc, Evas_Object *eo, bool isOwner = true);
};
}
class ElmWidget : public Widget {
public:
- explicit ElmWidget(Evas_Object *eo, bool isOwner = false);
+ explicit ElmWidget(Evas_Object *eo, bool isOwner = true);
virtual ~ElmWidget();
void setEnabled(bool value);
protected:
friend class ReffedObj<ElmWidget>;
- ElmWidget(IRefCountObj *rc, Evas_Object *eo, bool isOwner = false);
+ ElmWidget(IRefCountObj *rc, Evas_Object *eo, bool isOwner = true);
virtual void setFocusedImpl(bool value) final override;
virtual bool isFocusedImpl() const final override;
UCL_DECLARE_REF_ALIASES(Genlist);
- class Genlist : public StyledWidget {
+ class Genlist final : public StyledWidget {
public:
enum class Mode {
COMPRESS = ELM_LIST_COMPRESS,
inline Genlist::Builder::Builder() :
m_mode(Mode::COMPRESS),
m_isHomogeneous(true),
- m_isOwner(false),
+ m_isOwner(true),
m_needBindToEo(false)
{
}
public:
friend class ReffedObj<Layout>;
using EdjeWidget::EdjeWidget;
- explicit Layout(Evas_Object *eo, bool isOwner = false);
+ explicit Layout(Evas_Object *eo, bool isOwner = true);
bool setTheme(const LayoutTheme &theme);
bool setEdjeFile(const std::string &filePath, EdjeGroup group);
// Layout::Builder //
inline Layout::Builder::Builder() :
- m_isOwner(false),
+ m_isOwner(true),
m_needBindToEo(false)
{
}
public:
friend class ReffedObj<StyledWidget>;
using EdjeWidget::EdjeWidget;
- explicit StyledWidget(Evas_Object *eo, bool isOwner = false);
+ explicit StyledWidget(Evas_Object *eo, bool isOwner = true);
void setStyle(ElmStyle style);
};
static constexpr auto FILL = EVAS_HINT_FILL;
public:
- explicit Widget(Evas_Object *eo, bool isOwner = false);
+ explicit Widget(Evas_Object *eo, bool isOwner = true);
virtual ~Widget();
void bindToEo();
protected:
friend class ReffedObj<Widget>;
- Widget(IRefCountObj *rc, Evas_Object *eo, bool isOwner = false);
+ Widget(IRefCountObj *rc, Evas_Object *eo, bool isOwner = true);
virtual void setFocusedImpl(bool value);
virtual bool isFocusedImpl() const;
m_window = Window::Builder().
setType(winType).
setName(paramValue.asString().get()).
- setIsOwner(true).
build();
if (!m_window) {
LOG_RETURN(RES_FAIL, "Window::Builder().build() Failed!");
// Naviframe //
Naviframe::Naviframe(IRefCountObj &rc, Evas_Object *eo) :
- StyledWidget(&rc, eo, true),
+ StyledWidget(&rc, eo),
m_isInTransition(false)
{
addEventHandler(NAVI_TRANSITION_FINISHED, WEAK_DELEGATE(
setStyle(style).
setMode(Genlist::Mode::COMPRESS).
setHomogeneous(flags & FLAG_HOMOGENEOUS).
- setIsOwner(true).
setNeedBindToEo(true).
build(parentWidget);
if (!m_genlist) {