Subversion Repositories Kolibri OS

Rev

Rev 4308 | Rev 6256 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;*****************************************************************************
  2. ; Box_Lib - library of graphical components
  3. ; Copyright (C) KolibriOS team 2008-2013. All rights reserved.
  4. ;
  5. ; Authors:
  6. ; Alexey Teplov aka <Lrz>
  7. ; Marat Zakiyanov aka Mario79, aka Mario
  8. ; Evtikhov Maxim aka Maxxxx32
  9. ; Eugene Grechnikov aka Diamond
  10. ; hidnplayr
  11. ; Igor Afanasiev aka IgorA
  12. ;*****************************************************************************
  13.  
  14. format MS COFF
  15.  
  16. public EXPORTS
  17.  
  18. section '.flat' code readable align 16
  19. include '../../../../macros.inc'
  20. include '../../../../proc32.inc'
  21. include 'bl_sys.mac'
  22. include 'box_lib.mac' ;macro which should make life easier :)
  23. ;include '../../../../debug.inc'
  24.  
  25. ;-----------------------------------------------------------------------------
  26. mem.alloc   dd ? ;ôóíêöèÿ äëÿ âûäåëåíèÿ ïàìÿòè
  27. mem.free    dd ? ;ôóíêöèÿ äëÿ îñâîáîæäåíèÿ ïàìÿòè
  28. mem.realloc dd ? ;ôóíêöèÿ äëÿ ïåðåðàñïðåäåëåíèÿ ïàìÿòè
  29. dll.load    dd ?
  30.  
  31. ;----------------------------------------------------
  32. ;EditBox
  33. ;----------------------------------------------------
  34. align 16
  35. use_editbox_draw        ;macro reveals the function of the display.
  36. align 16
  37. use_editbox_key         ;macro reveals processing function of the keypad.
  38. align 16
  39. use_editbox_mouse       ;macro reveals processing function of the mouse.
  40.  
  41. ;----------------------------------------------------
  42. ;CheckBox2
  43. ;----------------------------------------------------
  44. align 16
  45. _init_checkbox2         ;macro for init checkbox
  46. align 16
  47. use_checkbox_draw2      ;macro reveals the function of the display.
  48. align 16
  49. use_checkbox_mouse2     ;macro reveals processing function of the mouse.
  50.  
  51. ;--------------------------------------------------
  52. ;radiobutton Group
  53. ;--------------------------------------------------
  54. align 16
  55. use_optionbox_driver    ;macro that control the operating modes
  56. align 16
  57. use_optionbox_draw      ;macro reveals the function of the display.
  58. align 16
  59. use_optionbox_mouse     ;macro reveals processing function of the mouse.
  60.  
  61. ;--------------------------------------------------
  62. ;scrollbar Group
  63. ;--------------------------------------------------
  64. align 16
  65. use_scroll_bar
  66. align 16
  67. use_scroll_bar_vertical
  68. align 16
  69. use_scroll_bar_horizontal
  70.  
  71. ;--------------------------------------------------
  72. ;dinamic button Group
  73. ;--------------------------------------------------
  74. align 16
  75. use_dinamic_button
  76.  
  77. ;--------------------------------------------------
  78. ;menubar Group
  79. ;--------------------------------------------------
  80. align 16
  81. use_menu_bar
  82.  
  83. ;--------------------------------------------------
  84. ;filebrowser Group
  85. ;--------------------------------------------------
  86. align 16
  87. use_file_browser
  88.  
  89. ;--------------------------------------------------
  90. ;tree list
  91. ;--------------------------------------------------
  92. align 16
  93. use_tree_list
  94.  
  95. ;--------------------------------------------------
  96. ;PathShow Group
  97. ;--------------------------------------------------
  98. align 16
  99. use_path_show
  100.  
  101. ;--------------------------------------------------
  102. ;text editor
  103. ;--------------------------------------------------
  104. align 16
  105. use_text_edit
  106. ;--------------------------------------------------
  107. ;Frame Group
  108. ;--------------------------------------------------
  109. align 16
  110. use_frame
  111. ;--------------------------------------------------
  112. ;ProgressBar
  113. ;--------------------------------------------------
  114. use_progressbar
  115.  
  116. ;input:
  117. ; eax = óêàçàòåëü íà ôóíêöèþ âûäåëåíèÿ ïàìÿòè
  118. ; ebx = ... îñâîáîæäåíèÿ ïàìÿòè
  119. ; ecx = ... ïåðåðàñïðåäåëåíèÿ ïàìÿòè
  120. ; edx = ... çàãðóçêè áèáëèîòåêè (ïîêà íå èñïîëüçóåòñÿ)
  121. align 16
  122. lib_init:
  123.         mov     [mem.alloc], eax
  124.         mov     [mem.free], ebx
  125.         mov     [mem.realloc], ecx
  126.         mov     [dll.load], edx
  127. ret
  128.  
  129.  
  130. align 4
  131. proc draw_edge uses eax ebx ecx edx edi esi, box_l:dword, box_t:dword, box_w:dword, box_h:dword,\
  132.         col_0:dword, col_1:dword, col_2:dword
  133.  
  134.         mov esi,dword[col_1]
  135.         and esi,111111101111111011111110b
  136.  
  137.         mov eax,13
  138.         ;bottom line
  139.         mov edx,dword[col_2]
  140.         mov ebx,dword[box_l]
  141.         shl ebx,16
  142.         add ebx,dword[box_w]
  143.         inc ebx ;äëÿ çàëèâêè äèàãîíàëüíûõ ïèêñåëåé
  144.         mov ecx,dword[box_t]
  145.         add ecx,dword[box_h]
  146.         shl ecx,16
  147.         inc ecx
  148.  
  149.         mov edi,3 ;for cycle
  150.         @@:
  151.                 ;calculate colors
  152.                 and edx,111111101111111011111110b
  153.                 add edx,esi
  154.                 shr edx,1
  155.                 ;line move up and ->...<-
  156.                 sub ecx,1 shl 16 ;move up
  157.                 add ebx,1 shl 16 ;->...
  158.                 sub ebx,2 ;...<-
  159.                 ;draw line
  160.                 int 0x40
  161.                 dec edi
  162.         jnz @b
  163.  
  164.         ;right line
  165.         mov edx,dword[col_2]
  166.         mov ebx,dword[box_l]
  167.         add ebx,dword[box_w]
  168.         shl ebx,16
  169.         inc ebx
  170.         mov ecx,dword[box_t]
  171.         shl ecx,16
  172.         add ecx,dword[box_h]
  173.  
  174.         mov edi,3 ;for cycle
  175.         @@:
  176.                 ;calculate colors
  177.                 and edx,111111101111111011111110b
  178.                 add edx,esi
  179.                 shr edx,1
  180.                 ;line move left and ...
  181.                 sub ebx,1 shl 16 ;move left
  182.                 add ecx,1 shl 16
  183.                 sub ecx,2
  184.                 ;draw line
  185.                 int 0x40
  186.                 dec edi
  187.         jnz @b
  188.  
  189.         ;top line
  190.         mov edx,dword[col_0]
  191.         mov ebx,dword[box_l]
  192.         shl ebx,16
  193.         add ebx,dword[box_w]
  194.         mov ecx,dword[box_t]
  195.         shl ecx,16
  196.         inc ecx
  197.  
  198.         mov edi,3 ;for cycle
  199.         @@:
  200.                 ;calculate colors
  201.                 and edx,111111101111111011111110b
  202.                 add edx,esi
  203.                 shr edx,1
  204.                 ;line move down and ->...<-
  205.                 add ecx,1 shl 16 ;move down
  206.                 add ebx,1 shl 16 ;->...
  207.                 sub ebx,2 ;...<-
  208.                 ;draw line
  209.                 int 0x40
  210.                 dec edi
  211.         jnz @b
  212.  
  213.         ;left line
  214.         mov edx,dword[col_0]
  215.         mov ebx,dword[box_l]
  216.         shl ebx,16
  217.         inc ebx
  218.         mov ecx,dword[box_t]
  219.         shl ecx,16
  220.         add ecx,dword[box_h]
  221.  
  222.         mov edi,3 ;for cycle
  223.         @@:
  224.                 ;calculate colors
  225.                 and edx,111111101111111011111110b
  226.                 add edx,esi
  227.                 shr edx,1
  228.                 ;line move left and ...
  229.                 add ebx,1 shl 16 ;move left
  230.                 add ecx,1 shl 16
  231.                 sub ecx,2
  232.                 ;draw line
  233.                 int 0x40
  234.                 dec edi
  235.         jnz @b
  236.  
  237.         ret
  238. endp
  239.  
  240.  
  241. align 16
  242. EXPORTS:
  243.  
  244.  
  245. dd      sz_init,                        lib_init
  246. dd      sz_version,                     0x00000001
  247.  
  248. dd      sz_edit_box,                    edit_box
  249. dd      sz_edit_box_key,                edit_box_key
  250. dd      sz_edit_box_mouse,              edit_box_mouse
  251. dd      sz_edit_box_set_text,           edit_box_set_text
  252. dd      szVersion_ed,                   0x00000001
  253.  
  254. dd      sz_init_checkbox2,              init_checkbox2
  255. dd      sz_check_box_draw2,             check_box_draw2
  256. dd      sz_check_box_mouse2,            check_box_mouse2
  257. dd      szVersion_ch2,                  0x00000002
  258.  
  259. dd      sz_option_box_draw,             option_box_draw
  260. dd      sz_option_box_mouse,            option_box_mouse
  261. dd      szVersion_op,                   0x00000001
  262.  
  263. dd      sz_Scrollbar_ver_draw,          scroll_bar_vertical.draw
  264. dd      sz_Scrollbar_ver_mouse,         scroll_bar_vertical.mouse
  265. dd      sz_Scrollbar_hor_draw,          scroll_bar_horizontal.draw
  266. dd      sz_Scrollbar_hor_mouse,         scroll_bar_horizontal.mouse
  267. dd      szVersion_scrollbar,            0x00010001
  268.  
  269. dd      sz_Dbutton_draw,                dinamic_button.draw
  270. dd      sz_Dbutton_mouse,               dinamic_button.mouse
  271. dd      szVersion_dbutton,              0x00010001
  272.  
  273. dd      sz_Menu_bar_draw,               menu_bar.draw
  274. dd      sz_Menu_bar_mouse,              menu_bar.mouse
  275. dd      sz_Menu_bar_activate,           menu_bar.activate
  276. dd      szVersion_menu_bar,             0x00010002
  277.  
  278. dd      sz_FileBrowser_draw,            fb_draw_panel
  279. dd      sz_FileBrowser_mouse,           fb_mouse
  280. dd      sz_FileBrowser_key,             fb_key
  281. dd      szVersion_FileBrowser,          0x00010001
  282.  
  283. dd      sz_tl_data_init,                tl_data_init
  284. dd      sz_tl_data_clear,               tl_data_clear
  285. dd      sz_tl_info_clear,               tl_info_clear
  286. dd      sz_tl_key,                      tl_key
  287. dd      sz_tl_mouse,                    tl_mouse
  288. dd      sz_tl_draw,                     tl_draw
  289. dd      sz_tl_info_undo,                tl_info_undo
  290. dd      sz_tl_info_redo,                tl_info_redo
  291. dd      sz_tl_node_add,                 tl_node_add
  292. dd      sz_tl_node_set_data,            tl_node_set_data
  293. dd      sz_tl_node_get_data,            tl_node_get_data
  294. dd      sz_tl_node_delete,              tl_node_delete
  295. dd      sz_tl_cur_beg,                  tl_cur_beg
  296. dd      sz_tl_cur_next,                 tl_cur_next
  297. dd      sz_tl_cur_perv,                 tl_cur_perv
  298. dd      sz_tl_node_close_open,          tl_node_close_open
  299. dd      sz_tl_node_lev_inc,             tl_node_lev_inc
  300. dd      sz_tl_node_lev_dec,             tl_node_lev_dec
  301. dd      sz_tl_node_move_up,             tl_node_move_up
  302. dd      sz_tl_node_move_down,           tl_node_move_down
  303. dd      sz_tl_node_poi_get_info,        tl_node_poi_get_info
  304. dd      sz_tl_node_poi_get_next_info,   tl_node_poi_get_next_info
  305. dd      sz_tl_node_poi_get_data,        tl_node_poi_get_data
  306. dd      sz_tl_save_mem,                 tl_save_mem
  307. dd      sz_tl_load_mem,                 tl_load_mem
  308. dd      sz_tl_get_mem_size,             tl_get_mem_size
  309. dd      sz_tl_version_tree_list,        0x00000001
  310.  
  311. dd      sz_PathShow_prepare,            path_show.prepare
  312. dd      sz_PathShow_draw,               path_show.draw
  313. dd      szVersion_path_show,            0x00010001
  314.  
  315. dd      sz_ted_but_sumb_upper,          ted_but_sumb_upper
  316. dd      sz_ted_but_sumb_lover,          ted_but_sumb_lover
  317. dd      sz_ted_but_convert_by_table,    ted_but_convert_by_table
  318. dd      sz_ted_can_save,                ted_can_save
  319. dd      sz_ted_clear,                   ted_clear
  320. dd      sz_ted_delete,                  ted_delete
  321. dd      sz_ted_draw,                    ted_draw
  322. dd      sz_ted_init,                    ted_init
  323. dd      sz_ted_init_scroll_bars,        ted_init_scroll_bars
  324. dd      sz_ted_init_syntax_file,        ted_init_syntax_file
  325. dd      sz_ted_is_select,               ted_is_select
  326. dd      sz_ted_key,                     ted_key
  327. dd      sz_ted_mouse,                   ted_mouse
  328. dd      sz_ted_open_file,               ted_open_file
  329. dd      sz_ted_save_file,               ted_save_file
  330. dd      sz_ted_text_add,                ted_text_add
  331. dd      sz_ted_but_select_word,         ted_but_select_word
  332. dd      sz_ted_but_cut,                 ted_but_cut
  333. dd      sz_ted_but_copy,                ted_but_copy
  334. dd      sz_ted_but_paste,               ted_but_paste
  335. dd      sz_ted_but_undo,                ted_but_undo
  336. dd      sz_ted_but_redo,                ted_but_redo
  337. dd      sz_ted_but_reverse,             ted_but_reverse
  338. dd      sz_ted_but_find_next,           ted_but_find_next
  339. dd      sz_ted_text_colored,            ted_text_colored
  340. dd      sz_ted_version,                 0x00000004
  341.  
  342. dd      sz_Frame_draw,                  frame.draw
  343. dd      szVersion_frame,                0x00010001
  344.  
  345. dd sz_progressbar_draw,     progressbar_draw    
  346. dd sz_progressbar_progress, progressbar_progress
  347.  
  348. dd      0,0
  349.  
  350.  
  351. sz_init                         db 'lib_init',0
  352. sz_version                      db 'version',0
  353.  
  354. sz_edit_box                     db 'edit_box',0
  355. sz_edit_box_key                 db 'edit_box_key',0
  356. sz_edit_box_mouse               db 'edit_box_mouse',0
  357. sz_edit_box_set_text            db 'edit_box_set_text',0
  358. szVersion_ed                    db 'version_ed',0
  359.  
  360. sz_init_checkbox2               db 'init_checkbox2',0
  361. sz_check_box_draw2              db 'check_box_draw2',0
  362. sz_check_box_mouse2             db 'check_box_mouse2',0
  363. szVersion_ch2                   db 'version_ch2',0
  364.  
  365. sz_option_box_draw              db 'option_box_draw',0
  366. sz_option_box_mouse             db 'option_box_mouse',0
  367. szVersion_op                    db 'version_op',0
  368.  
  369. sz_Scrollbar_ver_draw           db 'scrollbar_v_draw',0
  370. sz_Scrollbar_ver_mouse          db 'scrollbar_v_mouse',0
  371. sz_Scrollbar_hor_draw           db 'scrollbar_h_draw',0
  372. sz_Scrollbar_hor_mouse          db 'scrollbar_h_mouse',0
  373. szVersion_scrollbar             db 'version_scrollbar',0
  374.  
  375. sz_Dbutton_draw                 db 'dbutton_draw',0
  376. sz_Dbutton_mouse                db 'dbutton_mouse',0
  377. szVersion_dbutton               db 'version_dbutton',0
  378.  
  379. sz_Menu_bar_draw                db 'menu_bar_draw',0
  380. sz_Menu_bar_mouse               db 'menu_bar_mouse',0
  381. sz_Menu_bar_activate            db 'menu_bar_activate',0
  382. szVersion_menu_bar              db 'version_menu_bar',0
  383.  
  384. sz_FileBrowser_draw             db 'FileBrowser_draw',0
  385. sz_FileBrowser_mouse            db 'FileBrowser_mouse',0
  386. sz_FileBrowser_key              db 'FileBrowser_key',0
  387. szVersion_FileBrowser           db 'version_FileBrowser',0
  388.  
  389. sz_tl_data_init                 db 'tl_data_init',0
  390. sz_tl_data_clear                db 'tl_data_clear',0
  391. sz_tl_info_clear                db 'tl_info_clear',0
  392. sz_tl_key                       db 'tl_key',0
  393. sz_tl_mouse                     db 'tl_mouse',0
  394. sz_tl_draw                      db 'tl_draw',0
  395. sz_tl_info_undo                 db 'tl_info_undo',0
  396. sz_tl_info_redo                 db 'tl_info_redo',0
  397. sz_tl_node_add                  db 'tl_node_add',0
  398. sz_tl_node_set_data             db 'tl_node_set_data',0
  399. sz_tl_node_get_data             db 'tl_node_get_data',0
  400. sz_tl_node_delete               db 'tl_node_delete',0
  401. sz_tl_cur_beg                   db 'tl_cur_beg',0
  402. sz_tl_cur_next                  db 'tl_cur_next',0
  403. sz_tl_cur_perv                  db 'tl_cur_perv',0
  404. sz_tl_node_close_open           db 'tl_node_close_open',0
  405. sz_tl_node_lev_inc              db 'tl_node_lev_inc',0
  406. sz_tl_node_lev_dec              db 'tl_node_lev_dec',0
  407. sz_tl_node_move_up              db 'tl_node_move_up',0
  408. sz_tl_node_move_down            db 'tl_node_move_down',0
  409. sz_tl_node_poi_get_info         db 'tl_node_poi_get_info',0
  410. sz_tl_node_poi_get_next_info    db 'tl_node_poi_get_next_info',0
  411. sz_tl_node_poi_get_data         db 'tl_node_poi_get_data',0
  412. sz_tl_save_mem                  db 'tl_save_mem',0
  413. sz_tl_load_mem                  db 'tl_load_mem',0
  414. sz_tl_get_mem_size              db 'tl_get_mem_size',0
  415. sz_tl_version_tree_list         db 'version_tree_list',0
  416.  
  417. sz_PathShow_prepare             db 'PathShow_prepare',0
  418. sz_PathShow_draw                db 'PathShow_draw',0
  419. szVersion_path_show             db 'version_PathShow',0
  420.  
  421. sz_ted_but_sumb_upper           db 'ted_but_sumb_upper',0
  422. sz_ted_but_sumb_lover           db 'ted_but_sumb_lover',0
  423. sz_ted_but_convert_by_table     db 'ted_but_convert_by_table',0
  424. sz_ted_can_save                 db 'ted_can_save',0
  425. sz_ted_clear                    db 'ted_clear',0
  426. sz_ted_delete                   db 'ted_delete',0
  427. sz_ted_draw                     db 'ted_draw',0
  428. sz_ted_init                     db 'ted_init',0
  429. sz_ted_init_scroll_bars         db 'ted_init_scroll_bars',0
  430. sz_ted_init_syntax_file         db 'ted_init_syntax_file',0
  431. sz_ted_is_select                db 'ted_is_select',0
  432. sz_ted_key                      db 'ted_key',0
  433. sz_ted_mouse                    db 'ted_mouse',0
  434. sz_ted_open_file                db 'ted_open_file',0
  435. sz_ted_save_file                db 'ted_save_file',0
  436. sz_ted_text_add                 db 'ted_text_add',0
  437. sz_ted_but_select_word          db 'ted_but_select_word',0
  438. sz_ted_but_cut                  db 'ted_but_cut',0
  439. sz_ted_but_copy                 db 'ted_but_copy',0
  440. sz_ted_but_paste                db 'ted_but_paste',0
  441. sz_ted_but_undo                 db 'ted_but_undo',0
  442. sz_ted_but_redo                 db 'ted_but_redo',0
  443. sz_ted_but_reverse              db 'ted_but_reverse',0
  444. sz_ted_but_find_next            db 'ted_but_find_next',0
  445. sz_ted_text_colored             db 'ted_text_colored',0
  446. sz_ted_version                  db 'version_text_edit',0
  447.  
  448. sz_Frame_draw                   db 'frame_draw',0
  449. szVersion_frame                 db 'version_frame',0
  450.  
  451. sz_progressbar_draw     db 'progressbar_draw', 0
  452. sz_progressbar_progress db 'progressbar_progress', 0