revert cd59af8f9aceab2b2cef52ac2fc122cb5e028702 75/34875/1
authorBoram Park <boram1288.park@samsung.com>
Wed, 4 Feb 2015 05:15:47 +0000 (14:15 +0900)
committerBoram Park <boram1288.park@samsung.com>
Wed, 4 Feb 2015 05:15:58 +0000 (14:15 +0900)
Change-Id: Iccef1c330658ea85db0d06100701923821f6f78c

CMakeLists.txt
capi-ui-efl-util.pc.in
config.h.in [deleted file]
include/efl_util.h
packaging/capi-ui-efl-util.spec
src/efl_util.c

index c0b9e7b..fae5e44 100644 (file)
@@ -13,26 +13,21 @@ INCLUDE_DIRECTORIES(${INC_DIR})
 # required dependencies
 SET(dependents "dlog elementary capi-base-common")
 
+IF (WITH_X11)
+    ADD_DEFINITIONS("-DX11")
+    SET(dependents "${dependents} ecore-x utilX")
+ENDIF (WITH_X11)
+
+IF (WITH_WAYLAND)
+    ADD_DEFINITIONS("-DWAYLAND")
+ENDIF (WITH_WAYLAND)
+
 INCLUDE(FindPkgConfig)
 pkg_check_modules(${fw_name} REQUIRED ${dependents})
 FOREACH(flag ${${fw_name}_CFLAGS})
     SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
 
-# optional
-SET(ECORE_X "ecore-x utilX")
-pkg_check_modules(ECORE_X ${ECORE_X})
-FOREACH(flag ${${ECORE_X}_CFLAGS})
-    SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-IF (ECORE_X_FOUND)
-   SET(HAVE_X "1")
-   SET(deps "${deps} ecore-x utilX")
-ELSE (ECORE_X_FOUND)
-   SET(HAVE_X "0")
-ENDIF (ECORE_X_FOUND)
-
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror")
 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
 
@@ -75,13 +70,6 @@ CONFIGURE_FILE(
     ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
     @ONLY
 )
-
-CONFIGURE_FILE(
-    config.h.in
-    ${CMAKE_CURRENT_SOURCE_DIR}/include/config.h
-    @ONLY
-)
-
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
 
 IF(UNIX)
index a73c2bd..b9737af 100644 (file)
@@ -9,7 +9,7 @@ includedir=/usr/include/ui
 Name: @PC_NAME@
 Description: @PACKAGE_DESCRIPTION@
 Version: @VERSION@
-Requires: @deps@ @PC_REQUIRED@ 
+Requires: @PC_REQUIRED@ 
 Libs: -L${libdir} @PC_LDFLAGS@
 Cflags: -I${includedir} @PC_CFLAGS@
 
