Added gitignore file.

Signed-off-by: Byron Sanchez <bfs5030@gmail.com>
Added resources and dependencies submodules.

By splitting the resources and the vendor directory into their
own seperate repos, we can manage the inevitable bloat of each
repository by isolating the bloat by type.

This has tradeoffs, but the point is to be able to download source code
quickly without the need of pulling in dependencies or resources.

Signed-off-by: Byron Sanchez <bfs5030@gmail.com>
Added common project files.

Signed-off-by: Byron Sanchez <bfs5030@gmail.com>
Added standard Xcode project files.

Signed-off-by: Byron Sanchez <bfs5030@gmail.com>
Added the database dump file.

To create the actual database, run the following command:

sqlite3 coloring_book.db < coloring-book.sql

An entire dump file is sufficient as there is not much data in the
database. However, if it ever gets huge, consider using change scripts.

Signed-off-by: Byron Sanchez <bfs5030@gmail.com>
Added source files.

The source files contain almost the entirety of the Coloring Book app.
There are a few things that would need to be implemented (or
alternatively, removed) for a clean build. So as of this commit,
the application isn't automatically buildable when the repository is
cloned. This will need to be addressed.

Signed-off-by: Byron Sanchez <bfs5030@gmail.com>
Added support files.

Support files sometimes help during compilation or at runtime. For
example, the strings file generalizes application strings for potential
multi-language support.

Signed-off-by: Byron Sanchez <bfs5030@gmail.com>
Updated license files and added urls.

Signed-off-by: Byron Sanchez <bfs5030@gmail.com>
Fixed AppDelegate.h imports.

They were not present, and this resulted in an unbuildable application.

Signed-off-by: Byron Sanchez <bfs5030@gmail.com>
Updated the vendor submodule commit reference and project data.

Signed-off-by: Byron Sanchez <bfs5030@gmail.com>
Added build.sh script to facilitate project compilation.

build.sh is to be used once on a freshly cloned repo. It will make all
necessary changes so that projects can compile successfully on any
machine.

Signed-off-by: Byron Sanchez <bfs5030@gmail.com>
Added the nuke script.

The nuke script removes content that has not been licensed to other
developers for re-use. The content remains in the repository because it
ensures the application is buildable, but if any other developer wants
to have their own distribution (e.g., via a binary file), the
copyrighted material MUST be removed.

So the nuke script facilitates this.

Signed-off-by: Byron Sanchez <bfs5030@gmail.com>
Updated various files for release of v1.0

Signed-off-by: Byron Sanchez <bfs5030@gmail.com>
Updated the application so that it can generate database and all updates

The application will now generate the database on first launch as
opposed to being pregenerated. This will allow for easy updates in the
future via change scripts. Precautions have been taken for all users who
have previously installed the application with the pre-generated
database.

Signed-off-by: Byron Sanchez <bfs5030@gmail.com>
Fixed a ColorActivity bug that reduced brush softness.

The softness of the brushed was reduced whenever erase-mode was disabled
by clicking the brush button directly. This is because this case was not
setting the mHard switch to NO, and so the hard-brush for the eraser
stayed enabled for the brush.

This update fixes that issue.

Signed-off-by: Byron Sanchez <bfs5030@gmail.com>
Optimized the flood-fill algorithm.

Instead of using NSMutableArrays, which can dynamically allocate memory
up to arbitrary size, the algorithm is now using boolean arrays that are
preallocated with the maximum width and height of the images dimensions.
The boolean arrays default to false values. When a pixel is to be filled
with a color, the corresponding boolean value is set to true.

This is faster than using NSMutableArrays and ultimately uses much less
heap memory.

Signed-off-by: Byron Sanchez <bfs5030@gmail.com>
Merge branch 'feature-optimize-floodfill' into github
Fixed bug that crashes app when a valid response is not received.

The response callback function sometimes does not have valid product
data. In these cases, the application would attempt to use the info from
the invalid array and this would cause crashes. Now, if the array
contains invalid data, the data is not used at all.

Signed-off-by: Byron Sanchez <bfs5030@gmail.com>
Created a DBUpgradeTask which creates a worker thread for DDL execution.

Since all database setup and upgrades occur via DDL statements stored in
local files, complex setups may take a little bit longer. This will
create a worker thread for these setup and upgrades ops. The user will
see a notification on the screen stating that an upgrade is in progress
and an indeterminate progress indicator is displayed.

In addition to these database updates, the SplashScreenViewController
now creates a thread that waits for upgrades to complete if necessary in
addition to the splash time. The waiting occurs on this seperate thread.
Once both conditions have been satisfied, the splashs creen invokes
hideSplash() on the main thread. ViewController will then retrieve the
database info AFTER the SplashViewController is hidden via
viewDidAppear().

Signed-off-by: Byron Sanchez <bfs5030@gmail.com>
Fixed blend-mode bug that occurs when switching from fill to erase mode.

If you were to switch to erase mode during the middle of a flood-fill
op, the fill would occur in erase-mode. In other words, the fill would
actually erase the area it was meant to fill! This commit changes the
blend mode to normal when a flood-fill is actuall being added to the
canvas. Then it switches back to the last blend mode after the fill
operation is complete.

Signed-off-by: Byron Sanchez <bfs5030@gmail.com>