+ * @brief ico_input_hook_region_visible: change surface visibility
+ *
+ * @param[in] usurf UIFW surface
+ * @return none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+ico_input_hook_region_visible(struct uifw_win_surface *usurf)
+{
+ struct uifw_region_mng *p; /* input region mamagement table*/
+ struct ico_uifw_input_region *rp; /* input region */
+ struct wl_array array;
+ int chgcount = 0;
+ int visible;
+
+ visible = ico_window_mgr_is_visible(usurf);
+
+ uifw_trace("ico_input_hook_region_visible: Entery(surf=%08x, visible=%d)",
+ usurf->surfaceid, visible);
+
+ wl_array_init(&array);
+
+ wl_list_for_each(p, &usurf->input_region, link) {
+ if (((p->region.change > 0) && (visible <= 0)) ||
+ ((p->region.change <= 0) && (visible > 0))) {
+ /* visible change, send remove event */
+ rp = (struct ico_uifw_input_region *)
+ wl_array_add(&array, sizeof(struct ico_uifw_input_region));
+ if (rp) {
+ chgcount ++;
+ memcpy(rp, &p->region, sizeof(struct ico_uifw_input_region));
+ if (visible > 0) {
+ rp->change = ICO_INPUT_MGR_DEVICE_REGION_ADD;
+ }
+ else {
+ rp->change = ICO_INPUT_MGR_DEVICE_REGION_REMOVE;
+ }
+ }
+ }
+ p->region.change = visible;
+ }
+ if (chgcount > 0) {
+ /* send region delete to haptic device input controller */
+ ico_input_send_region_event(&array);
+ }
+
+ uifw_trace("ico_input_hook_region_visible: Leave");
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief ico_input_hook_region_destroy: destory surface
+ *
+ * @param[in] usurf UIFW surface
+ * @return none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+ico_input_hook_region_destroy(struct uifw_win_surface *usurf)
+{
+ struct uifw_region_mng *p; /* input region mamagement table*/
+ struct uifw_region_mng *np; /* next region mamagement table */
+ struct ico_uifw_input_region *rp; /* input region */
+ struct wl_array array;
+ int delcount = 0;
+
+ uifw_trace("ico_input_hook_region_destroy: Entery(surf=%08x)", usurf->surfaceid);
+
+ wl_array_init(&array);
+
+ wl_list_for_each_safe(p, np, &usurf->input_region, link) {
+ if (p->region.change > 0) {
+ /* visible, send remove event */
+ rp = (struct ico_uifw_input_region *)
+ wl_array_add(&array, sizeof(struct ico_uifw_input_region));
+ if (rp) {
+ delcount ++;
+ memcpy(rp, &p->region, sizeof(struct ico_uifw_input_region));
+ rp->change = ICO_INPUT_MGR_DEVICE_REGION_REMOVE;
+ }
+ }
+ wl_list_remove(&p->link);
+ wl_list_insert(pInputMgr->free_region.prev, &p->link);
+ }
+ if (delcount > 0) {
+ /* send region delete to haptic device input controller */
+ ico_input_send_region_event(&array);
+ }
+ uifw_trace("ico_input_hook_region_destroy: Leave");
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * @brief ico_input_send_region_event: send region event to Haptic dic
+ *
+ * @param[in] usurf UIFW surface
+ * @return none
+ */
+/*--------------------------------------------------------------------------*/
+static void
+ico_input_send_region_event(struct wl_array *array)
+{
+ struct ico_ictl_mgr *pIctlMgr;
+
+ wl_list_for_each (pIctlMgr, &pInputMgr->ictl_list, link) {
+ if ((pIctlMgr->type == ICO_INPUT_MGR_DEVICE_TYPE_HAPTIC) &&
+ (pIctlMgr->mgr_resource != NULL)) {
+ uifw_trace("ico_input_send_region_event: send event to Hapfic");
+ ico_input_mgr_device_send_input_regions(pIctlMgr->mgr_resource, array);
+ }
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+/**