*
* @return true if succeed.
*/
- virtual bool create(Evas_Object* parent, void* param)=0;
+ virtual bool create(Evas_Object *parent, void *param) = 0;
/**
* @brief Destroys this class instance and deletes evas object.
*/
- virtual void destroy()=0;
+ virtual void destroy() = 0;
/**
* @brief Get the evas object created.
*
* @return evas object created.
*/
- virtual Evas_Object* getEvasObj()=0;
+ virtual Evas_Object *getEvasObj() = 0;
protected:
/**
* @code
*
* // main.cpp
-* WAPP_ASSIST_EXPORT int main( int argc, char* argv[] )
+* WAPP_ASSIST_EXPORT int main(int argc, char *argv[])
* {
* MyApp app;
-* int ret = app.start( argc, argv );
+* int ret = app.start(argc, argv);
* return ret;
* }
* @endcode
*
* @return result
*/
- int start( int argc, char* argv[] );
+ int start(int argc, char *argv[]);
protected:
/**
*
* @return result.
*/
- virtual int onStart( int argc, char* argv[] );
+ virtual int onStart(int argc, char *argv[]);
/**
* @brief Called when the application created.
* @param[in] request Handle of request information.
* @param[in] firstLaunch True, if it is called after creation.
*/
- virtual void onAppControl(app_control_h request, bool firstLaunch );
+ virtual void onAppControl(app_control_h request, bool firstLaunch);
/**
* @brief Gets the window class instance of the application.
*
* @return The pointer to the window.
*/
- WWindow* getWindow();
+ WWindow *getWindow();
/**
* @brief Attaches a window to the application.
* @param[in] win A pointer to the window to attach.
* @return True if the window attached successfully, else false.
*/
- bool attachWindow(WWindow* win);
+ bool attachWindow(WWindow *win);
private:
WDECLARE_PRIVATE_IMPL(WApp);
WDISABLE_COPY_AND_ASSIGN(WApp);
-
};
#endif /* _WAPP_H_ */
*
* @return 0 on success, otherwise error.
*/
- int addEventHandler( app_event_type_e eventType, const std::function<void (app_event_info_h eventInfo, void* userData)>& handlerFunc, void* userData );
+ int addEventHandler(app_event_type_e eventType, const std::function<void(app_event_info_h eventInfo, void *userData)>& handlerFunc, void *userData);
/**
* @brief Remove application event handler.
private:
WDECLARE_PRIVATE_IMPL(WAppEventHandler);
WDISABLE_COPY_AND_ASSIGN(WAppEventHandler);
-
};
#endif /* _WAPP_EVENT_HANDLER_H_ */
*
* @return The class name.
*/
- virtual const char* getClassName();
+ virtual const char *getClassName();
/**
* @brief Initialize and creates the control. onCreate will be called subsequently.
*
* @see onCreate()
*/
- bool create(Evas_Object* parent, void* param );
+ bool create(Evas_Object *parent, void *param);
/**
* @brief Destroy the control. The linked evas object will be delete together.
*
* @return The pointer to evas object.
*/
- Evas_Object* getEvasObj();
+ Evas_Object *getEvasObj();
/**
* @brief Get evas object of this class for read-only reference.
*
* @return The read-only pointer to evas object.
*/
- const Evas_Object* getConstEvasObj() const;
+ const Evas_Object *getConstEvasObj() const;
/**
* @brief Set the name of the instance.
*
* @param[in] name Name.
*/
- void setName( const char* name);
+ void setName(const char *name);
/**
* @brief Get the name of the instance.
*
* @return The control name.
*/
- const char* getName();
+ const char *getName();
/**
* @brief Return weak pointer of this instance to refer it safe.
*
* @see destroyPopup()
*/
- void attachPopup( WControl* popup );
+ void attachPopup(WControl *popup);
/**
* @brief Destroy pop-up. Use this method when you want to destroy pop-up explicitly.
* @see create()
* @see onCreated()
*/
- virtual Evas_Object* onCreate( Evas_Object* parent, void* param ) = 0;
+ virtual Evas_Object *onCreate(Evas_Object *parent, void *param) = 0;
/**
* @brief Override this method to do something after evas object is created.
private:
WDECLARE_PRIVATE_IMPL(WControl);
WDISABLE_COPY_AND_ASSIGN(WControl);
-
};
/**
* @return The pointer to WControl class instance.
* It will be NULL, if no instance is related.
*/
-WAPP_ASSIST_EXPORT WControl* WControl_getInstanceFromEvasObj( Evas_Object* obj );
+WAPP_ASSIST_EXPORT WControl *WControl_getInstanceFromEvasObj(Evas_Object *obj);
#endif /* _WCONTROL_H_ */
#define WERROR(fmt, args...) LOGE(WCOLOR_RED "* Critical * " fmt WCOLOR_END, ##args)
#define WHIT() LOGD(WCOLOR_BLUE ">>>HIT<<<" WCOLOR_END)
-#define WHITM(fmt, args... ) LOGD(WCOLOR_BLUE ">>>HIT<<<" fmt WCOLOR_END, ##args)
+#define WHITM(fmt, args...) LOGD(WCOLOR_BLUE ">>>HIT<<<" fmt WCOLOR_END, ##args)
#define WENTER() LOGD(WCOLOR_GREEN "BEGIN >>>>" WCOLOR_END)
#define WLEAVE() LOGD(WCOLOR_GREEN "END <<<<" WCOLOR_END)
#define WSERROR(fmt, args...) SECURE_LOGE(WCOLOR_RED "* Critical * " fmt WCOLOR_END, ##args)
#define WPRET_VM(expr, val, fmt, arg...) do { \
- if (expr) { \
- WERROR(fmt, ##arg); \
- return (val); \
- } \
- } while (0)
+ if (expr) { \
+ WERROR(fmt, ##arg); \
+ return (val); \
+ } \
+ } while (0)
#define WPRET_M(expr, fmt, arg...) do { \
- if (expr) { \
- WERROR(fmt, ##arg); \
- return; \
- } \
- } while (0)
+ if (expr) { \
+ WERROR(fmt, ##arg); \
+ return; \
+ } \
+ } while (0)
#define WASSERT(expr) do { \
- if(!(expr)) \
- {\
- WERROR( "WASSERT!" );\
+ if (!(expr)) { \
+ WERROR("WASSERT!");\
assert((expr)); \
- }\
- }while(0);
+ } \
+ } while (0);
-#define WASSERT_EX(expr, fmt, args... ) do { \
- if(!(expr)) \
- {\
- WERROR( "WASSERT! " fmt, ##args);\
+#define WASSERT_EX(expr, fmt, args...) do { \
+ if (!(expr)) { \
+ WERROR("WASSERT! " fmt, ##args);\
assert((expr)); \
- }\
- }while(0);
+ } \
+ } while (0);
WAPP_ASSIST_EXPORT int WAppAssist_getMajorVersion();
WAPP_ASSIST_EXPORT int WAppAssist_getMinorVersion();
WAPP_ASSIST_EXPORT int WAppAssist_getPatchVersion();
-WAPP_ASSIST_EXPORT const char* WAppAssist_getVersion();
+WAPP_ASSIST_EXPORT const char *WAppAssist_getVersion();
-#define WDISABLE_COPY_AND_ASSIGN( A ) \
- A( const A& ) = delete; \
- const A& operator=( const A& ) = delete
+#define WDISABLE_COPY_AND_ASSIGN(A) \
+ A(const A&) = delete; \
+ const A& operator=(const A&) = delete
-#define WDECLARE_PRIVATE_IMPL( A ) \
- class __##A##Impl* __pv; \
+#define WDECLARE_PRIVATE_IMPL(A) \
+ class __##A##Impl *__pv; \
friend class __##A##Impl
*
* @return Evas object.
*/
- virtual Evas_Object* getEvasObj() = 0;
+ virtual Evas_Object *getEvasObj() = 0;
protected:
virtual ~IWEvasObject(){};
*
* @see WEvasObjectPtr.
*/
-WAPP_ASSIST_EXPORT WEvasObjectPtr WEvasObject_getWeakPtr( Evas_Object* obj );
+WAPP_ASSIST_EXPORT WEvasObjectPtr WEvasObject_getWeakPtr(Evas_Object *obj);
*
* @see getItemClassStatic()
*/
- virtual Elm_Genlist_Item_Class* getItemClassNew();
+ virtual Elm_Genlist_Item_Class *getItemClassNew();
/**
* @brief Override this method to create Elm_Genlist_Item_Class structure.
*
* @see getItemClassNew()
*/
- virtual Elm_Genlist_Item_Class* getItemClassStatic();
+ virtual Elm_Genlist_Item_Class *getItemClassStatic();
/**
* @brief Get Elm_Object_Item of this item instance after it is append to genlist.
*
* @see setElmObjectItem()
*/
- Elm_Object_Item* getElmObjectItem();
+ Elm_Object_Item *getElmObjectItem();
/**
* @brief Set Elm_Object_Item, which is returned when this item is appended to genlist.
*
* @see getElmObjectItem()
*/
- void setElmObjectItem( Elm_Object_Item* objItem );
+ void setElmObjectItem(Elm_Object_Item *objItem);
/**
* @brief This is static callback function to be used to append item to the genlist.
- * Then this will call onSelect( Elm_Object_Item* item ) method when this callback is invoked.
+ * Then this will call onSelect(Elm_Object_Item *item) method when this callback is invoked.
*
* @param[in] data Genlist select callback parameter.
* @param[in] obj Genlist select callback parameter.
* @param[in] event_info Genlist select callback parameter.
*
- * @see onSelect( Elm_Object_Item* item )
+ * @see onSelect(Elm_Object_Item *item)
*/
static void selectCb(void *data, Evas_Object *obj, void *event_info);
*
* @see selectCb()
*/
- virtual void onSelect( Elm_Object_Item* objItem );
+ virtual void onSelect(Elm_Object_Item *objItem);
/**
* @brief Attache the pop-up to the view, which is the container view of this item.
*
* @return True the view is found and it is attached successfully.
*/
- bool attachToView( WControl* popup );
+ bool attachToView(WControl *popup);
private:
WDECLARE_PRIVATE_IMPL(WGenlistItem);
WDISABLE_COPY_AND_ASSIGN(WGenlistItem);
-
};
-#define WGENLIST_ITEM_DEL() [](void* data, Evas_Object* obj) \
+#define WGENLIST_ITEM_DEL() [](void *data, Evas_Object *obj) \
{ \
- WGenlistItem* item = static_cast<WGenlistItem*>(data); \
+ WGenlistItem *item = static_cast<WGenlistItem *>(data); \
delete item; \
}
*
* @see create()
*/
- void prepare(Evas_Object* win, Evas_Object* naviframe);
+ void prepare(Evas_Object *win, Evas_Object *naviframe);
/**
* @brief Append menu items.
*
* @return Appended item. NULL, if failed.
*/
- Elm_Object_Item* appendItem(const char* label, std::function< void()> selectItemCb);
+ Elm_Object_Item *appendItem(const char *label, std::function< void()> selectItemCb);
/**
* @brief Create and show menu pop-up.
virtual ~WMenuPopup();
private:
- virtual Evas_Object* onCreate(Evas_Object* parent, void* param);
+ virtual Evas_Object *onCreate(Evas_Object *parent, void *param);
virtual void onDestroy();
WDECLARE_PRIVATE_IMPL(WMenuPopup);
*
* @return The class name.
*/
- virtual const char* getClassName();
+ virtual const char *getClassName();
/**
* @brief Initialize and creates the evas object.
*
* @see onCreate()
*/
- bool create( Evas_Object* parent, void* param );
+ bool create(Evas_Object *parent, void *param);
/**
* @brief Destroy the instance. "onDestroy" will be called subsequently.
*
* @return The pointer to the evas object
*/
- Evas_Object* getEvasObj();
+ Evas_Object *getEvasObj();
/**
* @brief Set the name of this instance.
*
* @param[in] name The name to be set.
*/
- void setName( const char* name);
+ void setName(const char *name);
/**
* @brief Get the name of this instance.
*
* @return The name of the naviframe.
*/
- const char* getName();
+ const char *getName();
/**
* @brief Push the view instance into naviframe. "onPushToNaviframe" will be called subsequently.
*
* @see onPushToNaviframe
*/
- bool push( WView* view, const char* viewName = NULL, void* viewCreationParam = NULL );
+ bool push(WView *view, const char *viewName = NULL, void *viewCreationParam = NULL);
/**
* @brief Destroy all views stacked on naviframe.
*
* @see onCreate()
*/
- void setOnCreate( const std::function<Evas_Object*(Evas_Object*, void*)>& handlerFunc);
+ void setOnCreate(const std::function<Evas_Object *(Evas_Object *, void *)>& handlerFunc);
/**
* @brief Set the handler function pointer to override virtual
*
* @see onLastItemPop()
*/
- void setOnLastItemPop( const std::function<void(bool*)>& handlerFunc);
+ void setOnLastItemPop(const std::function<void(bool *)>& handlerFunc);
protected:
/**
* @param[in] param User data.
* @return The pointer to naviframe evas object created.
*/
- virtual Evas_Object* onCreate( Evas_Object* parent, void* param);
+ virtual Evas_Object *onCreate(Evas_Object *parent, void *param);
/**
* @brief Override this method to do something after evas object is created.
*
* @see push
*/
- virtual bool onPush( WView* view, void* viewParam);
+ virtual bool onPush(WView *view, void *viewParam);
/**
* @brief Override this method to do something before popping the view from the naviframe.
*
* @see onLastItemPop()
*/
- virtual bool onItemPop( WView* view, Elm_Object_Item* item);
+ virtual bool onItemPop(WView *view, Elm_Object_Item *item);
/**
* @brief Override this method to change how the application should work when last view is popped from naviframe.
*
* @see onItemPop()
*/
- virtual void onLastItemPop( bool* popOut );
+ virtual void onLastItemPop(bool *popOut);
/**
* @brief Get the pointer to the WWindow class instance.
* @return The pointer to the window instance. If the naviframe
* is the part of UG module, NULL will be returned.
*/
- WWindow* getWindow();
+ WWindow *getWindow();
protected:
/**
virtual ~WNaviframe();
private:
- static Eina_Bool __popCb( void* data, Elm_Object_Item* item);
+ static Eina_Bool __popCb(void *data, Elm_Object_Item *item);
WDECLARE_PRIVATE_IMPL(WNaviframe);
WDISABLE_COPY_AND_ASSIGN(WNaviframe);
-
};
#endif /* _WNAVI_FRAME_H_ */
* @param[in] title Title text.
* @param[in] textContent Content text.
*/
- WPopup( const char* title, const char* textContent );
+ WPopup(const char *title, const char *textContent);
/**
* @brief Set the title string of the pop-up.
*
* @see setContent()
*/
- void setTitle( const char* title );
+ void setTitle(const char *title);
/**
* @brief Set the content string of the pop-up.
*
* @see other setContent()
*/
- void setContent( const char* text );
+ void setContent(const char *text);
/**
* @brief Set the content of the pop-up with WControl instance.
*
* @see other setContent()
*/
- void setContent( WControl* control );
+ void setContent(WControl *control);
/**
* @brief Set the creation function of the content Evas Object of the pop-up.
*
* @see other setContent()
*/
- void setContent( const std::function<Evas_Object* (Evas_Object* parent)> contentCreateCb );
+ void setContent(const std::function<Evas_Object *(Evas_Object *parent)> contentCreateCb);
/**
* @brief Set the string ID's domain name to be automatically translated on language change.
*
* @param[in] textDomain Text domain name.
*
- * @see setTitle( const char* title)
- * @seesetContent( const char* text)
+ * @see setTitle(const char *title)
+ * @seesetContent(const char *text)
*/
- void setTextTranslatable( const char* textDomain );
+ void setTextTranslatable(const char *textDomain);
/**
* @brief Add buttons with button text string and button pressed callback function.
*
* @return True if succeeded.
*/
- bool addButton(const char* buttonText, const std::function<void (bool* destroyPopup)> buttonCb, const std::function<void (Evas_Object* button)> setPropertyCb = NULL );
+ bool addButton(const char *buttonText, const std::function<void(bool *destroyPopup)> buttonCb, const std::function<void(Evas_Object *button)> setPropertyCb = NULL);
/**
* @brief Add handler function when back button is pressed.
* If it returns true, pop-up will be closed, if not, remained.
*
*/
- void setOnBack( const std::function<void (bool* destroyPopup)> backCb );
+ void setOnBack(const std::function<void(bool *destroyPopup)> backCb);
/**
* @brief Add handler function to set more properties of pop-up.
*
* @return True if succeeded.
*/
- void setOnMoreProperties( const std::function<void(Evas_Object* popup)>& morePropertiesCb );
+ void setOnMoreProperties(const std::function<void(Evas_Object *popup)>& morePropertiesCb);
protected:
/**
*
* @return Evas object created.
*/
- virtual Evas_Object* onCreate(Evas_Object* parent, void* param);
+ virtual Evas_Object *onCreate(Evas_Object *parent, void *param);
/**
* @brief It is called when pop-up instance is deleted.
*
* @param[in] text Message text string.
*/
- WToastPopup(const char* text);
+ WToastPopup(const char *text);
/**
* @brief This is the constructor with message text and time-out time.
* @param[in] text Message text string.
* @param[in] timeout Time-out time to be destroyed. Unit is second.
*/
- WToastPopup(const char* text, double timeout);
+ WToastPopup(const char *text, double timeout);
private:
- virtual Evas_Object* onCreate(Evas_Object* parent, void* param);
+ virtual Evas_Object *onCreate(Evas_Object *parent, void *param);
virtual void onDestroy();
virtual ~WToastPopup();
/**
* @brief Timer types.
*/
- enum TimerType{
+ enum TimerType
+ {
IDLER, /**< Can be called multiple times with in one rendering cycle, based on system load */
ANIMATOR, /**< Called just once per rendering cycle */
TIMER, /**< Called just once per rendering cycle, if the "set time" is elapsed before next vsync */
* @param[in] timerFunc std::function object of worker function.
* @param[in] userData User data.
* @param[in] monitorObj UI object, like WView or WControl object, is to be monitored.
- * If it has been deleted,when callback function is called, the callback
+ * If it has been deleted, when callback function is called, the callback
* function will not do anything and just delete itself.
*
* @return WUiTimer instance created. If failed, NULL will be returned.
*/
- static WUiTimer* addIdler( const std::function<Eina_Bool (void*)>& timerFunc, void* userData, WUiObjectPtr monitorObj);
+ static WUiTimer *addIdler(const std::function<Eina_Bool(void *)>& timerFunc, void *userData, WUiObjectPtr monitorObj);
/**
* @brief Create a ANIMATOR type timer. It uses ecore_animator internally.
* @param[in] timerFunc std::function object of worker function.
* @param[in] userData User data.
* @param[in] monitorObj UI object, like WView or WControl object, is to be monitored.
- * If it has been deleted,when callback function is called, the callback
+ * If it has been deleted, when callback function is called, the callback
* function will not do anything and just delete itself.
*
* @return WUiTimer instance created. If failed, NULL will be returned.
*/
- static WUiTimer* addAnimator( const std::function<Eina_Bool (void*)>& timerFunc, void* userData, WUiObjectPtr monitorObj );
+ static WUiTimer *addAnimator(const std::function<Eina_Bool(void *)>& timerFunc, void *userData, WUiObjectPtr monitorObj);
/**
* @brief Create a timer. It uses ecore_timer internally.
* @param[in] timerFunc std::function object of worker function.
* @param[in] userData User data.
* @param[in] monitorObj UI object, like WView or WControl object, is to be monitored.
- * If it has been deleted,when callback function is called, the callback
+ * If it has been deleted, when callback function is called, the callback
* function will not do anything and just delete itself.
*
* @return WUiTimer instance created. If failed, NULL will be returned.
*/
- static WUiTimer* addTimer( double interval, const std::function<Eina_Bool (void*)>& timerFunc, void* userData, WUiObjectPtr monitorObj );
+ static WUiTimer *addTimer(double interval, const std::function<Eina_Bool(void *)>& timerFunc, void *userData, WUiObjectPtr monitorObj);
/**
* @brief Create a JOB type timer. It uses ecore_job internally.
* @param[in] timerFunc std::function object of worker function.
* @param[in] userData User data.
* @param[in] monitorObj UI object, like WView or WControl object, is to be monitored.
- * If it has been deleted,when callback function is called, the callback
+ * If it has been deleted, when callback function is called, the callback
* function will not do anything and just delete itself.
*
* @return WUiTimer instance created. If failed, NULL will be returned.
*/
- static WUiTimer* addJob( const std::function<void (void*)>& timerFunc, void* userData, WUiObjectPtr monitorObj );
+ static WUiTimer *addJob(const std::function<void(void *)>& timerFunc, void *userData, WUiObjectPtr monitorObj);
private:
WUiTimer();
WDECLARE_PRIVATE_IMPL(WUiTimer);
WDISABLE_COPY_AND_ASSIGN(WUiTimer);
-
};
#endif /* _WUI_TIMER_H_ */
*
* @param[in] name The instance name to be set.
*/
- explicit WView( const char* name );
+ explicit WView(const char *name);
/**
* @brief Get the class name.
*/
- virtual const char* getClassName();
+ virtual const char *getClassName();
/**
* @brief Create evas object which represents this view.
* @param[in] parent Parent evas object of the view.
* @param[in] viewParam User data.
*/
- bool create( Evas_Object* parent, void* viewParam );
+ bool create(Evas_Object *parent, void *viewParam);
/**
* @brief Destroy the class instance and deletes evas object.
*
* @return The pointer to the evas object.
*/
- Evas_Object* getEvasObj();
+ Evas_Object *getEvasObj();
/**
* @brief Set the name of the class instance.
*
* @see getName()
*/
- void setName( const char* name );
+ void setName(const char *name);
/**
* @brief Get the name of the class instance.
*
* @see setName()
*/
- const char* getName();
+ const char *getName();
/**
* @brief Set the title string of the view.
*
* @param[in] title String of the title to be set.
*/
- void setTitle( const char* title );
+ void setTitle(const char *title);
/**
* @brief Get the title string.
*
* @return Title string.
*/
- const char* getTitle();
+ const char *getTitle();
/**
* @brief Return weak pointer of this instance to refer it safe.
*
* @see destroyPopup()
*/
- void attachPopup( WControl* popup );
+ void attachPopup(WControl *popup);
/**
* @brief Destroy pop-up. Use this method when you want to destroy pop-up explicitly.
*
* @see onCreate()
*/
- void setOnCreate( const std::function<Evas_Object* (Evas_Object*, void*)>& handlerFunc );
+ void setOnCreate(const std::function<Evas_Object *(Evas_Object *, void *)>& handlerFunc);
/**
* @brief Set the handler function pointer to override virtual function
*
* @see onPushed()
*/
- void setOnPushed( const std::function<void (Elm_Object_Item*)>& handlerFunc );
+ void setOnPushed(const std::function<void(Elm_Object_Item *)>& handlerFunc);
protected:
/**
* @return The most parent evas object created in this method.
* It will be related to the class instance.
*/
- virtual Evas_Object* onCreate( Evas_Object* parent, void* viewParam );
+ virtual Evas_Object *onCreate(Evas_Object *parent, void *viewParam);
/**
* @brief Override this method to do something after evas object is created.
* @see %WNaviframe::push()
* @see onPushed()
*/
- virtual Elm_Object_Item* onPushToNaviframe( Evas_Object* naviFrame);
+ virtual Elm_Object_Item *onPushToNaviframe(Evas_Object *naviFrame);
/**
* @brief Called when this view instance evas object is pushed into naviframe.
* @see %WNaviframe::push()
* @see onPushToNaviframe()
*/
- virtual void onPushed(Elm_Object_Item* naviItem);
+ virtual void onPushed(Elm_Object_Item *naviItem);
/**
* @brief Called when the view evas object is popped from naviframe.
* @return The pointer to the window. If the view is the part of UG module,
* NULL will be returned.
*/
- WWindow* getWindow();
+ WWindow *getWindow();
/**
* @brief Get the WNaviframe class instance.
* @return the pointer to the WNaviframe class instance.
* If this view instance is not pushed into naviframe, it will be NULL.
*/
- WNaviframe* getNaviframe();
+ WNaviframe *getNaviframe();
/**
* @brief Get a navi item.
* @return The pointer to navi item. If this view instance
* is not pushed into naviframe, it will be NULL.
*/
- Elm_Object_Item* getNaviItem();
+ Elm_Object_Item *getNaviItem();
/**
* @brief Pop out this view instance evas object from naviframe.
* @see %WNaviframe::push()
* @see onPushed()
*/
- bool enableMoreButton( Elm_Object_Item* naviItem, Evas_Smart_Cb clickedCb, void* userData );
+ bool enableMoreButton(Elm_Object_Item *naviItem, Evas_Smart_Cb clickedCb, void *userData);
protected:
/**
virtual ~WView();
private:
- bool __callPushedHandlerFunc(Elm_Object_Item* naviItem);
+ bool __callPushedHandlerFunc(Elm_Object_Item *naviItem);
void __destroy();
WDECLARE_PRIVATE_IMPL(WView);
WDISABLE_COPY_AND_ASSIGN(WView);
friend class WNaviframe;
- friend Evas_Object* WView_getWindowBaseLayoutEvasObj( WView* view );
- friend Evas_Object* WView_getWindowEvasObj( WView* view );
- friend void WView_setContainerProperties( WView* view, WWindow* win, WNaviframe* naviframe );
- friend void WView_setContainerNaviItemProperty( WView* view, Elm_Object_Item* item );
+ friend Evas_Object *WView_getWindowBaseLayoutEvasObj(WView *view);
+ friend Evas_Object *WView_getWindowEvasObj(WView *view);
+ friend void WView_setContainerProperties(WView *view, WWindow *win, WNaviframe *naviframe);
+ friend void WView_setContainerNaviItemProperty(WView *view, Elm_Object_Item *item);
};
/**
*
* @return NULL, if no view class instance is related.
*/
-WAPP_ASSIST_EXPORT WView* WView_getInstanceFromEvasObj(Evas_Object* obj);
+WAPP_ASSIST_EXPORT WView *WView_getInstanceFromEvasObj(Evas_Object *obj);
/**
* @brief Get window base layout.
*
* @return Window base layout.
*/
-WAPP_ASSIST_EXPORT Evas_Object* WView_getWindowBaseLayoutEvasObj( WView* view );
+WAPP_ASSIST_EXPORT Evas_Object *WView_getWindowBaseLayoutEvasObj(WView *view);
/**
* @brief Get window evas object.
*
* @return Window evas object.
*/
-WAPP_ASSIST_EXPORT Evas_Object* WView_getWindowEvasObj( WView* view );
+WAPP_ASSIST_EXPORT Evas_Object *WView_getWindowEvasObj(WView *view);
/**
* @brief Set the container class properties to the view.
* @param[in] win WWindow instance.
* @param[in] naviframe WNaviframe instance.
*/
-WAPP_ASSIST_EXPORT void WView_setContainerProperties( WView* view, WWindow* win, WNaviframe* naviframe );
+WAPP_ASSIST_EXPORT void WView_setContainerProperties(WView *view, WWindow *win, WNaviframe *naviframe);
/**
* @brief Set the container class navi item property to the view.
* @param[in] view WView instance to set these properties
* @param[in] item Navi item pointer of container view which is pushed into naviframe.
*/
-WAPP_ASSIST_EXPORT void WView_setContainerNaviItemProperty( WView* view, Elm_Object_Item* item );
+WAPP_ASSIST_EXPORT void WView_setContainerNaviItemProperty(WView *view, Elm_Object_Item *item);
#endif /* _WVIEW_H_ */
* @param[in] name The window name.
* @param[in] winType The type of the window.
*/
- WWindow(const char* name, Elm_Win_Type winType);
+ WWindow(const char *name, Elm_Win_Type winType);
/**
* @brief Constructor.
* @param[in] conform Pointer to evas object conformant.
* @param[in] baseLayout Pointer to evas object base layout.
*/
- WWindow(Evas_Object* win, Evas_Object* conform, Evas_Object* baseLayout);
+ WWindow(Evas_Object *win, Evas_Object *conform, Evas_Object *baseLayout);
/**
* @brief Get the class name of this class.
*
* @return The class name.
*/
- virtual const char* getClassName();
+ virtual const char *getClassName();
/**
* @brief Create the windows
*
* @see onCreateWin()
*/
- Evas_Object* getEvasObj();
+ Evas_Object *getEvasObj();
/**
* @brief Get the base layout evas object.
*
* @see onCreateBaseLayout()
*/
- Evas_Object* getBaseLayoutEvasObj();
+ Evas_Object *getBaseLayoutEvasObj();
/**
* @brief Get the conformant evas object.
*
* @return The pointer to the evas object of the conformant.
*/
- Evas_Object* getConformantEvasObj();
+ Evas_Object *getConformantEvasObj();
/**
* @brief Attache base UI object, which can be WNaviframe or WView instance.
*
* @see getBaseUiObject()
*/
- bool attachBaseUiObject( IWUiObject* baseObj, void* creationParam = NULL );
+ bool attachBaseUiObject(IWUiObject *baseObj, void *creationParam = NULL);
/**
* @brief Get the base UI object attached.
*
* @see attachBaseUiObject()
*/
- IWUiObject* getBaseUiObject();
+ IWUiObject *getBaseUiObject();
/**
* @brief Detach the base UI object.
*
* @return The base UI object, which should be deleted explicitly later.
*/
- IWUiObject* detachBaseUiObject();
+ IWUiObject *detachBaseUiObject();
/**
* @brief Destroy the base UI object.
*
* @return The name of the window.
*/
- const char* getName();
+ const char *getName();
/**
* @brief Get the type of the window.
*
* @see onCreateWin()
*/
- void setOnCreateWin( const std::function<Evas_Object* ()>& handlerFunc );
+ void setOnCreateWin(const std::function<Evas_Object *()>& handlerFunc);
/**
* @brief Set the handler function pointer to override virtual function
*
* @see onCreateBaseLayout()
*/
- void setOnCreateBaseLayout( const std::function<Evas_Object* (Evas_Object*, Evas_Object** outConformant)>& handlerFunc );
+ void setOnCreateBaseLayout(const std::function<Evas_Object *(Evas_Object *, Evas_Object **outConformant)>& handlerFunc);
protected:
/**
*
* @see create()
*/
- virtual Evas_Object* onCreateWin();
+ virtual Evas_Object *onCreateWin();
/**
* @brief Called when create method is called to create base layout.
*
* @return The pointer to the evas object of base layout created.
*/
- virtual Evas_Object* onCreateBaseLayout(Evas_Object* win, Evas_Object** outConformant);
+ virtual Evas_Object *onCreateBaseLayout(Evas_Object *win, Evas_Object **outConformant);
/**
* @brief Called when the window is destroyed
__WAppImpl():__window(NULL), __firstLaunch(true) {}
~__WAppImpl();
public:
- WWindow* __window;
+ WWindow *__window;
bool __firstLaunch;
//
- static bool __onCreate( void* data);
- static void __onTerminate( void* data);
- static void __onPause( void* data);
- static void __onResume( void* data);
- static void __onAppControl( app_control_h request, void* data);
+ static bool __onCreate(void *data);
+ static void __onTerminate(void *data);
+ static void __onPause(void *data);
+ static void __onResume(void *data);
+ static void __onAppControl(app_control_h request, void *data);
};
__WAppImpl::~__WAppImpl()
{
-
}
-bool __WAppImpl::__onCreate( void* data)
+bool __WAppImpl::__onCreate(void *data)
{
WHIT();
elm_app_base_scale_set(APP_BASE_SCALE);
elm_config_accel_preference_set("3d");
- auto pApp = (WApp*)data;
+ auto pApp = (WApp *)data;
return pApp->onCreate();
}
-void __WAppImpl::__onTerminate( void* data)
+void __WAppImpl::__onTerminate(void *data)
{
WHIT();
- auto pApp = (WApp*)data;
+ auto pApp = (WApp *)data;
pApp->onTerminate();
// To reverse destruction order
// It will destroy View and then Naviframe instance before the window is destroyed.
- if (pApp->__pv->__window)
+ if (pApp->__pv->__window) {
pApp->__pv->__window->destroyBaseUiObject();
+ }
// window evas object "del" callback will be called by system.
}
-void __WAppImpl::__onPause( void* data)
+void __WAppImpl::__onPause(void *data)
{
WHIT();
- auto pApp = (WApp*)data;
+ auto pApp = (WApp *)data;
pApp->onPause();
-
}
-void __WAppImpl::__onResume( void* data)
+void __WAppImpl::__onResume(void *data)
{
WHIT();
- auto pApp = (WApp*)data;
+ auto pApp = (WApp *)data;
pApp->onResume();
-
}
-void __WAppImpl::__onAppControl( app_control_h request, void* data)
+void __WAppImpl::__onAppControl(app_control_h request, void *data)
{
WHIT();
- auto pApp = (WApp*)data;
- pApp->onAppControl( request, pApp->__pv->__firstLaunch );
+ auto pApp = (WApp *)data;
+ pApp->onAppControl(request, pApp->__pv->__firstLaunch);
//
pApp->__pv->__firstLaunch = false;
-
}
WApp::WApp()
{
- WDEBUG("app-assist version=%s", WAppAssist_getVersion() );
+ WDEBUG("app-assist version=%s", WAppAssist_getVersion());
__pv = new __WAppImpl();
}
delete __pv;
}
-int WApp::start( int argc, char* argv[] )
+int WApp::start(int argc, char *argv[])
{
- return onStart( argc, argv );
+ return onStart(argc, argv);
}
-WWindow* WApp::getWindow()
+WWindow *WApp::getWindow()
{
return __pv->__window;
}
-bool WApp::attachWindow(WWindow* win)
+bool WApp::attachWindow(WWindow *win)
{
- WASSERT( __pv->__window == NULL);
+ WASSERT(__pv->__window == NULL);
__pv->__window = win;
return win->create();
}
void WApp::onAppControl(app_control_h request, bool firstLaunch)
{
- Evas_Object* win = getWindow()->getEvasObj();
- if( win ) {
- elm_win_activate( win);
- evas_object_show( win);
+ Evas_Object *win = getWindow()->getEvasObj();
+ if (win) {
+ elm_win_activate(win);
+ evas_object_show(win);
}
}
-int WApp::onStart( int argc, char* argv[] )
+int WApp::onStart(int argc, char *argv[])
{
ui_app_lifecycle_callback_s cb;
- memset( &cb, 0, sizeof(cb));
+ memset(&cb, 0, sizeof(cb));
cb.create = __WAppImpl::__onCreate;
cb.terminate = __WAppImpl::__onTerminate;
cb.pause = __WAppImpl::__onPause;
cb.resume = __WAppImpl::__onResume;
cb.app_control = __WAppImpl::__onAppControl;
- return ui_app_main( argc, argv, &cb, this);
-
+ return ui_app_main(argc, argv, &cb, this);
}
//
app_event_handler_h __handle;
//
- void* __userData;
- std::function<void (app_event_info_h, void*)> __eventHandlerFunc;
+ void *__userData;
+ std::function<void(app_event_info_h, void *)> __eventHandlerFunc;
- static void __eventCb( app_event_info_h eventInfo, void* userData);
+ static void __eventCb(app_event_info_h eventInfo, void *userData);
void __removeEventHandler();
};
}
-void __WAppEventHandlerImpl::__eventCb( app_event_info_h eventInfo, void* userData)
+void __WAppEventHandlerImpl::__eventCb(app_event_info_h eventInfo, void *userData)
{
- auto p = (__WAppEventHandlerImpl*)userData;
- p->__eventHandlerFunc( eventInfo, p->__userData );
+ auto p = (__WAppEventHandlerImpl *)userData;
+ p->__eventHandlerFunc(eventInfo, p->__userData);
}
void __WAppEventHandlerImpl::__removeEventHandler()
{
- if( __handle ) {
- ui_app_remove_event_handler( __handle );
+ if (__handle) {
+ ui_app_remove_event_handler(__handle);
__handle = NULL;
__userData = NULL;
-
}
}
}
-int WAppEventHandler::addEventHandler( app_event_type_e eventType, const std::function<void (app_event_info_h, void*)>& handlerFunc, void* userData )
+int WAppEventHandler::addEventHandler(app_event_type_e eventType, const std::function<void(app_event_info_h, void *)>& handlerFunc, void *userData)
{
removeEventHandler();
__pv->__eventHandlerFunc = handlerFunc;
__pv->__userData = userData;
- return ui_app_add_event_handler( &__pv->__handle, eventType, __pv->__eventCb, __pv );
+ return ui_app_add_event_handler(&__pv->__handle, eventType, __pv->__eventCb, __pv);
}
void WAppEventHandler::removeEventHandler()
~__WControlImpl();
public:
//
- Evas_Object* __obj;
- char* __name;
- std::shared_ptr<IWUiObject>* __selfPtr;
- std::weak_ptr<IWUiObject>* __popupMonitor;
+ Evas_Object *__obj;
+ char *__name;
+ std::shared_ptr<IWUiObject> *__selfPtr;
+ std::weak_ptr<IWUiObject> *__popupMonitor;
//
- static void __objDelCb( void* data, Evas* evas, Evas_Object* obj, void* event_info);
-
+ static void __objDelCb(void *data, Evas *evas, Evas_Object *obj, void *event_info);
};
__WControlImpl::__WControlImpl()
{
__WControlImpl::~__WControlImpl()
{
- if(__name)
+ if (__name) {
free(__name);
+ }
- if( __popupMonitor ) {
- if( auto p = __popupMonitor->lock() ) {
+ if (__popupMonitor) {
+ if (auto p = __popupMonitor->lock()) {
p->destroy();
}
}
delete __selfPtr;
}
-void __WControlImpl::__objDelCb( void* data, Evas* evas, Evas_Object* obj, void* event_info)
+void __WControlImpl::__objDelCb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
{
- auto ctrl = (WControl*)data;
+ auto ctrl = (WControl *)data;
ctrl->onDestroy();
delete ctrl;
WControl::~WControl()
{
- if( __pv->__name) {
- WDEBUG( "name=%s", __pv->__name );
+ if (__pv->__name) {
+ WDEBUG("name=%s", __pv->__name);
} else {
WHIT();
}
//
delete __pv;
}
-const char* WControl::getClassName()
+const char *WControl::getClassName()
{
return __CLASS_NAME;
}
-bool WControl::create( Evas_Object* parent, void* param )
+bool WControl::create(Evas_Object *parent, void *param)
{
- if( __pv->__name)
- WDEBUG( "name=%s", __pv->__name );
- else
+ if (__pv->__name) {
+ WDEBUG("name=%s", __pv->__name);
+ } else {
WHIT();
+ }
- if( __pv->__obj ) {
+ if (__pv->__obj) {
WDEBUG("Already created!");
return true;
}
- __pv->__obj = onCreate( parent, param );
+ __pv->__obj = onCreate(parent, param);
- if( __pv->__obj == NULL)
+ if (__pv->__obj == NULL) {
return false;
+ }
- if( __pv->__name ) // for easy debugging
- {
- evas_object_name_set( __pv->__obj, __pv->__name );
+ if (__pv->__name) { // for easy debugging
+ evas_object_name_set(__pv->__obj, __pv->__name);
}
- evas_object_data_set( __pv->__obj, WKEY_CONTROL_INSTANCE, this );
- evas_object_event_callback_add( __pv->__obj, EVAS_CALLBACK_DEL, __WControlImpl::__objDelCb, this);
+ evas_object_data_set(__pv->__obj, WKEY_CONTROL_INSTANCE, this);
+ evas_object_event_callback_add(__pv->__obj, EVAS_CALLBACK_DEL, __WControlImpl::__objDelCb, this);
//
// Do not place this before "evas_object_event_callback_add",
// The reason is that if additional del callback is added at child class, it should be called first to keep state the class object is still alive.
void WControl::destroy()
{
- if(__pv->__obj) {
+ if (__pv->__obj) {
evas_object_del(__pv->__obj);
// Do not leave any code here.
// After executing upper statement "evas_object_del", this object will be deleted at evas object deletion callback!
}
}
-Evas_Object* WControl::getEvasObj()
+Evas_Object *WControl::getEvasObj()
{
return __pv->__obj;
}
-const Evas_Object* WControl::getConstEvasObj() const
+const Evas_Object *WControl::getConstEvasObj() const
{
return __pv->__obj;
}
-void WControl::setName(const char* name)
+void WControl::setName(const char *name)
{
- if( __pv->__name) {
- free( __pv->__name);
+ if (__pv->__name) {
+ free(__pv->__name);
__pv->__name = NULL;
}
- if( name ) {
+ if (name) {
size_t len = strlen(name) + 1;
- __pv->__name = (char*)malloc(len);
- strncpy( __pv->__name, name, len);
+ __pv->__name = (char *)malloc(len);
+ strncpy(__pv->__name, name, len);
}
}
-const char* WControl::getName()
+const char *WControl::getName()
{
return __pv->__name;
}
std::weak_ptr<IWUiObject> WControl::getWeakPtr()
{
- if( __pv->__selfPtr ) {
+ if (__pv->__selfPtr) {
return std::weak_ptr<IWUiObject>(*__pv->__selfPtr);
}
- __pv->__selfPtr = new std::shared_ptr<IWUiObject>( this,[](IWUiObject* p){} );
+ __pv->__selfPtr = new std::shared_ptr<IWUiObject>(this, [](IWUiObject *p){});
return std::weak_ptr<IWUiObject>(*__pv->__selfPtr);
}
-void WControl::attachPopup( WControl* popup )
+void WControl::attachPopup(WControl *popup)
{
- Evas_Object* parent = NULL;
- Evas_Object* obj = getEvasObj();
- while( (obj = elm_object_parent_widget_get( obj )) != NULL ) {
- WView* view = WView_getInstanceFromEvasObj( obj );
- if( view != NULL ) {
- parent = WView_getWindowBaseLayoutEvasObj( view );
+ Evas_Object *parent = NULL;
+ Evas_Object *obj = getEvasObj();
+ while ((obj = elm_object_parent_widget_get(obj)) != NULL) {
+ WView *view = WView_getInstanceFromEvasObj(obj);
+ if (view != NULL) {
+ parent = WView_getWindowBaseLayoutEvasObj(view);
break;
}
}
- if( parent == NULL ) {
+ if (parent == NULL) {
WERROR("Cannot find parent View!");
// If the pop-up has been already created, the following statement will just return without creating pop-up.
- popup->create( elm_object_top_widget_get( getEvasObj() ), NULL);
+ popup->create(elm_object_top_widget_get(getEvasObj()), NULL);
} else {
// If the pop-up has been already created, the following statement will just return without creating pop-up.
- popup->create( parent, NULL );
+ popup->create(parent, NULL);
}
// destroy old popup after new popup created
destroyPopup();
- if( __pv->__popupMonitor == NULL)
+ if (__pv->__popupMonitor == NULL) {
__pv->__popupMonitor = new std::weak_ptr<IWUiObject>;
+ }
*__pv->__popupMonitor = popup->getWeakPtr();
}
void WControl::destroyPopup()
{
- if( __pv->__popupMonitor == NULL ) return;
+ if (__pv->__popupMonitor == NULL) {
+ return;
+ }
- if( auto p = __pv->__popupMonitor->lock() ) {
+ if (auto p = __pv->__popupMonitor->lock()) {
p->destroy();
__pv->__popupMonitor->reset();
}
}
-WControl* WControl_getInstanceFromEvasObj(Evas_Object* obj)
+WControl *WControl_getInstanceFromEvasObj(Evas_Object *obj)
{
- return (WControl*)evas_object_data_get(obj, WKEY_CONTROL_INSTANCE);
+ return (WControl *)evas_object_data_get(obj, WKEY_CONTROL_INSTANCE);
}
class __WEvasObjectImpl : public IWEvasObject
{
public:
- __WEvasObjectImpl(Evas_Object* obj):__evasObj(obj) { }
+ __WEvasObjectImpl(Evas_Object *obj):__evasObj(obj) { }
public:
- virtual Evas_Object* getEvasObj() { return __evasObj; }
+ virtual Evas_Object *getEvasObj() { return __evasObj; }
- static void __objDelCb( void* data, Evas* evas, Evas_Object* obj, void* event_info)
+ static void __objDelCb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
{
- auto p = (__WEvasObjectImpl*)data;
+ auto p = (__WEvasObjectImpl *)data;
delete p;
}
std::shared_ptr<IWEvasObject> __selfPtr;
- Evas_Object* __evasObj;
+ Evas_Object *__evasObj;
};
-std::weak_ptr<IWEvasObject> WEvasObject_getWeakPtr( Evas_Object* obj )
+std::weak_ptr<IWEvasObject> WEvasObject_getWeakPtr(Evas_Object *obj)
{
auto pImpl = new __WEvasObjectImpl(obj);
- std::shared_ptr<IWEvasObject> sp( pImpl,[](IWEvasObject* p){} );
+ std::shared_ptr<IWEvasObject> sp(pImpl, [](IWEvasObject *p){});
pImpl->__selfPtr = sp;
- evas_object_event_callback_add( obj, EVAS_CALLBACK_DEL, __WEvasObjectImpl::__objDelCb, pImpl);
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, __WEvasObjectImpl::__objDelCb, pImpl);
return std::weak_ptr<IWEvasObject>(pImpl->__selfPtr);
}
__objectItem = NULL; }
~__WGenlistItemImpl(){};
public:
- Elm_Object_Item* __objectItem;
-
+ Elm_Object_Item *__objectItem;
};
-WGenlistItem::WGenlistItem() : __pv( new __WGenlistItemImpl() )
+WGenlistItem::WGenlistItem() : __pv(new __WGenlistItemImpl())
{
}
delete __pv;
}
-Elm_Genlist_Item_Class* WGenlistItem::getItemClassNew()
+Elm_Genlist_Item_Class *WGenlistItem::getItemClassNew()
{
return NULL;
}
-Elm_Genlist_Item_Class* WGenlistItem::getItemClassStatic()
+Elm_Genlist_Item_Class *WGenlistItem::getItemClassStatic()
{
return NULL;
}
-void WGenlistItem::onSelect( Elm_Object_Item* objItem )
+void WGenlistItem::onSelect(Elm_Object_Item *objItem)
{
}
-Elm_Object_Item* WGenlistItem::getElmObjectItem()
+Elm_Object_Item *WGenlistItem::getElmObjectItem()
{
return __pv->__objectItem;
}
-void WGenlistItem::setElmObjectItem( Elm_Object_Item* objItem )
+void WGenlistItem::setElmObjectItem(Elm_Object_Item *objItem)
{
__pv->__objectItem = objItem;
}
void WGenlistItem::selectCb(void *data, Evas_Object *obj, void *event_info)
{
- Elm_Object_Item* genlistItem = (Elm_Object_Item*) event_info;
+ Elm_Object_Item *genlistItem = (Elm_Object_Item *) event_info;
elm_genlist_item_selected_set(genlistItem, EINA_FALSE);
- auto item = (WGenlistItem*)data;
- item->onSelect( genlistItem );
+ auto item = (WGenlistItem *)data;
+ item->onSelect(genlistItem);
}
-bool WGenlistItem::attachToView( WControl* popup )
+bool WGenlistItem::attachToView(WControl *popup)
{
- if( __pv->__objectItem == NULL ) {
+ if (__pv->__objectItem == NULL) {
WERROR("object item is not created!");
return false;
}
- Evas_Object* obj = elm_object_item_widget_get( __pv->__objectItem );
- while( (obj = elm_object_parent_widget_get( obj )) != NULL ) {
- WView* view = WView_getInstanceFromEvasObj( obj );
- if( view != NULL ) {
- view->attachPopup( popup );
+ Evas_Object *obj = elm_object_item_widget_get(__pv->__objectItem);
+ while ((obj = elm_object_parent_widget_get(obj)) != NULL) {
+ WView *view = WView_getInstanceFromEvasObj(obj);
+ if (view != NULL) {
+ view->attachPopup(popup);
return true;
}
}
~__WMenuPopupImpl();
public:
//
- Evas_Object* __win;
- Evas_Object* __navi;
- Evas_Object* __popup;
+ Evas_Object *__win;
+ Evas_Object *__navi;
+ Evas_Object *__popup;
std::vector<std::function< void()>> __vSelectItemCb;
void __popupMove();
- static void __popupSelectCb(void* data, Evas_Object* obj, void* event_info);
- static void __popupResizeCb(void* data, Evas* e, Evas_Object* obj, void* event_info);
- static void __popupWinRotateCb(void* data, Evas_Object* obj, void* event_info);
- static void __popupDismissedCb(void* data, Evas_Object* obj, void* event_info);
-
+ static void __popupSelectCb(void *data, Evas_Object *obj, void *event_info);
+ static void __popupResizeCb(void *data, Evas *e, Evas_Object *obj, void *event_info);
+ static void __popupWinRotateCb(void *data, Evas_Object *obj, void *event_info);
+ static void __popupDismissedCb(void *data, Evas_Object *obj, void *event_info);
};
__WMenuPopupImpl::__WMenuPopupImpl()
__WMenuPopupImpl::~__WMenuPopupImpl()
{
-
}
void __WMenuPopupImpl:: __popupMove()
{
WENTER();
- int y, w,h,w1,h1;
+ int y, w, h, w1, h1;
int rotate;
evas_object_geometry_get(NULL, NULL, &y, &w, &h);
elm_win_screen_size_get(__win, NULL, NULL, &w1, &h1);
rotate = elm_win_rotation_get(__win);
- if(rotate == 90)
+ if (rotate == 90) {
evas_object_move(__popup, h1/2, w1);
- else if(rotate == 270)
+ } else if (rotate == 270) {
evas_object_move(__popup, h1/2, w1);
- else
+ } else {
evas_object_move(__popup, w1/2, h1);
+ }
evas_object_show(__popup);
}
-void __WMenuPopupImpl::__popupSelectCb( void* data, Evas_Object* obj, void* event_info )
+void __WMenuPopupImpl::__popupSelectCb(void *data, Evas_Object *obj, void *event_info)
{
WENTER();
- auto p = (WMenuPopup*)WControl_getInstanceFromEvasObj(obj);
+ auto p = (WMenuPopup *)WControl_getInstanceFromEvasObj(obj);
const unsigned int itemIndex = reinterpret_cast<unsigned long long>(data);
if (p && p->__pv) {
p->__pv->__vSelectItemCb[itemIndex]();
evas_object_del(obj);
}
-void __WMenuPopupImpl::__popupResizeCb(void* data, Evas* e, Evas_Object* obj, void* event_info)
+void __WMenuPopupImpl::__popupResizeCb(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
WENTER();
- auto p = (WMenuPopup*)data;
+ auto p = (WMenuPopup *)data;
p->__pv->__popupMove();
}
-void __WMenuPopupImpl::__popupWinRotateCb(void* data, Evas_Object* obj, void* event_info)
+void __WMenuPopupImpl::__popupWinRotateCb(void *data, Evas_Object *obj, void *event_info)
{
WENTER();
- auto p = (WMenuPopup*)data;
+ auto p = (WMenuPopup *)data;
p->__pv->__popupMove();
}
-void __WMenuPopupImpl::__popupDismissedCb(void* data, Evas_Object* obj, void* event_info)
+void __WMenuPopupImpl::__popupDismissedCb(void *data, Evas_Object *obj, void *event_info)
{
WENTER();
- auto p = (WMenuPopup*)data;
+ auto p = (WMenuPopup *)data;
evas_object_del(p->getEvasObj());
}
-WMenuPopup::WMenuPopup() : __pv( new __WMenuPopupImpl() )
+WMenuPopup::WMenuPopup() : __pv(new __WMenuPopupImpl())
{
WHIT();
}
delete __pv;
}
-void WMenuPopup::prepare(Evas_Object* win, Evas_Object* naviframe)
+void WMenuPopup::prepare(Evas_Object *win, Evas_Object *naviframe)
{
__pv->__win = win;
__pv->__navi = naviframe;
- Evas_Object* popup = NULL;
+ Evas_Object *popup = NULL;
popup = elm_ctxpopup_add(__pv->__win);
elm_object_style_set(popup, "more/default");
elm_ctxpopup_auto_hide_disabled_set(popup, EINA_TRUE);
evas_object_smart_callback_add(popup, "language,changed", __WMenuPopupImpl::__popupDismissedCb, this);
__pv->__popup = popup;
-
}
-Elm_Object_Item* WMenuPopup::appendItem( const char* label, std::function< void()> selectCb )
+Elm_Object_Item *WMenuPopup::appendItem(const char *label, std::function<void()> selectCb)
{
WASSERT(__pv->__popup);
__pv->__vSelectItemCb.push_back(selectCb);
- return elm_ctxpopup_item_append(__pv->__popup, label, NULL, __WMenuPopupImpl::__popupSelectCb, (void*)(__pv->__vSelectItemCb.size() - 1));
+ return elm_ctxpopup_item_append(__pv->__popup, label, NULL, __WMenuPopupImpl::__popupSelectCb, (void *)(__pv->__vSelectItemCb.size() - 1));
}
void WMenuPopup::createMenu()
{
- WControl::create(NULL,NULL);
+ WControl::create(NULL, NULL);
}
-Evas_Object* WMenuPopup::onCreate(Evas_Object* parent, void* param)
+Evas_Object *WMenuPopup::onCreate(Evas_Object *parent, void *param)
{
- if(__pv->__popup == NULL) {
+ if (__pv->__popup == NULL) {
WERROR("Not initialized!");
return NULL;
}
~__WNaviframeImpl();
public:
//
- char* __name;
- Evas_Object* __evasObj;
+ char *__name;
+ Evas_Object *__evasObj;
//
- std::function<Evas_Object*(Evas_Object*, void*)> __createHandler;
- std::function<void(bool*)> __lastItemPopHandler;
+ std::function<Evas_Object *(Evas_Object *, void *)> __createHandler;
+ std::function<void(bool *)> __lastItemPopHandler;
- static void __objDelCb( void* data, Evas* evas, Evas_Object* obj, void* event_info);
- static void __transitionFinishedCb(void* data, Evas_Object* obj, void* event_info);
+ static void __objDelCb(void *data, Evas *evas, Evas_Object *obj, void *event_info);
+ static void __transitionFinishedCb(void *data, Evas_Object *obj, void *event_info);
};
__WNaviframeImpl::__WNaviframeImpl():
}
__WNaviframeImpl::~__WNaviframeImpl()
{
- if( __name)
+ if (__name) {
free(__name);
+ }
}
-void __WNaviframeImpl::__objDelCb( void* data, Evas* evas, Evas_Object* obj, void* event_info)
+void __WNaviframeImpl::__objDelCb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
{
WHIT();
- auto frame = (WNaviframe*)data;
+ auto frame = (WNaviframe *)data;
frame->onDestroy();
//
delete frame;
}
-void __WNaviframeImpl::__transitionFinishedCb(void* data, Evas_Object* obj, void* event_info)
+void __WNaviframeImpl::__transitionFinishedCb(void *data, Evas_Object *obj, void *event_info)
{
WHIT();
}
-WNaviframe::WNaviframe() : __pv( new __WNaviframeImpl() )
+WNaviframe::WNaviframe() : __pv(new __WNaviframeImpl())
{
WHIT();
}
delete __pv;
}
-const char* WNaviframe::getClassName()
+const char *WNaviframe::getClassName()
{
return __CLASS_NAME;
}
-bool WNaviframe::create( Evas_Object* parent, void* param )
+bool WNaviframe::create(Evas_Object *parent, void *param)
{
- if( __pv->__evasObj ) {
+ if (__pv->__evasObj) {
WDEBUG("Already created!");
return true;
}
__pv->__evasObj = NULL;
- if( __pv->__createHandler )
+ if (__pv->__createHandler) {
__pv->__evasObj = __pv->__createHandler(parent, param);
- else
+ } else {
__pv->__evasObj = onCreate(parent, param);
+ }
- if(__pv->__evasObj == NULL) {
+ if (__pv->__evasObj == NULL) {
WERROR("No frame object created!");
return false;
}
- evas_object_data_set( __pv->__evasObj, WKEY_FRAME_INSTANCE, this );
- evas_object_event_callback_add( __pv->__evasObj, EVAS_CALLBACK_DEL, __WNaviframeImpl::__objDelCb, this);
+ evas_object_data_set(__pv->__evasObj, WKEY_FRAME_INSTANCE, this);
+ evas_object_event_callback_add(__pv->__evasObj, EVAS_CALLBACK_DEL, __WNaviframeImpl::__objDelCb, this);
//
// Do not place this before "evas_object_event_callback_add",
// The reason is that if additional del callback is added at child class, it should be called first to keep state the class object is still alive.
void WNaviframe::destroy()
{
WHIT();
- if(__pv->__evasObj) {
+ if (__pv->__evasObj) {
destroyAllViews();
evas_object_del(__pv->__evasObj);
// Do not leave any code here.
}
}
-Evas_Object* WNaviframe::getEvasObj()
+Evas_Object *WNaviframe::getEvasObj()
{
return __pv->__evasObj;
}
-void WNaviframe::setName(const char* name)
+void WNaviframe::setName(const char *name)
{
- if( __pv->__name) {
+ if (__pv->__name) {
free(__pv->__name);
__pv->__name = NULL;
}
- if( name ) {
+ if (name) {
size_t len = strlen(name) + 1;
- __pv->__name = (char*)malloc(len);
- strncpy( __pv->__name, name, len);
+ __pv->__name = (char *)malloc(len);
+ strncpy(__pv->__name, name, len);
}
}
-const char* WNaviframe::getName()
+const char *WNaviframe::getName()
{
return __pv->__name;
}
-WWindow* WNaviframe::getWindow()
+WWindow *WNaviframe::getWindow()
{
- if( __pv->__evasObj == NULL)
+ if (__pv->__evasObj == NULL) {
return NULL;
+ }
- WWindow* window = (WWindow*)evas_object_data_get( __pv->__evasObj, WKEY_WINDOW_INSTANCE );
+ WWindow *window = (WWindow *)evas_object_data_get(__pv->__evasObj, WKEY_WINDOW_INSTANCE);
return window;
}
-bool WNaviframe::push( WView* view, const char* viewName, void* viewCreationParam )
+bool WNaviframe::push(WView *view, const char *viewName, void *viewCreationParam)
{
- if( viewName )
- view->setName( viewName );
- return onPush( view, viewCreationParam );
+ if (viewName) {
+ view->setName(viewName);
+ }
+ return onPush(view, viewCreationParam);
}
void WNaviframe::destroyAllViews()
{
WHIT();
- Eina_List* list = elm_naviframe_items_get( getEvasObj());
- Eina_List* temp = NULL;
- void* it = NULL;
- EINA_LIST_FOREACH( list, temp, it) {
- elm_object_item_del( (Elm_Object_Item*)it);
+ Eina_List *list = elm_naviframe_items_get(getEvasObj());
+ Eina_List *temp = NULL;
+ void *it = NULL;
+ EINA_LIST_FOREACH(list, temp, it) {
+ elm_object_item_del((Elm_Object_Item *)it);
}
}
-void WNaviframe::setOnCreate( const std::function<Evas_Object*(Evas_Object*, void*)>& handlerFunc)
+void WNaviframe::setOnCreate(const std::function<Evas_Object *(Evas_Object *, void *)>& handlerFunc)
{
__pv->__createHandler = handlerFunc;
}
-void WNaviframe::setOnLastItemPop( const std::function<void(bool*)>& handlerFunc)
+void WNaviframe::setOnLastItemPop(const std::function<void(bool *)>& handlerFunc)
{
__pv->__lastItemPopHandler = handlerFunc;
}
-Evas_Object* WNaviframe::onCreate(Evas_Object* parent, void* param)
+Evas_Object *WNaviframe::onCreate(Evas_Object *parent, void *param)
{
- Evas_Object* obj = elm_naviframe_add( parent);
+ Evas_Object *obj = elm_naviframe_add(parent);
elm_naviframe_prev_btn_auto_pushed_set(obj, EINA_TRUE);
elm_object_part_content_set(parent, "elm.swallow.content", obj);
eext_object_event_callback_add(obj, EEXT_CALLBACK_BACK, eext_naviframe_back_cb, NULL);
void WNaviframe::onDestroy()
{
-
}
-void WNaviframe::onLastItemPop(bool* popOut)
+void WNaviframe::onLastItemPop(bool *popOut)
{
WHIT();
*popOut = false;
- WWindow* window = getWindow();
+ WWindow *window = getWindow();
if (window != NULL) {
- Evas_Object* evasObj = window->getEvasObj();
+ Evas_Object *evasObj = window->getEvasObj();
if (evasObj != NULL) {
elm_win_lower(evasObj);
}
}
}
-bool WNaviframe::onPush( WView* view, void* viewParam )
+bool WNaviframe::onPush(WView *view, void *viewParam)
{
- WASSERT( getEvasObj() != NULL );
+ WASSERT(getEvasObj() != NULL);
//
- view->create( getEvasObj(), viewParam );
+ view->create(getEvasObj(), viewParam);
- WView_setContainerProperties( view, getWindow(), this);
+ WView_setContainerProperties(view, getWindow(), this);
//
- Elm_Object_Item* item = view->onPushToNaviframe( getEvasObj() );
- if( item == NULL )
- item = elm_naviframe_item_push( getEvasObj(), view->getTitle(), NULL, NULL, view->getEvasObj(), NULL);
+ Elm_Object_Item *item = view->onPushToNaviframe(getEvasObj());
+ if (item == NULL) {
+ item = elm_naviframe_item_push(getEvasObj(), view->getTitle(), NULL, NULL, view->getEvasObj(), NULL);
+ }
//
- WView_setContainerNaviItemProperty( view, item );
+ WView_setContainerNaviItemProperty(view, item);
//
- if( view->__callPushedHandlerFunc( item ) == false)
- view->onPushed( item );
+ if (view->__callPushedHandlerFunc(item) == false) {
+ view->onPushed(item);
+ }
- elm_naviframe_item_pop_cb_set( item, __popCb, view);
+ elm_naviframe_item_pop_cb_set(item, __popCb, view);
return true;
}
-bool WNaviframe::onItemPop( WView* view, Elm_Object_Item* item )
+bool WNaviframe::onItemPop(WView *view, Elm_Object_Item *item)
{
- WNaviframe* nf = view->getNaviframe();
+ WNaviframe *nf = view->getNaviframe();
- if( item == elm_naviframe_bottom_item_get( nf->getEvasObj() )) {
+ if (item == elm_naviframe_bottom_item_get(nf->getEvasObj())) {
bool ret = view->onPop();
- if( ret == false )
+ if (ret == false) {
return EINA_FALSE;
+ }
bool popOut = true;
- if( nf->__pv->__lastItemPopHandler)
+ if (nf->__pv->__lastItemPopHandler) {
nf->__pv->__lastItemPopHandler(&popOut);
- else
+ } else {
nf->onLastItemPop(&popOut);
+ }
return popOut;
} else {
return view->onPop();
}
}
-Eina_Bool WNaviframe::__popCb( void* data, Elm_Object_Item* item)
+Eina_Bool WNaviframe::__popCb(void *data, Elm_Object_Item *item)
{
- auto view = (WView*)data;
- WNaviframe* nf = view->getNaviframe();
+ auto view = (WView *)data;
+ WNaviframe *nf = view->getNaviframe();
//
- WASSERT( view->getNaviItem() == item );
+ WASSERT(view->getNaviItem() == item);
//
- if( nf->onItemPop( view, item ) )
+ if (nf->onItemPop(view, item)) {
return EINA_TRUE;
- else
+ } else {
return EINA_FALSE;
+ }
}
std::string __title;
std::string __text;
std::string __textDomain;
- WControl* __content;
+ WControl *__content;
- std::function<Evas_Object* (Evas_Object* parent)> __contentCreateCb;
- std::function<void(Evas_Object* popup)> __morePropertiesCb;
- std::function<void (bool* destroyPopup)> __backCb;
+ std::function<Evas_Object *(Evas_Object *parent)> __contentCreateCb;
+ std::function<void(Evas_Object *popup)> __morePropertiesCb;
+ std::function<void(bool *destroyPopup)> __backCb;
- std::function<void (bool* destroyPopup)> __vButtonCb[__MAX_BUTTON_NUM];
- std::function<void (Evas_Object* button)>* buttonPropertyCb[__MAX_BUTTON_NUM];
+ std::function<void(bool *destroyPopup)> __vButtonCb[__MAX_BUTTON_NUM];
+ std::function<void(Evas_Object *button)> *buttonPropertyCb[__MAX_BUTTON_NUM];
std::string __listButtonLabel[__MAX_BUTTON_NUM];
int __count;
-
};
__WPopupImpl::__WPopupImpl()
{
__content = NULL;
__count = 0;
- for( int i=0; i< __MAX_BUTTON_NUM; i++) {
+ for (int i = 0; i < __MAX_BUTTON_NUM; i++) {
buttonPropertyCb[i] = NULL;
}
}
__WPopupImpl::~__WPopupImpl()
{
- for( int i=0; i< __MAX_BUTTON_NUM; i++) {
+ for (int i = 0; i < __MAX_BUTTON_NUM; i++) {
delete buttonPropertyCb[i];
}
}
-WPopup::WPopup() : __pv( new __WPopupImpl() )
+WPopup::WPopup() : __pv(new __WPopupImpl())
{
WHIT();
}
-WPopup::WPopup( const char* title, const char* textContent ) : __pv( new __WPopupImpl() )
+WPopup::WPopup(const char *title, const char *textContent) : __pv(new __WPopupImpl())
{
- if( title )
+ if (title) {
__pv->__title = title;
- if( textContent )
+ }
+ if (textContent) {
__pv->__text = textContent;
+ }
}
WPopup::~WPopup()
delete __pv;
}
-void WPopup::setTitle( const char* title )
+void WPopup::setTitle(const char *title)
{
- if( title )
+ if (title) {
__pv->__title = title;
- else
+ } else {
__pv->__title.clear();
+ }
}
-void WPopup::setContent( const char* text )
+void WPopup::setContent(const char *text)
{
- if( text )
+ if (text) {
__pv->__text = text;
- else
+ } else {
__pv->__text.clear();
- if( __pv->__content ) {
+ }
+ if (__pv->__content) {
__pv->__content->destroy();
__pv->__content = NULL;
}
}
-void WPopup::setContent( WControl* control )
+void WPopup::setContent(WControl *control)
{
__pv->__text = "";
__pv->__content = control;
}
-void WPopup::setContent( const std::function<Evas_Object* (Evas_Object* parent)> contentCreateCb )
+void WPopup::setContent(const std::function<Evas_Object *(Evas_Object *parent)> contentCreateCb)
{
__pv->__text = "";
- if( __pv->__content ) {
+ if (__pv->__content) {
__pv->__content->destroy();
__pv->__content = NULL;
}
__pv->__contentCreateCb = contentCreateCb;
}
-void WPopup::setTextTranslatable( const char* textDomain )
+void WPopup::setTextTranslatable(const char *textDomain)
{
- if( textDomain )
+ if (textDomain) {
__pv->__textDomain = textDomain;
- else
+ } else {
__pv->__textDomain.clear();
+ }
}
#define BUTTON_CALLBACK(_buttonIndex) \
-[](void* data, Evas_Object* obj, void* eventInfo) {\
- WPopup* self = (WPopup*)data;\
+[](void *data, Evas_Object *obj, void *eventInfo) { \
+ WPopup *self = (WPopup *)data;\
if (self->__pv->__vButtonCb[_buttonIndex]) { \
bool destroyPopup = true; \
self->__pv->__vButtonCb[_buttonIndex](&destroyPopup); \
- if( destroyPopup ) \
- evas_object_del(self->getEvasObj());\
- }\
- else \
- evas_object_del(self->getEvasObj());\
+ if (destroyPopup) { \
+ evas_object_del(self->getEvasObj()); \
+ } \
+ } else { \
+ evas_object_del(self->getEvasObj()); \
+ } \
}
-bool WPopup::addButton(const char* buttonText, const std::function<void (bool* destroyPopup)> buttonCb, const std::function<void (Evas_Object* button)> setPropertyCb )
+bool WPopup::addButton(const char *buttonText, const std::function<void(bool *destroyPopup)> buttonCb, const std::function<void(Evas_Object *button)> setPropertyCb)
{
- if( __pv->__count >= __MAX_BUTTON_NUM ) {
+ if (__pv->__count >= __MAX_BUTTON_NUM) {
WERROR("Over the max button number! =%d", __pv->__count);
return false;
}
__pv->__listButtonLabel[__pv->__count] = buttonText;
__pv->__vButtonCb[__pv->__count] = buttonCb;
- if( setPropertyCb )
- __pv->buttonPropertyCb[__pv->__count] = new std::function<void (Evas_Object* button)>( setPropertyCb );
+ if (setPropertyCb) {
+ __pv->buttonPropertyCb[__pv->__count] = new std::function<void(Evas_Object *button)>(setPropertyCb);
+ }
__pv->__count++;
return true;
}
-void WPopup::setOnBack( const std::function<void (bool* destroyPopup)> backCb )
+void WPopup::setOnBack(const std::function<void(bool *destroyPopup)> backCb)
{
__pv->__backCb = backCb;
}
-void WPopup::setOnMoreProperties( const std::function<void(Evas_Object* popup)>& morePropertiesCb )
+void WPopup::setOnMoreProperties(const std::function<void(Evas_Object *popup)>& morePropertiesCb)
{
__pv->__morePropertiesCb = morePropertiesCb;
}
-Evas_Object* WPopup::onCreate(Evas_Object* parent, void* param)
+Evas_Object *WPopup::onCreate(Evas_Object *parent, void *param)
{
WHIT();
- Evas_Object* popup = elm_popup_add( parent );
+ Evas_Object *popup = elm_popup_add(parent);
// It make the width to fit to screen width in portrait mode. 2014.09.30 modified as EFL notice.
- elm_popup_align_set( popup, ELM_NOTIFY_ALIGN_FILL, 1.0 );
+ elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
- if( __pv->__backCb )
- eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, [](void *data, Evas_Object *obj, void *event_info){
- WPopup* p = (WPopup*)data;
+ if (__pv->__backCb) {
+ eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, [](void *data, Evas_Object *obj, void *event_info) {
+ WPopup *p = (WPopup *)data;
bool destroyPopup = true;
- p->__pv->__backCb( &destroyPopup );
- if( destroyPopup ) {
+ p->__pv->__backCb(&destroyPopup);
+ if (destroyPopup) {
p->destroy();
}
}, this);
- else
+ } else {
eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, NULL);
+ }
- if( __pv->__morePropertiesCb )
- __pv->__morePropertiesCb( popup );
+ if (__pv->__morePropertiesCb) {
+ __pv->__morePropertiesCb(popup);
+ }
if (!__pv->__title.empty()) {
- if (!__pv->__textDomain.empty())
+ if (!__pv->__textDomain.empty()) {
elm_object_domain_translatable_part_text_set(popup, "title,text", __pv->__textDomain.c_str(), __pv->__title.c_str());
- else
- elm_object_part_text_set(popup, "title,text", __pv->__title.c_str() );
+ } else {
+ elm_object_part_text_set(popup, "title,text", __pv->__title.c_str());
+ }
}
if (!__pv->__text.empty()) {
- if (!__pv->__textDomain.empty())
+ if (!__pv->__textDomain.empty()) {
elm_object_domain_translatable_part_text_set(popup, NULL, __pv->__textDomain.c_str(), __pv->__text.c_str());
- else
+ } else {
elm_object_text_set(popup, __pv->__text.c_str());
- } else if( __pv->__content) {
+ }
+ } else if (__pv->__content) {
__pv->__content->create(popup, NULL);
elm_object_content_set(popup, __pv->__content->getEvasObj());
- } else if( __pv->__contentCreateCb ) {
- Evas_Object* obj = __pv->__contentCreateCb( popup );
+ } else if (__pv->__contentCreateCb) {
+ Evas_Object *obj = __pv->__contentCreateCb(popup);
elm_object_content_set(popup, obj);
}
- for( int i=0; i< __pv->__count; i++ ) {
- Evas_Object* button = elm_button_add(popup);
+ for (int i = 0; i < __pv->__count; i++) {
+ Evas_Object *button = elm_button_add(popup);
elm_object_style_set(button, "popup");
- if (!__pv->__textDomain.empty())
- elm_object_domain_translatable_part_text_set(button, NULL, __pv->__textDomain.c_str(), __pv->__listButtonLabel[i].c_str() );
- else
- elm_object_text_set(button, __pv->__listButtonLabel[i].c_str() );
+ if (!__pv->__textDomain.empty()) {
+ elm_object_domain_translatable_part_text_set(button, NULL, __pv->__textDomain.c_str(), __pv->__listButtonLabel[i].c_str());
+ } else {
+ elm_object_text_set(button, __pv->__listButtonLabel[i].c_str());
+ }
char partname[100] = {0};
snprintf(partname, sizeof(partname) - 1, "button%d", i + 1);
elm_object_part_content_set(popup, partname, button);
//
- switch ( i ) {
+ switch (i) {
case 0:
evas_object_smart_callback_add(button, "clicked", BUTTON_CALLBACK(0), this);
break;
break;
}
- if( __pv->buttonPropertyCb[i] ) {
- (*__pv->buttonPropertyCb[i])( button );
+ if (__pv->buttonPropertyCb[i]) {
+ (*__pv->buttonPropertyCb[i])(button);
}
- evas_object_show( button);
+ evas_object_show(button);
}
evas_object_show(popup);
return popup;
-
}
void WPopup::onDestroy()
~__WUiTimerImpl();
public:
//
- void* __timer;
+ void *__timer;
WUiTimer::TimerType __type;
- void* __userData;
- std::weak_ptr<IWUiObject>* __uiObjMonitor;
+ void *__userData;
+ std::weak_ptr<IWUiObject> *__uiObjMonitor;
- std::function<Eina_Bool (void*)> __timerFunc;
- std::function<void (void*)> __jobFunc;
+ std::function<Eina_Bool(void *)> __timerFunc;
+ std::function<void(void *)> __jobFunc;
//
void __deleteTimer();
- static Eina_Bool __timerCb(void* data);
- static void __jobCb(void* data);
-
+ static Eina_Bool __timerCb(void *data);
+ static void __jobCb(void *data);
};
__WUiTimerImpl::__WUiTimerImpl()
{
{
__deleteTimer();
delete __uiObjMonitor;
-
}
void __WUiTimerImpl::__deleteTimer()
{
- if( __timer ) {
- switch( __type ) {
+ if (__timer) {
+ switch(__type) {
case WUiTimer::IDLER:
- ecore_idler_del( (Ecore_Idler*)__timer);
+ ecore_idler_del((Ecore_Idler *)__timer);
break;
case WUiTimer::ANIMATOR:
- ecore_animator_del( (Ecore_Animator*)__timer);
+ ecore_animator_del((Ecore_Animator *)__timer);
break;
case WUiTimer::TIMER:
- ecore_timer_del( (Ecore_Timer*)__timer);
+ ecore_timer_del((Ecore_Timer *)__timer);
break;
case WUiTimer::JOB:
- ecore_job_del( (Ecore_Job*)__timer);
+ ecore_job_del((Ecore_Job *)__timer);
break;
default:
break;
}
}
-Eina_Bool __WUiTimerImpl::__timerCb( void* data )
+Eina_Bool __WUiTimerImpl::__timerCb(void *data)
{
- auto p = (WUiTimer*)data;
+ auto p = (WUiTimer *)data;
- if( p->__pv->__uiObjMonitor && p->__pv->__uiObjMonitor->expired() ) {
+ if (p->__pv->__uiObjMonitor && p->__pv->__uiObjMonitor->expired()) {
p->__pv->__timer = NULL;
delete p;
return ECORE_CALLBACK_CANCEL;
}
- Eina_Bool ret = p->__pv->__timerFunc( p->__pv->__userData );
- if( ret == ECORE_CALLBACK_CANCEL ) {
+ Eina_Bool ret = p->__pv->__timerFunc(p->__pv->__userData);
+ if (ret == ECORE_CALLBACK_CANCEL) {
p->__pv->__timer = NULL;
delete p;
}
return ret;
}
-void __WUiTimerImpl::__jobCb( void* data )
+void __WUiTimerImpl::__jobCb(void *data)
{
- auto p = (WUiTimer*)data;
+ auto p = (WUiTimer *)data;
- if( p->__pv->__uiObjMonitor && p->__pv->__uiObjMonitor->expired()) {
+ if (p->__pv->__uiObjMonitor && p->__pv->__uiObjMonitor->expired()) {
p->__pv->__timer = NULL;
delete p;
return;
}
- p->__pv->__jobFunc( p->__pv->__userData );
+ p->__pv->__jobFunc(p->__pv->__userData);
p->__pv->__timer = NULL;
delete p;
}
delete this;
}
-WUiTimer* WUiTimer::addIdler( const std::function<Eina_Bool (void*)>& timerFunc, void* userData, WUiObjectPtr monitorObj )
+WUiTimer *WUiTimer::addIdler(const std::function<Eina_Bool(void *)>& timerFunc, void *userData, WUiObjectPtr monitorObj)
{
- WUiTimer* timer = new WUiTimer();
+ WUiTimer *timer = new WUiTimer();
timer->__pv->__type = WUiTimer::IDLER;
- if( !monitorObj.expired() ) {
+ if (!monitorObj.expired()) {
timer->__pv->__uiObjMonitor = new std::weak_ptr<IWUiObject>;
*timer->__pv->__uiObjMonitor = monitorObj;
} else {
- WDEBUG( "No monitored object is set!");
+ WDEBUG("No monitored object is set!");
}
timer->__pv->__timerFunc = timerFunc;
timer->__pv->__userData = userData;
- Ecore_Idler* ecoreIdler = ecore_idler_add( __WUiTimerImpl::__timerCb, timer );
- if( ecoreIdler == NULL ) {
+ Ecore_Idler *ecoreIdler = ecore_idler_add(__WUiTimerImpl::__timerCb, timer);
+ if (ecoreIdler == NULL) {
WERROR("failed to add ecore idler!");
delete timer;
return NULL;
timer->__pv->__timer = ecoreIdler;
return timer;
}
-WUiTimer* WUiTimer::addAnimator( const std::function<Eina_Bool (void*)>& timerFunc, void* userData, WUiObjectPtr monitorObj )
+WUiTimer *WUiTimer::addAnimator(const std::function<Eina_Bool(void *)>& timerFunc, void *userData, WUiObjectPtr monitorObj)
{
- WUiTimer* timer = new WUiTimer();
+ WUiTimer *timer = new WUiTimer();
timer->__pv->__type = WUiTimer::ANIMATOR;
- if( !monitorObj.expired() ) {
+ if (!monitorObj.expired()) {
timer->__pv->__uiObjMonitor = new std::weak_ptr<IWUiObject>;
*timer->__pv->__uiObjMonitor = monitorObj;
} else {
- WDEBUG( "No monitored object is set!");
+ WDEBUG("No monitored object is set!");
}
timer->__pv->__timerFunc = timerFunc;
timer->__pv->__userData = userData;
- Ecore_Animator* ecoreAnimator = ecore_animator_add( __WUiTimerImpl::__timerCb, timer );
- if( ecoreAnimator == NULL ) {
+ Ecore_Animator *ecoreAnimator = ecore_animator_add(__WUiTimerImpl::__timerCb, timer);
+ if (ecoreAnimator == NULL) {
WERROR("failed to add ecore animator!");
delete timer;
return NULL;
timer->__pv->__timer = ecoreAnimator;
return timer;
}
-WUiTimer* WUiTimer::addTimer( double interval, const std::function<Eina_Bool (void*)>& timerFunc, void* userData, WUiObjectPtr monitorObj )
+WUiTimer *WUiTimer::addTimer(double interval, const std::function<Eina_Bool(void *)>& timerFunc, void *userData, WUiObjectPtr monitorObj)
{
- WUiTimer* timer = new WUiTimer();
+ WUiTimer *timer = new WUiTimer();
timer->__pv->__type = WUiTimer::TIMER;
- if( !monitorObj.expired() ) {
+ if (!monitorObj.expired()) {
timer->__pv->__uiObjMonitor = new std::weak_ptr<IWUiObject>;
*timer->__pv->__uiObjMonitor = monitorObj;
} else {
- WDEBUG( "No monitored object is set!");
+ WDEBUG("No monitored object is set!");
}
timer->__pv->__timerFunc = timerFunc;
timer->__pv->__userData = userData;
- Ecore_Timer* ecoreTimer = ecore_timer_add( interval, __WUiTimerImpl::__timerCb, timer );
- if( ecoreTimer == NULL ) {
+ Ecore_Timer *ecoreTimer = ecore_timer_add(interval, __WUiTimerImpl::__timerCb, timer);
+ if (ecoreTimer == NULL) {
WERROR("failed to add ecore timer!");
delete timer;
return NULL;
return timer;
}
-WUiTimer* WUiTimer::addJob( const std::function<void (void*)>& timerFunc, void* userData, WUiObjectPtr monitorObj )
+WUiTimer *WUiTimer::addJob(const std::function<void(void *)>& timerFunc, void *userData, WUiObjectPtr monitorObj)
{
- WUiTimer* timer = new WUiTimer();
+ WUiTimer *timer = new WUiTimer();
timer->__pv->__type = WUiTimer::JOB;
- if( !monitorObj.expired() ) {
+ if (!monitorObj.expired()) {
timer->__pv->__uiObjMonitor = new std::weak_ptr<IWUiObject>;
*timer->__pv->__uiObjMonitor = monitorObj;
} else {
- WDEBUG( "No monitored object is set!");
+ WDEBUG("No monitored object is set!");
}
timer->__pv->__jobFunc = timerFunc;
timer->__pv->__userData = userData;
- Ecore_Job* ecoreJob = ecore_job_add( __WUiTimerImpl::__jobCb, timer );
- if( ecoreJob == NULL ) {
+ Ecore_Job *ecoreJob = ecore_job_add(__WUiTimerImpl::__jobCb, timer);
+ if (ecoreJob == NULL) {
WERROR("failed to add ecore job!");
delete timer;
return NULL;
int WAppAssist_getMajorVersion() { return WAPP_ASSIST_VERSION_MAJOR; }
int WAppAssist_getMinorVersion() { return WAPP_ASSIST_VERSION_MINOR; }
int WAppAssist_getPatchVersion() { return WAPP_ASSIST_VERSION_PATCH; }
-const char* WAppAssist_getVersion()
+const char *WAppAssist_getVersion()
{
- static char ver[24] = {0,};
- if( ver[0] == '\0' )
- snprintf( ver, sizeof(ver), "%d.%d.%d", WAppAssist_getMajorVersion(), WAppAssist_getMinorVersion(), WAppAssist_getPatchVersion() );
+ static char ver[24] = {0, };
+ if (ver[0] == '\0') {
+ snprintf(ver, sizeof(ver), "%d.%d.%d", WAppAssist_getMajorVersion(), WAppAssist_getMinorVersion(), WAppAssist_getPatchVersion());
+ }
return ver;
}
~__WViewImpl();
public:
//
- Evas_Object* __obj;
- char* __name;
- char* __title;
- Elm_Object_Item* __naviItem;
- WWindow* __window;
- WNaviframe* __naviframe;
+ Evas_Object *__obj;
+ char *__name;
+ char *__title;
+ Elm_Object_Item *__naviItem;
+ WWindow *__window;
+ WNaviframe *__naviframe;
//
- std::function<Evas_Object* (Evas_Object*, void*)> __createHandler;
- std::function<void (Elm_Object_Item*)> __pushedHandler;
+ std::function<Evas_Object *(Evas_Object *, void *)> __createHandler;
+ std::function<void(Elm_Object_Item *)> __pushedHandler;
- std::shared_ptr<IWUiObject>* __selfPtr;
- std::weak_ptr<IWUiObject>* __popupMonitor;
-
- static void __objDelCb( void* data, Evas* evas, Evas_Object* obj, void* event_info);
+ std::shared_ptr<IWUiObject> *__selfPtr;
+ std::weak_ptr<IWUiObject> *__popupMonitor;
+ static void __objDelCb(void *data, Evas *evas, Evas_Object *obj, void *event_info);
};
__WViewImpl::__WViewImpl()
{
__WViewImpl::~__WViewImpl()
{
- if(__name)
+ if (__name) {
free(__name);
+ }
- if(__title)
+ if (__title) {
free(__title);
+ }
//
- if( __popupMonitor ) {
- if( auto p = __popupMonitor->lock() ) {
+ if (__popupMonitor) {
+ if (auto p = __popupMonitor->lock()) {
p->destroy();
}
}
delete __selfPtr;
}
-void __WViewImpl::__objDelCb( void* data, Evas* evas, Evas_Object* obj, void* event_info)
+void __WViewImpl::__objDelCb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
{
WHIT();
- auto view = (WView*)data;
+ auto view = (WView *)data;
view->__destroy();
}
__pv = new __WViewImpl();
}
-WView::WView( const char* name ) : __pv( new __WViewImpl() )
+WView::WView(const char *name) : __pv(new __WViewImpl())
{
WHIT();
- setName( name);
+ setName(name);
}
WView::~WView()
{
- if( __pv->__name) {
- WDEBUG( "name=%s", __pv->__name );
+ if (__pv->__name) {
+ WDEBUG("name=%s", __pv->__name);
} else {
WHIT();
}
delete __pv;
}
-const char* WView::getClassName()
+const char *WView::getClassName()
{
return __CLASS_NAME;
}
-bool WView::create( Evas_Object* parent, void* viewParam )
+bool WView::create(Evas_Object *parent, void *viewParam)
{
WHIT();
- if( __pv->__obj ) {
+ if (__pv->__obj) {
WDEBUG("Already created!");
return true;
}
- if( __pv->__createHandler )
- __pv->__obj = __pv->__createHandler( parent, viewParam );
- else
- __pv->__obj = onCreate( parent, viewParam );
+ if (__pv->__createHandler) {
+ __pv->__obj = __pv->__createHandler(parent, viewParam);
+ } else {
+ __pv->__obj = onCreate(parent, viewParam);
+ }
- if( __pv->__obj == NULL)
+ if (__pv->__obj == NULL) {
return false;
+ }
- if( __pv->__name ) // for easy debugging
- {
- evas_object_name_set( __pv->__obj, __pv->__name );
+ if (__pv->__name) {// for easy debugging
+ evas_object_name_set(__pv->__obj, __pv->__name);
}
- evas_object_data_set( __pv->__obj, WKEY_VIEW_INSTANCE, this );
- evas_object_event_callback_add( __pv->__obj, EVAS_CALLBACK_DEL, __WViewImpl::__objDelCb, this);
+ evas_object_data_set(__pv->__obj, WKEY_VIEW_INSTANCE, this);
+ evas_object_event_callback_add(__pv->__obj, EVAS_CALLBACK_DEL, __WViewImpl::__objDelCb, this);
//
// Do not place this before "evas_object_event_callback_add",
// The reason is that if additional del callback is added at child class, it should be called first to keep state the class object is still alive.
void WView::destroy()
{
- if(__pv->__obj) {
- if( getNaviframe() ) {
- elm_object_item_del( __pv->__naviItem );
+ if (__pv->__obj) {
+ if (getNaviframe()) {
+ elm_object_item_del(__pv->__naviItem);
} else {
evas_object_del(__pv->__obj);
}
}
}
-Evas_Object* WView::getEvasObj()
+Evas_Object *WView::getEvasObj()
{
return __pv->__obj;
}
-void WView::setName(const char* name)
+void WView::setName(const char *name)
{
- if( __pv->__name) {
- free( __pv->__name);
+ if (__pv->__name) {
+ free(__pv->__name);
__pv->__name = NULL;
}
- if( name ) {
+ if (name) {
size_t len = strlen(name) + 1;
- __pv->__name = (char*)malloc(len);
- strncpy( __pv->__name, name, len);
+ __pv->__name = (char *)malloc(len);
+ strncpy(__pv->__name, name, len);
}
}
-const char* WView::getName()
+const char *WView::getName()
{
return __pv->__name;
}
-void WView::setTitle( const char* title )
+void WView::setTitle(const char *title)
{
- if( __pv->__title) {
- free( __pv->__title);
+ if (__pv->__title) {
+ free(__pv->__title);
__pv->__title = NULL;
}
- if( title ) {
+ if (title) {
size_t len = strlen(title) + 1;
- __pv->__title = (char*)malloc(len);
- strncpy( __pv->__title, title, len);
+ __pv->__title = (char *)malloc(len);
+ strncpy(__pv->__title, title, len);
}
}
-const char* WView::getTitle()
+const char *WView::getTitle()
{
return __pv->__title;
}
std::weak_ptr<IWUiObject> WView::getWeakPtr()
{
- if( __pv->__selfPtr ) {
+ if (__pv->__selfPtr) {
return std::weak_ptr<IWUiObject>(*__pv->__selfPtr);
}
- __pv->__selfPtr = new std::shared_ptr<IWUiObject>( this,[](IWUiObject* p){} );
+ __pv->__selfPtr = new std::shared_ptr<IWUiObject>(this, [](IWUiObject *p){});
return std::weak_ptr<IWUiObject>(*__pv->__selfPtr);
}
-void WView::setOnCreate( const std::function<Evas_Object* (Evas_Object*, void*)>& handlerFunc )
+void WView::setOnCreate(const std::function<Evas_Object *(Evas_Object *, void *)>& handlerFunc)
{
__pv->__createHandler = handlerFunc;
}
-void WView::setOnPushed( const std::function<void (Elm_Object_Item*)>& handlerFunc )
+void WView::setOnPushed(const std::function<void(Elm_Object_Item *)>& handlerFunc)
{
__pv->__pushedHandler = handlerFunc;
}
bool WView::popOut()
{
- if( getEvasObj() == NULL) {
+ if (getEvasObj() == NULL) {
WWARNING("Not created view! No Evas Object!");
return false;
}
- if( getNaviframe() == NULL) {
+ if (getNaviframe() == NULL) {
WWARNING("Not pushed to naviframe!");
return false;
}
destroyPopup(); // Before popping out view, pop-up is destroyed, if it has.Because pop-up is disappeared too late.
- if( __pv->__naviItem != elm_naviframe_top_item_get(getNaviframe()->getEvasObj()) ) {
+ if (__pv->__naviItem != elm_naviframe_top_item_get(getNaviframe()->getEvasObj())) {
elm_object_item_del(__pv->__naviItem);
return true;
}
}
-WWindow* WView::getWindow()
+WWindow *WView::getWindow()
{
return __pv->__window;
}
return true;
}
-WNaviframe* WView::getNaviframe()
+WNaviframe *WView::getNaviframe()
{
- if( __pv->__naviframe == NULL) {
+ if (__pv->__naviframe == NULL) {
WWARNING("naviframe does not exist!");
}
return __pv->__naviframe;
}
-Elm_Object_Item* WView::getNaviItem()
+Elm_Object_Item *WView::getNaviItem()
{
- if( __pv->__naviItem == NULL) {
+ if (__pv->__naviItem == NULL) {
WWARNING("naviItem does not exist!");
}
return __pv->__naviItem;
}
-void WView::onPushed(Elm_Object_Item* naviItem)
+void WView::onPushed(Elm_Object_Item *naviItem)
{
-
}
-Elm_Object_Item* WView::onPushToNaviframe( Evas_Object* naviFrame)
+Elm_Object_Item *WView::onPushToNaviframe(Evas_Object *naviFrame)
{
return NULL;
}
-Evas_Object* WView::onCreate( Evas_Object* parent, void* viewParam )
+Evas_Object *WView::onCreate(Evas_Object *parent, void *viewParam)
{
- Evas_Object* layout = elm_layout_add(parent);
+ Evas_Object *layout = elm_layout_add(parent);
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- char* path = app_get_resource_path();
- if( path == NULL ) {
- WERROR("Failed to get resource path=NULL");
+ char *path = app_get_resource_path();
+ if (path == NULL) {
+ WERROR("Failed to get resource path = NULL");
return layout;
}
std::string edjPath(path);
free(path);
edjPath += "edje/app-assist-efl.edj";
- if( elm_layout_file_set(layout, edjPath.c_str(), "default-view") == EINA_TRUE) {
- Evas_Object* rect = evas_object_rectangle_add(evas_object_evas_get(layout));
+ if (elm_layout_file_set(layout, edjPath.c_str(), "default-view") == EINA_TRUE) {
+ Evas_Object *rect = evas_object_rectangle_add(evas_object_evas_get(layout));
evas_object_color_set(rect, rand() % 256, rand() % 256, rand() % 256, 255);
evas_object_size_hint_weight_set(rect, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(rect, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_object_part_content_set(layout, "rect", rect);
- if( getName() != NULL )
+ if (getName() != NULL) {
elm_object_part_text_set(layout, "name", getName());
+ }
} else {
WERROR("Fail to set layout. Check EDJ file(%s)", edjPath.c_str());
void WView::onDestroy()
{
-
}
-bool WView::enableMoreButton( Elm_Object_Item* naviItem, Evas_Smart_Cb clickedCb, void* userData )
+bool WView::enableMoreButton(Elm_Object_Item *naviItem, Evas_Smart_Cb clickedCb, void *userData)
{
- if( getNaviframe() == NULL ) {
+ if (getNaviframe() == NULL) {
WERROR("naviframe is not set");
return false;
}
- Evas_Object *btn = elm_button_add( getNaviframe()->getEvasObj() );
- if (!btn) return false;
+ Evas_Object *btn = elm_button_add(getNaviframe()->getEvasObj());
+ if (!btn) {
+ return false;
+ }
elm_object_style_set(btn, "naviframe/more/default");
evas_object_show(btn);
evas_object_smart_callback_add(btn, "clicked", clickedCb, userData);
return true;
}
-void WView::attachPopup( WControl* popup )
+void WView::attachPopup(WControl *popup)
{
// If the pop-up has been already created, the following statement will just return without creating pop-up.
- Evas_Object* parent = WView_getWindowBaseLayoutEvasObj( this );
- if( parent == NULL ) {
+ Evas_Object *parent = WView_getWindowBaseLayoutEvasObj(this);
+ if (parent == NULL) {
WERROR("Parent is NULL! Fail to attach popup");
return;
}
// Base layout should be parent.
// If the window is parent, the pop-up is displayed bottom of the screen and keyboard overlaps and hides it, if the pop-up has entry field.
- popup->create( parent, NULL );
+ popup->create(parent, NULL);
// destroy old popup after new popup created, because of edit field of the view re-focusing issue related to IME.
destroyPopup();
- if( __pv->__popupMonitor == NULL)
+ if (__pv->__popupMonitor == NULL) {
__pv->__popupMonitor = new std::weak_ptr<IWUiObject>;
+ }
*__pv->__popupMonitor = popup->getWeakPtr();
}
void WView::destroyPopup()
{
- if( __pv->__popupMonitor == NULL ) return;
+ if (__pv->__popupMonitor == NULL) {
+ return;
+ }
- if( auto p = __pv->__popupMonitor->lock() ) {
+ if (auto p = __pv->__popupMonitor->lock()) {
p->destroy();
__pv->__popupMonitor->reset();
}
}
-bool WView::__callPushedHandlerFunc(Elm_Object_Item* naviItem)
+bool WView::__callPushedHandlerFunc(Elm_Object_Item *naviItem)
{
- if( __pv->__pushedHandler ) {
+ if (__pv->__pushedHandler) {
__pv->__pushedHandler(naviItem);
return true;
}
delete this;
}
-WView* WView_getInstanceFromEvasObj(Evas_Object* obj)
+WView *WView_getInstanceFromEvasObj(Evas_Object *obj)
{
- return (WView*)evas_object_data_get(obj, WKEY_VIEW_INSTANCE);
+ return (WView *)evas_object_data_get(obj, WKEY_VIEW_INSTANCE);
}
-Evas_Object* WView_getWindowBaseLayoutEvasObj( WView* view )
+Evas_Object *WView_getWindowBaseLayoutEvasObj(WView *view)
{
- if( view->getWindow() ) {
+ if (view->getWindow()) {
return view->getWindow()->getBaseLayoutEvasObj();
} else {
WERROR("Fail to get base layout");
}
}
-Evas_Object* WView_getWindowEvasObj( WView* view )
+Evas_Object *WView_getWindowEvasObj(WView *view)
{
- if( view->getWindow() ) {
+ if (view->getWindow()) {
return view->getWindow()->getEvasObj();
} else {
WERROR("Fail to get window evas object");
}
}
-void WView_setContainerProperties( WView* view, WWindow* win, WNaviframe* naviframe)
+void WView_setContainerProperties(WView *view, WWindow *win, WNaviframe *naviframe)
{
view->__pv->__window = win;
view->__pv->__naviframe = naviframe;
}
-void WView_setContainerNaviItemProperty( WView* view, Elm_Object_Item* item )
+void WView_setContainerNaviItemProperty(WView *view, Elm_Object_Item *item)
{
view->__pv->__naviItem = item;
}
class __WWindowImpl
{
public:
- __WWindowImpl(const char* inName, Elm_Win_Type inWinType);
- __WWindowImpl(Evas_Object* win, Evas_Object* conform, Evas_Object* baseLayout);
+ __WWindowImpl(const char *inName, Elm_Win_Type inWinType);
+ __WWindowImpl(Evas_Object *win, Evas_Object *conform, Evas_Object *baseLayout);
~__WWindowImpl();
public:
//
- Evas_Object* __win;
- Evas_Object* __baseLayout;
- Evas_Object* __conformant;
- IWUiObject* __baseObj;
+ Evas_Object *__win;
+ Evas_Object *__baseLayout;
+ Evas_Object *__conformant;
+ IWUiObject *__baseObj;
std::string __name;
Elm_Win_Type __winType;
- std::function<Evas_Object* ()> __createWinHandler;
- std::function<Evas_Object* (Evas_Object*, Evas_Object** )> __createBaseLayoutHandler;
+ std::function<Evas_Object *()> __createWinHandler;
+ std::function<Evas_Object *(Evas_Object *, Evas_Object **)> __createBaseLayoutHandler;
bool __owner;
- static void __delReqCb( void* data, Evas_Object* obj, void* event_info);
- static void __objDelCb( void* data, Evas* evas, Evas_Object* obj, void* event_info);
+ static void __delReqCb(void *data, Evas_Object *obj, void *event_info);
+ static void __objDelCb(void *data, Evas *evas, Evas_Object *obj, void *event_info);
};
-__WWindowImpl::__WWindowImpl(const char* name, Elm_Win_Type winType):
+__WWindowImpl::__WWindowImpl(const char *name, Elm_Win_Type winType):
__win(NULL),
__baseLayout(NULL),
__conformant(NULL),
__createBaseLayoutHandler(NULL),
__owner(true)
{
- WASSERT( name );
+ WASSERT(name);
__name = name;
}
-__WWindowImpl::__WWindowImpl(Evas_Object* win, Evas_Object* conform, Evas_Object* baseLayout):
+__WWindowImpl::__WWindowImpl(Evas_Object *win, Evas_Object *conform, Evas_Object *baseLayout):
__win(win),
__baseLayout(baseLayout),
__conformant(conform),
__createBaseLayoutHandler(NULL),
__owner(false)
{
- if(win) {
+ if (win) {
__winType = elm_win_type_get(win);
const char *title = elm_win_title_get(win);
- if(title)
+ if (title) {
__name = title;
- evas_object_data_set( __win, WKEY_WINDOW_INSTANCE, this ); // ?
+ }
+ evas_object_data_set(__win, WKEY_WINDOW_INSTANCE, this); // ?
}
}
__WWindowImpl::~__WWindowImpl()
{
- if(__win && !__owner)
- evas_object_data_del( __win, WKEY_WINDOW_INSTANCE);
+ if (__win && !__owner) {
+ evas_object_data_del(__win, WKEY_WINDOW_INSTANCE);
+ }
}
-void __WWindowImpl::__delReqCb( void* data, Evas_Object* obj, void* event_info)
+void __WWindowImpl::__delReqCb(void *data, Evas_Object *obj, void *event_info)
{
WHIT();
elm_exit();
}
-void __WWindowImpl::__objDelCb( void* data, Evas* evas, Evas_Object* obj, void* event_info)
+void __WWindowImpl::__objDelCb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
{
WHIT();
- auto win = (WWindow*)data;
+ auto win = (WWindow *)data;
win->onDestroy();
delete win;
}
-WWindow::WWindow(const char* name, Elm_Win_Type winType)
+WWindow::WWindow(const char *name, Elm_Win_Type winType)
{
__pv = new __WWindowImpl(name, winType);
}
-WWindow::WWindow(Evas_Object* win, Evas_Object* conform, Evas_Object* baseLayout)
+WWindow::WWindow(Evas_Object *win, Evas_Object *conform, Evas_Object *baseLayout)
{
__pv = new __WWindowImpl(win, conform, baseLayout);
}
delete __pv;
}
-const char* WWindow::getClassName()
+const char *WWindow::getClassName()
{
return __CLASS_NAME;
}
bool WWindow::create()
{
- if(__pv->__win || !__pv->__owner) {
+ if (__pv->__win || !__pv->__owner) {
WDEBUG("Already created!");
return true;
}
- Evas_Object* win = NULL;
- if( __pv->__createWinHandler )
+ Evas_Object *win = NULL;
+ if (__pv->__createWinHandler) {
win = __pv->__createWinHandler();
- else
+ } else {
win = onCreateWin();
+ }
__pv->__win = win;
- if( win ) {
- Evas_Object* cf = NULL;
- if(__pv->__createBaseLayoutHandler)
- __pv->__baseLayout = __pv->__createBaseLayoutHandler(win,&cf);
- else
+ if (win) {
+ Evas_Object *cf = NULL;
+ if (__pv->__createBaseLayoutHandler) {
+ __pv->__baseLayout = __pv->__createBaseLayoutHandler(win, &cf);
+ } else {
__pv->__baseLayout = onCreateBaseLayout(win, &cf);
+ }
__pv->__conformant = cf;
- evas_object_data_set( win, WKEY_WINDOW_INSTANCE, this );
- evas_object_smart_callback_add( win, "delete,request", __WWindowImpl::__delReqCb, this);
- evas_object_event_callback_add( win, EVAS_CALLBACK_DEL, __WWindowImpl::__objDelCb, this);
+ evas_object_data_set(win, WKEY_WINDOW_INSTANCE, this);
+ evas_object_smart_callback_add(win, "delete,request", __WWindowImpl::__delReqCb, this);
+ evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, __WWindowImpl::__objDelCb, this);
- evas_object_show( win );
+ evas_object_show(win);
return true;
} else {
void WWindow::destroy()
{
- if(__pv->__owner) {
- if( __pv->__win) {
+ if (__pv->__owner) {
+ if (__pv->__win) {
evas_object_del(__pv->__win);
// Do not leave any code here.
// After executing upper statement "evas_object_del", this object will be deleted at evas object deletion callback!
return __pv->__owner;
}
-Evas_Object* WWindow::getEvasObj()
+Evas_Object *WWindow::getEvasObj()
{
return __pv->__win;
}
-Evas_Object* WWindow::getBaseLayoutEvasObj()
+Evas_Object *WWindow::getBaseLayoutEvasObj()
{
return __pv->__baseLayout;
}
-Evas_Object* WWindow::getConformantEvasObj()
+Evas_Object *WWindow::getConformantEvasObj()
{
return __pv->__conformant;
}
-bool WWindow::attachBaseUiObject( IWUiObject* baseObj, void* creationParam )
+bool WWindow::attachBaseUiObject(IWUiObject *baseObj, void *creationParam)
{
+ WASSERT(__pv->__baseObj == NULL);
- WASSERT( __pv->__baseObj == NULL);
-
- if( baseObj->create( __pv->__baseLayout, creationParam) == false ) {
+ if (baseObj->create(__pv->__baseLayout, creationParam) == false) {
return false;
}
__pv->__baseObj = baseObj;
- evas_object_data_set( baseObj->getEvasObj(), WKEY_WINDOW_INSTANCE, this );
+ evas_object_data_set(baseObj->getEvasObj(), WKEY_WINDOW_INSTANCE, this);
return true;
}
-IWUiObject* WWindow::getBaseUiObject()
+IWUiObject *WWindow::getBaseUiObject()
{
return __pv->__baseObj;
}
-IWUiObject* WWindow::detachBaseUiObject()
+IWUiObject *WWindow::detachBaseUiObject()
{
- IWUiObject* obj = __pv->__baseObj;
+ IWUiObject *obj = __pv->__baseObj;
__pv->__baseObj = NULL;
return obj;
}
void WWindow::destroyBaseUiObject()
{
- if( __pv->__baseObj )
+ if (__pv->__baseObj) {
__pv->__baseObj->destroy();
+ }
__pv->__baseObj = NULL;
}
-const char* WWindow::getName()
+const char *WWindow::getName()
{
return __pv->__name.c_str();
}
return __pv->__winType;
}
-void WWindow::setOnCreateWin( const std::function<Evas_Object* ()>& handlerFunc )
+void WWindow::setOnCreateWin(const std::function<Evas_Object *()>& handlerFunc)
{
__pv->__createWinHandler = handlerFunc;
}
-void WWindow::setOnCreateBaseLayout( const std::function<Evas_Object* (Evas_Object*, Evas_Object** )>& handlerFunc )
+void WWindow::setOnCreateBaseLayout(const std::function<Evas_Object *(Evas_Object *, Evas_Object**)>& handlerFunc)
{
__pv->__createBaseLayoutHandler = handlerFunc;
-
}
-Evas_Object* WWindow::onCreateWin()
+Evas_Object *WWindow::onCreateWin()
{
- Evas_Object* win = elm_win_add( NULL, getName(), getWinType() );
- if( win == NULL) {
+ Evas_Object *win = elm_win_add(NULL, getName(), getWinType());
+ if (win == NULL) {
WERROR("Fail to create win!");
return NULL;
}
- elm_win_title_set( win, getName() );
- elm_win_conformant_set( win, EINA_TRUE);
- elm_win_autodel_set( win, EINA_TRUE);
- if( elm_win_wm_rotation_supported_get(win)) {
- int rotation[4] = {0,90,180,270};
- elm_win_wm_rotation_available_rotations_set( win, (const int*)(&rotation), 4);
-
+ elm_win_title_set(win, getName());
+ elm_win_conformant_set(win, EINA_TRUE);
+ elm_win_autodel_set(win, EINA_TRUE);
+ if (elm_win_wm_rotation_supported_get(win)) {
+ int rotation[4] = {0, 90, 180, 270};
+ elm_win_wm_rotation_available_rotations_set(win, (const int *)(&rotation), 4);
}
- elm_win_indicator_mode_set( win, ELM_WIN_INDICATOR_SHOW);
+ elm_win_indicator_mode_set(win, ELM_WIN_INDICATOR_SHOW);
elm_win_indicator_opacity_set(win, ELM_WIN_INDICATOR_OPAQUE);
return win;
}
-Evas_Object* WWindow::onCreateBaseLayout( Evas_Object* win, Evas_Object** outConformant )
+Evas_Object *WWindow::onCreateBaseLayout(Evas_Object *win, Evas_Object **outConformant)
{
- Evas_Object* bg = elm_bg_add( win );
+ Evas_Object *bg = elm_bg_add(win);
- evas_object_size_hint_weight_set( bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_win_resize_object_add( win, bg);
+ evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(win, bg);
evas_object_show(bg);
// If window has no conformant object, ug creation is failed.
- Evas_Object* cf = elm_conformant_add( win);
+ Evas_Object *cf = elm_conformant_add(win);
- evas_object_size_hint_weight_set( cf, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_win_resize_object_add( win, cf);
+ evas_object_size_hint_weight_set(cf, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(win, cf);
evas_object_show(cf);
- Evas_Object* cf_bg = elm_bg_add( cf);
- elm_object_style_set( cf_bg, "indicator/headerbg");
- elm_object_part_content_set( cf, "elm.swallow.indicator_bg", cf_bg);
+ Evas_Object *cf_bg = elm_bg_add(cf);
+ elm_object_style_set(cf_bg, "indicator/headerbg");
+ elm_object_part_content_set(cf, "elm.swallow.indicator_bg", cf_bg);
evas_object_show(cf_bg);
- Evas_Object* layout = elm_layout_add( cf);
- elm_layout_theme_set( layout, "layout", "application", "default");
- evas_object_size_hint_weight_set( layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_object_content_set( cf, layout);
+ Evas_Object *layout = elm_layout_add(cf);
+ elm_layout_theme_set(layout, "layout", "application", "default");
+ evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_object_content_set(cf, layout);
evas_object_show(layout);
void WWindow::onDestroy()
{
-
}