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 #ifndef __HIPPBACKGROUND_H__
00022 #define __HIPPBACKGROUND_H__
00023
00024 #include <wx/docview.h>
00025 #include "HippShape.h"
00026 #include <xercesc/util/XMLString.hpp>
00027 #include <iostream>
00028
00029 using namespace xercesc;
00030 using namespace std;
00031 namespace hipp {
00032
00048 class HippBackground: public HippShape {
00049 public:
00050 HippBackground(string imagePath);
00051 ~HippBackground(void);
00052
00053 void LoadObject(const xercesc::Attributes& attrs, const XMLCh* const localname=XMLString::transcode("background"));
00054 ostream& SaveObject(ostream& stream);
00055
00056 ShapeType getShapeType(){
00057 return Image;
00058 }
00059
00060 const wxRect& getBounds() const;
00061 bool containsPoint(wxPoint p) const;
00062 void OnDraw(Cairo::RefPtr<Cairo::Context> context, bool isHaptic) const;
00063 virtual HippBackground* clone() const;
00064 void move(int diffX, int diffY);
00065 void zoom(double scaleX, double scaleY);
00066
00067 private:
00068 int x, y, width, height;
00069 string sPath;
00070 wxRect m_rectangle;
00071 Cairo::RefPtr<Cairo::ImageSurface> surface;
00072 Cairo::RefPtr<Cairo::ImageSurface> grayscaleSurface;
00073 bool imageLoaded;
00074 unsigned char * data;
00075 };
00076 }
00077 #endif