From: Shinwoo Kim Date: Mon, 28 Mar 2016 12:48:31 +0000 (+0900) Subject: Initial draft: checked module loaded properly with modified e-tizen-data (https:... X-Git-Tag: submit/tizen/20160520.065205~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=63f2623b8a470349f8fa11d8867adf532c4738ca;p=platform%2Fcore%2Fuifw%2Fe-mod-tizen-screen-reader.git Initial draft: checked module loaded properly with modified e-tizen-data (https://review.tizen.org/gerrit/#/c/63914/) Change-Id: I4878351c44a72394c2e90a710c4b3de503449048 --- diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..f3bbff3 --- /dev/null +++ b/COPYING @@ -0,0 +1,25 @@ +Copyright notice for Enlightenment: + +Copyright (C) 2000-2012 Carsten Haitzler and various contributors (see AUTHORS) + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..a30d363 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,8 @@ +#maintainer-clean removes everything +MAINTAINERCLEANFILES = aclocal.m4 compile config.sub config.guess config.h.in \ + configure depcomp install-sh ltmain.sh Makefile.in missing + +SUBDIRS = src + +MAINTAINERCLEANFILES = \ + Makefile.in diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..ab0c7d2 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +set -x +aclocal +autoconf +libtoolize --copy --force +autoheader +automake --foreign --add-missing --copy diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..053e1cb --- /dev/null +++ b/configure.ac @@ -0,0 +1,122 @@ +# Process this file with autoconf to produce a configure script. +dnl Process this file with autoconf to produce a configure script. + +# Note ) +# +# AC_DEFINE(VARIABLE, VALUE, DESCRIPTION) +# output the following to config.h +# /* DESCRIPTION */ +# #define VARIABLE VALUE +# +# AC_SUBST(VARIABLE, [VALUE]) +# define $(VARIABLE) as VALUE in Makefile + +dnl ======================================================================== +# initialization +dnl ======================================================================== +AC_INIT([e-mod-tizen-screen-reader], [0.1], [cinoo.kim@samsung.com]) + +# check for tools needed by automake generated Makefiles +# -Wall : Turn all warnings on. +# -Werror: report warings as errors. +# foreign: relax some GNU standard requirements +#AM_INIT_AUTOMAKE([-Wall -Werror foreign]) +AM_INIT_AUTOMAKE([-Wall foreign]) +AM_SILENT_RULES([yes]) + +dnl ======================================================================== +# checks for programs +dnl ======================================================================== +AC_PROG_CC +AC_DISABLE_STATIC +AC_PROG_LIBTOOL + +dnl ======================================================================== +# checks for libraries +dnl ======================================================================== + +dnl ======================================================================== +# checks for header files +dnl ======================================================================== +#AC_HEADER_STDC +AC_CHECK_HEADERS([math.h fcntl.h stdlib.h string.h unistd.h]) + +dnl ======================================================================== +# checks for typedefs, structures, and compiler characteristics +AC_C_CONST + +dnl ======================================================================== +# checks for library functions +dnl ======================================================================== +#AC_FUNC_MALLOC +AC_FUNC_MMAP +AC_CHECK_FUNCS([memset munmap strcasecmp strdup]) + +dnl ======================================================================== +# checks for pkg-config +dnl ======================================================================== +PKG_PROG_PKG_CONFIG + + +dnl ======================================================================== +# 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 + +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) +MODULE_ARCH="$host_os-$host_cpu-$release" +AC_SUBST(MODULE_ARCH) +AC_DEFINE_UNQUOTED(MODULE_ARCH, "$MODULE_ARCH", "Module architecture") + +datadir=$(pkg-config --variable=modules enlightenment)/${PACKAGE} +AC_ARG_ENABLE(homedir-install, + AS_HELP_STRING([--enable-homedir-install], [Install module in homedir]), + [ datadir="${HOME}/.e/e/modules/${PACKAGE}" ] +) + +dnl ======================================================================== +# output files +dnl ======================================================================== + +# create HEADER for all HEADER.in. +# HEADERS contain definitions made with AC_DEFINE. +# the following command will create config.h from config.h.in +AC_CONFIG_HEADERS([config.h]) + +# create FILE for all FILE.in. +# FILES contains definitions made with AC_SUBST. +AC_CONFIG_FILES([ + Makefile + src/Makefile + ]) + +AC_OUTPUT + + diff --git a/packaging/e-mod-tizen-screen-reader.spec b/packaging/e-mod-tizen-screen-reader.spec new file mode 100644 index 0000000..08ea789 --- /dev/null +++ b/packaging/e-mod-tizen-screen-reader.spec @@ -0,0 +1,50 @@ +%bcond_with wayland + +Name: e-mod-tizen-screen-reader +Version: 0.0.1 +Release: 1 +Summary: The screen-reader for enlightenment modules +URL: http://www.enlightenment.org +Group: Graphics & UI Framework/Other +Source0: %{name}-%{version}.tar.gz +License: BSD-2-Clause +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. + +%prep +%setup -q + +%build + +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 + +make + +%install +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} + +# install +make install DESTDIR=%{buildroot} + +# clear useless textual files +find %{buildroot}%{_libdir}/enlightenment/modules/%{name} -name *.la | xargs rm + +%files +%defattr(-,root,root,-) +%{_libdir}/enlightenment/modules/e-mod-tizen-screen-reader +%{TZ_SYS_RO_SHARE}/license/%{name} diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..6f439a2 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,18 @@ +MAINTAINERCLEANFILES = Makefile.in +MODULE = e-mod-tizen-screen-reader + +LDFLAGS += + +pkgdir = $(libdir)/enlightenment/modules/$(MODULE)/$(MODULE_ARCH) +pkg_LTLIBRARIES = module.la +module_la_SOURCES = \ + e_mod_main.c + +#if HAVE_WAYLAND_ONLY +#module_la_SOURCES += e_screen_reader_*.c \ +#endif + +module_la_LIBADD = +module_la_CFLAGS = @ENLIGHTENMENT_CFLAGS@ +module_la_LDFLAGS = -module -avoid-version @ENLIGHTENMENT_LIBS@ +module_la_DEPENDENCIES = $(top_builddir)/config.h diff --git a/src/e_mod_main.c b/src/e_mod_main.c new file mode 100644 index 0000000..7ba6bbd --- /dev/null +++ b/src/e_mod_main.c @@ -0,0 +1,41 @@ +#include "e.h" +#include "eina_log.h" +#include "e_mod_main.h" + +#undef DBG +int _log_dom = -1; +#define DBG(...) do EINA_LOG_DOM_DBG(_log_dom, __VA_ARGS__); while(0) + +EAPI E_Module_Api e_modapi = +{ + E_MODULE_API_VERSION, + "Screen Reader Module of Window Manager" +}; + +EAPI void * +e_modapi_init(E_Module *m) +{ + _log_dom = eina_log_domain_register("e_screen_reader", EINA_COLOR_YELLOW); + if (_log_dom < 0) + { + DBG("Failed @ eina_log_domain_register()..!"); + return NULL; + } + + return m; +} + +EAPI int +e_modapi_shutdown(E_Module *m EINA_UNUSED) +{ + eina_log_domain_unregister(_log_dom); + + return 1; +} + +EAPI int +e_modapi_save(E_Module *m EINA_UNUSED) +{ + /* Do Something */ + return 1; +} diff --git a/src/e_mod_main.h b/src/e_mod_main.h new file mode 100644 index 0000000..fc6520c --- /dev/null +++ b/src/e_mod_main.h @@ -0,0 +1,13 @@ +#ifndef __E_MOD_MAIN_H__ +#define __E_MOD_MAIN_H__ + +#include "e.h" + +/*** E Module ***/ +EAPI extern E_Module_Api e_modapi; + +EAPI void* e_modapi_init (E_Module *m); +EAPI int e_modapi_shutdown (E_Module *m); +EAPI int e_modapi_save (E_Module *m); + +#endif//__E_MOD_MAIN_H__ \ No newline at end of file