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
84 // Call currently implicitely done : InitFloatingWindows() ;
86 if ( sUMAHasWindowManager
)
87 InitFloatingWindows() ;
93 if ( NavServicesAvailable() )
100 long UMAGetProcessMode()
103 ProcessInfoRec processinfo
;
104 ProcessSerialNumber procno
;
106 procno
.highLongOfPSN
= NULL
;
107 procno
.lowLongOfPSN
= kCurrentProcess
;
108 processinfo
.processInfoLength
= sizeof(ProcessInfoRec
);
109 processinfo
.processName
= NULL
;
110 processinfo
.processAppSpec
= NULL
;
112 err
= ::GetProcessInformation( &procno
, &processinfo
) ;
113 wxASSERT( err
== noErr
) ;
114 return processinfo
.processMode
;
117 bool UMAGetProcessModeDoesActivateOnFGSwitch()
119 return UMAGetProcessMode() & modeDoesActivateOnFGSwitch
;
124 void UMASetMenuTitle( MenuRef menu
, StringPtr title
)
127 long size
= GetHandleSize( (Handle
) menu
) ;
128 const long headersize
= 14 ;
129 int oldlen
= (**menu
).menuData
[0] + 1;
130 int newlen
= title
[0] + 1 ;
132 if ( oldlen
< newlen
)
134 // enlarge before adjusting
135 SetHandleSize( (Handle
) menu
, size
+ (newlen
- oldlen
) );
138 if ( oldlen
!= newlen
)
139 memmove( (char*) (**menu
).menuData
+ newlen
, (char*) (**menu
).menuData
+ oldlen
, size
- headersize
- oldlen
) ;
141 memcpy( (char*) (**menu
).menuData
, title
, newlen
) ;
142 if ( oldlen
> newlen
)
145 SetHandleSize( (Handle
) menu
, size
+ (newlen
- oldlen
) ) ;
148 SetMenuTitle( menu
, title
) ;
152 UInt32
UMAMenuEvent( EventRecord
*inEvent
)
154 #if UMA_USE_APPEARANCE
155 if ( UMAHasAppearance() )
157 return MenuEvent( inEvent
) ;
162 if ( inEvent
->what
== keyDown
&& inEvent
->modifiers
& cmdKey
)
164 return MenuKey( inEvent
->message
& charCodeMask
) ;
170 void UMAEnableMenuItem( MenuRef inMenu
, MenuItemIndex inItem
)
172 #if UMA_USE_8_6 || TARGET_CARBON
173 EnableMenuItem( inMenu
, inItem
) ;
175 EnableItem( inMenu
, inItem
) ;
179 void UMADisableMenuItem( MenuRef inMenu
, MenuItemIndex inItem
)
181 #if UMA_USE_8_6 || TARGET_CARBON
182 DisableMenuItem( inMenu
, inItem
) ;
184 DisableItem( inMenu
, inItem
) ;
188 void UMAAppendSubMenuItem( MenuRef menu
, StringPtr l
, SInt16 id
)
191 memcpy( label
, l
, l
[0]+1 ) ;
192 // hardcoded adding of the submenu combination for mac
194 int theEnd
= label
[0] + 1;
196 theEnd
= 251; // mac allows only 255 characters
197 label
[theEnd
++] = '/';
198 label
[theEnd
++] = hMenuCmd
;
199 label
[theEnd
++] = '!';
200 label
[theEnd
++] = id
;
201 label
[theEnd
] = 0x00;
203 MacAppendMenu(menu
, label
);
206 void UMAInsertSubMenuItem( MenuRef menu
, StringPtr l
, MenuItemIndex item
, SInt16 id
)
209 memcpy( label
, l
, l
[0]+1 ) ;
210 // hardcoded adding of the submenu combination for mac
212 int theEnd
= label
[0] + 1;
214 theEnd
= 251; // mac allows only 255 characters
215 label
[theEnd
++] = '/';
216 label
[theEnd
++] = hMenuCmd
;
217 label
[theEnd
++] = '!';
218 label
[theEnd
++] = id
;
219 label
[theEnd
] = 0x00;
221 MacInsertMenuItem(menu
, label
, item
);
224 void UMAAppendMenuItem( MenuRef menu
, StringPtr l
, SInt16 key
, UInt8 modifiers
)
227 memcpy( label
, l
, l
[0]+1 ) ;
232 label
[++pos
] = toupper( key
);
235 MacAppendMenu( menu
, label
) ;
238 void UMAInsertMenuItem( MenuRef menu
, StringPtr l
, MenuItemIndex item
, SInt16 key
, UInt8 modifiers
)
241 memcpy( label
, l
, l
[0]+1 ) ;
246 label
[++pos
] = toupper( key
);
249 MacInsertMenuItem( menu
, label
, item
) ;
252 void UMADrawMenuBar()
258 void UMASetMenuItemText( MenuRef menu
, MenuItemIndex item
, StringPtr label
)
260 ::SetMenuItemText( menu
, item
, label
) ;
263 MenuRef
UMANewMenu( SInt16 menuid
, StringPtr label
)
265 return ::NewMenu(menuid
, label
);
268 void UMADisposeMenu( MenuRef menu
)
270 DisposeMenu( menu
) ;
272 void UMADeleteMenu( SInt16 menuId
)
274 ::DeleteMenu( menuId
) ;
277 void UMAInsertMenu( MenuRef insertMenu
, SInt16 afterId
)
279 ::InsertMenu( insertMenu
, afterId
) ;
285 int gPrOpenCounter
= 0 ;
292 if ( gPrOpenCounter
== 1 )
296 wxASSERT( err
== noErr
) ;
300 OSStatus err
= noErr
;
302 if ( gPrOpenCounter
== 1 )
305 wxASSERT( err
== noErr
) ;
311 OSStatus
UMAPrClose()
315 wxASSERT( gPrOpenCounter
>= 1 ) ;
316 if ( gPrOpenCounter
== 1 )
320 wxASSERT( err
== noErr
) ;
325 OSStatus err
= noErr
;
326 wxASSERT( gPrOpenCounter
>= 1 ) ;
327 if ( gPrOpenCounter
== 1 )
338 pascal QDGlobalsPtr
GetQDGlobalsPtr (void)
340 return QDGlobalsPtr (* (Ptr
*) LMGetCurrentA5 ( ) - 0xCA);
345 void UMAShowWatchCursor()
349 CursHandle watchFob
= GetCursor (watchCursor
);
356 Cursor preservedArrow
;
357 GetQDGlobalsArrow (&preservedArrow
);
358 SetQDGlobalsArrow (*watchFob
);
360 SetQDGlobalsArrow (&preservedArrow
);
362 SetCursor (*watchFob
);
367 void UMAShowArrowCursor()
371 SetCursor (GetQDGlobalsArrow (&arrow
));
373 SetCursor (&(qd
.arrow
));
379 GrafPtr
UMAGetWindowPort( WindowRef inWindowRef
)
381 wxASSERT( inWindowRef
!= NULL
) ;
383 return GetWindowPort( inWindowRef
) ;
385 return (GrafPtr
) inWindowRef
;
389 void UMADisposeWindow( WindowRef inWindowRef
)
391 wxASSERT( inWindowRef
!= NULL
) ;
392 DisposeWindow( inWindowRef
) ;
395 void UMASetWTitleC( WindowRef inWindowRef
, const char *title
)
398 strncpy( (char*)ptitle
, title
, 96 ) ;
401 c2pstrcpy( ptitle
, (char *)ptitle
) ;
403 c2pstr( (char*)ptitle
) ;
405 SetWTitle( inWindowRef
, ptitle
) ;
408 void UMAGetWTitleC( WindowRef inWindowRef
, char *title
)
410 GetWTitle( inWindowRef
, (unsigned char*)title
) ;
412 p2cstrcpy( title
, (unsigned char *)title
) ;
414 p2cstr( (unsigned char*)title
) ;
418 void UMAShowWindow( WindowRef inWindowRef
)
420 ShowWindow( inWindowRef
) ;
423 void UMAHideWindow( WindowRef inWindowRef
)
425 HideWindow( inWindowRef
) ;
428 void UMASelectWindow( WindowRef inWindowRef
)
430 SelectWindow( inWindowRef
) ;
433 void UMABringToFront( WindowRef inWindowRef
)
435 BringToFront( inWindowRef
) ;
438 void UMASendBehind( WindowRef inWindowRef
, WindowRef behindWindow
)
440 SendBehind( inWindowRef
, behindWindow
) ;
443 void UMACloseWindow(WindowRef inWindowRef
)
447 CloseWindow( inWindowRef
) ;
451 // appearance additions
453 void UMAActivateControl( ControlHandle inControl
)
455 #if UMA_USE_APPEARANCE
456 if ( UMAHasAppearance() )
458 ::ActivateControl( inControl
) ;
464 AGAActivateControl( inControl
) ;
472 void UMADrawControl( ControlHandle inControl
)
474 #if UMA_USE_APPEARANCE
475 if ( UMAHasAppearance() )
477 ::DrawControlInCurrentPort( inControl
) ;
483 AGADrawControl( inControl
) ;
491 void UMAMoveControl( ControlHandle inControl
, short x
, short y
)
493 #if UMA_USE_APPEARANCE
494 if ( UMAHasAppearance() )
496 ::MoveControl( inControl
, x
, y
) ;
502 AGAMoveControl( inControl
, x
,y
) ;
510 void UMASizeControl( ControlHandle inControl
, short x
, short y
)
512 #if UMA_USE_APPEARANCE
513 if ( UMAHasAppearance() )
515 ::SizeControl( inControl
, x
, y
) ;
521 AGASizeControl( inControl
, x
,y
) ;
529 void UMADeactivateControl( ControlHandle inControl
)
531 #if UMA_USE_APPEARANCE
532 if ( UMAHasAppearance() )
534 ::DeactivateControl( inControl
) ;
540 AGADeactivateControl( inControl
) ;
548 void UMASetThemeWindowBackground (WindowRef inWindow
,
552 #if UMA_USE_APPEARANCE
553 if ( UMAHasAppearance() )
555 ::SetThemeWindowBackground( inWindow
,inBrush
, inUpdate
) ;
561 AGASetThemeWindowBackground( inWindow
, inBrush
, inUpdate
) ;
569 void UMAApplyThemeBackground (ThemeBackgroundKind inKind
,
571 ThemeDrawState inState
,
575 #if UMA_USE_APPEARANCE
576 if ( UMAHasAppearance() )
579 if ( sUMAAppearanceVersion >= 0x0110 )
580 ::ApplyThemeBackground( inKind ,bounds , inState , inDepth , inColorDev ) ;
587 AGAApplyThemeBackground( inKind
,bounds
, inState
, inDepth
, inColorDev
) ;
595 ControlHandle
UMANewControl(WindowPtr owningWindow
,
596 const Rect
* boundsRect
,
597 ConstStr255Param controlTitle
,
598 Boolean initiallyVisible
,
603 SInt32 controlReference
)
605 ControlHandle theControl
= NULL
;
606 #if UMA_USE_APPEARANCE
607 if ( UMAHasAppearance() )
609 theControl
= NewControl( owningWindow
, boundsRect
, controlTitle
, initiallyVisible
,
610 initialValue
, minimumValue
, maximumValue
, procID
, controlReference
) ;
616 theControl
= AGANewControl( owningWindow
, boundsRect
, controlTitle
, initiallyVisible
,
617 initialValue
, minimumValue
, maximumValue
, procID
, controlReference
) ;
626 void UMADisposeControl (ControlHandle theControl
)
628 if ( UMAHasAppearance() )
630 ::DisposeControl( theControl
) ;
634 ::DisposeControl( theControl
) ;
639 void UMAHiliteControl (ControlHandle theControl
,
640 ControlPartCode hiliteState
)
642 if ( UMAHasAppearance() )
644 ::HiliteControl( theControl
, hiliteState
) ;
648 ::HiliteControl( theControl
, hiliteState
) ;
653 void UMAShowControl (ControlHandle theControl
)
655 if ( UMAHasAppearance() )
657 ::ShowControl( theControl
) ;
661 ::ShowControl( theControl
) ;
666 void UMAHideControl (ControlHandle theControl
)
668 if ( UMAHasAppearance() )
670 ::HideControl( theControl
) ;
674 ::HideControl( theControl
) ;
679 void UMASetControlVisibility (ControlHandle inControl
,
683 if ( UMAHasAppearance() )
685 #if UMA_USE_APPEARANCE
686 ::SetControlVisibility( inControl
, inIsVisible
, inDoDraw
) ;
693 bool UMAIsControlActive (ControlHandle inControl
)
696 return IsControlActive( inControl
) ;
698 #if UMA_USE_APPEARANCE
699 if ( UMAHasAppearance() )
701 return IsControlActive( inControl
) ;
705 return (**inControl
).contrlHilite
== 0 ;
710 bool UMAIsControlVisible (ControlHandle inControl
)
712 #if UMA_USE_APPEARANCE
713 if ( UMAHasAppearance() )
715 return IsControlVisible( inControl
) ;
721 OSErr
UMAGetBestControlRect (ControlHandle inControl
,
723 SInt16
* outBaseLineOffset
)
725 #if UMA_USE_APPEARANCE
726 if ( UMAHasAppearance() )
728 return GetBestControlRect( inControl
, outRect
, outBaseLineOffset
) ;
734 return AGAGetBestControlRect( inControl
, outRect
, outBaseLineOffset
) ;
744 OSErr
UMASetControlFontStyle (ControlHandle inControl
,
745 const ControlFontStyleRec
* inStyle
)
747 #if UMA_USE_APPEARANCE
748 if ( UMAHasAppearance() )
750 return ::SetControlFontStyle( inControl
, inStyle
) ;
755 return AGASetControlFontStyle( inControl
, inStyle
) ;
767 OSErr
UMACreateRootControl (WindowPtr inWindow
,
768 ControlHandle
* outControl
)
770 #if UMA_USE_APPEARANCE
771 if ( UMAHasAppearance() )
773 return CreateRootControl( inWindow
, outControl
) ;
778 return AGACreateRootControl( inWindow
, outControl
) ;
788 OSErr
UMAEmbedControl (ControlHandle inControl
,
789 ControlHandle inContainer
)
791 #if UMA_USE_APPEARANCE
792 if ( UMAHasAppearance() )
794 return EmbedControl( inControl
, inContainer
) ;
799 return AGAEmbedControl( inControl
, inContainer
) ; ;
810 OSErr
UMASetKeyboardFocus (WindowPtr inWindow
,
811 ControlHandle inControl
,
812 ControlFocusPart inPart
)
818 SetPort( GetWindowPort( inWindow
) ) ;
820 SetPort( inWindow
) ;
823 #if UMA_USE_APPEARANCE
824 if ( UMAHasAppearance() )
826 err
= SetKeyboardFocus( inWindow
, inControl
, inPart
) ;
831 err
= AGASetKeyboardFocus( inWindow
, inControl
, inPart
) ;
845 ControlPartCode
UMAHandleControlClick (ControlHandle inControl
,
848 ControlActionUPP inAction
)
850 #if UMA_USE_APPEARANCE
851 if ( UMAHasAppearance() )
853 return HandleControlClick( inControl
, inWhere
, inModifiers
, inAction
) ;
859 return AGAHandleControlClick( inControl
, inWhere
, inModifiers
, inAction
) ;
869 SInt16
UMAHandleControlKey (ControlHandle inControl
,
874 #if UMA_USE_APPEARANCE
875 if ( UMAHasAppearance() )
877 return HandleControlKey( inControl
, inKeyCode
, inCharCode
, inModifiers
) ;
883 return AGAHandleControlKey(inControl
, inKeyCode
, inCharCode
, inModifiers
) ;
894 void UMAIdleControls (WindowPtr inWindow
)
896 #if UMA_USE_APPEARANCE
897 if ( UMAHasAppearance() )
899 IdleControls( inWindow
) ;
905 AGAIdleControls( inWindow
) ;
913 void UMAUpdateControls( WindowPtr inWindow
, RgnHandle inRgn
)
915 #if UMA_USE_APPEARANCE
916 if ( UMAHasAppearance() )
918 UpdateControls( inWindow
, inRgn
) ;
924 AGAUpdateControls( inWindow
, inRgn
) ;
932 OSErr
UMAGetRootControl( WindowPtr inWindow
, ControlHandle
*outControl
)
934 #if UMA_USE_APPEARANCE
935 if ( UMAHasAppearance() )
937 return GetRootControl( inWindow
, outControl
) ;
943 return AGAGetRootControl( inWindow
, outControl
) ;
953 // handling control data
955 OSErr
UMASetControlData (ControlHandle inControl
,
956 ControlPartCode inPart
,
961 #if UMA_USE_APPEARANCE
962 if ( UMAHasAppearance() )
964 return SetControlData( inControl
, inPart
, inTagName
, inSize
, inData
) ;
969 return AGASetControlData( inControl
, inPart
, inTagName
, inSize
, inData
) ;
979 OSErr
UMAGetControlData (ControlHandle inControl
,
980 ControlPartCode inPart
,
984 Size
* outActualSize
)
986 #if UMA_USE_APPEARANCE
987 if ( UMAHasAppearance() )
989 return ::GetControlData( inControl
, inPart
, inTagName
, inBufferSize
, outBuffer
, outActualSize
) ;
995 return AGAGetControlData( inControl
, inPart
, inTagName
, inBufferSize
, outBuffer
, outActualSize
) ;
1005 OSErr
UMAGetControlDataSize (ControlHandle inControl
,
1006 ControlPartCode inPart
,
1010 #if UMA_USE_APPEARANCE
1011 if ( UMAHasAppearance() )
1013 return GetControlDataSize( inControl
, inPart
, inTagName
, outMaxSize
) ;
1019 return AGAGetControlDataSize( inControl
, inPart
, inTagName
, outMaxSize
) ;
1032 // system 8.0 changes
1034 short UMAFindWindow( Point inPoint
, WindowRef
*outWindow
)
1036 // todo add the additional area codes
1037 return FindWindow( inPoint
, outWindow
) ;
1040 OSStatus
UMAGetWindowFeatures( WindowRef inWindowRef
, UInt32
*outFeatures
)
1042 #if UMA_USE_WINDOWMGR
1043 return GetWindowFeatures( inWindowRef
, outFeatures
) ;
1049 OSStatus
UMAGetWindowRegion( WindowRef inWindowRef
, WindowRegionCode inRegionCode
, RgnHandle ioWinRgn
)
1051 #if UMA_USE_WINDOWMGR
1052 return GetWindowRegion( inWindowRef
, inRegionCode
, ioWinRgn
) ;
1058 void UMADrawGrowIcon( WindowRef inWindowRef
)
1060 DrawGrowIcon( inWindowRef
) ;
1063 OSStatus
UMACollapseWindow( WindowRef inWindowRef
, Boolean inCollapseIt
)
1065 return CollapseWindow( inWindowRef
, inCollapseIt
) ;
1068 OSStatus
UMACollapseAllWindows( Boolean inCollapseEm
)
1070 return CollapseAllWindows( inCollapseEm
) ;
1073 Boolean
UMAIsWindowCollapsed( WindowRef inWindowRef
)
1075 return IsWindowCollapsed( inWindowRef
) ;
1078 Boolean
UMAIsWindowCollapsable( WindowRef inWindowRef
)
1080 return IsWindowCollapsable( inWindowRef
) ;
1083 // system 8.5 changes<MacWindows.h>
1084 OSStatus
UMACreateNewWindow( WindowClass windowClass
, WindowAttributes attributes
, const Rect
*bounds
, WindowRef
*outWindow
)
1086 #if UMA_USE_WINDOWMGR
1087 if ( UMAHasWindowManager() )
1089 return CreateNewWindow( windowClass
, attributes
, bounds
, outWindow
) ;
1095 if ( UMAHasAppearance() )
1097 switch( windowClass
)
1099 case kMovableModalWindowClass
:
1100 procID
= kWindowMovableModalDialogProc
;
1102 case kModalWindowClass
:
1103 procID
= kWindowShadowDialogProc
;
1105 case kFloatingWindowClass
:
1106 if ( attributes
& kWindowSideTitlebarAttribute
)
1108 if( ( attributes
& kWindowResizableAttribute
) &&
1109 ( attributes
& kWindowFullZoomAttribute
) )
1111 procID
= kWindowFloatSideFullZoomGrowProc
;
1113 else if( attributes
& kWindowFullZoomAttribute
)
1115 procID
= kWindowFloatSideFullZoomProc
;
1117 else if ( attributes
& kWindowResizableAttribute
)
1119 procID
= kWindowFloatSideGrowProc
;
1123 procID
= kWindowFloatSideProc
;
1128 if( ( attributes
& kWindowResizableAttribute
) &&
1129 ( attributes
& kWindowFullZoomAttribute
) )
1131 procID
= kWindowFloatFullZoomGrowProc
;
1133 else if( attributes
& kWindowFullZoomAttribute
)
1135 procID
= kWindowFloatFullZoomProc
;
1137 else if ( attributes
& kWindowResizableAttribute
)
1139 procID
= kWindowFloatGrowProc
;
1143 procID
= kWindowFloatProc
;
1147 case kDocumentWindowClass
:
1149 if( ( attributes
& kWindowResizableAttribute
) &&
1150 ( attributes
& kWindowFullZoomAttribute
) )
1152 procID
= kWindowFullZoomGrowDocumentProc
;
1154 else if( attributes
& kWindowFullZoomAttribute
)
1156 procID
= kWindowFullZoomDocumentProc
;
1158 else if ( attributes
& kWindowResizableAttribute
)
1160 procID
= kWindowGrowDocumentProc
;
1164 procID
= kWindowDocumentProc
;
1171 switch( windowClass
)
1173 case kMovableModalWindowClass
:
1174 procID
= movableDBoxProc
;
1176 case kModalWindowClass
:
1177 procID
= altDBoxProc
;
1179 case kFloatingWindowClass
:
1180 if ( attributes
& kWindowSideTitlebarAttribute
)
1182 if( ( attributes
& kWindowResizableAttribute
) &&
1183 ( attributes
& kWindowFullZoomAttribute
) )
1185 procID
= floatSideZoomGrowProc
;
1187 else if( attributes
& kWindowFullZoomAttribute
)
1189 procID
= floatSideZoomProc
;
1191 else if ( attributes
& kWindowResizableAttribute
)
1193 procID
= floatSideGrowProc
;
1197 procID
= floatSideProc
;
1202 if( ( attributes
& kWindowResizableAttribute
) &&
1203 ( attributes
& kWindowFullZoomAttribute
) )
1205 procID
= floatZoomGrowProc
;
1207 else if( attributes
& kWindowFullZoomAttribute
)
1209 procID
= floatZoomProc
;
1211 else if ( attributes
& kWindowResizableAttribute
)
1213 procID
= floatGrowProc
;
1221 case kDocumentWindowClass
:
1223 if( ( attributes
& kWindowResizableAttribute
) &&
1224 ( attributes
& kWindowFullZoomAttribute
) )
1226 procID
= zoomDocProc
;
1228 else if( attributes
& kWindowFullZoomAttribute
)
1230 procID
= zoomNoGrow
;
1232 else if ( attributes
& kWindowResizableAttribute
)
1234 procID
= documentProc
;
1238 procID
= noGrowDocProc
;
1244 *outWindow
= NewCWindow(nil
, bounds
, "\p", false, procID
, (WindowRef
) -1 /*behind*/,
1245 attributes
& kWindowCloseBoxAttribute
, (long)NULL
);
1250 OSStatus
UMAGetWindowClass( WindowRef inWindowRef
, WindowClass
*outWindowClass
)
1252 #if UMA_USE_WINDOWMGR
1253 if ( UMAHasWindowManager() )
1255 return GetWindowClass( inWindowRef
, outWindowClass
) ;
1259 return kDocumentWindowClass
;
1262 OSStatus
UMAGetWindowAttributes( WindowRef inWindowRef
, WindowAttributes
*outAttributes
)
1264 #if UMA_USE_WINDOWMGR
1265 if ( UMAHasWindowManager() )
1267 return GetWindowAttributes( inWindowRef
, outAttributes
) ;
1270 return kWindowNoAttributes
;
1273 void UMAShowFloatingWindows()
1275 #if UMA_USE_WINDOWMGR
1276 if ( UMAHasWindowManager() )
1278 ShowFloatingWindows() ;
1283 void UMAHideFloatingWindows()
1285 #if UMA_USE_WINDOWMGR
1286 if ( UMAHasWindowManager() )
1288 HideFloatingWindows() ;
1293 Boolean
UMAAreFloatingWindowsVisible()
1295 #if UMA_USE_WINDOWMGR
1296 if ( UMAHasWindowManager() )
1298 return AreFloatingWindowsVisible() ;
1304 WindowRef
UMAFrontNonFloatingWindow()
1306 #if UMA_USE_WINDOWMGR
1307 if ( UMAHasWindowManager() )
1309 return FrontNonFloatingWindow() ;
1314 return FrontWindow() ;
1318 WindowRef
UMAFrontWindow()
1320 #if UMA_USE_WINDOWMGR
1321 if ( UMAHasWindowManager() )
1323 return FrontWindow() ;
1328 return FrontWindow() ;
1332 WindowRef
UMAGetActiveNonFloatingWindow()
1337 bool UMAIsWindowFloating( WindowRef inWindow
)
1341 UMAGetWindowClass( inWindow
, &cl
) ;
1342 return cl
== kFloatingWindowClass
;
1345 bool UMAIsWindowModal( WindowRef inWindow
)
1349 UMAGetWindowClass( inWindow
, &cl
) ;
1350 return cl
< kFloatingWindowClass
;
1355 void UMAHighlightAndActivateWindow( WindowRef inWindowRef
, bool inActivate
)
1359 // bool isHighlighted = IsWindowHighlited( inWindowRef ) ;
1360 // if ( inActivate != isHightlited )
1361 HiliteWindow( inWindowRef
, inActivate
) ;
1362 ControlHandle control
= NULL
;
1363 UMAGetRootControl( inWindowRef
, & control
) ;
1367 UMAActivateControl( control
) ;
1369 UMADeactivateControl( control
) ;
1373 OSStatus
UMADrawThemePlacard( const Rect
*inRect
, ThemeDrawState inState
)
1375 #if UMA_USE_APPEARANCE
1376 if ( UMAHasAppearance() )
1378 ::DrawThemePlacard( inRect
, inState
) ;