Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Ignore whitespace Rev 49 → Rev 48

/kernel/trunk/skin_v3.7z
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/kernel/trunk/gui/window.inc
345,6 → 345,12
cmp eax,5 ; get screen workarea
jne no_get_workarea
popad
 
mov eax,[0xfe00]
mov [screen_workarea.right],eax
mov eax,[0xfe04]
mov [screen_workarea.bottom],eax
 
mov eax,[screen_workarea.left-2]
mov ax,word[screen_workarea.right]
mov [esp+36],eax
356,48 → 362,32
 
cmp eax,6 ; set screen workarea
jne no_set_workarea
movsx eax,word[esp+16+2]
movsx ebx,word[esp+16]
movzx eax,word[esp+16+2]
movzx ebx,word[esp+16]
cmp eax,[0xFE00]
jae .exit
cmp ebx,[0xFE00]
ja .exit
cmp eax,ebx
jge .lp1
or eax,eax;[0xFE00]
jl @f
jae .exit
mov [screen_workarea.left],eax
@@: cmp ebx,[0xFE00]
jg .lp1
mov [screen_workarea.right],ebx
.lp1: movsx eax,word[esp+24+2]
movsx ebx,word[esp+24]
movzx eax,word[esp+24+2]
movzx ebx,word[esp+24]
cmp eax,[0xFE04]
jae .exit
cmp ebx,[0xFE04]
ja .exit
cmp eax,ebx
jge .lp2
or eax,eax;[0xFE04]
jl @f
jae .exit
mov [screen_workarea.top],eax
@@: cmp ebx,[0xFE04]
jg .lp2
mov [screen_workarea.bottom],ebx
.lp2: call repos_windows
call calculatescreen
; jmp redraw_screen_direct
.exit:
popad
ret
no_set_workarea:
 
popad
ret
 
 
repos_windows:
mov ecx,[0x3004]
mov esi,0x20*2
mov byte[0x0000fff0],1
dec ecx
jge @f
ret
@@: mov [esi+WDATA.fl_redraw],1
test [esi+WDATA.fl_wstate],WSTATE_MAXIMIZED
jz .lp2
@@: test [esi+WDATA.fl_wstate],WSTATE_MAXIMIZED
jz .lp1
mov eax,[screen_workarea.left]
mov [esi+WDATA.left],eax
sub eax,[screen_workarea.right]
412,43 → 402,130
mov [esi+WDATA.height],eax
.lp1: add esi,0x20
loop @b
call calculatescreen
jmp redraw_screen_direct
.exit:
popad
ret
.lp2: mov eax,[esi+WDATA.left]
add eax,[esi+WDATA.width]
mov ebx,[0x0000fe00]
; inc ebx
cmp eax,ebx
jle .lp4
mov eax,[esi+WDATA.width]
sub eax,ebx
jle .lp3
mov [esi+WDATA.width],ebx
.lp3: sub ebx,[esi+WDATA.width]
mov [esi+WDATA.left],ebx
.lp4: mov eax,[esi+WDATA.top]
add eax,[esi+WDATA.height]
mov ebx,[0x0000fe04]
; inc ebx
cmp eax,ebx
jle .lp6
mov eax,[esi+WDATA.height]
sub eax,ebx
jle .lp5
mov [esi+WDATA.height],ebx
.lp5: sub ebx,[esi+WDATA.height]
mov [esi+WDATA.top],ebx
.lp6: add esi,0x20
loop @b
ret
no_set_workarea:
 
popad
ret
 
uglobal
common_colours:
times 128 db 0x0
endg
 
check_window_move_request:
 
pushad
 
mov edi,[window_move_pr] ; requestor process base
 
cmp edi,0
je window_move_return
 
shl edi,5
add edi,window_data
 
