Subversion Repositories Kolibri OS

Rev

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