diff --git a/config.h.in b/config.h.in
deleted file mode 100644 (file)
index 425d31f..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef _CONFIG_H_H_
-#define _CONFIG_H_H_
-
-#define ECORE_X_FOUND @HAVE_X@
-
-// use the cmake @ECORE_WAYLAND_FOUND@ when wayland supported
-#define ECORE_WAYLAND_FOUND 0
-
-#endif /* _CONFIG.H_H_ */
index fe01c53..5a1080d 100644 (file)
@@ -34,129 +34,6 @@ extern "C" {
  * @{
  */
 
-// Duplicated from utilX.h, should be moved to somewhere common in the future
-
-#ifndef KEY_VOLUMEUP
-#define KEY_VOLUMEUP           "XF86AudioRaiseVolume"  /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Volume Up' key */
-#endif
-
-#ifndef KEY_VOLUMEDOWN
-#define KEY_VOLUMEDOWN         "XF86AudioLowerVolume"  /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Volume Down' key */
-#endif
-
-#ifndef KEY_CAMERA
-#define KEY_CAMERA             "XF86WebCam"    /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Half-Press of Camera' key */
-#endif
-
-#ifndef KEY_CONFIG
-#define KEY_CONFIG             "XF86Pictures"  /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Full-Press of Camera' key */
-#endif
-
-#ifndef KEY_POWER
-#define KEY_POWER              "XF86PowerOff"  /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Power' key */
-#endif
-
-#ifndef KEY_PAUSE
-#define KEY_PAUSE              "XF86Standby"   /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Pause' key */
-#endif
-
-#ifndef KEY_CANCEL
-#define KEY_CANCEL              "Cancel"        /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Cancel' key */
-#endif
-
-// Earjack/BT Headset/Multimedia keys
-#ifndef KEY_PLAYCD
-#define KEY_PLAYCD             "XF86AudioPlay" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Play Audio' key */
-#endif
-
-#ifndef KEY_STOPCD
-#define KEY_STOPCD             "XF86AudioStop" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Stop Audio' key */
-#endif
-
-#ifndef KEY_PAUSECD
-#define KEY_PAUSECD            "XF86AudioPause"        /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Pause Audio' key */
-#endif
-
-#ifndef KEY_NEXTSONG
-#define KEY_NEXTSONG           "XF86AudioNext" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Next Song' key */
-#endif
-
-#ifndef KEY_PREVIOUSSONG
-#define KEY_PREVIOUSSONG       "XF86AudioPrev" /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Previous Song' key */
-#endif
-
-#ifndef KEY_REWIND
-#define KEY_REWIND             "XF86AudioRewind"       /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Rewind Song' key */
-#endif
-
-#ifndef KEY_FASTFORWARD
-#define KEY_FASTFORWARD                "XF86AudioForward"      /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Forward Song' key */
-#endif
-
-#ifndef KEY_MEDIA
-#define KEY_MEDIA              "XF86AudioMedia"        /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Media' key */
-#endif
-
-// 3-Touch key
-#ifndef KEY_SEND
-#define KEY_SEND               "XF86Send"      /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Send' key */
-#endif
-
-#ifndef KEY_SELECT
-#define KEY_SELECT             "XF86Phone"     /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Home' key */
-#endif
-
-#ifndef KEY_END
-#define KEY_END                        "XF86Stop"      /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'End' key */
-#endif
-
-// Renamed 3-Touch key
-#ifndef KEY_MENU
-#define KEY_MENU               "XF86Send"      /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Send' key */
-#endif
-
-#ifndef KEY_HOME
-#define KEY_HOME               "XF86Phone"     /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'Home' key */
-#endif
-
-#ifndef KEY_BACK
-#define KEY_BACK               "XF86Stop"      /**< this macro means the XKeySym (XServer Key Symbol) corresponds to 'End' key */
-#endif
-
-#ifndef OR_EXCLUSIVE_GRAB
-#define OR_EXCLUSIVE_GRAB      0xf00000        /**< this means that the client window will always get the grabbed-key exclusively regardless of the position on the window stack but the grab is overridable by the other client window */
-#endif
-
-#ifndef EXCLUSIVE_GRAB
-#define EXCLUSIVE_GRAB         0x0f0000        /**< this means that the client window will always get the grabbed-key exclusively regardless of the position on the window stack */
-#endif
-
-#ifndef TOP_POSITION_GRAB
-#define TOP_POSITION_GRAB      0x00f000        /**< this means that the client window will get the grabbed-key only when on the top of the grabbing-window stack */
-#endif
-
-#ifndef SHARED_GRAB
-#define SHARED_GRAB            0x000f00        /**< this means that the client window will get the grabbed-key together with the other client window(s) */
-#endif
-
-#ifndef GRAB_MODE_MASK
-#define GRAB_MODE_MASK 0xffff00        /**< this mask will be used for getting the key-grab mode of a client window */
-#endif
-
-typedef enum _Efl_Util_Window_Type
-{
-       EFL_UTIL_WINDOW_TYPE_NORMAL = 8, /**< ecore_x compatible, ECORE_X_WINDOW_TYPE_NORMAL */
-       EFL_UTIL_WINDOW_TYPE_NOTIFICATION = 12, /**< ecore_x compatible, ECORE_X_WINDOW_TYPE_NOTIFICATION */
-} Efl_Util_Window_Type;
-
-typedef enum _Efl_Util_Notification_Level
-{
-       EFL_UTIL_NOTIFICATION_LEVEL_LOW, /**< low level notification */
-       EFL_UTIL_NOTIFICATION_LEVEL_NORMAL, /**< normal level notification*/
-       EFL_UTIL_NOTIFICATION_LEVEL_HIGH, /**< high level notification */
-       EFL_UTIL_NOTIFICATION_LEVEL_UNKNOWN
-} Efl_Util_Notification_Level;
-
 /**
  * @brief Enumeration for EFL UTIL ERROR.
  * @since_tizen 2.3
@@ -171,13 +48,6 @@ typedef enum
        //EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE = TIZEN_ERROR_EFL_UTIL | 0x01  /**< Window type not supported */
 } efl_util_error_e;
 
-// TODO: are we going to have more states than on/off shouldn't we move it to a bool in the API's
-typedef enum _Efl_Util_Opaque_State
-{
-       EFL_UTIL_OPAQUE_STATE_OFF = 0, /**< Transparent state */
-       EFL_UTIL_OPAQUE_STATE_ON  = 1, /**< Opaque state */
-} Efl_Util_Opaque_State;
-
 /**
  * @brief Enumeration of notification window's priority level.
  * @since_tizen 2.3
@@ -189,31 +59,6 @@ typedef enum
        EFL_UTIL_NOTIFICATION_LEVEL_3, /**< The highest notification level */
 } efl_util_notification_level_e; 
 
