2
0

gdi32.cpp 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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. TEXTMETRIC * bmx_win32_TEXTMETRIC_new();
  26. void bmx_win32_TEXTMETRIC_free(TEXTMETRIC * metric);
  27. int bmx_win32_TEXTMETRIC_tmAveCharWidth(TEXTMETRIC * metric);
  28. }
  29. // ********************************************************
  30. LOGFONTW * bmx_win32_LOGFONTW_new() {
  31. return (LOGFONTW *)calloc(1, sizeof(LOGFONTW));
  32. }
  33. void bmx_win32_LOGFONTW_free(LOGFONTW * font) {
  34. free(font);
  35. }
  36. void bmx_win32_LOGFONTW_SetlfHeight(LOGFONTW * font, int lfHeight) {
  37. font->lfHeight= lfHeight;
  38. }
  39. void bmx_win32_LOGFONTW_SetlfWidth(LOGFONTW * font, int lfWidth) {
  40. font->lfWidth= lfWidth;
  41. }
  42. void bmx_win32_LOGFONTW_SetlfWeight(LOGFONTW * font, int lfWeight) {
  43. font->lfWeight= lfWeight;
  44. }
  45. void bmx_win32_LOGFONTW_SetlfItalic(LOGFONTW * font, int lfItalic) {
  46. font->lfItalic= lfItalic;
  47. }
  48. void bmx_win32_LOGFONTW_SetlfUnderline(LOGFONTW * font, int lfUnderline) {
  49. font->lfUnderline= lfUnderline;
  50. }
  51. void bmx_win32_LOGFONTW_SetlfStrikeOut(LOGFONTW * font, int lfStrikeOut) {
  52. font->lfStrikeOut= lfStrikeOut;
  53. }
  54. int bmx_win32_LOGFONTW_lfHeight(LOGFONTW * font) {
  55. return font->lfHeight;
  56. }
  57. int bmx_win32_LOGFONTW_lfWidth(LOGFONTW * font) {
  58. return font->lfWidth;
  59. }
  60. int bmx_win32_LOGFONTW_lfEscapement(LOGFONTW * font) {
  61. return font->lfEscapement;
  62. }
  63. int bmx_win32_LOGFONTW_lfOrientation(LOGFONTW * font) {
  64. return font->lfOrientation;
  65. }
  66. int bmx_win32_LOGFONTW_lfWeight(LOGFONTW * font) {
  67. return font->lfWeight;
  68. }
  69. int bmx_win32_LOGFONTW_lfItalic(LOGFONTW * font) {
  70. return font->lfItalic;
  71. }
  72. int bmx_win32_LOGFONTW_lfUnderline(LOGFONTW * font) {
  73. return font->lfUnderline;
  74. }
  75. int bmx_win32_LOGFONTW_lfStrikeOut(LOGFONTW * font) {
  76. return font->lfStrikeOut;
  77. }
  78. int bmx_win32_LOGFONTW_lfCharSet(LOGFONTW * font) {
  79. return font->lfCharSet;
  80. }
  81. int bmx_win32_LOGFONTW_lfOutPrecision(LOGFONTW * font) {
  82. return font->lfOutPrecision;
  83. }
  84. int bmx_win32_LOGFONTW_lfClipPrecision(LOGFONTW * font) {
  85. return font->lfClipPrecision;
  86. }
  87. int bmx_win32_LOGFONTW_lfQuality(LOGFONTW * font) {
  88. return font->lfQuality;
  89. }
  90. int bmx_win32_LOGFONTW_lfPitchAndFamily(LOGFONTW * font) {
  91. return font->lfPitchAndFamily;
  92. }
  93. WCHAR * bmx_win32_LOGFONTW_lfFaceName(LOGFONTW * font) {
  94. return font->lfFaceName;
  95. }
  96. // ********************************************************
  97. TEXTMETRIC * bmx_win32_TEXTMETRIC_new() {
  98. return (TEXTMETRIC *)calloc(1, sizeof(TEXTMETRIC));
  99. }
  100. void bmx_win32_TEXTMETRIC_free(TEXTMETRIC * metric) {
  101. free(metric);
  102. }
  103. int bmx_win32_TEXTMETRIC_tmAveCharWidth(TEXTMETRIC * metric) {
  104. return metric->tmAveCharWidth;
  105. }