/**
* @platform
+ * @brief Requests to set the maximum touch count.
+ * @since_tizen 6.5
+ * @privlevel platform
+ * @privilege %http://tizen.org/privilege/inputgenerator
+ * @remarks If you would like to generate more touch count supported than the display server supports,
+ you can use this API to increase the maximum touch count.
+ Note that this API returns success only when there is no configuration enabled
+ about maximum touch count in the display server.
+ * @param[in] max_count The maximum number of touches want to generate.
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #EFL_UTIL_ERROR_NONE Successful
+ * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED Has no permission to deinitialize input generator
+ * @retval #EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE Resource is not available
+ */
+API int efl_util_input_set_touch_count(int max_count);
+
+/**
+ * @platform
* @brief Deinitializes system and close opened devices.
* @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
* @privlevel platform
Eina_List *devices;
Eina_List *wait_devices;
struct wl_event_source *wait_timer;
+ int max_touch_count;
+ int request_touch_count;
} devmgr;
struct
{
NULL, NULL, NULL,
{ 0, NULL, NULL, NULL }, /* tizen_policy protocol */
{ NULL, NULL, NULL, NULL, NULL, 0 }, /* screenshooter protocol */
- { NULL, -1, NULL, NULL, NULL }, /* tizen_input_device_manager protocol */
+ { NULL, -1, NULL, NULL, NULL, 0, 0 }, /* tizen_input_device_manager protocol */
{ 0, NULL, NULL } /* display_policy protocol */
},
};
_cb_max_touch_count(void *data EINA_UNUSED,
struct tizen_input_device_manager *tizen_input_device_manager EINA_UNUSED,
uint32_t serial EINA_UNUSED,
- int32_t max_count EINA_UNUSED,
+ int32_t max_count,
struct wl_seat *seat EINA_UNUSED)
{
- ;
+ _eflutil.wl.devmgr.max_touch_count = max_count;
}
static efl_util_error_e
return EFL_UTIL_ERROR_OUT_OF_MEMORY;
case TIZEN_INPUT_DEVICE_MANAGER_ERROR_INVALID_PARAMETER:
return EFL_UTIL_ERROR_INVALID_PARAMETER;
+ case TIZEN_INPUT_DEVICE_MANAGER_ERROR_NOT_ALLOWED:
+ return EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE;
default :
return EFL_UTIL_ERROR_NONE;
}
}
API int
+efl_util_input_set_touch_count(int max_count)
+{
+ int ret = EFL_UTIL_ERROR_NONE;
+
+ ret = _wl_init();
+ if (ret == (int)EINA_FALSE)
+ {
+ return EFL_UTIL_ERROR_INVALID_PARAMETER;
+ }
+
+ while (!_eflutil.wl.devmgr.devicemgr)
+ wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+
+ if (_eflutil.wl.devmgr.max_touch_count >= max_count)
+ return EFL_UTIL_ERROR_NONE;
+
+ tizen_input_device_manager_set_touch_count(_eflutil.wl.devmgr.devicemgr, max_count);
+
+ while (_eflutil.wl.devmgr.request_notified == -1)
+ wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+
+ ret = _efl_util_input_convert_input_generator_error(_eflutil.wl.devmgr.request_notified);
+ _eflutil.wl.devmgr.request_notified = -1;
+
+ if (ret == EFL_UTIL_ERROR_NONE)
+ {
+ _eflutil.wl.devmgr.request_touch_count = max_count;
+ }
+
+ return ret;
+}
+
+API int
efl_util_input_deinitialize_generator(efl_util_inputgen_h inputgen_h)
{
int ret = EFL_UTIL_ERROR_NONE;
EINA_SAFETY_ON_FALSE_RETURN_VAL((x > 0 && y > 0), EFL_UTIL_ERROR_INVALID_PARAMETER);
EINA_SAFETY_ON_FALSE_RETURN_VAL(inputgen_h->init_type & EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN, EFL_UTIL_ERROR_NO_SUCH_DEVICE);
+ if (idx >= _eflutil.wl.devmgr.request_touch_count)
+ return EFL_UTIL_ERROR_INVALID_PARAMETER;
+
EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.devmgr.devicemgr, EFL_UTIL_ERROR_INVALID_PARAMETER);
switch(touch_type)