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.

148 lines
4.5 KiB

  1. /*++
  2. Copyright (c) 1996 - 1999 Microsoft Corporation
  3. Module Name:
  4. fmmacro.h
  5. Abstract:
  6. Font module main macro header file.
  7. Environment:
  8. Windows NT Unidrv driver
  9. Revision History:
  10. 11/18/96 -ganeshp-
  11. Created
  12. dd-mm-yy -author-
  13. description
  14. --*/
  15. #ifndef _FMMACRO_H
  16. #define _FMMACRO_H
  17. /* Debugging macroes specific to Font Module */
  18. #if DBG // Check Build
  19. /* Error handling macroes */
  20. #define ERREXIT(ErrString) { ERR((ErrString));goto ErrorExit;}
  21. #else // Free Build
  22. /* Error handling macroes */
  23. #define ERREXIT(ErrString) { goto ErrorExit;}
  24. #endif // if DBG
  25. /* Macroes */
  26. #define ARF_IS_NULLSTRING(String) ((String).dwCount == 0)
  27. #define BUFFSIZE 1024
  28. #define PFDV ((PFONTPDEV)(pPDev->pFontPDev))
  29. #define POINTEQUAL(pt1,pt2) ((pt1.x == pt2.x) && (pt1.y == pt2.y))
  30. #define VALID_FONTPDEV(pfontpdev) \
  31. ( (pfontpdev) && ((pfontpdev)->dwSignature == FONTPDEV_ID) )
  32. #define MEMFREEANDRESET(ptr) { if (ptr) MemFree( (LPSTR)ptr ); ptr = NULL; }
  33. #define SIZEOFDEVPFM() (sizeof( FONTMAP ) + sizeof(FONTMAP_DEV))
  34. #if 0
  35. #define NO_ROTATION(xform) ( \
  36. (FLOATOBJ_EqualLong(&(xform.eM12), 0) && \
  37. FLOATOBJ_EqualLong(&(xform.eM21), 0) ) || \
  38. (FLOATOBJ_EqualLong(&(xform.eM11), 0) && \
  39. FLOATOBJ_EqualLong(&(xform.eM22), 0) )\
  40. )
  41. #else
  42. #define NO_ROTATION(xform) ( \
  43. FLOATOBJ_EqualLong(&(xform.eM12), 0) && \
  44. FLOATOBJ_EqualLong(&(xform.eM21), 0) && \
  45. FLOATOBJ_GreaterThanLong(&(xform.eM11),0) && \
  46. FLOATOBJ_GreaterThanLong(&(xform.eM22),0) \
  47. )
  48. #endif
  49. #define GLYPH_IN_NEW_SOFTFONT(pFontPDev, pdm, pdlGlyph) \
  50. ( \
  51. (pdm->wFlags & DLM_BOUNDED) && \
  52. (pdm->wBaseDLFontid != pdm->wCurrFontId) && \
  53. (pdlGlyph->wDLFontId != (WORD)(pFontPDev->ctl.iSoftFont)) \
  54. )
  55. #define SET_CURSOR_FOR_EACH_GLYPH(flAccel) \
  56. ( \
  57. (!(flAccel & SO_FLAG_DEFAULT_PLACEMENT)) || \
  58. ( flAccel & SO_VERTICAL ) || \
  59. ( flAccel & SO_REVERSED ) \
  60. )
  61. #define SET_CURSOR_POS(pPDev,pgp,flAccel) \
  62. if (!(flAccel & SO_FLAG_DEFAULT_PLACEMENT)) \
  63. XMoveTo(pPDev, pgp->ptl.x, MV_GRAPHICS|MV_FINE)
  64. //
  65. // Cursor Move type
  66. //
  67. #define MOVE_RELATIVE 0x0001
  68. #define MOVE_ABSOLUTE 0x0002
  69. #define MOVE_UPDATE 0x0004
  70. /* Defines for Floating point numbers */
  71. #if defined(_X86_) && !defined(USERMODE_DRIVER)
  72. #define FLOATL_0_0 0 // 0.0 in IEEE floating point format
  73. #define FLOATL_00_001M 0xAE000000 // -00.000976625f
  74. #define FLOATL_00_001 0x2E000000 // 00.000976625f
  75. #define FLOATL_00_005 0x3ba3d70a // 00.005f
  76. #define FLOATL_00_005M 0xbba3d70a // -00.005f
  77. #define FLOATL_00_50 0x3F000000 // 00.50f in IEEE floating point format
  78. #define FLOATL_00_90 0x3f666666 // 00.90f in IEEE floating point format
  79. #define FLOATL_1_0 0x3F800000 // 1.0f in IEEE floating point format
  80. #define FLOATL_1_0M 0xBF800000 // -1.0f in IEEE floating point format
  81. #define FLOATL_72_00 0x42900000 // 72.00f in IEEE floating point format
  82. #define FLOATL_72_31 0x42909EB8 // 72.31f in IEEE floating point format
  83. #define FLOATL_PI 0x40490fdb // 3.14159265358979f
  84. #else //RISC
  85. #define FLOATL_0_0 0.0f
  86. #define FLOATL_00_001M -0.001f
  87. #define FLOATL_00_001 0.001f
  88. #define FLOATL_00_005M -0.005f
  89. #define FLOATL_00_005 0.005f
  90. #define FLOATL_00_50 0.5f
  91. #define FLOATL_00_90 0.9f
  92. #define FLOATL_1_0 1.0f
  93. #define FLOATL_1_0M -1.0f
  94. #define FLOATL_72_00 72.00f
  95. #define FLOATL_72_31 72.31f
  96. #define FLOATL_PI 3.14159265358979f
  97. #endif _X86_
  98. #define SYMBOL_START 0xf020
  99. #define SYMBOL_END 0xf0ff
  100. #define NUM_OF_SYMBOL SYMBOL_END - SYMBOL_START + 1
  101. #define EURO_CUR_SYMBOL 0x20ac
  102. #define IS_SYMBOL_CHARSET(pfm) (pfm->pIFIMet->jWinCharSet == 0x02)
  103. BOOL
  104. NONSQUARE_FONT(
  105. PXFORML pxform);
  106. #endif // !_FMMACRO_H