Commit Graph

61 Commits

Author SHA1 Message Date
Stefan Csomor
0e4a6d339a using Run of base class
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74610 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-28 14:32:35 +00:00
Stefan Csomor
a8123c1359 OSX adaptions
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74603 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-27 19:00:25 +00:00
Vadim Zeitlin
3f66f6a5b3 Remove all lines containing cvs/svn "$Id$" keyword.
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.

If nothing else, this will make an eventual transition to Git simpler.

Closes #14487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-26 16:02:46 +00:00
Vadim Zeitlin
71e9885be0 Make wxEventLoop::AddSourceForFD() static.
Any event sources should be registered with all the event loops, including the
ones that will be started in the future, and not only the current (and
potentially not even existing yet) one. So make AddSourceForFD() method static.

To still allow it to do different things in console and GUI applications, as
it must, virtualize it via the new wxEventLoopSourcesManager class which has
different implementations in the two cases, returned via wxAppTraits as usual.

Notice that this required moving the implementation of this method from
src/osx/core/evtloop_cf.cpp to src/osx/core/utilsexc_cf.cpp as the former file
is base-only and didn't have access to wxGUIAppTraits.

See #10258.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74341 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-03 00:28:42 +00:00
Vadim Zeitlin
d3ad22bdb3 Add wxEventLoop::ScheduleExit().
This method allows to request exiting from the given event loop even if it's
not the currently active one, unlike Exit() which would assert in this case.
With it, it becomes possible to ask the loop to terminate as soon as possible
even if a nested loop is currently running.

See #10258.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74335 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-03 00:26:13 +00:00
Vadim Zeitlin
c738d187e9 Add wxEventLoopBase::DoRun().
Call it from public Run() after setting the loop as active and resetting
m_shouldExit flag.

No real changes, just cut down on the code duplication among the ports and
make it easier to implement the upcoming changes. see #10258.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74333 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-03 00:25:23 +00:00
Vadim Zeitlin
a1fe5f9048 Move wxEventLoopManual::m_shouldExit to wxEventLoopBase.
No real changes, just make this flag available to the other event loop
implementations as they will need it soon.

See #10258.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74332 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-03 00:24:58 +00:00
Vadim Zeitlin
7ce6da52a1 Extract OS X non-GUI event loop in a separate header.
This will allow its reuse from non-wxOSX ports, e.g. wxGTK under OS X.

Closes #14519.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72206 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-07-24 20:45:43 +00:00
Vadim Zeitlin
da0ee16ef9 Use __DARWIN__ instead of __WXOSX__ in non-GUI code.
This fixes compilation of non-wxOSX ports (e.g. wxGTK) under OS X.

Also make the difference between the two symbols more clear in the
documentation.

Closes #14503.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72180 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-07-23 15:03:42 +00:00
Vadim Zeitlin
e27f554012 Use the same console event loop in wxBase and wxCore in wxMSW.
Refactor the console event loop code into separate files to untangle it from
the GUI version and ensure that it doesn't depend on the GUI at all. It can
now be defined in the base library and simply reused by the core one.

This also makes the console event loop usable for other ports under Windows,
e.g. wxGTK.

Closes #14426.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72008 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-07-10 23:52:00 +00:00
Vadim Zeitlin
acbed1149e Fixes for building wxGTK under Cygwin.
Test for __WXMSW__ instead of __CYGWIN__ to not affect building non-MSW ports
such as wxGTK under Cygwin.

See #14382.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71799 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-06-17 21:35:14 +00:00
Vadim Zeitlin
bd362275b8 Remove Palm OS port.
The platform targeted by this port doesn't exist any more and the port never
achieved really working state so remove the code to avoid having to maintain
it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70345 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-01-15 01:05:28 +00:00
Vadim Zeitlin
715e4f7e3e Fix Cygwin 1.7 build.
Avoid using Cygwin sockets as our code assumes that we use WinSock API under
Windows currently (this might change in the future) by defining
__USE_W32_SOCKETS.

Use new, safer and more efficient cygwin_conv_path() function.

Use t_str() instead of fn_str() with Windows API taking file names, under
Cygwin they are different and using fn_str() is incorrect.

A few other minor fixes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65057 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-07-23 23:32:46 +00:00
Vadim Zeitlin
5d670c2cc7 Fix wxGTK1 event loop definition mismatch between base/GUI.
We must define wxEventLoopBase in the same way in base and GUI code,
otherwise, even though we fool the compiler into accepting our code, it
crashes or behaves otherwise weirdly during run-time because of vtbl mismatch.

