36 m_dx = dx ? dx : window.
dx() ;
37 m_dy = dy ? dy : window.
dy() ;
38 G_ASSERT( m_dx >= 0 && m_dy >= 0 ) ;
39 m_pixmap = XCreatePixmap( display.
x() , window.
x() ,
40 static_cast<unsigned int>(m_dx) , static_cast<unsigned int>(m_dy) ,
41 static_cast<unsigned int>(display.
depth()) ) ;
48 XFreePixmap( m_display.x() , m_pixmap ) ;
77 Context gc = m_display.defaultContext() ;
78 blit( window , gc , src_x , src_y , dx , dy , dst_x , dst_y ) ;
82 int src_x ,
int src_y ,
int dx ,
int dy ,
int dst_x ,
int dst_y )
84 G_ASSERT( dx >= 0 && dy >= 0 ) ;
85 XCopyArea( m_display.x() , m_pixmap , window.
x() , gc.
x() , src_x , src_y ,
86 static_cast<unsigned int>(dx) , static_cast<unsigned int>(dy) , dst_x , dst_y ) ;
91 unsigned int mask =
static_cast<unsigned int>(~0) ;
92 XImage * p = XGetImage( m_display.x() , m_pixmap , 0 , 0 ,
93 static_cast<unsigned int>(m_dx) , static_cast<unsigned int>(m_dy) ,
96 throw Error(
"XGetImage" ) ;
97 image.reset(
new Image( m_display , p , m_dx , m_dy ) ) ;
102 Context gc = m_display.defaultContext() ;
103 drawRectangle( gc , 0 , 0 , m_dx , m_dy ) ;
A window class that is-a GX::Drawable and a GX::EventHandler.
::Display * x()
Returns the X object.
A class for xclient-side images that are drawn locally and then blitted to the xserver.
void readImage(unique_ptr< Image > &) const
Reads the image from the xserver.
::Pixmap x()
Returns the X object.
int dx() const
Returns the current width.
Pixmap(Display &, GX::Window &window, int dx=0, int dy=0)
Constructor. The display reference is kept.
void blit(GX::Window &, int src_x, int src_y, int dx, int dy, int dst_x, int dst_y)
Blits to a window.
An exception class for GX classes.
A pixmap class for xserver-side images.
::GC x()
Returns the X object.
int dx() const
Returns the width.
::Window x()
Returns the X object.
virtual ::Drawable xd()
From Drawable.
int dy() const
Returns the current hieght.
void clear()
Draws a big rectangle to clear the pixmap.
int dy() const
Returns the height.
int depth() const
Returns the color depth (in bits).
An abstract base class for xserver-side drawables (windows, pixmaps, etc) with methods for drawing po...