#ifndef _WX_APP_H_
#define _WX_APP_H_
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(__APPLE__)
#pragma interface "app.h"
#endif
virtual void SetPrintMode(int mode) { m_printMode = mode; }
virtual int GetPrintMode() const { return m_printMode; }
+#if wxUSE_GUI
+ // setting up all MacOS Specific Event-Handlers etc
+ virtual bool OnInitGui();
+#endif // wxUSE_GUI
// implementation only
void OnIdle(wxIdleEvent& event);
void OnEndSession(wxCloseEvent& event);
static bool Initialize();
static void CleanUp();
- virtual bool OnInit();
void DeletePendingObjects();
bool IsExiting() { return !m_keepGoing ; }
-
+#if TARGET_CARBON
+ WXEVENTHANDLERREF MacGetEventHandler() { return m_macEventHandler ; }
+#endif
+
public:
static long sm_lastMessageTime;
static wxWindow* s_captureWindow ;
static int s_lastMouseDown ; // 0 = none , 1 = left , 2 = right
static WXHRGN s_macCursorRgn ;
+ static long s_lastModifiers ;
WXEVENTREF m_macCurrentEvent ;
int m_nCmdShow;
// mac specifics
public:
+#if TARGET_CARBON
+ // public to avoid change in initialization order of handlers
+ // could be moved into a override of OnInitGui eventually
+ WXEVENTHANDLERREF m_macEventHandler ;
+#endif
static bool s_macDefaultEncodingIsPC ;
static bool s_macSupportPCMenuShortcuts ;
static long s_macAboutMenuItemId ;
+ static long s_macPreferencesMenuItemId ;
+ static long s_macExitMenuItemId ;
static wxString s_macHelpMenuTitleName ;
static bool s_macHasAppearance ;
virtual void MacSuspend( bool convertClipboard ) ;
virtual void MacResume( bool convertClipboard ) ;
-
virtual void MacConvertPrivateToPublicScrap() ;
virtual void MacConvertPublicToPrivateScrap() ;
+
+#if !TARGET_CARBON
+ virtual void MacHandleMenuSelect( int menuid , int menuitem ) ;
+ virtual void MacHandleMouseUpEvent( WXEVENTREF ev ) ;
+ virtual void MacHandleOSEvent( WXEVENTREF ev ) ;
+ virtual void MacHandleDiskEvent( WXEVENTREF ev ) ;
+ virtual void MacHandleActivateEvent( WXEVENTREF ev ) ;
+ virtual void MacHandleUpdateEvent( WXEVENTREF ev ) ;
+#endif
+ virtual void MacHandleMouseDownEvent( WXEVENTREF ev ) ;
+ void MacHandleMenuCommand( wxUint32 command ) ;
// event main methods
void MacDoOneEvent() ;
void MacHandleOneEvent( WXEVENTREF ev ) ;
+ void MacHandleModifierEvents( WXEVENTREF ev ) ;
WXEVENTREF MacGetCurrentEvent() { return m_macCurrentEvent ; }
// primary events
- virtual void MacHandleMouseDownEvent( WXEVENTREF ev ) ;
- virtual void MacHandleMouseUpEvent( WXEVENTREF ev ) ;
- virtual void MacHandleActivateEvent( WXEVENTREF ev ) ;
- virtual void MacHandleUpdateEvent( WXEVENTREF ev ) ;
virtual void MacHandleKeyDownEvent( WXEVENTREF ev ) ;
virtual void MacHandleKeyUpEvent( WXEVENTREF ev ) ;
- virtual void MacHandleDiskEvent( WXEVENTREF ev ) ;
- virtual void MacHandleOSEvent( WXEVENTREF ev ) ;
virtual void MacHandleHighLevelEvent( WXEVENTREF ev ) ;
- virtual void MacHandleMenuSelect( int menuid , int menuitem ) ;
virtual bool MacSendKeyDownEvent( wxWindow* focus , long keyval , long modifiers , long when , short wherex , short wherey ) ;
virtual bool MacSendKeyUpEvent( wxWindow* focus , long keyval , long modifiers , long when , short wherex , short wherey ) ;
virtual short MacHandleAEOApp(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ;
virtual short MacHandleAEQuit(const WXAPPLEEVENTREF event , WXAPPLEEVENTREF reply) ;
+ // in response of an open-document apple event
+ virtual void MacOpenFile(const wxString &fileName) ;
+ // in response of a print-document apple event
+ virtual void MacPrintFile(const wxString &fileName) ;
+ // in response of a open-application apple event
+ virtual void MacNewFile() ;
+
DECLARE_EVENT_TABLE()
};
} ;
// TODO: add platform-specific arguments
+#ifndef __DARWIN__
int WXDLLEXPORT wxEntry( int argc, char *argv[] , bool enterLoop = TRUE);
+#endif
void wxMacConvertFromPCForControls( char * p ) ;