Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.6 KiB

  1. //------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 2000
  5. //
  6. // File: XBarGlyph.h
  7. //
  8. // Contents: image of an xBar pane
  9. //
  10. // Classes: CXBarGlyph
  11. //
  12. //------------------------------------------------------------------------
  13. #ifndef _XBAR_GLYPH_H_
  14. #define _XBAR_GLYPH_H_
  15. #if _MSC_VER > 1000
  16. #pragma once
  17. #endif // _MSC_VER > 1000
  18. //------------------------------------------------------------------------
  19. // encapsule the image used by xBar panes,
  20. // can potentially be any format, for now we only support icon format
  21. class CXBarGlyph :
  22. public CRefCount
  23. {
  24. public:
  25. CXBarGlyph();
  26. protected:
  27. virtual ~CXBarGlyph();
  28. // operations
  29. public:
  30. HRESULT SetIcon(HICON hIcon, BOOL fAlpha);
  31. HICON GetIcon(void);
  32. BOOL IsAlpha(void) { return _fAlpha; }
  33. BOOL HaveGlyph(void);
  34. LONG GetWidth(void);
  35. LONG GetHeight(void);
  36. HRESULT LoadGlyphFile(LPCTSTR pszPath, BOOL fSmall);
  37. HRESULT LoadDefaultGlyph(BOOL fSmall, BOOL fHot);
  38. HRESULT Draw(HDC hdc, int x, int y);
  39. private:
  40. void _EnsureDimensions(void);
  41. // attributes
  42. protected:
  43. HBITMAP _hbmpColor;
  44. HBITMAP _hbmpMask;
  45. BOOL _fAlpha;
  46. LONG _lWidth;
  47. LONG _lHeight;
  48. private:
  49. };
  50. #endif // !defined(_XBAR_GLYPH_H_)