windraw.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /** @file
  2. * Header file for internal routines.
  3. *
  4. * @author anlzhao
  5. * @author mandy.wu 2009/06/30
  6. * @version 0.1
  7. */
  8. #ifndef _WINDRAW_H
  9. #define _WINDRAW_H
  10. #include "gui_eng/stddefs.h"
  11. #include "gui_eng/device_gdi.h"
  12. /**
  13. * Draw a point using the current foreground color.
  14. *
  15. * @param hdc Handle to device context.
  16. * @param swX x coordinate of the pixel.
  17. * @param swY y coordinate of the pixel.
  18. * @return GUI_SUCCESS if succeed, error codes otherwise.
  19. */
  20. GUIResult_e DRAW_PutPixel(HDC hdc, INT16 swX, INT16 swY, INT32 *pBlockId);
  21. /**
  22. * Draw a vertical or a horizontal line by the current fg color.
  23. *
  24. * @param hdc Handle to device context.
  25. * @param swX1 x coordinate of first input line.
  26. * @param swY1 y coordinate of first input line.
  27. * @param swX2 x coordinate of second input line.
  28. * @param swY2 y coordinate of second input line.
  29. * @param wThickness Thickness of line.
  30. * @return GUI_SUCCESS if succeed, error codes otherwise.
  31. */
  32. GUIResult_e DRAW_DrawLine(HDC hdc, INT16 swX1, INT16 swY1, INT16 swX2, INT16 swY2, UINT16 wThickness, INT32 *pBlockId);
  33. /**
  34. * Draw a rectangle by the current fg color.
  35. *
  36. * @param hdc Handle to device context.
  37. * @param pRect Rectangle to be drawn.
  38. * @param wThickneess Thickness of line.
  39. * @return GUI_SUCCESS if succeed, error codes otherwise.
  40. */
  41. GUIResult_e DRAW_DrawRect(HDC hdc, PRECT pRect, UINT16 wThickness, INT32 *pBlockId);
  42. /**
  43. * Fill a rectangle with the foreground color
  44. *
  45. * @param hdc Handle to device context.
  46. * @param pRect Rectangle to be filled.
  47. * @param bIgnoreTransparentColor Ignore drawing transparent or not.
  48. * @return GUI_SUCCESS if succeed, error codes otherwise.
  49. */
  50. GUIResult_e DRAW_FillRect(HDC hdc, PRECT pRect, BOOLEAN bIgnoreTransparentColor, INT32 *pBlockId);
  51. /**
  52. * Draw a no 4-byte pitch aligned bitmap.
  53. *
  54. * @param hdc Handle to device context.
  55. * @param swX Left edge of destination rectangle.
  56. * @param swY Top edge of destination rectangle.
  57. * @param pImgData Pointer to icon info PIMAGEHDR containing image
  58. * data ,height ,width with Data compressed using
  59. * compression technique.
  60. * @return GUI_SUCCESS if succeed, error codes otherwise.
  61. */
  62. GUIResult_e DRAW_DrawTextBitmap(HDC hdc, PRECT pstRect, const PIMAGEHDR pImgData, INT32 *pBlockId);
  63. /**
  64. * Draw a 4-bytes pitch aligned bitmap.
  65. *
  66. * @param hdc Handle to device context.
  67. * @param pSrcRect Pointer of the source rectangle.
  68. * @param pSrcRect Pointer of the destination rectangle.
  69. * @param pImgData Pointer to a bitmap header.
  70. * @param dFlags Flags indicating different drawing styles.
  71. * @param bDrawFlag Refer to GDL_XXX definitions in device_gdi.h
  72. * @return GUI_SUCCESS if succeed, error codes otherwise.
  73. */
  74. GUIResult_e DRAW_DrawBitmap (HDC hdc, PRECT pSrcRect, PRECT pDstRect, const PIMAGEHDR pImgData,
  75. PALENTRY *pDynSrcPal, UINT32 dFlags, UINT8 bDrawFlag, INT32 *pBlockId);
  76. /**
  77. * Apply a constant alpha value when blit a bitmap.
  78. *
  79. * @param hdc Handle to device context.
  80. * @param pDstRect Pointer of the source rectangle.
  81. * @param pImgData Pointer to the handle of a bitmap.
  82. * @param bAlphaValue The constant alpha value to be applied.
  83. * @return GUI_SUCCESS if succeed, error codes otherwise.
  84. */
  85. GUIResult_e DRAW_BlendBitmap(HDC hdc, PRECT pDstRect, const PIMAGEHDR pImgData, PALENTRY *pDynSrcPal,
  86. UINT8 bAlphaValue, INT32 *pBlockId);
  87. /**
  88. * Stretch blit a bitmap to the target HDC rectangle.
  89. *
  90. * @param hdc Handle to device context.
  91. * @param pDstRect Pointer to the target rectangle to be drawn.
  92. * @param pImgData Pointer to the handle of a bitmap.
  93. * @param dFlags Flags indicating different draw styles
  94. * @return GUI_SUCCESS if succeed, error codes otherwise.
  95. */
  96. GUIResult_e DRAW_StretchBlit(HDC hdc, PRECT pDstRect, const PIMAGEHDR pImgData, PALENTRY *pDynSrcPal,
  97. UINT32 dFlags, INT32 *pBlockId);
  98. #endif