gdi32.bmx 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729
  1. Strict
  2. Import "gdi32.cpp"
  3. Const OUT_DEFAULT_PRECIS=0
  4. Const OUT_STRING_PRECIS=1
  5. Const OUT_CHARACTER_PRECIS=2
  6. Const OUT_STROKE_PRECIS=3
  7. Const OUT_TT_PRECIS=4
  8. Const OUT_DEVICE_PRECIS=5
  9. Const OUT_RASTER_PRECIS=6
  10. Const OUT_TT_ONLY_PRECIS=7
  11. Const OUT_OUTLINE_PRECIS=8
  12. Const OUT_SCREEN_OUTLINE_PRECIS=9
  13. Const OUT_PS_ONLY_PRECIS=10
  14. Const CLIP_DEFAULT_PRECIS=0
  15. Const CLIP_CHARACTER_PRECIS=1
  16. Const CLIP_STROKE_PRECIS=2
  17. Const CLIP_MASK=15
  18. Const CLIP_LH_ANGLES=(1 Shl 4)
  19. Const CLIP_TT_ALWAYS=(2 Shl 4)
  20. Const CLIP_DFA_DISABLE=(4 Shl 4)
  21. Const CLIP_EMBEDDED=(8 Shl 4)
  22. ' font constants
  23. Const DEFAULT_QUALITY =0
  24. Const DRAFT_QUALITY =1
  25. Const PROOF_QUALITY =2
  26. Const NONANTIALIASED_QUALITY=3
  27. Const ANTIALIASED_QUALITY= 4
  28. Const CLEARTYPE_QUALITY=5
  29. Const CLEARTYPE_NATURAL_QUALITY=6
  30. Const DEFAULT_PITCH =0
  31. Const FIXED_PITCH =1
  32. Const VARIABLE_PITCH=2
  33. Const MONO_FONT =8
  34. Const ANSI_CHARSET=0
  35. Const DEFAULT_CHARSET =1
  36. Const SYMBOL_CHARSET=2
  37. Const SHIFTJIS_CHARSET=128
  38. Const HANGEUL_CHARSET =129
  39. Const HANGUL_CHARSET=129
  40. Const GB2312_CHARSET=134
  41. Const CHINESEBIG5_CHARSET =136
  42. Const OEM_CHARSET =255
  43. Const JOHAB_CHARSET =130
  44. Const HEBREW_CHARSET=177
  45. Const ARABIC_CHARSET=178
  46. Const GREEK_CHARSET =161
  47. Const TURKISH_CHARSET =162
  48. Const VIETNAMESE_CHARSET=163
  49. Const THAI_CHARSET=222
  50. Const EASTEUROPE_CHARSET=238
  51. Const RUSSIAN_CHARSET =204
  52. Const MAC_CHARSET =77
  53. Const BALTIC_CHARSET=186
  54. Const FS_LATIN1 =$00000001
  55. Const FS_LATIN2 =$00000002
  56. Const FS_CYRILLIC =$00000004
  57. Const FS_GREEK=$00000008
  58. Const FS_TURKISH=$00000010
  59. Const FS_HEBREW =$00000020
  60. Const FS_ARABIC =$00000040
  61. Const FS_BALTIC =$00000080
  62. Const FS_VIETNAMESE =$00000100
  63. Const FS_THAI =$00010000
  64. Const FS_JISJAPAN =$00020000
  65. Const FS_CHINESESIMP=$00040000
  66. Const FS_WANSUNG=$00080000
  67. Const FS_CHINESETRAD=$00100000
  68. Const FS_JOHAB=$00200000
  69. Const FS_SYMBOL =$80000000
  70. Const FF_DONTCARE =(0 Shl 4)' Don't care or don't know.
  71. Const FF_ROMAN=(1 Shl 4)' Variable stroke width, serifed.
  72. ' Times Roman, Century Schoolbook, etc.
  73. Const FF_SWISS=(2 Shl 4)' Variable stroke width, sans-serifed.
  74. ' Helvetica, Swiss, etc.
  75. Const FF_MODERN =(3 Shl 4)' Constant stroke width, serifed Or sans-serifed.
  76. ' Pica, Elite, Courier, etc.
  77. Const FF_SCRIPT =(4 Shl 4)' Cursive, etc.
  78. Const FF_DECORATIVE =(5 Shl 4)' Old English, etc.
  79. ' Font Weights
  80. Const FW_DONTCARE =0
  81. Const FW_THIN =100
  82. Const FW_EXTRALIGHT =200
  83. Const FW_LIGHT=300
  84. Const FW_NORMAL =400
  85. Const FW_MEDIUM =500
  86. Const FW_SEMIBOLD =600
  87. Const FW_BOLD =700
  88. Const FW_EXTRABOLD=800
  89. Const FW_HEAVY=900
  90. Const FW_ULTRALIGHT =FW_EXTRALIGHT
  91. Const FW_REGULAR=FW_NORMAL
  92. Const FW_DEMIBOLD =FW_SEMIBOLD
  93. Const FW_ULTRABOLD=FW_EXTRABOLD
  94. Const FW_BLACK=FW_HEAVY
  95. ' Device Parameters for GetDeviceCaps()
  96. Const DRIVERVERSION =0 ' Device driver version
  97. Const TECHNOLOGY=2 ' Device classification
  98. Const HORZSIZE=4 ' Horizontal size in millimeters
  99. Const VERTSIZE=6 ' Vertical size in millimeters
  100. Const HORZRES =8 ' Horizontal width in pixels
  101. Const VERTRES =10' Vertical height in pixels
  102. Const BITSPIXEL =12' Number of bits per pixel
  103. Const PLANES=14' Number of planes
  104. Const NUMBRUSHES=16' Number of brushes the device has
  105. Const NUMPENS =18' Number of pens the device has
  106. Const NUMMARKERS=20' Number of markers the device has
  107. Const NUMFONTS=22' Number of fonts the device has
  108. Const NUMCOLORS =24' Number of colors the device supports
  109. Const PDEVICESIZE =26' Size required For device descriptor
  110. Const CURVECAPS =28' Curve capabilities
  111. Const LINECAPS=30' Line capabilities
  112. Const POLYGONALCAPS =32' Polygonal capabilities
  113. Const TEXTCAPS=34' Text capabilities
  114. Const CLIPCAPS=36' Clipping capabilities
  115. Const RASTERCAPS=38' Bitblt capabilities
  116. Const ASPECTX =40' Length of the X leg
  117. Const ASPECTY =42' Length of the Y leg
  118. Const ASPECTXY=44' Length of the hypotenuse
  119. Const LOGPIXELSX=88' Logical pixels/inch in X
  120. Const LOGPIXELSY=90' Logical pixels/inch in Y
  121. Const SIZEPALETTE=104' Number of entries in physical palette
  122. Const NUMRESERVED=106' Number of reserved entries in palette
  123. Const COLORRES =108' Actual color resolution
  124. ' Printing related DeviceCaps. These Replace the appropriate Escapes
  125. Const PHYSICALWIDTH =110 ' Physical Width in device units
  126. Const PHYSICALHEIGHT=111 ' Physical Height in device units
  127. Const PHYSICALOFFSETX =112 ' Physical Printable Area x margin
  128. Const PHYSICALOFFSETY =113 ' Physical Printable Area y margin
  129. Const SCALINGFACTORX=114 ' Scaling factor x
  130. Const SCALINGFACTORY=115 ' Scaling factor y
  131. ' Display driver specific
  132. Const VREFRESH=116' Current vertical refresh rate of the display device (For displays only) in Hz
  133. Const DESKTOPVERTRES=117' Horizontal width of entire Desktop in pixels
  134. Const DESKTOPHORZRES=118' Vertical height of entire Desktop in pixels
  135. Const BLTALIGNMENT=119' Preferred blt alignment
  136. Const SHADEBLENDCAPS=120' Shading And blending caps
  137. Const COLORMGMTCAPS =121' Color Management caps
  138. Const WHITE_BRUSH=0
  139. Const LTGRAY_BRUSH=1
  140. Const GRAY_BRUSH=2
  141. Const DKGRAY_BRUSH=3
  142. Const BLACK_BRUSH=4
  143. Const HOLLOW_BRUSH=5
  144. Const NULL_BRUSH=5
  145. Const WHITE_PEN=6
  146. Const BLACK_PEN=7
  147. Const NULL_PEN=8
  148. Const OEM_FIXED_FONT=10
  149. Const ANSI_FIXED_FONT=11
  150. Const ANSI_VAR_FONT=12
  151. Const SYSTEM_FONT=13
  152. Const DEVICE_DEFAULT_FONT=14
  153. Const DEFAULT_PALETTE=15
  154. Const SYSTEM_FIXED_FONT=16
  155. Const DEFAULT_GUI_FONT=17
  156. Const DC_BRUSH=18
  157. Const DC_PEN=19
  158. Const ROP_SRCCOPY=$00CC0020
  159. Const ROP_SRCPAINT=$00EE0086
  160. Const ROP_SRCAND=$008800C6
  161. Const ROP_SRCINVERT=$00660046
  162. Const ROP_SRCERASE=$00440328
  163. Const ROP_NOTSRCCOPY=$00330008
  164. Const ROP_NOTSRCERASE=$001100A6
  165. Const ROP_MERGECOPY=$00C000CA
  166. Const ROP_MERGEPAINT=$00BB0226
  167. Const ROP_PATCOPY=$00F00021
  168. Const ROP_PATPAINT=$00FB0A09
  169. Const ROP_PATINVERT=$005A0049
  170. Const ROP_DSTINVERT=$00550009
  171. Const ROP_BLACKNESS=$00000042
  172. Const ROP_WHITENESS=$00FF0062
  173. Const DM_SPECVERSION=800
  174. Const DM_GRAYSCALE=1
  175. Const DM_INTERLACED=2
  176. Const DM_UPDATE=1
  177. Const DM_COPY=2
  178. Const DM_PROMPT=4
  179. Const DM_MODIFY=8
  180. Const DM_IN_BUFFER=DM_MODIFY
  181. Const DM_IN_PROMPT=DM_PROMPT
  182. Const DM_OUT_BUFFER=DM_COPY
  183. Const DM_OUT_DEFAULT=DM_UPDATE
  184. Const DM_ORIENTATION=1
  185. Const DM_PAPERSIZE=2
  186. Const DM_PAPERLENGTH=4
  187. Const DM_PAPERWIDTH=8
  188. Const DM_SCALE=16
  189. Const DM_COPIES=256
  190. Const DM_DEFAULTSOURCE=512
  191. Const DM_PRINTQUALITY=1024
  192. Const DM_COLOR=2048
  193. Const DM_DUPLEX=4096
  194. Const DM_YRESOLUTION=8192
  195. Const DM_TTOPTION=16384
  196. Const DM_COLLATE=32768
  197. Const DM_FORMNAME=65536
  198. Const DM_LOGPIXELS=$20000
  199. Const DM_BITSPERPEL=$40000
  200. Const DM_PELSWIDTH=$80000
  201. Const DM_PELSHEIGHT=$100000
  202. Const DM_DISPLAYFLAGS=$200000
  203. Const DM_DISPLAYFREQUENCY=$400000
  204. Const DM_ICMMETHOD=$800000
  205. Const DM_ICMINTENT=$1000000
  206. Const DM_MEDIATYPE=$2000000
  207. Const DM_DITHERTYPE=$4000000
  208. Const PFD_TYPE_RGBA=0
  209. Const PFD_TYPE_COLORINDEX=1
  210. Const PFD_MAIN_PLANE=0
  211. Const PFD_OVERLAY_PLANE=1
  212. Const PFD_UNDERLAY_PLANE=-1
  213. Const PFD_DOUBLEBUFFER=1
  214. Const PFD_STEREO=2
  215. Const PFD_DRAW_TO_WINDOW=4
  216. Const PFD_DRAW_TO_BITMAP=8
  217. Const PFD_SUPPORT_GDI=16
  218. Const PFD_SUPPORT_OPENGL=32
  219. Const PFD_GENERIC_FORMAT=64
  220. Const PFD_NEED_PALETTE=128
  221. Const PFD_NEED_SYSTEM_PALETTE=$00000100
  222. Const PFD_SWAP_EXCHANGE=$00000200
  223. Const PFD_SWAP_COPY=$00000400
  224. Const PFD_SWAP_LAYER_BUFFERS=$00000800
  225. Const PFD_GENERIC_ACCELERATED=$00001000
  226. Const PFD_DEPTH_DONTCARE=$20000000
  227. Const PFD_DOUBLEBUFFER_DONTCARE=$40000000
  228. Const PFD_STEREO_DONTCARE=$80000000
  229. Const BI_RGB=0
  230. Const BI_RLE8=1
  231. Const BI_RLE4=2
  232. Const BI_BITFIELDS=3
  233. Const BI_JPEG=4
  234. Const BI_PNG=5
  235. Const DIB_RGB_COLORS=0
  236. Const DIB_PAL_COLORS=1
  237. Const BLACKONWHITE=1
  238. Const WHITEONBLACK=2
  239. Const COLORONCOLOR=3
  240. Const HALFTONE=4
  241. Const WGL_ARB_pixel_format =$0001
  242. Const WGL_NUMBER_PIXEL_FORMATS_ARB =$2000
  243. Const WGL_DRAW_TO_WINDOW_ARB =$2001
  244. Const WGL_DRAW_TO_BITMAP_ARB =$2002
  245. Const WGL_ACCELERATION_ARB =$2003
  246. Const WGL_NEED_PALETTE_ARB =$2004
  247. Const WGL_NEED_SYSTEM_PALETTE_ARB =$2005
  248. Const WGL_SWAP_LAYER_BUFFERS_ARB =$2006
  249. Const WGL_SWAP_METHOD_ARB =$2007
  250. Const WGL_NUMBER_OVERLAYS_ARB =$2008
  251. Const WGL_NUMBER_UNDERLAYS_ARB =$2009
  252. Const WGL_TRANSPARENT_ARB =$200A
  253. Const WGL_TRANSPARENT_RED_VALUE_ARB =$2037
  254. Const WGL_TRANSPARENT_GREEN_VALUE_ARB =$2038
  255. Const WGL_TRANSPARENT_BLUE_VALUE_ARB =$2039
  256. Const WGL_TRANSPARENT_ALPHA_VALUE_ARB =$203A
  257. Const WGL_TRANSPARENT_INDEX_VALUE_ARB =$203B
  258. Const WGL_SHARE_DEPTH_ARB =$200C
  259. Const WGL_SHARE_STENCIL_ARB =$200D
  260. Const WGL_SHARE_ACCUM_ARB =$200E
  261. Const WGL_SUPPORT_GDI_ARB =$200F
  262. Const WGL_SUPPORT_OPENGL_ARB =$2010
  263. Const WGL_DOUBLE_BUFFER_ARB =$2011
  264. Const WGL_STEREO_ARB =$2012
  265. Const WGL_PIXEL_TYPE_ARB =$2013
  266. Const WGL_COLOR_BITS_ARB =$2014
  267. Const WGL_RED_BITS_ARB =$2015
  268. Const WGL_RED_SHIFT_ARB =$2016
  269. Const WGL_GREEN_BITS_ARB =$2017
  270. Const WGL_GREEN_SHIFT_ARB =$2018
  271. Const WGL_BLUE_BITS_ARB =$2019
  272. Const WGL_BLUE_SHIFT_ARB =$201A
  273. Const WGL_ALPHA_BITS_ARB =$201B
  274. Const WGL_ALPHA_SHIFT_ARB =$201C
  275. Const WGL_ACCUM_BITS_ARB =$201D
  276. Const WGL_ACCUM_RED_BITS_ARB =$201E
  277. Const WGL_ACCUM_GREEN_BITS_ARB =$201F
  278. Const WGL_ACCUM_BLUE_BITS_ARB =$2020
  279. Const WGL_ACCUM_ALPHA_BITS_ARB =$2021
  280. Const WGL_DEPTH_BITS_ARB =$2022
  281. Const WGL_STENCIL_BITS_ARB =$2023
  282. Const WGL_AUX_BUFFERS_ARB =$2024
  283. Const WGL_NO_ACCELERATION_ARB =$2025
  284. Const WGL_GENERIC_ACCELERATION_ARB =$2026
  285. Const WGL_FULL_ACCELERATION_ARB =$2027
  286. Const WGL_SWAP_EXCHANGE_ARB =$2028
  287. Const WGL_SWAP_COPY_ARB =$2029
  288. Const WGL_SWAP_UNDEFINED_ARB =$202A
  289. Const WGL_TYPE_RGBA_ARB =$202B
  290. Const WGL_TYPE_COLORINDEX_ARB =$202C
  291. Const WGL_SAMPLE_BUFFERS_ARB =$2041
  292. Const WGL_SAMPLES_ARB =$2042
  293. Type DEVMODE
  294. Field pad0,pad1,pad2,pad3,pad4,pad5,pad6,pad7 'dmDeviceName[32] - eek!
  295. Field dmSpecVersion:Short
  296. Field dmDriverVersion:Short
  297. Field dmSize:Short
  298. Field dmDriverExtra:Short
  299. Field dmFields
  300. Field dmPostition_x,dmPosition_y 'actually a gnarly union
  301. Field dmScale:Short
  302. Field dmCopies:Short
  303. Field dmDefaultSource:Short
  304. Field dmPrintQuality:Short
  305. Field dmColor:Short
  306. Field dmDuplex:Short
  307. Field dmYResolution:Short
  308. Field dmTTOption:Short
  309. Field dmCollate:Short
  310. Field pad8:Short,pad9,pad10,pad11,pad12,pad13,pad14,pad15,pad16:Short 'dmFormName[32]
  311. Field dmLogPixels:Short
  312. Field dmBitsPerPel
  313. Field dmPelsWidth
  314. Field dmPelsHeight
  315. Field dmDisplayFlags
  316. Field dmDisplayFrequency
  317. Field dmICMMethod
  318. Field dmICMIntent
  319. Field dmMediaType
  320. Field dmDitherType
  321. Field dmReserved1
  322. Field dmReserved2
  323. Field dmPanningWidth
  324. Field dmPanningHeight
  325. End Type
  326. Type PIXELFORMATDESCRIPTOR
  327. Field nSize:Short
  328. Field nVersion:Short
  329. Field dwFlags
  330. Field iPixelType:Byte
  331. Field cColorBits:Byte
  332. Field cRedBits:Byte
  333. Field cRedShift:Byte
  334. Field cGreenBits:Byte
  335. Field cGreenShift:Byte
  336. Field cBlueBits:Byte
  337. Field cBlueShift:Byte
  338. Field cAlphaBits:Byte
  339. Field cAlphaShift:Byte
  340. Field cAccumBits:Byte
  341. Field cAccumRedBits:Byte
  342. Field cAccumGreenBits:Byte
  343. Field cAccumBlueBits:Byte
  344. Field cAccumAlphaBits:Byte
  345. Field cDepthBits:Byte
  346. Field cStencilBits:Byte
  347. Field cAuxBuffers:Byte
  348. Field iLayerType:Byte
  349. Field bReserved:Byte
  350. Field dwLayerMask
  351. Field dwVisibleMask
  352. Field dwDamageMask
  353. End Type
  354. Extern
  355. Function bmx_win32_BITMAPINFOHEADER_new:Byte Ptr()
  356. Function bmx_win32_BITMAPINFOHEADER_free(handle:Byte Ptr)
  357. Function bmx_win32_BITMAPINFOHEADER_SetbiWidth(handle:Byte Ptr, biWidth:Int)
  358. Function bmx_win32_BITMAPINFOHEADER_SetbiHeight(handle:Byte Ptr, biHeight:Int)
  359. Function bmx_win32_BITMAPINFOHEADER_SetbiPlanes(handle:Byte Ptr, biPlanes:Int)
  360. Function bmx_win32_BITMAPINFOHEADER_SetbiBitCount(handle:Byte Ptr, biBitCount:Int)
  361. Function bmx_win32_BITMAPINFOHEADER_SetbiCompression(handle:Byte Ptr, biCompression:Int)
  362. End Extern
  363. Type BITMAPINFOHEADER
  364. Field infoPtr:Byte Ptr
  365. Method New()
  366. infoPtr = bmx_win32_BITMAPINFOHEADER_new()
  367. End Method
  368. Method Delete()
  369. Free()
  370. End Method
  371. Method Free()
  372. If infoPtr Then
  373. bmx_win32_BITMAPINFOHEADER_free(infoPtr)
  374. End If
  375. infoPtr = Null
  376. End Method
  377. Method SetbiWidth(biWidth:Int)
  378. bmx_win32_BITMAPINFOHEADER_SetbiWidth(infoPtr, biWidth)
  379. End Method
  380. Method SetbiHeight(biHeight:Int)
  381. bmx_win32_BITMAPINFOHEADER_SetbiHeight(infoPtr, biHeight)
  382. End Method
  383. Method SetbiPlanes(biPlanes:Int)
  384. bmx_win32_BITMAPINFOHEADER_SetbiPlanes(infoPtr, biPlanes)
  385. End Method
  386. Method SetbiBitCount(biBitCount:Int)
  387. bmx_win32_BITMAPINFOHEADER_SetbiBitCount(infoPtr, biBitCount)
  388. End Method
  389. Method SetbiCompression(biCompression:Int)
  390. bmx_win32_BITMAPINFOHEADER_SetbiCompression(infoPtr, biCompression)
  391. End Method
  392. ' Field biSize
  393. ' Field biWidth
  394. ' Field biHeight
  395. ' Field biPlanes:Short
  396. ' Field biBitCount:Short
  397. ' Field biCompression
  398. ' Field biSizeImage
  399. ' Field biXPelsPerMeter
  400. ' Field biYPelsPerMeter
  401. ' Field biClrUsed
  402. ' Field biClrImportant
  403. End Type
  404. Extern
  405. Function bmx_win32_LOGFONTW_new:Byte Ptr()
  406. Function bmx_win32_LOGFONTW_free(handle:Byte Ptr)
  407. Function bmx_win32_LOGFONTW_SetlfHeight(handle:Byte Ptr, lfHeight:Int)
  408. Function bmx_win32_LOGFONTW_SetlfWidth(handle:Byte Ptr, lfWidth:Int)
  409. Function bmx_win32_LOGFONTW_SetlfWeight(handle:Byte Ptr, lfWeight:Int)
  410. Function bmx_win32_LOGFONTW_SetlfItalic(handle:Byte Ptr, lfItalic:Int)
  411. Function bmx_win32_LOGFONTW_SetlfUnderline(handle:Byte Ptr, lfUnderline:Int)
  412. Function bmx_win32_LOGFONTW_SetlfStrikeOut(handle:Byte Ptr, lfStrikeOut:Int)
  413. Function bmx_win32_LOGFONTW_lfHeight:Int(handle:Byte Ptr)
  414. Function bmx_win32_LOGFONTW_lfWidth:Int(handle:Byte Ptr)
  415. Function bmx_win32_LOGFONTW_lfEscapement:Int(handle:Byte Ptr)
  416. Function bmx_win32_LOGFONTW_lfOrientation:Int(handle:Byte Ptr)
  417. Function bmx_win32_LOGFONTW_lfWeight:Int(handle:Byte Ptr)
  418. Function bmx_win32_LOGFONTW_lfItalic:Int(handle:Byte Ptr)
  419. Function bmx_win32_LOGFONTW_lfUnderline:Int(handle:Byte Ptr)
  420. Function bmx_win32_LOGFONTW_lfStrikeOut:Int(handle:Byte Ptr)
  421. Function bmx_win32_LOGFONTW_lfCharSet:Int(handle:Byte Ptr)
  422. Function bmx_win32_LOGFONTW_lfOutPrecision:Int(handle:Byte Ptr)
  423. Function bmx_win32_LOGFONTW_lfClipPrecision:Int(handle:Byte Ptr)
  424. Function bmx_win32_LOGFONTW_lfQuality:Int(handle:Byte Ptr)
  425. Function bmx_win32_LOGFONTW_lfPitchAndFamily:Int(handle:Byte Ptr)
  426. Function bmx_win32_LOGFONTW_lfFaceName:Int(handle:Byte Ptr)
  427. Function bmx_win32_LOGFONTW_size:Int()
  428. End Extern
  429. Type LOGFONTW
  430. Field fontPtr:Byte Ptr
  431. Field _owner:Int = True
  432. Method New()
  433. fontPtr = bmx_win32_LOGFONTW_new()
  434. End Method
  435. Method Delete()
  436. Free()
  437. End Method
  438. Method Free()
  439. If fontPtr And _owner Then
  440. bmx_win32_LOGFONTW_free(fontPtr)
  441. End If
  442. fontPtr = Null
  443. End Method
  444. Function Size:Int()
  445. Return bmx_win32_LOGFONTW_size()
  446. End Function
  447. Function _create:LOGFONTW(fontPtr:Byte Ptr)
  448. Local this:LOGFONTW = New LOGFONTW
  449. this.Free()
  450. this.fontPtr = fontPtr
  451. this._owner = False
  452. Return this
  453. End Function
  454. Method SetlfHeight(lfHeight:Int)
  455. bmx_win32_LOGFONTW_SetlfHeight(fontPtr, lfHeight)
  456. End Method
  457. Method SetlfWidth(lfWidth:Int)
  458. bmx_win32_LOGFONTW_SetlfWidth(fontPtr, lfWidth)
  459. End Method
  460. Method SetlfWeight(lfWeight:Int)
  461. bmx_win32_LOGFONTW_SetlfWeight(fontPtr, lfWeight)
  462. End Method
  463. Method SetlfItalic(lfItalic:Int)
  464. bmx_win32_LOGFONTW_SetlfItalic(fontPtr, lfItalic)
  465. End Method
  466. Method SetlfUnderline(lfUnderline:Int)
  467. bmx_win32_LOGFONTW_SetlfUnderline(fontPtr, lfUnderline)
  468. End Method
  469. Method SetlfStrikeOut(lfStrikeOut:Int)
  470. bmx_win32_LOGFONTW_SetlfStrikeOut(fontPtr, lfStrikeOut)
  471. End Method
  472. Method lfHeight:Int()
  473. Return bmx_win32_LOGFONTW_lfHeight(fontPtr)
  474. End Method
  475. Method lfWidth:Int()
  476. Return bmx_win32_LOGFONTW_lfWidth(fontPtr)
  477. End Method
  478. Method lfEscapement:Int()
  479. Return bmx_win32_LOGFONTW_lfEscapement(fontPtr)
  480. End Method
  481. Method lfOrientation:Int()
  482. Return bmx_win32_LOGFONTW_lfOrientation(fontPtr)
  483. End Method
  484. Method lfWeight:Int()
  485. Return bmx_win32_LOGFONTW_lfWeight(fontPtr)
  486. End Method
  487. Method lfItalic:Int()
  488. Return bmx_win32_LOGFONTW_lfItalic(fontPtr)
  489. End Method
  490. Method lfUnderline:Int()
  491. Return bmx_win32_LOGFONTW_lfUnderline(fontPtr)
  492. End Method
  493. Method lfStrikeOut:Int()
  494. Return bmx_win32_LOGFONTW_lfStrikeOut(fontPtr)
  495. End Method
  496. Method lfCharSet:Int()
  497. Return bmx_win32_LOGFONTW_lfCharSet(fontPtr)
  498. End Method
  499. Method lfOutPrecision:Int()
  500. Return bmx_win32_LOGFONTW_lfOutPrecision(fontPtr)
  501. End Method
  502. Method lfClipPrecision:Int()
  503. Return bmx_win32_LOGFONTW_lfClipPrecision(fontPtr)
  504. End Method
  505. Method lfQuality:Int()
  506. Return bmx_win32_LOGFONTW_lfQuality(fontPtr)
  507. End Method
  508. Method lfPitchAndFamily:Int()
  509. Return bmx_win32_LOGFONTW_lfPitchAndFamily(fontPtr)
  510. End Method
  511. Method lfFaceName:Short Ptr()
  512. Return bmx_win32_LOGFONTW_lfFaceName(fontPtr)
  513. End Method
  514. Rem
  515. Field lfHeight
  516. Field lfWidth
  517. Field lfEscapement
  518. Field lfOrientation
  519. Field lfWeight
  520. Field lfItalic:Byte
  521. Field lfUnderline:Byte
  522. Field lfStrikeOut:Byte
  523. Field lfCharSet:Byte
  524. Field lfOutPrecision:Byte
  525. Field lfClipPrecision:Byte
  526. Field lfQuality:Byte
  527. Field lfPitchAndFamily:Byte
  528. Field lfFaceName00:Short
  529. Field lfFaceName01:Short
  530. Field lfFaceName02:Short
  531. Field lfFaceName03:Short
  532. Field lfFaceName04:Short
  533. Field lfFaceName05:Short
  534. Field lfFaceName06:Short
  535. Field lfFaceName07:Short
  536. Field lfFaceName08:Short
  537. Field lfFaceName09:Short
  538. Field lfFaceName0a:Short
  539. Field lfFaceName0b:Short
  540. Field lfFaceName0c:Short
  541. Field lfFaceName0d:Short
  542. Field lfFaceName0e:Short
  543. Field lfFaceName0f:Short
  544. Field lfFaceName10:Short
  545. Field lfFaceName11:Short
  546. Field lfFaceName12:Short
  547. Field lfFaceName13:Short
  548. Field lfFaceName14:Short
  549. Field lfFaceName15:Short
  550. Field lfFaceName16:Short
  551. Field lfFaceName17:Short
  552. Field lfFaceName18:Short
  553. Field lfFaceName19:Short
  554. Field lfFaceName1a:Short
  555. Field lfFaceName1b:Short
  556. Field lfFaceName1c:Short
  557. Field lfFaceName1d:Short
  558. Field lfFaceName1e:Short
  559. Field lfFaceName1f:Short
  560. End Rem
  561. End Type
  562. Extern
  563. Function bmx_win32_TEXTMETRIC_new:Byte Ptr()
  564. Function bmx_win32_TEXTMETRIC_free(handle:Byte Ptr)
  565. Function bmx_win32_TEXTMETRIC_tmAveCharWidth:Int(handle:Byte Ptr)
  566. End Extern
  567. Type TEXTMETRICW
  568. Field metricPtr:Byte Ptr
  569. Method New()
  570. metricPtr = bmx_win32_TEXTMETRIC_new()
  571. End Method
  572. Method Delete()
  573. Free()
  574. End Method
  575. Method Free()
  576. If metricPtr Then
  577. bmx_win32_TEXTMETRIC_free(metricPtr)
  578. End If
  579. metricPtr = Null
  580. End Method
  581. Method tmAveCharWidth:Int()
  582. Return bmx_win32_TEXTMETRIC_tmAveCharWidth(metricPtr)
  583. End Method
  584. Rem
  585. Field tmHeight
  586. Field tmAscent
  587. Field tmDescent
  588. Field tmInternalLeading
  589. Field tmExternalLeading
  590. Field tmAveCharWidth
  591. Field tmMaxCharWidth
  592. Field tmWeight
  593. Field tmOverhang
  594. Field tmDigitizedAspectX
  595. Field tmDigitizedAspectY
  596. Field tmFirstChar:Short
  597. Field tmLastChar:Short
  598. Field tmDefaultChar:Short
  599. Field tmBreakChar:Short
  600. Field tmItalic:Byte
  601. Field tmUnderlined:Byte
  602. Field tmStruckOut:Byte
  603. Field tmPitchAndFamily:Byte
  604. Field tmCharSet:Byte
  605. Field pad0:Byte
  606. Field pad1:Byte
  607. Field pad2:Byte
  608. End Rem
  609. End Type
  610. Extern "Win32"
  611. Function GetStockObject:Byte Ptr( fnObject )="HGDIOBJ GetStockObject(int)!"
  612. Function ChoosePixelFormat( hdc:Byte Ptr,ppfd:Byte Ptr )="int ChoosePixelFormat(HDC,CONST PIXELFORMATDESCRIPTOR*)!"
  613. Function SetPixelFormat( hdc:Byte Ptr,iPixelFormat,ppfd:Byte Ptr )="BOOL SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR*)!"
  614. Function SwapBuffers( hdc:Byte Ptr )="BOOL SwapBuffers(HDC)!"
  615. Function wglCreateContext:Byte Ptr( hdc:Byte Ptr )="HGLRC wglCreateContext(HDC)!"
  616. Function wglDeleteContext( hglrc )="BOOL wglDeleteContext(HGLRC)!"
  617. Function wglMakeCurrent( hdc:Byte Ptr,hglrc )="BOOL wglMakeCurrent(HDC,HGLRC)!"
  618. Function BitBlt(hdc:Byte Ptr,x,y,w,h,src_dc:Byte Ptr,src_x,src_y,dwrop)="BOOL BitBlt(HDC,int,int,int,int,HDC,int,int,DWORD)!"
  619. Function GetDeviceCaps(hdc:Byte Ptr,indec)="int GetDeviceCaps(HDC,int)!"
  620. Function CreateFontA:Byte Ptr(cHeight,cWidth,cEscapement,cOrientation,cWeight,bItalic,bUnderline,bStrikeOut,iCharSet,iOutPrecision,iClipPrecision,iQuality,iPitchAndFamily,pszFaceName:Byte Ptr)="HFONT CreateFontA(int,int,int,int,int,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,LPCSTR)!"
  621. Function CreateFontW:Byte Ptr(cHeight,cWidth,cEscapement,cOrientation,cWeight,bItalic,bUnderline,bStrikeOut,iCharSet,iOutPrecision,iClipPrecision,iQuality,iPitchAndFamily,pszFaceName:Short Ptr)="HFONT CreateFontW(int,int,int,int,int,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,LPCWSTR)!"
  622. Function SelectObject:Byte Ptr(hdc:Byte Ptr,obj:Byte Ptr)="HGDIOBJ SelectObject(HDC,HGDIOBJ)!"
  623. Function DeleteObject( hObject:Byte Ptr )="BOOL DeleteObject(HGDIOBJ)!"
  624. Function CreateSolidBrush:Byte Ptr( crColor )="HBRUSH CreateSolidBrush(COLORREF)!"
  625. Function CreateCompatibleDC:Byte Ptr( hdc:Byte Ptr )="HDC CreateCompatibleDC(HDC)!"
  626. Function CreateCompatibleBitmap:Byte Ptr( hdc:Byte Ptr,nWidth,nHeight )="HBITMAP CreateCompatibleBitmap(HDC,int,int)!"
  627. Function SetDIBits( hdc:Byte Ptr,hbmp:Byte Ptr,uStartScan:UInt,cScanLines:UInt,lpvBits:Byte Ptr,lpbmi:Byte Ptr,fuColorUse:UInt )="int SetDIBits(HDC,HBITMAP,UINT,UINT,VOID *,const BITMAPINFO*,UINT)!"
  628. Function DeleteDC( hdc:Byte Ptr )="BOOL DeleteDC(HDC)!"
  629. Function SetStretchBltMode( hdc:Byte Ptr,iStretchMode )="int SetStretchBltMode(HDC,int)!"
  630. Function StretchBlt( hdcDest:Byte Ptr,dx,dy,dw,dh,hdcSrc:Byte Ptr,sx,sy,sw,sh,dwRop )="BOOL StretchBlt(HDC,int,int,int,int,HDC,int,int,int,int,DWORD)!"
  631. Function CreateFontIndirectW:Byte Ptr( lplf:Byte Ptr )="HFONT CreateFontIndirectW(const LOGFONTW*)!"
  632. Function GetTextMetricsW( hdc:Byte Ptr,lptm:Byte Ptr )="int GetTextMetricsW(HDC,LPTEXTMETRICW)!"
  633. Function GetTextFaceW( hdc:Byte Ptr,nCount,lpFaceName:Short Ptr )="int GetTextFaceW(HDC,int,LPWSTR)!"
  634. End Extern