gdi32.cpp 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. #include "windows.h"
  2. extern "C" {
  3. LOGFONTW * bmx_win32_LOGFONTW_new();
  4. void bmx_win32_LOGFONTW_free(LOGFONTW * font);
  5. void bmx_win32_LOGFONTW_SetlfHeight(LOGFONTW * font, int lfHeight);
  6. void bmx_win32_LOGFONTW_SetlfWidth(LOGFONTW * font, int lfWidth);
  7. void bmx_win32_LOGFONTW_SetlfWeight(LOGFONTW * font, int lfWeight);
  8. void bmx_win32_LOGFONTW_SetlfItalic(LOGFONTW * font, int lfItalic);
  9. void bmx_win32_LOGFONTW_SetlfUnderline(LOGFONTW * font, int lfUnderline);
  10. void bmx_win32_LOGFONTW_SetlfStrikeOut(LOGFONTW * font, int lfStrikeOut);
  11. int bmx_win32_LOGFONTW_lfHeight(LOGFONTW * font);
  12. int bmx_win32_LOGFONTW_lfWidth(LOGFONTW * font);
  13. int bmx_win32_LOGFONTW_lfEscapement(LOGFONTW * font);
  14. int bmx_win32_LOGFONTW_lfOrientation(LOGFONTW * font);
  15. int bmx_win32_LOGFONTW_lfWeight(LOGFONTW * font);
  16. int bmx_win32_LOGFONTW_lfItalic(LOGFONTW * font);
  17. int bmx_win32_LOGFONTW_lfUnderline(LOGFONTW * font);
  18. int bmx_win32_LOGFONTW_lfStrikeOut(LOGFONTW * font);
  19. int bmx_win32_LOGFONTW_lfCharSet(LOGFONTW * font);
  20. int bmx_win32_LOGFONTW_lfOutPrecision(LOGFONTW * font);
  21. int bmx_win32_LOGFONTW_lfClipPrecision(LOGFONTW * font);
  22. int bmx_win32_LOGFONTW_lfQuality(LOGFONTW * font);
  23. int bmx_win32_LOGFONTW_lfPitchAndFamily(LOGFONTW * font);
  24. WCHAR * bmx_win32_LOGFONTW_lfFaceName(LOGFONTW * font);
  25. int bmx_win32_LOGFONTW_size();
  26. TEXTMETRIC * bmx_win32_TEXTMETRIC_new();
  27. void bmx_win32_TEXTMETRIC_free(TEXTMETRIC * metric);
  28. int bmx_win32_TEXTMETRIC_tmAveCharWidth(TEXTMETRIC * metric);
  29. BITMAPINFOHEADER * bmx_win32_BITMAPINFOHEADER_new();
  30. void bmx_win32_BITMAPINFOHEADER_free(BITMAPINFOHEADER * hdr);
  31. void bmx_win32_BITMAPINFOHEADER_SetbiWidth(BITMAPINFOHEADER * hdr, int biWidth);
  32. void bmx_win32_BITMAPINFOHEADER_SetbiHeight(BITMAPINFOHEADER * hdr, int biHeight);
  33. void bmx_win32_BITMAPINFOHEADER_SetbiPlanes(BITMAPINFOHEADER * hdr, int biPlanes);
  34. void bmx_win32_BITMAPINFOHEADER_SetbiBitCount(BITMAPINFOHEADER * hdr, int biBitCount);
  35. void bmx_win32_BITMAPINFOHEADER_SetbiCompression(BITMAPINFOHEADER * hdr, int biCompression);
  36. }
  37. // ********************************************************
  38. int bmx_win32_LOGFONTW_size() {
  39. return sizeof(LOGFONTW);
  40. }
  41. LOGFONTW * bmx_win32_LOGFONTW_new() {
  42. return (LOGFONTW *)calloc(1, sizeof(LOGFONTW));
  43. }
  44. void bmx_win32_LOGFONTW_free(LOGFONTW * font) {
  45. free(font);
  46. }
  47. void bmx_win32_LOGFONTW_SetlfHeight(LOGFONTW * font, int lfHeight) {
  48. font->lfHeight= lfHeight;
  49. }
  50. void bmx_win32_LOGFONTW_SetlfWidth(LOGFONTW * font, int lfWidth) {
  51. font->lfWidth= lfWidth;
  52. }
  53. void bmx_win32_LOGFONTW_SetlfWeight(LOGFONTW * font, int lfWeight) {
  54. font->lfWeight= lfWeight;
  55. }
  56. void bmx_win32_LOGFONTW_SetlfItalic(LOGFONTW * font, int lfItalic) {
  57. font->lfItalic= lfItalic;
  58. }
  59. void bmx_win32_LOGFONTW_SetlfUnderline(LOGFONTW * font, int lfUnderline) {
  60. font->lfUnderline= lfUnderline;
  61. }
  62. void bmx_win32_LOGFONTW_SetlfStrikeOut(LOGFONTW * font, int lfStrikeOut) {
  63. font->lfStrikeOut= lfStrikeOut;
  64. }
  65. int bmx_win32_LOGFONTW_lfHeight(LOGFONTW * font) {
  66. return font->lfHeight;
  67. }
  68. int bmx_win32_LOGFONTW_lfWidth(LOGFONTW * font) {
  69. return font->lfWidth;
  70. }
  71. int bmx_win32_LOGFONTW_lfEscapement(LOGFONTW * font) {
  72. return font->lfEscapement;
  73. }
  74. int bmx_win32_LOGFONTW_lfOrientation(LOGFONTW * font) {
  75. return font->lfOrientation;
  76. }
  77. int bmx_win32_LOGFONTW_lfWeight(LOGFONTW * font) {
  78. return font->lfWeight;
  79. }
  80. int bmx_win32_LOGFONTW_lfItalic(LOGFONTW * font) {
  81. return font->lfItalic;
  82. }
  83. int bmx_win32_LOGFONTW_lfUnderline(LOGFONTW * font) {
  84. return font->lfUnderline;
  85. }
  86. int bmx_win32_LOGFONTW_lfStrikeOut(LOGFONTW * font) {
  87. return font->lfStrikeOut;
  88. }
  89. int bmx_win32_LOGFONTW_lfCharSet(LOGFONTW * font) {
  90. return font->lfCharSet;
  91. }
  92. int bmx_win32_LOGFONTW_lfOutPrecision(LOGFONTW * font) {
  93. return font->lfOutPrecision;
  94. }
  95. int bmx_win32_LOGFONTW_lfClipPrecision(LOGFONTW * font) {
  96. return font->lfClipPrecision;
  97. }
  98. int bmx_win32_LOGFONTW_lfQuality(LOGFONTW * font) {
  99. return font->lfQuality;
  100. }
  101. int bmx_win32_LOGFONTW_lfPitchAndFamily(LOGFONTW * font) {
  102. return font->lfPitchAndFamily;
  103. }
  104. WCHAR * bmx_win32_LOGFONTW_lfFaceName(LOGFONTW * font) {
  105. return font->lfFaceName;
  106. }
  107. // ********************************************************
  108. TEXTMETRIC * bmx_win32_TEXTMETRIC_new() {
  109. return (TEXTMETRIC *)calloc(1, sizeof(TEXTMETRIC));
  110. }
  111. void bmx_win32_TEXTMETRIC_free(TEXTMETRIC * metric) {
  112. free(metric);
  113. }
  114. int bmx_win32_TEXTMETRIC_tmAveCharWidth(TEXTMETRIC * metric) {
  115. return metric->tmAveCharWidth;
  116. }
  117. // ********************************************************
  118. BITMAPINFOHEADER * bmx_win32_BITMAPINFOHEADER_new() {
  119. BITMAPINFOHEADER * hdr = (BITMAPINFOHEADER *)calloc(1, sizeof(BITMAPINFOHEADER));
  120. hdr->biSize = sizeof(BITMAPINFOHEADER);
  121. return hdr;
  122. }
  123. void bmx_win32_BITMAPINFOHEADER_free(BITMAPINFOHEADER * hdr) {
  124. free(hdr);
  125. }
  126. void bmx_win32_BITMAPINFOHEADER_SetbiWidth(BITMAPINFOHEADER * hdr, int biWidth) {
  127. hdr->biWidth = biWidth;
  128. }
  129. void bmx_win32_BITMAPINFOHEADER_SetbiHeight(BITMAPINFOHEADER * hdr, int biHeight) {
  130. hdr->biHeight = biHeight;
  131. }
  132. void bmx_win32_BITMAPINFOHEADER_SetbiPlanes(BITMAPINFOHEADER * hdr, int biPlanes) {
  133. hdr->biPlanes = biPlanes;
  134. }
  135. void bmx_win32_BITMAPINFOHEADER_SetbiBitCount(BITMAPINFOHEADER * hdr, int biBitCount) {
  136. hdr->biBitCount = biBitCount;
  137. }
  138. void bmx_win32_BITMAPINFOHEADER_SetbiCompression(BITMAPINFOHEADER * hdr, int biCompression) {
  139. hdr->biCompression = biCompression;
  140. }