-typedef enum _Efl_Util_Effect_Type
-{
-       EFL_UTIL_EFFECT_TYPE_MAP, /**< Effect for Window's Map Notify Event */
-       EFL_UTIL_EFFECT_TYPE_UNMAP, /**< Effect for Window's UnMap Notify Event */
-       EFL_UTIL_EFFECT_TYPE_RAISEABOVE, /**< Effect for Window's Configure Notify ( RaiseAbove case ) Event */
-       EFL_UTIL_EFFECT_TYPE_ROTATION, /**< Effect for Window's Rotation Property Change Notify Event ( X Property: ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE ) */
-       EFL_UTIL_EFFECT_TYPE_FOCUSIN, /**< Effect for Window's FocusIn Event ( E17's Event: E_EVENT_BORDER_FOCUS_IN ) */
-       EFL_UTIL_EFFECT_TYPE_FOCUSOUT /**< Effect for Window's FocusOut Event ( E17's Event : E_EVENT_BORDER_FOCUS_OUT ) */
-} Efl_Util_Effect_Type;
-
-typedef enum _Efl_Util_Effect_Style
-{
-       EFL_UTIL_EFFECT_STYLE_DEFAULT, /**< Default Effect Style for Effect Type */
-       EFL_UTIL_EFFECT_STYLE_NONE, /**< None of Effect Style for Effect Type */
-       EFL_UTIL_EFFECT_STYLE_CUSTOM0, /**< Custom0 Effect Style for Effect Type */
-       EFL_UTIL_EFFECT_STYLE_CUSTOM1, /**< Custom1 Effect Style for Effect Type */
-       EFL_UTIL_EFFECT_STYLE_CUSTOM2, /**< Custom2 Effect Style for Effect Type */
-       EFL_UTIL_EFFECT_STYLE_CUSTOM3, /**< Custom3 Effect Style for Effect Type */
-       EFL_UTIL_EFFECT_STYLE_CUSTOM4, /**< Custom4 Effect Style for Effect Type */
-       EFL_UTIL_EFFECT_STYLE_CUSTOM5, /**< Custom5 Effect Style for Effect Type */
-       EFL_UTIL_EFFECT_STYLE_CUSTOM6, /**< Custom6 Effect Style for Effect Type */
-       EFL_UTIL_EFFECT_STYLE_CUSTOM7, /**< Custom7 Effect Style for Effect Type */
-       EFL_UTIL_EFFECT_STYLE_CUSTOM8, /**< Custom8 Effect Style for Effect Type */
-       EFL_UTIL_EFFECT_STYLE_CUSTOM9 /**< Custom9 Effect Style for Effect Type */
-} Efl_Util_Effect_Style;
 
 /**
  * @brief Sets the priority level for the specified notification window, asynchronously.
@@ -291,77 +136,6 @@ int efl_util_set_notification_window_level_error_cb(Evas_Object *window, efl_uti
 int efl_util_unset_notification_window_level_error_cb(Evas_Object *window);
 
 
-/** 
- * @brief Grabs a key specfied by key_name for obj in grab_mode.
- *
- * @param obj The Evas_Object representing the window to set the key grab to.
- * @param key The key of interest.
- * @param grab_mode EXCLUSIVE_GRAB, TOP_POSITION_GRAB, SHARED_GRAB, EXCLUSIVE_GRAB
- *
- * @return 0 on Success, fail othrewise.
- * @see efl_util_ungrab_key()
- */
-int efl_util_grab_key (Evas_Object *obj, const char* key, int grab_mode);
-
-/** 
- * @brief Ungrabs a key specfied by key_name for win
- *
- * @param obj The Evas_Object representing the window to ungrab the key.
- * @param key The key of interest.
- *
- * @return 0 on Success, fail otherwise.
- * @see efl_util_grab_key()
- */
-int efl_util_ungrab_key (Evas_Object *obj, const char* key);
-
-/** 
- * @brief Sets the priority level for the specified notification window
- *
- * @param obj The Evas_Object representing the window to set the notification level.
- * @param level The notification level.
- *
- * @see Efl_Util_Notification_Level
- */
-void efl_util_set_system_notification_level (Evas_Object *obj, Efl_Util_Notification_Level level);
-
-/** 
- * @brief Gets the priority level for the specified notification window.
- *
- * @param obj The Evas_Object representing the window to get the system notification level
- * set to.
- *
- * @return current notication level (EFL_UTIL_NOTIFICATION_LEVEL_LOW,
- *         EFL_UTIL_NOTIFICATION_LEVEL_NORMAL, EFL_UTIL_NOTIFICATION_LEVEL_HIGH)
- */
-Efl_Util_Notification_Level efl_util_get_system_notification_level (Evas_Object *obj);
-
-/** 
- * @brief Set the functional type of window by sending _NET_WM_WINDOW_TYPE property to window.
- *
- * @param obj The Evas_Object representing the window to set the net_wm to.
- * @param type The type to be set.
- */
-void efl_util_netwm_window_type_set(Evas_Object *obj, Efl_Util_Window_Type type);
-
-/** 
- * @brief Sets a window's effect style with effect type.
- *
- * @param win The window to set the style to.
- * @param type type Specifies the window's effect type ( ex. EFL_UTIL_EFFECT_TYPE_MAP, EFL_UTIL_EFFECT_TYPE_UNMAP, etc )
- * @param style Specifies  the window's effect style ( ex. EFL_UTIL_EFFECT_STYLE_DEFAULT, EFL_UTIL_EFFECT_STYLE_NONE, EFL_UTIL_EFFECT_STYLE_CUSTOM0, etc )
- */
-void efl_util_set_window_effect_style(Evas_Object *win, Efl_Util_Effect_Type type, Efl_Util_Effect_Style style);
-
-/**
- * @brief Sets the window's opaque state
- *
- * @param win The window to set the opaque state to.
- * @param state The state (EFL_UTIL_OPAQUE_STATE_ON, EFL_UTIL_OPAQUE_STATE_OFF).
- *
- * @return 0 on failure
- */
-int efl_util_set_window_opaque_state (Evas_Object *win, Efl_Util_Opaque_State state);
-
 /**
  * @}
  */
