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.
P. F. Chimento [Wed, 20 Apr 2011 11:12:15 +0000 (13:12 +0200)]
Implemented date/time Glk functions
Mostly copied from Andrew Plotkin's CheapGlk implementation; should
be converted to use GDateTime (more portable) when it is feasible to
use GLib 2.26 on many platforms.
P. F. Chimento [Tue, 19 Apr 2011 16:05:37 +0000 (18:05 +0200)]
Simplify include comments
Put include comments in chimara-sections.txt so they apply to a whole
group of sections instead of typing out the include files in each
section individually.
P. F. Chimento [Sun, 17 Apr 2011 10:19:33 +0000 (12:19 +0200)]
Updated Gargoyle extensions and documentation
Brought garglk.h to the latest revision of the Gargoyle extensions to
Glk - removed garglk_set_line_terminators(), added
garglk_set_story_title(), and updated the documentation.
P. F. Chimento [Thu, 14 Apr 2011 21:32:27 +0000 (23:32 +0200)]
Updated documentation to match API 0.7.2
The Glk API documentation in Chimara now matches the official
documentation, although not everything considered necessary by
Gtk-Doc is documented. Stubs added for new functions.