Subversion Repositories Kolibri OS

Rev

Rev 9444 | Rev 9876 | Go to most recent revision | 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. align 4
  251. main_loop:
  252.     mcall   SF_WAIT_EVENT
  253.  
  254.     cmp     eax, EV_REDRAW
  255.     je      event_redraw
  256.  
  257.     cmp     eax, EV_BUTTON
  258.     je      event_button
  259.  
  260.     cmp     eax, EV_MOUSE
  261.     je      event_mouse
  262.  
  263.     jmp     main_loop
  264. ;-------------------------------------------------------------------------------
  265. event_redraw:
  266.     call    DRAW_WINDOW
  267.     jmp     main_loop
  268. ;-------------------------------------------------------------------------------
  269. DRAW_WINDOW:
  270.     mcall   SF_REDRAW, SSF_BEGIN_DRAW
  271.    
  272.     push    dword [sc.work]
  273.     mcall   SF_STYLE_SETTINGS, SSF_GET_COLORS, sc, sizeof.system_colors
  274.     pop     eax
  275.     cmp     dword [sc.work], eax
  276.     je      @f
  277.     call    LOAD_ICONS
  278.   @@:
  279.     mov     esi, [sc.work]
  280.     or        esi, 0x01000000
  281.     mcall   SF_CREATE_WINDOW, <[win.x], [win.w]>, <[win.y], [win.h]>, [sc.work], , [sc.work_dark]
  282.  
  283.     xor     edi, edi
  284.   @@:
  285.     cmp     edi, [dock_items.count]
  286.     je        @f
  287.  
  288.     push    edi
  289.     mov     eax, SF_DEFINE_BUTTON
  290.     mov     edx, 0x60000002
  291.     mov     esi, [sc.work]
  292.     imul    edi, BUTTON_SIZE
  293.     add     edi, 12
  294.     shl     edi, 16
  295.     add     edi, BUTTON_SIZE
  296.     cmp     byte[win.isvert], 1
  297.     je        .vert_btn
  298.     mcall   , edi, <0, BUTTON_SIZE>
  299.     jmp     .endbtn
  300.  .vert_btn:
  301.     sub     edi, 12 shl 16
  302.     mcall   , <0, BUTTON_SIZE>, edi
  303.  .endbtn:
  304.     pop     edi
  305.  
  306.     cmp     byte[dock_items.separator + edi], 1
  307.     jne     .end_separator
  308.  
  309.  .draw_separator:
  310.     push    ebx
  311.     push    ecx
  312.  
  313.     mov     eax, SF_DRAW_RECT
  314.     mov     ebx, edi
  315.     imul    ebx, BUTTON_SIZE
  316.     add     ebx, BUTTON_SIZE
  317.     add     ebx, 12-1
  318.     shl     ebx, 16
  319.     add     ebx, 2
  320.  
  321.     cmp     byte[win.isvert], 1
  322.     je      .vert_draw_sep
  323.     mcall   , , <4,  36>, [sc.work_dark]
  324.     jmp     .end_inner_sep
  325.  .vert_draw_sep:
  326.     sub     ebx, 12 shl 16
  327.     mov     ecx, ebx
  328.     mcall   , <4, 36>, , [sc.work_dark]
  329.  .end_inner_sep:
  330.     pop     ecx
  331.     pop     ebx
  332.  .end_separator:
  333.  
  334.     cmp     byte[win.isvert], 1
  335.     je        .vert_dig
  336.     mov     edx, ebx
  337.     and     edx, 0xFFFF0000
  338.     add     edx, 0x00060006
  339.     jmp     .digend
  340.  .vert_dig:
  341.     mov     edx, ecx
  342.     and     edx, 0xFFFF0000
  343.     shr     edx, 16
  344.     add     edx, 0x00060006
  345.  .digend:
  346.  
  347.     imul    ebx, edi, 4
  348.     add     ebx, dock_items.icon
  349.     mov     ebx, [ebx]
  350.  
  351.     push    edi
  352.     imul    ebx, 32*32*4
  353.     add     ebx, [icons_inactive]
  354.     mcall   SF_PUT_IMAGE_EXT, , <32, 32>, , 32, 0, 0
  355.     pop     edi
  356.  
  357.     inc     edi
  358.     jmp     @b
  359.   @@:
  360.  
  361.     mcall   SF_REDRAW, SSF_END_DRAW
  362.  
  363.     ret
  364. ;-------------------------------------------------------------------------------
  365. event_button:
  366.     mcall   SF_GET_BUTTON
  367.  
  368.     ;; it must not be possible to close dock
  369.     ;cmp     ah, 1
  370.     ;je        .button_close
  371.  
  372.     cmp     ah, 2
  373.     je      .button_dock
  374.  
  375.     jmp     @f
  376.  
  377.  ;.button_close:
  378.  ;   jmp     exit
  379.  
  380.  .button_dock:
  381.     mov     edi, [win.btn_index]
  382.     imul    edi, 256
  383.  
  384.     mov     dword[fi.p00], SSF_START_APP
  385.  
  386.     mov     esi, edi
  387.     add     esi, dock_items.path
  388.     mov     dword[fi.p21], esi
  389.  
  390.     mov     esi, edi
  391.     add     esi, dock_items.param
  392.     mov     dword[fi.p08], esi
  393.  
  394.     mcall   SF_FILE, fi
  395.  
  396.     mov     ecx, eax
  397.     mcall   SF_SYSTEM, SSF_GET_THREAD_SLOT
  398.     and     eax, 0xFFFF
  399.     mov     [win.psid], eax
  400.  
  401.     jmp     wnd_hide
  402.  
  403.   @@:
  404.     jmp     main_loop
  405. ;-------------------------------------------------------------------------------
  406. event_mouse:
  407.   ; ==== IS MOUSE INNER ====
  408.     mcall   SF_MOUSE_GET, SSF_WINDOW_POSITION
  409.     mov     edi, eax
  410.     mov     esi, eax
  411.     shr     edi, 16
  412.     and     esi, 0xFFFF
  413.  
  414.     cmp     edi, 0
  415.     jl        wnd_hide
  416.     dec     edi
  417.     cmp     edi, [win.w]
  418.     jg        wnd_hide
  419.     cmp     esi, 0
  420.     jl        wnd_hide
  421.     dec     esi
  422.     cmp     esi, [win.h]
  423.     jg        wnd_hide
  424.  
  425.   ; ==== COUNT INDEX ====
  426.  
  427.     mov     eax, [dock_items.location]
  428.     and     eax, 1b
  429.     cmp     eax, 1
  430.     jne     .vert
  431.     mov     eax, edi
  432.     jmp     .nxt
  433.  
  434.  .vert:
  435.     mov     eax, esi
  436.     add     eax, 12
  437.  
  438.  .nxt:
  439.     sub     eax, 12
  440.     mov     edx, 0
  441.     mov     ebx, BUTTON_SIZE
  442.     div     ebx
  443.  
  444.     cmp     eax, [dock_items.count]
  445.     jge     .set0
  446.     jmp     .nxtcmp
  447.  
  448.  .set0:
  449.     mov     eax, 100
  450.  
  451.  .nxtcmp:
  452.     cmp     [win.btn_index], eax
  453.     je        .nxt2
  454.  
  455.     push    dword[win.btn_index]
  456.     pop     dword[win.prev_index]
  457.  
  458.     mov     [win.btn_index], eax
  459.  
  460.  ; ==== DRAW SELECTION ====
  461.     call    DRAW_SELECTION
  462.  
  463.  .nxt2:
  464.     mov     eax, [win.btn_index]
  465.     imul    eax, BUTTON_SIZE
  466.     cmp     byte[win.isvert], 1
  467.     je        .vert_name
  468.     add     eax, [win.x]
  469.     mov     [nwin.x], eax
  470.     mov     byte[nwin.swap_shape], 1
  471.     mcall   SF_DRAW_RECT, <0, [win.w]>, <[win.h], 1>, [sc.work_dark]
  472.     jmp     .vert_end
  473.  .vert_name:
  474.     add     eax, [win.y]
  475.     add     eax, 14
  476.     mov     [nwin.y], eax
  477.     mov     byte[nwin.swap_shape], 1
  478.     mcall   SF_DRAW_RECT, <[win.w], 1>, <0, [win.h]>, [sc.work_dark]
  479.  .vert_end:
  480.  
  481.  ; ==== OPEN/CLOSE WINDOW ====
  482.     cmp     byte[win.state], 1
  483.     je        main_loop
  484.  
  485.     mov     edx, esp
  486.     add     edx, 512
  487.     mcall   SF_CREATE_THREAD, 1, n_main
  488.  
  489.     mcall   SF_SYSTEM, SSF_GET_ACTIVE_WINDOW
  490.     mov     [win.psid], eax
  491.  
  492.     mcall   SF_SYSTEM, SSF_FOCUS_WINDOW, [win.sid]
  493.  
  494.     mov     byte[win.state], 1
  495.  
  496.     m2m     dword [win.x], dword [win.x_opn]
  497.     m2m     dword [win.y], dword [win.y_opn]
  498.     m2m     dword [win.w], dword [win.w_opn]
  499.     m2m     dword [win.h], dword [win.h_opn]
  500.  
  501.     cmp     byte[dock_items.ashow],1
  502.     je       .change_nothing
  503.     mcall   SF_CHANGE_WINDOW, [win.x], [win.y], [win.w], [win.h]
  504.  
  505.   .change_nothing:
  506.     call    DRAW_WINDOW
  507.     call    DRAW_SELECTION
  508.     jmp     main_loop
  509.  
  510. ;-------------------------------------------------------------------------------
  511. wnd_hide:
  512.     cmp     byte[win.state], 0
  513.     je        main_loop
  514.  
  515.     mov     byte[nwin.close], 1
  516.  
  517.     mcall   SF_SYSTEM, SSF_FOCUS_WINDOW, [win.psid]
  518.  
  519.     mov     byte[win.state], 0
  520.     mov     byte[win.btn_index], -1
  521.  
  522.     cmp     byte[dock_items.ashow],1
  523.     je       .do_no_hide
  524.  
  525.     m2m     dword [win.x], dword [win.x_hdn]
  526.     m2m     dword [win.y], dword [win.y_hdn]
  527.     m2m     dword [win.w], dword [win.w_hdn]
  528.     m2m     dword [win.h], dword [win.h_hdn]
  529.  
  530.     mcall   SF_CHANGE_WINDOW, [win.x], [win.y], [win.w], [win.h]
  531.  
  532.   .do_no_hide:
  533.     call    DRAW_WINDOW
  534.     jmp     main_loop
  535. ;-------------------------------------------------------------------------------
  536. DRAW_SELECTION:
  537.     mov     ebx, [win.prev_index]
  538.     imul    ebx, BUTTON_SIZE
  539.     add     ebx, 14
  540.     shl     ebx, 16
  541.     add     ebx, 40
  542.     mov     ecx, 0x00020028
  543.  
  544.     cmp     byte[win.isvert], 1
  545.     jne     @f
  546.     xchg    ebx, ecx
  547.     sub     ecx, 0x000C0000
  548.   @@:
  549.  
  550.     mcall   SF_DRAW_RECT, , , [sc.work]
  551.  
  552.     mov     edx, ebx
  553.     shr     ecx, 16
  554.     mov     dx,  cx
  555.     add     edx, 0x00040004
  556.  
  557.     mov     ebx, [win.prev_index]
  558.     imul    ebx, 4
  559.     add     ebx, dock_items.icon
  560.     mov     ebx, [ebx]
  561.     imul    ebx, 32*32*4
  562.     add     ebx, [icons_inactive]
  563.     mcall   SF_PUT_IMAGE_EXT, , <32, 32>, , 32, 0, 0
  564.  
  565.     mov     ebx, [win.btn_index]
  566.     imul    ebx, BUTTON_SIZE
  567.     add     ebx, 14
  568.     shl     ebx, 16
  569.     add     ebx, 40
  570.     mov     ecx, 0x00020028
  571.  
  572.     cmp     byte[win.isvert], 1
  573.     jne     @f
  574.     xchg    ebx, ecx
  575.     sub     ecx, 0x000C0000
  576.   @@:
  577.  
  578.     mcall   SF_DRAW_RECT, , , [sc.work_button]
  579.  
  580.     mov     edx, ebx
  581.     shr     ecx, 16
  582.     mov     dx, cx
  583.     add     edx, 0x00040004
  584.  
  585.     mov     ebx, [win.btn_index]
  586.     imul    ebx, 4
  587.     add     ebx, dock_items.icon
  588.     mov     ebx, [ebx]
  589.     imul    ebx, 32*32*4
  590.     add     ebx, [icons_active]
  591.     mcall   SF_PUT_IMAGE_EXT, , <32, 32>, , 32, 0, 0
  592.    
  593.     ret
  594. ;-------------------------------------------------------------------------------
  595. proc icon32cpy uses ecx edx edi esi, dest:dword, src:dword, len:dword, bgcol:dword
  596.     mov     edi, [dest]
  597.     mov     esi, [src]
  598.     mov     ecx, [len]
  599.     mov     edx, [bgcol]
  600. .loop:
  601.     m2m     dword [edi], dword [esi]
  602.     cmp     dword [edi], 0
  603.     jne     @f
  604.     mov     dword [edi], edx
  605.    @@:
  606.     add     edi, 4
  607.     add     esi, 4
  608.     sub     ecx, 4
  609.     cmp     ecx, 4
  610.     jg      .loop
  611.  
  612.     ret
  613. endp
  614. ;-------------------------------------------------------------------------------
  615. LOAD_ICONS:
  616.     mov     esi, 0 ; esi is a counter of mem_open attempts
  617.   @@:
  618.     ; try to open shr memory, if failed then make 5 attempts more
  619.     mcall   SF_SYS_MISC, SSF_MEM_OPEN,icons_resname ; 0 = SHM_READ
  620.     cmp     eax,0
  621.     jne     @f
  622.     inc     esi
  623.     cmp     esi,10
  624.     je      exit
  625.     mcall   SF_SLEEP, 70
  626.     jmp     @b
  627.   @@:
  628.     mov     [shr_icons_ptr], eax
  629.     mov     [shr_icons_len], edx
  630.    
  631.     mcall   SF_SYS_MISC, SSF_MEM_FREE,  [icons_active]
  632.     mcall   SF_SYS_MISC, SSF_MEM_ALLOC, [shr_icons_len]
  633.     mov     [icons_active], eax
  634.    
  635.     mcall   SF_SYS_MISC, SSF_MEM_FREE,  [icons_inactive]
  636.     mcall   SF_SYS_MISC, SSF_MEM_ALLOC, [shr_icons_len]
  637.     mov     [icons_inactive], eax  
  638.    
  639.     stdcall icon32cpy, [icons_inactive], [shr_icons_ptr], [shr_icons_len], [sc.work]
  640.     stdcall icon32cpy, [icons_active],   [shr_icons_ptr], [shr_icons_len], [sc.work_button]
  641.    
  642.     mcall   SF_SYS_MISC, SSF_MEM_CLOSE,icons_resname
  643.    
  644.     ret
  645. ;-------------------------------------------------------------------------------
  646. proc sections_callback, _file_name, _section_name
  647.     mov     eax, [_section_name]
  648.     cmp     byte[eax], '@'
  649.     jne     @f
  650.  
  651.     dec     dword[dock_items.count]
  652.     jmp     .endproc
  653.  
  654.   @@:
  655.     ; ==== GET NAME ====
  656.     mov     ebx, [dock_items.count]
  657.     imul    ebx, 16
  658.     add     ebx, dock_items.name
  659.  
  660.     mov     eax, [_section_name]
  661.  
  662.     mov     edi, 0
  663.   @@:
  664.     mov     cl, byte[eax]
  665.     mov     byte[ebx + edi], cl
  666.  
  667.     inc     eax
  668.     inc     edi
  669.     cmp     edi, 10
  670.     jne     @b
  671.  
  672.   ; ==== GET PATH ====
  673.     mov     ebx, [dock_items.count]
  674.     imul    ebx, 256
  675.     add     ebx, dock_items.path
  676.  
  677.     invoke  ini.get_str, [_file_name], [_section_name], ini_data.path_name, ebx, 256, 0
  678.  
  679.   ; === GET  PARAM ===
  680.     mov     ebx, [dock_items.count]
  681.     imul    ebx, 256
  682.     add     ebx, dock_items.param
  683.  
  684.     invoke  ini.get_str, [_file_name], [_section_name], ini_data.param_name, ebx, 256, 0
  685.  
  686.   ; ==== GET ICON ====
  687.     invoke  ini.get_int, [_file_name], [_section_name], ini_data.icon_name, 0
  688.  
  689.     mov     ebx, [dock_items.count]
  690.     imul    ebx, 4
  691.     mov     [dock_items.icon + ebx], eax
  692.  
  693.   ; ==== GET SEPARATOR ====
  694.     invoke  ini.get_int, [_file_name], [_section_name], ini_data.separator_name, 0
  695.  
  696.     mov     ebx, [dock_items.count]
  697.     mov     byte[dock_items.separator + ebx], al
  698.  
  699.   ; ====== END =======
  700.  .endproc:
  701.     mov     eax, 1
  702.     inc     dword[dock_items.count]
  703.     ret
  704. endp
  705. ;-------------------------------------------------------------------------------
  706.     include "MEMORY.INC"