Philip Chimento [Tue, 25 Mar 2014 06:16:53 +0000 (06:16 +0000)]
Reset Glk style hints at beginning of program
The Glk program can change the style hints so that different styles
display differently. These style hints should not carry over into the
next execution of the Glk program, or even a different Glk program. This
resets them at the beginning of a Glk program execution.
Philip Chimento [Tue, 25 Mar 2014 04:53:19 +0000 (04:53 +0000)]
Clear GModule pointer to prevent accidental re-use
This makes it harmless (as it should be) to call
chimara_glk_unload_plugin() more than once. Since it is called in any
case when running a new game, client code calling it externally would
occasionally result in problems.
Philip Chimento [Mon, 28 Oct 2013 05:09:29 +0000 (22:09 -0700)]
Sync new GStreamer element to parent state
In GStreamer 1.0, when adding a new element to the pipeline in a signal
handler, its state has to be synced to the pipeline's state, because the
handler could be called in the middle of a state change which would
cause the state change to hang.
This was supposed to be done in GStreamer 0.10 too, but it never caused
any problems.
Philip Chimento [Sun, 27 Oct 2013 20:55:59 +0000 (13:55 -0700)]
Support for GStreamer 1.0
Configure.ac now supports an argument --with-sound, with
possible values "no", "auto" (default), "gstreamer0.10", and
"gstreamer1.0". The old --with-gstreamer option is removed.
Supplying "auto" will pick which sound library is available,
preferring 1.0 over 0.10.
Philip Chimento [Sat, 26 Oct 2013 23:03:36 +0000 (16:03 -0700)]
Change I/O signals to pass a unique window ID
Change the 'char-input', 'line-input', and 'text-buffer-output'
signals to pass a unique window ID string as well as the
window rock value. If a client program wants to keep track of
input and output in all windows, then the window rock will
not do by itself - all open windows might have rock 0, for
example. The string ID is guaranteed to be unique for each
window, though its contents are implementation-defined.
Philip Chimento [Wed, 25 Sep 2013 06:14:46 +0000 (23:14 -0700)]
Add Glk unit test framework
This is the beginning of a unit test framework for Glk. Currently it has
only one test. But the potential is infinite! It could be used to test
how well other Glk implementations conform too.
Philip Chimento [Fri, 13 Sep 2013 21:58:52 +0000 (14:58 -0700)]
Port date/time functions to GDateTime
These are supposedly portable to more platforms than POSIX, effectively
putting the burden of checking whether a platform supports it onto GLib,
instead of having Chimara shoulder it.
Philip Chimento [Sat, 31 Aug 2013 21:07:08 +0000 (14:07 -0700)]
Use g_thread_try_new() instead of g_thread_create()
g_thread_create() was deprecated in GLib 2.32. We don't use
g_thread_new() because the program should not abort if the thread
could not be created; rather, it should display an error message
and refuse to start the game.
The old functions were deprecated and the new functions were added as
of GLib 2.32.
This requires all structures to use GMutex members instead of GMutex *
pointers; likewise for GCond. Since we cannot set the GMutex * pointers
to NULL anymore when the ChimaraGlk widget is finalized, we add an
after_finalize flag that is set at the beginning of
chimara_glk_finalize().
Philip Chimento [Fri, 28 Sep 2012 13:59:29 +0000 (15:59 +0200)]
[player] Call Gdk.threads_init() before import Gtk
I thought this might fix the crashing problems with the Python
player, since you should initialize Gdk threads before initializing
Gtk, and Gtk is initialized on import from gi.repository.
It didn't fix the problems, but it's a good thing to do anyway.
Philip Chimento [Sun, 16 Sep 2012 20:22:35 +0000 (22:22 +0200)]
Copyright, change log, news file
Update the copyright notice in the license file, add content to the
NEWS and ChangeLog file. We will not use a ChangeLog, because just
referring to the git log does a much better job.
Philip Chimento [Sun, 16 Sep 2012 17:52:38 +0000 (19:52 +0200)]
Keep glkunix startup arg[c,v] alive
Bocfel (for one) relies on the argc and argv that it gets from the
Glk library not being freed during the course of the game. So now
we keep them alive.
Philip Chimento [Sun, 16 Sep 2012 13:59:01 +0000 (15:59 +0200)]
Fix pager bug #25!
Finally fixed! An extra check to see whether the pager is at the
bottom. Apparently if you click to put the cursor somewhere that's
not the end of the text buffer, then scroll up with your scroll
wheel, then _sometimes_ the pager wouldn't stop paging when you
paged down to the end again, because the GtkAdjustment's "changed"
signal didn't fire. But now that's fixed.
Philip Chimento [Sat, 15 Sep 2012 21:28:40 +0000 (23:28 +0200)]
Fix window resizing bug; no size requests!
Size allocation is strictly top-down in Glk, so we actually don't
need to do size requests. All size requests are 1, so that the
window keeps its current size.
Philip Chimento [Sat, 15 Sep 2012 15:38:07 +0000 (17:38 +0200)]
Remove Babel library from codebase
Since we are going to release the library with a minimal player, and
work together with Grotesque to produce a cool player, we are removing
the Babel library for now.
Philip Chimento [Sat, 25 Aug 2012 20:46:36 +0000 (22:46 +0200)]
Use cairo for drawing
GDK drawing does not exist in GTK 3 anymore. We now use cairo for
drawing. This means that the graphics window now corresponds to a
GtkDrawingArea, and we use a cairo surface as a backing store.
Philip Chimento [Sat, 25 Aug 2012 19:04:04 +0000 (21:04 +0200)]
Replace deprecated signals
The 'size-request' and 'expose-event' signals now don't exist anymore.
'expose-event' is simply replaced by 'draw'. We used 'size-request' in a
slightly different way than it was supposed to be: connecting a handler
after the default 'size-request' handler run, ensured that the handler
was run after the GtkTextView finished validating text positions, so we
could scroll the text view to the end after printing text to it. Luckily,
'size-allocate' works the same way in GTK 3.
Philip Chimento [Sat, 25 Aug 2012 19:00:42 +0000 (21:00 +0200)]
Replace size-request by minimal height-for-width
The size-request method is now gone, in favor of height-for-width
allocation. The height-for-width implementation is currently minimal,
as described at
http://developer.gnome.org/gtk3/stable/ch24s02.html#id1328275
This could be made much nicer.
Philip Chimento [Sat, 25 Aug 2012 18:58:50 +0000 (20:58 +0200)]
Remove deprecated member access
GObject classes aren't supposed to have their members accessed directly
anymore. Instead use accessor functions. In the case of our
gtk_text_tag_copy() function this requires some clever copying of
properties ;-)
Philip Chimento [Sun, 12 Feb 2012 12:40:05 +0000 (13:40 +0100)]
Implement new name mangling
The Glk 0.7.4 spec has new recommendations on what characters should
be legal in filenames and how to make sure that files created by
different Glk implementations are interoperable.
Philip Chimento [Sun, 12 Feb 2012 12:11:23 +0000 (13:11 +0100)]
Implement recommended file suffixes in dialog
When creating a file with glk_fileref_create_by_prompt(), there will
be a file filter active for the recommended file extension. For
fileusage_InputRecord and fileusage_Transcript, there will also be a
filter for text/plain files selectable. In any case there is also an
"All files" filter selectable.