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();
00048
00049
00050 virtual void drawGraphics( const OSGraphics &rGraphics, int xSrc = 0,
00051 int ySrc = 0, int xDest = 0, int yDest = 0,
00052 int width = -1, int height = -1 );
00053
00054
00055 virtual void drawBitmap( const GenericBitmap &rBitmap, int xSrc = 0,
00056 int ySrc = 0, int xDest = 0, int yDest = 0,
00057 int width = -1, int height = -1,
00058 bool blend = false );
00059
00060
00061 virtual void fillRect( int left, int top, int width, int height,
00062 uint32_t color );
00063
00064
00065 virtual void drawRect( int left, int top, int width, int height,
00066 uint32_t color );
00067
00068
00069 virtual void applyMaskToWindow( OSWindow &rWindow );
00070
00071
00072 virtual void copyToWindow( OSWindow &rWindow, int xSrc,
00073 int ySrc, int width, int height,
00074 int xDest, int yDest );
00075
00076
00077 virtual bool hit( int x, int y ) const;
00078
00079
00080 virtual int getWidth() const { return m_width; }
00081 virtual int getHeight() const { return m_height; }
00082
00083
00084 Pixmap getDrawable() const { return m_pixmap; }
00085
00086 Region getMask() const { return m_mask; }
00087
00088 private:
00089
00090 X11Display &m_rDisplay;
00091
00092 int m_width, m_height;
00093
00094 Pixmap m_pixmap;
00095
00096 Region m_mask;
00097
00098 GC m_gc;
00099
00100
00101 void addHSegmentInRegion( Region &rMask, int xStart,
00102 int xEnd, int y );
00103
00104 void addVSegmentInRegion( Region &rMask, int yStart,
00105 int yEnd, int x );
00106 };
00107
00108
00109 #endif