home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / msysjour / vol04 / 01b / macsl / macproto.h < prev    next >
Text File  |  1988-10-03  |  6KB  |  130 lines

  1. /*-----------------------------------------------------------------*/
  2. /* MacPrototypes.h                                                 */
  3. /* Lightspeed C, for some strange reason, fails to provide         */
  4. /* prototypes for the Mac toolbox functions, so here we have       */
  5. /* the prototypes for the fucntions we use.                        */
  6. /*-----------------------------------------------------------------*/
  7.  
  8. /*-----------------------------------------------------------------*/
  9. /* Mac menu bar data structure, missing from Mac .h files          */
  10. /*-----------------------------------------------------------------*/
  11.  
  12. typedef struct {
  13.     MenuHandle  hmenu;
  14.     SHORT       sHorzCoord;
  15. } MlistItem;
  16.  
  17. typedef struct {
  18.     USHORT      usMlistSize;
  19.     SHORT       sHorzSize;
  20.     USHORT      usUnused;
  21.     MlistItem   mlist[1];
  22. } Mbar, *MbarPtr, **MbarHandle;
  23.  
  24. #define MENUCOUNTOFHMBAR( hmbar )  \
  25.     ( (**(hmbar)).usMlistSize / sizeof(MlistItem) )
  26.  
  27. /*-----------------------------------------------------------------*/
  28. /* Function prototypes                                             */
  29. /*-----------------------------------------------------------------*/
  30.  
  31. #define P pascal
  32.  
  33. P void        AddResMenu( MenuHandle hmenu, ResType restype );
  34. P void        BeginUpdate( WindowPeek pwin );
  35. P void        CopyRgn( RgnHandle hrgnSrc, RgnHandle hrgnDest );
  36. P void        DiffRgn( RgnHandle hrgnSrcA, RgnHandle hrgnSrcB,
  37.                        RgnHandle hrgnDest );
  38. P void        DisposeWindow( WindowPeek pwin );
  39. P void        DisposHandle( Handle hMem );
  40. P void        DisposeRgn( RgnHandle hrgn );
  41. P long        DragGrayRgn( RgnHandle hrgn, Point point,
  42.                            Rect* prectBounds, Rect* prectSlop,
  43.                            short sAxis, ProcPtr pfnAction );
  44. P void        DragWindow( WindowPeek pwin, Point point,
  45.                           Rect* prect );
  46. P void        DrawControls( WindowPeek pwin );
  47. P void        DrawGrowIcon( WindowPeek pwin );
  48. P void        DrawMenuBar( void );
  49. P void        DrawText( Ptr pch, short sFirst, short sLen );
  50. P void        EndUpdate( WindowPeek pwin );
  51. P void        EraseRect( Rect* prect );
  52. P Boolean     EventAvail( short sMask, EventRecord* pEvent );
  53. P void        ExitToShell( void );
  54. P int         FindControl( Point point, WindowPeek pwin,
  55.                            ControlHandle* hctl );
  56. P short       FindWindow( Point point, WindowPeek* ppwin );
  57. P void        FlushEvents( short sWhichMask, short sStopMask );
  58. P FMOutPtr    FMSwapFont( FMInput* pfmi );
  59. P WindowPtr   FrontWindow( void );
  60. P long        GetCaretTime( void );
  61. P long        GetDblTime( void );
  62. P void        GetIndString( char* pstr, short id, short index );
  63. P void        GetItem( MenuHandle hmenu, short item, char* pstr );
  64. P void        GetMouse( Point* ppoint );
  65. P Boolean     GetNextEvent( short sMask, EventRecord* pEvent );
  66. P Handle      GetNewMBar( short idBar );
  67. P Handle      GetResource( ResType restype, short id );
  68. P void        GetWMgrPort( GrafPtr* pgraf );
  69. P void        GetWTitle( WindowPeek pwin, char* pstr );
  70. P long        GrowWindow( WindowPeek pwin, Point point,
  71.                           Rect* prect );
  72. P void        HideWindow( WindowPeek pwin );
  73. P void        HiliteMenu( short idMenu );
  74. P void        InitCursor( void );
  75. P void        InitDialogs( ProcPtr resumeProc );
  76. P void        InitFonts( void );
  77. P void        InitGraf( GrafPtr* pGlobals );
  78. P void        InitMenus( void );
  79. P void        InitWindows( void );
  80. P void        InsetRgn( RgnHandle hrgn, short dh, short dv );
  81. P void        InvalRect( Rect* prect );
  82. P void        MaxApplZone( void );
  83. P long        MenuSelect( Point point );
  84. P void        MoreMasters( void );
  85. P void        MoveTo( short h, short v );
  86. P void        MoveWindow( WindowPeek pwin, short h, short v,
  87.                           Boolean fFront );
  88. P ControlHandle NewControl( WindowPeek pwin, Rect* prectBounds,
  89.                             char* pstrTitle, Boolean fVisible,
  90.                             short sValue, short sMin, short sMax,
  91.                             short sProcID, long lRefCon );
  92. P Handle      NewHandle( Size lBytes );
  93. P Ptr         NewPtr( Size lBytes );
  94. P RgnHandle   NewRgn( void );
  95. P WindowPtr   NewWindow( Ptr pWinBuf, Rect* prectBounds,
  96.                          char* pstrTitle, Boolean fVisible,
  97.                          short sProcID, WindowPeek pwinBehind,
  98.                          Boolean fGoAway, long lRefCon );
  99. P OsErr       PostEvent( int iEvent, long lMsg );
  100. P short       OpenDeskAcc( char* pstrName );
  101. P short       OpenResFile( char* pstrFileName );
  102. P Boolean     PtInRect( Point point, Rect* prect );
  103. P void        RectRgn( RgnHandle hrgn, Rect* prect );
  104. P void        SectRgn( RgnHandle hrgnSrcA, RgnHandle hrgnSrcB,
  105.                        RgnHandle hrgnDest );
  106. P void        SelectWindow( WindowPeek pwin );
  107. P void        SetEventMask( short sMask );
  108. P void        SetMenuBar( MbarHandle hmbar );
  109. P void        SetRectRgn( RgnHandle hrgn, int left, int top,
  110.                           int right, int bottom );
  111. P void        SetWTitle( WindowPeek pwin, char* pstr );
  112. P void        ShowHide( WindowPeek pwin, Boolean fShow );
  113. P void        ShowWindow( WindowPeek pwin );
  114. P void        SizeWindow( WindowPeek pwin, short h, short v,
  115.                           Boolean fUpdate );
  116. P void        SystemClick( EventRecord* pEvent, WindowPeek pwin );
  117. P void        SystemTask( void );
  118. P void        TEInit( void );
  119. P Boolean     TrackBox( WindowPeek pwin, Point point, short sPart );
  120. P int         TrackControl( ControlHandle hctl, Point point,
  121.                             ProcPtr pfnAction );
  122. P Boolean     TrackGoAway( WindowPeek pwin, Point point );
  123. P void        UpdtControl( WindowPeek pwin, RgnHandle hrgn );
  124. P void        ZoomWindow( WindowPeek pwin, short sPart,
  125.                           Boolean fFront );
  126.  
  127. #undef P
  128.  
  129. /*-----------------------------------------------------------------*/
  130.