1 #include <wx/mac/uma.h>
2 #include <wx/mac/aga.h>
5 #include "Navigation.h"
9 static bool sUMAHasAppearance
= false ;
10 static long sUMAAppearanceVersion
= 0 ;
11 extern int gAGABackgroundColor
;
12 bool UMAHasAppearance() { return sUMAHasAppearance
; }
13 long UMAGetAppearanceVersion() { return sUMAAppearanceVersion
; }
15 static bool sUMAHasWindowManager
= false ;
16 static long sUMAWindowManagerAttr
= 0 ;
18 bool UMAHasWindowManager() { return sUMAHasWindowManager
; }
19 long UMAGetWindowManagerAttr() { return sUMAWindowManagerAttr
; }
20 void UMACleanupToolbox()
22 #if UMA_USE_APPEARANCE
23 if ( sUMAHasAppearance
)
25 UnregisterAppearanceClient() ;
28 if ( NavServicesAvailable() )
33 void UMAInitToolbox( UInt16 inMoreMastersCalls
)
37 for (long i
= 1; i
<= inMoreMastersCalls
; i
++)
40 ::InitGraf(&qd
.thePort
);
45 ::FlushEvents(everyEvent
, 0);
48 PurgeSpace(&total
, &contig
);
53 #if UMA_USE_APPEARANCE
55 if ( Gestalt( gestaltAppearanceAttr
, &theAppearance
) == noErr
)
57 sUMAHasAppearance
= true ;
58 RegisterAppearanceClient();
59 if ( Gestalt( gestaltAppearanceVersion
, &theAppearance
) == noErr
)
61 sUMAAppearanceVersion
= theAppearance
;
65 sUMAAppearanceVersion
= 0x0100 ;
68 #endif // UMA_USE_APPEARANCE
71 if ( Gestalt( gestaltWindowMgrAttr
, &sUMAWindowManagerAttr
) == noErr
)
73 sUMAHasWindowManager
= sUMAWindowManagerAttr
& gestaltWindowMgrPresent
;
75 #endif // UMA_USE_WINDOWMGR
78 if ( sUMAHasWindowManager
)
79 InitFloatingWindows() ;
83 if ( NavServicesAvailable() )
90 long UMAGetProcessMode()
93 ProcessInfoRec processinfo
;
94 ProcessSerialNumber procno
;
96 procno
.highLongOfPSN
= NULL
;
97 procno
.lowLongOfPSN
= kCurrentProcess
;
98 processinfo
.processInfoLength
= sizeof(ProcessInfoRec
);
99 processinfo
.processName
= NULL
;
100 processinfo
.processAppSpec
= NULL
;
102 err
= ::GetProcessInformation( &procno
, &processinfo
) ;
103 wxASSERT( err
== noErr
) ;
104 return processinfo
.processMode
;
107 bool UMAGetProcessModeDoesActivateOnFGSwitch()
109 return UMAGetProcessMode() & modeDoesActivateOnFGSwitch
;
114 void UMASetMenuTitle( MenuRef menu
, StringPtr title
)
117 long size
= GetHandleSize( (Handle
) menu
) ;
118 const long headersize
= 14 ;
119 int oldlen
= (**menu
).menuData
[0] + 1;
120 int newlen
= title
[0] + 1 ;
122 if ( oldlen
< newlen
)
124 // enlarge before adjusting
125 SetHandleSize( (Handle
) menu
, size
+ (newlen
- oldlen
) );
128 if ( oldlen
!= newlen
)
129 memmove( (char*) (**menu
).menuData
+ newlen
, (char*) (**menu
).menuData
+ oldlen
, size
- headersize
- oldlen
) ;
131 memcpy( (char*) (**menu
).menuData
, title
, newlen
) ;
132 if ( oldlen
> newlen
)
135 SetHandleSize( (Handle
) menu
, size
+ (newlen
- oldlen
) ) ;
138 SetMenuTitle( menu
, title
) ;
142 UInt32
UMAMenuEvent( EventRecord
*inEvent
)
144 #if UMA_USE_APPEARANCE
145 if ( UMAHasAppearance() )
147 return MenuEvent( inEvent
) ;
152 if ( inEvent
->what
== keyDown
&& inEvent
->modifiers
& cmdKey
)
154 return MenuKey( inEvent
->message
& charCodeMask
) ;
160 void UMAEnableMenuItem( MenuRef inMenu
, MenuItemIndex inItem
)
162 #if UMA_USE_8_6 || TARGET_CARBON
163 EnableMenuItem( inMenu
, inItem
) ;
165 EnableItem( inMenu
, inItem
) ;
169 void UMADisableMenuItem( MenuRef inMenu
, MenuItemIndex inItem
)
171 #if UMA_USE_8_6 || TARGET_CARBON
172 DisableMenuItem( inMenu
, inItem
) ;
174 DisableItem( inMenu
, inItem
) ;
178 void UMAAppendSubMenuItem( MenuRef menu
, StringPtr l
, SInt16 id
)
181 memcpy( label
, l
, l
[0]+1 ) ;
182 // hardcoded adding of the submenu combination for mac
184 int theEnd
= label
[0] + 1;
186 theEnd
= 251; // mac allows only 255 characters
187 label
[theEnd
++] = '/';
188 label
[theEnd
++] = hMenuCmd
;
189 label
[theEnd
++] = '!';
190 label
[theEnd
++] = id
;
191 label
[theEnd
] = 0x00;
193 MacAppendMenu(menu
, label
);
196 void UMAInsertSubMenuItem( MenuRef menu
, StringPtr l
, MenuItemIndex item
, SInt16 id
)
199 memcpy( label
, l
, l
[0]+1 ) ;
200 // hardcoded adding of the submenu combination for mac
202 int theEnd
= label
[0] + 1;
204 theEnd
= 251; // mac allows only 255 characters
205 label
[theEnd
++] = '/';
206 label
[theEnd
++] = hMenuCmd
;
207 label
[theEnd
++] = '!';
208 label
[theEnd
++] = id
;
209 label
[theEnd
] = 0x00;
211 MacInsertMenuItem(menu
, label
, item
);
214 void UMAAppendMenuItem( MenuRef menu
, StringPtr l
, SInt16 key
, UInt8 modifiers
)
217 memcpy( label
, l
, l
[0]+1 ) ;
222 label
[++pos
] = toupper( key
);
225 MacAppendMenu( menu
, label
) ;
228 void UMAInsertMenuItem( MenuRef menu
, StringPtr l
, MenuItemIndex item
, SInt16 key
, UInt8 modifiers
)
231 memcpy( label
, l
, l
[0]+1 ) ;
236 label
[++pos
] = toupper( key
);
239 MacInsertMenuItem( menu
, label
, item
) ;
242 void UMADrawMenuBar()
248 void UMASetMenuItemText( MenuRef menu
, MenuItemIndex item
, StringPtr label
)
250 ::SetMenuItemText( menu
, item
, label
) ;
253 MenuRef
UMANewMenu( SInt16 menuid
, StringPtr label
)
255 return ::NewMenu(menuid
, label
);
258 void UMADisposeMenu( MenuRef menu
)
260 DisposeMenu( menu
) ;
262 void UMADeleteMenu( SInt16 menuId
)
264 ::DeleteMenu( menuId
) ;
267 void UMAInsertMenu( MenuRef insertMenu
, SInt16 afterId
)
269 ::InsertMenu( insertMenu
, afterId
) ;
275 int gPrOpenCounter
= 0 ;
282 if ( gPrOpenCounter
== 1 )
286 wxASSERT( err
== noErr
) ;
290 OSStatus err
= noErr
;
292 if ( gPrOpenCounter
== 1 )
295 wxASSERT( err
== noErr
) ;
301 OSStatus
UMAPrClose()
305 wxASSERT( gPrOpenCounter
>= 1 ) ;
306 if ( gPrOpenCounter
== 1 )
310 wxASSERT( err
== noErr
) ;
315 OSStatus err
= noErr
;
316 wxASSERT( gPrOpenCounter
>= 1 ) ;
317 if ( gPrOpenCounter
== 1 )
328 pascal QDGlobalsPtr
GetQDGlobalsPtr (void)
330 return QDGlobalsPtr (* (Ptr
*) LMGetCurrentA5 ( ) - 0xCA);
335 void UMAShowWatchCursor()
339 CursHandle watchFob
= GetCursor (watchCursor
);
346 Cursor preservedArrow
;
347 GetQDGlobalsArrow (&preservedArrow
);
348 SetQDGlobalsArrow (*watchFob
);
350 SetQDGlobalsArrow (&preservedArrow
);
352 SetCursor (*watchFob
);
357 void UMAShowArrowCursor()
361 SetCursor (GetQDGlobalsArrow (&arrow
));
363 SetCursor (&(qd
.arrow
));
369 GrafPtr
UMAGetWindowPort( WindowRef inWindowRef
)
371 wxASSERT( inWindowRef
!= NULL
) ;
373 return GetWindowPort( inWindowRef
) ;
375 return (GrafPtr
) inWindowRef
;
379 void UMADisposeWindow( WindowRef inWindowRef
)
381 wxASSERT( inWindowRef
!= NULL
) ;
382 DisposeWindow( inWindowRef
) ;
385 void UMASetWTitleC( WindowRef inWindowRef
, const char *title
)
388 strncpy( (char*)ptitle
, title
, 96 ) ;
390 c2pstr( (char*)ptitle
) ;
391 SetWTitle( inWindowRef
, ptitle
) ;
393 void UMAGetWTitleC( WindowRef inWindowRef
, char *title
)
395 GetWTitle( inWindowRef
, (unsigned char*)title
) ;
396 p2cstr( (unsigned char*)title
) ;
399 void UMAShowWindow( WindowRef inWindowRef
)
401 ShowWindow( inWindowRef
) ;
404 void UMAHideWindow( WindowRef inWindowRef
)
406 HideWindow( inWindowRef
) ;
409 void UMASelectWindow( WindowRef inWindowRef
)
411 SelectWindow( inWindowRef
) ;
414 void UMABringToFront( WindowRef inWindowRef
)
416 BringToFront( inWindowRef
) ;
419 void UMASendBehind( WindowRef inWindowRef
, WindowRef behindWindow
)
421 SendBehind( inWindowRef
, behindWindow
) ;
424 void UMACloseWindow(WindowRef inWindowRef
)
428 CloseWindow( inWindowRef
) ;
432 // appearance additions
434 void UMAActivateControl( ControlHandle inControl
)
436 #if UMA_USE_APPEARANCE
437 if ( UMAHasAppearance() )
439 ::ActivateControl( inControl
) ;
445 AGAActivateControl( inControl
) ;
453 void UMADrawControl( ControlHandle inControl
)
455 #if UMA_USE_APPEARANCE
456 if ( UMAHasAppearance() )
458 ::DrawControlInCurrentPort( inControl
) ;
464 AGADrawControl( inControl
) ;
472 void UMAMoveControl( ControlHandle inControl
, short x
, short y
)
474 #if UMA_USE_APPEARANCE
475 if ( UMAHasAppearance() )
477 ::MoveControl( inControl
, x
, y
) ;
483 AGAMoveControl( inControl
, x
,y
) ;
491 void UMASizeControl( ControlHandle inControl
, short x
, short y
)
493 #if UMA_USE_APPEARANCE
494 if ( UMAHasAppearance() )
496 ::SizeControl( inControl
, x
, y
) ;
502 AGASizeControl( inControl
, x
,y
) ;
510 void UMADeactivateControl( ControlHandle inControl
)
512 #if UMA_USE_APPEARANCE
513 if ( UMAHasAppearance() )
515 ::DeactivateControl( inControl
) ;
521 AGADeactivateControl( inControl
) ;
529 void UMASetThemeWindowBackground (WindowRef inWindow
,
533 #if UMA_USE_APPEARANCE
534 if ( UMAHasAppearance() )
536 ::SetThemeWindowBackground( inWindow
,inBrush
, inUpdate
) ;
542 AGASetThemeWindowBackground( inWindow
, inBrush
, inUpdate
) ;
550 void UMAApplyThemeBackground (ThemeBackgroundKind inKind
,
552 ThemeDrawState inState
,
556 #if UMA_USE_APPEARANCE
557 if ( UMAHasAppearance() )
560 if ( sUMAAppearanceVersion >= 0x0110 )
561 ::ApplyThemeBackground( inKind ,bounds , inState , inDepth , inColorDev ) ;
568 AGAApplyThemeBackground( inKind
,bounds
, inState
, inDepth
, inColorDev
) ;
576 ControlHandle
UMANewControl(WindowPtr owningWindow
,
577 const Rect
* boundsRect
,
578 ConstStr255Param controlTitle
,
579 Boolean initiallyVisible
,
584 SInt32 controlReference
)
586 ControlHandle theControl
= NULL
;
587 #if UMA_USE_APPEARANCE
588 if ( UMAHasAppearance() )
590 theControl
= NewControl( owningWindow
, boundsRect
, controlTitle
, initiallyVisible
,
591 initialValue
, minimumValue
, maximumValue
, procID
, controlReference
) ;
597 theControl
= AGANewControl( owningWindow
, boundsRect
, controlTitle
, initiallyVisible
,
598 initialValue
, minimumValue
, maximumValue
, procID
, controlReference
) ;
607 void UMADisposeControl (ControlHandle theControl
)
609 if ( UMAHasAppearance() )
611 ::DisposeControl( theControl
) ;
615 ::DisposeControl( theControl
) ;
620 void UMAHiliteControl (ControlHandle theControl
,
621 ControlPartCode hiliteState
)
623 if ( UMAHasAppearance() )
625 ::HiliteControl( theControl
, hiliteState
) ;
629 ::HiliteControl( theControl
, hiliteState
) ;
634 void UMAShowControl (ControlHandle theControl
)
636 if ( UMAHasAppearance() )
638 ::ShowControl( theControl
) ;
642 ::ShowControl( theControl
) ;
647 void UMAHideControl (ControlHandle theControl
)
649 if ( UMAHasAppearance() )
651 ::HideControl( theControl
) ;
655 ::HideControl( theControl
) ;
660 void UMASetControlVisibility (ControlHandle inControl
,
664 if ( UMAHasAppearance() )
666 #if UMA_USE_APPEARANCE
667 ::SetControlVisibility( inControl
, inIsVisible
, inDoDraw
) ;
674 bool UMAIsControlActive (ControlHandle inControl
)
677 return IsControlActive( inControl
) ;
679 #if UMA_USE_APPEARANCE
680 if ( UMAHasAppearance() )
682 return IsControlActive( inControl
) ;
686 return (**inControl
).contrlHilite
== 0 ;
691 bool UMAIsControlVisible (ControlHandle inControl
)
693 #if UMA_USE_APPEARANCE
694 if ( UMAHasAppearance() )
696 return IsControlVisible( inControl
) ;
702 OSErr
UMAGetBestControlRect (ControlHandle inControl
,
704 SInt16
* outBaseLineOffset
)
706 #if UMA_USE_APPEARANCE
707 if ( UMAHasAppearance() )
709 return GetBestControlRect( inControl
, outRect
, outBaseLineOffset
) ;
715 return AGAGetBestControlRect( inControl
, outRect
, outBaseLineOffset
) ;
725 OSErr
UMASetControlFontStyle (ControlHandle inControl
,
726 const ControlFontStyleRec
* inStyle
)
728 #if UMA_USE_APPEARANCE
729 if ( UMAHasAppearance() )
731 return ::SetControlFontStyle( inControl
, inStyle
) ;
736 return AGASetControlFontStyle( inControl
, inStyle
) ;
748 OSErr
UMACreateRootControl (WindowPtr inWindow
,
749 ControlHandle
* outControl
)
751 #if UMA_USE_APPEARANCE
752 if ( UMAHasAppearance() )
754 return CreateRootControl( inWindow
, outControl
) ;
759 return AGACreateRootControl( inWindow
, outControl
) ;
769 OSErr
UMAEmbedControl (ControlHandle inControl
,
770 ControlHandle inContainer
)
772 #if UMA_USE_APPEARANCE
773 if ( UMAHasAppearance() )
775 return EmbedControl( inControl
, inContainer
) ;
780 return AGAEmbedControl( inControl
, inContainer
) ; ;
791 OSErr
UMASetKeyboardFocus (WindowPtr inWindow
,
792 ControlHandle inControl
,
793 ControlFocusPart inPart
)
799 SetPort( GetWindowPort( inWindow
) ) ;
801 SetPort( inWindow
) ;
804 #if UMA_USE_APPEARANCE
805 if ( UMAHasAppearance() )
807 err
= SetKeyboardFocus( inWindow
, inControl
, inPart
) ;
812 err
= AGASetKeyboardFocus( inWindow
, inControl
, inPart
) ;
826 ControlPartCode
UMAHandleControlClick (ControlHandle inControl
,
829 ControlActionUPP inAction
)
831 #if UMA_USE_APPEARANCE
832 if ( UMAHasAppearance() )
834 return HandleControlClick( inControl
, inWhere
, inModifiers
, inAction
) ;
840 return AGAHandleControlClick( inControl
, inWhere
, inModifiers
, inAction
) ;
850 SInt16
UMAHandleControlKey (ControlHandle inControl
,
855 #if UMA_USE_APPEARANCE
856 if ( UMAHasAppearance() )
858 return HandleControlKey( inControl
, inKeyCode
, inCharCode
, inModifiers
) ;
864 return AGAHandleControlKey(inControl
, inKeyCode
, inCharCode
, inModifiers
) ;
875 void UMAIdleControls (WindowPtr inWindow
)
877 #if UMA_USE_APPEARANCE
878 if ( UMAHasAppearance() )
880 IdleControls( inWindow
) ;
886 AGAIdleControls( inWindow
) ;
894 void UMAUpdateControls( WindowPtr inWindow
, RgnHandle inRgn
)
896 #if UMA_USE_APPEARANCE
897 if ( UMAHasAppearance() )
899 UpdateControls( inWindow
, inRgn
) ;
905 AGAUpdateControls( inWindow
, inRgn
) ;
913 OSErr
UMAGetRootControl( WindowPtr inWindow
, ControlHandle
*outControl
)
915 #if UMA_USE_APPEARANCE
916 if ( UMAHasAppearance() )
918 return GetRootControl( inWindow
, outControl
) ;
924 return AGAGetRootControl( inWindow
, outControl
) ;
934 // handling control data
936 OSErr
UMASetControlData (ControlHandle inControl
,
937 ControlPartCode inPart
,
942 #if UMA_USE_APPEARANCE
943 if ( UMAHasAppearance() )
945 return SetControlData( inControl
, inPart
, inTagName
, inSize
, inData
) ;
950 return AGASetControlData( inControl
, inPart
, inTagName
, inSize
, inData
) ;
960 OSErr
UMAGetControlData (ControlHandle inControl
,
961 ControlPartCode inPart
,
965 Size
* outActualSize
)
967 #if UMA_USE_APPEARANCE
968 if ( UMAHasAppearance() )
970 return ::GetControlData( inControl
, inPart
, inTagName
, inBufferSize
, outBuffer
, outActualSize
) ;
976 return AGAGetControlData( inControl
, inPart
, inTagName
, inBufferSize
, outBuffer
, outActualSize
) ;
986 OSErr
UMAGetControlDataSize (ControlHandle inControl
,
987 ControlPartCode inPart
,
991 #if UMA_USE_APPEARANCE
992 if ( UMAHasAppearance() )
994 return GetControlDataSize( inControl
, inPart
, inTagName
, outMaxSize
) ;
1000 return AGAGetControlDataSize( inControl
, inPart
, inTagName
, outMaxSize
) ;
1013 // system 8.0 changes
1015 short UMAFindWindow( Point inPoint
, WindowRef
*outWindow
)
1017 // todo add the additional area codes
1018 return FindWindow( inPoint
, outWindow
) ;
1021 OSStatus
UMAGetWindowFeatures( WindowRef inWindowRef
, UInt32
*outFeatures
)
1023 #if UMA_USE_WINDOWMGR
1024 return GetWindowFeatures( inWindowRef
, outFeatures
) ;
1030 OSStatus
UMAGetWindowRegion( WindowRef inWindowRef
, WindowRegionCode inRegionCode
, RgnHandle ioWinRgn
)
1032 #if UMA_USE_WINDOWMGR
1033 return GetWindowRegion( inWindowRef
, inRegionCode
, ioWinRgn
) ;
1039 void UMADrawGrowIcon( WindowRef inWindowRef
)
1041 DrawGrowIcon( inWindowRef
) ;
1044 OSStatus
UMACollapseWindow( WindowRef inWindowRef
, Boolean inCollapseIt
)
1046 return CollapseWindow( inWindowRef
, inCollapseIt
) ;
1049 OSStatus
UMACollapseAllWindows( Boolean inCollapseEm
)
1051 return CollapseAllWindows( inCollapseEm
) ;
1054 Boolean
UMAIsWindowCollapsed( WindowRef inWindowRef
)
1056 return IsWindowCollapsed( inWindowRef
) ;
1059 Boolean
UMAIsWindowCollapsable( WindowRef inWindowRef
)
1061 return IsWindowCollapsable( inWindowRef
) ;
1064 // system 8.5 changes<MacWindows.h>
1065 OSStatus
UMACreateNewWindow( WindowClass windowClass
, WindowAttributes attributes
, const Rect
*bounds
, WindowRef
*outWindow
)
1067 #if UMA_USE_WINDOWMGR
1068 if ( UMAHasWindowManager() )
1070 return CreateNewWindow( windowClass
, attributes
, bounds
, outWindow
) ;
1076 if ( UMAHasAppearance() )
1078 switch( windowClass
)
1080 case kMovableModalWindowClass
:
1081 procID
= kWindowMovableModalDialogProc
;
1083 case kModalWindowClass
:
1084 procID
= kWindowShadowDialogProc
;
1086 case kFloatingWindowClass
:
1087 if ( attributes
& kWindowSideTitlebarAttribute
)
1089 if( ( attributes
& kWindowResizableAttribute
) &&
1090 ( attributes
& kWindowFullZoomAttribute
) )
1092 procID
= kWindowFloatSideFullZoomGrowProc
;
1094 else if( attributes
& kWindowFullZoomAttribute
)
1096 procID
= kWindowFloatSideFullZoomProc
;
1098 else if ( attributes
& kWindowResizableAttribute
)
1100 procID
= kWindowFloatSideGrowProc
;
1104 procID
= kWindowFloatSideProc
;
1109 if( ( attributes
& kWindowResizableAttribute
) &&
1110 ( attributes
& kWindowFullZoomAttribute
) )
1112 procID
= kWindowFloatFullZoomGrowProc
;
1114 else if( attributes
& kWindowFullZoomAttribute
)
1116 procID
= kWindowFloatFullZoomProc
;
1118 else if ( attributes
& kWindowResizableAttribute
)
1120 procID
= kWindowFloatGrowProc
;
1124 procID
= kWindowFloatProc
;
1128 case kDocumentWindowClass
:
1130 if( ( attributes
& kWindowResizableAttribute
) &&
1131 ( attributes
& kWindowFullZoomAttribute
) )
1133 procID
= kWindowFullZoomGrowDocumentProc
;
1135 else if( attributes
& kWindowFullZoomAttribute
)
1137 procID
= kWindowFullZoomDocumentProc
;
1139 else if ( attributes
& kWindowResizableAttribute
)
1141 procID
= kWindowGrowDocumentProc
;
1145 procID
= kWindowDocumentProc
;
1152 switch( windowClass
)
1154 case kMovableModalWindowClass
:
1155 procID
= movableDBoxProc
;
1157 case kModalWindowClass
:
1158 procID
= altDBoxProc
;
1160 case kFloatingWindowClass
:
1161 if ( attributes
& kWindowSideTitlebarAttribute
)
1163 if( ( attributes
& kWindowResizableAttribute
) &&
1164 ( attributes
& kWindowFullZoomAttribute
) )
1166 procID
= floatSideZoomGrowProc
;
1168 else if( attributes
& kWindowFullZoomAttribute
)
1170 procID
= floatSideZoomProc
;
1172 else if ( attributes
& kWindowResizableAttribute
)
1174 procID
= floatSideGrowProc
;
1178 procID
= floatSideProc
;
1183 if( ( attributes
& kWindowResizableAttribute
) &&
1184 ( attributes
& kWindowFullZoomAttribute
) )
1186 procID
= floatZoomGrowProc
;
1188 else if( attributes
& kWindowFullZoomAttribute
)
1190 procID
= floatZoomProc
;
1192 else if ( attributes
& kWindowResizableAttribute
)
1194 procID
= floatGrowProc
;
1202 case kDocumentWindowClass
:
1204 if( ( attributes
& kWindowResizableAttribute
) &&
1205 ( attributes
& kWindowFullZoomAttribute
) )
1207 procID
= zoomDocProc
;
1209 else if( attributes
& kWindowFullZoomAttribute
)
1211 procID
= zoomNoGrow
;
1213 else if ( attributes
& kWindowResizableAttribute
)
1215 procID
= documentProc
;
1219 procID
= noGrowDocProc
;
1225 *outWindow
= NewCWindow(nil
, bounds
, "\p", false, procID
, (WindowRef
) -1 /*behind*/,
1226 attributes
& kWindowCloseBoxAttribute
, (long)NULL
);
1231 OSStatus
UMAGetWindowClass( WindowRef inWindowRef
, WindowClass
*outWindowClass
)
1233 #if UMA_USE_WINDOWMGR
1234 if ( UMAHasWindowManager() )
1236 return GetWindowClass( inWindowRef
, outWindowClass
) ;
1240 return kDocumentWindowClass
;
1243 OSStatus
UMAGetWindowAttributes( WindowRef inWindowRef
, WindowAttributes
*outAttributes
)
1245 #if UMA_USE_WINDOWMGR
1246 if ( UMAHasWindowManager() )
1248 return GetWindowAttributes( inWindowRef
, outAttributes
) ;
1251 return kWindowNoAttributes
;
1254 void UMAShowFloatingWindows()
1256 #if UMA_USE_WINDOWMGR
1257 if ( UMAHasWindowManager() )
1259 ShowFloatingWindows() ;
1264 void UMAHideFloatingWindows()
1266 #if UMA_USE_WINDOWMGR
1267 if ( UMAHasWindowManager() )
1269 HideFloatingWindows() ;
1274 Boolean
UMAAreFloatingWindowsVisible()
1276 #if UMA_USE_WINDOWMGR
1277 if ( UMAHasWindowManager() )
1279 return AreFloatingWindowsVisible() ;
1285 WindowRef
UMAFrontNonFloatingWindow()
1287 #if UMA_USE_WINDOWMGR
1288 if ( UMAHasWindowManager() )
1290 return FrontNonFloatingWindow() ;
1295 return FrontWindow() ;
1299 WindowRef
UMAFrontWindow()
1301 #if UMA_USE_WINDOWMGR
1302 if ( UMAHasWindowManager() )
1304 return FrontWindow() ;
1309 return FrontWindow() ;
1313 WindowRef
UMAGetActiveNonFloatingWindow()
1318 bool UMAIsWindowFloating( WindowRef inWindow
)
1322 UMAGetWindowClass( inWindow
, &cl
) ;
1323 return cl
== kFloatingWindowClass
;
1326 bool UMAIsWindowModal( WindowRef inWindow
)
1330 UMAGetWindowClass( inWindow
, &cl
) ;
1331 return cl
< kFloatingWindowClass
;
1336 void UMAHighlightAndActivateWindow( WindowRef inWindowRef
, bool inActivate
)
1340 // bool isHighlighted = IsWindowHighlited( inWindowRef ) ;
1341 // if ( inActivate != isHightlited )
1342 HiliteWindow( inWindowRef
, inActivate
) ;
1343 ControlHandle control
= NULL
;
1344 UMAGetRootControl( inWindowRef
, & control
) ;
1348 UMAActivateControl( control
) ;
1350 UMADeactivateControl( control
) ;
1354 OSStatus
UMADrawThemePlacard( const Rect
*inRect
, ThemeDrawState inState
)
1356 #if UMA_USE_APPEARANCE
1357 if ( UMAHasAppearance() )
1359 ::DrawThemePlacard( inRect
, inState
) ;