lib/ecore_wayland/xdg-shell-client-protocol.h \
lib/ecore_wayland/xdg-shell-protocol.c \
lib/ecore_wayland/tizen-policy-client-protocol.h \
-lib/ecore_wayland/tizen-policy-protocol.c
+lib/ecore_wayland/tizen-policy-protocol.c \
+lib/ecore_wayland/tizen-extension-client-protocol.h \
+lib/ecore_wayland/tizen-extension-protocol.c
lib_ecore_wayland_libecore_wayland_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl @ECORE_WAYLAND_CFLAGS@
lib_ecore_wayland_libecore_wayland_la_LIBADD = @ECORE_WAYLAND_LIBS@
unsigned int win;
unsigned int parent_win;
unsigned int event_win;
+ unsigned int data[4];
};
struct _Ecore_Wl_Event_Window_Hide
wl_data_device_manager_destroy(_ecore_wl_disp->wl.data_device_manager);
if (_ecore_wl_disp->wl.tz_policy)
tizen_policy_destroy(_ecore_wl_disp->wl.tz_policy);
+ if (_ecore_wl_disp->wl.tz_surf_ext)
+ tizen_surface_extension_destroy(_ecore_wl_disp->wl.tz_surf_ext);
if (_ecore_wl_disp->wl.compositor)
wl_compositor_destroy(_ecore_wl_disp->wl.compositor);
if (_ecore_wl_disp->wl.subcompositor)
ewd->wl.tz_policy =
wl_registry_bind(registry, id, &tizen_policy_interface, 1);
}
+ else if (!strcmp(interface, "tizen_surface_extension"))
+ {
+ ewd->wl.tz_surf_ext =
+ wl_registry_bind(registry, id, &tizen_surface_extension_interface, 1);
+ }
if ((ewd->wl.compositor) && (ewd->wl.shm) &&
((ewd->wl.shell) || (ewd->wl.xdg_shell)))
# endif
# include "tizen-policy-client-protocol.h"
+# include "tizen-extension-client-protocol.h"
//# define LOGFNS 1
struct wl_shm *shm;
struct wl_data_device_manager *data_device_manager;
struct tizen_policy *tz_policy;
+ struct tizen_surface_extension *tz_surf_ext;
} wl;
int fd;
int ivi_surface_id;
# endif
struct tizen_visibility *tz_visibility;
+ struct tizen_resource *tz_resource;
+ unsigned int resource_id;
struct wl_region *opaque_region;
struct wl_region *input_region;
#include "ecore_wl_private.h"
#include "xdg-shell-client-protocol.h"
#include "tizen-policy-client-protocol.h"
+#include "tizen-extension-client-protocol.h"
/* local function prototypes */
static void _ecore_wl_window_cb_ping(void *data EINA_UNUSED, struct wl_shell_surface *shell_surface, unsigned int serial);
static void _ecore_xdg_handle_surface_delete(void *data, struct xdg_surface *xdg_surface);
static void _ecore_xdg_handle_popup_done(void *data, struct xdg_popup *xdg_popup, unsigned int serial);
static void _ecore_wl_window_cb_visibility_change(void *data, struct tizen_visibility *tizen_visibility, uint32_t visibility);
+static void _ecore_wl_window_cb_resource_id(void *data, struct tizen_resource *tizen_resource, uint32_t id);
/* local variables */
static Eina_Hash *_windows = NULL;
_ecore_wl_window_cb_visibility_change,
};
+static const struct tizen_resource_listener _ecore_tizen_resource_listener =
+{
+ _ecore_wl_window_cb_resource_id,
+};
+
/* internal functions */
void
_ecore_wl_window_init(void)
tizen_visibility_add_listener(win->tz_visibility,
&_ecore_tizen_visibility_listener, win);
}
+ if ((!win->tz_resource) && (_ecore_wl_disp->wl.tz_surf_ext))
+ {
+ win->tz_resource =
+ tizen_surface_extension_get_tizen_resource(_ecore_wl_disp->wl.tz_surf_ext,
+ win->surface);
+ if (!win->tz_resource) return;
+ tizen_resource_add_listener(win->tz_resource,
+ &_ecore_tizen_resource_listener, win);
+ }
}
/* trap for valid shell surface */
}
static void
+_ecore_wl_window_cb_resource_id(void *data,
+ struct tizen_resource *tizen_resource,
+ uint32_t id)
+{
+ Ecore_Wl_Window *win;
+ Ecore_Wl_Event_Window_Show *ev;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(win = data)) return;
+ if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Window_Show)))) return;
+ ev->win = win->id;
+ if (win->parent)
+ ev->parent_win = win->parent->id;
+ else
+ ev->parent_win = 0;
+ ev->event_win = win->id;
+ ev->data[0] = (unsigned int)id;
+ win->resource_id = (unsigned int)id;
+ ecore_event_add(ECORE_WL_EVENT_WINDOW_SHOW, ev, NULL, NULL);
+}
+
+static void
_ecore_wl_window_cb_xdg_surface_delete(void *data EINA_UNUSED, struct xdg_surface *xdg_surface EINA_UNUSED)
{
}
--- /dev/null
+#ifndef TIZEN_EXTENSION_CLIENT_PROTOCOL_H
+#define TIZEN_EXTENSION_CLIENT_PROTOCOL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-client.h"
+
+struct wl_client;
+struct wl_resource;
+
+struct tizen_resource;
+struct tizen_surface_extension;
+struct tizen_transient_for;
+
+extern const struct wl_interface tizen_resource_interface;
+extern const struct wl_interface tizen_surface_extension_interface;
+extern const struct wl_interface tizen_transient_for_interface;
+
+struct tizen_resource_listener {
+ /**
+ * resource_id - (none)
+ * @id: (none)
+ */
+ void (*resource_id)(void *data,
+ struct tizen_resource *tizen_resource,
+ uint32_t id);
+};
+
+static inline int
+tizen_resource_add_listener(struct tizen_resource *tizen_resource,
+ const struct tizen_resource_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) tizen_resource,
+ (void (**)(void)) listener, data);
+}
+
+#define TIZEN_RESOURCE_DESTROY 0
+
+static inline void
+tizen_resource_set_user_data(struct tizen_resource *tizen_resource, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) tizen_resource, user_data);
+}
+
+static inline void *
+tizen_resource_get_user_data(struct tizen_resource *tizen_resource)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) tizen_resource);
+}
+
+static inline void
+tizen_resource_destroy(struct tizen_resource *tizen_resource)
+{
+ wl_proxy_marshal((struct wl_proxy *) tizen_resource,
+ TIZEN_RESOURCE_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) tizen_resource);
+}
+
+#define TIZEN_SURFACE_EXTENSION_GET_TIZEN_RESOURCE 0
+#define TIZEN_SURFACE_EXTENSION_PLACE_BELOW_PARENT 1
+
+static inline void
+tizen_surface_extension_set_user_data(struct tizen_surface_extension *tizen_surface_extension, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) tizen_surface_extension, user_data);
+}
+
+static inline void *
+tizen_surface_extension_get_user_data(struct tizen_surface_extension *tizen_surface_extension)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) tizen_surface_extension);
+}
+
+static inline void
+tizen_surface_extension_destroy(struct tizen_surface_extension *tizen_surface_extension)
+{
+ wl_proxy_destroy((struct wl_proxy *) tizen_surface_extension);
+}
+
+static inline struct tizen_resource *
+tizen_surface_extension_get_tizen_resource(struct tizen_surface_extension *tizen_surface_extension, struct wl_surface *surface)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) tizen_surface_extension,
+ TIZEN_SURFACE_EXTENSION_GET_TIZEN_RESOURCE, &tizen_resource_interface, NULL, surface);
+
+ return (struct tizen_resource *) id;
+}
+
+static inline void
+tizen_surface_extension_place_below_parent(struct tizen_surface_extension *tizen_surface_extension, struct wl_subsurface *subsurface)
+{
+ wl_proxy_marshal((struct wl_proxy *) tizen_surface_extension,
+ TIZEN_SURFACE_EXTENSION_PLACE_BELOW_PARENT, subsurface);
+}
+
+struct tizen_transient_for_listener {
+ /**
+ * done - (none)
+ * @child_id: (none)
+ */
+ void (*done)(void *data,
+ struct tizen_transient_for *tizen_transient_for,
+ uint32_t child_id);
+};
+
+static inline int
+tizen_transient_for_add_listener(struct tizen_transient_for *tizen_transient_for,
+ const struct tizen_transient_for_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) tizen_transient_for,
+ (void (**)(void)) listener, data);
+}
+
+#define TIZEN_TRANSIENT_FOR_SET 0
+
+static inline void
+tizen_transient_for_set_user_data(struct tizen_transient_for *tizen_transient_for, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) tizen_transient_for, user_data);
+}
+
+static inline void *
+tizen_transient_for_get_user_data(struct tizen_transient_for *tizen_transient_for)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) tizen_transient_for);
+}
+
+static inline void
+tizen_transient_for_destroy(struct tizen_transient_for *tizen_transient_for)
+{
+ wl_proxy_destroy((struct wl_proxy *) tizen_transient_for);
+}
+
+static inline void
+tizen_transient_for_set(struct tizen_transient_for *tizen_transient_for, uint32_t child_id, uint32_t parent_id)
+{
+ wl_proxy_marshal((struct wl_proxy *) tizen_transient_for,
+ TIZEN_TRANSIENT_FOR_SET, child_id, parent_id);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null
+#include <stdlib.h>
+#include <stdint.h>
+#include "wayland-util.h"
+
+extern const struct wl_interface tizen_resource_interface;
+extern const struct wl_interface wl_surface_interface;
+extern const struct wl_interface wl_subsurface_interface;
+
+static const struct wl_interface *types[] = {
+ NULL,
+ NULL,
+ &tizen_resource_interface,
+ &wl_surface_interface,
+ &wl_subsurface_interface,
+};
+
+static const struct wl_message tizen_resource_requests[] = {
+ { "destroy", "", types + 0 },
+};
+
+static const struct wl_message tizen_resource_events[] = {
+ { "resource_id", "u", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface tizen_resource_interface = {
+ "tizen_resource", 1,
+ 1, tizen_resource_requests,
+ 1, tizen_resource_events,
+};
+
+static const struct wl_message tizen_surface_extension_requests[] = {
+ { "get_tizen_resource", "no", types + 2 },
+ { "place_below_parent", "o", types + 4 },
+};
+
+WL_EXPORT const struct wl_interface tizen_surface_extension_interface = {
+ "tizen_surface_extension", 1,
+ 2, tizen_surface_extension_requests,
+ 0, NULL,
+};
+
+static const struct wl_message tizen_transient_for_requests[] = {
+ { "set", "uu", types + 0 },
+};
+
+static const struct wl_message tizen_transient_for_events[] = {
+ { "done", "u", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface tizen_transient_for_interface = {
+ "tizen_transient_for", 1,
+ 1, tizen_transient_for_requests,
+ 1, tizen_transient_for_events,
+};