summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2016-05-03 23:23:36 +0100
committerAndy Williams <andy@andywilliams.me>2016-05-03 23:23:36 +0100
commit41c7f3e89dfbe13b25089519114bc4c2ff869bc7 (patch)
treed8302fa0bb5e7ccb0ee6ff02d7e0620f59f06b31
Generate a quick stub that is our extra client app
-rw-r--r--.gitignore63
-rw-r--r--AUTHORS1
-rw-r--r--COPYING13
-rw-r--r--ChangeLog0
-rw-r--r--INSTALL370
-rw-r--r--Makefile.am91
-rw-r--r--Makefile_Edje_Helper.am9
-rw-r--r--NEWS0
-rw-r--r--README0
-rw-r--r--TODO0
-rwxr-xr-xautogen.sh15
-rw-r--r--configure.ac98
-rw-r--r--data/Makefile.am3
-rw-r--r--data/desktop/Makefile.am9
-rw-r--r--data/desktop/extra.desktop12
-rw-r--r--data/desktop/extra.desktop.in12
-rw-r--r--data/desktop/extra.pngbin0 -> 82822 bytes
-rw-r--r--data/themes/Makefile.am4
-rw-r--r--data/themes/default/Makefile.am22
-rw-r--r--data/themes/default/default.edc21
-rw-r--r--data/themes/default/images/enlightenment.pngbin0 -> 2046 bytes
-rw-r--r--data/themes/default/sounds/bell.wavbin0 -> 242396 bytes
-rw-r--r--description1
-rw-r--r--doc/Makefile.am38
-rw-r--r--doc/extra.1.in50
-rw-r--r--m4/efl.m4123
-rw-r--r--m4/efl_attribute.m456
-rw-r--r--m4/efl_binary.m479
-rw-r--r--m4/efl_compiler_flag.m457
-rw-r--r--m4/efl_doxygen.m498
-rw-r--r--m4/efl_path_max.m436
-rw-r--r--m4/efl_tests.m465
-rw-r--r--packaging/Makefile.am4
-rw-r--r--packaging/pkgbuild/Makefile.am3
-rw-r--r--packaging/pkgbuild/PKGBUILD60
-rw-r--r--packaging/slackware/Makefile.am4
-rw-r--r--packaging/slackware/doinst.sh1
-rwxr-xr-xpackaging/slackware/extra.SlackBuild106
-rw-r--r--packaging/slackware/slack-desc19
-rw-r--r--packaging/slackware/slack-required5
-rw-r--r--po/Makevars41
-rw-r--r--po/POTFILES.in2
-rw-r--r--src/Makefile.am4
-rw-r--r--src/bin/Makefile.am19
-rw-r--r--src/bin/extra_main.c118
-rw-r--r--src/bin/extra_private.h6
-rw-r--r--src/bin/gettext.h280
-rw-r--r--src/lib/Makefile.am18
-rw-r--r--src/lib/extra.c92
-rw-r--r--src/lib/extra.h111
-rw-r--r--src/lib/extra_private.h27
-rw-r--r--src/tests/Makefile.am17
-rw-r--r--src/tests/test_extra.c124
53 files changed, 2407 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..b09952e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,63 @@
1# generated and tmp files
2*~
3*.edj
4*.exe
5*.o
6*.lo
7*.la
8.deps
9*.gcno
10*.gcda
11
12/src/bin/extra
13/src/tests/extra_tests
14packaging/slackware/extra-*.txz
15extra-*.tar.?z*
16po/*.gmo
17po/POTFILES
18.libs
19
20# autotools crap
21m4/*.m4
22!m4/efl*.m4
23Makefile
24Makefile.in
25aclocal.m4
26autom4te.cache
27compile
28config.guess
29config.h
30config.h.in
31config.log
32config.rpath
33config.status
34config.sub
35configure
36depcomp
37install-sh
38libtool
39ltmain.sh
40missing
41stamp-h1
42ar-lib
43test-driver
44test-suite.log
45
46# gettext crap
47ABOUT-NLS
48po/Makefile.in.in
49po/Makevars.template
50po/Rules-quot
51po/boldquot.sed
52po/en@boldquot.header
53po/en@quot.header
54po/insert-header.sin
55po/quot.sed
56po/remove-potcdate.sed
57po/remove-potcdate.sin
58po/stamp-po
59
60/coverage/
61/src/tests/extra_tests.*
62/src/tests/test-suite.log
63/src/tests/check-results.xml
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..69ac997
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1 @@
Andy Williams <andy@andywilliams.me>
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..a741250
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,13 @@
1Copyright (c) 2016 Andy Williams
2
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6
71. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8
92. 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.
10
113. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
12
13THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/ChangeLog
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..007e939
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,370 @@
1Installation Instructions
2*************************
3
4Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
5Inc.
6
7 Copying and distribution of this file, with or without modification,
8are permitted in any medium without royalty provided the copyright
9notice and this notice are preserved. This file is offered as-is,
10without warranty of any kind.
11
12Basic Installation
13==================
14
15 Briefly, the shell commands `./configure; make; make install' should
16configure, build, and install this package. The following
17more-detailed instructions are generic; see the `README' file for
18instructions specific to this package. Some packages provide this
19`INSTALL' file but do not implement all of the features documented
20below. The lack of an optional feature in a given package is not
21necessarily a bug. More recommendations for GNU packages can be found
22in *note Makefile Conventions: (standards)Makefile Conventions.
23
24 The `configure' shell script attempts to guess correct values for
25various system-dependent variables used during compilation. It uses
26those values to create a `Makefile' in each directory of the package.
27It may also create one or more `.h' files containing system-dependent
28definitions. Finally, it creates a shell script `config.status' that
29you can run in the future to recreate the current configuration, and a
30file `config.log' containing compiler output (useful mainly for
31debugging `configure').
32
33 It can also use an optional file (typically called `config.cache'
34and enabled with `--cache-file=config.cache' or simply `-C') that saves
35the results of its tests to speed up reconfiguring. Caching is
36disabled by default to prevent problems with accidental use of stale
37cache files.
38
39 If you need to do unusual things to compile the package, please try
40to figure out how `configure' could check whether to do them, and mail
41diffs or instructions to the address given in the `README' so they can
42be considered for the next release. If you are using the cache, and at
43some point `config.cache' contains results you don't want to keep, you
44may remove or edit it.
45
46 The file `configure.ac' (or `configure.in') is used to create
47`configure' by a program called `autoconf'. You need `configure.ac' if
48you want to change it or regenerate `configure' using a newer version
49of `autoconf'.
50
51 The simplest way to compile this package is:
52
53 1. `cd' to the directory containing the package's source code and type
54 `./configure' to configure the package for your system.
55
56 Running `configure' might take a while. While running, it prints
57 some messages telling which features it is checking for.
58
59 2. Type `make' to compile the package.
60
61 3. Optionally, type `make check' to run any self-tests that come with
62 the package, generally using the just-built uninstalled binaries.
63
64 4. Type `make install' to install the programs and any data files and
65 documentation. When installing into a prefix owned by root, it is
66 recommended that the package be configured and built as a regular
67 user, and only the `make install' phase executed with root
68 privileges.
69
70 5. Optionally, type `make installcheck' to repeat any self-tests, but
71 this time using the binaries in their final installed location.
72 This target does not install anything. Running this target as a
73 regular user, particularly if the prior `make install' required
74 root privileges, verifies that the installation completed
75 correctly.
76
77 6. You can remove the program binaries and object files from the
78 source code directory by typing `make clean'. To also remove the
79 files that `configure' created (so you can compile the package for
80 a different kind of computer), type `make distclean'. There is
81 also a `make maintainer-clean' target, but that is intended mainly
82 for the package's developers. If you use it, you may have to get
83 all sorts of other programs in order to regenerate files that came
84 with the distribution.
85
86 7. Often, you can also type `make uninstall' to remove the installed
87 files again. In practice, not all packages have tested that
88 uninstallation works correctly, even though it is required by the
89 GNU Coding Standards.
90
91 8. Some packages, particularly those that use Automake, provide `make
92 distcheck', which can by used by developers to test that all other
93 targets like `make install' and `make uninstall' work correctly.
94 This target is generally not run by end users.
95
96Compilers and Options
97=====================
98
99 Some systems require unusual options for compilation or linking that
100the `configure' script does not know about. Run `./configure --help'
101for details on some of the pertinent environment variables.
102
103 You can give `configure' initial values for configuration parameters
104by setting variables in the command line or in the environment. Here
105is an example:
106
107 ./configure CC=c99 CFLAGS=-g LIBS=-lposix
108
109 *Note Defining Variables::, for more details.
110
111Compiling For Multiple Architectures
112====================================
113
114 You can compile the package for more than one kind of computer at the
115same time, by placing the object files for each architecture in their
116own directory. To do this, you can use GNU `make'. `cd' to the
117directory where you want the object files and executables to go and run
118the `configure' script. `configure' automatically checks for the
119source code in the directory that `configure' is in and in `..'. This
120is known as a "VPATH" build.
121
122 With a non-GNU `make', it is safer to compile the package for one
123architecture at a time in the source code directory. After you have
124installed the package for one architecture, use `make distclean' before
125reconfiguring for another architecture.
126
127 On MacOS X 10.5 and later systems, you can create libraries and
128executables that work on multiple system types--known as "fat" or
129"universal" binaries--by specifying multiple `-arch' options to the
130compiler but only a single `-arch' option to the preprocessor. Like
131this:
132
133 ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
134 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
135 CPP="gcc -E" CXXCPP="g++ -E"
136
137 This is not guaranteed to produce working output in all cases, you
138may have to build one architecture at a time and combine the results
139using the `lipo' tool if you have problems.
140
141Installation Names
142==================
143
144 By default, `make install' installs the package's commands under
145`/usr/local/bin', include files under `/usr/local/include', etc. You
146can specify an installation prefix other than `/usr/local' by giving
147`configure' the option `--prefix=PREFIX', where PREFIX must be an
148absolute file name.
149
150 You can specify separate installation prefixes for
151architecture-specific files and architecture-independent files. If you
152pass the option `--exec-prefix=PREFIX' to `configure', the package uses
153PREFIX as the prefix for installing programs and libraries.
154Documentation and other data files still use the regular prefix.
155
156 In addition, if you use an unusual directory layout you can give
157options like `--bindir=DIR' to specify different values for particular
158kinds of files. Run `configure --help' for a list of the directories
159you can set and what kinds of files go in them. In general, the
160default for these options is expressed in terms of `${prefix}', so that
161specifying just `--prefix' will affect all of the other directory
162specifications that were not explicitly provided.
163
164 The most portable way to affect installation locations is to pass the
165correct locations to `configure'; however, many packages provide one or
166both of the following shortcuts of passing variable assignments to the
167`make install' command line to change installation locations without
168having to reconfigure or recompile.
169
170 The first method involves providing an override variable for each
171affected directory. For example, `make install
172prefix=/alternate/directory' will choose an alternate location for all
173directory configuration variables that were expressed in terms of
174`${prefix}'. Any directories that were specified during `configure',
175but not in terms of `${prefix}', must each be overridden at install
176time for the entire installation to be relocated. The approach of
177makefile variable overrides for each directory variable is required by
178the GNU Coding Standards, and ideally causes no recompilation.
179However, some platforms have known limitations with the semantics of
180shared libraries that end up requiring recompilation when using this
181method, particularly noticeable in packages that use GNU Libtool.
182
183 The second method involves providing the `DESTDIR' variable. For
184example, `make install DESTDIR=/alternate/directory' will prepend
185`/alternate/directory' before all installation names. The approach of
186`DESTDIR' overrides is not required by the GNU Coding Standards, and
187does not work on platforms that have drive letters. On the other hand,
188it does better at avoiding recompilation issues, and works well even
189when some directory options were not specified in terms of `${prefix}'
190at `configure' time.
191
192Optional Features
193=================
194
195 If the package supports it, you can cause programs to be installed
196with an extra prefix or suffix on their names by giving `configure' the
197option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
198
199 Some packages pay attention to `--enable-FEATURE' options to
200`configure', where FEATURE indicates an optional part of the package.
201They may also pay attention to `--with-PACKAGE' options, where PACKAGE
202is something like `gnu-as' or `x' (for the X Window System). The
203`README' should mention any `--enable-' and `--with-' options that the
204package recognizes.
205
206 For packages that use the X Window System, `configure' can usually
207find the X include and library files automatically, but if it doesn't,
208you can use the `configure' options `--x-includes=DIR' and
209`--x-libraries=DIR' to specify their locations.
210
211 Some packages offer the ability to configure how verbose the
212execution of `make' will be. For these packages, running `./configure
213--enable-silent-rules' sets the default to minimal output, which can be
214overridden with `make V=1'; while running `./configure
215--disable-silent-rules' sets the default to verbose, which can be
216overridden with `make V=0'.
217
218Particular systems
219==================
220
221 On HP-UX, the default C compiler is not ANSI C compatible. If GNU
222CC is not installed, it is recommended to use the following options in
223order to use an ANSI C compiler:
224
225 ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
226
227and if that doesn't work, install pre-built binaries of GCC for HP-UX.
228
229 HP-UX `make' updates targets which have the same time stamps as
230their prerequisites, which makes it generally unusable when shipped
231generated files such as `configure' are involved. Use GNU `make'
232instead.
233
234 On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
235parse its `<wchar.h>' header file. The option `-nodtk' can be used as
236a workaround. If GNU CC is not installed, it is therefore recommended
237to try
238
239 ./configure CC="cc"
240
241and if that doesn't work, try
242
243 ./configure CC="cc -nodtk"
244
245 On Solaris, don't put `/usr/ucb' early in your `PATH'. This
246directory contains several dysfunctional programs; working variants of
247these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
248in your `PATH', put it _after_ `/usr/bin'.
249
250 On Haiku, software installed for all users goes in `/boot/common',
251not `/usr/local'. It is recommended to use the following options:
252
253 ./configure --prefix=/boot/common
254
255Specifying the System Type
256==========================
257
258 There may be some features `configure' cannot figure out
259automatically, but needs to determine by the type of machine the package
260will run on. Usually, assuming the package is built to be run on the
261_same_ architectures, `configure' can figure that out, but if it prints
262a message saying it cannot guess the machine type, give it the
263`--build=TYPE' option. TYPE can either be a short name for the system
264type, such as `sun4', or a canonical name which has the form:
265
266 CPU-COMPANY-SYSTEM
267
268where SYSTEM can have one of these forms:
269
270 OS
271 KERNEL-OS
272
273 See the file `config.sub' for the possible values of each field. If
274`config.sub' isn't included in this package, then this package doesn't
275need to know the machine type.
276
277 If you are _building_ compiler tools for cross-compiling, you should
278use the option `--target=TYPE' to select the type of system they will
279produce code for.
280
281 If you want to _use_ a cross compiler, that generates code for a
282platform different from the build platform, you should specify the
283"host" platform (i.e., that on which the generated programs will
284eventually be run) with `--host=TYPE'.
285
286Sharing Defaults
287================
288
289 If you want to set default values for `configure' scripts to share,
290you can create a site shell script called `config.site' that gives
291default values for variables like `CC', `cache_file', and `prefix'.
292`configure' looks for `PREFIX/share/config.site' if it exists, then
293`PREFIX/etc/config.site' if it exists. Or, you can set the
294`CONFIG_SITE' environment variable to the location of the site script.
295A warning: not all `configure' scripts look for a site script.
296
297Defining Variables
298==================
299
300 Variables not defined in a site shell script can be set in the
301environment passed to `configure'. However, some packages may run
302configure again during the build, and the customized values of these
303variables may be lost. In order to avoid this problem, you should set
304them in the `configure' command line, using `VAR=value'. For example:
305
306 ./configure CC=/usr/local2/bin/gcc
307
308causes the specified `gcc' to be used as the C compiler (unless it is
309overridden in the site shell script).
310
311Unfortunately, this technique does not work for `CONFIG_SHELL' due to
312an Autoconf limitation. Until the limitation is lifted, you can use
313this workaround:
314
315 CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
316
317`configure' Invocation
318======================
319
320 `configure' recognizes the following options to control how it
321operates.
322
323`--help'
324`-h'
325 Print a summary of all of the options to `configure', and exit.
326
327`--help=short'
328`--help=recursive'
329 Print a summary of the options unique to this package's
330 `configure', and exit. The `short' variant lists options used
331 only in the top level, while the `recursive' variant lists options
332 also present in any nested packages.
333
334`--version'
335`-V'
336 Print the version of Autoconf used to generate the `configure'
337 script, and exit.
338
339`--cache-file=FILE'
340 Enable the cache: use and save the results of the tests in FILE,
341 traditionally `config.cache'. FILE defaults to `/dev/null' to
342 disable caching.
343
344`--config-cache'
345`-C'
346 Alias for `--cache-file=config.cache'.
347
348`--quiet'
349`--silent'
350`-q'
351 Do not print messages saying which checks are being made. To
352 suppress all normal output, redirect it to `/dev/null' (any error
353 messages will still be shown).
354
355`--srcdir=DIR'
356 Look for the package's source code in directory DIR. Usually
357 `configure' can determine that directory automatically.
358
359`--prefix=DIR'
360 Use DIR as the installation prefix. *note Installation Names::
361 for more details, including other options available for fine-tuning
362 the installation locations.
363
364`--no-create'
365`-n'
366 Run the configure checks, but stop before creating any output
367 files.
368
369`configure' also accepts some other, not widely useful, options. Run
370`configure --help' for more details.
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..11cc3a5
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,91 @@
1MAINTAINERCLEANFILES = \
2 ABOUT-NLS \
3 Makefile.in \
4 aclocal.m4 \
5 compile \
6 config.guess \
7 config.h.in \
8 config.rpath \
9 config.sub \
10 configure \
11 depcomp \
12 install-sh \
13 ltmain.sh \
14 missing \
15 m4/libtool.m4 \
16 m4/ltoptions.m4 \
17 m4/ltsugar.m4 \
18 m4/ltversion.m4 \
19 m4/lt~obsolete.m4 \
20 po/boldquot.sed \
21 po/en@boldquot.header \
22 po/en@quot.header \
23 po/insert-header.sin \
24 po/Makefile.in.in \
25 po/Makevars.template \
26 po/quot.sed \
27 po/remove-potcdate.sin \
28 po/Rules-quot \
29 $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz \
30 $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.bz2
31
32SUBDIRS = data doc packaging po src
33
34ACLOCAL_AMFLAGS = -I m4
35
36filesdir = $(docdir)
37files_DATA = \
38 AUTHORS \
39 COPYING \
40 ChangeLog \
41 INSTALL \
42 NEWS \
43 README \
44 TODO
45
46EXTRA_DIST = \
47 autogen.sh \
48 config.rpath \
49 configure \
50 m4/efl_attribute.m4 \
51 m4/efl_binary.m4 \
52 m4/efl_compiler_flag.m4 \
53 m4/efl_path_max.m4
54
55if EFL_HAVE_LCOV
56
57lcov-reset:
58 @rm -rf $(top_builddir)/coverage
59 @find $(top_builddir) -name "*.gcda" -delete
60 @lcov --zerocounters --directory $(top_builddir)
61
62lcov-report:
63 @mkdir $(top_builddir)/coverage
64 lcov --capture --compat-libtool --output-file $(top_builddir)/coverage/coverage.info --directory $(top_builddir)/src/lib --base-directory $(top_srcdir)/src/lib
65 lcov --remove $(top_builddir)/coverage/coverage.info '*.h' --output-file $(top_builddir)/coverage/coverage.cleaned.info
66 lcov --remove $(top_builddir)/coverage/coverage.cleaned.info '*/tests/*' --output-file $(top_builddir)/coverage/coverage.cleaned2.info
67 genhtml --branch-coverage -t "$(PACKAGE_STRING)" -o $(top_builddir)/coverage/html $(top_builddir)/coverage/coverage.cleaned2.info
68 @echo "Coverage Report at $(top_builddir)/coverage/html"
69
70endif
71
72if EFL_HAVE_TESTS
73
74TESTS = src/tests/extra_tests
75
76lcov-check:
77if EFL_HAVE_LCOV
78 @$(MAKE) $(AM_MAKEFLAGS) lcov-reset
79endif
80 @$(MAKE) $(AM_MAKEFLAGS) check
81if EFL_HAVE_LCOV
82 @$(MAKE) $(AM_MAKEFLAGS) lcov-report
83endif
84
85endif
86
87# cleaning
88
89clean-local:
90 rm -rf benchmark coverage
91
diff --git a/Makefile_Edje_Helper.am b/Makefile_Edje_Helper.am
new file mode 100644
index 0000000..3f05237
--- /dev/null
+++ b/Makefile_Edje_Helper.am
@@ -0,0 +1,9 @@
1EDJE_CC = @edje_cc@
2EDJE_CC_FLAGS_VERBOSE = $(EDJE_CC_FLAGS_VERBOSE_@AM_V@)
3EDJE_CC_FLAGS_VERBOSE_ = $(EDJE_CC_FLAGS_VERBOSE_@AM_DEFAULT_V@)
4EDJE_CC_FLAGS_VERBOSE_1 = -v
5EDJE_CC_FLAGS = $(EDJE_CC_FLAGS_VERBOSE) -fastdecomp -id $(srcdir) -fd $(srcdir)
6
7AM_V_EDJ = $(am__v_EDJ_@AM_V@)
8am__v_EDJ_ = $(am__v_EDJ_@AM_DEFAULT_V@)
9am__v_EDJ_0 = @echo " EDJ " $@;
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/NEWS
diff --git a/README b/README
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/README
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TODO
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..fe644eb
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,15 @@
1#!/bin/sh
2
3rm -rf autom4te.cache
4rm -f aclocal.m4 ltmain.sh
5
6echo "Running autopoint..." ; autopoint -f || :
7echo "Running aclocal..." ; aclocal -I m4 $ACLOCAL_FLAGS || exit 1
8echo "Running autoconf..." ; autoconf || exit 1
9echo "Running autoheader..." ; autoheader || exit 1
10echo "Running libtoolize..." ; (libtoolize --copy --automake || glibtoolize --automake) || exit 1
11echo "Running automake..." ; automake --add-missing --copy --gnu || exit 1
12
13if [ -z "$NOCONFIGURE" ]; then
14 ./configure "$@"
15fi
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..102887a
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,98 @@
1EFL_VERSION([0], [0], [1], [dev])
2AC_INIT([extra], [efl_version], [enlightenment-devel@lists.sourceforge.net])
3
4AC_PREREQ([2.65])
5AC_CONFIG_SRCDIR([configure.ac])
6AC_CONFIG_HEADERS([config.h])
7
8AC_CANONICAL_BUILD
9AC_CANONICAL_HOST
10
11AM_INIT_AUTOMAKE([1.10 dist-bzip2 -Wall color-tests])
12m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
13AM_PROG_AR
14
15# this will speed up libtool checks
16LT_PREREQ([2.2])
17LT_INIT([win32-dll pic-only])
18EFL_INIT
19
20AC_PROG_CC
21AM_PROG_CC_C_O
22EFL_ATTRIBUTE_UNUSED
23ELM_QUICKLAUNCH
24EFL_COMPILER_FLAG([-Wall])
25EFL_COMPILER_FLAG([-W])
26
27# Checks for header files.
28EFL_CHECK_PATH_MAX
29
30# Check for EFL
31PKG_CHECK_MODULES([EFL],
32[
33 eina >= 1.8.0
34 evas >= 1.8.0
35 ecore >= 1.8.0
36 edje >= 1.8.0
37 elementary >= 1.8.0
38])
39
40# Check for tests and coverage
41AC_ARG_WITH([tests],
42 [AC_HELP_STRING([--with-tests=none|regular|coverage],
43 [choose testing method: regular, coverage or none.
44 @<:@default=none@:>@])],
45 [build_tests=${withval}],
46 [build_tests=auto])
47
48EFL_TESTS([${build_tests}])
49
50# doxygen program for documentation building
51EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
52
53# Check edje_cc
54EFL_WITH_BIN([edje], [edje-cc], [edje_cc])
55
56# Checks for library functions.
57AC_CHECK_FUNCS([setlocale])
58
59AM_GNU_GETTEXT_VERSION([0.17])
60AM_GNU_GETTEXT([external])
61
62AC_CONFIG_FILES([
63Makefile
64data/Makefile
65data/desktop/Makefile
66data/desktop/extra.desktop
67data/themes/Makefile
68data/themes/default/Makefile
69doc/Makefile
70packaging/Makefile
71packaging/slackware/Makefile
72packaging/pkgbuild/Makefile
73po/Makefile.in
74src/Makefile
75src/bin/Makefile
76src/lib/Makefile
77src/tests/Makefile
78doc/extra.1
79])
80AC_OUTPUT
81
82echo
83echo
84echo "------------------------------------------------------------------------"
85echo "$PACKAGE_NAME $PACKAGE_VERSION"
86echo "------------------------------------------------------------------------"
87echo
88echo "Compilation..............: make (or gmake)"
89echo " CFLAGS.................: $CFLAGS"
90echo " edje_cc................: ${edje_cc}"
91echo
92echo "Building documentation...: ${build_doc}"
93echo "Building tests...........: ${have_tests}"
94echo "Generate coverage .......: ${have_lcov}"
95echo
96echo "Installation.............: make install (as root if needed, with 'su' or 'sudo')"
97echo " prefix.................: $prefix"
98echo
diff --git a/data/Makefile.am b/data/Makefile.am
new file mode 100644
index 0000000..2d4e6c1
--- /dev/null
+++ b/data/Makefile.am
@@ -0,0 +1,3 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3SUBDIRS = themes desktop
diff --git a/data/desktop/Makefile.am b/data/desktop/Makefile.am
new file mode 100644
index 0000000..1ab7c9c
--- /dev/null
+++ b/data/desktop/Makefile.am
@@ -0,0 +1,9 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3desktopdir = $(datadir)/applications
4desktop_DATA = extra.desktop
5
6icondir = $(datadir)/icons
7icon_DATA = extra.png
8
9EXTRA_DIST = $(desktop_DATA) $(icon_DATA)
diff --git a/data/desktop/extra.desktop b/data/desktop/extra.desktop
new file mode 100644
index 0000000..42c8c26
--- /dev/null
+++ b/data/desktop/extra.desktop
@@ -0,0 +1,12 @@
1[Desktop Entry]
2Encoding=UTF-8
3Version=0.0.1
4Type=Application
5Name=extra
6Name[fr]=extra
7GenericName=extra
8Comment=Efl Application extra
9Icon=extra
10TryExec=extra
11Exec=extra
12Categories=Development;Utility;
diff --git a/data/desktop/extra.desktop.in b/data/desktop/extra.desktop.in
new file mode 100644
index 0000000..548c092
--- /dev/null
+++ b/data/desktop/extra.desktop.in
@@ -0,0 +1,12 @@
1[Desktop Entry]
2Encoding=UTF-8
3Version=@VERSION@
4Type=Application
5Name=@PACKAGE_NAME@
6Name[fr]=@PACKAGE_NAME@
7GenericName=extra
8Comment=Efl Application extra
9Icon=@PACKAGE_NAME@
10TryExec=@PACKAGE_NAME@
11Exec=@PACKAGE_NAME@
12Categories=Development;Utility;
diff --git a/data/desktop/extra.png b/data/desktop/extra.png
new file mode 100644
index 0000000..9037bea
--- /dev/null
+++ b/data/desktop/extra.png
Binary files differ
diff --git a/data/themes/Makefile.am b/data/themes/Makefile.am
new file mode 100644
index 0000000..31a2b40
--- /dev/null
+++ b/data/themes/Makefile.am
@@ -0,0 +1,4 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3SUBDIRS = default
4
diff --git a/data/themes/default/Makefile.am b/data/themes/default/Makefile.am
new file mode 100644
index 0000000..2612ac0
--- /dev/null
+++ b/data/themes/default/Makefile.am
@@ -0,0 +1,22 @@
1AUTOMAKE_OPTIONS = subdir-objects
2MAINTAINERCLEANFILES = Makefile.in
3
4EXTRA_DIST = \
5default.edc \
6images/enlightenment.png \
7sounds/bell.wav
8
9include ../../../Makefile_Edje_Helper.am
10
11filesdir = $(datadir)/$(PACKAGE)/themes
12files_DATA = default.edj
13
14default.edj: Makefile $(EXTRA_DIST)
15 $(AM_V_EDJ)$(EDJE_CC) $(EDJE_CC_FLAGS) \
16 -id ${top_srcdir}/data/themes/default/images \
17 -sd ${top_srcdir}/data/themes/default/sounds \
18 $(top_srcdir)/data/themes/default/default.edc \
19 $(top_builddir)/data/themes/default/default.edj
20
21clean-local:
22 rm -f *.edj
diff --git a/data/themes/default/default.edc b/data/themes/default/default.edc
new file mode 100644
index 0000000..b1bacd8
--- /dev/null
+++ b/data/themes/default/default.edc
@@ -0,0 +1,21 @@
1images.image: "enlightenment.png" COMP;
2
3collections {
4 sounds {
5 sample {
6 name: "bell" LOSSY 64;
7 source: "bell.wav";
8 }
9 }
10
11 group {
12 name: "test";
13 parts {
14 part { name: "main"; type: IMAGE;
15 description {
16 image.normal: "enlightenment.png";
17 }
18 }
19 }
20 }
21}
diff --git a/data/themes/default/images/enlightenment.png b/data/themes/default/images/enlightenment.png
new file mode 100644
index 0000000..759381d
--- /dev/null
+++ b/data/themes/default/images/enlightenment.png
Binary files differ
diff --git a/data/themes/default/sounds/bell.wav b/data/themes/default/sounds/bell.wav
new file mode 100644
index 0000000..c052881
--- /dev/null
+++ b/data/themes/default/sounds/bell.wav
Binary files differ
diff --git a/description b/description
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/description
@@ -0,0 +1 @@
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..a9ca5ba
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,38 @@
1MAINTAINERCLEANFILES = Makefile.in
2EXTRA_DIST = extra.1.in
3
4man_MANS = extra.1
5
6
7.PHONY: doc
8
9PACKAGE_DOCNAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-doc
10
11if EFL_BUILD_DOC
12
13doc-clean:
14 rm -rf html/ latex/ man/ xml/ $(top_builddir)/$(PACKAGE_DOCNAME).tar*
15
16doc: all
17 $(efl_doxygen)
18 cp $(srcdir)/img/* html/
19 cp $(srcdir)/img/*.eps latex/
20 rm -rf $(PACKAGE_DOCNAME).tar*
21 mkdir -p $(PACKAGE_DOCNAME)/doc
22 cp -R html/ latex/ man/ $(PACKAGE_DOCNAME)/doc
23 tar cf $(PACKAGE_DOCNAME).tar $(PACKAGE_DOCNAME)/
24 bzip2 -9 $(PACKAGE_DOCNAME).tar
25 rm -rf $(PACKAGE_DOCNAME)/
26 mv $(PACKAGE_DOCNAME).tar.bz2 $(top_builddir)
27 @echo "Documentation Package: doc/$(PACKAGE_DOCNAME).tar.bz2"
28 @echo "Documentation HTML: doc/html"
29
30clean-local: doc-clean
31
32else
33
34doc:
35 @echo "Documentation not built. Run ./configure --help"
36
37endif
38
diff --git a/doc/extra.1.in b/doc/extra.1.in
new file mode 100644
index 0000000..e94b73e
--- /dev/null
+++ b/doc/extra.1.in
@@ -0,0 +1,50 @@
1.TH EXTRA 1 "01 01 2016 FIXME" "@PACKAGE_NAME@ @PACKAGE_VERSION@"
2
3.SH NAME
4extra \- a demo application
5
6.SH SYNOPSIS
7.B extra
8[-L] [-C] [-V] [-h]
9
10.SH DESCRIPTION
11
12extra is a demo application to show how to integrate EFL and autotools into a
13cross platform build. You should be able to generate an executable easily for all
14target supported by EFL with this extra.
15
16With no option, the program starts and display an Hello World.
17
18
19.SH OPTIONS
20
21.TP
22.B -L, --license
23Show license.
24
25.TP
26.B -C, --copyright
27Show copyright.
28
29.TP
30.B -V, --version
31Show program version.
32
33.TP
34.B -h, --help
35Print list of options with short description.
36
37
38.SH BUGS
39
40Reports are welcome. Send them at @PACKAGE_BUGREPORT@.
41
42
43.SH HOMEPAGE
44
45http://enlightenment.org
46
47
48.SH AUTHORS
49
50Andy Williams <andy@andywilliams.me> and various contributors.
diff --git a/m4/efl.m4 b/m4/efl.m4
new file mode 100644
index 0000000..098722f
--- /dev/null
+++ b/m4/efl.m4
@@ -0,0 +1,123 @@
1dnl file to manage modules in efl
2
3dnl EFL_VERSION(major, minor, micro, release)
4dnl This setup EFL version information and should be called BEFORE AC_INIT().
5dnl
6dnl release parameter is 'dev' to use from SVN or libtool -release field.
7dnl It may be empty if not dev (svn/live build) and no -release is to be used.
8dnl
9dnl Examples:
10dnl EFL_VERSION(1, 7, 99, dev)
11dnl EFL_VERSION(1, 7, 99, ver-1234)
12dnl This will define couple of m4 symbols:
13dnl v_maj = given major number (first parameter)
14dnl v_min = given minor number (second parameter)
15dnl v_mic = given micro number (third parameter)
16dnl v_rev = if release, it's 0, otherwise it's dev_version.
17dnl v_rel = if release, it's -release followed by fourth parameter,
18dnl otherwise it's empty. (mostly for libtool)
19dnl efl_version = if release, it's major.minor.micro, otherwise it's
20dnl major.minor.micro.dev_version
21dnl dev_version = development version (svn revision).
22dnl def_build_profile = dev or release based on 'dev' release parameter.
23AC_DEFUN([EFL_VERSION],
24[dnl
25m4_define([v_maj], [$1])dnl
26m4_define([v_min], [$2])dnl
27m4_define([v_mic], [$3])dnl
28m4_define([dev_version], m4_esyscmd([(git rev-list --count HEAD 2>/dev/null || echo 0) | tr -d '\n']))dnl
29m4_define([v_rev], m4_if($4, dev, [dev_version], [0]))dnl
30m4_define([v_rel], [])dnl
31m4_define([def_build_profile], m4_if($4, dev, [dev], [release]))dnl
32m4_define([efl_version], m4_if($4, dev, [v_maj.v_min.v_mic.v_rev], [v_maj.v_min.v_mic]))dnl
33m4_define([efl_version], [v_maj.v_min.v_mic])dnl
34])
35
36dnl EFL_COLOR
37dnl will check if terminal supports color and if color is wanted by user.
38dnl
39dnl Used Variables:
40dnl WANT_COLOR: if no, forces no color output.
41dnl TERM: used to check if color should be enabled.
42dnl
43dnl Defined Variables:
44dnl COLOR_YES: to be used in positive/yes conditions
45dnl COLOR_NO: to be used in negative/no conditions
46dnl COLOR_OTHER: to be used to highlight some other condition
47dnl COLOR_RESET: to reset color
48dnl want_color: yes or no
49AC_DEFUN([EFL_COLOR],
50[dnl
51case "$TERM" in
52 xterm|xterm-color|xterm-256color|Eterm|aterm|kterm|rxvt*|screen|gnome|interix)
53 want_color="${WANT_COLOR:-yes}"
54 ;;
55 *)
56 want_color="no"
57 ;;
58esac
59
60if test "${want_color}" = "yes"; then
61 if test `echo -e x` = x; then
62 echoopt=-e
63 else
64 echoopt=
65 fi
66
67 COLOR_YES=`echo $echoopt "\033@<:@1;32m"`
68 COLOR_NO=`echo $echoopt "\033@<:@1;31m"`
69 COLOR_OTHER=`echo $echoopt "\033@<:@1;36m"`
70 COLOR_RESET=`echo $echoopt "\033@<:@0m"`
71
72else
73 COLOR_YES=""
74 COLOR_NO=""
75 COLOR_OTHER=""
76 COLOR_RESET=""
77fi
78])
79
80dnl EFL_INIT()
81dnl Will AC_DEFINE() the following:
82dnl VMAJ = v_maj
83dnl VMIN = v_min
84dnl VMIC = v_mic
85dnl VREV = v_rev
86dnl Will AC_SUBST() the following:
87dnl VMAJ = v_maj
88dnl VMIN = v_min
89dnl VMIC = v_mic
90dnl EFL_LTLIBRARY_FLAGS="-no-undefined -version-info ..."
91dnl EFL_LTMODULE_FLAGS="-no-undefined -avoid-version"
92dnl Will define the following m4:
93dnl lt_cur = libtool 'current' field of libtool's -version-info
94dnl lt_rev = libtool 'revision' field of libtool's -version-info
95dnl lt_age = libtool 'age' field of libtool's -version-info
96AC_DEFUN([EFL_INIT],
97[dnl
98AC_REQUIRE([EFL_COLOR])dnl
99AC_DEFINE_UNQUOTED([VMAJ], [v_maj], [Major version])dnl
100AC_DEFINE_UNQUOTED([VMIN], [v_min], [Minor version])dnl
101AC_DEFINE_UNQUOTED([VMIC], [v_mic], [Micro version])dnl
102AC_DEFINE_UNQUOTED([VREV], [v_rev], [Revison])dnl
103VMAJ=v_maj
104VMIN=v_min
105VMIC=v_mic
106AC_SUBST([VMAJ])dnl
107AC_SUBST([VMIN])dnl
108AC_SUBST([VMIC])dnl
109dnl
110dnl TODO: warning - lt_cur:
111dnl the previous code assumed v_maj + v_min, but this will be a problem when
112dnl we bump v_maj and reset v_min. 1 + 7 == 7 + 1, so if v_maj is bumped
113dnl we multiply it by 100.
114m4_define([lt_cur], m4_if(m4_cmp(v_maj, 1), 0, m4_eval(v_maj + v_min), m4_eval(v_maj * 100 + v_min)))dnl
115m4_define([lt_rev], v_mic)dnl
116m4_define([lt_age], v_min)dnl
117dnl
118EFL_LTLIBRARY_FLAGS="-no-undefined -version-info lt_cur:lt_rev:lt_age v_rel"
119AC_SUBST(EFL_LTLIBRARY_FLAGS)dnl
120EFL_LTMODULE_FLAGS="-no-undefined -avoid-version"
121AC_SUBST([EFL_LTMODULE_FLAGS])dnl
122AC_MSG_NOTICE([Initialized AC_PACKAGE_NAME (AC_PACKAGE_VERSION) development=dev_version v_rel])
123])
diff --git a/m4/efl_attribute.m4 b/m4/efl_attribute.m4
new file mode 100644
index 0000000..78bff15
--- /dev/null
+++ b/m4/efl_attribute.m4
@@ -0,0 +1,56 @@
1dnl Copyright (C) 2011 Vincent Torri <vtorri at univ-evry dot fr>
2dnl That code is public domain and can be freely used or copied.
3
4dnl Macros for checking if the compiler supports some __attribute__ uses
5
6dnl Usage: EFL_ATTRIBUTE_UNUSED
7dnl call AC_DEFINE for __UNUSED__ if __attribute__((unused)) is available
8
9AC_DEFUN([EFL_ATTRIBUTE_UNUSED],
10[
11AC_MSG_CHECKING([for __attribute__ ((unused))])
12AC_COMPILE_IFELSE(
13 [AC_LANG_PROGRAM(
14 [[
15void foo(int x __attribute__ ((unused))) {}
16 ]],
17 [[
18 ]])],
19 [have_attribute_unused="yes"],
20 [have_attribute_unused="no"])
21AC_MSG_RESULT([${have_attribute_unused}])
22
23if test "x${have_attribute_unused}" = "xyes" ; then
24 AC_DEFINE([__UNUSED__], [__attribute__ ((unused))], [Macro declaring a function argument to be unused.])
25else
26 AC_DEFINE([__UNUSED__], [], [__attribute__ ((unused)) is not supported.])
27fi
28])
29
30dnl Usage: EFL_ATTRIBUTE_VECTOR
31dnl call AC_DEFINE for HAVE_GCC_ATTRIBUTE_VECTOR if __attribute__((vector)) is available
32
33AC_DEFUN([EFL_ATTRIBUTE_VECTOR],
34[
35AC_MSG_CHECKING([for __attribute__ ((vector))])
36AC_COMPILE_IFELSE(
37 [AC_LANG_PROGRAM(
38 [[
39typedef int v4si __attribute__ ((vector_size (16)));
40 ]],
41 [[
42if (sizeof(v4si) == 16)
43 return 0;
44else
45 return -1;
46 ]])],
47 [have_attribute_vector="yes"],
48 [have_attribute_vector="no"])
49AC_MSG_RESULT([${have_attribute_vector}])
50
51if test "x${have_attribute_vector}" = "xyes" ; then
52 AC_DEFINE([HAVE_GCC_ATTRIBUTE_VECTOR], [1], [Define to 1 if your compiler supports __attribute__ ((vector)).])
53fi
54])
55
56dnl End of efl_attribute.m4
diff --git a/m4/efl_binary.m4 b/m4/efl_binary.m4
new file mode 100644
index 0000000..91a26b2
--- /dev/null
+++ b/m4/efl_binary.m4
@@ -0,0 +1,79 @@
1dnl Copyright (C) 2010 Vincent Torri <vtorri at univ-evry dot fr>
2dnl That code is public domain and can be freely used or copied.
3
4dnl Macro that check if a binary is built or not
5
6dnl Usage: EFL_ENABLE_BIN(binary)
7dnl Call AC_SUBST(BINARY_PRG) (BINARY is the uppercase of binary, - being transformed into _)
8dnl Define have_binary (- is transformed into _)
9dnl Define conditional BUILD_BINARY (BINARY is the uppercase of binary, - being transformed into _)
10
11AC_DEFUN([EFL_ENABLE_BIN],
12[
13
14m4_pushdef([UP], m4_translit([[$1]], [-a-z], [_A-Z]))dnl
15m4_pushdef([DOWN], m4_translit([[$1]], [-A-Z], [_a-z]))dnl
16
17have_[]m4_defn([DOWN])="yes"
18
19dnl configure option
20
21AC_ARG_ENABLE([$1],
22 [AC_HELP_STRING([--disable-$1], [disable building of ]DOWN)],
23 [
24 if test "x${enableval}" = "xyes" ; then
25 have_[]m4_defn([DOWN])="yes"
26 else
27 have_[]m4_defn([DOWN])="no"
28 fi
29 ])
30
31AC_MSG_CHECKING([whether to build ]DOWN[ binary])
32AC_MSG_RESULT([$have_[]m4_defn([DOWN])])
33
34if test "x$have_[]m4_defn([DOWN])" = "xyes"; then
35 UP[]_PRG=DOWN[${EXEEXT}]
36fi
37
38AC_SUBST(UP[]_PRG)
39
40AM_CONDITIONAL(BUILD_[]UP, test "x$have_[]m4_defn([DOWN])" = "xyes")
41
42AS_IF([test "x$have_[]m4_defn([DOWN])" = "xyes"], [$2], [$3])
43
44])
45
46
47dnl Macro that check if a binary is built or not
48
49dnl Usage: EFL_WITH_BIN(package, binary, default_value)
50dnl Call AC_SUBST(_binary) (_binary is the lowercase of binary, - being transformed into _ by default, or the value set by the user)
51
52AC_DEFUN([EFL_WITH_BIN],
53[
54
55m4_pushdef([DOWN], m4_translit([[$2]], [-A-Z], [_a-z]))dnl
56m4_pushdef([UP], m4_translit([[$2]], [-a-z], [_A-Z]))dnl
57
58dnl configure option
59
60AC_ARG_WITH([$2],
61 [AC_HELP_STRING([--with-$2=PATH], [specify a specific path to ]DOWN[ @<:@default=$3@:>@])],
62 [
63 _efl_with_binary=${withval}
64 _efl_binary_define="yes"
65 ],
66 [
67 _efl_with_binary=$(pkg-config --variable=prefix $1)/bin/$3
68 _efl_binary_define="no"
69 ])
70
71DOWN=${_efl_with_binary}
72AC_MSG_NOTICE(DOWN[ set to ${_efl_with_binary}])
73
74with_binary_[]m4_defn([DOWN])=${_efl_with_binary}
75
76AM_CONDITIONAL(HAVE_[]UP, [test "x${_efl_binary_define}" = "xyes"])
77AC_SUBST(DOWN)
78
79])
diff --git a/m4/efl_compiler_flag.m4 b/m4/efl_compiler_flag.m4
new file mode 100644
index 0000000..25c285d
--- /dev/null
+++ b/m4/efl_compiler_flag.m4
@@ -0,0 +1,57 @@
1dnl Copyright (C) 2010 Vincent Torri <vtorri at univ-evry dot fr>
2dnl and Albin Tonnerre <albin dot tonnerre at gmail dot com>
3dnl That code is public domain and can be freely used or copied.
4
5dnl Macro that checks if a compiler flag is supported by the compiler.
6
7dnl Usage: EFL_COMPILER_FLAG(flag)
8dnl flag is added to CFLAGS if supported.
9
10AC_DEFUN([EFL_COMPILER_FLAG],
11[
12
13CFLAGS_save="${CFLAGS}"
14CFLAGS="${CFLAGS} $1"
15
16AC_LANG_PUSH([C])
17AC_MSG_CHECKING([whether the compiler supports $1])
18
19AC_COMPILE_IFELSE(
20 [AC_LANG_PROGRAM([[]])],
21 [have_flag="yes"],
22 [have_flag="no"])
23AC_MSG_RESULT([${have_flag}])
24
25if test "x${have_flag}" = "xno" ; then
26 CFLAGS="${CFLAGS_save}"
27fi
28AC_LANG_POP([C])
29
30])
31
32dnl Macro that checks if a linker flag is supported by the compiler.
33
34dnl Usage: EFL_LINKER_FLAG(flag)
35dnl flag is added to LDFLAGS if supported (will be passed to ld anyway).
36
37AC_DEFUN([EFL_LINKER_FLAG],
38[
39
40LDFLAGS_save="${LDFLAGS}"
41LDFLAGS="${LDFLAGS} $1"
42
43AC_LANG_PUSH([C])
44AC_MSG_CHECKING([whether the compiler supports $1])
45
46AC_LINK_IFELSE(
47 [AC_LANG_PROGRAM([[]])],
48 [have_flag="yes"],
49 [have_flag="no"])
50AC_MSG_RESULT([${have_flag}])
51
52if test "x${have_flag}" = "xno" ; then
53 LDFLAGS="${LDFLAGS_save}"
54fi
55AC_LANG_POP([C])
56
57])
diff --git a/m4/efl_doxygen.m4 b/m4/efl_doxygen.m4
new file mode 100644
index 0000000..0c1452f
--- /dev/null
+++ b/m4/efl_doxygen.m4
@@ -0,0 +1,98 @@
1dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
2dnl That code is public domain and can be freely used or copied.
3
4dnl Macro that check if doxygen is available or not.
5
6dnl EFL_CHECK_DOXYGEN([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
7dnl Test for the doxygen program
8dnl Defines efl_doxygen
9dnl Defines the automake conditionnal EFL_BUILD_DOC
10dnl
11AC_DEFUN([EFL_CHECK_DOXYGEN],
12[
13
14dnl
15dnl Disable the build of the documentation
16dnl
17AC_ARG_ENABLE([doc],
18 [AC_HELP_STRING(
19 [--disable-doc],
20 [Disable documentation build @<:@default=enabled@:>@])],
21 [
22 if test "x${enableval}" = "xyes" ; then
23 efl_enable_doc="yes"
24 else
25 efl_enable_doc="no"
26 fi
27 ],
28 [efl_enable_doc="yes"]
29)
30
31if test "x${efl_enable_doc}" = "xyes" ; then
32
33dnl
34dnl Specify the full file name, with path
35dnl
36
37 efl_doxygen="doxygen"
38
39 AC_ARG_WITH([doxygen],
40 [AC_HELP_STRING(
41 [--with-doxygen=FILE],
42 [doxygen program to use @<:@default=doxygen@:>@])],
43dnl
44dnl Check the given doxygen program.
45dnl
46 [efl_doxygen=${withval}
47 AC_CHECK_PROG([efl_have_doxygen],
48 [${efl_doxygen}],
49 [yes],
50 [no])
51 if test "x${efl_have_doxygen}" = "xno" ; then
52 echo "WARNING:"
53 echo "The doxygen program you specified:"
54 echo "$efl_doxygen"
55 echo "was not found. Please check the path and make sure "
56 echo "the program exists and is executable."
57 AC_MSG_WARN([Warning: no doxygen detected. Documentation will not be built])
58 fi
59 ],
60 [AC_CHECK_PROG([efl_have_doxygen],
61 [${efl_doxygen}],
62 [yes],
63 [no])
64 if test "x${efl_have_doxygen}" = "xno" ; then
65 echo "WARNING:"
66 echo "The doxygen program was not found in your execute"
67 echo "You may have doxygen installed somewhere not covered by your path."
68 echo ""
69 echo "If this is the case make sure you have the packages installed, AND"
70 echo "that the doxygen program is in your execute path (see your"
71 echo "shell manual page on setting the \$PATH environment variable), OR"
72 echo "alternatively, specify the program to use with --with-doxygen."
73 AC_MSG_WARN([Warning: no doxygen detected. Documentation will not be built])
74 fi
75 ]
76 )
77fi
78
79dnl
80dnl Substitution
81dnl
82AC_SUBST([efl_doxygen])
83
84if ! test "x${efl_have_doxygen}" = "xyes" ; then
85 efl_enable_doc="no"
86fi
87
88AM_CONDITIONAL(EFL_BUILD_DOC, test "x${efl_enable_doc}" = "xyes")
89
90if test "x${efl_enable_doc}" = "xyes" ; then
91 ifelse([$1], , :, [$1])
92else
93 ifelse([$2], , :, [$2])
94fi
95
96])
97
98dnl End of doxygen.m4
diff --git a/m4/efl_path_max.m4 b/m4/efl_path_max.m4
new file mode 100644
index 0000000..f57bfd2
--- /dev/null
+++ b/m4/efl_path_max.m4
@@ -0,0 +1,36 @@
1dnl Check for PATH_MAX in limits.h, and define a default value if not found
2dnl This is a workaround for systems not providing PATH_MAX, like GNU/Hurd
3
4dnl EFL_CHECK_PATH_MAX([DEFAULT_VALUE_IF_NOT_FOUND])
5dnl
6dnl If PATH_MAX is not defined in <limits.h>, defines it
7dnl to DEFAULT_VALUE_IF_NOT_FOUND if it exists, or fallback
8dnl to using 4096
9
10AC_DEFUN([EFL_CHECK_PATH_MAX],
11[
12
13default_max=m4_default([$1], "4096")
14AC_LANG_PUSH([C])
15
16AC_MSG_CHECKING([for PATH_MAX in limits.h])
17AC_COMPILE_IFELSE(
18 [AC_LANG_PROGRAM(
19 [[
20#include <limits.h>
21 ]],
22 [[
23int i = PATH_MAX;
24 ]])],
25 [AC_MSG_RESULT([yes])],
26 [
27 AC_DEFINE_UNQUOTED([PATH_MAX],
28 [${default_max}],
29 [default value since PATH_MAX is not defined])
30 AC_MSG_RESULT([no: using ${default_max}])
31 ])
32
33AC_LANG_POP([C])
34
35])
36dnl end of efl_path_max.m4
diff --git a/m4/efl_tests.m4 b/m4/efl_tests.m4
new file mode 100644
index 0000000..2b6106c
--- /dev/null
+++ b/m4/efl_tests.m4
@@ -0,0 +1,65 @@
1dnl Copyright (C) 2013 Cedric BAIL <cedric.bail at free dot fr>
2dnl That code is public domain and can be freely used or copied.
3
4dnl Macro for checking availability of tests and coverage infra structure
5
6dnl Usage: EFL_TESTS(profile)
7dnl Valid profile are auto, tests, coverage, no
8dnl Call PKG_CHECK_MODULES, AC_CHECK_PROG, define CHECK_CFLAGS/CHECK_LIBS and modify CFLAGS/LIBS
9dnl It define EFL_HAVE_TESTS/EFL_HAVE_LCOV for use in Makefile.am
10dnl It set have_test and have_coverage to yes/no depending if found
11
12AC_DEFUN([EFL_TESTS],
13[
14build_tests=$1
15
16case "${build_tests}" in
17 auto)
18 check_tests="auto"
19 check_coverage="auto"
20 ;;
21 tests)
22 check_tests="yes"
23 check_coverage="auto"
24 ;;
25 coverage)
26 check_tests="yes"
27 check_coverage="yes"
28 ;;
29 no)
30 check_tests="no"
31 check_coverage="no"
32 ;;
33 *)
34 AC_MSG_ERROR([Unknow tests profile])
35esac
36
37have_tests="no"
38if test "x${check_tests}" = "xyes" -o "x${check_tests}" = "xauto"; then
39 PKG_CHECK_MODULES([CHECK], [check >= 0.9.5], [have_tests="yes"], [have_tests="no"])
40 if test "${check_tests}" = "xyes" -a "x${have_tests}" = "xno"; then
41 AC_MSG_ERROR([Impossible to find check package to build tests])
42 fi
43fi
44
45if test "x${have_tests}" = "xyes"; then
46 if test "x${check_coverage}" = "xyes" -o "x${check_coverage}" = "xauto"; then
47 AC_CHECK_PROG([have_lcov], [lcov], [yes], [no])
48 if test "x${have_lcov}" = "xyes" ; then
49 CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage"
50 LIBS="${LIBS} -lgcov"
51 fi
52 if test "x${have_lcov}" = "xno" -a "x${check_coverage}" = "xyes"; then
53 AC_MSG_ERROR([Impossible to find lcov package to build with coverage support])
54 fi
55 else
56 have_coverage="no"
57 fi
58else
59 have_coverage="no"
60fi
61
62AM_CONDITIONAL([EFL_HAVE_TESTS], [test "x${have_tests}" = "xyes"])
63AM_CONDITIONAL([EFL_HAVE_LCOV], [test "x${have_lcov}" = "xyes"])
64
65])
diff --git a/packaging/Makefile.am b/packaging/Makefile.am
new file mode 100644
index 0000000..47eb174
--- /dev/null
+++ b/packaging/Makefile.am
@@ -0,0 +1,4 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3SUBDIRS = slackware pkgbuild
4
diff --git a/packaging/pkgbuild/Makefile.am b/packaging/pkgbuild/Makefile.am
new file mode 100644
index 0000000..c1675ad
--- /dev/null
+++ b/packaging/pkgbuild/Makefile.am
@@ -0,0 +1,3 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3EXTRA_DIST = PKGBUILD
diff --git a/packaging/pkgbuild/PKGBUILD b/packaging/pkgbuild/PKGBUILD
new file mode 100644
index 0000000..9587bc1
--- /dev/null
+++ b/packaging/pkgbuild/PKGBUILD
@@ -0,0 +1,60 @@
1# Maintainer: Enlightenment Developers <enlightenment-devel@enlightenment.org>
2pkgname=('extra-git' 'extra_doc-git')
3pkgver=1.8.99.8967.a1cfce6
4pkgrel=1
5pkgdesc="Enlightenment toolkit extra - GIT development snapshot"
6arch=('i686' 'x86_64' 'arm')
7url="http://http://extra.enlightenment.org/app/"
8license=('WTFPL')
9makedepends=('doxygen' 'imagemagick' 'git')
10depends=('elementary-git')
11optdepends=('emotion_generic_players' 'evas_generic_loaders')
12options=('!libtool' 'debug')
13provides=('extra')
14
15pkgver() {
16 cd "../.."
17
18 for _i in v_maj v_min v_mic; do
19 local v_ver=$v_ver.$(grep -m 1 $_i configure.ac | sed 's/m4//' | grep -o "[[:digit:]]*")
20 done
21
22 v_ver=$(awk -F , -v v_ver=${v_ver#.} '/^AC_INIT/ {gsub(/v_ver/, v_ver); gsub(/[\[\] -]/, ""); print $2}' configure.ac)
23
24 printf "$v_ver.$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
25}
26
27build() {
28 cd "../.."
29 export CFLAGS="$CFLAGS -fvisibility=hidden -fomit-frame-pointer"
30 [[ -e Makefile ]] && make clean distclean
31 ./configure --prefix=/usr \
32 --disable-static
33 make
34 make doc
35}
36
37package_extra-git() {
38 cd "../.."
39 make -j1 DESTDIR="$pkgdir/" install
40 install -Dm644 README "$pkgdir/usr/share/$pkgname/README"
41 install -Dm644 NEWS "$pkgdir/usr/share/$pkgname/NEWS"
42 install -Dm644 ChangeLog "$pkgdir/usr/share/$pkgname/ChangeLog"
43 install -Dm644 AUTHORS "$pkgdir/usr/share/$pkgname/AUTHORS"
44 install -Dm644 COMPLIANCE "$pkgdir/usr/share/$pkgname/COMPLIANCE"
45 install -Dm644 COPYING.images "$pkgdir/usr/share/licenses/$pkgname/COPYING.images"
46 sed -n '1,/details./p' COPYING > "$pkgdir/usr/share/licenses/$pkgname/COPYING"
47 ln -s "../licenses/$pkgname/COPYING" "$pkgdir/usr/share/$pkgname/COPYING"
48 ln -s "../licenses/$pkgname/COPYING.images" "$pkgdir/usr/share/$pkgname/COPYING.images"
49}
50
51package_extra_doc-git() {
52 pkgdesc="Documentation for extra"
53 arch=('any')
54 unset depends optdepends
55
56 cd "../.."
57 mkdir -p "$pkgdir/usr/share/doc/$pkgname"
58 cp -a doc/html "$pkgdir/usr/share/doc/$pkgname/html"
59 cp -a doc/latex "$pkgdir/usr/share/doc/$pkgname/latex"
60}
diff --git a/packaging/slackware/Makefile.am b/packaging/slackware/Makefile.am
new file mode 100644
index 0000000..028e0cc
--- /dev/null
+++ b/packaging/slackware/Makefile.am
@@ -0,0 +1,4 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3EXTRA_DIST = doinst.sh extra.SlackBuild slack-desc slack-required
4
diff --git a/packaging/slackware/doinst.sh b/packaging/slackware/doinst.sh
new file mode 100644
index 0000000..6dfbe18
--- /dev/null
+++ b/packaging/slackware/doinst.sh
@@ -0,0 +1 @@
# Stuff done after package installation
diff --git a/packaging/slackware/extra.SlackBuild b/packaging/slackware/extra.SlackBuild
new file mode 100755
index 0000000..d027c61
--- /dev/null
+++ b/packaging/slackware/extra.SlackBuild
@@ -0,0 +1,106 @@
1#!/bin/bash
2#
3# Begin extra.SlackBuild
4#
5# Copyright (C) 2012-2013 Jerome Pinot <ngc891@gmail.com>
6# All rights reserved.
7#
8# Redistribution and use of this script, with or without modification, is
9# permitted provided that the following conditions are met:
10#
11# 1. Redistributions of this script must retain the above copyright
12# notice, this list of conditions and the following disclaimer.
13#
14# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
15# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
17# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
20# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
25NAME=extra
26BUILD=${BUILD:-1jp}
27CWD=$(pwd)
28TMP=${TMP:-/tmp}
29PKG=${TMP}/package-${NAME}
30
31# First check if we are in the right folder
32if [ -f ./${NAME}.SlackBuild ]; then
33 echo 'Found SlackBuild'
34else
35 echo 'Error: You must run this script from the packaging/slackware sub-folder!'
36 exit 1
37fi
38
39# Get the version number from configure.ac
40if [ -f ../../configure.ac ];then
41 VERSION=`grep "AC_INIT" ../../configure.ac | cut -d' ' -f2 | sed -e 's/\[//' -e 's/\],//'`
42else
43 echo "Error: can't find configure.ac!"
44 exit 2
45fi
46
47# if ${ARCH} is unset, we have to guess it with uname
48if [ -z "${ARCH}" ]; then
49 case "$(uname -m)" in
50 i?86) export ARCH=i486 ;;
51 arm*) export ARCH=arm ;;
52 *) export ARCH=$(uname -m) ;;
53 esac
54fi
55
56# Set generic flags for gcc
57SCFLAGS='-O2'
58if [ "${ARCH}" = "i486" ]; then
59 SCFLAGS="${SCFLAGS} -march=i486 -mtune=i686"
60 LIBDIR="/usr/lib"
61elif [ "${ARCH}" = "x86_64" ]; then
62 SCFLAGS="${SCFLAGS} -fPIC"
63 LIBDIR="/usr/lib64"
64elif [ "${ARCH}" = "arm" ]; then
65 SCFLAGS="${SCFLAGS} -march=armv4 -mtune=xscale"
66 LIBDIR="/usr/lib"
67fi
68
69# Creating directories
70if [ ! -d ${TMP} ]; then
71 mkdir -p ${TMP}
72fi
73rm -rf ${PKG}
74mkdir -p ${PKG}
75
76# Configuring
77cd ../..
78CFLAGS="${SCFLAGS}" \
79 ./configure \
80 --prefix=/usr \
81 --libdir=${LIBDIR} \
82 --mandir=/usr/man \
83 --docdir=/usr/doc/${NAME}-${VERSION}
84
85# Building
86make
87
88# Installing
89make DESTDIR=${PKG} install
90
91# Cleaning
92cd ${PKG}
93gzip -9 usr/man/man1/${NAME}.1
94
95find ${PKG} | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
96find ${PKG} | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
97
98# Building the package
99mkdir install
100install -m644 ${CWD}/doinst.sh install/
101install -m644 ${CWD}/slack-desc install/
102install -m644 ${CWD}/slack-required install/
103makepkg -l y -c n ${CWD}/${NAME}-${VERSION}-${ARCH}-${BUILD}.txz
104rm -rf ${PKG}
105
106# End extra.SlackBuild
diff --git a/packaging/slackware/slack-desc b/packaging/slackware/slack-desc
new file mode 100644
index 0000000..f877468
--- /dev/null
+++ b/packaging/slackware/slack-desc
@@ -0,0 +1,19 @@
1# HOW TO EDIT THIS FILE:
2# The "handy ruler" below makes it easier to edit a package description. Line
3# up the first '|' above the ':' following the base package name, and the '|'
4# on the right side marks the last column you can put a character in. You must
5# make exactly 11 lines for the formatting to be correct. It's also
6# customary to leave one space after the ':'.
7
8 |-----handy-ruler------------------------------------------------------|
9extra: extra
10extra:
11extra: extra is an example of application written using the Enlightenment
12extra: Foundation Libraries.
13extra:
14extra: It requires elementary.
15extra:
16extra: extra was written by Andy Williams <andy@andywilliams.me>
17extra: website: <http://http://extra.enlightenment.org/app//>
18extra:
19extra:
diff --git a/packaging/slackware/slack-required b/packaging/slackware/slack-required
new file mode 100644
index 0000000..29e9f10
--- /dev/null
+++ b/packaging/slackware/slack-required
@@ -0,0 +1,5 @@
1eina >= 1.8.0
2evas >= 1.8.0
3ecore >= 1.8.0
4edje >= 1.8.0
5elementary >= 1.8.0
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 0000000..4dd2a0b
--- /dev/null
+++ b/po/Makevars
@@ -0,0 +1,41 @@
1# Makefile variables for PO directory in any package using GNU gettext.
2
3# Usually the message domain is the same as the package name.
4DOMAIN = $(PACKAGE)
5
6# These two variables depend on the location of this directory.
7subdir = po
8top_builddir = ..
9
10# These options get passed to xgettext.
11XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --from-code=utf-8
12
13# This is the copyright holder that gets inserted into the header of the
14# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
15# package. (Note that the msgstr strings, extracted from the package's
16# sources, belong to the copyright holder of the package.) Translators are
17# expected to transfer the copyright for their translations to this person
18# or entity, or to disclaim their copyright. The empty string stands for
19# the public domain; in this case the translators are expected to disclaim
20# their copyright.
21COPYRIGHT_HOLDER =
22
23# This is the email address or URL to which the translators shall report
24# bugs in the untranslated strings:
25# - Strings which are not entire sentences, see the maintainer guidelines
26# in the GNU gettext documentation, section 'Preparing Strings'.
27# - Strings which use unclear terms or require additional context to be
28# understood.
29# - Strings which make invalid assumptions about notation of date, time or
30# money.
31# - Pluralisation problems.
32# - Incorrect English spelling.
33# - Incorrect formatting.
34# It can be your email address, or a mailing list address where translators
35# can write to without being subscribed, or the URL of a web page through
36# which the translators can contact you.
37MSGID_BUGS_ADDRESS =
38
39# This is the list of locale categories, beyond LC_MESSAGES, for which the
40# message catalogs shall be used. It is usually empty.
41EXTRA_LOCALE_CATEGORIES =
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 0000000..962fdf5
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1,2 @@
1src/bin/extra_main.c
2src/bin/extra_private.h
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..15871c9
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,4 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3SUBDIRS = lib bin tests
4
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
new file mode 100644
index 0000000..3a16631
--- /dev/null
+++ b/src/bin/Makefile.am
@@ -0,0 +1,19 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3bin_PROGRAMS = extra
4
5AM_CPPFLAGS = -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
6-I$(top_builddir)/src/bin/ \
7-I$(top_srcdir)/src/bin/ \
8-I$(top_builddir)/src/lib/ \
9-I$(top_srcdir)/src/lib/ \
10@EFL_CFLAGS@
11
12extra_SOURCES = extra_main.c
13extra_LDADD = @EFL_LIBS@ $(top_builddir)/src/lib/libextra.la
14
15localedir = $(datadir)/locale
16DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
17
18EXTRA_DIST = extra_private.h
19
diff --git a/src/bin/extra_main.c b/src/bin/extra_main.c
new file mode 100644
index 0000000..73e33ea
--- /dev/null
+++ b/src/bin/extra_main.c
@@ -0,0 +1,118 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5/* NOTE: Respecting header order is important for portability.
6 * Always put system first, then EFL, then your public header,
7 * and finally your private one. */
8
9#include <Ecore_Getopt.h>
10#include <Elementary.h>
11
12#include "gettext.h"
13
14#include "extra.h"
15
16#include "extra_private.h"
17
18#define COPYRIGHT "Copyright © 2016 Andy Williams <andy@andywilliams.me> and various contributors (see AUTHORS)."
19
20static void
21_extra_win_del(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
22{
23 elm_exit();
24}
25
26static Evas_Object *
27extra_win_setup(void)
28{
29 Evas_Object *win;
30 Evas_Object *label;
31
32 win = elm_win_util_standard_add("main", "Extra!");
33 if (!win) return NULL;
34
35 elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
36 evas_object_smart_callback_add(win, "delete,request", _extra_win_del, NULL);
37
38 label = elm_label_add(win);
39 elm_object_text_set(label, "Available Themes:");
40 evas_object_size_hint_weight_set(label, 0.0, EVAS_HINT_EXPAND);
41 evas_object_size_hint_align_set(label, 0.0, EVAS_HINT_FILL);
42 evas_object_show(label);
43
44 elm_win_resize_object_add(win, label);
45
46 evas_object_show(win);
47
48 return win;
49}
50
51static const Ecore_Getopt optdesc = {
52 "extra",
53 "%prog [options]",
54 PACKAGE_VERSION,
55 COPYRIGHT,
56 "3 clause BSD license",
57 "An Enlightenment theme and plugin browser",
58 0,
59 {
60 ECORE_GETOPT_LICENSE('L', "license"),
61 ECORE_GETOPT_COPYRIGHT('C', "copyright"),
62 ECORE_GETOPT_VERSION('V', "version"),
63 ECORE_GETOPT_HELP('h', "help"),
64 ECORE_GETOPT_SENTINEL
65 }
66};
67
68EAPI_MAIN int
69elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
70{
71 Evas_Object *win;
72 int args;
73 Eina_Bool quit_option = EINA_FALSE;
74
75 Ecore_Getopt_Value values[] = {
76 ECORE_GETOPT_VALUE_BOOL(quit_option),
77 ECORE_GETOPT_VALUE_BOOL(quit_option),
78 ECORE_GETOPT_VALUE_BOOL(quit_option),
79 ECORE_GETOPT_VALUE_BOOL(quit_option),
80 ECORE_GETOPT_VALUE_NONE
81 };
82
83#if ENABLE_NLS
84 setlocale(LC_ALL, "");
85 bindtextdomain(PACKAGE, LOCALEDIR);
86 bind_textdomain_codeset(PACKAGE, "UTF-8");
87 textdomain(PACKAGE);
88#endif
89
90 extra_init();
91
92 args = ecore_getopt_parse(&optdesc, values, argc, argv);
93 if (args < 0)
94 {
95 EINA_LOG_CRIT("Could not parse arguments.");
96 goto end;
97 }
98 else if (quit_option)
99 {
100 goto end;
101 }
102
103 elm_app_info_set(elm_main, "extra", "images/extra.png");
104
105 if (!(win = extra_win_setup()))
106 goto end;
107
108 extra_library_call();
109
110 elm_run();
111
112 end:
113 extra_shutdown();
114 elm_shutdown();
115
116 return 0;
117}
118ELM_MAIN()
diff --git a/src/bin/extra_private.h b/src/bin/extra_private.h
new file mode 100644
index 0000000..6dfe45d
--- /dev/null
+++ b/src/bin/extra_private.h
@@ -0,0 +1,6 @@
1#ifndef EXTRA_PRIVATE_H_
2# define EXTRA_PRIVATE_H_
3
4// FIXME: put some private stuff related to your binary
5
6#endif
diff --git a/src/bin/gettext.h b/src/bin/gettext.h
new file mode 100644
index 0000000..e76b592
--- /dev/null
+++ b/src/bin/gettext.h
@@ -0,0 +1,280 @@
1/* Convenience header for conditional use of GNU <libintl.h>.
2 Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009 Free Software Foundation, Inc.
3
4 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published
6 by the Free Software Foundation; either version 3, or (at your option)
7 any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU General Public
15 License along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17 USA. */
18
19#ifndef _LIBGETTEXT_H
20#define _LIBGETTEXT_H 1
21
22/* NLS can be disabled through the configure --disable-nls option. */
23#if ENABLE_NLS
24
25/* Get declarations of GNU message catalog functions. */
26# include <libintl.h>
27
28/* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by
29 the gettext() and ngettext() macros. This is an alternative to calling
30 textdomain(), and is useful for libraries. */
31# ifdef DEFAULT_TEXT_DOMAIN
32# undef gettext
33# define gettext(Msgid) \
34 dgettext (DEFAULT_TEXT_DOMAIN, Msgid)
35# undef ngettext
36# define ngettext(Msgid1, Msgid2, N) \
37 dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N)
38# endif
39
40#else
41
42/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
43 chokes if dcgettext is defined as a macro. So include it now, to make
44 later inclusions of <locale.h> a NOP. We don't include <libintl.h>
45 as well because people using "gettext.h" will not include <libintl.h>,
46 and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
47 is OK. */
48#if defined(__sun)
49# include <locale.h>
50#endif
51
52/* Many header files from the libstdc++ coming with g++ 3.3 or newer include
53 <libintl.h>, which chokes if dcgettext is defined as a macro. So include
54 it now, to make later inclusions of <libintl.h> a NOP. */
55#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3)
56# include <cstdlib>
57# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H
58# include <libintl.h>
59# endif
60#endif
61
62/* Disabled NLS.
63 The casts to 'const char *' serve the purpose of producing warnings
64 for invalid uses of the value returned from these functions.
65 On pre-ANSI systems without 'const', the config.h file is supposed to
66 contain "#define const". */
67# undef gettext
68# define gettext(Msgid) ((const char *) (Msgid))
69# undef dgettext
70# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid))
71# undef dcgettext
72# define dcgettext(Domainname, Msgid, Category) \
73 ((void) (Category), dgettext (Domainname, Msgid))
74# undef ngettext
75# define ngettext(Msgid1, Msgid2, N) \
76 ((N) == 1 \
77 ? ((void) (Msgid2), (const char *) (Msgid1)) \
78 : ((void) (Msgid1), (const char *) (Msgid2)))
79# undef dngettext
80# define dngettext(Domainname, Msgid1, Msgid2, N) \
81 ((void) (Domainname), ngettext (Msgid1, Msgid2, N))
82# undef dcngettext
83# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
84 ((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N))
85# undef textdomain
86# define textdomain(Domainname) ((const char *) (Domainname))
87# undef bindtextdomain
88# define bindtextdomain(Domainname, Dirname) \
89 ((void) (Domainname), (const char *) (Dirname))
90# undef bind_textdomain_codeset
91# define bind_textdomain_codeset(Domainname, Codeset) \
92 ((void) (Domainname), (const char *) (Codeset))
93
94#endif
95
96/* A pseudo function call that serves as a marker for the automated
97 extraction of messages, but does not call gettext(). The run-time
98 translation is done at a different place in the code.
99 The argument, String, should be a literal string. Concatenated strings
100 and other string expressions won't work.
101 The macro's expansion is not parenthesized, so that it is suitable as
102 initializer for static 'char[]' or 'const char[]' variables. */
103#define gettext_noop(String) String
104
105/* The separator between msgctxt and msgid in a .mo file. */
106#define GETTEXT_CONTEXT_GLUE "\004"
107
108/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a
109 MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be
110 short and rarely need to change.
111 The letter 'p' stands for 'particular' or 'special'. */
112#ifdef DEFAULT_TEXT_DOMAIN
113# define pgettext(Msgctxt, Msgid) \
114 pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
115#else
116# define pgettext(Msgctxt, Msgid) \
117 pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
118#endif
119#define dpgettext(Domainname, Msgctxt, Msgid) \
120 pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
121#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \
122 pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category)
123#ifdef DEFAULT_TEXT_DOMAIN
124# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
125 npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
126#else
127# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
128 npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
129#endif
130#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
131 npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
132#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \
133 npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category)
134
135#ifdef __GNUC__
136__inline
137#else
138#ifdef __cplusplus
139inline
140#endif
141#endif
142static const char *
143pgettext_aux (const char *domain,
144 const char *msg_ctxt_id, const char *msgid,
145 int category)
146{
147 const char *translation = dcgettext (domain, msg_ctxt_id, category);
148 if (translation == msg_ctxt_id)
149 return msgid;
150 else
151 return translation;
152}
153
154#ifdef __GNUC__
155__inline
156#else
157#ifdef __cplusplus
158inline
159#endif
160#endif
161static const char *
162npgettext_aux (const char *domain,
163 const char *msg_ctxt_id, const char *msgid,
164 const char *msgid_plural, unsigned long int n,
165 int category)
166{
167 const char *translation =
168 dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
169 if (translation == msg_ctxt_id || translation == msgid_plural)
170 return (n == 1 ? msgid : msgid_plural);
171 else
172 return translation;
173}
174
175/* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID
176 can be arbitrary expressions. But for string literals these macros are
177 less efficient than those above. */
178
179#include <string.h>
180
181#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \
182 (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \
183 /* || __STDC_VERSION__ >= 199901L */ )
184
185#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
186#include <stdlib.h>
187#endif
188
189#define pgettext_expr(Msgctxt, Msgid) \
190 dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES)
191#define dpgettext_expr(Domainname, Msgctxt, Msgid) \
192 dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES)
193
194#ifdef __GNUC__
195__inline
196#else
197#ifdef __cplusplus
198inline
199#endif
200#endif
201static const char *
202dcpgettext_expr (const char *domain,
203 const char *msgctxt, const char *msgid,
204 int category)
205{
206 size_t msgctxt_len = strlen (msgctxt) + 1;
207 size_t msgid_len = strlen (msgid) + 1;
208 const char *translation;
209#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
210 char msg_ctxt_id[msgctxt_len + msgid_len];
211#else
212 char buf[1024];
213 char *msg_ctxt_id =
214 (msgctxt_len + msgid_len <= sizeof (buf)
215 ? buf
216 : (char *) malloc (msgctxt_len + msgid_len));
217 if (msg_ctxt_id != NULL)
218#endif
219 {
220 memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
221 msg_ctxt_id[msgctxt_len - 1] = '\004';
222 memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
223 translation = dcgettext (domain, msg_ctxt_id, category);
224#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
225 if (msg_ctxt_id != buf)
226 free (msg_ctxt_id);
227#endif
228 if (translation != msg_ctxt_id)
229 return translation;
230 }
231 return msgid;
232}
233
234#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \
235 dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
236#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
237 dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
238
239#ifdef __GNUC__
240__inline
241#else
242#ifdef __cplusplus
243inline
244#endif
245#endif
246static const char *
247dcnpgettext_expr (const char *domain,
248 const char *msgctxt, const char *msgid,
249 const char *msgid_plural, unsigned long int n,
250 int category)
251{
252 size_t msgctxt_len = strlen (msgctxt) + 1;
253 size_t msgid_len = strlen (msgid) + 1;
254 const char *translation;
255#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
256 char msg_ctxt_id[msgctxt_len + msgid_len];
257#else
258 char buf[1024];
259 char *msg_ctxt_id =
260 (msgctxt_len + msgid_len <= sizeof (buf)
261 ? buf
262 : (char *) malloc (msgctxt_len + msgid_len));
263 if (msg_ctxt_id != NULL)
264#endif
265 {
266 memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
267 msg_ctxt_id[msgctxt_len - 1] = '\004';
268 memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
269 translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
270#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
271 if (msg_ctxt_id != buf)
272 free (msg_ctxt_id);
273#endif
274 if (!(translation == msg_ctxt_id || translation == msgid_plural))
275 return translation;
276 }
277 return (n == 1 ? msgid : msgid_plural);
278}
279
280#endif /* _LIBGETTEXT_H */
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
new file mode 100644
index 0000000..13d41b2
--- /dev/null
+++ b/src/lib/Makefile.am
@@ -0,0 +1,18 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3AM_CPPFLAGS = \
4-I$(top_srcdir)/src/lib \
5-I$(top_builddir)/src/lib \
6-DPACKAGE_LIB_DIR=\"$(libdir)\" \
7-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
8@EFL_CFLAGS@ \
9-DEFL_EXTRA_BUILD
10
11lib_LTLIBRARIES = libextra.la
12
13includes_HEADERS = extra.h
14includesdir = $(includedir)/extra-@VMAJ@
15
16libextra_la_SOURCES = extra.c
17libextra_la_LIBADD = @EFL_LIBS@ -lm
18libextra_la_LDFLAGS = -no-undefined @EFL_LTLIBRARY_FLAGS@
diff --git a/src/lib/extra.c b/src/lib/extra.c
new file mode 100644
index 0000000..f6afd2c
--- /dev/null
+++ b/src/lib/extra.c
@@ -0,0 +1,92 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include "extra.h"
6
7#include "extra_private.h"
8
9static int _extra_init = 0;
10int _extra_lib_log_dom = -1;
11
12EAPI int
13extra_init(void)
14{
15 _extra_init++;
16 if (_extra_init > 1) return _extra_init;
17
18 eina_init();
19
20 _extra_lib_log_dom = eina_log_domain_register("extra", EINA_COLOR_CYAN);
21 if (_extra_lib_log_dom < 0)
22 {
23 EINA_LOG_ERR("extra can not create its log domain.");
24 goto shutdown_eina;
25 }
26
27 // Put here your initialization logic of your library
28
29 eina_log_timing(_extra_lib_log_dom, EINA_LOG_STATE_STOP, EINA_LOG_STATE_INIT);
30
31 return _extra_init;
32
33 shutdown_eina:
34 eina_shutdown();
35 _extra_init--;
36
37 return _extra_init;
38}
39
40EAPI int
41extra_shutdown(void)
42{
43 _extra_init--;
44 if (_extra_init != 0) return _extra_init;
45
46 eina_log_timing(_extra_lib_log_dom,
47 EINA_LOG_STATE_START,
48 EINA_LOG_STATE_SHUTDOWN);
49
50 // Put here your shutdown logic
51
52 eina_log_domain_unregister(_extra_lib_log_dom);
53 _extra_lib_log_dom = -1;
54
55 eina_shutdown();
56
57 return _extra_init;
58}
59
60static Eina_Bool
61_url_data_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event_info)
62{
63 Ecore_Con_Event_Url_Data *url_data = event_info;
64 int i;
65
66 for (i = 0; i < url_data->size; i++)
67 printf("%c", url_data->data[i]);
68
69 return EINA_TRUE;
70}
71
72static Eina_Bool
73_url_complete_cb(void *data, int type EINA_UNUSED, void *event_info EINA_UNUSED)
74{
75 Ecore_Con_Url *url = data;
76
77 ecore_con_url_free(url);
78 return EINA_TRUE;
79}
80
81EAPI void
82extra_library_call(void)
83{
84 Ecore_Con_Url *url;
85
86 url = ecore_con_url_custom_new("http://ajwilliams.pythonanywhere.com/v1/themes/", "GET");
87
88 ecore_event_handler_add(ECORE_CON_EVENT_URL_DATA, _url_data_cb, NULL);
89 ecore_event_handler_add(ECORE_CON_EVENT_URL_COMPLETE, _url_complete_cb, url);
90
91 ecore_con_url_get(url);
92}
diff --git a/src/lib/extra.h b/src/lib/extra.h
new file mode 100644
index 0000000..8daf622
--- /dev/null
+++ b/src/lib/extra.h
@@ -0,0 +1,111 @@
1#ifndef EXTRA_H_
2# define EXTRA_H_
3
4#include <Elementary.h>
5
6#ifdef EAPI
7# undef EAPI
8#endif
9
10#ifdef _WIN32
11# ifdef EFL_EXTRA_BUILD
12# ifdef DLL_EXPORT
13# define EAPI __declspec(dllexport)
14# else
15# define EAPI
16# endif /* ! DLL_EXPORT */
17# else
18# define EAPI __declspec(dllimport)
19# endif /* ! EFL_EXTRA_BUILD */
20#else
21# ifdef __GNUC__
22# if __GNUC__ >= 4
23# define EAPI __attribute__ ((visibility("default")))
24# else
25# define EAPI
26# endif
27# else
28# define EAPI
29# endif
30#endif /* ! _WIN32 */
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36/**
37 * @file
38 * @brief These routines are used for extra library interaction.
39 */
40
41/**
42 * @brief Init / shutdown functions.
43 * @defgroup Init Init / Shutdown
44 *
45 * @{
46 *
47 * Functions of obligatory usage, handling proper initialization
48 * and shutdown routines.
49 *
50 * Before the usage of any other function, extra should be properly
51 * initialized with @ref extra_init() and the last call to extra's
52 * functions should be @ref extra_shutdown(), so everything will
53 * be correctly freed.
54 *
55 * extra logs everything with Eina Log, using the "extra" log domain.
56 *
57 */
58
59/**
60 * Initialize extra.
61 *
62 * Initializes extra, its dependencies and modules. Should be the first
63 * function of extra to be called.
64 *
65 * @return The init counter value.
66 *
67 * @see extra_shutdown().
68 *
69 * @ingroup Init
70 */
71EAPI int extra_init(void);
72
73/**
74 * Shutdown extra
75 *
76 * Shutdown extra. If init count reaches 0, all the internal structures will
77 * be freed. Any extra library call after this point will leads to an error.
78 *
79 * @return extra's init counter value.
80 *
81 * @see extra_init().
82 *
83 * @ingroup Init
84 */
85EAPI int extra_shutdown(void);
86
87/**
88 * @}
89 */
90
91/**
92 * @brief Main group API that wont do anything
93 * @defgroup Main Main
94 *
95 * @{
96 *
97 * @brief A function that doesn't do any good nor any bad
98 *
99 * @ingroup Main
100 */
101EAPI void extra_library_call(void);
102
103/**
104 * @}
105 */
106
107#ifdef __cplusplus
108}
109#endif
110
111#endif /* EXTRA_H_ */
diff --git a/src/lib/extra_private.h b/src/lib/extra_private.h
new file mode 100644
index 0000000..51b980b
--- /dev/null
+++ b/src/lib/extra_private.h
@@ -0,0 +1,27 @@
1#ifndef EXTRA_PRIVATE_H
2# define EXTRA_PRIVATE_H
3
4extern int _extra_lib_log_dom;
5
6#ifdef ERR
7# undef ERR
8#endif
9#define ERR(...) EINA_LOG_DOM_ERR(_extra_lib_log_dom, __VA_ARGS__)
10#ifdef INF
11# undef INF
12#endif
13#define INF(...) EINA_LOG_DOM_INFO(_extra_lib_log_dom, __VA_ARGS__)
14#ifdef WRN
15# undef WRN
16#endif
17#define WRN(...) EINA_LOG_DOM_WARN(_extra_lib_log_dom, __VA_ARGS__)
18#ifdef CRIT
19# undef CRIT
20#endif
21#define CRIT(...) EINA_LOG_DOM_CRIT(_extra_lib_log_dom, __VA_ARGS__)
22#ifdef DBG
23# undef DBG
24#endif
25#define DBG(...) EINA_LOG_DOM_DBG(_extra_lib_log_dom, __VA_ARGS__)
26
27#endif
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
new file mode 100644
index 0000000..c4e5e98
--- /dev/null
+++ b/src/tests/Makefile.am
@@ -0,0 +1,17 @@
1
2if EFL_HAVE_TESTS
3
4check_PROGRAMS = extra_tests
5
6extra_tests_SOURCES = test_extra.c
7extra_tests_CPPFLAGS = -I$(top_builddir)/src/lib/ \
8-DPACKAGE_TESTS_DIR=\"$(top_srcdir)/src/tests/\" \
9-DPACKAGE_BUILD_DIR=\"`pwd`/$(top_builddir)/src/tests/\" \
10@EFL_CFLAGS@ \
11@CHECK_CFLAGS@
12extra_tests_LDADD = @CHECK_LIBS@ $(top_builddir)/src/lib/libextra.la
13extra_tests_DEPENDENCIES = $(top_builddir)/src/lib/libextra.la
14
15endif
16
17EXTRA_DIST = test_extra.c
diff --git a/src/tests/test_extra.c b/src/tests/test_extra.c
new file mode 100644
index 0000000..7da20b3
--- /dev/null
+++ b/src/tests/test_extra.c
@@ -0,0 +1,124 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include <Ecore_Getopt.h>
6#include <check.h>
7
8#include "extra.h"
9
10#define COPYRIGHT "Copyright © 2016 Andy Williams <andy@andywilliams.me> and various contributors (see AUTHORS)."
11
12static void extra_test_basic(TCase *tc);
13
14static const struct {
15 const char *name;
16 void (*build)(TCase *tc);
17} tests[] = {
18 { "basic", extra_test_basic }
19};
20
21START_TEST(extra_initialization)
22{
23 fail_if(extra_init() != 1);
24
25 extra_library_call();
26
27 fail_if(extra_shutdown() != 0);
28}
29END_TEST
30
31static void
32extra_test_basic(TCase *tc)
33{
34 tcase_add_test(tc, extra_initialization);
35}
36
37static const Ecore_Getopt optdesc = {
38 "extra",
39 "%prog [options]",
40 PACKAGE_VERSION,
41 COPYRIGHT,
42 "BSD with advertisement clause",
43 "An EFL extra program",
44 0,
45 {
46 ECORE_GETOPT_STORE_TRUE('l', "list", "list available tests"),
47 ECORE_GETOPT_STORE_STR('t', "test", "test to run"),
48 ECORE_GETOPT_LICENSE('L', "license"),
49 ECORE_GETOPT_COPYRIGHT('C', "copyright"),
50 ECORE_GETOPT_VERSION('V', "version"),
51 ECORE_GETOPT_HELP('h', "help"),
52 ECORE_GETOPT_SENTINEL
53 }
54};
55
56int
57main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
58{
59 Suite *s;
60 SRunner *sr;
61 TCase *tc = NULL;
62 char *test = NULL;
63 unsigned int i;
64 int failed_count = -1;
65 int args;
66 Eina_Bool quit_option = EINA_FALSE;
67 Eina_Bool list_option = EINA_FALSE;
68
69 Ecore_Getopt_Value values[] = {
70 ECORE_GETOPT_VALUE_BOOL(list_option),
71 ECORE_GETOPT_VALUE_STR(test),
72 ECORE_GETOPT_VALUE_BOOL(quit_option),
73 ECORE_GETOPT_VALUE_BOOL(quit_option),
74 ECORE_GETOPT_VALUE_BOOL(quit_option),
75 ECORE_GETOPT_VALUE_BOOL(quit_option),
76 ECORE_GETOPT_VALUE_NONE
77 };
78
79 eina_init();
80
81 args = ecore_getopt_parse(&optdesc, values, argc, argv);
82 if (args < 0)
83 {
84 EINA_LOG_CRIT("Could not parse arguments.");
85 goto end;
86 }
87 else if (quit_option)
88 {
89 goto end;
90 }
91 else if (list_option)
92 {
93 fprintf(stdout, "Available tests :\n");
94 for (i = 0; i < sizeof (tests) / sizeof (tests[0]); i++)
95 fprintf(stdout, "\t%s\n", tests[i].name);
96 goto end;
97 }
98
99 s = suite_create("extra");
100
101 for (i = 0; i < sizeof (tests) / sizeof (tests[0]); i++)
102 {
103 if (test && strcmp(tests[i].name, test))
104 continue ;
105
106 tc = tcase_create(tests[i].name);
107 tcase_set_timeout(tc, 0);
108
109 tests[i].build(tc);
110 suite_add_tcase(s, tc);
111 }
112
113 sr = srunner_create(s);
114 srunner_set_xml(sr, PACKAGE_BUILD_DIR "/check-results.xml");
115
116 srunner_run_all(sr, CK_ENV);
117 failed_count = srunner_ntests_failed(sr);
118 srunner_free(sr);
119
120 end:
121 eina_shutdown();
122
123 return (failed_count == 0) ? 0 : 255;
124}