Eina_List *devices;
Eina_List *wait_devices;
struct wl_event_source *wait_timer;
+ int max_touch_count;
+ int request_touch_count;
} devmgr;
+ struct wl_seat *seat;
struct
{
unsigned int id;
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 */
+ NULL, /* wl_seat protocol */
{ 0, NULL, NULL } /* display_policy protocol */
},
};
};
static void
+_cb_seat_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability caps)
+{
+}
+
+static void
+_cb_seat_name(void *data, struct wl_seat *seat EINA_UNUSED, const char *name)
+{
+}
+
+static const struct wl_seat_listener _seat_listener =
+{
+ _cb_seat_capabilities,
+ _cb_seat_name,
+};
+
+static void
_cb_wl_reg_global(void *data,
struct wl_registry *reg,
unsigned int id,
output->output = wl_registry_bind(reg, id, &wl_output_interface, version);
wl_output_add_listener(output->output, &output_listener, output);
}
+ else if(strcmp(interface, "wl_seat") == 0)
+ {
+ _eflutil.wl.seat = wl_registry_bind(reg, id, &wl_seat_interface, version);
+ wl_seat_add_listener(_eflutil.wl.seat, &_seat_listener, NULL);
+ }
else if (strcmp(interface, "tizen_input_device_manager") == 0)
{
_eflutil.wl.devmgr.devicemgr = wl_registry_bind(reg, id, &tizen_input_device_manager_interface, version);
_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.max_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)