cd_filled_areas.e 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865
  1. deferred class CD_FILLED_AREAS
  2. -- It is an area filled with the foreground color, but it depends on the
  3. -- current interior style. The "solid" style depends only on the foreground
  4. -- color. The "hatch" and "stipple" style depend on the foreground color,
  5. -- background color and on the back opacity attribute. The hatch lines drawn
  6. -- with this style do not depend on the other line attributes. The "pattern"
  7. -- style depends only on global canvas attributes.
  8. --
  9. -- The filled area includes the line at the edge of the area. So if you draw a
  10. -- filled rectangle, sector or polygon on top of a non filled one using the
  11. -- same coordinates, no style and 1 pixel width, the non filled primitive
  12. -- should be obscured by the filled primitive. But depending on the driver
  13. -- implementation some pixels at the edges may be not included. IMPORTANT: In
  14. -- the Postscript and PDF drivers the line at the edge is not included at all.
  15. -- If either the background or the foreground color are modified, the hatched
  16. -- and monochromatic fillings must be modified again in order to be updated.
  17. --
  18. -- Note that when a Filling Attribute is modified, the active filling style is
  19. -- now that of the modified attribute (hatch, stipple or pattern). Notice that
  20. -- this is not true for the clipping area. When the clipping area is modified,
  21. -- the clipping is only affected if it is active.
  22. inherit
  23. CANVAS_DRAW
  24. feature {ANY}
  25. draws_box (xmin, xmax, ymin, ymax: INTEGER)
  26. -- Fills a rectangle according to the current interior style. All points
  27. -- in the interval x_min <= x <= x_max, y_min <= y <= y_max will be
  28. -- painted. When the interior style "hollow" is defined, the function
  29. -- behaves like its equivalent "draws_rect".
  30. do
  31. int_canvas_box (cnvs, xmin, xmax, ymin, ymax)
  32. end
  33. draws_box_real (xmin, xmax, ymin, ymax: REAL_64)
  34. -- As "draws_box" but with REAL_64 coordinates.
  35. do
  36. int_canvas_c_double_box (cnvs, xmin, xmax, ymin, ymax)
  37. end
  38. wd_draws_box (xmin, xmax, ymin, ymax: REAL_64)
  39. -- As "draws_box" but with World coordinates.
  40. do
  41. int_wd_canvas_box (cnvs, xmin, xmax, ymin, ymax)
  42. end
  43. draws_sector (xc, yc, w, h: INTEGER; angle1, angle2: REAL_64)
  44. -- Fills the arc of an ellipse aligned with the axis, according to the
  45. -- current interior style, in the shape of a pie.
  46. --
  47. -- The coordinate (xc,yc) defines the center of the ellipse. Dimensions w
  48. -- and h define the elliptic axes X and Y, respectively.
  49. --
  50. -- Angles angle1 and angle2 are in degrees and oriented
  51. -- counter-clockwise. They define the arc start and end, but they are not
  52. -- the angle relative to the center, except when w==h and the ellipse is
  53. -- reduced to a circle. The arc starts at the point
  54. -- (xc+(w/2)*cos(angle1), yc+(h/2)*sin(angle1)) and ends at
  55. -- (xc+(w/2)*cos(angle2), yc+(h/2)*sin(angle2)). A complete ellipse can
  56. -- be drawn using 0 and 360 as the angles. If angle2 is less than angle1
  57. -- it will be increased by 360 until it is greater than angle1.
  58. --
  59. -- The angles are specified so if the size of the ellipse (w x h) is
  60. -- changed, its shape is preserved. So the angles relative to the center
  61. -- are dependent from the ellipse size. The actual angle can be obtained
  62. -- using rangle = atan2((h/2)*sin(angle), (w/2)*cos(angle)).
  63. --
  64. -- When the interior style "hollow" is defined, the function behaves
  65. -- like its equivalent "draws_arc", plus two lines connecting to the
  66. -- center.
  67. do
  68. int_canvas_sector (cnvs, xc, yc, w, h, angle1, angle2)
  69. end
  70. draws_sector_real (xc, yc, w, h, angle1, angle2: REAL_64)
  71. -- As "draws_sector" but with REAL_64 coordinates.
  72. do
  73. int_canvas_c_double_sector (cnvs, xc, yc, w, h, angle1, angle2)
  74. end
  75. wd_draws_sector (xc, yc, w, h, angle1, angle2: REAL_64)
  76. -- As "draws_sector" but with World coordinates.
  77. do
  78. int_wd_canvas_sector (cnvs, xc, yc, w, h, angle1, angle2)
  79. end
  80. draws_chord (xc, yc, w, h: INTEGER; angle1, angle2: REAL_64)
  81. -- Fills the arc of an ellipse aligned with the axis, according to the
  82. -- current interior style, the start and end points of the arc are
  83. -- connected. The parameters are the same as the "draws_sector".
  84. --
  85. -- When the interior style "hollow" is defined, the function behaves
  86. -- like its equivalent "draws_arc", plus a line connecting the arc start
  87. -- and end points.
  88. do
  89. int_canvas_chord (cnvs, xc, yc, w, h, angle1, angle2)
  90. end
  91. draws_chord_real (xc, yc, w, h, angle1, angle2: REAL_64)
  92. -- As "draws_chord" but with REAL_64 coordinates.
  93. do
  94. int_canvas_c_double_chord (cnvs, xc, yc, w, h, angle1, angle2)
  95. end
  96. wd_draws_chord (xc, yc, w, h, angle1, angle2: REAL_64)
  97. -- As "draws_chord" but with World coordinates.
  98. do
  99. int_wd_canvas_chord (cnvs, xc, yc, w, h, angle1, angle2)
  100. end
  101. -- Attributes
  102. set_back_opacity (opacity: STRING)
  103. -- Configures the background opacity to filling primitives based on the
  104. -- foreground and background colors. Note that only when interior style
  105. -- is "hatch" or "stipple" that back opacity is used. Values:
  106. -- CD_TRANSPARENT or CD_OPAQUE. If it is opaque the primitive will erase
  107. -- whatever is in the background with the background color. If it is
  108. -- transparent, only the foreground color is painted.
  109. -- Default value: CD_TRANSPARENT.
  110. -- In some drivers is always opaque.
  111. require
  112. is_valid_back_opacity (opacity)
  113. local
  114. i: INTEGER
  115. do
  116. if opacity.is_equal("CD_OPAQUE") then
  117. i := int_canvas_back_opacity (cnvs, 0)
  118. elseif opacity.is_equal("CD_TRANSPARENT") then
  119. i := int_canvas_back_opacity (cnvs, 1)
  120. end
  121. end
  122. get_back_opacity: STRING
  123. local
  124. i: INTEGER
  125. do
  126. i := int_canvas_back_opacity (cnvs, -1)
  127. if i.is_equal(0) then
  128. Result := "CD_OPAQUE"
  129. elseif i.is_equal(1) then
  130. Result := "CD_TRANSPARENT"
  131. end
  132. end
  133. set_back_opacity_opaque
  134. local
  135. i: INTEGER
  136. do
  137. i := int_canvas_back_opacity (cnvs, 0)
  138. end
  139. set_back_opacity_transparent
  140. local
  141. i: INTEGER
  142. do
  143. i := int_canvas_back_opacity (cnvs, 1)
  144. end
  145. set_fill_mode (mode: STRING)
  146. -- Selects a predefined polygon fill rule (CD_EVENODD or CD_WINDING).
  147. -- Default value: CD_EVENODD.
  148. require
  149. is_valid_fill_mode (mode)
  150. local
  151. i: INTEGER
  152. do
  153. if mode.is_equal("CD_EVENODD") then
  154. i := int_canvas_back_opacity (cnvs, 0)
  155. elseif mode.is_equal("CD_WINDING") then
  156. i := int_canvas_back_opacity (cnvs, 1)
  157. end
  158. end
  159. get_fill_mode: STRING
  160. local
  161. i: INTEGER
  162. do
  163. i := int_canvas_fill_mode (cnvs, -1)
  164. if i.is_equal(0) then
  165. Result := "CD_EVENODD"
  166. elseif i.is_equal(1) then
  167. Result := "CD_WINDING"
  168. end
  169. end
  170. set_fill_mode_even_odd
  171. local
  172. i: INTEGER
  173. do
  174. i := int_canvas_back_opacity (cnvs, 0)
  175. end
  176. set_fill_mode_winding
  177. local
  178. i: INTEGER
  179. do
  180. i := int_canvas_back_opacity (cnvs, 1)
  181. end
  182. set_interior_style (style: STRING)
  183. -- Configures the current style for the area filling primitives:
  184. -- CD_SOLID, CD_HOLLOW, CD_HATCH, CD_STIPPLE or CD_PATTERN. Note that
  185. -- only CD_HATCH and CD_STIPPLE are affected by the backopacity.
  186. -- Default value: CD_SOLID.
  187. --
  188. -- If a stipple or a pattern were not defined, when they are selected the
  189. -- state of the attribute is not changed.
  190. --
  191. -- When the style CD_HOLLOW is defined, functions "draws_box" and
  192. -- "draws_sector" behave as their equivalent "draws_rect" and
  193. -- "draws_arc", and the polygons with style "fill" behave like
  194. -- "closed_lines".
  195. require
  196. is_valid_interior_style(style)
  197. local
  198. i: INTEGER
  199. do
  200. if style.is_equal("CD_SOLID") then
  201. i := int_canvas_interior_style (cnvs, 0)
  202. elseif style.is_equal("CD_HATCH") then
  203. i := int_canvas_interior_style (cnvs, 1)
  204. elseif style.is_equal("CD_STIPPLE") then
  205. i := int_canvas_interior_style (cnvs, 2)
  206. elseif style.is_equal("CD_PATTERN") then
  207. i := int_canvas_interior_style (cnvs, 3)
  208. elseif style.is_equal("CD_HOLLOW") then
  209. i := int_canvas_interior_style (cnvs, 4)
  210. end
  211. end
  212. get_interior_style: STRING
  213. local
  214. i: INTEGER
  215. do
  216. i := int_canvas_interior_style (cnvs, -1)
  217. if i.is_equal(0) then
  218. Result := "CD_SOLID"
  219. elseif i.is_equal(1) then
  220. Result := "CD_HATCH"
  221. elseif i.is_equal(2) then
  222. Result := "CD_STIPPLE"
  223. elseif i.is_equal(3) then
  224. Result := "CD_PATTERN"
  225. elseif i.is_equal(4) then
  226. Result := "CD_HOLLOW"
  227. end
  228. end
  229. set_interior_style_solid
  230. local
  231. i: INTEGER
  232. do
  233. i := int_canvas_interior_style (cnvs, 0)
  234. end
  235. set_interior_style_hatch
  236. local
  237. i: INTEGER
  238. do
  239. i := int_canvas_interior_style (cnvs, 1)
  240. end
  241. set_interior_style_stipple
  242. local
  243. i: INTEGER
  244. do
  245. i := int_canvas_interior_style (cnvs, 2)
  246. end
  247. set_interior_style_pattern
  248. local
  249. i: INTEGER
  250. do
  251. i := int_canvas_interior_style (cnvs, 3)
  252. end
  253. set_interior_style_hollow
  254. local
  255. i: INTEGER
  256. do
  257. i := int_canvas_interior_style (cnvs, 4)
  258. end
  259. set_hatch (style: STRING)
  260. -- Selects a predefined hatch style (CD_HORIZONTAL, CD_VERTICAL,
  261. -- CD_FDIAGONAL, CD_BDIAGONAL, CD_CROSS or CD_DIAGCROSS) and sets the
  262. -- interior style to CD_HATCH. The lines are drawn with the foreground
  263. -- color, and the background is drawn with the background color if back
  264. -- opacity is opaque.
  265. -- Default value: CD_HORIZONTAL.
  266. -- The foreground and background colors must be set before setting the
  267. -- style. In some drivers is always opaque.
  268. require
  269. is_valid_hatch(style)
  270. local
  271. i: INTEGER
  272. do
  273. if style.is_equal("CD_HORIZONTAL") then
  274. i := int_canvas_hatch (cnvs, 0)
  275. elseif style.is_equal("CD_VERTICAL") then
  276. i := int_canvas_hatch (cnvs, 1)
  277. elseif style.is_equal("CD_FDIAGONAL") then
  278. i := int_canvas_hatch (cnvs, 2)
  279. elseif style.is_equal("CD_BDIAGONAL") then
  280. i := int_canvas_hatch (cnvs, 3)
  281. elseif style.is_equal("CD_CROSS") then
  282. i := int_canvas_hatch (cnvs, 4)
  283. elseif style.is_equal("CD_DIAGCROSS") then
  284. i := int_canvas_hatch (cnvs, 5)
  285. end
  286. end
  287. get_hatch: STRING
  288. local
  289. i: INTEGER
  290. do
  291. i := int_canvas_hatch (cnvs, -1)
  292. if i.is_equal(0) then
  293. Result := "CD_HORIZONTAL"
  294. elseif i.is_equal(1) then
  295. Result := "CD_VERTICAL"
  296. elseif i.is_equal(2) then
  297. Result := "CD_FDIAGONAL"
  298. elseif i.is_equal(3) then
  299. Result := "CD_BDIAGONAL"
  300. elseif i.is_equal(4) then
  301. Result := "CD_CROSS"
  302. elseif i.is_equal(5) then
  303. Result := "CD_DIAGCROSS"
  304. end
  305. end
  306. set_hatch_horizontal
  307. local
  308. i: INTEGER
  309. do
  310. i := int_canvas_hatch (cnvs, 0)
  311. end
  312. set_hatch_vertical
  313. local
  314. i: INTEGER
  315. do
  316. i := int_canvas_hatch (cnvs, 1)
  317. end
  318. set_hatch_forward_diagonal
  319. local
  320. i: INTEGER
  321. do
  322. i := int_canvas_hatch (cnvs, 2)
  323. end
  324. set_hatch_backward_diagonal
  325. local
  326. i: INTEGER
  327. do
  328. i := int_canvas_hatch (cnvs, 3)
  329. end
  330. set_hatch_cross
  331. local
  332. i: INTEGER
  333. do
  334. i := int_canvas_hatch (cnvs, 4)
  335. end
  336. set_hatch_diagonal_cross
  337. local
  338. i: INTEGER
  339. do
  340. i := int_canvas_hatch (cnvs, 5)
  341. end
  342. set_stipple (marks: FAST_ARRAY2[INTEGER])
  343. -- Defines a wxh matrix of zeros (0) and ones (1). The zeros are mapped
  344. -- to the background color or are transparent, according to the
  345. -- background opacity attribute. The ones are mapped to the foreground
  346. -- color. The function sets the interior style to "sttiple". It does not
  347. -- need to be stored by the application, as it is internally replicated
  348. -- by the library. In some drivers is always opaque. The foreground and
  349. -- background colors must be set before setting the style.
  350. do
  351. int_canvas_stipple (cnvs, marks.count2, marks.count1,
  352. convert_array2(marks))
  353. end
  354. set_wd_stipple (marks: FAST_ARRAY2[INTEGER]; width_mm, height_mm: REAL_64)
  355. -- Allows specifying the stipple in world coordinates. Another stipple
  356. -- will be created with the size in pixels corresponding to the specified
  357. -- size in millimeters. The new size in pixels will be an integer factor
  358. -- of the original size that is closets to the size in millimeters. The
  359. -- use of this function may produce very large or very small stipples.
  360. do
  361. int_wd_canvas_stipple (cnvs, marks.count2, marks.count1,
  362. convert_array2(marks),
  363. width_mm, height_mm)
  364. end
  365. get_stipple: FAST_ARRAY2[INTEGER]
  366. -- Returns the current stipple. Returns Void if no
  367. -- stipple was defined.
  368. local
  369. w, h: INTEGER
  370. p: POINTER
  371. do
  372. p := int_canvas_get_stipple (cnvs, $w, $h)
  373. if p.is_not_null then
  374. Result := get_array2(p, w, h)
  375. end
  376. end
  377. set_pattern (colors: FAST_ARRAY2[INTEGER])
  378. -- Defines a new wxh color matrix and sets the interior style to
  379. -- "pattern". It does not need to be stored by the application, as it is
  380. -- internally replicated by the library.
  381. do
  382. int_canvas_pattern (cnvs, colors.count2, colors.count1,
  383. convert_colors_array2(colors))
  384. end
  385. set_wd_pattern (colors: FAST_ARRAY2[INTEGER]; width_mm, height_mm: REAL_64)
  386. -- Allows specifying the pattern in world coordinates. Another pattern
  387. -- will be created with the size in pixels corresponding to the specified
  388. -- size in millimeters. The new size in pixels will be an integer factor
  389. -- of the original size that is closets to the size in millimeters. The
  390. -- use of this function may produce very large or very small patterns.
  391. do
  392. int_wd_canvas_pattern (cnvs, colors.count2, colors.count1,
  393. convert_colors_array2(colors),
  394. width_mm, height_mm)
  395. end
  396. get_pattern: FAST_ARRAY2[INTEGER]
  397. -- Returns the current pattern and its dimensions. Returns Void if no
  398. -- pattern was defined.
  399. local
  400. w, h: INTEGER
  401. p: POINTER
  402. do
  403. p := int_canvas_get_pattern (cnvs, $w, $h)
  404. if p.is_not_null then
  405. Result := get_colors_array2(p, w, h)
  406. end
  407. end
  408. feature {}
  409. -- Validations
  410. is_valid_back_opacity (opacity: STRING): BOOLEAN
  411. do
  412. if opacity.is_equal("CD_OPAQUE") or
  413. opacity.is_equal("CD_TRANSPARENT") then
  414. Result := True
  415. else
  416. Result := False
  417. end
  418. end
  419. is_valid_fill_mode (mode: STRING): BOOLEAN
  420. do
  421. if mode.is_equal("CD_EVENODD") or
  422. mode.is_equal("CD_WINDING") then
  423. Result := True
  424. else
  425. Result := False
  426. end
  427. end
  428. is_valid_interior_style (style: STRING): BOOLEAN
  429. do
  430. if style.is_equal("CD_SOLID") or
  431. style.is_equal("CD_HOLLOW") or
  432. style.is_equal("CD_HATCH") or
  433. style.is_equal("CD_STIPPLE") or
  434. style.is_equal("CD_PATTERN") then
  435. Result := True
  436. else
  437. Result := False
  438. end
  439. end
  440. is_valid_hatch (style: STRING): BOOLEAN
  441. do
  442. if style.is_equal("CD_HORIZONTAL") or
  443. style.is_equal("CD_VERTICAL") or
  444. style.is_equal("CD_FDIAGONAL") or
  445. style.is_equal("CD_BDIAGONAL") or
  446. style.is_equal("CD_CROSS") or
  447. style.is_equal("CD_DIAGCROSS") then
  448. Result := True
  449. else
  450. Result := False
  451. end
  452. end
  453. -- Convertions
  454. convert_array2 (matrix: FAST_ARRAY2[INTEGER]): NATIVE_ARRAY[CHARACTER]
  455. local
  456. w, h, v: INTEGER;
  457. arg: NATIVE_ARRAY[CHARACTER]
  458. i, x, y: INTEGER
  459. do
  460. h := matrix.count1
  461. w := matrix.count2
  462. arg := arg.calloc(w*h)
  463. i := 0
  464. from
  465. x := 0
  466. until
  467. x = w
  468. loop
  469. from
  470. y := 0
  471. until
  472. y = w
  473. loop
  474. v := matrix.item(x, y)
  475. arg.put(v.to_character, i)
  476. i := i + 1
  477. y := y + 1
  478. end
  479. x := x + 1
  480. end
  481. Result := arg
  482. end
  483. get_array2 (array: POINTER; w, h: INTEGER): FAST_ARRAY2[INTEGER]
  484. local
  485. i, x, y: INTEGER
  486. v: CHARACTER
  487. arg: NATIVE_ARRAY[CHARACTER]
  488. marks: FAST_ARRAY2[INTEGER]
  489. do
  490. create marks.make (h, w)
  491. arg := arg.calloc(w*h)
  492. arg := arg.from_pointer(array)
  493. i := 0
  494. from
  495. x := 0
  496. until
  497. x = w
  498. loop
  499. from
  500. y := 0
  501. until
  502. y = h
  503. loop
  504. v := arg.item(i)
  505. marks.put(v.to_integer_8.to_integer_32, y, x)
  506. i := i + 1
  507. y := y + 1
  508. end
  509. x := x + 1
  510. end
  511. Result := marks
  512. end
  513. convert_colors_array2 (matrix: FAST_ARRAY2[INTEGER]): NATIVE_ARRAY[INTEGER]
  514. local
  515. w, h, v: INTEGER;
  516. arg: NATIVE_ARRAY[INTEGER]
  517. i, x, y: INTEGER
  518. do
  519. h := matrix.count1
  520. w := matrix.count2
  521. arg := arg.calloc(w*h)
  522. i := 0
  523. from
  524. x := 0
  525. until
  526. x = w
  527. loop
  528. from
  529. y := 0
  530. until
  531. y = w
  532. loop
  533. v := matrix.item(x, y)
  534. arg.put(v, i)
  535. i := i + 1
  536. y := y + 1
  537. end
  538. x := x + 1
  539. end
  540. Result := arg
  541. end
  542. get_colors_array2 (array: POINTER; w, h: INTEGER): FAST_ARRAY2[INTEGER]
  543. local
  544. x, y: INTEGER
  545. i, v: INTEGER
  546. arg: NATIVE_ARRAY[INTEGER]
  547. marks: FAST_ARRAY2[INTEGER]
  548. do
  549. create marks.make (h, w)
  550. arg := arg.calloc(w*h)
  551. arg := arg.from_pointer(array)
  552. i := 0
  553. from
  554. x := 0
  555. until
  556. x = w
  557. loop
  558. from
  559. y := 0
  560. until
  561. y = h
  562. loop
  563. v := arg.item(i)
  564. marks.put(v, y, x)
  565. i := i + 1
  566. y := y + 1
  567. end
  568. x := x + 1
  569. end
  570. Result := marks
  571. end
  572. -- Internals
  573. int_canvas_box (wgt: POINTER; xmin, xmax, ymin, ymax: INTEGER)
  574. external "plug_in"
  575. alias "{
  576. location: "${sys}/plugins"
  577. module_name: "iup"
  578. feature_name: "cdCanvasBox"
  579. }"
  580. end
  581. int_canvas_c_double_box (wgt: POINTER; xmin, xmax, ymin, ymax: REAL_64)
  582. external "plug_in"
  583. alias "{
  584. location: "${sys}/plugins"
  585. module_name: "iup"
  586. feature_name: "cdfCanvasBox"
  587. }"
  588. end
  589. int_wd_canvas_box (wgt: POINTER; xmin, xmax, ymin, ymax: REAL_64)
  590. external "plug_in"
  591. alias "{
  592. location: "${sys}/plugins"
  593. module_name: "iup"
  594. feature_name: "wdCanvasBox"
  595. }"
  596. end
  597. int_canvas_sector (wgt: POINTER; xc, yc, w, h: INTEGER; a1, a2: REAL_64)
  598. external "plug_in"
  599. alias "{
  600. location: "${sys}/plugins"
  601. module_name: "iup"
  602. feature_name: "cdCanvasSector"
  603. }"
  604. end
  605. int_canvas_c_double_sector (wgt: POINTER; xc, yc, w, h, a1, a2: REAL_64)
  606. external "plug_in"
  607. alias "{
  608. location: "${sys}/plugins"
  609. module_name: "iup"
  610. feature_name: "cdfCanvasSector"
  611. }"
  612. end
  613. int_wd_canvas_sector (wgt: POINTER; xc, yc, w, h, a1, a2: REAL_64)
  614. external "plug_in"
  615. alias "{
  616. location: "${sys}/plugins"
  617. module_name: "iup"
  618. feature_name: "wdCanvasSector"
  619. }"
  620. end
  621. int_canvas_chord (wgt: POINTER; xc, yc, w, h: INTEGER; a1, a2: REAL_64)
  622. external "plug_in"
  623. alias "{
  624. location: "${sys}/plugins"
  625. module_name: "iup"
  626. feature_name: "cdCanvasChord"
  627. }"
  628. end
  629. int_canvas_c_double_chord (wgt: POINTER; xc, yc, w, h, a1, a2: REAL_64)
  630. external "plug_in"
  631. alias "{
  632. location: "${sys}/plugins"
  633. module_name: "iup"
  634. feature_name: "cdfCanvasChord"
  635. }"
  636. end
  637. int_wd_canvas_chord (wgt: POINTER; xc, yc, w, h, a1, a2: REAL_64)
  638. external "plug_in"
  639. alias "{
  640. location: "${sys}/plugins"
  641. module_name: "iup"
  642. feature_name: "wdCanvasChord"
  643. }"
  644. end
  645. int_canvas_back_opacity (wgt: POINTER; o: INTEGER): INTEGER
  646. external "plug_in"
  647. alias "{
  648. location: "${sys}/plugins"
  649. module_name: "iup"
  650. feature_name: "cdCanvasBackOpacity"
  651. }"
  652. end
  653. int_canvas_fill_mode (wgt: POINTER; m: INTEGER): INTEGER
  654. external "plug_in"
  655. alias "{
  656. location: "${sys}/plugins"
  657. module_name: "iup"
  658. feature_name: "cdCanvasFillMode"
  659. }"
  660. end
  661. int_canvas_interior_style (wgt: POINTER; s: INTEGER): INTEGER
  662. external "plug_in"
  663. alias "{
  664. location: "${sys}/plugins"
  665. module_name: "iup"
  666. feature_name: "cdCanvasInteriorStyle"
  667. }"
  668. end
  669. int_canvas_hatch (wgt: POINTER; s: INTEGER): INTEGER
  670. external "plug_in"
  671. alias "{
  672. location: "${sys}/plugins"
  673. module_name: "iup"
  674. feature_name: "cdCanvasHatch"
  675. }"
  676. end
  677. int_canvas_stipple (wgt: POINTER; w, h: INTEGER; fgfb: NATIVE_ARRAY[CHARACTER])
  678. external "plug_in"
  679. alias "{
  680. location: "${sys}/plugins"
  681. module_name: "iup"
  682. feature_name: "cdCanvasStipple"
  683. }"
  684. end
  685. int_canvas_stipple_imimage (wgt, im: POINTER)
  686. external "plug_in"
  687. alias "{
  688. location: "${sys}/plugins"
  689. module_name: "iup"
  690. feature_name: "cdCanvasStippleImImage"
  691. }"
  692. end
  693. int_wd_canvas_stipple (wgt: POINTER; w, h: INTEGER; fgfb: NATIVE_ARRAY[CHARACTER]; w_mm, h_mm: REAL_64)
  694. external "plug_in"
  695. alias "{
  696. location: "${sys}/plugins"
  697. module_name: "iup"
  698. feature_name: "wdCanvasStipple"
  699. }"
  700. end
  701. int_canvas_get_stipple (wgt, w, h: POINTER): POINTER
  702. external "plug_in"
  703. alias "{
  704. location: "${sys}/plugins"
  705. module_name: "iup"
  706. feature_name: "cdCanvasGetStipple"
  707. }"
  708. end
  709. int_canvas_pattern (wgt: POINTER; w, h: INTEGER; color: NATIVE_ARRAY[INTEGER])
  710. external "plug_in"
  711. alias "{
  712. location: "${sys}/plugins"
  713. module_name: "iup"
  714. feature_name: "cdCanvasPattern"
  715. }"
  716. end
  717. int_canvas_pattern_imimage (wgt, im: POINTER)
  718. external "plug_in"
  719. alias "{
  720. location: "${sys}/plugins"
  721. module_name: "iup"
  722. feature_name: "cdCanvasPatternImImage"
  723. }"
  724. end
  725. int_wd_canvas_pattern (wgt: POINTER; w, h: INTEGER; color: NATIVE_ARRAY[INTEGER]; w_mm, h_mm: REAL_64)
  726. external "plug_in"
  727. alias "{
  728. location: "${sys}/plugins"
  729. module_name: "iup"
  730. feature_name: "wdCanvasPattern"
  731. }"
  732. end
  733. int_canvas_get_pattern (wgt, w, h: POINTER): POINTER
  734. external "plug_in"
  735. alias "{
  736. location: "${sys}/plugins"
  737. module_name: "iup"
  738. feature_name: "cdCanvasGetPattern"
  739. }"
  740. end
  741. end
  742. -- The MIT License (MIT)
  743. -- Copyright (c) 2016 by German A. Arias
  744. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  745. -- of this software and associated documentation files (the "Software"), to deal
  746. -- in the Software without restriction, including without limitation the rights
  747. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  748. -- copies of the Software, and to permit persons to whom the Software is
  749. -- furnished to do so, subject to the following conditions:
  750. --
  751. -- The above copyright notice and this permission notice shall be included in
  752. -- all copies or substantial portions of the Software.
  753. --
  754. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  755. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  756. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  757. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  758. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  759. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  760. -- SOFTWARE.