3 #include "wx/mac/uma.h"
4 #include "wx/mac/aga.h"
7 #include <Carbon/Carbon.h>
9 #include <Navigation.h>
14 static bool sUMAHasAppearance
= false ;
15 static long sUMAAppearanceVersion
= 0 ;
16 extern int gAGABackgroundColor
;
17 bool UMAHasAppearance() { return sUMAHasAppearance
; }
18 long UMAGetAppearanceVersion() { return sUMAAppearanceVersion
; }
20 static bool sUMAHasWindowManager
= false ;
21 static long sUMAWindowManagerAttr
= 0 ;
23 bool UMAHasWindowManager() { return sUMAHasWindowManager
; }
24 long UMAGetWindowManagerAttr() { return sUMAWindowManagerAttr
; }
25 void UMACleanupToolbox()
27 #if UMA_USE_APPEARANCE
28 if ( sUMAHasAppearance
)
30 UnregisterAppearanceClient() ;
33 if ( NavServicesAvailable() )
38 void UMAInitToolbox( UInt16 inMoreMastersCalls
)
42 for (long i
= 1; i
<= inMoreMastersCalls
; i
++)
45 ::InitGraf(&qd
.thePort
);
50 ::FlushEvents(everyEvent
, 0);
53 PurgeSpace(&total
, &contig
);
58 #if UMA_USE_APPEARANCE
60 if ( Gestalt( gestaltAppearanceAttr
, &theAppearance
) == noErr
)
62 sUMAHasAppearance
= true ;
63 RegisterAppearanceClient();
64 if ( Gestalt( gestaltAppearanceVersion
, &theAppearance
) == noErr
)
66 sUMAAppearanceVersion
= theAppearance
;
70 sUMAAppearanceVersion
= 0x0100 ;
73 #endif // UMA_USE_APPEARANCE
76 if ( Gestalt( gestaltWindowMgrAttr
, &sUMAWindowManagerAttr
) == noErr
)
78 sUMAHasWindowManager
= sUMAWindowManagerAttr
& gestaltWindowMgrPresent
;
80 #endif // UMA_USE_WINDOWMGR
85 // Call currently implicitely done : InitFloatingWindows() ;
87 if ( sUMAHasWindowManager
)
88 InitFloatingWindows() ;
94 if ( NavServicesAvailable() )
101 long UMAGetProcessMode()
104 ProcessInfoRec processinfo
;
105 ProcessSerialNumber procno
;
107 procno
.highLongOfPSN
= NULL
;
108 procno
.lowLongOfPSN
= kCurrentProcess
;
109 processinfo
.processInfoLength
= sizeof(ProcessInfoRec
);
110 processinfo
.processName
= NULL
;
111 processinfo
.processAppSpec
= NULL
;
113 err
= ::GetProcessInformation( &procno
, &processinfo
) ;
114 wxASSERT( err
== noErr
) ;
115 return processinfo
.processMode
;
118 bool UMAGetProcessModeDoesActivateOnFGSwitch()
120 return UMAGetProcessMode() & modeDoesActivateOnFGSwitch
;
125 void UMASetMenuTitle( MenuRef menu
, StringPtr title
)
128 long size
= GetHandleSize( (Handle
) menu
) ;
129 const long headersize
= 14 ;
130 int oldlen
= (**menu
).menuData
[0] + 1;
131 int newlen
= title
[0] + 1 ;
133 if ( oldlen
< newlen
)
135 // enlarge before adjusting
136 SetHandleSize( (Handle
) menu
, size
+ (newlen
- oldlen
) );
139 if ( oldlen
!= newlen
)
140 memmove( (char*) (**menu
).menuData
+ newlen
, (char*) (**menu
).menuData
+ oldlen
, size
- headersize
- oldlen
) ;
142 memcpy( (char*) (**menu
).menuData
, title
, newlen
) ;
143 if ( oldlen
> newlen
)
146 SetHandleSize( (Handle
) menu
, size
+ (newlen
- oldlen
) ) ;
149 SetMenuTitle( menu
, title
) ;
153 UInt32
UMAMenuEvent( EventRecord
*inEvent
)
155 #if UMA_USE_APPEARANCE
156 if ( UMAHasAppearance() )
158 return MenuEvent( inEvent
) ;
163 if ( inEvent
->what
== keyDown
&& inEvent
->modifiers
& cmdKey
)
165 return MenuKey( inEvent
->message
& charCodeMask
) ;
171 void UMAEnableMenuItem( MenuRef inMenu
, MenuItemIndex inItem
)
173 #if UMA_USE_8_6 || TARGET_CARBON
174 EnableMenuItem( inMenu
, inItem
) ;
176 EnableItem( inMenu
, inItem
) ;
180 void UMADisableMenuItem( MenuRef inMenu
, MenuItemIndex inItem
)
182 #if UMA_USE_8_6 || TARGET_CARBON
183 DisableMenuItem( inMenu
, inItem
) ;
185 DisableItem( inMenu
, inItem
) ;
189 void UMAAppendSubMenuItem( MenuRef menu
, StringPtr l
, SInt16 id
)
192 memcpy( label
, l
, l
[0]+1 ) ;
193 // hardcoded adding of the submenu combination for mac
195 int theEnd
= label
[0] + 1;
197 theEnd
= 251; // mac allows only 255 characters
198 label
[theEnd
++] = '/';
199 label
[theEnd
++] = hMenuCmd
;
200 label
[theEnd
++] = '!';
201 label
[theEnd
++] = id
;
202 label
[theEnd
] = 0x00;
204 MacAppendMenu(menu
, label
);
207 void UMAInsertSubMenuItem( MenuRef menu
, StringPtr l
, MenuItemIndex item
, SInt16 id
)
210 memcpy( label
, l
, l
[0]+1 ) ;
211 // hardcoded adding of the submenu combination for mac
213 int theEnd
= label
[0] + 1;
215 theEnd
= 251; // mac allows only 255 characters
216 label
[theEnd
++] = '/';
217 label
[theEnd
++] = hMenuCmd
;
218 label
[theEnd
++] = '!';
219 label
[theEnd
++] = id
;
220 label
[theEnd
] = 0x00;
222 MacInsertMenuItem(menu
, label
, item
);
225 void UMAAppendMenuItem( MenuRef menu
, StringPtr l
, SInt16 key
, UInt8 modifiers
)
228 memcpy( label
, l
, l
[0]+1 ) ;
233 label
[++pos
] = toupper( key
);
236 MacAppendMenu( menu
, label
) ;
239 void UMAInsertMenuItem( MenuRef menu
, StringPtr l
, MenuItemIndex item
, SInt16 key
, UInt8 modifiers
)
242 memcpy( label
, l
, l
[0]+1 ) ;
247 label
[++pos
] = toupper( key
);
250 MacInsertMenuItem( menu
, label
, item
) ;
253 void UMADrawMenuBar()
259 void UMASetMenuItemText( MenuRef menu
, MenuItemIndex item
, StringPtr label
)
261 ::SetMenuItemText( menu
, item
, label
) ;
264 MenuRef
UMANewMenu( SInt16 menuid
, StringPtr label
)
266 return ::NewMenu(menuid
, label
);
269 void UMADisposeMenu( MenuRef menu
)
271 DisposeMenu( menu
) ;
273 void UMADeleteMenu( SInt16 menuId
)
275 ::DeleteMenu( menuId
) ;
278 void UMAInsertMenu( MenuRef insertMenu
, SInt16 afterId
)
280 ::InsertMenu( insertMenu
, afterId
) ;
286 int gPrOpenCounter
= 0 ;
293 if ( gPrOpenCounter
== 1 )
297 wxASSERT( err
== noErr
) ;
301 OSStatus err
= noErr
;
303 if ( gPrOpenCounter
== 1 )
306 wxASSERT( err
== noErr
) ;
312 OSStatus
UMAPrClose()
316 wxASSERT( gPrOpenCounter
>= 1 ) ;
317 if ( gPrOpenCounter
== 1 )
321 wxASSERT( err
== noErr
) ;
326 OSStatus err
= noErr
;
327 wxASSERT( gPrOpenCounter
>= 1 ) ;
328 if ( gPrOpenCounter
== 1 )
339 pascal QDGlobalsPtr
GetQDGlobalsPtr (void)
341 return QDGlobalsPtr (* (Ptr
*) LMGetCurrentA5 ( ) - 0xCA);
346 void UMAShowWatchCursor()
350 CursHandle watchFob
= GetCursor (watchCursor
);
357 Cursor preservedArrow
;
358 GetQDGlobalsArrow (&preservedArrow
);
359 SetQDGlobalsArrow (*watchFob
);
361 SetQDGlobalsArrow (&preservedArrow
);
363 SetCursor (*watchFob
);
368 void UMAShowArrowCursor()
372 SetCursor (GetQDGlobalsArrow (&arrow
));
374 SetCursor (&(qd
.arrow
));
380 GrafPtr
UMAGetWindowPort( WindowRef inWindowRef
)
382 wxASSERT( inWindowRef
!= NULL
) ;
384 return GetWindowPort( inWindowRef
) ;
386 return (GrafPtr
) inWindowRef
;
390 void UMADisposeWindow( WindowRef inWindowRef
)
392 wxASSERT( inWindowRef
!= NULL
) ;
393 DisposeWindow( inWindowRef
) ;
396 void UMASetWTitleC( WindowRef inWindowRef
, const char *title
)
399 strncpy( (char*)ptitle
, title
, 96 ) ;
402 c2pstrcpy( ptitle
, (char *)ptitle
) ;
404 c2pstr( (char*)ptitle
) ;
406 SetWTitle( inWindowRef
, ptitle
) ;
409 void UMAGetWTitleC( WindowRef inWindowRef
, char *title
)
411 GetWTitle( inWindowRef
, (unsigned char*)title
) ;
413 p2cstrcpy( title
, (unsigned char *)title
) ;
415 p2cstr( (unsigned char*)title
) ;
419 void UMAShowWindow( WindowRef inWindowRef
)
421 ShowWindow( inWindowRef
) ;
424 void UMAHideWindow( WindowRef inWindowRef
)
426 HideWindow( inWindowRef
) ;
429 void UMASelectWindow( WindowRef inWindowRef
)
431 SelectWindow( inWindowRef
) ;
434 void UMABringToFront( WindowRef inWindowRef
)
436 BringToFront( inWindowRef
) ;
439 void UMASendBehind( WindowRef inWindowRef
, WindowRef behindWindow
)
441 SendBehind( inWindowRef
, behindWindow
) ;
444 void UMACloseWindow(WindowRef inWindowRef
)
448 CloseWindow( inWindowRef
) ;
452 // appearance additions
454 void UMAActivateControl( ControlHandle inControl
)
456 #if UMA_USE_APPEARANCE
457 if ( UMAHasAppearance() )
459 ::ActivateControl( inControl
) ;
465 AGAActivateControl( inControl
) ;
473 void UMADrawControl( ControlHandle inControl
)
475 #if UMA_USE_APPEARANCE
476 if ( UMAHasAppearance() )
478 ::DrawControlInCurrentPort( inControl
) ;
484 AGADrawControl( inControl
) ;
492 void UMAMoveControl( ControlHandle inControl
, short x
, short y
)
494 #if UMA_USE_APPEARANCE
495 if ( UMAHasAppearance() )
497 ::MoveControl( inControl
, x
, y
) ;
503 AGAMoveControl( inControl
, x
,y
) ;
511 void UMASizeControl( ControlHandle inControl
, short x
, short y
)
513 #if UMA_USE_APPEARANCE
514 if ( UMAHasAppearance() )
516 ::SizeControl( inControl
, x
, y
) ;
522 AGASizeControl( inControl
, x
,y
) ;
530 void UMADeactivateControl( ControlHandle inControl
)
532 #if UMA_USE_APPEARANCE
533 if ( UMAHasAppearance() )
535 ::DeactivateControl( inControl
) ;
541 AGADeactivateControl( inControl
) ;
549 void UMASetThemeWindowBackground (WindowRef inWindow
,
553 #if UMA_USE_APPEARANCE
554 if ( UMAHasAppearance() )
556 ::SetThemeWindowBackground( inWindow
,inBrush
, inUpdate
) ;
562 AGASetThemeWindowBackground( inWindow
, inBrush
, inUpdate
) ;
570 void UMAApplyThemeBackground (ThemeBackgroundKind inKind
,
572 ThemeDrawState inState
,
576 #if UMA_USE_APPEARANCE
577 if ( UMAHasAppearance() )
580 if ( sUMAAppearanceVersion >= 0x0110 )
581 ::ApplyThemeBackground( inKind ,bounds , inState , inDepth , inColorDev ) ;
588 AGAApplyThemeBackground( inKind
,bounds
, inState
, inDepth
, inColorDev
) ;
596 ControlHandle
UMANewControl(WindowPtr owningWindow
,
597 const Rect
* boundsRect
,
598 ConstStr255Param controlTitle
,
599 Boolean initiallyVisible
,
604 SInt32 controlReference
)
606 ControlHandle theControl
= NULL
;
607 #if UMA_USE_APPEARANCE
608 if ( UMAHasAppearance() )
610 theControl
= NewControl( owningWindow
, boundsRect
, controlTitle
, initiallyVisible
,
611 initialValue
, minimumValue
, maximumValue
, procID
, controlReference
) ;
617 theControl
= AGANewControl( owningWindow
, boundsRect
, controlTitle
, initiallyVisible
,
618 initialValue
, minimumValue
, maximumValue
, procID
, controlReference
) ;
627 void UMADisposeControl (ControlHandle theControl
)
629 if ( UMAHasAppearance() )
631 ::DisposeControl( theControl
) ;
635 ::DisposeControl( theControl
) ;
640 void UMAHiliteControl (ControlHandle theControl
,
641 ControlPartCode hiliteState
)
643 if ( UMAHasAppearance() )
645 ::HiliteControl( theControl
, hiliteState
) ;
649 ::HiliteControl( theControl
, hiliteState
) ;
654 void UMAShowControl (ControlHandle theControl
)
656 if ( UMAHasAppearance() )
658 ::ShowControl( theControl
) ;
662 ::ShowControl( theControl
) ;
667 void UMAHideControl (ControlHandle theControl
)
669 if ( UMAHasAppearance() )
671 ::HideControl( theControl
) ;
675 ::HideControl( theControl
) ;
680 void UMASetControlVisibility (ControlHandle inControl
,
684 if ( UMAHasAppearance() )
686 #if UMA_USE_APPEARANCE
687 ::SetControlVisibility( inControl
, inIsVisible
, inDoDraw
) ;
694 bool UMAIsControlActive (ControlHandle inControl
)
697 return IsControlActive( inControl
) ;
699 #if UMA_USE_APPEARANCE
700 if ( UMAHasAppearance() )
702 return IsControlActive( inControl
) ;
706 return (**inControl
).contrlHilite
== 0 ;
711 bool UMAIsControlVisible (ControlHandle inControl
)
713 #if UMA_USE_APPEARANCE
714 if ( UMAHasAppearance() )
716 return IsControlVisible( inControl
) ;
722 OSErr
UMAGetBestControlRect (ControlHandle inControl
,
724 SInt16
* outBaseLineOffset
)
726 #if UMA_USE_APPEARANCE
727 if ( UMAHasAppearance() )
729 return GetBestControlRect( inControl
, outRect
, outBaseLineOffset
) ;
735 return AGAGetBestControlRect( inControl
, outRect
, outBaseLineOffset
) ;
745 OSErr
UMASetControlFontStyle (ControlHandle inControl
,
746 const ControlFontStyleRec
* inStyle
)
748 #if UMA_USE_APPEARANCE
749 if ( UMAHasAppearance() )
751 return ::SetControlFontStyle( inControl
, inStyle
) ;
756 return AGASetControlFontStyle( inControl
, inStyle
) ;
768 OSErr
UMACreateRootControl (WindowPtr inWindow
,
769 ControlHandle
* outControl
)
771 #if UMA_USE_APPEARANCE
772 if ( UMAHasAppearance() )
774 return CreateRootControl( inWindow
, outControl
) ;
779 return AGACreateRootControl( inWindow
, outControl
) ;
789 OSErr
UMAEmbedControl (ControlHandle inControl
,
790 ControlHandle inContainer
)
792 #if UMA_USE_APPEARANCE
793 if ( UMAHasAppearance() )
795 return EmbedControl( inControl
, inContainer
) ;
800 return AGAEmbedControl( inControl
, inContainer
) ; ;
811 OSErr
UMASetKeyboardFocus (WindowPtr inWindow
,
812 ControlHandle inControl
,
813 ControlFocusPart inPart
)
819 SetPort( GetWindowPort( inWindow
) ) ;
821 SetPort( inWindow
) ;
824 #if UMA_USE_APPEARANCE
825 if ( UMAHasAppearance() )
827 err
= SetKeyboardFocus( inWindow
, inControl
, inPart
) ;
832 err
= AGASetKeyboardFocus( inWindow
, inControl
, inPart
) ;
846 ControlPartCode
UMAHandleControlClick (ControlHandle inControl
,
849 ControlActionUPP inAction
)
851 #if UMA_USE_APPEARANCE
852 if ( UMAHasAppearance() )
854 return HandleControlClick( inControl
, inWhere
, inModifiers
, inAction
) ;
860 return AGAHandleControlClick( inControl
, inWhere
, inModifiers
, inAction
) ;
870 SInt16
UMAHandleControlKey (ControlHandle inControl
,
875 #if UMA_USE_APPEARANCE
876 if ( UMAHasAppearance() )
878 return HandleControlKey( inControl
, inKeyCode
, inCharCode
, inModifiers
) ;
884 return AGAHandleControlKey(inControl
, inKeyCode
, inCharCode
, inModifiers
) ;
895 void UMAIdleControls (WindowPtr inWindow
)
897 #if UMA_USE_APPEARANCE
898 if ( UMAHasAppearance() )
900 IdleControls( inWindow
) ;
906 AGAIdleControls( inWindow
) ;
914 void UMAUpdateControls( WindowPtr inWindow
, RgnHandle inRgn
)
916 #if UMA_USE_APPEARANCE
917 if ( UMAHasAppearance() )
919 UpdateControls( inWindow
, inRgn
) ;
925 AGAUpdateControls( inWindow
, inRgn
) ;
933 OSErr
UMAGetRootControl( WindowPtr inWindow
, ControlHandle
*outControl
)
935 #if UMA_USE_APPEARANCE
936 if ( UMAHasAppearance() )
938 return GetRootControl( inWindow
, outControl
) ;
944 return AGAGetRootControl( inWindow
, outControl
) ;
954 // handling control data
956 OSErr
UMASetControlData (ControlHandle inControl
,
957 ControlPartCode inPart
,
962 #if UMA_USE_APPEARANCE
963 if ( UMAHasAppearance() )
965 return SetControlData( inControl
, inPart
, inTagName
, inSize
, inData
) ;
970 return AGASetControlData( inControl
, inPart
, inTagName
, inSize
, inData
) ;
980 OSErr
UMAGetControlData (ControlHandle inControl
,
981 ControlPartCode inPart
,
985 Size
* outActualSize
)
987 #if UMA_USE_APPEARANCE
988 if ( UMAHasAppearance() )
990 return ::GetControlData( inControl
, inPart
, inTagName
, inBufferSize
, outBuffer
, outActualSize
) ;
996 return AGAGetControlData( inControl
, inPart
, inTagName
, inBufferSize
, outBuffer
, outActualSize
) ;
1006 OSErr
UMAGetControlDataSize (ControlHandle inControl
,
1007 ControlPartCode inPart
,
1011 #if UMA_USE_APPEARANCE
1012 if ( UMAHasAppearance() )
1014 return GetControlDataSize( inControl
, inPart
, inTagName
, outMaxSize
) ;
1020 return AGAGetControlDataSize( inControl
, inPart
, inTagName
, outMaxSize
) ;
1033 // system 8.0 changes
1035 short UMAFindWindow( Point inPoint
, WindowRef
*outWindow
)
1037 // todo add the additional area codes
1038 return FindWindow( inPoint
, outWindow
) ;
1041 OSStatus
UMAGetWindowFeatures( WindowRef inWindowRef
, UInt32
*outFeatures
)
1043 #if UMA_USE_WINDOWMGR
1044 return GetWindowFeatures( inWindowRef
, outFeatures
) ;
1050 OSStatus
UMAGetWindowRegion( WindowRef inWindowRef
, WindowRegionCode inRegionCode
, RgnHandle ioWinRgn
)
1052 #if UMA_USE_WINDOWMGR
1053 return GetWindowRegion( inWindowRef
, inRegionCode
, ioWinRgn
) ;
1059 void UMADrawGrowIcon( WindowRef inWindowRef
)
1061 DrawGrowIcon( inWindowRef
) ;
1064 OSStatus
UMACollapseWindow( WindowRef inWindowRef
, Boolean inCollapseIt
)
1066 return CollapseWindow( inWindowRef
, inCollapseIt
) ;
1069 OSStatus
UMACollapseAllWindows( Boolean inCollapseEm
)
1071 return CollapseAllWindows( inCollapseEm
) ;
1074 Boolean
UMAIsWindowCollapsed( WindowRef inWindowRef
)
1076 return IsWindowCollapsed( inWindowRef
) ;
1079 Boolean
UMAIsWindowCollapsable( WindowRef inWindowRef
)
1081 return IsWindowCollapsable( inWindowRef
) ;
1084 // system 8.5 changes<MacWindows.h>
1085 OSStatus
UMACreateNewWindow( WindowClass windowClass
, WindowAttributes attributes
, const Rect
*bounds
, WindowRef
*outWindow
)
1087 #if UMA_USE_WINDOWMGR
1088 if ( UMAHasWindowManager() )
1090 return CreateNewWindow( windowClass
, attributes
, bounds
, outWindow
) ;
1096 if ( UMAHasAppearance() )
1098 switch( windowClass
)
1100 case kMovableModalWindowClass
:
1101 procID
= kWindowMovableModalDialogProc
;
1103 case kModalWindowClass
:
1104 procID
= kWindowShadowDialogProc
;
1106 case kFloatingWindowClass
:
1107 if ( attributes
& kWindowSideTitlebarAttribute
)
1109 if( ( attributes
& kWindowResizableAttribute
) &&
1110 ( attributes
& kWindowFullZoomAttribute
) )
1112 procID
= kWindowFloatSideFullZoomGrowProc
;
1114 else if( attributes
& kWindowFullZoomAttribute
)
1116 procID
= kWindowFloatSideFullZoomProc
;
1118 else if ( attributes
& kWindowResizableAttribute
)
1120 procID
= kWindowFloatSideGrowProc
;
1124 procID
= kWindowFloatSideProc
;
1129 if( ( attributes
& kWindowResizableAttribute
) &&
1130 ( attributes
& kWindowFullZoomAttribute
) )
1132 procID
= kWindowFloatFullZoomGrowProc
;
1134 else if( attributes
& kWindowFullZoomAttribute
)
1136 procID
= kWindowFloatFullZoomProc
;
1138 else if ( attributes
& kWindowResizableAttribute
)
1140 procID
= kWindowFloatGrowProc
;
1144 procID
= kWindowFloatProc
;
1148 case kDocumentWindowClass
:
1150 if( ( attributes
& kWindowResizableAttribute
) &&
1151 ( attributes
& kWindowFullZoomAttribute
) )
1153 procID
= kWindowFullZoomGrowDocumentProc
;
1155 else if( attributes
& kWindowFullZoomAttribute
)
1157 procID
= kWindowFullZoomDocumentProc
;
1159 else if ( attributes
& kWindowResizableAttribute
)
1161 procID
= kWindowGrowDocumentProc
;
1165 procID
= kWindowDocumentProc
;
1172 switch( windowClass
)
1174 case kMovableModalWindowClass
:
1175 procID
= movableDBoxProc
;
1177 case kModalWindowClass
:
1178 procID
= altDBoxProc
;
1180 case kFloatingWindowClass
:
1181 if ( attributes
& kWindowSideTitlebarAttribute
)
1183 if( ( attributes
& kWindowResizableAttribute
) &&
1184 ( attributes
& kWindowFullZoomAttribute
) )
1186 procID
= floatSideZoomGrowProc
;
1188 else if( attributes
& kWindowFullZoomAttribute
)
1190 procID
= floatSideZoomProc
;
1192 else if ( attributes
& kWindowResizableAttribute
)
1194 procID
= floatSideGrowProc
;
1198 procID
= floatSideProc
;
1203 if( ( attributes
& kWindowResizableAttribute
) &&
1204 ( attributes
& kWindowFullZoomAttribute
) )
1206 procID
= floatZoomGrowProc
;
1208 else if( attributes
& kWindowFullZoomAttribute
)
1210 procID
= floatZoomProc
;
1212 else if ( attributes
& kWindowResizableAttribute
)
1214 procID
= floatGrowProc
;
1222 case kDocumentWindowClass
:
1224 if( ( attributes
& kWindowResizableAttribute
) &&
1225 ( attributes
& kWindowFullZoomAttribute
) )
1227 procID
= zoomDocProc
;
1229 else if( attributes
& kWindowFullZoomAttribute
)
1231 procID
= zoomNoGrow
;
1233 else if ( attributes
& kWindowResizableAttribute
)
1235 procID
= documentProc
;
1239 procID
= noGrowDocProc
;
1245 *outWindow
= NewCWindow(nil
, bounds
, "\p", false, procID
, (WindowRef
) -1 /*behind*/,
1246 attributes
& kWindowCloseBoxAttribute
, (long)NULL
);
1251 OSStatus
UMAGetWindowClass( WindowRef inWindowRef
, WindowClass
*outWindowClass
)
1253 #if UMA_USE_WINDOWMGR
1254 if ( UMAHasWindowManager() )
1256 return GetWindowClass( inWindowRef
, outWindowClass
) ;
1260 return kDocumentWindowClass
;
1263 OSStatus
UMAGetWindowAttributes( WindowRef inWindowRef
, WindowAttributes
*outAttributes
)
1265 #if UMA_USE_WINDOWMGR
1266 if ( UMAHasWindowManager() )
1268 return GetWindowAttributes( inWindowRef
, outAttributes
) ;
1271 return kWindowNoAttributes
;
1274 void UMAShowFloatingWindows()
1276 #if UMA_USE_WINDOWMGR
1277 if ( UMAHasWindowManager() )
1279 ShowFloatingWindows() ;
1284 void UMAHideFloatingWindows()
1286 #if UMA_USE_WINDOWMGR
1287 if ( UMAHasWindowManager() )
1289 HideFloatingWindows() ;
1294 Boolean
UMAAreFloatingWindowsVisible()
1296 #if UMA_USE_WINDOWMGR
1297 if ( UMAHasWindowManager() )
1299 return AreFloatingWindowsVisible() ;
1305 WindowRef
UMAFrontNonFloatingWindow()
1307 #if UMA_USE_WINDOWMGR
1308 if ( UMAHasWindowManager() )
1310 return FrontNonFloatingWindow() ;
1315 return FrontWindow() ;
1319 WindowRef
UMAFrontWindow()
1321 #if UMA_USE_WINDOWMGR
1322 if ( UMAHasWindowManager() )
1324 return FrontWindow() ;
1329 return FrontWindow() ;
1333 WindowRef
UMAGetActiveNonFloatingWindow()
1338 bool UMAIsWindowFloating( WindowRef inWindow
)
1342 UMAGetWindowClass( inWindow
, &cl
) ;
1343 return cl
== kFloatingWindowClass
;
1346 bool UMAIsWindowModal( WindowRef inWindow
)
1350 UMAGetWindowClass( inWindow
, &cl
) ;
1351 return cl
< kFloatingWindowClass
;
1356 void UMAHighlightAndActivateWindow( WindowRef inWindowRef
, bool inActivate
)
1360 // bool isHighlighted = IsWindowHighlited( inWindowRef ) ;
1361 // if ( inActivate != isHightlited )
1365 SetPort( GetWindowPort( inWindowRef
) ) ;
1367 SetPort( inWindowRef
) ;
1369 SetOrigin( 0 , 0 ) ;
1370 HiliteWindow( inWindowRef
, inActivate
) ;
1371 ControlHandle control
= NULL
;
1372 UMAGetRootControl( inWindowRef
, & control
) ;
1376 UMAActivateControl( control
) ;
1378 UMADeactivateControl( control
) ;
1383 OSStatus
UMADrawThemePlacard( const Rect
*inRect
, ThemeDrawState inState
)
1385 #if UMA_USE_APPEARANCE
1386 if ( UMAHasAppearance() )
1388 ::DrawThemePlacard( inRect
, inState
) ;