SapDisplay.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. #ifndef _SAPDISPLAY_H_
  2. #define _SAPDISPLAY_H_
  3. // SapDisplay.h : header file
  4. //
  5. #include "SapClassBasicDef.h"
  6. //
  7. // SapDisplay class declaration
  8. //
  9. class SAPCLASSBASIC_CLASS SapDisplay : public SapManager
  10. {
  11. public:
  12. // Display types
  13. typedef int Type; // For compatibility with old Sapera++ application code
  14. enum _Type
  15. {
  16. TypeUnknown = 0,
  17. TypeSystem = CORDISPLAY_VAL_TYPE_SYSTEM,
  18. TypeDuplicate = CORDISPLAY_VAL_TYPE_DUPLICATE,
  19. TypeExtended = CORDISPLAY_VAL_TYPE_EXTENDED,
  20. TypeIndependent = CORDISPLAY_VAL_TYPE_INDEPENDENT
  21. };
  22. // Various constants
  23. enum MiscValues
  24. {
  25. MaxFormats = 32
  26. };
  27. public:
  28. // Constructor/Destructor
  29. SapDisplay(SapLocation loc = SapLocation::ServerSystem);
  30. SapDisplay(const SapDisplay &disp);
  31. virtual ~SapDisplay();
  32. SapDisplay &operator=(const SapDisplay &disp);
  33. // Module create/destroy
  34. virtual BOOL Create();
  35. virtual BOOL Destroy();
  36. // Access to implementation
  37. CORHANDLE GetHandle() const { return m_hDisplay;}
  38. SapLocation GetLocation() const { return m_Location;}
  39. int GetWidth() const { return m_Width; }
  40. int GetHeight() const { return m_Height; }
  41. int GetPixelDepth() const { return m_PixelDepth; }
  42. int GetRefreshRate() const { return m_Refresh; }
  43. BOOL IsInterlaced() const { return m_Interlaced ? TRUE : FALSE; }
  44. Type GetType() const { return m_Type; }
  45. BOOL GetFormatDetection() const { return m_FormatDetection; }
  46. BOOL SetLocation(SapLocation location);
  47. virtual BOOL SetFormatDetection(BOOL formatDetection);
  48. virtual BOOL GetCapability(int cap, void *pValue);
  49. virtual BOOL GetParameter(int param, void *pValue);
  50. virtual BOOL SetParameter(int param, int value);
  51. virtual BOOL SetParameter(int param, void *pValue);
  52. virtual BOOL IsCapabilityValid(int cap);
  53. virtual BOOL IsParameterValid(int param);
  54. virtual BOOL IsPrimaryVGABoard();
  55. virtual BOOL IsOffscreenAvailable(SapFormat format);
  56. virtual BOOL IsOverlayAvailable(SapFormat format);
  57. // Access to display context
  58. virtual BOOL GetDC(HDC *pDC);
  59. virtual BOOL ReleaseDC();
  60. // Utility methods
  61. int IncRef() { m_nRef++; return m_nRef;}
  62. int DecRef() { if (m_nRef > 0) m_nRef--; return m_nRef;}
  63. // Obsolete methods
  64. BOOL IsSystem() const { return m_Type == TypeSystem; }
  65. BOOL IsIndependent() const { return m_Type == TypeIndependent; }
  66. #if !COR_WIN64
  67. // Programmable display support
  68. virtual BOOL SetMode(int width, int height, SapFormat format, int refresh);
  69. #endif
  70. protected:
  71. // Utility methods
  72. void Construct(SapLocation loc);
  73. protected:
  74. SapLocation m_Location;
  75. CORDISPLAY m_hDisplay;
  76. int m_nRef; // Number of views attached to the object
  77. // Parameters
  78. int m_Width; // Displayable width
  79. int m_Height; // Displayable height
  80. int m_PixelDepth; // Number of bits per pixel
  81. int m_Refresh; // Refresh rate in Hz
  82. int m_Interlaced; // Non-zero if current display mode is interlaced
  83. Type m_Type; // Display type
  84. BOOL m_FormatDetection; // Enable or disable detection of available offscreen and overlay formats
  85. // Available offscreen and overlay display formats
  86. int m_OffscreenFormats[MaxFormats];
  87. int m_OverlayFormats[MaxFormats];
  88. };
  89. #endif // _SAPDISPLAY_H_