wx/unix/app.h \
wx/unix/apptbase.h \
wx/unix/apptrait.h \
+ wx/unix/chkconf.h \
wx/unix/execute.h \
wx/unix/evtloop.h \
wx/unix/mimetype.h \
wx/unix/app.h \
wx/unix/apptbase.h \
wx/unix/apptrait.h \
+ wx/unix/chkconf.h \
wx/unix/execute.h \
wx/unix/evtloop.h \
wx/unix/mimetype.h \
wx/unix/app.h \
wx/unix/apptbase.h \
wx/unix/apptrait.h \
+ wx/unix/chkconf.h \
wx/unix/execute.h \
wx/unix/evtloop.h \
wx/unix/mimetype.h \
wx/unix/app.h \
wx/unix/apptbase.h \
wx/unix/apptrait.h \
+ wx/unix/chkconf.h \
wx/unix/execute.h \
wx/unix/evtloop.h \
wx/unix/mimetype.h \
wx/unix/app.h \
wx/unix/apptbase.h \
wx/unix/apptrait.h \
+ wx/unix/chkconf.h \
wx/unix/evtloop.h \
wx/unix/stdpaths.h
@COND_TOOLKIT_MAC@BASE_MACOSX_HDR = $(COND_TOOLKIT_MAC_BASE_MACOSX_HDR)
wx/unix/app.h \
wx/unix/apptbase.h \
wx/unix/apptrait.h \
+ wx/unix/chkconf.h \
wx/unix/execute.h \
wx/unix/evtloop.h \
wx/unix/mimetype.h \
wx/unix/app.h \
wx/unix/apptbase.h \
wx/unix/apptrait.h \
+ wx/unix/chkconf.h \
wx/unix/execute.h \
wx/unix/evtloop.h \
wx/unix/mimetype.h \
wx/unix/app.h \
wx/unix/apptbase.h \
wx/unix/apptrait.h \
+ wx/unix/chkconf.h \
wx/unix/execute.h \
wx/unix/evtloop.h \
wx/unix/mimetype.h \
wx/unix/app.h
wx/unix/apptbase.h
wx/unix/apptrait.h
+ wx/unix/chkconf.h
wx/unix/execute.h
wx/unix/evtloop.h
wx/unix/mimetype.h
wx/unix/app.h
wx/unix/apptbase.h
wx/unix/apptrait.h
+ wx/unix/chkconf.h
wx/unix/evtloop.h
wx/unix/stdpaths.h
</set>
dnl should be used for the options which are enabled by default
dnl - WX_ARG_FEATURE is a version of WX_ARG_ENABLE which should be used for
dnl optional features, i.e. options which should be disabled if
-dnl --disable-all_features is specified (WX_ARG_WITH/WX_ARG_SYS_WITH are
+dnl --disable-all-features is specified (WX_ARG_WITH/WX_ARG_SYS_WITH are
dnl also affected by this)
dnl ---------------------------------------------------------------------------
VENDOR="custom"
fi
-WX_ARG_DISABLE(all_features,[ --disable-all_features disable all optional features to build minimal library], wxUSE_ALL_FEATURES)
+WX_ARG_DISABLE(all-features,[ --disable-all-features disable all optional features to build minimal library], wxUSE_ALL_FEATURES)
dnl ---------------------------------------------------------------------------
dnl port selection
WX_ARG_FEATURE(ipc, [ --enable-ipc use interprocess communication (wxSocket etc.)], wxUSE_IPC)
+WX_ARG_FEATURE(baseevtloop, [ --enable-base-evtloop use event loop in console programs too], wxUSE_CONSOLE_EVENTLOOP)
+WX_ARG_FEATURE(epoolloop, [ --enable-epool-loop use wxEpollDispatcher class (Linux only)], wxUSE_EPOLL_DISPATCHER)
+WX_ARG_FEATURE(selectloop, [ --enable-select-loop use wxSelectDispatcher class], wxUSE_SELECT_DISPATCHER)
+
dnl please keep the settings below in alphabetical order
WX_ARG_FEATURE(apple_ieee, [ --enable-apple_ieee use the Apple IEEE codec], wxUSE_APPLE_IEEE)
WX_ARG_FEATURE(arcstream, [ --enable-arcstream use wxArchive streams], wxUSE_ARCHIVE_STREAMS)
AC_CHECK_HEADER([sys/select.h],,, [AC_INCLUDES_DEFAULT()])
fi
-dnl defines HAVE_SYS_EPOLL_H - for epoll mainloop implementation in wxbase
-AC_CHECK_HEADERS(sys/epoll.h)
-
dnl ---------------------------------------------------------------------------
dnl Checks for compiler characteristics
dnl ---------------------------------------------------------------------------
AC_DEFINE(wxUSE_OBJC_UNIQUIFYING)
fi
+dnl ---------------------------------------------------------------------------
+dnl console event loop stuff
+dnl ---------------------------------------------------------------------------
+
+if test "$wxUSE_CONSOLE_EVENTLOOP" = "yes"; then
+ AC_DEFINE(wxUSE_CONSOLE_EVENTLOOP)
+
+ if test "$wxUSE_UNIX" = "yes"; then
+ if test "$wxUSE_SELECT_DISPATCHER" = "yes"; then
+ AC_DEFINE(wxUSE_SELECT_DISPATCHER);
+ fi
+
+ if test "$wxUSE_EPOLL_DISPATCHER" = "yes"; then
+ AC_CHECK_HEADERS(sys/epoll.h)
+ if test "$ac_cv_header_sys_epoll_h" = "yes"; then
+ AC_DEFINE(wxUSE_EPOLL_DISPATCHER)
+ else
+ AC_MSG_WARN([sys/epoll.h not available, wxEpollDispatcher disabled])
+ fi
+ fi
+ fi
+fi
+
dnl ---------------------------------------------------------------------------
dnl time/date functions
dnl ---------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxConsoleAppTraitsBase : public wxAppTraits
{
public:
+#if !wxUSE_CONSOLE_EVENTLOOP
+ virtual wxEventLoopBase *CreateEventLoop() { return NULL; }
+#endif // !wxUSE_CONSOLE_EVENTLOOP
+
#if wxUSE_LOG
virtual wxLog *CreateLogTarget();
#endif // wxUSE_LOG
# include "wx/x11/chkconf.h"
#endif
+#ifdef __UNIX__
+# include "wx/unix/chkconf.h"
+#endif
+
#ifdef __WXUNIVERSAL__
# include "wx/univ/chkconf.h"
#endif
please keep the options in alphabetical order!
*/
+#ifndef wxUSE_CONSOLE_EVENTLOOP
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_CONSOLE_EVENTLOOP must be defined."
+# else
+# define wxUSE_CONSOLE_EVENTLOOP 0
+# endif
+#endif /* !defined(wxUSE_CONSOLE_EVENTLOOP) */
+
#ifndef wxUSE_CRASHREPORT
/* this one is special: as currently it is Windows-only, don't force it
to be defined on other platforms */
# error "wxFileConfig is required by wxDFB port"
#endif
+#if wxUSE_SOCKETS && !wxUSE_SELECT_DISPATCHER
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxSocket requires wxSelectDispatcher in wxDFB"
+# else
+# undef wxUSE_SELECT_DISPATCHER
+# define wxUSE_SELECT_DISPATCHER 1
+# endif
+#endif
+
#endif /* _WX_DFB_CHKCONF_H_ */
// Recommended setting: 1 (but can be safely disabled if you don't use it)
#define wxUSE_BASE64 1
+// Set this to 1 to be able to use wxEventLoop even in console applications
+// (i.e. using base library only, without GUI). This is mostly useful for
+// processing socket events but is also necessary to use timers in console
+// applications
+//
+// Default is 1.
+//
+// Recommended setting: 1 (but can be safely disabled if you don't use it)
+#define wxUSE_CONSOLE_EVENTLOOP 1
+
// Set wxUSE_(F)FILE to 1 to compile wx(F)File classes. wxFile uses low level
// POSIX functions for file access, wxFFile uses ANSI C stdio.h functions.
//
// Recommended setting: 1 (but can be safely disabled if you don't use it)
#define wxUSE_BASE64 1
+// Set this to 1 to be able to use wxEventLoop even in console applications
+// (i.e. using base library only, without GUI). This is mostly useful for
+// processing socket events but is also necessary to use timers in console
+// applications
+//
+// Default is 1.
+//
+// Recommended setting: 1 (but can be safely disabled if you don't use it)
+#define wxUSE_CONSOLE_EVENTLOOP 1
+
// Set wxUSE_(F)FILE to 1 to compile wx(F)File classes. wxFile uses low level
// POSIX functions for file access, wxFFile uses ANSI C stdio.h functions.
//
// Recommended setting: 1 (but can be safely disabled if you don't use it)
#define wxUSE_BASE64 1
+// Set this to 1 to be able to use wxEventLoop even in console applications
+// (i.e. using base library only, without GUI). This is mostly useful for
+// processing socket events but is also necessary to use timers in console
+// applications
+//
+// Default is 1.
+//
+// Recommended setting: 1 (but can be safely disabled if you don't use it)
+#define wxUSE_CONSOLE_EVENTLOOP 1
+
// Set wxUSE_(F)FILE to 1 to compile wx(F)File classes. wxFile uses low level
// POSIX functions for file access, wxFFile uses ANSI C stdio.h functions.
//
// Recommended setting: 1 (but can be safely disabled if you don't use it)
#define wxUSE_BASE64 1
+// Set this to 1 to be able to use wxEventLoop even in console applications
+// (i.e. using base library only, without GUI). This is mostly useful for
+// processing socket events but is also necessary to use timers in console
+// applications
+//
+// Default is 1.
+//
+// Recommended setting: 1 (but can be safely disabled if you don't use it)
+#define wxUSE_CONSOLE_EVENTLOOP 1
+
// Set wxUSE_(F)FILE to 1 to compile wx(F)File classes. wxFile uses low level
// POSIX functions for file access, wxFFile uses ANSI C stdio.h functions.
//
// Recommended setting: 1 (but can be safely disabled if you don't use it)
#define wxUSE_BASE64 1
+// Set this to 1 to be able to use wxEventLoop even in console applications
+// (i.e. using base library only, without GUI). This is mostly useful for
+// processing socket events but is also necessary to use timers in console
+// applications
+//
+// Default is 1.
+//
+// Recommended setting: 1 (but can be safely disabled if you don't use it)
+#define wxUSE_CONSOLE_EVENTLOOP 1
+
// Set wxUSE_(F)FILE to 1 to compile wx(F)File classes. wxFile uses low level
// POSIX functions for file access, wxFFile uses ANSI C stdio.h functions.
//
// Recommended setting: 1 (but can be safely disabled if you don't use it)
#define wxUSE_BASE64 1
+// Set this to 1 to be able to use wxEventLoop even in console applications
+// (i.e. using base library only, without GUI). This is mostly useful for
+// processing socket events but is also necessary to use timers in console
+// applications
+//
+// Default is 1.
+//
+// Recommended setting: 1 (but can be safely disabled if you don't use it)
+#define wxUSE_CONSOLE_EVENTLOOP 1
+
// Set wxUSE_(F)FILE to 1 to compile wx(F)File classes. wxFile uses low level
// POSIX functions for file access, wxFFile uses ANSI C stdio.h functions.
//
#include "wx/defs.h"
+#if wxUSE_SELECT_DISPATCHER
+
#include <sys/types.h>
#include "wx/private/fdiodispatcher.h"
int m_maxFD;
};
+#endif // wxUSE_SELECT_DISPATCHER
#endif // _WX_PRIVATE_SOCKETEVTDISPATCH_H_
// Recommended setting: 1 (but can be safely disabled if you don't use it)
#define wxUSE_BASE64 1
+// Set this to 1 to be able to use wxEventLoop even in console applications
+// (i.e. using base library only, without GUI). This is mostly useful for
+// processing socket events but is also necessary to use timers in console
+// applications
+//
+// Default is 1.
+//
+// Recommended setting: 1 (but can be safely disabled if you don't use it)
+#define wxUSE_CONSOLE_EVENTLOOP 1
+
// Set wxUSE_(F)FILE to 1 to compile wx(F)File classes. wxFile uses low level
// POSIX functions for file access, wxFFile uses ANSI C stdio.h functions.
//
class WXDLLEXPORT wxConsoleAppTraits : public wxConsoleAppTraitsBase
{
public:
+#if wxUSE_CONSOLE_EVENTLOOP
virtual wxEventLoopBase *CreateEventLoop();
+#endif // wxUSE_CONSOLE_EVENTLOOP
virtual bool CreateEndProcessPipe(wxExecuteData& execData);
virtual bool IsWriteFDOfEndProcessPipe(wxExecuteData& execData, int fd);
virtual void DetachWriteFDOfEndProcessPipe(wxExecuteData& execData);
--- /dev/null
+/*
+ * Name: wx/unix/chkconf.h
+ * Purpose: Unix-specific config settings consistency checks
+ * Author: Vadim Zeitlin
+ * Created: 2007-07-14
+ * RCS-ID: $Id$
+ * Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwidgets.org>
+ * Licence: wxWindows licence
+ */
+
+/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */
+
+#if wxUSE_CONSOLE_EVENTLOOP
+# if !wxUSE_SELECT_DISPATCHER && !wxUSE_EPOLL_DISPATCHER
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxSelect/EpollDispatcher needed for console event loop"
+# else
+# undef wxUSE_SELECT_DISPATCHER
+# define wxUSE_SELECT_DISPATCHER 1
+# endif
+# endif
+#endif /* wxUSE_CONSOLE_EVENTLOOP */
#ifndef _WX_UNIX_EVTLOOP_H_
#define _WX_UNIX_EVTLOOP_H_
+#if wxUSE_CONSOLE_EVENTLOOP
+
#include "wx/private/fdiodispatcher.h"
#include "wx/unix/pipe.h"
DECLARE_NO_COPY_CLASS(wxConsoleEventLoop)
};
+#endif // wxUSE_CONSOLE_EVENTLOOP
+
#endif // _WX_UNIX_EVTLOOP_H_
#include "wx/defs.h"
-#ifdef HAVE_SYS_EPOLL_H
+#ifdef wxUSE_EPOLL_DISPATCHER
#include "wx/private/fdiodispatcher.h"
int m_epollDescriptor;
};
-#endif // HAVE_SYS_EPOLL_H
+#endif // wxUSE_EPOLL_DISPATCHER
#endif // _WX_PRIVATE_SOCKETEVTDISPATCH_H_
#ifndef _WX_X11_CHKCONF_H_
#define _WX_X11_CHKCONF_H_
-
/* wxPalette is always needed */
#if !wxUSE_PALETTE
# error "wxX11 requires wxUSE_PALETTE=1"
#endif
+#if wxUSE_SOCKETS && !wxUSE_SELECT_DISPATCHER
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxSocket requires wxSelectDispatcher in wxX11"
+# else
+# undef wxUSE_SELECT_DISPATCHER
+# define wxUSE_SELECT_DISPATCHER 1
+# endif
+#endif
+
#endif /* _WX_X11_CHKCONF_H_ */
#define wxUSE_BASE64 0
+#define wxUSE_CONSOLE_EVENTLOOP 0
+
#define wxUSE_FILE 0
#define wxUSE_FFILE 0
/* --- end common options --- */
+/*
+ * Unix-specific options
+ */
+#define wxUSE_SELECT_DISPATCHER 0
+#define wxUSE_EPOLL_DISPATCHER 0
+
/* for some features we don't have dedicated configure switches, so just choose
* the common values automatically */
#if (defined(__WIN32__) && !defined(__WXUNIVERSAL__)) || defined(__WXPM__)
// for compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
-#if wxUSE_SOCKETS
+#if wxUSE_SOCKETS && wxUSE_SELECT_DISPATCHER
#include "wx/private/gsocketiohandler.h"
#include "wx/unix/private.h"
// for compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
+#if wxUSE_SELECT_DISPATCHER
+
#include "wx/private/selectdispatcher.h"
#include "wx/module.h"
#include "wx/timer.h"
IMPLEMENT_DYNAMIC_CLASS(wxSelectDispatcherModule, wxModule)
+#endif // wxUSE_SELECT_DISPATCHER
#endif // wxUSE_TIMER
+#if wxUSE_CONSOLE_EVENTLOOP
+
wxEventLoopBase *wxConsoleAppTraits::CreateEventLoop()
{
return new wxEventLoop();
}
+#endif // wxUSE_CONSOLE_EVENTLOOP
// for compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
-#ifdef HAVE_SYS_EPOLL_H
+#ifdef wxUSE_EPOLL_DISPATCHER
#include "wx/unix/private/epolldispatcher.h"
#include "wx/unix/private.h"
IMPLEMENT_DYNAMIC_CLASS(wxEpollDispatcherModule, wxModule)
-#endif // HAVE_SYS_EPOLL_H
+#endif // wxUSE_EPOLL_DISPATCHER
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
-#include "wx/evtloop.h"
+#if wxUSE_CONSOLE_EVENTLOOP
#ifndef WX_PRECOMP
#include "wx/app.h"
#endif
#include <errno.h>
+#include "wx/evtloop.h"
#include "wx/thread.h"
#include "wx/module.h"
#include "wx/unix/private/timer.h"
#define TRACE_EVENTS _T("events")
-//this code should not be compiled when GUI is defined
-//(monolithic build issue)
-#if !wxUSE_GUI
-
// ===========================================================================
// wxEventLoop::PipeIOHandler implementation
// ===========================================================================
return;
}
-#ifdef HAVE_SYS_EPOLL_H
+#ifdef wxUSE_EPOLL_DISPATCHER
m_dispatcher = wxEpollDispatcher::Get();
if ( !m_dispatcher )
-#endif // HAVE_SYS_EPOLL_H
- {
+#endif // wxUSE_EPOLL_DISPATCHER
+#if wxUSE_SELECT_DISPATCHER
m_dispatcher = wxSelectDispatcher::Get();
- }
+#endif // wxUSE_WCHAR_T
wxCHECK_RET( m_dispatcher, _T("failed to create IO dispatcher") );
wxTheApp->CheckSignal();
}
-#endif // !wxUSE_GUI
+#endif // wxUSE_CONSOLE_EVENTLOOP
wx/unix/app.h
wx/unix/apptbase.h
wx/unix/apptrait.h
+wx/unix/chkconf.h
wx/unix/execute.h
wx/unix/evtloop.h
wx/unix/mimetype.h
wx/unix/app.h
wx/unix/apptbase.h
wx/unix/apptrait.h
+wx/unix/chkconf.h
wx/unix/execute.h
wx/unix/evtloop.h
wx/unix/mimetype.h
wx/unix/app.h
wx/unix/apptbase.h
wx/unix/apptrait.h
+wx/unix/chkconf.h
wx/unix/execute.h
wx/unix/evtloop.h
wx/unix/mimetype.h