2013-10-28 21:47:26 +01:00
|
|
|
use32
|
|
|
|
org 0x0
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
db "MENUET01"
|
|
|
|
dd 1, main, __dataend, __memend, __stackend, 0, sys_path
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
include "../../../macros.inc"
|
|
|
|
include "../../../proc32.inc"
|
|
|
|
include "../../../dll.inc"
|
|
|
|
include "../../../develop/libraries/box_lib/load_lib.mac"
|
2013-11-03 17:32:45 +01:00
|
|
|
;include "../../../debug.inc"
|
2013-10-31 21:04:03 +01:00
|
|
|
|
|
|
|
include "DATA.INC"
|
|
|
|
include "NAME.INC"
|
2013-10-28 21:47:26 +01:00
|
|
|
|
|
|
|
@use_library_mem \
|
|
|
|
mem.Alloc, \
|
|
|
|
mem.Free, \
|
|
|
|
mem.ReAlloc, \
|
|
|
|
dll.Load
|
|
|
|
;================================================================================
|
2013-10-31 21:04:03 +01:00
|
|
|
main:
|
2013-10-28 21:47:26 +01:00
|
|
|
; ==== Init ====
|
|
|
|
mcall 18, 7
|
|
|
|
mov [win.psid], eax
|
|
|
|
|
|
|
|
mcall 40, 100101b
|
|
|
|
|
|
|
|
; ==== Load libs ====
|
|
|
|
load_libraries load_lib_start, load_lib_end
|
|
|
|
|
|
|
|
; ==== Config LibINI ====
|
|
|
|
invoke ini.get_int, ini_data.file_name, ini_data.settings_name, ini_data.location_name, -1
|
|
|
|
mov [dock_items.location], eax
|
|
|
|
|
2013-10-31 21:04:03 +01:00
|
|
|
mcall 48, 3, color
|
|
|
|
or dword[color.bg], 0x10000000
|
|
|
|
or dword[color.frame], 0x10000000
|
|
|
|
or dword[color.text], 0x80000000
|
2013-10-28 21:47:26 +01:00
|
|
|
|
|
|
|
invoke ini.sections, ini_data.file_name, sections_callback
|
|
|
|
|
|
|
|
; ==== Config LibIMG ====
|
2013-10-31 21:04:03 +01:00
|
|
|
mov dword[fi.p00], 5
|
|
|
|
mov dword[fi.p16], buf_128
|
|
|
|
mov dword[fi.p21], img_data.file_name
|
|
|
|
|
|
|
|
mcall 70, fi
|
|
|
|
|
|
|
|
mov edx, [buf_128 + 32]
|
|
|
|
imul edx, 10
|
|
|
|
|
|
|
|
stdcall mem.Alloc, edx
|
2013-10-28 21:47:26 +01:00
|
|
|
mov [img_data.rgb_object], eax
|
|
|
|
|
2013-10-31 21:04:03 +01:00
|
|
|
mov dword[fi.p00], 0
|
|
|
|
mov dword[fi.p12], edx
|
|
|
|
m2m dword[fi.p16], dword[img_data.rgb_object]
|
|
|
|
mov dword[fi.p21], img_data.file_name
|
2013-10-28 21:47:26 +01:00
|
|
|
|
2013-10-31 21:04:03 +01:00
|
|
|
mcall 70, fi
|
2013-10-28 21:47:26 +01:00
|
|
|
|
|
|
|
cmp ebx, 0xFFFFFFFF
|
|
|
|
je @f
|
|
|
|
|
|
|
|
stdcall dword[img.decode], dword[img_data.rgb_object], ebx, 0
|
|
|
|
mov dword[img_data.object], eax
|
|
|
|
|
|
|
|
; === ALPHA ===
|
|
|
|
mov edi, 0
|
|
|
|
add eax, 24
|
|
|
|
mov eax, [eax]
|
|
|
|
.setalpha:
|
|
|
|
mov ebx, [eax + edi]
|
|
|
|
shr ebx, 24
|
|
|
|
cmp ebx, 0
|
|
|
|
jne .nonalpha
|
2013-10-29 20:18:52 +01:00
|
|
|
|
|
|
|
mov ecx, [color.bg]
|
2013-10-28 21:47:26 +01:00
|
|
|
mov [eax + edi], ecx
|
|
|
|
.nonalpha:
|
|
|
|
add edi, 4
|
2013-10-31 21:04:03 +01:00
|
|
|
cmp edi, ICONS_SIZE_RGB
|
2013-10-28 21:47:26 +01:00
|
|
|
jne .setalpha
|
|
|
|
|
|
|
|
; === CONVERTING TO BGR
|
|
|
|
stdcall dword[img.toRGB], dword[img_data.object], dword[img_data.rgb_object]
|
|
|
|
stdcall dword[img.destroy], dword[img_data.object]
|
|
|
|
|
|
|
|
; ==== Config window ====
|
|
|
|
mov eax, dword[dock_items.location]
|
|
|
|
and eax, 1b
|
|
|
|
cmp eax, 0
|
|
|
|
je .vert
|
|
|
|
jmp .setshape
|
|
|
|
|
|
|
|
.vert:
|
|
|
|
mov byte[win.isvert], 1
|
|
|
|
|
|
|
|
.setshape:
|
|
|
|
cmp byte[win.isvert], 1
|
|
|
|
je .vert_sp
|
|
|
|
|
|
|
|
.horz_sp:
|
|
|
|
call .HORZ_WIDTH
|
|
|
|
call .HORZ_X
|
|
|
|
call .HORZ_HEIGHT
|
|
|
|
cmp dword[dock_items.location], 1
|
|
|
|
je .settop
|
|
|
|
|
|
|
|
.setbottom:
|
|
|
|
call .HORZ_Y_BOTTOM
|
|
|
|
jmp .SETDEF
|
|
|
|
|
|
|
|
.settop:
|
|
|
|
call .HORZ_Y_TOP
|
|
|
|
jmp .SETDEF
|
|
|
|
|
|
|
|
|
|
|
|
.vert_sp:
|
|
|
|
call .VERT_WIDTH
|
|
|
|
call .VERT_HEIGHT
|
|
|
|
call .VERT_Y
|
|
|
|
cmp dword[dock_items.location], 2
|
|
|
|
je .setleft
|
|
|
|
|
|
|
|
.setright:
|
|
|
|
call .VERT_X_RIGHT
|
|
|
|
jmp .SETDEF
|
|
|
|
|
|
|
|
.setleft:
|
|
|
|
call .VERT_X_LEFT
|
|
|
|
jmp .SETDEF
|
|
|
|
|
|
|
|
.HORZ_WIDTH:
|
2013-10-31 21:04:03 +01:00
|
|
|
mov eax, BUTTON_SIZE
|
2013-10-28 21:47:26 +01:00
|
|
|
mov ebx, [dock_items.count]
|
|
|
|
imul eax, ebx
|
2013-10-31 21:04:03 +01:00
|
|
|
add eax, 24
|
2013-10-28 21:47:26 +01:00
|
|
|
dec eax
|
|
|
|
mov [win.width_opn], eax
|
|
|
|
mov [win.width_hdn], eax
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
.HORZ_X:
|
|
|
|
mcall 14
|
|
|
|
shr eax, 16
|
|
|
|
mov ebx, 2
|
|
|
|
mov edx, 0
|
|
|
|
div ebx
|
|
|
|
mov edx, 0
|
|
|
|
mov ecx, eax
|
|
|
|
|
|
|
|
mov eax, [win.width_opn]
|
|
|
|
div ebx
|
|
|
|
sub ecx, eax
|
|
|
|
mov [win.x_opn], ecx
|
|
|
|
mov [win.x_hdn], ecx
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
.HORZ_HEIGHT:
|
2013-10-31 21:04:03 +01:00
|
|
|
mov dword[win.height_opn], BUTTON_SIZE
|
2013-11-03 17:32:45 +01:00
|
|
|
mov dword[win.height_hdn], 3
|
2013-10-28 21:47:26 +01:00
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
.HORZ_Y_BOTTOM:
|
|
|
|
mcall 14
|
|
|
|
and eax, 0xFFFF
|
|
|
|
dec eax
|
|
|
|
mov [win.y_hdn], eax
|
2013-11-03 17:32:45 +01:00
|
|
|
sub eax, 43
|
2013-10-28 21:47:26 +01:00
|
|
|
mov [win.y_opn], eax
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
.HORZ_Y_TOP:
|
|
|
|
mov dword[win.y_opn], 0
|
|
|
|
mov dword[win.y_hdn], 0
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
.VERT_WIDTH:
|
2013-10-31 21:04:03 +01:00
|
|
|
mov dword[win.width_opn], BUTTON_SIZE
|
2013-11-03 17:32:45 +01:00
|
|
|
mov dword[win.width_hdn], 3
|
2013-10-28 21:47:26 +01:00
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
.VERT_X_LEFT:
|
|
|
|
|
|
|
|
mov dword[win.x_opn], 0
|
|
|
|
mov dword[win.x_hdn], 0
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
.VERT_X_RIGHT:
|
|
|
|
mcall 14
|
|
|
|
and eax, 0xFFFF0000
|
|
|
|
shr eax, 16
|
|
|
|
mov [win.x_hdn], eax
|
2013-10-31 21:04:03 +01:00
|
|
|
sub eax, BUTTON_SIZE
|
2013-10-28 21:47:26 +01:00
|
|
|
mov [win.x_opn], eax
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
.VERT_HEIGHT:
|
2013-10-31 21:04:03 +01:00
|
|
|
mov eax, BUTTON_SIZE
|
2013-10-28 21:47:26 +01:00
|
|
|
mov ebx, [dock_items.count]
|
|
|
|
imul eax, ebx
|
|
|
|
dec eax
|
|
|
|
mov [win.height_opn], eax
|
|
|
|
mov [win.height_hdn], eax
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
.VERT_Y:
|
|
|
|
mcall 14
|
|
|
|
and eax, 0xFFFF
|
|
|
|
mov edx, 0
|
|
|
|
mov ebx, 2
|
|
|
|
div ebx
|
|
|
|
mov esi, eax
|
|
|
|
|
|
|
|
mov eax, [win.height_opn]
|
|
|
|
mov edx, 0
|
|
|
|
mov ebx, 2
|
|
|
|
div ebx
|
|
|
|
sub esi, eax
|
|
|
|
|
|
|
|
mov [win.y_hdn], esi
|
|
|
|
mov [win.y_opn], esi
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
.SETDEF:
|
|
|
|
mov eax, [win.width_hdn]
|
|
|
|
mov [win.width], eax
|
|
|
|
|
|
|
|
mov eax, [win.x_hdn]
|
|
|
|
mov [win.x], eax
|
|
|
|
|
|
|
|
mov eax, [win.height_hdn]
|
|
|
|
mov [win.height], eax
|
|
|
|
|
|
|
|
mov eax, [win.y_hdn]
|
|
|
|
mov [win.y], eax
|
|
|
|
|
|
|
|
; ==== START ====
|
|
|
|
mcall 9, win.procinfo, -1
|
|
|
|
mov ecx, [win.procinfo + 30]
|
|
|
|
mcall 18, 21
|
|
|
|
and eax, 0xFFFF
|
|
|
|
mov [win.sid], eax
|
|
|
|
|
|
|
|
call main_loop
|
2013-10-31 21:04:03 +01:00
|
|
|
;-------------------------------------------------------------------------------
|
2013-10-28 21:47:26 +01:00
|
|
|
exit:
|
|
|
|
stdcall mem.Free, [img_data.rgb_object]
|
|
|
|
mcall 18, 2, [nwin.sid]
|
|
|
|
mcall -1
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
proc main_loop
|
|
|
|
mcall 10
|
|
|
|
|
|
|
|
cmp eax, EV_REDRAW
|
|
|
|
je event_redraw
|
|
|
|
|
|
|
|
cmp eax, EV_BUTTON
|
|
|
|
je event_button
|
|
|
|
|
|
|
|
cmp eax, EV_MOUSE
|
|
|
|
je event_mouse
|
|
|
|
|
|
|
|
jmp main_loop
|
|
|
|
|
|
|
|
.end:
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
;-------------------------------------------------------------------------------
|
2013-10-31 21:04:03 +01:00
|
|
|
event_redraw:
|
2013-10-28 21:47:26 +01:00
|
|
|
mcall 12, 1
|
|
|
|
|
2013-10-31 21:04:03 +01:00
|
|
|
mcall 0, <[win.x], [win.width]>, <[win.y], [win.height]>, [color.bg], [color.bg], [color.frame]
|
2013-10-29 20:18:52 +01:00
|
|
|
|
2013-10-28 21:47:26 +01:00
|
|
|
mov edi, 0
|
|
|
|
@@:
|
|
|
|
cmp edi, [dock_items.count]
|
|
|
|
je @f
|
|
|
|
|
|
|
|
push edi
|
2013-10-28 23:17:24 +01:00
|
|
|
mov eax, 8
|
|
|
|
mov edx, 0x60000002
|
|
|
|
mov esi, [color.bg]
|
2013-10-31 21:04:03 +01:00
|
|
|
imul edi, BUTTON_SIZE
|
|
|
|
add edi, 12
|
2013-10-28 23:17:24 +01:00
|
|
|
shl edi, 16
|
2013-10-31 21:04:03 +01:00
|
|
|
add edi, BUTTON_SIZE
|
2013-10-28 21:47:26 +01:00
|
|
|
cmp byte[win.isvert], 1
|
|
|
|
je .vert_btn
|
2013-10-31 21:04:03 +01:00
|
|
|
mcall , edi, <0, BUTTON_SIZE>
|
2013-10-28 21:47:26 +01:00
|
|
|
jmp .endbtn
|
|
|
|
.vert_btn:
|
2013-11-03 17:32:45 +01:00
|
|
|
sub edi, 12 shl 16
|
2013-10-31 21:04:03 +01:00
|
|
|
mcall , <0, BUTTON_SIZE>, edi
|
2013-10-28 21:47:26 +01:00
|
|
|
.endbtn:
|
|
|
|
pop edi
|
|
|
|
|
|
|
|
cmp byte[dock_items.separator + edi], 1
|
2013-10-29 20:18:52 +01:00
|
|
|
jne .end_separator
|
2013-10-28 21:47:26 +01:00
|
|
|
|
|
|
|
.draw_separator:
|
|
|
|
push ebx
|
|
|
|
push ecx
|
2013-10-31 21:04:03 +01:00
|
|
|
|
2013-10-28 23:17:24 +01:00
|
|
|
mov eax, 13
|
2013-10-28 21:47:26 +01:00
|
|
|
mov ebx, edi
|
2013-10-31 21:04:03 +01:00
|
|
|
imul ebx, BUTTON_SIZE
|
|
|
|
add ebx, BUTTON_SIZE
|
|
|
|
add ebx, 12
|
|
|
|
dec ebx
|
2013-10-28 21:47:26 +01:00
|
|
|
shl ebx, 16
|
|
|
|
add ebx, 1
|
2013-10-31 21:04:03 +01:00
|
|
|
|
2013-10-28 21:47:26 +01:00
|
|
|
cmp byte[win.isvert], 1
|
|
|
|
je .vert_draw_sep
|
2013-10-31 21:04:03 +01:00
|
|
|
mcall , , <4, 36>, [color.frame]
|
2013-10-28 21:47:26 +01:00
|
|
|
jmp .end_inner_sep
|
|
|
|
.vert_draw_sep:
|
2013-11-03 17:32:45 +01:00
|
|
|
sub ebx, 12 shl 16
|
2013-10-28 21:47:26 +01:00
|
|
|
mov ecx, ebx
|
2013-10-31 21:04:03 +01:00
|
|
|
mcall , <4, 36>, , [color.frame]
|
2013-10-28 21:47:26 +01:00
|
|
|
.end_inner_sep:
|
|
|
|
pop ecx
|
|
|
|
pop ebx
|
|
|
|
.end_separator:
|
|
|
|
|
|
|
|
cmp byte[win.isvert], 1
|
|
|
|
je .vert_dig
|
|
|
|
mov edx, ebx
|
|
|
|
and edx, 0xFFFF0000
|
2013-10-31 21:04:03 +01:00
|
|
|
add edx, 0x00060006
|
2013-10-28 21:47:26 +01:00
|
|
|
jmp .digend
|
|
|
|
.vert_dig:
|
|
|
|
mov edx, ecx
|
|
|
|
and edx, 0xFFFF0000
|
|
|
|
shr edx, 16
|
2013-10-31 21:04:03 +01:00
|
|
|
add edx, 0x00060006
|
2013-10-28 21:47:26 +01:00
|
|
|
.digend:
|
|
|
|
|
|
|
|
imul ebx, edi, 4
|
|
|
|
add ebx, dock_items.icon
|
|
|
|
mov ebx, [ebx]
|
2013-10-31 21:04:03 +01:00
|
|
|
imul ebx, ICON_SIZE_BGR
|
2013-10-28 21:47:26 +01:00
|
|
|
add ebx, [img_data.rgb_object]
|
|
|
|
|
|
|
|
mcall 7, , <32, 32>
|
|
|
|
|
|
|
|
inc edi
|
|
|
|
jmp @b
|
|
|
|
@@:
|
|
|
|
|
|
|
|
mcall 12, 2
|
|
|
|
|
|
|
|
jmp main_loop
|
|
|
|
;-------------------------------------------------------------------------------
|
2013-10-31 21:04:03 +01:00
|
|
|
event_button:
|
2013-10-28 21:47:26 +01:00
|
|
|
mcall 17
|
|
|
|
|
|
|
|
cmp ah, 1
|
|
|
|
je .button_close
|
|
|
|
|
|
|
|
cmp ah, 2
|
|
|
|
je .button_dock
|
|
|
|
|
|
|
|
jmp @f
|
|
|
|
|
|
|
|
.button_close:
|
|
|
|
jmp exit
|
|
|
|
|
|
|
|
.button_dock:
|
|
|
|
mov edi, [win.button_index]
|
|
|
|
imul edi, 256
|
|
|
|
|
2013-10-31 21:04:03 +01:00
|
|
|
mov dword[fi.p00], 7
|
|
|
|
|
2013-10-28 21:47:26 +01:00
|
|
|
mov esi, edi
|
|
|
|
add esi, dock_items.path
|
2013-10-31 21:04:03 +01:00
|
|
|
mov dword[fi.p21], esi
|
2013-10-28 21:47:26 +01:00
|
|
|
|
|
|
|
mov esi, edi
|
|
|
|
add esi, dock_items.param
|
2013-10-31 21:04:03 +01:00
|
|
|
mov dword[fi.p08], esi
|
2013-10-28 21:47:26 +01:00
|
|
|
|
2013-10-31 21:04:03 +01:00
|
|
|
mcall 70, fi
|
2013-10-28 21:47:26 +01:00
|
|
|
|
2013-10-29 20:18:52 +01:00
|
|
|
mov ecx, eax
|
|
|
|
mcall 18, 21
|
|
|
|
and eax, 0xFFFF
|
|
|
|
mov [win.psid], eax
|
|
|
|
|
2013-10-31 21:04:03 +01:00
|
|
|
jmp wnd_hide
|
|
|
|
|
2013-10-28 21:47:26 +01:00
|
|
|
@@:
|
|
|
|
jmp main_loop
|
|
|
|
;-------------------------------------------------------------------------------
|
2013-10-31 21:04:03 +01:00
|
|
|
event_mouse:
|
2013-10-28 21:47:26 +01:00
|
|
|
mcall 37, 1
|
|
|
|
mov edi, eax
|
|
|
|
mov esi, eax
|
|
|
|
shr edi, 16
|
|
|
|
and esi, 0xFFFF
|
|
|
|
|
|
|
|
cmp edi, 0
|
2013-10-31 21:04:03 +01:00
|
|
|
jl wnd_hide
|
2013-10-28 21:47:26 +01:00
|
|
|
dec edi
|
|
|
|
cmp edi, [win.width]
|
2013-10-31 21:04:03 +01:00
|
|
|
jg wnd_hide
|
2013-10-28 21:47:26 +01:00
|
|
|
cmp esi, 0
|
2013-10-31 21:04:03 +01:00
|
|
|
jl wnd_hide
|
2013-10-28 21:47:26 +01:00
|
|
|
dec esi
|
|
|
|
cmp esi, [win.height]
|
2013-10-31 21:04:03 +01:00
|
|
|
jg wnd_hide
|
2013-10-28 21:47:26 +01:00
|
|
|
|
|
|
|
mov eax, [dock_items.location]
|
|
|
|
and eax, 1b
|
|
|
|
cmp eax, 1
|
|
|
|
jne .vert
|
|
|
|
mov eax, edi
|
|
|
|
jmp .nxt
|
|
|
|
|
|
|
|
.vert:
|
|
|
|
mov eax, esi
|
2013-11-03 17:32:45 +01:00
|
|
|
add eax, 12
|
2013-10-28 21:47:26 +01:00
|
|
|
|
|
|
|
.nxt:
|
2013-10-31 21:04:03 +01:00
|
|
|
sub eax, 12
|
2013-10-28 21:47:26 +01:00
|
|
|
mov edx, 0
|
2013-10-31 21:04:03 +01:00
|
|
|
mov ebx, BUTTON_SIZE
|
2013-10-28 21:47:26 +01:00
|
|
|
div ebx
|
|
|
|
|
|
|
|
cmp eax, [dock_items.count]
|
|
|
|
jge .set0
|
|
|
|
jmp .nxtcmp
|
|
|
|
|
|
|
|
.set0:
|
|
|
|
mov eax, 100
|
|
|
|
|
|
|
|
.nxtcmp:
|
|
|
|
cmp [win.button_index], eax
|
|
|
|
je .nxt2
|
|
|
|
|
|
|
|
mov [win.button_index], eax
|
|
|
|
|
|
|
|
.nxt2:
|
|
|
|
mov eax, [win.button_index]
|
2013-10-31 21:04:03 +01:00
|
|
|
imul eax, BUTTON_SIZE
|
2013-10-28 21:47:26 +01:00
|
|
|
cmp byte[win.isvert], 1
|
|
|
|
je .vert_name
|
|
|
|
add eax, [win.x]
|
|
|
|
mov [nwin.x], eax
|
2013-11-03 17:32:45 +01:00
|
|
|
mov byte[nwin.change_shape], 1
|
|
|
|
mcall 13, <0, [win.width]>, <[win.height], 1>, [color.frame]
|
2013-10-28 21:47:26 +01:00
|
|
|
jmp .vert_end
|
|
|
|
.vert_name:
|
|
|
|
add eax, [win.y]
|
2013-11-03 17:32:45 +01:00
|
|
|
add eax, 14
|
2013-10-28 21:47:26 +01:00
|
|
|
mov [nwin.y], eax
|
|
|
|
mov byte[nwin.change_shape], 1
|
2013-11-03 17:32:45 +01:00
|
|
|
mcall 13, <[win.width], 1>, <0, [win.height]>, [color.frame]
|
|
|
|
.vert_end:
|
2013-10-28 21:47:26 +01:00
|
|
|
|
|
|
|
cmp byte[win.state], 1
|
2013-10-31 21:04:03 +01:00
|
|
|
je main_loop
|
2013-10-28 21:47:26 +01:00
|
|
|
|
|
|
|
mov edx, esp
|
|
|
|
add edx, 512
|
|
|
|
mcall 51, 1, n_main
|
|
|
|
|
2013-10-28 23:17:24 +01:00
|
|
|
mov eax, 18
|
|
|
|
|
|
|
|
mcall , 7
|
2013-10-28 21:47:26 +01:00
|
|
|
mov [win.psid], eax
|
|
|
|
|
2013-10-29 15:29:49 +01:00
|
|
|
mcall 18, 3, [win.sid]
|
2013-10-28 21:47:26 +01:00
|
|
|
|
|
|
|
mov byte[win.state], 1
|
|
|
|
|
|
|
|
mov eax, [win.width_opn]
|
|
|
|
mov [win.width], eax
|
|
|
|
|
|
|
|
mov eax, [win.x_opn]
|
|
|
|
mov [win.x], eax
|
|
|
|
|
|
|
|
mov eax, [win.height_opn]
|
|
|
|
mov [win.height], eax
|
|
|
|
|
|
|
|
mov eax, [win.y_opn]
|
|
|
|
mov [win.y], eax
|
|
|
|
|
|
|
|
mcall 67, [win.x], [win.y], [win.width], [win.height]
|
|
|
|
|
2013-10-31 21:04:03 +01:00
|
|
|
jmp event_redraw
|
2013-10-28 21:47:26 +01:00
|
|
|
|
2013-10-31 21:04:03 +01:00
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
wnd_hide:
|
2013-10-28 21:47:26 +01:00
|
|
|
cmp byte[win.state], 0
|
2013-10-31 21:04:03 +01:00
|
|
|
je main_loop
|
2013-10-28 21:47:26 +01:00
|
|
|
|
|
|
|
mov byte[nwin.close], 1
|
|
|
|
|
|
|
|
mcall 18, 3, [win.psid]
|
|
|
|
|
|
|
|
mov byte[win.state], 0
|
|
|
|
mov byte[win.button_index], -1
|
|
|
|
|
|
|
|
mov eax, [win.width_hdn]
|
|
|
|
mov [win.width], eax
|
|
|
|
|
|
|
|
mov eax, [win.x_hdn]
|
|
|
|
mov [win.x], eax
|
|
|
|
|
|
|
|
mov eax, [win.height_hdn]
|
|
|
|
mov [win.height], eax
|
|
|
|
|
|
|
|
mov eax, [win.y_hdn]
|
|
|
|
mov [win.y], eax
|
|
|
|
|
|
|
|
mcall 67, [win.x], [win.y], [win.width], [win.height]
|
|
|
|
|
2013-10-31 21:04:03 +01:00
|
|
|
jmp event_redraw
|
2013-10-28 21:47:26 +01:00
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
proc sections_callback, _file_name, _section_name
|
|
|
|
mov eax, [_section_name]
|
|
|
|
cmp byte[eax], '@'
|
|
|
|
jne @f
|
|
|
|
|
|
|
|
dec dword[dock_items.count]
|
|
|
|
jmp .endproc
|
|
|
|
|
|
|
|
@@:
|
|
|
|
; ==== GET NAME ====
|
|
|
|
mov ebx, [dock_items.count]
|
|
|
|
imul ebx, 16
|
|
|
|
add ebx, dock_items.name
|
|
|
|
|
|
|
|
mov eax, [_section_name]
|
|
|
|
|
|
|
|
mov edi, 0
|
|
|
|
@@:
|
|
|
|
mov cl, byte[eax]
|
|
|
|
mov byte[ebx + edi], cl
|
|
|
|
|
|
|
|
inc eax
|
|
|
|
inc edi
|
|
|
|
cmp edi, 10
|
|
|
|
jne @b
|
|
|
|
|
|
|
|
; ==== GET PATH ====
|
|
|
|
mov ebx, [dock_items.count]
|
|
|
|
imul ebx, 256
|
|
|
|
add ebx, dock_items.path
|
|
|
|
|
|
|
|
invoke ini.get_str, [_file_name], [_section_name], ini_data.path_name, ebx, 256, 0
|
|
|
|
|
|
|
|
; === GET PARAM ===
|
|
|
|
mov ebx, [dock_items.count]
|
|
|
|
imul ebx, 256
|
|
|
|
add ebx, dock_items.param
|
|
|
|
|
|
|
|
invoke ini.get_str, [_file_name], [_section_name], ini_data.param_name, ebx, 256, 0
|
|
|
|
|
|
|
|
; ==== GET ICON ====
|
|
|
|
invoke ini.get_int, [_file_name], [_section_name], ini_data.icon_name, 0
|
|
|
|
|
|
|
|
mov ebx, [dock_items.count]
|
|
|
|
imul ebx, 4
|
|
|
|
mov [dock_items.icon + ebx], eax
|
|
|
|
|
|
|
|
; ==== GET SEPARATOR ====
|
|
|
|
invoke ini.get_int, [_file_name], [_section_name], ini_data.separator_name, 0
|
|
|
|
|
|
|
|
mov ebx, [dock_items.count]
|
|
|
|
mov byte[dock_items.separator + ebx], al
|
|
|
|
|
|
|
|
; ====== END =======
|
|
|
|
.endproc:
|
|
|
|
mov eax, 1
|
|
|
|
inc dword[dock_items.count]
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
;-------------------------------------------------------------------------------
|
2013-10-31 21:04:03 +01:00
|
|
|
include "MEMORY.INC"
|