openblt

a hobby OS from the late 90s
git clone http://frotz.net/git/openblt.git
Log | Files | Refs | LICENSE

Canvas.h (1171B)


      1 #ifndef _CANVAS_H
      2 #define _CANVAS_H
      3 
      4 class Window;
      5 class Event;
      6 
      7 class Canvas {
      8 public:
      9 
     10 	Canvas();
     11 	virtual ~Canvas();
     12 	
     13 	void AddChild(Canvas *child, long left, long top, long right, long bottom);
     14 	void RemoveChild(Canvas *child);
     15 	void DrawLine(long, long, long, long);
     16 	void FillRect(long, long, long, long);
     17 	void SetBackgroundColor(char);
     18 	void SetPenColor(char);
     19 	void DrawString(long, long, const char*);
     20 	void Hide();
     21 	void Show();
     22 	void CopyRect(long left, long top, long right, long bottom, long newLeft,
     23 		long newTop);
     24 	Window* GetWindow() const;
     25 	void GetBounds(long *left, long *top, long *right, long *bottom);
     26 	void Invalidate(long left = 0, long top = 0, long right = 100000, long bottom
     27 		= 100000);
     28 	void LockMouseFocus();
     29 	
     30 	virtual void Repaint(long left, long top, long right, long bottom);
     31 	virtual void EventReceived(const Event*);
     32 
     33 	
     34 private:
     35 
     36 	void HandleEvent(Event*);
     37 	void BeginPaint(long *out_left, long *out_top, long *out_right, long *out_bottom);
     38 	void EndPaint();
     39 
     40 	int fID;
     41 	Window *fWindow;
     42 	bool fInPaint;
     43 	int fShowLevel;
     44 	Canvas *fWinListNext, **fWinListPrev;
     45 	long fLeft, fTop, fRight, fBottom;
     46 
     47 	friend class Window;
     48 };
     49 
     50 
     51 #endif