Commit Graph

211 Commits

Author SHA1 Message Date
Václav Slavík
3f8cdda485 don't include private headers from wx/unix/evtloop.h
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58542 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-31 10:58:10 +00:00
Václav Slavík
86e9b8f28f wxDFB: use Unix event loop and timers (fixes #10408)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58520 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-30 15:21:47 +00:00
Václav Slavík
cd720f7e16 wxEpollDispatcher is in wxBase, not wxCore - fixed to use WXDLLIMPEXP_BASE
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58487 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-29 00:26:40 +00:00
Vadim Zeitlin
d3b9f782ef don't use annoying and unneeded in C++ casts of NULL to "T *" in all other files neither
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58227 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-19 13:55:27 +00:00
Francesco Montorsi
5249958203 don't use hardcoded constant 200; use wxSTACKWALKER_MAX_DEPTH instead
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58093 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-14 14:38:00 +00:00
Vadim Zeitlin
a12698abb7 added wxFDIODispatcher::HasPending() and implemented correctly wxConsoleEventLoop::Pending() using it to fix the pending events processing in console event loop based programs; also changed wxFDIODispatcher::Dispatch() return type/value to be able to indicate the errors
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57804 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-03 01:21:24 +00:00
Vadim Zeitlin
df21920b80 disable the events when we get a notification about socket being ready for IO and reenable them later after performing the IO in the Unix version to avoid continuous flood of ready notifications
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57796 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-02 21:53:30 +00:00
Vadim Zeitlin
39b61b0581 rename wxSocketSelectManager to wxSocketFDIOManager, the old name was confusing as it could be either select()- or epoll()-based
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57776 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-02 16:59:23 +00:00
Vadim Zeitlin
c363ead1e2 remove wxSOCKET_MAX_EVENT, it is not really necessary and results in gcc warnings about unhandled enum value in switch in existing code (including our own sample)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57653 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-12-30 00:11:04 +00:00
Vadim Zeitlin
14372de82e move Read/Write() to common code, there was almost nothing platform-specific in it
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57613 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-12-27 22:49:46 +00:00
Vadim Zeitlin
62088a3c3b wxSocketImpl::Shutdown() doesn't need to be virtual, its implementation can the same in Unix and Win32 versions (events are already disabled by Close() so there is no need to do it again explicitly under Unix)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57611 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-12-27 22:03:34 +00:00
Vadim Zeitlin
7d66cdccd0 don't remove/add back the socket to the list of inputs monitored by the event loop all the time but just leave it there until the socket is destroyed; this should be beneficial from performance point of view (although hard to measure) and also makes the code simpler
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57610 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-12-27 21:56:05 +00:00
Vadim Zeitlin
5e9238f9c6 remove the badle defined and apparently unnecessary wxSocketImpl::m_detected field
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57608 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-12-27 21:48:42 +00:00
Vadim Zeitlin
2b036c4b23 our sockets are always non-blocking anyhow so throw away all the code dealing with checking if they're blocking; also merge Unix/Win32 versions of connect() and accept() handling as they were almost identical except for the different checking of the return value which was factored out into a platform-specific GetLastError() function
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57600 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-12-27 17:15:22 +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
aa8cbe0b64 return true if we did anything in NotifyExpired()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57570 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-12-26 22:27:02 +00:00
Vadim Zeitlin
22185a1f15 remove m_use_events from Unix wxSocket implementation, we always need asynchronous socket notifications now (and this was always the case under Windows anyhow), even if we don't always generate wx events corresponding to them
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57569 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-12-26 20:20:46 +00:00
Vadim Zeitlin
c6b1063250 refactor Input/Output_Timeout: don't duplicate the same code in MSW/Unix code and also don't duplicate it for input and output, one function is enough for both
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57558 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-12-25 20:27:35 +00:00
Vadim Zeitlin
07792edb2e use void pointers, not char ones, in socket IO functions
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57546 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-12-25 18:29:08 +00:00
Vadim Zeitlin
54cb21d692 remove wxSocketManager::CreateSocket() function, we don't need to have different wxSocketImpl implementation for the same platform, all the differences between console and GUI applications are abstracted by wxSocketManager::Install/Uninstall_Callback() methods
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57000 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-11-28 15:06:50 +00:00
Vadim Zeitlin
acd523a964 move enabled callbacks flag down to wxSocketImplUnix from wxSocketImplFDIO, this allows to get rid of the letter
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56999 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-11-28 15:01:41 +00:00
Vadim Zeitlin
a9d859df6f make wxSocketImplUnix inherit from wxFDIOHandler as they're used for almost the same purpose; this removes the need for the bridge wxSocketOHandler class
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56998 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-11-28 14:39:49 +00:00
Vadim Zeitlin
9123889f20 no real changes, just moved wxSocketImplUnix ctor inline
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56997 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-11-28 13:43:41 +00:00
Vadim Zeitlin
86c5b12b21 also rename gsocketiohandler.* to socketiohandler.* and move it to wxNet where it belongs
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56996 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-11-28 13:37:19 +00:00
Vadim Zeitlin
6091364135 rename various gsock* files to sock* (except for MSW where this will be done later)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56995 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-11-28 13:04:47 +00:00
Vadim Zeitlin
51fe4b60ab Streamline wxSocket code: wxSocketBase now uses wxSocketImpl (previously known
as GSocket) which is a base class with various wxSocketImplXXX implementations
provided by different wxSocketManagers.

Share more code between ports (still not finished).

Refactor some code inside wxSocketImpl itself to be less redundant and fixed a
couple of minor bugs in the process.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56994 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-11-28 12:47:07 +00:00
Vadim Zeitlin
36b6a92876 compilation fix for OS X (missing unistd.h)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56966 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-11-25 13:57:19 +00:00
Vadim Zeitlin
f0fbbe2364 trying to resolve GSocketManager API mess: the meaning of Install/Uninstall_Callback() and Enable/Disable_Events() has diverged in different ports and didn't make any sense any more; merge them in a single function (with still differing semantics though); also added Close_Socket()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56964 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-11-25 13:33:07 +00:00
Vadim Zeitlin
025644120d move more socket functions common to Winsock and BSD implementations to common code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56938 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-11-23 13:30:42 +00:00
Vadim Zeitlin
3a6ec3c880 don't duplicate SetInitialSocketBuffers()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56937 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-11-23 13:21:11 +00:00
Vadim Zeitlin
53a161e101 continuation of GSocket/wxSocket merge: always create GSocket associated to a wxSocket instead of (always) doing it using a separate call later; remove support for user callbacks which wasn't implemented in Windows version and deprecated since 10 years or so
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56934 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-11-23 13:12:46 +00:00
Vadim Zeitlin
40e7c0b913 compilation fixes for Unix after moving wxFD_XXX macros from wx/unix/private.h
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56927 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-11-23 01:52:20 +00:00
Vadim Zeitlin
eb97543d28 don't duplicate GSocket creation/destruction and shutdown code in BSD and Winsock implementations
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56926 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-11-23 01:44:50 +00:00
Vadim Zeitlin
f0db5d7587 do not require a running event loop, even under MSW, for the sockets to work: if the user code doesn't use events there is no reason for it to run the event loop, especially as it's not needed under the other platforms; instead use the same Select() implementation as under Unix under MSW too and, to avoid duplicating it, put it into the new GSocketBase class
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56923 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-11-23 00:11:09 +00:00
Vadim Zeitlin
5c33522fca replace wx_{const,static,reinterpret}_cast with their standard C++ equivalents
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56644 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-11-02 02:39:52 +00:00
Vadim Zeitlin
04021d6fac made Dispatch() return bool indicating whether we processed any events inside it or if the timeout expired
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56358 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-10-16 12:33:05 +00:00
Vadim Zeitlin
d80170bd4d extact common GAddress declarations to the common header instead of duplicating them for Windows and Unix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55934 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-09-28 17:37:01 +00:00
Vadim Zeitlin
4db307e110 build fixes for wxUSE_ON_FATAL_EXCEPTION==0 (#9937)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55593 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-09-14 00:26:29 +00:00
Vadim Zeitlin
8b73c5318c chanegd wxTlsValue to be pointer-like instead of value-like which doesn't work for UDTs; use __thread keyword with mingw32 >= 4.3 too; use library-based thread-specific variables support in wxString cache now that it is fixed to work there; finally added a unit test for TLS stuff
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55361 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-08-29 23:28:42 +00:00
Vadim Zeitlin
64a044d5a6 added wxTLS_TYPE() macro
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55019 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-08-08 02:59:32 +00:00
Robert Roebling
05f616efaa Add stub for parsing globs file
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54448 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-07-01 09:28:08 +00:00
Robert Roebling
d39e2bbcf7 Remaining conversion to read-only XDG MIME types code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54446 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-07-01 08:31:50 +00:00
Robert Roebling
29886d1bf8 Removed most of the pre-XDG MIME code from the Unix implementation, many speed-ups by simplification
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54434 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-06-30 11:58:41 +00:00
Vadim Zeitlin
c39d2e0a38 added multisampling (anti-aliasing) support to wxGLCanvas (#9145)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54022 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-06-08 00:12:12 +00:00
Paul Cornett
3abc756645 prevent crash if panel/kicker is killed, bug 1872724
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53563 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-05-11 22:45:36 +00:00
Vadim Zeitlin
2404ce8d8a argh, really, really fix Darwin build
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53129 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-04-11 13:01:34 +00:00
Vadim Zeitlin
a0f4d36895 GetSocketManager() has no GUI-specific version under Darwin finally
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53128 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-04-11 12:59:22 +00:00
Vadim Zeitlin
b2915c82ca also use AddProcessCallback() and GetSocketManager() under Darwin
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53127 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-04-11 12:51:51 +00:00
Vadim Zeitlin
f05114174f oops, added missing #endif
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53100 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-04-10 10:45:47 +00:00
Vadim Zeitlin
13d4419b86 only declare AddProcessCallback for wxMotif and wxGTK
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53099 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-04-10 10:44:06 +00:00