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.

174 lines
3.9 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. glvminit.cpp
  5. Abstract:
  6. This module contains the initial unidrv-hpgl handshaking function.
  7. Author:
  8. [Environment:]
  9. Windows 2000 Unidrv driver
  10. [Notes:]
  11. Revision History:
  12. --*/
  13. #include "hpgl2col.h" //Precompiled header file
  14. #include "vectorc.h"
  15. #include "glvminit.h"
  16. //
  17. // Local function declaration.
  18. //
  19. BOOL bIsGraphicsModeHPGL2 (
  20. IN PDEV *pPDev
  21. );
  22. //
  23. // The jump table. Initializing the jump table with the functions that
  24. // hpgl2 driver supports.
  25. //
  26. static VMPROCS HPGLProcs =
  27. {
  28. HPGLDriverDMS,
  29. HPGLCommandCallback,
  30. NULL, // HPGLImageProcessing
  31. NULL, // HPGLFilterGraphics
  32. NULL, // HPGLCompression
  33. NULL, // HPGLHalftonePattern
  34. NULL, // HPGLMemoryUsage
  35. NULL, // HPGLTTYGetInfo
  36. NULL, // HPGLDownloadFontHeader
  37. NULL, // HPGLDownloadCharGlyph
  38. NULL, // HPGLTTDownloadMethod
  39. NULL, // HPGLOutputCharStr
  40. NULL, // HPGLSendFontCmd
  41. HPGLTextOutAsBitmap,
  42. HPGLEnablePDEV,
  43. HPGLResetPDEV,
  44. NULL, // HPGLCompletePDEV,
  45. HPGLDisablePDEV,
  46. NULL, // HPGLEnableSurface,
  47. NULL, // HPGLDisableSurface,
  48. HPGLDisableDriver,
  49. HPGLStartDoc,
  50. HPGLStartPage,
  51. HPGLSendPage,
  52. HPGLEndDoc,
  53. HPGLStartBanding,
  54. HPGLNextBand,
  55. HPGLPaint,
  56. HPGLBitBlt,
  57. HPGLStretchBlt,
  58. #ifndef WINNT_40
  59. HPGLStretchBltROP,
  60. HPGLPlgBlt,
  61. #endif
  62. HPGLCopyBits,
  63. HPGLDitherColor,
  64. HPGLRealizeBrush,
  65. HPGLLineTo,
  66. HPGLStrokePath,
  67. HPGLFillPath,
  68. HPGLStrokeAndFillPath,
  69. #ifndef WINNT_40
  70. HPGLGradientFill,
  71. HPGLAlphaBlend,
  72. HPGLTransparentBlt,
  73. #endif
  74. HPGLTextOut,
  75. HPGLEscape,
  76. #ifdef HOOK_DEVICE_FONTS
  77. HPGLQueryFont,
  78. HPGLQueryFontTree,
  79. HPGLQueryFontData,
  80. HPGLGetGlyphMode,
  81. HPGLFontManagement,
  82. HPGLQueryAdvanceWidths
  83. #else
  84. NULL,
  85. NULL,
  86. NULL,
  87. NULL,
  88. NULL,
  89. NULL,
  90. #endif
  91. };
  92. PVMPROCS HPGLInitVectorProcTable (
  93. PDEV *pPDev,
  94. DEVINFO *pDevInfo,
  95. GDIINFO *pGDIInfo )
  96. {
  97. ASSERT (pPDev);
  98. UNREFERENCED_PARAMETER(pDevInfo);
  99. UNREFERENCED_PARAMETER(pGDIInfo);
  100. if ( bIsGraphicsModeHPGL2 (pPDev) )
  101. {
  102. return &HPGLProcs;
  103. }
  104. return NULL;
  105. }
  106. /*++
  107. Routine Name:
  108. bIsGraphicsModeHPGL2
  109. Routine Description:
  110. Finds out whether the Graphics Mode chosen by the user from the Advanced Page
  111. in the UI is HP-GL/2.
  112. Arguments:
  113. IN PDEV *pPDev, : Unidrv's PDEV
  114. Return Value:
  115. TRUE : If the graphics mode chosen by user is HP-GL/2
  116. FALSE: Otherwise
  117. Last Error:
  118. Not changed.
  119. --*/
  120. BOOL bIsGraphicsModeHPGL2 (
  121. IN PDEV *pPDev
  122. )
  123. {
  124. CHAR pOptionName[MAX_DISPLAY_NAME];
  125. DWORD cbNeeded = 0, cOptions = 0;
  126. //
  127. // The strings below are exactly as the ones in gpd
  128. // *Feature: GraphicsMode
  129. // *Option: HPGL2MODE
  130. // *Option: RASTERMODE
  131. //
  132. if ( BGetDriverSettingForOEM(pPDev,
  133. "GraphicsMode", //This is not unicode
  134. pOptionName,
  135. MAX_DISPLAY_NAME,
  136. &cbNeeded,
  137. &cOptions) &&
  138. !strcmp (pOptionName, "HPGL2MODE" ) //HPGL2 is not unicode
  139. )
  140. {
  141. return TRUE;
  142. }
  143. return FALSE;
  144. }