PreviousUpNext

15.3.303  src/lib/global-controls/global-control-index.api

## global-control-index.api

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





# A registry collects together string controls.
# It supports generation of help messages and
# initialization from the dictionary.

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

    api Global_Control_Index {
        #
        Global_Control_Index;

        Control_Info
            =
            { dictionary_name:  Null_Or( String ) };


        make:
            { help:  String }                           # Registry's description.
            ->
            Global_Control_Index;



        note_control                                    # Register a control.
            :
            Global_Control_Index
            ->
            { control:         ctl::Global_Control( String ),
              dictionary_name: Null_Or( String )
            }
            ->
            Void;



        note_control_set                                # Register a set of controls.
            :
            Global_Control_Index
            ->
            { control_set:           global_control_set::Global_Control_Set (String, X),
              make_dictionary_name:  String -> Null_Or( String )
            }
            ->
            Void;



        note_subindex                                   # Nest a registry inside another registry.
            :
            Global_Control_Index
            ->
            { prefix:           Null_Or( String ),
              menu_slot:        ctl::Menu_Slot,         # Positions within control menu hierarchy.
              obscurity:  Int,                          # registry's detail level; higher means more obscure.
              reg:        Global_Control_Index
            }
            ->
            Void;



        find_control
            :
            Global_Control_Index
            ->
            List( String )
            ->
            Null_Or( ctl::Global_Control( String ) );



        set_up_controls_from_posix_environment
            :                   # Initialize the controls in the registry from the unix environment: 
            Global_Control_Index -> Void;

        Index_Tree
            =
            INDEX_TREE  {
              path:         List( String ),
              help:         String,
              subregs:      List( Index_Tree ),
              control_set:  List { control:     ctl::Global_Control( String ),
                                   info:        Control_Info
                                 }
            };

        controls:
            (Global_Control_Index,  Null_Or(Int))
            ->
            Index_Tree;

    };
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