2 #include "wx/mac/uma.h"
3 #include "wx/mac/aga.h"
6 #include <NavigationServices/Navigation.h>
8 #include <Navigation.h>
13 static bool sUMAHasAppearance
= false ;
14 static long sUMAAppearanceVersion
= 0 ;
15 extern int gAGABackgroundColor
;
16 bool UMAHasAppearance() { return sUMAHasAppearance
; }
17 long UMAGetAppearanceVersion() { return sUMAAppearanceVersion
; }
19 static bool sUMAHasWindowManager
= false ;
20 static long sUMAWindowManagerAttr
= 0 ;
22 bool UMAHasWindowManager() { return sUMAHasWindowManager
; }
23 long UMAGetWindowManagerAttr() { return sUMAWindowManagerAttr
; }
24 void UMACleanupToolbox()
26 #if UMA_USE_APPEARANCE
27 if ( sUMAHasAppearance
)
29 UnregisterAppearanceClient() ;
32 if ( NavServicesAvailable() )
37 void UMAInitToolbox( UInt16 inMoreMastersCalls
)
41 for (long i
= 1; i
<= inMoreMastersCalls
; i
++)
44 ::InitGraf(&qd
.thePort
);
49 ::FlushEvents(everyEvent
, 0);
52 PurgeSpace(&total
, &contig
);
57 #if UMA_USE_APPEARANCE
59 if ( Gestalt( gestaltAppearanceAttr
, &theAppearance
) == noErr
)
61 sUMAHasAppearance
= true ;
62 RegisterAppearanceClient();
63 if ( Gestalt( gestaltAppearanceVersion
, &theAppearance
) == noErr
)
65 sUMAAppearanceVersion
= theAppearance
;
69 sUMAAppearanceVersion
= 0x0100 ;
72 #endif // UMA_USE_APPEARANCE
75 if ( Gestalt( gestaltWindowMgrAttr
, &sUMAWindowManagerAttr
) == noErr
)
77 sUMAHasWindowManager
= sUMAWindowManagerAttr
& gestaltWindowMgrPresent
;
79 #endif // UMA_USE_WINDOWMGR
83 if ( sUMAHasWindowManager
)
84 InitFloatingWindows() ;
89 if ( NavServicesAvailable() )
96 long UMAGetProcessMode()
99 ProcessInfoRec processinfo
;
100 ProcessSerialNumber procno
;
102 procno
.highLongOfPSN
= NULL
;
103 procno
.lowLongOfPSN
= kCurrentProcess
;
104 processinfo
.processInfoLength
= sizeof(ProcessInfoRec
);
105 processinfo
.processName
= NULL
;
106 processinfo
.processAppSpec
= NULL
;
108 err
= ::GetProcessInformation( &procno
, &processinfo
) ;
109 wxASSERT( err
== noErr
) ;
110 return processinfo
.processMode
;
113 bool UMAGetProcessModeDoesActivateOnFGSwitch()
115 return UMAGetProcessMode() & modeDoesActivateOnFGSwitch
;
120 void UMASetMenuTitle( MenuRef menu
, StringPtr title
)
123 long size
= GetHandleSize( (Handle
) menu
) ;
124 const long headersize
= 14 ;
125 int oldlen
= (**menu
).menuData
[0] + 1;
126 int newlen
= title
[0] + 1 ;
128 if ( oldlen
< newlen
)
130 // enlarge before adjusting
131 SetHandleSize( (Handle
) menu
, size
+ (newlen
- oldlen
) );
134 if ( oldlen
!= newlen
)
135 memmove( (char*) (**menu
).menuData
+ newlen
, (char*) (**menu
).menuData
+ oldlen
, size
- headersize
- oldlen
) ;
137 memcpy( (char*) (**menu
).menuData
, title
, newlen
) ;
138 if ( oldlen
> newlen
)
141 SetHandleSize( (Handle
) menu
, size
+ (newlen
- oldlen
) ) ;
144 SetMenuTitle( menu
, title
) ;
148 UInt32
UMAMenuEvent( EventRecord
*inEvent
)
150 #if UMA_USE_APPEARANCE
151 if ( UMAHasAppearance() )
153 return MenuEvent( inEvent
) ;
158 if ( inEvent
->what
== keyDown
&& inEvent
->modifiers
& cmdKey
)
160 return MenuKey( inEvent
->message
& charCodeMask
) ;
166 void UMAEnableMenuItem( MenuRef inMenu
, MenuItemIndex inItem
)
168 #if UMA_USE_8_6 || TARGET_CARBON
169 EnableMenuItem( inMenu
, inItem
) ;
171 EnableItem( inMenu
, inItem
) ;
175 void UMADisableMenuItem( MenuRef inMenu
, MenuItemIndex inItem
)
177 #if UMA_USE_8_6 || TARGET_CARBON
178 DisableMenuItem( inMenu
, inItem
) ;
180 DisableItem( inMenu
, inItem
) ;
184 void UMAAppendSubMenuItem( MenuRef menu
, StringPtr l
, SInt16 id
)
187 memcpy( label
, l
, l
[0]+1 ) ;
188 // hardcoded adding of the submenu combination for mac
190 int theEnd
= label
[0] + 1;
192 theEnd
= 251; // mac allows only 255 characters
193 label
[theEnd
++] = '/';
194 label
[theEnd
++] = hMenuCmd
;
195 label
[theEnd
++] = '!';
196 label
[theEnd
++] = id
;
197 label
[theEnd
] = 0x00;
199 MacAppendMenu(menu
, label
);
202 void UMAInsertSubMenuItem( MenuRef menu
, StringPtr l
, MenuItemIndex item
, SInt16 id
)
205 memcpy( label
, l
, l
[0]+1 ) ;
206 // hardcoded adding of the submenu combination for mac
208 int theEnd
= label
[0] + 1;
210 theEnd
= 251; // mac allows only 255 characters
211 label
[theEnd
++] = '/';
212 label
[theEnd
++] = hMenuCmd
;
213 label
[theEnd
++] = '!';
214 label
[theEnd
++] = id
;
215 label
[theEnd
] = 0x00;
217 MacInsertMenuItem(menu
, label
, item
);
220 void UMAAppendMenuItem( MenuRef menu
, StringPtr l
, SInt16 key
, UInt8 modifiers
)
223 memcpy( label
, l
, l
[0]+1 ) ;
228 label
[++pos
] = toupper( key
);
231 MacAppendMenu( menu
, label
) ;
234 void UMAInsertMenuItem( MenuRef menu
, StringPtr l
, MenuItemIndex item
, SInt16 key
, UInt8 modifiers
)
237 memcpy( label
, l
, l
[0]+1 ) ;
242 label
[++pos
] = toupper( key
);
245 MacInsertMenuItem( menu
, label
, item
) ;
248 void UMADrawMenuBar()
254 void UMASetMenuItemText( MenuRef menu
, MenuItemIndex item
, StringPtr label
)
256 ::SetMenuItemText( menu
, item
, label
) ;
259 MenuRef
UMANewMenu( SInt16 menuid
, StringPtr label
)
261 return ::NewMenu(menuid
, label
);
264 void UMADisposeMenu( MenuRef menu
)
266 DisposeMenu( menu
) ;
268 void UMADeleteMenu( SInt16 menuId
)
270 ::DeleteMenu( menuId
) ;
273 void UMAInsertMenu( MenuRef insertMenu
, SInt16 afterId
)
275 ::InsertMenu( insertMenu
, afterId
) ;
281 int gPrOpenCounter
= 0 ;
288 if ( gPrOpenCounter
== 1 )
292 wxASSERT( err
== noErr
) ;
296 OSStatus err
= noErr
;
298 if ( gPrOpenCounter
== 1 )
301 wxASSERT( err
== noErr
) ;
307 OSStatus
UMAPrClose()
311 wxASSERT( gPrOpenCounter
>= 1 ) ;
312 if ( gPrOpenCounter
== 1 )
316 wxASSERT( err
== noErr
) ;
321 OSStatus err
= noErr
;
322 wxASSERT( gPrOpenCounter
>= 1 ) ;
323 if ( gPrOpenCounter
== 1 )
334 pascal QDGlobalsPtr
GetQDGlobalsPtr (void)
336 return QDGlobalsPtr (* (Ptr
*) LMGetCurrentA5 ( ) - 0xCA);
341 void UMAShowWatchCursor()
345 CursHandle watchFob
= GetCursor (watchCursor
);
352 Cursor preservedArrow
;
353 GetQDGlobalsArrow (&preservedArrow
);
354 SetQDGlobalsArrow (*watchFob
);
356 SetQDGlobalsArrow (&preservedArrow
);
358 SetCursor (*watchFob
);
363 void UMAShowArrowCursor()
367 SetCursor (GetQDGlobalsArrow (&arrow
));
369 SetCursor (&(qd
.arrow
));
375 GrafPtr
UMAGetWindowPort( WindowRef inWindowRef
)
377 wxASSERT( inWindowRef
!= NULL
) ;
379 return GetWindowPort( inWindowRef
) ;
381 return (GrafPtr
) inWindowRef
;
385 void UMADisposeWindow( WindowRef inWindowRef
)
387 wxASSERT( inWindowRef
!= NULL
) ;
388 DisposeWindow( inWindowRef
) ;
391 void UMASetWTitleC( WindowRef inWindowRef
, const char *title
)
394 strncpy( (char*)ptitle
, title
, 96 ) ;
397 c2pstrcpy( ptitle
, (char *)ptitle
) ;
399 c2pstr( (char*)ptitle
) ;
401 SetWTitle( inWindowRef
, ptitle
) ;
404 void UMAGetWTitleC( WindowRef inWindowRef
, char *title
)
406 GetWTitle( inWindowRef
, (unsigned char*)title
) ;
408 p2cstrcpy( title
, (unsigned char *)title
) ;
410 p2cstr( (unsigned char*)title
) ;
414 void UMAShowWindow( WindowRef inWindowRef
)
416 ShowWindow( inWindowRef
) ;
419 void UMAHideWindow( WindowRef inWindowRef
)
421 HideWindow( inWindowRef
) ;
424 void UMASelectWindow( WindowRef inWindowRef
)
426 SelectWindow( inWindowRef
) ;
429 void UMABringToFront( WindowRef inWindowRef
)
431 BringToFront( inWindowRef
) ;
434 void UMASendBehind( WindowRef inWindowRef
, WindowRef behindWindow
)
436 SendBehind( inWindowRef
, behindWindow
) ;
439 void UMACloseWindow(WindowRef inWindowRef
)
443 CloseWindow( inWindowRef
) ;
447 // appearance additions
449 void UMAActivateControl( ControlHandle inControl
)
451 #if UMA_USE_APPEARANCE
452 if ( UMAHasAppearance() )
454 ::ActivateControl( inControl
) ;
460 AGAActivateControl( inControl
) ;
468 void UMADrawControl( ControlHandle inControl
)
470 #if UMA_USE_APPEARANCE
471 if ( UMAHasAppearance() )
473 ::DrawControlInCurrentPort( inControl
) ;
479 AGADrawControl( inControl
) ;
487 void UMAMoveControl( ControlHandle inControl
, short x
, short y
)
489 #if UMA_USE_APPEARANCE
490 if ( UMAHasAppearance() )
492 ::MoveControl( inControl
, x
, y
) ;
498 AGAMoveControl( inControl
, x
,y
) ;
506 void UMASizeControl( ControlHandle inControl
, short x
, short y
)
508 #if UMA_USE_APPEARANCE
509 if ( UMAHasAppearance() )
511 ::SizeControl( inControl
, x
, y
) ;
517 AGASizeControl( inControl
, x
,y
) ;
525 void UMADeactivateControl( ControlHandle inControl
)
527 #if UMA_USE_APPEARANCE
528 if ( UMAHasAppearance() )
530 ::DeactivateControl( inControl
) ;
536 AGADeactivateControl( inControl
) ;
544 void UMASetThemeWindowBackground (WindowRef inWindow
,
548 #if UMA_USE_APPEARANCE
549 if ( UMAHasAppearance() )
551 ::SetThemeWindowBackground( inWindow
,inBrush
, inUpdate
) ;
557 AGASetThemeWindowBackground( inWindow
, inBrush
, inUpdate
) ;
565 void UMAApplyThemeBackground (ThemeBackgroundKind inKind
,
567 ThemeDrawState inState
,
571 #if UMA_USE_APPEARANCE
572 if ( UMAHasAppearance() )
575 if ( sUMAAppearanceVersion >= 0x0110 )
576 ::ApplyThemeBackground( inKind ,bounds , inState , inDepth , inColorDev ) ;
583 AGAApplyThemeBackground( inKind
,bounds
, inState
, inDepth
, inColorDev
) ;
591 ControlHandle
UMANewControl(WindowPtr owningWindow
,
592 const Rect
* boundsRect
,
593 ConstStr255Param controlTitle
,
594 Boolean initiallyVisible
,
599 SInt32 controlReference
)
601 ControlHandle theControl
= NULL
;
602 #if UMA_USE_APPEARANCE
603 if ( UMAHasAppearance() )
605 theControl
= NewControl( owningWindow
, boundsRect
, controlTitle
, initiallyVisible
,
606 initialValue
, minimumValue
, maximumValue
, procID
, controlReference
) ;
612 theControl
= AGANewControl( owningWindow
, boundsRect
, controlTitle
, initiallyVisible
,
613 initialValue
, minimumValue
, maximumValue
, procID
, controlReference
) ;
622 void UMADisposeControl (ControlHandle theControl
)
624 if ( UMAHasAppearance() )
626 ::DisposeControl( theControl
) ;
630 ::DisposeControl( theControl
) ;
635 void UMAHiliteControl (ControlHandle theControl
,
636 ControlPartCode hiliteState
)
638 if ( UMAHasAppearance() )
640 ::HiliteControl( theControl
, hiliteState
) ;
644 ::HiliteControl( theControl
, hiliteState
) ;
649 void UMAShowControl (ControlHandle theControl
)
651 if ( UMAHasAppearance() )
653 ::ShowControl( theControl
) ;
657 ::ShowControl( theControl
) ;
662 void UMAHideControl (ControlHandle theControl
)
664 if ( UMAHasAppearance() )
666 ::HideControl( theControl
) ;
670 ::HideControl( theControl
) ;
675 void UMASetControlVisibility (ControlHandle inControl
,
679 if ( UMAHasAppearance() )
681 #if UMA_USE_APPEARANCE
682 ::SetControlVisibility( inControl
, inIsVisible
, inDoDraw
) ;
689 bool UMAIsControlActive (ControlHandle inControl
)
692 return IsControlActive( inControl
) ;
694 #if UMA_USE_APPEARANCE
695 if ( UMAHasAppearance() )
697 return IsControlActive( inControl
) ;
701 return (**inControl
).contrlHilite
== 0 ;
706 bool UMAIsControlVisible (ControlHandle inControl
)
708 #if UMA_USE_APPEARANCE
709 if ( UMAHasAppearance() )
711 return IsControlVisible( inControl
) ;
717 OSErr
UMAGetBestControlRect (ControlHandle inControl
,
719 SInt16
* outBaseLineOffset
)
721 #if UMA_USE_APPEARANCE
722 if ( UMAHasAppearance() )
724 return GetBestControlRect( inControl
, outRect
, outBaseLineOffset
) ;
730 return AGAGetBestControlRect( inControl
, outRect
, outBaseLineOffset
) ;
740 OSErr
UMASetControlFontStyle (ControlHandle inControl
,
741 const ControlFontStyleRec
* inStyle
)
743 #if UMA_USE_APPEARANCE
744 if ( UMAHasAppearance() )
746 return ::SetControlFontStyle( inControl
, inStyle
) ;
751 return AGASetControlFontStyle( inControl
, inStyle
) ;
763 OSErr
UMACreateRootControl (WindowPtr inWindow
,
764 ControlHandle
* outControl
)
766 #if UMA_USE_APPEARANCE
767 if ( UMAHasAppearance() )
769 return CreateRootControl( inWindow
, outControl
) ;
774 return AGACreateRootControl( inWindow
, outControl
) ;
784 OSErr
UMAEmbedControl (ControlHandle inControl
,
785 ControlHandle inContainer
)
787 #if UMA_USE_APPEARANCE
788 if ( UMAHasAppearance() )
790 return EmbedControl( inControl
, inContainer
) ;
795 return AGAEmbedControl( inControl
, inContainer
) ; ;
806 OSErr
UMASetKeyboardFocus (WindowPtr inWindow
,
807 ControlHandle inControl
,
808 ControlFocusPart inPart
)
814 SetPort( GetWindowPort( inWindow
) ) ;
816 SetPort( inWindow
) ;
819 #if UMA_USE_APPEARANCE
820 if ( UMAHasAppearance() )
822 err
= SetKeyboardFocus( inWindow
, inControl
, inPart
) ;
827 err
= AGASetKeyboardFocus( inWindow
, inControl
, inPart
) ;
841 ControlPartCode
UMAHandleControlClick (ControlHandle inControl
,
844 ControlActionUPP inAction
)
846 #if UMA_USE_APPEARANCE
847 if ( UMAHasAppearance() )
849 return HandleControlClick( inControl
, inWhere
, inModifiers
, inAction
) ;
855 return AGAHandleControlClick( inControl
, inWhere
, inModifiers
, inAction
) ;
865 SInt16
UMAHandleControlKey (ControlHandle inControl
,
870 #if UMA_USE_APPEARANCE
871 if ( UMAHasAppearance() )
873 return HandleControlKey( inControl
, inKeyCode
, inCharCode
, inModifiers
) ;
879 return AGAHandleControlKey(inControl
, inKeyCode
, inCharCode
, inModifiers
) ;
890 void UMAIdleControls (WindowPtr inWindow
)
892 #if UMA_USE_APPEARANCE
893 if ( UMAHasAppearance() )
895 IdleControls( inWindow
) ;
901 AGAIdleControls( inWindow
) ;
909 void UMAUpdateControls( WindowPtr inWindow
, RgnHandle inRgn
)
911 #if UMA_USE_APPEARANCE
912 if ( UMAHasAppearance() )
914 UpdateControls( inWindow
, inRgn
) ;
920 AGAUpdateControls( inWindow
, inRgn
) ;
928 OSErr
UMAGetRootControl( WindowPtr inWindow
, ControlHandle
*outControl
)
930 #if UMA_USE_APPEARANCE
931 if ( UMAHasAppearance() )
933 return GetRootControl( inWindow
, outControl
) ;
939 return AGAGetRootControl( inWindow
, outControl
) ;
949 // handling control data
951 OSErr
UMASetControlData (ControlHandle inControl
,
952 ControlPartCode inPart
,
957 #if UMA_USE_APPEARANCE
958 if ( UMAHasAppearance() )
960 return SetControlData( inControl
, inPart
, inTagName
, inSize
, inData
) ;
965 return AGASetControlData( inControl
, inPart
, inTagName
, inSize
, inData
) ;
975 OSErr
UMAGetControlData (ControlHandle inControl
,
976 ControlPartCode inPart
,
980 Size
* outActualSize
)
982 #if UMA_USE_APPEARANCE
983 if ( UMAHasAppearance() )
985 return ::GetControlData( inControl
, inPart
, inTagName
, inBufferSize
, outBuffer
, outActualSize
) ;
991 return AGAGetControlData( inControl
, inPart
, inTagName
, inBufferSize
, outBuffer
, outActualSize
) ;
1001 OSErr
UMAGetControlDataSize (ControlHandle inControl
,
1002 ControlPartCode inPart
,
1006 #if UMA_USE_APPEARANCE
1007 if ( UMAHasAppearance() )
1009 return GetControlDataSize( inControl
, inPart
, inTagName
, outMaxSize
) ;
1015 return AGAGetControlDataSize( inControl
, inPart
, inTagName
, outMaxSize
) ;
1028 // system 8.0 changes
1030 short UMAFindWindow( Point inPoint
, WindowRef
*outWindow
)
1032 // todo add the additional area codes
1033 return FindWindow( inPoint
, outWindow
) ;
1036 OSStatus
UMAGetWindowFeatures( WindowRef inWindowRef
, UInt32
*outFeatures
)
1038 #if UMA_USE_WINDOWMGR
1039 return GetWindowFeatures( inWindowRef
, outFeatures
) ;
1045 OSStatus
UMAGetWindowRegion( WindowRef inWindowRef
, WindowRegionCode inRegionCode
, RgnHandle ioWinRgn
)
1047 #if UMA_USE_WINDOWMGR
1048 return GetWindowRegion( inWindowRef
, inRegionCode
, ioWinRgn
) ;
1054 void UMADrawGrowIcon( WindowRef inWindowRef
)
1056 DrawGrowIcon( inWindowRef
) ;
1059 OSStatus
UMACollapseWindow( WindowRef inWindowRef
, Boolean inCollapseIt
)
1061 return CollapseWindow( inWindowRef
, inCollapseIt
) ;
1064 OSStatus
UMACollapseAllWindows( Boolean inCollapseEm
)
1066 return CollapseAllWindows( inCollapseEm
) ;
1069 Boolean
UMAIsWindowCollapsed( WindowRef inWindowRef
)
1071 return IsWindowCollapsed( inWindowRef
) ;
1074 Boolean
UMAIsWindowCollapsable( WindowRef inWindowRef
)
1076 return IsWindowCollapsable( inWindowRef
) ;
1079 // system 8.5 changes<MacWindows.h>
1080 OSStatus
UMACreateNewWindow( WindowClass windowClass
, WindowAttributes attributes
, const Rect
*bounds
, WindowRef
*outWindow
)
1082 #if UMA_USE_WINDOWMGR
1083 if ( UMAHasWindowManager() )
1085 return CreateNewWindow( windowClass
, attributes
, bounds
, outWindow
) ;
1091 if ( UMAHasAppearance() )
1093 switch( windowClass
)
1095 case kMovableModalWindowClass
:
1096 procID
= kWindowMovableModalDialogProc
;
1098 case kModalWindowClass
:
1099 procID
= kWindowShadowDialogProc
;
1101 case kFloatingWindowClass
:
1102 if ( attributes
& kWindowSideTitlebarAttribute
)
1104 if( ( attributes
& kWindowResizableAttribute
) &&
1105 ( attributes
& kWindowFullZoomAttribute
) )
1107 procID
= kWindowFloatSideFullZoomGrowProc
;
1109 else if( attributes
& kWindowFullZoomAttribute
)
1111 procID
= kWindowFloatSideFullZoomProc
;
1113 else if ( attributes
& kWindowResizableAttribute
)
1115 procID
= kWindowFloatSideGrowProc
;
1119 procID
= kWindowFloatSideProc
;
1124 if( ( attributes
& kWindowResizableAttribute
) &&
1125 ( attributes
& kWindowFullZoomAttribute
) )
1127 procID
= kWindowFloatFullZoomGrowProc
;
1129 else if( attributes
& kWindowFullZoomAttribute
)
1131 procID
= kWindowFloatFullZoomProc
;
1133 else if ( attributes
& kWindowResizableAttribute
)
1135 procID
= kWindowFloatGrowProc
;
1139 procID
= kWindowFloatProc
;
1143 case kDocumentWindowClass
:
1145 if( ( attributes
& kWindowResizableAttribute
) &&
1146 ( attributes
& kWindowFullZoomAttribute
) )
1148 procID
= kWindowFullZoomGrowDocumentProc
;
1150 else if( attributes
& kWindowFullZoomAttribute
)
1152 procID
= kWindowFullZoomDocumentProc
;
1154 else if ( attributes
& kWindowResizableAttribute
)
1156 procID
= kWindowGrowDocumentProc
;
1160 procID
= kWindowDocumentProc
;
1167 switch( windowClass
)
1169 case kMovableModalWindowClass
:
1170 procID
= movableDBoxProc
;
1172 case kModalWindowClass
:
1173 procID
= altDBoxProc
;
1175 case kFloatingWindowClass
:
1176 if ( attributes
& kWindowSideTitlebarAttribute
)
1178 if( ( attributes
& kWindowResizableAttribute
) &&
1179 ( attributes
& kWindowFullZoomAttribute
) )
1181 procID
= floatSideZoomGrowProc
;
1183 else if( attributes
& kWindowFullZoomAttribute
)
1185 procID
= floatSideZoomProc
;
1187 else if ( attributes
& kWindowResizableAttribute
)
1189 procID
= floatSideGrowProc
;
1193 procID
= floatSideProc
;
1198 if( ( attributes
& kWindowResizableAttribute
) &&
1199 ( attributes
& kWindowFullZoomAttribute
) )
1201 procID
= floatZoomGrowProc
;
1203 else if( attributes
& kWindowFullZoomAttribute
)
1205 procID
= floatZoomProc
;
1207 else if ( attributes
& kWindowResizableAttribute
)
1209 procID
= floatGrowProc
;
1217 case kDocumentWindowClass
:
1219 if( ( attributes
& kWindowResizableAttribute
) &&
1220 ( attributes
& kWindowFullZoomAttribute
) )
1222 procID
= zoomDocProc
;
1224 else if( attributes
& kWindowFullZoomAttribute
)
1226 procID
= zoomNoGrow
;
1228 else if ( attributes
& kWindowResizableAttribute
)
1230 procID
= documentProc
;
1234 procID
= noGrowDocProc
;
1240 *outWindow
= NewCWindow(nil
, bounds
, "\p", false, procID
, (WindowRef
) -1 /*behind*/,
1241 attributes
& kWindowCloseBoxAttribute
, (long)NULL
);
1246 OSStatus
UMAGetWindowClass( WindowRef inWindowRef
, WindowClass
*outWindowClass
)
1248 #if UMA_USE_WINDOWMGR
1249 if ( UMAHasWindowManager() )
1251 return GetWindowClass( inWindowRef
, outWindowClass
) ;
1255 return kDocumentWindowClass
;
1258 OSStatus
UMAGetWindowAttributes( WindowRef inWindowRef
, WindowAttributes
*outAttributes
)
1260 #if UMA_USE_WINDOWMGR
1261 if ( UMAHasWindowManager() )
1263 return GetWindowAttributes( inWindowRef
, outAttributes
) ;
1266 return kWindowNoAttributes
;
1269 void UMAShowFloatingWindows()
1271 #if UMA_USE_WINDOWMGR
1272 if ( UMAHasWindowManager() )
1274 ShowFloatingWindows() ;
1279 void UMAHideFloatingWindows()
1281 #if UMA_USE_WINDOWMGR
1282 if ( UMAHasWindowManager() )
1284 HideFloatingWindows() ;
1289 Boolean
UMAAreFloatingWindowsVisible()
1291 #if UMA_USE_WINDOWMGR
1292 if ( UMAHasWindowManager() )
1294 return AreFloatingWindowsVisible() ;
1300 WindowRef
UMAFrontNonFloatingWindow()
1302 #if UMA_USE_WINDOWMGR
1303 if ( UMAHasWindowManager() )
1305 return FrontNonFloatingWindow() ;
1310 return FrontWindow() ;
1314 WindowRef
UMAFrontWindow()
1316 #if UMA_USE_WINDOWMGR
1317 if ( UMAHasWindowManager() )
1319 return FrontWindow() ;
1324 return FrontWindow() ;
1328 WindowRef
UMAGetActiveNonFloatingWindow()
1333 bool UMAIsWindowFloating( WindowRef inWindow
)
1337 UMAGetWindowClass( inWindow
, &cl
) ;
1338 return cl
== kFloatingWindowClass
;
1341 bool UMAIsWindowModal( WindowRef inWindow
)
1345 UMAGetWindowClass( inWindow
, &cl
) ;
1346 return cl
< kFloatingWindowClass
;
1351 void UMAHighlightAndActivateWindow( WindowRef inWindowRef
, bool inActivate
)
1355 // bool isHighlighted = IsWindowHighlited( inWindowRef ) ;
1356 // if ( inActivate != isHightlited )
1357 HiliteWindow( inWindowRef
, inActivate
) ;
1358 ControlHandle control
= NULL
;
1359 UMAGetRootControl( inWindowRef
, & control
) ;
1363 UMAActivateControl( control
) ;
1365 UMADeactivateControl( control
) ;
1369 OSStatus
UMADrawThemePlacard( const Rect
*inRect
, ThemeDrawState inState
)
1371 #if UMA_USE_APPEARANCE
1372 if ( UMAHasAppearance() )
1374 ::DrawThemePlacard( inRect
, inState
) ;