From 2d52841d08d63f396318da4045cf671455f0db44 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Wed, 2 Feb 2000 20:36:55 +0000 Subject: [PATCH] Clearified ROP code in wxDC (MSW and GTK). Removed CaptureMouse() non-sense again. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5810 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/dcclient.cpp | 9 +++++++-- src/gtk/window.cpp | 2 -- src/gtk1/dcclient.cpp | 9 +++++++-- src/gtk1/window.cpp | 2 -- src/msw/dc.cpp | 29 +++++++++++++++++++++++++++++ 5 files changed, 43 insertions(+), 8 deletions(-) diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index d061496e42..8cfd94e837 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -1273,9 +1273,7 @@ void wxWindowDC::SetLogicalFunction( int function ) case wxCLEAR: mode = GDK_CLEAR; break; case wxSET: mode = GDK_SET; break; case wxOR_INVERT: mode = GDK_OR_INVERT; break; - case wxSRC_AND: case wxAND: mode = GDK_AND; break; - case wxSRC_OR: case wxOR: mode = GDK_OR; break; case wxEQUIV: mode = GDK_EQUIV; break; case wxNAND: mode = GDK_NAND; break; @@ -1283,6 +1281,13 @@ void wxWindowDC::SetLogicalFunction( int function ) case wxCOPY: mode = GDK_COPY; break; case wxNO_OP: mode = GDK_NOOP; break; case wxSRC_INVERT: mode = GDK_COPY_INVERT; break; + + // unsupported by GTK + case wxNOR: mode = GDK_COPY; break; + + // these are actually ternary ROPs + case wxSRC_AND: mode = GDK_AND; break; + case wxSRC_OR: mode = GDK_OR; break; #endif default: { diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index c7c7373a79..b760a98993 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -3241,8 +3241,6 @@ void wxWindow::CaptureMouse() (GdkEventMask) (GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | - GDK_KEY_PRESS_MASK | - GDK_KEY_RELEASE_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_POINTER_MOTION_MASK), (GdkWindow *) NULL, diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index d061496e42..8cfd94e837 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -1273,9 +1273,7 @@ void wxWindowDC::SetLogicalFunction( int function ) case wxCLEAR: mode = GDK_CLEAR; break; case wxSET: mode = GDK_SET; break; case wxOR_INVERT: mode = GDK_OR_INVERT; break; - case wxSRC_AND: case wxAND: mode = GDK_AND; break; - case wxSRC_OR: case wxOR: mode = GDK_OR; break; case wxEQUIV: mode = GDK_EQUIV; break; case wxNAND: mode = GDK_NAND; break; @@ -1283,6 +1281,13 @@ void wxWindowDC::SetLogicalFunction( int function ) case wxCOPY: mode = GDK_COPY; break; case wxNO_OP: mode = GDK_NOOP; break; case wxSRC_INVERT: mode = GDK_COPY_INVERT; break; + + // unsupported by GTK + case wxNOR: mode = GDK_COPY; break; + + // these are actually ternary ROPs + case wxSRC_AND: mode = GDK_AND; break; + case wxSRC_OR: mode = GDK_OR; break; #endif default: { diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index c7c7373a79..b760a98993 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -3241,8 +3241,6 @@ void wxWindow::CaptureMouse() (GdkEventMask) (GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | - GDK_KEY_PRESS_MASK | - GDK_KEY_RELEASE_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_POINTER_MOTION_MASK), (GdkWindow *) NULL, diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index 3fc309221a..0e11aaf67d 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -1001,6 +1001,7 @@ void wxDC::SetRop(WXHDC dc) return; int c_rop; + // These may be wrong switch (m_logicalFunction) { @@ -1019,6 +1020,34 @@ void wxDC::SetRop(WXHDC dc) case wxEQUIV: case wxNAND: case wxCOPY: + +#if 0 + // these probably wouldn't be wrong, RR + + case wxXOR: c_rop = R2_XORPEN; break; + case wxINVERT: c_rop = R2_NOT; break; + case wxOR_REVERSE: c_rop = R2_MERGEPENNOT; break; + case wxAND_REVERSE: c_rop = R2_MASKPENNOT; break; + case wxCLEAR: c_rop = R2_BLACK; break; + case wxSET: c_rop = R2_WHITE; break; + case wxOR_INVERT: c_rop = R2_MERGENOTPEN; break; + case wxAND: c_rop = R2_MASKPEN; break; + case wxOR: c_rop = R2_MERGEPEN; break; + case wxEQUIV: c_rop = R2_NOTXORPEN; break; + case wxNAND: c_rop = R2_NOTMASKPEN; break; + case wxAND_INVERT: c_rop = R2_MASKNOTPEN; break; + case wxCOPY: c_rop = R2_COPYPEN; break; + case wxNO_OP: c_rop = R2_NOP; break; + case wxSRC_INVERT: c_rop = R2_NOTCOPYPEN; break; + + // what is this one? + case wxNOR: c_rop = R2_COPYPEN; break; + + // these are actually ternary ROPs + case wxSRC_AND: c_rop = R2_MASKPEN; break; + case wxSRC_OR: c_rop = R2_MERGEPEN; break; +#endif + default: c_rop = R2_COPYPEN; break; } -- 2.45.2