home *** CD-ROM | disk | FTP | other *** search
Modula Implementation | 1996-02-22 | 4.9 KB | 167 lines | [TEXT/3PRM] |
- implementation module windows;
-
- import mac_types;
-
- InDesk :== 0;
- InMenuBar :== 1;
- InSysWindow :== 2;
- InContent :== 3;
- InDrag :== 4;
- InGrow :== 5;
- InGoAway :== 6;
- InZoomIn :== 7;
- InZoomOut :== 8;
-
- // Initialization and Allocation
-
- NewWindow :: !Ptr !Rect !{#Char} !Bool !Int !WindowPtr !Bool !Int !Toolbox -> (!WindowPtr,!Toolbox);
- NewWindow wStorage (left,top,right,bottom) title visible procID behind goAwayFlag refCon t
- = code (right=W,bottom=W,left=W,top=W,wStorage=R4L,title=O8S,visible=W,
- procID=W,behind=L,goAwayFlag=W,refCon=L,t=U) (window_pointer=L,z=I8Z)
- {
- instruction 0xA913
- };
-
- NewCWindow :: !Ptr !Rect !{#Char} !Bool !Int !WindowPtr !Bool !Int !Toolbox -> (!WindowPtr,!Toolbox);
- NewCWindow wStorage (left,top,right,bottom) title visible procID behind goAwayFlag refCon t
- = code (right=W,bottom=W,left=W,top=W,wStorage=R4L,title=O8S,visible=W,
- procID=W,behind=L,goAwayFlag=W,refCon=L,t=U)(window_pointer=L,z=I8Z)
- {
- instruction 0xAA45
- };
-
- DisposeWindow :: !WindowPtr !Toolbox -> Toolbox;
- DisposeWindow theWindow t = code (theWindow=L,t=U)(z=Z){
- instruction 0xA914
- };
-
- // Window Display
-
- SetWTitle :: !WindowPtr !{#Char} !Toolbox -> Toolbox;
- SetWTitle theWindow title t = code (theWindow=L,title=S,t=U)(z=Z){
- instruction 0xA91A
- };
-
- SelectWindow :: !WindowPtr !Toolbox -> Toolbox;
- SelectWindow theWindow t = code (theWindow=L,t=U)(z=Z){
- instruction 0xA91F || _SelectWindow
- };
-
- HideWindow :: !WindowPtr !Toolbox -> Toolbox;
- HideWindow theWindow t = code (theWindow=L,t=U)(z=Z){
- instruction 0xA916 || _HideWindow
- };
-
- ShowWindow :: !WindowPtr !Toolbox -> Toolbox;
- ShowWindow theWindow t = code (theWindow=L,t=U)(z=Z){
- instruction 0xA915 || _ShowWindow
- };
-
- ShowHide :: !WindowPtr !Bool !Toolbox -> Toolbox;
- ShowHide theWindow showFlag t = code (theWindow=L,showFlag=W,t=U)(z=Z){
- instruction 0xA908 || _ShowHide
- };
-
- SendBehind :: !WindowPtr !WindowPtr !Toolbox -> Toolbox;
- SendBehind theWindow behindWindow t = code (theWindow=L,behindWindow=L,t=U)(z=Z){
- instruction 0xA921 || _SendBehind
- };
-
- DrawGrowIcon :: !WindowPtr !Toolbox -> Toolbox;
- DrawGrowIcon theWindow t = code (theWindow=L,t=U)(z=Z){
- instruction 0xA904
- };
-
- FrontWindow :: !Toolbox -> (!WindowPtr,!Toolbox);
- FrontWindow t = code (t=R4U)(theWindow=L,z=Z){
- instruction 0xA924 || _FrontWindow
- };
-
- // Mouse Location
-
- FindWindow :: !Int !Int !Toolbox -> (!Int,!WindowPtr,!Toolbox);
- FindWindow h v t = code (h=R6W,v=W,t=O6U)(wher=W,whichWindow=l,z=Z){
- instruction 0xA92C || _FindWindow
- };
-
- TrackGoAway :: !WindowPtr !Int !Int !Toolbox -> (!Bool,!Toolbox);
- TrackGoAway theWindow h v t = code (theWindow=R2L,h=W,v=W,t=U)(result=D1,z=Z){
- instruction 0xA91E
- instruction 0x7000 || moveq #0,d0
- instruction 0x101F || move.b (sp)+,d0
- instruction 0x4440 || neg.w d0
- instruction 0x48C0 || ext.l d0
- instruction 0x2200 || move.l d0,d1
- };
-
- TrackBox :: !WindowPtr !Int !Int !Int !Toolbox -> (!Bool,!Toolbox);
- TrackBox theWindow h v partCode t = code (theWindow=R2L,h=W,v=W,partCode=W,t=U)(result=D1,z=Z){
- instruction 0xA83B
- instruction 0x7000 || moveq #0,d0
- instruction 0x101F || move.b (sp)+,d0
- instruction 0x4440 || neg.w d0
- instruction 0x48C0 || ext.l d0
- instruction 0x2200 || move.l d0,d1
- };
-
- // Window Movement and Sizing
-
- MoveWindow :: !WindowPtr !Int !Int !Bool !Toolbox -> Toolbox;
- MoveWindow theWindow hGlobal vGlobal front t
- = code (theWindow=L,hGlobal=W,vGlobal=W,front=W,t=U)(z=Z){
- instruction 0xA91B || _MoveWindow
- };
-
- DragWindow :: !WindowPtr !Int !Int !Rect !Toolbox -> Toolbox;
- DragWindow theWindow h v (left,top,right,bottom) t
- = code (right=W,bottom=W,left=W,top=W,theWindow=L,h=W,v=W,t=O8U)(z=I8Z){
- instruction 0xA925
- };
-
-
- GrowWindow :: !WindowPtr !Int !Int !Rect !Toolbox -> (!(!Int,!Int),!Toolbox);
- GrowWindow theWindow h v rect tb
- = ((h1,v1),tb1);
- where {
- (v_and_h,tb1) =: GrowWindow1 theWindow h v rect tb;
- (v1,h1) =: v_and_h;
- };
-
- GrowWindow1 :: !WindowPtr !Int !Int !Rect !Toolbox -> (!(!Int,!Int),!Toolbox);
- GrowWindow1 theWindow h v (left,top,right,bottom) t
- = code (right=W,bottom=W,left=W,top=W,theWindow=R4L,h=W,v=W,t=O12U)(h2=W,w2=W,z=I8Z){
- instruction 0xA92B
- };
-
- SizeWindow :: !WindowPtr !Int !Int !Bool !Toolbox -> Toolbox;
- SizeWindow theWindow w h fUpdate t = code (theWindow=L,w=W,h=W,fUpdate=W,t=U)(z=Z){
- instruction 0xA91D
- };
-
- ZoomWindow :: !WindowPtr !Int !Bool !Toolbox -> Toolbox;
- ZoomWindow theWindow partCode front t = code (theWindow=L,partCode=W,front=W,t=U)(z=Z){
- instruction 0xA83A
- };
-
- // Update Region Maintenance
-
- InvalRect :: !Rect !Toolbox -> Toolbox;
- InvalRect (left,top,right,bottom) t = code (right=W,bottom=W,left=W,top=W,t=O0U)(z=I8Z){
- instruction 0xA928
- };
-
- ValidRect :: !Rect !Toolbox -> Toolbox;
- ValidRect (left,top,right,bottom) t = code (right=W,bottom=W,left=W,top=W,t=O0U)(z=I8Z){
- instruction 0xA92A
- };
-
- BeginUpdate :: !WindowPtr !Toolbox -> Toolbox;
- BeginUpdate theWindow t = code (theWindow=L,t=U)(z=Z){
- instruction 0xA922
- };
-
- EndUpdate :: !WindowPtr !Toolbox -> Toolbox;
- EndUpdate theWindow t = code (theWindow=L,t=U)(z=Z){
- instruction 0xA923
- };
-