// Mac native about box currently can show only name, version, copyright
// and description fields and we also shoehorn the credits text into the
// description but if we have anything else we must use the generic version
+#ifndef __LP64__
if ( info.IsSimple() )
{
AboutBoxOptions opts;
HIAboutBox(opts);
}
else // simple "native" version is not enough
+#endif
{
// we need to use the full-blown generic version
wxGenericAboutBox(info);
#include "wx/string.h"
#endif
+#ifndef __WXUNIVERSAL__
+
IMPLEMENT_DYNAMIC_CLASS(wxAcceleratorTable, wxObject)
// ----------------------------------------------------------------------------
return -1;
}
+
+#endif
\ No newline at end of file
return eventNotHandledErr;
}
+#ifndef __LP64__
static pascal OSStatus
wxMacAppCommandEventHandler( EventHandlerCallRef WXUNUSED(handler) ,
EventRef event ,
}
return result ;
}
+#endif
static pascal OSStatus
wxMacAppApplicationEventHandler( EventHandlerCallRef WXUNUSED(handler) ,
OSStatus result = eventNotHandledErr ;
switch ( GetEventClass( event ) )
{
+#ifndef __LP64__
case kEventClassCommand :
result = wxMacAppCommandEventHandler( handler , event , data ) ;
break ;
-
+#endif
case kEventClassApplication :
result = wxMacAppApplicationEventHandler( handler , event , data ) ;
break ;
-
+#ifndef __LP64__
case kEventClassMenu :
result = wxMacAppMenuEventHandler( handler , event , data ) ;
break ;
result = wxMacTopLevelMouseEventHandler( handler , event , NULL ) ;
}
break ;
-
+#endif
case kEventClassAppleEvent :
{
- EventRecord rec ;
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+ if ( AEProcessEvent != NULL )
+ {
+ result = AEProcessEvent(event);
+ }
+#endif
+#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
+ {
+ EventRecord rec ;
- wxMacConvertEventToRecord( event , &rec ) ;
- result = AEProcessAppleEvent( &rec ) ;
+ wxMacConvertEventToRecord( event , &rec ) ;
+ result = AEProcessAppleEvent( &rec ) ;
+ }
+#endif
}
break ;
#endif
UMAInitToolbox( 4, sm_isEmbedded ) ;
- SetEventMask( everyEvent ) ;
+// TODO CHECK Can Be Removed SetEventMask( everyEvent ) ;
UMAShowWatchCursor() ;
// Mac OS X passes a process serial number command line argument when
{
if ( !wxAppBase::OnInitGui() )
return false ;
-
+#ifndef __LP64__
InstallStandardEventHandler( GetApplicationEventTarget() ) ;
-
if (!sm_isEmbedded)
{
InstallApplicationEventHandler(
GetwxMacAppEventHandlerUPP(),
GetEventTypeCount(eventList), eventList, wxTheApp, (EventHandlerRef *)&(wxTheApp->m_macEventHandler));
}
+#endif
if (!sm_isEmbedded)
{
// misc initialization stuff
//----------------------------------------------------------------------
+#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
bool wxMacConvertEventToRecord( EventRef event , EventRecord *rec)
{
OSStatus err = noErr ;
UInt32 keyCode ;
unsigned char charCode ;
UInt32 modifiers ;
-#ifndef __LP64__
GetMouse( &rec->where) ;
-#endif
err = GetEventParameter(event, kEventParamKeyModifiers, typeUInt32, NULL, 4, NULL, &modifiers);
err = GetEventParameter(event, kEventParamKeyCode, typeUInt32, NULL, 4, NULL, &keyCode);
err = GetEventParameter(event, kEventParamKeyMacCharCodes, typeChar, NULL, 1, NULL, &charCode);
{
UInt32 keyCode, modifiers;
unsigned char charCode ;
-#ifndef __LP64__
-
GetMouse( &rec->where) ;
-#endif
rec->what = keyDown ;
err = GetEventParameter(rawEvent, kEventParamKeyModifiers, typeUInt32, NULL, 4, NULL, &modifiers);
err = GetEventParameter(rawEvent, kEventParamKeyCode, typeUInt32, NULL, 4, NULL, &keyCode);
return converted ;
}
+#endif
wxApp::wxApp()
{
{
// if window is not having a focus still testing for default enter or cancel
// TODO: add the UMA version for ActiveNonFloatingWindow
+#ifndef __LP64__
wxWindow* focus = wxFindWinFromMacWindow( FrontWindow() ) ;
if ( focus )
{
handled = focus->GetEventHandler()->ProcessEvent( new_event );
}
}
+#endif
}
return handled ;
}
if (!m_window)
return wxNullBitmap;
+#ifdef __LP64__
+ return wxNullBitmap;
+#else
ControlRef handle = (ControlRef) m_window->GetHandle();
if ( !handle )
return wxNullBitmap;
-
+
HIRect rect;
CGImageRef image;
CGContextRef context;
}
return bmp;
+#endif
}
/*
// Create a DC representing the whole screen
wxScreenDC::wxScreenDC()
{
+#ifdef __LP64__
+ m_graphicContext = NULL;
+ m_ok = false ;
+#else
CGRect cgbounds ;
cgbounds = CGDisplayBounds(CGMainDisplayID());
Rect bounds;
m_width = (wxCoord)cgbounds.size.width;
m_height = (wxCoord)cgbounds.size.height;
m_ok = true ;
+#endif
}
wxScreenDC::~wxScreenDC()
{
delete m_graphicContext;
m_graphicContext = NULL;
+#ifdef __LP64__
+#else
DisposeWindow((WindowRef) m_overlayWindow );
+#endif
}
int attributeCount = sizeof(atsuTags) / sizeof(ATSUAttributeTag) ;
// attempt to add atsu font
+#if 0
status = ATSUFindFontFromName(m_faceName.c_str(), strlen(m_faceName.c_str()), kFontFamilyName, kFontNoPlatform, kFontNoScript, kFontNoLanguage, &atsuFontID);
if ( status != noErr )
{
attributeCount--;
}
-
+#endif
ATSUAttributeValuePtr atsuValues[sizeof(atsuTags) / sizeof(ATSUAttributeTag)] =
{
&atsuSize ,
typedef float CGFloat;
#endif
+#ifdef __LP64__
+#define wxMAC_USE_CORE_TEXT 1
+#else
+#define wxMAC_USE_ATSU_TEXT 1
+#endif
+#undef wxMAC_USE_CG_TEXT
//-----------------------------------------------------------------------------
// constants
//-----------------------------------------------------------------------------
#ifdef __LP64__
// todo flip
CGContextDrawImage(inContext, *inBounds, inImage );
+ return noErr;
#else
- HIViewDrawCGImage( inContext, inBounds, inImage );
+ return HIViewDrawCGImage( inContext, inBounds, inImage );
#endif
}
{
m_macATSUIStyle = NULL;
+#ifdef wxMAC_USE_CORE_TEXT
+#elif defined(wxMAC_USE_ATSU_TEXT)
OSStatus status;
status = ATSUCreateAndCopyStyle( (ATSUStyle) font.MacGetATSUStyle() , &m_macATSUIStyle );
atsuTags, atsuSizes, atsuValues);
wxASSERT_MSG( status == noErr , wxT("couldn't modify ATSU style") );
+#elif defined(WXMAC_USE_CG_TEXT)
+#endif
}
wxMacCoreGraphicsFontData::~wxMacCoreGraphicsFontData()
{
+#ifdef wxMAC_USE_CORE_TEXT
+#elif defined(wxMAC_USE_ATSU_TEXT)
if ( m_macATSUIStyle )
{
::ATSUDisposeStyle((ATSUStyle)m_macATSUIStyle);
m_macATSUIStyle = NULL;
}
+#elif defined(WXMAC_USE_CG_TEXT)
+#endif
}
//
int originX , originY;
originX = originY = 0;
window->MacWindowToRootWindow( &originX , &originY );
- Rect bounds;
- GetWindowBounds( m_windowRef, kWindowContentRgn, &bounds );
+ Rect bounds = { 0,0,0,0 };
+#ifdef __LP64__
+#else
+ GetWindowBounds( m_windowRef, kWindowContentRgn, &bounds );
+#endif
m_windowTransform = CGAffineTransformMakeTranslation( 0 , bounds.bottom - bounds.top );
m_windowTransform = CGAffineTransformScale( m_windowTransform , 1 , -1 );
m_windowTransform = CGAffineTransformTranslate( m_windowTransform, originX, originY ) ;
void wxMacCoreGraphicsContext::DrawText( const wxString &str, wxDouble x, wxDouble y )
{
+ if ( m_font.IsNull() )
+ return;
+
+ EnsureIsValid();
+#ifdef wxMAC_USE_CORE_TEXT
+ // TODO core text implementation here
+#elif defined(wxMAC_USE_ATSU_TEXT)
DrawText(str, x, y, 0.0);
+#elif defined(WXMAC_USE_CG_TEXT)
+ // TODO core graphics text implementation here
+#endif
}
void wxMacCoreGraphicsContext::DrawText( const wxString &str, wxDouble x, wxDouble y, wxDouble angle )
return;
EnsureIsValid();
-
+#ifdef wxMAC_USE_CORE_TEXT
+ // default implementation takes care of rotation and calls non rotated DrawText afterwards
+ wxGraphicsContext::DrawText( str, x, y, angle );
+#elif defined(wxMAC_USE_ATSU_TEXT)
OSStatus status = noErr;
ATSUTextLayout atsuLayout;
UniCharCount chars = str.length();
#if SIZEOF_WCHAR_T == 4
free( ubuf );
#endif
+#elif defined(WXMAC_USE_CG_TEXT)
+ // default implementation takes care of rotation and calls non rotated DrawText afterwards
+ wxGraphicsContext::DrawText( str, x, y, angle );
+#endif
}
void wxMacCoreGraphicsContext::GetTextExtent( const wxString &str, wxDouble *width, wxDouble *height,
if (str.empty())
return;
+#ifdef wxMAC_USE_CORE_TEXT
+ // TODO core text implementation here
+#elif defined(wxMAC_USE_ATSU_TEXT)
OSStatus status = noErr;
ATSUTextLayout atsuLayout;
#if SIZEOF_WCHAR_T == 4
free( ubuf ) ;
#endif
+#elif defined(WXMAC_USE_CG_TEXT)
+ // TODO core graphics text implementation here
+#endif
}
void wxMacCoreGraphicsContext::GetPartialTextExtents(const wxString& text, wxArrayDouble& widths) const
if (text.empty())
return;
+#ifdef wxMAC_USE_CORE_TEXT
+ // TODO core text implementation here
+#elif defined(wxMAC_USE_ATSU_TEXT)
ATSUTextLayout atsuLayout;
UniCharCount chars = text.length();
UniChar* ubuf = NULL;
#if SIZEOF_WCHAR_T == 4
free( ubuf ) ;
#endif
+#elif defined(WXMAC_USE_CG_TEXT)
+ // TODO core graphics text implementation here
+#endif
}
void * wxMacCoreGraphicsContext::GetNativeContext()
((wxMacCarbonPrintData*)m_printDialogData.GetPrintData().GetNativeData())->TransferFrom( &m_printDialogData );
int result = wxID_CANCEL;
+
+#ifdef __LP64__
+ // TODO use NSPrintPanel
+#else
OSErr err = noErr;
Boolean accepted;
-
err = PMSessionPrintDialog(
((wxMacCarbonPrintData*)m_printDialogData.GetPrintData().GetNativeData())->m_macPrintSession,
((wxMacCarbonPrintData*)m_printDialogData.GetPrintData().GetNativeData())->m_macPrintSettings,
m_printDialogData.GetPrintData().ConvertFromNative();
((wxMacCarbonPrintData*)m_printDialogData.GetPrintData().GetNativeData())->TransferTo( &m_printDialogData );
}
-
+#endif
return result;
}
((wxMacCarbonPrintData*)m_pageSetupData.GetPrintData().GetNativeData())->TransferFrom( &m_pageSetupData );
int result = wxID_CANCEL;
+#ifdef __LP64__
+#else
OSErr err = noErr;
Boolean accepted;
m_pageSetupData.SetPaperSize( m_pageSetupData.GetPrintData().GetPaperSize() );
((wxMacCarbonPrintData*)m_pageSetupData.GetPrintData().GetNativeData())->TransferTo( &m_pageSetupData );
}
-
+#endif
return result;
}