test [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
jnz window_move_return
 
push dword [edi+0] ; save old coordinates
push dword [edi+4]
push dword [edi+8]
push dword [edi+12]
 
mov eax,[window_move_eax]
mov ebx,[window_move_ebx]
mov ecx,[window_move_ecx]
mov edx,[window_move_edx]
 
cmp eax,-1 ; set new position and size
je no_x_reposition
mov [edi+0],eax
no_x_reposition:
cmp ebx,-1
je no_y_reposition
mov [edi+4],ebx
no_y_reposition:
 
test [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP
jnz no_y_resizing
 
cmp ecx,-1
je no_x_resizing
mov [edi+8],ecx
no_x_resizing:
cmp edx,-1
je no_y_resizing
mov [edi+12],edx
no_y_resizing:
 
call check_window_position
 
pushad ; save for window fullscreen/resize
mov esi,edi
sub edi,window_data
shr edi,5
shl edi,8
add edi,0x80000+0x90
mov ecx,4
cld
rep movsd
popad
 
pushad ; calculcate screen at new position
mov eax,[edi+00]
mov ebx,[edi+04]
mov ecx,[edi+8]
mov edx,[edi+12]
add ecx,eax
add edx,ebx
call calculatescreen
popad
 
pop edx ; calculcate screen at old position
pop ecx
pop ebx
pop eax
add ecx,eax
add edx,ebx
mov [dlx],eax ; save for drawlimits
mov [dly],ebx
mov [dlxe],ecx
mov [dlye],edx
call calculatescreen
 
mov [edi+31],byte 1 ; flag the process as redraw
 
mov eax,edi ; redraw screen at old position
xor esi,esi
call redrawscreen
 
mov [0xfff5],byte 0 ; mouse pointer
mov [0xfff4],byte 0 ; no mouse under
mov [0xfb44],byte 0 ; react to mouse up/down
 
mov ecx,10 ; wait 1/10 second
wmrl3:
call [draw_pointer]
mov eax,1
call delay_hs
loop wmrl3
 
mov [window_move_pr],0
 
window_move_return:
 
popad
 
ret
 
 
 
 
check_window_position:
 
pushad ; window inside screen ?
/kernel/trunk/gui/skincode.inc
1,181 → 1,245
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; WINDOW SKIN for MenuetOS ;;
;; ;;
;; entryway@bkg.lt ;;
;; ;;
;; Bugfixes & upgrades by ;;
;; Samuel Rodriguez Perez ;;
;; Xeoda@ciberirmandade.org ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
 
include "skindata.inc"
 
skin_data = 0x00778000
virtual at 0
bmp_header:
.type rw 1 ; "BM" signature
.filesize rd 1 ; size of the file
.reserved rd 1 ; zero
.offbits rd 1 ; pointer to image data
;----------------
.headsize rd 1 ; usually 40 bytes for image header
.width rd 1
.height rd 1
.planes rw 1 ; usually 1
.bitcount rw 1 ; currently 24 bits/pixel (0x18)
.compress rd 1 ; zero
.sizeimage rd 1 ; x*y*(bitcount/8)
.unused rd 4 ; these bits aren't used by MeOS
bmp_data:
end virtual
 
load_skin_file:
; eax = filename
; edx = destination
mov ebx,1
or ecx,-1
mov esi,12
call fileread
virtual at 0x778000
_bmp_bpl dd ? ; bytes per line
_bmp_dpl dd ? ; dwords per line
_bmp_zb dd ? ; bytes filled by zeroes at the end of a scanline
align 32
raw_data:
end virtual
 
bmp2raw:
; esi = to bmp data (source)
; edi = to raw data (destination)
cmp [esi+bmp_header.type],'BM' ; check if bmp file is really loaded
jne .finish
mov edx,esi
 
mov eax,[edx+bmp_header.width]
imul eax,3
push eax
test eax,11b
jz @f
add eax,4
@@:
shr eax,2
mov [_bmp_dpl],eax
shl eax,2
mov [_bmp_bpl],eax
pop ebx
sub eax,ebx
mov [_bmp_zb],eax
 
add esi,bmp_data
mov eax,[_bmp_bpl]
imul eax,[edx+bmp_header.height]
add esi,eax
mov ebx,[edx+bmp_header.height] ; ebx = y
cld
.y_begin:
sub esi,[_bmp_bpl]
push esi
mov ecx,[_bmp_dpl]
rep movsd
pop esi
sub edi,[_bmp_zb]
dec ebx
jne .y_begin
 
.finish:
ret
 
struct SKIN_HEADER
.ident dd ?
.version dd ?
.params dd ?
.buttons dd ?
.bitmaps dd ?
ends
 
struct SKIN_PARAMS
.skin_height dd ?
.margin.right dw ?
.margin.left dw ?
.margin.bottom dw ?
.margin.top dw ?
.colors.inner dd ?
.colors.outer dd ?
.colors.frame dd ?
.colors_1.inner dd ?
.colors_1.outer dd ?
.colors_1.frame dd ?
.dtp.size dd ?
.dtp.data db 40 dup (?)
ends
; BMP support by Ivan Poddubny
; 1) load LEFT.BMP
; a) _skinleftw = bmp_width
; b) _skinleft = 0
; c) _refleft = 0x778000
; d) convert
; 2) load BASE.BMP
; a) _skinbasew = bmp_width
; b) _skinbase = _skinleftw
; c) _refbase = _refleft+sizeof(left_raw_converted)
; d) convert
; 3) load OPER.BMP
; a) _skinoper = minus width from bmp file
; b) _skinoperw = width from bmp file
; c) _refoper = _refbase+sizeof(oper_raw_converted)
; d) convert
; 4) set height
 
