Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement version 0.7.5 of Glk spec #65

Merged
merged 9 commits into from
Jan 2, 2024
Merged

Implement version 0.7.5 of Glk spec #65

merged 9 commits into from
Jan 2, 2024

Commits on Nov 5, 2023

  1. Configuration menu
    Copy the full SHA
    bb0d575 View commit details
    Browse the repository at this point in the history
  2. New version of Blorb API, 1.6.1.

    Stubs for the documentation of giblorb_load_image_info() and
    giblorb_image_info_t because they are not described in the Glk spec yet.
    The new symbols are marked as unstable in the docs.
    ptomato committed Nov 5, 2023
    Configuration menu
    Copy the full SHA
    f8edf49 View commit details
    Browse the repository at this point in the history
  3. New version of Dispatch API for 0.7.5.

    For gidispatch_set_autorestore_registry, include a stub.
    
    The new symbols are marked as unstable in the docs because they are not
    mentioned in any version of the Glk specification yet.
    ptomato committed Nov 5, 2023
    Configuration menu
    Copy the full SHA
    54d6c77 View commit details
    Browse the repository at this point in the history
  4. Make sure glk_exit() does not return

    The new glk.h header file adds __attribute__((noreturn)) to glk_exit().
    However, g_thread_exit() does not have this annotation, so indicate to the
    compiler that the function really can never return.
    
    See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3562
    ptomato committed Nov 5, 2023
    Configuration menu
    Copy the full SHA
    881e45d View commit details
    Browse the repository at this point in the history
  5. Silently return NULL when opening nonexistent file

    The Glk specification 0.7.5 clarifies that this is supposed to return NULL
    silently, and not abort as some early Glk libraries did. We already
    returned NULL, but not silently, so it's a good opportunity to include a
    test.
    ptomato committed Nov 5, 2023
    Configuration menu
    Copy the full SHA
    5273be3 View commit details
    Browse the repository at this point in the history
  6. Tests for UTF-8 when writing unicode to a text file

    In Glk 0.7.5, Unicode file streams written in text mode are required to
    be written out with UTF-8 encoding. We already did this, but add some
    tests exercising each of the glk_put_... functions that check that the
    file is written using UTF-8 encoding.
    ptomato committed Nov 5, 2023
    Configuration menu
    Copy the full SHA
    8532c35 View commit details
    Browse the repository at this point in the history
  7. Implement graphics window character input

    Character input in graphics windows is new in version 0.7.5 of the Glk
    specification. It's relatively easy to enable; add key presses to the
    events accepted by the graphics window's GtkDrawingArea, and allow the
    graphics window to have the input focus.
    
    Add a test, for which we also have to give glkunit-runner the ability to
    send character input to the Glk program.
    ptomato committed Nov 5, 2023
    Configuration menu
    Copy the full SHA
    cd4cc98 View commit details
    Browse the repository at this point in the history
  8. Hide windows when they have zero height or width

    New in the 0.7.5 Glk spec is a note about zero-size windows. They should
    disappear completely, including any borders that they have. This change
    makes the size allocation code ignore zero-size windows, and in the case
    of a pair window that is going to allocate zero size to one of its
    children, it should instead give the entire space to its other child,
    eliminating the border.
    
    This is an interesting problem to test, but it can be done by testing
    against a reference image. This mechanism might be useful for writing more
    tests in the future, so we add a reftest runner (and image diffing code
    copied from GTK's reftest suite.)
    ptomato committed Nov 5, 2023
    Configuration menu
    Copy the full SHA
    5da5c83 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    cb925e9 View commit details
    Browse the repository at this point in the history