Subversion Repositories Kolibri OS

Rev

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