Merge "fix build break remove dependency to capi-system-runtime-info" into tizen accepted/tizen_3.0.2014.q3_common accepted/tizen_generic accepted/tizen_ivi_panda accepted/tizen_ivi_release tizen_3.0.2014.q3_common tizen_ivi_release accepted/tizen/generic/20140312.123553 accepted/tizen/ivi/20140312.175555 accepted/tizen/ivi/panda/20140312.115513 accepted/tizen/ivi/panda/20140312.122302 accepted/tizen/ivi/release/20140315.004529 submit/tizen/20140312.102822 submit/tizen/20140312.115113 submit/tizen_ivi_release/20140315.004750 submit/tizen_mobile/20141120.000000 tizen_3.0.2014.q3_common_release
authorSemun Lee <sm79.lee@samsung.com>
Tue, 11 Mar 2014 00:14:54 +0000 (17:14 -0700)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Tue, 11 Mar 2014 00:14:54 +0000 (17:14 -0700)
CMakeLists.txt
include/ug-manager.h
include/ui-gadget.h
packaging/ui-gadget-1.spec
src/manager.c
src/ug.c

index c665300..ed72a99 100644 (file)
@@ -26,7 +26,7 @@ SET(SRCS src/ug.c
 
 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
 
-SET(PKGS_CHECK_MODULES "glib-2.0 bundle dlog capi-appfw-application appsvc capi-appfw-app-manager ecore libtzplatform-config")
+SET(PKGS_CHECK_MODULES "glib-2.0 bundle dlog capi-appfw-application appsvc capi-appfw-app-manager ecore elementary libtzplatform-config")
 IF (with_x)
        PKG_CHECK_MODULES(PKGS REQUIRED ${PKGS_CHECK_MODULES} utilX x11)
 ENDIF(with_x)
index f5ac47e..7c7e059 100644 (file)
@@ -26,6 +26,7 @@
 #include <utilX.h>
 #endif
 
+#include <Evas.h>
 #include "ug.h"
 
 int ugman_ug_add(ui_gadget_h parent, ui_gadget_h ug);
@@ -41,6 +42,8 @@ int ugman_ug_del_all(void);
 int ugman_init(Display *disp, Window xid, void *win, enum ug_option opt);
 #endif
 
+int ugman_init_efl(Evas_Object *win, enum ug_option opt);
+
 int ugman_resume(void);
 int ugman_pause(void);
 int ugman_send_event(enum ug_event event);
index 41f5637..bc4a1e8 100644 (file)
@@ -58,6 +58,7 @@
 #include <X11/Xlib.h>
 #endif
 
+#include <Evas.h>
 #include <app.h>
 
 #ifdef __cplusplus
@@ -163,11 +164,8 @@ struct ug_cbs {
  * Easy-to-use macro of ug_init() for EFL
  * @see ug_init()
  */
-#ifndef WAYLAND
 #define UG_INIT_EFL(win, opt) \
-       ug_init((Display *)ecore_x_display_get(), elm_win_xwindow_get(win), \
-               win, opt)
-#endif
+    ug_init_efl(win, opt)
 
 /**
  * Easy-to-use macro of ug_init() for GTK
@@ -222,6 +220,35 @@ struct ug_cbs {
 #ifndef WAYLAND
 int ug_init(Display *disp, Window xid, void *win, enum ug_option opt);
 #endif
+
+/**
+ * \par Description:
+ * This function initializes default window and indicator state.
+ *
+ * @param[in] win A pointer to window evas object.
+ * @param[in] opt Default indicator state to restore application's indicator state
+ * @return 0 on success, -1 on error
+ *
+ * \pre None
+ * \post None
+ * \see UG_INIT_EFL()
+ * \remarks None
+ *
+ * \par Sample code:
+ * \code
+ * #include <ui-gadget.h>
+ * ...
+ * Evas_Object *win;
+ * ...
+ * // create window
+ * ...
+ * ug_init_efl(win, UG_OPT_INDICATOR_ENABLE);
+ * // for convenience you can use following macro: ELM_INIT_EFL(win, UG_OPT_INDICATOR_ENABLE);
+ * ...
+ * \endcode
+ */
+int ug_init_efl(Evas_Object *win, enum ug_option opt);
+
 /**
  * \par Description:
  * This function creates a UI gadget
index 3c084a9..e8e5113 100644 (file)
@@ -20,6 +20,7 @@ BuildRequires:  pkgconfig(utilX)
 BuildRequires:  pkgconfig(x11)
 %endif
 BuildRequires:  pkgconfig(appsvc)
+BuildRequires:  pkgconfig(elementary)
 BuildRequires:  pkgconfig(capi-appfw-application)
 BuildRequires:  pkgconfig(capi-appfw-app-manager)
 BuildRequires:  pkgconfig(vconf)
index 015e1eb..5c9cbed 100644 (file)
@@ -29,6 +29,7 @@
 #include <utilX.h>
 #include <X11/Xatom.h>
 #include <X11/Xutil.h>
+#include <Ecore_X.h>
 #endif
 
 #include <Ecore.h>
@@ -910,6 +911,16 @@ int ugman_init(Display *disp, Window xid, void *win, enum ug_option opt)
 }
 #endif
 
+int ugman_init_efl(Evas_Object *win, enum ug_option opt)
+{
+#ifndef WAYLAND
+    Ecore_X_Window xwin = elm_win_xwindow_get(win);
+    if (xwin)
+        return ugman_init((Display *)ecore_x_display_get(), xwin, win, opt);
+#endif
+    return -1;
+}
+
 int ugman_resume(void)
 {
        /* RESUME */
index af5bc47..60719bc 100644 (file)
--- a/src/ug.c
+++ b/src/ug.c
@@ -111,6 +111,21 @@ UG_API int ug_init(Display *disp, Window xid, void *win, enum ug_option opt)
 }
 #endif
 
+UG_API int ug_init_efl(Evas_Object *win, enum ug_option opt)
+{
+       if (!win) {
+               _ERR("ug_init_efl() failed: Invalid arguments");
+               return -1;
+       }
+
+       if (opt < UG_OPT_INDICATOR_ENABLE || opt >= UG_OPT_MAX) {
+               _ERR("ug_init_efl() failed: Invalid option");
+               return -1;
+       }
+
+       return ugman_init_efl(win, opt);
+}
+
 UG_API int ug_pause(void)
 {
        return ugman_pause();