]> git.saurik.com Git - wxWidgets.git/commitdiff
Implemented wxScreenDC the hard way
authorRobert Roebling <robert@roebling.de>
Mon, 26 Oct 1998 10:56:58 +0000 (10:56 +0000)
committerRobert Roebling <robert@roebling.de>
Mon, 26 Oct 1998 10:56:58 +0000 (10:56 +0000)
  INcreased menu bar size
  Ripped off handles (a few days ago)
  Corrected $Id:$ somewhere

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@916 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

55 files changed:
include/wx/gtk/accel.h
include/wx/gtk/app.h
include/wx/gtk/bmpbuttn.h
include/wx/gtk/brush.h
include/wx/gtk/button.h
include/wx/gtk/checkbox.h
include/wx/gtk/choice.h
include/wx/gtk/colour.h
include/wx/gtk/combobox.h
include/wx/gtk/control.h
include/wx/gtk/cursor.h
include/wx/gtk/dc.h
include/wx/gtk/dcclient.h
include/wx/gtk/dcmemory.h
include/wx/gtk/dcscreen.h
include/wx/gtk1/accel.h
include/wx/gtk1/app.h
include/wx/gtk1/bmpbuttn.h
include/wx/gtk1/brush.h
include/wx/gtk1/button.h
include/wx/gtk1/checkbox.h
include/wx/gtk1/choice.h
include/wx/gtk1/colour.h
include/wx/gtk1/combobox.h
include/wx/gtk1/control.h
include/wx/gtk1/cursor.h
include/wx/gtk1/dc.h
include/wx/gtk1/dcclient.h
include/wx/gtk1/dcmemory.h
include/wx/gtk1/dcscreen.h
src/gtk/button.cpp
src/gtk/checkbox.cpp
src/gtk/choice.cpp
src/gtk/colour.cpp
src/gtk/combobox.cpp
src/gtk/control.cpp
src/gtk/cursor.cpp
src/gtk/data.cpp
src/gtk/dc.cpp
src/gtk/dcclient.cpp
src/gtk/dcscreen.cpp
src/gtk/frame.cpp
src/gtk1/button.cpp
src/gtk1/checkbox.cpp
src/gtk1/choice.cpp
src/gtk1/colour.cpp
src/gtk1/combobox.cpp
src/gtk1/control.cpp
src/gtk1/cursor.cpp
src/gtk1/data.cpp
src/gtk1/dc.cpp
src/gtk1/dcclient.cpp
src/gtk1/dcscreen.cpp
src/gtk1/frame.cpp
user/wxTest/wxTest.cpp

index 9b2f0e69d081f6d08588ebf7eafcef716157f34b..d2eb53c07007d8d69f68c0a1356cc9c8aed802fb 100644 (file)
@@ -1,9 +1,8 @@
 /////////////////////////////////////////////////////////////////////////////
 // Name:        accel.h
 // Purpose:     wxAcceleratorTable class
-// Author:      Robert
-// Modified by:
-// RCS-ID:      $id$
+// Author:      Robert Roebling
+// RCS-ID:      $Id$
 // Copyright:   (c) Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index 2df05b4886e991bed136b2d73171bce2f22657d9..c69720797268ed6985dc59839469ed63a94fcde9 100644 (file)
@@ -2,8 +2,7 @@
 // Name:        app.h
 // Purpose:
 // Author:      Robert Roebling
-// Created:     01/02/97
-// Id:
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling, Julian Smart
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index 5d61d0708b25d52dd8698c4be1e9af0c397f3909..380642dc6ab4d16953cb095db3de3e880d4aaa55 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        bmpbutton.h
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index 8a9fd41bf4b2879d6c525fcc59f8b3c5650dd3b6..bd3eeeba5fbfb1bdff70f0cbf7914c5c1b25f4d8 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        brush.h
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index f5a88d0a50aa66054f87f770fb6027dafad3f890..f4bfe395ed0bc936d29c4f3c974f27c34669c3f3 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        button.h
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index 36730fb54b76fe1adb7591481a43e1a4c8d04cf4..a2f858b7912fabbd6a784914285b91e6c4e23efb 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        checkbox.h
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index 2ccd1f22e821fc8429d31a2f4e5f13b1eee2dff4..70f5f4bd7efefadbb02001145ba6cd735f027827 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        choice.h
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index 77e4155350d8447ca57fdb60cf651ce90c8a8833..e994c2e0895afd21ede7ad5b05eb00cc7a1c27af 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        colour.h
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index 12c632e48020505a1d4f4a01329c8b0934777214..5b8046a4a55cb09e8894203986b3da3bce5adc71 100644 (file)
@@ -4,7 +4,7 @@
 // Author:      Robert Roebling
 // Created:     01/02/97
 // Id:          $Id$
-// Copyright:   (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
index 3e874707d0a75a7fc19bbd73dd6aeff9f330086b..80cc74b331f5274e7914e7bd04af6cd68cd00575 100644 (file)
@@ -2,9 +2,8 @@
 // Name:        control.h
 // Purpose:
 // Author:      Robert Roebling
-// Created:     01/02/97
-// Id:
-// Copyright:   (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id:          $Id$
+// Copyright:   (c) 1998 Robert Roebling, Julian Smart
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
index b760e0b512225b0369ded079c954a25cc1b75881..f0391af65bcebbf6506e5e003cb7c2156acb07ee 100644 (file)
@@ -2,9 +2,8 @@
 // Name:        cursor.h
 // Purpose:
 // Author:      Robert Roebling
-// Created:     01/02/97
-// Id:
-// Copyright:   (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id:          $Id$
+// Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
index 1fca0bcf10afec53cb245d43c021440b26338f8d..1c778cfbf8474fa8037ac67a3ffbb3455ae60375 100644 (file)
@@ -2,9 +2,8 @@
 // Name:        dc.h
 // Purpose:
 // Author:      Robert Roebling
-// Created:     01/02/97
-// Id:
-// Copyright:   (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id:          $Id$
+// Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
index be532ec577b65224e72ae2187f21f91ea37160a5..2797a151cfdad0b16c5cd4a4360ebbb221bc4403 100644 (file)
@@ -2,9 +2,8 @@
 // Name:        dcclient.h
 // Purpose:
 // Author:      Robert Roebling
