bool Create(const wxNativeFontInfo& info);
-#if wxOSX_USE_CARBON
+#if wxOSX_USE_ATSU_TEXT
bool MacCreateFromThemeFont( wxUint16 themeFontID ) ;
#endif
#if wxOSX_USE_CORE_TEXT
#include <ApplicationServices/ApplicationServices.h>
+#if wxOSX_USE_ATSU_TEXT
+ // we need theming and atsu
+ #include <Carbon/Carbon.h>
+#endif
+
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
if ( GetWindowVariant() == wxWINDOW_VARIANT_NORMAL )
{
wxFont font;
-#if wxOSX_USE_CARBON
+#if wxOSX_USE_ATSU_TEXT
font.MacCreateFromThemeFont( kThemeViewsFont );
#else
font.MacCreateFromUIFont( kCTFontViewsFontType );
if (m_headerWin)
{
wxFont font;
-#if wxOSX_USE_CARBON
+#if wxOSX_USE_ATSU_TEXT
font.MacCreateFromThemeFont( kThemeSmallSystemFont );
#else
font.MacCreateFromUIFont( kCTFontSystemFontType );
m_lastOnSame = false;
#if defined( __WXMAC__ )
-#if wxOSX_USE_CARBON
+#if wxOSX_USE_ATSU_TEXT
m_normalFont.MacCreateFromThemeFont( kThemeViewsFont ) ;
#else
m_normalFont.MacCreateFromUIFont( kCTFontViewsFontType ) ;
#if wxOSX_USE_COCOA_OR_CARBON
case FONT_NORMAL:
font = new wxFont;
-#if wxOSX_USE_CARBON
+#if wxOSX_USE_ATSU_TEXT
font->MacCreateFromThemeFont(kThemeSystemFont);
#else
font->MacCreateFromUIFont(kCTFontSystemFontType);
break;
case FONT_SMALL:
font = new wxFont;
-#if wxOSX_USE_CARBON
+#if wxOSX_USE_ATSU_TEXT
font->MacCreateFromThemeFont(kThemeSmallSystemFont);
#else
font->MacCreateFromUIFont(kCTFontSmallSystemFontType);
#include "wx/osx/private.h"
-
WXGLContext WXGLCreateContext( WXGLPixelFormat pixelFormat, WXGLContext shareContext )
{
WXGLContext context = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext: shareContext];
{
NSOpenGLPFADoubleBuffer,
NSOpenGLPFAMinimumPolicy,
- NSOpenGLPFAColorSize,8,
- NSOpenGLPFAAlphaSize,0,
- NSOpenGLPFADepthSize,8,
+ NSOpenGLPFAColorSize,(NSOpenGLPixelFormatAttribute)8,
+ NSOpenGLPFAAlphaSize,(NSOpenGLPixelFormatAttribute)0,
+ NSOpenGLPFADepthSize,(NSOpenGLPixelFormatAttribute)8,
(NSOpenGLPixelFormatAttribute)nil
};
case WX_GL_AUX_BUFFERS:
data[p++] = NSOpenGLPFAAuxBuffers;
- data[p++] = attribList[arg++];
+ data[p++] = (NSOpenGLPixelFormatAttribute) attribList[arg++];
break;
case WX_GL_MIN_RED:
data[p++] = NSOpenGLPFAColorSize;
- data[p++] = attribList[arg++];
+ data[p++] = (NSOpenGLPixelFormatAttribute) attribList[arg++];
break;
case WX_GL_MIN_GREEN:
case WX_GL_MIN_ALPHA:
data[p++] = NSOpenGLPFAAlphaSize;
- data[p++] = attribList[arg++];
+ data[p++] = (NSOpenGLPixelFormatAttribute) attribList[arg++];
break;
case WX_GL_DEPTH_SIZE:
data[p++] = NSOpenGLPFADepthSize;
- data[p++] = attribList[arg++];
+ data[p++] = (NSOpenGLPixelFormatAttribute) attribList[arg++];
break;
case WX_GL_STENCIL_SIZE:
data[p++] = NSOpenGLPFAStencilSize;
- data[p++] = attribList[arg++];
+ data[p++] = (NSOpenGLPixelFormatAttribute) attribList[arg++];
break;
case WX_GL_MIN_ACCUM_RED:
data[p++] = NSOpenGLPFAAccumSize;
- data[p++] = attribList[arg++];
+ data[p++] = (NSOpenGLPixelFormatAttribute) attribList[arg++];
break;
case WX_GL_MIN_ACCUM_GREEN:
}
data[p++] = NSOpenGLPFASampleBuffers;
- if ( (data[p++] = attribList[arg++]) == true )
+ if ( (data[p++] = (NSOpenGLPixelFormatAttribute) attribList[arg++]) == true )
{
// don't use software fallback
data[p++] = NSOpenGLPFANoRecovery;
}
data[p++] = NSOpenGLPFASamples;
- data[p++] = attribList[arg++];
+ data[p++] = (NSOpenGLPixelFormatAttribute) attribList[arg++];
break;
}
}
attribs = data;
}
- return [[NSOpenGLPixelFormat alloc] initWithAttributes:attribs];
+ return [[NSOpenGLPixelFormat alloc] initWithAttributes:(NSOpenGLPixelFormatAttribute*) attribs];
}
bool wxGLContext::SetCurrent(const wxGLCanvas& win) const
/////////////////////////////////////////////////////////////////////////
-// File: src/cocoa/taskbar.mm
+// File: src/osx/cocoa/taskbar.mm
// Purpose: Implements wxTaskBarIcon class
// Author: David Elliott
// Modified by:
#include "wx/taskbar.h"
-#import <AppKit/NSApplication.h>
-#import <AppKit/NSImage.h>
-#import <AppKit/NSMenu.h>
-#import <AppKit/NSMenuItem.h>
-#import <AppKit/NSStatusBar.h>
-#import <AppKit/NSStatusItem.h>
-#import <AppKit/NSView.h>
-#import <Foundation/NSArray.h>
-#import <Foundation/NSEnumerator.h>
-
-#import <AppKit/NSEvent.h>
-#import <AppKit/NSWindow.h>
-#import <AppKit/NSGraphicsContext.h>
-
-#include "wx/cocoa/autorelease.h"
+#include "wx/osx/private.h"
// A category for methods that are only present in Panther's SDK
@interface NSStatusItem(wxNSStatusItemPrePantherCompatibility)
bool wxTaskBarIconDockImpl::SetIcon(const wxIcon& icon, const wxString& tooltip)
{
- wxAutoNSAutoreleasePool pool;
+ wxMacAutoreleasePool pool;
m_originalDockIcon = [[[NSApplication sharedApplication] applicationIconImage] retain];
//[[NSApplication sharedApplication] setApplicationIconImage:icon.GetNSImage()];
return true;
bool wxTaskBarIconCustomStatusItemImpl::SetIcon(const wxIcon& icon, const wxString& tooltip)
{
- wxAutoNSAutoreleasePool pool;
+ wxMacAutoreleasePool pool;
if(!m_cocoaNSStatusItem)
{
m_cocoaNSStatusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];
PMSetOrientation( (PMPageFormat) m_macPageFormat , ( data.GetOrientation() == wxLANDSCAPE ) ?
kPMLandscape : kPMPortrait , false ) ;
-#if wxOSX_USE_CARBON
+#if 1 // wxOSX_USE_CARBON
PMTag tag = kPMMaxSquareResolution;
PMPrinterGetPrinterResolution(printer, tag, &res);
PMSetResolution((PMPageFormat) m_macPageFormat, &res);
PMResolution res;
wxMacCarbonPrintData* nativeData = (wxMacCarbonPrintData*)
(m_printDialogData.GetPrintData().GetNativeData());
-#if wxOSX_USE_CARBON
+#if 1 // wxOSX_USE_CARBON
PMGetResolution((PMPageFormat) (nativeData->m_macPageFormat), &res);
#else
PMPrinter printer;
attr.colFg = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT );
attr.colBg = wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOX );
-#if wxOSX_USE_CARBON
+#if wxOSX_USE_ATSU_TEXT
attr.font.MacCreateFromThemeFont(kThemeViewsFont);
#else
attr.font.MacCreateFromUIFont(kCTFontViewsFontType);
return;
m_peer->SetControlSize( variant );
+#if wxOSX_USE_CARBON
+ ControlSize size ;
+
+ // we will get that from the settings later
+ // and make this NORMAL later, but first
+ // we have a few calculations that we must fix
+
+ switch ( variant )
+ {
+ case wxWINDOW_VARIANT_NORMAL :
+ size = kControlSizeNormal;
+ break ;
+
+ case wxWINDOW_VARIANT_SMALL :
+ size = kControlSizeSmall;
+ break ;
+
+ case wxWINDOW_VARIANT_MINI :
+ // not always defined in the headers
+ size = 3 ;
+ break ;
+
+ case wxWINDOW_VARIANT_LARGE :
+ size = kControlSizeLarge;
+ break ;
+
+ default:
+ wxFAIL_MSG(_T("unexpected window variant"));
+ break ;
+ }
+ m_peer->SetData<ControlSize>(kControlEntireControl, kControlSizeTag, &size ) ;
+#endif
+
#if wxOSX_USE_COCOA_OR_CARBON
wxFont font ;
-#if wxOSX_USE_CARBON
+#if wxOSX_USE_ATSU_TEXT
ControlSize size ;
ThemeFontID themeFont = kThemeSystemFont ;
break ;
}
- m_peer->SetData<ControlSize>(kControlEntireControl, kControlSizeTag, &size ) ;
font.MacCreateFromThemeFont( themeFont ) ;
#else
CTFontUIFontType themeFont = kCTFontSystemFontType ;