--- /dev/null
+#include "e.h"
+#include "e_screen_reader_private.h"
+#include "e_dispatch_rotation_event.h"
+
+static void
+_e_zone_event_rotation_change_begin_free(void *data, void *ev)
+{
+ E_Event_Zone_Rotation_Change_Begin *e = ev;
+ e_object_unref(E_OBJECT(e->zone));
+ E_FREE(e);
+}
+
+void _e_dispatch_rotation_event(int angle)
+{
+ if (angle % 90 != 0 || angle < 0 || angle > 270)
+ {
+ ERROR("Wrong angle");
+ return;
+ }
+
+ E_Zone *zone = e_zone_current_get();
+ if (!zone)
+ {
+ ERROR("Fail to find zone");
+ return;
+ }
+
+ zone->rot.prev = zone->rot.act;
+ zone->rot.curr = angle;
+ zone->rot.wait_for_done = EINA_TRUE;
+
+ E_Event_Zone_Rotation_Change_Begin *ev = E_NEW(E_Event_Zone_Rotation_Change_Begin, 1);
+ if (ev)
+ {
+ ev->zone = zone;
+ e_object_ref(E_OBJECT(ev->zone));
+ ecore_event_add(E_EVENT_ZONE_ROTATION_CHANGE_BEGIN, ev, _e_zone_event_rotation_change_begin_free, NULL);
+ }
+}
\ No newline at end of file
#include <e_screen_reader_private.h>
#include <vconf.h>
#include <e_dispatch_gesture_event.h>
+#include <e_dispatch_rotation_event.h>
#include "e_universal_switch.h"
#define E_A11Y_SERVICE_BUS_NAME "org.enlightenment.wm-screen-reader"
static Eldbus_Message *_object_needs_scroll_gesture(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
static Eldbus_Message *_dispatch_gesture_event(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
static Eldbus_Message *_dispatch_drag_event(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
+static Eldbus_Message *_dispatch_rotation_event(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg);
static const Eldbus_Method methods[] = {
{ "ScreenReaderEnabled", ELDBUS_ARGS({"b", "bool"}), ELDBUS_ARGS({"b", "bool"}),
{ "DispatchDragEvent", ELDBUS_ARGS({"i", "int"}, {"i", "int"}, {"i", "int"}, {"i", "int"}, {"i", "int"}, {"d", "double"}), NULL,
_dispatch_drag_event
},
+ { "DispatchRotationEvent", ELDBUS_ARGS({"i", "int"}), NULL,
+ _dispatch_rotation_event
+ },
{ }
};
return eldbus_message_method_return_new(msg);
}
+static Eldbus_Message *
+_dispatch_rotation_event(const Eldbus_Service_Interface *iface, const Eldbus_Message *msg)
+{
+ int angle;
+ if (eldbus_message_arguments_get(msg, "i", &angle))
+ {
+ _e_dispatch_rotation_event(angle);
+ }
+ else
+ ERROR("eldbus_message_arguments_get() error\n");
+
+ return eldbus_message_method_return_new(msg);
+}
+
static int
_fetch_a11y_bus_address(void)
{