forked from KolibriOS/kolibrios
Open Dialog - component to select the file
Build.sh - script to compile examples Box_lib under Linux git-svn-id: svn://kolibrios.org@1219 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
c002678faf
commit
c2b5a1b2a8
2501
programs/develop/libraries/box_lib/asm/trunk/OpenDial.asm
Normal file
2501
programs/develop/libraries/box_lib/asm/trunk/OpenDial.asm
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,9 +1,16 @@
|
||||
REM compiling examples
|
||||
if not exist bin mkdir bin
|
||||
|
||||
@fasm.exe -m 16384 ctrldemo.asm bin\ctrldemo.kex
|
||||
@kpack bin\ctrldemo.kex
|
||||
@copy cnv_bmp.obj bin\cnv_bmp.obj
|
||||
@copy reload_16x16_8b.bmp bin\reload_16x16_8b.bmp
|
||||
|
||||
@fasm.exe -m 16384 OpenDial.asm bin\OpenDial.kex
|
||||
@kpack bin\OpenDial.kex
|
||||
|
||||
@copy reload_16x16_8b.png bin\reload_16x16_8b.png
|
||||
@copy cnv_png.obj bin\cnv_png.obj
|
||||
@copy icons.ini bin\icons.ini
|
||||
@copy z_icons.png bin\z_icons.png
|
||||
|
||||
@fasm.exe -m 16384 editbox_ex.asm bin\editbox_ex.kex
|
||||
@kpack bin\editbox_ex.kex
|
||||
|
19
programs/develop/libraries/box_lib/asm/trunk/build.sh
Executable file
19
programs/develop/libraries/box_lib/asm/trunk/build.sh
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
# This script does for Linux the same as build.bat for DOS,
|
||||
# it compiles the current KolibriOS applications
|
||||
|
||||
echo "lang fix en"
|
||||
echo "lang fix en" > lang.inc
|
||||
mkdir bin
|
||||
fasm -m 16384 ctrldemo.asm ./bin/ctrldemo.kex
|
||||
fasm -m 16384 OpenDial.asm ./bin/OpenDial.kex
|
||||
fasm -m 16384 editbox_ex.asm ./bin/editbox_ex.kex
|
||||
rm -f lang.inc
|
||||
cp reload_16x16_8b.png ./bin/reload_16x16_8b.png
|
||||
cp cnv_png.obj ./bin/cnv_png.obj
|
||||
cp icons.ini ./bin/icons.ini
|
||||
cp z_icons.png ./bin/z_icons.png
|
||||
exit 0
|
||||
|
||||
|
||||
|
Binary file not shown.
BIN
programs/develop/libraries/box_lib/asm/trunk/cnv_png.obj
Normal file
BIN
programs/develop/libraries/box_lib/asm/trunk/cnv_png.obj
Normal file
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
;
|
||||
;*****************************************************************************
|
||||
; Example for Box_lib: scrollbar, menubar, dinamic_button
|
||||
; Copyright (c) 2009, Mario79
|
||||
; Copyright (c) 2009, Marat Zakiyanov aka Mario79, aka Mario
|
||||
; All rights reserved.
|
||||
;
|
||||
; Redistribution and use in source and binary forms, with or without
|
||||
@ -14,7 +14,7 @@
|
||||
; names of its contributors may be used to endorse or promote products
|
||||
; derived from this software without specific prior written permission.
|
||||
;
|
||||
; THIS SOFTWARE IS PROVIDED BY Mario79 ''AS IS'' AND ANY
|
||||
; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
|
||||
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
|
||||
@ -24,7 +24,7 @@
|
||||
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
;*****************************************************************************
|
||||
;******************************************************************************
|
||||
; import_boxlib procedure written by <Lrz>
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
@ -42,6 +42,11 @@
|
||||
|
||||
include '../../../../../macros.inc'
|
||||
include '../../load_lib.mac'
|
||||
;include 'macros.inc'
|
||||
;include 'load_lib.mac'
|
||||
@use_library
|
||||
include 'opendial.mac'
|
||||
use_OpenDialog
|
||||
;---------------------------------------------------------------------
|
||||
;--- Start of program ----------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
@ -50,69 +55,25 @@ START:
|
||||
mcall 66, 1, 1
|
||||
mcall 40, 0x27
|
||||
;---------------------------------------------------------------------
|
||||
; Procinfo area for function 9 in MenuBar
|
||||
mcall 68,12,1024
|
||||
mov [menu_data_1.procinfo],eax
|
||||
mov [menu_data_2.procinfo],eax
|
||||
;---------------------------------------------------------------------
|
||||
; loading Box_Lib library
|
||||
|
||||
load_libraries l_libs_start,end_l_libs
|
||||
;sys_load_library boxlib_name, path, file_name, system_dir, \
|
||||
;er_message_found_lib, ihead_f_l, myimport, er_message_import, ihead_f_i
|
||||
; test eax,eax
|
||||
; jnz button.exit
|
||||
|
||||
;----------------------------------old
|
||||
; mov ebx,boxlib_name
|
||||
; mov esi,path
|
||||
; mov edi,file_name
|
||||
; call copy_path
|
||||
;
|
||||
; mcall 68,19,file_name ; load of alternative
|
||||
; test eax,eax
|
||||
; jnz @f
|
||||
;
|
||||
; mcall 68,19,system_dir ; load of sys directory
|
||||
; test eax,eax
|
||||
; jz button.exit
|
||||
;@@:
|
||||
; call import_boxlib
|
||||
;---------------------------------------------------------------------
|
||||
; Load and convert BMP file for DinamicButton
|
||||
; This procedures use cnv_bmp.obj and this module used only for
|
||||
; demonstration of use DinamicButton
|
||||
|
||||
; mov ebx,plugin_BMP_name
|
||||
; mov esi,path
|
||||
; mov edi,file_name
|
||||
copy_path plugin_BMP_name,path,file_name
|
||||
;
|
||||
mcall 68,19,file_name
|
||||
test eax,eax
|
||||
jz button.exit
|
||||
|
||||
mov eax,[eax+4]
|
||||
mov [plugin],eax
|
||||
|
||||
|
||||
;ïðîâåðêà íà ñêîëüêî óäà÷íî çàãóçèëàñü íàøà ëèáà
|
||||
mov ebp,library01
|
||||
cmp dword [ebp+ll_struc_size-4],0
|
||||
jnz button.exit
|
||||
;
|
||||
; mov ebp,library02
|
||||
; cmp dword [ebp+ll_struc_size-4],0x2
|
||||
; jnz button.exit
|
||||
; mov eax,dword [ebp+36]
|
||||
; mov eax,[eax+4]
|
||||
; mov [plugin],eax
|
||||
|
||||
; unpack deflate
|
||||
mov eax,[unpack_DeflateUnpack2]
|
||||
mov [deflate_unpack],eax
|
||||
|
||||
;OpenDialog initialisation
|
||||
init_OpenDialog OpenDialog_data
|
||||
|
||||
|
||||
; mov ebx,icons_file_name
|
||||
; mov esi,path
|
||||
; mov edi,file_name
|
||||
copy_path icons_file_name,path,file_name
|
||||
|
||||
copy_path icons_file_name,path,library_path,0
|
||||
|
||||
mcall 70, fileinfo
|
||||
|
||||
@ -135,7 +96,7 @@ load_libraries l_libs_start,end_l_libs
|
||||
xor eax,eax
|
||||
mov [return_code],eax
|
||||
mov eax,image_file
|
||||
call [plugin]
|
||||
call [cnv_png_import.Start]
|
||||
|
||||
mov ecx,[image_file]
|
||||
mcall 68, 13,
|
||||
@ -296,7 +257,10 @@ mouse:
|
||||
;---------------------------------------------------------------------
|
||||
analyse_out_menu_1:
|
||||
; analyse result of Menu 1
|
||||
cmp [menu_data_1.cursor_out],dword 3
|
||||
mov eax,[menu_data_1.cursor_out]
|
||||
cmp eax,dword 1
|
||||
je OpenDialog_start
|
||||
cmp eax,dword 3
|
||||
je button.exit
|
||||
jmp still
|
||||
|
||||
@ -310,6 +274,44 @@ analyse_out_menu_2:
|
||||
mcall 51,1,thread3,thread
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
OpenDialog_start:
|
||||
; mov ebx,open_dialog_name
|
||||
; mov esi,path
|
||||
; mov edi,library_path
|
||||
; call copy_file_path
|
||||
call get_filter_data
|
||||
|
||||
copy_path open_dialog_name,path,library_path,0
|
||||
|
||||
|
||||
start_OpenDialog OpenDialog_data
|
||||
|
||||
cmp [OpenDialog_data.status],2 ; OpenDialog does not start
|
||||
je still ; some kind of alternative, instead OpenDialog
|
||||
cmp [OpenDialog_data.status],1
|
||||
jne still ; OpenDialog user say cancel
|
||||
; copy path
|
||||
call draw_window
|
||||
jmp still ; OpenDialog user selected the target file
|
||||
; [OpenDialog_data.openfile_pach] pointer of area the target file
|
||||
;---------------------------------------------------------------------
|
||||
get_filter_data:
|
||||
mov edi,[OpenDialog_data.com_area]
|
||||
test edi,edi
|
||||
jnz @f
|
||||
add esp,4
|
||||
jmp still
|
||||
@@:
|
||||
add edi,4096+4
|
||||
mov esi,Filter
|
||||
mov ecx,[esi]
|
||||
inc ecx
|
||||
cld
|
||||
rep movsb
|
||||
mov edi,[OpenDialog_data.com_area]
|
||||
mov [edi+4096],dword 1
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
draw_window:
|
||||
mcall 12, 1
|
||||
mcall 0, <0,400>, <0,400>, 0x03AABBCC, 0x805080D0, 0x005080D0
|
||||
@ -328,6 +330,11 @@ draw_window:
|
||||
; draw for Dinamic Button 2
|
||||
push dword dinamic_button_data_2
|
||||
call [dinamic_button_draw]
|
||||
;---------------------------------------------
|
||||
mcall 13,<170,200>,<25,15>,0xffffb0
|
||||
mov bx,28
|
||||
add ebx,2 shl 16
|
||||
mcall 4,,0xC0000000,openfile_pach,,0xffffb0
|
||||
;---------------------------------------------
|
||||
; set all_redraw flag for draw all ScrollBar
|
||||
; In some cases it is necessity to draw only the area
|
||||
@ -365,19 +372,35 @@ draw_cube:
|
||||
mov bx,30
|
||||
mcall 13, , , 0x0
|
||||
ret
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
include 'data.inc'
|
||||
include 'w_about.inc'
|
||||
;---------------------------------------------------------------------
|
||||
IM_END:
|
||||
rb 1024
|
||||
thread:
|
||||
;---------------------------------------------------------------------
|
||||
rb 1024
|
||||
stacktop:
|
||||
;---------------------------------------------------------------------
|
||||
path:
|
||||
rb 4096
|
||||
file_name:
|
||||
;---------------------------------------------------------------------
|
||||
openfile_pach:
|
||||
rb 4096
|
||||
;---------------------------------------------------------------------
|
||||
file_name:
|
||||
library_path:
|
||||
rb 4096
|
||||
;---------------------------------------------------------------------
|
||||
plugin_pach:
|
||||
rb 4096
|
||||
;---------------------------------------------------------------------
|
||||
file_info:
|
||||
rb 40
|
||||
;---------------------------------------------------------------------
|
||||
procinfo:
|
||||
rb 1024
|
||||
;---------------------------------------------------------------------
|
||||
I_END:
|
||||
|
||||
|
@ -1,170 +0,0 @@
|
||||
;**************************************************************
|
||||
; Dinamic Button Macro for Kolibri OS
|
||||
; Copyright (c) 2009, Mario79
|
||||
; All rights reserved.
|
||||
;
|
||||
; Redistribution and use in source and binary forms, with or without
|
||||
; modification, are permitted provided that the following conditions are met:
|
||||
; * Redistributions of source code must retain the above copyright
|
||||
; notice, this list of conditions and the following disclaimer.
|
||||
; * Redistributions in binary form must reproduce the above copyright
|
||||
; notice, this list of conditions and the following disclaimer in the
|
||||
; documentation and/or other materials provided with the distribution.
|
||||
; * Neither the name of the <organization> nor the
|
||||
; names of its contributors may be used to endorse or promote products
|
||||
; derived from this software without specific prior written permission.
|
||||
;
|
||||
; THIS SOFTWARE IS PROVIDED BY Mario79 ''AS IS'' AND ANY
|
||||
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
|
||||
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
;*****************************************************************************
|
||||
macro dinamic_button_exit
|
||||
{
|
||||
popa
|
||||
ret 4
|
||||
}
|
||||
;*****************************************************************************
|
||||
macro use_dinamic_button
|
||||
{
|
||||
dinamic_button:
|
||||
db_type equ [edi]
|
||||
db_size_x equ [edi+4]
|
||||
db_start_x equ [edi+6]
|
||||
db_size_y equ [edi+8]
|
||||
db_start_y equ [edi+10]
|
||||
db_mouse_pos equ [edi+12]
|
||||
db_mouse_keys equ [edi+16]
|
||||
db_mouse_keys_old equ [edi+20]
|
||||
db_active_raw equ [edi+24]
|
||||
db_passive_raw equ [edi+28]
|
||||
db_click_raw equ [edi+32]
|
||||
db_resolution_raw equ [edi+36]
|
||||
db_palette_raw equ [edi+40]
|
||||
db_offset_raw equ [edi+44]
|
||||
db_select equ [edi+48]
|
||||
db_click equ [edi+52]
|
||||
;*****************************************************************************
|
||||
;*****************************************************************************
|
||||
; draw event
|
||||
;*****************************************************************************
|
||||
;*****************************************************************************
|
||||
.draw:
|
||||
pusha
|
||||
mov edi,dword [esp+36]
|
||||
call .draw_1
|
||||
dinamic_button_exit
|
||||
|
||||
.draw_1:
|
||||
cmp db_select,dword 1
|
||||
je .active_1
|
||||
cmp db_select,dword 2
|
||||
je .click_2
|
||||
mov ebx,db_passive_raw
|
||||
jmp .draw_2 ;@f
|
||||
.active_1:
|
||||
mov ebx,db_active_raw
|
||||
jmp .draw_2 ;@f
|
||||
.click_2:
|
||||
mov ebx,db_click_raw
|
||||
@@:
|
||||
.draw_2:
|
||||
mov cx,db_size_x
|
||||
shl ecx,16
|
||||
mov cx,db_size_y
|
||||
|
||||
mov dx,db_start_x
|
||||
shl edx,16
|
||||
mov dx,db_start_y
|
||||
|
||||
mov esi,db_resolution_raw
|
||||
|
||||
mov ebp,db_offset_raw
|
||||
|
||||
push edi
|
||||
mov edi,db_palette_raw
|
||||
mcall 65
|
||||
pop edi
|
||||
ret
|
||||
;*****************************************************************************
|
||||
;*****************************************************************************
|
||||
; mouse event
|
||||
;*****************************************************************************
|
||||
;*****************************************************************************
|
||||
.mouse:
|
||||
pusha
|
||||
mov edi,dword [esp+36]
|
||||
mcall 37,2
|
||||
mov ebx,db_mouse_keys
|
||||
mov db_mouse_keys_old,ebx
|
||||
|
||||
mov db_mouse_keys,eax
|
||||
|
||||
mcall 37,1
|
||||
mov db_mouse_pos,eax
|
||||
|
||||
test eax,0x80000000
|
||||
jnz .exit_menu
|
||||
test eax,0x8000
|
||||
jnz .exit_menu
|
||||
|
||||
mov ebx,eax
|
||||
shr ebx,16 ; x position
|
||||
shl eax,16
|
||||
shr eax,16 ; y position
|
||||
|
||||
mov cx,db_start_x
|
||||
cmp bx,cx
|
||||
jb .exit_menu
|
||||
|
||||
add cx,db_size_x
|
||||
cmp bx,cx
|
||||
ja .exit_menu
|
||||
|
||||
mov cx,db_start_y
|
||||
cmp ax,cx
|
||||
jb .exit_menu
|
||||
|
||||
add cx,db_size_y
|
||||
cmp ax,cx
|
||||
ja .exit_menu
|
||||
|
||||
test db_mouse_keys,dword 1b
|
||||
jnz @f
|
||||
cmp db_select,dword 1
|
||||
je .exit_menu_1
|
||||
mov db_select,dword 1
|
||||
call .draw_1
|
||||
jmp .exit_menu_1
|
||||
@@:
|
||||
mov eax,db_mouse_keys
|
||||
cmp eax,db_mouse_keys_old
|
||||
je .exit_menu_1
|
||||
|
||||
mov db_select,dword 2
|
||||
call .draw_1
|
||||
mcall 5, 25
|
||||
mov db_select,dword 1
|
||||
call .draw_1
|
||||
|
||||
mov db_click,dword 1
|
||||
jmp .exit_menu_2
|
||||
|
||||
.exit_menu:
|
||||
cmp db_select,dword 0
|
||||
je .exit_menu_1
|
||||
mov db_select,dword 0
|
||||
|
||||
call .draw_1
|
||||
|
||||
.exit_menu_1:
|
||||
; mov db_click,dword 0
|
||||
.exit_menu_2:
|
||||
dinamic_button_exit
|
||||
}
|
@ -1,19 +1,24 @@
|
||||
;---------------------------------------------------------------------
|
||||
;--- ÄÀÍÍÛÅ ÏÐÎÃÐÀÌÌÛ ----------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
@use_library
|
||||
header_1 db 'Box_lib Control Demo by Mario79',0
|
||||
|
||||
ok_btn db 'Ok',0
|
||||
|
||||
labelt3 db 'About program',0
|
||||
;---------------------------------------------------------------------
|
||||
icons_file_name: db 'reload_16x16_8b.bmp',0
|
||||
icons_file_name: db 'reload_16x16_8b.png',0
|
||||
system_dir1 db '/sys/lib/'
|
||||
plugin_BMP_name db 'cnv_bmp.obj',0
|
||||
|
||||
system_dir db '/sys/lib/'
|
||||
boxlib_name db 'box_lib.obj',0
|
||||
|
||||
;plugins_directory db 'plugins/',0
|
||||
plugins_directory db 0
|
||||
|
||||
system_dir_Boxlib db '/sys/lib/box_lib.obj',0
|
||||
system_dir_CnvPNG db '/sys/lib/cnv_png.obj',0
|
||||
system_dir_UNPACK db '/sys/lib/archiver.obj',0
|
||||
; Åñëè åñòü æåëàíèå ðàçúåäèíèòü, òî íóæíî èñïîëüçîâàòü ñëåäóþùèþ êîíñòðóêöèþ
|
||||
;system_path db '/sys/lib/box_lib.obj',0
|
||||
;... ëþáàÿ ïîñëåäîâàòåëüíîñòü äðóãèõ êîìàíä è îïðåäåëåíèé.
|
||||
@ -25,20 +30,76 @@ ihead_f_l db 'System error',0
|
||||
er_message_found_lib db 'Sorry I cannot load library box_lib.obj',0
|
||||
er_message_import db 'Error on load import library box_lib.obj',0
|
||||
|
||||
er_message_found_lib2 db 'Sorry I cannot load library cnv_bmp.obj',0
|
||||
er_message_import2 db 'Error on load import library cnv_bmp.obj',0
|
||||
er_message_found_lib2 db 'cnv_png.obj - Not found!',0
|
||||
er_message_import2 db 'cnv_png.obj - Wrong import!',0
|
||||
|
||||
err_message_found_lib3 db 'archiver.obj - Not found!',0
|
||||
err_message_import3 db 'archiver.obj - Wrong import!',0
|
||||
|
||||
align 4
|
||||
l_libs_start:
|
||||
library01 l_libs boxlib_name, path, file_name, system_dir, \
|
||||
er_message_found_lib, ihead_f_l, myimport, er_message_import, ihead_f_i
|
||||
library01 l_libs system_dir_Boxlib+9, path, file_name, system_dir_Boxlib, \
|
||||
er_message_found_lib, ihead_f_l, Box_lib_import, er_message_import, ihead_f_i, plugins_directory
|
||||
|
||||
;library02 l_libs plugin_BMP_name, path, file_name, system_dir1,\
|
||||
;er_message_found_lib2, ihead_f_l, myimport, er_message_import2, ihead_f_i
|
||||
library02 l_libs system_dir_CnvPNG+9, path, file_name, system_dir_CnvPNG,\
|
||||
er_message_found_lib2, ihead_f_l, cnv_png_import, er_message_import2, ihead_f_i, plugins_directory
|
||||
|
||||
library03 l_libs system_dir_UNPACK+9, path, file_name, system_dir_UNPACK, \
|
||||
err_message_found_lib3, ihead_f_l, UNPACK_import, err_message_import3, ihead_f_i, plugins_directory
|
||||
|
||||
end_l_libs:
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
cnv_png_import:
|
||||
.Start dd aCP_Start
|
||||
.Version dd aCP_Version
|
||||
.Check dd aCP_Check
|
||||
.Assoc dd aCP_Assoc
|
||||
dd 0
|
||||
dd 0
|
||||
aCP_Start db 'START',0
|
||||
aCP_Version db 'version',0
|
||||
aCP_Check db 'Check_Header',0
|
||||
aCP_Assoc db 'Associations',0
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
UNPACK_import:
|
||||
;unpack_Version dd aUnpack_Version
|
||||
;unpack_PluginLoad dd aUnpack_PluginLoad
|
||||
;unpack_OpenFilePlugin dd aUnpack_OpenFilePlugin
|
||||
;unpack_ClosePlugin dd aUnpack_ClosePlugin
|
||||
;unpack_ReadFolder dd aUnpack_ReadFolder
|
||||
;unpack_SetFolder dd aUnpack_SetFolder
|
||||
;unpack_GetFiles dd aUnpack_GetFiles
|
||||
;unpack_GetOpenPluginInfo dd aUnpack_GetOpenPluginInfo
|
||||
;unpack_Getattr dd aUnpack_Getattr
|
||||
;unpack_Open dd aUnpack_Open
|
||||
;unpack_Read dd aUnpack_Read
|
||||
;unpack_Setpos dd aUnpack_Setpos
|
||||
;unpack_Close dd aUnpack_Close
|
||||
unpack_DeflateUnpack dd aUnpack_DeflateUnpack
|
||||
unpack_DeflateUnpack2 dd aUnpack_DeflateUnpack2
|
||||
dd 0
|
||||
dd 0
|
||||
|
||||
;aUnpack_Version db 'version',0
|
||||
;aUnpack_PluginLoad db 'plugin_load',0
|
||||
;aUnpack_OpenFilePlugin db 'OpenFilePlugin',0
|
||||
;aUnpack_ClosePlugin db 'ClosePlugin',0
|
||||
;aUnpack_ReadFolder db 'ReadFolder',0
|
||||
;aUnpack_SetFolder db 'SetFolder',0
|
||||
;aUnpack_GetFiles db 'GetFiles',0
|
||||
;aUnpack_GetOpenPluginInfo db 'GetOpenPluginInfo',0
|
||||
;aUnpack_Getattr db 'getattr',0
|
||||
;aUnpack_Open db 'open',0
|
||||
;aUnpack_Read db 'read',0
|
||||
;aUnpack_Setpos db 'setpos',0
|
||||
;aUnpack_Close db 'close',0
|
||||
aUnpack_DeflateUnpack db 'deflate_unpack',0
|
||||
aUnpack_DeflateUnpack2 db 'deflate_unpack2',0
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
fileinfo:
|
||||
dd 5
|
||||
dd 0
|
||||
@ -65,69 +126,81 @@ deflate_unpack dd 0
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
align 4
|
||||
myimport:
|
||||
init_lib dd a_init
|
||||
version_lib dd a_version
|
||||
Box_lib_import:
|
||||
;init_lib dd a_init
|
||||
;version_lib dd a_version
|
||||
|
||||
|
||||
edit_box_draw dd aEdit_box_draw
|
||||
edit_box_key dd aEdit_box_key
|
||||
edit_box_mouse dd aEdit_box_mouse
|
||||
version_ed dd aVersion_ed
|
||||
;edit_box_draw dd aEdit_box_draw
|
||||
;edit_box_key dd aEdit_box_key
|
||||
;edit_box_mouse dd aEdit_box_mouse
|
||||
;version_ed dd aVersion_ed
|
||||
|
||||
check_box_draw dd aCheck_box_draw
|
||||
check_box_mouse dd aCheck_box_mouse
|
||||
version_ch dd aVersion_ch
|
||||
;check_box_draw dd aCheck_box_draw
|
||||
;check_box_mouse dd aCheck_box_mouse
|
||||
;version_ch dd aVersion_ch
|
||||
|
||||
option_box_draw dd aOption_box_draw
|
||||
option_box_mouse dd aOption_box_mouse
|
||||
version_op dd aVersion_op
|
||||
;option_box_draw dd aOption_box_draw
|
||||
;option_box_mouse dd aOption_box_mouse
|
||||
;version_op dd aVersion_op
|
||||
|
||||
scrollbar_ver_draw dd aScrollbar_ver_draw
|
||||
scrollbar_ver_mouse dd aScrollbar_ver_mouse
|
||||
scrollbar_hor_draw dd aScrollbar_hor_draw
|
||||
scrollbar_hor_mouse dd aScrollbar_hor_mouse
|
||||
version_scrollbar dd aVersion_scrollbar
|
||||
;version_scrollbar dd aVersion_scrollbar
|
||||
|
||||
dinamic_button_draw dd aDbutton_draw
|
||||
dinamic_button_mouse dd aDbutton_mouse
|
||||
version_dbutton dd aVersion_dbutton
|
||||
;version_dbutton dd aVersion_dbutton
|
||||
|
||||
menu_bar_draw dd aMenu_bar_draw
|
||||
menu_bar_mouse dd aMenu_bar_mouse
|
||||
version_menu_bar dd aVersion_menu_bar
|
||||
menu_bar_activate dd aMenu_bar_activate
|
||||
;version_menu_bar dd aVersion_menu_bar
|
||||
|
||||
;FileBrowser_draw dd aFileBrowser_draw
|
||||
;FileBrowser_mouse dd aFileBrowser_mouse
|
||||
;FileBrowser_key dd aFileBrowser_key
|
||||
;Version_FileBrowser dd aVersion_FileBrowser
|
||||
dd 0
|
||||
dd 0
|
||||
|
||||
a_init db 'lib_init',0
|
||||
a_version db 'version',0
|
||||
;a_init db 'lib_init',0
|
||||
;a_version db 'version',0
|
||||
|
||||
aEdit_box_draw db 'edit_box',0
|
||||
aEdit_box_key db 'edit_box_key',0
|
||||
aEdit_box_mouse db 'edit_box_mouse',0
|
||||
aVersion_ed db 'version_ed',0
|
||||
;aEdit_box_draw db 'edit_box',0
|
||||
;aEdit_box_key db 'edit_box_key',0
|
||||
;aEdit_box_mouse db 'edit_box_mouse',0
|
||||
;aVersion_ed db 'version_ed',0
|
||||
|
||||
aCheck_box_draw db 'check_box_draw',0
|
||||
aCheck_box_mouse db 'check_box_mouse',0
|
||||
aVersion_ch db 'version_ch',0
|
||||
;aCheck_box_draw db 'check_box_draw',0
|
||||
;aCheck_box_mouse db 'check_box_mouse',0
|
||||
;aVersion_ch db 'version_ch',0
|
||||
|
||||
aOption_box_draw db 'option_box_draw',0
|
||||
aOption_box_mouse db 'option_box_mouse',0
|
||||
aVersion_op db 'version_op',0
|
||||
;aOption_box_draw db 'option_box_draw',0
|
||||
;aOption_box_mouse db 'option_box_mouse',0
|
||||
;aVersion_op db 'version_op',0
|
||||
|
||||
aScrollbar_ver_draw db 'scrollbar_v_draw',0
|
||||
aScrollbar_ver_mouse db 'scrollbar_v_mouse',0
|
||||
aScrollbar_hor_draw db 'scrollbar_h_draw',0
|
||||
aScrollbar_hor_mouse db 'scrollbar_h_mouse',0
|
||||
aVersion_scrollbar db 'version_scrollbar',0
|
||||
;aVersion_scrollbar db 'version_scrollbar',0
|
||||
|
||||
aDbutton_draw db 'dbutton_draw',0
|
||||
aDbutton_mouse db 'dbutton_mouse',0
|
||||
aVersion_dbutton db 'version_dbutton',0
|
||||
;aVersion_dbutton db 'version_dbutton',0
|
||||
|
||||
aMenu_bar_draw db 'menu_bar_draw',0
|
||||
aMenu_bar_mouse db 'menu_bar_mouse',0
|
||||
aVersion_menu_bar db 'version_menu_bar',0
|
||||
aMenu_bar_activate db 'menu_bar_activate',0
|
||||
;aVersion_menu_bar db 'version_menu_bar',0
|
||||
|
||||
;aFileBrowser_draw db 'FileBrowser_draw',0
|
||||
;aFileBrowser_mouse db 'FileBrowser_mouse',0
|
||||
;aFileBrowser_key db 'FileBrowser_key',0
|
||||
;aVersion_FileBrowser db 'version_FileBrowser',0
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
@ -214,7 +287,7 @@ menu_data_1:
|
||||
.mouse_pos dd 0 ;+24
|
||||
.mouse_keys dd 0 ;+28
|
||||
.x1:
|
||||
.size_x1 dw 40 ;+32
|
||||
.size_x1 dw 80 ;+32
|
||||
.start_x1 dw 20 ;+34
|
||||
.y1:
|
||||
.size_y1 dw 100 ;+36
|
||||
@ -225,7 +298,7 @@ menu_data_1:
|
||||
.select dd 0 ;+52
|
||||
.out_select dd 0 ;+56
|
||||
.buf_adress dd 0 ;+60
|
||||
.procinfo dd 0 ;+64
|
||||
.procinfo dd procinfo ;+64
|
||||
.click dd 0 ;+68
|
||||
.cursor dd 0 ;+72
|
||||
.cursor_old dd 0 ;+76
|
||||
@ -243,8 +316,8 @@ menu_data_1:
|
||||
menu_text_area:
|
||||
db 'File',0
|
||||
.1:
|
||||
db 'OpenDialog',0
|
||||
db 'Test1',0
|
||||
db 'Test2',0
|
||||
db 'Exit',0
|
||||
.end:
|
||||
db 0
|
||||
@ -275,7 +348,7 @@ menu_data_2:
|
||||
.select dd 0 ;+52
|
||||
.out_select dd 0 ;+56
|
||||
.buf_adress dd 0 ;+60
|
||||
.procinfo dd 0 ;+64
|
||||
.procinfo dd procinfo ;+64
|
||||
.click dd 0 ;+68
|
||||
.cursor dd 0 ;+72
|
||||
.cursor_old dd 0 ;+76
|
||||
@ -303,7 +376,7 @@ dinamic_button_data_1:
|
||||
.type dd 0 ;+0
|
||||
.x:
|
||||
.size_x dw 20 ;+4
|
||||
.start_x dw 150 ;+6
|
||||
.start_x dw 110 ;+6
|
||||
.y:
|
||||
.size_y dw 20 ;+8
|
||||
.start_y dw 25 ;+10
|
||||
@ -324,7 +397,7 @@ dinamic_button_data_2:
|
||||
.type dd 0 ;+0
|
||||
.x:
|
||||
.size_x dw 20 ;+4
|
||||
.start_x dw 180 ;+6
|
||||
.start_x dw 140 ;+6
|
||||
.y:
|
||||
.size_y dw 20 ;+8
|
||||
.start_y dw 25 ;+10
|
||||
@ -340,3 +413,34 @@ dinamic_button_data_2:
|
||||
.select dd 0 ;+48
|
||||
.click dd 0 ;+52
|
||||
;---------------------------------------------------------------------
|
||||
OpenDialog_data:
|
||||
.type dd 0
|
||||
.procinfo dd procinfo ;+4
|
||||
.com_area_name dd communication_area_name ;+8
|
||||
.com_area dd 0 ;+12
|
||||
.opendir_pach dd plugin_pach ;+16
|
||||
.dir_default_pach dd communication_area_default_pach ;+20
|
||||
.start_path dd library_path ;+24
|
||||
.draw_window dd draw_window ;+28
|
||||
.status dd 0 ;+32
|
||||
.openfile_pach dd openfile_pach ;+36
|
||||
|
||||
communication_area_name:
|
||||
db 'FFFFFFFF_open_dialog',0
|
||||
open_dialog_name:
|
||||
db 'opendial',0
|
||||
communication_area_default_pach:
|
||||
db '/rd/1',0
|
||||
|
||||
Filter:
|
||||
dd Filter.end - Filter
|
||||
db 'JPEG',0
|
||||
db 'JPG',0
|
||||
db 'JPE',0
|
||||
db 'PNG',0
|
||||
db 'GIF',0
|
||||
db 'BMP',0
|
||||
db 'KEX',0
|
||||
.end:
|
||||
db 0
|
||||
;---------------------------------------------------------------------
|
128
programs/develop/libraries/box_lib/asm/trunk/icons.ini
Normal file
128
programs/develop/libraries/box_lib/asm/trunk/icons.ini
Normal file
@ -0,0 +1,128 @@
|
||||
asm=4
|
||||
inc=4
|
||||
txt=3
|
||||
rtf=3
|
||||
ini=3
|
||||
log=3
|
||||
dic=3
|
||||
doc=3
|
||||
exc=3
|
||||
wtx=3
|
||||
inf=3
|
||||
jpg=6
|
||||
jpe=6
|
||||
jpeg=6
|
||||
jif=6
|
||||
jfif=6
|
||||
jp2=6
|
||||
jpx=6
|
||||
jpk=6
|
||||
j2k=6
|
||||
jpc=6
|
||||
j2c=6
|
||||
bmp=6
|
||||
dib=6
|
||||
rle=6
|
||||
pbm=6
|
||||
wbm=6
|
||||
wbmp=6
|
||||
xbm=6
|
||||
xpm=6
|
||||
gif=6
|
||||
png=6
|
||||
ico=6
|
||||
cur=6
|
||||
ani=6
|
||||
tif=6
|
||||
tiff=6
|
||||
xif=6
|
||||
tga=6
|
||||
pcx=6
|
||||
dcx=6
|
||||
ppm=6
|
||||
psd=6
|
||||
psp=6
|
||||
raw=6
|
||||
raf=6
|
||||
x3f=6
|
||||
orf=6
|
||||
nef=6
|
||||
mrw=6
|
||||
dcr=6
|
||||
crw=6
|
||||
cr2=6
|
||||
ras=6
|
||||
pix=6
|
||||
pict=6
|
||||
pct=6
|
||||
pic=6
|
||||
pgm=6
|
||||
pef=6
|
||||
pcd=6
|
||||
iff=6
|
||||
lbm=6
|
||||
ilbm=6
|
||||
fpx=6
|
||||
djv=6
|
||||
djvu=6
|
||||
iw4=6
|
||||
wav=7
|
||||
mp3=7
|
||||
xm=7
|
||||
mid=7
|
||||
midi=7
|
||||
aif=7
|
||||
aifc=7
|
||||
aiff=7
|
||||
au=7
|
||||
snd=7
|
||||
wma=7
|
||||
wm=7
|
||||
avi=11
|
||||
mpg=11
|
||||
mpe=11
|
||||
mpeg=11
|
||||
flv=11
|
||||
3gp=11
|
||||
img=5
|
||||
ima=5
|
||||
imz=5
|
||||
bwz=5
|
||||
dsk=5
|
||||
vfd=5
|
||||
wil=5
|
||||
wlz=5
|
||||
exe=8
|
||||
com=8
|
||||
bat=8
|
||||
7z=9
|
||||
rar=9
|
||||
zip=9
|
||||
cab=9
|
||||
arj=9
|
||||
lha=9
|
||||
lzh=9
|
||||
tar=9
|
||||
taz=9
|
||||
tbz=9
|
||||
tbz2=9
|
||||
bz=9
|
||||
bz2=9
|
||||
ice=9
|
||||
gz=9
|
||||
tgz=9
|
||||
uue=9
|
||||
uu=9
|
||||
xxe=9
|
||||
z=9
|
||||
dat=10
|
||||
ttf=12
|
||||
ttc=12
|
||||
chr=12
|
||||
mt=12
|
||||
htm=13
|
||||
html=13
|
||||
lif=14
|
||||
3ds=15
|
||||
kex=16
|
||||
skn=17
|
170
programs/develop/libraries/box_lib/asm/trunk/opendial.mac
Normal file
170
programs/develop/libraries/box_lib/asm/trunk/opendial.mac
Normal file
@ -0,0 +1,170 @@
|
||||
;*****************************************************************************
|
||||
; Macro for use Open Dialog - for Kolibri OS
|
||||
; Copyright (c) 2009, Marat Zakiyanov aka Mario79, aka Mario
|
||||
; All rights reserved.
|
||||
;
|
||||
; Redistribution and use in source and binary forms, with or without
|
||||
; modification, are permitted provided that the following conditions are met:
|
||||
; * Redistributions of source code must retain the above copyright
|
||||
; notice, this list of conditions and the following disclaimer.
|
||||
; * Redistributions in binary form must reproduce the above copyright
|
||||
; notice, this list of conditions and the following disclaimer in the
|
||||
; documentation and/or other materials provided with the distribution.
|
||||
; * Neither the name of the <organization> nor the
|
||||
; names of its contributors may be used to endorse or promote products
|
||||
; derived from this software without specific prior written permission.
|
||||
;
|
||||
; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
|
||||
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
|
||||
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
;*****************************************************************************
|
||||
;*****************************************************************************
|
||||
macro OpenDialog_exit
|
||||
{
|
||||
popa
|
||||
ret
|
||||
}
|
||||
;*****************************************************************************
|
||||
macro use_OpenDialog
|
||||
{
|
||||
OpenDialog:
|
||||
od_type equ dword [ebp]
|
||||
od_procinfo equ dword [ebp+4]
|
||||
od_com_area_name equ dword [ebp+8]
|
||||
od_com_area equ dword [ebp+12]
|
||||
od_opendir_pach equ dword [ebp+16]
|
||||
od_dir_default_pach equ dword [ebp+20]
|
||||
od_start_path equ dword [ebp+24]
|
||||
od_draw_window equ dword [ebp+28]
|
||||
od_status equ dword [ebp+32]
|
||||
od_openfile_pach equ dword [ebp+36]
|
||||
;*****************************************************************************
|
||||
.init:
|
||||
pusha
|
||||
mcall 9, od_procinfo, -1
|
||||
mov ebx,[ebx+30]
|
||||
mov edi,od_com_area_name
|
||||
add edi,7
|
||||
; mov edi,communication_area_name+7
|
||||
std
|
||||
mov ecx,4
|
||||
@@:
|
||||
mov al,bl
|
||||
and al,1111b
|
||||
add al,0x30
|
||||
stosb
|
||||
mov al,bl
|
||||
shr al,4
|
||||
and al,1111b
|
||||
add al,0x30
|
||||
stosb
|
||||
shr ebx,8
|
||||
dec ecx
|
||||
jnz @r
|
||||
cld
|
||||
|
||||
mcall 68,22,od_com_area_name,8192,0x09
|
||||
mov od_com_area,eax
|
||||
OpenDialog_exit
|
||||
;*****************************************************************************
|
||||
;*****************************************************************************
|
||||
.start:
|
||||
pusha
|
||||
mov eax,od_com_area
|
||||
test eax,eax
|
||||
jz .1
|
||||
mov [eax],dword 2 ; folder for open
|
||||
mov edi,eax
|
||||
add edi,4
|
||||
|
||||
mov esi,od_opendir_pach
|
||||
xor eax,eax
|
||||
mov al,[esi]
|
||||
test eax,eax
|
||||
jnz @f
|
||||
mov esi,od_dir_default_pach ;communication_area_default_pach
|
||||
@@:
|
||||
call .copy
|
||||
|
||||
mov eax,od_com_area_name
|
||||
mov [start_open_dialog.parameter],eax
|
||||
|
||||
mov eax,od_start_path
|
||||
mov [start_open_dialog.name],eax
|
||||
|
||||
mcall 70, start_open_dialog
|
||||
shr eax,31
|
||||
test eax,eax
|
||||
jnz .1
|
||||
jmp .still
|
||||
.red:
|
||||
pusha
|
||||
call od_draw_window
|
||||
popa
|
||||
.still:
|
||||
mcall 23, 50
|
||||
cmp eax,1
|
||||
je .red
|
||||
mov eax,od_com_area
|
||||
mov ebx,[eax]
|
||||
test ebx,ebx
|
||||
jz .still
|
||||
cmp ebx,3
|
||||
je .2 ;still
|
||||
cmp ebx,1
|
||||
jne .still
|
||||
|
||||
mov esi,od_com_area
|
||||
add esi,4
|
||||
mov edi,od_openfile_pach ;string
|
||||
call .copy
|
||||
mov od_status,1
|
||||
jmp .3 ;kopen_1
|
||||
.2:
|
||||
mov od_status,0
|
||||
jmp .3 ; still
|
||||
.1:
|
||||
mov od_status,2 ; thread1
|
||||
.3:
|
||||
OpenDialog_exit
|
||||
;----------------------------------------------
|
||||
.copy:
|
||||
xor eax,eax
|
||||
cld
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
test eax,eax
|
||||
jnz @b
|
||||
ret
|
||||
;----------------------------------------------
|
||||
align 4
|
||||
start_open_dialog:
|
||||
.subfunction dd 7
|
||||
.flags dd 0
|
||||
.parameter dd 0 ;od_com_area_name
|
||||
.reserved1 dd 0
|
||||
.reserved2 dd 0
|
||||
db 0
|
||||
.name: dd 0 ;od_start_path
|
||||
}
|
||||
;*****************************************************************************
|
||||
macro init_OpenDialog od_ptr
|
||||
{
|
||||
mov ebp,od_ptr
|
||||
call OpenDialog.init
|
||||
}
|
||||
;*****************************************************************************
|
||||
macro start_OpenDialog od_ptr
|
||||
{
|
||||
mov ebp,od_ptr
|
||||
call OpenDialog.start
|
||||
}
|
||||
;*****************************************************************************
|
Binary file not shown.
Before Width: | Height: | Size: 1.9 KiB |
BIN
programs/develop/libraries/box_lib/asm/trunk/reload_16x16_8b.png
Normal file
BIN
programs/develop/libraries/box_lib/asm/trunk/reload_16x16_8b.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
BIN
programs/develop/libraries/box_lib/asm/trunk/z_icons.png
Normal file
BIN
programs/develop/libraries/box_lib/asm/trunk/z_icons.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.6 KiB |
Loading…
Reference in New Issue
Block a user