cd_filled_areas.e 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828
  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. else
  132. Result := "CD_OPAQUE"
  133. end
  134. end
  135. set_back_opacity_opaque
  136. local
  137. i: INTEGER
  138. do
  139. i := int_canvas_back_opacity (cnvs, 0)
  140. end
  141. set_back_opacity_transparent
  142. local
  143. i: INTEGER
  144. do
  145. i := int_canvas_back_opacity (cnvs, 1)
  146. end
  147. set_fill_mode (mode: STRING)
  148. -- Selects a predefined polygon fill rule (CD_EVENODD or CD_WINDING).
  149. -- Default value: CD_EVENODD.
  150. require
  151. is_valid_fill_mode (mode)
  152. local
  153. i: INTEGER
  154. do
  155. if mode.is_equal("CD_EVENODD") then
  156. i := int_canvas_back_opacity (cnvs, 0)
  157. elseif mode.is_equal("CD_WINDING") then
  158. i := int_canvas_back_opacity (cnvs, 1)
  159. end
  160. end
  161. get_fill_mode: STRING
  162. local
  163. i: INTEGER
  164. do
  165. i := int_canvas_fill_mode (cnvs, -1)
  166. if i.is_equal(0) then
  167. Result := "CD_EVENODD"
  168. elseif i.is_equal(1) then
  169. Result := "CD_WINDING"
  170. else
  171. Result := "CD_EVENODD"
  172. end
  173. end
  174. set_fill_mode_even_odd
  175. local
  176. i: INTEGER
  177. do
  178. i := int_canvas_back_opacity (cnvs, 0)
  179. end
  180. set_fill_mode_winding
  181. local
  182. i: INTEGER
  183. do
  184. i := int_canvas_back_opacity (cnvs, 1)
  185. end
  186. set_interior_style (style: STRING)
  187. -- Configures the current style for the area filling primitives:
  188. -- CD_SOLID, CD_HOLLOW, CD_HATCH, CD_STIPPLE or CD_PATTERN. Note that
  189. -- only CD_HATCH and CD_STIPPLE are affected by the backopacity.
  190. -- Default value: CD_SOLID.
  191. --
  192. -- If a stipple or a pattern were not defined, when they are selected the
  193. -- state of the attribute is not changed.
  194. --
  195. -- When the style CD_HOLLOW is defined, functions "draws_box" and
  196. -- "draws_sector" behave as their equivalent "draws_rect" and
  197. -- "draws_arc", and the polygons with style "fill" behave like
  198. -- "closed_lines".
  199. require
  200. is_valid_interior_style(style)
  201. local
  202. i: INTEGER
  203. do
  204. if style.is_equal("CD_SOLID") then
  205. i := int_canvas_interior_style (cnvs, 0)
  206. elseif style.is_equal("CD_HATCH") then
  207. i := int_canvas_interior_style (cnvs, 1)
  208. elseif style.is_equal("CD_STIPPLE") then
  209. i := int_canvas_interior_style (cnvs, 2)
  210. elseif style.is_equal("CD_PATTERN") then
  211. i := int_canvas_interior_style (cnvs, 3)
  212. elseif style.is_equal("CD_HOLLOW") then
  213. i := int_canvas_interior_style (cnvs, 4)
  214. end
  215. end
  216. get_interior_style: STRING
  217. local
  218. i: INTEGER
  219. do
  220. i := int_canvas_interior_style (cnvs, -1)
  221. if i.is_equal(0) then
  222. Result := "CD_SOLID"
  223. elseif i.is_equal(1) then
  224. Result := "CD_HATCH"
  225. elseif i.is_equal(2) then
  226. Result := "CD_STIPPLE"
  227. elseif i.is_equal(3) then
  228. Result := "CD_PATTERN"
  229. elseif i.is_equal(4) then
  230. Result := "CD_HOLLOW"
  231. else
  232. Result := "CD_SOLID"
  233. end
  234. end
  235. set_interior_style_solid
  236. local
  237. i: INTEGER
  238. do
  239. i := int_canvas_interior_style (cnvs, 0)
  240. end
  241. set_interior_style_hatch
  242. local
  243. i: INTEGER
  244. do
  245. i := int_canvas_interior_style (cnvs, 1)
  246. end
  247. set_interior_style_stipple
  248. local
  249. i: INTEGER
  250. do
  251. i := int_canvas_interior_style (cnvs, 2)
  252. end
  253. set_interior_style_pattern
  254. local
  255. i: INTEGER
  256. do
  257. i := int_canvas_interior_style (cnvs, 3)
  258. end
  259. set_interior_style_hollow
  260. local
  261. i: INTEGER
  262. do
  263. i := int_canvas_interior_style (cnvs, 4)
  264. end
  265. set_hatch (style: STRING)
  266. -- Selects a predefined hatch style (CD_HORIZONTAL, CD_VERTICAL,
  267. -- CD_FDIAGONAL, CD_BDIAGONAL, CD_CROSS or CD_DIAGCROSS) and sets the
  268. -- interior style to CD_HATCH. The lines are drawn with the foreground
  269. -- color, and the background is drawn with the background color if back
  270. -- opacity is opaque.
  271. -- Default value: CD_HORIZONTAL.
  272. -- The foreground and background colors must be set before setting the
  273. -- style. In some drivers is always opaque.
  274. require
  275. is_valid_hatch(style)
  276. local
  277. i: INTEGER
  278. do
  279. if style.is_equal("CD_HORIZONTAL") then
  280. i := int_canvas_hatch (cnvs, 0)
  281. elseif style.is_equal("CD_VERTICAL") then
  282. i := int_canvas_hatch (cnvs, 1)
  283. elseif style.is_equal("CD_FDIAGONAL") then
  284. i := int_canvas_hatch (cnvs, 2)
  285. elseif style.is_equal("CD_BDIAGONAL") then
  286. i := int_canvas_hatch (cnvs, 3)
  287. elseif style.is_equal("CD_CROSS") then
  288. i := int_canvas_hatch (cnvs, 4)
  289. elseif style.is_equal("CD_DIAGCROSS") then
  290. i := int_canvas_hatch (cnvs, 5)
  291. end
  292. end
  293. get_hatch: STRING
  294. local
  295. i: INTEGER
  296. do
  297. i := int_canvas_hatch (cnvs, -1)
  298. if i.is_equal(0) then
  299. Result := "CD_HORIZONTAL"
  300. elseif i.is_equal(1) then
  301. Result := "CD_VERTICAL"
  302. elseif i.is_equal(2) then
  303. Result := "CD_FDIAGONAL"
  304. elseif i.is_equal(3) then
  305. Result := "CD_BDIAGONAL"
  306. elseif i.is_equal(4) then
  307. Result := "CD_CROSS"
  308. elseif i.is_equal(5) then
  309. Result := "CD_DIAGCROSS"
  310. else
  311. Result := "CD_HORIZONTAL"
  312. end
  313. end
  314. set_hatch_horizontal
  315. local
  316. i: INTEGER
  317. do
  318. i := int_canvas_hatch (cnvs, 0)
  319. end
  320. set_hatch_vertical
  321. local
  322. i: INTEGER
  323. do
  324. i := int_canvas_hatch (cnvs, 1)
  325. end
  326. set_hatch_forward_diagonal
  327. local
  328. i: INTEGER
  329. do
  330. i := int_canvas_hatch (cnvs, 2)
  331. end
  332. set_hatch_backward_diagonal
  333. local
  334. i: INTEGER
  335. do
  336. i := int_canvas_hatch (cnvs, 3)
  337. end
  338. set_hatch_cross
  339. local
  340. i: INTEGER
  341. do
  342. i := int_canvas_hatch (cnvs, 4)
  343. end
  344. set_hatch_diagonal_cross
  345. local
  346. i: INTEGER
  347. do
  348. i := int_canvas_hatch (cnvs, 5)
  349. end
  350. set_stipple (marks: ARRAY2[INTEGER])
  351. -- Defines a wxh matrix of zeros (0) and ones (1). The zeros are mapped
  352. -- to the background color or are transparent, according to the
  353. -- background opacity attribute. The ones are mapped to the foreground
  354. -- color. The function sets the interior style to "sttiple". It does not
  355. -- need to be stored by the application, as it is internally replicated
  356. -- by the library. In some drivers is always opaque. The foreground and
  357. -- background colors must be set before setting the style.
  358. do
  359. int_canvas_stipple (cnvs, marks.width, marks.height,
  360. convert_array2(marks))
  361. end
  362. set_wd_stipple (marks: ARRAY2[INTEGER]; width_mm, height_mm: REAL_64)
  363. -- Allows specifying the stipple in world coordinates. Another stipple
  364. -- will be created with the size in pixels corresponding to the specified
  365. -- size in millimeters. The new size in pixels will be an integer factor
  366. -- of the original size that is closets to the size in millimeters. The
  367. -- use of this function may produce very large or very small stipples.
  368. do
  369. int_wd_canvas_stipple (cnvs, marks.width, marks.height,
  370. convert_array2(marks),
  371. width_mm, height_mm)
  372. end
  373. get_stipple: detachable ARRAY2[INTEGER]
  374. -- Returns the current stipple. Returns Void if no
  375. -- stipple was defined.
  376. local
  377. w, h: INTEGER
  378. p: POINTER
  379. do
  380. p := int_canvas_get_stipple (cnvs, $w, $h)
  381. if p /= default_pointer then
  382. Result := get_array2(p, w, h)
  383. end
  384. end
  385. set_pattern (colors: ARRAY2[INTEGER])
  386. -- Defines a new wxh color matrix and sets the interior style to
  387. -- "pattern". It does not need to be stored by the application, as it is
  388. -- internally replicated by the library.
  389. do
  390. int_canvas_pattern (cnvs, colors.width, colors.height,
  391. convert_colors_array2(colors))
  392. end
  393. set_wd_pattern (colors: ARRAY2[INTEGER]; width_mm, height_mm: REAL_64)
  394. -- Allows specifying the pattern in world coordinates. Another pattern
  395. -- will be created with the size in pixels corresponding to the specified
  396. -- size in millimeters. The new size in pixels will be an integer factor
  397. -- of the original size that is closets to the size in millimeters. The
  398. -- use of this function may produce very large or very small patterns.
  399. do
  400. int_wd_canvas_pattern (cnvs, colors.width, colors.height,
  401. convert_colors_array2(colors),
  402. width_mm, height_mm)
  403. end
  404. get_pattern: detachable ARRAY2[INTEGER]
  405. -- Returns the current pattern and its dimensions. Returns Void if no
  406. -- pattern was defined.
  407. local
  408. w, h: INTEGER
  409. p: POINTER
  410. do
  411. p := int_canvas_get_pattern (cnvs, $w, $h)
  412. if p /= default_pointer then
  413. Result := get_colors_array2(p, w, h)
  414. end
  415. end
  416. -- Validations
  417. is_valid_back_opacity (opacity: STRING): BOOLEAN
  418. do
  419. if opacity.is_equal("CD_OPAQUE") or
  420. opacity.is_equal("CD_TRANSPARENT") then
  421. Result := True
  422. else
  423. Result := False
  424. end
  425. end
  426. is_valid_fill_mode (mode: STRING): BOOLEAN
  427. do
  428. if mode.is_equal("CD_EVENODD") or
  429. mode.is_equal("CD_WINDING") then
  430. Result := True
  431. else
  432. Result := False
  433. end
  434. end
  435. is_valid_interior_style (style: STRING): BOOLEAN
  436. do
  437. if style.is_equal("CD_SOLID") or
  438. style.is_equal("CD_HOLLOW") or
  439. style.is_equal("CD_HATCH") or
  440. style.is_equal("CD_STIPPLE") or
  441. style.is_equal("CD_PATTERN") then
  442. Result := True
  443. else
  444. Result := False
  445. end
  446. end
  447. is_valid_hatch (style: STRING): BOOLEAN
  448. do
  449. if style.is_equal("CD_HORIZONTAL") or
  450. style.is_equal("CD_VERTICAL") or
  451. style.is_equal("CD_FDIAGONAL") or
  452. style.is_equal("CD_BDIAGONAL") or
  453. style.is_equal("CD_CROSS") or
  454. style.is_equal("CD_DIAGCROSS") then
  455. Result := True
  456. else
  457. Result := False
  458. end
  459. end
  460. feature {NONE}
  461. -- Convertions
  462. convert_array2 (matrix: ARRAY2[INTEGER]): POINTER
  463. local
  464. w, h, v: INTEGER;
  465. arg: ARRAY[CHARACTER_8]
  466. i, x, y: INTEGER
  467. do
  468. h := matrix.height
  469. w := matrix.width
  470. create arg.make_filled(' ', 1, w*h + 1)
  471. i := 0
  472. from
  473. x := 0
  474. until
  475. x = w
  476. loop
  477. from
  478. y := 0
  479. until
  480. y = w
  481. loop
  482. v := matrix.item(x, y)
  483. arg.put(v.to_character_8, i)
  484. i := i + 1
  485. y := y + 1
  486. end
  487. x := x + 1
  488. end
  489. Result := get_pointer(arg.to_c)
  490. end
  491. get_array2 (array: POINTER; w, h: INTEGER): ARRAY2[INTEGER]
  492. local
  493. i, x, y: INTEGER
  494. arg: MANAGED_POINTER
  495. marks: ARRAY2[INTEGER]
  496. do
  497. create marks.make_filled (0, h, w)
  498. create arg.make_from_pointer(array, w*h)
  499. i := 0
  500. from
  501. x := 0
  502. until
  503. x = w
  504. loop
  505. from
  506. y := 0
  507. until
  508. y = h
  509. loop
  510. marks.put(arg.read_integer_32(i), y, x)
  511. i := i + 1
  512. y := y + 1
  513. end
  514. x := x + 1
  515. end
  516. Result := marks
  517. end
  518. convert_colors_array2 (matrix: ARRAY2[INTEGER]): POINTER
  519. -- Revise GOBO
  520. local
  521. x, y, i, w, h: INTEGER
  522. marks: ARRAY[INTEGER_8]
  523. do
  524. w := matrix.width
  525. h := matrix.height
  526. create marks.make_filled ((0).to_integer_8, 1, w*h + 1)
  527. i := 1
  528. from
  529. x := 1
  530. until
  531. x = w
  532. loop
  533. from
  534. y := 1
  535. until
  536. y = h
  537. loop
  538. marks.put(matrix.item(y, x).to_integer_8, i)
  539. i := i + 1
  540. y := y + 1
  541. end
  542. x := x + 1
  543. end
  544. Result := get_pointer(marks.to_c)
  545. end
  546. get_colors_array2 (array: POINTER; w, h: INTEGER): ARRAY2[INTEGER]
  547. local
  548. x, y: INTEGER
  549. i, v: INTEGER
  550. arg: MANAGED_POINTER
  551. marks: ARRAY2[INTEGER]
  552. do
  553. create marks.make_filled (0, h, w)
  554. create arg.make_from_pointer(array, w*h)
  555. i := 0
  556. from
  557. x := 0
  558. until
  559. x = w
  560. loop
  561. from
  562. y := 0
  563. until
  564. y = h
  565. loop
  566. v := arg.read_integer_32(i)
  567. marks.put(v, y, x)
  568. i := i + 1
  569. y := y + 1
  570. end
  571. x := x + 1
  572. end
  573. Result := marks
  574. end
  575. -- Internals
  576. int_canvas_box (wgt: POINTER; xmin, xmax, ymin, ymax: INTEGER)
  577. external
  578. "C inline use %"eiffel-iup.h%""
  579. alias
  580. "cdCanvasBox ($wgt, $xmin, $xmax, $ymin, $ymax);"
  581. end
  582. int_canvas_c_double_box (wgt: POINTER; xmin, xmax, ymin, ymax: REAL_64)
  583. external
  584. "C inline use %"eiffel-iup.h%""
  585. alias
  586. "cdfCanvasBox ($wgt, $xmin, $xmax, $ymin, $ymax);"
  587. end
  588. int_wd_canvas_box (wgt: POINTER; xmin, xmax, ymin, ymax: REAL_64)
  589. external
  590. "C inline use %"eiffel-iup.h%""
  591. alias
  592. "wdCanvasBox ($wgt, $xmin, $xmax, $ymin, $ymax);"
  593. end
  594. int_canvas_sector (wgt: POINTER; xc, yc, w, h: INTEGER; a1, a2: REAL_64)
  595. external
  596. "C inline use %"eiffel-iup.h%""
  597. alias
  598. "cdCanvasSector ($wgt, $xc, $yc, $w, $h, $a1, $a2);"
  599. end
  600. int_canvas_c_double_sector (wgt: POINTER; xc, yc, w, h, a1, a2: REAL_64)
  601. external
  602. "C inline use %"eiffel-iup.h%""
  603. alias
  604. "cdfCanvasSector ($wgt, $xc, $yc, $w, $h, $a1, $a2);"
  605. end
  606. int_wd_canvas_sector (wgt: POINTER; xc, yc, w, h, a1, a2: REAL_64)
  607. external
  608. "C inline use %"eiffel-iup.h%""
  609. alias
  610. "wdCanvasSector ($wgt, $xc, $yc, $w, $h, $a1, $a2);"
  611. end
  612. int_canvas_chord (wgt: POINTER; xc, yc, w, h: INTEGER; a1, a2: REAL_64)
  613. external
  614. "C inline use %"eiffel-iup.h%""
  615. alias
  616. "cdCanvasChord ($wgt, $xc, $yc, $w, $h, $a1, $a2);"
  617. end
  618. int_canvas_c_double_chord (wgt: POINTER; xc, yc, w, h, a1, a2: REAL_64)
  619. external
  620. "C inline use %"eiffel-iup.h%""
  621. alias
  622. "cdfCanvasChord ($wgt, $xc, $yc, $w, $h, $a1, $a2);"
  623. end
  624. int_wd_canvas_chord (wgt: POINTER; xc, yc, w, h, a1, a2: REAL_64)
  625. external
  626. "C inline use %"eiffel-iup.h%""
  627. alias
  628. "wdCanvasChord ($wgt, $xc, $yc, $w, $h, $a1, $a2);"
  629. end
  630. int_canvas_back_opacity (wgt: POINTER; o: INTEGER): INTEGER
  631. external
  632. "C inline use %"eiffel-iup.h%""
  633. alias
  634. "return cdCanvasBackOpacity ($wgt, $o);"
  635. end
  636. int_canvas_fill_mode (wgt: POINTER; m: INTEGER): INTEGER
  637. external
  638. "C inline use %"eiffel-iup.h%""
  639. alias
  640. "return cdCanvasFillMode ($wgt, $m);"
  641. end
  642. int_canvas_interior_style (wgt: POINTER; s: INTEGER): INTEGER
  643. external
  644. "C inline use %"eiffel-iup.h%""
  645. alias
  646. "return cdCanvasInteriorStyle ($wgt, $s);"
  647. end
  648. int_canvas_hatch (wgt: POINTER; s: INTEGER): INTEGER
  649. external
  650. "C inline use %"eiffel-iup.h%""
  651. alias
  652. "return cdCanvasHatch ($wgt, $s);"
  653. end
  654. int_canvas_stipple (wgt: POINTER; w, h: INTEGER; fgfb: POINTER)
  655. external
  656. "C inline use %"eiffel-iup.h%""
  657. alias
  658. "cdCanvasStipple ($wgt, $w, $h, $fgfb);"
  659. end
  660. int_canvas_stipple_imimage (wgt, im: POINTER)
  661. external
  662. "C inline use %"eiffel-iup.h%""
  663. alias
  664. "cdCanvasStippleImImage ($wgt, $im);"
  665. end
  666. int_wd_canvas_stipple (wgt: POINTER; w, h: INTEGER; fgfb: POINTER; w_mm, h_mm: REAL_64)
  667. external
  668. "C inline use %"eiffel-iup.h%""
  669. alias
  670. "wdCanvasStipple ($wgt, $w, $h, $fgfb, $w_mm, $h_mm);"
  671. end
  672. int_canvas_get_stipple (wgt, w, h: POINTER): POINTER
  673. external
  674. "C inline use %"eiffel-iup.h%""
  675. alias
  676. "return cdCanvasGetStipple ($wgt, $w, $h);"
  677. end
  678. int_canvas_pattern (wgt: POINTER; w, h: INTEGER; color: POINTER)
  679. external
  680. "C inline use %"eiffel-iup.h%""
  681. alias
  682. "cdCanvasPattern ($wgt, $w, $h, $color);"
  683. end
  684. int_canvas_pattern_imimage (wgt, im: POINTER)
  685. external
  686. "C inline use %"eiffel-iup.h%""
  687. alias
  688. "cdCanvasPatternImImage ($wgt, $im);"
  689. end
  690. int_wd_canvas_pattern (wgt: POINTER; w, h: INTEGER; color: POINTER; w_mm, h_mm: REAL_64)
  691. external
  692. "C inline use %"eiffel-iup.h%""
  693. alias
  694. "wdCanvasPattern ($wgt, $w, $h, $color, $w_mm, $h_mm);"
  695. end
  696. int_canvas_get_pattern (wgt, w, h: POINTER): POINTER
  697. external
  698. "C inline use %"eiffel-iup.h%""
  699. alias
  700. "return cdCanvasGetPattern ($wgt, $w, $h);"
  701. end
  702. end
  703. -- The MIT License (MIT)
  704. -- Copyright (c) 2016, 2019, 2020 by German A. Arias
  705. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  706. -- of this software and associated documentation files (the "Software"), to deal
  707. -- in the Software without restriction, including without limitation the rights
  708. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  709. -- copies of the Software, and to permit persons to whom the Software is
  710. -- furnished to do so, subject to the following conditions:
  711. --
  712. -- The above copyright notice and this permission notice shall be included in
  713. -- all copies or substantial portions of the Software.
  714. --
  715. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  716. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  717. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  718. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  719. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  720. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  721. -- SOFTWARE.