_pol_cb_client_resize(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
{
E_Event_Client *ev;
+ E_Client *ec;
ev = event;
+ ec = ev->ec;
if (!ev) return ECORE_CALLBACK_PASS_ON;
+ if (e_mod_pol_client_is_keyboard(ec) ||
+ e_mod_pol_client_is_keyboard_sub(ec))
+ {
+#ifdef HAVE_WAYLAND_ONLY
+ E_Client *comp_ec;
+ E_CLIENT_REVERSE_FOREACH(e_comp, comp_ec)
+ {
+ if (e_client_util_ignored_get(comp_ec)) continue;
+ if (!e_mod_pol_client_is_conformant(comp_ec)) continue;
+ if (ec->visible)
+ e_mod_pol_wl_keyboard_send(comp_ec, EINA_TRUE, ec->x, ec->y, ec->client.w, ec->client.h);
+ else
+ e_mod_pol_wl_keyboard_send(comp_ec, EINA_FALSE, ec->x, ec->y, ec->client.w, ec->client.h);
+ }
+#endif
+ }
+
/* calculate e_client visibility */
e_mod_pol_visibility_calc();
return EINA_FALSE;
}
+Eina_Bool
+e_mod_pol_client_is_conformant(E_Client *ec)
+{
+ E_OBJECT_CHECK_RETURN(ec, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE);
+
+#ifdef HAVE_WAYLAND_ONLY
+ E_Comp_Wl_Client_Data * cdata = ec->comp_data;
+ if (cdata->conformant == 1)
+ {
+ return EINA_TRUE;
+ }
+#endif
+
+ return EINA_FALSE;
+}
+
#undef E_CLIENT_HOOK_APPEND
#define E_CLIENT_HOOK_APPEND(l, t, cb, d) \
do \
EINTERN Eina_Bool e_mod_pol_client_is_lock_screen(E_Client *ec);
EINTERN Eina_Bool e_mod_pol_client_is_home_screen(E_Client *ec);
EINTERN Eina_Bool e_mod_pol_client_is_quickpanel(E_Client *ec);
+EINTERN Eina_Bool e_mod_pol_client_is_conformant(E_Client *ec);
EINTERN Pol_Softkey *e_mod_pol_softkey_add(E_Zone *zone);
EINTERN void e_mod_pol_softkey_del(Pol_Softkey *softkey);
struct wl_resource *surface;
} Notification_Level;
+typedef struct _Policy_Conformant
+{
+ struct wl_resource *interface;
+ struct wl_resource *surface;
+} Policy_Conformant;
+
static Eina_Hash *hash_pol_wayland = NULL;
static Eina_Hash *hash_notification_levels = NULL;
static Eina_Hash *hash_notification_interfaces = NULL;
+static Eina_Hash *hash_policy_conformants = NULL;
static Pol_Wayland*
_pol_wayland_get_info (E_Pixmap *ep)
}
}
+static void
+_e_tizen_policy_cb_conformant_set(struct wl_client *client,
+ struct wl_resource *policy,
+ struct wl_resource *surface_resource)
+{
+ E_Pixmap *ep;
+ E_Client *ec;
+ E_Comp_Wl_Client_Data *cdata;
+ Policy_Conformant *pn;
+
+ ep = wl_resource_get_user_data(surface_resource);
+ EINA_SAFETY_ON_NULL_RETURN(ep);
+
+ ec = e_pixmap_client_get(ep);
+ if (ec)
+ {
+ if (!ec->comp_data->conformant)
+ {
+ ec->comp_data->conformant = 1;
+ EC_CHANGED(ec);
+ }
+ }
+ else
+ {
+ cdata = e_pixmap_cdata_get(ep);
+ EINA_SAFETY_ON_NULL_RETURN(cdata);
+ cdata->conformant = 1;
+ }
+ pn = eina_hash_find(hash_policy_conformants, &surface_resource);
+ if (!pn)
+ {
+ pn = E_NEW(Policy_Conformant, 1);
+ EINA_SAFETY_ON_NULL_RETURN(pn);
+ eina_hash_add(hash_policy_conformants, &surface_resource, pn);
+ }
+
+ pn->interface = policy;
+ pn->surface = surface_resource;
+}
+
+static void
+_e_tizen_policy_cb_conformant_unset(struct wl_client *client,
+ struct wl_resource *policy,
+ struct wl_resource *surface_resource)
+{
+ E_Pixmap *ep;
+ E_Client *ec;
+ E_Comp_Wl_Client_Data *cdata;
+
+ ep = wl_resource_get_user_data(surface_resource);
+ EINA_SAFETY_ON_NULL_RETURN(ep);
+
+ ec = e_pixmap_client_get(ep);
+ if (ec)
+ {
+ if (ec->comp_data->conformant)
+ {
+ ec->comp_data->conformant = 0;
+ EC_CHANGED(ec);
+ }
+ }
+ else
+ {
+ cdata = e_pixmap_cdata_get(ep);
+ EINA_SAFETY_ON_NULL_RETURN(cdata);
+ cdata->conformant = 0;
+ }
+}
+
+static void
+_e_tizen_policy_cb_conformant_get(struct wl_client *client,
+ struct wl_resource *policy,
+ struct wl_resource *surface_resource)
+{
+ E_Pixmap *ep;
+ E_Client *ec;
+ E_Comp_Wl_Client_Data *cdata;
+ Policy_Conformant *pn;
+
+ ep = wl_resource_get_user_data(surface_resource);
+ EINA_SAFETY_ON_NULL_RETURN(ep);
+
+ pn = eina_hash_find(hash_policy_conformants, &surface_resource);
+ if (pn)
+ {
+ ec = e_pixmap_client_get(ep);
+ if (ec)
+ tizen_policy_send_conformant(pn->interface, surface_resource, ec->comp_data->conformant);
+ else
+ {
+ cdata = e_pixmap_cdata_get(ep);
+ EINA_SAFETY_ON_NULL_RETURN(cdata);
+ tizen_policy_send_conformant(pn->interface, surface_resource, cdata->conformant);
+ }
+ }
+}
+
static const struct tizen_policy_interface _e_tizen_policy_interface =
{
_e_tizen_policy_cb_visibility_get,
_e_tizen_policy_cb_focus_skip_set,
_e_tizen_policy_cb_focus_skip_unset,
_e_tizen_policy_cb_role_set,
+ _e_tizen_policy_cb_conformant_set,
+ _e_tizen_policy_cb_conformant_unset,
+ _e_tizen_policy_cb_conformant_get,
};
static void
hash_pol_wayland = eina_hash_pointer_new(free);
hash_notification_levels = eina_hash_pointer_new(free);
hash_notification_interfaces = eina_hash_pointer_new(NULL); // do not free by hash_del by key.
+ hash_policy_conformants = eina_hash_pointer_new(free);
return EINA_TRUE;
}
E_FREE_FUNC(hash_pol_wayland, eina_hash_free);
E_FREE_FUNC(hash_notification_levels, eina_hash_free);
E_FREE_FUNC(hash_notification_interfaces, eina_hash_free);
+ E_FREE_FUNC(hash_policy_conformants, eina_hash_free);
}
void
eina_hash_del_by_key(hash_notification_levels, &surface);
}
}
+
+void
+e_mod_pol_wl_keyboard_send(E_Client *ec, Eina_Bool state, int x, int y, int w, int h)
+{
+ E_Comp_Client_Data *cdata;
+ struct wl_resource *surface;
+ Policy_Conformant *pn;
+ struct wl_resource *policy_interface;
+
+ EINA_SAFETY_ON_NULL_RETURN(ec);
+ cdata = e_pixmap_cdata_get(ec->pixmap);
+ EINA_SAFETY_ON_NULL_RETURN(cdata);
+ surface = cdata->wl_surface;
+ EINA_SAFETY_ON_NULL_RETURN(surface);
+
+ pn = eina_hash_find(hash_policy_conformants, &surface);
+ if (pn)
+ {
+ tizen_policy_send_conformant_area(pn->interface, pn->surface, TIZEN_POLICY_CONFORMANT_PART_KEYBOARD, state, x, y, w, h);
+ }
+}
/* notification */
void e_mod_pol_wl_notification_level_fetch(E_Client *ec);
+void e_mod_pol_wl_keyboard_send(E_Client *ec, Eina_Bool state, int x, int y, int w, int h);
#endif /* HAVE_WAYLAND_ONLY */
#endif /* E_MOD_WL_H */
&wl_surface_interface,
&wl_surface_interface,
NULL,
+ &wl_surface_interface,
+ &wl_surface_interface,
+ &wl_surface_interface,
+ &wl_surface_interface,
+ NULL,
+ &wl_surface_interface,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
};
static const struct wl_message tizen_policy_requests[] = {
{ "focus_skip_set", "o", types + 8 },
{ "focus_skip_unset", "o", types + 9 },
{ "role_set", "os", types + 10 },
+ { "conformant_set", "o", types + 12 },
+ { "conformant_unset", "o", types + 13 },
+ { "conformant_get", "o", types + 14 },
+};
+
+static const struct wl_message tizen_policy_events[] = {
+ { "conformant", "ou", types + 15 },
+ { "conformant_area", "ouuiiii", types + 17 },
};
WL_EXPORT const struct wl_interface tizen_policy_interface = {
"tizen_policy", 1,
- 7, tizen_policy_requests,
- 0, NULL,
+ 10, tizen_policy_requests,
+ 2, tizen_policy_events,
};
static const struct wl_message tizen_visibility_requests[] = {
struct wl_surface;
extern const struct wl_interface tizen_policy_interface;
-extern const struct wl_interface tizen_visibility_interface;
extern const struct wl_interface tizen_position_interface;
+extern const struct wl_interface tizen_visibility_interface;
+extern const struct wl_interface wl_surface_interface;
+
+#ifndef TIZEN_POLICY_CONFORMANT_PART_ENUM
+#define TIZEN_POLICY_CONFORMANT_PART_ENUM
+enum tizen_policy_conformant_part {
+ TIZEN_POLICY_CONFORMANT_PART_INDICATOR = 0,
+ TIZEN_POLICY_CONFORMANT_PART_KEYBOARD = 1,
+ TIZEN_POLICY_CONFORMANT_PART_CLIPBOARD = 2,
+};
+#endif /* TIZEN_POLICY_CONFORMANT_PART_ENUM */
struct tizen_policy_interface {
/**
struct wl_resource *resource,
struct wl_resource *surface,
const char *role);
+ /**
+ * conformant_set - (none)
+ * @surface: surface object
+ */
+ void (*conformant_set)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *surface);
+ /**
+ * conformant_unset - (none)
+ * @surface: surface object
+ */
+ void (*conformant_unset)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *surface);
+ /**
+ * conformant_get - (none)
+ * @surface: surface object
+ */
+ void (*conformant_get)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *surface);
};
+#define TIZEN_POLICY_CONFORMANT 0
+#define TIZEN_POLICY_CONFORMANT_AREA 1
+
+#define TIZEN_POLICY_CONFORMANT_SINCE_VERSION 1
+#define TIZEN_POLICY_CONFORMANT_AREA_SINCE_VERSION 1
+
+static inline void
+tizen_policy_send_conformant(struct wl_resource *resource_, struct wl_resource *surface, uint32_t is_conformant)
+{
+ wl_resource_post_event(resource_, TIZEN_POLICY_CONFORMANT, surface, is_conformant);
+}
+
+static inline void
+tizen_policy_send_conformant_area(struct wl_resource *resource_, struct wl_resource *surface, uint32_t conformant_part, uint32_t state, int32_t x, int32_t y, int32_t w, int32_t h)
+{
+ wl_resource_post_event(resource_, TIZEN_POLICY_CONFORMANT_AREA, surface, conformant_part, state, x, y, w, h);
+}
#ifndef TIZEN_VISIBILITY_VISIBILITY_ENUM
#define TIZEN_VISIBILITY_VISIBILITY_ENUM