cd_iup.e 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. class CD_IUP
  2. inherit
  3. CANVAS_DRAW
  4. CD_CANVAS_SIMULATE
  5. CD_CANVAS_INITIALIZATION
  6. CD_CANVAS_CONTROL
  7. CD_CANVAS_COORDINATE_SYSTEM
  8. CD_CANVAS_WORLD_COORDINATES
  9. CD_CANVAS_GENERAL_ATTRIBUTES
  10. CD_PRIMITIVES_MARKS
  11. CD_LINES
  12. CD_POLYGONS_BEZIER_REGIONS
  13. CD_COMPLEX_CLIPPING_REGIONS
  14. CD_FILLED_AREAS
  15. CD_TEXT
  16. CD_VECTOR_TEXT
  17. CD_CLIENT_IMAGES
  18. create {IUP_CANVAS}
  19. create_with_front_cd_canvas
  20. create {IUP_CONTROLS}
  21. create_with_cd_canvas
  22. create {ANY}
  23. create_with_canvas,
  24. create_double_buffer_with_canvas,
  25. create_double_buffer_rgb_with_canvas
  26. feature {IUP_CANVAS}
  27. create_with_front_cd_canvas (p: POINTER)
  28. do
  29. cnvs := p
  30. end
  31. feature {IUP_CONTROLS}
  32. create_with_cd_canvas (wgt: IUP_CANVAS; p: POINTER)
  33. do
  34. cnvs := p
  35. wgt.set_cd_canvas(Current)
  36. initialize_modes
  37. initialize_colors
  38. end
  39. feature {ANY}
  40. create_with_canvas (wgt: IUP_CANVAS)
  41. do
  42. cnvs := int_create_canvas(int_cd_context_iup, wgt.widget)
  43. wgt.set_cd_canvas(Current)
  44. initialize_modes
  45. initialize_colors
  46. end
  47. create_double_buffer_with_canvas (wgt: IUP_CANVAS)
  48. do
  49. cnvs := int_create_canvas(int_cd_context_iup_double_buffer, wgt.widget)
  50. wgt.set_back_and_front_cd_canvas(Current)
  51. initialize_modes
  52. initialize_colors
  53. end
  54. create_double_buffer_rgb_with_canvas (wgt: IUP_CANVAS)
  55. do
  56. cnvs := int_create_canvas(int_cd_context_iup_double_buffer_rgb,
  57. wgt.widget)
  58. wgt.set_back_and_front_cd_canvas(Current)
  59. initialize_modes
  60. initialize_colors
  61. end
  62. feature {}
  63. -- Internals
  64. int_create_canvas (context, data: POINTER): POINTER
  65. external "plug_in"
  66. alias "{
  67. location: "${sys}/plugins"
  68. module_name: "iup"
  69. feature_name: "cdCreateCanvas"
  70. }"
  71. end
  72. int_cd_context_iup: POINTER
  73. external "plug_in"
  74. alias "{
  75. location: "${sys}/plugins"
  76. module_name: "iup"
  77. feature_name: "cdContextIup()"
  78. }"
  79. end
  80. int_cd_context_iup_double_buffer: POINTER
  81. external "plug_in"
  82. alias "{
  83. location: "${sys}/plugins"
  84. module_name: "iup"
  85. feature_name: "cdContextIupDBuffer()"
  86. }"
  87. end
  88. int_cd_context_iup_double_buffer_rgb: POINTER
  89. external "plug_in"
  90. alias "{
  91. location: "${sys}/plugins"
  92. module_name: "iup"
  93. feature_name: "cdContextIupDBufferRGB()"
  94. }"
  95. end
  96. end
  97. -- The MIT License (MIT)
  98. -- Copyright (c) 2016, 2017 by German A. Arias
  99. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  100. -- of this software and associated documentation files (the "Software"), to deal
  101. -- in the Software without restriction, including without limitation the rights
  102. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  103. -- copies of the Software, and to permit persons to whom the Software is
  104. -- furnished to do so, subject to the following conditions:
  105. --
  106. -- The above copyright notice and this permission notice shall be included in
  107. -- all copies or substantial portions of the Software.
  108. --
  109. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  110. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  111. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  112. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  113. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  114. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  115. -- SOFTWARE.