PreviousUpNext

15.3.766  src/lib/x-kit/xclient/src/window/hash-window.api

## hash-window.api
#
# A hashtable package for hashing on windows.

# Compiled by:
#     src/lib/x-kit/xclient/xclient-internals.sublib


# This api is implemented in:
#
#     src/lib/x-kit/xclient/src/window/hash-window-old.pkg

stipulate
    package sn  =  xsession_junk;                               # xsession_junk         is from   src/lib/x-kit/xclient/src/window/xsession-junk.pkg
#   package dt =  draw_types;                                   # draw_types            is from   src/lib/x-kit/xclient/src/window/draw-types.pkg
    package xt =  xtypes;                                       # xtypes                is from   src/lib/x-kit/xclient/src/wire/xtypes.pkg
herein
    api Hash_Window {
        #
        Window_Map(X);

        exception WINDOW_NOT_FOUND;

        # Create a new table:
        #
        make_map:  Void ->  Window_Map(X);

        # Insert an item:
        #
        set:   Window_Map(X) -> (sn::Window, X) -> Void;

        # Find an item, the exception WINDOW_NOT_FOUND is raised if the
        # item doesn't exist.
        #
        get:   Window_Map(X) -> sn::Window -> X;

        # Find an item (using an id as the key), the exception WINDOW_NOT_FOUND
        # is raised if the item doesn't exist
        #
        get_window_id:   Window_Map(X) -> xt::Window_Id -> X;

        get_and_drop:   Window_Map(X) -> sn::Window -> Null_Or(X);                      # Remove a value by key, returning (THE value) if key is found, else NULL.
        drop:            Window_Map(X) -> sn::Window -> Void;                           # Remove a value by key. This is a no-op if the key is not found.

        vals_list:   Window_Map(X) ->  List(X);                                         # Return a list of the items in the table.
    };
end;


## COPYRIGHT (c) 1990, 1991 by John H. Reppy.  See SMLNJ-COPYRIGHT file for details.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext