1
0

VideoOSD.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef NULLSOFT_VIDEOOSDH
  2. #define NULLSOFT_VIDEOOSDH
  3. /* Video On Screen Display */
  4. #include <windows.h>
  5. #define NUM_WIDGETS 11
  6. class IVideoOSD
  7. {
  8. public:
  9. IVideoOSD();
  10. ~IVideoOSD();
  11. void SetParent(HWND _parent)
  12. {
  13. parent=_parent;
  14. }
  15. bool Showing();
  16. bool Ready();
  17. void Show();
  18. void Hide();
  19. void Draw();
  20. int GetBarHeight();
  21. bool Mouse(int x, int y, WPARAM wParam, bool moving); // return true if we need to close because of this
  22. int ctrlrects_ready;
  23. virtual bool MouseDown(int x, int y, WPARAM wParam) {return false;};
  24. virtual bool MouseMove(int x, int y, WPARAM wParam) {return false;};
  25. virtual bool MouseUp(int x, int y, WPARAM wParam) {return false;};
  26. protected:
  27. HWND parent;
  28. private:
  29. bool CloseHitTest(int x, int y);
  30. void HitTest(int x, int y, int dragging);
  31. int osdLastClickItem;
  32. int osdMemBMW; // width of memory bitmap
  33. int osdMemBMH; // height of memory bitmap
  34. int osdLastMouseX; // for WM_MOUSEMOVE thresholding, so osd isn't spastic
  35. int osdLastMouseY; // for WM_MOUSEMOVE thresholding, so osd isn't spastic
  36. RECT ctrlrect[NUM_WIDGETS]; // relative to [i.e. (0,0) is] upper left corner of the black strip @ the bottom
  37. RECT ctrlrect_all; // relative to [i.e. (0,0) is] upper left corner of the black strip @ the bottom
  38. bool show_osd;
  39. static void CALLBACK TimerCallback(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
  40. int ignore_mousemove_count;
  41. int last_close_height, last_close_width;
  42. };
  43. #endif