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.
Philip Chimento [Sun, 5 Feb 2012 16:14:50 +0000 (17:14 +0100)]
Prevent unnecessary regeneration of VAPI
Vapigen doesn't update the timestamp of the VAPI file when the
contents don't change; so when the GIR changes but the VAPI doesn't,
the dependency tracking got confused. This updates the timestamp
properly.
Philip Chimento [Wed, 1 Feb 2012 22:13:36 +0000 (23:13 +0100)]
Added a Python player!
It crashes half the time because GObject Introspection isn't actually
officially supported with GTK 2. However, it's a simple player that
shows how to use Chimara in Python. We don't even have to write any
language bindings, thanks to the power of GObject Introspection! But
if we want to do anything serious with Python, we will need to port to
GTK 3 first.
It's a straight port of the C player, but it's 300 lines instead
of 1200 ;-)
Philip Chimento [Wed, 1 Feb 2012 21:06:05 +0000 (22:06 +0100)]
Identified two more entry points
This fixes an obscure bug! If you create your ChimaraGlk object
not with chimara_glk_new() but with g_object_new(), then the library
init function was not called. That caused a crash when trying to
access the thread-private data.
Philip Chimento [Sun, 1 Jan 2012 17:32:28 +0000 (18:32 +0100)]
Add API to start plugins using GFile
To complete the API, we should have functions that start a plugin using
GIO's GFile API. It's easier for navigating the filesystem in language
bindings such as Python.