summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Peresipkyn <r.peresipkyn@samsung.com>2016-07-06 17:33:44 +0300
committerRoman Peresipkyn <r.peresipkyn@samsung.com>2016-07-06 17:36:00 +0300
commit2c8e6ec9bdb2951710a45549dfa4498bee9f7988 (patch)
tree1be2064ddf840469bbaa4763fb4f8100f6182c46
parent53668d7947b0b903db78953ba499ec14ca9e0ba0 (diff)
downloadlibeom-2c8e6ec9bdb2951710a45549dfa4498bee9f7988.tar.gz
libeom-2c8e6ec9bdb2951710a45549dfa4498bee9f7988.tar.bz2
libeom-2c8e6ec9bdb2951710a45549dfa4498bee9f7988.zip
Extending of EOM protocol by which clients set its windows using wl_eom_set_xdg_window and wl_eom_set_shell_window
Change-Id: Iac8b696b79180c3a0d02cc439afa59f4ffc2a85c Signed-off-by: Roman Peresipkyn <r.peresipkyn@samsung.com>
-rw-r--r--src/wayland/eom-wayland.c7
-rw-r--r--src/wayland/protocol/eom-client-protocol.h55
-rw-r--r--src/wayland/protocol/eom-protocol.c11
-rw-r--r--src/wayland/protocol/eom.xml10
4 files changed, 61 insertions, 22 deletions
diff --git a/src/wayland/eom-wayland.c b/src/wayland/eom-wayland.c
index c1971b4..27f0d09 100644
--- a/src/wayland/eom-wayland.c
+++ b/src/wayland/eom-wayland.c
@@ -956,14 +956,11 @@ eom_wayland_client_set_window(eom_output_id output_id, Evas_Object *win)
/* set full screen at output */
xdg_shell_surface = ecore_wl_window_xdg_surface_get(e_wl_win);
if (xdg_shell_surface) {
- xdg_surface_set_fullscreen(xdg_shell_surface,
- eom_wl_output->output);
+ wl_eom_set_xdg_window(wl_client_info.eom, output_id, xdg_shell_surface);
} else {
shell_surface = ecore_wl_window_shell_surface_get(e_wl_win);
if (shell_surface) {
- wl_shell_surface_set_fullscreen(shell_surface,
- WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
- 0, eom_wl_output->output);
+ wl_eom_set_shell_window(wl_client_info.eom, output_id, shell_surface);
} else {
ERR("no wl surface.\n");
goto fail;
diff --git a/src/wayland/protocol/eom-client-protocol.h b/src/wayland/protocol/eom-client-protocol.h
index 67fb8a3..7172c5f 100644
--- a/src/wayland/protocol/eom-client-protocol.h
+++ b/src/wayland/protocol/eom-client-protocol.h
@@ -1,7 +1,7 @@
#ifndef WL_EOM_CLIENT_PROTOCOL_H
#define WL_EOM_CLIENT_PROTOCOL_H
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" {
#endif
@@ -13,6 +13,8 @@ struct wl_client;
struct wl_resource;
struct wl_eom;
+struct wl_shell_surface;
+struct xdg_surface;
extern const struct wl_interface wl_eom_interface;
@@ -145,6 +147,8 @@ enum wl_eom_attribute_state {
/**
* wl_eom - an interface to get the information of the external outputs
+ * @output_count: (none)
+ * @output_info: (none)
* @output_type: (none)
* @output_mode: (none)
* @output_attribute: (none)
@@ -157,8 +161,8 @@ struct wl_eom_listener {
* @count: (none)
*/
void (*output_count)(void *data,
- struct wl_eom *wl_eom,
- uint32_t count);
+ struct wl_eom *wl_eom,
+ uint32_t count);
/**
* output_info - (none)
* @output_id: (none)
@@ -171,15 +175,15 @@ struct wl_eom_listener {
* @connection: (none)
*/
void (*output_info)(void *data,
- struct wl_eom *wl_eom,
- uint32_t output_id,
- uint32_t type,
- uint32_t mode,
- uint32_t w,
- uint32_t h,
- uint32_t w_mm,
- uint32_t h_mm,
- uint32_t connection);
+ struct wl_eom *wl_eom,
+ uint32_t output_id,
+ uint32_t type,
+ uint32_t mode,
+ uint32_t w,
+ uint32_t h,
+ uint32_t w_mm,
+ uint32_t h_mm,
+ uint32_t connection);
/**
* output_type - (none)
* @output_id: (none)
@@ -224,9 +228,14 @@ wl_eom_add_listener(struct wl_eom *wl_eom,
}
#define WL_EOM_SET_ATTRIBUTE 0
-#define WL_EOM_GET_INFO 1
+#define WL_EOM_SET_XDG_WINDOW 1
+#define WL_EOM_SET_SHELL_WINDOW 2
+#define WL_EOM_GET_OUTPUT_INFO 3
#define WL_EOM_SET_ATTRIBUTE_SINCE_VERSION 1
+#define WL_EOM_SET_XDG_WINDOW_SINCE_VERSION 1
+#define WL_EOM_SET_SHELL_WINDOW_SINCE_VERSION 1
+#define WL_EOM_GET_OUTPUT_INFO_SINCE_VERSION 1
static inline void
wl_eom_set_user_data(struct wl_eom *wl_eom, void *user_data)
@@ -256,17 +265,31 @@ static inline void
wl_eom_set_attribute(struct wl_eom *wl_eom, uint32_t output_id, uint32_t attribute)
{
wl_proxy_marshal((struct wl_proxy *) wl_eom,
- WL_EOM_SET_ATTRIBUTE, output_id, attribute);
+ WL_EOM_SET_ATTRIBUTE, output_id, attribute);
+}
+
+static inline void
+wl_eom_set_xdg_window(struct wl_eom *wl_eom, uint32_t output_id, struct xdg_surface *surface)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_eom,
+ WL_EOM_SET_XDG_WINDOW, output_id, surface);
+}
+
+static inline void
+wl_eom_set_shell_window(struct wl_eom *wl_eom, uint32_t output_id, struct wl_shell_surface *surface)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_eom,
+ WL_EOM_SET_SHELL_WINDOW, output_id, surface);
}
static inline void
wl_eom_get_output_info(struct wl_eom *wl_eom, uint32_t output_id)
{
wl_proxy_marshal((struct wl_proxy *) wl_eom,
- WL_EOM_GET_INFO, output_id);
+ WL_EOM_GET_OUTPUT_INFO, output_id);
}
-#ifdef __cplusplus
+#ifdef __cplusplus
}
#endif
diff --git a/src/wayland/protocol/eom-protocol.c b/src/wayland/protocol/eom-protocol.c
index ed56ef6..3db1593 100644
--- a/src/wayland/protocol/eom-protocol.c
+++ b/src/wayland/protocol/eom-protocol.c
@@ -2,6 +2,8 @@
#include <stdint.h>
#include "wayland-util.h"
+extern const struct wl_interface wl_shell_surface_interface;
+extern const struct wl_interface xdg_surface_interface;
static const struct wl_interface *types[] = {
NULL,
@@ -11,10 +13,17 @@ static const struct wl_interface *types[] = {
NULL,
NULL,
NULL,
+ NULL,
+ NULL,
+ &xdg_surface_interface,
+ NULL,
+ &wl_shell_surface_interface,
};
static const struct wl_message wl_eom_requests[] = {
{ "set_attribute", "uu", types + 0 },
+ { "set_xdg_window", "uo", types + 8 },
+ { "set_shell_window", "uo", types + 10 },
{ "get_output_info", "u", types + 0 },
};
@@ -28,7 +37,7 @@ static const struct wl_message wl_eom_events[] = {
WL_EXPORT const struct wl_interface wl_eom_interface = {
"wl_eom", 1,
- 2, wl_eom_requests,
+ 4, wl_eom_requests,
5, wl_eom_events,
};
diff --git a/src/wayland/protocol/eom.xml b/src/wayland/protocol/eom.xml
index 32fff54..699d499 100644
--- a/src/wayland/protocol/eom.xml
+++ b/src/wayland/protocol/eom.xml
@@ -77,6 +77,16 @@
<arg name="attribute" type="uint"/>
</request>
+ <request name="set_xdg_window">
+ <arg name="output_id" type="uint"/>
+ <arg name="surface" type="object" interface="xdg_surface" allow-null="false"/>
+ </request>
+
+ <request name="set_shell_window">
+ <arg name="output_id" type="uint"/>
+ <arg name="surface" type="object" interface="wl_shell_surface" allow-null="false"/>
+ </request>
+
<request name="get_output_info">
<arg name="output_id" type="uint"/>
</request>