Subversion Repositories Kolibri OS

Rev

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