summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaoul HECKY <raoul.hecky@gmail.com>2010-03-15 16:59:12 +0000
committerRaoul HECKY <raoul.hecky@gmail.com>2010-03-15 16:59:12 +0000
commitac0bafbd2a0e06ca8640f6ffef3eb66c53ba3d83 (patch)
tree0ba12da95cb2a5abeaa8a5be04c31dc80bc7fec2
Adding eskiss to the svn
SVN revision: 47238
-rw-r--r--AUTHORS1
-rw-r--r--LICENCE674
-rw-r--r--README50
-rw-r--r--data/background_01.jpgbin0 -> 226801 bytes
-rw-r--r--data/background_02.jpgbin0 -> 483605 bytes
-rw-r--r--data/ball_01.pngbin0 -> 4910 bytes
-rw-r--r--data/brush01.pngbin0 -> 323 bytes
-rw-r--r--data/brush02.pngbin0 -> 329 bytes
-rw-r--r--data/brush03.pngbin0 -> 286 bytes
-rw-r--r--data/brush04.pngbin0 -> 286 bytes
-rw-r--r--data/brush05.pngbin0 -> 284 bytes
-rw-r--r--data/edje/background_02.jpgbin0 -> 483605 bytes
-rw-r--r--data/edje/background_02.pngbin0 -> 99081 bytes
-rw-r--r--data/edje/ball_01.pngbin0 -> 4910 bytes
-rw-r--r--data/edje/ball_02.pngbin0 -> 5269 bytes
-rw-r--r--data/edje/ball_03.pngbin0 -> 4858 bytes
-rw-r--r--data/edje/bt_close.pngbin0 -> 3103 bytes
-rw-r--r--data/edje/calaos_content-bold.ttfbin0 -> 444304 bytes
-rw-r--r--data/edje/calaos_content-oblique.ttfbin0 -> 465900 bytes
-rw-r--r--data/edje/calaos_content.ttfbin0 -> 452076 bytes
-rw-r--r--data/edje/cloud1.pngbin0 -> 34798 bytes
-rw-r--r--data/edje/cloud2.pngbin0 -> 40290 bytes
-rw-r--r--data/edje/default.edc2566
-rw-r--r--data/edje/editor_bg.pngbin0 -> 9099 bytes
-rw-r--r--data/edje/editor_bt.pngbin0 -> 695 bytes
-rw-r--r--data/edje/editor_bt_background.pngbin0 -> 4916 bytes
-rw-r--r--data/edje/editor_bt_color.pngbin0 -> 964 bytes
-rw-r--r--data/edje/editor_bt_glow.pngbin0 -> 4027 bytes
-rw-r--r--data/edje/editor_bt_menu.pngbin0 -> 2153 bytes
-rw-r--r--data/edje/editor_bt_move.pngbin0 -> 3721 bytes
-rw-r--r--data/edje/editor_bt_open.pngbin0 -> 3052 bytes
-rw-r--r--data/edje/editor_bt_pencil.pngbin0 -> 3466 bytes
-rw-r--r--data/edje/editor_bt_play.pngbin0 -> 2400 bytes
-rw-r--r--data/edje/editor_bt_previous.pngbin0 -> 2346 bytes
-rw-r--r--data/edje/editor_bt_save.pngbin0 -> 1323 bytes
-rw-r--r--data/edje/editor_bt_save_new.pngbin0 -> 2228 bytes
-rw-r--r--data/edje/editor_bt_static.pngbin0 -> 5001 bytes
-rw-r--r--data/edje/editor_bt_stop.pngbin0 -> 1357 bytes
-rw-r--r--data/edje/game_level_next.pngbin0 -> 3345 bytes
-rw-r--r--data/edje/goal_01.pngbin0 -> 5481 bytes
-rw-r--r--data/edje/goal_02.pngbin0 -> 4991 bytes
-rw-r--r--data/edje/goal_03.pngbin0 -> 4829 bytes
-rw-r--r--data/edje/load_anim_01.pngbin0 -> 840 bytes
-rw-r--r--data/edje/load_anim_02.pngbin0 -> 4410 bytes
-rw-r--r--data/edje/load_anim_03.pngbin0 -> 4000 bytes
-rw-r--r--data/edje/load_anim_04.pngbin0 -> 4166 bytes
-rw-r--r--data/edje/load_anim_05.pngbin0 -> 3976 bytes
-rw-r--r--data/edje/load_anim_06.pngbin0 -> 3882 bytes
-rw-r--r--data/edje/load_anim_07.pngbin0 -> 3971 bytes
-rw-r--r--data/edje/menu_item.pngbin0 -> 7097 bytes
-rw-r--r--data/edje/pin.pngbin0 -> 6856 bytes
-rw-r--r--data/edje/play_menu.pngbin0 -> 3445 bytes
-rw-r--r--data/edje/title.pngbin0 -> 19534 bytes
-rw-r--r--data/edje/tree.pngbin0 -> 89267 bytes
-rw-r--r--data/edje/wscript20
-rw-r--r--data/goal_01.pngbin0 -> 5481 bytes
-rw-r--r--data/levels/000_begin.eetbin0 -> 111527 bytes
-rw-r--r--data/levels/001_level.eetbin0 -> 47130 bytes
-rw-r--r--data/levels/002_level.eetbin0 -> 58949 bytes
-rw-r--r--data/levels/003_level.eetbin0 -> 59484 bytes
-rw-r--r--data/levels/004_level.eetbin0 -> 78682 bytes
-rw-r--r--data/levels/005_level.eetbin0 -> 80641 bytes
-rw-r--r--data/levels/006_level.eetbin0 -> 47376 bytes
-rw-r--r--data/levels/007_level.eetbin0 -> 45300 bytes
-rw-r--r--data/levels/008_level.eetbin0 -> 60733 bytes
-rw-r--r--data/levels/009_level.eetbin0 -> 102906 bytes
-rw-r--r--data/levels/010_level.eetbin0 -> 57150 bytes
-rw-r--r--data/levels/011_level.eetbin0 -> 130241 bytes
-rw-r--r--data/levels/wscript21
-rw-r--r--data/wscript20
-rw-r--r--src/bin/common.h73
-rw-r--r--src/bin/draw_object.c607
-rw-r--r--src/bin/draw_object.h61
-rw-r--r--src/bin/game.c464
-rw-r--r--src/bin/game.h39
-rw-r--r--src/bin/level.c538
-rw-r--r--src/bin/level.h63
-rw-r--r--src/bin/level_chooser.c273
-rw-r--r--src/bin/level_chooser.h30
-rw-r--r--src/bin/level_editor.c610
-rw-r--r--src/bin/level_editor.h39
-rw-r--r--src/bin/main.c386
-rw-r--r--src/bin/main.h41
-rw-r--r--src/bin/physic_object.c708
-rw-r--r--src/bin/physic_object.h96
-rw-r--r--src/bin/wscript28
-rwxr-xr-xwafbin0 -> 88387 bytes
-rw-r--r--wscript49
88 files changed, 7457 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..9d86450
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1 @@
Raoul Hecky <raoul.hecky@gmail.com>
diff --git a/LICENCE b/LICENCE
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/LICENCE
@@ -0,0 +1,674 @@
1 GNU GENERAL PUBLIC LICENSE
2 Version 3, 29 June 2007
3
4 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5 Everyone is permitted to copy and distribute verbatim copies
6 of this license document, but changing it is not allowed.
7
8 Preamble
9
10 The GNU General Public License is a free, copyleft license for
11software and other kinds of works.
12
13 The licenses for most software and other practical works are designed
14to take away your freedom to share and change the works. By contrast,
15the GNU General Public License is intended to guarantee your freedom to
16share and change all versions of a program--to make sure it remains free
17software for all its users. We, the Free Software Foundation, use the
18GNU General Public License for most of our software; it applies also to
19any other work released this way by its authors. You can apply it to
20your programs, too.
21
22 When we speak of free software, we are referring to freedom, not
23price. Our General Public Licenses are designed to make sure that you
24have the freedom to distribute copies of free software (and charge for
25them if you wish), that you receive source code or can get it if you
26want it, that you can change the software or use pieces of it in new
27free programs, and that you know you can do these things.
28
29 To protect your rights, we need to prevent others from denying you
30these rights or asking you to surrender the rights. Therefore, you have
31certain responsibilities if you distribute copies of the software, or if
32you modify it: responsibilities to respect the freedom of others.
33
34 For example, if you distribute copies of such a program, whether
35gratis or for a fee, you must pass on to the recipients the same
36freedoms that you received. You must make sure that they, too, receive
37or can get the source code. And you must show them these terms so they
38know their rights.
39
40 Developers that use the GNU GPL protect your rights with two steps:
41(1) assert copyright on the software, and (2) offer you this License
42giving you legal permission to copy, distribute and/or modify it.
43
44 For the developers' and authors' protection, the GPL clearly explains
45that there is no warranty for this free software. For both users' and
46authors' sake, the GPL requires that modified versions be marked as
47changed, so that their problems will not be attributed erroneously to
48authors of previous versions.
49
50 Some devices are designed to deny users access to install or run
51modified versions of the software inside them, although the manufacturer
52can do so. This is fundamentally incompatible with the aim of
53protecting users' freedom to change the software. The systematic
54pattern of such abuse occurs in the area of products for individuals to
55use, which is precisely where it is most unacceptable. Therefore, we
56have designed this version of the GPL to prohibit the practice for those
57products. If such problems arise substantially in other domains, we
58stand ready to extend this provision to those domains in future versions
59of the GPL, as needed to protect the freedom of users.
60
61 Finally, every program is threatened constantly by software patents.
62States should not allow patents to restrict development and use of
63software on general-purpose computers, but in those that do, we wish to
64avoid the special danger that patents applied to a free program could
65make it effectively proprietary. To prevent this, the GPL assures that
66patents cannot be used to render the program non-free.
67
68 The precise terms and conditions for copying, distribution and
69modification follow.
70
71 TERMS AND CONDITIONS
72
73 0. Definitions.
74
75 "This License" refers to version 3 of the GNU General Public License.
76
77 "Copyright" also means copyright-like laws that apply to other kinds of
78works, such as semiconductor masks.
79
80 "The Program" refers to any copyrightable work licensed under this
81License. Each licensee is addressed as "you". "Licensees" and
82"recipients" may be individuals or organizations.
83
84 To "modify" a work means to copy from or adapt all or part of the work
85in a fashion requiring copyright permission, other than the making of an
86exact copy. The resulting work is called a "modified version" of the
87earlier work or a work "based on" the earlier work.
88
89 A "covered work" means either the unmodified Program or a work based
90on the Program.
91
92 To "propagate" a work means to do anything with it that, without
93permission, would make you directly or secondarily liable for
94infringement under applicable copyright law, except executing it on a
95computer or modifying a private copy. Propagation includes copying,
96distribution (with or without modification), making available to the
97public, and in some countries other activities as well.
98
99 To "convey" a work means any kind of propagation that enables other
100parties to make or receive copies. Mere interaction with a user through
101a computer network, with no transfer of a copy, is not conveying.
102
103 An interactive user interface displays "Appropriate Legal Notices"
104to the extent that it includes a convenient and prominently visible
105feature that (1) displays an appropriate copyright notice, and (2)
106tells the user that there is no warranty for the work (except to the
107extent that warranties are provided), that licensees may convey the
108work under this License, and how to view a copy of this License. If
109the interface presents a list of user commands or options, such as a
110menu, a prominent item in the list meets this criterion.
111
112 1. Source Code.
113
114 The "source code" for a work means the preferred form of the work
115for making modifications to it. "Object code" means any non-source
116form of a work.
117
118 A "Standard Interface" means an interface that either is an official
119standard defined by a recognized standards body, or, in the case of
120interfaces specified for a particular programming language, one that
121is widely used among developers working in that language.
122
123 The "System Libraries" of an executable work include anything, other
124than the work as a whole, that (a) is included in the normal form of
125packaging a Major Component, but which is not part of that Major
126Component, and (b) serves only to enable use of the work with that
127Major Component, or to implement a Standard Interface for which an
128implementation is available to the public in source code form. A
129"Major Component", in this context, means a major essential component
130(kernel, window system, and so on) of the specific operating system
131(if any) on which the executable work runs, or a compiler used to
132produce the work, or an object code interpreter used to run it.
133
134 The "Corresponding Source" for a work in object code form means all
135the source code needed to generate, install, and (for an executable
136work) run the object code and to modify the work, including scripts to
137control those activities. However, it does not include the work's
138System Libraries, or general-purpose tools or generally available free
139programs which are used unmodified in performing those activities but
140which are not part of the work. For example, Corresponding Source
141includes interface definition files associated with source files for
142the work, and the source code for shared libraries and dynamically
143linked subprograms that the work is specifically designed to require,
144such as by intimate data communication or control flow between those
145subprograms and other parts of the work.
146
147 The Corresponding Source need not include anything that users
148can regenerate automatically from other parts of the Corresponding
149Source.
150
151 The Corresponding Source for a work in source code form is that
152same work.
153
154 2. Basic Permissions.
155
156 All rights granted under this License are granted for the term of
157copyright on the Program, and are irrevocable provided the stated
158conditions are met. This License explicitly affirms your unlimited
159permission to run the unmodified Program. The output from running a
160covered work is covered by this License only if the output, given its
161content, constitutes a covered work. This License acknowledges your
162rights of fair use or other equivalent, as provided by copyright law.
163
164 You may make, run and propagate covered works that you do not
165convey, without conditions so long as your license otherwise remains
166in force. You may convey covered works to others for the sole purpose
167of having them make modifications exclusively for you, or provide you
168with facilities for running those works, provided that you comply with
169the terms of this License in conveying all material for which you do
170not control copyright. Those thus making or running the covered works
171for you must do so exclusively on your behalf, under your direction
172and control, on terms that prohibit them from making any copies of
173your copyrighted material outside their relationship with you.
174
175 Conveying under any other circumstances is permitted solely under
176the conditions stated below. Sublicensing is not allowed; section 10
177makes it unnecessary.
178
179 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
181 No covered work shall be deemed part of an effective technological
182measure under any applicable law fulfilling obligations under article
18311 of the WIPO copyright treaty adopted on 20 December 1996, or
184similar laws prohibiting or restricting circumvention of such
185measures.
186
187 When you convey a covered work, you waive any legal power to forbid
188circumvention of technological measures to the extent such circumvention
189is effected by exercising rights under this License with respect to
190the covered work, and you disclaim any intention to limit operation or
191modification of the work as a means of enforcing, against the work's
192users, your or third parties' legal rights to forbid circumvention of
193technological measures.
194
195 4. Conveying Verbatim Copies.
196
197 You may convey verbatim copies of the Program's source code as you
198receive it, in any medium, provided that you conspicuously and
199appropriately publish on each copy an appropriate copyright notice;
200keep intact all notices stating that this License and any
201non-permissive terms added in accord with section 7 apply to the code;
202keep intact all notices of the absence of any warranty; and give all
203recipients a copy of this License along with the Program.
204
205 You may charge any price or no price for each copy that you convey,
206and you may offer support or warranty protection for a fee.
207
208 5. Conveying Modified Source Versions.
209
210 You may convey a work based on the Program, or the modifications to
211produce it from the Program, in the form of source code under the
212terms of section 4, provided that you also meet all of these conditions:
213
214 a) The work must carry prominent notices stating that you modified
215 it, and giving a relevant date.
216
217 b) The work must carry prominent notices stating that it is
218 released under this License and any conditions added under section
219 7. This requirement modifies the requirement in section 4 to
220 "keep intact all notices".
221
222 c) You must license the entire work, as a whole, under this
223 License to anyone who comes into possession of a copy. This
224 License will therefore apply, along with any applicable section 7
225 additional terms, to the whole of the work, and all its parts,
226 regardless of how they are packaged. This License gives no
227 permission to license the work in any other way, but it does not
228 invalidate such permission if you have separately received it.
229
230 d) If the work has interactive user interfaces, each must display
231 Appropriate Legal Notices; however, if the Program has interactive
232 interfaces that do not display Appropriate Legal Notices, your
233 work need not make them do so.
234
235 A compilation of a covered work with other separate and independent
236works, which are not by their nature extensions of the covered work,
237and which are not combined with it such as to form a larger program,
238in or on a volume of a storage or distribution medium, is called an
239"aggregate" if the compilation and its resulting copyright are not
240used to limit the access or legal rights of the compilation's users
241beyond what the individual works permit. Inclusion of a covered work
242in an aggregate does not cause this License to apply to the other
243parts of the aggregate.
244
245 6. Conveying Non-Source Forms.
246
247 You may convey a covered work in object code form under the terms
248of sections 4 and 5, provided that you also convey the
249machine-readable Corresponding Source under the terms of this License,
250in one of these ways:
251
252 a) Convey the object code in, or embodied in, a physical product
253 (including a physical distribution medium), accompanied by the
254 Corresponding Source fixed on a durable physical medium
255 customarily used for software interchange.
256
257 b) Convey the object code in, or embodied in, a physical product
258 (including a physical distribution medium), accompanied by a
259 written offer, valid for at least three years and valid for as
260 long as you offer spare parts or customer support for that product
261 model, to give anyone who possesses the object code either (1) a
262 copy of the Corresponding Source for all the software in the
263 product that is covered by this License, on a durable physical
264 medium customarily used for software interchange, for a price no
265 more than your reasonable cost of physically performing this
266 conveying of source, or (2) access to copy the
267 Corresponding Source from a network server at no charge.
268
269 c) Convey individual copies of the object code with a copy of the
270 written offer to provide the Corresponding Source. This
271 alternative is allowed only occasionally and noncommercially, and
272 only if you received the object code with such an offer, in accord
273 with subsection 6b.
274
275 d) Convey the object code by offering access from a designated
276 place (gratis or for a charge), and offer equivalent access to the
277 Corresponding Source in the same way through the same place at no
278 further charge. You need not require recipients to copy the
279 Corresponding Source along with the object code. If the place to
280 copy the object code is a network server, the Corresponding Source
281 may be on a different server (operated by you or a third party)
282 that supports equivalent copying facilities, provided you maintain
283 clear directions next to the object code saying where to find the
284 Corresponding Source. Regardless of what server hosts the
285 Corresponding Source, you remain obligated to ensure that it is
286 available for as long as needed to satisfy these requirements.
287
288 e) Convey the object code using peer-to-peer transmission, provided
289 you inform other peers where the object code and Corresponding
290 Source of the work are being offered to the general public at no
291 charge under subsection 6d.
292
293 A separable portion of the object code, whose source code is excluded
294from the Corresponding Source as a System Library, need not be
295included in conveying the object code work.
296
297 A "User Product" is either (1) a "consumer product", which means any
298tangible personal property which is normally used for personal, family,
299or household purposes, or (2) anything designed or sold for incorporation
300into a dwelling. In determining whether a product is a consumer product,
301doubtful cases shall be resolved in favor of coverage. For a particular
302product received by a particular user, "normally used" refers to a
303typical or common use of that class of product, regardless of the status
304of the particular user or of the way in which the particular user
305actually uses, or expects or is expected to use, the product. A product
306is a consumer product regardless of whether the product has substantial
307commercial, industrial or non-consumer uses, unless such uses represent
308the only significant mode of use of the product.
309
310 "Installation Information" for a User Product means any methods,
311procedures, authorization keys, or other information required to install
312and execute modified versions of a covered work in that User Product from
313a modified version of its Corresponding Source. The information must
314suffice to ensure that the continued functioning of the modified object
315code is in no case prevented or interfered with solely because
316modification has been made.
317
318 If you convey an object code work under this section in, or with, or
319specifically for use in, a User Product, and the conveying occurs as
320part of a transaction in which the right of possession and use of the
321User Product is transferred to the recipient in perpetuity or for a
322fixed term (regardless of how the transaction is characterized), the
323Corresponding Source conveyed under this section must be accompanied
324by the Installation Information. But this requirement does not apply
325if neither you nor any third party retains the ability to install
326modified object code on the User Product (for example, the work has
327been installed in ROM).
328
329 The requirement to provide Installation Information does not include a
330requirement to continue to provide support service, warranty, or updates
331for a work that has been modified or installed by the recipient, or for
332the User Product in which it has been modified or installed. Access to a
333network may be denied when the modification itself materially and
334adversely affects the operation of the network or violates the rules and
335protocols for communication across the network.
336
337 Corresponding Source conveyed, and Installation Information provided,
338in accord with this section must be in a format that is publicly
339documented (and with an implementation available to the public in
340source code form), and must require no special password or key for
341unpacking, reading or copying.
342
343 7. Additional Terms.
344
345 "Additional permissions" are terms that supplement the terms of this
346License by making exceptions from one or more of its conditions.
347Additional permissions that are applicable to the entire Program shall
348be treated as though they were included in this License, to the extent
349that they are valid under applicable law. If additional permissions
350apply only to part of the Program, that part may be used separately
351under those permissions, but the entire Program remains governed by
352this License without regard to the additional permissions.
353
354 When you convey a copy of a covered work, you may at your option
355remove any additional permissions from that copy, or from any part of
356it. (Additional permissions may be written to require their own
357removal in certain cases when you modify the work.) You may place
358additional permissions on material, added by you to a covered work,
359for which you have or can give appropriate copyright permission.
360
361 Notwithstanding any other provision of this License, for material you
362add to a covered work, you may (if authorized by the copyright holders of
363that material) supplement the terms of this License with terms:
364
365 a) Disclaiming warranty or limiting liability differently from the
366 terms of sections 15 and 16 of this License; or
367
368 b) Requiring preservation of specified reasonable legal notices or
369 author attributions in that material or in the Appropriate Legal
370 Notices displayed by works containing it; or
371
372 c) Prohibiting misrepresentation of the origin of that material, or
373 requiring that modified versions of such material be marked in
374 reasonable ways as different from the original version; or
375
376 d) Limiting the use for publicity purposes of names of licensors or
377 authors of the material; or
378
379 e) Declining to grant rights under trademark law for use of some
380 trade names, trademarks, or service marks; or
381
382 f) Requiring indemnification of licensors and authors of that
383 material by anyone who conveys the material (or modified versions of
384 it) with contractual assumptions of liability to the recipient, for
385 any liability that these contractual assumptions directly impose on
386 those licensors and authors.
387
388 All other non-permissive additional terms are considered "further
389restrictions" within the meaning of section 10. If the Program as you
390received it, or any part of it, contains a notice stating that it is
391governed by this License along with a term that is a further
392restriction, you may remove that term. If a license document contains
393a further restriction but permits relicensing or conveying under this
394License, you may add to a covered work material governed by the terms
395of that license document, provided that the further restriction does
396not survive such relicensing or conveying.
397
398 If you add terms to a covered work in accord with this section, you
399must place, in the relevant source files, a statement of the
400additional terms that apply to those files, or a notice indicating
401where to find the applicable terms.
402
403 Additional terms, permissive or non-permissive, may be stated in the
404form of a separately written license, or stated as exceptions;
405the above requirements apply either way.
406
407 8. Termination.
408
409 You may not propagate or modify a covered work except as expressly
410provided under this License. Any attempt otherwise to propagate or
411modify it is void, and will automatically terminate your rights under
412this License (including any patent licenses granted under the third
413paragraph of section 11).
414
415 However, if you cease all violation of this License, then your
416license from a particular copyright holder is reinstated (a)
417provisionally, unless and until the copyright holder explicitly and
418finally terminates your license, and (b) permanently, if the copyright
419holder fails to notify you of the violation by some reasonable means
420prior to 60 days after the cessation.
421
422 Moreover, your license from a particular copyright holder is
423reinstated permanently if the copyright holder notifies you of the
424violation by some reasonable means, this is the first time you have
425received notice of violation of this License (for any work) from that
426copyright holder, and you cure the violation prior to 30 days after
427your receipt of the notice.
428
429 Termination of your rights under this section does not terminate the
430licenses of parties who have received copies or rights from you under
431this License. If your rights have been terminated and not permanently
432reinstated, you do not qualify to receive new licenses for the same
433material under section 10.
434
435 9. Acceptance Not Required for Having Copies.
436
437 You are not required to accept this License in order to receive or
438run a copy of the Program. Ancillary propagation of a covered work
439occurring solely as a consequence of using peer-to-peer transmission
440to receive a copy likewise does not require acceptance. However,
441nothing other than this License grants you permission to propagate or
442modify any covered work. These actions infringe copyright if you do
443not accept this License. Therefore, by modifying or propagating a
444covered work, you indicate your acceptance of this License to do so.
445
446 10. Automatic Licensing of Downstream Recipients.
447
448 Each time you convey a covered work, the recipient automatically
449receives a license from the original licensors, to run, modify and
450propagate that work, subject to this License. You are not responsible
451for enforcing compliance by third parties with this License.
452
453 An "entity transaction" is a transaction transferring control of an
454organization, or substantially all assets of one, or subdividing an
455organization, or merging organizations. If propagation of a covered
456work results from an entity transaction, each party to that
457transaction who receives a copy of the work also receives whatever
458licenses to the work the party's predecessor in interest had or could
459give under the previous paragraph, plus a right to possession of the
460Corresponding Source of the work from the predecessor in interest, if
461the predecessor has it or can get it with reasonable efforts.
462
463 You may not impose any further restrictions on the exercise of the
464rights granted or affirmed under this License. For example, you may
465not impose a license fee, royalty, or other charge for exercise of
466rights granted under this License, and you may not initiate litigation
467(including a cross-claim or counterclaim in a lawsuit) alleging that
468any patent claim is infringed by making, using, selling, offering for
469sale, or importing the Program or any portion of it.
470
471 11. Patents.
472
473 A "contributor" is a copyright holder who authorizes use under this
474License of the Program or a work on which the Program is based. The
475work thus licensed is called the contributor's "contributor version".
476
477 A contributor's "essential patent claims" are all patent claims
478owned or controlled by the contributor, whether already acquired or
479hereafter acquired, that would be infringed by some manner, permitted
480by this License, of making, using, or selling its contributor version,
481but do not include claims that would be infringed only as a
482consequence of further modification of the contributor version. For
483purposes of this definition, "control" includes the right to grant
484patent sublicenses in a manner consistent with the requirements of
485this License.
486
487 Each contributor grants you a non-exclusive, worldwide, royalty-free
488patent license under the contributor's essential patent claims, to
489make, use, sell, offer for sale, import and otherwise run, modify and
490propagate the contents of its contributor version.
491
492 In the following three paragraphs, a "patent license" is any express
493agreement or commitment, however denominated, not to enforce a patent
494(such as an express permission to practice a patent or covenant not to
495sue for patent infringement). To "grant" such a patent license to a
496party means to make such an agreement or commitment not to enforce a
497patent against the party.
498
499 If you convey a covered work, knowingly relying on a patent license,
500and the Corresponding Source of the work is not available for anyone
501to copy, free of charge and under the terms of this License, through a
502publicly available network server or other readily accessible means,
503then you must either (1) cause the Corresponding Source to be so
504available, or (2) arrange to deprive yourself of the benefit of the
505patent license for this particular work, or (3) arrange, in a manner
506consistent with the requirements of this License, to extend the patent
507license to downstream recipients. "Knowingly relying" means you have
508actual knowledge that, but for the patent license, your conveying the
509covered work in a country, or your recipient's use of the covered work
510in a country, would infringe one or more identifiable patents in that
511country that you have reason to believe are valid.
512
513 If, pursuant to or in connection with a single transaction or
514arrangement, you convey, or propagate by procuring conveyance of, a
515covered work, and grant a patent license to some of the parties
516receiving the covered work authorizing them to use, propagate, modify
517or convey a specific copy of the covered work, then the patent license
518you grant is automatically extended to all recipients of the covered
519work and works based on it.
520
521 A patent license is "discriminatory" if it does not include within
522the scope of its coverage, prohibits the exercise of, or is
523conditioned on the non-exercise of one or more of the rights that are
524specifically granted under this License. You may not convey a covered
525work if you are a party to an arrangement with a third party that is
526in the business of distributing software, under which you make payment
527to the third party based on the extent of your activity of conveying
528the work, and under which the third party grants, to any of the
529parties who would receive the covered work from you, a discriminatory
530patent license (a) in connection with copies of the covered work
531conveyed by you (or copies made from those copies), or (b) primarily
532for and in connection with specific products or compilations that
533contain the covered work, unless you entered into that arrangement,
534or that patent license was granted, prior to 28 March 2007.
535
536 Nothing in this License shall be construed as excluding or limiting
537any implied license or other defenses to infringement that may
538otherwise be available to you under applicable patent law.
539
540 12. No Surrender of Others' Freedom.
541
542 If conditions are imposed on you (whether by court order, agreement or
543otherwise) that contradict the conditions of this License, they do not
544excuse you from the conditions of this License. If you cannot convey a
545covered work so as to satisfy simultaneously your obligations under this
546License and any other pertinent obligations, then as a consequence you may
547not convey it at all. For example, if you agree to terms that obligate you
548to collect a royalty for further conveying from those to whom you convey
549the Program, the only way you could satisfy both those terms and this
550License would be to refrain entirely from conveying the Program.
551
552 13. Use with the GNU Affero General Public License.
553
554 Notwithstanding any other provision of this License, you have
555permission to link or combine any covered work with a work licensed
556under version 3 of the GNU Affero General Public License into a single
557combined work, and to convey the resulting work. The terms of this
558License will continue to apply to the part which is the covered work,
559but the special requirements of the GNU Affero General Public License,
560section 13, concerning interaction through a network will apply to the
561combination as such.
562
563 14. Revised Versions of this License.
564
565 The Free Software Foundation may publish revised and/or new versions of
566the GNU General Public License from time to time. Such new versions will
567be similar in spirit to the present version, but may differ in detail to
568address new problems or concerns.
569
570 Each version is given a distinguishing version number. If the
571Program specifies that a certain numbered version of the GNU General
572Public License "or any later version" applies to it, you have the
573option of following the terms and conditions either of that numbered
574version or of any later version published by the Free Software
575Foundation. If the Program does not specify a version number of the
576GNU General Public License, you may choose any version ever published
577by the Free Software Foundation.
578
579 If the Program specifies that a proxy can decide which future
580versions of the GNU General Public License can be used, that proxy's
581public statement of acceptance of a version permanently authorizes you
582to choose that version for the Program.
583
584 Later license versions may give you additional or different
585permissions. However, no additional obligations are imposed on any
586author or copyright holder as a result of your choosing to follow a
587later version.
588
589 15. Disclaimer of Warranty.
590
591 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
600 16. Limitation of Liability.
601
602 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610SUCH DAMAGES.
611
612 17. Interpretation of Sections 15 and 16.
613
614 If the disclaimer of warranty and limitation of liability provided
615above cannot be given local legal effect according to their terms,
616reviewing courts shall apply local law that most closely approximates
617an absolute waiver of all civil liability in connection with the
618Program, unless a warranty or assumption of liability accompanies a
619copy of the Program in return for a fee.
620
621 END OF TERMS AND CONDITIONS
622
623 How to Apply These Terms to Your New Programs
624
625 If you develop a new program, and you want it to be of the greatest
626possible use to the public, the best way to achieve this is to make it
627free software which everyone can redistribute and change under these terms.
628
629 To do so, attach the following notices to the program. It is safest
630to attach them to the start of each source file to most effectively
631state the exclusion of warranty; and each file should have at least
632the "copyright" line and a pointer to where the full notice is found.
633
634 <one line to give the program's name and a brief idea of what it does.>
635 Copyright (C) <year> <name of author>
636
637 This program is free software: you can redistribute it and/or modify
638 it under the terms of the GNU General Public License as published by
639 the Free Software Foundation, either version 3 of the License, or
640 (at your option) any later version.
641
642 This program is distributed in the hope that it will be useful,
643 but WITHOUT ANY WARRANTY; without even the implied warranty of
644 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 GNU General Public License for more details.
646
647 You should have received a copy of the GNU General Public License
648 along with this program. If not, see <http://www.gnu.org/licenses/>.
649
650Also add information on how to contact you by electronic and paper mail.
651
652 If the program does terminal interaction, make it output a short
653notice like this when it starts in an interactive mode:
654
655 <program> Copyright (C) <year> <name of author>
656 This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 This is free software, and you are welcome to redistribute it
658 under certain conditions; type `show c' for details.
659
660The hypothetical commands `show w' and `show c' should show the appropriate
661parts of the General Public License. Of course, your program's commands
662might be different; for a GUI interface, you would use an "about box".
663
664 You should also get your employer (if you work as a programmer) or school,
665if any, to sign a "copyright disclaimer" for the program, if necessary.
666For more information on this, and how to apply and follow the GNU GPL, see
667<http://www.gnu.org/licenses/>.
668
669 The GNU General Public License does not permit incorporating your program
670into proprietary programs. If your program is a subroutine library, you
671may consider it more useful to permit linking proprietary applications with
672the library. If this is what you want to do, use the GNU Lesser General
673Public License instead of this License. But first, please read
674<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/README b/README
new file mode 100644
index 0000000..36a6cb2
--- /dev/null
+++ b/README
@@ -0,0 +1,50 @@
1Eskiss
2======
3
4Eskiss is a physics game where you can draw some object on the screen,
5and using the physic you need to move a ball from one point to another.
6There is an in game editor where you can create your own levels.
7
8Features
9========
10
11- Awesome physics
12- In-game level editor
13- Fun !
14
15Dependencies
16============
17
18* Eina
19* Eet
20* Evas
21* Ecore
22* Embryo
23* Edje
24* Chipmunk >= 5.0.0
25
26Chipmunk is available here: http://code.google.com/p/chipmunk-physics/
27
28Installation Instructions
29=========================
30
31Eskiss is using waf to build everything. Here's how to use it:
32
331. Go to the directory containing the sources
34
352. Configuration
36
37 ./waf configure
38
393. Build
40
41 ./waf
42
434. Install
44
45 ./waf install
46
47Now just type "eskiss" in a terminal to start the game.
48
49
50Have fun !
diff --git a/data/background_01.jpg b/data/background_01.jpg
new file mode 100644
index 0000000..83ee546
--- /dev/null
+++ b/data/background_01.jpg
Binary files differ
diff --git a/data/background_02.jpg b/data/background_02.jpg
new file mode 100644
index 0000000..e21b6d2
--- /dev/null
+++ b/data/background_02.jpg
Binary files differ
diff --git a/data/ball_01.png b/data/ball_01.png
new file mode 100644
index 0000000..6644ecf
--- /dev/null
+++ b/data/ball_01.png
Binary files differ
diff --git a/data/brush01.png b/data/brush01.png
new file mode 100644
index 0000000..d4d3b87
--- /dev/null
+++ b/data/brush01.png
Binary files differ
diff --git a/data/brush02.png b/data/brush02.png
new file mode 100644
index 0000000..c799efa
--- /dev/null
+++ b/data/brush02.png
Binary files differ
diff --git a/data/brush03.png b/data/brush03.png
new file mode 100644
index 0000000..ed6a1ea
--- /dev/null
+++ b/data/brush03.png
Binary files differ
diff --git a/data/brush04.png b/data/brush04.png
new file mode 100644
index 0000000..0205501
--- /dev/null
+++ b/data/brush04.png
Binary files differ
diff --git a/data/brush05.png b/data/brush05.png
new file mode 100644
index 0000000..ffad2c5
--- /dev/null
+++ b/data/brush05.png
Binary files differ
diff --git a/data/edje/background_02.jpg b/data/edje/background_02.jpg
new file mode 100644
index 0000000..e21b6d2
--- /dev/null
+++ b/data/edje/background_02.jpg
Binary files differ
diff --git a/data/edje/background_02.png b/data/edje/background_02.png
new file mode 100644
index 0000000..0119d2c
--- /dev/null
+++ b/data/edje/background_02.png
Binary files differ
diff --git a/data/edje/ball_01.png b/data/edje/ball_01.png
new file mode 100644
index 0000000..6644ecf
--- /dev/null
+++ b/data/edje/ball_01.png
Binary files differ
diff --git a/data/edje/ball_02.png b/data/edje/ball_02.png
new file mode 100644
index 0000000..85f8ec3
--- /dev/null
+++ b/data/edje/ball_02.png
Binary files differ
diff --git a/data/edje/ball_03.png b/data/edje/ball_03.png
new file mode 100644
index 0000000..e1fbccf
--- /dev/null
+++ b/data/edje/ball_03.png
Binary files differ
diff --git a/data/edje/bt_close.png b/data/edje/bt_close.png
new file mode 100644
index 0000000..4a457ac
--- /dev/null
+++ b/data/edje/bt_close.png
Binary files differ
diff --git a/data/edje/calaos_content-bold.ttf b/data/edje/calaos_content-bold.ttf
new file mode 100644
index 0000000..49122c9
--- /dev/null
+++ b/data/edje/calaos_content-bold.ttf
Binary files differ
diff --git a/data/edje/calaos_content-oblique.ttf b/data/edje/calaos_content-oblique.ttf
new file mode 100644
index 0000000..1bbc769
--- /dev/null
+++ b/data/edje/calaos_content-oblique.ttf
Binary files differ
diff --git a/data/edje/calaos_content.ttf b/data/edje/calaos_content.ttf
new file mode 100644
index 0000000..dfb49f6
--- /dev/null
+++ b/data/edje/calaos_content.ttf
Binary files differ
diff --git a/data/edje/cloud1.png b/data/edje/cloud1.png
new file mode 100644
index 0000000..fa1b993
--- /dev/null
+++ b/data/edje/cloud1.png
Binary files differ
diff --git a/data/edje/cloud2.png b/data/edje/cloud2.png
new file mode 100644
index 0000000..e421f1d
--- /dev/null
+++ b/data/edje/cloud2.png
Binary files differ
diff --git a/data/edje/default.edc b/data/edje/default.edc
new file mode 100644
index 0000000..d7a5c84
--- /dev/null
+++ b/data/edje/default.edc
@@ -0,0 +1,2566 @@
1/******************************************************************************
2** Copyright (c) 2006-2010, Calaos. All Rights Reserved.
3**
4** This is free software; you can redistribute it and/or modify
5** it under the terms of the GNU General Public License as published by
6** the Free Software Foundation; either version 3 of the License, or
7** (at your option) any later version.
8**
9** This 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
12** GNU General Public License for more details.
13**
14** You should have received a copy of the GNU General Public License
15** along with this; if not, write to the Free Software
16** Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17**
18******************************************************************************/
19
20fonts
21{
22 font: "calaos_content.ttf" "CalaosContent";
23 font: "calaos_content-bold.ttf" "CalaosContentBold";
24 font: "calaos_content-oblique.ttf" "CalaosContentOblique";
25}
26
27images
28{
29 image: "editor_bg.png" COMP;
30 image: "menu_item.png" COMP;
31 image: "pin.png" COMP;
32 image: "editor_bt_color.png" COMP;
33 image: "editor_bt.png" COMP;
34 image: "editor_bt_background.png" COMP;
35 image: "editor_bt_stop.png" COMP;
36 image: "editor_bt_glow.png" COMP;
37 image: "editor_bt_menu.png" COMP;
38 image: "editor_bt_move.png" COMP;
39 image: "editor_bt_pencil.png" COMP;
40 image: "editor_bt_play.png" COMP;
41 image: "editor_bt_static.png" COMP;
42 image: "ball_01.png" COMP;
43 image: "ball_02.png" COMP;
44 image: "ball_03.png" COMP;
45 image: "goal_01.png" COMP;
46 image: "goal_02.png" COMP;
47 image: "goal_03.png" COMP;
48 image: "editor_bt_open.png" COMP;
49 image: "editor_bt_save.png" COMP;
50 image: "editor_bt_save_new.png" COMP;
51 image: "game_level_next.png" COMP;
52 image: "editor_bt_previous.png" COMP;
53 image: "load_anim_01.png" COMP;
54 image: "title.png" COMP;
55 image: "cloud1.png" COMP;
56 image: "cloud2.png" COMP;
57 image: "tree.png" COMP;
58 image: "background_02.png" COMP;
59 image: "background_02.jpg" COMP;
60 image: "bt_close.png" COMP;
61 image: "play_menu.png" COMP;
62}
63
64#define MENU_ITEM(id, _text, clipper, tempo, rel1x, rel1y, rel2x, rel2y, offset1x, offset1y, offset2x, offset2y) \
65part \
66{ \
67 name: "item_"id; \
68 clip_to: clipper; \
69 type: RECT; \
70 description \
71 { \
72 state: "default" 0.0; \
73 color: 255 255 255 0; \
74 visible: 0; \
75 rel1 { relative: rel1x rel1y; offset: offset1x (offset1y - 20); } \
76 rel2 { relative: rel2x rel2y; offset: offset2x (offset2y - 20); } \
77 rel1.to: clipper; \
78 rel2.to: clipper; \
79 } \
80 description \
81 { \
82 state: "visible" 0.0; \
83 inherit: "default" 0.0; \
84 color: 255 255 255 255; \
85 visible: 1; \
86 rel1 { relative: rel1x rel1y; offset: offset1x offset1y; } \
87 rel2 { relative: rel2x rel2y; offset: offset2x offset2y; } \
88 rel1.to: clipper; \
89 rel2.to: clipper; \
90 } \
91} \
92 \
93part \
94{ \
95 name: "bg"id; \
96 clip_to: "item_"id; \
97 mouse_events: 0; \
98 description \
99 { \
100 state: "default" 0.0; \
101 image.normal: "menu_item.png"; \
102 image.border: 51 58 43 62; \
103 rel1.to: "item_"id; \
104 rel2.to: "item_"id; \
105 } \
106} \
107 \
108part \
109{ \
110 name: "title"id; \
111 type: TEXT; \
112 clip_to: "item_"id; \
113 mouse_events: 0; \
114 description \
115 { \
116 state, "default" 0.0; \
117 color: 62 62 62 255; \
118 text { text: _text; font: "CalaosContentBold"; size: 28; align: 0.5 0.44; } \
119 rel1.to: "item_"id; \
120 rel2.to: "item_"id; \
121 } \
122} \
123 \
124part \
125{ \
126 name: "pin_clip"id; \
127 type: RECT; \
128 mouse_events: 0; \
129 clip_to: clipper; \
130 description \
131 { \
132 state: "default" 0.0; \
133 rel1.to: "item_"id; \
134 rel2.to: "item_"id; \
135 rel2 { relative: 0.0 0.0; offset: 110 83; } \
136 visible: 0; \
137 color: 255 255 255 0; \
138 } \
139 description \
140 { \
141 state: "visible" 0.0; \
142 inherit: "default" 0.0; \
143 visible: 1; \
144 color: 255 255 255 255; \
145 } \
146} \
147part \
148{ \
149 name: "pin"id; \
150 clip_to: "pin_clip"id; \
151 mouse_events: 0; \
152 description \
153 { \
154 state: "default" 0.0; \
155 image.normal: "pin.png"; \
156 rel1.to: "item_"id; \
157 rel2.to: "item_"id; \
158 rel2 { relative: 0.0 0.0; offset: 110 83; } \
159 } \
160} \
161 \
162part \
163{ \
164 name: "mouse_"id; \
165 type: RECT; \
166 clip_to: clipper; \
167 description \
168 { \
169 state: "default" 0.0; \
170 rel1.to: "item_"id; \
171 rel2.to: "item_"id; \
172 visible: 1; \
173 color: 255 255 255 0; \
174 } \
175} \
176 \
177program \
178{ \
179 name: "on_show"id; \
180 in: tempo 0.0; \
181 signal: "show"; \
182 source: "menu"; \
183 action: STATE_SET "visible" 0.0; \
184 transition: DECELERATE 0.6; \
185 target: "item_"id; \
186} \
187program \
188{ \
189 name: "on_hide"id; \
190 signal: "hide"; \
191 source: "menu"; \
192 action: STATE_SET "default" 0.0; \
193 transition: ACCELERATE 0.3; \
194 target: "item_"id; \
195 target: "pin_clip"id; \
196} \
197program \
198{ \
199 name: "on_select"id; \
200 signal: "pin,select,"id; \
201 source: "menu"; \
202 action: STATE_SET "visible" 0.0; \
203 transition: ACCELERATE 0.1; \
204 target: "pin_clip"id; \
205} \
206program \
207{ \
208 name: "on_unselect"id; \
209 signal: "pin,unselect,"id; \
210 source: "menu"; \
211 action: STATE_SET "default" 0.0; \
212 transition: DECELERATE 0.1; \
213 target: "pin_clip"id; \
214} \
215program \
216{ \
217 name: "on_click"id; \
218 signal: "mouse,down,1"; \
219 source: "mouse_"id; \
220 action: SIGNAL_EMIT "select,"id "menu"; \
221} \
222program \
223{ \
224 name: "on_clicked"id; \
225 signal: "mouse,up,1"; \
226 source: "mouse_"id; \
227 action: SIGNAL_EMIT "clicked,"id "menu"; \
228}
229
230
231#define EDITOR_ITEM(id, img, clipper, tempo, rel1x, rel1y, rel2x, rel2y, offset1x, offset1y, offset2x, offset2y) \
232part \
233{ \
234 name: "item_"id; \
235 clip_to: clipper; \
236 type: RECT; \
237 description \
238 { \
239 state: "default" 0.0; \
240 color: 255 255 255 0; \
241 visible: 0; \
242 rel1 { relative: rel1x rel1y; offset: offset1x (offset1y - 10); } \
243 rel2 { relative: rel2x rel2y; offset: offset2x (offset2y - 10); } \
244 rel1.to: clipper; \
245 rel2.to: clipper; \
246 } \
247 description \
248 { \
249 state: "visible" 0.0; \
250 inherit: "default" 0.0; \
251 color: 255 255 255 255; \
252 visible: 1; \
253 rel1 { relative: rel1x rel1y; offset: offset1x offset1y; } \
254 rel2 { relative: rel2x rel2y; offset: offset2x offset2y; } \
255 rel1.to: clipper; \
256 rel2.to: clipper; \
257 } \
258} \
259 \
260part \
261{ \
262 name: "glow_clip"id; \
263 type: RECT; \
264 mouse_events: 0; \
265 description \
266 { \
267 state: "default" 0.0; \
268 visible: 0; \
269 color: 255 255 255 0; \
270 rel1.to: "item_"id; \
271 rel2.to: "item_"id; \
272 rel1 { relative: 0.0 0.0; offset: -7 -7; } \
273 rel2 { relative: 1.0 1.0; offset: 6 6; } \
274 } \
275 description \
276 { \
277 state: "visible" 0.0; \
278 inherit: "default" 0.0; \
279 visible: 1; \
280 color: 255 255 255 255; \
281 } \
282} \
283part \
284{ \
285 name: "glow"id; \
286 clip_to: "glow_clip"id; \
287 mouse_events: 0; \
288 description \
289 { \
290 state: "default" 0.0; \
291 image.normal: "editor_bt_glow.png"; \
292 rel1.to: "item_"id; \
293 rel2.to: "item_"id; \
294 rel1 { relative: 0.0 0.0; offset: -7 -7; } \
295 rel2 { relative: 1.0 1.0; offset: 6 6; } \
296 } \
297} \
298 \
299part \
300{ \
301 name: "bg"id; \
302 clip_to: "item_"id; \
303 mouse_events: 0; \
304 description \
305 { \
306 state: "default" 0.0; \
307 image.normal: img; \
308 rel1.to: "item_"id; \
309 rel2.to: "item_"id; \
310 } \
311} \
312 \
313part \
314{ \
315 name: "mouse_"id; \
316 type: RECT; \
317 clip_to: clipper; \
318 description \
319 { \
320 state: "default" 0.0; \
321 rel1.to: "item_"id; \
322 rel2.to: "item_"id; \
323 visible: 1; \
324 color: 255 255 255 0; \
325 } \
326} \
327 \
328program \
329{ \
330 name: "on_show"id; \
331 in: tempo 0.0; \
332 signal: "show"; \
333 source: "item"; \
334 action: STATE_SET "visible" 0.0; \
335 transition: DECELERATE 0.3; \
336 target: "item_"id; \
337} \
338program \
339{ \
340 name: "on_hide"id; \
341 signal: "hide"; \
342 source: "menu"; \
343 after: "hide_glow"id; \
344 after: "on_hide_real"id; \
345} \
346program \
347{ \
348 name: "on_hide_real"id; \
349 action: STATE_SET "default" 0.0; \
350 transition: ACCELERATE 0.2; \
351 target: "item_"id; \
352} \
353program \
354{ \
355 name: "on_select"id; \
356 signal: "item,select,"id; \
357 source: "menu"; \
358 after: "anim_glow1"id; \
359} \
360program \
361{ \
362 name: "on_unselect"id; \
363 signal: "item,unselect,"id; \
364 source: "menu"; \
365 action: ACTION_STOP; \
366 target: "anim_glow1"id; \
367 target: "anim_glow2"id; \
368 after: "hide_glow"id; \
369} \
370program \
371{ \
372 name: "on_click"id; \
373 signal: "mouse,down,1"; \
374 source: "mouse_"id; \
375 action: SIGNAL_EMIT "select,"id "menu"; \
376} \
377program \
378{ \
379 name: "on_clicked"id; \
380 signal: "mouse,up,1"; \
381 source: "mouse_"id; \
382 action: SIGNAL_EMIT "clicked,"id "menu"; \
383} \
384program \
385{ \
386 name: "anim_glow1"id; \
387 action: STATE_SET "visible" 0.0; \
388 transition: ACCELERATE 0.2; \
389 target: "glow_clip"id; \
390 after: "anim_glow2"id; \
391} \
392program \
393{ \
394 name: "anim_glow2"id; \
395 action: STATE_SET "default" 0.0; \
396 transition: DECELERATE 0.45; \
397 target: "glow_clip"id; \
398 after: "anim_glow1"id; \
399} \
400program \
401{ \
402 name: "hide_glow"id; \
403 action: STATE_SET "default" 0.0; \
404 transition: ACCELERATE 0.45; \
405 target: "glow_clip"id; \
406}
407
408
409#define EDITOR_ITEM_SWALLOW(id, clipper, tempo, rel1x, rel1y, rel2x, rel2y, offset1x, offset1y, offset2x, offset2y) \
410part \
411{ \
412 name: "item_"id; \
413 clip_to: clipper; \
414 type: RECT; \
415 description \
416 { \
417 state: "default" 0.0; \
418 color: 255 255 255 0; \
419 visible: 0; \
420 rel1 { relative: rel1x rel1y; offset: offset1x (offset1y - 10); } \
421 rel2 { relative: rel2x rel2y; offset: offset2x (offset2y - 10); } \
422 rel1.to: clipper; \
423 rel2.to: clipper; \
424 } \
425 description \
426 { \
427 state: "visible" 0.0; \
428 inherit: "default" 0.0; \
429 color: 255 255 255 255; \
430 visible: 1; \
431 rel1 { relative: rel1x rel1y; offset: offset1x offset1y; } \
432 rel2 { relative: rel2x rel2y; offset: offset2x offset2y; } \
433 rel1.to: clipper; \
434 rel2.to: clipper; \
435 } \
436} \
437 \
438part \
439{ \
440 name: "glow_clip"id; \
441 type: RECT; \
442 mouse_events: 0; \
443 description \
444 { \
445 state: "default" 0.0; \
446 visible: 0; \
447 color: 255 255 255 0; \
448 rel1.to: "item_"id; \
449 rel2.to: "item_"id; \
450 rel1 { relative: 0.0 0.0; offset: -7 -7; } \
451 rel2 { relative: 1.0 1.0; offset: 6 6; } \
452 } \
453 description \
454 { \
455 state: "visible" 0.0; \
456 inherit: "default" 0.0; \
457 visible: 1; \
458 color: 255 255 255 255; \
459 } \
460} \
461part \
462{ \
463 name: "glow"id; \
464 clip_to: "glow_clip"id; \
465 mouse_events: 0; \
466 description \
467 { \
468 state: "default" 0.0; \
469 image.normal: "editor_bt_glow.png"; \
470 rel1.to: "item_"id; \
471 rel2.to: "item_"id; \
472 rel1 { relative: 0.0 0.0; offset: -7 -7; } \
473 rel2 { relative: 1.0 1.0; offset: 6 6; } \
474 } \
475} \
476 \
477part \
478{ \
479 name: "bg"id; \
480 clip_to: "item_"id; \
481 mouse_events: 0; \
482 description \
483 { \
484 state: "default" 0.0; \
485 image.normal: "editor_bt.png"; \
486 rel1.to: "item_"id; \
487 rel2.to: "item_"id; \
488 } \
489} \
490part \
491{ \
492 name: "item_swallow_"id; \
493 clip_to: "item_"id; \
494 type: SWALLOW; \
495 mouse_events: 0; \
496 description \
497 { \
498 state: "default" 0.0; \
499 rel1 { relative: 0.0 0.0; offset: 12 12; } \
500 rel2 { relative: 1.0 1.0; offset: -12 -12; } \
501 rel1.to: "item_"id; \
502 rel2.to: "item_"id; \
503 } \
504} \
505 \
506part \
507{ \
508 name: "mouse_"id; \
509 type: RECT; \
510 clip_to: clipper; \
511 description \
512 { \
513 state: "default" 0.0; \
514 rel1.to: "item_"id; \
515 rel2.to: "item_"id; \
516 visible: 1; \
517 color: 255 255 255 0; \
518 } \
519} \
520 \
521program \
522{ \
523 name: "on_show"id; \
524 in: tempo 0.0; \
525 signal: "show"; \
526 source: "item"; \
527 action: STATE_SET "visible" 0.0; \
528 transition: DECELERATE 0.3; \
529 target: "item_"id; \
530} \
531program \
532{ \
533 name: "on_hide"id; \
534 signal: "hide"; \
535 source: "menu"; \
536 after: "hide_glow"id; \
537 after: "on_hide_real"id; \
538} \
539program \
540{ \
541 name: "on_hide_real"id; \
542 action: STATE_SET "default" 0.0; \
543 transition: ACCELERATE 0.2; \
544 target: "item_"id; \
545} \
546program \
547{ \
548 name: "on_select"id; \
549 signal: "item,select,"id; \
550 source: "menu"; \
551 after: "anim_glow1"id; \
552} \
553program \
554{ \
555 name: "on_unselect"id; \
556 signal: "item,unselect,"id; \
557 source: "menu"; \
558 action: ACTION_STOP; \
559 target: "anim_glow1"id; \
560 target: "anim_glow2"id; \
561 after: "hide_glow"id; \
562} \
563program \
564{ \
565 name: "on_click"id; \
566 signal: "mouse,down,1"; \
567 source: "mouse_"id; \
568 action: SIGNAL_EMIT "select,"id "menu"; \
569} \
570program \
571{ \
572 name: "on_clicked"id; \
573 signal: "mouse,up,1"; \
574 source: "mouse_"id; \
575 action: SIGNAL_EMIT "clicked,"id "menu"; \
576} \
577program \
578{ \
579 name: "anim_glow1"id; \
580 action: STATE_SET "visible" 0.0; \
581 transition: ACCELERATE 0.2; \
582 target: "glow_clip"id; \
583 after: "anim_glow2"id; \
584} \
585program \
586{ \
587 name: "anim_glow2"id; \
588 action: STATE_SET "default" 0.0; \
589 transition: DECELERATE 0.45; \
590 target: "glow_clip"id; \
591 after: "anim_glow1"id; \
592} \
593program \
594{ \
595 name: "hide_glow"id; \
596 action: STATE_SET "default" 0.0; \
597 transition: ACCELERATE 0.45; \
598 target: "glow_clip"id; \
599}
600
601collections
602{
603 group
604 {
605 name: "main/game/menu_button";
606
607 parts
608 {
609 part
610 {
611 name: "main_clip";
612 type: RECT;
613 description
614 {
615 state: "default" 0.0;
616 color: 255 255 255 0;
617 visible: 0;
618 }
619 description
620 {
621 state: "visible" 0.0;
622 inherit: "default" 0.0;
623 color: 255 255 255 255;
624 visible: 1;
625 }
626 }
627
628 part
629 {
630 name: "button";
631 clip_to: "main_clip";
632 description
633 {
634 state: "default" 0.0;
635 image.normal: "play_menu.png";
636 rel1 { relative: 0.0 0.0; offset: 0+5 0+5; }
637 rel2 { relative: 0.0 0.0; offset: 60+5 32+5; }
638 }
639 }
640 }
641
642 programs
643 {
644 program
645 {
646 name: "on_show";
647 signal: "show";
648 source: "eskiss";
649 action: STATE_SET "visible" 0.0;
650 target: "main_clip";
651 transition: ACCELERATE 0.5;
652 }
653 program
654 {
655 name: "on_hide";
656 signal: "hide";
657 source: "eskiss";
658 action: STATE_SET "default" 0.0;
659 target: "main_clip";
660 transition: DECELERATE 0.5;
661 }
662 program
663 {
664 name: "mouse_click";
665 signal: "mouse,down,1";
666 source: "button";
667 action: SIGNAL_EMIT "click" "menu";
668 }
669 }
670 }
671
672 group
673 {
674 name: "main/menu";
675
676 parts
677 {
678 part
679 {
680 name: "main_clip";
681 type: RECT;
682 description
683 {
684 state: "default" 0.0;
685 color: 255 255 255 0;
686 visible: 0;
687 }
688 description
689 {
690 state: "visible" 0.0;
691 inherit: "default" 0.0;
692 color: 255 255 255 255;
693 visible: 1;
694 }
695 }
696
697 part
698 {
699 name: "title";
700 clip_to: "main_clip";
701 description
702 {
703 state: "default" 0.0;
704 image.normal: "title.png";
705 rel1 { relative: 0.0 0.0; offset: 100 60; }
706 rel2 { relative: 0.0 0.0; offset: 100+498 60+189; }
707 }
708 }
709
710 part
711 {
712 name: "tree";
713 clip_to: "main_clip";
714 description
715 {
716 state: "default" 0.0;
717 image.normal: "tree.png";
718 rel1 { relative: 1.0 1.0; offset: -27-274 -16-474; }
719 rel2 { relative: 1.0 1.0; offset: -27 -16; }
720 }
721 }
722 part
723 {
724 name: "cloud1";
725 clip_to: "main_clip";
726 description
727 {
728 state: "default" 0.0;
729 image.normal: "cloud1.png";
730 rel1 { relative: 0.0 0.0; offset: 123 295; }
731 rel2 { relative: 0.0 0.0; offset: 123+268 295+172; }
732 }
733 }
734 part
735 {
736 name: "cloud2";
737 clip_to: "main_clip";
738 description
739 {
740 state: "default" 0.0;
741 image.normal: "cloud2.png";
742 rel1 { relative: 1.0 0.0; offset: -135-273 64; }
743 rel2 { relative: 1.0 0.0; offset: -135 64+197; }
744 }
745 }
746
747 MENU_ITEM("play", "Play game", "main_clip", 0.0, 0.5, 0.6, 0.5, 0.6, -200, -212, 200, -106)
748 MENU_ITEM("choose_level", "Choose level", "main_clip", 0.1, 0.5, 0.6, 0.5, 0.6, -200, -106, 200, 0)
749 MENU_ITEM("editor", "Level editor", "main_clip", 0.2, 0.5, 0.6, 0.5, 0.6, -200, 0, 200, 106)
750 MENU_ITEM("quit", "Quit", "main_clip", 0.3, 0.5, 0.6, 0.5, 0.6, -200, 106, 200, 212)
751
752 }
753
754 programs
755 {
756 program
757 {
758 name: "on_show";
759 signal: "show";
760 action: STATE_SET "visible" 0.0;
761 transition: DECELERATE 0.8;
762 target: "main_clip";
763 after: "show_menu";
764 }
765 program
766 {
767 name: "on_show2";
768 signal: "show";
769 source: "menu";
770 action: STATE_SET "visible" 0.0;
771 transition: DECELERATE 0.6;
772 target: "main_clip";
773 }
774 program
775 {
776 name: "on_hide";
777 signal: "hide";
778 action: STATE_SET "default" 0.0;
779 target: "main_clip";
780 after: "on_hide_anim";
781 }
782 program
783 {
784 name: "on_hide_anim";
785 signal: "hide";
786 source: "menu";
787 action: STATE_SET "default" 0.0;
788 transition: DECELERATE 0.3;
789 target: "main_clip";
790 after: "hide_done";
791 }
792
793 program
794 {
795 name: "show_menu";
796 action: SIGNAL_EMIT "show" "menu";
797 }
798 program
799 {
800 name: "hide_done";
801 action: SIGNAL_EMIT "hidden" "menu";
802 }
803 }
804 }
805
806
807 group
808 {
809 name: "editor/menu";
810
811 parts
812 {
813 part
814 {
815 name: "main_clip";
816 type: RECT;
817 description
818 {
819 state: "default" 0.0;
820 color: 255 255 255 0;
821 visible: 0;
822 }
823 description
824 {
825 state: "visible" 0.0;
826 inherit: "default" 0.0;
827 color: 255 255 255 255;
828 visible: 1;
829 }
830 }
831
832 part
833 {
834 name: "menu_bg";
835 clip_to: "main_clip";
836 description
837 {
838 state: "default" 0.0;
839 image.normal: "editor_bg.png";
840 image.border: 73 60 60 67;
841 rel1 { relative: 0.5 0.0; offset: -463 -257; }
842 rel2 { relative: 0.5 0.0; offset: 463 -1; }
843 }
844 description
845 {
846 state: "visible" 0.0;
847 inherit: "default" 0.0;
848 rel1 { relative: 0.5 0.0; offset: -463 -125; }
849 rel2 { relative: 0.5 0.0; offset: 463 132; }
850 }
851 }
852
853 part
854 {
855 name: "button_clip";
856 clip_to: "main_clip";
857 description
858 {
859 state: "default" 0.0;
860 rel1.to: "menu_bg";
861 rel2.to: "menu_bg";
862 }
863 }
864
865 EDITOR_ITEM("draw", "editor_bt_pencil.png", "button_clip", 0.0, 0.0, 0.0, 0.0, 0.0, 48, 136, 127, 208)
866 EDITOR_ITEM("draw_static", "editor_bt_static.png", "button_clip", 0.05, 0.0, 0.0, 0.0, 0.0, 142, 136, 221, 208)
867 EDITOR_ITEM("draw_nophysic", "editor_bt_background.png", "button_clip", 0.1, 0.0, 0.0, 0.0, 0.0, 236, 136, 315, 208)
868 EDITOR_ITEM("move", "editor_bt_move.png", "button_clip", 0.15, 0.0, 0.0, 0.0, 0.0, 330, 136, 409, 208)
869 EDITOR_ITEM("color", "editor_bt_color.png", "button_clip", 0.20, 0.0, 0.0, 0.0, 0.0, 424, 136, 503, 208)
870 EDITOR_ITEM("play", "editor_bt_play.png", "button_clip", 0.25, 0.0, 0.0, 0.0, 0.0, 518, 136, 597, 208)
871 EDITOR_ITEM("open", "editor_bt_open.png", "button_clip", 0.30, 0.0, 0.0, 0.0, 0.0, 612, 136, 691, 208)
872 EDITOR_ITEM("save", "editor_bt_save.png", "button_clip", 0.35, 0.0, 0.0, 0.0, 0.0, 706, 136, 785, 208)
873 EDITOR_ITEM("menu", "editor_bt_menu.png", "button_clip", 0.40, 0.0, 0.0, 0.0, 0.0, 800, 136, 879, 208)
874
875 }
876
877 programs
878 {
879 program
880 {
881 name: "on_show";
882 signal: "show";
883 after: "on_show2";
884 }
885 program
886 {
887 name: "on_show2";
888 signal: "show";
889 source: "menu";
890 action: STATE_SET "visible" 0.0;
891 transition: DECELERATE 0.8;
892 target: "main_clip";
893 target: "menu_bg";
894 after: "show_items";
895 }
896 program
897 {
898 name: "on_hide";
899 signal: "hide";
900 action: STATE_SET "default" 0.0;
901 target: "main_clip";
902 target: "menu_bg";
903 after: "on_hide_anim";
904 }
905 program
906 {
907 name: "on_hide_anim";
908 signal: "hide";
909 source: "menu";
910 action: STATE_SET "default" 0.0;
911 transition: DECELERATE 0.3;
912 target: "main_clip";
913 target: "menu_bg";
914 after: "hide_done";
915 }
916
917 program
918 {
919 name: "show_items";
920 action: SIGNAL_EMIT "show" "item";
921 }
922 program
923 {
924 name: "hide_done";
925 action: SIGNAL_EMIT "hidden" "menu";
926 }
927 }
928 }
929
930 group
931 {
932 name: "editor/menu/running";
933
934 parts
935 {
936 part
937 {
938 name: "main_clip";
939 type: RECT;
940 description
941 {
942 state: "default" 0.0;
943 color: 255 255 255 0;
944 visible: 0;
945 }
946 description
947 {
948 state: "visible" 0.0;
949 inherit: "default" 0.0;
950 color: 255 255 255 255;
951 visible: 1;
952 }
953 }
954
955 part
956 {
957 name: "menu_bg";
958 clip_to: "main_clip";
959 description
960 {
961 state: "default" 0.0;
962 image.normal: "editor_bg.png";
963 image.border: 73 60 60 67;
964 rel1 { relative: 0.75 0.0; offset: -87 -257; }
965 rel2 { relative: 0.75 0.0; offset: 87 -1; }
966 }
967 description
968 {
969 state: "visible" 0.0;
970 inherit: "default" 0.0;
971 rel1 { relative: 0.75 0.0; offset: -87 -125; }
972 rel2 { relative: 0.75 0.0; offset: 87 132; }
973 }
974 }
975
976 part
977 {
978 name: "button_clip";
979 clip_to: "main_clip";
980 description
981 {
982 state: "default" 0.0;
983 rel1.to: "menu_bg";
984 rel2.to: "menu_bg";
985 }
986 }
987
988 EDITOR_ITEM("stop", "editor_bt_stop.png", "button_clip", 0.0, 0.0, 0.0, 0.0, 0.0, 48, 136, 127, 208)
989
990 }
991
992 programs
993 {
994 program
995 {
996 name: "on_show";
997 signal: "show";
998 after: "on_show2";
999 }
1000 program
1001 {
1002 name: "on_show2";
1003 signal: "show";
1004 source: "menu";
1005 action: STATE_SET "visible" 0.0;
1006 transition: DECELERATE 0.8;
1007 target: "main_clip";
1008 target: "menu_bg";
1009 after: "show_items";
1010 }
1011 program
1012 {
1013 name: "on_hide";
1014 signal: "hide";
1015 action: STATE_SET "default" 0.0;
1016 target: "main_clip";
1017 target: "menu_bg";
1018 after: "on_hide_anim";
1019 }
1020 program
1021 {
1022 name: "on_hide_anim";
1023 signal: "hide";
1024 source: "menu";
1025 action: STATE_SET "default" 0.0;
1026 transition: DECELERATE 0.3;
1027 target: "main_clip";
1028 target: "menu_bg";
1029 after: "hide_done";
1030 }
1031
1032 program
1033 {
1034 name: "show_items";
1035 action: SIGNAL_EMIT "show" "item";
1036 }
1037 program
1038 {
1039 name: "hide_done";
1040 action: SIGNAL_EMIT "running,hidden" "menu";
1041 }
1042 }
1043 }
1044
1045 group
1046 {
1047 name: "editor/menu/color";
1048
1049 parts
1050 {
1051 part
1052 {
1053 name: "main_clip";
1054 type: RECT;
1055 description
1056 {
1057 state: "default" 0.0;
1058 color: 255 255 255 0;
1059 visible: 0;
1060 }
1061 description
1062 {
1063 state: "visible" 0.0;
1064 inherit: "default" 0.0;
1065 color: 255 255 255 255;
1066 visible: 1;
1067 }
1068 }
1069
1070 part
1071 {
1072 name: "menu_bg";
1073 clip_to: "main_clip";
1074 description
1075 {
1076 state: "default" 0.0;
1077 image.normal: "editor_bg.png";
1078 image.border: 73 60 60 67;
1079 rel1 { relative: 0.5 0.0; offset: -416 -257; }
1080 rel2 { relative: 0.5 0.0; offset: 416 -1; }
1081 }
1082 description
1083 {
1084 state: "visible" 0.0;
1085 inherit: "default" 0.0;
1086 rel1 { relative: 0.5 0.0; offset: -416 -125; }
1087 rel2 { relative: 0.5 0.0; offset: 416 132; }
1088 }
1089 }
1090
1091 part
1092 {
1093 name: "button_clip";
1094 clip_to: "main_clip";
1095 description
1096 {
1097 state: "default" 0.0;
1098 rel1.to: "menu_bg";
1099 rel2.to: "menu_bg";
1100 }
1101 }
1102
1103 EDITOR_ITEM_SWALLOW("0", "button_clip", 0.0, 0.0, 0.0, 0.0, 0.0, 48, 136, 127, 208)
1104 EDITOR_ITEM_SWALLOW("1", "button_clip", 0.05, 0.0, 0.0, 0.0, 0.0, 142, 136, 221, 208)
1105 EDITOR_ITEM_SWALLOW("2", "button_clip", 0.1, 0.0, 0.0, 0.0, 0.0, 236, 136, 315, 208)
1106 EDITOR_ITEM_SWALLOW("3", "button_clip", 0.15, 0.0, 0.0, 0.0, 0.0, 330, 136, 409, 208)
1107 EDITOR_ITEM_SWALLOW("4", "button_clip", 0.20, 0.0, 0.0, 0.0, 0.0, 424, 136, 503, 208)
1108 EDITOR_ITEM_SWALLOW("5", "button_clip", 0.25, 0.0, 0.0, 0.0, 0.0, 518, 136, 597, 208)
1109 EDITOR_ITEM_SWALLOW("6", "button_clip", 0.30, 0.0, 0.0, 0.0, 0.0, 612, 136, 691, 208)
1110 EDITOR_ITEM_SWALLOW("7", "button_clip", 0.35, 0.0, 0.0, 0.0, 0.0, 706, 136, 785, 208)
1111
1112 }
1113
1114 programs
1115 {
1116 program
1117 {
1118 name: "on_show";
1119 signal: "show";
1120 after: "on_show_2";
1121 }
1122 program
1123 {
1124 name: "on_show_2";
1125 signal: "show";
1126 source: "menu";
1127 action: STATE_SET "visible" 0.0;
1128 transition: DECELERATE 0.8;
1129 target: "main_clip";
1130 target: "menu_bg";
1131 after: "show_items";
1132 }
1133 program
1134 {
1135 name: "on_hide";
1136 signal: "hide";
1137 action: STATE_SET "default" 0.0;
1138 target: "main_clip";
1139 target: "menu_bg";
1140 after: "on_hide_anim";
1141 }
1142 program
1143 {
1144 name: "on_hide_anim";
1145 signal: "hide";
1146 source: "menu";
1147 action: STATE_SET "default" 0.0;
1148 transition: DECELERATE 0.3;
1149 target: "main_clip";
1150 target: "menu_bg";
1151 after: "hide_done";
1152 }
1153
1154 program
1155 {
1156 name: "show_items";
1157 action: SIGNAL_EMIT "show" "item";
1158 }
1159 program
1160 {
1161 name: "hide_done";
1162 action: SIGNAL_EMIT "color,hidden" "menu";
1163 }
1164 }
1165 }
1166
1167
1168 group
1169 {
1170 name: "main/ball";
1171 min: 70 70;
1172 max: 70 70;
1173
1174 data
1175 {
1176 item: "radius" "28";
1177 item: "center" "35,35";
1178 }
1179
1180 parts
1181 {
1182 part
1183 {
1184 name: "main_clip";
1185 type: RECT;
1186 mouse_events: 0;
1187 description
1188 {
1189 state: "default" 0.0;
1190 color: 255 255 255 0;
1191 visible: 0;
1192 }
1193 description
1194 {
1195 state: "visible" 0.0;
1196 inherit: "default" 0.0;
1197 color: 255 255 255 255;
1198 visible: 1;
1199 }
1200 }
1201
1202 part
1203 {
1204 name: "ball01";
1205 clip_to: "main_clip";
1206 mouse_events: 0;
1207 description
1208 {
1209 state: "default" 0.0;
1210 image.normal: "ball_01.png";
1211 visible: 0;
1212 color: 255 255 255 0;
1213 }
1214 description
1215 {
1216 state: "visible" 0.0;
1217 inherit: "default" 0.0;
1218 visible: 1;
1219 color: 255 255 255 255;
1220 }
1221 }
1222
1223 part
1224 {
1225 name: "ball02";
1226 clip_to: "main_clip";
1227 mouse_events: 0;
1228 description
1229 {
1230 state: "default" 0.0;
1231 image.normal: "ball_02.png";
1232 visible: 0;
1233 color: 255 255 255 0;
1234 }
1235 description
1236 {
1237 state: "visible" 0.0;
1238 inherit: "default" 0.0;
1239 visible: 1;
1240 color: 255 255 255 255;
1241 }
1242 }
1243
1244 part
1245 {
1246 name: "ball03";
1247 clip_to: "main_clip";
1248 mouse_events: 0;
1249 description
1250 {
1251 state: "default" 0.0;
1252 image.normal: "ball_03.png";
1253 visible: 0;
1254 color: 255 255 255 0;
1255 }
1256 description
1257 {
1258 state: "visible" 0.0;
1259 inherit: "default" 0.0;
1260 visible: 1;
1261 color: 255 255 255 255;
1262 }
1263 }
1264 part
1265 {
1266 name: "mouse_catcher";
1267 type: RECT;
1268 mouse_events: 1;
1269 repeat_events: 1;
1270 description
1271 {
1272 state: "default" 0.0;
1273 color: 255 255 255 0;
1274 visible: 1;
1275 }
1276 }
1277 }
1278
1279 programs
1280 {
1281 program
1282 {
1283 name: "on_show";
1284 signal: "show";
1285 after: "on_show_2";
1286 }
1287 program
1288 {
1289 name: "on_show_2";
1290 signal: "show";
1291 source: "ball";
1292 action: STATE_SET "visible" 0.0;
1293 transition: DECELERATE 0.15;
1294 target: "main_clip";
1295 after: "start_anim";
1296 }
1297 program
1298 {
1299 name: "on_hide";
1300 signal: "hide";
1301 action: STATE_SET "default" 0.0;
1302 target: "main_clip";
1303 after: "stop_anim";
1304 }
1305 program
1306 {
1307 name: "on_hide_anim";
1308 signal: "hide";
1309 source: "ball";
1310 action: STATE_SET "default" 0.0;
1311 transition: DECELERATE 0.3;
1312 target: "main_clip";
1313 after: "stop_anim";
1314 after: "hide_done";
1315 }
1316
1317 program
1318 {
1319 name: "hide_done";
1320 action: SIGNAL_EMIT "hidden" "ball";
1321 }
1322
1323 #define ANIM_SPEED 0.1
1324 #define PROG_WAIT_SPEED 0.05
1325 program
1326 {
1327 name: "show_ball01";
1328 action: STATE_SET "visible" 0.0;
1329 transition: DECELERATE ANIM_SPEED;
1330 target: "ball01";
1331 }
1332 program
1333 {
1334 name: "hide_ball01";
1335 action: STATE_SET "default" 0.0;
1336 transition: ACCELERATE ANIM_SPEED;
1337 target: "ball01";
1338 }
1339 program
1340 {
1341 name: "show_ball02";
1342 action: STATE_SET "visible" 0.0;
1343 transition: DECELERATE ANIM_SPEED;
1344 target: "ball02";
1345 }
1346 program
1347 {
1348 name: "hide_ball02";
1349 action: STATE_SET "default" 0.0;
1350 transition: ACCELERATE ANIM_SPEED;
1351 target: "ball02";
1352 }
1353 program
1354 {
1355 name: "show_ball03";
1356 action: STATE_SET "visible" 0.0;
1357 transition: DECELERATE ANIM_SPEED;
1358 target: "ball03";
1359 }
1360 program
1361 {
1362 name: "hide_ball03";
1363 action: STATE_SET "default" 0.0;
1364 transition: ACCELERATE ANIM_SPEED;
1365 target: "ball03";
1366 }
1367
1368 program
1369 {
1370 name: "start_anim";
1371 after: "hide_ball02";
1372 after: "hide_ball03";
1373 after: "show_ball01";
1374 after: "anim_loop2";
1375 }
1376
1377 program
1378 {
1379 name: "stop_anim";
1380 action: ACTION_STOP;
1381 target: "anim_loop2";
1382 target: "anim_loop3";
1383 target: "anim_loop4";
1384 }
1385
1386 program
1387 {
1388 name: "anim_loop2";
1389 in: PROG_WAIT_SPEED 0.1;
1390 after: "hide_ball01";
1391 after: "hide_ball03";
1392 after: "show_ball02";
1393 after: "anim_loop3";
1394 }
1395
1396 program
1397 {
1398 name: "anim_loop3";
1399 in: PROG_WAIT_SPEED 0.1;
1400 after: "hide_ball01";
1401 after: "hide_ball02";
1402 after: "show_ball03";
1403 after: "anim_loop4";
1404 }
1405
1406 program
1407 {
1408 name: "anim_loop4";
1409 in: PROG_WAIT_SPEED 0.1;
1410 after: "hide_ball02";
1411 after: "hide_ball03";
1412 after: "show_ball01";
1413 after: "anim_loop2";
1414 }
1415 }
1416 }
1417
1418 group
1419 {
1420 name: "main/goal";
1421 min: 87 81;
1422 max: 87 81;
1423
1424 data
1425 {
1426 //List of points for the physic object
1427 item: "thickness" "7";
1428 item: "points" "8,41 28,50 33,73 50,61 70,66 61,50 76,28 54,33 50,11 36,29";
1429 }
1430
1431 parts
1432 {
1433 part
1434 {
1435 name: "main_clip";
1436 type: RECT;
1437 mouse_events: 0;
1438 description
1439 {
1440 state: "default" 0.0;
1441 color: 255 255 255 0;
1442 visible: 0;
1443 }
1444 description
1445 {
1446 state: "visible" 0.0;
1447 inherit: "default" 0.0;
1448 color: 255 255 255 255;
1449 visible: 1;
1450 }
1451 }
1452
1453 part
1454 {
1455 name: "goal01";
1456 clip_to: "main_clip";
1457 mouse_events: 0;
1458 description
1459 {
1460 state: "default" 0.0;
1461 image.normal: "goal_01.png";
1462 visible: 0;
1463 color: 255 255 255 0;
1464 }
1465 description
1466 {
1467 state: "visible" 0.0;
1468 inherit: "default" 0.0;
1469 visible: 1;
1470 color: 255 255 255 255;
1471 }
1472 }
1473
1474 part
1475 {
1476 name: "goal02";
1477 clip_to: "main_clip";
1478 mouse_events: 0;
1479 description
1480 {
1481 state: "default" 0.0;
1482 image.normal: "goal_02.png";
1483 visible: 0;
1484 color: 255 255 255 0;
1485 }
1486 description
1487 {
1488 state: "visible" 0.0;
1489 inherit: "default" 0.0;
1490 visible: 1;
1491 color: 255 255 255 255;
1492 }
1493 }
1494
1495 part
1496 {
1497 name: "goal03";
1498 clip_to: "main_clip";
1499 mouse_events: 0;
1500 description
1501 {
1502 state: "default" 0.0;
1503 image.normal: "goal_03.png";
1504 visible: 0;
1505 color: 255 255 255 0;
1506 }
1507 description
1508 {
1509 state: "visible" 0.0;
1510 inherit: "default" 0.0;
1511 visible: 1;
1512 color: 255 255 255 255;
1513 }
1514 }
1515 part
1516 {
1517 name: "mouse_catcher";
1518 type: RECT;
1519 mouse_events: 1;
1520 repeat_events: 1;
1521 description
1522 {
1523 state: "default" 0.0;
1524 color: 255 255 255 0;
1525 visible: 1;
1526 }
1527 }
1528 }
1529
1530 programs
1531 {
1532 program
1533 {
1534 name: "on_show";
1535 signal: "show";
1536 after: "on_show_2";
1537 }
1538 program
1539 {
1540 name: "on_show_2";
1541 signal: "show";
1542 source: "goal";
1543 action: STATE_SET "visible" 0.0;
1544 transition: DECELERATE 0.15;
1545 target: "main_clip";
1546 after: "start_anim";
1547 }
1548 program
1549 {
1550 name: "on_hide";
1551 signal: "hide";
1552 action: STATE_SET "default" 0.0;
1553 target: "main_clip";
1554 after: "stop_anim";
1555 }
1556 program
1557 {
1558 name: "on_hide_anim";
1559 signal: "hide";
1560 source: "goal";
1561 action: STATE_SET "default" 0.0;
1562 transition: DECELERATE 0.3;
1563 target: "main_clip";
1564 after: "stop_anim";
1565 after: "hide_done";
1566 }
1567
1568 program
1569 {
1570 name: "hide_done";
1571 action: SIGNAL_EMIT "hidden" "goal";
1572 }
1573
1574 #define ANIM_SPEED 0.1
1575 #define PROG_WAIT_SPEED 0.05
1576 program
1577 {
1578 name: "show_goal01";
1579 action: STATE_SET "visible" 0.0;
1580 transition: DECELERATE ANIM_SPEED;
1581 target: "goal01";
1582 }
1583 program
1584 {
1585 name: "hide_goal01";
1586 action: STATE_SET "default" 0.0;
1587 transition: ACCELERATE ANIM_SPEED;
1588 target: "goal01";
1589 }
1590 program
1591 {
1592 name: "show_goal02";
1593 action: STATE_SET "visible" 0.0;
1594 transition: DECELERATE ANIM_SPEED;
1595 target: "goal02";
1596 }
1597 program
1598 {
1599 name: "hide_goal02";
1600 action: STATE_SET "default" 0.0;
1601 transition: ACCELERATE ANIM_SPEED;
1602 target: "goal02";
1603 }
1604 program
1605 {
1606 name: "show_goal03";
1607 action: STATE_SET "visible" 0.0;
1608 transition: DECELERATE ANIM_SPEED;
1609 target: "goal03";
1610 }
1611 program
1612 {
1613 name: "hide_goal03";
1614 action: STATE_SET "default" 0.0;
1615 transition: ACCELERATE ANIM_SPEED;
1616 target: "goal03";
1617 }
1618
1619 program
1620 {
1621 name: "start_anim";
1622 after: "hide_goal02";
1623 after: "hide_goal03";
1624 after: "show_goal01";
1625 after: "anim_loop2";
1626 }
1627
1628 program
1629 {
1630 name: "stop_anim";
1631 action: ACTION_STOP;
1632 target: "anim_loop2";
1633 target: "anim_loop3";
1634 target: "anim_loop4";
1635 }
1636
1637 program
1638 {
1639 name: "anim_loop2";
1640 in: PROG_WAIT_SPEED 0.1;
1641 after: "hide_goal01";
1642 after: "hide_goal03";
1643 after: "show_goal02";
1644 after: "anim_loop3";
1645 }
1646
1647 program
1648 {
1649 name: "anim_loop3";
1650 in: PROG_WAIT_SPEED 0.1;
1651 after: "hide_goal01";
1652 after: "hide_goal02";
1653 after: "show_goal03";
1654 after: "anim_loop4";
1655 }
1656
1657 program
1658 {
1659 name: "anim_loop4";
1660 in: PROG_WAIT_SPEED 0.1;
1661 after: "hide_goal02";
1662 after: "hide_goal03";
1663 after: "show_goal01";
1664 after: "anim_loop2";
1665 }
1666 }
1667 }
1668
1669 group
1670 {
1671 name: "dialog/win/rotated";
1672
1673 parts
1674 {
1675 part
1676 {
1677 name: "bg";
1678 mouse_events: 0;
1679 description
1680 {
1681 state: "default" 0.0;
1682 image.normal: "editor_bg.png";
1683 }
1684 }
1685
1686 part
1687 {
1688 name: "text";
1689 type: TEXT;
1690 mouse_events: 0;
1691 description
1692 {
1693 state: "default" 0.0;
1694 color: 162 119 0 255;
1695 text { text: "Great, you WIN !"; font: "CalaosContentBold"; size: 35; align: 0.5 0.5; }
1696 }
1697 }
1698
1699 part
1700 {
1701 name: "button_menu_clip";
1702 mouse_events: 0;
1703 type: RECT;
1704 description
1705 {
1706 state: "default" 0.0;
1707 rel1 { relative: 0.0 0.5; offset: 40 -36; }
1708 rel2 { relative: 0.0 0.5; offset: 109 36; }
1709 }
1710 }
1711 part
1712 {
1713 name: "button_next_clip";
1714 mouse_events: 0;
1715 type: RECT;
1716 description
1717 {
1718 state: "default" 0.0;
1719 rel1 { relative: 1.0 0.5; offset: -109 -36; }
1720 rel2 { relative: 1.0 0.5; offset: -40 36; }
1721 }
1722 }
1723
1724 EDITOR_ITEM("menu", "editor_bt_menu.png", "button_menu_clip", 0.0, 0.0, 0.0, 1.0, 1.0, 0, 0, -1, -1)
1725 EDITOR_ITEM("next", "editor_bt_play.png", "button_next_clip", 0.0, 0.0, 0.0, 1.0, 1.0, 0, 0, -1, -1)
1726 }
1727
1728 programs
1729 {
1730 program
1731 {
1732 name: "on_show";
1733 signal: "show";
1734 action: SIGNAL_EMIT "show" "item";
1735 }
1736 }
1737 }
1738
1739 group
1740 {
1741 name: "dialog/win";
1742
1743 parts
1744 {
1745 part
1746 {
1747 name: "main_clip";
1748 type: RECT;
1749 mouse_events: 0;
1750 description
1751 {
1752 state: "default" 0.0;
1753 color: 255 255 255 255;
1754 visible: 1;
1755 rel1 { relative: 0.5 0.0; offset: -584/2 -257-10; }
1756 rel2 { relative: 0.5 0.0; offset: 584/2 -10; }
1757 map.on: 1;
1758 map.perspective_on: 1;
1759 }
1760 description
1761 {
1762 state: "visible" 0.1;
1763 inherit: "default" 0.0;
1764 color: 255 255 255 255;
1765 visible: 1;
1766 rel1 { relative: 0.5 0.5; offset: -584/2 -257/2; }
1767 rel2 { relative: 0.5 0.5; offset: 584/2 257/2; }
1768 map.rotation.z: 5.0;
1769 }
1770 description
1771 {
1772 state: "visible" 0.2;
1773 inherit: "default" 0.0;
1774 color: 255 255 255 255;
1775 visible: 1;
1776 rel1 { relative: 0.5 0.5; offset: -584/2 -257/2-15; }
1777 rel2 { relative: 0.5 0.5; offset: 584/2 257/2-15; }
1778 map.rotation.z: -1.0;
1779 }
1780 description
1781 {
1782 state: "visible" 0.3;
1783 inherit: "default" 0.0;
1784 color: 255 255 255 255;
1785 visible: 1;
1786 rel1 { relative: 0.5 0.5; offset: -584/2 -257/2; }
1787 rel2 { relative: 0.5 0.5; offset: 584/2 257/2; }
1788 map.rotation.z: -5.0;
1789 }
1790 description
1791 {
1792 state: "visible" 0.4;
1793 inherit: "default" 0.0;
1794 color: 255 255 255 255;
1795 visible: 1;
1796 rel1 { relative: 0.5 0.5; offset: -584/2 -257/2-7; }
1797 rel2 { relative: 0.5 0.5; offset: 584/2 257/2-7; }
1798 map.rotation.z: 1.0;
1799 }
1800 description
1801 {
1802 state: "visible" 0.5;
1803 inherit: "default" 0.0;
1804 color: 255 255 255 255;
1805 visible: 1;
1806 rel1 { relative: 0.5 0.5; offset: -584/2 -257/2; }
1807 rel2 { relative: 0.5 0.5; offset: 584/2 257/2; }
1808 map.rotation.z: 0.0;
1809 }
1810 description
1811 {
1812 state: "hide" 0.0;
1813 inherit: "default" 0.0;
1814 color: 255 255 255 0;
1815 visible: 1;
1816 rel1 { relative: 0.5 0.5; offset: -584/2 -257/2; }
1817 rel2 { relative: 0.5 0.5; offset: 584/2 257/2; }
1818 map.rotation.y: 180;
1819 }
1820 }
1821
1822 part
1823 {
1824 name: "group";
1825 type: GROUP;
1826 source: "dialog/win/rotated";
1827 clip_to: "main_clip";
1828 description
1829 {
1830 state: "default" 0.0;
1831 rel1.to: "main_clip";
1832 rel2.to: "main_clip";
1833 map.on: 1;
1834 map.perspective_on: 1;
1835 map.backface_cull: 1;
1836 }
1837 description
1838 {
1839 state: "visible" 0.1;
1840 inherit: "default" 0.0;
1841 map.rotation.z: 5.0;
1842 }
1843 description
1844 {
1845 state: "visible" 0.2;
1846 inherit: "default" 0.0;
1847 map.rotation.z: -1.0;
1848 }
1849 description
1850 {
1851 state: "visible" 0.3;
1852 inherit: "default" 0.0;
1853 map.rotation.z: -5.0;
1854 }
1855 description
1856 {
1857 state: "visible" 0.4;
1858 inherit: "default" 0.0;
1859 map.rotation.z: 1.0;
1860 }
1861 description
1862 {
1863 state: "visible" 0.5;
1864 inherit: "default" 0.0;
1865 map.rotation.z: 0.0;
1866 }
1867 description
1868 {
1869 state: "hide" 0.0;
1870 inherit: "default" 0.0;
1871 map.rotation.y: 180;
1872 }
1873 }
1874 }
1875
1876 programs
1877 {
1878 program
1879 {
1880 name: "on_show";
1881 signal: "show";
1882 source: "dialog";
1883 action: STATE_SET "visible" 0.1;
1884 transition: ACCELERATE 0.75;
1885 target: "main_clip";
1886 target: "group";
1887 after: "on_show_anim_2";
1888 }
1889 program
1890 {
1891 name: "on_show_anim_2";
1892 action: STATE_SET "visible" 0.2;
1893 transition: DECELERATE 0.15;
1894 target: "main_clip";
1895 target: "group";
1896 after: "on_show_anim_3";
1897 }
1898 program
1899 {
1900 name: "on_show_anim_3";
1901 action: STATE_SET "visible" 0.3;
1902 transition: ACCELERATE 0.15;
1903 target: "main_clip";
1904 target: "group";
1905 after: "on_show_anim_4";
1906 }
1907 program
1908 {
1909 name: "on_show_anim_4";
1910 action: STATE_SET "visible" 0.4;
1911 transition: DECELERATE 0.15;
1912 target: "main_clip";
1913 target: "group";
1914 after: "on_show_anim_5";
1915 }
1916 program
1917 {
1918 name: "on_show_anim_5";
1919 action: STATE_SET "visible" 0.5;
1920 transition: ACCELERATE 0.15;
1921 target: "main_clip";
1922 target: "group";
1923 }
1924
1925 program
1926 {
1927 name: "on_hide";
1928 signal: "hide";
1929 source: "dialog";
1930 action: STATE_SET "hide" 0.0;
1931 transition: ACCELERATE 0.7;
1932 target: "main_clip";
1933 target: "group";
1934 after: "on_hide_2";
1935 }
1936 program
1937 {
1938 name: "on_hide_2";
1939 action: STATE_SET "default" 0.0;
1940 target: "main_clip";
1941 target: "group";
1942 after: "on_hidden";
1943 }
1944 program
1945 {
1946 name: "on_hidden";
1947 action: SIGNAL_EMIT "hidden" "dialog";
1948 }
1949 }
1950
1951 }
1952
1953#define ITEM_TABLE(num) \
1954 group \
1955 { \
1956 name: "dialog/level_list/item/"num; \
1957 \
1958 parts \
1959 { \
1960 part \
1961 { \
1962 name: "main_clip"; \
1963 type: RECT; \
1964 description \
1965 { \
1966 state: "default" 0.0; \
1967 color: 255 255 255 0; \
1968 visible: 0; \
1969 } \
1970 description \
1971 { \
1972 state: "visible" 0.0; \
1973 inherit: "default" 0.0; \
1974 color: 255 255 255 255; \
1975 visible: 1; \
1976 } \
1977 } \
1978 \
1979 part \
1980 { \
1981 name: "load_clip"; \
1982 clip_to: "main_clip"; \
1983 type: RECT; \
1984 description \
1985 { \
1986 state: "default" 0.0; \
1987 color: 255 255 255 0; \
1988 visible: 0; \
1989 } \
1990 description \
1991 { \
1992 state: "visible" 0.0; \
1993 inherit: "default" 0.0; \
1994 color: 255 255 255 255; \
1995 visible: 1; \
1996 } \
1997 } \
1998 \
1999 part \
2000 { \
2001 name: "loading"; \
2002 clip_to: "load_clip"; \
2003 description \
2004 { \
2005 state: "default" 0.0; \
2006 image.normal: "load_anim_01.png"; \
2007 rel1 { relative: 0.5 0.5; offset: -15 -15; } \
2008 rel2 { relative: 0.5 0.5; offset: 15 15; } \
2009 map.on: 1; \
2010 } \
2011 description \
2012 { \
2013 state: "rotate" 0.0; \
2014 inherit: "default" 0.0; \
2015 map.rotation.z: 360.0; \
2016 } \
2017 } \
2018 \
2019 part \
2020 { \
2021 name: "thumb_clip"; \
2022 clip_to: "main_clip"; \
2023 type: RECT; \
2024 description \
2025 { \
2026 state: "default" 0.0; \
2027 color: 255 255 255 0; \
2028 visible: 0; \
2029 } \
2030 description \
2031 { \
2032 state: "visible" 0.0; \
2033 inherit: "default" 0.0; \
2034 color: 255 255 255 255; \
2035 visible: 1; \
2036 } \
2037 } \
2038 part \
2039 { \
2040 name: "bg_thumb"; \
2041 clip_to: "main_clip"; \
2042 description \
2043 { \
2044 state: "default" 0.0; \
2045 image.normal: "background_02.png"; \
2046 } \
2047 } \
2048 \
2049 part \
2050 { \
2051 name: "item.thumb"; \
2052 clip_to: "thumb_clip"; \
2053 type: SWALLOW; \
2054 description \
2055 { \
2056 state: "default" 0.0; \
2057 rel1 { relative: 0.0 0.0; offset: 16 16; } \
2058 rel2 { relative: 1.0 1.0; offset: -16 -16; } \
2059 } \
2060 } \
2061 \
2062 part \
2063 { \
2064 name: "mouse_mask"; \
2065 clip_to: "thumb_clip"; \
2066 type: RECT; \
2067 description \
2068 { \
2069 state: "default" 0.0; \
2070 color: 0 0 0 0; \
2071 } \
2072 } \
2073 } \
2074 \
2075 programs \
2076 { \
2077 \
2078 program \
2079 { \
2080 name: "on_show"; \
2081 signal: "show"; \
2082 } \
2083 \
2084 program \
2085 { \
2086 name: "item_enable"; \
2087 signal: "enable"; \
2088 source: "item"; \
2089 action: STATE_SET "visible" 0.0; \
2090 transition: DECELERATE 0.5; \
2091 target: "main_clip"; \
2092 } \
2093 \
2094 program \
2095 { \
2096 name: "item_disable"; \
2097 signal: "disable"; \
2098 source: "item"; \
2099 action: STATE_SET "default" 0.0; \
2100 transition: DECELERATE 0.5; \
2101 target: "main_clip"; \
2102 } \
2103 \
2104 program \
2105 { \
2106 name: "loading"; \
2107 signal: "load,start"; \
2108 source: "item"; \
2109 after: "hide_swallow"; \
2110 after: "start_load_anim"; \
2111 after: "show_loader"; \
2112 } \
2113 \
2114 program \
2115 { \
2116 name: "loading_done"; \
2117 signal: "load,done"; \
2118 source: "item"; \
2119 after: "show_swallow"; \
2120 after: "stop_load_anim"; \
2121 after: "hide_loader"; \
2122 } \
2123 \
2124 program \
2125 { \
2126 name: "hide_loader"; \
2127 action: STATE_SET "default" 0.0; \
2128 transition: DECELERATE 0.5; \
2129 target: "load_clip"; \
2130 } \
2131 program \
2132 { \
2133 name: "show_loader"; \
2134 action: STATE_SET "visible" 0.0; \
2135 transition: ACCELERATE 0.4; \
2136 target: "load_clip"; \
2137 } \
2138 \
2139 program \
2140 { \
2141 name: "start_load_anim"; \
2142 action: STATE_SET "rotate" 0.0; \
2143 transition: LINEAR 1.0; \
2144 target: "loading"; \
2145 after: "load_anim_loop"; \
2146 } \
2147 program \
2148 { \
2149 name: "load_anim_loop"; \
2150 action: STATE_SET "default" 0.0; \
2151 target: "loading"; \
2152 after: "start_load_anim"; \
2153 } \
2154 \
2155 program \
2156 { \
2157 name: "stop_load_anim"; \
2158 action: ACTION_STOP; \
2159 target: "start_load_anim"; \
2160 target: "load_anim_loop"; \
2161 } \
2162 \
2163 program \
2164 { \
2165 name: "show_swallow"; \
2166 action: STATE_SET "visible" 0.0; \
2167 transition: DECELERATE 0.2; \
2168 target: "thumb_clip"; \
2169 } \
2170 \
2171 program \
2172 { \
2173 name: "hide_swallow"; \
2174 action: STATE_SET "default" 0.0; \
2175 transition: DECELERATE 0.2; \
2176 target: "thumb_clip"; \
2177 } \
2178 \
2179 program \
2180 { \
2181 name: "click"; \
2182 signal: "mouse,up,1"; \
2183 source: "mouse_mask"; \
2184 action: SIGNAL_EMIT "click,"num "item"; \
2185 } \
2186 } \
2187 }
2188
2189 ITEM_TABLE("0")
2190 ITEM_TABLE("1")
2191 ITEM_TABLE("2")
2192 ITEM_TABLE("3")
2193 ITEM_TABLE("4")
2194 ITEM_TABLE("5")
2195 ITEM_TABLE("6")
2196 ITEM_TABLE("7")
2197
2198 #define ADD_ITEM(c,r,num) \
2199 item \
2200 { \
2201 type: GROUP; \
2202 source: "dialog/level_list/item/"num; \
2203 position: c r; \
2204 min: 176 158; \
2205 padding: 1 1 1 1; \
2206 }
2207
2208 group
2209 {
2210 name: "dialog/level_list";
2211
2212 parts
2213 {
2214 part
2215 {
2216 name: "mouse_catcher";
2217 type: RECT;
2218 description
2219 {
2220 state: "default" 0.0;
2221 color: 0 0 0 0;
2222 visible: 0;
2223 }
2224 description
2225 {
2226 state: "visible" 0.0;
2227 color: 0 0 0 0;
2228 visible: 1;
2229 }
2230 }
2231
2232 part
2233 {
2234 name: "main_clip";
2235 type: RECT;
2236 description
2237 {
2238 state: "default" 0.0;
2239 color: 255 255 255 255;
2240 visible: 1;
2241 }
2242 description
2243 {
2244 state: "visible" 0.0;
2245 inherit: "default" 0.0;
2246 color: 255 255 255 255;
2247 visible: 1;
2248 }
2249 }
2250
2251 part
2252 {
2253 name: "menu_bg";
2254 clip_to: "main_clip";
2255 description
2256 {
2257 state: "default" 0.0;
2258 image.normal: "editor_bg.png";
2259 image.border: 73 60 60 67;
2260 rel1 { relative: 0.0 0.5; offset: 0 -335; }
2261 rel2 { relative: 1.0 0.5; offset: -1 335; }
2262 }
2263 description
2264 {
2265 state: "left" 0.0;
2266 inherit: "default" 0.0;
2267 rel1 { relative: 0.0 0.5; offset: -1024 -335; }
2268 rel2 { relative: 0.0 0.5; offset: -4 335; }
2269 }
2270 description
2271 {
2272 state: "right" 0.0;
2273 inherit: "default" 0.0;
2274 rel1 { relative: 1.0 0.5; offset: 4 -335; }
2275 rel2 { relative: 1.0 0.5; offset: 1024 335; }
2276 }
2277
2278 }
2279
2280 part
2281 {
2282 name: "close_button";
2283 clip_to: "main_clip";
2284 description
2285 {
2286 state: "default" 0.0;
2287 image.normal: "bt_close.png";
2288 rel1 { relative: 1.0 0.0; offset: -76 3; to: "menu_bg"; }
2289 rel2 { relative: 1.0 0.0; offset: -33 42; to: "menu_bg"; }
2290 }
2291 }
2292
2293 part
2294 {
2295 name: "table";
2296 type: TABLE;
2297 clip_to: "main_clip";
2298 description
2299 {
2300 state: "default" 0.0;
2301 rel1 { relative: 0.0 0.0; offset: 54 49; to: "menu_bg"; }
2302 rel2 { relative: 1.0 1.0; offset: -50 -182; to: "menu_bg"; }
2303 table
2304 {
2305 homogeneous: TABLE;
2306 padding: 7 10;
2307 align: 0.5 0.5;
2308 }
2309 }
2310 table.items
2311 {
2312 ADD_ITEM(0, 0, "0")
2313 ADD_ITEM(1, 0, "1")
2314 ADD_ITEM(2, 0, "2")
2315 ADD_ITEM(3, 0, "3")
2316
2317 ADD_ITEM(0, 1, "4")
2318 ADD_ITEM(1, 1, "5")
2319 ADD_ITEM(2, 1, "6")
2320 ADD_ITEM(3, 1, "7")
2321 }
2322 }
2323
2324 part
2325 {
2326 name: "button_previous_clip";
2327 mouse_events: 0;
2328 type: RECT;
2329 description
2330 {
2331 state: "default" 0.0;
2332 rel1 { relative: 0.0 1.0; offset: 40 -127; to: "menu_bg"; }
2333 rel2 { relative: 0.0 1.0; offset: 109 -55; to: "menu_bg"; }
2334 color: 255 255 255 0;
2335 visible: 0;
2336 }
2337 description
2338 {
2339 state: "visible" 0.0;
2340 inherit: "default" 0.0;
2341 color: 255 255 255 255;
2342 visible: 1;
2343 }
2344 }
2345 part
2346 {
2347 name: "button_next_clip";
2348 mouse_events: 0;
2349 type: RECT;
2350 description
2351 {
2352 state: "default" 0.0;
2353 rel1 { relative: 1.0 1.0; offset: -109 -127; to: "menu_bg"; }
2354 rel2 { relative: 1.0 1.0; offset: -40 -55; to: "menu_bg"; }
2355 color: 255 255 255 0;
2356 visible: 0;
2357 }
2358 description
2359 {
2360 state: "visible" 0.0;
2361 inherit: "default" 0.0;
2362 color: 255 255 255 255;
2363 visible: 1;
2364 }
2365 }
2366 part
2367 {
2368 name: "button_save_clip";
2369 mouse_events: 0;
2370 type: RECT;
2371 description
2372 {
2373 state: "default" 0.0;
2374 rel1 { relative: 0.5 1.0; offset: -40 -127; to: "menu_bg"; }
2375 rel2 { relative: 0.5 1.0; offset: 39 -55; to: "menu_bg"; }
2376 color: 255 255 255 0;
2377 visible: 0;
2378 }
2379 description
2380 {
2381 state: "visible" 0.0;
2382 inherit: "default" 0.0;
2383 color: 255 255 255 255;
2384 visible: 1;
2385 }
2386 }
2387
2388 EDITOR_ITEM("save", "editor_bt_save_new.png", "button_save_clip", 0.0, 0.0, 0.0, 1.0, 1.0, 0, 0, -1, -1)
2389 EDITOR_ITEM("next", "editor_bt_play.png", "button_next_clip", 0.0, 0.0, 0.0, 1.0, 1.0, 0, 0, -1, -1)
2390 EDITOR_ITEM("previous", "editor_bt_previous.png", "button_previous_clip", 0.0, 0.0, 0.0, 1.0, 1.0, 0, 0, -1, -1)
2391 }
2392
2393 programs
2394 {
2395 program
2396 {
2397 name: "on_show";
2398 signal: "show";
2399 action: STATE_SET "right" 0.0;
2400 target: "menu_bg";
2401 }
2402 program
2403 {
2404 name: "on_show2";
2405 signal: "show";
2406 action: SIGNAL_EMIT "show" "item";
2407 }
2408
2409 program
2410 {
2411 name: "show_from_left";
2412 signal: "show,left";
2413 source: "dialog";
2414 action: STATE_SET "left" 0.0;
2415 target: "menu_bg";
2416 after: "show_from_left2";
2417 after: "show_catcher";
2418 }
2419 program
2420 {
2421 name: "show_from_left2";
2422 action: STATE_SET "default" 0.0;
2423 transition: ACCELERATE 0.45;
2424 target: "menu_bg";
2425 }
2426
2427 program
2428 {
2429 name: "show_from_right";
2430 signal: "show,right";
2431 source: "dialog";
2432 action: STATE_SET "right" 0.0;
2433 target: "menu_bg";
2434 after: "show_from_right2";
2435 after: "show_catcher";
2436 }
2437 program
2438 {
2439 name: "show_from_right2";
2440 action: STATE_SET "default" 0.0;
2441 transition: ACCELERATE 0.45;
2442 target: "menu_bg";
2443 }
2444
2445 program
2446 {
2447 name: "hide_to_left";
2448 signal: "hide,left";
2449 source: "dialog";
2450 action: STATE_SET "left" 0.0;
2451 transition: ACCELERATE 0.35;
2452 target: "menu_bg";
2453 after: "hide_to_left_end";
2454 after: "disable_items";
2455 after: "hide_catcher";
2456 }
2457 program
2458 {
2459 name: "hide_to_left_end";
2460 action: SIGNAL_EMIT "left,hidden" "dialog";
2461 }
2462 program
2463 {
2464 name: "hide_to_right";
2465 signal: "hide,right";
2466 source: "dialog";
2467 action: STATE_SET "right" 0.0;
2468 transition: ACCELERATE 0.35;
2469 target: "menu_bg";
2470 after: "hide_to_right_end";
2471 after: "disable_items";
2472 after: "hide_catcher";
2473 }
2474 program
2475 {
2476 name: "hide_to_right_end";
2477 action: SIGNAL_EMIT "right,hidden" "dialog";
2478 }
2479
2480 program
2481 {
2482 name: "disable_items";
2483 action: SIGNAL_EMIT "disable" "table:item";
2484 }
2485
2486 program
2487 {
2488 name: "close_signal";
2489 signal: "mouse,down,1";
2490 source: "close_button";
2491 action: SIGNAL_EMIT "close" "dialog";
2492 }
2493
2494 program
2495 {
2496 name: "show_catcher";
2497 action: STATE_SET "visible" 0.0;
2498 target: "mouse_catcher";
2499 }
2500 program
2501 {
2502 name: "hide_catcher";
2503 action: STATE_SET "default" 0.0;
2504 target: "mouse_catcher";
2505 }
2506
2507 program
2508 {
2509 name: "show_previous";
2510 signal: "show,previous";
2511 source: "dialog";
2512 action: STATE_SET "visible" 0.0;
2513 transition: DECELERATE 0.25;
2514 target: "button_previous_clip";
2515 }
2516 program
2517 {
2518 name: "hide_previous";
2519 signal: "hide,previous";
2520 source: "dialog";
2521 action: STATE_SET "default" 0.0;
2522 transition: ACCELERATE 0.15;
2523 target: "button_previous_clip";
2524 }
2525
2526 program
2527 {
2528 name: "show_next";
2529 signal: "show,next";
2530 source: "dialog";
2531 action: STATE_SET "visible" 0.0;
2532 transition: DECELERATE 0.25;
2533 target: "button_next_clip";
2534 }
2535 program
2536 {
2537 name: "hide_next";
2538 signal: "hide,next";
2539 source: "dialog";
2540 action: STATE_SET "default" 0.0;
2541 transition: ACCELERATE 0.15;
2542 target: "button_next_clip";
2543 }
2544
2545 program
2546 {
2547 name: "show_save";
2548 signal: "show,save";
2549 source: "dialog";
2550 action: STATE_SET "visible" 0.0;
2551 transition: DECELERATE 0.25;
2552 target: "button_save_clip";
2553 }
2554 program
2555 {
2556 name: "hide_save";
2557 signal: "hide,save";
2558 source: "dialog";
2559 action: STATE_SET "default" 0.0;
2560 transition: ACCELERATE 0.15;
2561 target: "button_save_clip";
2562 }
2563 }
2564 }
2565
2566}
diff --git a/data/edje/editor_bg.png b/data/edje/editor_bg.png
new file mode 100644
index 0000000..478ba46
--- /dev/null
+++ b/data/edje/editor_bg.png
Binary files differ
diff --git a/data/edje/editor_bt.png b/data/edje/editor_bt.png
new file mode 100644
index 0000000..c1fa131
--- /dev/null
+++ b/data/edje/editor_bt.png
Binary files differ
diff --git a/data/edje/editor_bt_background.png b/data/edje/editor_bt_background.png
new file mode 100644
index 0000000..378ae19
--- /dev/null
+++ b/data/edje/editor_bt_background.png
Binary files differ
diff --git a/data/edje/editor_bt_color.png b/data/edje/editor_bt_color.png
new file mode 100644
index 0000000..d1d76d3
--- /dev/null
+++ b/data/edje/editor_bt_color.png
Binary files differ
diff --git a/data/edje/editor_bt_glow.png b/data/edje/editor_bt_glow.png
new file mode 100644
index 0000000..83e756e
--- /dev/null
+++ b/data/edje/editor_bt_glow.png
Binary files differ
diff --git a/data/edje/editor_bt_menu.png b/data/edje/editor_bt_menu.png
new file mode 100644
index 0000000..b5c9ec9
--- /dev/null
+++ b/data/edje/editor_bt_menu.png
Binary files differ
diff --git a/data/edje/editor_bt_move.png b/data/edje/editor_bt_move.png
new file mode 100644
index 0000000..bc6fb72
--- /dev/null
+++ b/data/edje/editor_bt_move.png
Binary files differ
diff --git a/data/edje/editor_bt_open.png b/data/edje/editor_bt_open.png
new file mode 100644
index 0000000..077519c
--- /dev/null
+++ b/data/edje/editor_bt_open.png
Binary files differ
diff --git a/data/edje/editor_bt_pencil.png b/data/edje/editor_bt_pencil.png
new file mode 100644
index 0000000..062d458
--- /dev/null
+++ b/data/edje/editor_bt_pencil.png
Binary files differ
diff --git a/data/edje/editor_bt_play.png b/data/edje/editor_bt_play.png
new file mode 100644
index 0000000..82dd1a1
--- /dev/null
+++ b/data/edje/editor_bt_play.png
Binary files differ
diff --git a/data/edje/editor_bt_previous.png b/data/edje/editor_bt_previous.png
new file mode 100644
index 0000000..c9039cf
--- /dev/null
+++ b/data/edje/editor_bt_previous.png
Binary files differ
diff --git a/data/edje/editor_bt_save.png b/data/edje/editor_bt_save.png
new file mode 100644
index 0000000..49e4f1d
--- /dev/null
+++ b/data/edje/editor_bt_save.png
Binary files differ
diff --git a/data/edje/editor_bt_save_new.png b/data/edje/editor_bt_save_new.png
new file mode 100644
index 0000000..67ffb82
--- /dev/null
+++ b/data/edje/editor_bt_save_new.png
Binary files differ
diff --git a/data/edje/editor_bt_static.png b/data/edje/editor_bt_static.png
new file mode 100644
index 0000000..28d1a44
--- /dev/null
+++ b/data/edje/editor_bt_static.png
Binary files differ
diff --git a/data/edje/editor_bt_stop.png b/data/edje/editor_bt_stop.png
new file mode 100644
index 0000000..813166d
--- /dev/null
+++ b/data/edje/editor_bt_stop.png
Binary files differ
diff --git a/data/edje/game_level_next.png b/data/edje/game_level_next.png
new file mode 100644
index 0000000..6869b5a
--- /dev/null
+++ b/data/edje/game_level_next.png
Binary files differ
diff --git a/data/edje/goal_01.png b/data/edje/goal_01.png
new file mode 100644
index 0000000..835b9a4
--- /dev/null
+++ b/data/edje/goal_01.png
Binary files differ
diff --git a/data/edje/goal_02.png b/data/edje/goal_02.png
new file mode 100644
index 0000000..df4a825
--- /dev/null
+++ b/data/edje/goal_02.png
Binary files differ
diff --git a/data/edje/goal_03.png b/data/edje/goal_03.png
new file mode 100644
index 0000000..af12edb
--- /dev/null
+++ b/data/edje/goal_03.png
Binary files differ
diff --git a/data/edje/load_anim_01.png b/data/edje/load_anim_01.png
new file mode 100644
index 0000000..70cfab8
--- /dev/null
+++ b/data/edje/load_anim_01.png
Binary files differ
diff --git a/data/edje/load_anim_02.png b/data/edje/load_anim_02.png
new file mode 100644
index 0000000..a8bc744
--- /dev/null
+++ b/data/edje/load_anim_02.png
Binary files differ
diff --git a/data/edje/load_anim_03.png b/data/edje/load_anim_03.png
new file mode 100644
index 0000000..6ee33a2
--- /dev/null
+++ b/data/edje/load_anim_03.png
Binary files differ
diff --git a/data/edje/load_anim_04.png b/data/edje/load_anim_04.png
new file mode 100644
index 0000000..2253d1f
--- /dev/null
+++ b/data/edje/load_anim_04.png
Binary files differ
diff --git a/data/edje/load_anim_05.png b/data/edje/load_anim_05.png
new file mode 100644
index 0000000..9e51e51
--- /dev/null
+++ b/data/edje/load_anim_05.png
Binary files differ
diff --git a/data/edje/load_anim_06.png b/data/edje/load_anim_06.png
new file mode 100644
index 0000000..a96abd0
--- /dev/null
+++ b/data/edje/load_anim_06.png
Binary files differ
diff --git a/data/edje/load_anim_07.png b/data/edje/load_anim_07.png
new file mode 100644
index 0000000..dffe0f0
--- /dev/null
+++ b/data/edje/load_anim_07.png
Binary files differ
diff --git a/data/edje/menu_item.png b/data/edje/menu_item.png
new file mode 100644
index 0000000..d5850b3
--- /dev/null
+++ b/data/edje/menu_item.png
Binary files differ
diff --git a/data/edje/pin.png b/data/edje/pin.png
new file mode 100644
index 0000000..29b8093
--- /dev/null
+++ b/data/edje/pin.png
Binary files differ
diff --git a/data/edje/play_menu.png b/data/edje/play_menu.png
new file mode 100644
index 0000000..6f62fde
--- /dev/null
+++ b/data/edje/play_menu.png
Binary files differ
diff --git a/data/edje/title.png b/data/edje/title.png
new file mode 100644
index 0000000..3d81ea2
--- /dev/null
+++ b/data/edje/title.png
Binary files differ
diff --git a/data/edje/tree.png b/data/edje/tree.png
new file mode 100644
index 0000000..116b48e
--- /dev/null
+++ b/data/edje/tree.png
Binary files differ
diff --git a/data/edje/wscript b/data/edje/wscript
new file mode 100644
index 0000000..d6e238a
--- /dev/null
+++ b/data/edje/wscript
@@ -0,0 +1,20 @@
1#! /usr/bin/env python
2# -*- coding: utf-8 -*-
3# encoding: utf-8
4# Calaos, 2010
5
6import misc
7
8def build(bld):
9
10 #edje compilation
11 bld(features = 'command-output',
12 no_inputs = True,
13 no_outputs = True,
14 command = 'edje_cc',
15 argv = ['-id', '../data/edje/', '-fd', '../data/edje/', '../data/edje/default.edc', '../data/edje/default.edj'],
16 command_is_external = True)
17
18 bld.install_files('${PREFIX}/share/eskiss/theme',
19 ['default.edj'])
20
diff --git a/data/goal_01.png b/data/goal_01.png
new file mode 100644
index 0000000..835b9a4
--- /dev/null
+++ b/data/goal_01.png
Binary files differ
diff --git a/data/levels/000_begin.eet b/data/levels/000_begin.eet
new file mode 100644
index 0000000..3e1a2e4
--- /dev/null
+++ b/data/levels/000_begin.eet
Binary files differ
diff --git a/data/levels/001_level.eet b/data/levels/001_level.eet
new file mode 100644
index 0000000..91925c2
--- /dev/null
+++ b/data/levels/001_level.eet
Binary files differ
diff --git a/data/levels/002_level.eet b/data/levels/002_level.eet
new file mode 100644
index 0000000..1efac67
--- /dev/null
+++ b/data/levels/002_level.eet
Binary files differ
diff --git a/data/levels/003_level.eet b/data/levels/003_level.eet
new file mode 100644
index 0000000..943cddb
--- /dev/null
+++ b/data/levels/003_level.eet
Binary files differ
diff --git a/data/levels/004_level.eet b/data/levels/004_level.eet
new file mode 100644
index 0000000..b9a63ca
--- /dev/null
+++ b/data/levels/004_level.eet
Binary files differ
diff --git a/data/levels/005_level.eet b/data/levels/005_level.eet
new file mode 100644
index 0000000..284ad27
--- /dev/null
+++ b/data/levels/005_level.eet
Binary files differ
diff --git a/data/levels/006_level.eet b/data/levels/006_level.eet
new file mode 100644
index 0000000..5f92b88
--- /dev/null
+++ b/data/levels/006_level.eet
Binary files differ
diff --git a/data/levels/007_level.eet b/data/levels/007_level.eet
new file mode 100644
index 0000000..14b1f93
--- /dev/null
+++ b/data/levels/007_level.eet
Binary files differ
diff --git a/data/levels/008_level.eet b/data/levels/008_level.eet
new file mode 100644
index 0000000..c29081d
--- /dev/null
+++ b/data/levels/008_level.eet
Binary files differ
diff --git a/data/levels/009_level.eet b/data/levels/009_level.eet
new file mode 100644
index 0000000..a910a01
--- /dev/null
+++ b/data/levels/009_level.eet
Binary files differ
diff --git a/data/levels/010_level.eet b/data/levels/010_level.eet
new file mode 100644
index 0000000..1bb482e
--- /dev/null
+++ b/data/levels/010_level.eet
Binary files differ
diff --git a/data/levels/011_level.eet b/data/levels/011_level.eet
new file mode 100644
index 0000000..0e253a8
--- /dev/null
+++ b/data/levels/011_level.eet
Binary files differ
diff --git a/data/levels/wscript b/data/levels/wscript
new file mode 100644
index 0000000..fe05c2b
--- /dev/null
+++ b/data/levels/wscript
@@ -0,0 +1,21 @@
1#! /usr/bin/env python
2# -*- coding: utf-8 -*-
3# encoding: utf-8
4# Calaos, 2010
5
6def build(bld):
7 pass
8 bld.install_files('${PREFIX}/share/eskiss/levels',
9 ['000_begin.eet',
10 '001_level.eet',
11 '002_level.eet',
12 '003_level.eet',
13 '004_level.eet',
14 '005_level.eet',
15 '006_level.eet',
16 '007_level.eet',
17 '008_level.eet',
18 '009_level.eet',
19 '010_level.eet',
20 '011_level.eet',
21 ])
diff --git a/data/wscript b/data/wscript
new file mode 100644
index 0000000..58ac887
--- /dev/null
+++ b/data/wscript
@@ -0,0 +1,20 @@
1#! /usr/bin/env python
2# -*- coding: utf-8 -*-
3# encoding: utf-8
4# Calaos, 2010
5
6def build(bld):
7
8 bld.install_files('${PREFIX}/share/eskiss/brushes',
9 ['brush01.png',
10 'brush02.png',
11 'brush03.png',
12 'brush04.png',
13 'brush05.png',
14 'ball_01.png',
15 'goal_01.png'])
16
17 bld.install_files('${PREFIX}/share/eskiss/backgrounds',
18 ['background_01.jpg',
19 'background_02.jpg'])
20
diff --git a/src/bin/common.h b/src/bin/common.h
new file mode 100644
index 0000000..fcbdc3e
--- /dev/null
+++ b/src/bin/common.h
@@ -0,0 +1,73 @@
1/******************************************************************************
2** Copyright (c) 2006-2010, Calaos. All Rights Reserved.
3**
4** This is free software; you can redistribute it and/or modify
5** it under the terms of the GNU General Public License as published by
6** the Free Software Foundation; either version 3 of the License, or
7** (at your option) any later version.
8**
9** This 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
12** GNU General Public License for more details.
13**
14** You should have received a copy of the GNU General Public License
15** along with this; if not, write to the Free Software
16** Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17**
18******************************************************************************/
19
20#ifndef COMMON_INC
21#define COMMON_INC
22
23#include <stdlib.h>
24#include <time.h>
25
26#include <Evas.h>
27#include <Ecore.h>
28#include <Ecore_Data.h>
29#include <Ecore_Getopt.h>
30#include <Ecore_Evas.h>
31#include <Eina.h>
32#include <Edje.h>
33
34#include <config.h>
35
36#define DEFAULT_WIDTH 1024
37#define DEFAULT_HEIGHT 768
38
39#define PI 3.14159265358979323846
40
41#define swap_int(i1, i2) \
42 { int tmp = i1; i1 = i2; i2 = tmp; }
43
44extern int _drawin_log_domain;
45
46#ifdef ERR
47# undef ERR
48#endif
49#define ERR(...) EINA_LOG_DOM_ERR(_drawin_log_domain, __VA_ARGS__)
50#ifdef INF
51# undef INF
52#endif
53#define INF(...) EINA_LOG_DOM_INFO(_drawin_log_domain, __VA_ARGS__)
54#ifdef WARN
55# undef WARN
56#endif
57#define WARN(...) EINA_LOG_DOM_WARN(_drawin_log_domain, __VA_ARGS__)
58
59typedef struct _DrawPoint
60{
61 int x, y;
62
63} DrawPoint;
64
65static const DrawPoint point_zero = { 0, 0 };
66
67static inline DrawPoint drawpoint(const int x, const int y)
68{
69 DrawPoint p = { x, y };
70 return p;
71}
72
73#endif
diff --git a/src/bin/draw_object.c b/src/bin/draw_object.c
new file mode 100644
index 0000000..0fda1a2
--- /dev/null
+++ b/src/bin/draw_object.c
@@ -0,0 +1,607 @@
1/******************************************************************************
2** Copyright (c) 2006-2010, Calaos. All Rights Reserved.
3**
4** This is free software; you can redistribute it and/or modify
5** it under the terms of the GNU General Public License as published by
6** the Free Software Foundation; either version 3 of the License, or
7** (at your option) any later version.
8**
9** This 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
12** GNU General Public License for more details.
13**
14** You should have received a copy of the GNU General Public License
15** along with this; if not, write to the Free Software
16** Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17**
18******************************************************************************/
19
20#include "draw_object.h"
21#include "physic_object.h"
22
23//list of callbacks
24static Eina_List *callback_list = NULL;
25
26typedef struct _CallbackDrawType
27{
28 void (*func) (Evas_Object *new_obj, Eina_List *point_list, void *data);
29 void *data;
30} CallbackDrawType;
31
32//handle evas mouse events
33static Evas_Object *mouse_catcher = NULL;
34static Eina_Bool is_clicked = EINA_FALSE;
35
36static Eina_Bool is_enabled = EINA_TRUE;
37
38//clipper to change the brush color
39static Evas_Object *brush_color_clip = NULL;
40
41static Eina_List *current_path_list = NULL;
42
43static Evas *evas = NULL;
44
45//Buffer evas for new object creation
46static Ecore_Evas *ee_buffer = NULL;
47static Evas_Object *image_buffer = NULL;
48
49//private functions
50static void _add_point(int x, int y);
51static void _draw_line(int x1, int y1, int x2, int y2);
52static void _mouse_down_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info);
53static void _mouse_up_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info);
54static void _mouse_move_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info);
55static void _find_bouding_box(Eina_List *point_list, int brush_size, int *box_x, int *box_y, int *box_w, int *box_h);
56
57BrushColor default_colors[] =
58{
59 BRUSH_RED,
60 BRUSH_BLUE,
61 BRUSH_GREEN,
62 BRUSH_YELLOW,
63 BRUSH_PINK,
64 BRUSH_CYAN,
65 BRUSH_ORANGE,
66 BRUSH_VIOLET
67};
68
69/**
70 * @brief Add a new mouse event catcher and init all functions for drawing on the canvas
71 * @note Can be added only once.
72 */
73void draw_object_add(Evas *_evas)
74{
75 if (mouse_catcher)
76 {
77 WARN("already added to canvas !");
78
79 return;
80 }
81
82 evas = _evas;
83
84 Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas);
85
86 int bg_width = 0, bg_height = 0;
87 ecore_evas_geometry_get(ee, NULL, NULL, &bg_width, &bg_height);
88
89 mouse_catcher = evas_object_rectangle_add(evas);
90 evas_object_move(mouse_catcher, 0, 0);
91 evas_object_resize(mouse_catcher, bg_width, bg_height);
92 evas_object_layer_set(mouse_catcher, 1000);
93 evas_object_repeat_events_set(mouse_catcher, EINA_TRUE);
94 evas_object_color_set(mouse_catcher, 0, 0, 0, 0);
95 evas_object_show(mouse_catcher);
96
97 brush_color_clip = evas_object_rectangle_add(evas);
98 evas_object_move(brush_color_clip, 0, 0);
99 evas_object_resize(brush_color_clip, bg_width, bg_height);
100 evas_object_layer_set(brush_color_clip, 999);
101 evas_object_pass_events_set(brush_color_clip, EINA_TRUE);
102 evas_object_color_set(brush_color_clip, 0, 0, 0, 255);
103
104 evas_object_event_callback_add(mouse_catcher, EVAS_CALLBACK_MOUSE_DOWN, _mouse_down_cb, NULL);
105 evas_object_event_callback_add(mouse_catcher, EVAS_CALLBACK_MOUSE_UP, _mouse_up_cb, NULL);
106 evas_object_event_callback_add(mouse_catcher, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move_cb, NULL);
107
108 INF("Added drawing layer");
109}
110
111/**
112 * @brief Enable/Disable drawing
113 * @param en true if enabled
114 */
115void draw_object_enabled_set(Eina_Bool en)
116{
117 is_enabled = en;
118}
119
120/**
121 * @brief Get enabled state
122 * @return true if enabled
123 */
124Eina_Bool draw_object_enabled_get(void)
125{
126 return is_enabled;
127}
128
129/**
130 * @brief Change color of the brush
131 */
132void draw_object_color_set(int r, int g, int b, int a)
133{
134 evas_object_color_set(brush_color_clip, r, g, b, a);
135}
136
137/**
138 * @brief Change color of the brush
139 * @note same as draw_object_color_set but takes a BrushColor as parameter
140 */
141void draw_object_brush_set(BrushColor brush)
142{
143 draw_object_color_set(brush.r, brush.g, brush.b, brush.a);
144}
145
146/**
147 * @brief Resize the drawing rect
148 */
149void draw_object_resize(int w, int h)
150{
151 if (mouse_catcher)
152 {
153 evas_object_resize(mouse_catcher, w, h);
154 evas_object_resize(brush_color_clip, w, h);
155 }
156}
157
158/**
159 * @brief Add a callback called when a new object is drawn
160 */
161void draw_object_new_callback_add(void (*func) (Evas_Object *new_obj, Eina_List *point_list, void *data), void *data)
162{
163 CallbackDrawType *cb = calloc(1, sizeof(CallbackDrawType));
164
165 cb->func = func;
166 cb->data = data;
167
168 callback_list = eina_list_append(callback_list, cb);
169}
170
171/**
172 * @brief Delete a callback
173 */
174void draw_object_new_callback_del(void (*func) (Evas_Object *new_obj, Eina_List *point_list, void *data), void *data)
175{
176 Eina_List *l, *lnext;
177 CallbackDrawType *cb;
178 EINA_LIST_FOREACH_SAFE(callback_list, l, lnext, cb)
179 {
180 if (cb->func == func && cb->data == data)
181 {
182 free(cb);
183 callback_list = eina_list_remove_list(callback_list, l);
184 }
185 }
186}
187
188/**
189 * @brief Remove the drawing system from the canvas
190 */
191void draw_object_del(void)
192{
193 CallbackDrawType *cb;
194 EINA_LIST_FREE(callback_list, cb);
195 free(cb);
196
197 evas_object_del(mouse_catcher);
198 mouse_catcher = NULL;
199 is_clicked = EINA_FALSE;
200}
201
202/**
203 * @brief Create an Evas_Object from a list of point
204 * @param e the evas canvas
205 * @param point_list list of points to draw
206 * @param color brush color to draw with
207 * @return The corresponding Evas_Object
208 */
209Evas_Object *draw_object_create(Evas *e, Eina_List *point_list, BrushColor color)
210{
211 if (!point_list)
212 {
213 ERR("point_list is NULL !");
214 return NULL;
215 }
216
217 int bg_width = 0, bg_height = 0;
218 ecore_evas_geometry_get(ecore_evas_ecore_evas_get(e), NULL, NULL, &bg_width, &bg_height);
219
220 int ox, oy;
221 Eina_List *l = NULL;
222 DrawPoint *first_obj = (DrawPoint *)eina_list_data_get(point_list);
223
224 //Get brush size...
225 Evas_Object *tmp_brush;
226 tmp_brush = evas_object_image_add(e);
227 evas_object_image_file_set(tmp_brush, PACKAGE_DATA "/brushes/brush01.png", NULL);
228 int iw, ih;
229 evas_object_image_size_get(tmp_brush, &iw, &ih);
230 evas_object_del(tmp_brush);
231
232 ox = first_obj->x - iw / 2;
233 oy = first_obj->y - ih / 2;
234 oy = bg_height - oy;
235
236 //find bounding box
237 int bx, by, bw, bh;
238 _find_bouding_box(point_list, iw / 2, &bx, &by, &bw, &bh);
239
240 ee_buffer = ecore_evas_buffer_new(bw, bh);
241 image_buffer = ecore_evas_object_image_new(ee_buffer);
242
243 evas_object_move(image_buffer, 0, 0);
244 evas_object_resize(image_buffer, bw, bh);
245 evas_object_image_fill_set(image_buffer, 0, 0, bw, bh);
246 evas_object_image_size_set(image_buffer, bw, bh);
247 evas_object_show(image_buffer);
248
249 Ecore_Evas *ee_im = (Ecore_Evas *)evas_object_data_get(image_buffer, "Ecore_Evas");
250 Evas *evas_im = ecore_evas_get(ee_im);
251
252 //create clipper
253 Evas_Object *color_clip = evas_object_rectangle_add(evas_im);
254 evas_object_move(color_clip, 0, 0);
255 evas_object_resize(color_clip, bw, bh);
256 evas_object_color_set(color_clip, color.r, color.g, color.b, color.a);
257 evas_object_show(color_clip);
258
259 DrawPoint *point;
260 EINA_LIST_FOREACH(point_list, l, point)
261 {
262 int ox2, oy2;
263
264 ox2 = point->x - iw / 2;
265 oy2 = point->y - ih / 2;
266
267 //Draw on a buffer
268 char file[128];
269 sprintf(file, PACKAGE_DATA "/brushes/brush0%d.png", (rand() % 4) + 1);
270
271 Evas_Object *image = evas_object_image_add(evas_im);
272 evas_object_image_file_set(image, file, NULL);
273
274 evas_object_image_fill_set(image, 0, 0, iw, ih);
275 evas_object_move(image, ox2 - bx, oy2 - by);
276 evas_object_resize(image, iw, ih);
277 evas_object_clip_set(image, color_clip);
278 evas_object_show(image);
279 }
280
281 //ecore_evas_buffer_pixels_get(ee_buffer);
282 //evas_object_image_save(image_buffer, "tmp.png", NULL, NULL);
283
284 //it's time to save our buffer image to a new one on the current Evas surface
285 Evas_Object *image = evas_object_image_add(e);
286
287 evas_object_move(image, bx, by);
288 evas_object_image_fill_set(image, 0, 0, bw, bh);
289 evas_object_image_size_set(image, bw, bh);
290 evas_object_resize(image, bw, bh);
291 evas_object_image_alpha_set(image, 1);
292 evas_object_image_data_copy_set(image, (void *)ecore_evas_buffer_pixels_get(ee_buffer));
293 evas_object_show(image);
294
295 evas_object_del(image_buffer);
296 ecore_evas_free(ee_buffer);
297
298 INF("New object added to Evas");
299
300 return image;
301}
302
303/* ------- Private here ------- */
304
305//for drawing detection
306static int last_pointx = -999, last_pointy = -999;
307static int last_draw_pointx = -999, last_draw_pointy = -999;
308
309//bounding box for the new drawing
310int bbox_x, bbox_y, bbox_w, bbox_h;
311
312static void _find_bouding_box(Eina_List *point_list, int brush_size, int *box_x, int *box_y, int *box_w, int *box_h)
313{
314 int bx = -999, by = -999, bw = 0, bh = 0;
315
316 Eina_List *l;
317 DrawPoint *point;
318 EINA_LIST_FOREACH(point_list, l, point)
319 {
320 int x = point->x - brush_size;
321 int y = point->y - brush_size;
322
323 if (bx == -999) bx = x;
324 if (by == -999) by = y;
325
326 if (x < bx) { bw += bx - x; bx = x; }
327 if (y < by) { bh += by - y; by = y; }
328 if (x + brush_size > bx + bw) bw = x + brush_size - bx + 2 * brush_size;
329 if (y + brush_size > by + bh) bh = y + brush_size - by + 2 * brush_size;
330 }
331
332 if (box_x) *box_x = bx;
333 if (box_y) *box_y = by;
334 if (box_w) *box_w = bw;
335 if (box_h) *box_h = bh;
336}
337
338static void _add_point(int x, int y)
339{
340 //Only draw add a brush if the last one was far enough
341 if (last_draw_pointx != -999 && last_draw_pointx != -999 &&
342 abs(x - last_draw_pointx) <= 3 &&
343 abs(y - last_draw_pointy) <= 3)
344 {
345 return;
346 }
347
348 last_draw_pointx = x;
349 last_draw_pointy = y;
350
351 Evas_Object *point = evas_object_image_add(evas);
352 evas_object_move(point, x, y);
353
354 char file[128];
355 sprintf(file, PACKAGE_DATA "/brushes/brush0%d.png", (rand() % 4) + 1);
356 evas_object_image_file_set(point, file, NULL);
357
358 int iw, ih;
359 evas_object_image_size_get(point, &iw, &ih);
360
361 evas_object_resize(point, iw, ih);
362 evas_object_image_fill_set(point, 0, 0, iw, ih);
363
364 evas_object_show(point);
365
366 //clip brush to change color
367 evas_object_clip_set(point, brush_color_clip);
368 evas_object_show(brush_color_clip);
369
370 current_path_list = eina_list_append(current_path_list, point);
371
372 if (x < bbox_x) { bbox_w += bbox_x - x; bbox_x = x; }
373 if (y < bbox_y) { bbox_h += bbox_y - y; bbox_y = y; }
374 if (x + iw > bbox_x + bbox_w) bbox_w = x + iw - bbox_x;
375 if (y + ih > bbox_y + bbox_h) bbox_h = y + ih - bbox_y;
376}
377
378//simple bresenham algo
379void _draw_line(int x1, int y1, int x2, int y2)
380{
381 int d, dx, dy, aincr, bincr, xincr, yincr, x, y;
382
383 if (abs(x2 - x1) < abs(y2 - y1))
384 {
385 if (y1 > y2)
386 {
387 swap_int(x1, x2);
388 swap_int(y1, y2);
389 }
390
391 xincr = x2 > x1 ? 1 : -1;
392 dy = y2 - y1;
393 dx = abs(x2 - x1);
394 d = 2 * dx - dy;
395 aincr = 2 * (dx - dy);
396 bincr = 2 * dx;
397 x = x1;
398 y = y1;
399
400 _add_point(x, y);
401
402 for (y = y1+1; y <= y2; ++y)
403 {
404 if (d >= 0)
405 {
406 x += xincr;
407 d += aincr;
408 }
409 else
410 d += bincr;
411
412 _add_point(x, y);
413 }
414
415 }
416 else
417 {
418 if (x1 > x2)
419 {
420 swap_int(x1, x2);
421 swap_int(y1, y2);
422 }
423
424 yincr = y2 > y1 ? 1 : -1;
425 dx = x2 - x1;
426 dy = abs(y2 - y1);
427 d = 2 * dy - dx;
428 aincr = 2 * (dy - dx);
429 bincr = 2 * dy;
430 x = x1;
431 y = y1;
432
433 _add_point(x, y);
434
435 for (x = x1+1; x <= x2; ++x)
436 {
437 if (d >= 0)
438 {
439 y += yincr;
440 d += aincr;
441 }
442 else
443 d += bincr;
444
445 _add_point(x, y);