projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use MSWAlwaysDrawBg() to fix the problem with black background; rewrote/cleaned up...
[wxWidgets.git]
/
src
/
motif
/
evtloop.cpp
diff --git
a/src/motif/evtloop.cpp
b/src/motif/evtloop.cpp
index 0c68418f27cd9d4cffc6bc131760f1841cc7e4dc..431f2a11b3a2a600a67f41263344d0195eb4aaa1 100644
(file)
--- a/
src/motif/evtloop.cpp
+++ b/
src/motif/evtloop.cpp
@@
-6,7
+6,7
@@
// Created: 01.11.02
// RCS-ID: $Id$
// Copyright: (c) 2002 Mattia Barbon
// Created: 01.11.02
// RCS-ID: $Id$
// Copyright: (c) 2002 Mattia Barbon
-// License: wxWindows licen
s
e
+// License: wxWindows licen
c
e
///////////////////////////////////////////////////////////////////////////////
// ============================================================================
///////////////////////////////////////////////////////////////////////////////
// ============================================================================
@@
-17,7
+17,7
@@
// headers
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
-#if
def __GNUG__
+#if
defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "evtloop.h"
#endif
#pragma implementation "evtloop.h"
#endif
@@
-35,6
+35,7
@@
#include "wx/evtloop.h"
#include "wx/event.h"
#include "wx/app.h"
#include "wx/evtloop.h"
#include "wx/event.h"
#include "wx/app.h"
+#include "wx/window.h"
#ifdef __VMS__
#pragma message disable nosimpint
#ifdef __VMS__
#pragma message disable nosimpint
@@
-82,9
+83,7
@@
private:
static bool SendIdleMessage()
{
static bool SendIdleMessage()
{
- wxIdleEvent event;
-
- return wxTheApp->ProcessEvent(event) && event.MoreRequested();
+ return wxTheApp->ProcessIdle();
}
bool wxEventLoopImpl::SendIdleMessage()
}
bool wxEventLoopImpl::SendIdleMessage()
@@
-100,18
+99,13
@@
bool wxEventLoopImpl::SendIdleMessage()
// wxEventLoop running and exiting
// ----------------------------------------------------------------------------
// wxEventLoop running and exiting
// ----------------------------------------------------------------------------
-wxEventLoop *wxEventLoop::ms_activeLoop = NULL;
+wxEventLoop *wxEventLoop
Base
::ms_activeLoop = NULL;
wxEventLoop::~wxEventLoop()
{
wxASSERT_MSG( !m_impl, _T("should have been deleted in Run()") );
}
wxEventLoop::~wxEventLoop()
{
wxASSERT_MSG( !m_impl, _T("should have been deleted in Run()") );
}
-bool wxEventLoop::IsRunning() const
-{
- return m_impl != NULL;
-}
-
int wxEventLoop::Run()
{
// event loops are not recursive, you need to create another loop!
int wxEventLoop::Run()
{
// event loops are not recursive, you need to create another loop!
@@
-233,7
+227,7
@@
void ProcessXEvent(XEvent* event)
* window is recieved. Prevents flicker as windows are resized.
*/
* window is recieved. Prevents flicker as windows are resized.
*/
- Display *disp =
XtDisplay((Widget) wxTheApp->GetTopLevelWidget())
;
+ Display *disp =
event->xany.display
;
Window win = event->xany.window;
XEvent report;
Window win = event->xany.window;
XEvent report;
@@
-259,7
+253,7
@@
bool CheckForAccelerator(XEvent* event)
{
// Find a wxWindow for this window
// TODO: should get display for the window, not the current display
{
// Find a wxWindow for this window
// TODO: should get display for the window, not the current display
- Widget widget = XtWindowToWidget(
(Display*) wxGetDisplay()
,
+ Widget widget = XtWindowToWidget(
event->xany.display
,
event->xany.window);
wxWindow* win = NULL;
event->xany.window);
wxWindow* win = NULL;
@@
-293,8
+287,8
@@
bool CheckForKeyDown(XEvent* event)
{
if (event->xany.type == KeyPress)
{
{
if (event->xany.type == KeyPress)
{
- Widget widget = XtWindowToWidget(
(Display*) wxGetDisplay()
,
- event->xany.window);
+ Widget widget = XtWindowToWidget(
event->xany.display
,
+
event->xany.window);
wxWindow* win = NULL;
// Find the first wxWindow that corresponds to this event window
wxWindow* win = NULL;
// Find the first wxWindow that corresponds to this event window
@@
-307,7
+301,7
@@
bool CheckForKeyDown(XEvent* event)
wxKeyEvent keyEvent(wxEVT_KEY_DOWN);
wxTranslateKeyEvent(keyEvent, win, (Widget) 0, event);
wxKeyEvent keyEvent(wxEVT_KEY_DOWN);
wxTranslateKeyEvent(keyEvent, win, (Widget) 0, event);
- return win->ProcessEvent( keyEvent );
+ return win->
GetEventHandler()->
ProcessEvent( keyEvent );
}
return false;
}
return false;
@@
-319,8
+313,8
@@
bool CheckForKeyUp(XEvent* event)
{
if (event->xany.type == KeyRelease)
{
{
if (event->xany.type == KeyRelease)
{
- Widget widget = XtWindowToWidget(
(Display*) wxGetDisplay()
,
- event->xany.window);
+ Widget widget = XtWindowToWidget(
event->xany.display
,
+
event->xany.window);
wxWindow* win = NULL;
// Find the first wxWindow that corresponds to this event window
wxWindow* win = NULL;
// Find the first wxWindow that corresponds to this event window
@@
-333,7
+327,7
@@
bool CheckForKeyUp(XEvent* event)
wxKeyEvent keyEvent(wxEVT_KEY_UP);
wxTranslateKeyEvent(keyEvent, win, (Widget) 0, event);
wxKeyEvent keyEvent(wxEVT_KEY_UP);
wxTranslateKeyEvent(keyEvent, win, (Widget) 0, event);
- return win->ProcessEvent( keyEvent );
+ return win->
GetEventHandler()->
ProcessEvent( keyEvent );
}
return false;
}
return false;
@@
-401,9
+395,11
@@
public:
virtual bool OnInit()
{
virtual bool OnInit()
{
+ // Must be done before modules are initialized
+#if 0
if( pipe(idleFds) != 0 )
return false;
if( pipe(idleFds) != 0 )
return false;
-
+#endif
return true;
}
return true;
}
@@
-443,7
+439,7
@@
static void wxInputCallback( XtPointer, int* fd, XtInputId* )
static void wxBreakDispatch()
{
static void wxBreakDispatch()
{
- char dummy
;
+ char dummy
= 0; // for valgrind
// check if wxWakeUpIdle has already been called
fd_set in;
// check if wxWakeUpIdle has already been called
fd_set in;
@@
-462,13
+458,23
@@
static void wxBreakDispatch()
write( idleFds[1], &dummy, 1 );
}
write( idleFds[1], &dummy, 1 );
}
-void wxWakeUpIdle()
+void wx
App::
WakeUpIdle()
{
::wxBreakDispatch();
}
{
::wxBreakDispatch();
}
+bool wxInitIdleFds()
+{
+ if( pipe(idleFds) != 0 )
+ return false;
+ return true;
+}
+
bool wxAddIdleCallback()
{
bool wxAddIdleCallback()
{
+ if (!wxInitIdleFds())
+ return false;
+
// install input handler for wxWakeUpIdle
inputId = XtAppAddInput( (XtAppContext) wxTheApp->GetAppContext(),
idleFds[0],
// install input handler for wxWakeUpIdle
inputId = XtAppAddInput( (XtAppContext) wxTheApp->GetAppContext(),
idleFds[0],