Apps: fixed 3 programs for using a long path in parameters

git-svn-id: svn://kolibrios.org@10017 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Doczom 2024-05-10 16:54:08 +00:00
parent 6fbd7cd2f9
commit 9c44899099
3 changed files with 101 additions and 96 deletions

View File

@ -1,7 +1,9 @@
use32
org 0
db 'MENUET01'
dd 1, @ENTRY, @end, @memory, @stack, @params, 0
db 'MENUET01'
dd 1, @ENTRY, @end, @memory, @stack
M01header.params:
dd @params, 0
include "../../macros.inc"
include "../../proc32.inc"
@ -11,9 +13,9 @@
include "notify.inc"
LINEH equ 12
LINEH equ 12
MARGIN equ 12
ICONS equ 11
ICONS equ 11
;-------------------------------------------------------------------------------
@ -31,8 +33,8 @@
mcall 18, 25, 2, -1, 1
;; SET STD PARAMS, IF IT NEEDS
mov eax, @params
cmpne byte [@params], 0, @f
mov eax, [M01header.params]
cmpne byte [eax], 0, @f
mov eax, sz_std
@@:
mov [params.source], eax
@ -499,8 +501,8 @@
mov edx, [window.height]
shr edx, 1
sub edx, 12
stdcall dword [img.draw], dword [img_data.obj], 12, edx, 24, 24, 0, ebx
stdcall dword [img.draw], dword [img_data.obj], 12, edx, 24, 24, 0, ebx
@@:
ret
@ -757,8 +759,8 @@
@imports:
library img, "libimg.obj"
import img, img.to_rgb, "img_to_rgb2", \
img.decode, "img_decode", \
img.draw, "img_draw"
img.decode, "img_decode", \
img.draw, "img_draw"
;----------------------------
@ -766,31 +768,31 @@
sz_ifile db "/sys/notify3.png", 0
sz_shname db "notify-mem-v01", 0
sz_std db "'NOTIFY 3\n", \
"d - disable auto-closing\n", \
"c - disable click-closing\n", \
"p - use progressbar\n", \
"t - title\n", \
" \n", \
"ICONS:\n", \
"A - application\n", \
"E - error\n", \
"W - warning\n", \
"O - ok\n", \
"N - network\n", \
"I - info\n", \
"F - folder\n", \
"C - component\n", \
"M - mail\n", \
"D - download\n", \
"S - audio player", \
"' -td", 0
"d - disable auto-closing\n", \
"c - disable click-closing\n", \
"p - use progressbar\n", \
"t - title\n", \
" \n", \
"ICONS:\n", \
"A - application\n", \
"E - error\n", \
"W - warning\n", \
"O - ok\n", \
"N - network\n", \
"I - info\n", \
"F - folder\n", \
"C - component\n", \
"M - mail\n", \
"D - download\n", \
"S - audio player", \
"' -td", 0
fi:
dd 5
dd 0, 0, 0
dd buffer
db 0
dd sz_ifile
dd 5
dd 0, 0, 0
dd buffer
db 0
dd sz_ifile
;----------------------------
@ -799,8 +801,8 @@
;=====================================================================
window:
.x rd 1
.y rd 1
.x rd 1
.y rd 1
.width rd 1
.height rd 1
@ -816,28 +818,28 @@
params:
.source rd 1
.atcl rb 1
.clcl rb 1
.atcl rb 1
.clcl rb 1
.title rb 1
.pbar rb 1
.icon rb 1
.ctrl rb 1
.pbar rb 1
.icon rb 1
.ctrl rb 1
img_data:
.file rd 1
.obj rd 1
.obj rd 1
timer:
.value rd 1
.step rd 1
.step rd 1
shm:
.addr rd 1
.our rd 1
.addr rd 1
.our rd 1
ctrl:
.name rb 31
.addr rd 1
.name rb 31
.addr rd 1
pbar:
.width rd 1
@ -850,8 +852,8 @@
prev_pid rd 1
;=====================================================================
rb 2048
rb 2048
@stack:
@params rb 2048
@params rb 256
@memory:

