1
0

qpaintwnd.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. #ifndef __QPAINTWND_H
  2. #define __QPAINTWND_H
  3. #include <api/wnd/wndclass/guiobjwnd.h>
  4. #include <api/service/svcs/svc_skinfilter.h>
  5. #define QUICKPAINTWND_PARENT GuiObjectWnd
  6. /**
  7. class QuickPaintWnd .
  8. @short
  9. @author Nullsoft
  10. @ver 1.0
  11. @see
  12. @cat BFC
  13. */
  14. class QuickPaintContext;
  15. class QuickPaintWnd : public QUICKPAINTWND_PARENT {
  16. public:
  17. /**
  18. QuickPaintWnd constructor .
  19. @see ~QuickPaintWnd()
  20. */
  21. QuickPaintWnd();
  22. /**
  23. Destructor for QuickPaintWnd .
  24. @see QuickPaintWnd()
  25. */
  26. virtual ~QuickPaintWnd();
  27. /**
  28. QuickPaintWnd method onInit .
  29. @ret 1
  30. */
  31. virtual int onInit();
  32. virtual int onPaint(Canvas *c);
  33. /**
  34. QuickPaintWnd method timerCallback .
  35. @param id Identifies requested action
  36. */
  37. virtual void timerCallback(int id);
  38. virtual void onSetVisible(int show);
  39. /**
  40. QuickPaintWnd method setRealtime .
  41. @see getRealtime()
  42. @param rt
  43. */
  44. virtual void setRealtime(int rt);
  45. int getRealtime() const;
  46. /**
  47. QuickPaintWnd method setSpeed sets the timer interval in milliseconds.
  48. @see getSpeed()
  49. @param ms The timer interval in milliseconds.
  50. */
  51. virtual void setSpeed(int ms);
  52. /**
  53. QuickPaintWnd method getSpeed gets the timer interval in milliseconds.
  54. @see setSpeed()
  55. @param ms The timer interval in milliseconds.
  56. */
  57. virtual int getSpeed();
  58. /**
  59. QuickPaintWnd method startQuickPaint .
  60. */
  61. virtual void startQuickPaint();
  62. /**
  63. QuickPaintWnd method stopQuickPaint .
  64. */
  65. virtual void stopQuickPaint();
  66. /**
  67. QuickPaintWnd method isQuickPainting .
  68. */
  69. virtual int isQuickPainting();
  70. virtual int onQuickPaint(BltCanvas *c, int w, int h, int newone) { return 0; } // return 1 if your content has changed, or 0 to cancel update of your buffer to the window
  71. virtual int wantEvenAlignment() { return 0; } // if you need even coordinates for your framebuffer, return 1 here
  72. /**
  73. QuickPaintWnd method getQuickPaintSize gets the client area width and
  74. height.
  75. @param w A pointer to the width to fill.
  76. @param h A pointer to the height to fill.
  77. */
  78. virtual void getQuickPaintSize(int *w, int *h); // by default returns client width/height
  79. /**
  80. QuickPaintWnd method getQuickPaintSource .
  81. @see getQuickPaintSize()
  82. @assert r exists.
  83. @ret None
  84. @except
  85. @param r
  86. */
  87. virtual void getQuickPaintSource(RECT *r); // by default returns the size of the quickpaint canvas
  88. /**
  89. QuickPaintWnd method getQuickPaintDest .
  90. @see getQuickPaintSource()
  91. @assert r exists.
  92. @param r
  93. */
  94. virtual void getQuickPaintDest(RECT *r); // by default returns the size of client area
  95. virtual int wantNegativeHeight() { return 0; }
  96. virtual int wantFilters() { return 0; }
  97. virtual const wchar_t *getFiltersGroup() { return L"Vis/Eq"; }
  98. protected:
  99. int invalidated;
  100. private:
  101. /**
  102. QuickPaintWnd method quickPaint .
  103. */
  104. friend class QuickPaintContext;
  105. int quickPaint();
  106. void KillThread();
  107. void CreateRenderThread();
  108. int realtime;
  109. volatile LONG invalidates_required;
  110. BltCanvas *render_canvas1, *render_canvas2, *paint_canvas;
  111. void SetPaintingCanvas(BltCanvas *c);
  112. BltCanvas *&GetDrawingConvas();
  113. int canvas_w, canvas_h;
  114. int speed;
  115. int timerset;
  116. int enabled;
  117. PtrList<svc_skinFilter>filters;
  118. SkinFilterEnum sfe;
  119. QuickPaintContext *thread_context;
  120. };
  121. #endif