Subversion Repositories Kolibri OS

Rev

Rev 9876 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.     use32
  2.     org     0x0
  3. ;-------------------------------------------------------------------------------
  4.     db        "MENUET01"
  5.     dd        1, main, __dataend, __memend, __stackend, 0, sys_path
  6. ;-------------------------------------------------------------------------------
  7.     include "../../../macros.inc"
  8.     include "../../../proc32.inc"
  9.     include "../../../dll.inc"
  10.     include "../../../KOSfuncs.inc"
  11.     include "../../../load_lib.mac"
  12.     ;include "../../../debug.inc"
  13.  
  14.     include "DATA.INC"
  15.     include "NAME.INC"
  16.  
  17.     @use_library \
  18.         mem.Alloc, mem.Free, mem.ReAlloc, dll.Load
  19. ;================================================================================
  20.  
  21. main:
  22. ; ==== Init ====
  23.     mcall   SF_SYS_MISC, SSF_HEAP_INIT
  24.     mcall   SF_STYLE_SETTINGS, SSF_GET_COLORS, sc, sizeof.system_colors
  25.     call    LOAD_ICONS
  26.  
  27.     mcall   SF_SYSTEM, SSF_GET_ACTIVE_WINDOW
  28.     mov     [win.psid], eax
  29.  
  30.     mcall   SF_SET_EVENTS_MASK, EVM_REDRAW+EVM_BUTTON+EVM_MOUSE ;+EVM_DEKSTOP to update colors on skin change
  31.    
  32. ; ==== Load libs ====
  33.     load_libraries load_lib_start, load_lib_end
  34.  
  35. ; ==== Config LibINI ====
  36.     invoke  ini.get_int, ini_data.file_name, ini_data.settings_name, ini_data.location_name, 2
  37.     test    eax,eax
  38.     jz      exit
  39.     mov     [dock_items.location], eax
  40.     invoke  ini.get_int, ini_data.file_name, ini_data.settings_name, ini_data.fsize_name, 0
  41.     mov     [dock_items.fsize], eax
  42.     invoke  ini.get_int, ini_data.file_name, ini_data.settings_name, ini_data.ashow_name, 0
  43.     mov     [dock_items.ashow], eax
  44.  
  45.     invoke  ini.sections, ini_data.file_name, sections_callback
  46.  
  47. ; ==== Config window ====
  48.     mov     eax, dword[dock_items.location]
  49.     and     eax, 1b
  50.     cmp     eax, 0
  51.     je      .vert
  52.     jmp     .setshape
  53.  
  54.  .vert:
  55.     mov     byte[win.isvert], 1
  56.  
  57.  .setshape:
  58.     cmp     byte[win.isvert], 1
  59.     je      .vert_sp
  60.  
  61.  .horz_sp:
  62.     call    .HORZ_WIDTH
  63.     call    .HORZ_X
  64.     call    .HORZ_HEIGHT
  65.     cmp     dword[dock_items.location], 1
  66.     je      .settop
  67.  
  68.  .setbottom:
  69.     call    .HORZ_Y_BOTTOM
  70.     jmp     .SETDEF
  71.  
  72.  .settop:
  73.     call    .HORZ_Y_TOP
  74.     jmp     .SETDEF
  75.  
  76.  
  77.  .vert_sp:
  78.     call    .VERT_WIDTH
  79.     call    .VERT_HEIGHT
  80.     call    .VERT_Y
  81.     cmp     dword[dock_items.location], 2
  82.     je      .setleft
  83.  
  84.  .setright:
  85.     call    .VERT_X_RIGHT
  86.     jmp     .SETDEF
  87.  
  88.  .setleft:
  89.     call    .VERT_X_LEFT
  90.     jmp     .SETDEF
  91.  
  92. ;-------------------------------------------------------------------------------
  93.  .HORZ_WIDTH:
  94.     cmp     [dock_items.fsize], byte 1
  95.     je      @f
  96.     mov     eax, BUTTON_SIZE
  97.     mov     ebx, [dock_items.count]
  98.     imul    eax, ebx
  99.     add     eax, 24
  100.     dec     eax
  101.     jmp     .set_hw
  102.   @@:
  103.     mcall   SF_GET_SCREEN_SIZE
  104.     shr     eax, 16
  105.  .set_hw:
  106.     mov     [win.w_opn], eax
  107.     mov     [win.w_hdn], eax
  108.  
  109.     ret
  110.  
  111. ;-------------------------------------------------------------------------------
  112.  .HORZ_X:
  113.     mcall   SF_GET_SCREEN_SIZE
  114.     shr     eax, 17
  115.     mov     ecx, [win.w_opn]
  116.     shr     ecx, 1
  117.     sub     eax, ecx
  118.     mov     [win.x_opn], eax
  119.     mov     [win.x_hdn], eax
  120.  
  121.     ret
  122.  
  123. ;-------------------------------------------------------------------------------
  124.  .HORZ_HEIGHT:
  125.     mov     dword[win.h_hdn], 3
  126.     mov     dword[win.h_opn], BUTTON_SIZE
  127.  
  128.     ret
  129.  
  130. ;-------------------------------------------------------------------------------
  131.  .HORZ_Y_BOTTOM:
  132.     mcall   SF_GET_SCREEN_SIZE
  133.     and     eax, 0xFFFF
  134.     dec     eax
  135.     mov     [win.y_hdn], eax
  136.     sub     eax, 43
  137.     mov     [win.y_opn], eax
  138.  
  139.     ret
  140.  
  141.  .HORZ_Y_TOP:
  142.     mov     dword[win.y_opn], 0
  143.     mov     dword[win.y_hdn], 0
  144.  
  145.     ret
  146.  
  147. ;-------------------------------------------------------------------------------
  148.  .VERT_WIDTH:
  149.     mov     dword[win.w_opn], BUTTON_SIZE
  150.     mov     dword[win.w_hdn], 3
  151.  
  152.     ret
  153.  
  154. ;-------------------------------------------------------------------------------
  155.  .VERT_X_LEFT:
  156.     mov     dword[win.x_opn], 0
  157.     mov     dword[win.x_hdn], 0
  158.  
  159.     ret
  160.  
  161.  .VERT_X_RIGHT:
  162.     mcall   SF_GET_SCREEN_SIZE
  163.     and     eax, 0xFFFF0000
  164.     shr     eax, 16
  165.     mov     [win.x_hdn], eax
  166.     sub     eax, BUTTON_SIZE
  167.     mov     [win.x_opn], eax
  168.  
  169.     ret
  170.  
  171. ;-------------------------------------------------------------------------------
  172.  .VERT_HEIGHT:
  173.     cmp     [dock_items.fsize], byte 1
  174.     je      @f
  175.     mov     eax, BUTTON_SIZE
  176.     mov     ebx, [dock_items.count]
  177.     imul    eax, ebx
  178.     dec     eax
  179.     jmp     .set_vh
  180.   @@:
  181.     mcall   SF_GET_SCREEN_SIZE
  182.     and     eax, 0xFFFF
  183.  .set_vh:
  184.     mov     [win.h_opn], eax
  185.     mov     [win.h_hdn], eax
  186.  
  187.     ret
  188.  
  189. ;-------------------------------------------------------------------------------
  190.  .VERT_Y:
  191.     mcall   SF_GET_SCREEN_SIZE
  192.     and     eax, 0xFFFF
  193.     shr     eax, 1
  194.  
  195.     mov     esi, [win.h_opn]
  196.     shr     esi, 1
  197.     sub     eax, esi
  198.  
  199.     mov     [win.y_hdn], eax
  200.     mov     [win.y_opn], eax
  201.  
  202.     ret
  203.  
  204. ;-------------------------------------------------------------------------------
  205.  .SETDEF:
  206.     mov     eax, [win.w_hdn]
  207.     mov     [win.w], eax
  208.  
  209.     mov     eax, [win.x_hdn]
  210.     mov     [win.x], eax
  211.  
  212.     mov     eax, [win.h_hdn]
  213.     mov     [win.h], eax
  214.  
  215.     mov     eax, [win.y_hdn]
  216.     mov     [win.y], eax
  217.    
  218.     cmp     byte[dock_items.ashow],1
  219.     jne     .not_ashow
  220.  
  221.     mov     eax, [win.w_opn]
  222.     mov     [win.w], eax
  223.  
  224.     mov     eax, [win.x_opn]
  225.     mov     [win.x], eax
  226.  
  227.     mov     eax, [win.h_opn]
  228.     mov     [win.h], eax
  229.  
  230.     mov     eax, [win.y_opn]
  231.     mov     [win.y], eax
  232.  
  233.  .not_ashow:
  234.  
  235.  
  236. ;-------------------------------------------------------------------------------
  237. ; ==== START ====
  238.     mcall   SF_THREAD_INFO, win.procinfo, -1
  239.     mov     ecx, [win.procinfo + 30]
  240.     mcall   SF_SYSTEM, SSF_GET_THREAD_SLOT
  241.     and     eax, 0xFFFF
  242.     mov     [win.sid], eax
  243.  
  244.     call    main_loop
  245. ;-------------------------------------------------------------------------------
  246. exit:
  247.     mcall   SF_SYSTEM, SSF_TERMINATE_THREAD, [nwin.sid]
  248.     mcall   SF_TERMINATE_PROCESS
  249. ;-------------------------------------------------------------------------------
  250. error_exit:
  251.     push    .notify
  252.     dec     esp
  253.     push    0
  254.     push    0
  255.     push    .error_message
  256.     push    0
  257.     push    SSF_START_APP
  258.  
  259.     mcall   SF_FILE, esp
  260.     add     esp, 6*4 + 1
  261.     mcall   SF_SYSTEM, SSF_TERMINATE_THREAD, [nwin.sid]
  262.     mcall   SF_TERMINATE_PROCESS
  263. .error_message:
  264.     db  '"@DOCKY\nError load @RESHARE" -tdE',0
  265. .notify:
  266.     db  '/sys/@notify',0
  267. ;-------------------------------------------------------------------------------
  268. align 4
  269. main_loop:
  270.     mcall   SF_WAIT_EVENT
  271.  
  272.     cmp     eax, EV_REDRAW
  273.     je      event_redraw
  274.  
  275.     cmp     eax, EV_BUTTON
  276.     je      event_button
  277.  
  278.     cmp     eax, EV_MOUSE
  279.     je      event_mouse
  280.  
  281.     jmp     main_loop
  282. ;-------------------------------------------------------------------------------
  283. event_redraw:
  284.     call    DRAW_WINDOW
  285.     jmp     main_loop
  286. ;-------------------------------------------------------------------------------
  287. DRAW_WINDOW:
  288.     mcall   SF_REDRAW, SSF_BEGIN_DRAW
  289.    
  290.     push    dword [sc.work]
  291.     mcall   SF_STYLE_SETTINGS, SSF_GET_COLORS, sc, sizeof.system_colors
  292.     pop     eax
  293.     cmp     dword [sc.work], eax
  294.     je      @f
  295.     call    LOAD_ICONS
  296.   @@:
  297.     mov     esi, [sc.work]
  298.     or        esi, 0x01000000
  299.     mcall   SF_CREATE_WINDOW, <[win.x], [win.w]>, <[win.y], [win.h]>, [sc.work], , [sc.work_dark]
  300.  
  301.     xor     edi, edi
  302.   @@:
  303.     cmp     edi, [dock_items.count]
  304.     je        @f
  305.  
  306.     push    edi
  307.     mov     eax, SF_DEFINE_BUTTON
  308.     mov     edx, 0x60000002
  309.     mov     esi, [sc.work]
  310.     imul    edi, BUTTON_SIZE
  311.     add     edi, 12
  312.     shl     edi, 16
  313.     add     edi, BUTTON_SIZE
  314.     cmp     byte[win.isvert], 1
  315.     je        .vert_btn
  316.     mcall   , edi, <0, BUTTON_SIZE>
  317.     jmp     .endbtn
  318.  .vert_btn:
  319.     sub     edi, 12 shl 16
  320.     mcall   , <0, BUTTON_SIZE>, edi
  321.  .endbtn:
  322.     pop     edi
  323.  
  324.     cmp     byte[dock_items.separator + edi], 1
  325.     jne     .end_separator
  326.  
  327.  .draw_separator:
  328.     push    ebx
  329.     push    ecx
  330.  
  331.     mov     eax, SF_DRAW_RECT
  332.     mov     ebx, edi
  333.     imul    ebx, BUTTON_SIZE
  334.     add     ebx, BUTTON_SIZE
  335.     add     ebx, 12-1
  336.     shl     ebx, 16
  337.     add     ebx, 2
  338.  
  339.     cmp     byte[win.isvert], 1
  340.     je      .vert_draw_sep
  341.     mcall   , , <4,  36>, [sc.work_dark]
  342.     jmp     .end_inner_sep
  343.  .vert_draw_sep:
  344.     sub     ebx, 12 shl 16
  345.     mov     ecx, ebx
  346.     mcall   , <4, 36>, , [sc.work_dark]
  347.  .end_inner_sep:
  348.     pop     ecx
  349.     pop     ebx
  350.  .end_separator:
  351.  
  352.     cmp     byte[win.isvert], 1
  353.     je        .vert_dig
  354.     mov     edx, ebx
  355.     and     edx, 0xFFFF0000
  356.     add     edx, 0x00060006
  357.     jmp     .digend
  358.  .vert_dig:
  359.     mov     edx, ecx
  360.     and     edx, 0xFFFF0000
  361.     shr     edx, 16
  362.     add     edx, 0x00060006
  363.  .digend:
  364.  
  365.     imul    ebx, edi, 4
  366.     add     ebx, dock_items.icon
  367.     mov     ebx, [ebx]
  368.  
  369.     push    edi
  370.     imul    ebx, 32*32*4
  371.     add     ebx, [icons_inactive]
  372.     mcall   SF_PUT_IMAGE_EXT, , <32, 32>, , 32, 0, 0
  373.     pop     edi
  374.  
  375.     inc     edi
  376.     jmp     @b
  377.   @@:
  378.  
  379.     mcall   SF_REDRAW, SSF_END_DRAW
  380.  
  381.     ret
  382. ;-------------------------------------------------------------------------------
  383. event_button:
  384.     mcall   SF_GET_BUTTON
  385.  
  386.     ;; it must not be possible to close dock
  387.     ;cmp     ah, 1
  388.     ;je        .button_close
  389.  
  390.     cmp     ah, 2
  391.     je      .button_dock
  392.  
  393.     jmp     @f
  394.  
  395.  ;.button_close:
  396.  ;   jmp     exit
  397.  
  398.  .button_dock:
  399.     mov     edi, [win.btn_index]
  400.     imul    edi, 256
  401.  
  402.     mov     dword[fi.p00], SSF_START_APP
  403.  
  404.     mov     esi, edi
  405.     add     esi, dock_items.path
  406.     mov     dword[fi.p21], esi
  407.  
  408.     mov     esi, edi
  409.     add     esi, dock_items.param
  410.     mov     dword[fi.p08], esi
  411.  
  412.     mcall   SF_FILE, fi
  413.  
  414.     mov     ecx, eax
  415.     mcall   SF_SYSTEM, SSF_GET_THREAD_SLOT
  416.     and     eax, 0xFFFF
  417.     mov     [win.psid], eax
  418.  
  419.     jmp     wnd_hide
  420.  
  421.   @@:
  422.     jmp     main_loop
  423. ;-------------------------------------------------------------------------------
  424. event_mouse:
  425.   ; ==== IS MOUSE INNER ====
  426.     mcall   SF_MOUSE_GET, SSF_WINDOW_POSITION
  427.     mov     edi, eax
  428.     mov     esi, eax
  429.     shr     edi, 16
  430.     and     esi, 0xFFFF
  431.  
  432.     cmp     edi, 0
  433.     jl        wnd_hide
  434.     dec     edi
  435.     cmp     edi, [win.w]
  436.     jg        wnd_hide
  437.     cmp     esi, 0
  438.     jl        wnd_hide
  439.     dec     esi
  440.     cmp     esi, [win.h]
  441.     jg        wnd_hide
  442.  
  443.   ; ==== COUNT INDEX ====
  444.  
  445.     mov     eax, [dock_items.location]
  446.     and     eax, 1b
  447.     cmp     eax, 1
  448.     jne     .vert
  449.     mov     eax, edi
  450.     jmp     .nxt
  451.  
  452.  .vert:
  453.     mov     eax, esi
  454.     add     eax, 12
  455.  
  456.  .nxt:
  457.     sub     eax, 12
  458.     mov     edx, 0
  459.     mov     ebx, BUTTON_SIZE
  460.     div     ebx
  461.  
  462.     cmp     eax, [dock_items.count]
  463.     jge     .set0
  464.     jmp     .nxtcmp
  465.  
  466.  .set0:
  467.     mov     eax, 100
  468.  
  469.  .nxtcmp:
  470.     cmp     [win.btn_index], eax
  471.     je        .nxt2
  472.  
  473.     push    dword[win.btn_index]
  474.     pop     dword[win.prev_index]
  475.  
  476.     mov     [win.btn_index], eax
  477.  
  478.  ; ==== DRAW SELECTION ====
  479.     call    DRAW_SELECTION
  480.  
  481.  .nxt2:
  482.     mov     eax, [win.btn_index]
  483.     imul    eax, BUTTON_SIZE
  484.     cmp     byte[win.isvert], 1
  485.     je        .vert_name
  486.     add     eax, [win.x]
  487.     mov     [nwin.x], eax
  488.     mov     byte[nwin.swap_shape], 1
  489.     mcall   SF_DRAW_RECT, <0, [win.w]>, <[win.h], 1>, [sc.work_dark]
  490.     jmp     .vert_end
  491.  .vert_name:
  492.     add     eax, [win.y]
  493.     add     eax, 14
  494.     mov     [nwin.y], eax
  495.     mov     byte[nwin.swap_shape], 1
  496.     mcall   SF_DRAW_RECT, <[win.w], 1>, <0, [win.h]>, [sc.work_dark]
  497.  .vert_end:
  498.  
  499.  ; ==== OPEN/CLOSE WINDOW ====
  500.     cmp     byte[win.state], 1
  501.     je        main_loop
  502.  
  503.     mov     edx, esp
  504.     add     edx, 512
  505.     mcall   SF_CREATE_THREAD, 1, n_main
  506.  
  507.     mcall   SF_SYSTEM, SSF_GET_ACTIVE_WINDOW
  508.     mov     [win.psid], eax
  509.  
  510.     mcall   SF_SYSTEM, SSF_FOCUS_WINDOW, [win.sid]
  511.  
  512.     mov     byte[win.state], 1
  513.  
  514.     m2m     dword [win.x], dword [win.x_opn]
  515.     m2m     dword [win.y], dword [win.y_opn]
  516.     m2m     dword [win.w], dword [win.w_opn]
  517.     m2m     dword [win.h], dword [win.h_opn]
  518.  
  519.     cmp     byte[dock_items.ashow],1
  520.     je       .change_nothing
  521.     mcall   SF_CHANGE_WINDOW, [win.x], [win.y], [win.w], [win.h]
  522.  
  523.   .change_nothing:
  524.     call    DRAW_WINDOW
  525.     call    DRAW_SELECTION
  526.     jmp     main_loop
  527.  
  528. ;-------------------------------------------------------------------------------
  529. wnd_hide:
  530.     cmp     byte[win.state], 0
  531.     je        main_loop
  532.  
  533.     mov     byte[nwin.close], 1
  534.  
  535.     mcall   SF_SYSTEM, SSF_FOCUS_WINDOW, [win.psid]
  536.  
  537.     mov     byte[win.state], 0
  538.     mov     byte[win.btn_index], -1
  539.  
  540.     cmp     byte[dock_items.ashow],1
  541.     je       .do_no_hide
  542.  
  543.     m2m     dword [win.x], dword [win.x_hdn]
  544.     m2m     dword [win.y], dword [win.y_hdn]
  545.     m2m     dword [win.w], dword [win.w_hdn]
  546.     m2m     dword [win.h], dword [win.h_hdn]
  547.  
  548.     mcall   SF_CHANGE_WINDOW, [win.x], [win.y], [win.w], [win.h]
  549.  
  550.   .do_no_hide:
  551.     call    DRAW_WINDOW
  552.     jmp     main_loop
  553. ;-------------------------------------------------------------------------------
  554. DRAW_SELECTION:
  555.     mov     ebx, [win.prev_index]
  556.     imul    ebx, BUTTON_SIZE
  557.     add     ebx, 14
  558.     shl     ebx, 16
  559.     add     ebx, 40
  560.     mov     ecx, 0x00020028
  561.  
  562.     cmp     byte[win.isvert], 1
  563.     jne     @f
  564.     xchg    ebx, ecx
  565.     sub     ecx, 0x000C0000
  566.   @@:
  567.  
  568.     mcall   SF_DRAW_RECT, , , [sc.work]
  569.  
  570.     mov     edx, ebx
  571.     shr     ecx, 16
  572.     mov     dx,  cx
  573.     add     edx, 0x00040004
  574.  
  575.     mov     ebx, [win.prev_index]
  576.     imul    ebx, 4
  577.     add     ebx, dock_items.icon
  578.     mov     ebx, [ebx]
  579.     imul    ebx, 32*32*4
  580.     add     ebx, [icons_inactive]
  581.     mcall   SF_PUT_IMAGE_EXT, , <32, 32>, , 32, 0, 0
  582.  
  583.     mov     ebx, [win.btn_index]
  584.     imul    ebx, BUTTON_SIZE
  585.     add     ebx, 14
  586.     shl     ebx, 16
  587.     add     ebx, 40
  588.     mov     ecx, 0x00020028
  589.  
  590.     cmp     byte[win.isvert], 1
  591.     jne     @f
  592.     xchg    ebx, ecx
  593.     sub     ecx, 0x000C0000
  594.   @@:
  595.  
  596.     mcall   SF_DRAW_RECT, , , [sc.work_button]
  597.  
  598.     mov     edx, ebx
  599.     shr     ecx, 16
  600.     mov     dx, cx
  601.     add     edx, 0x00040004
  602.  
  603.     mov     ebx, [win.btn_index]
  604.     imul    ebx, 4
  605.     add     ebx, dock_items.icon
  606.     mov     ebx, [ebx]
  607.     imul    ebx, 32*32*4
  608.     add     ebx, [icons_active]
  609.     mcall   SF_PUT_IMAGE_EXT, , <32, 32>, , 32, 0, 0
  610.    
  611.     ret
  612. ;-------------------------------------------------------------------------------
  613. proc icon32cpy uses ecx edx edi esi, dest:dword, src:dword, len:dword, bgcol:dword
  614.     mov     edi, [dest]
  615.     mov     esi, [src]
  616.     mov     ecx, [len]
  617.     mov     edx, [bgcol]
  618. .loop:
  619.     m2m     dword [edi], dword [esi]
  620.     cmp     dword [edi], 0
  621.     jne     @f
  622.     mov     dword [edi], edx
  623.    @@:
  624.     add     edi, 4
  625.     add     esi, 4
  626.     sub     ecx, 4
  627.     cmp     ecx, 4
  628.     jg      .loop
  629.  
  630.     ret
  631. endp
  632. ;-------------------------------------------------------------------------------
  633. LOAD_ICONS:
  634.     mov     esi, 0 ; esi is a counter of mem_open attempts
  635.     mov     edi, esi
  636.   @@:
  637.     ; try to open shr memory, if failed then make 5 attempts more
  638.     mcall   SF_SYS_MISC, SSF_MEM_OPEN,icons_resname ; 0 = SHM_READ
  639.  
  640.     cmp     eax,0
  641.     jne     @f
  642.     inc     edi
  643.     cmp     edi,10
  644.     je      error_exit
  645.     mcall   SF_SLEEP, 70
  646.     jmp     @b
  647.   @@:
  648.     mov     [shr_icons_ptr], eax
  649.     mov     [shr_icons_len], edx
  650.    
  651.     mcall   SF_SYS_MISC, SSF_MEM_FREE,  [icons_active]
  652.     mcall   SF_SYS_MISC, SSF_MEM_ALLOC, [shr_icons_len]
  653.     mov     [icons_active], eax
  654.    
  655.     mcall   SF_SYS_MISC, SSF_MEM_FREE,  [icons_inactive]
  656.     mcall   SF_SYS_MISC, SSF_MEM_ALLOC, [shr_icons_len]
  657.     mov     [icons_inactive], eax  
  658.    
  659.     stdcall icon32cpy, [icons_inactive], [shr_icons_ptr], [shr_icons_len], [sc.work]
  660.     stdcall icon32cpy, [icons_active],   [shr_icons_ptr], [shr_icons_len], [sc.work_button]
  661.    
  662.     mcall   SF_SYS_MISC, SSF_MEM_CLOSE,icons_resname
  663.    
  664.     ret
  665. ;-------------------------------------------------------------------------------
  666. proc sections_callback, _file_name, _section_name
  667.     mov     eax, [_section_name]
  668.     cmp     byte[eax], '@'
  669.     jne     @f
  670.  
  671.     dec     dword[dock_items.count]
  672.     jmp     .endproc
  673.  
  674.   @@:
  675.     ; ==== GET NAME ====
  676.     mov     ebx, [dock_items.count]
  677.     imul    ebx, 16
  678.     add     ebx, dock_items.name
  679.  
  680.     mov     eax, [_section_name]
  681.  
  682.     mov     edi, 0
  683.   @@:
  684.     mov     cl, byte[eax]
  685.     mov     byte[ebx + edi], cl
  686.  
  687.     inc     eax
  688.     inc     edi
  689.     cmp     edi, 10
  690.     jne     @b
  691.  
  692.   ; ==== GET PATH ====
  693.     mov     ebx, [dock_items.count]
  694.     imul    ebx, 256
  695.     add     ebx, dock_items.path
  696.  
  697.     invoke  ini.get_str, [_file_name], [_section_name], ini_data.path_name, ebx, 256, 0
  698.  
  699.   ; === GET  PARAM ===
  700.     mov     ebx, [dock_items.count]
  701.     imul    ebx, 256
  702.     add     ebx, dock_items.param
  703.  
  704.     invoke  ini.get_str, [_file_name], [_section_name], ini_data.param_name, ebx, 256, 0
  705.  
  706.   ; ==== GET ICON ====
  707.     invoke  ini.get_int, [_file_name], [_section_name], ini_data.icon_name, 0
  708.  
  709.     mov     ebx, [dock_items.count]
  710.     imul    ebx, 4
  711.     mov     [dock_items.icon + ebx], eax
  712.  
  713.   ; ==== GET SEPARATOR ====
  714.     invoke  ini.get_int, [_file_name], [_section_name], ini_data.separator_name, 0
  715.  
  716.     mov     ebx, [dock_items.count]
  717.     mov     byte[dock_items.separator + ebx], al
  718.  
  719.   ; ====== END =======
  720.  .endproc:
  721.     mov     eax, 1
  722.     inc     dword[dock_items.count]
  723.     ret
  724. endp
  725. ;-------------------------------------------------------------------------------
  726.     include "MEMORY.INC"