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
) ;
838 wxDC::MacInvalidateSetup() ;
847 ControlPartCode
UMAHandleControlClick (ControlHandle inControl
,
850 ControlActionUPP inAction
)
852 #if UMA_USE_APPEARANCE
853 if ( UMAHasAppearance() )
855 return HandleControlClick( inControl
, inWhere
, inModifiers
, inAction
) ;
861 return AGAHandleControlClick( inControl
, inWhere
, inModifiers
, inAction
) ;
871 SInt16
UMAHandleControlKey (ControlHandle inControl
,
876 #if UMA_USE_APPEARANCE
877 if ( UMAHasAppearance() )
879 return HandleControlKey( inControl
, inKeyCode
, inCharCode
, inModifiers
) ;
885 return AGAHandleControlKey(inControl
, inKeyCode
, inCharCode
, inModifiers
) ;
896 void UMAIdleControls (WindowPtr inWindow
)
898 #if UMA_USE_APPEARANCE
899 if ( UMAHasAppearance() )
901 IdleControls( inWindow
) ;
907 AGAIdleControls( inWindow
) ;
915 void UMAUpdateControls( WindowPtr inWindow
, RgnHandle inRgn
)
917 #if UMA_USE_APPEARANCE
918 if ( UMAHasAppearance() )
920 UpdateControls( inWindow
, inRgn
) ;
926 AGAUpdateControls( inWindow
, inRgn
) ;
934 OSErr
UMAGetRootControl( WindowPtr inWindow
, ControlHandle
*outControl
)
936 #if UMA_USE_APPEARANCE
937 if ( UMAHasAppearance() )
939 return GetRootControl( inWindow
, outControl
) ;
945 return AGAGetRootControl( inWindow
, outControl
) ;
955 // handling control data
957 OSErr
UMASetControlData (ControlHandle inControl
,
958 ControlPartCode inPart
,
963 #if UMA_USE_APPEARANCE
964 if ( UMAHasAppearance() )
966 return SetControlData( inControl
, inPart
, inTagName
, inSize
, inData
) ;
971 return AGASetControlData( inControl
, inPart
, inTagName
, inSize
, inData
) ;
981 OSErr
UMAGetControlData (ControlHandle inControl
,
982 ControlPartCode inPart
,
986 Size
* outActualSize
)
988 #if UMA_USE_APPEARANCE
989 if ( UMAHasAppearance() )
991 return ::GetControlData( inControl
, inPart
, inTagName
, inBufferSize
, outBuffer
, outActualSize
) ;
997 return AGAGetControlData( inControl
, inPart
, inTagName
, inBufferSize
, outBuffer
, outActualSize
) ;
1007 OSErr
UMAGetControlDataSize (ControlHandle inControl
,
1008 ControlPartCode inPart
,
1012 #if UMA_USE_APPEARANCE
1013 if ( UMAHasAppearance() )
1015 return GetControlDataSize( inControl
, inPart
, inTagName
, outMaxSize
) ;
1021 return AGAGetControlDataSize( inControl
, inPart
, inTagName
, outMaxSize
) ;
1034 // system 8.0 changes
1036 short UMAFindWindow( Point inPoint
, WindowRef
*outWindow
)
1038 // todo add the additional area codes
1039 return FindWindow( inPoint
, outWindow
) ;
1042 OSStatus
UMAGetWindowFeatures( WindowRef inWindowRef
, UInt32
*outFeatures
)
1044 #if UMA_USE_WINDOWMGR
1045 return GetWindowFeatures( inWindowRef
, outFeatures
) ;
1051 OSStatus
UMAGetWindowRegion( WindowRef inWindowRef
, WindowRegionCode inRegionCode
, RgnHandle ioWinRgn
)
1053 #if UMA_USE_WINDOWMGR
1054 return GetWindowRegion( inWindowRef
, inRegionCode
, ioWinRgn
) ;
1060 void UMADrawGrowIcon( WindowRef inWindowRef
)
1062 DrawGrowIcon( inWindowRef
) ;
1065 OSStatus
UMACollapseWindow( WindowRef inWindowRef
, Boolean inCollapseIt
)
1067 return CollapseWindow( inWindowRef
, inCollapseIt
) ;
1070 OSStatus
UMACollapseAllWindows( Boolean inCollapseEm
)
1072 return CollapseAllWindows( inCollapseEm
) ;
1075 Boolean
UMAIsWindowCollapsed( WindowRef inWindowRef
)
1077 return IsWindowCollapsed( inWindowRef
) ;
1080 Boolean
UMAIsWindowCollapsable( WindowRef inWindowRef
)
1082 return IsWindowCollapsable( inWindowRef
) ;
1085 // system 8.5 changes<MacWindows.h>
1086 OSStatus
UMACreateNewWindow( WindowClass windowClass
, WindowAttributes attributes
, const Rect
*bounds
, WindowRef
*outWindow
)
1088 #if UMA_USE_WINDOWMGR
1089 if ( UMAHasWindowManager() )
1091 return CreateNewWindow( windowClass
, attributes
, bounds
, outWindow
) ;
1097 if ( UMAHasAppearance() )
1099 switch( windowClass
)
1101 case kMovableModalWindowClass
:
1102 procID
= kWindowMovableModalDialogProc
;
1104 case kModalWindowClass
:
1105 procID
= kWindowShadowDialogProc
;
1107 case kFloatingWindowClass
:
1108 if ( attributes
& kWindowSideTitlebarAttribute
)
1110 if( ( attributes
& kWindowResizableAttribute
) &&
1111 ( attributes
& kWindowFullZoomAttribute
) )
1113 procID
= kWindowFloatSideFullZoomGrowProc
;
1115 else if( attributes
& kWindowFullZoomAttribute
)
1117 procID
= kWindowFloatSideFullZoomProc
;
1119 else if ( attributes
& kWindowResizableAttribute
)
1121 procID
= kWindowFloatSideGrowProc
;
1125 procID
= kWindowFloatSideProc
;
1130 if( ( attributes
& kWindowResizableAttribute
) &&
1131 ( attributes
& kWindowFullZoomAttribute
) )
1133 procID
= kWindowFloatFullZoomGrowProc
;
1135 else if( attributes
& kWindowFullZoomAttribute
)
1137 procID
= kWindowFloatFullZoomProc
;
1139 else if ( attributes
& kWindowResizableAttribute
)
1141 procID
= kWindowFloatGrowProc
;
1145 procID
= kWindowFloatProc
;
1149 case kDocumentWindowClass
:
1151 if( ( attributes
& kWindowResizableAttribute
) &&
1152 ( attributes
& kWindowFullZoomAttribute
) )
1154 procID
= kWindowFullZoomGrowDocumentProc
;
1156 else if( attributes
& kWindowFullZoomAttribute
)
1158 procID
= kWindowFullZoomDocumentProc
;
1160 else if ( attributes
& kWindowResizableAttribute
)
1162 procID
= kWindowGrowDocumentProc
;
1166 procID
= kWindowDocumentProc
;
1173 switch( windowClass
)
1175 case kMovableModalWindowClass
:
1176 procID
= movableDBoxProc
;
1178 case kModalWindowClass
:
1179 procID
= altDBoxProc
;
1181 case kFloatingWindowClass
:
1182 if ( attributes
& kWindowSideTitlebarAttribute
)
1184 if( ( attributes
& kWindowResizableAttribute
) &&
1185 ( attributes
& kWindowFullZoomAttribute
) )
1187 procID
= floatSideZoomGrowProc
;
1189 else if( attributes
& kWindowFullZoomAttribute
)
1191 procID
= floatSideZoomProc
;
1193 else if ( attributes
& kWindowResizableAttribute
)
1195 procID
= floatSideGrowProc
;
1199 procID
= floatSideProc
;
1204 if( ( attributes
& kWindowResizableAttribute
) &&
1205 ( attributes
& kWindowFullZoomAttribute
) )
1207 procID
= floatZoomGrowProc
;
1209 else if( attributes
& kWindowFullZoomAttribute
)
1211 procID
= floatZoomProc
;
1213 else if ( attributes
& kWindowResizableAttribute
)
1215 procID
= floatGrowProc
;
1223 case kDocumentWindowClass
:
1225 if( ( attributes
& kWindowResizableAttribute
) &&
1226 ( attributes
& kWindowFullZoomAttribute
) )
1228 procID
= zoomDocProc
;
1230 else if( attributes
& kWindowFullZoomAttribute
)
1232 procID
= zoomNoGrow
;
1234 else if ( attributes
& kWindowResizableAttribute
)
1236 procID
= documentProc
;
1240 procID
= noGrowDocProc
;
1246 *outWindow
= NewCWindow(nil
, bounds
, "\p", false, procID
, (WindowRef
) -1 /*behind*/,
1247 attributes
& kWindowCloseBoxAttribute
, (long)NULL
);
1252 OSStatus
UMAGetWindowClass( WindowRef inWindowRef
, WindowClass
*outWindowClass
)
1254 #if UMA_USE_WINDOWMGR
1255 if ( UMAHasWindowManager() )
1257 return GetWindowClass( inWindowRef
, outWindowClass
) ;
1261 return kDocumentWindowClass
;
1264 OSStatus
UMAGetWindowAttributes( WindowRef inWindowRef
, WindowAttributes
*outAttributes
)
1266 #if UMA_USE_WINDOWMGR
1267 if ( UMAHasWindowManager() )
1269 return GetWindowAttributes( inWindowRef
, outAttributes
) ;
1272 return kWindowNoAttributes
;
1275 void UMAShowFloatingWindows()
1277 #if UMA_USE_WINDOWMGR
1278 if ( UMAHasWindowManager() )
1280 ShowFloatingWindows() ;
1285 void UMAHideFloatingWindows()
1287 #if UMA_USE_WINDOWMGR
1288 if ( UMAHasWindowManager() )
1290 HideFloatingWindows() ;
1295 Boolean
UMAAreFloatingWindowsVisible()
1297 #if UMA_USE_WINDOWMGR
1298 if ( UMAHasWindowManager() )
1300 return AreFloatingWindowsVisible() ;
1306 WindowRef
UMAFrontNonFloatingWindow()
1308 #if UMA_USE_WINDOWMGR
1309 if ( UMAHasWindowManager() )
1311 return FrontNonFloatingWindow() ;
1316 return FrontWindow() ;
1320 WindowRef
UMAFrontWindow()
1322 #if UMA_USE_WINDOWMGR
1323 if ( UMAHasWindowManager() )
1325 return FrontWindow() ;
1330 return FrontWindow() ;
1334 WindowRef
UMAGetActiveNonFloatingWindow()
1339 bool UMAIsWindowFloating( WindowRef inWindow
)
1343 UMAGetWindowClass( inWindow
, &cl
) ;
1344 return cl
== kFloatingWindowClass
;
1347 bool UMAIsWindowModal( WindowRef inWindow
)
1351 UMAGetWindowClass( inWindow
, &cl
) ;
1352 return cl
< kFloatingWindowClass
;
1357 void UMAHighlightAndActivateWindow( WindowRef inWindowRef
, bool inActivate
)
1361 // bool isHighlighted = IsWindowHighlited( inWindowRef ) ;
1362 // if ( inActivate != isHightlited )
1366 SetPort( GetWindowPort( inWindowRef
) ) ;
1368 SetPort( inWindowRef
) ;
1370 SetOrigin( 0 , 0 ) ;
1371 HiliteWindow( inWindowRef
, inActivate
) ;
1372 ControlHandle control
= NULL
;
1373 UMAGetRootControl( inWindowRef
, & control
) ;
1377 UMAActivateControl( control
) ;
1379 UMADeactivateControl( control
) ;
1382 wxDC::MacInvalidateSetup() ;
1385 OSStatus
UMADrawThemePlacard( const Rect
*inRect
, ThemeDrawState inState
)
1387 #if UMA_USE_APPEARANCE
1388 if ( UMAHasAppearance() )
1390 ::DrawThemePlacard( inRect
, inState
) ;