index 60028ec..fb01a29 100644 (file)
@@ -1,4 +1,6 @@
 %bcond_with x
+%bcond_with wayland
+
 Name:       capi-ui-efl-util
 Summary:    An EFL utility library in SLP C API
 Version:    0.1.1
@@ -35,7 +37,14 @@ cp %{SOURCE1001} .
 
 %build
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
+%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \
+%if %{with wayland}
+-DWITH_WAYLAND=TRUE
+%endif
+%if %{with x}
+-DWITH_X11=TRUE
+%endif
+
 make %{?jobs:-j%jobs}
 
 %install
index 4faaa75..98b9ce3 100644 (file)
 #define LOG_TAG "TIZEN_N_EFL_UTIL"
 
 #include <efl_util.h>
-#include <config.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <Elementary.h>
 
-#if ECORE_X_FOUND
+#if X11
 #include <Ecore_X.h>
 #include <utilX.h>
 #endif
@@ -44,7 +43,7 @@ static notification_error_cb_info *_notification_error_cb_info_find(Evas_Object
 static Eina_Bool _efl_util_notification_info_add(Evas_Object *window, efl_util_notification_window_level_error_cb callback, void *user_data);
 static Eina_Bool _efl_util_notification_info_del(Evas_Object *window);
 
-#if ECORE_X_FOUND
+#if X11
 static unsigned int _noti_level_access_result_atom = 0;
 
 static Eina_Bool _efl_util_client_message(void *data, int type, void *event);
@@ -59,7 +58,7 @@ int efl_util_set_notification_window_level (Evas_Object* window, efl_util_notifi
                                        level <= EFL_UTIL_NOTIFICATION_LEVEL_3,
                                        EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-#if ECORE_X_FOUND
+#if X11
        Ecore_X_Window xwin = elm_win_xwindow_get(window);
        if (xwin)
        {
@@ -104,7 +103,7 @@ int efl_util_get_notification_window_level (Evas_Object* window, efl_util_notifi
        EINA_SAFETY_ON_NULL_RETURN_VAL(level,
                                       EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-#if ECORE_X_FOUND
+#if X11
        Ecore_X_Window_Type window_type;
        Utilx_Notification_Level utilx_level;
        Ecore_X_Window xwin = elm_win_xwindow_get(window);
@@ -172,7 +171,7 @@ int efl_util_set_notification_window_level_error_cb(Evas_Object *window, efl_uti
        ret = _efl_util_notification_info_add(window, callback, user_data);
        if (ret)
        {
-#if ECORE_X_FOUND
+#if X11
                if (!_noti_level_access_result_atom)
                        _noti_level_access_result_atom = ecore_x_atom_get("_E_NOTIFICATION_LEVEL_ACCESS_RESULT");
 
@@ -216,48 +215,7 @@ int efl_util_unset_notification_window_level_error_cb(Evas_Object *window)
        return EFL_UTIL_ERROR_INVALID_PARAMETER;
 }
 
-int efl_util_grab_key (Evas_Object *obj, const char* key, int grab_mode)
-{
-       fprintf (stderr, "%s deprecated\n", __FUNCTION__);
-
-       return 0;
-}
-
-int efl_util_ungrab_key (Evas_Object *obj, const char* key)
-{
-       fprintf (stderr, "%s deprecated\n", __FUNCTION__);
-
-       return 0;
-}
-
-void efl_util_set_system_notification_level (Evas_Object *obj, Efl_Util_Notification_Level level)
-{
-       fprintf (stderr, "%s deprecated\n", __FUNCTION__);
-}
-
-Efl_Util_Notification_Level efl_util_get_system_notification_level (Evas_Object *obj)
-{
-       fprintf (stderr, "%s deprecated\n", __FUNCTION__);
-       return EFL_UTIL_NOTIFICATION_LEVEL_UNKNOWN;
-}
-
-void efl_util_netwm_window_type_set(Evas_Object *obj, Efl_Util_Window_Type type)
-{
-       fprintf (stderr, "%s deprecated\n", __FUNCTION__);
-}
-
-void efl_util_set_window_effect_style(Evas_Object *win, Efl_Util_Effect_Type type, Efl_Util_Effect_Style style)
-{
-       fprintf (stderr, "%s deprecated\n", __FUNCTION__);
-}
-
-int efl_util_set_window_opaque_state (Evas_Object *win, Efl_Util_Opaque_State state)
-{
-       fprintf (stderr, "%s deprecated\n", __FUNCTION__);
-       return 0;
-}
-
-#if ECORE_X_FOUND
+#if X11
 static Eina_Bool _efl_util_client_message(void *data, int type, void *event)
 {
        Ecore_X_Event_Client_Message *ev;