]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk1/dcscreen.cpp
   1 ///////////////////////////////////////////////////////////////////////////// 
   4 // Author:      Robert Roebling 
   6 // Copyright:   (c) 1998 Robert Roebling 
   7 // Licence:     wxWindows licence 
   8 ///////////////////////////////////////////////////////////////////////////// 
  10 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) 
  11 #pragma implementation "dcscreen.h" 
  14 // For compilers that support precompilation, includes "wx.h". 
  15 #include "wx/wxprec.h" 
  17 #include "wx/dcscreen.h" 
  18 #include "wx/window.h" 
  24 //----------------------------------------------------------------------------- 
  25 // global data initialization 
  26 //----------------------------------------------------------------------------- 
  28 GdkWindow 
*wxScreenDC::sm_overlayWindow  
= (GdkWindow
*) NULL
; 
  29 int wxScreenDC::sm_overlayWindowX 
= 0; 
  30 int wxScreenDC::sm_overlayWindowY 
= 0; 
  32 //----------------------------------------------------------------------------- 
  34 //----------------------------------------------------------------------------- 
  36 IMPLEMENT_DYNAMIC_CLASS(wxScreenDC
,wxPaintDC
) 
  38 wxScreenDC::wxScreenDC() 
  41     m_cmap 
= gdk_colormap_get_system(); 
  42     m_window 
= GDK_ROOT_PARENT(); 
  48     gdk_gc_set_subwindow( m_penGC
, GDK_INCLUDE_INFERIORS 
); 
  49     gdk_gc_set_subwindow( m_brushGC
, GDK_INCLUDE_INFERIORS 
); 
  50     gdk_gc_set_subwindow( m_textGC
, GDK_INCLUDE_INFERIORS 
); 
  51     gdk_gc_set_subwindow( m_bgGC
, GDK_INCLUDE_INFERIORS 
); 
  54 wxScreenDC::~wxScreenDC() 
  56     gdk_gc_set_subwindow( m_penGC
, GDK_CLIP_BY_CHILDREN 
); 
  57     gdk_gc_set_subwindow( m_brushGC
, GDK_CLIP_BY_CHILDREN 
); 
  58     gdk_gc_set_subwindow( m_textGC
, GDK_CLIP_BY_CHILDREN 
); 
  59     gdk_gc_set_subwindow( m_bgGC
, GDK_CLIP_BY_CHILDREN 
); 
  64 bool wxScreenDC::StartDrawingOnTop( wxWindow 
*window 
) 
  66     if (!window
) return StartDrawingOnTop(); 
  70     window
->GetPosition( &x
, &y 
); 
  73     window
->GetSize( &w
, &h 
); 
  74     window
->ClientToScreen( &x
, &y 
); 
  82     return StartDrawingOnTop( &rect 
); 
  85 bool wxScreenDC::StartDrawingOnTop( wxRect 
*rect 
) 
  89     int width 
= gdk_screen_width(); 
  90     int height 
= gdk_screen_height(); 
  96         height 
= rect
->height
; 
 102 bool wxScreenDC::EndDrawingOnTop() 
 107 void wxScreenDC::DoGetSize(int *width
, int *height
) const 
 109     wxDisplaySize(width
, height
);