static void _ecore_wl_cb_supported_aux_hints(void *data EINA_UNUSED, struct tizen_policy *tizen_policy EINA_UNUSED, struct wl_surface *surface_resource, struct wl_array *hints, uint32_t num_hints);
static void _ecore_wl_cb_allowed_aux_hint(void *data EINA_UNUSED, struct tizen_policy *tizen_policy EINA_UNUSED, struct wl_surface *surface_resource, int id);
static void _ecore_wl_window_conformant_area_send(Ecore_Wl_Window *win, uint32_t conformant_part, uint32_t state);
+static void _ecore_wl_cb_active_angle(void *data EINA_UNUSED, struct tizen_policy_ext *tizen_policy_ext EINA_UNUSED, uint32_t angle);
static void _ecore_wl_cb_effect_start(void *data EINA_UNUSED, struct tizen_effect *tizen_effect EINA_UNUSED, struct wl_surface *surface_resource, unsigned int type);
static void _ecore_wl_cb_effect_end(void *data EINA_UNUSED, struct tizen_effect *tizen_effect EINA_UNUSED, struct wl_surface *surface_resource, unsigned int type);
static void _ecore_wl_log_cb_print(const char *format, va_list args);
// TIZEN_ONLY(20150722): Add ecore_wl_window_keygrab_* APIs
static Eina_Hash *_keygrabs = NULL;
static int _ecore_wl_keygrab_error = -1;
+static int _ecore_wl_active_angle = -1;
//
static const struct wl_registry_listener _ecore_wl_registry_listener =
_ecore_wl_cb_allowed_aux_hint,
};
+static const struct tizen_policy_ext_listener _ecore_tizen_policy_ext_listener =
+{
+ _ecore_wl_cb_active_angle,
+};
+
static const struct tizen_effect_listener _ecore_tizen_effect_listener =
{
_ecore_wl_cb_effect_start,
{
ewd->wl.tz_policy_ext =
wl_registry_bind(registry, id, &tizen_policy_ext_interface, 1);
+ if (ewd->wl.tz_policy_ext)
+ tizen_policy_add_listener(_ecore_wl_disp->wl.tz_policy_ext, &_ecore_tizen_policy_ext_listener, ewd->wl.display);
}
else if (!strcmp(interface, "tizen_surface"))
{
_ecore_wl_keygrab_error = -1;
return ret;
}
+
+EAPI int
+ecore_wl_window_active_angle_get(Ecore_Wl_Window *win)
+{
+ struct wl_surface *surface = NULL;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!_ecore_wl_disp->wl.tz_policy_ext) return 0;
+
+ if (win)
+ surface = ecore_wl_window_surface_get(win);
+
+ tizen_policy_ext_get_active_angle(_ecore_wl_disp->wl.tz_policy_ext, surface);
+ ecore_wl_sync();
+
+ return _ecore_wl_active_angle;
+}
//
static void
}
static void
+_ecore_wl_cb_active_angle(void *data EINA_UNUSED, struct tizen_policy_ext *tizen_policy_ext EINA_UNUSED, uint32_t angle)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ _ecore_wl_active_angle = angle;
+}
+
+static void
_ecore_wl_cb_effect_start(void *data EINA_UNUSED, struct tizen_effect *tizen_effect EINA_UNUSED, struct wl_surface *surface_resource, unsigned int type)
{
struct wl_surface *surface = surface_resource;
extern const struct wl_interface tizen_policy_ext_interface;
extern const struct wl_interface tizen_rotation_interface;
+struct tizen_policy_ext_listener {
+ /**
+ * active_angle - (none)
+ * @angle: (none)
+ */
+ void (*active_angle)(void *data,
+ struct tizen_policy_ext *tizen_policy_ext,
+ uint32_t angle);
+};
+
+static inline int
+tizen_policy_ext_add_listener(struct tizen_policy_ext *tizen_policy_ext,
+ const struct tizen_policy_ext_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) tizen_policy_ext,
+ (void (**)(void)) listener, data);
+}
+
#define TIZEN_POLICY_EXT_GET_ROTATION 0
+#define TIZEN_POLICY_EXT_GET_ACTIVE_ANGLE 1
static inline void
tizen_policy_ext_set_user_data(struct tizen_policy_ext *tizen_policy_ext, void *user_data)
return (struct tizen_rotation *) id;
}
+static inline void
+tizen_policy_ext_get_active_angle(struct tizen_policy_ext *tizen_policy_ext, struct wl_surface *surface)
+{
+ wl_proxy_marshal((struct wl_proxy *) tizen_policy_ext,
+ TIZEN_POLICY_EXT_GET_ACTIVE_ANGLE, surface);
+}
+
#ifndef TIZEN_ROTATION_ANGLE_ENUM
#define TIZEN_ROTATION_ANGLE_ENUM
enum tizen_rotation_angle {
return wl_proxy_get_user_data((struct wl_proxy *) tizen_rotation);
}
+static inline uint32_t
+tizen_rotation_get_version(struct tizen_rotation *tizen_rotation)
+{
+ return wl_proxy_get_version((struct wl_proxy *) tizen_rotation);
+}
+
static inline void
tizen_rotation_destroy(struct tizen_rotation *tizen_rotation)
{
NULL,
&tizen_rotation_interface,
&wl_surface_interface,
+ &wl_surface_interface,
};
static const struct wl_message tizen_policy_ext_requests[] = {
{ "get_rotation", "no", types + 2 },
+ { "get_active_angle", "?o", types + 4 },
+};
+
+static const struct wl_message tizen_policy_ext_events[] = {
+ { "active_angle", "u", types + 0 },
};
WL_EXPORT const struct wl_interface tizen_policy_ext_interface = {
"tizen_policy_ext", 1,
- 1, tizen_policy_ext_requests,
- 0, NULL,
+ 2, tizen_policy_ext_requests,
+ 1, tizen_policy_ext_events,
};
static const struct wl_message tizen_rotation_requests[] = {