litehtml.monkey2 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. Namespace litehtml
  2. #Import "makefile.monkey2"
  3. #Import "litehtml/include/*.h"
  4. #Import "native/litehtml_glue.h"
  5. #Import "native/litehtml_glue.cpp"
  6. Extern
  7. Struct web_color="litehtml::web_color"
  8. Field blue:UByte
  9. Field green:UByte
  10. Field red:UByte
  11. Field alpha:UByte
  12. End
  13. Struct size="litehtml::size"
  14. Field width:Int
  15. Field height:Int
  16. End
  17. Struct position="litehtml::position"
  18. Field x:Int
  19. Field y:Int
  20. Field width:Int
  21. Field height:Int
  22. End
  23. Enum font_style="litehtml::font_style"
  24. End
  25. 'Const fontStyleNormal:font_style
  26. 'Const fontStyleItalic:font_style
  27. Const font_decoration_none:UInt
  28. Const font_decoration_underline:UInt
  29. Const font_decoration_linethrough:UInt
  30. Const font_decoration_overline:UInt
  31. Struct font_metrics="litehtml::font_metrics"
  32. Field height:Int
  33. Field ascent:Int
  34. Field descent:Int
  35. Field x_height:Int
  36. Field draw_spaces:Bool
  37. End
  38. Enum list_style_type="litehtml::list_style_type"
  39. End
  40. Const list_style_type_none:list_style_type="litehtml::list_style_type_none"
  41. Const list_style_type_circle:list_style_type="litehtml::list_style_type_circle"
  42. Const list_style_type_disc:list_style_type="litehtml::list_style_type_disc"
  43. Const list_style_type_square:list_style_type="litehtml::list_style_type_square"
  44. #rem
  45. Const list_style_type_armenian:list_style_type
  46. Const list_style_type_cjk_ideographic:list_style_type
  47. Const list_style_type_decimal:list_style_type
  48. Const list_style_type_decimal_leading_zero:list_style_type
  49. Const list_style_type_georgian:list_style_type
  50. Const list_style_type_hebrew:list_style_type
  51. Const list_style_type_hiragana:list_style_type
  52. Const list_style_type_hiragana_iroha:list_style_type
  53. Const list_style_type_katakana:list_style_type
  54. Const list_style_type_katakana_iroha:list_style_type
  55. Const list_style_type_lower_alpha:list_style_type
  56. Const list_style_type_lower_greek:list_style_type
  57. Const list_style_type_lower_latin:list_style_type
  58. Const list_style_type_lower_roman:list_style_type
  59. Const list_style_type_upper_alpha:list_style_type
  60. Const list_style_type_upper_latin:list_style_type
  61. Const list_style_type_upper_roman:list_style_type
  62. #end
  63. Struct list_marker="litehtml::list_marker"
  64. 'tstring image;
  65. 'const tchar_t* baseurl;
  66. Field marker_type:list_style_type
  67. Field color:web_color
  68. Field pos:position
  69. End
  70. Enum border_style
  71. End
  72. Const border_style_none:border_style="litehtml::border_style_none"
  73. Const border_style_hidden:border_style="litehtml::border_style_hidden"
  74. Const border_style_dotted:border_style
  75. Const border_style_dashed:border_style
  76. Const border_style_solid:border_style="litehtml::border_style_solid"
  77. Const border_style_double:border_style
  78. Const border_style_groove:border_style
  79. Const border_style_ridge:border_style
  80. Const border_style_inset:border_style
  81. Const border_style_outset:border_style
  82. Struct border="litehtml::border"
  83. Field width:Int
  84. Field style:border_style
  85. Field color:web_color
  86. End
  87. Struct border_radiuses="litehtml::border_radiuses"
  88. Field top_left_x:Int
  89. Field top_left_y:Int
  90. Field top_right_x:Int
  91. Field top_right_y:Int
  92. Field bottom_right_x:Int
  93. Field bottom_right_y:Int
  94. Field bottom_left_x:Int
  95. Field bottom_left_y:Int
  96. End
  97. Struct borders="litehtml::borders"
  98. Field left:border
  99. Field top:border
  100. Field right:border
  101. Field bottom:border
  102. Field radius:border_radiuses
  103. End
  104. Enum background_attachment
  105. End
  106. Const background_attachment_scroll:background_attachment
  107. Const background_attachment_fixed:background_attachment
  108. Enum background_repeat
  109. End
  110. Const background_repeat_repeat:background_repeat
  111. Const background_repeat_repeat_x:background_repeat
  112. Const background_repeat_repeat_y:background_repeat
  113. Const background_repeat_no_repeat:background_repeat
  114. Struct background_paint="litehtml::background_paint"
  115. 'tstring image;
  116. 'tstring baseurl;
  117. Field attachment:background_attachment
  118. Field repeat_:background_repeat ="repeat"
  119. Field color:web_color
  120. Field clip_box:position
  121. Field origin_box:position
  122. Field border_box:position
  123. Field border_radius:border_radiuses
  124. Field image_size:size
  125. Field position_x:Int
  126. Field position_y:Int
  127. Field is_root:Bool
  128. End
  129. Enum media_type="litehtml::media_type"
  130. End
  131. Const media_type_none:media_type
  132. Const media_type_all:media_type
  133. Const media_type_screen:media_type="litehtml::media_type_screen"
  134. Const media_type_print:media_type
  135. Const media_type_braille:media_type
  136. Const media_type_embossed:media_type
  137. Const media_type_handheld:media_type
  138. Const media_type_projection:media_type
  139. Const media_type_speech:media_type
  140. Const media_type_tty:media_type
  141. Const media_type_tv:media_type
  142. Struct media_features="litehtml::media_features"
  143. Field type:media_type
  144. Field width:Int ' (pixels) For continuous media, this is the width of the viewport including the size of a rendered scroll bar (if any). For paged media, this is the width of the page box.
  145. Field height:Int ' (pixels) The height of the targeted display area of the output device. For continuous media, this is the height of the viewport including the size of a rendered scroll bar (if any). For paged media, this is the height of the page box.
  146. Field device_width:Int ' (pixels) The width of the rendering surface of the output device. For continuous media, this is the width of the screen. For paged media, this is the width of the page sheet size.
  147. Field device_height:Int ' (pixels) The height of the rendering surface of the output device. For continuous media, this is the height of the screen. For paged media, this is the height of the page sheet size.
  148. Field color:Int ' The number of bits per color component of the output device. If the device is not a color device, the value is zero.
  149. Field color_index:Int ' The number of entries in the color lookup table of the output device. If the device does not use a color lookup table, the value is zero.
  150. Field monochrome:Int ' The number of bits per pixel in a monochrome frame buffer. If the device is not a monochrome device, the output device value will be 0.
  151. Field resolution:Int ' The resolution of the output device (in DPI)
  152. End
  153. Class document_container="bb_litehtml_document_container"
  154. Method create_font:Object( faceName:String,size:Int,weight:Int,style:font_style,docoration:UInt,fm:font_metrics Ptr ) Abstract="_create_font"
  155. Method delete_font( font:Object ) Abstract="_delete_font"
  156. Method text_width:Int( text:String,font:Object ) Abstract="_text_width"
  157. Method draw_text( hdc:Object,text:String,font:Object,color:web_color Ptr,pos:position Ptr ) Abstract="_draw_text"
  158. Method pt_to_px:Int( pt:Int ) Abstract="_pt_to_px"
  159. Method get_default_font_size:Int() Abstract="_get_default_font_size"
  160. Method get_default_font_name:String() Abstract="_get_default_font_name"
  161. Method draw_list_marker( hdc:Object,marker:list_marker Ptr ) Abstract="_draw_list_marker"
  162. Method load_image( src:String,baseurl:String,redraw_on_ready:Bool ) Abstract="_load_image"
  163. Method get_image_size( src:String,baseurl:String,sz:size Ptr ) Abstract="_get_image_size"
  164. Method draw_background( hdc:Object,img_src:String,img_baseurl:String,bg:background_paint Ptr ) Abstract="_draw_background"
  165. Method draw_borders( hdc:Object,bordrs:borders Ptr,pos:position Ptr,root:Bool ) Abstract="_draw_borders"
  166. Method set_caption( caption:String ) Abstract="_set_caption"
  167. Method set_base_url( baseurl:String ) Abstract="_set_base_url"
  168. Method on_anchor_click( url:String ) Abstract="_on_anchor_click"
  169. Method set_cursor( cursor:String ) Abstract="_set_cursor"
  170. Method import_css:String( url:String,baseurl:String ) Abstract="_import_css"
  171. Method set_clip( pos:position Ptr,radiuses:border_radiuses Ptr ) Abstract="_set_clip"
  172. Method del_clip() Abstract="_del_clip"
  173. Method get_client_rect( client:position Ptr ) Abstract="_get_client_rect"
  174. Method get_media_features( media:media_features Ptr ) Abstract="_get_media_features"
  175. Method get_language:String() Abstract="_get_language"
  176. Method get_culture:String() Abstract="_get_culture"
  177. End
  178. Class context="bb_litehtml_context"
  179. Method load_master_stylesheet( master_css:String )
  180. End
  181. Class document="bb_litehtml_document"
  182. Method New( source:String,container:document_container,context:context )
  183. Method render( max_width:Int )
  184. Method draw( hdc:Object,x:Int,y:Int,clip:position Ptr )
  185. Method width:Int()
  186. Method height:Int()
  187. Method media_changed()
  188. Method on_mouse_over( x:Int,y:Int,client_x:Int,client_y:Int )
  189. Method on_lbutton_down( x:Int,y:Int,client_x:Int,client_y:Int )
  190. Method on_lbutton_up( x:Int,y:Int,client_x:Int,client_y:Int )
  191. Method on_mouse_leave()
  192. End