struct SKIN_BUTTONS
.type dd ?
.pos:
.left dw ?
.top dw ?
.size:
.width dw ?
.height dw ?
ends
load_bmp_file:
; eax = pointer to filename
mov ebx, 1
or ecx, -1
mov edx, 0x90000
mov esi, 12
call fileread
ret
 
struct SKIN_BITMAPS
.kind dw ?
.type dw ?
.data dd ?
ends
 
load_skin:
pushad
mov eax,_skin_file
mov edx,skin_data
call load_skin_file
call parse_skin_data
popad
ret
load_default_skin:
pushad
mov eax, _fileleft
call load_bmp_file
mov eax, [0x90000+bmp_header.width]
mov [_skinleftw], eax
mov [_skinleft], 0
mov edi, raw_data
mov [_refleft], edi
mov esi, 0x90000
call bmp2raw
mov eax, [_bmp_bpl]
imul eax, [0x90000+bmp_header.height]
push eax
 
parse_skin_data:
mov ebp,skin_data
cmp [ebp+SKIN_HEADER.ident],'SKIN'
jne .exit
mov eax, _filebase
call load_bmp_file
mov eax, [0x90000+bmp_header.width]
mov [_skinbasew], eax
mov eax, [_skinleftw]
mov [_skinbase], eax
pop eax
add eax, [_refleft]
; align to 32-byte boundary
test eax, 11111b
jz @f
shr eax, 5
inc eax
shl eax, 5
@@:
; save base address
mov [_refbase], eax
; convert
mov edi, eax
mov esi, 0x90000
call bmp2raw
mov eax, [_bmp_bpl]
imul eax, [0x90000+bmp_header.height]
push eax
 
mov ebx,[ebp+SKIN_HEADER.params]
add ebx,skin_data
mov eax,[ebx+SKIN_PARAMS.skin_height]
mov [_skinh],eax
mov eax,[ebx+SKIN_PARAMS.colors.inner]
mov [skin_active.colors.inner],eax
mov eax,[ebx+SKIN_PARAMS.colors.outer]
mov [skin_active.colors.outer],eax
mov eax,[ebx+SKIN_PARAMS.colors.frame]
mov [skin_active.colors.frame],eax
mov eax,[ebx+SKIN_PARAMS.colors_1.inner]
mov [skin_inactive.colors.inner],eax
mov eax,[ebx+SKIN_PARAMS.colors_1.outer]
mov [skin_inactive.colors.outer],eax
mov eax,[ebx+SKIN_PARAMS.colors_1.frame]
mov [skin_inactive.colors.frame],eax
lea esi,[ebx+SKIN_PARAMS.dtp.data]
mov edi,common_colours
mov ecx,[ebx+SKIN_PARAMS.dtp.size]
and ecx,127
cld
rep movsb
mov eax,dword[ebx+SKIN_PARAMS.margin.left]
mov dword[_skinmargins+0],eax
mov eax,dword[ebx+SKIN_PARAMS.margin.top]
mov dword[_skinmargins+4],eax
mov eax, _fileoper
call load_bmp_file
mov eax, [0x90000+bmp_header.width]
mov [_skinoperw], eax
neg eax
mov [_skinoper], eax
pop eax
add eax, [_refbase]
; align to 32-byte boundary
test eax, 11111b
jz @f
shr eax, 5
inc eax
shl eax, 5
@@:
mov [_refoper], eax
mov edi, eax
mov esi, 0x90000
call bmp2raw
mov eax, [0x90000+bmp_header.height]
mov [_skinh], eax
popad
 
mov ebx,[ebp+SKIN_HEADER.bitmaps]
add ebx,skin_data
.lp1: cmp dword[ebx],0
je .end_bitmaps
movzx eax,[ebx+SKIN_BITMAPS.kind]
movzx ecx,[ebx+SKIN_BITMAPS.type]
dec eax
jnz .not_left
xor eax,eax
mov edx,skin_active.left.data
or ecx,ecx
jnz @f
mov edx,skin_inactive.left.data
@@: jmp .next_bitmap
.not_left:
dec eax
jnz .not_oper
mov esi,[ebx+SKIN_BITMAPS.data]
add esi,skin_data
mov eax,[esi+0]
neg eax
mov edx,skin_active.oper.data
or ecx,ecx
jnz @f
mov edx,skin_inactive.oper.data
@@: jmp .next_bitmap
.not_oper:
dec eax
jnz .not_base
mov eax,[skin_active.left.width]
mov edx,skin_active.base.data
or ecx,ecx
jnz @f
mov eax,[skin_inactive.left.width]
mov edx,skin_inactive.base.data
@@: jmp .next_bitmap
.not_base:
add ebx,8
jmp .lp1
.next_bitmap:
mov ecx,[ebx+SKIN_BITMAPS.data]
add ecx,skin_data
mov [edx+4],eax
mov eax,[ecx+0]
mov [edx+8],eax
add ecx,8
mov [edx+0],ecx
add ebx,8
jmp .lp1
.end_bitmaps:
ret
 
mov ebx,[ebp+SKIN_HEADER.buttons]
add ebx,skin_data
.lp2: cmp dword[ebx],0
je .end_buttons
mov eax,[ebx+SKIN_BUTTONS.type]
dec eax
jnz .not_close
mov edx,skin_btn_close
jmp .next_button
.not_close:
dec eax
jnz .not_minimize
mov edx,skin_btn_minimize
jmp .next_button
.not_minimize:
add ebx,12
jmp .lp2
.next_button:
movsx eax,[ebx+SKIN_BUTTONS.left]
mov [edx+SKIN_BUTTON.left],eax
movsx eax,[ebx+SKIN_BUTTONS.top]
mov [edx+SKIN_BUTTON.top],eax
movsx eax,[ebx+SKIN_BUTTONS.width]
mov [edx+SKIN_BUTTON.width],eax
movsx eax,[ebx+SKIN_BUTTONS.height]
mov [edx+SKIN_BUTTON.height],eax
add ebx,12
jmp .lp2
.end_buttons:
load_default_skin_1:
pushad
mov eax, _fileleft_1
call load_bmp_file
mov eax, [0x90000+bmp_header.width]
mov [_skinleftw], eax
mov [_skinleft_1], 0
mov edi, raw_data+1000h
mov [_refleft_1], edi
mov esi, 0x90000
call bmp2raw
mov eax, [_bmp_bpl]
imul eax, [0x90000+bmp_header.height]
push eax
 
.exit:
ret
mov eax, _filebase_1
call load_bmp_file
mov eax, [0x90000+bmp_header.width]
mov [_skinbasew], eax
mov eax, [_skinleftw]
mov [_skinbase], eax
pop eax
add eax, [_refleft_1]
; align to 32-byte boundary
test eax, 11111b
jz @f
shr eax, 5
inc eax
shl eax, 5
@@:
; save base address
mov [_refbase_1], eax
; convert
mov edi, eax
mov esi, 0x90000
call bmp2raw
mov eax, [_bmp_bpl]
imul eax, [0x90000+bmp_header.height]
push eax
 
