]>
git.saurik.com Git - wxWidgets.git/blob - src/unix/baseunix.cpp
fb2bdf58baff086f17d24c8e726e8913ed584ee5
   1 /////////////////////////////////////////////////////////////////////////////// 
   2 // Name:        src/unix/baseunix.cpp 
   3 // Purpose:     misc stuff only used in console applications under Unix 
   4 // Author:      Vadim Zeitlin 
   8 // Copyright:   (c) 2003 Vadim Zeitlin <vadim@wxwindows.org> 
   9 // License:     wxWindows licence 
  10 /////////////////////////////////////////////////////////////////////////////// 
  12 // ============================================================================ 
  14 // ============================================================================ 
  16 // ---------------------------------------------------------------------------- 
  18 // ---------------------------------------------------------------------------- 
  20 // for compilers that support precompilation, includes "wx.h". 
  21 #include "wx/wxprec.h" 
  33 #include "wx/apptrait.h" 
  34 #include "wx/unix/execute.h" 
  35 #include "wx/evtloop.h" 
  38     #include "wx/unix/private/timer.h" 
  42 #include <sys/types.h> 
  45 // ============================================================================ 
  46 // wxConsoleAppTraits implementation 
  47 // ============================================================================ 
  49 // ---------------------------------------------------------------------------- 
  51 // ---------------------------------------------------------------------------- 
  53 bool wxConsoleAppTraits::CreateEndProcessPipe(wxExecuteData
& WXUNUSED(data
)) 
  55     // nothing to do, so always ok 
  60 wxConsoleAppTraits::IsWriteFDOfEndProcessPipe(wxExecuteData
& WXUNUSED(data
), 
  63     // we don't have any pipe 
  68 wxConsoleAppTraits::DetachWriteFDOfEndProcessPipe(wxExecuteData
& WXUNUSED(data
)) 
  75 wxConsoleAppTraits::WaitForChild(wxExecuteData
& execData
) 
  77     wxASSERT_MSG( execData
.flags 
& wxEXEC_SYNC
, 
  78                   wxT("async execution not supported yet") ); 
  81     if ( waitpid(execData
.pid
, &exitcode
, 0) == -1 || !WIFEXITED(exitcode
) ) 
  83         wxLogSysError(_("Waiting for subprocess termination failed")); 
  91 wxTimerImpl 
*wxConsoleAppTraits::CreateTimerImpl(wxTimer 
*timer
) 
  93     // this doesn't work yet as there is no main loop in console applications 
  94     // (but it will be added later) 
  95     return new wxUnixTimerImpl(timer
); 
 100 wxEventLoopBase 
*wxConsoleAppTraits::CreateEventLoop() 
 102     return new wxEventLoop();