/////////////////////////////////////////////////////////////////////////
-// 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/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)
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];
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