-// Created:     01/02/97
-// Id:
-// Copyright:   (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id:          $Id$
+// Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
@@ -103,6 +102,7 @@ class wxPaintDC: public wxDC
     bool          m_isMemDC;
     
     void SetUpDC(void);
+    void Destroy(void);
     GdkWindow *GetWindow(void);
 };
 
index c5854c5110f9c8c3945f0576004d952c883c947e..be4a0ffa42091c250da74c3e2f4723a095a042ea 100644 (file)
@@ -2,9 +2,8 @@
 // Name:        dcmemory.h
 // Purpose:
 // Author:      Robert Roebling
-// Created:     01/02/97
 // RCS-ID:      $Id$
-// Copyright:   (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
@@ -29,7 +28,7 @@ class wxMemoryDC;
 // wxMemoryDC
 //-----------------------------------------------------------------------------
 
-class WXDLLEXPORT wxMemoryDC: public wxPaintDC
+class wxMemoryDC: public wxPaintDC
 {
   DECLARE_DYNAMIC_CLASS(wxMemoryDC)
 
index fdbb7344cc2e6803fc75cf6edacc6cada361cdee..c0136643c038af76dc61b943d6c1a50ce713666d 100644 (file)
@@ -2,19 +2,27 @@
 // Name:        dcscreen.h
 // Purpose:
 // Author:      Robert Roebling
-// Created:     01/02/97
-// Id:
-// Copyright:   (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id:          $Id$
+// Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-
 #ifndef __GTKDCSCREENH__
 #define __GTKDCSCREENH__
 
 #include "wx/dcclient.h"
 
-class WXDLLEXPORT wxScreenDC: public wxPaintDC
+//-----------------------------------------------------------------------------
+// classes
+//-----------------------------------------------------------------------------
+
+class wxScreenDC;
+
+//-----------------------------------------------------------------------------
+// wxScreenDC
+//-----------------------------------------------------------------------------
+
+class wxScreenDC: public wxPaintDC
 {
   DECLARE_DYNAMIC_CLASS(wxScreenDC)
 
@@ -25,8 +33,15 @@ class WXDLLEXPORT wxScreenDC: public wxPaintDC
   static bool StartDrawingOnTop( wxWindow *window );
   static bool StartDrawingOnTop( wxRectangle *rect = (wxRectangle *) NULL );
   static bool EndDrawingOnTop(void);
+  
+  // implementation
+  
+  static GdkWindow  *sm_overlayWindow;
+  static int         sm_overlayWindowX;
+  static int         sm_overlayWindowY;
 };
 
 #endif
+
     // __GTKDCSCREENH__
 
index 9b2f0e69d081f6d08588ebf7eafcef716157f34b..d2eb53c07007d8d69f68c0a1356cc9c8aed802fb 100644 (file)
@@ -1,9 +1,8 @@
 /////////////////////////////////////////////////////////////////////////////
 // Name:        accel.h
 // Purpose:     wxAcceleratorTable class
-// Author:      Robert
-// Modified by:
-// RCS-ID:      $id$
+// Author:      Robert Roebling
+// RCS-ID:      $Id$
 // Copyright:   (c) Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index 2df05b4886e991bed136b2d73171bce2f22657d9..c69720797268ed6985dc59839469ed63a94fcde9 100644 (file)
@@ -2,8 +2,7 @@
 // Name:        app.h
 // Purpose:
 // Author:      Robert Roebling
-// Created:     01/02/97
-// Id:
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling, Julian Smart
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index 5d61d0708b25d52dd8698c4be1e9af0c397f3909..380642dc6ab4d16953cb095db3de3e880d4aaa55 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        bmpbutton.h
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index 8a9fd41bf4b2879d6c525fcc59f8b3c5650dd3b6..bd3eeeba5fbfb1bdff70f0cbf7914c5c1b25f4d8 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        brush.h
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index f5a88d0a50aa66054f87f770fb6027dafad3f890..f4bfe395ed0bc936d29c4f3c974f27c34669c3f3 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        button.h
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index 36730fb54b76fe1adb7591481a43e1a4c8d04cf4..a2f858b7912fabbd6a784914285b91e6c4e23efb 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        checkbox.h
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index 2ccd1f22e821fc8429d31a2f4e5f13b1eee2dff4..70f5f4bd7efefadbb02001145ba6cd735f027827 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        choice.h
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index 77e4155350d8447ca57fdb60cf651ce90c8a8833..e994c2e0895afd21ede7ad5b05eb00cc7a1c27af 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        colour.h
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index 12c632e48020505a1d4f4a01329c8b0934777214..5b8046a4a55cb09e8894203986b3da3bce5adc71 100644 (file)
@@ -4,7 +4,7 @@
 // Author:      Robert Roebling
 // Created:     01/02/97
 // Id:          $Id$
-// Copyright:   (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
index 3e874707d0a75a7fc19bbd73dd6aeff9f330086b..80cc74b331f5274e7914e7bd04af6cd68cd00575 100644 (file)
@@ -2,9 +2,8 @@
 // Name:        control.h
 // Purpose:
 // Author:      Robert Roebling
-// Created:     01/02/97
-// Id:
-// Copyright:   (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id:          $Id$
+// Copyright:   (c) 1998 Robert Roebling, Julian Smart
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
index b760e0b512225b0369ded079c954a25cc1b75881..f0391af65bcebbf6506e5e003cb7c2156acb07ee 100644 (file)
@@ -2,9 +2,8 @@
 // Name:        cursor.h
 // Purpose:
 // Author:      Robert Roebling
-// Created:     01/02/97
-// Id:
-// Copyright:   (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id:          $Id$
+// Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
index 1fca0bcf10afec53cb245d43c021440b26338f8d..1c778cfbf8474fa8037ac67a3ffbb3455ae60375 100644 (file)
@@ -2,9 +2,8 @@
 // Name:        dc.h
 // Purpose:
 // Author:      Robert Roebling
-// Created:     01/02/97
-// Id:
-// Copyright:   (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id:          $Id$
+// Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
index be532ec577b65224e72ae2187f21f91ea37160a5..2797a151cfdad0b16c5cd4a4360ebbb221bc4403 100644 (file)
@@ -2,9 +2,8 @@
 // Name:        dcclient.h
 // Purpose:
 // Author:      Robert Roebling
-// Created:     01/02/97
-// Id:
-// Copyright:   (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id:          $Id$
+// Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
@@ -103,6 +102,7 @@ class wxPaintDC: public wxDC
     bool          m_isMemDC;
     
     void SetUpDC(void);
+    void Destroy(void);
     GdkWindow *GetWindow(void);
 };
 