This fixes wxGTK1 which was crashing on startup since the FSWATCHER branch
merge in r62474 and associated changes to support the event loop sources.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64146 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-26 14:19:31 +00:00
Stefan Csomor
9aee121225 adding proper removal of observer for stacked event loops, using cfrunloop for console on osx as well
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63698 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-03-17 08:05:04 +00:00
Stefan Csomor
80eee8378f streamlining OSX event support third step, using platform specific native run methods for event loops
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63697 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-03-17 07:14:03 +00:00
Jouk Jansen
bc7879ec4c fixing wx/evtloop.h for gtk1
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62507 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-29 07:30:42 +00:00
Vadim Zeitlin
5cd9986613 Refactor wxEventLoopSource-related code.
Currently wxEventLoopSource can't be created directly and can only be used to
monitor file descriptors so reduce the API to just wxEventLoop::AddSourceForFD()
and remove AddSource(), RemoveSource() and RemoveAllSources() which couldn't
be implemented for all ports. This makes the code much simpler without any
loss of functionality.

Make wxEventLoopSource responsible for removing itself from the event loop
when it is deleted. This allows to remove IsOk() and Invalidate() methods
making the code simpler and gets rid of various sets/maps which were used
before.

This also allows to support event loop sources in Carbon as well: wxOSX/Carbon
now compiles and works with wxUSE_FSWATCHER==1.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62475 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-22 11:36:35 +00:00
Vadim Zeitlin
6b8ef0b35d Merge SOC2009_FSWATCHER branch into trunk.
Merges everything from the branch with only some minor changes, mostly renamed
wxUSE_FSWATCHER_{INOTIFY,KQUEUE} to wxHAS_{INOTIFY,KQUEUE}.

Add wxFileSystemWatcher and related classes.

