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.
Philip Chimento [Fri, 2 Sep 2011 23:59:17 +0000 (01:59 +0200)]
Add API to unload plugin module
This is a workaround for a very complicated bug. When you have more than
one ChimaraGlk widget opening the same plugin, then g_module_open()
doesn't dlopen() the plugin again; instead, it just adds a reference to
the open module.
This means that all static variables in the module are not reinitialized
when the Glk program starts running in the second ChimaraGlk widget.
This problem needs to be solved either by eliminating the static
variables from the plugins, or making sure that different ChimaraGlk
widgets open their plugins separately.
This commit does the latter, by adding API to unload the plugin module
(chimara_glk_unload_plugin()) so that ChimaraGlk widgets that run the
same program but not at the same time have the option to unload the
plugin in one widget before loading it in the other. Specifically, this
is the use case of Inform 7.
This does not fix the use case where two separate ChimaraGlk widgets
want to run the same program at the same time.
Finished babeltest, it now does all of the following:
1) Extact metadata from file using babel
2) If no metadata was found lookup IFID on IFDB
3) Parse ifiction record
4) Store in database
Marijn van Vliet [Sun, 19 Jun 2011 13:33:09 +0000 (15:33 +0200)]
Completed babeltest. It now opens the library.bdf in the current directory (or creates it) and adds the metadata (if any) of the given story to it. Then it dumps the contents of the library.
P. F. Chimento [Sat, 18 Jun 2011 20:45:11 +0000 (22:45 +0200)]
Keep an EOF mark for memory streams
Seeking to seekmode_End in a memory stream should move relative to
the last written position in the buffer, not the end of the memory
buffer. This brings the behavior of memory streams into line with
what would happen in a file stream.
P. F. Chimento [Sat, 18 Jun 2011 19:59:33 +0000 (21:59 +0200)]
Fix obscure C stdio bug
You cannot switch between reading and writing a file stream without a
call to fseek() in between. This borrows Andrew Plotkin's solution of
keeping track of what the last operation was and switching if
necessary.
P. F. Chimento [Sat, 18 Jun 2011 19:16:57 +0000 (21:16 +0200)]
C stdio trickery for read/write mode
As pointed out in the new version of the Glk spec, when opening a file
for appending, you cannot seek in it. We must open the file for
appending, to make sure it is created, then close it and reopen it
for read/writing.
P. F. Chimento [Sat, 7 May 2011 22:18:58 +0000 (00:18 +0200)]
Fix (most) UniCaseTest failures (fix #27)
Upper- or lowercasing Unicode strings is not possible by mapping one
character to one character in each case, in contradiction of what the
GLib functions g_unichar_tolower() and g_unichar_toupper() would seem
to suggest. The casing operations now operate on the whole string.
Unfortunately, this introduces a new bug, #28, since there is no
title-casing function in GLib that allows for the title-case of a
character to be longer than one character.
P. F. Chimento [Sun, 1 May 2011 14:30:21 +0000 (16:30 +0200)]
Fixed grid line input bug introduced in [9f52ac]
The window buffer of a text grid must be flushed before line input
begins; line input replaces part of the text with a widget (GtkEntry)
so if the buffer is flushed during, then it overwrites the widget,
deleting it, and causing a crash.