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.

79 lines
2.0 KiB

  1. #if !defined(INC__SmGadget_inl__INCLUDED)
  2. #define INC__SmGadget_inl__INCLUDED
  3. //------------------------------------------------------------------------------
  4. inline
  5. SmGadget::SmGadget()
  6. {
  7. m_hgad = NULL;
  8. }
  9. //------------------------------------------------------------------------------
  10. inline
  11. SmGadget::~SmGadget()
  12. {
  13. }
  14. //------------------------------------------------------------------------------
  15. inline BOOL
  16. SmGadget::PostBuild()
  17. {
  18. return TRUE;
  19. }
  20. //------------------------------------------------------------------------------
  21. inline HRESULT
  22. SmGadget::GadgetProc(EventMsg * pmsg)
  23. {
  24. if (pmsg->hgadMsg == m_hgad) {
  25. switch (pmsg->nMsg)
  26. {
  27. case GM_PAINT:
  28. {
  29. GMSG_PAINT * pmsgPaint = (GMSG_PAINT *) pmsg;
  30. if (pmsgPaint->nCmd == GPAINT_RENDER) {
  31. switch (pmsgPaint->nSurfaceType)
  32. {
  33. case GSURFACE_HDC:
  34. {
  35. GMSG_PAINTRENDERI * pmsgR = (GMSG_PAINTRENDERI *) pmsgPaint;
  36. OnDraw(pmsgR->hdc, pmsgR);
  37. }
  38. break;
  39. #ifdef GADGET_ENABLE_GDIPLUS
  40. case GSURFACE_GPGRAPHICS:
  41. {
  42. GMSG_PAINTRENDERF * pmsgR = (GMSG_PAINTRENDERF *) pmsgPaint;
  43. OnDraw(pmsgR->pgpgr, pmsgR);
  44. }
  45. break;
  46. #endif // GADGET_ENABLE_GDIPLUS
  47. default:
  48. Trace("WARNING: Unknown surface type\n");
  49. }
  50. return DU_S_PARTIAL;
  51. }
  52. }
  53. break;
  54. }
  55. }
  56. return DU_S_NOTHANDLED;
  57. }
  58. //------------------------------------------------------------------------------
  59. inline void
  60. SmGadget::Invalidate()
  61. {
  62. InvalidateGadget(m_hgad);
  63. }
  64. #endif // INC__SmGadget_inl__INCLUDED