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.

66 lines
2.1 KiB

  1. #if !defined(MOTION__Context_h__INCLUDED)
  2. #define MOTION__Context_h__INCLUDED
  3. #pragma once
  4. #include "Scheduler.h"
  5. /***************************************************************************\
  6. *****************************************************************************
  7. *
  8. * MotionSC contains Context-specific information used by the Motion project
  9. * in DirectUser. This class is instantiated by the ResourceManager when it
  10. * creates a new Context object.
  11. *
  12. *****************************************************************************
  13. \***************************************************************************/
  14. class MotionSC : public SubContext
  15. {
  16. // Construction
  17. public:
  18. inline MotionSC();
  19. virtual ~MotionSC();
  20. virtual void xwPreDestroyNL();
  21. // Operations
  22. public:
  23. inline Scheduler * GetScheduler();
  24. inline DWORD GetTimeslice();
  25. inline void SetTimeslice(DWORD dwTimeslice);
  26. inline HBRUSH GetBrushI(UINT idxBrush) const;
  27. Gdiplus::Brush *
  28. GetBrushF(UINT idxBrush) const;
  29. inline HPEN GetPenI(UINT idxPen) const;
  30. Gdiplus::Pen *
  31. GetPenF(UINT idxPen) const;
  32. virtual DWORD xwOnIdleNL();
  33. // Data
  34. protected:
  35. Scheduler m_sch;
  36. DWORD m_dwLastTimeslice;
  37. DWORD m_dwPauseTimeslice;
  38. //
  39. // NOTE: Both GDI and GDI+ lock the brush / pen objects when they are
  40. // being used. This means that if multiple threads try to use the same
  41. // brush, the function calls may fail.
  42. //
  43. mutable HBRUSH m_rghbrStd[SC_MAXCOLORS];
  44. mutable HPEN m_rghpenStd[SC_MAXCOLORS];
  45. mutable Gdiplus::SolidBrush *
  46. m_rgpgpbrStd[SC_MAXCOLORS];
  47. mutable Gdiplus::Pen *
  48. m_rgpgppenStd[SC_MAXCOLORS];
  49. };
  50. inline MotionSC * GetMotionSC();
  51. inline MotionSC * GetMotionSC(Context * pContext);
  52. #include "Context.inl"
  53. #endif // MOTION__Context_h__INCLUDED