+ wxMenu* DoCreatePopupMenu();
+
+ EventHandlerRef m_eventHandlerRef;
+ EventHandlerUPP m_eventupp;
+ wxWindow *m_eventWindow;
+ wxMenu *m_pMenu;
+ MenuRef m_theLastMenu;
+ bool m_iconAdded;
+};
+
+// Forward declarations for utility functions for dock implementation
+pascal OSStatus wxDockEventHandler(
+ EventHandlerCallRef inHandlerCallRef,
+ EventRef inEvent, void* pData );
+wxMenu * wxDeepCopyMenu( wxMenu *menu );
+
+
+//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+//
+// wxTaskBarIconImpl
+//
+//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+wxTaskBarIconImpl::wxTaskBarIconImpl(wxTaskBarIcon* parent)
+ : m_parent(parent), m_menuEventWindow(new wxTaskBarIconWindow(this))
+{
+}
+
+wxTaskBarIconImpl::~wxTaskBarIconImpl()
+{
+ delete m_menuEventWindow;
+}
+
+//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+//
+// wxDockTaskBarIcon
+//
+// OS X Dock implementation of wxTaskBarIcon using Carbon
+//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+//-----------------------------------------------------------------------------
+// wxDockEventHandler
+//
+// This is the global Mac/Carbon event handler for the dock.
+// We need this for two reasons:
+// 1) To handle wxTaskBarIcon menu events (see below for why)
+// 2) To handle events from the dock when it requests a menu
+//-----------------------------------------------------------------------------
+pascal OSStatus
+wxDockEventHandler(EventHandlerCallRef WXUNUSED(inHandlerCallRef),
+ EventRef inEvent,
+ void *pData)
+{
+ // Get the parameters we want from the event
+ wxDockTaskBarIcon* pTB = (wxDockTaskBarIcon*) pData;
+ const UInt32 eventClass = GetEventClass(inEvent);
+ const UInt32 eventKind = GetEventKind(inEvent);