From: <sm...@us...> - 2008-12-02 08:47:16
|
Revision: 9028 http://plplot.svn.sourceforge.net/plplot/?rev=9028&view=rev Author: smekal Date: 2008-12-02 08:47:08 +0000 (Tue, 02 Dec 2008) Log Message: ----------- If a static plplot library with the wxWidgets driver was built, wxPLplotDemo didn't compile due to multiple definitions of wxGetAPP(). This function is defined in wxwidgets_app.cpp and was now renamed to wxPLGetApp(). Modified Paths: -------------- trunk/drivers/wxwidgets.cpp trunk/drivers/wxwidgets.h trunk/drivers/wxwidgets_app.cpp Modified: trunk/drivers/wxwidgets.cpp =================================================================== --- trunk/drivers/wxwidgets.cpp 2008-12-01 10:49:49 UTC (rev 9027) +++ trunk/drivers/wxwidgets.cpp 2008-12-02 08:47:08 UTC (rev 9028) @@ -47,7 +47,7 @@ extern "C" { void CPSEnableForegroundOperation(ProcessSerialNumber* psn); } #endif -DECLARE_APP( wxPLplotApp ) +DECLARE_PLAPP( wxPLplotApp ) /*--------------------------------------------------------------------------*\ * void Log_Verbose( const char *fmt, ... ) @@ -571,8 +571,8 @@ #endif if( dev->ownGUI ) { - wxGetApp().RemoveFrame( dev->m_frame ); - if( !wxGetApp().FrameCount() ) + wxPLGetApp().RemoveFrame( dev->m_frame ); + if( !wxPLGetApp().FrameCount() ) wxUninitialize(); } @@ -1049,14 +1049,14 @@ wxInitialize(); wxLog::GetActiveTarget(); wxTRY { - wxGetApp().CallOnInit(); + wxPLGetApp().CallOnInit(); } - wxCATCH_ALL( wxGetApp().OnUnhandledException(); fprintf(stderr, "Can't init wxWidgets!\n"); exit(0); ) + wxCATCH_ALL( wxPLGetApp().OnUnhandledException(); fprintf(stderr, "Can't init wxWidgets!\n"); exit(0); ) initApp=true; } dev->m_frame = new wxPLplotFrame( wxT("wxWidgets PLplot App"), pls ); - wxGetApp().AddFrame( dev->m_frame ); + wxPLGetApp().AddFrame( dev->m_frame ); dev->m_frame->SetClientSize( dev->width, dev->height ); dev->m_frame->Show( true ); dev->m_frame->Raise(); @@ -1097,25 +1097,25 @@ { public: /* only call OnExit if exit is true (i.e. due an exception) */ - ~CallOnExit() { if(exit) wxGetApp().OnExit(); } + ~CallOnExit() { if(exit) wxPLGetApp().OnExit(); } bool exit; } callOnExit; callOnExit.exit=true; - wxGetApp().SetAdvanceFlag( runonce ); - wxGetApp().SetRefreshFlag(); + wxPLGetApp().SetAdvanceFlag( runonce ); + wxPLGetApp().SetRefreshFlag(); /* add an idle event is necessary for Linux (wxGTK2) but not for Windows, but it doesn't harm */ wxIdleEvent event; - wxGetApp().AddPendingEvent( event ); - wxGetApp().OnRun(); /* start wxWidgets application */ + wxPLGetApp().AddPendingEvent( event ); + wxPLGetApp().OnRun(); /* start wxWidgets application */ callOnExit.exit=false; } - wxCATCH_ALL( wxGetApp().OnUnhandledException(); fprintf(stderr, "Problem running wxWidgets!\n"); exit(0); ) + wxCATCH_ALL( wxPLGetApp().OnUnhandledException(); fprintf(stderr, "Problem running wxWidgets!\n"); exit(0); ) if( dev->exit ) { - wxGetApp().OnExit(); + wxPLGetApp().OnExit(); plexit(""); } Modified: trunk/drivers/wxwidgets.h =================================================================== --- trunk/drivers/wxwidgets.h 2008-12-01 10:49:49 UTC (rev 9027) +++ trunk/drivers/wxwidgets.h 2008-12-02 08:47:08 UTC (rev 9028) @@ -440,10 +440,10 @@ } \ wxAppInitializer \ wxAppInitializer((wxAppInitializerFunction) wxPLCreateApp); \ - DECLARE_APP(appname) \ - appname& wxGetApp() { return *wx_static_cast(appname*, wxApp::GetInstance()); } + DECLARE_PLAPP(appname) \ + appname& wxPLGetApp() { return *wx_static_cast(appname*, wxApp::GetInstance()); } -#define DECLARE_APP(appname) extern appname& wxGetApp(); +#define DECLARE_PLAPP(appname) extern appname& wxPLGetApp(); /* workaround against warnings for unused variables */ static inline void Use(void *) { } Modified: trunk/drivers/wxwidgets_app.cpp =================================================================== --- trunk/drivers/wxwidgets_app.cpp 2008-12-01 10:49:49 UTC (rev 9027) +++ trunk/drivers/wxwidgets_app.cpp 2008-12-02 08:47:08 UTC (rev 9028) @@ -20,7 +20,7 @@ */ /* TODO: - * - Locate mode is implemented, but user functions are not called + * - NA */ @@ -238,7 +238,7 @@ { case wxID_EXIT: m_dev->exit=true; - wxGetApp().ExitMainLoop(); + wxPLGetApp().ExitMainLoop(); break; case wxPL_Orientation_0: case wxPL_Orientation_90: @@ -275,7 +275,7 @@ // Log_Verbose( "wxPLplotFrame::OnClose" ); m_dev->exit=true; - wxGetApp().ExitMainLoop(); + wxPLGetApp().ExitMainLoop(); } @@ -432,7 +432,7 @@ /* End locate mode on <Escape> */ if( gin->keysym == PLK_Escape ) { if( m_dev->locate_mode == LOCATE_INVOKED_VIA_API ) - wxGetApp().SetAdvanceFlag(); + wxPLGetApp().SetAdvanceFlag(); m_dev->locate_mode = 0; m_dev->draw_xhair = false; DrawCrosshair(); @@ -447,7 +447,7 @@ int advance=0; (*m_pls->KeyEH)( gin, m_pls->KeyEH_data, &advance ); if( advance ) - wxGetApp().SetAdvanceFlag(); + wxPLGetApp().SetAdvanceFlag(); } switch( gin->keysym ) { @@ -459,12 +459,12 @@ case 'Q': case PLK_Escape: m_dev->exit=true; - wxGetApp().SetExitFlag(); + wxPLGetApp().SetExitFlag(); break; case PLK_Return: case WXK_SPACE: case WXK_RIGHT: - wxGetApp().SetAdvanceFlag(); + wxPLGetApp().SetAdvanceFlag(); break; default: break; @@ -587,13 +587,13 @@ int advance=0; (*m_pls->ButtonEH)( gin, m_pls->ButtonEH_data, &advance ); if( advance ) - wxGetApp().SetAdvanceFlag(); + wxPLGetApp().SetAdvanceFlag(); } /* Handle internal events */ switch( gin->button ) { case 3: // on right mouse button advance - wxGetApp().SetAdvanceFlag(); + wxPLGetApp().SetAdvanceFlag(); break; default: break; @@ -620,7 +620,7 @@ // was initiated by the API we need to return back to the // user program if( m_dev->locate_mode == LOCATE_INVOKED_VIA_API ) - wxGetApp().SetAdvanceFlag(); + wxPLGetApp().SetAdvanceFlag(); /* Call user locate mode handler if provided */ if( m_pls->LocateEH != NULL ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |