Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Regard whitespace Rev 485 → Rev 484

/programs/system/menu/trunk/build_en.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix en >lang.inc
@fasm menu.asm @menu
@erase lang.inc
@pause
/programs/system/menu/trunk/build_ru.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm menu.asm @menu
@erase lang.inc
@pause
/programs/system/menu/trunk/menu.asm
5,7 → 5,7
; Compile with FASM for Menuet
;******************************************************************************
include "lang.inc"
include "..\..\..\macros.inc"
include "macros.inc"
 
BTN_HEIGHT = 22
TXT_Y = (BTN_HEIGHT)/2-5
27,11 → 27,11
mov ebx, 3
mov ecx, sc
mov edx, sizeof.system_colors
mcall
int 0x40
 
mov eax, 70 ; load MENU.DAT
mov ebx, fileinfo
mcall
int 0x40
test eax, eax ; error ?
jz @f
cmp eax,6
89,7 → 89,7
jmp newprocess
search_end1:
mov eax, 14
mcall
int 0x40
sub ax, 20
mov [menu_data + y_end], ax
mov [menu_data + x_start], 5
106,7 → 106,7
 
mov eax, 40 ; set event mask
mov ebx, 100111b ; mouse + button + key + redraw
mcall
int 0x40
 
call draw_window
 
113,7 → 113,7
still:
mov eax, 23 ; wait here for event
mov ebx, 5
mcall
int 0x40
 
test [close_now], 1 ; is close flag set?
jnz close
147,7 → 147,7
 
key:
; mov eax, 2
mcall
int 0x40
 
mov al, [edi + rows] ; number of buttons
 
189,7 → 189,7
 
button: ; BUTTON HANDLER
mov eax, 17 ; get id
mcall
int 0x40
 
button1:
mov esi, edi
238,7 → 238,7
mov byte [edi], 0 ; store terminator
mov eax, 70 ; start program
mov ebx, fileinfo_start
mcall
int 0x40
; mcall 5,100
or [close_now], 1 ; set close flag
pop edi
306,7 → 306,7
mov ebx, 1
mov ecx, thread
mov edx, [thread_stack]
mcall
int 0x40
 
jmp searchexit
 
314,12 → 314,12
mouse: ; MOUSE EVENT HANDLER
mov eax, 37
mov ebx, 2
mcall
int 0x40
test eax, eax ; check buttons state
jnz click
mov eax, 37
mov ebx, 1
mcall
int 0x40
ror eax, 16 ; eax = [ Y | X ] relative to window
cmp ax, 140 ; pointer in window?
ja noinwindow
363,7 → 363,7
close:
or eax, -1 ; close this thread
mov [edi + child], al ; my child is not mine
mcall
int 0x40
 
 
backconvert: ; convert from pointer to process id
409,7 → 409,7
 
mov eax, 12 ; function 12:tell os about windowdraw
mov ebx, 1 ; 1, start of draw
mcall
int 0x40
 
movzx ebx, [edi + rows]
imul eax, ebx, BTN_HEIGHT ; eax = height of window
424,13 → 424,13
xor eax, eax ; function 0 : define and draw window
mov edx, 0x01000000 ; color of work area RRGGBB,8->color gl
mov esi, edx ; unmovable window
mcall
int 0x40
 
call draw_all_buttons
 
mov eax,12
mov ebx,2
mcall
int 0x40
 
ret
 
479,7 → 479,7
add esi, 0x1a1a1a
.nohighlight:
or edx, 0x20000000
mcall
int 0x40
movzx edx, dl
 
dec dl
504,7 → 504,7
mov ecx, [sc.work_text]
mov eax, 4
mov esi, 21
mcall
int 0x40
 
pop edx;ad
ret
/programs/system/menu/trunk/macros.inc
0,0 → 1,269
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
dw ? ; +52 - reserved
.client_left dd ? ; +54
.client_top dd ? ; +58
.client_width dd ? ; +62
.client_height dd ? ; +66
.wnd_state db ? ; +70
rb (1024-71)
}
struct process_information
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
Property changes:
Added: svn:eol-style
+native
\ No newline at end of property
/programs/system/menu/trunk/readme2.txt
0,0 → 1,6
Changes:
11.07.06 - Mario79, application used function 70.
Earlier changes were made:
Ivan Poddubny, Mario79 and Halyavin
 
 
/programs/system/menu/trunk/readme.txt
47,8 → 47,6
Ñ óâàæåíèåì,
Ìèõàèë Ëèñîâèí
 
11.07.06 - Mario79, ïðèëîæåíèå èñïîëüçóåò ôóíêöèþ 70.
 
NEW MAIN MENU
Requirements: MENUET 0.76, color monitor
WHAT'S NEW?
72,6 → 70,4
It is recommended to compile MMENU.ASM as MENU. So, you can run it from
standard panel.
All the comments and bugreports send to lisovin@26.ru
Michail Lisovin.
 
11.07.06 - Mario79, application used function 70.
Michail Lisovin.