Subversion Repositories Kolibri OS

Rev

Rev 4129 | Rev 4140 | 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 "../../../develop/libraries/box_lib/load_lib.mac"
  11.    ;include "../../../debug.inc"
  12.  
  13.     @use_library_mem     \
  14.             mem.Alloc,   \
  15.             mem.Free,    \
  16.             mem.ReAlloc, \
  17.             dll.Load
  18. ;-------------------------------------------------------------------------------
  19. ICON_SIZE        equ  32 * 32 * 3
  20. IMAGE_FILE_SIZE  equ  ICON_SIZE   * 29
  21. IMAGE_DATA_SIZE  equ  32 * 32 * 4 * 29
  22. ;================================================================================
  23. proc main
  24. ; ==== Init ====
  25.     mcall   18, 7
  26.     mov     [win.psid], eax
  27.  
  28.     mcall   40, 100101b
  29.  
  30.     mov     dword[file_exec.proc], 7
  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, -1
  37.     mov     [dock_items.location], eax
  38.  
  39.     invoke  ini.get_color, ini_data.file_name, ini_data.settings_name, ini_data.color_bg, 0x0
  40.     mov     [color.bg], eax
  41.     invoke  ini.get_color, ini_data.file_name, ini_data.settings_name, ini_data.color_bg_line, 0x080808
  42.     mov     [color.bg_line], eax
  43.     invoke  ini.get_color, ini_data.file_name, ini_data.settings_name, ini_data.color_frame, 0xFFFFFF
  44.     mov     [color.frame], eax
  45.     invoke  ini.get_color, ini_data.file_name, ini_data.settings_name, ini_data.color_framein, 0x888888
  46.     mov     [color.framein], eax
  47.     invoke  ini.get_color, ini_data.file_name, ini_data.settings_name, ini_data.color_text, 0xFFFFFF
  48.     or      eax, 0x80000000
  49.     mov     [color.text], eax
  50.  
  51.     invoke  ini.sections, ini_data.file_name, sections_callback
  52.  
  53. ; ==== Config LibIMG ====
  54.     stdcall mem.Alloc, dword IMAGE_FILE_SIZE
  55.     mov     [img_data.rgb_object], eax
  56.  
  57.     mov     dword[img_data.file.proc], 0
  58.     mov     dword[img_data.file.position], 0
  59.     mov     dword[img_data.file.size], dword IMAGE_FILE_SIZE
  60.     m2m     dword[img_data.file.buffer], dword[img_data.rgb_object]
  61.     mov     byte[img_data.file + 20], 0
  62.     mov     dword[img_data.file.name], img_data.file_name
  63.  
  64.     mcall   70, img_data.file
  65.  
  66.     cmp     ebx, 0xFFFFFFFF
  67.     je      @f
  68.  
  69.     stdcall dword[img.decode], dword[img_data.rgb_object], ebx, 0
  70.     mov     dword[img_data.object], eax
  71.  
  72.   ; === ALPHA ===
  73.     mov     edi, 0
  74.     add     eax, 24
  75.     mov     eax, [eax]
  76.  .setalpha:
  77.     mov     ebx, [eax + edi]
  78.     shr     ebx, 24
  79.     cmp     ebx, 0
  80.     jne     .nonalpha
  81.  
  82.     pushad
  83.     mov     eax, edi
  84.     mov     edx, 0
  85.     mov     ebx, 128
  86.     div     ebx
  87.  
  88.     mov     edx, 0
  89.     mov     ebx, 2
  90.     div     ebx
  91.  
  92.     mov     edx, 0
  93.     div     ebx
  94.  
  95.     cmp     edx, 1
  96.     je      .set_bg_line
  97.  .set_bg:
  98.     popad
  99.     mov     ecx, [color.bg]
  100.     jmp     .set_ecx
  101.  .set_bg_line:
  102.     popad
  103.     mov     ecx, [color.bg_line]
  104.  .set_ecx:
  105.     mov     [eax + edi], ecx
  106.  .nonalpha:
  107.     add     edi, 4
  108.     cmp     edi, IMAGE_DATA_SIZE
  109.     jne     .setalpha
  110.  
  111.   ; === CONVERTING TO BGR
  112.     stdcall dword[img.toRGB], dword[img_data.object], dword[img_data.rgb_object]
  113.     stdcall dword[img.destroy], dword[img_data.object]
  114.  
  115. ; ==== Config window ====
  116.     mov     eax, dword[dock_items.location]
  117.     and     eax, 1b
  118.     cmp     eax, 0
  119.     je      .vert
  120.     jmp     .setshape
  121.  
  122.  .vert:
  123.     mov     byte[win.isvert], 1
  124.  
  125.  .setshape:
  126.     cmp     byte[win.isvert], 1
  127.     je      .vert_sp
  128.  
  129.  .horz_sp:
  130.     call    .HORZ_WIDTH
  131.     call    .HORZ_X
  132.     call    .HORZ_HEIGHT
  133.     cmp     dword[dock_items.location], 1
  134.     je      .settop
  135.  
  136.  .setbottom:
  137.     call    .HORZ_Y_BOTTOM
  138.     jmp     .SETDEF
  139.  
  140.  .settop:
  141.     call    .HORZ_Y_TOP
  142.     jmp     .SETDEF
  143.  
  144.  
  145.  .vert_sp:
  146.     call    .VERT_WIDTH
  147.     call    .VERT_HEIGHT
  148.     call    .VERT_Y
  149.     cmp     dword[dock_items.location], 2
  150.     je      .setleft
  151.  
  152.  .setright:
  153.     call    .VERT_X_RIGHT
  154.     jmp     .SETDEF
  155.  
  156.  .setleft:
  157.     call    .VERT_X_LEFT
  158.     jmp     .SETDEF
  159.  
  160.  .HORZ_WIDTH:
  161.     mov     eax, 40
  162.     mov     ebx, [dock_items.count]
  163.     imul    eax, ebx
  164.     dec     eax
  165.     mov     [win.width_opn], eax
  166.     mov     [win.width_hdn], eax
  167.  
  168.     ret
  169.  
  170.  .HORZ_X:
  171.     mcall   14
  172.     shr     eax, 16
  173.     mov     ebx, 2
  174.     mov     edx, 0
  175.     div     ebx
  176.     mov     edx, 0
  177.     mov     ecx, eax
  178.  
  179.     mov     eax, [win.width_opn]
  180.     div     ebx
  181.     sub     ecx, eax
  182.     mov     [win.x_opn], ecx
  183.     mov     [win.x_hdn], ecx
  184.  
  185.     ret
  186.  
  187.  .HORZ_HEIGHT:
  188.     mov     dword[win.height_opn], 40
  189.     mov     dword[win.height_hdn], 0
  190.  
  191.     ret
  192.  
  193.  .HORZ_Y_BOTTOM:
  194.     mcall   14
  195.     and     eax, 0xFFFF
  196.     dec     eax
  197.     mov     [win.y_hdn], eax
  198.     sub     eax, 40
  199.     mov     [win.y_opn], eax
  200.  
  201.     ret
  202.  
  203.  .HORZ_Y_TOP:
  204.     mov     dword[win.y_opn], 0
  205.     mov     dword[win.y_hdn], 0
  206.  
  207.     ret
  208.  
  209.  .VERT_WIDTH:
  210.     mov     dword[win.width_opn], 40
  211.     mov     dword[win.width_hdn], 0
  212.  
  213.     ret
  214.  
  215.  .VERT_X_LEFT:
  216.  
  217.     mov     dword[win.x_opn], 0
  218.     mov     dword[win.x_hdn], 0
  219.  
  220.     ret
  221.  
  222.  .VERT_X_RIGHT:
  223.     mcall   14
  224.     and     eax, 0xFFFF0000
  225.     shr     eax, 16
  226.     mov     [win.x_hdn], eax
  227.     sub     eax, 40
  228.     mov     [win.x_opn], eax
  229.  
  230.     ret
  231.  
  232.  .VERT_HEIGHT:
  233.     mov     eax, 40
  234.     mov     ebx, [dock_items.count]
  235.     imul    eax, ebx
  236.     dec     eax
  237.     mov     [win.height_opn], eax
  238.     mov     [win.height_hdn], eax
  239.  
  240.     ret
  241.  
  242.  .VERT_Y:
  243.     mcall   14
  244.     and     eax, 0xFFFF
  245.     mov     edx, 0
  246.     mov     ebx, 2
  247.     div     ebx
  248.     mov     esi, eax
  249.  
  250.     mov     eax, [win.height_opn]
  251.     mov     edx, 0
  252.     mov     ebx, 2
  253.     div     ebx
  254.     sub     esi, eax
  255.  
  256.     mov     [win.y_hdn], esi
  257.     mov     [win.y_opn], esi
  258.  
  259.     ret
  260.  
  261.  .SETDEF:
  262.     mov     eax, [win.width_hdn]
  263.     mov     [win.width], eax
  264.  
  265.     mov     eax, [win.x_hdn]
  266.     mov     [win.x], eax
  267.  
  268.     mov     eax, [win.height_hdn]
  269.     mov     [win.height], eax
  270.  
  271.     mov     eax, [win.y_hdn]
  272.     mov     [win.y], eax
  273.  
  274. ; ==== START ====
  275.     mcall   9, win.procinfo, -1
  276.     mov     ecx, [win.procinfo + 30]
  277.     mcall   18, 21
  278.     and     eax, 0xFFFF
  279.     mov     [win.sid], eax
  280.  
  281.     call    main_loop
  282.  
  283. exit:
  284.     stdcall mem.Free, [img_data.rgb_object]
  285.     mcall   18, 2, [nwin.sid]
  286.     mcall   -1
  287. endp
  288. ;-------------------------------------------------------------------------------
  289. proc main_loop
  290.     mcall   10
  291.  
  292.     cmp     eax, EV_REDRAW
  293.     je      event_redraw
  294.  
  295.     cmp     eax, EV_BUTTON
  296.     je      event_button
  297.  
  298.     cmp     eax, EV_MOUSE
  299.     je      event_mouse
  300.  
  301.     jmp     main_loop
  302.  
  303.  .end:
  304.     ret
  305. endp
  306. ;-------------------------------------------------------------------------------
  307. proc event_redraw
  308.     mcall   12, 1
  309.  
  310.     mcall   0, <[win.x], [win.width]>, <[win.y], [win.height]>, [color.frame], [color.frame], [color.frame]
  311.  
  312.     mov     eax, 13
  313.  
  314.     and     ebx, 0x0000FFFF
  315.     add     ebx, 0x00010000
  316.     sub     ebx, 0x00000001
  317.  
  318.     and     ecx, 0x0000FFFF
  319.     add     ecx, 0x00010000
  320.     sub     ecx, 0x00000001
  321.  
  322.     mcall   , , , [color.framein]
  323.  
  324.  
  325.     add     ebx, 0x00010000
  326.     sub     ebx, 0x00000002
  327.  
  328.     add     ecx, 0x00010000
  329.     sub     ecx, 0x00000002
  330.  
  331.     mcall   , , , [color.bg]
  332.  
  333.     mov     edi, 2
  334.     mov     eax, 13
  335.     mov     ebx, 2 shl 16
  336.     add     ebx, [win.width]
  337.     sub     ebx, 3
  338.     mov     ecx, 2 shl 16 + 2
  339.     mov     edx, [color.bg_line]
  340.   @@:
  341.     mcall
  342.     add     ecx, 4 shl 16
  343.     add     edi, 4
  344.     cmp     edi, [win.height]
  345.     jl      @b
  346.  
  347.     mov     edi, 0
  348.   @@:
  349.     cmp     edi, [dock_items.count]
  350.     je      @f
  351.  
  352.     push    edi
  353.     mov     eax, 8
  354.     mov     edx, 0x60000002
  355.     mov     esi, [color.bg]
  356.     imul    edi, 40
  357.     shl     edi, 16
  358.     add     edi, 39
  359.     cmp     byte[win.isvert], 1
  360.     je      .vert_btn
  361.     mcall   , edi, <0, 40>
  362.     jmp     .endbtn
  363.  .vert_btn:
  364.     mcall   , <0, 40>, edi
  365.  .endbtn:
  366.     pop     edi
  367.  
  368.  .draw_Sseparator:
  369.     push    ebx
  370.     push    ecx
  371.     mov     eax, 13
  372.     mov     ebx, edi
  373.     imul    ebx, 40
  374.     add     ebx, 40
  375.     shl     ebx, 16
  376.     add     ebx, 1
  377.     cmp     byte[win.isvert], 1
  378.     je      .vert_Sdraw_sep
  379.     mcall   , , <6, 29>, [color.framein]
  380.     jmp     .end_Sinner_sep
  381.  .vert_Sdraw_sep:
  382.     mov     ecx, ebx
  383.     mcall   , <6, 29>, , [color.framein]
  384.  .end_Sinner_sep:
  385.     pop     ecx
  386.     pop     ebx
  387.  .end_Sseparator:
  388.  
  389.     cmp     byte[dock_items.separator + edi], 1
  390.     jne     .end_separator
  391.  
  392.  .draw_separator:
  393.     push    ebx
  394.     push    ecx
  395.     mov     eax, 13
  396.     mov     ebx, edi
  397.     imul    ebx, 40
  398.     add     ebx, 39
  399.     shl     ebx, 16
  400.     add     ebx, 1
  401.     cmp     byte[win.isvert], 1
  402.     je      .vert_draw_sep
  403.     mcall   , , <0, 41>, [color.frame]
  404.     sub     ebx, 0x00010000
  405.     mov     edx, [color.framein]
  406.     mcall   , , <1, 39>
  407.     add     ebx, 0x00020000
  408.     mcall   , , <1, 39>
  409.     jmp     .end_inner_sep
  410.  .vert_draw_sep:
  411.     mov     ecx, ebx
  412.     mcall   , <0, 41>, , [color.frame]
  413.     sub     ecx, 0x00010000
  414.     mov     edx, [color.framein]
  415.     mcall   , <1, 39>
  416.     add     ecx, 0x00020000
  417.     mcall   , <1, 39>
  418.  .end_inner_sep:
  419.     pop     ecx
  420.     pop     ebx
  421.  .end_separator:
  422.  
  423.     cmp     byte[win.isvert], 1
  424.     je      .vert_dig
  425.     mov     edx, ebx
  426.     and     edx, 0xFFFF0000
  427.     add     edx, 0x00040004
  428.     jmp     .digend
  429.  .vert_dig:
  430.     mov     edx, ecx
  431.     and     edx, 0xFFFF0000
  432.     shr     edx, 16
  433.     add     edx, 0x00040004
  434.  .digend:
  435.  
  436.     imul    ebx, edi, 4
  437.     add     ebx, dock_items.icon
  438.     mov     ebx, [ebx]
  439.     imul    ebx, ICON_SIZE
  440.     add     ebx, [img_data.rgb_object]
  441.  
  442.     mcall   7, , <32, 32>
  443.  
  444.     inc     edi
  445.     jmp     @b
  446.   @@:
  447.  
  448.     mcall   12, 2
  449.  
  450.     jmp     main_loop
  451. endp
  452. ;-------------------------------------------------------------------------------
  453. proc event_button
  454.     mcall   17
  455.  
  456.     cmp     ah, 1
  457.     je      .button_close
  458.  
  459.     cmp     ah, 2
  460.     je      .button_dock
  461.  
  462.     jmp     @f
  463.  
  464.  .button_close:
  465.     jmp     exit
  466.  
  467.  .button_dock:
  468.     mov     edi, [win.button_index]
  469.     imul    edi, 256
  470.  
  471.     mov     esi, edi
  472.     add     esi, dock_items.path
  473.     mov     dword[file_exec.file], esi
  474.  
  475.     mov     esi, edi
  476.     add     esi, dock_items.param
  477.     mov     dword[file_exec.param], esi
  478.  
  479.     mcall   70, file_exec
  480.  
  481.     mov     ecx, eax
  482.     mcall   18, 21
  483.     and     eax, 0xFFFF
  484.     mov     [win.psid], eax
  485.  
  486.   @@:
  487.     jmp     main_loop
  488. endp
  489. ;-------------------------------------------------------------------------------
  490. proc event_mouse
  491.     mcall   37, 1
  492.     mov     edi, eax
  493.     mov     esi, eax
  494.     shr     edi, 16
  495.     and     esi, 0xFFFF
  496.  
  497.     cmp     edi, 0
  498.     jl      @f
  499.     dec     edi
  500.     cmp     edi, [win.width]
  501.     jg      @f
  502.     cmp     esi, 0
  503.     jl      @f
  504.     dec     esi
  505.     cmp     esi, [win.height]
  506.     jg      @f
  507.  
  508.     mov     eax, [dock_items.location]
  509.     and     eax, 1b
  510.     cmp     eax, 1
  511.     jne     .vert
  512.     mov     eax, edi
  513.     jmp     .nxt
  514.  
  515.  .vert:
  516.     mov     eax, esi
  517.  
  518.  .nxt:
  519.     mov     edx, 0
  520.     mov     ebx, 40
  521.     div     ebx
  522.  
  523.     cmp     eax, [dock_items.count]
  524.     jge     .set0
  525.     jmp     .nxtcmp
  526.  
  527.  .set0:
  528.     mov     eax, 100
  529.  
  530.  .nxtcmp:
  531.     cmp     [win.button_index], eax
  532.     je      .nxt2
  533.  
  534.     mov     [win.button_index], eax
  535.  
  536.  .nxt2:
  537.     mov     eax, [win.button_index]
  538.     imul    eax, 40
  539.     cmp     byte[win.isvert], 1
  540.     je      .vert_name
  541.     sub     eax, 15
  542.     add     eax, [win.x]
  543.     mov     [nwin.x], eax
  544.     jmp     .vert_end
  545.  .vert_name:
  546.     add     eax, 12
  547.     add     eax, [win.y]
  548.     mov     [nwin.y], eax
  549.  .vert_end:
  550.     mov     byte[nwin.change_shape], 1
  551.  
  552.     cmp     byte[win.state], 1
  553.     je      .end_cmp
  554.  
  555.     mov     edx, esp
  556.     add     edx, 512
  557.     mcall   51, 1, n_main
  558.  
  559.     mov     eax, 18
  560.  
  561.     mcall   , 7
  562.     mov     [win.psid], eax
  563.  
  564.     mcall   18, 3, [win.sid]
  565.  
  566.     mov     byte[win.state], 1
  567.  
  568.     mov     eax, [win.width_opn]
  569.     mov     [win.width], eax
  570.  
  571.     mov     eax, [win.x_opn]
  572.     mov     [win.x], eax
  573.  
  574.     mov     eax, [win.height_opn]
  575.     mov     [win.height], eax
  576.  
  577.     mov     eax, [win.y_opn]
  578.     mov     [win.y], eax
  579.  
  580.     mcall   67, [win.x], [win.y], [win.width], [win.height]
  581.  
  582.     call     event_redraw
  583.  
  584.   @@:
  585.     cmp     byte[win.state], 0
  586.     je      .end_cmp
  587.  
  588.     mov     byte[nwin.close], 1
  589.  
  590.     mcall   18, 3, [win.psid]
  591.  
  592.     mov     byte[win.state], 0
  593.     mov     byte[win.button_index], -1
  594.  
  595.     mov     eax, [win.width_hdn]
  596.     mov     [win.width], eax
  597.  
  598.     mov     eax, [win.x_hdn]
  599.     mov     [win.x], eax
  600.  
  601.     mov     eax, [win.height_hdn]
  602.     mov     [win.height], eax
  603.  
  604.     mov     eax, [win.y_hdn]
  605.     mov     [win.y], eax
  606.  
  607.     mcall   67, [win.x], [win.y], [win.width], [win.height]
  608.  
  609.     call     event_redraw
  610.  
  611.   .end_cmp:
  612.     jmp     main_loop
  613. endp
  614. ;-------------------------------------------------------------------------------
  615. proc sections_callback, _file_name, _section_name
  616.     mov     eax, [_section_name]
  617.     cmp     byte[eax], '@'
  618.     jne     @f
  619.  
  620.     dec     dword[dock_items.count]
  621.     jmp     .endproc
  622.  
  623.   @@:
  624.     ; ==== GET NAME ====
  625.     mov     ebx, [dock_items.count]
  626.     imul    ebx, 16
  627.     add     ebx, dock_items.name
  628.  
  629.     mov     eax, [_section_name]
  630.  
  631.     mov     edi, 0
  632.   @@:
  633.     mov     cl, byte[eax]
  634.     mov     byte[ebx + edi], cl
  635.  
  636.     inc     eax
  637.     inc     edi
  638.     cmp     edi, 10
  639.     jne     @b
  640.  
  641.   ; ==== GET PATH ====
  642.     mov     ebx, [dock_items.count]
  643.     imul    ebx, 256
  644.     add     ebx, dock_items.path
  645.  
  646.     invoke  ini.get_str, [_file_name], [_section_name], ini_data.path_name, ebx, 256, 0
  647.  
  648.   ; === GET  PARAM ===
  649.     mov     ebx, [dock_items.count]
  650.     imul    ebx, 256
  651.     add     ebx, dock_items.param
  652.  
  653.     invoke  ini.get_str, [_file_name], [_section_name], ini_data.param_name, ebx, 256, 0
  654.  
  655.   ; ==== GET ICON ====
  656.     invoke  ini.get_int, [_file_name], [_section_name], ini_data.icon_name, 0
  657.  
  658.     mov     ebx, [dock_items.count]
  659.     imul    ebx, 4
  660.     mov     [dock_items.icon + ebx], eax
  661.  
  662.   ; ==== GET SEPARATOR ====
  663.     invoke  ini.get_int, [_file_name], [_section_name], ini_data.separator_name, 0
  664.  
  665.     mov     ebx, [dock_items.count]
  666.     mov     byte[dock_items.separator + ebx], al
  667.  
  668.   ; ====== END =======
  669.  .endproc:
  670.     mov     eax, 1
  671.     inc     dword[dock_items.count]
  672.     ret
  673. endp
  674. ;-------------------------------------------------------------------------------
  675. n_main:
  676.     cmp     dword[dock_items.location], 1
  677.     je      .top
  678.     cmp     dword[dock_items.location], 4
  679.     je      .right
  680.     cmp     dword[dock_items.location], 3
  681.     je      .bottom
  682.     jmp     .left
  683.  .top:
  684.     mov     eax, [win.height_opn]
  685.     add     eax, 4
  686.     mov     [nwin.y], eax
  687.     jmp     @f
  688.  .right:
  689.     mov     eax, [win.x_opn]
  690.     sub     eax, 72
  691.     mov     [nwin.x], eax
  692.     jmp     @f
  693.  .bottom:
  694.     mov     eax, [win.y_opn]
  695.     sub     eax, 20
  696.     mov     [nwin.y], eax
  697.     jmp     @f
  698.  .left:
  699.     mov     eax, [win.width_opn]
  700.     add     eax, 4
  701.     mov     [nwin.x], eax
  702.   @@:
  703.     mov     dword[nwin.width], 68
  704.     mov     dword[nwin.height], 16
  705.  
  706.     mcall   40, 1b
  707.  
  708.     mcall   9, win.procinfo, -1
  709.     mov     ecx, [win.procinfo + 30]
  710.     mcall   18, 21
  711.     and     eax, 0xFFFF
  712.     mov     [nwin.sid], eax
  713. ;-------------------------------------------------------------------------------
  714. n_main_loop:
  715.     mcall   23, 1
  716.  
  717.     cmp     eax, EV_IDLE
  718.     je      n_event_idle
  719.     cmp     eax, EV_REDRAW
  720.     je      n_event_redraw
  721.  
  722.     jmp     n_main_loop
  723. ;-------------------------------------------------------------------------------
  724. n_event_idle:
  725.     cmp     byte[nwin.close], 1
  726.     jne     @f
  727.  
  728.     mov     byte[nwin.close], 0
  729.     mcall   -1
  730.  
  731.   @@:
  732.     cmp     byte[win.button_index], 100
  733.     jne     @f
  734.  
  735.     mcall   67, 0, 0, 0, 0
  736.     jmp     .end
  737.  
  738.   @@:
  739.     cmp     byte[nwin.change_shape], 1
  740.     jne     .end
  741.  
  742.     mov     byte[nwin.change_shape], 0
  743.     mcall   67, [nwin.x], [nwin.y], [nwin.width], [nwin.height]
  744.  
  745.  .end:
  746.     jmp     n_main_loop
  747. ;-------------------------------------------------------------------------------
  748. n_event_redraw:
  749.     mcall   12, 1
  750.  
  751.     mcall   0, <[nwin.x], [nwin.width]>, <[nwin.y], [nwin.height]>, [color.frame], [color.frame], [color.frame]
  752.  
  753.     mov     eax, 13
  754.  
  755.     and     ebx, 0x0000FFFF
  756.     add     ebx, 0x00010000
  757.     sub     ebx, 0x00000001
  758.  
  759.     and     ecx, 0x0000FFFF
  760.     add     ecx, 0x00010000
  761.     sub     ecx, 0x00000001
  762.  
  763.     mcall   , , , [color.framein]
  764.  
  765.  
  766.     add     ebx, 0x00010000
  767.     sub     ebx, 0x00000002
  768.  
  769.     add     ecx, 0x00010000
  770.     sub     ecx, 0x00000002
  771.  
  772.     mcall   , , , [color.bg]
  773.  
  774.     mov     edi, 0
  775.     mov     eax, 13
  776.     mov     ebx, 2 shl 16
  777.     add     ebx, [nwin.width]
  778.     sub     ebx, 3
  779.     mov     ecx, 2 shl 16 + 2
  780.     mov     edx, [color.bg_line]
  781.   @@:
  782.     mcall
  783.     add     ecx, 4 shl 16
  784.     add     edi, 4
  785.     cmp     edi, 16
  786.     jne     @b
  787.  
  788.     mov     edx, [win.button_index]
  789.     imul    edx, 16
  790.     add     edx, dock_items.name
  791.  
  792.     mov     eax, 0
  793.   @@:
  794.     inc     eax
  795.     cmp     byte[edx+eax], 0
  796.     jne     @b
  797.  
  798.     imul    eax, 3
  799.     mov     ebx, 34
  800.     sub     ebx, eax
  801.     inc     ebx
  802.     shl     ebx, 16
  803.     add     ebx, 5
  804.  
  805.     mcall   4, , [color.text]
  806.  
  807.     mcall   12, 2
  808.  
  809.     jmp     n_main_loop
  810. ;-------------------------------------------------------------------------------
  811. img_data:
  812.  .file_name:
  813.     db      "/sys/iconstrp.png", 0
  814.  .cfg_text:
  815.     db      "R", 0
  816.  .ext_text:
  817.     db      "X", 0
  818. ;-------------------------------------------------------------------------------
  819. ini_data:
  820.  .file_name:
  821.     db      "/sys/settings/Docky.ini", 0
  822.  .path_name:
  823.     db      "path", 0
  824.  .param_name:
  825.     db      "param", 0
  826.  .icon_name:
  827.     db      "icon", 0
  828.  .separator_name:
  829.     db      "separator", 0
  830.  
  831.  .settings_name:
  832.     db      "@SETTINGS", 0
  833.  .location_name:
  834.     db      "location", 0
  835.  .color_bg:
  836.     db      "bg", 0
  837.  .color_bg_line:
  838.     db      "bg_line", 0
  839.  .color_frame:
  840.     db      "frame", 0
  841.  .color_framein:
  842.     db      "framein", 0
  843.  .color_text:
  844.     db      "text", 0
  845. ;-------------------------------------------------------------------------------
  846. load_lib_start:
  847.     lib1    l_libs img.name,         \
  848.                    sys_path,         \
  849.                    file_name,        \
  850.                    img.dir,          \
  851.                    error,            \
  852.                    error,            \
  853.                    img,              \
  854.                    error,            \
  855.                    error
  856.  
  857.     lib2    l_libs ini.name,         \
  858.                    sys_path,         \
  859.                    file_name,        \
  860.                    ini.dir,          \
  861.                    error,            \
  862.                    error,            \
  863.                    ini,              \
  864.                    error,            \
  865.                    error
  866. load_lib_end:
  867. ;-------------------------------------------------------------------------------
  868. img:
  869.  .init     \
  870.     dd      .init_T
  871.  .toRGB    \
  872.     dd      .toRGB_T
  873.  .decode   \
  874.     dd      .decode_T
  875.  .destroy  \
  876.     dd      .destroy_T
  877.  
  878.     dd      0, 0
  879.  
  880.  .init_T:
  881.     db      "lib_init", 0
  882.  .toRGB_T:
  883.     db      "img_to_rgb2", 0
  884.  .decode_T:
  885.     db      "img_decode", 0
  886.  .destroy_T:
  887.     db      "img_destroy", 0
  888.  
  889.  .dir:
  890.     db      "/sys/lib/"
  891.  .name:
  892.     db      "libimg.obj", 0
  893. ;-------------------------------------------------------------------------------
  894. ini:
  895.  .init     \
  896.     dd      .init_T
  897.  .sections \
  898.     dd      .sections_T
  899.  .get_int  \
  900.     dd      .get_int_T
  901.  .get_str  \
  902.     dd      .get_str_T
  903.  .get_color\
  904.     dd      .get_color_T
  905.  
  906.     dd      0, 0
  907.  
  908.  .init_T:
  909.     db      "lib_init", 0
  910.  .sections_T:
  911.     db      "ini_enum_sections", 0
  912.  .get_int_T:
  913.     db      "ini_get_int", 0
  914.  .get_str_T:
  915.     db      "ini_get_str", 0
  916.  .get_color_T:
  917.     db      "ini_get_color", 0
  918.  
  919.  .dir:
  920.     db      "/sys/lib/"
  921.  .name:
  922.     db      "libini.obj", 0
  923. ;-------------------------------------------------------------------------------
  924. error:
  925.     db      0
  926. ;-------------------------------------------------------------------------------
  927. __dataend:
  928. ;================================================================================
  929.     rb      1024
  930. __stackend:
  931. ;================================================================================
  932. color:
  933.  .bg:
  934.     rd      1
  935.  .bg_line:
  936.     rd      1
  937.  .frame:
  938.     rd      1
  939.  .framein:
  940.     rd      1
  941.  .text:
  942.     rd      1
  943. ;-------------------------------------------------------------------------------
  944. win:
  945.  .x:
  946.     rd      1
  947.  .y:
  948.     rd      1
  949.  .width:
  950.     rd      1
  951.  .height:
  952.     rd      1
  953.  
  954.  .x_hdn:
  955.     rd      1
  956.  .y_hdn:
  957.     rd      1
  958.  .width_hdn:
  959.     rd      1
  960.  .height_hdn:
  961.     rd      1
  962.  
  963.  .x_opn:
  964.     rd      1
  965.  .y_opn:
  966.     rd      1
  967.  .width_opn:
  968.     rd      1
  969.  .height_opn:
  970.     rd      1
  971.  
  972.  .sid:
  973.     rd      1
  974.  .psid:
  975.     rd      1
  976.  .procinfo:
  977.     rb      1024
  978.  .state:
  979.     rb      1
  980.  .button_index:
  981.     rd      1
  982.  
  983.  .isvert:
  984.     rb      1
  985. ;-------------------------------------------------------------------------------
  986. nwin:
  987.  .x:
  988.     rd      1
  989.  .y:
  990.     rd      1
  991.  .width:
  992.     rd      1
  993.  .height:
  994.     rd      1
  995.  
  996.  .visible:
  997.     rd      1
  998.  .sid:
  999.     rd      1
  1000.  .change_shape:
  1001.     rb      1
  1002.  .close:
  1003.     rb      1
  1004. ;-------------------------------------------------------------------------------
  1005. img_data.object:
  1006.     rd      1
  1007. img_data.rgb_object:
  1008.     rd      1
  1009. img_data.file:
  1010.  .proc:
  1011.     rd      1
  1012.  .position:
  1013.     rd      1
  1014.     rd      1
  1015.  .size:
  1016.     rd      1
  1017.  .buffer:
  1018.     rd      1
  1019.     rb      1
  1020.  .name:
  1021.     rd      1
  1022. ;-------------------------------------------------------------------------------
  1023. file_exec:
  1024.  .proc:
  1025.     rd      1
  1026.     rd      1
  1027.  .param:
  1028.     rd      1
  1029.     rd      1
  1030.     rd      1
  1031.     rb      1
  1032.  .file:
  1033.     rd      1
  1034. ;-------------------------------------------------------------------------------
  1035. dock_items:
  1036.  .count:
  1037.     rd      1
  1038.  .name:
  1039.     rb      16  * 20
  1040.  .path:
  1041.     rb      256 * 20
  1042.  .param:
  1043.     rb      256 * 20
  1044.  .icon:
  1045.     rd      1   * 20
  1046.  .separator:
  1047.     rb      1   * 20
  1048.  .location:
  1049.     rd      1
  1050. ;-------------------------------------------------------------------------------
  1051. sys_path:
  1052.     rb      4096
  1053. file_name:
  1054.     rb      4096
  1055. ;-------------------------------------------------------------------------------
  1056. __memend:
  1057. ;================================================================================