mov eax, _fileoper_1
call load_bmp_file
mov eax, [0x90000+bmp_header.width]
mov [_skinoperw], eax
neg eax
mov [_skinoper], eax
pop eax
add eax, [_refbase_1]
; align to 32-byte boundary
test eax, 11111b
jz @f
shr eax, 5
inc eax
shl eax, 5
@@:
mov [_refoper_1], eax
mov edi, eax
mov esi, 0x90000
call bmp2raw
mov eax, [0x90000+bmp_header.height]
mov [_skinh], eax
popad
ret
 
drawwindow_IV:
;param1 - aw_yes
 
185,12 → 249,6
 
mov edi,[esp] ; RECTANGLE
 
mov ebp,skin_active
cmp byte [esp+32+4+4],0
jne @f
mov ebp,skin_inactive
@@:
 
mov eax,[edi+0]
shl eax,16
mov ax,[edi+0]
202,7 → 260,7
; mov esi,[edi+24]
; shr esi,1
; and esi,0x007f7f7f
mov esi,[ebp+SKIN_DATA.colors.outer]
mov esi,[_coloroutborder]
call draw_rectangle
mov ecx,3
_dw3l:
212,11 → 270,11
js no_skin_add_button
test bx,bx
js no_skin_add_button
mov esi,[ebp+SKIN_DATA.colors.frame] ;[edi+24]
mov esi,[_colorframe] ;[edi+24]
call draw_rectangle
dec ecx
jnz _dw3l
mov esi,[ebp+SKIN_DATA.colors.inner]
mov esi,[_colorborder]
add eax,1*65536-1
add ebx,1*65536-1
test ax,ax
227,37 → 285,46
 
mov esi,[esp]
mov eax,[esi+8] ; window width
mov edx,[ebp+SKIN_DATA.left.left]
mov edx,[_skinleft]
shl edx,16
mov ecx,[ebp+SKIN_DATA.left.width]
mov ecx,[_skinleftw]
shl ecx,16
add ecx,[_skinh]
 
mov ebx, [ebp+SKIN_DATA.left.data]
cmp byte [esp+32+4+4],1
mov ebx, [_refleft_1]
jne @f
mov ebx,[_refleft]
@@:
call sys_putimage
 
mov esi,[esp]
mov eax,[esi+8]
sub eax,[ebp+SKIN_DATA.left.width]
sub eax,[ebp+SKIN_DATA.oper.width]
cmp eax,[ebp+SKIN_DATA.base.left]
sub eax,[_skinleftw]
sub eax,[_skinoperw]
cmp eax,[_skinbase]
jng non_base
xor edx,edx
mov ebx,[ebp+SKIN_DATA.base.width]
mov ebx,[_skinbasew]
div ebx
 
inc eax
 
mov ebx,[ebp+SKIN_DATA.base.data]
mov ecx,[ebp+SKIN_DATA.base.width]
cmp byte [esp+32+4+4], 1
mov ebx,[_refbase_1]
jne @f
mov ebx,[_refbase]
@@:
 
mov ecx,[_skinbasew]
shl ecx,16
add ecx,[_skinh]
mov edx,[ebp+SKIN_DATA.base.left]
sub edx,[ebp+SKIN_DATA.base.width]
mov edx,[_skinbase]
sub edx,[_skinbasew]
shl edx,16
baseskinloop:
shr edx,16
add edx,[ebp+SKIN_DATA.base.width]
add edx,[_skinbasew]
shl edx,16
 
push eax ebx ecx edx
270,12 → 337,16
 
mov esi,[esp]
mov edx,[esi+8]
sub edx,[ebp+SKIN_DATA.oper.width]
sub edx,[_skinoperw]
inc edx
shl edx,16
mov ebx,[ebp+SKIN_DATA.oper.data]
cmp byte [esp+32+4+4], 1
mov ebx,[_refoper_1]
jne @f
mov ebx,[_refoper]
@@:
 
mov ecx,[ebp+SKIN_DATA.oper.width]
mov ecx,[_skinoperw]
shl ecx,16
add ecx,[_skinh]
call sys_putimage
298,7 → 369,6
call [drawbar]
_noinside2:
 
