1 #include <wx/mac/uma.h>
2 #include <wx/mac/aga.h>
6 static bool sUMAHasAppearance
= false ;
7 static long sUMAAppearanceVersion
= 0 ;
8 extern int gAGABackgroundColor
;
9 bool UMAHasAppearance() { return sUMAHasAppearance
; }
10 long UMAGetAppearanceVersion() { return sUMAAppearanceVersion
; }
12 static bool sUMAHasWindowManager
= false ;
13 static long sUMAWindowManagerAttr
= 0 ;
15 bool UMAHasWindowManager() { return sUMAHasWindowManager
; }
16 long UMAGetWindowManagerAttr() { return sUMAWindowManagerAttr
; }
18 void UMAInitToolbox( UInt16 inMoreMastersCalls
)
22 for (long i
= 1; i
<= inMoreMastersCalls
; i
++)
25 ::InitGraf(&qd
.thePort
);
31 ::FlushEvents(everyEvent
, 0);
34 PurgeSpace(&total
, &contig
);
39 #if UMA_USE_APPEARANCE
41 if ( Gestalt( gestaltAppearanceAttr
, &theAppearance
) == noErr
)
43 sUMAHasAppearance
= true ;
44 RegisterAppearanceClient();
45 if ( Gestalt( gestaltAppearanceVersion
, &theAppearance
) == noErr
)
47 sUMAAppearanceVersion
= theAppearance
;
51 sUMAAppearanceVersion
= 0x0100 ;
54 #endif // UMA_USE_APPEARANCE
57 if ( Gestalt( gestaltWindowMgrAttr
, &sUMAWindowManagerAttr
) == noErr
)
59 sUMAHasWindowManager
= sUMAWindowManagerAttr
& gestaltWindowMgrPresent
;
61 #endif // UMA_USE_WINDOWMGR
66 long UMAGetProcessMode()
69 ProcessInfoRec processinfo
;
70 ProcessSerialNumber procno
;
72 procno
.highLongOfPSN
= NULL
;
73 procno
.lowLongOfPSN
= kCurrentProcess
;
74 processinfo
.processInfoLength
= sizeof(ProcessInfoRec
);
75 processinfo
.processName
= NULL
;
76 processinfo
.processAppSpec
= NULL
;
78 err
= ::GetProcessInformation( &procno
, &processinfo
) ;
79 wxASSERT( err
== noErr
) ;
80 return processinfo
.processMode
;
83 bool UMAGetProcessModeDoesActivateOnFGSwitch()
85 return UMAGetProcessMode() & modeDoesActivateOnFGSwitch
;
90 void UMASetMenuTitle( MenuRef menu
, StringPtr title
)
93 long size
= GetHandleSize( (Handle
) menu
) ;
94 const long headersize
= 14 ;
95 int oldlen
= (**menu
).menuData
[0] + 1;
96 int newlen
= title
[0] + 1 ;
98 if ( oldlen
< newlen
)
100 // enlarge before adjusting
101 SetHandleSize( (Handle
) menu
, size
+ (newlen
- oldlen
) );
104 if ( oldlen
!= newlen
)
105 memmove( (char*) (**menu
).menuData
+ newlen
, (char*) (**menu
).menuData
+ oldlen
, size
- headersize
- oldlen
) ;
107 memcpy( (char*) (**menu
).menuData
, title
, newlen
) ;
108 if ( oldlen
> newlen
)
111 SetHandleSize( (Handle
) menu
, size
+ (newlen
- oldlen
) ) ;
114 SetMenuTitle( menu
, title
) ;
118 UInt32
UMAMenuEvent( EventRecord
*inEvent
)
120 #if UMA_USE_APPEARANCE
121 if ( UMAHasAppearance() )
123 return MenuEvent( inEvent
) ;
128 if ( inEvent
->what
== keyDown
&& inEvent
->modifiers
& cmdKey
)
130 return MenuKey( inEvent
->message
& charCodeMask
) ;
136 void UMAEnableMenuItem( MenuRef inMenu
, MenuItemIndex inItem
)
138 #if UMA_USE_8_6 || TARGET_CARBON
139 EnableMenuItem( inMenu
, inItem
) ;
141 EnableItem( inMenu
, inItem
) ;
145 void UMADisableMenuItem( MenuRef inMenu
, MenuItemIndex inItem
)
147 #if UMA_USE_8_6 || TARGET_CARBON
148 DisableMenuItem( inMenu
, inItem
) ;
150 DisableItem( inMenu
, inItem
) ;
154 void UMAAppendSubMenuItem( MenuRef menu
, StringPtr l
, SInt16 id
)
157 memcpy( label
, l
, l
[0]+1 ) ;
158 // hardcoded adding of the submenu combination for mac
160 int theEnd
= label
[0] + 1;
162 theEnd
= 251; // mac allows only 255 characters
163 label
[theEnd
++] = '/';
164 label
[theEnd
++] = hMenuCmd
;
165 label
[theEnd
++] = '!';
166 label
[theEnd
++] = id
;
167 label
[theEnd
] = 0x00;
169 MacAppendMenu(menu
, label
);
172 void UMAInsertSubMenuItem( MenuRef menu
, StringPtr l
, MenuItemIndex item
, SInt16 id
)
175 memcpy( label
, l
, l
[0]+1 ) ;
176 // hardcoded adding of the submenu combination for mac
178 int theEnd
= label
[0] + 1;
180 theEnd
= 251; // mac allows only 255 characters
181 label
[theEnd
++] = '/';
182 label
[theEnd
++] = hMenuCmd
;
183 label
[theEnd
++] = '!';
184 label
[theEnd
++] = id
;
185 label
[theEnd
] = 0x00;
187 MacInsertMenuItem(menu
, label
, item
);
190 void UMAAppendMenuItem( MenuRef menu
, StringPtr l
, SInt16 key
, UInt8 modifiers
)
193 memcpy( label
, l
, l
[0]+1 ) ;
198 label
[++pos
] = toupper( key
);
201 MacAppendMenu( menu
, label
) ;
204 void UMAInsertMenuItem( MenuRef menu
, StringPtr l
, MenuItemIndex item
, SInt16 key
, UInt8 modifiers
)
207 memcpy( label
, l
, l
[0]+1 ) ;
212 label
[++pos
] = toupper( key
);
215 MacInsertMenuItem( menu
, label
, item
) ;
218 void UMADrawMenuBar()
224 void UMASetMenuItemText( MenuRef menu
, MenuItemIndex item
, StringPtr label
)
226 ::SetMenuItemText( menu
, item
, label
) ;
229 MenuRef
UMANewMenu( SInt16 menuid
, StringPtr label
)
231 return ::NewMenu(menuid
, label
);
234 void UMADisposeMenu( MenuRef menu
)
236 DisposeMenu( menu
) ;
238 void UMADeleteMenu( SInt16 menuId
)
240 ::DeleteMenu( menuId
) ;
243 void UMAInsertMenu( MenuRef insertMenu
, SInt16 afterId
)
245 ::InsertMenu( insertMenu
, afterId
) ;
251 int gPrOpenCounter
= 0 ;
258 if ( gPrOpenCounter
== 1 )
262 wxASSERT( err
== noErr
) ;
265 #pragma warning "TODO Printing for Carbon"
273 wxASSERT( gPrOpenCounter
>= 1 ) ;
274 if ( gPrOpenCounter
== 1 )
278 wxASSERT( err
== noErr
) ;
282 #pragma warning "TODO Printing for Carbon"
288 pascal QDGlobalsPtr
GetQDGlobalsPtr (void)
290 return QDGlobalsPtr (* (Ptr
*) LMGetCurrentA5 ( ) - 0xCA);
295 void UMAShowWatchCursor()
299 CursHandle watchFob
= GetCursor (watchCursor
);
306 Cursor preservedArrow
;
307 GetQDGlobalsArrow (&preservedArrow
);
308 SetQDGlobalsArrow (*watchFob
);
310 SetQDGlobalsArrow (&preservedArrow
);
312 SetCursor (*watchFob
);
317 void UMAShowArrowCursor()
321 SetCursor (GetQDGlobalsArrow (&arrow
));
323 SetCursor (&(qd
.arrow
));
329 GrafPtr
UMAGetWindowPort( WindowRef inWindowRef
)
331 wxASSERT( inWindowRef
!= NULL
) ;
333 return GetWindowPort( inWindowRef
) ;
335 return (GrafPtr
) inWindowRef
;
339 void UMADisposeWindow( WindowRef inWindowRef
)
341 wxASSERT( inWindowRef
!= NULL
) ;
342 DisposeWindow( inWindowRef
) ;
345 void UMASetWTitleC( WindowRef inWindowRef
, const char *title
)
348 strncpy( (char*)ptitle
, title
, 96 ) ;
350 c2pstr( (char*)ptitle
) ;
351 SetWTitle( inWindowRef
, ptitle
) ;
353 void UMAGetWTitleC( WindowRef inWindowRef
, char *title
)
355 GetWTitle( inWindowRef
, (unsigned char*)title
) ;
356 p2cstr( (unsigned char*)title
) ;
359 void UMAShowWindow( WindowRef inWindowRef
)
361 ShowWindow( inWindowRef
) ;
364 void UMAHideWindow( WindowRef inWindowRef
)
366 HideWindow( inWindowRef
) ;
369 void UMASelectWindow( WindowRef inWindowRef
)
371 SelectWindow( inWindowRef
) ;
374 void UMABringToFront( WindowRef inWindowRef
)
376 BringToFront( inWindowRef
) ;
379 void UMASendBehind( WindowRef inWindowRef
, WindowRef behindWindow
)
381 SendBehind( inWindowRef
, behindWindow
) ;
384 void UMACloseWindow(WindowRef inWindowRef
)
388 CloseWindow( inWindowRef
) ;
392 // appearance additions
394 void UMAActivateControl( ControlHandle inControl
)
396 #if UMA_USE_APPEARANCE
397 if ( UMAHasAppearance() )
399 ::ActivateControl( inControl
) ;
405 AGAActivateControl( inControl
) ;
413 void UMADrawControl( ControlHandle inControl
)
415 #if UMA_USE_APPEARANCE
416 if ( UMAHasAppearance() )
418 ::DrawControlInCurrentPort( inControl
) ;
424 AGADrawControl( inControl
) ;
432 void UMAMoveControl( ControlHandle inControl
, short x
, short y
)
434 #if UMA_USE_APPEARANCE
435 if ( UMAHasAppearance() )
437 ::MoveControl( inControl
, x
, y
) ;
443 AGAMoveControl( inControl
, x
,y
) ;
451 void UMASizeControl( ControlHandle inControl
, short x
, short y
)
453 #if UMA_USE_APPEARANCE
454 if ( UMAHasAppearance() )
456 ::SizeControl( inControl
, x
, y
) ;
462 AGASizeControl( inControl
, x
,y
) ;
470 void UMADeactivateControl( ControlHandle inControl
)
472 #if UMA_USE_APPEARANCE
473 if ( UMAHasAppearance() )
475 ::DeactivateControl( inControl
) ;
481 AGADeactivateControl( inControl
) ;
489 void UMASetThemeWindowBackground (WindowRef inWindow
,
493 #if UMA_USE_APPEARANCE
494 if ( UMAHasAppearance() )
496 ::SetThemeWindowBackground( inWindow
,inBrush
, inUpdate
) ;
502 AGASetThemeWindowBackground( inWindow
, inBrush
, inUpdate
) ;
510 void UMAApplyThemeBackground (ThemeBackgroundKind inKind
,
512 ThemeDrawState inState
,
516 #if UMA_USE_APPEARANCE
517 if ( UMAHasAppearance() )
520 if ( sUMAAppearanceVersion >= 0x0110 )
521 ::ApplyThemeBackground( inKind ,bounds , inState , inDepth , inColorDev ) ;
528 AGAApplyThemeBackground( inKind
,bounds
, inState
, inDepth
, inColorDev
) ;
536 ControlHandle
UMANewControl(WindowPtr owningWindow
,
537 const Rect
* boundsRect
,
538 ConstStr255Param controlTitle
,
539 Boolean initiallyVisible
,
544 SInt32 controlReference
)
546 ControlHandle theControl
= NULL
;
547 #if UMA_USE_APPEARANCE
548 if ( UMAHasAppearance() )
550 theControl
= NewControl( owningWindow
, boundsRect
, controlTitle
, initiallyVisible
,
551 initialValue
, minimumValue
, maximumValue
, procID
, controlReference
) ;
557 theControl
= AGANewControl( owningWindow
, boundsRect
, controlTitle
, initiallyVisible
,
558 initialValue
, minimumValue
, maximumValue
, procID
, controlReference
) ;
567 void UMADisposeControl (ControlHandle theControl
)
569 if ( UMAHasAppearance() )
571 ::DisposeControl( theControl
) ;
575 ::DisposeControl( theControl
) ;
580 void UMAHiliteControl (ControlHandle theControl
,
581 ControlPartCode hiliteState
)
583 if ( UMAHasAppearance() )
585 ::HiliteControl( theControl
, hiliteState
) ;
589 ::HiliteControl( theControl
, hiliteState
) ;
594 void UMAShowControl (ControlHandle theControl
)
596 if ( UMAHasAppearance() )
598 ::ShowControl( theControl
) ;
602 ::ShowControl( theControl
) ;
607 void UMAHideControl (ControlHandle theControl
)
609 if ( UMAHasAppearance() )
611 ::HideControl( theControl
) ;
615 ::HideControl( theControl
) ;
620 void UMASetControlVisibility (ControlHandle inControl
,
624 if ( UMAHasAppearance() )
626 #if UMA_USE_APPEARANCE
627 ::SetControlVisibility( inControl
, inIsVisible
, inDoDraw
) ;
634 bool UMAIsControlActive (ControlHandle inControl
)
637 return IsControlActive( inControl
) ;
639 #if UMA_USE_APPEARANCE
640 if ( UMAHasAppearance() )
642 return IsControlActive( inControl
) ;
646 return (**inControl
).contrlHilite
== 0 ;
651 bool UMAIsControlVisible (ControlHandle inControl
)
653 #if UMA_USE_APPEARANCE
654 if ( UMAHasAppearance() )
656 return IsControlVisible( inControl
) ;
662 OSErr
UMAGetBestControlRect (ControlHandle inControl
,
664 SInt16
* outBaseLineOffset
)
666 #if UMA_USE_APPEARANCE
667 if ( UMAHasAppearance() )
669 return GetBestControlRect( inControl
, outRect
, outBaseLineOffset
) ;
675 return AGAGetBestControlRect( inControl
, outRect
, outBaseLineOffset
) ;
685 OSErr
UMASetControlFontStyle (ControlHandle inControl
,
686 const ControlFontStyleRec
* inStyle
)
688 #if UMA_USE_APPEARANCE
689 if ( UMAHasAppearance() )
691 return ::SetControlFontStyle( inControl
, inStyle
) ;
696 return AGASetControlFontStyle( inControl
, inStyle
) ;
708 OSErr
UMACreateRootControl (WindowPtr inWindow
,
709 ControlHandle
* outControl
)
711 #if UMA_USE_APPEARANCE
712 if ( UMAHasAppearance() )
714 return CreateRootControl( inWindow
, outControl
) ;
719 return AGACreateRootControl( inWindow
, outControl
) ;
729 OSErr
UMAEmbedControl (ControlHandle inControl
,
730 ControlHandle inContainer
)
732 #if UMA_USE_APPEARANCE
733 if ( UMAHasAppearance() )
735 return EmbedControl( inControl
, inContainer
) ;
740 return AGAEmbedControl( inControl
, inContainer
) ; ;
751 OSErr
UMASetKeyboardFocus (WindowPtr inWindow
,
752 ControlHandle inControl
,
753 ControlFocusPart inPart
)
759 SetPort( GetWindowPort( inWindow
) ) ;
761 SetPort( inWindow
) ;
764 #if UMA_USE_APPEARANCE
765 if ( UMAHasAppearance() )
767 err
= SetKeyboardFocus( inWindow
, inControl
, inPart
) ;
772 err
= AGASetKeyboardFocus( inWindow
, inControl
, inPart
) ;
786 ControlPartCode
UMAHandleControlClick (ControlHandle inControl
,
789 ControlActionUPP inAction
)
791 #if UMA_USE_APPEARANCE
792 if ( UMAHasAppearance() )
794 return HandleControlClick( inControl
, inWhere
, inModifiers
, inAction
) ;
800 return AGAHandleControlClick( inControl
, inWhere
, inModifiers
, inAction
) ;
810 SInt16
UMAHandleControlKey (ControlHandle inControl
,
815 #if UMA_USE_APPEARANCE
816 if ( UMAHasAppearance() )
818 return HandleControlKey( inControl
, inKeyCode
, inCharCode
, inModifiers
) ;
824 return AGAHandleControlKey(inControl
, inKeyCode
, inCharCode
, inModifiers
) ;
835 void UMAIdleControls (WindowPtr inWindow
)
837 #if UMA_USE_APPEARANCE
838 if ( UMAHasAppearance() )
840 IdleControls( inWindow
) ;
846 AGAIdleControls( inWindow
) ;
854 void UMAUpdateControls( WindowPtr inWindow
, RgnHandle inRgn
)
856 #if UMA_USE_APPEARANCE
857 if ( UMAHasAppearance() )
859 UpdateControls( inWindow
, inRgn
) ;
865 AGAUpdateControls( inWindow
, inRgn
) ;
873 OSErr
UMAGetRootControl( WindowPtr inWindow
, ControlHandle
*outControl
)
875 #if UMA_USE_APPEARANCE
876 if ( UMAHasAppearance() )
878 return GetRootControl( inWindow
, outControl
) ;
884 return AGAGetRootControl( inWindow
, outControl
) ;
894 // handling control data
896 OSErr
UMASetControlData (ControlHandle inControl
,
897 ControlPartCode inPart
,
902 #if UMA_USE_APPEARANCE
903 if ( UMAHasAppearance() )
905 return SetControlData( inControl
, inPart
, inTagName
, inSize
, inData
) ;
910 return AGASetControlData( inControl
, inPart
, inTagName
, inSize
, inData
) ;
920 OSErr
UMAGetControlData (ControlHandle inControl
,
921 ControlPartCode inPart
,
925 Size
* outActualSize
)
927 #if UMA_USE_APPEARANCE
928 if ( UMAHasAppearance() )
930 return ::GetControlData( inControl
, inPart
, inTagName
, inBufferSize
, outBuffer
, outActualSize
) ;
936 return AGAGetControlData( inControl
, inPart
, inTagName
, inBufferSize
, outBuffer
, outActualSize
) ;
946 OSErr
UMAGetControlDataSize (ControlHandle inControl
,
947 ControlPartCode inPart
,
951 #if UMA_USE_APPEARANCE
952 if ( UMAHasAppearance() )
954 return GetControlDataSize( inControl
, inPart
, inTagName
, outMaxSize
) ;
960 return AGAGetControlDataSize( inControl
, inPart
, inTagName
, outMaxSize
) ;
973 // system 8.0 changes
975 short UMAFindWindow( Point inPoint
, WindowRef
*outWindow
)
977 // todo add the additional area codes
978 return FindWindow( inPoint
, outWindow
) ;
981 OSStatus
UMAGetWindowFeatures( WindowRef inWindowRef
, UInt32
*outFeatures
)
983 #if UMA_USE_WINDOWMGR
984 return GetWindowFeatures( inWindowRef
, outFeatures
) ;
990 OSStatus
UMAGetWindowRegion( WindowRef inWindowRef
, WindowRegionCode inRegionCode
, RgnHandle ioWinRgn
)
992 #if UMA_USE_WINDOWMGR
993 return GetWindowRegion( inWindowRef
, inRegionCode
, ioWinRgn
) ;
999 void UMADrawGrowIcon( WindowRef inWindowRef
)
1001 DrawGrowIcon( inWindowRef
) ;
1004 OSStatus
UMACollapseWindow( WindowRef inWindowRef
, Boolean inCollapseIt
)
1006 return CollapseWindow( inWindowRef
, inCollapseIt
) ;
1009 OSStatus
UMACollapseAllWindows( Boolean inCollapseEm
)
1011 return CollapseAllWindows( inCollapseEm
) ;
1014 Boolean
UMAIsWindowCollapsed( WindowRef inWindowRef
)
1016 return IsWindowCollapsed( inWindowRef
) ;
1019 Boolean
UMAIsWindowCollapsable( WindowRef inWindowRef
)
1021 return IsWindowCollapsable( inWindowRef
) ;
1024 // system 8.5 changes<MacWindows.h>
1025 OSStatus
UMACreateNewWindow( WindowClass windowClass
, WindowAttributes attributes
, const Rect
*bounds
, WindowRef
*outWindow
)
1027 #if UMA_USE_WINDOWMGR
1028 if ( UMAHasWindowManager() )
1030 return CreateNewWindow( windowClass
, attributes
, bounds
, outWindow
) ;
1036 if ( UMAHasAppearance() )
1038 switch( windowClass
)
1040 case kMovableModalWindowClass
:
1041 procID
= kWindowMovableModalDialogProc
;
1043 case kModalWindowClass
:
1044 procID
= kWindowShadowDialogProc
;
1046 case kFloatingWindowClass
:
1047 if ( attributes
& kWindowSideTitlebarAttribute
)
1049 if( ( attributes
& kWindowResizableAttribute
) &&
1050 ( attributes
& kWindowFullZoomAttribute
) )
1052 procID
= kWindowFloatSideFullZoomGrowProc
;
1054 else if( attributes
& kWindowFullZoomAttribute
)
1056 procID
= kWindowFloatSideFullZoomProc
;
1058 else if ( attributes
& kWindowResizableAttribute
)
1060 procID
= kWindowFloatSideGrowProc
;
1064 procID
= kWindowFloatSideProc
;
1069 if( ( attributes
& kWindowResizableAttribute
) &&
1070 ( attributes
& kWindowFullZoomAttribute
) )
1072 procID
= kWindowFloatFullZoomGrowProc
;
1074 else if( attributes
& kWindowFullZoomAttribute
)
1076 procID
= kWindowFloatFullZoomProc
;
1078 else if ( attributes
& kWindowResizableAttribute
)
1080 procID
= kWindowFloatGrowProc
;
1084 procID
= kWindowFloatProc
;
1088 case kDocumentWindowClass
:
1090 if( ( attributes
& kWindowResizableAttribute
) &&
1091 ( attributes
& kWindowFullZoomAttribute
) )
1093 procID
= kWindowFullZoomGrowDocumentProc
;
1095 else if( attributes
& kWindowFullZoomAttribute
)
1097 procID
= kWindowFullZoomDocumentProc
;
1099 else if ( attributes
& kWindowResizableAttribute
)
1101 procID
= kWindowGrowDocumentProc
;
1105 procID
= kWindowDocumentProc
;
1112 switch( windowClass
)
1114 case kMovableModalWindowClass
:
1115 procID
= movableDBoxProc
;
1117 case kModalWindowClass
:
1118 procID
= altDBoxProc
;
1120 case kFloatingWindowClass
:
1121 if ( attributes
& kWindowSideTitlebarAttribute
)
1123 if( ( attributes
& kWindowResizableAttribute
) &&
1124 ( attributes
& kWindowFullZoomAttribute
) )
1126 procID
= floatSideZoomGrowProc
;
1128 else if( attributes
& kWindowFullZoomAttribute
)
1130 procID
= floatSideZoomProc
;
1132 else if ( attributes
& kWindowResizableAttribute
)
1134 procID
= floatSideGrowProc
;
1138 procID
= floatSideProc
;
1143 if( ( attributes
& kWindowResizableAttribute
) &&
1144 ( attributes
& kWindowFullZoomAttribute
) )
1146 procID
= floatZoomGrowProc
;
1148 else if( attributes
& kWindowFullZoomAttribute
)
1150 procID
= floatZoomProc
;
1152 else if ( attributes
& kWindowResizableAttribute
)
1154 procID
= floatGrowProc
;
1162 case kDocumentWindowClass
:
1164 if( ( attributes
& kWindowResizableAttribute
) &&
1165 ( attributes
& kWindowFullZoomAttribute
) )
1167 procID
= zoomDocProc
;
1169 else if( attributes
& kWindowFullZoomAttribute
)
1171 procID
= zoomNoGrow
;
1173 else if ( attributes
& kWindowResizableAttribute
)
1175 procID
= documentProc
;
1179 procID
= noGrowDocProc
;
1185 *outWindow
= NewCWindow(nil
, bounds
, "\p", false, procID
, (WindowRef
) -1 /*behind*/,
1186 attributes
& kWindowCloseBoxAttribute
, (long)NULL
);
1191 OSStatus
UMAGetWindowClass( WindowRef inWindowRef
, WindowClass
*outWindowClass
)
1193 #if UMA_USE_WINDOWMGR
1194 if ( UMAHasWindowManager() )
1196 return GetWindowClass( inWindowRef
, outWindowClass
) ;
1200 return kDocumentWindowClass
;
1203 OSStatus
UMAGetWindowAttributes( WindowRef inWindowRef
, WindowAttributes
*outAttributes
)
1205 #if UMA_USE_WINDOWMGR
1206 if ( UMAHasWindowManager() )
1208 return GetWindowAttributes( inWindowRef
, outAttributes
) ;
1211 return kWindowNoAttributes
;
1214 void UMAShowFloatingWindows()
1216 #if UMA_USE_WINDOWMGR
1217 if ( UMAHasWindowManager() )
1219 ShowFloatingWindows() ;
1224 void UMAHideFloatingWindows()
1226 #if UMA_USE_WINDOWMGR
1227 if ( UMAHasWindowManager() )
1229 HideFloatingWindows() ;
1234 Boolean
UMAAreFloatingWindowsVisible()
1236 #if UMA_USE_WINDOWMGR
1237 if ( UMAHasWindowManager() )
1239 return AreFloatingWindowsVisible() ;
1245 WindowRef
UMAFrontNonFloatingWindow()
1247 #if UMA_USE_WINDOWMGR
1248 if ( UMAHasWindowManager() )
1250 return FrontNonFloatingWindow() ;
1255 return FrontWindow() ;
1259 WindowRef
UMAFrontWindow()
1261 #if UMA_USE_WINDOWMGR
1262 if ( UMAHasWindowManager() )
1264 return FrontWindow() ;
1269 return FrontWindow() ;
1273 WindowRef
UMAGetActiveNonFloatingWindow()
1278 bool UMAIsWindowFloating( WindowRef inWindow
)
1282 UMAGetWindowClass( inWindow
, &cl
) ;
1283 return cl
== kFloatingWindowClass
;
1286 bool UMAIsWindowModal( WindowRef inWindow
)
1290 UMAGetWindowClass( inWindow
, &cl
) ;
1291 return cl
< kFloatingWindowClass
;
1296 void UMAHighlightAndActivateWindow( WindowRef inWindowRef
, bool inActivate
)
1300 // bool isHighlighted = IsWindowHighlited( inWindowRef ) ;
1301 // if ( inActivate != isHightlited )
1302 HiliteWindow( inWindowRef
, inActivate
) ;
1303 ControlHandle control
= NULL
;
1304 UMAGetRootControl( inWindowRef
, & control
) ;
1308 UMAActivateControl( control
) ;
1310 UMADeactivateControl( control
) ;
1314 OSStatus
UMADrawThemePlacard( const Rect
*inRect
, ThemeDrawState inState
)
1316 #if UMA_USE_APPEARANCE
1317 if ( UMAHasAppearance() )
1319 ::DrawThemePlacard( inRect
, inState
) ;