View File

@ -9,8 +9,10 @@
use32
org 0
db 'MENUET01'
dd 1, main, dataend, memory, memory, params, 0
db 'MENUET01'
dd 1, main, dataend, memory, memory
M01header.params:
dd params, 0
include "../../proc32.inc"
include "../../macros.inc"
@ -62,7 +64,7 @@ end if
sb_apps scrollbar \
13, WIN_WIDTH - 25, LIST_HEIGHT, 10 + 12, \ ;; w, x, h, y
0, 0, LIST_SIZE / 2, 0, \ ;; b.h, max, area, pos
0, 0, LIST_SIZE / 2, 0, \ ;; b.h, max, area, pos
0, 0, 0, 2
cb_always check_box2 \
@ -91,16 +93,16 @@ end if
.filter dd 0
ps_addres:
dd 0 ;; type
dw 7 ;; y
dw 4 ;; x
dw 6 ;; font.w
dd 0 ;; type
dw 7 ;; y
dw 4 ;; x
dw 6 ;; font.w
dw LIST_WIDTH ;; w
dd 0 ;; mono
dd 0 ;; without bg
.color dd 0 ;; text color
dd 0 ;; bg color
.txt dd 0 ;; text
dd 0 ;; mono
dd 0 ;; without bg
.color dd 0 ;; text color
dd 0 ;; bg color
.txt dd 0 ;; text
dd buffer2
dd 0
@ -148,28 +150,28 @@ end if
imports:
library libini, "libini.obj"
import libini, libini.get_str, "ini_get_str", \
libini.set_str, "ini_set_str", \
libini.get_num, "ini_get_int", \
libini.for_each_section, "ini_enum_sections"
libini.set_str, "ini_set_str", \
libini.get_num, "ini_get_int", \
libini.for_each_section, "ini_enum_sections"
imports_add:
library libimg, "libimg.obj", \
boxlib, "box_lib.obj", \
prclib, "proc_lib.obj"
boxlib, "box_lib.obj", \
prclib, "proc_lib.obj"
import libimg, libimg.init, "lib_init", \
libimg.toRGB, "img_to_rgb2", \
libimg.decode, "img_decode", \
libimg.destroy, "img_destroy"
libimg.toRGB, "img_to_rgb2", \
libimg.decode, "img_decode", \
libimg.destroy, "img_destroy"
import boxlib, scrollbar.draw, "scrollbar_v_draw", \
scrollbar.mouse, "scrollbar_v_mouse", \
pathshow.init, "PathShow_prepare", \
pathshow.draw, "PathShow_draw", \
checkbox.init, "init_checkbox2", \
checkbox.draw, "check_box_draw2", \
checkbox.mouse, "check_box_mouse2"
scrollbar.mouse, "scrollbar_v_mouse", \
pathshow.init, "PathShow_prepare", \
pathshow.draw, "PathShow_draw", \
checkbox.init, "init_checkbox2", \
checkbox.draw, "check_box_draw2", \
checkbox.mouse, "check_box_mouse2"
import prclib, opendialog.lib_init, "lib_init", \
opendialog.init, "OpenDialog_init", \
opendialog.start, "OpenDialog_start"
opendialog.init, "OpenDialog_init", \
opendialog.start, "OpenDialog_start"
;===============================
@ -178,18 +180,18 @@ end if
stdcall dll.Load, imports
if DEBUG eq 1
stdcall string.copy, std_param, params
stdcall string.copy, std_param, [M01header.params]
end if
;; trim params
stdcall string.copy, params, paramorig
stdcall string.copy, [M01header.params], paramorig
stdcall string.trim_last, paramorig
stdcall string.trim_first, paramorig
mov [param_s], eax
mov [param_s], eax
stdcall string.to_lower_case, params
stdcall string.trim_last, params
stdcall string.trim_first, params
stdcall string.to_lower_case, [M01header.params]
stdcall string.trim_last, [M01header.params]
stdcall string.trim_first, [M01header.params]
mov [param_lwr], eax
;; if empty - exit
@ -267,7 +269,7 @@ end if
;----------------------
start_dialog_pre:
or [cb_always.flags], ch_flag_en
or [cb_always.flags], ch_flag_en
start_dialog:
stdcall dll.Load, imports_add
@ -299,7 +301,7 @@ end if
mov ebx, [skin.work_text]
mov [ps_addres.txt], eax
mov [ps_addres], ebx
m2m [ps_addres.color], [skin.work_text]
m2m [ps_addres.color], [skin.work_text]
invoke pathshow.init, ps_addres
;; get checkbox
@ -584,8 +586,8 @@ end if
@@:
stdcall string.length, buffer
mov edi, eax
mov edi, eax
invoke libini.set_str, assoc_ini, assoc_ini.sec, [param_e], buffer, edi
jmp exit
@ -596,7 +598,7 @@ end if
mov edi, [sb_apps.position]
invoke scrollbar.mouse, sb_apps
sub edi, [sb_apps.position]
jz @f
jz @f
call draw_list
@@:
@ -676,7 +678,7 @@ end if
mcall 12, 1
mov edx, [skin.work]
or edx, 0x34 shl 24
or edx, 0x34 shl 24
mcall 0, <[win.x], WIN_WIDTH>, <[win.y], WIN_HEIGHT>, , , win.title
stdcall draw_list
invoke pathshow.draw, ps_addres
@ -722,7 +724,7 @@ end if
proc draw_list
mcall 13, <3, LIST_WIDTH + 2 + 12>, <9 + 12, 1>, [skin.work_graph]
mcall , , <LIST_HEIGHT + 9 + 1 + 12, 1>
mcall , , <LIST_HEIGHT + 9 + 1 + 12, 1>
mcall , <3, 1>, <9 + 12, LIST_HEIGHT + 1>
mcall , <3 + LIST_WIDTH + 12 + 1, 1>
mcall , <4, LIST_WIDTH>, <10 + 12, LIST_HEIGHT>, 0xFFFfff
@ -979,7 +981,7 @@ end if
.loop1:
mov edx, list.lowercased ;; j = 0
mov esi, [list.size] ;; j < n - i - 1
mov esi, [list.size] ;; j < n - i - 1
sub esi, edi
dec esi
imul esi, 32
@ -1056,9 +1058,9 @@ end if
buffer4 rb 2048 ;OD
buffer5 rb 2048 ;OD
buffer6 rb 2048 ;check existance
buffer7 rb 32 ;for sorting
buffer7 rb 32 ;for sorting
buffer8 rd 2048
params rb 2048
paramorig rb 2048
_stack rb 2048
params rb 256
memory:

View File

@ -23,6 +23,7 @@
dd IM_END ; file size
dd I_END ; memory
dd stacktop ; stack pointer
M01header.params:
dd app_param ; parameters
dd cur_dir_path ; path to file
@ -115,8 +116,8 @@ load_libraries l_libs_start,end_l_libs
stdcall string.copy, default_dtp, dtp_name
;---------------------------------------------------------------------
; check app param
stdcall string.length, app_param
add eax, app_param
stdcall string.length, [M01header.params]
add eax, [M01header.params]
mov ecx, [eax-4]
or ecx, 0x20202000 ;letters to lowercase
cmp ecx, '.skn'
@ -126,12 +127,12 @@ load_libraries l_libs_start,end_l_libs
jmp no_param
load_dtp_from_param:
stdcall string.copy, app_param, dtp_name
stdcall string.copy, [M01header.params], dtp_name
call load_dtp_file.1
jmp skin_path_ready
load_skin_from_param:
stdcall string.copy, app_param, skin_info
stdcall string.copy, [M01header.params], skin_info
call load_skin_file.2
jmp skin_path_ready