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.

77 lines
1.8 KiB

  1. /**************************************************************************\
  2. *
  3. * Copyright (c) 2000 Microsoft Corporation
  4. *
  5. * Module Name:
  6. *
  7. * StaticFlatApi.cpp
  8. *
  9. * Abstract:
  10. *
  11. * Flat GDI+ API wrappers for the static lib
  12. *
  13. * Revision History:
  14. *
  15. * 3/23/2000 dcurtis
  16. * Created it.
  17. *
  18. \**************************************************************************/
  19. #include "precomp.hpp"
  20. #include "StaticFlat.h"
  21. #if DBG
  22. #include <mmsystem.h>
  23. #endif
  24. // GillesK
  25. // Forward declaration of GdipGetWinMetaFileBitsStub which is in
  26. // gpmf3216
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. //--------------------------------------------------------------------------
  31. // CheckParameter(p)
  32. //
  33. // If p evaluates to FALSE, then we currently assert. In future,
  34. // we can simply return an invalid parameter status which throws
  35. // an exception.
  36. //
  37. // CheckObjectBusy(p)
  38. //
  39. // Not implemented. Bails out if object is currently being used.
  40. //
  41. //--------------------------------------------------------------------------
  42. //
  43. // !!!: Only include NULL & IsValid checks in checked builds?
  44. //
  45. // !!!: Instead of deleting object, call a Dispose() method, so far
  46. // only Bitmap supports this.
  47. //
  48. // !!!: Lock Matrix objects, what about color?
  49. #define CheckParameter(cond) \
  50. if (! (cond)) \
  51. return InvalidParameter;
  52. #define CheckParameterValid(obj) \
  53. if (!obj || !(obj->IsValid())) \
  54. return InvalidParameter;
  55. #define CheckObjectBusy(obj) \
  56. GpLock lock##obj(obj->GetObjectLock()); \
  57. if (!(lock##obj).IsValid()) \
  58. return ObjectBusy;
  59. #define CheckFontParameter(font) \
  60. if (!(font) || !((font)->IsValid())) \
  61. return InvalidParameter;
  62. #ifdef __cplusplus
  63. } // end of extern "C"
  64. #endif