[ug-wifi-direct]Remove X dependencies 36/46436/2 accepted/tizen/mobile/20150821.053032 accepted/tizen/tv/20150821.053049 accepted/tizen/wearable/20150821.053056 submit/tizen/20150821.022833
authorYu Jiung <jiung.yu@samsung.com>
Thu, 20 Aug 2015 08:24:01 +0000 (17:24 +0900)
committerYu Jiung <jiung.yu@samsung.com>
Fri, 21 Aug 2015 02:16:09 +0000 (11:16 +0900)
Change-Id: I42a3016f807340847a257da4a22cd15f1a8117c7
Signed-off-by: Yu jiung <jiung.yu@samsung.com>
packaging/libug-setting-wifidirect-efl.spec
popup-wifidirect/src/wfd-app-main.c
popup-wifidirect/src/wfd-app-popup-view.c
popup-wifidirect/src/wfd-app-util.c
ug-wifidirect/include/wfd_ug.h
ug-wifidirect/src/wfd_ug_popup.c

index a8cf220..bada490 100644 (file)
@@ -3,7 +3,7 @@
 
 Name:       libug-setting-wifidirect-efl
 Summary:    Wi-Fi Direct setting UI gadget
-Version:    1.11.63
+Version:    1.11.64
 Release:    1
 Group:      App/Network
 License:    Flora-1.1
index e81945c..c8374cd 100644 (file)
@@ -27,9 +27,6 @@
 
 #include <libintl.h>
 #include <Elementary.h>
-#if defined(X)
-#include <Ecore_X.h>
-#endif
 #include <notification.h>
 #include <ui-gadget-module.h>
 #include <app_control_internal.h>
@@ -38,9 +35,6 @@
 #include <efl_util.h>
 #include <efl_assist.h>
 #include <linux/unistd.h>
-#if defined(X)
-#include <utilX.h>
-#endif
 #include <vconf.h>
 
 #include "wfd-app.h"
@@ -62,7 +56,6 @@ static void _win_del(void *data, Evas_Object *obj, void *event)
 static Evas_Object *_create_win(Evas_Object *parent, const char *name)
 {
        Evas_Object *eo;
-       int w, h;
 
        /* eo = elm_win_add(parent, name, ELM_WIN_BASIC); */
        eo = elm_win_add(NULL, name, ELM_WIN_NOTIFICATION);
@@ -71,11 +64,7 @@ static Evas_Object *_create_win(Evas_Object *parent, const char *name)
                elm_win_borderless_set(eo, EINA_TRUE);
                elm_win_alpha_set(eo, EINA_TRUE);
                evas_object_smart_callback_add(eo, "delete,request", _win_del, NULL);
-#if defined(X)
-               ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
-#endif
                efl_util_set_notification_window_level(eo, EFL_UTIL_NOTIFICATION_LEVEL_1);
-               evas_object_resize(eo, w, h);
                evas_object_raise(eo);
        }
 
@@ -133,12 +122,6 @@ static bool _app_create(void *data)
        ad->layout = elm_layout_add(ad->conformant);
        elm_object_content_set(ad->conformant, ad->layout);
 
-#if defined(X)
-       if (!ecore_x_display_get()) {
-               return FALSE;
-       }
-#endif
-
        ret = init_wfd_client(ad);
        if (!ret) {
                WFD_APP_LOG(WFD_APP_LOG_ERROR, "init_wfd_popup_client error\n");
index 6a007af..9541761 100755 (executable)
 #include <Elementary.h>
 #include <efl-assist/efl_assist.h>
 #include <vconf.h>
-#if defined(X)
-#include <X11/Xatom.h>
-#include <X11/Xutil.h>
-#include <Ecore_X.h>
-#include <utilX.h>
-#endif
 #include <notification.h>
 #include <feedback.h>
 #include <wifi-direct.h>
@@ -72,30 +66,6 @@ static void mouseup_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
                evas_object_del(obj);
        }
 }*/