;* close button
mov edi,[0xfe88]
movzx eax,word [edi]
cmp eax,1000
316,25 → 386,23
mov bx,1
mov [eax],bx
add eax,2 ; x start
xor ebx,ebx
cmp [skin_btn_close.left],0
jge _bCx_at_right
mov ebx,[esp]
mov ebx,[ebx+8]
inc ebx
cmp [_buttonCx],0
jg _bCx_at_right
mov ebx,[_buttonCw] ; ebx will be 0 in next instruction
_bCx_at_right:
add ebx,[skin_btn_close.left]
sub ebx,[_buttonCw]
sub ebx,[_buttonCx]
mov [eax],bx
add eax,2 ; x size
mov ebx,[skin_btn_close.width]
dec ebx
mov ebx,[_buttonCw]
mov [eax],bx
add eax,2 ; y start
mov ebx,[skin_btn_close.top]
mov ebx,[_buttonCy]
mov [eax],bx
add eax,2 ; y size
mov ebx,[skin_btn_close.height]
dec ebx
mov ebx,[_buttonCh]
mov [eax],bx
 
;* minimize button
355,26 → 423,25
mov bx,65535 ;999
mov [eax],bx
add eax,2 ; x start
xor ebx,ebx
cmp [skin_btn_minimize.left],0
jge _bMx_at_right
mov ebx,[esp]
mov ebx,[ebx+8]
inc ebx
cmp [_buttonMx],0
jg _bMx_at_right
mov ebx,[_buttonMw] ; ebx will be 0 in next instruction
_bMx_at_right:
add ebx,[skin_btn_minimize.left]
sub ebx,[_buttonMw]
sub ebx,[_buttonMx]
mov [eax],bx
add eax,2 ; x size
mov ebx,[skin_btn_minimize.width]
dec ebx
mov ebx,[_buttonMw]
mov [eax],bx
add eax,2 ; y start
mov ebx,[skin_btn_minimize.top]
mov ebx,[_buttonMy]
mov [eax],bx
add eax,2 ; y size
mov ebx,[skin_btn_minimize.height]
dec ebx
mov ebx,[_buttonMh]
mov [eax],bx
;* minimize button
 
no_skin_add_button:
 
383,3 → 450,4
 
ret 4
 
 
/kernel/trunk/gui/skindata.inc
1,47 → 1,51
;
; WINDOW SKIN DATA
; WINDOW SKIN for MenuetOS
; ivan-yar@bk.ru
;
 
iglobal
_skin_file_default db 'DEFAULT SKN',0
endg
_skinh dd 22
 
struct SKIN_DATA
.colors.inner dd ?
.colors.outer dd ?
.colors.frame dd ?
.left.data dd ?
.left.left dd ?
.left.width dd ?
.oper.data dd ?
.oper.left dd ?
.oper.width dd ?
.base.data dd ?
.base.left dd ?
.base.width dd ?
ends
_skinleftw dd 10
 
struct SKIN_BUTTON
.left dd ?
.top dd ?
.width dd ?
.height dd ?
ends
_skinbase dd 10
_skinbasew dd 8
 
uglobal
_skinoper dd -39 ;-21
_skinoperw dd 39 ;21
 
align 4
_buttonCx dd 5 ; close
_buttonCy dd 2
_buttonCw dd 15
_buttonCh dd 17
 
_skinh dd ?
_buttonMx dd 23 ; minimize
_buttonMy dd 2
_buttonMw dd 15
_buttonMh dd 17
 
_skinmargins rw 4
_colorframe dd 0x3a6cb6 ;0x586E93
_colorborder dd 0x00081D
_coloroutborder dd 0x00081D
 
skin_btn_close SKIN_BUTTON
skin_btn_minimize SKIN_BUTTON
_fileleft db 'LEFT.BMP '
_filebase db 'BASE.BMP '
_fileoper db 'OPER.BMP '
_fileleft_1 db 'LEFT_1.BMP '
_filebase_1 db 'BASE_1.BMP '
_fileoper_1 db 'OPER_1.BMP '
endg
 
skin_active SKIN_DATA
skin_inactive SKIN_DATA
uglobal
_refoper dd 0
_refbase dd 0
_refleft dd 0
_skinleft dd 0
; _skinwinw dd 0
_refoper_1 dd 0
_refbase_1 dd 0
_refleft_1 dd 0
_skinleft_1 dd 0
endg
 
_skin_file rb 256
 
endg
/kernel/trunk/kernel.asm
700,12 → 700,8
 
