AmendHub

Download

Mu0n

/

MovieCrawl

/

Misc.h

 

(View History)

Mu0n   Added Misc.c and Misc.h which contain helper functions that I made a long time ago that are used in the project; MacPlusArea sets up an centered, active 512x342 area; HideMyMenuBar and ShowMyMenuBar are self-explanatory. Latest amendment: 3 on 2022-08-11

1 /* Misc.h
2 */
3
4
5 #ifndef __MISCH__
6 #define __MISCH__
7
8 #define kBaseResID 128
9 #define kMoveToFront (WindowPtr)-1L
10 #define kRandomUpperLimit 32768
11 #define kScrollBarAdjust (16-1)
12 #define kScrollBarWidth 16
13 #define kScreenWidth (qd.screenBits.bounds.right-qd.screenBits.bounds.left)
14 #define kScreenHeight (qd.screenBits.bounds.bottom-qd.screenBits.bounds.top)
15 #define kMacPlusHeight 342
16 #define kMacPlusWidth 512
17 #define kMenuBarHeight 20
18
19 #define MAX(A,B) (A>B?A:B)
20 #define MIN(A,B) (A>B?B:A)
21 #define SQUARE(A) A*A
22 #define ABS(A) (A<0?-A:A)
23
24 /*------ Constants -------*/
25 /* Part 1: Used in menu bar hiding*/
26 static short gs_dyMBar = 0;
27 static RgnHandle gs_hrgnMBar = 0;
28 /* Part 2: */
29 /*------ End of Constants -------*/
30
31 void InitMacStuff(void);
32 void HideMyMenuBar(void);
33 void ShowMyMenuBar(void);
34 unsigned short rangeRandom( unsigned short min, unsigned short max );
35 WindowPtr WholeScreen(Pattern thePat, Boolean wantMenus);
36 void MacPlusArea(Pattern borderPat, Pattern middlePat, Boolean wantMenus);
37 WindowPtr ForceMacPlusScreen(Pattern thePath, Boolean wantMenus);
38 void CLS(Pattern thePat, Boolean wantMenus);
39 short OldLoadFile(SFTypeList myTypes); // Must FSClose the short it returns when finished with the file
40 int GetScreenWidth(void);
41 int GetScreenHeight(void);
42 void PStringCat(Str255 a, Str255 b);
43 void PStringCopy(Str255 a, Str255 b);
44
45 #endif