]> git.saurik.com Git - wxWidgets.git/blame - src/gtk1/dc.cpp
Change wxNotebook selection before sending page changed event in wxMSW.
[wxWidgets.git] / src / gtk1 / dc.cpp
CommitLineData
c801d85f 1/////////////////////////////////////////////////////////////////////////////
80fdcdb9 2// Name: src/gtk1/dc.cpp
c801d85f
KB
3// Purpose:
4// Author: Robert Roebling
6f65e337 5// RCS-ID: $Id$
6c9a19aa 6// Copyright: (c) 1998 Robert Roebling
65571936 7// Licence: wxWindows licence
c801d85f
KB
8/////////////////////////////////////////////////////////////////////////////
9
14f355c2
VS
10// For compilers that support precompilation, includes "wx.h".
11#include "wx/wxprec.h"
c801d85f 12
10d30222 13#include "wx/gtk1/dc.h"
c801d85f 14
071a2d78
RR
15#include <gdk/gdk.h>
16#include <gtk/gtk.h>
83624f79 17
c801d85f 18//-----------------------------------------------------------------------------
10d30222 19// wxGTKDCImpl
c801d85f
KB
20//-----------------------------------------------------------------------------
21
10d30222 22IMPLEMENT_ABSTRACT_CLASS(wxGTKDCImpl, wxDCImpl)
c801d85f 23
10d30222
VZ
24wxGTKDCImpl::wxGTKDCImpl(wxDC *owner)
25 : wxDCImpl(owner)
c801d85f 26{
4bc67cc5 27 m_ok = FALSE;
a23fd0e1 28
4bc67cc5 29 m_logicalFunction = wxCOPY;
a23fd0e1 30
4bc67cc5
RR
31 m_pen = *wxBLACK_PEN;
32 m_font = *wxNORMAL_FONT;
41bf0eb3 33 m_brush = *wxWHITE_BRUSH;
ff7b1510 34}
c801d85f 35
10d30222 36void wxGTKDCImpl::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
c801d85f 37{
4bc67cc5
RR
38 m_clipping = TRUE;
39 m_clipX1 = x;
40 m_clipY1 = y;
41 m_clipX2 = x + width;
42 m_clipY2 = y + height;
ff7b1510 43}
c801d85f 44
a23fd0e1
VZ
45// ---------------------------------------------------------------------------
46// get DC capabilities
47// ---------------------------------------------------------------------------
c801d85f 48
10d30222 49void wxGTKDCImpl::DoGetSizeMM( int* width, int* height ) const
c801d85f 50{
4bc67cc5
RR
51 int w = 0;
52 int h = 0;
53 GetSize( &w, &h );
ce83033f
VZ
54 if (width) *width = int( double(w) / (m_userScaleX*m_mm_to_pix_x) );
55 if (height) *height = int( double(h) / (m_userScaleY*m_mm_to_pix_y) );
7bcb11d3
JS
56}
57
58// Resolution in pixels per logical inch
10d30222 59wxSize wxGTKDCImpl::GetPPI() const
7bcb11d3
JS
60{
61 // TODO (should probably be pure virtual)
62 return wxSize(0, 0);
ff7b1510 63}
c801d85f 64