index c5854c5110f9c8c3945f0576004d952c883c947e..be4a0ffa42091c250da74c3e2f4723a095a042ea 100644 (file)
@@ -2,9 +2,8 @@
 // Name:        dcmemory.h
 // Purpose:
 // Author:      Robert Roebling
-// Created:     01/02/97
 // RCS-ID:      $Id$
-// Copyright:   (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
@@ -29,7 +28,7 @@ class wxMemoryDC;
 // wxMemoryDC
 //-----------------------------------------------------------------------------
 
-class WXDLLEXPORT wxMemoryDC: public wxPaintDC
+class wxMemoryDC: public wxPaintDC
 {
   DECLARE_DYNAMIC_CLASS(wxMemoryDC)
 
index fdbb7344cc2e6803fc75cf6edacc6cada361cdee..c0136643c038af76dc61b943d6c1a50ce713666d 100644 (file)
@@ -2,19 +2,27 @@
 // Name:        dcscreen.h
 // Purpose:
 // Author:      Robert Roebling
-// Created:     01/02/97
-// Id:
-// Copyright:   (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id:          $Id$
+// Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-
 #ifndef __GTKDCSCREENH__
 #define __GTKDCSCREENH__
 
 #include "wx/dcclient.h"
 
-class WXDLLEXPORT wxScreenDC: public wxPaintDC
+//-----------------------------------------------------------------------------
+// classes
+//-----------------------------------------------------------------------------
+
+class wxScreenDC;
+
+//-----------------------------------------------------------------------------
+// wxScreenDC
+//-----------------------------------------------------------------------------
+
+class wxScreenDC: public wxPaintDC
 {
   DECLARE_DYNAMIC_CLASS(wxScreenDC)
 
@@ -25,8 +33,15 @@ class WXDLLEXPORT wxScreenDC: public wxPaintDC
   static bool StartDrawingOnTop( wxWindow *window );
   static bool StartDrawingOnTop( wxRectangle *rect = (wxRectangle *) NULL );
   static bool EndDrawingOnTop(void);
+  
+  // implementation
+  
+  static GdkWindow  *sm_overlayWindow;
+  static int         sm_overlayWindowX;
+  static int         sm_overlayWindowY;
 };
 
 #endif
+
     // __GTKDCSCREENH__
 
index f2a516ec655e8909b526d710200478b798cd3ead..e74cbc83ff6bbc9459f2c84afa7b2996acbf5e17 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        button.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index b33fd486e6f73eb78fd75af68fa90049cb637e78..818619187d324938d04056416d418f3df9a7a7c9 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        checkbox.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index d11061e9a5533eb97636af0433f83b1f93d0ad41..5d76b098ff5c7d13c5865bb48f053c25e585dc29 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        choice.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index 7e57df104f649c45de5a89753bcc4d6e3e850e38..de361155a8833afcccb5e78f3571718d8efd2a2e 100644 (file)
@@ -2,9 +2,8 @@
 // Name:        colour.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Created:     01/02/97
-// Id:
-// Copyright:   (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id:          $Id$
+// Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
index 906f31c2e5bafbd407bbe6a58ba1f160148c845b..3208d7ef927ab7e764a2466643dfc107ae6c0674 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        combobox.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index 658ebcd8c96e35313cb8e2349ee12c59f5a8677a..c9064a34136a0f241194ea2420e5b55e2fa0654c 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        control.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling, Julian Smart and Vadim Zeitlin
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index 20a8d3c19ef310eb3497f2a5bec5fdf48519eb91..01a469f84fa8609c332861c9f41948f858b2fa9d 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        cursor.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index 815bdca347f64228f7b411753dd230f3b996d19f..3d9ae3d037f795d083f4656182c2139c282e8a5b 100644 (file)
@@ -2,8 +2,8 @@
 // Name:        data.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
-// Copyright:   (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id:          $Id$
+// Copyright:   (c) 1998 Robert Roebling
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
index 3678494de46c238a4020b46ca8da26e6784ab89b..a519e5fd40f08645fbb77aeac2a6eec008db5365 100644 (file)
@@ -3,7 +3,7 @@
 // Purpose:
 // Author:      Robert Roebling
 // RCS-ID:      $Id$
-// Copyright:   (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Copyright:   (c) 1998 Robert Roebling, Markus Holzem
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
index 1d46f8b455f0578905daa6217be726f2f337d5d1..3e8025961bda075be3270c6d79391c10b3c41080 100644 (file)
@@ -119,6 +119,7 @@ wxPaintDC::wxPaintDC( wxWindow *window )
 
 wxPaintDC::~wxPaintDC(void)
 {
+  Destroy();
 }
 
 void wxPaintDC::FloodFill( long WXUNUSED(x1), long WXUNUSED(y1), 
@@ -827,15 +828,12 @@ void wxPaintDC::DestroyClippingRegion(void)
 
 void wxPaintDC::SetUpDC(void)
 {
+  Destroy();
   m_ok = TRUE;
   m_logicalFunction = wxCOPY;
-  if (m_penGC) gdk_gc_unref( m_penGC );
   m_penGC = gdk_gc_new( m_window );
-  if (m_brushGC) gdk_gc_unref( m_brushGC );
   m_brushGC = gdk_gc_new( m_window );
-  if (m_textGC) gdk_gc_unref( m_textGC );
   m_textGC = gdk_gc_new( m_window );
-  if (m_bgGC) gdk_gc_unref( m_bgGC );
   m_bgGC = gdk_gc_new( m_window );
   SetTextForeground( m_textForegroundColour );
   SetTextBackground( m_textBackgroundColour );
@@ -857,6 +855,18 @@ void wxPaintDC::SetUpDC(void)
   }
 }
 
+void wxPaintDC::Destroy(void)
+{
+  if (m_penGC) gdk_gc_unref( m_penGC );
+  m_penGC = (GdkGC*) NULL;
+  if (m_brushGC) gdk_gc_unref( m_brushGC );
+  m_brushGC = (GdkGC*) NULL;
+  if (m_textGC) gdk_gc_unref( m_textGC );
+  m_textGC = (GdkGC*) NULL;
+  if (m_bgGC) gdk_gc_unref( m_bgGC );
+  m_bgGC = (GdkGC*) NULL;
+}
+
 GdkWindow *wxPaintDC::GetWindow(void)
 {
   return m_window;
index cd47777fdbd8d5caf8d90305ac178f87be7ee608..ed085d15d77c2170a375c10e86ffb8e867ee6661 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        dcscreen.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #include "wx/dcscreen.h"
 #include "wx/window.h"
+
+//-----------------------------------------------------------------------------
+// global data initialization
+//-----------------------------------------------------------------------------
+
+GdkWindow *wxScreenDC::sm_overlayWindow  = (GdkWindow*) NULL;
+       int wxScreenDC::sm_overlayWindowX = 0;
+       int wxScreenDC::sm_overlayWindowY = 0;
+
+                            
+//-----------------------------------------------------------------------------
+// create X window
+//-----------------------------------------------------------------------------
+
+extern "C" {
+
+#include "gdk/gdk.h"
+#include "gdk/gdkprivate.h"
 #include "gdk/gdkx.h"
+#include <netinet/in.h>
+
+int nevent_masks = 17;
+int event_mask_table[19] =
+{
+  ExposureMask,
+  PointerMotionMask,
+  PointerMotionHintMask,
+  ButtonMotionMask,
+  Button1MotionMask,
+  Button2MotionMask,
+  Button3MotionMask,
+  ButtonPressMask | OwnerGrabButtonMask,
+  ButtonReleaseMask | OwnerGrabButtonMask,
+  KeyPressMask,
+  KeyReleaseMask,
+  EnterWindowMask,
+  LeaveWindowMask,
+  FocusChangeMask,
+  StructureNotifyMask,
+  PropertyChangeMask,
+  VisibilityChangeMask,
+  0,                           /* PROXIMITY_IN */
+  0                            /* PROXIMTY_OUT */
+};
+
+GdkWindow*
+gdk_window_transparent_new ( GdkWindow     *parent,
+                            GdkWindowAttr *attributes,
+                            gint           attributes_mask)
+{
+  GdkWindow *window;
+  GdkWindowPrivate *gprivate;
+  GdkWindowPrivate *parent_private;
+  GdkVisual *visual;
+  Display *parent_display;
+  Window xparent;
+  Visual *xvisual;
+  XSetWindowAttributes xattributes;
+  long xattributes_mask;
+  XSizeHints size_hints;
+  XWMHints wm_hints;
+  XClassHint *class_hint;
+  int x, y, depth;
+  unsigned int gclass;
+  char *title;
+  int i;
+
+  g_return_val_if_fail (attributes != NULL, NULL);
+
+  if (!parent)
+    parent = (GdkWindow*) &gdk_root_parent;
+
+  parent_private = (GdkWindowPrivate*) parent;
+  if (parent_private->destroyed)
+    return NULL;
+
+  xparent = parent_private->xwindow;
+  parent_display = parent_private->xdisplay;
+
+  gprivate = g_new (GdkWindowPrivate, 1);
+  window = (GdkWindow*) gprivate;
+
+  gprivate->parent = parent;
+
+  if (parent_private != &gdk_root_parent)
+    parent_private->children = g_list_prepend (parent_private->children, window);
+
+  gprivate->xdisplay = parent_display;
+  gprivate->destroyed = FALSE;
+  gprivate->resize_count = 0;
+  gprivate->ref_count = 1;
+  xattributes_mask = 0;
+
+  if (attributes_mask & GDK_WA_X)
+    x = attributes->x;
+  else
+    x = 0;
+
+  if (attributes_mask & GDK_WA_Y)
+    y = attributes->y;
+  else
+    y = 0;
+
+  gprivate->x = x;
+  gprivate->y = y;
+  gprivate->width = (attributes->width > 1) ? (attributes->width) : (1);
+  gprivate->height = (attributes->height > 1) ? (attributes->height) : (1);
+  gprivate->window_type = attributes->window_type;
+  gprivate->extension_events = FALSE;
+  gprivate->dnd_drag_data_type = None;
+  gprivate->dnd_drag_data_typesavail =
+    gprivate->dnd_drop_data_typesavail = NULL;
+  gprivate->dnd_drop_enabled = gprivate->dnd_drag_enabled =
+    gprivate->dnd_drag_accepted = gprivate->dnd_drag_datashow =
+    gprivate->dnd_drop_data_numtypesavail =
+    gprivate->dnd_drag_data_numtypesavail = 0;
+  gprivate->dnd_drag_eventmask = gprivate->dnd_drag_savedeventmask = 0;
+
+  gprivate->filters = NULL;
+  gprivate->children = NULL;
+
+  window->user_data = NULL;
+
+  if (attributes_mask & GDK_WA_VISUAL)
+    visual = attributes->visual;
+  else
+    visual = gdk_visual_get_system ();
+  xvisual = ((GdkVisualPrivate*) visual)->xvisual;
+
+  xattributes.event_mask = StructureNotifyMask;
+  for (i = 0; i < nevent_masks; i++)
+    {
+      if (attributes->event_mask & (1 << (i + 1)))
+       xattributes.event_mask |= event_mask_table[i];
+    }
+
+  if (xattributes.event_mask)
+    xattributes_mask |= CWEventMask;
+
+  if(attributes_mask & GDK_WA_NOREDIR) {
+       xattributes.override_redirect =
+               (attributes->override_redirect == FALSE)?False:True;
+       xattributes_mask |= CWOverrideRedirect;
+  } else
+    xattributes.override_redirect = False;
+
+      gclass = InputOutput;
+      depth = visual->depth;
+
+      if (attributes_mask & GDK_WA_COLORMAP)
+       gprivate->colormap = attributes->colormap;
+      else
+       gprivate->colormap = gdk_colormap_get_system ();
+
+         xattributes.colormap = ((GdkColormapPrivate*) gprivate->colormap)->xcolormap;
+         xattributes_mask |= CWColormap;
+
+         xparent = gdk_root_window;
+
+         xattributes.save_under = True;
+         xattributes.override_redirect = True;
+         xattributes.cursor = None;
+         xattributes_mask |= CWSaveUnder | CWOverrideRedirect;
+
+  gprivate->xwindow = XCreateWindow (gprivate->xdisplay, xparent,
+                                   x, y, gprivate->width, gprivate->height,
+                                   0, depth, gclass, xvisual,
+                                   xattributes_mask, &xattributes);
+  gdk_window_ref (window);
+  gdk_xid_table_insert (&gprivate->xwindow, window);
+
+  if (gprivate->colormap)
+    gdk_colormap_ref (gprivate->colormap);
+
+      XSetWMProtocols (gprivate->xdisplay, gprivate->xwindow, gdk_wm_window_protocols, 2);
+
+  size_hints.flags = PSize;
+  size_hints.width = gprivate->width;
+  size_hints.height = gprivate->height;
+
+  wm_hints.flags = InputHint | StateHint | WindowGroupHint;
+  wm_hints.window_group = gdk_leader_window;
+  wm_hints.input = True;
+  wm_hints.initial_state = NormalState;
+
+  /* FIXME: Is there any point in doing this? Do any WM's pay
+   * attention to PSize, and even if they do, is this the
+   * correct value???
+   */
+  XSetWMNormalHints (gprivate->xdisplay, gprivate->xwindow, &size_hints);
+
+  XSetWMHints (gprivate->xdisplay, gprivate->xwindow, &wm_hints);
+
+  if (attributes_mask & GDK_WA_TITLE)
+    title = attributes->title;
+  else
+    title = gdk_progname;
+
+  XmbSetWMProperties (gprivate->xdisplay, gprivate->xwindow,
+                      title, title,
+                      NULL, 0,
+                      NULL, NULL, NULL);
+
+  if (attributes_mask & GDK_WA_WMCLASS)
+    {
+      class_hint = XAllocClassHint ();
+      class_hint->res_name = attributes->wmclass_name;
+      class_hint->res_class = attributes->wmclass_class;
+      XSetClassHint (gprivate->xdisplay, gprivate->xwindow, class_hint);
+      XFree (class_hint);
+    }
+
+  return window;
+}
+
+} // extern "C"
 
 //-----------------------------------------------------------------------------
 // wxScreenDC
@@ -27,7 +242,14 @@ wxScreenDC::wxScreenDC(void)
   m_window = (GdkWindow *) NULL;
   m_cmap = gdk_colormap_get_system();
   
-  m_window = GDK_ROOT_PARENT();
+  if (sm_overlayWindow)
+  {
+    m_window = sm_overlayWindow;
+    m_deviceOriginX = - sm_overlayWindowX;
+    m_deviceOriginY = - sm_overlayWindowY;
+  }
+  else
+    m_window = GDK_ROOT_PARENT();
   
   SetUpDC();
   
@@ -42,32 +264,29 @@ wxScreenDC::~wxScreenDC(void)
   EndDrawingOnTop();
 }
 
-bool wxScreenDC::StartDrawingOnTop( wxWindow *WXUNUSED(window) )
+bool wxScreenDC::StartDrawingOnTop( wxWindow *window )
 {
-  return TRUE;
-/*
-  if (!window)
-  {
-    StartDrawingOnTop();
-    return;
-  }
+  if (!window) return StartDrawingOnTop();
+  
+  int x = 0;
+  int y = 0;
+  window->GetPosition( &x, &y );
+  int w = 0;
+  int h = 0;
+  window->GetSize( &w, &h );
+  window->ClientToScreen( &x, &y );
+  
   wxRectangle rect;
-  rect.x = 0;
-  rect.y = 0;
-  window->GetPosition( &rect.x, &rect.y );
+  rect.x = x;
+  rect.y = y;
   rect.width = 0;
   rect.height = 0;
-  window->GetSize( &rect.width, &rect.height );
-  window->ClientToScreen( &rect.x, &rect.y );
-  StartDrawingOnTop( &rect );
-  return TRUE;
-*/
+  
+  return StartDrawingOnTop( &rect );
 }
 
-bool wxScreenDC::StartDrawingOnTop( wxRectangle *WXUNUSED(rect) )
+bool wxScreenDC::StartDrawingOnTop( wxRectangle *rect )
 {
-  return TRUE;
-/*
   int x = 0;
   int y = 0;
   int width = gdk_screen_width();
@@ -80,7 +299,8 @@ bool wxScreenDC::StartDrawingOnTop( wxRectangle *WXUNUSED(rect) )
     height = rect->height;
   }
   
-  GTK cannot set transparent backgrounds. :-(
+  sm_overlayWindowX = x;
+  sm_overlayWindowY = y;
 
   GdkWindowAttr attr;
   attr.x = x;
@@ -91,31 +311,23 @@ bool wxScreenDC::StartDrawingOnTop( wxRectangle *WXUNUSED(rect) )
   attr.wclass = GDK_INPUT_OUTPUT;
   attr.event_mask = 0;
   attr.window_type = GDK_WINDOW_TEMP;
-  m_window = gdk_window_new( NULL, &attr, GDK_WA_NOREDIR | GDK_WA_X | GDK_WA_Y );
-  
-  gdk_window_show( m_window );
-
-  m_window = GDK_ROOT_PARENT();
   
-  SetUpDC();
+  // GTK cannot set transparent backgrounds. :-(
+  sm_overlayWindow = gdk_window_transparent_new( NULL, &attr, GDK_WA_NOREDIR | GDK_WA_X | GDK_WA_Y );
   
-  gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
-  gdk_gc_set_subwindow( m_brushGC, GDK_INCLUDE_INFERIORS );
-  gdk_gc_set_subwindow( m_textGC, GDK_INCLUDE_INFERIORS );
-  gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS );
+  if (sm_overlayWindow) gdk_window_show( sm_overlayWindow );
 
-  return TRUE;
-*/
+  return (sm_overlayWindow);
 }
 
 bool wxScreenDC::EndDrawingOnTop(void)
 {
+  if (sm_overlayWindow) gdk_window_destroy( sm_overlayWindow );
+  
+  sm_overlayWindow = NULL;
+  sm_overlayWindowX = 0;
+  sm_overlayWindowY = 0;
+  
   return TRUE;
-/*
-  if (m_window) gdk_window_destroy( m_window );
-  m_window = NULL;
-  m_isOk = FALSE;
-  return TRUE;
-*/
 }
 
index 2f1d7475585a222ace089436ea0bcac131e3f535..5864db957f4b096e28b58082f30ccb54074e3e48 100644 (file)
@@ -26,7 +26,7 @@
 // constants
 //-----------------------------------------------------------------------------
 
-const int wxMENU_HEIGHT    = 28;
+const int wxMENU_HEIGHT    = 30;
 const int wxSTATUS_HEIGHT  = 25;
 
 //-----------------------------------------------------------------------------
index f2a516ec655e8909b526d710200478b798cd3ead..e74cbc83ff6bbc9459f2c84afa7b2996acbf5e17 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        button.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index b33fd486e6f73eb78fd75af68fa90049cb637e78..818619187d324938d04056416d418f3df9a7a7c9 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        checkbox.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index d11061e9a5533eb97636af0433f83b1f93d0ad41..5d76b098ff5c7d13c5865bb48f053c25e585dc29 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        choice.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index 7e57df104f649c45de5a89753bcc4d6e3e850e38..de361155a8833afcccb5e78f3571718d8efd2a2e 100644 (file)
@@ -2,9 +2,8 @@
 // Name:        colour.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Created:     01/02/97
-// Id:
-// Copyright:   (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id:          $Id$
+// Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
index 906f31c2e5bafbd407bbe6a58ba1f160148c845b..3208d7ef927ab7e764a2466643dfc107ae6c0674 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        combobox.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index 658ebcd8c96e35313cb8e2349ee12c59f5a8677a..c9064a34136a0f241194ea2420e5b55e2fa0654c 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        control.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling, Julian Smart and Vadim Zeitlin
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index 20a8d3c19ef310eb3497f2a5bec5fdf48519eb91..01a469f84fa8609c332861c9f41948f858b2fa9d 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        cursor.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
index 815bdca347f64228f7b411753dd230f3b996d19f..3d9ae3d037f795d083f4656182c2139c282e8a5b 100644 (file)
@@ -2,8 +2,8 @@
 // Name:        data.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
-// Copyright:   (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Id:          $Id$
+// Copyright:   (c) 1998 Robert Roebling
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
index 3678494de46c238a4020b46ca8da26e6784ab89b..a519e5fd40f08645fbb77aeac2a6eec008db5365 100644 (file)
@@ -3,7 +3,7 @@
 // Purpose:
 // Author:      Robert Roebling
 // RCS-ID:      $Id$
-// Copyright:   (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
+// Copyright:   (c) 1998 Robert Roebling, Markus Holzem
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
index 1d46f8b455f0578905daa6217be726f2f337d5d1..3e8025961bda075be3270c6d79391c10b3c41080 100644 (file)
@@ -119,6 +119,7 @@ wxPaintDC::wxPaintDC( wxWindow *window )
 
 wxPaintDC::~wxPaintDC(void)
 {
+  Destroy();
 }
 
 void wxPaintDC::FloodFill( long WXUNUSED(x1), long WXUNUSED(y1), 
@@ -827,15 +828,12 @@ void wxPaintDC::DestroyClippingRegion(void)
 
 void wxPaintDC::SetUpDC(void)
 {
+  Destroy();
   m_ok = TRUE;
   m_logicalFunction = wxCOPY;
-  if (m_penGC) gdk_gc_unref( m_penGC );
   m_penGC = gdk_gc_new( m_window );
-  if (m_brushGC) gdk_gc_unref( m_brushGC );
   m_brushGC = gdk_gc_new( m_window );
-  if (m_textGC) gdk_gc_unref( m_textGC );
   m_textGC = gdk_gc_new( m_window );
-  if (m_bgGC) gdk_gc_unref( m_bgGC );
   m_bgGC = gdk_gc_new( m_window );
   SetTextForeground( m_textForegroundColour );
   SetTextBackground( m_textBackgroundColour );
@@ -857,6 +855,18 @@ void wxPaintDC::SetUpDC(void)
   }
 }
 
+void wxPaintDC::Destroy(void)
+{
+  if (m_penGC) gdk_gc_unref( m_penGC );
+  m_penGC = (GdkGC*) NULL;
+  if (m_brushGC) gdk_gc_unref( m_brushGC );
+  m_brushGC = (GdkGC*) NULL;
+  if (m_textGC) gdk_gc_unref( m_textGC );
+  m_textGC = (GdkGC*) NULL;
+  if (m_bgGC) gdk_gc_unref( m_bgGC );
+  m_bgGC = (GdkGC*) NULL;
+}
+
 GdkWindow *wxPaintDC::GetWindow(void)
 {
   return m_window;
index cd47777fdbd8d5caf8d90305ac178f87be7ee608..ed085d15d77c2170a375c10e86ffb8e867ee6661 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        dcscreen.cpp
 // Purpose:
 // Author:      Robert Roebling
-// Id:          $id$
+// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:    wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #include "wx/dcscreen.h"
 #include "wx/window.h"
+
+//-----------------------------------------------------------------------------
+// global data initialization
+//-----------------------------------------------------------------------------
+
+GdkWindow *wxScreenDC::sm_overlayWindow  = (GdkWindow*) NULL;
+       int wxScreenDC::sm_overlayWindowX = 0;
+       int wxScreenDC::sm_overlayWindowY = 0;
+
+                            
+//-----------------------------------------------------------------------------
+// create X window
+//-----------------------------------------------------------------------------
+
+extern "C" {
+
+#include "gdk/gdk.h"
+#include "gdk/gdkprivate.h"
 #include "gdk/gdkx.h"
+#include <netinet/in.h>
+
+int nevent_masks = 17;
+int event_mask_table[19] =
+{
+  ExposureMask,
+  PointerMotionMask,
+  PointerMotionHintMask,
+  ButtonMotionMask,
+  Button1MotionMask,
+  Button2MotionMask,
+  Button3MotionMask,
+  ButtonPressMask | OwnerGrabButtonMask,
+  ButtonReleaseMask | OwnerGrabButtonMask,
+  KeyPressMask,
+  KeyReleaseMask,
+  EnterWindowMask,
+  LeaveWindowMask,
+  FocusChangeMask,
+  StructureNotifyMask,
+  PropertyChangeMask,
+  VisibilityChangeMask,
+  0,                           /* PROXIMITY_IN */
+  0                            /* PROXIMTY_OUT */
+};
+
+GdkWindow*
+gdk_window_transparent_new ( GdkWindow     *parent,
+                            GdkWindowAttr *attributes,
+                            gint           attributes_mask)
+{
+  GdkWindow *window;
+  GdkWindowPrivate *gprivate;
+  GdkWindowPrivate *parent_private;
+  GdkVisual *visual;
+  Display *parent_display;
+  Window xparent;
+  Visual *xvisual;
+  XSetWindowAttributes xattributes;
+  long xattributes_mask;
+  XSizeHints size_hints;
+  XWMHints wm_hints;
+  XClassHint *class_hint;
+  int x, y, depth;
+  unsigned int gclass;
+  char *title;
+  int i;
+
+  g_return_val_if_fail (attributes != NULL, NULL);
+
+  if (!parent)
+    parent = (GdkWindow*) &gdk_root_parent;
+
+  parent_private = (GdkWindowPrivate*) parent;
+  if (parent_private->destroyed)
+    return NULL;
+
+  xparent = parent_private->xwindow;
+  parent_display = parent_private->xdisplay;
+
+  gprivate = g_new (GdkWindowPrivate, 1);
+  window = (GdkWindow*) gprivate;
+
+  gprivate->parent = parent;
+
+  if (parent_private != &gdk_root_parent)
+    parent_private->children = g_list_prepend (parent_private->children, window);
+
+  gprivate->xdisplay = parent_display;
+  gprivate->destroyed = FALSE;
+  gprivate->resize_count = 0;
+  gprivate->ref_count = 1;
+  xattributes_mask = 0;
+
+  if (attributes_mask & GDK_WA_X)
+    x = attributes->x;
+  else
+    x = 0;
+
+  if (attributes_mask & GDK_WA_Y)
+    y = attributes->y;
+  else
+    y = 0;
+
+  gprivate->x = x;
+  gprivate->y = y;
+  gprivate->width = (attributes->width > 1) ? (attributes->width) : (1);
+  gprivate->height = (attributes->height > 1) ? (attributes->height) : (1);
+  gprivate->window_type = attributes->window_type;
+  gprivate->extension_events = FALSE;
+  gprivate->dnd_drag_data_type = None;
+  gprivate->dnd_drag_data_typesavail =
+    gprivate->dnd_drop_data_typesavail = NULL;
+  gprivate->dnd_drop_enabled = gprivate->dnd_drag_enabled =
+    gprivate->dnd_drag_accepted = gprivate->dnd_drag_datashow =
+    gprivate->dnd_drop_data_numtypesavail =
+    gprivate->dnd_drag_data_numtypesavail = 0;
+  gprivate->dnd_drag_eventmask = gprivate->dnd_drag_savedeventmask = 0;
+
+  gprivate->filters = NULL;
+  gprivate->children = NULL;
+
+  window->user_data = NULL;
+
+  if (attributes_mask & GDK_WA_VISUAL)
+    visual = attributes->visual;
+  else
+    visual = gdk_visual_get_system ();
+  xvisual = ((GdkVisualPrivate*) visual)->xvisual;
+
+  xattributes.event_mask = StructureNotifyMask;
+  for (i = 0; i < nevent_masks; i++)
+    {
+      if (attributes->event_mask & (1 << (i + 1)))
+       xattributes.event_mask |= event_mask_table[i];
+    }
+
+  if (xattributes.event_mask)
+    xattributes_mask |= CWEventMask;
+
+  if(attributes_mask & GDK_WA_NOREDIR) {
+       xattributes.override_redirect =
+               (attributes->override_redirect == FALSE)?False:True;
+       xattributes_mask |= CWOverrideRedirect;
+  } else
+    xattributes.override_redirect = False;
+
+      gclass = InputOutput;
+      depth = visual->depth;
+
+      if (attributes_mask & GDK_WA_COLORMAP)
+       gprivate->colormap = attributes->colormap;
+      else
+       gprivate->colormap = gdk_colormap_get_system ();
+
+         xattributes.colormap = ((GdkColormapPrivate*) gprivate->colormap)->xcolormap;
+         xattributes_mask |= CWColormap;
+
+         xparent = gdk_root_window;
+
+         xattributes.save_under = True;
+         xattributes.override_redirect = True;
+         xattributes.cursor = None;
+         xattributes_mask |= CWSaveUnder | CWOverrideRedirect;
+
+  gprivate->xwindow = XCreateWindow (gprivate->xdisplay, xparent,
+                                   x, y, gprivate->width, gprivate->height,
+                                   0, depth, gclass, xvisual,
+                                   xattributes_mask, &xattributes);
+  gdk_window_ref (window);
+  gdk_xid_table_insert (&gprivate->xwindow, window);
+
+  if (gprivate->colormap)
+    gdk_colormap_ref (gprivate->colormap);
+
+      XSetWMProtocols (gprivate->xdisplay, gprivate->xwindow, gdk_wm_window_protocols, 2);
+
+  size_hints.flags = PSize;
+  size_hints.width = gprivate->width;
+  size_hints.height = gprivate->height;
+
+  wm_hints.flags = InputHint | StateHint | WindowGroupHint;
+  wm_hints.window_group = gdk_leader_window;
+  wm_hints.input = True;
+  wm_hints.initial_state = NormalState;
+
+  /* FIXME: Is there any point in doing this? Do any WM's pay
+   * attention to PSize, and even if they do, is this the
+   * correct value???
+   */
+  XSetWMNormalHints (gprivate->xdisplay, gprivate->xwindow, &size_hints);
+
+  XSetWMHints (gprivate->xdisplay, gprivate->xwindow, &wm_hints);
+
+  if (attributes_mask & GDK_WA_TITLE)
+    title = attributes->title;
+  else
+    title = gdk_progname;
+
+  XmbSetWMProperties (gprivate->xdisplay, gprivate->xwindow,
+                      title, title,
+                      NULL, 0,
+                      NULL, NULL, NULL);
+
+  if (attributes_mask & GDK_WA_WMCLASS)
+    {
+      class_hint = XAllocClassHint ();
+      class_hint->res_name = attributes->wmclass_name;
+      class_hint->res_class = attributes->wmclass_class;
+      XSetClassHint (gprivate->xdisplay, gprivate->xwindow, class_hint);
+      XFree (class_hint);
+    }
+
+  return window;
+}
+
+} // extern "C"
 
 //-----------------------------------------------------------------------------
 // wxScreenDC
@@ -27,7 +242,14 @@ wxScreenDC::wxScreenDC(void)
   m_window = (GdkWindow *) NULL;
   m_cmap = gdk_colormap_get_system();
   
-  m_window = GDK_ROOT_PARENT();
+  if (sm_overlayWindow)
+  {
+    m_window = sm_overlayWindow;
+    m_deviceOriginX = - sm_overlayWindowX;
+    m_deviceOriginY = - sm_overlayWindowY;
+  }
+  else
+    m_window = GDK_ROOT_PARENT();
   
   SetUpDC();
   
@@ -42,32 +264,29 @@ wxScreenDC::~wxScreenDC(void)
   EndDrawingOnTop();
 }
 
-bool wxScreenDC::StartDrawingOnTop( wxWindow *WXUNUSED(window) )
+bool wxScreenDC::StartDrawingOnTop( wxWindow *window )
 {
-  return TRUE;
-/*
-  if (!window)
-  {
-    StartDrawingOnTop();
-    return;
-  }
+  if (!window) return StartDrawingOnTop();
+  
+  int x = 0;
+  int y = 0;
+  window->GetPosition( &x, &y );
+  int w = 0;
+  int h = 0;
+  window->GetSize( &w, &h );
+  window->ClientToScreen( &x, &y );
+  
   wxRectangle rect;
-  rect.x = 0;
-  rect.y = 0;
-  window->GetPosition( &rect.x, &rect.y );
+  rect.x = x;
+  rect.y = y;
   rect.width = 0;
   rect.height = 0;
-  window->GetSize( &rect.width, &rect.height );
-  window->ClientToScreen( &rect.x, &rect.y );
-  StartDrawingOnTop( &rect );
-  return TRUE;
-*/
+  
+  return StartDrawingOnTop( &rect );
 }
 
-bool wxScreenDC::StartDrawingOnTop( wxRectangle *WXUNUSED(rect) )
+bool wxScreenDC::StartDrawingOnTop( wxRectangle *rect )
 {
-  return TRUE;
-/*
   int x = 0;
   int y = 0;
   int width = gdk_screen_width();
@@ -80,7 +299,8 @@ bool wxScreenDC::StartDrawingOnTop( wxRectangle *WXUNUSED(rect) )
     height = rect->height;
   }
   
-  GTK cannot set transparent backgrounds. :-(
+  sm_overlayWindowX = x;
+  sm_overlayWindowY = y;
 
   GdkWindowAttr attr;
   attr.x = x;
@@ -91,31 +311,23 @@ bool wxScreenDC::StartDrawingOnTop( wxRectangle *WXUNUSED(rect) )
   attr.wclass = GDK_INPUT_OUTPUT;
   attr.event_mask = 0;
   attr.window_type = GDK_WINDOW_TEMP;
-  m_window = gdk_window_new( NULL, &attr, GDK_WA_NOREDIR | GDK_WA_X | GDK_WA_Y );
-  
-  gdk_window_show( m_window );
-
-  m_window = GDK_ROOT_PARENT();
   
-  SetUpDC();
+  // GTK cannot set transparent backgrounds. :-(
+  sm_overlayWindow = gdk_window_transparent_new( NULL, &attr, GDK_WA_NOREDIR | GDK_WA_X | GDK_WA_Y );
   
-  gdk_gc_set_subwindow( m_penGC, GDK_INCLUDE_INFERIORS );
-  gdk_gc_set_subwindow( m_brushGC, GDK_INCLUDE_INFERIORS );
-  gdk_gc_set_subwindow( m_textGC, GDK_INCLUDE_INFERIORS );
-  gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS );
+  if (sm_overlayWindow) gdk_window_show( sm_overlayWindow );
 
-  return TRUE;
-*/
+  return (sm_overlayWindow);
 }
 
 bool wxScreenDC::EndDrawingOnTop(void)
 {
+  if (sm_overlayWindow) gdk_window_destroy( sm_overlayWindow );
+  
+  sm_overlayWindow = NULL;
+  sm_overlayWindowX = 0;
+  sm_overlayWindowY = 0;
+  
   return TRUE;
-/*
-  if (m_window) gdk_window_destroy( m_window );
-  m_window = NULL;
-  m_isOk = FALSE;
-  return TRUE;
-*/
 }
 
index 2f1d7475585a222ace089436ea0bcac131e3f535..5864db957f4b096e28b58082f30ccb54074e3e48 100644 (file)
@@ -26,7 +26,7 @@
 // constants
 //-----------------------------------------------------------------------------
 
-const int wxMENU_HEIGHT    = 28;
+const int wxMENU_HEIGHT    = 30;
 const int wxSTATUS_HEIGHT  = 25;
 
 //-----------------------------------------------------------------------------
index 8e5f747858bf99198cc5b25401f2276c6932da14..4ffdab896bc4a71583dad70db2d079d9ce1b72f7 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "folder.xpm"
 #include "list.xpm"
+#include "test.xpm"
 
 //-----------------------------------------------------------------------------
 // main program
@@ -324,8 +325,7 @@ MyCanvas::MyCanvas( wxWindow *parent, const wxWindowID id, const wxPoint &pos, c
   : wxScrolledWindow( parent, id, pos, size, wxSUNKEN_BORDER ) 
 {
   my_bitmap = new wxBitmap( folder_xpm );
-//  my_horse = new wxBitmap();
-//  my_horse->LoadFile( "horse.png", 0 );
+  my_horse = new wxBitmap( test_xpm);
   my_backstore = new wxBitmap( 150, 150 );
   my_font = new wxFont( 20, wxROMAN, wxNORMAL, wxNORMAL );
   m_isCreated = FALSE;
@@ -337,7 +337,7 @@ MyCanvas::~MyCanvas(void)
 {
   delete my_bitmap;
   delete my_backstore;
-//  delete my_horse;
+  delete my_horse;
   delete my_font;
 };
 
@@ -387,7 +387,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
   dc.DrawText( "Hej, ho, hej, ho. (ItalicFont)", 80, 100 );
   
   dc.DrawBitmap( *my_bitmap, 30, 80, TRUE );
-//  dc.DrawBitmap( *my_horse, 30, 120 );
+  dc.DrawBitmap( *my_horse, 30, 120 );
   
   dc.Blit( 200, 200, 150, 150, &memDC, 0, 0, 0 );