#include "page2.h"
#include "page1.h"
-Evas_Object*
+Elm_Toolbar*
create_toolbar(Evas_Object *parent, const char *style)
{
- Evas_Object *toolbar;
+ Elm_Toolbar *toolbar;
toolbar = elm_toolbar_add(parent);
Evas_Object*
create_content(Evas_Object *parent, const char *text, Evas_Smart_Cb prev_btn_clicked_cb, Evas_Smart_Cb next_btn_clicked_cb, appdata_s *ad)
{
- Evas_Object *grid, *box, *layout, *scroller, *btn, *button_layout;
+ Elm_Grid *grid;
+ Elm_Box *box;
+ Elm_Layout *layout;
+ Elm_Scroller *scroller;
+ Elm_Button *btn;
/* Scroller */
scroller = elm_scroller_add(parent);
} appdata_s;
Evas_Object *create_content(Evas_Object *parent, const char *text, Evas_Smart_Cb prev_btn_clicked_cb, Evas_Smart_Cb next_btn_clicked_cb, appdata_s *ad);
-Evas_Object *create_toolbar(Evas_Object *parent, const char *style);
+Elm_Toolbar *create_toolbar(Evas_Object *parent, const char *style);
{
ui_basic_view *view = dynamic_cast<ui_basic_view *>(this->get_view());
- Evas_Object *ctxpopup = elm_ctxpopup_add(view->get_base());
+ Elm_Ctxpopup *ctxpopup = elm_ctxpopup_add(view->get_base());
elm_ctxpopup_item_append(ctxpopup, "Phone calls", NULL, ctxpopup_item_select_cb, this);
elm_ctxpopup_item_append(ctxpopup, "Favorites", NULL, ctxpopup_item_select_cb, this);
elm_ctxpopup_item_append(ctxpopup, "Search", NULL, ctxpopup_item_select_cb, this);
this->ad);
//Title left button
- Evas_Object *left_title_btn = elm_button_add(view->get_base());
+ Elm_Button *left_title_btn = elm_button_add(view->get_base());
elm_object_text_set(left_title_btn, "Cancel");
//Title right button
- Evas_Object *right_title_btn = elm_button_add(view->get_base());
+ Elm_Button *right_title_btn = elm_button_add(view->get_base());
elm_object_text_set(right_title_btn, "Done");
//Arguments: content, title, subtitle, title left button, title right button
//Arguments: content, title
view->set_content(content, "Title with toolbar");
- Evas_Object *toolbar = create_toolbar(view->get_base(), "toolbar_with_title");
+ Elm_Toolbar *toolbar = create_toolbar(view->get_base(), "toolbar_with_title");
view->set_toolbar(toolbar);
}
};
//Don't delete view's content when this view poped.
view->set_removable_content(false);
view->set_content(content, "Title with toolbar");
- Evas_Object *toolbar = create_toolbar(view->get_base(), "navigationbar");
+ Elm_Toolbar *toolbar = create_toolbar(view->get_base(), "navigationbar");
view->set_toolbar(toolbar);
ad->viewmgr->push_view(view);
}
class ui_basic_view: public ui_view
{
private:
- Evas_Object *layout; //Base layout for view
- Evas_Object *ctxpopup; //Menu Widget
+ Elm_Layout *layout; //Base layout for view
+ Elm_Ctxpopup *ctxpopup; //Menu Widget
bool create_layout();
bool destroy_layout();
virtual ~ui_basic_view();
Evas_Object *set_content(Evas_Object *content, const char *title = NULL);
- Evas_Object *set_content(Evas_Object *content, const char *title, const char *subtitle, Evas_Object *title_left_btn, Evas_Object *title_right_btn);
+ Evas_Object *set_content(Evas_Object *content, const char *title, const char *subtitle, Elm_Button *title_left_btn, Elm_Button *title_right_btn);
bool set_title_badge(const char *text);
bool set_subtitle(const char *text);
- bool set_title_left_btn(Evas_Object *title_left_btn);
- bool set_title_right_btn(Evas_Object *title_right_btn);
+ bool set_title_left_btn(Elm_Button *title_left_btn);
+ bool set_title_right_btn(Elm_Button *title_right_btn);
bool set_title(const char *text);
- bool set_toolbar(Evas_Object *toolbar);
- bool set_menu(Evas_Object *menu);
- Evas_Object * unset_menu();
+ bool set_toolbar(Elm_Toolbar *toolbar);
+ bool set_menu(Elm_Ctxpopup *menu);
+ Elm_Ctxpopup * unset_menu();
virtual void on_menu();
return this->layout;
}
- Evas_Object *get_menu()
+ Elm_Ctxpopup *get_menu()
{
return this->ctxpopup;
}
#include "ui_key_listener.h"
#include <map>
+
+//FIXME: ??
+#ifndef Elm_Conformant
+#define Elm_Conformant Evas_Object
+#endif
+
namespace efl_viewmgr
{
friend class ui_view;
private:
- Evas_Object *win; //This is acting like a base object of viewmgr.
- Evas_Object *conform; //Conformant for viewmgr.
- Evas_Object *layout; //Viewmgr's base layout.
+ Elm_Win *win; //This is acting like a base object of viewmgr.
+ Elm_Conformant *conform; //Conformant for viewmgr.
+ Elm_Layout *layout; //Viewmgr's base layout.
ui_key_listener *key_listener; //HW Key Handler such as "BACK" key...
ui_view_indicator indicator; //Mode of indicator.
string transition_style; //Current transiton effect style name
- map<string, Evas_Object *> effect_map; //Map for effect layouts.
+ map<string, Elm_Layout *> effect_map; //Map for effect layouts.
- Evas_Object *set_transition_layout(string transition_style);
+ Elm_Layout *set_transition_layout(string transition_style);
/**
* @brief Create a conformant.
*
* @return @c true success or @c false not.
*/
- bool create_conformant(Evas_Object *win);
+ bool create_conformant(Elm_Win *win);
/**
* @brief Create a base layout.
*
* @return @c true success or @c false not.
*/
- bool create_base_layout(Evas_Object *conform, const char *style);
+ bool create_base_layout(Elm_Conformant *conform, const char *style);
/** @brief Set the indicator mode.
*
/** @brief Get a window object of viewmgr.
*/
- Evas_Object *get_window()
+ Elm_Win *get_window()
{
return this->win;
}
/** @brief Get a conformant object of viewmgr.
*/
- Evas_Object *get_conformant()
+ Elm_Conformant *get_conformant()
{
return this->conform;
}
#define MY_VIEWMGR dynamic_cast<ui_viewmgr *>(this->get_viewmgr())
#define MY_CONTROLLER dynamic_cast<ui_basic_controller *>(this->get_controller()))
-static void update_menu(Evas_Object *win, Evas_Object *ctxpopup)
+static void update_menu(Elm_Win *win, Elm_Ctxpopup *ctxpopup)
{
/* We convince the top widget is a window */
Evas_Coord w, h;
{
if (this->layout) return false;
- Evas_Object *layout = elm_layout_add(this->get_parent());
+ Elm_Layout *layout = elm_layout_add(this->get_parent());
if (!layout)
{
ui_viewmgr *viewmgr = MY_VIEWMGR;
if (viewmgr->need_soft_key())
{
- Evas_Object *prev_btn = elm_button_add(layout);
+ Elm_Button *prev_btn = elm_button_add(layout);
if (!prev_btn)
{
[](void *data, Evas *e, Evas_Object *obj, void *event_info) -> void
{
ui_basic_view *view = static_cast<ui_basic_view *>(data);
- Evas_Object *ctxpopup = view->get_menu();
+ Elm_Ctxpopup *ctxpopup = view->get_menu();
if (ctxpopup && evas_object_visible_get(ctxpopup))
{
update_menu(dynamic_cast<ui_viewmgr *>(view->get_viewmgr())->get_window(), ctxpopup);
[](void *data, Evas *e, Evas_Object *obj, void *event_info) -> void
{
ui_basic_view *view = static_cast<ui_basic_view *>(data);
- Evas_Object *ctxpopup = view->get_menu();
+ Elm_Ctxpopup *ctxpopup = view->get_menu();
if (ctxpopup && evas_object_visible_get(ctxpopup))
{
elm_ctxpopup_dismiss(ctxpopup);
return false;
}
-bool ui_basic_view::set_title_left_btn(Evas_Object *title_left_btn)
+bool ui_basic_view::set_title_left_btn(Elm_Button *title_left_btn)
{
if (this->layout)
{
return false;
}
-bool ui_basic_view::set_title_right_btn(Evas_Object *title_right_btn)
+bool ui_basic_view::set_title_right_btn(Elm_Button *title_right_btn)
{
if (this->layout)
{
return false;
}
-Evas_Object *ui_basic_view::set_content(Evas_Object *content, const char *title, const char *subtitle, Evas_Object *title_left_btn,
- Evas_Object *title_right_btn)
+Evas_Object *ui_basic_view::set_content(Evas_Object *content, const char *title, const char *subtitle, Elm_Button *title_left_btn,
+ Elm_Button *title_right_btn)
{
Evas_Object *pcontent = this->set_content(content);
return pcontent;
}
-Evas_Object* ui_basic_view::unset_menu()
+Elm_Ctxpopup* ui_basic_view::unset_menu()
{
- Evas_Object *menu = this->ctxpopup;
+ Elm_Ctxpopup *menu = this->ctxpopup;
//FIXME: cancel callbacks
this->ctxpopup = NULL;
return menu;
}
-bool ui_basic_view::set_menu(Evas_Object *menu)
+bool ui_basic_view::set_menu(Elm_Ctxpopup *menu)
{
if (this->ctxpopup) evas_object_del(this->ctxpopup);
return true;
}
-bool ui_basic_view::set_toolbar(Evas_Object *toolbar)
+bool ui_basic_view::set_toolbar(Elm_Toolbar *toolbar)
{
- Evas_Object *layout = this->get_base();
+ Elm_Layout *layout = this->get_base();
//FIXME: Keep this toolbar inside of this view then set up when layout is created after.
if (!layout)
Evas_Object *ui_view::set_content(Evas_Object *content)
{
T pcontent = ui_iface_view::set_content(CONVERT_TO_T(content));
- return static_cast<Evas_Object *>(pcontent);
+ return CONVERT_TO_EO(pcontent);
}
Evas_Object *ui_view::get_base()
//FIXME: is it correct to define here?
#define EDJ_PATH "/usr/share/edje/ui-viewmgr/ui-viewmgr.edj"
-bool ui_viewmgr::create_base_layout(Evas_Object *conform, const char *style)
+bool ui_viewmgr::create_base_layout(Elm_Conformant *conform, const char *style)
{
char buf[128];
- Evas_Object *layout = elm_layout_add(conform);
+ Elm_Layout *layout = elm_layout_add(conform);
if (!layout) return false;
//FIXME: Is it C programming style? need to change?
return true;
}
-Evas_Object *ui_viewmgr::set_transition_layout(string transition_style)
+Elm_Layout *ui_viewmgr::set_transition_layout(string transition_style)
{
- Evas_Object *effect_layout = NULL;
+ Elm_Layout *effect_layout = NULL;
elm_object_part_content_unset(this->get_base(), "pcontent");
elm_object_part_content_unset(this->get_base(), "content");
if (effect_map.size()) effect_layout = effect_map.find(transition_style)->second;
//Conformant content change to current effect layout and change to hide prev layout.
- Evas_Object *playout = elm_object_part_content_unset(this->conform, "elm.swallow.content");
+ Elm_Layout *playout = elm_object_part_content_unset(this->conform, "elm.swallow.content");
evas_object_hide(playout);
if (!effect_layout)
{
//Create and add effect_layouts in map here.
//FIXME: If we have to support many effects, this logic should be changed.
- effect_map.insert(pair<string, Evas_Object *>("default", this->layout));
-
+ effect_map.insert(pair<string, Elm_Layout *>("default", this->layout));
this->create_base_layout(this->get_conformant(), transition_style.c_str());
-
- effect_map.insert(pair<string, Evas_Object *>(transition_style, this->layout));
+ effect_map.insert(pair<string, Elm_Layout *>(transition_style, this->layout));
}
else
{
if (this->indicator == indicator) return false;
this->indicator = indicator;
- Evas_Object *window = this->get_window();
- Evas_Object *conform = this->get_conformant();
+ Elm_Win *window = this->get_window();
+ Elm_Conformant *conform = this->get_conformant();
switch (indicator)
{
return true;
}
-bool ui_viewmgr::create_conformant(Evas_Object *win)
+bool ui_viewmgr::create_conformant(Elm_Win *win)
{
- Evas_Object *conform = elm_conformant_add(win);
+ Elm_Conformant *conform = elm_conformant_add(win);
if (!conform) return false;
evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
}
//Choose an effect layout.
- Evas_Object *effect = this->set_transition_layout(view->get_transition_style());
+ Elm_Layout *effect = this->set_transition_layout(view->get_transition_style());
if (!effect) {
LOGE("invalid effect transition style?! = %s", view->get_transition_style());
this->pop_view_finished(pview);
}
//Choose an effect layout.
- Evas_Object *effect = this->set_transition_layout(view->get_transition_style());
+ Elm_Layout *effect = this->set_transition_layout(view->get_transition_style());
if (!effect) {
LOGE("invalid effect transition style?! = %s", view->get_transition_style());
this->active_top_view();