{
struct wl_resource *res;
- if (!(res = wl_resource_create(client, &tizen_policy_ext_interface, version, id)))
+ if (!(res = wl_resource_create(client, &tizen_policy_ext_interface2, version, id)))
{
ERR("Could not create scaler resource: %m");
wl_client_post_no_memory(client);
uint32_t serial;
struct wl_resource *resource;
enum tizen_rotation_angle tz_angle = TIZEN_ROTATION_ANGLE_0;
+ int ver;
EINA_SAFETY_ON_NULL_RETURN(ec);
EINA_SAFETY_ON_NULL_RETURN(hash_policy_ext_rotation);
EDBG(ec, "Send Change Rotation: angle %d", angle);
EINA_LIST_FOREACH(rot->rotation_list, l, resource)
{
- tizen_rotation_send_angle_change(resource, tz_angle, serial);
+ ver = wl_resource_get_version(resource); // resource is type of tizen_rotation_interface
+ if ((ver >= 2) && (ec->floating))
+ tizen_rotation_send_angle_change_with_resize(resource, tz_angle, serial, ec->h, ec->w);
+ else
+ tizen_rotation_send_angle_change(resource, tz_angle, serial);
}
}
EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl->wl.disp, EINA_FALSE);
- if (!wl_global_create(e_comp_wl->wl.disp, &tizen_policy_ext_interface, 1,
+ if (!wl_global_create(e_comp_wl->wl.disp, &tizen_policy_ext_interface2, 2,
NULL, _e_tizen_policy_ext_bind_cb))
{
ERR("Could not add tizen_policy_ext to wayland globals: %m");
static const struct wl_interface *types[] = {
NULL,
NULL,
+ NULL,
+ 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 },
+ { "get_rotation", "no", types + 4 },
+ { "get_active_angle", "?o", types + 6 },
};
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,
+WL_EXPORT const struct wl_interface tizen_policy_ext_interface2 = {
+ "tizen_policy_ext", 2,
2, tizen_policy_ext_requests,
1, tizen_policy_ext_events,
};
{ "available_angles_done", "u", types + 0 },
{ "preferred_angle_done", "u", types + 0 },
{ "angle_change", "uu", types + 0 },
+ { "angle_change_with_resize", "2uuuu", types + 0 },
};
WL_EXPORT const struct wl_interface tizen_rotation_interface = {
- "tizen_rotation", 1,
+ "tizen_rotation", 2,
4, tizen_rotation_requests,
- 3, tizen_rotation_events,
+ 4, tizen_rotation_events,
};
#include <stdint.h>
#include <stddef.h>
-#include "wayland-util.h"
+#include "wayland-server.h"
struct wl_client;
struct wl_resource;
struct tizen_policy_ext;
struct tizen_rotation;
+struct wl_surface;
-extern const struct wl_interface tizen_policy_ext_interface;
+extern const struct wl_interface tizen_policy_ext_interface2;
extern const struct wl_interface tizen_rotation_interface;
struct tizen_policy_ext_interface {
* get_active_angle - get a current active angle
* @surface: (none)
*
- *
+ *
*/
void (*get_active_angle)(struct wl_client *client,
struct wl_resource *resource,
#define TIZEN_POLICY_EXT_ACTIVE_ANGLE 0
+#define TIZEN_POLICY_EXT_ACTIVE_ANGLE_SINCE_VERSION 1
+
static inline void
tizen_policy_ext_send_active_angle(struct wl_resource *resource_, uint32_t angle)
{
#define TIZEN_ROTATION_AVAILABLE_ANGLES_DONE 0
#define TIZEN_ROTATION_PREFERRED_ANGLE_DONE 1
#define TIZEN_ROTATION_ANGLE_CHANGE 2
+#define TIZEN_ROTATION_ANGLE_CHANGE_WITH_RESIZE 3
+
+#define TIZEN_ROTATION_AVAILABLE_ANGLES_DONE_SINCE_VERSION 1
+#define TIZEN_ROTATION_PREFERRED_ANGLE_DONE_SINCE_VERSION 1
+#define TIZEN_ROTATION_ANGLE_CHANGE_SINCE_VERSION 1
+#define TIZEN_ROTATION_ANGLE_CHANGE_WITH_RESIZE_SINCE_VERSION 2
static inline void
tizen_rotation_send_available_angles_done(struct wl_resource *resource_, uint32_t angles)
wl_resource_post_event(resource_, TIZEN_ROTATION_ANGLE_CHANGE, angle, serial);
}
+static inline void
+tizen_rotation_send_angle_change_with_resize(struct wl_resource *resource_, uint32_t angle, uint32_t serial, uint32_t width, uint32_t height)
+{
+ wl_resource_post_event(resource_, TIZEN_ROTATION_ANGLE_CHANGE_WITH_RESIZE, angle, serial, width, height);
+}
+
#ifdef __cplusplus
}
#endif
<protocol name="tizen_policy_ext">
- <interface name="tizen_policy_ext" version="1">
+ <interface name="tizen_policy_ext" version="2">
<request name="get_rotation">
<arg name="id" type="new_id" interface="tizen_rotation" summary="new rotation object"/>
<arg name="surface" type="object" interface="wl_surface" summary="surface object"/>
<arg name="angle" type="uint"/>
</event>
</interface>
- <interface name="tizen_rotation" version="1">
+ <interface name="tizen_rotation" version="2">
<enum name="angle">
<entry name="none" value = "0"/>
<entry name="0" value = "1"/>
<description summary="ack a angle_change"/>
<arg name="serial" type="uint" summary="a serial to angle_change for"/>
</request>
+
+ <!-- Version 2 addtions -->
+ <event name="angle_change_with_resize" since="2">
+ <description summary="suggest a angle change with resize of window"/>
+ <arg name="angle" type="uint"/>
+ <arg name="serial" type="uint"/>
+ <arg name="width" type="uint"/>
+ <arg name="height" type="uint"/>
+ </event>
</interface>
</protocol>