#endif
static Eina_Hash *pixmaps[2] = {NULL};
-static Eina_Hash *gids = NULL;
-static uint32_t gid = 0;
+static Eina_Hash *res_ids = NULL;
+static uint32_t res_id = 0;
struct _E_Pixmap
{
E_Pixmap_Type type;
uint64_t win;
- uint32_t gid;
+ uint32_t res_id;
Ecore_Window parent;
int w, h;
cp = _e_pixmap_new(type);
cp->win = id;
eina_hash_add(pixmaps[type], &id, cp);
- if (!gids)
- gids = eina_hash_int32_new((Eina_Free_Cb)_e_pixmap_free);
- gid++;
- cp->gid = gid;
- eina_hash_add(gids, &gid, cp);
+ if (!res_ids)
+ res_ids = eina_hash_int32_new((Eina_Free_Cb)_e_pixmap_free);
+ cp->res_id = res_id;
+ eina_hash_add(res_ids, &res_id, cp);
+ res_id++;
#endif
break;
}
}
EAPI E_Client *
-e_pixmap_find_client_by_tizen_gid(uint32_t gid)
+e_pixmap_find_client_by_res_id(uint32_t res_id)
{
E_Pixmap *cp;
- if (!gids) return NULL;
- cp = eina_hash_find(gids, &gid);
+ if (!res_ids) return NULL;
+ cp = eina_hash_find(res_ids, &res_id);
return (!cp) ? NULL : cp->client;
}
EAPI uint32_t
-e_pixmap_tizen_gid_get(E_Pixmap *cp)
+e_pixmap_res_id_get(E_Pixmap *cp)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(cp, 0);
- return cp->gid;
+ return cp->res_id;
}
EAPI uint64_t
EAPI E_Client *e_pixmap_client_get(E_Pixmap *cp);
EAPI E_Pixmap *e_pixmap_find(E_Pixmap_Type type, ...);
EAPI E_Client *e_pixmap_find_client(E_Pixmap_Type type, ...);
-EAPI E_Client *e_pixmap_find_client_by_tizen_gid(uint32_t gid);
-EAPI uint32_t e_pixmap_tizen_gid_get(E_Pixmap *cp);
+EAPI E_Client *e_pixmap_find_client_by_res_id(uint32_t res_id);
+EAPI uint32_t e_pixmap_res_id_get(E_Pixmap *cp);
EAPI uint64_t e_pixmap_window_get(E_Pixmap *cp);
EAPI Ecore_Window e_pixmap_parent_window_get(E_Pixmap *cp);
EAPI Eina_Bool e_pixmap_native_surface_init(E_Pixmap *cp, Evas_Native_Surface *ns);
src/modules/wl_desktop_shell/e_scaler.h \
src/modules/wl_desktop_shell/e_scaler_protocol.c \
src/modules/wl_desktop_shell/e_scaler_protocol.h \
- src/modules/wl_desktop_shell/e_transient_for_protocol.h \
- src/modules/wl_desktop_shell/e_transient_for_protocol.c
+ src/modules/wl_desktop_shell/tizen_extension_server_protocol.h \
+ src/modules/wl_desktop_shell/tizen_extension_protocol.c
PHONIES += wl_desktop_shell install-wl_desktop_shell
wl_desktop_shell: $(wl_desktop_shellpkg_LTLIBRARIES) $(wl_desktop_shell_DATA)
#include "e.h"
#include "e_desktop_shell_protocol.h"
#include "e_scaler.h"
-#include "e_transient_for_protocol.h"
+#include "tizen_extension_server_protocol.h"
#define XDG_SERVER_VERSION 4
}
static void
-_e_tizen_gid_cb_destroy(struct wl_client *client, struct wl_resource *resource)
+_e_tz_res_cb_destroy(struct wl_client *client, struct wl_resource *resource)
{
wl_resource_destroy(resource);
}
-static const struct tizen_gid_interface _e_tizen_gid_interface =
+static const struct tizen_resource_interface _e_tz_res_interface =
{
- _e_tizen_gid_cb_destroy,
+ _e_tz_res_cb_destroy
};
static void
-_e_tizen_ext_cb_tizen_gid_get(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface)
+_e_tz_surf_ext_cb_tz_res_get(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *surface)
{
struct wl_resource *res;
E_Pixmap *ep;
- uint32_t gid;
+ uint32_t res_id;
/* get the pixmap from this surface so we can find the client */
if (!(ep = wl_resource_get_user_data(surface)))
if (e_pixmap_type_get(ep) != E_PIXMAP_TYPE_WL) return;
/* find the window id for this pixmap */
- gid = e_pixmap_tizen_gid_get(ep);
+ res_id = e_pixmap_res_id_get(ep);
- DBG("TIZEN_EXT: tizen_gid_get %" PRIu32, gid);
+ DBG("tizen resource id %" PRIu32, res_id);
/* try to create a tizen_gid */
- if (!(res = wl_resource_create(client, &tizen_gid_interface, wl_resource_get_version(resource), id)))
+ if (!(res = wl_resource_create(client,
+ &tizen_resource_interface,
+ wl_resource_get_version(resource),
+ id)))
{
wl_resource_post_no_memory(resource);
return;
}
- wl_resource_set_implementation(res, &_e_tizen_gid_interface,
- ep, NULL);
- tizen_gid_send_notify(res, gid);
+ wl_resource_set_implementation(res,
+ &_e_tz_res_interface,
+ ep,
+ NULL);
+
+ tizen_resource_send_resource_id(res, res_id);
}
static void
-_e_tizen_ext_cb_transient_for_set(struct wl_client *client, struct wl_resource *resource, uint32_t surface_gid, uint32_t parent_gid)
+_e_tz_surf_ext_cb_transient_for_set(struct wl_client *client, struct wl_resource *resource, uint32_t child_id, uint32_t parent_id)
{
- E_Client *ec;
- E_Client *pc;
- struct wl_resource *parent_resource;
+ E_Client *ec, *pc;
+ struct wl_resource *parent_res;
- DBG("TIZEN_EXT: surface_gid: %" PRIu32 ", parent_gid : %" PRIu32, surface_gid, parent_gid);
+ DBG("chid_id: %" PRIu32 ", parent_id: %" PRIu32, child_id, parent_id);
- ec = e_pixmap_find_client_by_tizen_gid(surface_gid);
- if (!ec)
- {
- ERR("No Client for this surface gid");
- return;
- }
+ ec = e_pixmap_find_client_by_res_id(child_id);
+ EINA_SAFETY_ON_NULL_RETURN(ec);
- /* find the parent client */
- pc = e_pixmap_find_client_by_tizen_gid(parent_gid);
- if (!pc)
- {
- ERR("No Client for this parent gid");
- return;
- }
- if (pc->comp_data->surface)
- {
- parent_resource = pc->comp_data->surface;
- _e_shell_surface_parent_set(ec, parent_resource);
- }
+ pc = e_pixmap_find_client_by_res_id(parent_id);
+ EINA_SAFETY_ON_NULL_RETURN(pc);
+ EINA_SAFETY_ON_NULL_RETURN(pc->comp_data);
+
+ parent_res = pc->comp_data->surface;
+ _e_shell_surface_parent_set(ec, parent_res);
}
-static const struct tizen_ext_interface _e_tizen_ext_interface =
+static const struct tizen_surface_extension_interface _e_tz_surf_ext_interface =
{
- _e_tizen_ext_cb_tizen_gid_get,
- _e_tizen_ext_cb_transient_for_set,
+ _e_tz_surf_ext_cb_tz_res_get,
+ _e_tz_surf_ext_cb_transient_for_set
};
static const struct wl_shell_interface _e_shell_interface =
}
static void
-_e_tizen_ext_cb_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id)
+_e_tz_surf_ext_cb_bind(struct wl_client *client, void *data, uint32_t version, uint32_t id)
{
E_Comp_Data *cdata;
struct wl_resource *res;
return;
}
- if (!(res = wl_resource_create(client, &tizen_ext_interface, MIN(version, 1), id)))
+ if (!(res = wl_resource_create(client,
+ &tizen_surface_extension_interface,
+ MIN(version, 1),
+ id)))
{
ERR("Could not create tizen_ext resource: %m");
wl_client_post_no_memory(client);
return;
}
- wl_resource_set_implementation(res, &_e_tizen_ext_interface, cdata, NULL);
+ wl_resource_set_implementation(res, &_e_tz_surf_ext_interface, cdata, NULL);
}
EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Wl_Desktop_Shell" };
e_scaler_init();
- /* try to add tizen_ext to wayland globals */
- if (!wl_global_create(cdata->wl.disp, &tizen_ext_interface, 1,
- cdata, _e_tizen_ext_cb_bind))
+ /* try to create global tizen surface extention interface */
+ if (!wl_global_create(cdata->wl.disp,
+ &tizen_surface_extension_interface,
+ 1,
+ cdata,
+ _e_tz_surf_ext_cb_bind))
{
- ERR("Could not add tizen_ext to wayland globals: %m");
+ ERR("Could not create tizen_surface_extension to wayland globals: %m");
return NULL;
}
+++ /dev/null
-#include <stdlib.h>
-#include <stdint.h>
-#include "wayland-util.h"
-
-extern const struct wl_interface tizen_gid_interface;
-extern const struct wl_interface wl_surface_interface;
-
-static const struct wl_interface *types[] = {
- NULL,
- NULL,
- &tizen_gid_interface,
- &wl_surface_interface,
-};
-
-static const struct wl_message tizen_ext_requests[] = {
- { "get_tizen_gid", "no", types + 2 },
- { "set_transient_for", "uu", types + 0 },
-};
-
-WL_EXPORT const struct wl_interface tizen_ext_interface = {
- "tizen_ext", 1,
- 2, tizen_ext_requests,
- 0, NULL,
-};
-
-static const struct wl_message tizen_gid_requests[] = {
- { "destroy", "", types + 0 },
-};
-
-static const struct wl_message tizen_gid_events[] = {
- { "notify", "u", types + 0 },
-};
-
-WL_EXPORT const struct wl_interface tizen_gid_interface = {
- "tizen_gid", 1,
- 1, tizen_gid_requests,
- 1, tizen_gid_events,
-};
-
+++ /dev/null
-#ifndef TIZEN_EXT_SERVER_PROTOCOL_H
-#define TIZEN_EXT_SERVER_PROTOCOL_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdint.h>
-#include <stddef.h>
-#include "wayland-util.h"
-
-struct wl_client;
-struct wl_resource;
-
-struct tizen_ext;
-struct tizen_gid;
-
-extern const struct wl_interface tizen_ext_interface;
-extern const struct wl_interface tizen_gid_interface;
-
-struct tizen_ext_interface {
- /**
- * get_tizen_gid - (none)
- * @id: (none)
- * @surface: (none)
- */
- void (*get_tizen_gid)(struct wl_client *client,
- struct wl_resource *resource,
- uint32_t id,
- struct wl_resource *surface);
- /**
- * set_transient_for - (none)
- * @surface_gid: (none)
- * @parent_gid: (none)
- */
- void (*set_transient_for)(struct wl_client *client,
- struct wl_resource *resource,
- uint32_t surface_gid,
- uint32_t parent_gid);
-};
-
-struct tizen_gid_interface {
- /**
- * destroy - (none)
- */
- void (*destroy)(struct wl_client *client,
- struct wl_resource *resource);
-};
-
-#define TIZEN_GID_NOTIFY 0
-
-static inline void
-tizen_gid_send_notify(struct wl_resource *resource_, uint32_t gid)
-{
- wl_resource_post_event(resource_, TIZEN_GID_NOTIFY, gid);
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
--- /dev/null
+<protocol name="tizen_extension">
+ <interface name="tizen_resource" version="1">
+ <request name="destroy" type="destructor" />
+ <event name="resource_id">
+ <arg name="id" type="uint" />
+ </event>
+ </interface>
+ <interface name="tizen_surface_extension" version="1">
+ <request name="get_tizen_resource">
+ <arg name="id" type="new_id" interface="tizen_resource" />
+ <arg name="surface" type="object" interface="wl_surface" />
+ </request>
+ <request name="set_transient_for">
+ <arg name="child_id" type="uint" />
+ <arg name="parent_id" type="uint" />
+ </request>
+ </interface>
+</protocol>
--- /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;
+
+static const struct wl_interface *types[] = {
+ NULL,
+ NULL,
+ &tizen_resource_interface,
+ &wl_surface_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 },
+ { "set_transient_for", "uu", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface tizen_surface_extension_interface = {
+ "tizen_surface_extension", 1,
+ 2, tizen_surface_extension_requests,
+ 0, NULL,
+};
+
--- /dev/null
+#ifndef TIZEN_EXTENSION_SERVER_PROTOCOL_H
+#define TIZEN_EXTENSION_SERVER_PROTOCOL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-server.h"
+
+struct wl_client;
+struct wl_resource;
+
+struct tizen_resource;
+struct tizen_surface_extension;
+
+extern const struct wl_interface tizen_resource_interface;
+extern const struct wl_interface tizen_surface_extension_interface;
+
+struct tizen_resource_interface {
+ /**
+ * destroy - (none)
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+#define TIZEN_RESOURCE_RESOURCE_ID 0
+
+#define TIZEN_RESOURCE_RESOURCE_ID_SINCE_VERSION 1
+
+static inline void
+tizen_resource_send_resource_id(struct wl_resource *resource_, uint32_t id)
+{
+ wl_resource_post_event(resource_, TIZEN_RESOURCE_RESOURCE_ID, id);
+}
+
+struct tizen_surface_extension_interface {
+ /**
+ * get_tizen_resource - (none)
+ * @id: (none)
+ * @surface: (none)
+ */
+ void (*get_tizen_resource)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ struct wl_resource *surface);
+ /**
+ * set_transient_for - (none)
+ * @child_id: (none)
+ * @parent_id: (none)
+ */
+ void (*set_transient_for)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t child_id,
+ uint32_t parent_id);
+};
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif