]>
Commit | Line | Data |
---|---|---|
cfcc3671 UJ |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: uma.h | |
3 | // Purpose: Universal MacOS API | |
4 | // Author: Stefan Csomor | |
5 | // Modified by: | |
6 | // Created: 03/02/99 | |
7 | // RCS-ID: $Id: | |
8 | // Copyright: (c) Stefan Csomor | |
9 | // Licence: LGPL licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef H_UMA | |
13 | #define H_UMA | |
14 | ||
15 | // define this to be 1 if you have the 8.6 libs (weak linked) | |
16 | ||
17 | #define UMA_USE_8_6 0 | |
18 | ||
19 | // define this to be 1 if you have the carbon libs (weak linked or PreCarbon.lib) | |
20 | ||
21 | #define UMA_USE_CARBON 0 | |
22 | ||
23 | #define UMA_USE_APPEARANCE 1 | |
24 | #define UMA_USE_WINDOWMGR 1 | |
25 | ||
26 | #if !UMA_USE_8_6 && UMA_USE_WINDOWMGR | |
27 | #undef UMA_USE_WINDOWMGR | |
28 | #define UMA_USE_WINDOWMGR 0 | |
29 | #endif | |
30 | ||
31 | #if !TARGET_CARBON | |
32 | typedef short MenuItemIndex ; | |
33 | #endif | |
34 | ||
35 | void UMAInitToolbox( UInt16 inMoreMastersCalls) ; | |
36 | bool UMAHasAppearance() ; | |
37 | long UMAGetAppearanceVersion() ; | |
38 | ||
39 | // process manager | |
40 | ||
41 | long UMAGetProcessMode() ; | |
42 | bool UMAGetProcessModeDoesActivateOnFGSwitch() ; | |
43 | ||
44 | // menu manager | |
45 | ||
46 | void UMASetMenuTitle( MenuRef menu , ConstStr255Param title ) ; | |
47 | UInt32 UMAMenuEvent( EventRecord *inEvent ) ; | |
48 | void UMAEnableMenuItem( MenuRef inMenu , MenuItemIndex item ) ; | |
49 | void UMADisableMenuItem( MenuRef inMenu , MenuItemIndex item ) ; | |
50 | // quickdraw | |
51 | ||
52 | void UMAShowWatchCursor() ; | |
53 | void UMAShowArrowCursor() ; | |
54 | ||
55 | // window manager | |
56 | ||
57 | GrafPtr UMAGetWindowPort( WindowRef inWindowRef ) ; | |
58 | void UMADisposeWindow( WindowRef inWindowRef ) ; | |
59 | void UMASetWTitleC( WindowRef inWindowRef , const char *title ) ; | |
60 | void UMAGetWTitleC( WindowRef inWindowRef , char *title ) ; | |
61 | ||
62 | void UMADrawGrowIcon( WindowRef inWindowRef ) ; | |
63 | void UMAShowWindow( WindowRef inWindowRef ) ; | |
64 | void UMAHideWindow( WindowRef inWindowRef ) ; | |
65 | void UMAShowHide( WindowRef inWindowRef , Boolean show) ; | |
66 | void UMASelectWindow( WindowRef inWindowRef ) ; | |
67 | void UMABringToFront( WindowRef inWindowRef ) ; | |
68 | void UMASendBehind( WindowRef inWindowRef , WindowRef behindWindow ) ; | |
69 | void UMACloseWindow(WindowRef inWindowRef) ; | |
70 | ||
71 | // appearance manager | |
72 | ||
73 | void UMADrawControl( ControlHandle inControl ) ; | |
74 | ||
75 | void UMAActivateControl( ControlHandle inControl ) ; | |
76 | void UMADeactivateControl( ControlHandle inControl ) ; | |
77 | void UMASetThemeWindowBackground (WindowRef inWindow, | |
78 | ThemeBrush inBrush, | |
79 | Boolean inUpdate) ; | |
80 | ControlHandle UMANewControl(WindowPtr owningWindow, | |
81 | const Rect * boundsRect, | |
82 | ConstStr255Param controlTitle, | |
83 | Boolean initiallyVisible, | |
84 | SInt16 initialValue, | |
85 | SInt16 minimumValue, | |
86 | SInt16 maximumValue, | |
87 | SInt16 procID, | |
88 | SInt32 controlReference) ; | |
89 | void UMADisposeControl (ControlHandle theControl) ; | |
90 | void UMAHiliteControl (ControlHandle theControl, | |
91 | ControlPartCode hiliteState) ; | |
92 | void UMAShowControl (ControlHandle theControl) ; | |
93 | void UMAHideControl (ControlHandle theControl); | |
94 | void UMASetControlVisibility (ControlHandle inControl, | |
95 | Boolean inIsVisible, | |
96 | Boolean inDoDraw); | |
97 | ||
98 | bool UMAIsControlActive (ControlHandle inControl); | |
99 | bool UMAIsControlVisible (ControlHandle inControl); | |
100 | void UMAActivateControl (ControlHandle inControl); | |
101 | void UMADeactivateControl (ControlHandle inControl); | |
102 | ||
103 | OSErr UMAGetBestControlRect (ControlHandle inControl, | |
104 | Rect * outRect, | |
105 | SInt16 * outBaseLineOffset); | |
106 | OSErr UMASetControlFontStyle (ControlHandle inControl, | |
107 | const ControlFontStyleRec * inStyle) ; | |
108 | ||
109 | ||
110 | void UMAMoveControl( ControlHandle inControl , short x , short y ) ; | |
111 | void UMASizeControl( ControlHandle inControl , short x , short y ) ; | |
112 | // control hierarchy | |
113 | ||
114 | OSErr UMACreateRootControl (WindowPtr inWindow, | |
115 | ControlHandle * outControl) ; | |
116 | ||
117 | OSErr UMAEmbedControl (ControlHandle inControl, | |
118 | ControlHandle inContainer); | |
119 | ||
120 | // keyboard focus | |
121 | OSErr UMASetKeyboardFocus (WindowPtr inWindow, | |
122 | ControlHandle inControl, | |
123 | ControlFocusPart inPart) ; | |
124 | ||
125 | ||
126 | // events | |
127 | ||
128 | ControlPartCode UMAHandleControlClick (ControlHandle inControl, | |
129 | Point inWhere, | |
130 | SInt16 inModifiers, | |
131 | ControlActionUPP inAction) ; | |
132 | SInt16 UMAHandleControlKey (ControlHandle inControl, | |
133 | SInt16 inKeyCode, | |
134 | SInt16 inCharCode, | |
135 | SInt16 inModifiers); | |
136 | ||
137 | void UMAIdleControls (WindowPtr inWindow) ; | |
138 | ||
139 | void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn ) ; | |
140 | OSErr UMAGetRootControl( WindowPtr inWindow , ControlHandle *outControl ) ; | |
141 | ||
142 | // handling control data | |
143 | ||
144 | OSErr UMASetControlData (ControlHandle inControl, | |
145 | ControlPartCode inPart, | |
146 | ResType inTagName, | |
147 | Size inSize, | |
148 | Ptr inData) ; | |
149 | ||
150 | OSErr UMAGetControlData (ControlHandle inControl, | |
151 | ControlPartCode inPart, | |
152 | ResType inTagName, | |
153 | Size inBufferSize, | |
154 | Ptr outBuffer, | |
155 | Size * outActualSize) ; | |
156 | OSErr UMAGetControlDataSize (ControlHandle inControl, | |
157 | ControlPartCode inPart, | |
158 | ResType inTagName, | |
159 | Size * outMaxSize); | |
160 | ||
161 | ||
162 | // system 8.0 | |
163 | ||
164 | short UMAFindWindow( Point inPoint , WindowRef *outWindow ) ; | |
165 | OSStatus UMAGetWindowFeatures( WindowRef inWindowRef , UInt32 *outFeatures ) ; | |
166 | OSStatus UMAGetWindowRegion( WindowRef inWindowRef , WindowRegionCode inRegionCode , RgnHandle ioWinRgn ) ; | |
167 | OSStatus UMACollapseWindow( WindowRef inWindowRef , Boolean inCollapseIt ) ; | |
168 | OSStatus UMACollapseAllWindows( Boolean inCollapseEm ) ; | |
169 | Boolean UMAIsWindowCollapsed( WindowRef inWindowRef ) ; | |
170 | Boolean UMAIsWindowCollapsable( WindowRef inWindowRef ) ; | |
171 | ||
172 | // system 8.5 | |
173 | ||
174 | OSStatus UMACreateNewWindow( WindowClass windowClass , WindowAttributes attributes , const Rect *bounds, WindowRef *outWindow ) ; | |
175 | OSStatus UMAGetWindowClass( WindowRef inWindowRef , WindowClass *outWindowClass ) ; | |
176 | OSStatus UMAGetWindowAttributes( WindowRef inWindowRef , WindowAttributes *outAttributes ) ; | |
177 | ||
178 | void UMAShowFloatingWindows() ; | |
179 | void UMAHideFloatingWindows() ; | |
180 | Boolean UMAAreFloatingWindowsVisible() ; | |
181 | WindowRef UMAFrontWindow() ; | |
182 | WindowRef UMAFrontNonFloatingWindow() ; | |
183 | ||
184 | // floaters support | |
185 | ||
186 | bool UMAIsWindowFloating( WindowRef inWindow ) ; | |
187 | bool UMAIsWindowModal( WindowRef inWindow ) ; | |
188 | WindowRef UMAGetActiveWindow() ; | |
189 | WindowRef UMAGetActiveNonFloatingWindow() ; | |
190 | ||
191 | void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate ) ; | |
192 | ||
193 | ||
194 | #endif |