/android/generated/glue/android.graphics.Paint.cpp

https://bitbucket.org/festevezga/xobotos · C++ · 712 lines · 620 code · 92 blank · 0 comment · 14 complexity · 1bbb0c8b4167b5fe89ac1f6df2a6d94e MD5 · raw file

  1. #include "android.graphics.Paint.h"
  2. extern "C" DLL_EXPORT void
  3. libxobotos_android_graphics_Paint_destructor(PaintGlue* ptr)
  4. {
  5. delete ptr;
  6. }
  7. struct FontMetrics_Struct
  8. {
  9. uint32_t _owner;
  10. float fTop;
  11. float fAscent;
  12. float fDescent;
  13. float fBottom;
  14. float fLeading;
  15. };
  16. void
  17. FontMetrics_Helper::unwrap(SkPaint::FontMetrics& from, FontMetrics_Struct* to)
  18. {
  19. to->_owner = 0x7380548b;
  20. to->fTop = from.fTop;
  21. to->fAscent = from.fAscent;
  22. to->fDescent = from.fDescent;
  23. to->fBottom = from.fBottom;
  24. to->fLeading = from.fLeading;
  25. }
  26. FontMetrics_Struct*
  27. FontMetrics_Helper::unwrap(SkPaint::FontMetrics* src)
  28. {
  29. if (src == NULL)
  30. {
  31. return NULL;
  32. }
  33. FontMetrics_Struct* retval = new FontMetrics_Struct();
  34. FontMetrics_Helper::unwrap(*src, retval);
  35. return retval;
  36. }
  37. void
  38. FontMetrics_Helper::marshalOut(const SkPaint::FontMetrics& from, FontMetrics_Struct*
  39. to)
  40. {
  41. to->fTop = from.fTop;
  42. to->fAscent = from.fAscent;
  43. to->fDescent = from.fDescent;
  44. to->fBottom = from.fBottom;
  45. to->fLeading = from.fLeading;
  46. }
  47. void
  48. FontMetrics_Helper::wrap(const FontMetrics_Struct& from, SkPaint::FontMetrics* to)
  49. {
  50. to->fTop = from.fTop;
  51. to->fAscent = from.fAscent;
  52. to->fDescent = from.fDescent;
  53. to->fBottom = from.fBottom;
  54. to->fLeading = from.fLeading;
  55. }
  56. SkPaint::FontMetrics*
  57. FontMetrics_Helper::wrap(const FontMetrics_Struct* src)
  58. {
  59. if (src == NULL)
  60. {
  61. return NULL;
  62. }
  63. SkPaint::FontMetrics* retval = new SkPaint::FontMetrics();
  64. FontMetrics_Helper::wrap(*src, retval);
  65. return retval;
  66. }
  67. const SkPaint::FontMetrics*
  68. FontMetrics_Helper::wrapConst(const FontMetrics_Struct* src)
  69. {
  70. return const_cast<const SkPaint::FontMetrics*>(FontMetrics_Helper::wrap(src));
  71. }
  72. void
  73. FontMetrics_Helper::freeMembers(FontMetrics_Struct& obj)
  74. {
  75. assert(obj._owner == 0x7380548b);
  76. }
  77. void
  78. FontMetrics_Helper::destructor(FontMetrics_Struct* obj)
  79. {
  80. if (obj == NULL)
  81. {
  82. return;
  83. }
  84. FontMetrics_Helper::freeMembers(*obj);
  85. delete obj;
  86. }
  87. extern "C" DLL_EXPORT void
  88. libxobotos_android_graphics_Paint_FontMetrics_destructor(FontMetrics_Struct* obj)
  89. {
  90. FontMetrics_Helper::destructor(obj);
  91. }
  92. struct FontMetricsInt_Struct
  93. {
  94. uint32_t _owner;
  95. int top;
  96. int ascent;
  97. int descent;
  98. int bottom;
  99. int leading;
  100. };
  101. void
  102. FontMetricsInt_Helper::unwrap(PaintGlue::FontMetricsInt& from, FontMetricsInt_Struct*
  103. to)
  104. {
  105. to->_owner = 0x7380548b;
  106. to->top = from.top;
  107. to->ascent = from.ascent;
  108. to->descent = from.descent;
  109. to->bottom = from.bottom;
  110. to->leading = from.leading;
  111. }
  112. FontMetricsInt_Struct*
  113. FontMetricsInt_Helper::unwrap(PaintGlue::FontMetricsInt* src)
  114. {
  115. if (src == NULL)
  116. {
  117. return NULL;
  118. }
  119. FontMetricsInt_Struct* retval = new FontMetricsInt_Struct();
  120. FontMetricsInt_Helper::unwrap(*src, retval);
  121. return retval;
  122. }
  123. void
  124. FontMetricsInt_Helper::marshalOut(const PaintGlue::FontMetricsInt& from, FontMetricsInt_Struct*
  125. to)
  126. {
  127. to->top = from.top;
  128. to->ascent = from.ascent;
  129. to->descent = from.descent;
  130. to->bottom = from.bottom;
  131. to->leading = from.leading;
  132. }
  133. void
  134. FontMetricsInt_Helper::wrap(const FontMetricsInt_Struct& from, PaintGlue::FontMetricsInt*
  135. to)
  136. {
  137. to->top = from.top;
  138. to->ascent = from.ascent;
  139. to->descent = from.descent;
  140. to->bottom = from.bottom;
  141. to->leading = from.leading;
  142. }
  143. PaintGlue::FontMetricsInt*
  144. FontMetricsInt_Helper::wrap(const FontMetricsInt_Struct* src)
  145. {
  146. if (src == NULL)
  147. {
  148. return NULL;
  149. }
  150. PaintGlue::FontMetricsInt* retval = new PaintGlue::FontMetricsInt();
  151. FontMetricsInt_Helper::wrap(*src, retval);
  152. return retval;
  153. }
  154. const PaintGlue::FontMetricsInt*
  155. FontMetricsInt_Helper::wrapConst(const FontMetricsInt_Struct* src)
  156. {
  157. return const_cast<const PaintGlue::FontMetricsInt*>(FontMetricsInt_Helper::wrap(src));
  158. }
  159. void
  160. FontMetricsInt_Helper::freeMembers(FontMetricsInt_Struct& obj)
  161. {
  162. assert(obj._owner == 0x7380548b);
  163. }
  164. void
  165. FontMetricsInt_Helper::destructor(FontMetricsInt_Struct* obj)
  166. {
  167. if (obj == NULL)
  168. {
  169. return;
  170. }
  171. FontMetricsInt_Helper::freeMembers(*obj);
  172. delete obj;
  173. }
  174. extern "C" DLL_EXPORT void
  175. libxobotos_android_graphics_Paint_FontMetricsInt_destructor(FontMetricsInt_Struct*
  176. obj)
  177. {
  178. FontMetricsInt_Helper::destructor(obj);
  179. }
  180. extern "C" DLL_EXPORT int
  181. libxobotos_Paint_getTextRunCursorC(PaintGlue* native_object, Array_char_Struct* text_ptr,
  182. int contextStart, int contextLength, int flags, int offset, int cursorOpt)
  183. {
  184. const NativeArray<char16_t>* text = Array_char_Helper::wrapConst(text_ptr);
  185. int _retval = native_object->getTextRunCursorC(*text, contextStart, contextLength,
  186. flags, offset, cursorOpt);
  187. delete text;
  188. return _retval;
  189. }
  190. extern "C" DLL_EXPORT void
  191. libxobotos_Paint_getTextPathS(PaintGlue* native_object, int bidiFlags, String_Struct*
  192. text_ptr, int start, int end, float x, float y, PathGlue* path)
  193. {
  194. const NativeString* text = String_Helper::wrapConst(text_ptr);
  195. native_object->getTextPathS(bidiFlags, *text, start, end, x, y, path);
  196. delete text;
  197. }
  198. extern "C" DLL_EXPORT void
  199. libxobotos_Paint_setXfermode(PaintGlue* native_object, SkXfermode* xfermode)
  200. {
  201. native_object->setXfermode(xfermode);
  202. }
  203. extern "C" DLL_EXPORT int
  204. libxobotos_Paint_getColor(PaintGlue* _instance)
  205. {
  206. int _retval = _instance->getColor();
  207. return _retval;
  208. }
  209. extern "C" DLL_EXPORT void
  210. libxobotos_Paint_setRasterizer(PaintGlue* native_object, SkRasterizer* rasterizer)
  211. {
  212. native_object->setRasterizer(rasterizer);
  213. }
  214. extern "C" DLL_EXPORT void
  215. libxobotos_Paint_setMaskFilter(PaintGlue* native_object, SkMaskFilter* maskfilter)
  216. {
  217. native_object->setMaskFilter(maskfilter);
  218. }
  219. extern "C" DLL_EXPORT float
  220. libxobotos_Paint_getFontMetrics(PaintGlue* _instance, FontMetrics_Struct** metrics_ptr)
  221. {
  222. SkPaint::FontMetrics metrics;
  223. float _retval = _instance->getFontMetrics(&metrics);
  224. *metrics_ptr = FontMetrics_Helper::unwrap(&metrics);
  225. return _retval;
  226. }
  227. extern "C" DLL_EXPORT void
  228. libxobotos_Paint_getTextPathC(PaintGlue* native_object, int bidiFlags, Array_char_Struct*
  229. text_ptr, int index, int count, float x, float y, PathGlue* path)
  230. {
  231. const NativeArray<char16_t>* text = Array_char_Helper::wrapConst(text_ptr);
  232. native_object->getTextPathC(bidiFlags, *text, index, count, x, y, path);
  233. delete text;
  234. }
  235. extern "C" DLL_EXPORT void
  236. libxobotos_Paint_setStrokeCap(PaintGlue* native_object, int cap)
  237. {
  238. native_object->setStrokeCap((SkPaint::Cap)cap);
  239. }
  240. extern "C" DLL_EXPORT void
  241. libxobotos_Paint_setShadowLayer(PaintGlue* _instance, float radius, float dx, float
  242. dy, int color)
  243. {
  244. _instance->setShadowLayer(radius, dx, dy, color);
  245. }
  246. extern "C" DLL_EXPORT float
  247. libxobotos_Paint_getTextSkewX(PaintGlue* _instance)
  248. {
  249. float _retval = _instance->getTextSkewX();
  250. return _retval;
  251. }
  252. extern "C" DLL_EXPORT void
  253. libxobotos_Paint_setFlags(PaintGlue* _instance, int flags)
  254. {
  255. _instance->setFlags(flags);
  256. }
  257. extern "C" DLL_EXPORT void
  258. libxobotos_Paint_setSubpixelText(PaintGlue* _instance, bool subpixelText)
  259. {
  260. _instance->setSubpixelText(subpixelText);
  261. }
  262. extern "C" DLL_EXPORT int
  263. libxobotos_Paint_getFlags(PaintGlue* _instance)
  264. {
  265. int _retval = _instance->getFlags();
  266. return _retval;
  267. }
  268. extern "C" DLL_EXPORT void
  269. libxobotos_Paint_setHinting(PaintGlue* _instance, int mode)
  270. {
  271. _instance->setHinting((SkPaint::Hinting)mode);
  272. }
  273. extern "C" DLL_EXPORT PaintGlue*
  274. libxobotos_Paint_init()
  275. {
  276. PaintGlue* _retval = new PaintGlue();
  277. return _retval;
  278. }
  279. extern "C" DLL_EXPORT void
  280. libxobotos_Paint_setAlpha(PaintGlue* _instance, int a)
  281. {
  282. _instance->setAlpha(a);
  283. }
  284. extern "C" DLL_EXPORT void
  285. libxobotos_Paint_getStringBounds(PaintGlue* nativePaint, String_Struct* text_ptr,
  286. int start, int end, Rect_Struct** bounds_ptr)
  287. {
  288. const NativeString* text = String_Helper::wrapConst(text_ptr);
  289. SkIRect bounds;
  290. nativePaint->getStringBounds(*text, start, end, &bounds);
  291. delete text;
  292. *bounds_ptr = Rect_Helper::unwrap(&bounds);
  293. }
  294. extern "C" DLL_EXPORT float
  295. libxobotos_Paint_measureTextC(PaintGlue* _instance, Array_char_Struct* text_ptr,
  296. int index, int count)
  297. {
  298. const NativeArray<char16_t>* text = Array_char_Helper::wrapConst(text_ptr);
  299. float _retval = _instance->measureTextC(*text, index, count);
  300. delete text;
  301. return _retval;
  302. }
  303. extern "C" DLL_EXPORT void
  304. libxobotos_Paint_setStrikeThruText(PaintGlue* _instance, bool strikeThruText)
  305. {
  306. _instance->setStrikeThruText(strikeThruText);
  307. }
  308. extern "C" DLL_EXPORT float
  309. libxobotos_Paint_ascent(PaintGlue* _instance)
  310. {
  311. float _retval = _instance->ascent();
  312. return _retval;
  313. }
  314. extern "C" DLL_EXPORT float
  315. libxobotos_Paint_getStrokeWidth(PaintGlue* _instance)
  316. {
  317. float _retval = _instance->getStrokeWidth();
  318. return _retval;
  319. }
  320. extern "C" DLL_EXPORT int
  321. libxobotos_Paint_breakTextC(PaintGlue* _instance, Array_char_Struct* text_ptr, int
  322. index, int count, float maxWidth, Array_float_Struct* measuredWidth_ptr)
  323. {
  324. const NativeArray<char16_t>* text = Array_char_Helper::wrapConst(text_ptr);
  325. NativeArray<float>* measuredWidth = Array_float_Helper::wrap(measuredWidth_ptr);
  326. int _retval = _instance->breakTextC(*text, index, count, maxWidth, measuredWidth);
  327. delete text;
  328. delete measuredWidth;
  329. return _retval;
  330. }
  331. extern "C" DLL_EXPORT void
  332. libxobotos_Paint_setStyle(PaintGlue* native_object, int style)
  333. {
  334. native_object->setStyle((SkPaint::Style)style);
  335. }
  336. extern "C" DLL_EXPORT float
  337. libxobotos_Paint_getTextScaleX(PaintGlue* _instance)
  338. {
  339. float _retval = _instance->getTextScaleX();
  340. return _retval;
  341. }
  342. extern "C" DLL_EXPORT int
  343. libxobotos_Paint_getTextRunCursorS(PaintGlue* native_object, String_Struct* text_ptr,
  344. int contextStart, int contextEnd, int flags, int offset, int cursorOpt)
  345. {
  346. const NativeString* text = String_Helper::wrapConst(text_ptr);
  347. int _retval = native_object->getTextRunCursorS(*text, contextStart, contextEnd, flags,
  348. offset, cursorOpt);
  349. delete text;
  350. return _retval;
  351. }
  352. extern "C" DLL_EXPORT float
  353. libxobotos_Paint_measureTextS(PaintGlue* _instance, String_Struct* text_ptr, int
  354. start, int end)
  355. {
  356. const NativeString* text = String_Helper::wrapConst(text_ptr);
  357. float _retval = _instance->measureTextS(*text, start, end);
  358. delete text;
  359. return _retval;
  360. }
  361. extern "C" DLL_EXPORT void
  362. libxobotos_Paint_setAntiAlias(PaintGlue* _instance, bool aa)
  363. {
  364. _instance->setAntiAlias(aa);
  365. }
  366. extern "C" DLL_EXPORT int
  367. libxobotos_Paint_getHinting(PaintGlue* _instance)
  368. {
  369. int _retval = _instance->getHinting();
  370. return _retval;
  371. }
  372. extern "C" DLL_EXPORT int
  373. libxobotos_Paint_breakTextS(PaintGlue* _instance, String_Struct* text_ptr, bool measureForwards,
  374. float maxWidth, Array_float_Struct* measuredWidth_ptr)
  375. {
  376. const NativeString* text = String_Helper::wrapConst(text_ptr);
  377. NativeArray<float>* measuredWidth = Array_float_Helper::wrap(measuredWidth_ptr);
  378. int _retval = _instance->breakTextS(*text, measureForwards, maxWidth, measuredWidth);
  379. delete text;
  380. delete measuredWidth;
  381. return _retval;
  382. }
  383. extern "C" DLL_EXPORT void
  384. libxobotos_Paint_setTextAlign(PaintGlue* native_object, int align)
  385. {
  386. native_object->setTextAlign((SkPaint::Align)align);
  387. }
  388. extern "C" DLL_EXPORT void
  389. libxobotos_Paint_setPathEffect(PaintGlue* native_object, SkPathEffect* effect)
  390. {
  391. native_object->setPathEffect(effect);
  392. }
  393. extern "C" DLL_EXPORT int
  394. libxobotos_Paint_getFontMetricsInt(PaintGlue* _instance, FontMetricsInt_Struct**
  395. fmi_ptr)
  396. {
  397. PaintGlue::FontMetricsInt fmi;
  398. int _retval = _instance->getFontMetricsInt(&fmi);
  399. *fmi_ptr = FontMetricsInt_Helper::unwrap(&fmi);
  400. return _retval;
  401. }
  402. extern "C" DLL_EXPORT PaintGlue*
  403. libxobotos_Paint_initWithPaint(PaintGlue* paint)
  404. {
  405. PaintGlue* _retval = new PaintGlue(*paint);
  406. return _retval;
  407. }
  408. extern "C" DLL_EXPORT void
  409. libxobotos_Paint_setStrokeJoin(PaintGlue* native_object, int join)
  410. {
  411. native_object->setStrokeJoin((SkPaint::Join)join);
  412. }
  413. extern "C" DLL_EXPORT float
  414. libxobotos_Paint_getTextRunAdvancesS(PaintGlue* native_object, String_Struct* text_ptr,
  415. int start, int end, int contextStart, int contextEnd, int flags, Array_float_Struct*
  416. advances_ptr, int advancesIndex, int reserved)
  417. {
  418. const NativeString* text = String_Helper::wrapConst(text_ptr);
  419. NativeArray<float>* advances = Array_float_Helper::wrap(advances_ptr);
  420. float _retval = native_object->getTextRunAdvancesS(*text, start, end, contextStart,
  421. contextEnd, flags, advances, advancesIndex, reserved);
  422. delete text;
  423. delete advances;
  424. return _retval;
  425. }
  426. extern "C" DLL_EXPORT void
  427. libxobotos_Paint_setFilterBitmap(PaintGlue* _instance, bool filter)
  428. {
  429. _instance->setFilterBitmap(filter);
  430. }
  431. extern "C" DLL_EXPORT int
  432. libxobotos_Paint_getTextWidthsS(PaintGlue* native_object, String_Struct* text_ptr,
  433. int start, int end, Array_float_Struct* widths_ptr)
  434. {
  435. const NativeString* text = String_Helper::wrapConst(text_ptr);
  436. NativeArray<float>* widths = Array_float_Helper::wrap(widths_ptr);
  437. int _retval = native_object->getTextWidthsS(*text, start, end, *widths);
  438. delete text;
  439. delete widths;
  440. return _retval;
  441. }
  442. extern "C" DLL_EXPORT void
  443. libxobotos_Paint_setFakeBoldText(PaintGlue* _instance, bool fakeBoldText)
  444. {
  445. _instance->setFakeBoldText(fakeBoldText);
  446. }
  447. extern "C" DLL_EXPORT void
  448. libxobotos_Paint_setLinearText(PaintGlue* _instance, bool linearText)
  449. {
  450. _instance->setLinearText(linearText);
  451. }
  452. extern "C" DLL_EXPORT void
  453. libxobotos_Paint_setTextSize(PaintGlue* _instance, float textSize)
  454. {
  455. _instance->setTextSize(textSize);
  456. }
  457. extern "C" DLL_EXPORT void
  458. libxobotos_Paint_setTextSkewX(PaintGlue* _instance, float skewX)
  459. {
  460. _instance->setTextSkewX(skewX);
  461. }
  462. extern "C" DLL_EXPORT float
  463. libxobotos_Paint_getTextSize(PaintGlue* _instance)
  464. {
  465. float _retval = _instance->getTextSize();
  466. return _retval;
  467. }
  468. extern "C" DLL_EXPORT float
  469. libxobotos_Paint_descent(PaintGlue* _instance)
  470. {
  471. float _retval = _instance->descent();
  472. return _retval;
  473. }
  474. extern "C" DLL_EXPORT int
  475. libxobotos_Paint_getStrokeJoin(PaintGlue* native_object)
  476. {
  477. int _retval = native_object->getStrokeJoin();
  478. return _retval;
  479. }
  480. extern "C" DLL_EXPORT void
  481. libxobotos_Paint_setShader(PaintGlue* native_object, SkShader* shader)
  482. {
  483. native_object->setShader(shader);
  484. }
  485. extern "C" DLL_EXPORT void
  486. libxobotos_Paint_setColorFilter(PaintGlue* native_object, SkColorFilter* filter)
  487. {
  488. native_object->setColorFilter(filter);
  489. }
  490. extern "C" DLL_EXPORT void
  491. libxobotos_Paint_setDither(PaintGlue* _instance, bool dither)
  492. {
  493. _instance->setDither(dither);
  494. }
  495. extern "C" DLL_EXPORT int
  496. libxobotos_Paint_getTextWidthsC(PaintGlue* native_object, Array_char_Struct* text_ptr,
  497. int index, int count, Array_float_Struct* widths_ptr)
  498. {
  499. const NativeArray<char16_t>* text = Array_char_Helper::wrapConst(text_ptr);
  500. NativeArray<float>* widths = Array_float_Helper::wrap(widths_ptr);
  501. int _retval = native_object->getTextWidthsC(*text, index, count, *widths);
  502. delete text;
  503. delete widths;
  504. return _retval;
  505. }
  506. extern "C" DLL_EXPORT void
  507. libxobotos_Paint_setStrokeMiter(PaintGlue* _instance, float miter)
  508. {
  509. _instance->setStrokeMiter(miter);
  510. }
  511. extern "C" DLL_EXPORT void
  512. libxobotos_Paint_getCharArrayBounds(PaintGlue* nativePaint, Array_char_Struct* text_ptr,
  513. int index, int count, Rect_Struct** bounds_ptr)
  514. {
  515. const NativeArray<char16_t>* text = Array_char_Helper::wrapConst(text_ptr);
  516. SkIRect bounds;
  517. nativePaint->getCharArrayBounds(*text, index, count, &bounds);
  518. delete text;
  519. *bounds_ptr = Rect_Helper::unwrap(&bounds);
  520. }
  521. extern "C" DLL_EXPORT void
  522. libxobotos_Paint_setColor(PaintGlue* _instance, int color)
  523. {
  524. _instance->setColor(color);
  525. }
  526. extern "C" DLL_EXPORT void
  527. libxobotos_Paint_setTypeface(PaintGlue* native_object, SkTypeface* typeface)
  528. {
  529. native_object->setTypeface(typeface);
  530. }
  531. extern "C" DLL_EXPORT void
  532. libxobotos_Paint_setUnderlineText(PaintGlue* _instance, bool underlineText)
  533. {
  534. _instance->setUnderlineText(underlineText);
  535. }
  536. extern "C" DLL_EXPORT float
  537. libxobotos_Paint_getFontMetrics_0(PaintGlue* native_paint, FontMetrics_Struct** metrics_ptr)
  538. {
  539. SkPaint::FontMetrics metrics;
  540. float _retval = native_paint->getFontMetrics(&metrics);
  541. *metrics_ptr = FontMetrics_Helper::unwrap(&metrics);
  542. return _retval;
  543. }
  544. extern "C" DLL_EXPORT void
  545. libxobotos_Paint_set(PaintGlue* native_dst, PaintGlue* native_src)
  546. {
  547. native_dst->set(*native_src);
  548. }
  549. extern "C" DLL_EXPORT bool
  550. libxobotos_Paint_getFillPath(PaintGlue* native_object, PathGlue* src, PathGlue* dst)
  551. {
  552. bool _retval = native_object->getFillPath(*src, dst);
  553. return _retval;
  554. }
  555. extern "C" DLL_EXPORT void
  556. libxobotos_Paint_reset(PaintGlue* native_object)
  557. {
  558. native_object->reset();
  559. }
  560. extern "C" DLL_EXPORT int
  561. libxobotos_Paint_getStrokeCap(PaintGlue* native_object)
  562. {
  563. int _retval = native_object->getStrokeCap();
  564. return _retval;
  565. }
  566. extern "C" DLL_EXPORT void
  567. libxobotos_Paint_setTextScaleX(PaintGlue* _instance, float scaleX)
  568. {
  569. _instance->setTextScaleX(scaleX);
  570. }
  571. extern "C" DLL_EXPORT int
  572. libxobotos_Paint_getAlpha(PaintGlue* _instance)
  573. {
  574. int _retval = _instance->getAlpha();
  575. return _retval;
  576. }
  577. extern "C" DLL_EXPORT float
  578. libxobotos_Paint_getStrokeMiter(PaintGlue* _instance)
  579. {
  580. float _retval = _instance->getStrokeMiter();
  581. return _retval;
  582. }
  583. extern "C" DLL_EXPORT int
  584. libxobotos_Paint_getTextAlign(PaintGlue* native_object)
  585. {
  586. int _retval = native_object->getTextAlign();
  587. return _retval;
  588. }
  589. extern "C" DLL_EXPORT float
  590. libxobotos_Paint_measureTextS2(PaintGlue* _instance, String_Struct* text_ptr)
  591. {
  592. const NativeString* text = String_Helper::wrapConst(text_ptr);
  593. float _retval = _instance->measureTextS2(*text);
  594. delete text;
  595. return _retval;
  596. }
  597. extern "C" DLL_EXPORT float
  598. libxobotos_Paint_getTextRunAdvancesC(PaintGlue* native_object, Array_char_Struct*
  599. text_ptr, int index, int count, int contextIndex, int contextCount, int flags,
  600. Array_float_Struct* advances_ptr, int advancesIndex, int reserved)
  601. {
  602. const NativeArray<char16_t>* text = Array_char_Helper::wrapConst(text_ptr);
  603. NativeArray<float>* advances = Array_float_Helper::wrap(advances_ptr);
  604. float _retval = native_object->getTextRunAdvancesC(*text, index, count, contextIndex,
  605. contextCount, flags, advances, advancesIndex, reserved);
  606. delete text;
  607. delete advances;
  608. return _retval;
  609. }
  610. extern "C" DLL_EXPORT void
  611. libxobotos_Paint_setStrokeWidth(PaintGlue* _instance, float width)
  612. {
  613. _instance->setStrokeWidth(width);
  614. }
  615. extern "C" DLL_EXPORT int
  616. libxobotos_Paint_getStyle(PaintGlue* native_object)
  617. {
  618. int _retval = native_object->getStyle();
  619. return _retval;
  620. }