Subversion Repositories Kolibri OS

Rev

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