summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Dilly <bdilly@profusion.mobi>2010-11-22 06:57:17 +0000
committerBruno Dilly <bdilly@profusion.mobi>2010-11-22 06:57:17 +0000
commitf6db1e90fdf32463c2d9cdc357ee28d005ce27be (patch)
tree29ed603310009bb84956ec1d759fc36aa760590f
Welcome to econcentration, a new puzzle game
SVN revision: 54771
-rw-r--r--AUTHORS1
-rw-r--r--COPYING165
-rw-r--r--COPYING_IMAGES41
-rw-r--r--ChangeLog0
-rw-r--r--INSTALL365
-rw-r--r--Makefile.am16
-rw-r--r--NEWS0
-rw-r--r--README9
-rw-r--r--TODO0
-rwxr-xr-xautogen.sh12
-rw-r--r--configure.ac135
-rw-r--r--data/Makefile.am2
-rw-r--r--data/desktop/Makefile.am9
-rw-r--r--data/desktop/econcentration.desktop10
-rw-r--r--data/desktop/econcentration.pngbin0 -> 12068 bytes
-rw-r--r--data/images/Makefile.am38
-rw-r--r--data/images/icon_00.pngbin0 -> 6154 bytes
-rw-r--r--data/images/icon_01.pngbin0 -> 12912 bytes
-rw-r--r--data/images/icon_02.pngbin0 -> 14003 bytes
-rw-r--r--data/images/icon_03.pngbin0 -> 10083 bytes
-rw-r--r--data/images/icon_04.pngbin0 -> 5062 bytes
-rw-r--r--data/images/icon_05.pngbin0 -> 1819 bytes
-rw-r--r--data/images/icon_06.pngbin0 -> 9245 bytes
-rw-r--r--data/images/icon_07.pngbin0 -> 8360 bytes
-rw-r--r--data/images/icon_08.pngbin0 -> 9793 bytes
-rw-r--r--data/images/icon_09.pngbin0 -> 11371 bytes
-rw-r--r--data/images/icon_10.pngbin0 -> 12432 bytes
-rw-r--r--data/images/icon_11.pngbin0 -> 15014 bytes
-rw-r--r--data/images/icon_12.pngbin0 -> 7912 bytes
-rw-r--r--data/images/icon_13.pngbin0 -> 1483 bytes
-rw-r--r--data/images/icon_14.pngbin0 -> 4977 bytes
-rw-r--r--data/images/icon_15.pngbin0 -> 2548 bytes
-rw-r--r--data/images/icon_16.pngbin0 -> 4861 bytes
-rw-r--r--data/images/icon_17.pngbin0 -> 7774 bytes
-rw-r--r--data/images/icon_18.pngbin0 -> 4745 bytes
-rw-r--r--data/images/icon_19.pngbin0 -> 8684 bytes
-rw-r--r--data/images/icon_20.pngbin0 -> 3018 bytes
-rw-r--r--data/images/icon_21.pngbin0 -> 5051 bytes
-rw-r--r--data/images/icon_22.pngbin0 -> 8448 bytes
-rw-r--r--data/images/icon_23.pngbin0 -> 8706 bytes
-rw-r--r--data/images/icon_24.pngbin0 -> 11758 bytes
-rw-r--r--data/images/icon_25.pngbin0 -> 13769 bytes
-rw-r--r--data/images/icon_26.pngbin0 -> 6079 bytes
-rw-r--r--data/images/icon_27.pngbin0 -> 11785 bytes
-rw-r--r--data/images/icon_28.pngbin0 -> 8278 bytes
-rw-r--r--data/images/icon_29.pngbin0 -> 14661 bytes
-rw-r--r--data/images/icon_30.pngbin0 -> 12215 bytes
-rw-r--r--data/images/icon_31.pngbin0 -> 10078 bytes
-rw-r--r--m4/ac_attribute.m447
-rw-r--r--m4/as-expand.m443
-rw-r--r--src/Makefile.am2
-rw-r--r--src/bin/Makefile.am34
-rw-r--r--src/bin/main.c451
53 files changed, 1380 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..5019971
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1 @@
Bruno Dilly <bdilly@profusion.mobi>
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..9260eac
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,165 @@
1 GNU LESSER GENERAL PUBLIC LICENSE
2 Version 3, 29 June 2007
3
4 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5 Enjoyryone is permitted to copy and distribute verbatim copies
6 of this license document, but changing it is not allowed.
7
8
9 This version of the GNU Lesser General Public License incorporates
10the terms and conditions of version 3 of the GNU General Public
11License, supplemented by the additional permissions listed below.
12
13 0. Additional Definitions.
14
15 As used herein, "this License" refers to version 3 of the GNU Lesser
16General Public License, and the "GNU GPL" refers to version 3 of the GNU
17General Public License.
18
19 "The Library" refers to a covered work governed by this License,
20other than an Application or a Combined Work as defined below.
21
22 An "Application" is any work that makes use of an interface provided
23by the Library, but which is not otherwise based on the Library.
24Defining a subclass of a class defined by the Library is deemed a mode
25of using an interface provided by the Library.
26
27 A "Combined Work" is a work produced by combining or linking an
28Application with the Library. The particular version of the Library
29with which the Combined Work was made is also called the "Linked
30Version".
31
32 The "Minimal Corresponding Source" for a Combined Work means the
33Corresponding Source for the Combined Work, excluding any source code
34for portions of the Combined Work that, considered in isolation, are
35based on the Application, and not on the Linked Version.
36
37 The "Corresponding Application Code" for a Combined Work means the
38object code and/or source code for the Application, including any data
39and utility programs needed for reproducing the Combined Work from the
40Application, but excluding the System Libraries of the Combined Work.
41
42 1. Exception to Section 3 of the GNU GPL.
43
44 You may convey a covered work under sections 3 and 4 of this License
45without being bound by section 3 of the GNU GPL.
46
47 2. Conveying Modified Versions.
48
49 If you modify a copy of the Library, and, in your modifications, a
50facility refers to a function or data to be supplied by an Application
51that uses the facility (other than as an argument passed when the
52facility is invoked), then you may convey a copy of the modified
53version:
54
55 a) under this License, provided that you make a good faith effort to
56 ensure that, in the enjoynt an Application does not supply the
57 function or data, the facility still operates, and performs
58 whatenjoyr part of its purpose remains meaningful, or
59
60 b) under the GNU GPL, with none of the additional permissions of
61 this License applicable to that copy.
62
63 3. Object Code Incorporating Material from Library Header Files.
64
65 The object code form of an Application may incorporate material from
66a header file that is part of the Library. You may convey such object
67code under terms of your choice, provided that, if the incorporated
68material is not limited to numerical parameters, data structure
69layouts and accessors, or small macros, inline functions and templates
70(ten or fewer lines in length), you do both of the following:
71
72 a) Give prominent notice with each copy of the object code that the
73 Library is used in it and that the Library and its use are
74 covered by this License.
75
76 b) Accompany the object code with a copy of the GNU GPL and this license
77 document.
78
79 4. Combined Works.
80
81 You may convey a Combined Work under terms of your choice that,
82taken together, effectively do not restrict modification of the
83portions of the Library contained in the Combined Work and renjoyrse
84engineering for debugging such modifications, if you also do each of
85the following:
86
87 a) Give prominent notice with each copy of the Combined Work that
88 the Library is used in it and that the Library and its use are
89 covered by this License.
90
91 b) Accompany the Combined Work with a copy of the GNU GPL and this license
92 document.
93
94 c) For a Combined Work that displays copyright notices during
95 execution, include the copyright notice for the Library among
96 these notices, as well as a reference directing the user to the
97 copies of the GNU GPL and this license document.
98
99 d) Do one of the following:
100
101 0) Convey the Minimal Corresponding Source under the terms of this
102 License, and the Corresponding Application Code in a form
103 suitable for, and under terms that permit, the user to
104 recombine or relink the Application with a modified version of
105 the Linked Version to produce a modified Combined Work, in the
106 manner specified by section 6 of the GNU GPL for conveying
107 Corresponding Source.
108
109 1) Use a suitable shared library mechanism for linking with the
110 Library. A suitable mechanism is one that (a) uses at run time
111 a copy of the Library already present on the user's computer
112 system, and (b) will operate properly with a modified version
113 of the Library that is interface-compatible with the Linked
114 Version.
115
116 e) Provide Installation Information, but only if you would otherwise
117 be required to provide such information under section 6 of the
118 GNU GPL, and only to the extent that such information is
119 necessary to install and execute a modified version of the
120 Combined Work produced by recombining or relinking the
121 Application with a modified version of the Linked Version. (If
122 you use option 4d0, the Installation Information must accompany
123 the Minimal Corresponding Source and Corresponding Application
124 Code. If you use option 4d1, you must provide the Installation
125 Information in the manner specified by section 6 of the GNU GPL
126 for conveying Corresponding Source.)
127
128 5. Combined Libraries.
129
130 You may place library facilities that are a work based on the
131Library side by side in a single library together with other library
132facilities that are not Applications and are not covered by this
133License, and convey such a combined library under terms of your
134choice, if you do both of the following:
135
136 a) Accompany the combined library with a copy of the same work based
137 on the Library, uncombined with any other library facilities,
138 conveyed under the terms of this License.
139
140 b) Give prominent notice with the combined library that part of it
141 is a work based on the Library, and explaining where to find the
142 accompanying uncombined form of the same work.
143
144 6. Revised Versions of the GNU Lesser General Public License.
145
146 The Free Software Foundation may publish revised and/or new versions
147of the GNU Lesser General Public License from time to time. Such new
148versions will be similar in spirit to the present version, but may
149differ in detail to address new problems or concerns.
150
151 Each version is given a distinguishing version number. If the
152Library as you received it specifies that a certain numbered version
153of the GNU Lesser General Public License "or any later version"
154applies to it, you have the option of following the terms and
155conditions either of that published version or of any later version
156published by the Free Software Foundation. If the Library as you
157received it does not specify a version number of the GNU Lesser
158General Public License, you may choose any version of the GNU Lesser
159General Public License enjoyr published by the Free Software Foundation.
160
161 If the Library as you received it specifies that a proxy can decide
162whether future versions of the GNU Lesser General Public License shall
163apply, that proxy's public statement of acceptance of any version is
164permanent authorization for you to choose that version for the
165Library.
diff --git a/COPYING_IMAGES b/COPYING_IMAGES
new file mode 100644
index 0000000..aaa3fb6
--- /dev/null
+++ b/COPYING_IMAGES
@@ -0,0 +1,41 @@
1Notes about the images:
2 * icon_00
3 - Liftarn
4 - GNU Free Documentation License, Version 1.2 or any later version
5 published by the Free Software Foundation;
6 - http://commons.wikimedia.org/wiki/File:Littlebluedog.svg
7 * icon_01
8 - David Vignoni
9 - GNU Lesser General Public License as published by the Free Software
10 Foundation; either version 2.1 of the License, or (at your option)
11 any later version.
12 - http://commons.wikimedia.org/wiki/File:Nuvola_apps_package_toys.png
13 * icon_02
14 - Nicolas Rougier
15 - GNU General Public License as published by the Free Software Foundation;
16 either version 2 of the License, or any later version.
17 - http://commons.wikimedia.org/wiki/File:BabyGnuAlpha.png
18 * icon_03
19 - Frédéric Bellaiche
20 - GNU General Public License as published by the Free Software Foundation;
21 either version 2 of the License, or any later version.
22 - http://commons.wikimedia.org/wiki/File:Bear.svg
23 * icon_04
24 - public domain
25 - http://commons.wikimedia.org/wiki/File:Dog.svg
26 * icon_05
27 - public domain
28 - http://commons.wikimedia.org/wiki/File:Cat_silhouette.svg
29 * icon_06
30 - Fumiaki Shingu
31 - GNU Free Documentation License, Version 1.2 or any later version
32 published by the Free Software Foundation
33 - http://commons.wikimedia.org/wiki/File:Bitti.png
34 * icon_07
35 - The people from the Tango! project
36 - public domain
37 - http://commons.wikimedia.org/wiki/File:Input-mouse.svg
38
39from icon_08 to icon_31:
40 stolen from elementary/data/images
41 don't know about licences, authors
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..7d1c323
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,365 @@
1Installation Instructions
2*************************
3
4Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
52006, 2007, 2008, 2009 Free Software Foundation, Inc.
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 On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
230parse its `<wchar.h>' header file. The option `-nodtk' can be used as
231a workaround. If GNU CC is not installed, it is therefore recommended
232to try
233
234 ./configure CC="cc"
235
236and if that doesn't work, try
237
238 ./configure CC="cc -nodtk"
239
240 On Solaris, don't put `/usr/ucb' early in your `PATH'. This
241directory contains several dysfunctional programs; working variants of
242these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
243in your `PATH', put it _after_ `/usr/bin'.
244
245 On Haiku, software installed for all users goes in `/boot/common',
246not `/usr/local'. It is recommended to use the following options:
247
248 ./configure --prefix=/boot/common
249
250Specifying the System Type
251==========================
252
253 There may be some features `configure' cannot figure out
254automatically, but needs to determine by the type of machine the package
255will run on. Usually, assuming the package is built to be run on the
256_same_ architectures, `configure' can figure that out, but if it prints
257a message saying it cannot guess the machine type, give it the
258`--build=TYPE' option. TYPE can either be a short name for the system
259type, such as `sun4', or a canonical name which has the form:
260
261 CPU-COMPANY-SYSTEM
262
263where SYSTEM can have one of these forms:
264
265 OS
266 KERNEL-OS
267
268 See the file `config.sub' for the possible values of each field. If
269`config.sub' isn't included in this package, then this package doesn't
270need to know the machine type.
271
272 If you are _building_ compiler tools for cross-compiling, you should
273use the option `--target=TYPE' to select the type of system they will
274produce code for.
275
276 If you want to _use_ a cross compiler, that generates code for a
277platform different from the build platform, you should specify the
278"host" platform (i.e., that on which the generated programs will
279eventually be run) with `--host=TYPE'.
280
281Sharing Defaults
282================
283
284 If you want to set default values for `configure' scripts to share,
285you can create a site shell script called `config.site' that gives
286default values for variables like `CC', `cache_file', and `prefix'.
287`configure' looks for `PREFIX/share/config.site' if it exists, then
288`PREFIX/etc/config.site' if it exists. Or, you can set the
289`CONFIG_SITE' environment variable to the location of the site script.
290A warning: not all `configure' scripts look for a site script.
291
292Defining Variables
293==================
294
295 Variables not defined in a site shell script can be set in the
296environment passed to `configure'. However, some packages may run
297configure again during the build, and the customized values of these
298variables may be lost. In order to avoid this problem, you should set
299them in the `configure' command line, using `VAR=value'. For example:
300
301 ./configure CC=/usr/local2/bin/gcc
302
303causes the specified `gcc' to be used as the C compiler (unless it is
304overridden in the site shell script).
305
306Unfortunately, this technique does not work for `CONFIG_SHELL' due to
307an Autoconf bug. Until the bug is fixed you can use this workaround:
308
309 CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
310
311`configure' Invocation
312======================
313
314 `configure' recognizes the following options to control how it
315operates.
316
317`--help'
318`-h'
319 Print a summary of all of the options to `configure', and exit.
320
321`--help=short'
322`--help=recursive'
323 Print a summary of the options unique to this package's
324 `configure', and exit. The `short' variant lists options used
325 only in the top level, while the `recursive' variant lists options
326 also present in any nested packages.
327
328`--version'
329`-V'
330 Print the version of Autoconf used to generate the `configure'
331 script, and exit.
332
333`--cache-file=FILE'
334 Enable the cache: use and save the results of the tests in FILE,
335 traditionally `config.cache'. FILE defaults to `/dev/null' to
336 disable caching.
337
338`--config-cache'
339`-C'
340 Alias for `--cache-file=config.cache'.
341
342`--quiet'
343`--silent'
344`-q'
345 Do not print messages saying which checks are being made. To
346 suppress all normal output, redirect it to `/dev/null' (any error
347 messages will still be shown).
348
349`--srcdir=DIR'
350 Look for the package's source code in directory DIR. Usually
351 `configure' can determine that directory automatically.
352
353`--prefix=DIR'
354 Use DIR as the installation prefix. *note Installation Names::
355 for more details, including other options available for fine-tuning
356 the installation locations.
357
358`--no-create'
359`-n'
360 Run the configure checks, but stop before creating any output
361 files.
362
363`configure' also accepts some other, not widely useful, options. Run
364`configure --help' for more details.
365
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..f6e1dbe
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,16 @@
1ACLOCAL_AMFLAGS = -I m4
2
3SUBDIRS = src data
4
5MAINTAINERCLEANFILES = Makefile.in ABOUT-NLS INSTALL aclocal.m4 config.guess compile \
6 config.h.in config.rpath config.sub configure install-sh \
7 ltconfig ltmain.sh missing mkinstalldirs \
8 m4/lib-link.m4 m4/lib-prefix.m4 m4/lib-ld.m4 m4/lcmessage.m4 m4/libtool.m4 m4/ulonglong.m4 \
9 m4/inttypes-pri.m4 m4/progtest.m4 m4/uintmax_t.m4 m4/lt~obsolete.m4 m4/stdint_h.m4 m4/intdiv0.m4 \
10 m4/iconv.m4 m4/isc-posix.m4 m4/inttypes.m4 m4/ltsugar.m4 m4/glibc21.m4 m4/gettext.m4 m4/ltversion.m4 \
11 m4/codeset.m4 m4/inttypes_h.m4 m4/ltoptions.m4 m4/nls.m4 \
12 stamp-h.in acconfig.h depcomp
13
14EXTRA_DIST = README AUTHORS COPYING COPYING_IMAGES
15
16DISTCHECK_CONFIGURE_FLAGS = --disable-quicklaunch
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..461466c
--- /dev/null
+++ b/README
@@ -0,0 +1,9 @@
1Econcentration - contentration game to improve you concentration and memory skills(*)
2
3It's written using the Enlightenment Foundation Libraries (EFL).
4
5See INSTALL for help on how to install.
6See COPYING for software usage, modification and redistribution license.
7See COPYING_IMAGES for information about images and redistribution license.
8
9(*)not scientifically proved AFAIK ;)
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..e4ebb2a
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,12 @@
1#!/bin/sh
2
3DIRNAME=`basename $PWD`
4
5find . -name Makefile -delete
6find . -name Makefile.in -delete
7
8autoreconf -f -i
9
10if [ -z "$NOCONFIGURE" ]; then
11 ./configure "$@"
12fi
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..5ebc0c5
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,135 @@
1##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
3m4_define([v_maj], [0])
4m4_define([v_min], [1])
5m4_define([v_mic], [0])
6m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v export || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n']))
7m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))])
8##-- When released, remove the dnl on the below line
9m4_undefine([v_rev])
10##-- When doing snapshots - change soname. remove dnl on below line
11dnl m4_define([relname], [ver-pre-svn-07])
12dnl m4_define([v_rel], [-release relname])
13##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
14m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])], [m4_define([v_ver], [v_maj.v_min.v_mic])])
15m4_define([lt_rev], m4_eval(v_maj + v_min))
16m4_define([lt_cur], v_mic)
17m4_define([lt_age], v_min)
18##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
19##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
20
21AC_INIT([econcentration], [v_ver-alpha], [enlightenment-devel@lists.sourceforge.net])
22AC_PREREQ([2.60])
23AC_CONFIG_SRCDIR([configure.ac])
24AC_CONFIG_MACRO_DIR([m4])
25AC_GNU_SOURCE
26AC_CANONICAL_BUILD
27AC_CANONICAL_HOST
28AC_ISC_POSIX
29
30AM_INIT_AUTOMAKE(1.6 dist-bzip2)
31AM_CONFIG_HEADER(config.h)
32m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
33
34define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])
35define([AC_LIBTOOL_LANG_GCJ_CONFIG], [:])
36define([AC_LIBTOOL_LANG_F77_CONFIG], [:])
37AC_PROG_LIBTOOL
38
39VMAJ=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $1);}'`
40VMIN=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $2);}'`
41VMIC=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $3);}'`
42SNAP=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $4);}'`
43version_info=`expr $VMAJ + $VMIN`":$VMIC:$VMIN"
44m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
45AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
46AC_SUBST(VMAJ)
47AC_SUBST(version_info)
48
49AC_C_BIGENDIAN
50AC_PROG_CC_C99
51AM_PROG_CC_C_O
52AC_C_CONST
53AC_FUNC_ALLOCA
54AC_C___ATTRIBUTE__
55
56PKG_CHECK_MODULES([ELEMENTARY], [elementary])
57
58want_quicklaunch="auto"
59AC_ARG_ENABLE([quicklaunch],
60 [AC_HELP_STRING([--disable-quicklaunch],
61 [disable build of quicklaunch (default=auto)])],
62 [if test "x${enableval}" = "xno"; then
63 want_quicklaunch="no"
64 elif test "x${enableval}" = "xyes"; then
65 want_quicklaunch="yes"
66 else
67 want_quicklaunch="auto"
68 fi
69 ],
70 [want_quicklaunch="auto"])
71
72if test "x${want_quicklaunch}" = "xauto"; then
73 AC_MSG_CHECKING([checking for elementary_quicklaunch binary...])
74 if test -x $(pkg-config --variable=prefix elementary)/bin/elementary_quicklaunch; then
75 AC_MSG_RESULT([found, enable quicklaunch.])
76 want_quicklaunch="yes"
77 else
78 AC_MSG_RESULT([not found, disable quicklaunch.])
79 want_quicklaunch="no"
80 fi
81fi
82
83if test "x${want_quicklaunch}" = "xyes"; then
84 AC_ARG_WITH([quicklauncher-libdir],
85 [AC_HELP_STRING([--with-quicklauncher-libdir=PATH],
86 [specify a specific path to install quicklauncher binaries])],
87 [quicklauncher_libdir=$withval;
88 AC_MSG_NOTICE([quicklauncher_libdir explicitly set to $quicklauncher_libdir])
89 ],
90 [quicklauncher_libdir=$(pkg-config --variable=libdir elementary)])
91 AC_SUBST(quicklauncher_libdir)
92fi
93
94AM_CONDITIONAL(BUILD_QUICKLAUNCH, test "x${want_quicklaunch}" = "xyes")
95
96AC_OUTPUT([
97Makefile
98src/Makefile
99src/bin/Makefile
100data/Makefile
101data/desktop/Makefile
102data/images/Makefile
103])
104
105
106cat << EOF
107
108econcentration configured with:
109
110Flags:
111 CFLAGS.....(C): $CFLAGS
112 CXXFLAGS.(C++): $CXXFLAGS
113 CPPFLAGS.(CPP): $CPPFLAGS
114 LDFLAGS...(LD): $LDFLAGS
115
116Installation:
117 PREFIX..............: $prefix
118
119Quick Launcher: ${want_quicklaunch}
120EOF
121
122if test "x${want_quicklaunch}" = "xyes"; then
123cat << EOF_QL
124 quicklauncher_libdir: $quicklauncher_libdir
125
126EOF_QL
127fi
128
129cat << EOF2
130
131Now type 'make' ('gmake' on some systems) to compile econcentration, if it
132builds successfully then you can 'make install', acquiring required
133permissions with 'su' or 'sudo'.
134
135EOF2
diff --git a/data/Makefile.am b/data/Makefile.am
new file mode 100644
index 0000000..2fa4881
--- /dev/null
+++ b/data/Makefile.am
@@ -0,0 +1,2 @@
1MAINTAINERCLEANFILES = Makefile.in
2SUBDIRS = desktop images
diff --git a/data/desktop/Makefile.am b/data/desktop/Makefile.am
new file mode 100644
index 0000000..4ddbac2
--- /dev/null
+++ b/data/desktop/Makefile.am
@@ -0,0 +1,9 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3desktopdir = $(datadir)/applications
4desktop_DATA = econcentration.desktop
5
6icondir = $(datadir)/icons
7icon_DATA = econcentration.png
8
9EXTRA_DIST = econcentration.desktop econcentration.png
diff --git a/data/desktop/econcentration.desktop b/data/desktop/econcentration.desktop
new file mode 100644
index 0000000..9bf8cd3
--- /dev/null
+++ b/data/desktop/econcentration.desktop
@@ -0,0 +1,10 @@
1[Desktop Entry]
2Encoding=UTF-8
3Name=Econcentration
4Comment=Game
5Comment[pt]=Jogo
6Exec=econcentration
7Icon=econcentration
8Terminal=false
9Type=Application
10Categories=Application;Game
diff --git a/data/desktop/econcentration.png b/data/desktop/econcentration.png
new file mode 100644
index 0000000..90b57af
--- /dev/null
+++ b/data/desktop/econcentration.png
Binary files differ
diff --git a/data/images/Makefile.am b/data/images/Makefile.am
new file mode 100644
index 0000000..62c2546
--- /dev/null
+++ b/data/images/Makefile.am
@@ -0,0 +1,38 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3filesdir = $(datadir)/econcentration/images
4files_DATA = \
5icon_00.png \
6icon_01.png \
7icon_02.png \
8icon_03.png \
9icon_04.png \
10icon_05.png \
11icon_06.png \
12icon_07.png \
13icon_08.png \
14icon_09.png \
15icon_10.png \
16icon_11.png \
17icon_12.png \
18icon_13.png \
19icon_14.png \
20icon_15.png \
21icon_16.png \
22icon_17.png \
23icon_18.png \
24icon_19.png \
25icon_20.png \
26icon_21.png \
27icon_22.png \
28icon_23.png \
29icon_24.png \
30icon_25.png \
31icon_26.png \
32icon_27.png \
33icon_28.png \
34icon_29.png \
35icon_30.png \
36icon_31.png
37
38EXTRA_DIST = $(files_DATA)
diff --git a/data/images/icon_00.png b/data/images/icon_00.png
new file mode 100644
index 0000000..414f068
--- /dev/null
+++ b/data/images/icon_00.png
Binary files differ
diff --git a/data/images/icon_01.png b/data/images/icon_01.png
new file mode 100644
index 0000000..6a99440
--- /dev/null
+++ b/data/images/icon_01.png
Binary files differ
diff --git a/data/images/icon_02.png b/data/images/icon_02.png
new file mode 100644
index 0000000..6ff1da2
--- /dev/null
+++ b/data/images/icon_02.png
Binary files differ
diff --git a/data/images/icon_03.png b/data/images/icon_03.png
new file mode 100644
index 0000000..aa37bb7
--- /dev/null
+++ b/data/images/icon_03.png
Binary files differ
diff --git a/data/images/icon_04.png b/data/images/icon_04.png
new file mode 100644
index 0000000..71ff31e
--- /dev/null
+++ b/data/images/icon_04.png
Binary files differ
diff --git a/data/images/icon_05.png b/data/images/icon_05.png
new file mode 100644
index 0000000..31adb9b
--- /dev/null
+++ b/data/images/icon_05.png
Binary files differ
diff --git a/data/images/icon_06.png b/data/images/icon_06.png
new file mode 100644
index 0000000..2bd4429
--- /dev/null
+++ b/data/images/icon_06.png
Binary files differ
diff --git a/data/images/icon_07.png b/data/images/icon_07.png
new file mode 100644
index 0000000..3a4e509
--- /dev/null
+++ b/data/images/icon_07.png
Binary files differ
diff --git a/data/images/icon_08.png b/data/images/icon_08.png
new file mode 100644
index 0000000..d026778
--- /dev/null
+++ b/data/images/icon_08.png
Binary files differ
diff --git a/data/images/icon_09.png b/data/images/icon_09.png
new file mode 100644
index 0000000..faf524c
--- /dev/null
+++ b/data/images/icon_09.png
Binary files differ
diff --git a/data/images/icon_10.png b/data/images/icon_10.png
new file mode 100644
index 0000000..592cb5a
--- /dev/null
+++ b/data/images/icon_10.png
Binary files differ
diff --git a/data/images/icon_11.png b/data/images/icon_11.png
new file mode 100644
index 0000000..3d3063b
--- /dev/null
+++ b/data/images/icon_11.png
Binary files differ
diff --git a/data/images/icon_12.png b/data/images/icon_12.png
new file mode 100644
index 0000000..454bd62
--- /dev/null
+++ b/data/images/icon_12.png
Binary files differ
diff --git a/data/images/icon_13.png b/data/images/icon_13.png
new file mode 100644
index 0000000..bb81792
--- /dev/null
+++ b/data/images/icon_13.png
Binary files differ
diff --git a/data/images/icon_14.png b/data/images/icon_14.png
new file mode 100644
index 0000000..7f72520
--- /dev/null
+++ b/data/images/icon_14.png
Binary files differ
diff --git a/data/images/icon_15.png b/data/images/icon_15.png
new file mode 100644
index 0000000..1c76beb
--- /dev/null
+++ b/data/images/icon_15.png
Binary files differ
diff --git a/data/images/icon_16.png b/data/images/icon_16.png
new file mode 100644
index 0000000..c8fc8d2
--- /dev/null
+++ b/data/images/icon_16.png
Binary files differ
diff --git a/data/images/icon_17.png b/data/images/icon_17.png
new file mode 100644
index 0000000..f321617
--- /dev/null
+++ b/data/images/icon_17.png
Binary files differ
diff --git a/data/images/icon_18.png b/data/images/icon_18.png
new file mode 100644
index 0000000..c72918b
--- /dev/null
+++ b/data/images/icon_18.png
Binary files differ
diff --git a/data/images/icon_19.png b/data/images/icon_19.png
new file mode 100644
index 0000000..cdb212e
--- /dev/null
+++ b/data/images/icon_19.png
Binary files differ
diff --git a/data/images/icon_20.png b/data/images/icon_20.png
new file mode 100644
index 0000000..1954b9b
--- /dev/null
+++ b/data/images/icon_20.png
Binary files differ
diff --git a/data/images/icon_21.png b/data/images/icon_21.png
new file mode 100644
index 0000000..27d964e
--- /dev/null
+++ b/data/images/icon_21.png
Binary files differ
diff --git a/data/images/icon_22.png b/data/images/icon_22.png
new file mode 100644
index 0000000..2434b05
--- /dev/null
+++ b/data/images/icon_22.png
Binary files differ
diff --git a/data/images/icon_23.png b/data/images/icon_23.png
new file mode 100644
index 0000000..8ab20ce
--- /dev/null
+++ b/data/images/icon_23.png
Binary files differ
diff --git a/data/images/icon_24.png b/data/images/icon_24.png
new file mode 100644
index 0000000..7f5ad1e
--- /dev/null
+++ b/data/images/icon_24.png
Binary files differ
diff --git a/data/images/icon_25.png b/data/images/icon_25.png
new file mode 100644
index 0000000..6afaf7a
--- /dev/null
+++ b/data/images/icon_25.png
Binary files differ
diff --git a/data/images/icon_26.png b/data/images/icon_26.png
new file mode 100644
index 0000000..74eb0d6
--- /dev/null
+++ b/data/images/icon_26.png
Binary files differ
diff --git a/data/images/icon_27.png b/data/images/icon_27.png
new file mode 100644
index 0000000..d8784e0
--- /dev/null
+++ b/data/images/icon_27.png
Binary files differ
diff --git a/data/images/icon_28.png b/data/images/icon_28.png
new file mode 100644
index 0000000..69a9dca
--- /dev/null
+++ b/data/images/icon_28.png
Binary files differ
diff --git a/data/images/icon_29.png b/data/images/icon_29.png
new file mode 100644
index 0000000..6561e5f
--- /dev/null
+++ b/data/images/icon_29.png
Binary files differ
diff --git a/data/images/icon_30.png b/data/images/icon_30.png
new file mode 100644
index 0000000..d6130e8
--- /dev/null
+++ b/data/images/icon_30.png
Binary files differ
diff --git a/data/images/icon_31.png b/data/images/icon_31.png
new file mode 100644
index 0000000..27f5457
--- /dev/null
+++ b/data/images/icon_31.png
Binary files differ
diff --git a/m4/ac_attribute.m4 b/m4/ac_attribute.m4
new file mode 100644
index 0000000..23479a9
--- /dev/null
+++ b/m4/ac_attribute.m4
@@ -0,0 +1,47 @@
1dnl Copyright (C) 2004-2008 Kim Woelders
2dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
3dnl That code is public domain and can be freely used or copied.
4dnl Originally snatched from somewhere...
5
6dnl Macro for checking if the compiler supports __attribute__
7
8dnl Usage: AC_C___ATTRIBUTE__
9dnl call AC_DEFINE for HAVE___ATTRIBUTE__ and __UNUSED__
10dnl if the compiler supports __attribute__, HAVE___ATTRIBUTE__ is
11dnl defined to 1 and __UNUSED__ is defined to __attribute__((unused))
12dnl otherwise, HAVE___ATTRIBUTE__ is not defined and __UNUSED__ is
13dnl defined to nothing.
14
15AC_DEFUN([AC_C___ATTRIBUTE__],
16[
17
18AC_MSG_CHECKING([for __attribute__])
19
20AC_CACHE_VAL([ac_cv___attribute__],
21 [AC_TRY_COMPILE(
22 [
23#include <stdlib.h>
24
25int func(int x);
26int foo(int x __attribute__ ((unused)))
27{
28 exit(1);
29}
30 ],
31 [],
32 [ac_cv___attribute__="yes"],
33 [ac_cv___attribute__="no"]
34 )])
35
36AC_MSG_RESULT($ac_cv___attribute__)
37
38if test "x${ac_cv___attribute__}" = "xyes" ; then
39 AC_DEFINE([HAVE___ATTRIBUTE__], [1], [Define to 1 if your compiler has __attribute__])
40 AC_DEFINE([__UNUSED__], [__attribute__((unused))], [Macro declaring a function argument to be unused])
41 else
42 AC_DEFINE([__UNUSED__], [], [Macro declaring a function argument to be unused])
43fi
44
45])
46
47dnl End of ac_attribute.m4
diff --git a/m4/as-expand.m4 b/m4/as-expand.m4
new file mode 100644
index 0000000..7b7e4a8
--- /dev/null
+++ b/m4/as-expand.m4
@@ -0,0 +1,43 @@
1dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
2dnl
3dnl example
4dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
5dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
6
7AC_DEFUN([AS_AC_EXPAND],
8[
9 EXP_VAR=[$1]
10 FROM_VAR=[$2]
11
12 dnl first expand prefix and exec_prefix if necessary
13 prefix_save=$prefix
14 exec_prefix_save=$exec_prefix
15
16 dnl if no prefix given, then use /usr/local, the default prefix
17 if test "x$prefix" = "xNONE"; then
18 prefix=$ac_default_prefix
19 fi
20 dnl if no exec_prefix given, then use prefix
21 if test "x$exec_prefix" = "xNONE"; then
22 exec_prefix=$prefix
23 fi
24
25 full_var="$FROM_VAR"
26 dnl loop until it doesn't change anymore
27 while true; do
28 new_full_var="`eval echo $full_var`"
29 dnl if test "x$new_full_var" = "x$full_var"; then
30 if test "x${new_full_var:0:1}" != "x\$"; then
31 break;
32 fi
33 full_var=$new_full_var
34 done
35
36 dnl clean up
37 full_var=$new_full_var
38 AC_SUBST([$1], "$full_var")
39
40 dnl restore prefix and exec_prefix
41 prefix=$prefix_save
42 exec_prefix=$exec_prefix_save
43])
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..ccfbf1a
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,2 @@
1MAINTAINERCLEANFILES = Makefile.in
2SUBDIRS = bin
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
new file mode 100644
index 0000000..0619030
--- /dev/null
+++ b/src/bin/Makefile.am
@@ -0,0 +1,34 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3INCLUDES = \
4-I$(top_srcdir) \
5-I$(top_srcdir)/src/bin \
6-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
7@ELEMENTARY_CFLAGS@
8
9bin_PROGRAMS = econcentration
10if BUILD_QUICKLAUNCH
11bin_PROGRAMS += econcentration_ql
12endif
13
14econcentration_LDADD = @ELEMENTARY_LIBS@
15econcentration_SOURCES = main.c
16
17if BUILD_QUICKLAUNCH
18############################################################################
19## Build quick launch binary, needs elementary_quicklaunch to be enabled. ##
20## ##
21## It is composed of a library with actual code and a binary that talks ##
22## to server that will then fork() + dlopen() such library. ##
23############################################################################
24econcentration_qldir = $(quicklauncher_libdir)
25econcentration_ql_LTLIBRARIES = econcentration_ql.la
26econcentration_ql_la_SOURCES = main.c
27econcentration_ql_la_LIBADD = @ELEMENTARY_LIBS@
28econcentration_ql_la_CFLAGS =
29econcentration_ql_la_LDFLAGS = -module -avoid-version -no-undefined
30econcentration_ql_SOURCES = main.c
31econcentration_ql_LDADD = @ELEMENTARY_LIBS@
32econcentration_ql_CFLAGS = -DELM_LIB_QUICKLAUNCH=1
33econcentration_ql_LDFLAGS =
34endif
diff --git a/src/bin/main.c b/src/bin/main.c
new file mode 100644
index 0000000..9a0c750
--- /dev/null
+++ b/src/bin/main.c
@@ -0,0 +1,451 @@
1#ifdef HAVE_CONFIG_H
2#include "config.h"
3#endif
4#include <Elementary.h>
5#include <Edje.h>
6#include <Evas.h>
7#ifndef ELM_LIB_QUICKLAUNCH
8
9#include <stdlib.h>
10
11#define BOARD_SIZE_DEFAULT 4
12#define BOARD_SIZE_MAX 64
13#define FLIP_HIDE 3
14
15typedef struct _Card
16{
17 int value;
18 Evas_Object *flip;
19} Card;
20
21typedef struct _Game
22{
23 int play_time, attempts, found, board_size, prev_board_size, total_size;
24 Card cards[BOARD_SIZE_MAX];
25 Card *first_card, *second_card;
26 Evas_Object *time_lb, *attempts_lb, *found_lb, *won_lb, *inwin, *table;
27 Ecore_Timer *play_timer, *show_timer, *dl_pop;
28 Eina_Bool running:1;
29} Game;
30
31static void
32_board_size_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
33{
34 Game *game = data;
35 game->board_size = elm_spinner_value_get(obj) * 2 + 2;
36 game->total_size = game->board_size * game->board_size;
37}
38
39static Eina_Bool
40_play_timer_cb(void *data)
41{
42 Game *game = data;
43 char buf[16];
44 game->play_time++;
45 snprintf(buf, sizeof(buf), "%i s", game->play_time);
46 elm_label_label_set(game->time_lb, buf);
47 return ECORE_CALLBACK_RENEW;
48}
49
50static Eina_Bool
51_hide_cards(void *data)
52{
53 Game *game = data;
54
55 elm_flip_go(game->first_card->flip, random() % 2);
56 elm_flip_go(game->second_card->flip, random() % 2);
57 game->first_card = NULL;
58 game->second_card = NULL;
59 game->show_timer = NULL;
60
61 return ECORE_CALLBACK_CANCEL;
62}
63
64static void
65_won_ok(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
66{
67 Game *game = data;
68 evas_object_hide(game->inwin);
69}
70
71static void
72_player_win(Game *game)
73{
74 char buf[320];
75
76 ecore_timer_del(game->play_timer);
77 game->play_timer = NULL;
78
79 evas_object_show(game->inwin);
80 snprintf(buf, sizeof(buf),
81 "Congratulations, you solved it!<br>"
82 "You spent %i seconds and<br>"
83 "made %i attempts.",
84 game->play_time, game->attempts);
85 elm_label_label_set(game->won_lb, buf);
86}
87
88static void
89_fl_selected(void *data, Evas_Object *obj, void *event_info __UNUSED__)
90{
91 Game *game = data;
92 char buf[16];
93 Card *card;
94 if (!game->running) return;
95 /* If show timer is set it means 2 cards are flipped */
96 if (game->show_timer) return;
97
98 card = evas_object_data_get(obj, "card");
99 elm_flip_go(card->flip, random() % 2);
100
101 if (!game->first_card)
102 {
103 game->first_card = card;
104 return;
105 }
106
107 if (game->first_card->value != card->value)
108 {
109 game->attempts++;
110 snprintf(buf, sizeof(buf), "%i", game->attempts);
111 elm_label_label_set(game->attempts_lb, buf);
112 game->second_card = card;
113 game->show_timer = ecore_timer_add(FLIP_HIDE, _hide_cards, game);
114 return;
115 }
116
117 /* first and second cards match */
118 game->found++;
119 snprintf(buf, sizeof(buf), "%i", game->found);
120 elm_label_label_set(game->found_lb, buf);
121 if (game->found == (game->total_size / 2))
122 _player_win(game);
123 game->first_card = NULL;
124}
125
126/* modulo bias - discardable here, but as we c&p a lot, I will leave it */
127static int
128_random(int n)
129{
130 int limit = RAND_MAX - RAND_MAX % n;
131 int rnd;
132
133 while ((rnd = random()) >= limit) {}
134 return rnd % n;
135}
136
137/* Fisher–Yates shuffle implementation, hopefully
138 * http://en.wikipedia.org/wiki/Fisher-Yates_shuffle
139 */
140static void
141_shuffle(int *array, int n)
142{
143 int i, j, tmp;
144
145 for (i = n - 1; i > 0; i--)
146 {
147 j = _random(i + 1);
148 tmp = array[j];
149 array[j] = array[i];
150 array[i] = tmp;
151 }
152}
153
154static Eina_Bool
155_populate_table(void *data)
156{
157 Game *game = data;
158 int values[] = {0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8,
159 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17,
160 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26,
161 27, 27, 28, 28, 29, 29, 30, 30, 31, 31};
162 int i;
163 char buf[1024];
164 Evas_Object *ic;
165
166 srandom(time(NULL));
167 _shuffle(values, game->total_size);
168
169 for (i = 0; i < game->total_size; i++)
170 {
171 if (!elm_flip_front_get(game->cards[i].flip))
172 elm_flip_go(game->cards[i].flip, random() % 2);
173 game->cards[i].value = values[i];
174
175 ic = elm_icon_add(game->cards[i].flip);
176 elm_object_scale_set(ic, 0.5);
177 snprintf(buf, sizeof(buf), "%s/images/icon_%02i.png",
178 PACKAGE_DATA_DIR, values[i]);
179 elm_icon_file_set(ic, buf, NULL);
180 elm_icon_scale_set(ic, 0, 0);
181 evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND,
182 EVAS_HINT_EXPAND);
183 evas_object_size_hint_align_set(ic, 0.5, 0.5);
184 elm_flip_content_back_set(game->cards[i].flip, ic);
185 evas_object_show(ic);
186 }
187 game->play_timer = ecore_timer_add(1, _play_timer_cb, game);
188 game->running = EINA_TRUE;
189 game->dl_pop = NULL;
190 return ECORE_CALLBACK_CANCEL;
191}
192
193static void
194_unflip_table(Game *game)
195{
196 int i;
197 for (i = 0; i < game->total_size; i++)
198 {
199 if (!elm_flip_front_get(game->cards[i].flip))
200 elm_flip_go(game->cards[i].flip, random() % 2);
201 }
202 if (game->dl_pop)
203 ecore_timer_del(game->dl_pop);
204 game->dl_pop = ecore_timer_add(1, _populate_table, game);
205}
206
207static void
208_prepopulate_table(Game *game)
209{
210 Evas_Object *fl, *bt, *table;
211 int i;
212
213 table = game->table;
214
215 for (i = 0; i < game->total_size; i++)
216 {
217 fl = elm_flip_add(table);
218 evas_object_size_hint_align_set(fl, EVAS_HINT_FILL, EVAS_HINT_FILL);
219 evas_object_size_hint_weight_set(fl, EVAS_HINT_EXPAND,
220 EVAS_HINT_EXPAND);
221 elm_table_pack(table, fl, i % game->board_size, i / game->board_size,
222 1, 1);
223 evas_object_show(fl);
224 game->cards[i].flip = fl;
225
226 bt = elm_button_add(table);
227 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
228 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND,
229 EVAS_HINT_EXPAND);
230 elm_flip_content_front_set(fl, bt);
231 evas_object_show(bt);
232
233 evas_object_data_set(bt, "card", &(game->cards[i]));
234 evas_object_smart_callback_add(bt, "clicked", _fl_selected, game);
235 }
236}
237
238static void
239_start_game_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
240{
241 Game *game = data;
242
243 game->running = EINA_FALSE;
244 game->play_time = 0;
245 game->attempts = 0;
246 game->found = 0;
247 game->first_card = NULL;
248 game->second_card = NULL;
249
250 elm_label_label_set(game->time_lb, "0 s");
251 elm_label_label_set(game->attempts_lb, "0");
252 elm_label_label_set(game->found_lb, "0");
253
254 if (game->play_timer)
255 ecore_timer_del(game->play_timer);
256 game->play_timer = NULL;
257 if (game->show_timer)
258 ecore_timer_del(game->show_timer);
259 game->show_timer = NULL;
260
261 if (game->prev_board_size != game->board_size)
262 {
263 elm_table_clear(game->table, EINA_TRUE);
264 _prepopulate_table(game);
265 }
266
267 game->prev_board_size = game->board_size;
268 _unflip_table(game);
269}
270
271static void
272_win_delete_request(void *data, Evas_Object *obj, void *event_info __UNUSED__)
273{
274 Game *game = data;
275 if (game->play_timer)
276 ecore_timer_del(game->play_timer);
277 if (game->show_timer)
278 ecore_timer_del(game->show_timer);
279 if (game->dl_pop)
280 ecore_timer_del(game->dl_pop);
281 evas_object_del(obj);
282 elm_exit();
283}
284
285static Eina_Bool
286_win_new(Game *game)
287{
288 Evas_Object *win, *inwin, *bg, *bx, *bxctl, *table, *bt, *sp, *fr, *lb;
289
290 win = elm_win_add(NULL, PACKAGE_NAME, ELM_WIN_BASIC);
291 if (!win) return EINA_FALSE;
292 evas_object_smart_callback_add(win, "delete-request",
293 _win_delete_request, game);
294
295 bg = elm_bg_add(win);
296 elm_win_resize_object_add(win, bg);
297 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
298 evas_object_show(bg);
299
300 bx = elm_box_add(win);
301 elm_box_horizontal_set(bx, EINA_TRUE);
302 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
303 elm_win_resize_object_add(win, bx);
304 evas_object_show(bx);
305
306 game->table = table = elm_table_add(win);
307 elm_table_padding_set(table, 2, 2);
308 _prepopulate_table(game);
309 evas_object_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
310 evas_object_size_hint_align_set(table, EVAS_HINT_FILL, EVAS_HINT_FILL);
311 evas_object_show(table);
312 elm_box_pack_end(bx, table);
313
314 bxctl = elm_box_add(win);
315 evas_object_size_hint_align_set(bxctl, EVAS_HINT_FILL, 0);
316 evas_object_show(bxctl);
317 elm_box_pack_end(bx, bxctl);
318
319 bt = elm_button_add(win);
320 elm_button_label_set(bt, "New game");
321 evas_object_smart_callback_add(bt, "clicked", _start_game_cb, game);
322 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);
323 evas_object_show(bt);
324 elm_box_pack_end(bxctl, bt);
325
326 bt = elm_button_add(win);
327 elm_button_label_set(bt, "Quit");
328 evas_object_smart_callback_add(bt, "clicked", _win_delete_request, game);
329 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0);
330 evas_object_show(bt);
331 elm_box_pack_end(bxctl, bt);
332
333 fr = elm_frame_add(win);
334 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
335 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
336 elm_frame_label_set(fr, "Board size:");
337 elm_box_pack_end(bxctl, fr);
338 evas_object_show(fr);
339
340 sp = elm_spinner_add(win);
341 elm_spinner_min_max_set(sp, 1, 3);
342 elm_spinner_label_format_set(sp, "Board size: %.0f");
343 elm_spinner_step_set(sp, 1.0);
344 elm_spinner_editable_set(sp, EINA_FALSE);
345 elm_spinner_special_value_add(sp, 1, "Small");
346 elm_spinner_special_value_add(sp, 2, "Normal");
347 elm_spinner_special_value_add(sp, 3, "Big");
348 evas_object_smart_callback_add(sp, "changed", _board_size_cb, game);
349 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0);
350 elm_frame_content_set(fr, sp);
351 evas_object_show(sp);
352
353 fr = elm_frame_add(win);
354 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
355 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
356 elm_frame_label_set(fr, "Time:");
357 elm_box_pack_end(bxctl, fr);
358 evas_object_show(fr);
359
360 game->time_lb = lb = elm_label_add(win);
361 elm_label_label_set(lb, "0 s");
362 evas_object_size_hint_weight_set(lb, 0.0, 0.0);
363 evas_object_size_hint_align_set(lb, 1, 0.5);
364 elm_frame_content_set(fr, lb);
365 evas_object_show(lb);
366
367 fr = elm_frame_add(win);
368 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
369 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
370 elm_frame_label_set(fr, "Attempts:");
371 elm_box_pack_end(bxctl, fr);
372 evas_object_show(fr);
373
374 game->attempts_lb = lb = elm_label_add(win);
375 elm_label_label_set(lb, "0");
376 evas_object_size_hint_weight_set(lb, 0.0, 0.0);
377 evas_object_size_hint_align_set(lb, 1, 0.5);
378 elm_frame_content_set(fr, lb);
379 evas_object_show(lb);
380
381 fr = elm_frame_add(win);
382 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
383 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
384 elm_frame_label_set(fr, "Found:");
385 elm_box_pack_end(bxctl, fr);
386 evas_object_show(fr);
387
388 game->found_lb = lb = elm_label_add(win);
389 elm_label_label_set(lb, "0");
390 evas_object_size_hint_weight_set(lb, 0.0, 0.0);
391 evas_object_size_hint_align_set(lb, 1, 0.5);
392 elm_frame_content_set(fr, lb);
393 evas_object_show(lb);
394
395 game->inwin = inwin = elm_win_inwin_add(win);
396 elm_object_style_set(inwin, "minimal");
397
398 bx = elm_box_add(win);
399 evas_object_show(bx);
400 elm_win_inwin_content_set(inwin, bx);
401
402 game->won_lb = lb = elm_label_add(win);
403 evas_object_size_hint_weight_set(lb, 0.0, 0.0);
404 evas_object_size_hint_align_set(lb, 0, 0);
405 evas_object_show(lb);
406 elm_box_pack_end(bx, lb);
407
408 bt = elm_button_add(win);
409 elm_button_label_set(bt, "Yay!");
410 evas_object_smart_callback_add(bt, "clicked", _won_ok, game);
411 evas_object_size_hint_align_set(bt, 0.5, 0.5);
412 evas_object_show(bt);
413 elm_box_pack_end(bx, bt);
414
415 evas_object_resize(win, 480, 320);
416 evas_object_size_hint_min_set(win, 480, 320);
417 elm_win_title_set(win, "Econcentration");
418 evas_object_show(win);
419
420 return EINA_TRUE;
421}
422
423EAPI int
424elm_main(int argc __UNUSED__, char **argv __UNUSED__)
425{
426 Game game;
427 int r = 0;
428
429 game.board_size = BOARD_SIZE_DEFAULT;
430 game.total_size = BOARD_SIZE_DEFAULT * BOARD_SIZE_DEFAULT;
431 game.prev_board_size = BOARD_SIZE_DEFAULT;
432 game.running = EINA_FALSE;
433 game.play_timer = NULL;
434 game.show_timer = NULL;
435 game.dl_pop = NULL;
436
437 if(!_win_new(&game))
438 {
439 r = -1;
440 goto end;
441 }
442
443 elm_run();
444
445end:
446 elm_shutdown();
447 return r;
448}
449
450#endif
451ELM_MAIN()