-static Eina_Bool __rotate(void *data, int type, void *event)
-{
-       __WFD_APP_FUNC_ENTER__;
-       wfd_appdata_t *ad = (wfd_appdata_t *)data;
-#if defined(X)
-       Ecore_X_Event_Client_Message *ev = event;
-#endif
-       int rots[4] = {0, 90, 180, 270};
-
-       if (ad == NULL || ad->win == NULL) {
-               WFD_APP_LOG(WFD_APP_LOG_ERROR, "Parameter NULL");
-               return EINA_FALSE;
-       }
-
-#if defined(X)
-       if (ev->message_type == ECORE_X_ATOM_E_ILLUME_ROTATE_ROOT_ANGLE) {
-               WFD_APP_LOG(WFD_APP_LOG_LOW, "ev->message_type: [%d]\n", ev->message_type);
-               elm_win_wm_rotation_available_rotations_set(ad->win, rots, 1);
-       }
-#endif
-
-       __WFD_APP_FUNC_EXIT__;
-       return EINA_FALSE;
-}
 
 /**
  *     This function let the ug make a callback for click the button in popup
@@ -294,114 +264,24 @@ void wfd_destroy_popup()
        __WFD_APP_FUNC_EXIT__;
        return;
 }
-#if defined(X)
-static int __get_window_property(Display *dpy, Window win, Atom atom,
-               Atom type, unsigned int *val, unsigned int len)
-{
-       __WFD_APP_FUNC_ENTER__;
-       unsigned char *prop_ret = NULL;
-       Atom type_ret = -1;
-       unsigned long bytes_after = 0;
-       unsigned long  num_ret = -1;
-       int format_ret = -1;
-       unsigned int i = 0;
-       int num = 0;
-
-       prop_ret = NULL;
-       if (XGetWindowProperty(dpy, win, atom, 0, 0x7fffffff, False,
-                               type, &type_ret, &format_ret, &num_ret,
-                               &bytes_after, &prop_ret) != Success) {
-               return -1;
-       }
-
-       if (type_ret != type || format_ret != 32) {
-               num = -1;
-       } else if (num_ret == 0 || !prop_ret) {
-               num = 0;
-       } else {
-               if (num_ret < len) {
-                       len = num_ret;
-               }
-               for (i = 0; i < len; i++) {
-                       val[i] = ((unsigned long *)prop_ret)[i];
-               }
-               num = len;
-       }
-
-       if (prop_ret) {
-               XFree(prop_ret);
-       }
-
-       __WFD_APP_FUNC_EXIT__;
-       return num;
-}
-
-static int __x_rotation_get(Display *dpy, void* win)
-{
-       __WFD_APP_FUNC_ENTER__;
-       Window active_win = 0;
-       Window root_win = 0;
-       int rotation = -1;
-       int ret = -1;
 
-       Atom atom_active_win;
-       Atom atom_win_rotate_angle;
-
-       root_win = XDefaultRootWindow(dpy);
-
-       atom_active_win = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False);
-       ret = __get_window_property(dpy, root_win, atom_active_win,
-                       XA_WINDOW, (unsigned int *)&active_win, 1);
-
-       if (ret != 1) {
-               return 0;
-       }
-
-       atom_win_rotate_angle =
-               XInternAtom(dpy, "_E_ILLUME_ROTATE_WINDOW_ANGLE", False);
-       ret = __get_window_property(dpy, active_win     ,
-                       atom_win_rotate_angle, XA_CARDINAL,
-                       (unsigned int *)&rotation, 1);
-
-       __WFD_APP_FUNC_EXIT__;
-
-       if (ret == 1) {
-               return rotation;
-       } else {
-               return 0;
-       }
-}
 void __set_parent_rotate_angle(wfd_appdata_t *ad)
 {
        __WFD_APP_FUNC_ENTER__;
 
-       int rotate_angle = 0;
        int rots1[1] = {0};
-       int rots2[4] = {0, 90, 180, 270};
 
        if (ad == NULL || ad->win == NULL) {
                WFD_APP_LOG(WFD_APP_LOG_ERROR, "Parameter NULL");
                return;
        }
 
-       rotate_angle = __x_rotation_get(ecore_x_display_get(), NULL);
-
-       WFD_APP_LOG(WFD_APP_LOG_LOW, "rotate_angle: [%d]\n", rotate_angle);
-
-       if (rotate_angle < 0) {
-               rotate_angle = 0;
-       }
-
-       if (rotate_angle == 0) {
-               elm_win_wm_rotation_available_rotations_set(ad->win, rots1, 1);
-       } else {
-               elm_win_wm_rotation_available_rotations_set(ad->win, rots2, 1);
-       }
+       elm_win_wm_rotation_available_rotations_set(ad->win, rots1, 1);
 
        __WFD_APP_FUNC_EXIT__;
        return;
 }
-#endif
+
 /**
  *     This function let the app create a popup which includes no button
  *     @return   popup
@@ -423,14 +303,9 @@ static Evas_Object *wfd_draw_pop_type_a(Evas_Object * win, wfd_popup_t * pop)
        evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        elm_object_domain_translatable_text_set(popup, PACKAGE, pop->text);
        elm_popup_timeout_set(popup, pop->timeout);
-#if defined(X)
        __set_parent_rotate_angle(ad);
-#endif
        evas_object_show(popup);
        evas_object_show(win);
-#if defined(X)
-       ad->rotate_event_handler = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, __rotate, ad);
-#endif
 
        __WFD_APP_FUNC_EXIT__;
        return popup;
@@ -463,14 +338,9 @@ static Evas_Object *wfd_draw_pop_type_b(Evas_Object * win, wfd_popup_t * pop)
        elm_object_part_content_set(popup, "button1", btn);
        evas_object_smart_callback_add(btn, "clicked", __popup_resp_cb, (void *) pop->resp_data1);
 
-#if defined(X)
        __set_parent_rotate_angle(ad);
-#endif
        evas_object_show(popup);
        evas_object_show(win);
-#if defined(X)
-       ad->rotate_event_handler = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, __rotate, ad);
-#endif
 
        __WFD_APP_FUNC_EXIT__;
        return popup;
@@ -513,14 +383,9 @@ static Evas_Object *wfd_draw_pop_type_c(Evas_Object * win, wfd_popup_t * pop)
        evas_object_smart_callback_add(btn2, "clicked", __popup_resp_cb,
                (void *) pop->resp_data1);
 
-#if defined(X)
        __set_parent_rotate_angle(ad);
-#endif
        evas_object_show(popup);
        evas_object_show(win);
-#if defined(X)
-       ad->rotate_event_handler = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, __rotate, ad);
-#endif
 
        __WFD_APP_FUNC_EXIT__;
        return popup;
@@ -575,14 +440,9 @@ Evas_Object *wfd_draw_pop_type_auto_deactivation(Evas_Object *win,  void *userda
        elm_object_part_content_set(popup, "button1", btn);
        evas_object_smart_callback_add(btn, "clicked", _wfd_ug_automatic_turn_off_popup_cb, userdata);
 
-#if defined(X)
        __set_parent_rotate_angle(ad);
-#endif
        evas_object_show(popup);
        evas_object_show(win);
-#if defined(X)
-       ad->rotate_event_handler = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, __rotate, ad);
-#endif
 
        __WFD_APP_FUNC_EXIT__;
        return popup;
@@ -897,14 +757,9 @@ Evas_Object *wfd_draw_pop_type_display(Evas_Object * win, wfd_popup_t * pop)
        }
 
        elm_object_content_set(popup, layout);
-#if defined(X)
        __set_parent_rotate_angle(ad);
-#endif
        evas_object_show(popup);
        evas_object_show(win);
-#if defined(X)
-       ad->rotate_event_handler = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, __rotate, ad);
-#endif
 
        __WFD_APP_FUNC_EXIT__;
        return popup;
@@ -1264,16 +1119,10 @@ Evas_Object *wfd_draw_pop_type_keypad(Evas_Object * win, wfd_popup_t * pop)
        evas_object_show(genlist);
        elm_object_content_set(pinpopup, genlist);
 
-#if defined(X)
        __set_parent_rotate_angle(ad);
-#endif
        evas_object_show(pinpopup);
        evas_object_show(win);
        elm_object_focus_set(ad->pin_entry, EINA_TRUE);
-#if defined(X)
-       ad->rotate_event_handler = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE,
-                       __rotate, ad);
-#endif
 
        __WFD_APP_FUNC_EXIT__;
        return pinpopup;
index e52f4d1..edb0dec 100644 (file)
@@ -30,9 +30,6 @@
 #include <string.h>
 
 #include <Elementary.h>
-#if defined(X)
-#include <utilX.h>
-#endif
 #include <vconf.h>
 #include <app_control_internal.h>
 #include <notification.h>
@@ -45,6 +42,8 @@
 #include "wfd-app.h"
 #include "wfd-app-util.h"
 
+#define KEY_SELECT "XF86Home"
+
 char *wfd_app_trim_path(const char *filewithpath)
 {
 #if 0
@@ -569,7 +568,7 @@ static Eina_Bool _wfd_hard_key_down_cb(void *data, int type, void *event)
                WFD_APP_LOG(WFD_APP_LOG_ERROR, "Invalid AppData parameter");
                return EINA_FALSE;
        }
-#if defined(KEY)
+
        if (!strcmp(ev->keyname, KEY_SELECT)) {
                WFD_APP_LOG(WFD_APP_LOG_HIGH, "[KEY]KEY_SELECT pressed");
                WFD_APP_LOG(WFD_APP_LOG_HIGH, "Mac : %s", ad->mac_addr_connecting);
@@ -586,7 +585,7 @@ static Eina_Bool _wfd_hard_key_down_cb(void *data, int type, void *event)
                WFD_APP_LOG(WFD_APP_LOG_HIGH, "[KEY][%s] pressed not Handled",
                        ev->keyname);
        }
-#endif
+
        return EINA_FALSE;
 }
 
index 5c768b2..4e1e585 100644 (file)
@@ -355,10 +355,6 @@ struct ug_data {
        GCancellable *dbus_cancellable;
        GDBusConnection *conn;
 #endif
-#if defined(EA)
-       Ea_Theme_Color_Table *color_table;
-       Ea_Theme_Font_Table *font_table;
-#endif
 };
 
 extern Elm_Gen_Item_Class device_name_title_itc;
index b6b397d..d78b65b 100755 (executable)
 #include <wifi-direct.h>
 #include <efl_extension.h>
 
-#if defined(X)
-#include "utilX.h"
-#endif
 #include "wfd_ug.h"
 #include "wfd_ug_view.h"
 #include "wfd_client.h"
 
+#define KEY_BACK "XF86Back"
+
 static void delete_popup(void *data)
 {
        __FUNC_ENTER__;
@@ -104,7 +103,6 @@ static void _mouseup_wifi_cb(void *data, Evas *e, Evas_Object *obj, void *event_
 static void _keydown_wifi_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
 
-#if defined(KEY)
        Evas_Event_Key_Down *ev = event_info;
        if (!strcmp(ev->keyname, KEY_BACK)) {
                struct ug_data *ugd = (struct ug_data *) data;
@@ -115,7 +113,6 @@ static void _keydown_wifi_cb(void *data, Evas *e, Evas_Object *obj, void *event_
                evas_object_del(ugd->act_popup);
                ugd->act_popup = NULL;
        }
-#endif
 }
 #endif /* MODEL_BUILD_FEATURE_WLAN_CONCURRENT_MODE */
 
@@ -135,7 +132,6 @@ static void _mouseup_hotspot_cb(void *data, Evas *e, Evas_Object *obj, void *eve
 }
 static void _keydown_hotspot_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
-#if defined(KEY)
        Evas_Event_Key_Down *ev = event_info;
        if (!strcmp(ev->keyname, KEY_BACK)) {
                struct ug_data *ugd = (struct ug_data *) data;
@@ -146,7 +142,6 @@ static void _keydown_hotspot_cb(void *data, Evas *e, Evas_Object *obj, void *eve
                evas_object_del(ugd->act_popup);
                ugd->act_popup = NULL;
        }
-#endif
 }
 
 static void _mouseup_disconnect_all_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)