+#include "e_test_event.h"
#include "e_test_efl_util.h"
static const char*
}
}
+etInputGenHandler::etInputGenHandler(efl_util_input_device_type_e type) :
+handler(nullptr)
+{
+ if (type == EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN)
+ {
+ int ret = EFL_UTIL_ERROR_NONE;
+ ret = efl_util_input_set_touch_count(10);
+ if (ret != EFL_UTIL_ERROR_NONE)
+ printf("failed to set touch count: (ret: %d)", ret);
+ }
+
+ handler = efl_util_input_initialize_generator_with_name(type, NULL);
+
+ if (handler == nullptr)
+ printf("failed to init input generator\n");
+}
+
+etInputGenHandler::etInputGenHandler(efl_util_input_device_type_e type, bool with_sync) :
+handler(nullptr)
+{
+ if (type == EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN)
+ {
+ int ret = EFL_UTIL_ERROR_NONE;
+ ret = efl_util_input_set_touch_count(10);
+ if (ret != EFL_UTIL_ERROR_NONE)
+ printf("failed to set touch count: (ret: %d)", ret);
+ }
+
+ if (with_sync)
+ handler = efl_util_input_initialize_generator_with_sync(type, NULL);
+ else
+ handler = efl_util_input_initialize_generator_with_name(type, NULL);
+
+ if (handler == nullptr)
+ printf("failed to init input generator\n");
+}
+
+etInputGenHandler::~etInputGenHandler()
+{
+ efl_util_input_deinitialize_generator(handler);
+ etRunner::get().work(0.5);
+ handler = nullptr;
+}
+
Eina_Bool
etInputGenHandler::generateMouseDown(int x, int y)
{
{
public :
etInputGenHandler() = delete;
- etInputGenHandler(efl_util_input_device_type_e type) :
- handler(nullptr)
- {
- if (type == EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN)
- {
- int ret = EFL_UTIL_ERROR_NONE;
- ret = efl_util_input_set_touch_count(10);
- if (ret != EFL_UTIL_ERROR_NONE)
- printf("failed to set touch count: (ret: %d)", ret);
- }
-
- handler = efl_util_input_initialize_generator_with_name(type, NULL);
-
- if (handler == nullptr)
- printf("failed to init input generator\n");
- }
- etInputGenHandler(efl_util_input_device_type_e type, bool with_sync) :
- handler(nullptr)
- {
- if (type == EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN)
- {
- int ret = EFL_UTIL_ERROR_NONE;
- ret = efl_util_input_set_touch_count(10);
- if (ret != EFL_UTIL_ERROR_NONE)
- printf("failed to set touch count: (ret: %d)", ret);
- }
-
- if (with_sync)
- handler = efl_util_input_initialize_generator_with_sync(type, NULL);
- else
- handler = efl_util_input_initialize_generator_with_name(type, NULL);
-
- if (handler == nullptr)
- printf("failed to init input generator\n");
- }
- ~etInputGenHandler()
- {
- efl_util_input_deinitialize_generator(handler);
- handler = nullptr;
- }
+ etInputGenHandler(efl_util_input_device_type_e type);
+ etInputGenHandler(efl_util_input_device_type_e type, bool with_sync);
+ ~etInputGenHandler();
efl_util_inputgen_h getHandler() { return handler; }