# checks for pkg-config
dnl ========================================================================
-have_wayland_only=no
-AC_ARG_ENABLE([wayland-only],
- AS_HELP_STRING([--enable-wayland-only],[enable wayland-only version of screen-reader @<:@default=disabled@:>@]),
- [have_wayland_only=$enableval],
- [have_wayland_only=no])
-AC_MSG_CHECKING([whether wayland-only version is enabled])
-if test "x${have_wayland_only}" = "xyes"; then
- AC_DEFINE_UNQUOTED([HAVE_WAYLAND_ONLY],[1],[enable wayland-only version of screen-reader])
-fi
-AM_CONDITIONAL(HAVE_WAYLAND_ONLY, [test "x${have_wayland_only}" = xyes])
-
-if test "x${have_wayland_only}" = "xyes"; then
- PKG_CHECK_MODULES(ENLIGHTENMENT, [enlightenment, dlog])
-else
- PKG_CHECK_MODULES(ENLIGHTENMENT, [enlightenment, dlog, x11, utilX])
- ENLIGHTENMENT_CFLAGS="${ENLIGHTENMENT_CFLAGS} -DNEED_X=1"
-fi
+PKG_CHECK_MODULES(ENLIGHTENMENT, [enlightenment, dlog])
AC_SUBST(ENLIGHTENMENT_CFLAGS)
AC_SUBST(ENLIGHTENMENT_LIBS)
-# to include e_comp_wl.h
-if test "${have_wayland_only}" != "xno"; then
- AC_DEFINE_UNQUOTED([HAVE_WAYLAND],[1],[enable wayland support])
-fi
-
dnl =======================================================================
release=$(pkg-config --variable=release enlightenment)
-%bcond_with wayland
-
Name: e-mod-tizen-screen-reader
Version: 0.0.2
Release: 1
BuildRequires: pkgconfig(enlightenment)
BuildRequires: pkgconfig(dlog)
-%global TZ_SYS_RO_SHARE %{?TZ_SYS_RO_SHARE:%TZ_SYS_RO_SHARE}%{!?TZ_SYS_RO_SHARE:/usr/share}
-
%description
This package is a screen-reader module for Tizen enlightenment.
%setup -q
%build
+%define DataDir %{?TZ_SYS_RO_SHARE:%TZ_SYS_RO_SHARE}%{!?TZ_SYS_RO_SHARE:/usr/share}
export GC_SECTIONS_FLAGS="-fdata-sections -ffunction-sections -Wl,--gc-sections"
export CFLAGS+=" -Wall -g -fPIC -rdynamic ${GC_SECTIONS_FLAGS} -DE_LOGGING=1"
export LDFLAGS+=" -Wl,--hash-style=both -Wl,--as-needed -Wl,--rpath=/usr/lib"
-%if %{with wayland}
-%reconfigure --enable-wayland-only
-%endif
+%autogen
+%configure
make
rm -rf %{buildroot}
# for license notification
-mkdir -p %{buildroot}/%{TZ_SYS_RO_SHARE}/license
-cp -a %{_builddir}/%{buildsubdir}/COPYING %{buildroot}/%{TZ_SYS_RO_SHARE}/license/%{name}
+mkdir -p %{buildroot}/%{DataDir}/license
+cp -a %{_builddir}/%{buildsubdir}/COPYING %{buildroot}/%{DataDir}/license/%{name}
# install
make install DESTDIR=%{buildroot}
%files
%defattr(-,root,root,-)
%{_libdir}/enlightenment/modules/e-mod-tizen-screen-reader
-%{TZ_SYS_RO_SHARE}/license/%{name}
+%{DataDir}/license/%{name}
int __get_window_angle(void)
{
- E_Client *ec;
E_Zone *zone;
- int x = 0, y = 0, w = 0, h = 0;
- E_Comp_Wl_Client_Data *cdata;
zone = e_zone_current_get();
if(!zone)
{
- DEBUG("Fail to found zone");
+ ERROR("Fail to find zone");
return cover->angle;
}
- E_CLIENT_REVERSE_FOREACH(ec)
- {
- if (e_object_is_del(E_OBJECT(ec))) continue;
- if (e_client_util_ignored_get(ec)) continue;
- if (ec->zone != zone) continue;
- if (!ec->frame) continue;
- cdata = (E_Comp_Wl_Client_Data *)ec->comp_data;
- if (cdata && cdata->sub.data) continue;
-
- e_client_geometry_get(ec, &x, &y, &w, &h);
- Eina_Bool vis = evas_object_visible_get(ec->frame);
- if (!vis) continue;
-
- if (E_INTERSECTS(x, y, w, h,
- zone->x, zone->y, zone->w, zone->h))
- break;
- }
-
- if (ec)
- {
- cover->angle = ec->e.state.rot.ang.curr;
- DEBUG("Window angle: %d", cover->angle);
- }
- else
- ERROR("Cannot find window");
-
+ cover->angle = zone->rot.act;
return cover->angle;
}
void __transform_coordinates(int *ax, int *ay)
{
- int win_angle, w, h, tmp;
+ int win_angle, tmp;
win_angle = __get_window_angle();
- ecore_wl_screen_size_get(&w, &h);
-
switch (win_angle) {
case 90:
tmp = *ax;
- *ax = h - *ay;
+ *ax = cover->zone.h - *ay;
*ay = tmp;
break;
case 270:
tmp = *ax;
*ax = *ay;
- *ay = w - tmp;
+ *ay = cover->zone.w - tmp;
break;
}
}
void __inverse_transform_coordinates(int *ax, int *ay)
{
- int win_angle, w, h, tmp;
+ int win_angle, tmp;
win_angle = __get_window_angle();
- ecore_wl_screen_size_get(&w, &h);
-
switch (win_angle) {
case 90:
tmp = *ax;
*ax = *ay;
- *ay = h - tmp;
+ *ay = cover->zone.h - tmp;
break;
case 270:
tmp = *ax;
- *ax = w - *ay;
+ *ax = cover->zone.w - *ay;
*ay = tmp;
break;
}
static void
_gesture_init()
{
- E_Zone *ez;
- E_Client *ec;
+ E_Zone *zone;
cover = E_NEW(Cover, 1);
if (!cover)
{
highlighted_object_y = -1;
scrolling = EINA_FALSE;
- /* Initialize angle value */
- ec = e_client_top_get();
- if (ec)
+ zone = e_zone_current_get();
+ if (zone)
{
- cover->angle = ec->e.state.rot.ang.curr;
- DEBUG("Default angle: %d", cover->angle);
+ /* Initialize angle value */
+ cover->angle = zone->rot.act;
+
+ /* Keep device geometry information */
+ cover->zone.x = zone->x;
+ cover->zone.y = zone->y;
+ cover->zone.w = zone->w;
+ cover->zone.h = zone->h;
}
-
- /* Keep device geometry information */
- ez = e_zone_current_get();
- if (ez)
+ else
{
- cover->zone.x = ez->x;
- cover->zone.y = ez->y;
- cover->zone.w = ez->w;
- cover->zone.h = ez->h;
+ ERROR("Fail to find zone");
}
}
DEBUG("gesture init");
_gesture_init();
_events_init();
- ecore_wl_init(NULL);
return 0;
}
_events_shutdown();
_gesture_shutdown();
- ecore_wl_shutdown();
return 0;
}