x11_graphics.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef X11_GRAPHICS_HPP
00026 #define X11_GRAPHICS_HPP
00027
00028 #include <X11/Xlib.h>
00029 #include <X11/Xutil.h>
00030
00031 #include "../src/os_graphics.hpp"
00032
00033 class X11Display;
00034 class GenericWindow;
00035 class GenericBitmap;
00036
00037
00038 class X11Graphics: public OSGraphics
00039 {
00040 public:
00041 X11Graphics( intf_thread_t *pIntf, X11Display &rDisplay, int width,
00042 int height);
00043
00044 virtual ~X11Graphics();
00045
00046
00047 virtual void clear( int xDest = 0, int yDest = 0,
00048 int width = -1, int height = -1 );
00049
00050
00051 virtual void drawGraphics( const OSGraphics &rGraphics, int xSrc = 0,
00052 int ySrc = 0, int xDest = 0, int yDest = 0,
00053 int width = -1, int height = -1 );
00054
00055
00056 virtual void drawBitmap( const GenericBitmap &rBitmap, int xSrc = 0,
00057 int ySrc = 0, int xDest = 0, int yDest = 0,
00058 int width = -1, int height = -1,
00059 bool blend = false );
00060
00061
00062 virtual void fillRect( int left, int top, int width, int height,
00063 uint32_t color );
00064
00065
00066 virtual void drawRect( int left, int top, int width, int height,
00067 uint32_t color );
00068
00069
00070 virtual void applyMaskToWindow( OSWindow &rWindow );
00071
00072
00073 virtual void copyToWindow( OSWindow &rWindow, int xSrc,
00074 int ySrc, int width, int height,
00075 int xDest, int yDest );
00076
00077
00078 virtual bool hit( int x, int y ) const;
00079
00080
00081 virtual int getWidth() const { return m_width; }
00082 virtual int getHeight() const { return m_height; }
00083
00084
00085 Pixmap getDrawable() const { return m_pixmap; }
00086
00087 Region getMask() const { return m_mask; }
00088
00089 private:
00090
00091 X11Display &m_rDisplay;
00092
00093 int m_width, m_height;
00094
00095 Pixmap m_pixmap;
00096
00097 Region m_mask;
00098
00099 GC m_gc;
00100
00101
00102 void addHSegmentInRegion( Region &rMask, int xStart, int xEnd, int y );
00103
00104 void addVSegmentInRegion( Region &rMask, int yStart, int yEnd, int x );
00105 };
00106
00107
00108 #endif