home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Clean 1.2.4 / IOInterface / ioState.dcl < prev    next >
Encoding:
Modula Definition  |  1997-04-23  |  3.3 KB  |  105 lines  |  [TEXT/3PRM]

  1. definition module ioState;
  2.  
  3. //    Version 0.8 to 1.0
  4.  
  5. import    events, controls;
  6. import    timerDef, menuDef, windowDef, dialogDef, event;
  7. from    deltaIOSystem    import    DeviceSystem, TimerSystem, MenuSystem,
  8.                                 WindowSystem, DialogSystem;
  9. from    deltaPicture    import    Point;
  10.  
  11.  
  12. EmptyMacMenuHandle :== 0;
  13.  
  14. ::    *IOState *s;
  15.  
  16. ::    DeviceSystemState    *s    =    TimerSystemState    (TimerHandles    s)
  17.                             |    MenuSystemState        (MenuHandles    s)
  18.                             |    WindowSystemState    (WindowHandles    s)
  19.                             |    DialogSystemState    (DialogHandles    s);
  20.  
  21. ::    TimerHandles        *s    :==    [TimerHandle s];
  22. ::    TimerHandle            *s    :==    (!TimerDef s (IOState s), !Time);
  23. ::    Time                    :==    Int;
  24.  
  25. ::    MenuHandles            *s    :==    (![MenuHandle s], ![Char], !MacMenuHandle, !Bool);
  26. ::    MenuHandle            *s
  27.     =     PullDownHandle        MacMenuHandle MenuId MenuId SelectState [MenuHandle s]
  28.     |     MenuItemHandle        MenuItemId Char (MenuFunction s (IOState s))
  29.     |     CheckMenuItemHandle    MenuItemId Char (MenuFunction s (IOState s))
  30.     |     SubMenuItemHandle    MacMenuHandle MenuId MenuId    [MenuHandle s]
  31.     |     MenuItemGroupHandle    MenuItemGroupId                [MenuHandle s]
  32.     |     MenuRadioItemsHandle                            [MenuHandle s]
  33.     |     MenuSeparatorHandle;
  34.  
  35. ::    WindowHandles        *s    :==    (![WindowHandle s], !GlobalCursor);
  36. ::    WindowHandle        *s    :==    (!WindowDef s (IOState s), !Window);
  37. ::    Window
  38.     :==    (    !WindowPtr,
  39.             !ScrollState,
  40.             !ScrollState,
  41.             !Int,
  42.             !UpdateArea,
  43.             !ZoomState    );
  44. ::    ScrollState
  45.     :==    (    !ControlHandle,
  46.             !Int,
  47.             !Int        );
  48. ::    ZoomState
  49.     :==    (    !Int,
  50.             !Int        );
  51. ::    GlobalCursor
  52.     =    GlobalCursorSet CursorShape
  53.     |    NoGlobalCursor;
  54. ::    DoubleDownDist
  55.     :==    Int;
  56.  
  57. ::    DialogHandles        *s    :==    [DialogRep s (IOState s)];
  58.  
  59.  
  60. ::    Device
  61.     =    TimerDevice | MenuDevice | WindowDevice | DialogDevice;
  62.  
  63. ::    DeviceFunctions        *s
  64.     :==    (    !ShowFunction    s,
  65.             !OpenFunction    s,
  66.             !DoIOFunction    s,
  67.             !CloseFunction    s,
  68.             !HideFunction    s    );
  69.  
  70. ::    ShowFunction  *s :== !(IOState s) -> !IOState s;
  71. ::    OpenFunction  *s :== !(DeviceSystem s (IOState s)) -> (!(IOState s) -> IOState s);
  72. ::    DoIOFunction  *s :== !Event -> (!s -> *(!(IOState s) -> (!Bool, !s, !IOState s)));
  73. ::    CloseFunction *s :== !(IOState s) -> IOState s;
  74. ::    HideFunction  *s :== !(IOState s) -> IOState s;
  75.  
  76.  
  77. //    Access-rules on the IOState:
  78.  
  79. NewIOStateFromOld        :: !(IOState s) -> (!IOState t, !IOState s);
  80. OldIOStateFromNew        :: !(IOState s) !(IOState t) -> IOState s;
  81. EmptyIOState            :: !EVENTS -> IOState s;
  82. IOStateEvents            :: !(IOState s) -> EVENTS;
  83.  
  84. IOStateButtonFreq        :: !Time !Point !WindowPtr !(IOState s) -> (!ButtonState, !IOState s);
  85. IOStateSetDoubleDownDist:: !DoubleDownDist     !(IOState s) -> IOState s;
  86.  
  87. IOStateClosed            :: !(IOState s)            -> (!Bool, !IOState s);
  88. IOStateHasDevice        :: !(IOState s) !Device -> (!Bool, !IOState s);
  89.  
  90. IOStateGetAnyDevice        :: !(IOState s) -> (!DeviceSystemState s, !IOState s);
  91. IOStateRemoveAnyDevice    :: !(IOState s) -> (!DeviceSystemState s, !IOState s);
  92. IOStateRemoveDevice        :: !(IOState s) !Device -> IOState s;
  93. IOStateGetDevice        :: !(IOState s) !Device -> (!DeviceSystemState s, !IOState s);
  94. IOStateSetDevice        :: !(IOState s) !(DeviceSystemState s) -> IOState s;
  95.  
  96. IOStateGetToolbox        ::                                    !(IOState s) -> (!Toolbox, !IOState s);
  97. IOStateSetToolbox        :: !Toolbox                            !(IOState s) -> IOState s;
  98. IOStateChangeToolbox    :: !(!Toolbox -> !Toolbox)            !(IOState s) -> IOState s;
  99. IOStateAccessToolbox    :: !(!Toolbox -> !(!x, !Toolbox))    !(IOState s) -> (!x, !IOState s);
  100.  
  101.  
  102. //    The priority of the Devices:
  103.  
  104. Priority :: !Device -> Int;
  105.