#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>
#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"
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);
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);
}
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");
#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>
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
__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
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;
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;
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;
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;
}
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;
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;