PreviousUpNext

15.3.305  src/lib/global-controls/global-control-set.api

## global-control-set.api

# Compiled by:
#     src/lib/global-controls/global-controls.lib


stipulate
    package ctl =  global_control;                                      # global_control                is from   src/lib/global-controls/global-control.pkg
    package qs  =  quickstring__premicrothread;                         # quickstring__premicrothread   is from   src/lib/src/quickstring--premicrothread.pkg
herein

    api Global_Control_Set {
        #
        Global_Control(X) =   ctl::Global_Control(X);

        Global_Control_Set( X, Y );

        make_control_set:  Void -> Global_Control_Set(X,Y);

        member:  ( (Global_Control_Set(X, Y), qs::Quickstring)) -> Bool;

        find:    ( (Global_Control_Set(X, Y), qs::Quickstring))
                 ->
                 Null_Or { control:  Global_Control(X), info:  Y };

        set:     ((Global_Control_Set(X, Y),  Global_Control(X), Y)) -> Void;
        drop:    ((Global_Control_Set(X, Y), qs::Quickstring)) -> Void;
        info_of:   Global_Control_Set(X, Y)  -> Global_Control(X) -> Null_Or(Y);


        # List the members; the list is ordered by priority.
        #
        # The list_controls' function allows one to specify
        # an obscurity level; controls with equal or higher
        # obscurity are omitted from the list.
        #
        list_controls
            :
            Global_Control_Set(X, Y)
            ->
            List { control:  Global_Control(X), info:  Y };

        list_controls'
            :
            ( (Global_Control_Set(X, Y), Int))
            ->
            List { control:  Global_Control(X), info:  Y };


        #  Apply a function to the controls in a set 
        #
        apply
            :
            ( { control:  Global_Control(X), info:  Y } -> Void)
            ->
            Global_Control_Set (X, Y) -> Void;

        # Convert the controls in a set to string
        # controls and create a new set for them:
        #
        convert_to_string_controls
            :
            ctl::Value_Converter(X)
            ->
            Global_Control_Set (X, Y)
            ->
            Global_Control_Set (String, Y);
    };
end;

## COPYRIGHT (c) 2002 Bell Labs, Lucent Technologies
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext