Mikko Rasa [Wed, 12 Nov 2014 20:22:15 +0000 (22:22 +0200)]
Chdir into a sensible location before starting the application
System location accessors will ultimately return this directory. The
default is /, which can easily cause problems. In particular, many of
my applications expect to have their data in get_sys_data_dir()/"data".
On Android /data exists but is not readable.
Mikko Rasa [Mon, 10 Nov 2014 17:32:54 +0000 (19:32 +0200)]
Deprecate the system directory accessors that take arguments
They are fundamentally broken due to their dependence on cwd and $PATH,
which may be changed after application startup. Now that Application
stores an absolute argv0, the argument-less versions can provide a more
consistent answer.
Implementations for the functions are still the same, as they behave
correctly when an absolute argv0 is passed in. At some point in the
future I'll remove the old versions completely.
Mikko Rasa [Mon, 10 Nov 2014 17:29:11 +0000 (19:29 +0200)]
Store absolute path to argv[0] in Application
Working directory or $PATH may be changed by the program, so it may not
be possible to recover the executable later. It's still not completely
reliable since the parent process can pass any value for argv[0] through
execve().
Mikko Rasa [Mon, 10 Nov 2014 17:25:19 +0000 (19:25 +0200)]
Allow startup info to be set externally
... but only if startup didn't happen through Application::run(). Certain
facilities, like Graphics::Display on Windows, require startup info to be
set and would not work without this in a custom startup scenario.
Mikko Rasa [Sun, 19 Oct 2014 17:23:02 +0000 (20:23 +0300)]
Expose the asset manager from Android::MainThread
AFAICT the asset manager is tied to the application and not the activity,
so this simple approach should be safe even if the activity gets destroyed
and recreated due to orientation change or whatever.
Mikko Rasa [Sun, 19 Oct 2014 13:33:01 +0000 (16:33 +0300)]
Synchronize access to the underlying object of Slice
This was prompted by the interactions between GL::ResourceManager and
some upcoming changes to DataFile::PackSource. If a new Slice object is
created and tries to connect to signal_flush_required at the exact moment
another Slice is seeking and causing the signal to be emitted, the emit
and connect calls step on each others' toes and corrupt the heap.
Mikko Rasa [Sun, 12 Oct 2014 11:35:05 +0000 (14:35 +0300)]
Add window and input management signals for Android
The onCreate handler will now wait until either the main Application
object is constructed or the MainThread's resume_startup function is
called. This ensures that the application (or a library such as mspgui)
can connect to the signals before they are emitted.
Mikko Rasa [Sat, 11 Oct 2014 10:32:23 +0000 (13:32 +0300)]
Minimalistic port for Android
Application startup through NativeActivity is provided and uncaught
exceptions are logged. A number of things are still in need of proper
implementations.
Mikko Rasa [Sun, 5 Oct 2014 10:48:57 +0000 (13:48 +0300)]
Use direct constant values for non-POSIX baud rates
Not all systems (particularly older ones) have #defines for the extended
baud rates, and the standard doesn't provide anything to check their
existence either.
Mikko Rasa [Mon, 6 Jan 2014 19:55:30 +0000 (21:55 +0200)]
Change get_bin_dir logic to assume exe in cwd if not otherwise found
Windows has an implicit . component in $PATH, which can cause programs
started from command line to not find their executable in $PATH. This
fixes the issue, and should not cause undue trouble on other systems.
Mikko Rasa [Sat, 5 Oct 2013 12:12:35 +0000 (15:12 +0300)]
Redesign uncaught exception handling to allow external reporters
This helps keep UI code out of the core library. It was becoming a
problem especially on OS X where including an Objective-C wrapper around
NSAlert would have broken Builder's bootstrap. Libmspgui will acquire
a class that will present graphical error dialogs on each platform.
Mikko Rasa [Fri, 3 May 2013 09:42:27 +0000 (12:42 +0300)]
Add support for positional arguments in GetOpt
This addresses the issue of any positional arguments recognized by an
application not showing up in the generated help text. It also reduces
the amount of processing and validation required from the application
itself and provides consistent error messages.
Mikko Rasa [Sat, 20 Apr 2013 14:47:50 +0000 (17:47 +0300)]
Fix Timer to use is Semaphore correctly
Besides still assuming the old condvar-style semantics, it was also
horribly broken and contained potential deadlocks and race conditions.
Not to mention unusable due to a missing constructor.
Mikko Rasa [Sat, 20 Apr 2013 14:19:55 +0000 (17:19 +0300)]
Add activation check to the rest of Filtered's virtual functions
This fixes a bug manifesting in builder where a put call that triggers a
BufferedFile's buffer flush causes the buffer contents to be written to
the file twice.