* limitations under the License.
*/
+#define _GNU_SOURCE
+
#define LOG_TAG "TIZEN_N_EFL_UTIL"
#include <efl_util.h>
#define LOG_TAG "TIZEN_N_EFL_UTIL"
#define EFL_UTIL_INPUT_GENERATOR_TOUCH_MAX_FINGER 10
+#define NUM_EVENT_WAIT_DONE_COUNT 10
+
typedef struct _Efl_Util_Wl_Surface_Lv_Info
{
void *surface; /* wl_surface */
int max_touch_count;
int request_touch_count;
} devmgr;
- struct wl_seat *seat;
struct
{
unsigned int id;
{ 0, NULL, NULL, NULL }, /* tizen_policy protocol */
{ NULL, NULL, NULL, NULL, 0 }, /* screenshooter 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);
if (lv_info->wait_for_done)
{
int count = 0;
- while (lv_info->wait_for_done && (count < 3))
+ while (lv_info->wait_for_done && (count < NUM_EVENT_WAIT_DONE_COUNT))
{
ecore_wl2_display_flush(_eflutil.wl.wl2_display);
wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
if (lv_info->wait_for_done)
{
int count = 0;
- while ((lv_info->wait_for_done) && (count < 3))
+ while ((lv_info->wait_for_done) && (count < NUM_EVENT_WAIT_DONE_COUNT))
{
ecore_wl2_display_flush(_eflutil.wl.wl2_display);
wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
if (scr_mode_info->wait_for_done)
{
int count = 0;
- while (scr_mode_info->wait_for_done && (count < 3))
+ while (scr_mode_info->wait_for_done && (count < NUM_EVENT_WAIT_DONE_COUNT))
{
ecore_wl2_display_flush(_eflutil.wl.wl2_display);
wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
if (brightness_info->wait_for_done)
{
int count = 0;
- while (brightness_info->wait_for_done && (count < 3))
+ while (brightness_info->wait_for_done && (count < NUM_EVENT_WAIT_DONE_COUNT))
{
ecore_wl2_display_flush(_eflutil.wl.wl2_display);
wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
return EFL_UTIL_ERROR_NONE;
}
-
struct _efl_util_inputgen_h
{
unsigned int init_type;
E_Devicemgr_Inputgen_Touch_Axis *axis_info;
};
-/* LCOV_EXCL_STOP */
-
static void
_cb_device_add(void *data EINA_UNUSED,
struct tizen_input_device_manager *tizen_input_device_manager EINA_UNUSED,
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 (_eflutil.wl.devmgr.request_touch_count != 0 &&
+ _eflutil.wl.devmgr.max_touch_count != _eflutil.wl.devmgr.request_touch_count)
+ wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+
if (idx >= _eflutil.wl.devmgr.max_touch_count)
return EFL_UTIL_ERROR_INVALID_PARAMETER;
ret = pthread_create(&screenmirror->thread, NULL, _efl_util_screenmirror_loop, screenmirror);
if (ret < 0)
- fprintf(stderr, "[screenmirror] fail: thread create fail\n");
+ {
+ fprintf(stderr, "[screenmirror] fail: thread create fail\n");
+ _screenshot_mutex_unlock();
+ return EFL_UTIL_ERROR_SCREENSHOT_EXECUTION_FAIL;
+ }
+
+ pthread_setname_np(screenmirror->thread, "e_util_mirror");
_screenshot_mutex_unlock();