Also introduces wxEventLoopSource.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62474 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-22 11:35:43 +00:00
Vadim Zeitlin
26bacb82ff Dispatch pending events without waiting for idle time (closes #10994).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61470 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-07-20 12:14:42 +00:00
Vadim Zeitlin
2a392e2d16 No real changes, just made wxEventLoopManual uncopyable.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61442 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-07-17 16:55:55 +00:00
Vadim Zeitlin
a758f601dd No real changes, just refactor wxEventLoop/wxApp::ProcessIdle().
Old code called wxApp::ProcessIdle() from wxEventLoopManualRun::Run() which called wxEventLoop::ProcessIdle() which called wxApp methods from it. In the new version wxEventLoopManualRun::Run() calls wxEventLoopManualRun::ProcessIdle() which calls wxApp::ProcessIdle() which calls other wxApp methods which seems to make more sense and also allows overriding ProcessIdle() in either wxEventLoopManual or wxApp-derived classes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61441 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-07-17 16:52:43 +00:00
Francesco Montorsi
8e40ed8535 move pending event processing back to wxApp (these methods were moved into wxEventLoopBase during YieldFor() refactoring - see #10320): we need to be able to queue events even when there's no event loop running (e.g. wxApp::OnInit)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59284 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-02 20:45:22 +00:00
Francesco Montorsi
ec38d07d03 add wxAppConsoleBase::OnEventLoopEnter/Exit callbacks; add wxEventLoopBase::IsMain() and wxAppConsoleBase::GetMainLoop() helpers
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59132 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-25 13:23:12 +00:00
Paul Cornett
1e04d2bf54 fix evtloop.h header dependency
implementation headers go first to catch this kind of problem, don't move them to fix a build error

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58951 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-16 17:19:17 +00:00
Francesco Montorsi
dde19c2180 second part of #10320: move wxApp event handling functions to wxEventLoopBase (in particular move Yield() functions); add backward compatible redirections to wxApp; update docs; remove global lists wxPendingEvents and wxPendingEventsLocker
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58911 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-15 14:25:08 +00:00
Vadim Zeitlin
c0c133e13b add wx-prefixed and semicolon-requiring versions of DECLARE_NO_{COPY,ASSIGN}_CLASS macros
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58757 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-08 11:45:59 +00:00
Vadim Zeitlin
1df4b19481 implement DispatchTimeout() for wxCocoa
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57620 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-12-28 14:25:00 +00:00
Vadim Zeitlin
564c7fc412 implement wxEventLoop::DispatchTimeout() for wxGTK (thanks Paul) and rewrote it to not use wxEventLoopImpl which it doesn't need
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57581 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-12-27 11:01:39 +00:00
Vadim Zeitlin
9c26672d4d move generic DispatchTimeout() implementation in the header as evtloopcmn.cpp is part of wxBase and so can't define a method of a wxCore class
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57575 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-12-27 00:04:57 +00:00
Vadim Zeitlin
9af42efda6 added wxEventLoop::DispatchTimeout()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57571 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-12-26 22:28:34 +00:00
Vadim Zeitlin
1a7cfc94a3 compilation fixes for wxUSE_CONSOLE_EVENTLOOP==0
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55263 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-08-25 19:23:26 +00:00
Stefan Csomor
ef0e92205a fixing file paths after renaming
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54125 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-06-11 19:17:41 +00:00
Stefan Neis
f212e222e7 Ensure that wxApp::Yield is always processing pending event by creating a
temporary event loop if needed.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53606 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-05-16 12:50:26 +00:00
Francesco Montorsi
53a2db124c substitute WXDLLEXPORT with WXDLLIMPEXP_CORE and WXDLLEXPORT_DATA with WXDLLIMPEXP_DATA_CORE
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52834 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-03-26 15:06:00 +00:00
Václav Slavík
b5dbe15d0b added WXDLLIMPEXP_FWD_FOO macros in addition to WXDLLIMPEXP_FOO for use with forward declarations (in preparation for GCC visibility support)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47254 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-07-09 10:09:52 +00:00
Vadim Zeitlin
2ddff00c92 don't define wxEventLoop class differently in GUI and base, this breaks the
ODR and hence results in many problems in practice; instead use wxEventLoopBase
whenever possible and #define wxEventLoop differently in console applications


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46158 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-05-22 02:30:01 +00:00
Vadim Zeitlin
b46b1d59d6 implement event loop for console applications (heavily modified patch 1715735)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46029 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-05-14 23:43:39 +00:00
Václav Slavík
b3c861501a initial (not yet working) code for DirectFB port
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40865 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-08-27 09:42:42 +00:00
Vadim Zeitlin
5b87e74ace added missing default value for wxEventLoopManual::Exit() parameter
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36851 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-01-13 01:32:38 +00:00
Vadim Zeitlin
c8026dea6c improved wxMac event loop implementation and refactored the code to share it with wxMSW
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36847 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-01-12 23:06:26 +00:00
Vadim Zeitlin
4d90072c22 implemented wxEventLoop for wxMac
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36846 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-01-12 20:09:00 +00:00
Vadim Zeitlin
77fb1a02aa share wxEventLoop::IsRunning() implementation between all ports; moved wxEventLoopActivator used by it in wx/evtloop.h instead of duplicating it in 3 different .cpp files (and not using it at all in 3 other ones)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36842 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-01-12 16:56:48 +00:00
Mart Raudsepp
8907154c1a Nuke #pragma implementation/interface's
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35650 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-09-23 12:56:45 +00:00
Włodzimierz Skiba
4055ed8281 Use __WXPALMOS__ for PalmOS port which fits __WX$(TOOLKIT)__ of bakefiles. Do not depend on MSW macros in PalmOS port. Source cleaning.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31087 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-12-20 12:44:22 +00:00
Julian Smart
ffecfa5aeb Committed William Osborne's wxPalmOS port
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29996 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-10-19 13:40:30 +00:00
Robin Dunn
9213ca5d47 Made wxGTK's wxEventLoop::IsRunning a little more consistent with
wxMSW's and uninstall the idle handled like wxYield does so Pending
can eventually return false.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29267 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-09-23 00:58:21 +00:00
Włodzimierz Skiba
1a18887b88 Source cleaning: tabs, whitespaces, -1/wxID_ANY, TRUE/true, FALSE/false.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29123 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-09-13 18:03:44 +00:00
Robin Dunn
eaca2a2cfc Fixed compilation error
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28556 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-07-31 04:39:49 +00:00
Vadim Zeitlin
3754265e32 switched to wxEventLoopBase/wxEventLoop implementation (instead of m_impl based one) for wxMSW; minimal changes for the other ports
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28549 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-07-30 22:54:31 +00:00