diff --git a/alienblaster/project/jni/application/jooleem_0.1.4/AppSettings.cfg b/alienblaster/project/jni/application/jooleem_0.1.4/AppSettings.cfg
new file mode 100644
index 000000000..2fc2f5664
--- /dev/null
+++ b/alienblaster/project/jni/application/jooleem_0.1.4/AppSettings.cfg
@@ -0,0 +1,13 @@
+LibSdlVersion=1.2
+AppName="Jooleem"
+AppFullName=net.sourceforge.jooleem
+ScreenOrientation=h
+AppDataDownloadUrl="http://sites.google.com/site/xpelyax/Home/jooleem_0.1.4_data.zip?attredirects=0&d=1|http://sitesproxy.goapk.com/site/xpelyax/Home/jooleem_0.1.4_data.zip"
+SdlVideoResize=y
+NeedDepthBuffer=n
+MultiABI=n
+AppVersionCode=01403
+AppVersionName="0.1.4.03"
+CompiledLibraries="sdl_mixer sdl_image sdl_ttf"
+AppCflags='-finline-functions -O2'
+ReadmeText='^You may press "Home" now - the data will be downloaded in background'
diff --git a/alienblaster/project/jni/application/jooleem_0.1.4/Jooleem.ico b/alienblaster/project/jni/application/jooleem_0.1.4/Jooleem.ico
new file mode 100644
index 000000000..5e4a98f9c
Binary files /dev/null and b/alienblaster/project/jni/application/jooleem_0.1.4/Jooleem.ico differ
diff --git a/alienblaster/project/jni/application/jooleem_0.1.4/Jooleem.png b/alienblaster/project/jni/application/jooleem_0.1.4/Jooleem.png
new file mode 100644
index 000000000..7e8ccba0e
Binary files /dev/null and b/alienblaster/project/jni/application/jooleem_0.1.4/Jooleem.png differ
diff --git a/alienblaster/project/jni/application/jooleem_0.1.4/Jooleem.rc b/alienblaster/project/jni/application/jooleem_0.1.4/Jooleem.rc
new file mode 100644
index 000000000..d60d3136d
--- /dev/null
+++ b/alienblaster/project/jni/application/jooleem_0.1.4/Jooleem.rc
@@ -0,0 +1,72 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource1.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource1.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_ICON1 ICON "Jooleem.ico"
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/alienblaster/project/jni/application/jooleem_0.1.4/Jooleem.sln b/alienblaster/project/jni/application/jooleem_0.1.4/Jooleem.sln
new file mode 100644
index 000000000..7276559f1
--- /dev/null
+++ b/alienblaster/project/jni/application/jooleem_0.1.4/Jooleem.sln
@@ -0,0 +1,21 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Jooleem", "Jooleem.vcproj", "{BF0C4EBF-38B1-47E4-A576-1CF34F82C283}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfiguration) = preSolution
+ Debug = Debug
+ Release = Release
+ EndGlobalSection
+ GlobalSection(ProjectConfiguration) = postSolution
+ {BF0C4EBF-38B1-47E4-A576-1CF34F82C283}.Debug.ActiveCfg = Debug|Win32
+ {BF0C4EBF-38B1-47E4-A576-1CF34F82C283}.Debug.Build.0 = Debug|Win32
+ {BF0C4EBF-38B1-47E4-A576-1CF34F82C283}.Release.ActiveCfg = Release|Win32
+ {BF0C4EBF-38B1-47E4-A576-1CF34F82C283}.Release.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
+ GlobalSection(ExtensibilityAddIns) = postSolution
+ EndGlobalSection
+EndGlobal
diff --git a/alienblaster/project/jni/application/jooleem_0.1.4/Jooleem.vcproj b/alienblaster/project/jni/application/jooleem_0.1.4/Jooleem.vcproj
new file mode 100644
index 000000000..d3b20879e
--- /dev/null
+++ b/alienblaster/project/jni/application/jooleem_0.1.4/Jooleem.vcproj
@@ -0,0 +1,351 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/alienblaster/project/jni/application/jooleem_0.1.4/changelog.txt b/alienblaster/project/jni/application/jooleem_0.1.4/changelog.txt
new file mode 100644
index 000000000..0e03cdf01
--- /dev/null
+++ b/alienblaster/project/jni/application/jooleem_0.1.4/changelog.txt
@@ -0,0 +1,170 @@
+Jooleem changelog
+=================
+
+Changes relevant to developers are marked with *
+Changes relevant to users are marked with **
+
+0.1.0 (Beta 1) [2005-08-08]
+** First public release
+
+0.1.1
+[2005-08-08]
+* Added PushUserEvent() to event.h
+** Clicking a selected marble deselects it
+** Executable installer
+** Added link to website in the about window
+** Fixed button behavior when clicking and dragging
+-----
+
+0.1.2
+[2005-08-27]
+** All new original sound effects by Dale North
+** All new music track by Ryan Reilly
+** When completing a rectangle, the points earned are shown
+** Improved sound and music support
+** Improved resource loading
+** Minor fixes so the game compiles on OS X (GCC 4.0)
+** Browser can now be launched on OS X
+** Exceptions are shown in an OS specific message dialog
+
+
+[2005-08-09]
+* Fixed Level messages during game
+
+[2005-08-10]
+* Add redraw to label's text change, button's align etc
+* Add to events.h - MakeUserEvent(&event, EVENT_CODE)
+
+[2005-08-11]
+** Minor fixes so it compiles on OS X (GCC 4.0)
+
+[2005-08-12]
+** Browser can now be launched on OS X
+
+[2005-08-13]
+** Exceptions are shown in an OS specific message dialog, and not in stderr
+* Switched from strstream (deprecated) to sstream in trap.h
+
+[2005-08-14]
+* Added support for data fields to PushUserEvent
+* Revised about window's layout
+
+[2005-08-15]
+* Renamed events: EVENT_SCORE -> EVENT_RECT_COMPLETE, EVENT_GAMEOVER -> EVENT_GAME_OVER, EVENT_LEVELOVER -> EVENT_NEW_LEVEL, EVENT_HISCORES -> EVENT_HIGH_SCORES
+* Added CoordToPixels(), PixelsToCoord() and CoordToSDLRect() to Board
+* On rectangle completion, the rectangle's screen location is pushed as data for EVENT_RECT_COMPLETE
+** When completing a rectangle, the points earned are shown
+* Added TextEffect and EffectManager classes
+** Fixed: Two or more sounds can now play simultaneously
+
+[2005-08-19]
+* Added HandleUserEvents() to IntroState, GameOnState, gets called from HandleEvents
+* Renamed: ChunkManager -> SoundManager
+* Added events: EVENT_SELECTION_ADD, EVENT_SELECTION_CANCEL, EVENT_SELECTION_INVALID
+
+[2005-08-20]
+** The game can now handle music
+* Added MusicManager class
+* Added events: EVENT_TRACK_OVER
+* Added folder: data/music
+* Renamed folder: data/tiles -> data/marbles
+* Added music loading and playing to various classes
+* Removed Mix_Chunk member from all game classes (not UI), replaced with SoundManager::PlaySound()
+
+[2005-08-24]
+** All new original sound effects by Dale North
+* Added Engine::LoadSounds()
+
+
+[2005-08-26]
+** Improved resource loading
+* Replaced Engine::LoadSounds() with Engine::LoadResources()
+* Moved all resource loading to Engine::LoadResources()
+* Add Engine::InitStates()
+* Added common/filenames.h - contains all resource file names
+* Fixed Trap macro
+* Removed AddResources() from all windows
+* Changed all reference to "tiles" to "marbles"
+* Added SetVolume() to music and sound manager
+
+[2005-08-27]
+** All new music track by Ryan Reilly
+
+---
+
+0.1.3
+[2005-08-27]
+* Fixed - music now loops properly in game mode
+
+---
+
+0.1.4
+[2005-09-25]
+New features:
+* New Music track by Ryan Reily
+* 4 new sound effects by Dale North
+* When time is low, the time bar begins to flash and an alarm is sounded
+* Pressing F12 takes a screenshot
+* Upgraded to SDL 1.2.9
+Fixes:
+* When right clicking, the marble deselect sound is only played if any marbles are actually selected
+* Fixed sound corruption issue that appeared on some systems (thanks to Malte Thiesen)
+
+
+[2005-08-28]
+** Upgraded to SDL 1.2.9
+* Moved Blit from Font to SurfaceManager
+* SoundManager assigns a channel to each new sound, and keeps track of it
+* Added SoundManager::StopSound()
+* Added events: EVENT_TIME_LOW, EVENT_TIME_OK
+** Fixed: When right clicking, the marble deselect sound is only played if marbles are selected
+
+[2005-08-30]
+* Fixed TextEffect::Update so transparency will not underflow and make the effects opaque again
+* Minor compile-pleasing warning-stomping
+
+[2005-08-31]
+* Minor fixes so it compiles on linux (case sensitivy, files end with a newline). Thanks to Jani Huhtanen.
+
+[2005-09-01]
+* Removed FULLSCREEN flag
+* Changed post-increment to pre-increment for all loops (i++ to ++i)
+* Moved all board related consts from common.h to board.h
+* Converted sound effect files from WAV to Ogg
+
+[2005-09-02]
+** Fixed: The computer can keep playing indefinitely in the intro demo (thanks to mein@stare.nl)
+
+[2005-09-03]
+* Added UIProgressBar class
+* Added SoundManager::StopAll()
+** When time is low, the time bar begins to flash and an alert is sounded
+* When restarting via the Game Over window, the music is restarted as well
+* Changed audio buffer size to 2048, this may fix audio corruption
+* Added DEFAULT_VOLUME to SoundManager and MusicManager
+* Added Engine::GetMute()
+
+[2005-09-04]
+* Added visibility array to Board (bool m_isVisible[][])
+
+[2005-09-05]
+* Added new music track (track_01.ogg)
+
+[2005-09-08]
+* Added ScreenShot() to common.h
+** Pressing F12 takes a screenshot
+* Added EffectManager::AddGameOverEffect()
+
+[2005-09-10]
+* Added __FILE__ and __LINE__ to TRAP
+
+[2005-10-10]
+* Added game over effect to GameOverState::Enter
+* Removed font objects from EffectManager, they are now loaded into the font manager
+* Fixed in Engine::InitSDL(): Allocated audio channels to required number of effects
+* Added Board::DropRectLogic, Board::ChangeVisibility, Board::RenderDroppingRect
+* Added marble dropping effect to Board, currently diabled. define MARBLE_DROP to try it out
+
+[2005-10-11]
+* UIButton no longer contains a Mix_chunk, and uses the sound manager to play the click sound
+* Added SoundManager::SetVolume(string, float) - set a sample's volume
diff --git a/alienblaster/project/jni/application/jooleem_0.1.4/gpl.txt b/alienblaster/project/jni/application/jooleem_0.1.4/gpl.txt
new file mode 100644
index 000000000..b8602677e
--- /dev/null
+++ b/alienblaster/project/jni/application/jooleem_0.1.4/gpl.txt
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ , 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/alienblaster/project/jni/application/jooleem_0.1.4/makefile b/alienblaster/project/jni/application/jooleem_0.1.4/makefile
new file mode 100644
index 000000000..3f4cbabf5
--- /dev/null
+++ b/alienblaster/project/jni/application/jooleem_0.1.4/makefile
@@ -0,0 +1,3 @@
+SRCS=$(shell find . -type f -name "*.cpp")
+jooleem: $(SRCS) makefile
+ g++ -o $@ `sdl-config --cflags` $(SRCS) `sdl-config --libs` -lSDL_mixer -lSDL_ttf -lSDL_image
diff --git a/alienblaster/project/jni/application/jooleem_0.1.4/readme.txt b/alienblaster/project/jni/application/jooleem_0.1.4/readme.txt
new file mode 100644
index 000000000..ffbbb8e58
--- /dev/null
+++ b/alienblaster/project/jni/application/jooleem_0.1.4/readme.txt
@@ -0,0 +1,78 @@
+Jooleem 0.1.3+
+=============
+
+http://jooleem.sourceforge.net/
+
+
+== Introduction ==
+ Jooleem is a simple yet extremely addictive puzzle game. There is only one
+rule: click on four marbles of the same color that form a rectangle. Time is
+constantly running out, but you can earn time (and points) by forming
+rectangles. The larger the rectangle, the more time and points are won.
+ Jooleem is free and open source software.
+
+== Controls ==
+Left click - Selects a marble. Selecting an already selected marble deselects it.
+Right click - Deselects the currently selected marbles.
+P - Pauses the game.
+H - Hint.
+F12 - Takes a screenshot. The file can be found in the "data/screenshot" folder.
+Esc - Quits the game.
+
+== Tips ==
+* When stuck, click the hint button. But beware - you will pay a time penalty.
+* Fill up the time bar to advance to the next level. The higher the level, the
+more points you get per marble.
+* The higher the level, the tougher the game. You earn less and less time per
+marble as the game progresses.
+
+== License ==
+ Jooleem is free and open source software. The code is released under the GNU
+General Public License. The full license can be found in GPL.txt in the game's
+folder.
+ All of the game's assets (music, sound effects, images) are original and
+released under a Creative Commons deed. The relevant deed can by found at http://creativecommons.org/licenses/by-nc/2.5/.
+
+== Development ==
+ Jooleem is developed using C++ and SDL, with cross platform compatibility in
+mind. Currently, Windows and Linux versions of the game are available for
+download. Mac OS X and RISC OS ports are planned.
+ You can follow the development process, submit bug reports and make feature
+requests on the game's project page - http://sourceforge.net/projects/jooleem/.
+
+== Credits ==
+Project lead, code & graphics: Chai Braudo (braudo@users.sourceforge.net)
+Music: Ryan Reilly (http://www.allacrost.org/)
+Sound design: Dale North (http://www.dalenorth.com/northmedia)
+Linux port: Jani Huhtanen
+Beta testing: Iddo Braudo, Uri Grupel, Shany Tcshernichov and Ma'ayan Zigdon
+The game was inspired by Nick Kouvaris' ZNAX
+(http://www.freestuff.gr/lightforce/znax.php)
+
+== Changelog ==
+
+0.1.3
+[2005-08-27]
+* Fixed - music now loops properly in game mode
+
+0.1.2
+[2005-08-27]
+* All new original sound effects by Dale North
+* All new music track by Ryan Reilly
+* When completing a rectangle, the points earned are shown
+* Improved sound and music support
+* Improved resource loading
+* Minor fixes so the game compiles on OS X (GCC 4.0)
+* Browser can now be launched on OS X
+* Exceptions are shown in an OS specific message dialog
+
+0.1.1 [2005-08-08]
+* Clicking a selected marble deselects it
+* Executable installer
+* Added link to website in the about window
+* Fixed button behavior when clicking and dragging
+
+0.1.0 [2005-08-07]
+* First public release
+
+[2005-08-27]
diff --git a/alienblaster/project/jni/application/jooleem_0.1.4/resource1.h b/alienblaster/project/jni/application/jooleem_0.1.4/resource1.h
new file mode 100644
index 000000000..84e8a5eed
--- /dev/null
+++ b/alienblaster/project/jni/application/jooleem_0.1.4/resource1.h
@@ -0,0 +1,15 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by Jooleem.rc
+//
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 204
+#define _APS_NEXT_COMMAND_VALUE 32768
+#define _APS_NEXT_CONTROL_VALUE 201
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/aboutwindow.cpp b/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/aboutwindow.cpp
new file mode 100644
index 000000000..655ad8646
--- /dev/null
+++ b/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/aboutwindow.cpp
@@ -0,0 +1,141 @@
+/*
+* Copyright (C) 2005 Chai Braudo (braudo@users.sourceforge.net)
+*
+* This file is part of Jooleem - http://sourceforge.net/projects/jooleem
+*
+* Jooleem is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* Jooleem is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with Jooleem; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include "../UI/aboutwindow.h"
+#include "../common/trap.h"
+#include "../common/events.h"
+#include "../common/common.h"
+
+#include "../common/surfacemanager.h"
+#include "../common/fontmanager.h"
+#include "../common/soundmanager.h"
+
+#include "../UI/uibutton.h"
+#include "../UI/uilabel.h"
+#include "../UI/uitextbox.h"
+
+
+AboutWindow::AboutWindow(SDL_Surface *background):
+UIWindow(background)
+{
+ InitControls();
+}
+
+AboutWindow::~AboutWindow()
+{
+
+}
+
+
+// Initializes the window's controls, and adds them to the
+// control collection
+void AboutWindow::InitControls()
+{
+ SurfaceManager *surfaceMgr = SurfaceManager::GetInstance();
+ FontManager *fontMgr = FontManager::GetInstance();
+ SoundManager *sndMgr = SoundManager::GetInstance();
+
+ {
+ /////// Buttons ///////
+ SDL_Color buttonTextColor = {0, 0, 0, 0};
+
+ // Link:
+ // This is an unusual button. To simulate the graphical beahvior of a HTML link
+ // as viewed in a web broweser, the text is rendered several times (normal, hover,
+ // click) and these surfaces are passed to the button *as surfaces*. The button
+ // itself has no text.
+ SDL_Color linkNormalColor = {66, 128, 221, 0};
+ SDL_Color linkHoverColor = {75, 147, 255, 0};
+ SDL_Color linkClickColor = {131, 194, 255, 0};
+ Font *linkFont = fontMgr->GetFont("LinkFont");
+ linkFont->SetStyle(Font::STYLE_UNDERLINE); // Make the font underline
+ SDL_Surface *linkNormalSurface = surfaceMgr->AddSurface("LinkNormal",
+ linkFont->RenderPlain(Font::ALN_LEFT, linkNormalColor, APP_URL));
+ SDL_Surface *linkHoverSurface = surfaceMgr->AddSurface("LinkHover",
+ linkFont->RenderPlain(Font::ALN_LEFT, linkHoverColor, APP_URL));
+ SDL_Surface *linkClickSurface = surfaceMgr->AddSurface("LinkClick",
+ linkFont->RenderPlain(Font::ALN_LEFT, linkClickColor, APP_URL));
+
+ UIButton *linkButton = new UIButton();
+ linkButton->Set(0, 0, "ButtonClick",
+ linkNormalSurface, linkNormalSurface, linkHoverSurface, linkClickSurface,
+ linkNormalSurface, NULL);
+ linkButton->AddState(EVENT_WEBSITE, fontMgr->GetFont("MediumButtonFont"), " ", buttonTextColor);
+ linkButton->Align(UIControl::HALN_CENTER, UIControl::VALN_BOTTOM, 320, 241);
+ linkButton->SetMode(UIButton::MODE_NORMAL);
+ AddControl(BTN_LINK, linkButton);
+
+ // Close:
+ UIButton *closeButton = new UIButton();
+ closeButton->Set(0, 0, "ButtonClick",
+ surfaceMgr->GetSurface("MediumButtonNormal"), surfaceMgr->GetSurface("MediumButtonDisabled"),
+ surfaceMgr->GetSurface("MediumButtonHover"), surfaceMgr->GetSurface("MediumButtonClicked"),
+ surfaceMgr->GetSurface("MediumButtonHover"), surfaceMgr->GetSurface("MediumButtonMask"));
+ closeButton->AddState(EVENT_CLOSE, fontMgr->GetFont("MediumButtonFont"), "Close", buttonTextColor);
+ closeButton->Align(UIControl::HALN_CENTER, UIControl::VALN_BOTTOM, 320, 355);
+ closeButton->SetMode(UIButton::MODE_NORMAL);
+ AddControl(BTN_CLOSE, closeButton);
+
+ /////// Labels ///////
+ SDL_Color titleColor = {64, 64, 64, 0};
+ SDL_Color labelTextColor = {0, 0, 0, 0};
+
+ // Title:
+ UILabel *titleLabel = new UILabel();
+ titleLabel->Set(0, 0, NULL, fontMgr->GetFont("WindowTitleFont"), titleColor);
+ titleLabel->SetText(UIControl::HALN_LEFT, "About");
+ titleLabel->Align(UIControl::HALN_CENTER, UIControl::VALN_TOP, 320, 125);
+ AddControl(LBL_TITLE, titleLabel);
+
+ // Logo:
+ UILabel *logoLabel = new UILabel();
+ logoLabel->Set(0, 0, surfaceMgr->GetSurface("Logo"), NULL, labelTextColor);
+ logoLabel->Align(UIControl::HALN_CENTER, UIControl::VALN_TOP, 320, 153);
+ AddControl(LBL_LOGO, logoLabel);
+
+ // Application name and version:
+ UILabel *appVersionLabel = new UILabel();
+ appVersionLabel->Set(0, 0, NULL, fontMgr->GetFont("AppVersionFont"), labelTextColor);
+ appVersionLabel->SetText(UIControl::HALN_LEFT, "%s %s", APP_NAME.c_str(), APP_VERSION.c_str());
+ appVersionLabel->Align(UIControl::HALN_CENTER, UIControl::VALN_BOTTOM, 320, 219);
+ AddControl(LBL_APP, appVersionLabel);
+
+ // Credits:
+ UILabel *creditsLabel = new UILabel();
+ creditsLabel->Set(0, 0, NULL, fontMgr->GetFont("CreditsFont"), labelTextColor);
+ creditsLabel->SetText( UIControl::HALN_CENTER,
+ "Developed by Chai Braudo\n"
+ "Music by Ryan Reilly\n"
+ "Sound design by Dale North");
+ creditsLabel->Align(UIControl::HALN_CENTER, UIControl::VALN_BOTTOM, 320, 289);
+ AddControl(LBL_CREDITS, creditsLabel);
+
+ // License:
+ UILabel *licenseLabel = new UILabel();
+ licenseLabel->Set(0, 0, NULL, fontMgr->GetFont("LicenseFont"), labelTextColor);
+ licenseLabel->SetText( UIControl::HALN_LEFT,
+ "This program is free, open source software\n"
+ "released under the GNU General Public License.");
+ licenseLabel->Align(UIControl::HALN_CENTER, UIControl::VALN_BOTTOM, 320, 318);
+ AddControl(LBL_LICENSE, licenseLabel);
+
+ }
+}
+
diff --git a/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/aboutwindow.h b/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/aboutwindow.h
new file mode 100644
index 000000000..ca7d1883f
--- /dev/null
+++ b/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/aboutwindow.h
@@ -0,0 +1,55 @@
+/*
+* Copyright (C) 2005 Chai Braudo (braudo@users.sourceforge.net)
+*
+* This file is part of Jooleem - http://sourceforge.net/projects/jooleem
+*
+* Jooleem is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* Jooleem is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with Jooleem; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#ifndef _ABOUTWINDOW_H_
+#define _ABOUTWINDOW_H_
+
+// The about window.
+
+#include "../UI/uiwindow.h"
+#include "SDL.h"
+
+class AboutWindow: public UIWindow
+{
+ public:
+
+ enum Controls {
+ // Buttons:
+ BTN_LINK, // Website link
+ BTN_CLOSE, // Close
+
+ // Labels:
+ LBL_TITLE, // Window title
+ LBL_LOGO, // Logo
+ LBL_APP, // Application name and version
+ LBL_CREDITS, // Game credits
+ LBL_LICENSE, // License info
+ };
+
+ // Constructor / destructor:
+ AboutWindow(SDL_Surface *background);
+ ~AboutWindow();
+
+ private:
+ void InitControls(); // Initializes the window's controls, and adds them to the control collection
+};
+
+#endif
+
diff --git a/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/gameoverwindow.cpp b/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/gameoverwindow.cpp
new file mode 100644
index 000000000..5a9878861
--- /dev/null
+++ b/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/gameoverwindow.cpp
@@ -0,0 +1,152 @@
+/*
+* Copyright (C) 2005 Chai Braudo (braudo@users.sourceforge.net)
+*
+* This file is part of Jooleem - http://sourceforge.net/projects/jooleem
+*
+* Jooleem is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* Jooleem is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with Jooleem; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include "../UI/gameoverwindow.h"
+#include "../common/trap.h"
+#include "../common/events.h"
+
+#include "../common/surfacemanager.h"
+#include "../common/fontmanager.h"
+#include "../common/soundmanager.h"
+
+#include "../UI/uibutton.h"
+#include "../UI/uilabel.h"
+#include "../UI/uitextbox.h"
+
+#include "../game/highscores.h"
+
+
+GameOverWindow::GameOverWindow(SDL_Surface *background):
+UIWindow(background)
+{
+ InitControls();
+}
+
+GameOverWindow::~GameOverWindow()
+{
+
+}
+
+
+// Initializes the window's controls, and adds them to the
+// control collection
+void GameOverWindow::InitControls()
+{
+ SurfaceManager *surfaceMgr = SurfaceManager::GetInstance();
+ FontManager *fontMgr = FontManager::GetInstance();
+ SoundManager *sndMgr = SoundManager::GetInstance();
+
+ {
+ /////// Buttons ///////
+ SDL_Color buttonTextColor = {0, 0, 0, 0};
+
+ // OK:
+ UIButton *okButton = new UIButton();
+ okButton->Set(0, 0, "ButtonClick",
+ surfaceMgr->GetSurface("MediumButtonNormal"), surfaceMgr->GetSurface("MediumButtonDisabled"),
+ surfaceMgr->GetSurface("MediumButtonHover"), surfaceMgr->GetSurface("MediumButtonClicked"),
+ surfaceMgr->GetSurface("MediumButtonHover"), surfaceMgr->GetSurface("MediumButtonMask"));
+ okButton->AddState(EVENT_CLOSE, fontMgr->GetFont("MediumButtonFont"), "OK", buttonTextColor);
+ okButton->Align(UIControl::HALN_CENTER, UIControl::VALN_BOTTOM, 320, 373);
+ okButton->SetMode(UIButton::MODE_NORMAL);
+ AddControl(BTN_OK, okButton);
+
+ // Quit:
+ UIButton *quitButton = new UIButton();
+ quitButton->Set(0, 0, "ButtonClick",
+ surfaceMgr->GetSurface("MediumButtonNormal"), surfaceMgr->GetSurface("MediumButtonDisabled"),
+ surfaceMgr->GetSurface("MediumButtonHover"), surfaceMgr->GetSurface("MediumButtonClicked"),
+ surfaceMgr->GetSurface("MediumButtonHover"), surfaceMgr->GetSurface("MediumButtonMask"));
+ SDL_Event event;
+ event.type = SDL_QUIT;
+ quitButton->AddState(event, fontMgr->GetFont("MediumButtonFont"), "Quit", buttonTextColor);
+ quitButton->Align(UIControl::HALN_RIGHT, UIControl::VALN_BOTTOM, 435, 373);
+ quitButton->SetMode(UIButton::MODE_NORMAL);
+ AddControl(BTN_QUIT, quitButton);
+
+ // Restart:
+ UIButton *restartButton = new UIButton();
+ restartButton->Set(0, 0, "ButtonClick",
+ surfaceMgr->GetSurface("MediumButtonNormal"), surfaceMgr->GetSurface("MediumButtonDisabled"),
+ surfaceMgr->GetSurface("MediumButtonHover"), surfaceMgr->GetSurface("MediumButtonClicked"),
+ surfaceMgr->GetSurface("MediumButtonHover"), surfaceMgr->GetSurface("MediumButtonMask"));
+ restartButton->AddState(EVENT_RESTART, fontMgr->GetFont("MediumButtonFont"), "Restart", buttonTextColor);
+ restartButton->Align(UIControl::HALN_LEFT, UIControl::VALN_BOTTOM, 205, 373);
+ restartButton->SetMode(UIButton::MODE_NORMAL);
+ AddControl(BTN_RESTART, restartButton);
+
+ /////// Labels ///////
+ SDL_Color titleColor = {64, 64, 64, 0};
+ SDL_Color labelTextColor = {0, 0, 0, 0};
+
+ // Title:
+ UILabel *titleLabel = new UILabel();
+ titleLabel->Set(0, 0, NULL, fontMgr->GetFont("WindowTitleFont"), titleColor);
+ titleLabel->SetText(UIControl::HALN_LEFT, "Game Over");
+ titleLabel->Align(UIControl::HALN_CENTER, UIControl::VALN_TOP, 320, 108);
+ AddControl(LBL_TITLE, titleLabel);
+
+ // Congratulations message:
+ UILabel *congratsLabel = new UILabel();
+ congratsLabel->Set(0, 0, NULL, fontMgr->GetFont("GameOverCongratsFont"), labelTextColor);
+ congratsLabel->SetText(UIControl::HALN_LEFT,
+ "Congratulations, you got a\n"
+ "high score!\n"
+ "Please enter your name.");
+ congratsLabel->Align(UIControl::HALN_LEFT, UIControl::VALN_TOP, 204, 133);
+ AddControl(LBL_CONGRATS, congratsLabel);
+
+ // Final score:
+ UILabel *scoreLabel = new UILabel();
+ scoreLabel->Set(0, 0, NULL, fontMgr->GetFont("GameOverScoreFont"), labelTextColor);
+ AddControl(LBL_SCORE, scoreLabel);
+
+ // Statistics description:
+ UILabel *statsDescLabel = new UILabel();
+ statsDescLabel->Set(0, 0, NULL, fontMgr->GetFont("GameOverStatsFont"), labelTextColor);
+ statsDescLabel->SetText(UIControl::HALN_LEFT,
+ "Level reached:\n"
+ "Total game time:\n"
+ "Marbles cleared:\n"
+ "Rectangles cleared:\n"
+ "Avg. rectangle size:\n"
+ "Best move:\n"
+ "Perfect moves:");
+ statsDescLabel->Align(UIControl::HALN_LEFT, UIControl::VALN_BOTTOM,
+ 203, 337);
+ AddControl(LBL_STATS_DESC, statsDescLabel);
+
+ // Statistics values:
+ UILabel *statsValLabel = new UILabel();
+ statsValLabel->Set(0, 0, NULL, fontMgr->GetFont("GameOverStatsFont"), labelTextColor);
+ AddControl(LBL_STATS_VAL, statsValLabel);
+
+ // Text box:
+ UITextBox *textBox = new UITextBox();
+ textBox->Set(205, 188,
+ 16, 6,
+ surfaceMgr->GetSurface("TextBoxBackground"),
+ surfaceMgr->GetSurface("TextBoxCursor"),
+ fontMgr->GetFont("TextBoxFont"),
+ titleColor);
+ AddControl(TXT_NAME, textBox);
+ }
+}
+
diff --git a/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/gameoverwindow.h b/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/gameoverwindow.h
new file mode 100644
index 000000000..d1afcf956
--- /dev/null
+++ b/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/gameoverwindow.h
@@ -0,0 +1,60 @@
+/*
+* Copyright (C) 2005 Chai Braudo (braudo@users.sourceforge.net)
+*
+* This file is part of Jooleem - http://sourceforge.net/projects/jooleem
+*
+* Jooleem is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* Jooleem is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with Jooleem; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#ifndef _GAMEOVERWINDOW_H_
+#define _GAMEOVERWINDOW_H_
+
+// This window is displayed when the game is over.
+// It shows the final score and various game statitics.
+
+#include "../UI/uiwindow.h"
+#include "SDL.h"
+
+class GameOverWindow: public UIWindow
+{
+ public:
+
+ enum Controls {
+ // Buttons:
+ BTN_OK, // OK
+ BTN_QUIT, // Quit
+ BTN_RESTART, // Restart
+
+ // Labels:
+ LBL_TITLE, // Window title
+ LBL_CONGRATS, // Congratulations message
+ LBL_SCORE, // Final score
+ LBL_STATS_DESC, // Statistics description
+ LBL_STATS_VAL, // Statistics values
+
+ // Text box:
+ TXT_NAME, // Enter the player's name
+ };
+
+ // Constructor / destructor:
+ GameOverWindow(SDL_Surface *background);
+ ~GameOverWindow();
+
+ private:
+ void InitControls(); // Initializes the window's controls, and adds them to the control collection
+};
+
+#endif
+
diff --git a/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/highscoreswindow.cpp b/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/highscoreswindow.cpp
new file mode 100644
index 000000000..912ff84d6
--- /dev/null
+++ b/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/highscoreswindow.cpp
@@ -0,0 +1,152 @@
+/*
+* Copyright (C) 2005 Chai Braudo (braudo@users.sourceforge.net)
+*
+* This file is part of Jooleem - http://sourceforge.net/projects/jooleem
+*
+* Jooleem is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* Jooleem is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with Jooleem; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include "../UI/highscoreswindow.h"
+#include "../common/trap.h"
+#include "../common/events.h"
+
+#include "../common/surfacemanager.h"
+#include "../common/fontmanager.h"
+#include "../common/soundmanager.h"
+
+#include "../UI/uibutton.h"
+#include "../UI/uilabel.h"
+
+#include "../game/highscores.h"
+
+
+HighScoresWindow::HighScoresWindow(SDL_Surface *background):
+UIWindow(background)
+{
+ InitControls();
+}
+
+HighScoresWindow::~HighScoresWindow()
+{
+
+}
+
+
+// Initializes the window's controls, and adds them to the
+// control collection
+void HighScoresWindow::InitControls()
+{
+ SurfaceManager *surfaceMgr = SurfaceManager::GetInstance();
+ FontManager *fontMgr = FontManager::GetInstance();
+ SoundManager *sndMgr = SoundManager::GetInstance();
+
+ {
+ /////// Buttons ///////
+ SDL_Color buttonTextColor = {0, 0, 0, 0};
+
+ // Close:
+ UIButton *closeButton = new UIButton();
+ closeButton->Set(0, 0, "ButtonClick",
+ surfaceMgr->GetSurface("MediumButtonNormal"), surfaceMgr->GetSurface("MediumButtonDisabled"),
+ surfaceMgr->GetSurface("MediumButtonHover"), surfaceMgr->GetSurface("MediumButtonClicked"),
+ surfaceMgr->GetSurface("MediumButtonHover"), surfaceMgr->GetSurface("MediumButtonMask"));
+ closeButton->AddState(EVENT_CLOSE, fontMgr->GetFont("MediumButtonFont"), "Close", buttonTextColor);
+ closeButton->Align(UIControl::HALN_CENTER, UIControl::VALN_BOTTOM, 320, 375);
+ closeButton->SetMode(UIButton::MODE_NORMAL);
+ AddControl(BTN_CLOSE, closeButton);
+
+ // Restart:
+ UIButton *restartButton = new UIButton();
+ restartButton->Set(0, 0, "ButtonClick",
+ surfaceMgr->GetSurface("MediumButtonNormal"), surfaceMgr->GetSurface("MediumButtonDisabled"),
+ surfaceMgr->GetSurface("MediumButtonHover"), surfaceMgr->GetSurface("MediumButtonClicked"),
+ surfaceMgr->GetSurface("MediumButtonHover"), surfaceMgr->GetSurface("MediumButtonMask"));
+ restartButton->AddState(EVENT_RESTART, fontMgr->GetFont("MediumButtonFont"), "Restart", buttonTextColor);
+ restartButton->Align(UIControl::HALN_LEFT, UIControl::VALN_BOTTOM,
+ m_x + 29, m_y + m_h - 34);
+ restartButton->SetMode(UIButton::MODE_NORMAL);
+ AddControl(BTN_RESTART, restartButton);
+
+ // Quit:
+ UIButton *quitButton = new UIButton();
+ quitButton->Set(0, 0, "ButtonClick",
+ surfaceMgr->GetSurface("MediumButtonNormal"), surfaceMgr->GetSurface("MediumButtonDisabled"),
+ surfaceMgr->GetSurface("MediumButtonHover"), surfaceMgr->GetSurface("MediumButtonClicked"),
+ surfaceMgr->GetSurface("MediumButtonHover"), surfaceMgr->GetSurface("MediumButtonMask"));
+ SDL_Event event;
+ event.type = SDL_QUIT;
+ quitButton->AddState(event, fontMgr->GetFont("MediumButtonFont"), "Quit", buttonTextColor);
+ quitButton->Align(UIControl::HALN_RIGHT, UIControl::VALN_BOTTOM,
+ m_x + m_w - 40 + 13, m_y + m_h - 34);
+ quitButton->SetMode(UIButton::MODE_NORMAL);
+ AddControl(BTN_QUIT, quitButton);
+
+
+ /////// Vectors ///////
+ SDL_Color tableTextColor = {0, 0, 0, 0};
+
+ vector indexVec; // Index
+ vector namesVec; // Names
+ vector scoresVec; // Scores
+
+ for (Uint16 i = 0 ; i < NUM_OF_HIGH_SCORES ; ++i)
+ {
+ // Index:
+ UILabel *index = new UILabel();
+
+ index->Set(0, 0, NULL, fontMgr->GetFont("HighScoresFont"), tableTextColor);
+ index->SetText(UIControl::HALN_LEFT, "%d", i + 1);
+ index->Align(UIControl::HALN_LEFT, UIControl::VALN_TOP, 207, 136 + 20 * i);
+
+ indexVec.push_back(index);
+
+
+ // Names:
+ UILabel *name = new UILabel();
+
+ name->Set(0, 0, NULL, fontMgr->GetFont("HighScoresFont"), tableTextColor);
+ name->SetText(UIControl::HALN_LEFT, "-");
+ name->Align(UIControl::HALN_LEFT, UIControl::VALN_TOP, 233, 136 + 20 * i);
+
+ namesVec.push_back(name);
+
+
+ // Scores:
+ UILabel *score = new UILabel();
+
+ score->Set(0, 0, NULL, fontMgr->GetFont("HighScoresFont"), tableTextColor);
+ score->SetText(UIControl::HALN_LEFT, "-");
+ score->Align(UIControl::HALN_RIGHT, UIControl::VALN_TOP, 435, 136 + 20 * i);
+
+ scoresVec.push_back(score);
+ }
+
+ AddControlVector(VEC_INDEX, indexVec);
+ AddControlVector(VEC_NAMES, namesVec);
+ AddControlVector(VEC_SCORES, scoresVec);
+
+ /////// Labels ///////
+ SDL_Color titleColor = {64, 64, 64, 0};
+
+ // Title:
+ UILabel *titleLabel = new UILabel();
+ titleLabel->Set(0, 0, NULL, fontMgr->GetFont("WindowTitleFont"), titleColor);
+ titleLabel->SetText(UIControl::HALN_LEFT, "High Scores");
+ titleLabel->Align(UIControl::HALN_CENTER, UIControl::VALN_TOP, 320, 106);
+ AddControl(LBL_TITLE, titleLabel);
+
+ }
+}
+
diff --git a/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/highscoreswindow.h b/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/highscoreswindow.h
new file mode 100644
index 000000000..91f1c1916
--- /dev/null
+++ b/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/highscoreswindow.h
@@ -0,0 +1,57 @@
+/*
+* Copyright (C) 2005 Chai Braudo (braudo@users.sourceforge.net)
+*
+* This file is part of Jooleem - http://sourceforge.net/projects/jooleem
+*
+* Jooleem is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* Jooleem is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with Jooleem; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#ifndef _HIGHSCORESWINDOW_H_
+#define _HIGHSCORESWINDOW_H_
+
+// The high scores window.
+
+#include "../UI/uiwindow.h"
+#include "SDL.h"
+
+class HighScoresWindow: public UIWindow
+{
+ public:
+
+ enum Controls {
+ // Buttons:
+ BTN_CLOSE, // Close
+ BTN_RESTART, // Restart
+ BTN_QUIT, // Quit
+
+ // Vectors (the names and scores are a vector of labels):
+ VEC_INDEX, // Scores index (1st place, 2nd...)
+ VEC_NAMES, // Player names
+ VEC_SCORES, // Scores
+
+ // Labels:
+ LBL_TITLE, // Window title
+ };
+
+ // Constructor / destructor:
+ HighScoresWindow(SDL_Surface *background);
+ ~HighScoresWindow();
+
+ private:
+ void InitControls(); // Initializes the window's controls, and adds them to the control collection
+};
+
+#endif
+
diff --git a/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/mainwindow.cpp b/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/mainwindow.cpp
new file mode 100644
index 000000000..6ab560255
--- /dev/null
+++ b/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/mainwindow.cpp
@@ -0,0 +1,172 @@
+/*
+* Copyright (C) 2005 Chai Braudo (braudo@users.sourceforge.net)
+*
+* This file is part of Jooleem - http://sourceforge.net/projects/jooleem
+*
+* Jooleem is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* Jooleem is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with Jooleem; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include "../UI/mainwindow.h"
+#include "../common/trap.h"
+#include "../common/events.h"
+
+#include "../common/surfacemanager.h"
+#include "../common/fontmanager.h"
+#include "../common/soundmanager.h"
+
+#include "../UI/uibutton.h"
+#include "../UI/uilabel.h"
+#include "../UI/uiprogress.h"
+
+
+MainWindow::MainWindow(SDL_Surface *background):
+UIWindow(background)
+{
+ InitControls();
+}
+
+MainWindow::~MainWindow()
+{
+
+}
+
+
+// Initializes the window's controls, and adds them to the
+// control collection
+void MainWindow::InitControls()
+{
+ SurfaceManager *surfaceMgr = SurfaceManager::GetInstance();
+ FontManager *fontMgr = FontManager::GetInstance();
+ SoundManager *sndMgr = SoundManager::GetInstance();
+
+ {
+ /////// Buttons ///////
+ SDL_Color buttonTextColor = {0, 0, 0, 0};
+ SDL_Event event;
+
+ // Start / restart:
+ UIButton *startButton = new UIButton();
+ startButton->Set(20, 344, "ButtonClick",
+ surfaceMgr->GetSurface("LargeButtonNormal"), surfaceMgr->GetSurface("LargeButtonDisabled"),
+ surfaceMgr->GetSurface("LargeButtonHover"), surfaceMgr->GetSurface("LargeButtonClicked"),
+ surfaceMgr->GetSurface("LargeButtonHover"), surfaceMgr->GetSurface("LargeButtonMask"));
+ startButton->AddState(EVENT_START, fontMgr->GetFont("LargeButtonFont"), "Start", buttonTextColor);
+ startButton->AddState(EVENT_RESTART, fontMgr->GetFont("LargeButtonFont"), "Restart", buttonTextColor);
+ startButton->SetState(EVENT_START);
+ startButton->SetMode(UIButton::MODE_NORMAL);
+ AddControl(BTN_START, startButton);
+
+ // Pause / resume:
+ UIButton *pauseButton = new UIButton();
+ pauseButton->Set(20, 276, "ButtonClick",
+ surfaceMgr->GetSurface("LargeButtonNormal"), surfaceMgr->GetSurface("LargeButtonDisabled"),
+ surfaceMgr->GetSurface("LargeButtonHover"), surfaceMgr->GetSurface("LargeButtonClicked"),
+ surfaceMgr->GetSurface("LargeButtonHover"), surfaceMgr->GetSurface("LargeButtonMask"));
+ pauseButton->AddState(EVENT_PAUSE, fontMgr->GetFont("LargeButtonFont"), "Pause", buttonTextColor);
+ pauseButton->AddState(EVENT_RESUME, fontMgr->GetFont("LargeButtonFont"), "Resume", buttonTextColor);
+ pauseButton->SetState(EVENT_PAUSE);
+ pauseButton->SetMode(UIButton::MODE_NORMAL);
+ AddControl(BTN_PAUSE, pauseButton);
+
+ // Quit:
+ UIButton *quitButton = new UIButton();
+ quitButton->Set(20, 412, "ButtonClick",
+ surfaceMgr->GetSurface("LargeButtonNormal"), surfaceMgr->GetSurface("LargeButtonDisabled"),
+ surfaceMgr->GetSurface("LargeButtonHover"), surfaceMgr->GetSurface("LargeButtonClicked"),
+ surfaceMgr->GetSurface("LargeButtonHover"), surfaceMgr->GetSurface("LargeButtonMask"));
+ event.type = SDL_QUIT;
+ quitButton->AddState(event, fontMgr->GetFont("LargeButtonFont"), "Quit", buttonTextColor);
+ quitButton->SetMode(UIButton::MODE_NORMAL);
+ AddControl(BTN_QUIT, quitButton);
+
+ // Hint:
+ UIButton *hintButton = new UIButton();
+ hintButton->Set(20, 208, "ButtonClick",
+ surfaceMgr->GetSurface("LargeButtonNormal"), surfaceMgr->GetSurface("LargeButtonDisabled"),
+ surfaceMgr->GetSurface("LargeButtonHover"), surfaceMgr->GetSurface("LargeButtonClicked"),
+ surfaceMgr->GetSurface("LargeButtonHover"), surfaceMgr->GetSurface("LargeButtonMask"));
+ hintButton->AddState(EVENT_HINT, fontMgr->GetFont("LargeButtonFont"), "Hint", buttonTextColor);
+ hintButton->SetMode(UIButton::MODE_NORMAL);
+ AddControl(BTN_HINT, hintButton);
+
+
+ // Mute / unmute:
+ UIButton *muteButton = new UIButton();
+ muteButton->Set(20, 140, "ButtonClick",
+ surfaceMgr->GetSurface("SmallButtonNormal"), surfaceMgr->GetSurface("SmallButtonDisabled"),
+ surfaceMgr->GetSurface("SmallButtonHover"), surfaceMgr->GetSurface("SmallButtonClicked"),
+ surfaceMgr->GetSurface("SmallButtonHover"), surfaceMgr->GetSurface("SmallButtonMask"));
+ muteButton->AddState(EVENT_MUTE, surfaceMgr->GetSurface("MuteButton"),
+ fontMgr->GetFont("TooltipFont"), "Mute");
+ muteButton->AddState(EVENT_UNMUTE, surfaceMgr->GetSurface("UnmuteButton"),
+ fontMgr->GetFont("TooltipFont"), "Unmute");
+ muteButton->SetState(EVENT_MUTE);
+ muteButton->SetMode(UIButton::MODE_NORMAL);
+ AddControl(BTN_MUTE, muteButton);
+
+ // About:
+ UIButton *aboutButton = new UIButton();
+ aboutButton->Set(120, 140, "ButtonClick",
+ surfaceMgr->GetSurface("SmallButtonNormal"), surfaceMgr->GetSurface("SmallButtonDisabled"),
+ surfaceMgr->GetSurface("SmallButtonHover"), surfaceMgr->GetSurface("SmallButtonClicked"),
+ surfaceMgr->GetSurface("SmallButtonHover"), surfaceMgr->GetSurface("SmallButtonMask"));
+ aboutButton->AddState(EVENT_ABOUT, surfaceMgr->GetSurface("AboutButton"),
+ fontMgr->GetFont("TooltipFont"), "About");
+ aboutButton->SetMode(UIButton::MODE_NORMAL);
+ AddControl(BTN_ABOUT, aboutButton);
+
+ // High scores:
+ UIButton *hiscoreButton = new UIButton();
+ hiscoreButton->Set(70, 140, "ButtonClick",
+ surfaceMgr->GetSurface("SmallButtonNormal"), surfaceMgr->GetSurface("SmallButtonDisabled"),
+ surfaceMgr->GetSurface("SmallButtonHover"), surfaceMgr->GetSurface("SmallButtonClicked"),
+ surfaceMgr->GetSurface("SmallButtonHover"), surfaceMgr->GetSurface("SmallButtonMask"));
+ hiscoreButton->AddState(EVENT_HIGH_SCORES, surfaceMgr->GetSurface("HighScoresButton"),
+ fontMgr->GetFont("TooltipFont"), "High Scores");
+ hiscoreButton->SetMode(UIButton::MODE_NORMAL);
+ AddControl(BTN_HISCORES, hiscoreButton);
+
+
+ /////// Labels ///////
+ SDL_Color scoreTextColor = {64, 64, 64, 0};
+
+ // Score:
+ UILabel *scoreLabel = new UILabel();
+ scoreLabel->Set(20, 70, surfaceMgr->GetSurface("ScoreLabel"), fontMgr->GetFont("ScoreFont"),
+ scoreTextColor);
+ AddControl(LBL_SCORE, scoreLabel);
+
+ // Level:
+ UILabel *levelLabel = new UILabel();
+ levelLabel->Set(20, 55, NULL, fontMgr->GetFont("LevelFont"),
+ scoreTextColor);
+ AddControl(LBL_LEVEL, levelLabel);
+
+ /*
+ // Time bar:
+ UILabel *timeBarLabel = new UILabel();
+ timeBarLabel->Set(192, 454, surfaceMgr->GetSurface("TimeBar"), NULL, scoreTextColor);
+ AddControl(LBL_TIMEBAR, timeBarLabel);
+ */
+
+ /////// Progress bar ///////
+ UIProgressBar *timeBar = new UIProgressBar();
+ timeBar->Set(192, 454, NULL, surfaceMgr->GetSurface("TimeBar"), surfaceMgr->GetSurface("TimeBarFlash"),
+ surfaceMgr->GetSurface("TimeBarPaused"));
+ AddControl(PRG_TIMEBAR, timeBar);
+
+ }
+}
+
diff --git a/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/mainwindow.h b/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/mainwindow.h
new file mode 100644
index 000000000..c9ad3dad7
--- /dev/null
+++ b/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/mainwindow.h
@@ -0,0 +1,65 @@
+/*
+* Copyright (C) 2005 Chai Braudo (braudo@users.sourceforge.net)
+*
+* This file is part of Jooleem - http://sourceforge.net/projects/jooleem
+*
+* Jooleem is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* Jooleem is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with Jooleem; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#ifndef _MAINWINDOW_H_
+#define _MAINWINDOW_H_
+
+// The main window.
+
+#include "../UI/uiwindow.h"
+#include "SDL.h"
+
+class MainWindow: public UIWindow
+{
+ public:
+
+ enum Controls {
+ // Buttons:
+ BTN_START, // Start / restart
+ BTN_PAUSE, // Pause / resume
+ BTN_QUIT, // Quit
+ BTN_HINT, // Hint
+ BTN_MUTE, // Mute
+ BTN_ABOUT, // About
+ BTN_HISCORES, // High scores
+
+ // Labels:
+ LBL_SCORE, // Game score
+ LBL_LEVEL, // Game level
+ //LBL_TIMEBAR, // The time bar
+
+ // Windows:
+ WND_ABOUT, // About window
+ WND_HISCORES, // High scores window
+
+ // Progress bar:
+ PRG_TIMEBAR, // Time bar
+ };
+
+ // Constructor / destructor:
+ MainWindow(SDL_Surface *background);
+ ~MainWindow();
+
+ private:
+ void InitControls(); // Initializes the window's controls, and adds them to the control collection
+};
+
+#endif
+
diff --git a/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/quitwindow.cpp b/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/quitwindow.cpp
new file mode 100644
index 000000000..e5d5d6c67
--- /dev/null
+++ b/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/quitwindow.cpp
@@ -0,0 +1,103 @@
+/*
+* Copyright (C) 2005 Chai Braudo (braudo@users.sourceforge.net)
+*
+* This file is part of Jooleem - http://sourceforge.net/projects/jooleem
+*
+* Jooleem is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* Jooleem is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with Jooleem; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include "../UI/quitwindow.h"
+#include "../common/trap.h"
+#include "../common/events.h"
+
+#include "../common/surfacemanager.h"
+#include "../common/fontmanager.h"
+#include "../common/soundmanager.h"
+
+#include "../UI/uibutton.h"
+#include "../UI/uilabel.h"
+
+
+QuitWindow::QuitWindow(SDL_Surface *background):
+UIWindow(background)
+{
+ InitControls();
+}
+
+QuitWindow::~QuitWindow()
+{
+
+}
+
+
+// Initializes the window's controls, and adds them to the
+// control collection
+void QuitWindow::InitControls()
+{
+ SurfaceManager *surfaceMgr = SurfaceManager::GetInstance();
+ FontManager *fontMgr = FontManager::GetInstance();
+ SoundManager *sndMgr = SoundManager::GetInstance();
+
+ {
+ /////// Buttons ///////
+ SDL_Color buttonTextColor = {0, 0, 0, 0};
+
+ // Close:
+ UIButton *quitButton = new UIButton();
+ quitButton->Set(0, 0, "ButtonClick",
+ surfaceMgr->GetSurface("MediumButtonNormal"), surfaceMgr->GetSurface("MediumButtonDisabled"),
+ surfaceMgr->GetSurface("MediumButtonHover"), surfaceMgr->GetSurface("MediumButtonClicked"),
+ surfaceMgr->GetSurface("MediumButtonHover"), surfaceMgr->GetSurface("MediumButtonMask"));
+ SDL_Event event;
+ event.type = SDL_QUIT;
+ quitButton->AddState(event, fontMgr->GetFont("MediumButtonFont"), "Quit", buttonTextColor);
+ quitButton->Align(UIControl::HALN_LEFT, UIControl::VALN_BOTTOM, 328, 290);
+ quitButton->SetMode(UIButton::MODE_NORMAL);
+ AddControl(BTN_QUIT, quitButton);
+
+ // Play:
+ UIButton *playButton = new UIButton();
+ playButton->Set(0, 0, "ButtonClick",
+ surfaceMgr->GetSurface("MediumButtonNormal"), surfaceMgr->GetSurface("MediumButtonDisabled"),
+ surfaceMgr->GetSurface("MediumButtonHover"), surfaceMgr->GetSurface("MediumButtonClicked"),
+ surfaceMgr->GetSurface("MediumButtonHover"), surfaceMgr->GetSurface("MediumButtonMask"));
+ playButton->AddState(EVENT_CLOSE, fontMgr->GetFont("MediumButtonFont"), "Play", buttonTextColor);
+ playButton->Align(UIControl::HALN_RIGHT, UIControl::VALN_BOTTOM, 312, 290);
+ playButton->SetMode(UIButton::MODE_NORMAL);
+ AddControl(BTN_PLAY, playButton);
+
+ /////// Labels ///////
+ SDL_Color titleColor = {64, 64, 64, 0};
+ SDL_Color labelTextColor = {0, 0, 0, 0};
+
+ // Title:
+ UILabel *titleLabel = new UILabel();
+ titleLabel->Set(0, 0, NULL, fontMgr->GetFont("WindowTitleFont"), titleColor);
+ titleLabel->SetText(UIControl::HALN_LEFT, "Quit");
+ titleLabel->Align(UIControl::HALN_CENTER, UIControl::VALN_TOP, 320, 191);
+ AddControl(LBL_TITLE, titleLabel);
+
+ // Dialog text:
+ UILabel *textLabel = new UILabel();
+ textLabel->Set(0, 0, NULL, fontMgr->GetFont("DialogTextFont"), labelTextColor);
+ textLabel->SetText( UIControl::HALN_LEFT,
+ "Are you sure you want to\n"
+ "quit Jooleem?");
+ textLabel->Align(UIControl::HALN_CENTER, UIControl::VALN_BOTTOM, 320, 252);
+ AddControl(LBL_TEXT, textLabel);
+
+ }
+}
+
diff --git a/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/quitwindow.h b/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/quitwindow.h
new file mode 100644
index 000000000..7b0b903e4
--- /dev/null
+++ b/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/quitwindow.h
@@ -0,0 +1,53 @@
+/*
+* Copyright (C) 2005 Chai Braudo (braudo@users.sourceforge.net)
+*
+* This file is part of Jooleem - http://sourceforge.net/projects/jooleem
+*
+* Jooleem is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* Jooleem is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with Jooleem; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#ifndef _QUITWINDOW_H_
+#define _QUITWINDOW_H_
+
+// The quit dialog window.
+
+#include "../UI/uiwindow.h"
+#include "SDL.h"
+
+class QuitWindow: public UIWindow
+{
+ public:
+
+ enum Controls {
+ // Buttons:
+ BTN_QUIT, // Close
+ BTN_PLAY, // Play
+
+ // Labels:
+ LBL_TITLE, // Window title
+ LBL_TEXT, // Dialog text
+ };
+
+ // Constructor / destructor:
+ QuitWindow(SDL_Surface *background);
+ ~QuitWindow();
+
+ private:
+ void InitControls(); // Initializes the window's controls, and adds them to the control collection
+};
+
+
+#endif
+
diff --git a/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/uibutton.cpp b/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/uibutton.cpp
new file mode 100644
index 000000000..b5a5fd66a
--- /dev/null
+++ b/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/uibutton.cpp
@@ -0,0 +1,559 @@
+/*
+* Copyright (C) 2005 Chai Braudo (braudo@users.sourceforge.net)
+*
+* This file is part of Jooleem - http://sourceforge.net/projects/jooleem
+*
+* Jooleem is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* Jooleem is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with Jooleem; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include "../UI/uibutton.h"
+#include "../common/trap.h"
+#include "../common/events.h"
+#include "../common/soundmanager.h"
+#include "SDL_image.h"
+#include
+
+using namespace std;
+
+
+// Constructor - initialize the data members:
+UIButton::UIButton()
+{
+ m_maskW = m_maskH = 0;
+ m_clickSoundID = "";
+ for (int i = 0 ; i < MODE_MAX ; ++i)
+ m_surfaces[i] = NULL;
+ m_currentMode = MODE_DISABLED;
+ m_enabled = true;
+ m_visible = true;
+ m_mask = NULL;
+ m_showTooltip = false;
+ m_isFlashing = false;
+
+ // Populate the tooltip callback timer parameter struct:
+ m_tooltipParam.currentMode = &m_currentMode;
+ m_tooltipParam.showTooltip = &m_showTooltip;
+}
+
+
+// Destructor - Free the tooltip surfaces memory for all the states:
+UIButton::~UIButton()
+{
+ SDL_RemoveTimer(m_timerID);
+
+ map::iterator itr;
+ for (itr = m_states.begin() ; itr != m_states.end() ; itr++)
+ {
+ if ((itr->second).toolTipSurface != NULL)
+ SDL_FreeSurface((itr->second).toolTipSurface);
+ }
+
+ delete []m_mask;
+}
+
+
+
+// Set the button's location, click sounds, surfaces and mask:
+void UIButton::Set(Uint16 x, Uint16 y, string clickSoundID, SDL_Surface* normal,
+ SDL_Surface* disabled, SDL_Surface* hover, SDL_Surface* clicked,
+ SDL_Surface* flash, SDL_Surface* mask)
+{
+ SetLocation(x, y);
+
+ m_clickSoundID = clickSoundID;
+
+ m_surfaces[MODE_NORMAL] = normal;
+ m_surfaces[MODE_DISABLED] = disabled;
+ m_surfaces[MODE_HOVER] = hover;
+ m_surfaces[MODE_CLICKED] = clicked;
+ m_surfaces[MODE_FLASH] = flash;
+
+ if (mask != NULL)
+ {
+ m_w = (Sint16) mask->w;
+ m_h = (Sint16) mask->h;
+ }
+ else
+ {
+ m_w = (Sint16) normal->w;
+ m_h = (Sint16) normal->h;
+ }
+
+ MakeMask(mask);
+}
+
+
+// Handle a mouse down event:
+bool UIButton::MouseDown(Uint16 x, Uint16 y)
+{
+ if (m_states.size() == 0 || m_visible == false || m_currentMode == MODE_DISABLED ||
+ m_currentMode == MODE_CLICKED)
+ return false;
+
+ if (IsInButton(x, y))
+ {
+ m_currentMode = MODE_CLICKED;
+ return true;
+ }
+ else
+ return false;
+}
+
+
+// Handle a mouse down event:
+bool UIButton::MouseUp(Uint16 x, Uint16 y)
+{
+ if (m_states.size() == 0 || m_visible == false || m_currentMode == MODE_DISABLED
+ || m_currentMode != MODE_CLICKED)
+ return false;
+
+ if (IsInButton(x, y))
+ return Click();
+ else
+ {
+ m_currentMode = MODE_NORMAL;
+ return true;
+ }
+}
+
+// Are the coordinates inside the button (use mask)?
+bool UIButton::IsInButton(Uint16 x, Uint16 y)
+{
+ Sint32 X = x - m_x;
+ Sint32 Y = y - m_y;
+
+ // If no mask is defined, do a simple boundry check:
+ if (m_mask == NULL)
+ return (X > 0 && Y > 0 && X <= m_surfaces[m_currentMode]->w && Y <= m_surfaces[m_currentMode]->h);
+
+ // Otherwise, check the mask:
+ if (X < 0 || Y < 0 || X >= m_maskW || Y >= m_maskH)
+ return false;
+
+ return ((m_mask[Y * m_maskW + X] == 0)? false : true);
+}
+
+
+// Are the coordinates inside the button?
+bool UIButton::IsInRect(Uint16 x, Uint16 y)
+{
+ return (m_x <= x && m_x + m_w >= x && m_y <= y && m_w + m_h >= y);
+}
+
+
+// An unconditional click:
+bool UIButton::Click()
+{
+ if (m_states.size() == 0 || m_visible == false || m_currentMode == MODE_DISABLED)
+ return false;
+
+ // Play the sound:
+ if (m_clickSoundID != "")
+ SoundManager::GetInstance()->PlaySound(m_clickSoundID);
+
+ // Push the event into the even queue:
+ SDL_PushEvent(&m_currentState.event);
+
+ // Switch to clicked mode:
+ m_currentMode = MODE_NORMAL;
+
+ return true;
+}
+
+// Clicks the button if the coords are valid:
+bool UIButton::Click(Uint16 x, Uint16 y)
+{
+ if (IsInButton(x, y))
+ return Click();
+ else
+ return false;
+}
+
+
+// Switch to hover mode.
+bool UIButton::Hover()
+{
+ m_currentMode = MODE_HOVER;
+ return true;
+}
+
+
+// Switch to hover mode, if the cursor is over the button.
+bool UIButton::Hover(Uint16 x, Uint16 y)
+{
+ if (m_states.size() == 0 || m_visible == false || m_currentMode == MODE_DISABLED
+ || m_currentMode == MODE_CLICKED || m_currentMode == MODE_FLASH)
+ return false;
+
+ if (IsInButton(x, y))
+ {
+ if (m_currentMode != MODE_HOVER) // We just started hovering
+ {
+ m_currentMode = MODE_HOVER;
+
+ // Set the tooltip callback timer:
+ m_timerID = SDL_AddTimer(TOOLTIP_DELAY, TriggerTooltip, &m_tooltipParam);
+
+ return true;
+ }
+ }
+ else if (m_currentMode == MODE_HOVER) // Restore to normal when no longer over button
+ {
+ m_currentMode = MODE_NORMAL;
+ m_showTooltip = false;
+ SDL_RemoveTimer(m_timerID);
+ return true;
+ }
+
+ return false;
+}
+
+
+// Switch to disabled mode.
+// Clicks on the button will be ignored.
+void UIButton::Disable()
+{
+ m_enabled = false;
+ m_currentMode = MODE_DISABLED;
+ m_showTooltip = false;
+}
+
+
+// Sets the button's enabled / disabled state.
+// Overrides the base class' method, to make it is compatible
+// with the button states.
+void UIButton::SetEnabled(bool enabled)
+{
+ m_enabled = enabled;
+ m_showTooltip = false;
+
+ if (enabled)
+ m_currentMode = MODE_NORMAL;
+ else
+ m_currentMode = MODE_DISABLED;
+}
+
+
+// Switch to flash mode.
+// Set the button to flash every a_iInterval ms.
+void UIButton::Flash(Uint32 interval)
+{
+ m_flashStart = SDL_GetTicks();
+ m_flashInterval = interval;
+ m_isFlashing = true;
+ m_currentMode = MODE_FLASH;
+}
+
+
+// Switch to normal (enabled) mode.
+void UIButton::Normal()
+{
+ m_currentMode = MODE_NORMAL;
+ m_showTooltip = false;
+}
+
+
+// Adds a state - User event / Text:
+void UIButton::AddState(int eventCode, Font *font, string text, SDL_Color color,
+ Font *tooltipFont, string tooltipText)
+{
+ SDL_Event event;
+
+ event.type = SDL_USEREVENT;
+ event.user.code = eventCode;
+
+ AddState(event, font, text, color, tooltipFont, tooltipText);
+}
+
+
+// Adds a state - SDL event / Text.
+void UIButton::AddState(SDL_Event event, Font *font, string text, SDL_Color color,
+ Font *tooltipFont, string tooltipText)
+{
+ State state;
+
+ // Render the text surface:
+ if (font != NULL && text != "")
+ state.textSurface = font->RenderPlain(Font::ALN_LEFT, color, text);
+
+ // Create the tooltip:
+ if (tooltipFont != NULL && tooltipText != "")
+ state.toolTipSurface = CreateTooltip(tooltipFont, tooltipText);
+ else
+ state.toolTipSurface = NULL;
+
+ // Set the event:
+ state.event = event;
+
+ // Add the state to the map. The name is the event type. For user events,
+ // the name is the event code.
+ if (event.type == SDL_USEREVENT)
+ m_states.insert(pair(event.user.code, state));
+ else
+ m_states.insert(pair(event.type, state));
+
+ m_currentState = state;
+}
+
+
+
+// Adds a state - User event / Image:
+void UIButton::AddState(int eventCode, SDL_Surface *surface, Font *tooltipFont, string tooltipText)
+{
+ SDL_Event event;
+
+ event.type = SDL_USEREVENT;
+ event.user.code = eventCode;
+
+ AddState(event, surface, tooltipFont, tooltipText);
+}
+
+
+// Adds a state - SDL event / Image:
+void UIButton::AddState(SDL_Event event, SDL_Surface *surface, Font *tooltipFont, string tooltipText)
+{
+ State state;
+
+ state.textSurface = surface;
+
+ // Set the event:
+ state.event = event;
+
+ // Create the tooltip:
+ if (tooltipFont != NULL && tooltipText != "")
+ state.toolTipSurface = CreateTooltip(tooltipFont, tooltipText);
+ else
+ state.toolTipSurface = NULL;
+
+ // Add the state to the map. The name is the event type. For user events,
+ // the name is the event code.
+ if (event.type == SDL_USEREVENT)
+ m_states.insert(pair(event.user.code, state));
+ else
+ m_states.insert(pair(event.type, state));
+
+ m_currentState = state;
+}
+
+
+// Sets the button's state.
+void UIButton::SetState(int state)
+{
+ map::iterator itr = m_states.find(state);
+ if (itr != m_states.end())
+ m_currentState = itr->second;
+}
+
+
+// Sets the button's mode:
+void UIButton::SetMode(ButtonMode mode)
+{
+ m_currentMode = mode;
+}
+
+
+
+// Updates the button.
+// Needed for flashing buttons.
+// Return true if a redraw is needed.
+bool UIButton::Update()
+{
+ if (m_enabled != true || m_currentMode != MODE_FLASH)
+ return false;
+
+ bool redraw = false;
+
+ if (((SDL_GetTicks() - m_flashStart) / m_flashInterval) % 2) // Flashing
+ {
+ if (!m_isFlashing) // ... but was not flashing before
+ redraw = true;
+ m_isFlashing = true;
+ }
+ else // Not flashing
+ {
+ if (m_isFlashing) // ... but was flashing before
+ redraw = true;
+
+ m_isFlashing = false;
+ }
+
+ return redraw;
+}
+
+// Draws the button:
+void UIButton::Draw(SDL_Surface *screen)
+{
+ if (!m_visible)
+ return;
+
+ // Draw button:
+ SDL_Rect rect = {m_x, m_y, 0, 0};
+
+ // Draw the basic surface:
+ if (m_currentMode == MODE_FLASH && m_isFlashing)
+ SDL_BlitSurface(m_surfaces[MODE_NORMAL], NULL, screen, &rect);
+ else // Not flashing or between flashes
+ SDL_BlitSurface(m_surfaces[m_currentMode], NULL, screen, &rect);
+
+ // Draw text, centered horizontally and vertically:
+ rect.x = (Sint16) (m_x + (m_surfaces[m_currentMode]->w - m_currentState.textSurface->w) / 2);
+ rect.y = (Sint16) (m_y + (m_surfaces[m_currentMode]->h - m_currentState.textSurface->h) / 2);
+ SDL_BlitSurface(m_currentState.textSurface, NULL, screen, &rect);
+
+ // Draws the tooltip:
+ if (m_showTooltip && m_currentState.toolTipSurface != NULL && m_currentMode != MODE_DISABLED)
+ {
+ rect.x = (Sint16)(m_x + m_w / 2 - m_currentState.toolTipSurface->w / 2);
+ rect.y = (Sint16)(m_y + m_h);
+
+ SDL_BlitSurface(m_currentState.toolTipSurface, NULL, screen, &rect);
+ }
+}
+
+
+// Creates a mask from a surface.
+// http://sdldoc.csn.ul.ie/guidevideo.php#AEN112
+void UIButton::MakeMask(SDL_Surface* maskSurface)
+{
+ if (maskSurface == NULL)
+ return;
+
+ m_maskW = (Uint16) maskSurface->w;
+ m_maskH = (Uint16) maskSurface->h;
+
+ {
+ m_mask = new Uint8[m_maskW * m_maskH];
+ }
+
+ // Lock the surface:
+ if(SDL_MUSTLOCK(maskSurface)) {
+ if(SDL_LockSurface(maskSurface) < 0)
+ return;
+ }
+
+ // Copy each pixel from the alpha or red channels to the mask:
+ Uint32 pixel; // Value of the current pixel
+ Uint8 *pPixel; // Pointer to the current pixel
+ Uint8 g,b;
+ for (Uint16 i = 0 ; i < m_maskW ; ++i)
+ for (Uint16 j = 0 ; j < m_maskH ; ++j)
+ {
+ // 32 bit images - the mask is based on the alpha channel:
+ if (maskSurface->format->BytesPerPixel == 4)
+ {
+ pPixel = (Uint8 *) maskSurface->pixels + j * maskSurface->pitch +
+ i * maskSurface->format->BytesPerPixel;
+
+ SDL_PixelFormat *fmt = maskSurface->format;
+ pixel = *(Uint32 *)pPixel & fmt->Amask; // Isolate alpha component
+ pixel = pixel >> fmt->Ashift; // Shift it down to 8-bit
+ pixel = pixel << fmt->Aloss; // Expand to a full 8-bit number
+ m_mask[j * m_maskW + i] = (Uint8) pixel;
+ }
+
+ // 24 bit images - the mask is based on the red channel:
+ else if (maskSurface->format->BytesPerPixel == 3)
+ {
+ pPixel = (Uint8 *) maskSurface->pixels + j * maskSurface->pitch +
+ i * maskSurface->format->BytesPerPixel;
+
+ if(SDL_BYTEORDER == SDL_BIG_ENDIAN)
+ pixel = pPixel[0] << 16 | pPixel[1] << 8 | pPixel[2];
+ else
+ pixel = pPixel[0] | pPixel[1] << 8 | pPixel[2] << 16;
+
+ SDL_GetRGB(pixel, maskSurface->format, &m_mask[j * m_maskW + i],
+ &g, &b);
+ }
+ }
+
+ // Unlock:
+ if(SDL_MUSTLOCK(maskSurface))
+ SDL_UnlockSurface(maskSurface);
+}
+
+
+// Creates a tooltip.
+SDL_Surface* UIButton::CreateTooltip(Font *tooltipFont, string tooltipText)
+{
+ // Render the text on a colored background:
+ SDL_Surface *shadedText =
+ tooltipFont->RenderShaded(Font::ALN_LEFT, TOOLTIP_FG, TOOLTIP_BG, tooltipText);
+
+ // Get a pointer to the screen, so we can create surfaces with
+ // the same pixel format:
+ SDL_Surface* screen = SDL_GetVideoSurface();
+
+ // Create a surface the will form the tooltip's background:
+ SDL_Surface *background = SDL_CreateRGBSurface(screen->flags,
+ shadedText->w + 8, shadedText->h + 4, // Add some spacing
+ screen->format->BitsPerPixel,
+ screen->format->Rmask,
+ screen->format->Gmask,
+ screen->format->Bmask, 0);
+
+ TRAP(background == NULL, "UIButton::MakeTooltip - SDL_CreateRGBSurface failed");
+
+ // Fill the surface with the background color:
+ SDL_FillRect(background, NULL, SDL_MapRGB(background->format, TOOLTIP_BG.r, TOOLTIP_BG.g, TOOLTIP_BG.b));
+
+ // Create a surface that will form the tooltip's border.
+ SDL_Surface *border = SDL_CreateRGBSurface(screen->flags,
+ background->w + 2, background->h + 2, // Add a 1px border
+ screen->format->BitsPerPixel,
+ screen->format->Rmask,
+ screen->format->Gmask,
+ screen->format->Bmask, 0);
+
+ TRAP(border == NULL, "UIButton::MakeTooltip - SDL_CreateRGBSurface failed");
+
+ // Fill the surface with the foreground color:
+ SDL_FillRect(border, NULL, SDL_MapRGB(border->format, TOOLTIP_FG.r, TOOLTIP_FG.g, TOOLTIP_FG.b));
+
+ // Blit the text on to the background surface:
+ SDL_Rect rect = {4, 2, 0, 0};
+ SDL_BlitSurface(shadedText, NULL, background, &rect);
+
+ // Blit the background + text on the border surface:
+ rect.x = rect.y = 1;
+ SDL_BlitSurface(background, NULL, border, &rect);
+
+ // The text surface is no longer needed:
+ SDL_FreeSurface(shadedText);
+ SDL_FreeSurface(background);
+
+ return border;
+}
+
+
+// Trigger tooltip timer callback function.
+// If by the time this is called the button is still in hover mode,
+// then the tooltip should be shown.
+Uint32 UIButton::TriggerTooltip(Uint32 interval, void* param)
+{
+ TooltipParam *tooltipParam = (TooltipParam *) param;
+
+ if (tooltipParam == NULL)
+ return 0;
+
+ if (*(tooltipParam->currentMode) == UIButton::MODE_HOVER)
+ *(tooltipParam->showTooltip) = true;
+
+ // Force a redraw:
+ PushUserEvent(EVENT_REDRAW);
+
+ return 0;
+}
+
diff --git a/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/uibutton.h b/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/uibutton.h
new file mode 100644
index 000000000..cb4c40f7a
--- /dev/null
+++ b/alienblaster/project/jni/application/jooleem_0.1.4/src/UI/uibutton.h
@@ -0,0 +1,166 @@
+/*
+* Copyright (C) 2005 Chai Braudo (braudo@users.sourceforge.net)
+*
+* This file is part of Jooleem - http://sourceforge.net/projects/jooleem
+*
+* Jooleem is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* Jooleem is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with Jooleem; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#ifndef _UIBUTTON_H_
+#define _UIBUTTON_H_
+
+// User interface button class.
+// A button has several modes (normal, hover etc.), and one
+// or more user defined states.
+// Once a button is clicked, it pushes an event defined by
+// its current state.
+// The class also supports tooltips.
+
+#include "../UI/uicontrol.h"
+#include "../common/font.h"
+
+#include "SDL.h"
+
+#include
+#include