return ECORE_CALLBACK_CANCEL;
}
+void VoiceTouchEngine::findIntersectArea(ClickableItem *command)
+{
+ int xMin = command->coordX, yMin = command->coordY, xMax = command->coordX + command->width, yMax = command->coordY + command->height;
+ _D("[VoiceTouchEngine] GRID mode selected area: [%d, %d, %d, %d]", xMin, yMin, xMax, yMax);
+ int areaMax = 0;
+ for (auto &item : __itemList) {
+ int dx = min(xMax, item.coordX + item.width) - max(xMin, item.coordX);
+ int dy = min(yMax, item.coordY + item.height) - max(yMin, item.coordY);
+ if (dx >= 0 && dy >= 0) {
+ _D("[VoiceTouchEngine] %s intersected(%d): [%d, %d, %d, %d]", item.label.c_str(), item.index, item.coordX, item.coordY, item.coordX + item.width, item.coordY + item.height);
+ _D("[VoiceTouchEngine] intersected area: %d", dx*dy);
+ _D("[VoiceTouchEngine] current max intersect area: %d", areaMax);
+ if (areaMax < dx*dy) {
+ _D("[VoiceTouchEngine] updated");
+ areaMax = dx*dy;
+ *command = item;
+ }
+ }
+ }
+}
+
Eina_Bool VoiceTouchEngine::findCommandCallback(void *data)
{
VoiceTouchEngine *engine = static_cast<VoiceTouchEngine *>(data);
return ECORE_CALLBACK_CANCEL;
}
+ if (engine->__currentMode == VOICE_TOUCH_MODE_GRID && engine->__currentGridInfo.currentStep == 1) {
+ engine->findIntersectArea(command);
+ }
+
_I("[VoiceTouchEngine] Command. object ID(%s)", command->objectId.c_str());
engine->makeTouchModality(*command, timestamp);
engine->invokeOutputModalityCallback(&engine->__touchModality);