]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/dcscreen.cpp
Attempt to add primary selection support, but doesn't work.
[wxWidgets.git] / src / gtk1 / dcscreen.cpp
index bd5f0c22e03803caa45ca5393ee42297f786230e..96491de8ad601c45a03f8c69f4f18146dde18390 100644 (file)
@@ -14,6 +14,9 @@
 #include "wx/dcscreen.h"
 #include "wx/window.h"
 
+#include "gdk/gdk.h"
+#include "gtk/gtk.h"
+
 //-----------------------------------------------------------------------------
 // global data initialization
 //-----------------------------------------------------------------------------
@@ -123,7 +126,7 @@ gdk_window_transparent_new ( GdkWindow     *parent,
   gprivate->window_type = attributes->window_type;
   gprivate->extension_events = FALSE;
   
-#ifndef NEW_GTK_DND_CODE
+#if (GTK_MINOR_VERSION == 0)
   gprivate->dnd_drag_data_type = None;
   gprivate->dnd_drag_data_typesavail =
     gprivate->dnd_drop_data_typesavail = NULL;
@@ -212,7 +215,7 @@ gdk_window_transparent_new ( GdkWindow     *parent,
   if (attributes_mask & GDK_WA_TITLE)
     title = attributes->title;
   else
-#if (GTK_MINOR_VERSION == 1)
+#if (GTK_MINOR_VERSION > 0)
     title = "Unknown"; // GLH: Well I don't know for the moment what to write here.
 #else
     title = gdk_progname;
@@ -245,54 +248,56 @@ IMPLEMENT_DYNAMIC_CLASS(wxScreenDC,wxPaintDC)
 
 wxScreenDC::wxScreenDC(void)
 {
-  m_ok = FALSE;
-  m_window = (GdkWindow *) NULL;
-  m_cmap = gdk_colormap_get_system();
+    m_ok = FALSE;
+    m_window = (GdkWindow *) NULL;
+    m_cmap = gdk_colormap_get_system();
   
-  if (sm_overlayWindow)
-  {
-    m_window = sm_overlayWindow;
-    m_deviceOriginX = - sm_overlayWindowX;
-    m_deviceOriginY = - sm_overlayWindowY;
-  }
-  else
-    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();
+    SetUpDC();
   
-  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 );
+    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 );
 }
 
 wxScreenDC::~wxScreenDC(void)
 {
-  EndDrawingOnTop();
+    EndDrawingOnTop();
 }
 
 bool wxScreenDC::StartDrawingOnTop( wxWindow *window )
 {
-  if (!window) return StartDrawingOnTop();
+    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 );
+    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 = x;
-  rect.y = y;
-  rect.width = 0;
-  rect.height = 0;
+    wxRect rect;
+    rect.x = x;
+    rect.y = y;
+    rect.width = 0;
+    rect.height = 0;
   
-  return StartDrawingOnTop( &rect );
+    return StartDrawingOnTop( &rect );
 }
 
-bool wxScreenDC::StartDrawingOnTop( wxRectangle *rect )
+bool wxScreenDC::StartDrawingOnTop( wxRect *rect )
 {
   int x = 0;
   int y = 0;
@@ -324,17 +329,17 @@ bool wxScreenDC::StartDrawingOnTop( wxRectangle *rect )
   
   if (sm_overlayWindow) gdk_window_show( sm_overlayWindow );
 
-  return (sm_overlayWindow);
+  return (sm_overlayWindow != NULL);
 }
 
 bool wxScreenDC::EndDrawingOnTop(void)
 {
-  if (sm_overlayWindow) gdk_window_destroy( sm_overlayWindow );
+    if (sm_overlayWindow) gdk_window_destroy( sm_overlayWindow );
   
-  sm_overlayWindow = NULL;
-  sm_overlayWindowX = 0;
-  sm_overlayWindowY = 0;
+    sm_overlayWindow = NULL;
+    sm_overlayWindowX = 0;
+    sm_overlayWindowY = 0;
   
-  return TRUE;
+    return TRUE;
 }