Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. ;--- ¤à㣨¥ ¬ ªà®áë ---
  2. include 'editbox.inc'
  3. include 'txtbut.inc'
  4. include 'gp.inc'
  5. include 'label.inc'
  6. ;include 'checkbox.inc'
  7. include 'check.inc'
  8. include 'file_sys.inc'
  9. include 'textwork.inc'
  10. ;include 'ini.inc'
  11.  
  12. lang fix ru;en
  13.  
  14. macro movr reg,val
  15. {
  16. if val < 65536
  17.         push    val
  18.         pop     reg
  19. else
  20.         mov     reg,val
  21. end if
  22. }
  23.  
  24. ;--- § £®«®¢®ª ---
  25. macro meos_header par_buf,cur_dir_buf
  26. {
  27.         use32
  28.         org     0x0
  29.  
  30.         db      'MENUET01'
  31.         dd      0x01
  32.         dd      __app_start
  33.         dd      __app_end
  34.         dd      __app_end
  35.         dd      __app_end
  36. if <par_buf> eq <>
  37.         dd      0x0
  38. else
  39.         dd      par_buf
  40. end if
  41. if <cur_dir_buf> eq <>
  42.         dd      0x0
  43. else
  44.         dd      cur_dir_buf
  45. end if
  46. }
  47.  
  48. ;--- ®¯à¥¤¥«¨âì â®çªã ¢å®¤  ---
  49. macro app_start
  50. {
  51. __app_start:
  52. }
  53.  
  54. ;--- ®¯à¥¤¥«¨âì ª®­¥æ ¯à¨«®¦¥­¨ï ¨ à §¬¥à á⥪  ---
  55. macro app_end stack_size
  56. {
  57. if <stack_size> eq <>
  58.         rb      1024
  59. else
  60.         rb      stack_size
  61. end if
  62. __app_end:
  63. }
  64.  
  65. ;--- § ¢¥àè¨âì ⥪ã騩 ¯®â®ª ---
  66. macro app_close
  67. {
  68.         xor     eax,eax
  69.         dec     eax
  70.         int     0x40
  71. }
  72.  
  73. ;--- ¯®«ãç¨âì ª®¤ ­ ¦ â®© ª« ¢¨è¨ ---
  74. macro get_key
  75. {
  76.         ;mov     eax,2
  77.         push    2
  78.         pop     eax
  79.         int     0x40
  80. }
  81.  
  82. ;--- ¯®«ãç¨âì ª®¤ ­ ¦ â®© ª­®¯ª¨ ---
  83. macro get_pressed_button
  84. {
  85.         ;mov     eax,17
  86.         push    17
  87.         pop     eax
  88.         int     0x40
  89. }
  90.  
  91. ;--- á®®¡é¨âì á¨á⥬¥ ® ­ ç «¥ ¯¥à¥à¨á®¢ª¨ ®ª­  ---
  92. macro start_draw_window
  93. {
  94.         ;mov     eax,12
  95.         push    12
  96.         pop     eax
  97.         xor     ebx,ebx
  98.         inc     ebx
  99.         int     0x40
  100. }
  101.  
  102. ;--- á®®¡é¨âì á¨á⥬¥ ® § ¢¥à襭¨¨ ¯¥à¥à¨á®¢ª¨ ®ª­  ---
  103. macro stop_draw_window
  104. {
  105.         ;mov     eax,12
  106.         push    12
  107.         pop     eax
  108.         ;mov     ebx,2
  109.         push    2
  110.         pop     ebx
  111.         int     0x40
  112. }
  113.  
  114. ;--- ãáâ ­®¢¨âì ¬ áªã ®¦¨¤ ¥¬ëå ᮡë⨩ ---
  115. macro set_events_mask mask
  116. {
  117.         ;mov     eax,40
  118.         push    40
  119.         pop     eax
  120.         ;mov     ebx,mask
  121.         push    mask
  122.         pop     ebx
  123.         int     0x40
  124. }
  125.  
  126. ;--- ¯®«ãç¨âì ¨­ä®à¬ æ¨î ® ¯à®æ¥áᥠ---
  127. macro get_procinfo proc_inf_buf,slot_num
  128. {
  129.         ;mov     eax,9
  130.         push    9
  131.         pop     eax
  132.         ;mov     ebx,proc_inf_buf
  133.         push    proc_inf_buf
  134.         pop     ebx
  135. if <slot_num> eq <>
  136.         xor     ecx,ecx
  137.         dec     ecx
  138. else
  139.         ;mov     ecx,slot_num
  140.         push    slot_num
  141.         pop     ecx
  142. end if
  143.         int     0x40
  144. }
  145.  
  146. macro get_sys_colors col_buf
  147. {
  148.         ;mov     eax,48
  149.         push    48
  150.         pop     eax
  151.         ;mov     ebx,3
  152.         push    3
  153.         pop     ebx
  154.         ;mov     ecx,col_buf
  155.         push    col_buf
  156.         pop     ecx
  157.         ;mov     edx,40
  158.         push    40
  159.         pop     edx
  160.         int     0x40
  161. }
  162.  
  163. macro get_grab_area
  164. {
  165.         movr     eax,48
  166.         movr     ebx,7
  167.         int     0x40
  168. }
  169.  
  170. macro get_scin_height
  171. {
  172.         movr     eax,48
  173.         movr     ebx,4
  174.         int     0x40
  175. }
  176.  
  177. macro min_window
  178. {
  179.         movr     eax,18
  180.         movr     ebx,10
  181.         int     0x40
  182. }
  183.  
  184. macro activ_window slot_n
  185. {
  186.         movr     eax,18
  187.         movr     ebx,3
  188. if <slot_n> eq <>
  189. else
  190.         movr     ecx,slot_n
  191. end if
  192.         int     0x40
  193. }
  194.  
  195. macro get_active_window
  196. {
  197.         movr     eax,18
  198.         movr     ebx,7
  199.         int     0x40
  200. }
  201.  
  202. macro delay time
  203. {
  204.         movr     eax,5
  205. if <time> eq <>
  206. else
  207.         movr     ebx,time
  208. end if
  209.         int     0x40
  210. }
  211.  
  212. ;--- ®¦¨¤ âì ᮡëâ¨ï ---
  213. macro wait_event redraw,key,button,mouse,ipc,other
  214. {
  215.         movr     eax,10
  216.         int     0x40
  217.         dec     ax
  218. if <redraw> eq <>
  219. else
  220.         jz      redraw
  221. end if
  222.         dec     ax
  223. if <key> eq <>
  224. else
  225.         jz      key
  226. end if
  227.         dec     ax
  228. if <button> eq <>
  229. else
  230.         jz      button
  231. end if
  232.         dec     ax
  233.         dec     ax
  234.         dec     ax
  235. if <mouse> eq <>
  236. else
  237.         jz      mouse
  238. end if
  239. if <ipc> eq <>
  240. else
  241.         dec     ax
  242.         jz      ipc
  243. end if
  244. if <other> eq <>
  245.         jmp     still
  246. else
  247.         jmp     other
  248. end if
  249. }
  250.  
  251. ;--- ¯®«ãç¨âì à §¬¥àë íªà ­  ---
  252. macro get_screen_size
  253. {
  254.         movr     eax,14
  255.         int     0x40
  256. }
  257.  
  258. macro get_screen_prop  struc_ptr
  259. {
  260.         movr     eax,61
  261.         push    eax eax
  262.         xor     ebx,ebx
  263.         inc     ebx
  264.         int     0x40
  265.         mov     [struc_ptr],eax
  266.         pop     eax
  267.         inc     ebx
  268.         int     0x40
  269.         mov     [struc_ptr+4],ax
  270.         pop     eax
  271.         inc     ebx
  272.         int     0x40
  273.         mov     [struc_ptr+6],eax
  274. }
  275.  
  276. macro resize_mem mem_size
  277. {
  278.         movr     eax,64
  279.         xor     ebx,ebx
  280.         inc     ebx
  281. if <mem_size> eq <>
  282. else
  283.         movr     ecx,mem_size
  284. end if
  285.         int     0x40
  286. }
  287.  
  288. evm_redraw equ 1
  289. evm_key equ 10b
  290. evm_button equ 100b
  291. evm_mouse equ 100000b
  292. evm_ipc equ 1000000b
  293.  
  294. struc procinfo
  295. {
  296. .takts_per_second: dd ?
  297. .window_stack_pos: dw ?
  298. .slot_number: dw ?
  299. dw ?
  300. .name: rb 11
  301. .align: db ?
  302. .addres: dd ?
  303. .use_mem: dd ?
  304. .pid: dd ?
  305. .left: dd ?
  306. .top: dd ?
  307. .width: dd ?
  308. .height: dd ?
  309. .slot_state: dw ?
  310. rb (1024-56)
  311. }
  312.  
  313. struc sys_color_table
  314. {
  315. .frames: dd ?  ;+0
  316. .grab: dd ?    ;+4
  317. .grab_button: dd ? ;+8
  318. .grab_button_text: dd ?  ;+12
  319. .grab_text: dd ?  ;+16
  320. .work: dd ?       ;+20
  321. .work_button: dd ?;+24
  322. .work_button_text: dd ? ;+28
  323. .work_text: dd ?        ;+32
  324. .work_graph: dd ?       ;+36
  325. }
  326.  
  327. struc screen_size
  328. {
  329. .height: dw ?
  330. .width: dw ?
  331. }
  332.  
  333. struc screen_prop
  334. {
  335. .height: dw ? ;+0
  336. .width: dw ?  ;+2
  337. .bitspp: dw ? ;+4
  338. .bytesps: dd ?;+6
  339. }
  340.  
  341. struc ipc_buffer size
  342. {
  343. .block: dd ?
  344. .in_use: dd ?
  345. .messages: rb size
  346. }
  347.  
  348. ;--- æ¢¥â  ---
  349. cl_white=0xffffff
  350. cl_black=0x000000