X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/01250f9b2c17d43f2283857869c80f7236a605e7..cf516c2bb2b8bc462f6f0cb852fb2fc2d86c9c66:/src/osx/cocoa/taskbar.mm?ds=sidebyside diff --git a/src/osx/cocoa/taskbar.mm b/src/osx/cocoa/taskbar.mm index af4717a47e..b6d327b863 100644 --- a/src/osx/cocoa/taskbar.mm +++ b/src/osx/cocoa/taskbar.mm @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// File: src/cocoa/taskbar.mm +// File: src/osx/cocoa/taskbar.mm // Purpose: Implements wxTaskBarIcon class // Author: David Elliott // Modified by: @@ -21,22 +21,7 @@ #include "wx/taskbar.h" -#import -#import -#import -#import -#import -#import -#import -#import -#import - -#import -#import -#import - -#include "wx/cocoa/NSApplication.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) @@ -248,7 +233,7 @@ WX_NSMenu wxTaskBarIconDockImpl::CocoaDoGetDockNSMenu() 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; @@ -283,7 +268,7 @@ wxTaskBarIconCustomStatusItemImpl::~wxTaskBarIconCustomStatusItemImpl() bool wxTaskBarIconCustomStatusItemImpl::SetIcon(const wxIcon& icon, const wxString& tooltip) { - wxAutoNSAutoreleasePool pool; + wxMacAutoreleasePool pool; if(!m_cocoaNSStatusItem) { m_cocoaNSStatusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength]; @@ -383,24 +368,4 @@ void wxTaskBarIconWindowCustom::OnPaint(wxPaintEvent &event) dc.DrawIcon(m_icon,0,0); } -// ============================================================================ -// wxTaskBarIconNSApplicationDelegateCategory -// ============================================================================ - -// This neatly solves the problem of DLL separation. If the wxAdvanced -// library (which this file is part of) is loaded then this category is -// defined and we get dock menu behavior without app.mm ever having to -// know we exist. C++ did sucketh so. :-) - -@interface wxNSApplicationDelegate(wxTaskBarIconNSApplicationDelegateCategory) -- (NSMenu*)applicationDockMenu:(NSApplication *)sender; -@end - -@implementation wxNSApplicationDelegate(wxTaskBarIconNSApplicationDelegateCategory) -- (NSMenu*)applicationDockMenu:(NSApplication *)sender -{ - return wxTaskBarIconDockImpl::CocoaGetDockNSMenu(); -} -@end - #endif //def wxHAS_TASK_BAR_ICON