1
0

bufferpaintwnd.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef __BPAINTWND_H
  2. #define __BPAINTWND_H
  3. #include <api/wnd/wndclass/guiobjwnd.h>
  4. #define BUFFERPAINTWND_PARENT GuiObjectWnd
  5. class BufferPaintWnd : public BUFFERPAINTWND_PARENT {
  6. public:
  7. BufferPaintWnd();
  8. virtual ~BufferPaintWnd();
  9. virtual int onInit();
  10. virtual int onPaint(Canvas *c);
  11. virtual int onBufferPaint(BltCanvas *c, int w, int h) { return 1; }
  12. virtual int wantEvenAlignment() { return 0; } // if you need even coordinates for your framebuffer, return 1 here
  13. virtual void getBufferPaintSize(int *w, int *h); // by default returns client width/height
  14. virtual void getBufferPaintSource(RECT *r); // by default returns the size of the quickpaint canvas
  15. virtual void getBufferPaintDest(RECT *r); // by default returns the size of client area
  16. virtual int wantNegativeHeight() { return 0; }
  17. virtual void invalidateBuffer();
  18. virtual int onResize();
  19. virtual void onNewBuffer(int w, int h) {}
  20. protected:
  21. BltCanvas *render_canvas;
  22. private:
  23. void bufferPaint();
  24. int updateCanvas();
  25. int canvas_w, canvas_h;
  26. int invalidated;
  27. };
  28. #endif