; LOAD DEFAULT SKIN
 
mov esi,_skin_file_default
mov edi,_skin_file
movsd
movsd
movsd
call load_skin
call load_default_skin
call load_default_skin_1
 
; MTRR'S
 
818,7 → 814,7
call checkbuttons
call main_loop_sys_getkey
call checkwindows
; call check_window_move_request
call check_window_move_request
call checkmisc
call checkEgaCga
call stack_handler
2925,95 → 2921,25
 
sys_window_move:
 
mov edi,[0x00003000]
shl edi,5
add edi,window_data
cmp [window_move_pr],0
je mwrl1
 
test [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
jnz .window_move_return
mov [esp+36],dword 1 ; return queue error
 
push dword [edi+0] ; save old coordinates
push dword [edi+4]
push dword [edi+8]
push dword [edi+12]
ret
 
cmp eax,-1 ; set new position and size
je .no_x_reposition
mov [edi+0],eax
.no_x_reposition:
cmp ebx,-1
je .no_y_reposition
mov [edi+4],ebx
.no_y_reposition:
mwrl1:
 
test [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP
jnz .no_y_resizing
mov edi,[0x3000] ; requestor process base
mov [window_move_pr],edi
 
cmp ecx,-1
je .no_x_resizing
mov [edi+8],ecx
.no_x_resizing:
cmp edx,-1
je .no_y_resizing
mov [edi+12],edx
.no_y_resizing:
mov [window_move_eax],eax
mov [window_move_ebx],ebx
mov [window_move_ecx],ecx
mov [window_move_edx],edx
 
call check_window_position
mov [esp+36],dword 0 ; return success
 
pushad ; save for window fullscreen/resize
mov esi,edi
sub edi,window_data
shr edi,5
shl edi,8
add edi,0x80000+0x90
mov ecx,4
cld
rep movsd
popad
 
pushad ; calculcate screen at new position
mov eax,[edi+00]
mov ebx,[edi+04]
mov ecx,[edi+8]
mov edx,[edi+12]
add ecx,eax
add edx,ebx
call calculatescreen
popad
 
pop edx ; calculcate screen at old position
pop ecx
pop ebx
pop eax
add ecx,eax
add edx,ebx
mov [dlx],eax ; save for drawlimits
mov [dly],ebx
mov [dlxe],ecx
mov [dlye],edx
call calculatescreen
 
mov [edi+31],byte 1 ; flag the process as redraw
 
mov eax,edi ; redraw screen at old position
xor esi,esi
call redrawscreen
 
mov [0xfff5],byte 0 ; mouse pointer
mov [0xfff4],byte 0 ; no mouse under
mov [0xfb44],byte 0 ; react to mouse up/down
 
mov ecx,10 ; wait 1/10 second
.wmrl3:
call [draw_pointer]
mov eax,1
call delay_hs
loop .wmrl3
 
mov [window_move_pr],0
 
.window_move_return:
 
ret
 
type_background_1:
/kernel/trunk/scin_v2.7z
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/kernel/trunk/vmodeint.inc
8,16 → 8,8
;
; Include in MeOS kernel and compile with FASM
;
 
uglobal
old_screen_width dd ?
old_screen_height dd ?
endg
 
cmp eax,13 ; CALL VIDEOMODE DRIVER FUNCTIONS
jne .no_vmode_drv_access
pushd [0x0000fe00] [0x0000fe04]
popd [old_screen_height] [old_screen_width]
or eax,-1 ; If driver is absent then eax does not change
call 0x760100 ; Entry point of video driver
mov [esp+36],eax
24,20 → 16,5
mov [esp+24],ebx
mov [esp+32],ecx
; mov [esp+28],edx
mov eax,[old_screen_width]
mov ebx,[old_screen_height]
sub eax,[0x0000fe00]
jnz @f
sub ebx,[0x0000fe04]
jz .resolution_wasnt_changed
jmp .lp1
@@: sub ebx,[0x0000fe04]
.lp1: sub [screen_workarea.right],eax
sub [screen_workarea.bottom],ebx
 
call repos_windows
call calculatescreen
 
.resolution_wasnt_changed:
ret
.no_vmode_drv_access: