/kernel/branches/kolibri-ahci/gui/mouse.inc |
---|
0,0 → 1,687 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2010-2015. All rights reserved. ;; |
;; Distributed under terms of the GNU General Public License ;; |
;; ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
$Revision$ |
include 'mousepointer.inc' |
;================================ |
;/////// public functions /////// |
;================================ |
mouse.LEFT_BUTTON_FLAG = 0001b |
mouse.RIGHT_BUTTON_FLAG = 0010b |
mouse.MIDDLE_BUTTON_FLAG = 0100b |
mouse.BUTTONS_MASK = \ |
mouse.LEFT_BUTTON_FLAG or \ |
mouse.RIGHT_BUTTON_FLAG or \ |
mouse.MIDDLE_BUTTON_FLAG |
mouse.WINDOW_RESIZE_N_FLAG = 000001b |
mouse.WINDOW_RESIZE_W_FLAG = 000010b |
mouse.WINDOW_RESIZE_S_FLAG = 000100b |
mouse.WINDOW_RESIZE_E_FLAG = 001000b |
mouse.WINDOW_MOVE_FLAG = 010000b |
mouse.WINDOW_RESIZE_SW_FLAG = \ |
mouse.WINDOW_RESIZE_S_FLAG or \ |
mouse.WINDOW_RESIZE_W_FLAG |
mouse.WINDOW_RESIZE_SE_FLAG = \ |
mouse.WINDOW_RESIZE_S_FLAG or \ |
mouse.WINDOW_RESIZE_E_FLAG |
align 4 |
;----------------------------------------------------------------- |
mouse_check_events: |
; Check if mouse buttons state or cursor position has changed |
push eax ebx |
mov al, [BTN_DOWN] |
mov bl, [mouse.state.buttons] |
and al, mouse.BUTTONS_MASK |
mov cl, al |
xchg cl, [mouse.state.buttons] |
xor bl, al |
push eax ebx |
; did any mouse button changed its state? |
or bl, bl |
jz .check_position |
; yes it did, is that the first button of all pressed down? |
or cl, cl |
jnz .check_buttons_released |
; yes it is, activate window user is pointing at, if needed |
call mouse._.activate_sys_window_under_cursor |
; is there any system button under cursor? |
call mouse._.find_sys_button_under_cursor |
or eax, eax |
jz .check_buttons_released |
; yes there is, activate it and exit |
mov [mouse.active_sys_button.pbid], eax |
mov [mouse.active_sys_button.coord], ebx |
mov cl, [mouse.state.buttons] |
mov [mouse.active_sys_button.buttons], cl |
call sys_button_activate_handler |
jmp .exit |
.check_buttons_released: |
cmp [mouse.state.buttons], 0 |
jnz .buttons_changed |
; did we press some button earlier? |
cmp [mouse.active_sys_button.pbid], 0 |
je .buttons_changed |
; yes we did, deactivate it |
xor eax, eax |
xchg eax, [mouse.active_sys_button.pbid] |
mov ebx, [mouse.active_sys_button.coord] |
mov cl, [mouse.active_sys_button.buttons] |
push eax ebx |
call sys_button_deactivate_handler |
pop edx ecx |
; is the button under cursor the one we deactivated? |
call mouse._.find_sys_button_under_cursor |
cmp eax, ecx |
jne .exit |
cmp ebx, edx |
jne .exit |
; yes it is, perform associated action |
mov cl, [mouse.active_sys_button.buttons] |
call sys_button_perform_handler |
jmp .exit |
.buttons_changed: |
test byte[esp], mouse.LEFT_BUTTON_FLAG |
jz @f |
mov eax, [esp + 4] |
call .call_left_button_handler |
@@: |
test byte[esp], mouse.RIGHT_BUTTON_FLAG |
jz @f |
mov eax, [esp + 4] |
call .call_right_button_handler |
@@: |
test byte[esp], mouse.MIDDLE_BUTTON_FLAG |
jz .check_position |
mov eax, [esp + 4] |
call .call_middle_button_handler |
.check_position: |
movzx eax, word[MOUSE_X] |
movzx ebx, word[MOUSE_Y] |
cmp eax, [mouse.state.pos.x] |
jne .position_changed |
cmp ebx, [mouse.state.pos.y] |
je .exit |
.position_changed: |
xchg eax, [mouse.state.pos.x] |
xchg ebx, [mouse.state.pos.y] |
call mouse._.move_handler |
.exit: |
add esp, 8 |
pop ebx eax |
ret |
.call_left_button_handler: |
test eax, mouse.LEFT_BUTTON_FLAG |
jnz mouse._.left_button_press_handler |
jmp mouse._.left_button_release_handler |
.call_right_button_handler: |
test eax, mouse.RIGHT_BUTTON_FLAG |
jnz mouse._.right_button_press_handler |
jmp mouse._.right_button_release_handler |
.call_middle_button_handler: |
test eax, mouse.MIDDLE_BUTTON_FLAG |
jnz mouse._.middle_button_press_handler |
jmp mouse._.middle_button_release_handler |
;=============================== |
;////// private functions ////// |
;=============================== |
uglobal |
mouse.state: |
.pos POINT |
.buttons db ? |
; NOTE: since there's no unique and lifetime-constant button identifiers, |
; we are using two dwords to identify each of them: |
; * pbid - process slot (high 8 bits) and button id (low 24 bits) pack |
; * coord - left (high 16 bits) and top (low 16 bits) coordinates pack |
align 4 |
mouse.active_sys_button: |
.pbid dd ? |
.coord dd ? |
.buttons db ? |
align 4 |
mouse.active_sys_window: |
.pslot dd ? |
.old_box BOX |
.new_box BOX |
.delta POINT |
.last_ticks dd ? |
.action db ? |
endg |
iglobal |
fl_moving db 0 |
rb 3 |
endg |
align 4 |
;----------------------------------------------------------------- |
mouse._.left_button_press_handler: |
; Called when left mouse button has been pressed down |
bts word [BTN_DOWN], 8 |
mov eax, [timer_ticks] |
mov ebx, eax |
xchg ebx, [mouse.active_sys_window.last_ticks] |
sub eax, ebx |
movzx ebx, [mouse_doubleclick_delay] |
cmp eax, ebx |
jg @f |
bts dword [BTN_DOWN], 24 |
@@: |
test [mouse.state.buttons], not mouse.LEFT_BUTTON_FLAG |
jnz .exit |
call mouse._.find_sys_window_under_cursor |
call mouse._.check_sys_window_actions |
mov [mouse.active_sys_window.action], al |
or eax, eax |
jz .exit |
xchg eax, edx |
test dl, mouse.WINDOW_MOVE_FLAG |
jz @f |
bt dword [BTN_DOWN], 24 |
jnc @f |
mov [mouse.active_sys_window.last_ticks], 0 |
call sys_window_maximize_handler |
jmp .exit |
@@: |
test [edi + WDATA.fl_wstate], WSTATE_MAXIMIZED |
jnz .exit |
mov [mouse.active_sys_window.pslot], esi |
lea eax, [edi + WDATA.box] |
mov ebx, mouse.active_sys_window.old_box |
mov ecx, sizeof.BOX |
call memmove |
mov ebx, mouse.active_sys_window.new_box |
call memmove |
test edx, mouse.WINDOW_MOVE_FLAG |
jz @f |
call .calculate_n_delta |
call .calculate_w_delta |
jmp .call_window_handler |
@@: |
test dl, mouse.WINDOW_RESIZE_W_FLAG |
jz @f |
call .calculate_w_delta |
@@: |
test dl, mouse.WINDOW_RESIZE_S_FLAG |
jz @f |
call .calculate_s_delta |
@@: |
test dl, mouse.WINDOW_RESIZE_E_FLAG |
jz .call_window_handler |
call .calculate_e_delta |
.call_window_handler: |
.exit: |
ret |
.calculate_n_delta: |
mov eax, [mouse.state.pos.y] |
sub eax, [mouse.active_sys_window.old_box.top] |
mov [mouse.active_sys_window.delta.y], eax |
ret |
.calculate_w_delta: |
mov eax, [mouse.state.pos.x] |
sub eax, [mouse.active_sys_window.old_box.left] |
mov [mouse.active_sys_window.delta.x], eax |
ret |
.calculate_s_delta: |
mov eax, [mouse.active_sys_window.old_box.top] |
add eax, [mouse.active_sys_window.old_box.height] |
sub eax, [mouse.state.pos.y] |
mov [mouse.active_sys_window.delta.y], eax |
ret |
.calculate_e_delta: |
mov eax, [mouse.active_sys_window.old_box.left] |
add eax, [mouse.active_sys_window.old_box.width] |
sub eax, [mouse.state.pos.x] |
mov [mouse.active_sys_window.delta.x], eax |
ret |
align 4 |
;----------------------------------------------------------------- |
mouse._.left_button_release_handler: |
; Called when left mouse button has been released |
bts dword [BTN_DOWN], 16 |
xor esi, esi |
xchg esi, [mouse.active_sys_window.pslot] |
or esi, esi |
jz .exit |
mov eax, esi |
shl eax, 5 |
add eax, window_data + WDATA.box |
mov ebx, mouse.active_sys_window.old_box |
mov ecx, sizeof.BOX |
call memmove |
mov eax, mouse.active_sys_window.old_box |
mov ebx, mouse.active_sys_window.new_box |
call sys_window_end_moving_handler |
.exit: |
and [mouse.active_sys_window.action], 0 |
mov [fl_moving], 0 |
ret |
mouse._.right_button_press_handler: |
bts word [BTN_DOWN], 9 |
test [mouse.state.buttons], not mouse.RIGHT_BUTTON_FLAG |
jnz @f |
call mouse._.find_sys_window_under_cursor |
call mouse._.check_sys_window_actions |
test al, mouse.WINDOW_MOVE_FLAG |
jz @f |
jmp sys_window_rollup_handler |
mouse._.right_button_release_handler: |
bts dword [BTN_DOWN], 17 |
@@: |
ret |
mouse._.middle_button_press_handler: |
bts word [BTN_DOWN], 10 |
ret |
mouse._.middle_button_release_handler: |
bts dword [BTN_DOWN], 18 |
ret |
align 4 |
;----------------------------------------------------------------- |
mouse._.move_handler: |
; Called when cursor has been moved |
;> eax = old x coord |
;> ebx = old y coord |
cmp [mouse.active_sys_button.pbid], 0 |
jnz .exit |
mov esi, [mouse.active_sys_window.pslot] |
or esi, esi |
jz .exit |
mov eax, mouse.active_sys_window.new_box |
mov ebx, mouse.active_sys_window.old_box |
mov ecx, sizeof.BOX |
call memmove |
mov dl, [mouse.active_sys_window.action] |
test dl, mouse.WINDOW_MOVE_FLAG |
jz .check_resize_w |
mov eax, [mouse.state.pos.x] |
sub eax, [mouse.active_sys_window.delta.x] |
mov [mouse.active_sys_window.new_box.left], eax |
mov eax, [mouse.state.pos.y] |
sub eax, [mouse.active_sys_window.delta.y] |
mov [mouse.active_sys_window.new_box.top], eax |
mov eax, [mouse.active_sys_window.new_box.left] |
or eax, eax |
jge @f |
xor eax, eax |
mov [mouse.active_sys_window.new_box.left], eax |
@@: |
add eax, [mouse.active_sys_window.new_box.width] |
cmp eax, [_display.width] |
jl @f |
sub eax, [_display.width] |
inc eax |
sub [mouse.active_sys_window.new_box.left], eax |
@@: |
mov eax, [mouse.active_sys_window.new_box.top] |
or eax, eax |
jge @f |
xor eax, eax |
mov [mouse.active_sys_window.new_box.top], eax |
@@: |
add eax, [mouse.active_sys_window.new_box.height] |
cmp eax, [_display.height] |
jl .call_window_handler |
sub eax, [_display.height] |
inc eax |
sub [mouse.active_sys_window.new_box.top], eax |
jmp .call_window_handler |
.check_resize_w: |
test dl, mouse.WINDOW_RESIZE_W_FLAG |
jz .check_resize_s |
mov eax, [mouse.state.pos.x] |
sub eax, [mouse.active_sys_window.delta.x] |
mov [mouse.active_sys_window.new_box.left], eax |
sub eax, [mouse.active_sys_window.old_box.left] |
sub [mouse.active_sys_window.new_box.width], eax |
mov eax, [mouse.active_sys_window.new_box.width] |
sub eax, 127 |
jge @f |
add [mouse.active_sys_window.new_box.left], eax |
mov [mouse.active_sys_window.new_box.width], 127 |
@@: |
mov eax, [mouse.active_sys_window.new_box.left] |
or eax, eax |
jge .check_resize_s |
add [mouse.active_sys_window.new_box.width], eax |
xor eax, eax |
mov [mouse.active_sys_window.new_box.left], eax |
.check_resize_s: |
test dl, mouse.WINDOW_RESIZE_S_FLAG |
jz .check_resize_e |
mov eax, [mouse.state.pos.y] |
add eax, [mouse.active_sys_window.delta.y] |
sub eax, [mouse.active_sys_window.old_box.top] |
mov [mouse.active_sys_window.new_box.height], eax |
push eax |
mov edi, esi |
shl edi, 5 |
add edi, window_data |
call window._.get_rolledup_height |
mov ecx, eax |
pop eax |
mov eax, [mouse.active_sys_window.new_box.height] |
cmp eax, ecx |
jge @f |
mov eax, ecx |
mov [mouse.active_sys_window.new_box.height], eax |
@@: |
add eax, [mouse.active_sys_window.new_box.top] |
cmp eax, [_display.height] |
jl .check_resize_e |
sub eax, [_display.height] |
neg eax |
add [mouse.active_sys_window.new_box.height], eax |
mov ecx, [_display.height] |
cmp ecx, eax |
jg .check_resize_e |
mov [mouse.active_sys_window.new_box.height], ecx |
.check_resize_e: |
test dl, mouse.WINDOW_RESIZE_E_FLAG |
jz .call_window_handler |
mov eax, [mouse.state.pos.x] |
add eax, [mouse.active_sys_window.delta.x] |
sub eax, [mouse.active_sys_window.old_box.left] |
mov [mouse.active_sys_window.new_box.width], eax |
mov eax, [mouse.active_sys_window.new_box.width] |
cmp eax, 127 |
jge @f |
mov eax, 127 |
mov [mouse.active_sys_window.new_box.width], eax |
@@: |
add eax, [mouse.active_sys_window.new_box.left] |
cmp eax, [_display.width] |
jl .call_window_handler |
sub eax, [_display.width] |
neg eax |
add [mouse.active_sys_window.new_box.width], eax |
mov ecx, [_display.width] |
cmp ecx, eax |
jg .call_window_handler |
mov [mouse.active_sys_window.new_box.width], ecx |
.call_window_handler: |
mov eax, mouse.active_sys_window.old_box |
mov ebx, mouse.active_sys_window.new_box |
push esi |
mov esi, mouse.active_sys_window.old_box |
mov edi, mouse.active_sys_window.new_box |
mov ecx, sizeof.BOX / 4 |
repe |
cmpsd |
pop esi |
je .exit |
test [fl_moving], 1 |
jnz @f |
mov [fl_moving], 1 |
push edi |
mov edi, esi |
shl edi, 5 |
add edi, WDATA.box + window_data |
call window._.draw_negative_box |
pop edi |
@@: |
mov [mouse.active_sys_window.last_ticks], 0 |
call sys_window_moving_handler |
.exit: |
ret |
align 4 |
;----------------------------------------------------------------- |
mouse._.find_sys_window_under_cursor: |
; Find system window object which is currently visible on screen |
; and has mouse cursor within its bounds |
;< esi = process slot |
;< edi = pointer to WDATA struct |
mov esi, [mouse.state.pos.y] |
mov esi, [d_width_calc_area + esi*4] |
add esi, [_display.win_map] |
add esi, [mouse.state.pos.x] |
movzx esi, byte[esi] |
mov edi, esi |
shl edi, 5 |
add edi, window_data |
ret |
align 4 |
;----------------------------------------------------------------- |
mouse._.activate_sys_window_under_cursor: |
; activate and redraw window under cursor (if necessary) |
call mouse._.find_sys_window_under_cursor |
movzx esi, word[WIN_STACK + esi * 2] |
lea esi, [WIN_POS + esi * 2] |
jmp waredraw |
align 4 |
;----------------------------------------------------------------- |
mouse._.find_sys_button_under_cursor: |
; Find system button object which is currently visible on screen |
; and has mouse cursor within its bounds |
;< eax = pack[8(process slot), 24(button id)] or 0 |
;< ebx = pack[16(button x coord), 16(button y coord)] |
push ecx edx esi edi |
call mouse._.find_sys_window_under_cursor |
mov edx, esi |
; check if any process button contains cursor |
mov eax, [BTN_ADDR] |
mov ecx, [eax] |
imul esi, ecx, sizeof.SYS_BUTTON |
add esi, eax |
inc ecx |
add esi, sizeof.SYS_BUTTON |
.next_button: |
dec ecx |
jz .not_found |
add esi, -sizeof.SYS_BUTTON |
; does it belong to our process? |
cmp dx, [esi + SYS_BUTTON.pslot] |
jne .next_button |
; does it contain cursor coordinates? |
mov eax, [mouse.state.pos.x] |
sub eax, [edi + WDATA.box.left] |
sub ax, [esi + SYS_BUTTON.left] |
jl .next_button |
sub ax, [esi + SYS_BUTTON.width] |
jge .next_button |
mov eax, [mouse.state.pos.y] |
sub eax, [edi + WDATA.box.top] |
sub ax, [esi + SYS_BUTTON.top] |
jl .next_button |
sub ax, [esi + SYS_BUTTON.height] |
jge .next_button |
; okay, return it |
shl edx, 24 |
mov eax, dword[esi + SYS_BUTTON.id_hi - 2] |
mov ax, [esi + SYS_BUTTON.id_lo] |
and eax, 0x0ffffff |
or eax, edx |
mov ebx, dword[esi + SYS_BUTTON.left - 2] |
mov bx, [esi + SYS_BUTTON.top] |
jmp .exit |
.not_found: |
xor eax, eax |
xor ebx, ebx |
.exit: |
pop edi esi edx ecx |
ret |
align 4 |
;----------------------------------------------------------------- |
mouse._.check_sys_window_actions: |
;< eax = action flags or 0 |
; is window movable? |
test byte[edi + WDATA.cl_titlebar + 3], 0x01 |
jnz .no_action |
mov eax, [mouse.state.pos.x] |
mov ebx, [mouse.state.pos.y] |
sub eax, [edi + WDATA.box.left] |
sub ebx, [edi + WDATA.box.top] |
; is there a window titlebar under cursor? |
push eax |
call window._.get_titlebar_height |
cmp ebx, eax |
pop eax |
jl .move_action |
; no there isn't, can it be resized then? |
mov dl, [edi + WDATA.fl_wstyle] |
and dl, 0x0f |
; NOTE: dangerous optimization, revise if window types changed |
; this currently implies only types 2 and 3 could be resized |
test dl, 2 |
jz .no_action |
mov ecx, [edi + WDATA.box.width] |
add ecx, -window.BORDER_SIZE |
mov edx, [edi + WDATA.box.height] |
add edx, -window.BORDER_SIZE |
; is it rolled up? |
test [edi + WDATA.fl_wstate], WSTATE_ROLLEDUP |
jnz .resize_w_or_e_action |
cmp eax, window.BORDER_SIZE |
jl .resize_w_action |
cmp eax, ecx |
jg .resize_e_action |
cmp ebx, edx |
jle .no_action |
.resize_s_action: |
cmp eax, window.BORDER_SIZE + 10 |
jl .resize_sw_action |
add ecx, -10 |
cmp eax, ecx |
jge .resize_se_action |
mov eax, mouse.WINDOW_RESIZE_S_FLAG |
jmp .exit |
.resize_w_or_e_action: |
cmp eax, window.BORDER_SIZE + 10 |
jl .resize_w_action.direct |
add ecx, -10 |
cmp eax, ecx |
jg .resize_e_action.direct |
jmp .no_action |
.resize_w_action: |
add edx, -10 |
cmp ebx, edx |
jge .resize_sw_action |
.resize_w_action.direct: |
mov eax, mouse.WINDOW_RESIZE_W_FLAG |
jmp .exit |
.resize_e_action: |
add edx, -10 |
cmp ebx, edx |
jge .resize_se_action |
.resize_e_action.direct: |
mov eax, mouse.WINDOW_RESIZE_E_FLAG |
jmp .exit |
.resize_sw_action: |
mov eax, mouse.WINDOW_RESIZE_SW_FLAG |
jmp .exit |
.resize_se_action: |
mov eax, mouse.WINDOW_RESIZE_SE_FLAG |
jmp .exit |
.move_action: |
mov eax, mouse.WINDOW_MOVE_FLAG |
jmp .exit |
.no_action: |
xor eax, eax |
.exit: |
ret |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
Added: svn:keywords |
+Rev |
\ No newline at end of property |
/kernel/branches/kolibri-ahci/gui/window.inc |
---|
0,0 → 1,2496 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;; |
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; |
;; Distributed under terms of the GNU General Public License ;; |
;; ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
$Revision$ |
;============================================================================== |
;///// public functions /////////////////////////////////////////////////////// |
;============================================================================== |
window.BORDER_SIZE = 5 |
uglobal |
common_colours rd 48 |
draw_limits RECT |
endg |
;------------------------------------------------------------------------------ |
syscall_draw_window: ;///// system function 0 ///////////////////////////////// |
;------------------------------------------------------------------------------ |
mov eax, edx |
shr eax, 24 |
and al, 0x0f |
cmp al, 5 |
jae .exit |
push eax |
call window._.sys_set_window |
pop eax |
or al, al |
jnz @f |
; type I - original style |
call drawwindow_I |
jmp window._.draw_window_caption.2 |
;-------------------------------------- |
@@: |
dec al |
jnz @f |
; type II - only reserve area, no draw |
call __sys_draw_pointer |
jmp .exit |
;-------------------------------------- |
@@: |
dec al |
jnz @f |
; type III - new style |
call drawwindow_III |
jmp window._.draw_window_caption.2 |
;-------------------------------------- |
@@: |
; type IV & V - skinned window (resizable & not) |
mov eax, [thread_count] |
movzx eax, word[WIN_POS + eax * 2] |
cmp eax, [current_slot_idx] |
setz al |
movzx eax, al |
push eax |
call drawwindow_IV |
jmp window._.draw_window_caption.2 |
;-------------------------------------- |
.exit: |
ret |
;------------------------------------------------------------------------------ |
syscall_display_settings: ;///// system function 48 /////////////////////////// |
;------------------------------------------------------------------------------ |
cmp ebx, 13 |
ja .ret |
jmp dword[.ftable + ebx*4] |
align 4 |
.ftable: |
dd .redrawWholeScreen |
dd .setButtonStyle |
dd .setSystemColors |
dd .getSystemColors |
dd .getCaptionHeight |
dd .getScreenWorkingArea |
dd .setScreenWorkingArea |
dd .getSkinMargins |
dd .setSkin |
dd .getFontSmoothing |
dd .setFontSmoothing |
dd .getFontSize |
dd .setFontSize |
dd .setSkinUnicode |
.redrawWholeScreen: |
xor eax, eax |
inc ebx |
cmp [windowtypechanged], ebx |
jne .ret |
mov [windowtypechanged], eax |
.redrawScreen: |
xor eax, eax |
mov [draw_limits.left], eax |
mov [draw_limits.top], eax |
mov eax, [_display.width] |
dec eax |
mov [draw_limits.right], eax |
mov eax, [_display.height] |
dec eax |
mov [draw_limits.bottom], eax |
mov eax, window_data |
jmp redrawscreen |
.setButtonStyle: |
; in: ecx: 0 = flat, 1 = with gradient |
and ecx, 1 |
cmp ecx, [buttontype] |
je .ret |
mov [buttontype], ecx |
mov [windowtypechanged], ebx |
.ret: |
ret |
.setSystemColors: |
; in: ecx = pointer to color table, edx = size of color table |
dec ebx |
mov esi, ecx |
cmp edx, 192 |
jnae @f |
mov edx, 192 ; max size |
@@: |
stdcall is_region_userspace, esi, edx ; |
jnz @f ; |
ret ; |
@@: |
mov edi, common_colours |
mov ecx, edx |
rep movsb |
mov [windowtypechanged], ebx |
ret |
.getSystemColors: |
; in: ecx = pointer to color table, edx = size of color table |
mov edi, ecx |
cmp edx, 192 |
jnae @f |
mov edx, 192 ; max size |
@@: |
stdcall is_region_userspace, edi, edx |
jnz @f |
ret |
@@: |
mov esi, common_colours |
mov ecx, edx |
rep movsb |
ret |
.getCaptionHeight: |
mov eax, [_skinh] |
mov [esp + 32], eax |
ret |
.getScreenWorkingArea: |
; out: eax = pack[left, right], ebx = pack[top, bottom] |
mov eax, [screen_workarea.left - 2] |
mov ax, word[screen_workarea.right] |
mov [esp + 32], eax |
mov eax, [screen_workarea.top - 2] |
mov ax, word[screen_workarea.bottom] |
mov [esp + 20], eax |
ret |
.setScreenWorkingArea: |
; in: ecx = pack[left, right], edx = pack[top, bottom] |
xor esi, esi |
mov edi, [_display.width] |
dec edi |
mov eax, ecx |
movsx ebx, ax |
sar eax, 16 |
cmp eax, ebx |
jge .check_horizontal |
inc esi |
or eax, eax |
jge @f |
xor eax, eax |
@@: |
mov [screen_workarea.left], eax |
cmp ebx, edi |
jle @f |
mov ebx, edi |
@@: |
mov [screen_workarea.right], ebx |
.check_horizontal: |
mov edi, [_display.height] |
dec edi |
mov eax, edx |
movsx ebx, ax |
sar eax, 16 |
cmp eax, ebx |
jge .check_if_redraw_needed |
inc esi |
or eax, eax |
jge @f |
xor eax, eax |
@@: |
mov [screen_workarea.top], eax |
cmp ebx, edi |
jle @f |
mov ebx, edi |
@@: |
mov [screen_workarea.bottom], ebx |
.check_if_redraw_needed: |
or esi, esi |
jz @f |
call repos_windows |
.calculateScreen: |
xor eax, eax |
xor ebx, ebx |
mov ecx, [_display.width] |
mov edx, [_display.height] |
dec ecx |
dec edx |
jmp calculatescreen |
.getSkinMargins: |
; out: eax = pack[left, right], ebx = pack[top, bottom] |
mov eax, [_skinmargins + 0] |
mov [esp + 32], eax |
mov eax, [_skinmargins + 4] |
mov [esp + 20], eax |
ret |
.setSkin: |
; in: ecx -> file path string |
mov ebx, ecx |
call read_skin_file |
mov [esp + 32], eax |
test eax, eax |
jnz .ret |
call .calculateScreen |
jmp .redrawScreen |
.getFontSmoothing: |
xor eax, eax |
mov al, [fontSmoothing] |
mov [esp + 32], eax |
ret |
.setFontSmoothing: |
mov [fontSmoothing], cl |
ret |
.getFontSize: |
xor eax, eax |
mov al, [fontSize] |
mov [esp + 32], eax |
ret |
.setFontSize: |
mov [fontSize], cl |
ret |
.setSkinUnicode: |
; in: ecx -> file path string, edx = string encoding |
push ecx edx |
stdcall kernel_alloc, maxPathLength |
mov edi, eax |
pop eax esi |
push edi |
call getFullPath |
test eax, eax |
jz @f |
mov ebx, [esp] |
call read_skin_file |
mov [esp + 32 + 4], eax |
@@: |
call kernel_free |
call .calculateScreen |
jmp .redrawScreen |
;------------------------------------------------------------------------------ |
syscall_set_window_shape: ;///// system function 50 /////////////////////////// |
;------------------------------------------------------------------------------ |
;; Set window shape address: |
;> ebx = 0 |
;> ecx = shape data address |
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
;; Set window shape scale: |
;> ebx = 1 |
;> ecx = scale power (resulting scale is 2^ebx) |
;------------------------------------------------------------------------------ |
mov edi, [current_slot] |
test ebx, ebx |
jne .shape_scale |
mov [edi + APPDATA.wnd_shape], ecx |
;-------------------------------------- |
align 4 |
.shape_scale: |
dec ebx |
jnz .exit |
mov [edi + APPDATA.wnd_shape_scale], ecx |
;-------------------------------------- |
align 4 |
.exit: |
ret |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
syscall_move_window: ;///// system function 67 //////////////////////////////// |
;------------------------------------------------------------------------------ |
;? <description> |
;------------------------------------------------------------------------------ |
mov edi, [current_slot_idx] |
shl edi, 5 |
add edi, window_data |
test [edi + WDATA.fl_wdrawn], 1 |
jz .exit |
test [edi + WDATA.fl_wstate], WSTATE_MAXIMIZED |
jnz .exit |
cmp ebx, -1 |
jne @f |
mov ebx, [edi + WDATA.box.left] |
;-------------------------------------- |
align 4 |
@@: |
cmp ecx, -1 |
jne @f |
mov ecx, [edi + WDATA.box.top] |
;-------------------------------------- |
align 4 |
@@: |
cmp edx, -1 |
jne @f |
mov edx, [edi + WDATA.box.width] |
;-------------------------------------- |
align 4 |
@@: |
cmp esi, -1 |
jne @f |
mov esi, [edi + WDATA.box.height] |
;-------------------------------------- |
align 4 |
@@: |
push esi edx ecx ebx |
mov eax, esp |
mov bl, [edi + WDATA.fl_wstate] |
;-------------------------------------- |
align 4 |
@@: |
cmp [REDRAW_BACKGROUND], byte 0 |
jz @f |
call change_task |
jmp @b |
;-------------------------------------- |
align 4 |
@@: |
call window._.set_window_box |
add esp, sizeof.BOX |
.exit: |
ret |
;------------------------------------------------------------------------------ |
syscall_window_settings: ;///// system function 71 //////////////////////////// |
;------------------------------------------------------------------------------ |
mov edi, [current_slot_idx] |
shl edi, 5 |
or [edi + window_data + WDATA.fl_wstyle], WSTYLE_HASCAPTION |
cmp ebx, 2 |
jz @f |
xor edx, edx |
@@: |
cmp dl, 4 |
jc @f |
xor edx, edx |
@@: |
mov [edi*8 + SLOT_BASE + APPDATA.wnd_caption], ecx |
mov [edi*8 + SLOT_BASE + APPDATA.captionEncoding], dl |
jmp window._.draw_window_caption |
;------------------------------------------------------------------------------ |
align 4 |
set_window_defaults: ;///////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
mov byte [window_data + 0x20 + WDATA.cl_titlebar + 3], 1 ; desktop is not movable |
push eax ecx |
xor eax, eax |
mov ecx, WIN_STACK |
;-------------------------------------- |
align 4 |
@@: |
inc eax |
add ecx, 2 |
; process no |
mov [ecx + 0x000], ax |
; positions in stack |
mov [ecx + 0x400], ax |
cmp ecx, WIN_POS - 2 |
jne @b |
pop ecx eax |
ret |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
calculatescreen: ;///////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? Scan all windows from bottom to top, calling `setscreen` for each one |
;? intersecting given screen area |
;------------------------------------------------------------------------------ |
;> eax = left |
;> ebx = top |
;> ecx = right |
;> edx = bottom |
;------------------------------------------------------------------------------ |
push esi |
pushfd |
cli |
mov esi, 1 |
call window._.set_screen |
push ebp |
mov ebp, [thread_count] |
cmp ebp, 1 |
jbe .exit |
push eax ;for num layout |
push edx ecx ebx eax |
mov dword[esp+10h], ZPOS_DESKTOP |
;-------------------------------------- |
align 4 |
.layout: |
mov esi, 1 ; = num in window stack |
mov ebp, [thread_count] |
;-------------------------------------- |
align 4 |
.next_window: |
movzx edi, word[WIN_POS + esi * 2] |
shl edi, 5 ;size of TASKDATA and WDATA = 32 bytes |
cmp byte [TASK_TABLE + edi + TASKDATA.state], TSTATE_FREE |
je .skip_window |
add edi, window_data |
test [edi + WDATA.fl_wstate], WSTATE_MINIMIZED |
jnz .skip_window |
mov eax, [esp+10h] |
cmp [edi + WDATA.z_modif], al |
jne .skip_window |
mov eax, [edi + WDATA.box.left] |
cmp eax, [esp + RECT.right] |
jg .skip_window |
mov ebx, [edi + WDATA.box.top] |
cmp ebx, [esp + RECT.bottom] |
jg .skip_window |
mov ecx, [edi + WDATA.box.width] |
add ecx, eax |
cmp ecx, [esp + RECT.left] |
jl .skip_window |
mov edx, [edi + WDATA.box.height] |
add edx, ebx |
cmp edx, [esp + RECT.top] |
jl .skip_window |
cmp eax, [esp + RECT.left] |
jae @f |
mov eax, [esp + RECT.left] |
;-------------------------------------- |
align 4 |
@@: |
cmp ebx, [esp + RECT.top] |
jae @f |
mov ebx, [esp + RECT.top] |
;-------------------------------------- |
align 4 |
@@: |
cmp ecx, [esp + RECT.right] |
jbe @f |
mov ecx, [esp + RECT.right] |
;-------------------------------------- |
align 4 |
@@: |
cmp edx, [esp + RECT.bottom] |
jbe @f |
mov edx, [esp + RECT.bottom] |
;-------------------------------------- |
align 4 |
@@: |
push esi |
movzx esi, word[WIN_POS + esi * 2] |
call window._.set_screen |
pop esi |
;-------------------------------------- |
align 4 |
.skip_window: |
inc esi |
dec ebp |
jnz .next_window |
;--------------------------------------------- |
inc dword[esp+10h] |
cmp dword[esp+10h], ZPOS_ALWAYS_TOP |
jle .layout |
;--------------------------------------------- |
mov esi, [thread_count] |
movzx edi, word[WIN_POS + esi * 2] |
shl edi, 5 |
add edi, window_data |
pop eax ebx ecx edx |
pop ebp ;del num layout |
;-------------------------------------- |
align 4 |
.exit: |
pop ebp |
inc [_display.mask_seqno] |
popfd |
pop esi |
ret |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
repos_windows: ;/////////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? <description> |
;------------------------------------------------------------------------------ |
mov ecx, [thread_count] |
mov edi, window_data + sizeof.WDATA * 2 |
call force_redraw_background |
dec ecx |
jle .exit |
;-------------------------------------- |
align 4 |
.next_window: |
mov [edi + WDATA.fl_redraw], 1 |
test [edi + WDATA.fl_wstate], WSTATE_MAXIMIZED |
jnz .fix_maximized |
mov eax, [edi + WDATA.box.left] |
add eax, [edi + WDATA.box.width] |
mov ebx, [_display.width] |
cmp eax, ebx |
jl .fix_vertical |
mov eax, [edi + WDATA.box.width] |
sub eax, ebx |
jl @f |
mov [edi + WDATA.box.width], ebx |
;-------------------------------------- |
align 4 |
@@: |
sub ebx, [edi + WDATA.box.width] |
mov [edi + WDATA.box.left], ebx |
;-------------------------------------- |
align 4 |
.fix_vertical: |
mov eax, [edi + WDATA.box.top] |
add eax, [edi + WDATA.box.height] |
mov ebx, [_display.height] |
cmp eax, ebx |
jl .fix_client_box |
mov eax, [edi + WDATA.box.height] |
sub eax, ebx |
jl @f |
mov [edi + WDATA.box.height], ebx |
;-------------------------------------- |
align 4 |
@@: |
sub ebx, [edi + WDATA.box.height] |
mov [edi + WDATA.box.top], ebx |
;-------------------------------------- |
align 4 |
.fix_client_box: |
call window._.set_window_clientbox |
add edi, sizeof.WDATA |
loop .next_window |
;-------------------------------------- |
align 4 |
.exit: |
ret |
;-------------------------------------- |
align 4 |
.fix_maximized: |
mov eax, [screen_workarea.left] |
mov [edi + WDATA.box.left], eax |
sub eax, [screen_workarea.right] |
neg eax |
mov [edi + WDATA.box.width], eax |
mov eax, [screen_workarea.top] |
mov [edi + WDATA.box.top], eax |
test [edi + WDATA.fl_wstate], WSTATE_ROLLEDUP |
jnz .fix_client_box |
sub eax, [screen_workarea.bottom] |
neg eax |
mov [edi + WDATA.box.height], eax |
jmp .fix_client_box |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
draw_rectangle: ;////////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;> eax = pack[16(left), 16(right)] |
;> ebx = pack[16(top), 16(bottom)] |
;> esi = color |
; ?? RR GG BB ; 0x01000000 negation |
; ; 0x02000000 used for draw_rectangle without top line |
; ; for example drawwindow_III and drawwindow_IV |
;------------------------------------------------------------------------------ |
push eax ebx ecx edi |
xor edi, edi |
;-------------------------------------- |
align 4 |
.flags_set: |
push ebx |
; set line color |
mov ecx, esi |
; draw top border |
rol ebx, 16 |
push ebx |
rol ebx, 16 |
pop bx |
test ecx, 1 shl 25 |
jnz @f |
sub ecx, 1 shl 25 |
; call [draw_line] |
call __sys_draw_line |
;-------------------------------------- |
align 4 |
@@: |
; draw bottom border |
mov ebx, [esp - 2] |
pop bx |
; call [draw_line] |
call __sys_draw_line |
pop ebx |
add ebx, 1 * 65536 - 1 |
; draw left border |
rol eax, 16 |
push eax |
rol eax, 16 |
pop ax |
; call [draw_line] |
call __sys_draw_line |
; draw right border |
mov eax, [esp - 2] |
pop ax |
; call [draw_line] |
call __sys_draw_line |
pop edi ecx ebx eax |
ret |
;-------------------------------------- |
align 4 |
.forced: |
push eax ebx ecx edi |
xor edi, edi |
inc edi |
jmp .flags_set |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
drawwindow_I_caption: ;//////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? <description> |
;------------------------------------------------------------------------------ |
push [edx + WDATA.cl_titlebar] |
mov esi, edx |
mov edx, [esi + WDATA.box.top] |
mov eax, edx |
lea ebx, [edx + 21] |
inc edx |
add eax, [esi + WDATA.box.height] |
cmp ebx, eax |
jbe @f |
mov ebx, eax |
;-------------------------------------- |
align 4 |
@@: |
push ebx |
xor edi, edi |
;-------------------------------------- |
align 4 |
.next_line: |
mov ebx, edx |
shl ebx, 16 |
add ebx, edx |
mov eax, [esi + WDATA.box.left] |
inc eax |
shl eax, 16 |
add eax, [esi + WDATA.box.left] |
add eax, [esi + WDATA.box.width] |
dec eax |
mov ecx, [esi + WDATA.cl_titlebar] |
test ecx, 0x80000000 |
jz @f |
sub ecx, 0x00040404 |
mov [esi + WDATA.cl_titlebar], ecx |
;-------------------------------------- |
align 4 |
@@: |
and ecx, 0x00ffffff |
; call [draw_line] |
call __sys_draw_line |
inc edx |
cmp edx, [esp] |
jb .next_line |
add esp, 4 |
pop [esi + WDATA.cl_titlebar] |
ret |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
drawwindow_I: ;//////////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? <description> |
;------------------------------------------------------------------------------ |
pushad |
; window border |
mov eax, [edx + WDATA.box.left - 2] |
mov ax, word[edx + WDATA.box.left] |
add ax, word[edx + WDATA.box.width] |
mov ebx, [edx + WDATA.box.top - 2] |
mov bx, word[edx + WDATA.box.top] |
add bx, word[edx + WDATA.box.height] |
mov esi, [edx + WDATA.cl_frames] |
call draw_rectangle |
; window caption |
call drawwindow_I_caption |
; window client area |
; do we need to draw it? |
mov edi, [esi + WDATA.cl_workarea] |
test edi, 0x40000000 |
jnz .exit |
; does client area have a positive size on screen? |
cmp [esi + WDATA.box.height], 21 |
jle .exit |
; okay, let's draw it |
mov eax, 1 |
mov ebx, 21 |
mov ecx, [esi + WDATA.box.width] |
mov edx, [esi + WDATA.box.height] |
; call [drawbar] |
call vesa20_drawbar |
;-------------------------------------- |
align 4 |
.exit: |
popad |
ret |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
drawwindow_III_caption: ;///////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? <description> |
;------------------------------------------------------------------------------ |
mov ecx, [edx + WDATA.cl_titlebar] |
push ecx |
mov esi, edx |
mov edx, [esi + WDATA.box.top] |
add edx, 4 |
mov ebx, [esi + WDATA.box.top] |
add ebx, 20 |
mov eax, [esi + WDATA.box.top] |
add eax, [esi + WDATA.box.height] |
cmp ebx, eax |
jb @f |
mov ebx, eax |
;-------------------------------------- |
align 4 |
@@: |
push ebx |
xor edi, edi |
;-------------------------------------- |
align 4 |
.next_line: |
mov ebx, edx |
shl ebx, 16 |
add ebx, edx |
mov eax, [esi + WDATA.box.left] |
shl eax, 16 |
add eax, [esi + WDATA.box.left] |
add eax, [esi + WDATA.box.width] |
add eax, 4 * 65536 - 4 |
mov ecx, [esi + WDATA.cl_titlebar] |
test ecx, 0x40000000 |
jz @f |
add ecx, 0x00040404 |
;-------------------------------------- |
align 4 |
@@: |
test ecx, 0x80000000 |
jz @f |
sub ecx, 0x00040404 |
;-------------------------------------- |
align 4 |
@@: |
mov [esi + WDATA.cl_titlebar], ecx |
and ecx, 0x00ffffff |
; call [draw_line] |
call __sys_draw_line |
inc edx |
cmp edx, [esp] |
jb .next_line |
add esp, 4 |
pop [esi + WDATA.cl_titlebar] |
ret |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
drawwindow_III: ;////////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? <description> |
;------------------------------------------------------------------------------ |
pushad |
; window border |
mov eax, [edx + WDATA.box.left - 2] |
mov ax, word[edx + WDATA.box.left] |
add ax, word[edx + WDATA.box.width] |
mov ebx, [edx + WDATA.box.top - 2] |
mov bx, word[edx + WDATA.box.top] |
add bx, word[edx + WDATA.box.height] |
mov esi, [edx + WDATA.cl_frames] |
shr esi, 1 |
and esi, 0x007f7f7f |
call draw_rectangle |
push esi |
mov ecx, 3 |
mov esi, [edx + WDATA.cl_frames] |
;-------------------------------------- |
align 4 |
.next_frame: |
add eax, 1 * 65536 - 1 |
add ebx, 1 * 65536 - 1 |
call draw_rectangle |
dec ecx |
jnz .next_frame |
pop esi |
add eax, 1 * 65536 - 1 |
add ebx, 1 * 65536 - 1 |
call draw_rectangle |
; window caption |
call drawwindow_III_caption |
; window client area |
; do we need to draw it? |
mov edi, [esi + WDATA.cl_workarea] |
test edi, 0x40000000 |
jnz .exit |
; does client area have a positive size on screen? |
mov edx, [esi + WDATA.box.top] |
add edx, 21 + 5 |
mov ebx, [esi + WDATA.box.top] |
add ebx, [esi + WDATA.box.height] |
cmp edx, ebx |
jg .exit |
; okay, let's draw it |
mov eax, 5 |
mov ebx, 20 |
mov ecx, [esi + WDATA.box.width] |
mov edx, [esi + WDATA.box.height] |
sub ecx, 4 |
sub edx, 4 |
; call [drawbar] |
call vesa20_drawbar |
;-------------------------------------- |
align 4 |
.exit: |
popad |
ret |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
waredraw: ;//////////////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? Activate window, redrawing if necessary |
;------------------------------------------------------------------------------ |
push -1 |
mov eax, [thread_count] |
lea eax, [WIN_POS + eax * 2] |
cmp eax, esi |
pop eax |
je .exit |
; is it overlapped by another window now? |
push ecx |
call window._.check_window_draw |
test ecx, ecx |
pop ecx |
jz .do_not_draw |
; yes it is, activate and update screen buffer |
call window._.window_activate |
pushad |
mov edi, [thread_count] |
movzx esi, word[WIN_POS + edi * 2] |
shl esi, 5 |
add esi, window_data |
mov eax, [esi + WDATA.box.left] |
mov ebx, [esi + WDATA.box.top] |
mov ecx, [esi + WDATA.box.width] |
mov edx, [esi + WDATA.box.height] |
add ecx, eax |
add edx, ebx |
mov edi, [thread_count] |
movzx esi, word[WIN_POS + edi * 2] |
call window._.set_screen |
call window._.set_top_wnd |
inc [_display.mask_seqno] |
popad |
; tell application to redraw itself |
mov [edi + WDATA.fl_redraw], 1 |
xor eax, eax |
jmp .exit |
;-------------------------------------- |
align 4 |
.do_not_draw: |
; no it's not, just activate the window |
call window._.window_activate |
xor eax, eax |
ret |
;-------------------------------------- |
align 4 |
.exit: |
inc eax |
ret |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
minimize_all_window: |
push ebx ecx edx esi edi |
pushfd |
cli |
xor edx, edx |
mov eax, 2 ; we do not minimize the kernel thread N1 |
mov ebx, [thread_count] |
;-------------------------------------- |
align 4 |
.loop: |
movzx edi, word[WIN_POS + eax * 2] |
shl edi, 5 |
; it is a unused slot? |
cmp byte [edi+TASK_TABLE+TASKDATA.state], TSTATE_FREE |
je @f |
; it is a hidden thread? |
lea esi, [edi*8+SLOT_BASE+APPDATA.app_name] |
cmp [esi], byte '@' |
je @f |
; is it already minimized? |
test [edi + window_data+WDATA.fl_wstate], WSTATE_MINIMIZED |
jnz @f |
; no it's not, let's do that |
or [edi + window_data+WDATA.fl_wstate], WSTATE_MINIMIZED |
inc edx |
;-------------------------------------- |
align 4 |
@@: |
inc eax |
cmp eax, ebx |
jbe .loop |
; If nothing has changed |
test edx, edx |
jz @f |
push edx |
call syscall_display_settings.calculateScreen |
call syscall_display_settings.redrawScreen |
pop edx |
;-------------------------------------- |
align 4 |
@@: |
mov eax, edx |
popfd |
pop edi esi edx ecx ebx |
ret |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
minimize_window: ;///////////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;> eax = window number on screen |
;------------------------------------------------------------------------------ |
;# corrupts [dl*] |
;------------------------------------------------------------------------------ |
push edi |
pushfd |
cli |
; is it already minimized? |
movzx edi, word[WIN_POS + eax * 2] |
shl edi, 5 |
add edi, window_data |
test [edi + WDATA.fl_wstate], WSTATE_MINIMIZED |
jnz .exit |
push eax ebx ecx edx esi |
; no it's not, let's do that |
or [edi + WDATA.fl_wstate], WSTATE_MINIMIZED |
; If the window width is 0, then the action is not needed. |
cmp [edi + WDATA.box.width], dword 0 |
je @f |
; If the window height is 0, then the action is not needed. |
cmp [edi + WDATA.box.height], dword 0 |
je @f |
mov eax, [edi + WDATA.box.left] |
mov [draw_limits.left], eax |
mov ecx, eax |
add ecx, [edi + WDATA.box.width] |
mov [draw_limits.right], ecx |
mov ebx, [edi + WDATA.box.top] |
mov [draw_limits.top], ebx |
mov edx, ebx |
add edx, [edi + WDATA.box.height] |
mov [draw_limits.bottom], edx |
; DEBUGF 1, "K : minimize_window\n" |
; DEBUGF 1, "K : dl_left %x\n",[draw_limits.left] |
; DEBUGF 1, "K : dl_right %x\n",[draw_limits.right] |
; DEBUGF 1, "K : dl_top %x\n",[draw_limits.top] |
; DEBUGF 1, "K : dl_bottom %x\n",[draw_limits.bottom] |
call calculatescreen |
; xor esi, esi |
; xor eax, eax |
mov eax, edi |
call redrawscreen |
;-------------------------------------- |
align 4 |
@@: |
pop esi edx ecx ebx eax |
;-------------------------------------- |
align 4 |
.exit: |
popfd |
pop edi |
ret |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
restore_minimized_window: ;//////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;> eax = window number on screen |
;------------------------------------------------------------------------------ |
;# corrupts [dl*] |
;------------------------------------------------------------------------------ |
pushad |
pushfd |
cli |
; is it already restored? |
movzx esi, word[WIN_POS + eax * 2] |
mov edi, esi |
shl edi, 5 |
add edi, window_data |
test [edi + WDATA.fl_wstate], WSTATE_MINIMIZED |
jz .exit |
; no it's not, let's do that |
mov [edi + WDATA.fl_redraw], 1 |
and [edi + WDATA.fl_wstate], not WSTATE_MINIMIZED |
mov ebp, window._.set_screen |
cmp eax, [thread_count] |
jz @f |
mov ebp, calculatescreen |
;-------------------------------------- |
align 4 |
@@: |
mov eax, [edi + WDATA.box.left] |
mov ebx, [edi + WDATA.box.top] |
mov ecx, [edi + WDATA.box.width] |
mov edx, [edi + WDATA.box.height] |
add ecx, eax |
add edx, ebx |
call ebp |
cmp ebp, window._.set_screen |
jne @f |
call window._.set_top_wnd |
@@: |
inc [_display.mask_seqno] |
;-------------------------------------- |
align 4 |
.exit: |
popfd |
popad |
ret |
;------------------------------------------------------------------------------ |
align 4 |
; TODO: remove this proc |
;------------------------------------------------------------------------------ |
window_check_events: ;///////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? <description> |
;------------------------------------------------------------------------------ |
; do we have window minimize/restore request? |
cmp [window_minimize], 0 |
je .exit |
; okay, minimize or restore top-most window and exit |
mov eax, [thread_count] |
mov bl, 0 |
xchg [window_minimize], bl |
dec bl |
jnz @f |
call minimize_window |
jmp .exit |
;-------------------------------------- |
align 4 |
@@: |
call restore_minimized_window |
;-------------------------------------- |
align 4 |
.exit: |
ret |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
sys_window_maximize_handler: ;///////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? <description> |
;------------------------------------------------------------------------------ |
;> esi = process slot |
;------------------------------------------------------------------------------ |
mov edi, esi |
shl edi, 5 |
add edi, window_data |
; can window change its height? |
; only types 2 and 3 can be resized |
mov dl, [edi + WDATA.fl_wstyle] |
test dl, 2 |
jz .exit |
; toggle normal/maximized window state |
mov bl, [edi + WDATA.fl_wstate] |
xor bl, WSTATE_MAXIMIZED |
; calculate and set appropriate window bounds |
test bl, WSTATE_MAXIMIZED |
jz .restore_size |
mov eax, [screen_workarea.left] |
mov ecx, [screen_workarea.top] |
push [screen_workarea.bottom] \ |
[screen_workarea.right] \ |
ecx \ |
eax |
sub [esp + BOX.width], eax |
sub [esp + BOX.height], ecx |
mov eax, esp |
jmp .set_box |
;-------------------------------------- |
align 4 |
.restore_size: |
mov eax, esi |
shl eax, 8 |
add eax, SLOT_BASE + APPDATA.saved_box |
push [eax + BOX.height] \ |
[eax + BOX.width] \ |
[eax + BOX.top] \ |
[eax + BOX.left] |
mov eax, esp |
;-------------------------------------- |
align 4 |
.set_box: |
test bl, WSTATE_ROLLEDUP |
jz @f |
xchg eax, ecx |
call window._.get_rolledup_height |
mov [ecx + BOX.height], eax |
xchg eax, ecx |
;-------------------------------------- |
align 4 |
@@: |
call window._.set_window_box |
add esp, sizeof.BOX |
;-------------------------------------- |
align 4 |
.exit: |
inc [_display.mask_seqno] |
ret |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
sys_window_rollup_handler: ;/////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? <description> |
;------------------------------------------------------------------------------ |
;> esi = process slot |
;------------------------------------------------------------------------------ |
mov edx, esi |
shl edx, 8 |
add edx, SLOT_BASE |
; toggle normal/rolled up window state |
mov bl, [edi + WDATA.fl_wstate] |
xor bl, WSTATE_ROLLEDUP |
; calculate and set appropriate window bounds |
test bl, WSTATE_ROLLEDUP |
jz .restore_size |
call window._.get_rolledup_height |
push eax \ |
[edi + WDATA.box.width] \ |
[edi + WDATA.box.top] \ |
[edi + WDATA.box.left] |
mov eax, esp |
jmp .set_box |
;-------------------------------------- |
align 4 |
.restore_size: |
test bl, WSTATE_MAXIMIZED |
jnz @f |
add esp, -sizeof.BOX |
lea eax, [edx + APPDATA.saved_box] |
jmp .set_box |
;-------------------------------------- |
align 4 |
@@: |
mov eax, [screen_workarea.top] |
push [screen_workarea.bottom] \ |
[edi + WDATA.box.width] \ |
eax \ |
[edi + WDATA.box.left] |
sub [esp + BOX.height], eax |
mov eax, esp |
;-------------------------------------- |
align 4 |
.set_box: |
call window._.set_window_box |
add esp, sizeof.BOX |
ret |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
;sys_window_start_moving_handler: ;///////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? <description> |
;------------------------------------------------------------------------------ |
;> eax = old (original) window box |
;> esi = process slot |
;------------------------------------------------------------------------------ |
; mov edi, eax |
; call window._.draw_negative_box |
; ret |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
sys_window_end_moving_handler: ;/////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? <description> |
;------------------------------------------------------------------------------ |
;> eax = old (original) window box |
;> ebx = new (final) window box |
;> esi = process slot |
;------------------------------------------------------------------------------ |
; mov edi, ebx |
; call window._.end_moving__box |
mov edi, esi |
shl edi, 5 |
add edi, window_data |
test [fl_moving], 1 |
jz @f |
push edi |
mov edi, ebx |
call window._.draw_negative_box |
pop edi |
@@: |
mov eax, ebx |
mov bl, [edi + WDATA.fl_wstate] |
call window._.set_window_box |
ret |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
sys_window_moving_handler: ;/////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? <description> |
;------------------------------------------------------------------------------ |
;> eax = old (from previous call) window box |
;> ebx = new (current) window box |
;> esi = process_slot |
;------------------------------------------------------------------------------ |
mov edi, eax |
call window._.draw_negative_box |
mov edi, ebx |
call window._.draw_negative_box |
ret |
;============================================================================== |
;///// private functions ////////////////////////////////////////////////////// |
;============================================================================== |
iglobal |
align 4 |
window_topleft dd \ |
1, 21, \ ;type 0 |
0, 0, \ ;type 1 |
5, 20, \ ;type 2 |
5, ?, \ ;type 3 {set by skin} |
5, ? ;type 4 {set by skin} |
endg |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
window._.invalidate_screen: ;////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? <description> |
;------------------------------------------------------------------------------ |
;> eax = old (original) window box |
;> ebx = new (final) window box |
;> edi = pointer to WDATA struct |
;------------------------------------------------------------------------------ |
push eax ebx |
; TODO: do we really need `draw_limits`? |
; Yes, they are used by background drawing code. |
; we need only to restore the background windows at the old place! |
mov ecx, [ebx + BOX.left] |
mov [draw_limits.left], ecx |
add ecx, [ebx + BOX.width] |
mov [draw_limits.right], ecx |
mov ecx, [ebx + BOX.top] |
mov [draw_limits.top], ecx |
add ecx, [ebx + BOX.height] |
mov [draw_limits.bottom], ecx |
; recalculate screen buffer at old position |
push ebx |
mov edx, [eax + BOX.height] |
mov ecx, [eax + BOX.width] |
mov ebx, [eax + BOX.top] |
mov eax, [eax + BOX.left] |
add ecx, eax |
add edx, ebx |
call calculatescreen |
pop eax |
; recalculate screen buffer at new position |
mov edx, [eax + BOX.height] |
mov ecx, [eax + BOX.width] |
mov ebx, [eax + BOX.top] |
mov eax, [eax + BOX.left] |
add ecx, eax |
add edx, ebx |
call calculatescreen |
mov eax, edi |
call redrawscreen |
; tell window to redraw itself |
mov [edi + WDATA.fl_redraw], 1 |
pop ebx eax |
ret |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
window._.set_window_box: ;///////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? <description> |
;------------------------------------------------------------------------------ |
;> eax = pointer to BOX struct |
;> bl = new window state flags |
;> edi = pointer to WDATA struct |
;------------------------------------------------------------------------------ |
push eax ebx esi |
; don't do anything if the new box is identical to the old |
cmp bl, [edi + WDATA.fl_wstate] |
jnz @f |
mov esi, eax |
push edi |
if WDATA.box |
add edi, WDATA.box |
end if |
mov ecx, 4 |
repz cmpsd |
pop edi |
jz .exit |
;-------------------------------------- |
align 4 |
@@: |
add esp, -sizeof.BOX |
mov ebx, esp |
if WDATA.box |
lea esi, [edi + WDATA.box] |
else |
mov esi, edi ; optimization for WDATA.box = 0 |
end if |
xchg eax, esi |
mov ecx, sizeof.BOX |
call memmove |
xchg eax, esi |
xchg ebx, esi |
call memmove |
mov eax, ebx |
mov ebx, esi |
call window._.check_window_position |
call window._.set_window_clientbox |
call window._.invalidate_screen |
add esp, sizeof.BOX |
mov cl, [esp + 4] |
mov ch, cl |
xchg cl, [edi + WDATA.fl_wstate] |
or cl, ch |
test cl, WSTATE_MAXIMIZED |
jnz .exit |
mov eax, edi |
sub eax, window_data |
shl eax, 3 |
add eax, SLOT_BASE |
lea ebx, [edi + WDATA.box] |
xchg esp, ebx |
pop [eax + APPDATA.saved_box.left] \ |
[eax + APPDATA.saved_box.top] \ |
[eax + APPDATA.saved_box.width] \ |
edx |
xchg esp, ebx |
test ch, WSTATE_ROLLEDUP |
jnz .exit |
mov [eax + APPDATA.saved_box.height], edx |
;-------------------------------------- |
align 4 |
.exit: |
pop esi ebx eax |
ret |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
window._.set_window_clientbox: ;/////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? <description> |
;------------------------------------------------------------------------------ |
;> edi = pointer to WDATA struct |
;------------------------------------------------------------------------------ |
push eax ecx edi |
mov eax, [_skinh] |
mov [window_topleft + 8 * 3 + 4], eax |
mov [window_topleft + 8 * 4 + 4], eax |
mov ecx, edi |
sub edi, window_data |
shl edi, 3 |
test [ecx + WDATA.fl_wstyle], WSTYLE_CLIENTRELATIVE |
jz .whole_window |
movzx eax, [ecx + WDATA.fl_wstyle] |
and eax, 0x0F |
mov eax, [eax * 8 + window_topleft + 0] |
mov [edi + SLOT_BASE + APPDATA.wnd_clientbox.left], eax |
shl eax, 1 |
neg eax |
add eax, [ecx + WDATA.box.width] |
inc eax ;Leency: as window is created width+1 so client the same |
mov [edi + SLOT_BASE + APPDATA.wnd_clientbox.width], eax |
movzx eax, [ecx + WDATA.fl_wstyle] |
and eax, 0x0F |
push [eax * 8 + window_topleft + 0] |
mov eax, [eax * 8 + window_topleft + 4] |
mov [edi + SLOT_BASE + APPDATA.wnd_clientbox.top], eax |
neg eax |
sub eax, [esp] |
add eax, [ecx + WDATA.box.height] |
inc eax ;Leency: as window is created height+1 so client the same |
mov [edi + SLOT_BASE + APPDATA.wnd_clientbox.height], eax |
add esp, 4 |
jmp .exit |
;-------------------------------------- |
align 4 |
.whole_window: |
xor eax, eax |
mov [edi + SLOT_BASE + APPDATA.wnd_clientbox.left], eax |
mov [edi + SLOT_BASE + APPDATA.wnd_clientbox.top], eax |
mov eax, [ecx + WDATA.box.width] |
mov [edi + SLOT_BASE + APPDATA.wnd_clientbox.width], eax |
mov eax, [ecx + WDATA.box.height] |
mov [edi + SLOT_BASE + APPDATA.wnd_clientbox.height], eax |
;-------------------------------------- |
align 4 |
.exit: |
pop edi ecx eax |
ret |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
window._.sys_set_window: ;///////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? <description> |
;------------------------------------------------------------------------------ |
;< edx = pointer to WDATA struct |
;------------------------------------------------------------------------------ |
mov eax, [current_slot_idx] |
shl eax, 5 |
add eax, window_data |
; save window colors |
mov [eax + WDATA.cl_workarea], edx |
mov [eax + WDATA.cl_titlebar], esi |
mov [eax + WDATA.cl_frames], edi |
mov edi, eax |
; Was it already defined before? |
test [edi + WDATA.fl_wdrawn], 1 |
jnz .set_client_box |
; No, it wasn't. After first draw_window we need redraw mouse necessarily! |
; Otherwise the user can see cursor specified by f.37.5 from another window. |
; He will be really unhappy! Usually, he will be enraged! |
or [edi + WDATA.fl_wdrawn], 1 |
mov [redrawmouse_unconditional], 1 |
call wakeup_osloop |
; performing initial window definition |
movzx eax, bx |
mov [edi + WDATA.box.width], eax |
movzx eax, cx |
mov [edi + WDATA.box.height], eax |
sar ebx, 16 |
sar ecx, 16 |
mov [edi + WDATA.box.left], ebx |
mov [edi + WDATA.box.top], ecx |
call window._.check_window_position |
push ecx edi |
mov cl, [edi + WDATA.fl_wstyle] |
mov eax, [edi + WDATA.cl_frames] |
sub edi, window_data |
shl edi, 3 |
add edi, SLOT_BASE |
and cl, 0x0F |
cmp cl, 3 |
je @f |
cmp cl, 4 |
je @f |
xor eax, eax |
;-------------------------------------- |
align 4 |
@@: |
mov [edi + APPDATA.wnd_caption], eax |
mov esi, [esp] |
add edi, APPDATA.saved_box |
movsd |
movsd |
movsd |
movsd |
pop edi ecx |
mov esi, [current_slot_idx] |
movzx esi, word[WIN_STACK + esi * 2] |
lea esi, [WIN_POS + esi * 2] |
call waredraw |
mov eax, [edi + WDATA.box.left] |
mov ebx, [edi + WDATA.box.top] |
mov ecx, [edi + WDATA.box.width] |
mov edx, [edi + WDATA.box.height] |
add ecx, eax |
add edx, ebx |
call calculatescreen |
mov byte[KEY_COUNT], 0 ; empty keyboard buffer |
mov byte[BTN_COUNT], 0 ; empty button buffer |
;-------------------------------------- |
align 4 |
.set_client_box: |
; update window client box coordinates |
call window._.set_window_clientbox |
; reset window redraw flag and exit |
mov [edi + WDATA.fl_redraw], 0 |
mov edx, edi |
ret |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
window._.check_window_position: ;////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? Check if window is inside screen area |
;------------------------------------------------------------------------------ |
;> edi = pointer to WDATA |
;------------------------------------------------------------------------------ |
push eax ebx ecx edx esi |
mov eax, [edi + WDATA.box.left] |
mov ebx, [edi + WDATA.box.top] |
mov ecx, [edi + WDATA.box.width] |
mov edx, [edi + WDATA.box.height] |
mov esi, [_display.width] |
cmp ecx, esi |
jae .fix_width_high |
;-------------------------------------- |
align 4 |
.check_left: |
or eax, eax |
jl .fix_left_low |
add eax, ecx |
cmp eax, esi |
jge .fix_left_high |
;-------------------------------------- |
align 4 |
.check_height: |
mov esi, [_display.height] |
cmp edx, esi |
jae .fix_height_high |
;-------------------------------------- |
align 4 |
.check_top: |
or ebx, ebx |
jl .fix_top_low |
add ebx, edx |
cmp ebx, esi |
jge .fix_top_high |
;-------------------------------------- |
align 4 |
.exit: |
pop esi edx ecx ebx eax |
ret |
;-------------------------------------- |
align 4 |
.fix_width_high: |
mov ecx, esi |
dec ecx |
mov [edi + WDATA.box.width], ecx |
jmp .check_left |
;-------------------------------------- |
align 4 |
.fix_left_low: |
xor eax, eax |
mov [edi + WDATA.box.left], eax |
jmp .check_height |
;-------------------------------------- |
align 4 |
.fix_left_high: |
mov eax, esi |
sub eax, ecx |
dec eax |
mov [edi + WDATA.box.left], eax |
jmp .check_height |
;-------------------------------------- |
align 4 |
.fix_height_high: |
mov edx, esi |
dec edx |
mov [edi + WDATA.box.height], edx |
jmp .check_top |
;-------------------------------------- |
align 4 |
.fix_top_low: |
xor ebx, ebx |
mov [edi + WDATA.box.top], ebx |
jmp .exit |
;-------------------------------------- |
align 4 |
.fix_top_high: |
mov ebx, esi |
sub ebx, edx |
dec ebx |
mov [edi + WDATA.box.top], ebx |
jmp .exit |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
window._.get_titlebar_height: ;//////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? <description> |
;------------------------------------------------------------------------------ |
;> edi = pointer to WDATA |
;------------------------------------------------------------------------------ |
mov al, [edi + WDATA.fl_wstyle] |
and al, 0x0f |
cmp al, 0x03 |
jne @f |
mov eax, [_skinh] |
ret |
;-------------------------------------- |
align 4 |
@@: |
mov eax, 21 |
ret |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
window._.get_rolledup_height: ;//////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? <description> |
;------------------------------------------------------------------------------ |
;> edi = pointer to WDATA |
;------------------------------------------------------------------------------ |
mov al, [edi + WDATA.fl_wstyle] |
and al, 0x0f |
cmp al, 0x03 |
jb @f |
mov eax, [_skinh] |
add eax, 3 |
ret |
;-------------------------------------- |
align 4 |
@@: |
or al, al |
jnz @f |
mov eax, 21 |
ret |
;-------------------------------------- |
align 4 |
@@: |
mov eax, 21 + 2 |
ret |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
window._.set_screen: ;///////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? Reserve window area in screen buffer |
;------------------------------------------------------------------------------ |
;> eax = left |
;> ebx = top |
;> ecx = right |
;> edx = bottom |
;> esi = process number |
;------------------------------------------------------------------------------ |
virtual at esp |
ff_x dd ? |
ff_y dd ? |
ff_width dd ? |
ff_xsz dd ? |
ff_ysz dd ? |
ff_scale dd ? |
end virtual |
pushad |
cmp esi, 1 |
jz .check_for_shaped_window |
mov edi, esi |
shl edi, 5 |
cmp [window_data + edi + WDATA.box.width], 0 |
jnz .check_for_shaped_window |
cmp [window_data + edi + WDATA.box.height], 0 |
jz .exit |
;-------------------------------------- |
align 4 |
.check_for_shaped_window: |
mov edi, esi |
shl edi, 8 |
add edi, SLOT_BASE |
cmp [edi + APPDATA.wnd_shape], 0 |
jne .shaped_window |
; get x&y size |
sub ecx, eax |
sub edx, ebx |
inc ecx |
inc edx |
; get WinMap start |
push esi |
mov esi, [_display.width] |
mov edi, [d_width_calc_area + ebx*4] |
add edi, eax |
add edi, [_display.win_map] |
pop eax |
mov ah, al |
push ax |
shl eax, 16 |
pop ax |
;-------------------------------------- |
align 4 |
.next_line: |
push ecx |
shr ecx, 2 |
rep stosd |
mov ecx, [esp] |
and ecx, 3 |
rep stosb |
pop ecx |
add edi, esi |
sub edi, ecx |
dec edx |
jnz .next_line |
jmp .exit |
;-------------------------------------- |
align 4 |
.shaped_window: |
; for (y=0; y <= x_size; y++) |
; for (x=0; x <= x_size; x++) |
; if (shape[coord(x,y,scale)]==1) |
; set_pixel(x, y, process_number); |
sub ecx, eax |
sub edx, ebx |
inc ecx |
inc edx |
push [edi + APPDATA.wnd_shape_scale] ; push scale first -> for loop |
; get WinMap start -> ebp |
push eax |
mov eax, [d_width_calc_area + ebx*4] |
add eax, [esp] |
add eax, [_display.win_map] |
mov ebp, eax |
mov edi, [edi + APPDATA.wnd_shape] |
pop eax |
; eax = x_start |
; ebx = y_start |
; ecx = x_size |
; edx = y_size |
; esi = process_number |
; edi = &shape |
; [scale] |
push edx ecx ; for loop - x,y size |
mov ecx, esi |
shl ecx, 5 |
mov edx, [window_data + ecx + WDATA.box.top] |
push [window_data + ecx + WDATA.box.width] ; for loop - width |
mov ecx, [window_data + ecx + WDATA.box.left] |
sub ebx, edx |
sub eax, ecx |
push ebx eax ; for loop - x,y |
add [ff_xsz], eax |
add [ff_ysz], ebx |
mov ebx, [ff_y] |
;-------------------------------------- |
align 4 |
.ff_new_y: |
mov edx, [ff_x] |
;-------------------------------------- |
align 4 |
.ff_new_x: |
; -- body -- |
mov ecx, [ff_scale] |
mov eax, [ff_width] |
inc eax |
shr eax, cl |
push ebx edx |
shr ebx, cl |
shr edx, cl |
imul eax, ebx |
add eax, edx |
pop edx ebx |
add eax, edi |
call .read_byte |
test al, al |
jz @f |
mov eax, esi |
mov [ebp], al |
; -- end body -- |
;-------------------------------------- |
align 4 |
@@: |
inc ebp |
inc edx |
cmp edx, [ff_xsz] |
jb .ff_new_x |
sub ebp, [ff_xsz] |
add ebp, [ff_x] |
add ebp, [_display.width] ; screen.x |
inc ebx |
cmp ebx, [ff_ysz] |
jb .ff_new_y |
add esp, 24 |
;-------------------------------------- |
align 4 |
.exit: |
popad |
inc [_display.mask_seqno] |
ret |
;-------------------------------------- |
align 4 |
.read_byte: |
; eax - address |
; esi - slot |
push eax ecx edx esi |
xchg eax, esi |
lea ecx, [esp + 12] |
mov edx, 1 |
call read_process_memory |
pop esi edx ecx eax |
ret |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
window._.window_activate: ;//////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? Activate window |
;------------------------------------------------------------------------------ |
;> esi = pointer to WIN_POS+ window data |
;------------------------------------------------------------------------------ |
push eax ebx |
; if type of current active window is 3 or 4, it must be redrawn |
mov ebx, [thread_count] |
; DEBUGF 1, "K : thread_count (0x%x)\n", ebx |
movzx ebx, word[WIN_POS + ebx * 2] |
shl ebx, 5 |
add eax, window_data |
mov al, [window_data + ebx + WDATA.fl_wstyle] |
and al, 0x0f |
cmp al, 0x03 |
je .set_window_redraw_flag |
cmp al, 0x04 |
jne .move_others_down |
;-------------------------------------- |
align 4 |
.set_window_redraw_flag: |
mov [window_data + ebx + WDATA.fl_redraw], 1 |
;-------------------------------------- |
align 4 |
.move_others_down: |
; bx <- process no |
movzx ebx, word[esi] |
; bx <- position in window stack |
movzx ebx, word[WIN_STACK + ebx * 2] |
; drop others |
xor eax, eax |
;-------------------------------------- |
align 4 |
.next_stack_window: |
cmp eax, [thread_count] |
jae .move_self_up |
inc eax |
; push ebx |
; xor ebx,ebx |
; mov bx,[WIN_STACK + eax * 2] |
; DEBUGF 1, "K : DEC WIN_STACK (0x%x)\n",ebx |
; pop ebx |
cmp [WIN_STACK + eax * 2], bx |
jbe .next_stack_window |
dec word[WIN_STACK + eax * 2] |
jmp .next_stack_window |
;-------------------------------------- |
align 4 |
.move_self_up: |
movzx ebx, word[esi] |
; number of thread |
mov ax, word [thread_count] |
; this is the last (and the upper) |
mov [WIN_STACK + ebx * 2], ax |
; update on screen - window stack |
xor eax, eax |
;-------------------------------------- |
align 4 |
.next_window_pos: |
cmp eax, [thread_count] |
jae .reset_vars |
inc eax |
movzx ebx, word[WIN_STACK + eax * 2] |
mov [WIN_POS + ebx * 2], ax |
jmp .next_window_pos |
;-------------------------------------- |
align 4 |
.reset_vars: |
mov byte[KEY_COUNT], 0 |
mov byte[BTN_COUNT], 0 |
mov word[MOUSE_SCROLL_H], 0 |
mov word[MOUSE_SCROLL_V], 0 |
pop ebx eax |
ret |
;------------------------------------------------------------------------------ |
window._.window_deactivate: ;//////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? Deactivate window |
;------------------------------------------------------------------------------ |
;> esi = pointer to WIN_POS+ window data |
;------------------------------------------------------------------------------ |
push eax ebx |
;-------------------------------------- |
align 4 |
.move_others_up: |
; ax <- process no |
movzx ebx, word[esi] |
; ax <- position in window stack |
movzx ebx, word[WIN_STACK + ebx * 2] |
; up others |
xor eax, eax |
;-------------------------------------- |
align 4 |
.next_stack_window: |
cmp eax, [thread_count] |
jae .move_self_down |
inc eax |
cmp [WIN_STACK + eax * 2], bx |
jae .next_stack_window |
inc word[WIN_STACK + eax * 2] |
jmp .next_stack_window |
;-------------------------------------- |
align 4 |
.move_self_down: |
movzx ebx, word[esi] |
; this is the last (and the low) |
mov [WIN_STACK + ebx * 2], word 1 |
; update on screen - window stack |
xor eax, eax |
;-------------------------------------- |
align 4 |
.next_window_pos: |
cmp eax, [thread_count] |
jae .reset_vars |
inc eax |
movzx ebx, word[WIN_STACK + eax * 2] |
mov [WIN_POS + ebx * 2], ax |
jmp .next_window_pos |
;-------------------------------------- |
align 4 |
.reset_vars: |
mov byte[KEY_COUNT], 0 |
mov byte[BTN_COUNT], 0 |
mov word[MOUSE_SCROLL_H], 0 |
mov word[MOUSE_SCROLL_V], 0 |
pop ebx eax |
ret |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
window._.check_window_draw: ;////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? Check if window is necessary to draw |
;------------------------------------------------------------------------------ |
;> edi = pointer to WDATA |
;------------------------------------------------------------------------------ |
mov cl, [edi + WDATA.fl_wstyle] |
and cl, 0x0f |
cmp cl, 3 |
je .exit.redraw ; window type 3 |
cmp cl, 4 |
je .exit.redraw ; window type 4 |
push eax ebx edx esi |
mov eax, edi |
sub eax, window_data |
shr eax, 5 |
movzx eax, word[WIN_STACK + eax * 2] ; get value of the curr process |
lea esi, [WIN_POS + eax * 2] ; get address of this process at 0xC400 |
;-------------------------------------- |
align 4 |
.next_window: |
add esi, 2 |
mov eax, [thread_count] |
lea eax, word[WIN_POS + eax * 2] ; number of the upper window |
cmp esi, eax |
ja .exit.no_redraw |
movzx edx, word[esi] |
shl edx, 5 ; size of TASKDATA and WDATA is 32 bytes |
cmp byte [TASK_TABLE + edx + TASKDATA.state], TSTATE_FREE |
je .next_window |
mov eax, [edi + WDATA.box.top] |
mov ebx, [edi + WDATA.box.height] |
add ebx, eax |
mov ecx, [window_data + edx + WDATA.box.top] |
cmp ecx, ebx |
jge .next_window |
add ecx, [window_data + edx + WDATA.box.height] |
cmp eax, ecx |
jge .next_window |
mov eax, [edi + WDATA.box.left] |
mov ebx, [edi + WDATA.box.width] |
add ebx, eax |
mov ecx, [window_data + edx + WDATA.box.left] |
cmp ecx, ebx |
jge .next_window |
add ecx, [window_data + edx + WDATA.box.width] |
cmp eax, ecx |
jge .next_window |
pop esi edx ebx eax |
;-------------------------------------- |
align 4 |
.exit.redraw: |
xor ecx, ecx |
inc ecx |
ret |
;-------------------------------------- |
align 4 |
.exit.no_redraw: |
pop esi edx ebx eax |
xor ecx, ecx |
ret |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
window._.draw_window_caption: ;//////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? <description> |
;------------------------------------------------------------------------------ |
xor eax, eax |
mov edx, [thread_count] |
movzx edx, word[WIN_POS + edx * 2] |
cmp edx, [current_slot_idx] |
jne @f |
inc eax |
;-------------------------------------- |
align 4 |
@@: |
mov edx, [current_slot_idx] |
shl edx, 5 |
add edx, window_data |
movzx ebx, [edx + WDATA.fl_wstyle] |
and bl, 0x0F |
cmp bl, 3 |
je .draw_caption_style_3 |
cmp bl, 4 |
je .draw_caption_style_3 |
jmp .not_style_3 |
;-------------------------------------- |
align 4 |
.draw_caption_style_3: |
push edx |
call drawwindow_IV_caption |
add esp, 4 |
jmp .2 |
;-------------------------------------- |
align 4 |
.not_style_3: |
cmp bl, 2 |
jne .not_style_2 |
call drawwindow_III_caption |
jmp .2 |
;-------------------------------------- |
align 4 |
.not_style_2: |
cmp bl, 0 |
jne .2 |
call drawwindow_I_caption |
;-------------------------------------- |
align 4 |
.2: |
mov edi, [current_slot_idx] |
shl edi, 5 |
test [edi + window_data + WDATA.fl_wstyle], WSTYLE_HASCAPTION |
jz .exit |
mov edx, [edi * 8 + SLOT_BASE + APPDATA.wnd_caption] |
or edx, edx |
jz .exit |
mov ebp, [edi + window_data + WDATA.box.left - 2] |
mov bp, word[edi + window_data + WDATA.box.top] |
movzx eax, [edi + window_data + WDATA.fl_wstyle] |
and al, 0x0F |
cmp al, 3 |
je .skinned |
cmp al, 4 |
je .skinned |
jmp .not_skinned |
;-------------------------------------- |
align 4 |
.skinned: |
movzx eax, word[edi + window_data + WDATA.box.width] |
sub ax, [_skinmargins.left] |
sub ax, [_skinmargins.right] |
js .exit |
mov ebx, dword[_skinmargins.left - 2] |
mov bx, word[_skinh] |
sub bx, [_skinmargins.bottom] |
sub bx, [_skinmargins.top] |
sar bx, 1 |
add bx, [_skinmargins.top] |
sub bx, 8 |
jmp .dodraw |
;-------------------------------------- |
align 4 |
.not_skinned: |
cmp al, 1 |
je .exit |
movzx eax, word[edi + window_data + WDATA.box.width] |
sub eax, 16 |
js .exit |
mov ebx, 80002h |
.dodraw: |
shr eax, 3 |
mov esi, eax |
add ebx, ebp |
mov ecx, [common_colours + 16] |
mov al, [edi*8 + SLOT_BASE + APPDATA.captionEncoding] |
test al, al |
jnz @f |
mov al, 1 |
cmp byte [edx], 4 |
jnc @f |
mov al, [edx] |
test al, al |
jz .exit |
inc edx |
@@: |
shl eax, 28 |
or ecx, eax |
xor edi, edi |
stc |
call dtext._ |
.exit: |
jmp __sys_draw_pointer |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
window._.draw_negative_box: ;////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? Draw negative box |
;------------------------------------------------------------------------------ |
;> edi = pointer to BOX struct |
;------------------------------------------------------------------------------ |
push eax ebx esi |
mov esi, 0x01000000 |
;-------------------------------------- |
align 4 |
.1: |
mov eax, [edi + BOX.left - 2] |
mov ax, word[edi + BOX.left] |
add ax, word[edi + BOX.width] |
mov ebx, [edi + BOX.top - 2] |
mov bx, word[edi + BOX.top] |
add bx, word[edi + BOX.height] |
call draw_rectangle.forced |
pop esi ebx eax |
ret |
;------------------------------------------------------------------------------ |
;align 4 |
;------------------------------------------------------------------------------ |
;window._.end_moving__box: ;////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? Draw positive box |
;------------------------------------------------------------------------------ |
;> edi = pointer to BOX struct |
;------------------------------------------------------------------------------ |
; push eax ebx esi |
; xor esi, esi |
; jmp window._.draw_negative_box.1 |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
window._.get_rect: ;///////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? <description> void __fastcall get_window_rect(struct RECT* rc); |
;------------------------------------------------------------------------------ |
;> ecx = pointer to RECT |
;------------------------------------------------------------------------------ |
mov eax, [TASK_BASE] |
mov edx, [eax-twdw + WDATA.box.left] |
mov [ecx+RECT.left], edx |
add edx, [eax-twdw + WDATA.box.width] |
mov [ecx+RECT.right], edx |
mov edx, [eax-twdw + WDATA.box.top] |
mov [ecx+RECT.top], edx |
add edx, [eax-twdw + WDATA.box.height] |
mov [ecx+RECT.bottom], edx |
ret |
;------------------------------------------------------------------------------ |
align 4 |
;------------------------------------------------------------------------------ |
window._.redraw_top_wnd: ;//////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? redraw all windows one above the window |
;------------------------------------------------------------------------------ |
;> eax = left |
;> ebx = top |
;> ecx = right |
;> edx = bottom |
;> esi = process number |
;! corrupted edi |
;------------------------------------------------------------------------------ |
push 0 |
jmp window._.set_top_wnd.go |
align 4 |
;------------------------------------------------------------------------------ |
window._.set_top_wnd: ;//////////////////////////////////////////////////////// |
;------------------------------------------------------------------------------ |
;? call set_screen for all windows one above the window |
;------------------------------------------------------------------------------ |
;> eax = left |
;> ebx = top |
;> ecx = right |
;> edx = bottom |
;> esi = process number |
;! corrupted edi |
;------------------------------------------------------------------------------ |
push 1 |
.go: |
push esi |
pushfd |
cli |
push ebp |
mov ebp, [thread_count] |
cmp ebp, 1 |
jbe .exit |
shl esi, 5 |
cmp [esi + window_data + WDATA.z_modif], ZPOS_ALWAYS_TOP |
je .exit |
push eax ;for num layout |
push edx ecx ebx eax |
movsx eax, byte [esi + window_data + WDATA.z_modif] |
inc eax |
mov dword[esp+10h], eax |
;-------------------------------------- |
align 4 |
.layout: |
mov esi, 1 ; = num in window stack |
mov ebp, [thread_count] |
;-------------------------------------- |
align 4 |
.next_window: |
movzx edi, word[WIN_POS + esi * 2] |
shl edi, 5 ;size of TASKDATA and WDATA = 32 bytes |
cmp byte [TASK_TABLE + edi + TASKDATA.state], TSTATE_FREE |
je .skip_window |
add edi, window_data |
test [edi + WDATA.fl_wstate], WSTATE_MINIMIZED |
jnz .skip_window |
mov eax, [esp+10h] |
cmp [edi + WDATA.z_modif], al |
jne .skip_window |
mov eax, [edi + WDATA.box.left] |
cmp eax, [esp + RECT.right] |
jg .skip_window |
mov ebx, [edi + WDATA.box.top] |
cmp ebx, [esp + RECT.bottom] |
jg .skip_window |
mov ecx, [edi + WDATA.box.width] |
add ecx, eax |
cmp ecx, [esp + RECT.left] |
jl .skip_window |
mov edx, [edi + WDATA.box.height] |
add edx, ebx |
cmp edx, [esp + RECT.top] |
jl .skip_window |
cmp eax, [esp + RECT.left] |
jae @f |
mov eax, [esp + RECT.left] |
;-------------------------------------- |
align 4 |
@@: |
cmp ebx, [esp + RECT.top] |
jae @f |
mov ebx, [esp + RECT.top] |
;-------------------------------------- |
align 4 |
@@: |
cmp ecx, [esp + RECT.right] |
jbe @f |
mov ecx, [esp + RECT.right] |
;-------------------------------------- |
align 4 |
@@: |
cmp edx, [esp + RECT.bottom] |
jbe @f |
mov edx, [esp + RECT.bottom] |
;-------------------------------------- |
align 4 |
@@: |
cmp dword[esp+32], 0 |
je .set_fl_redraw |
push esi |
movzx esi, word[WIN_POS + esi * 2] |
call window._.set_screen |
pop esi |
jmp @f |
.set_fl_redraw: |
mov [edi + WDATA.fl_redraw], 1 ;set redraw flag |
@@: |
;-------------------------------------- |
align 4 |
.skip_window: |
inc esi |
dec ebp |
jnz .next_window |
;-------------------------------------- |
inc dword[esp+10h] |
cmp byte[esp+10h], ZPOS_ALWAYS_TOP |
jle .layout |
;------------------------------------- |
pop eax ebx ecx edx |
pop ebp ;del num layout |
;------------------------------------- |
align 4 |
.exit: |
pop ebp |
popfd |
pop esi |
add esp, 4 ;dword for 0/1 - set_screen/fl_redraw |
ret |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
Added: svn:keywords |
+Rev |
\ No newline at end of property |
/kernel/branches/kolibri-ahci/gui/button.inc |
---|
0,0 → 1,346 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;; |
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; |
;; Distributed under terms of the GNU General Public License ;; |
;; ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
$Revision$ |
button.MAX_BUTTONS = 4095 |
struct SYS_BUTTON |
pslot dw ? |
id_lo dw ? |
left dw ? |
width dw ? |
top dw ? |
height dw ? |
id_hi dw ? |
dw ? |
ends |
;--------------------------------------------------------------- |
syscall_button: ;////////////// system function 8 ////////////// |
;--------------------------------------------------------------- |
;? Define/undefine GUI button object |
;--------------------------------------------------------------- |
;; Define button: |
;> ebx = pack[16(x), 16(width)] |
;> ecx = pack[16(y), 16(height)] |
;> edx = pack[8(flags), 24(button identifier)] |
;> flags bits: |
;> 7 (31) = 0 |
;> 6 (30) = don't draw button |
;> 5 (29) = don't draw button frame when pressed |
;> esi = button color |
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
;; Undefine button: |
;> edx = pack[8(flags), 24(button identifier)] |
;> flags bits: |
;> 7 (31) = 1 |
;--------------------------------------------------------------- |
; do we actually need to undefine the button? |
test edx, 0x80000000 |
jnz .remove_button |
; do we have free button slots available? |
mov edi, [BTN_ADDR] |
mov eax, [edi] |
cmp eax, button.MAX_BUTTONS |
jge .exit |
; does it have positive size? (otherwise it doesn't have sense) |
or bx, bx |
jle .exit |
or cx, cx |
jle .exit |
; make coordinates clientbox-relative |
push eax |
mov eax, [current_slot] |
rol ebx, 16 |
add bx, word[eax + APPDATA.wnd_clientbox.left] |
rol ebx, 16 |
rol ecx, 16 |
add cx, word[eax + APPDATA.wnd_clientbox.top] |
rol ecx, 16 |
pop eax |
; basic checks passed, define the button |
inc eax |
mov [edi], ax |
shl eax, 4 |
add edi, eax |
; NOTE: this code doesn't rely on SYS_BUTTON struct, |
; please revise it, if you change something. |
mov ax, word [current_slot_idx] |
stosw |
mov ax, dx |
stosw ; button id number: bits 0-15 |
mov eax, ebx |
rol eax, 16 |
stosd ; x start | x size |
mov eax, ecx |
rol eax, 16 |
stosd ; y start | y size |
mov eax, edx |
shr eax, 16 |
stosw ; button id number: bits 16-31 |
; do we also need to draw the button? |
test edx, 0x40000000 |
jnz .exit |
and esi, 0xFFFFFF |
xor edi, edi |
push ebx ecx esi |
dec cx |
dec cx |
cmp [buttontype], 1 |
jnz .draw |
cmp cx, 65 |
jnc .draw |
; calculate gradient data |
mov eax, esi |
shl eax, 8 |
mov edx, 3 |
.calculate: |
rol eax, 8 |
shl al, 1 |
jnc @f |
neg al |
jnz @f |
mov al, 64 |
@@: |
cmp al, 65 |
jc @f |
mov al, 64 |
@@: |
div cl |
shl ax, 8 |
dec edx |
jnz .calculate |
mov dl, cl |
dec edx |
shr edx, 1 |
shr eax, 8 |
mov edi, eax |
mul edx |
add esi, eax |
.draw: ; calculate window-relative coordinates |
movzx ebp, cx |
dec ebp |
shr ebx, 16 |
shr ecx, 16 |
mov eax, [TASK_BASE] |
add ebx, [eax - twdw + WDATA.box.left] |
add ecx, [eax - twdw + WDATA.box.top] |
mov eax, ebx |
inc eax |
mov edx, ebx |
add dx, [esp+8] |
dec edx |
mov ebx, ecx |
mov ecx, esi |
shr ecx, 1 |
and cx, 7F7Fh |
push esi |
mov esi, edi |
xor edi, edi |
call hline ; top border |
inc ebx |
or ecx, 808080h |
call hline ; top light line |
pop ecx |
inc ebx |
.next_line: |
call hline ; button body |
inc ebx |
sub ecx, esi |
dec ebp |
jnz .next_line |
shr ecx, 2 |
and cx, 3F3Fh |
mov ebp, ecx |
shl ecx, 1 |
add ecx, ebp |
call hline ; bottom dark line |
inc ebx |
sub ecx, ebp |
call hline ; bottom border |
pop ecx |
shr ecx, 1 |
inc edx |
push edx |
mov edx, ebx |
sub bx, [esp+4] |
dec edx |
inc ebx |
cmp [buttontype], 0 |
jnz @f |
dec edx |
or ecx, 808080h |
call vline ; left light line |
inc edx |
@@: |
and ecx, 7F7F7Fh |
dec eax |
call vline ; left border |
pop eax |
call vline ; right border |
cmp [buttontype], 0 |
jnz @f |
mov ebp, ecx |
shr ecx, 1 |
and cx, 7F7Fh |
add ecx, ebp |
dec eax |
inc ebx |
dec edx ; avoid lines overflow |
call vline ; right dark line |
@@: |
pop ecx ebx |
.exit: |
ret |
; FIXME: mutex needed |
.remove_button: |
and edx, 0x00ffffff |
mov edi, [BTN_ADDR] |
mov ebx, [edi] |
inc ebx |
imul esi, ebx, sizeof.SYS_BUTTON |
add esi, edi |
xor ecx, ecx |
add ecx, -sizeof.SYS_BUTTON |
add esi, sizeof.SYS_BUTTON |
.next_button: |
dec ebx |
jz .exit |
add ecx, sizeof.SYS_BUTTON |
add esi, -sizeof.SYS_BUTTON |
; does it belong to our process? |
mov ax, word [current_slot_idx] |
cmp ax, [esi + SYS_BUTTON.pslot] |
jne .next_button |
; does the identifier match? |
mov eax, dword[esi + SYS_BUTTON.id_hi - 2] |
mov ax, [esi + SYS_BUTTON.id_lo] |
and eax, 0x00ffffff |
cmp edx, eax |
jne .next_button |
; okay, undefine it |
push ebx |
mov ebx, esi |
lea eax, [esi + sizeof.SYS_BUTTON] |
call memmove |
dec dword[edi] |
add ecx, -sizeof.SYS_BUTTON |
pop ebx |
jmp .next_button |
;--------------------------------------------------------------- |
sys_button_activate_handler: |
sys_button_deactivate_handler: |
;--------------------------------------------------------------- |
;> eax = pack[8(process slot), 24(button id)] |
;> ebx = pack[16(button x coord), 16(button y coord)] |
;> cl = mouse button mask this system button was pressed with |
;--------------------------------------------------------------- |
; find system button by specified process slot, id and coordinates |
push ecx edx esi edi |
mov edx, eax |
shr edx, 24 |
and eax, 0x0ffffff |
mov edi, [BTN_ADDR] |
mov ecx, [edi] |
imul esi, ecx, sizeof.SYS_BUTTON |
add esi, edi |
inc ecx |
add esi, sizeof.SYS_BUTTON |
.next_button: |
dec ecx |
jz .popexit |
add esi, -sizeof.SYS_BUTTON |
; does it belong to our process? |
cmp dx, [esi + SYS_BUTTON.pslot] |
jne .next_button |
; does id match? |
mov edi, dword[esi + SYS_BUTTON.id_hi - 2] |
mov di, [esi + SYS_BUTTON.id_lo] |
and edi, 0x0ffffff |
cmp eax, edi |
jne .next_button |
; does coordinates match? |
mov edi, dword[esi + SYS_BUTTON.left - 2] |
mov di, [esi + SYS_BUTTON.top] |
cmp ebx, edi |
jne .next_button |
mov eax, esi |
pop edi esi edx ecx |
mov ebx, dword[eax + SYS_BUTTON.id_hi - 2] |
; display button border on press? |
bt ebx, 29 |
jc .exit |
; invert system button border |
pushad |
mov esi, eax |
mov edi, ebx |
movzx ecx, [esi + SYS_BUTTON.pslot] |
shl ecx, 5 |
add ecx, window_data |
mov eax, dword[esi + SYS_BUTTON.left] |
mov ebx, dword[esi + SYS_BUTTON.top] |
add eax, [ecx + WDATA.box.left] |
add ebx, [ecx + WDATA.box.top] |
mov ecx, eax |
mov edx, ebx |
bt edi, 30 |
jc @f |
inc ax |
inc bx |
dec cx |
dec dx |
@@: |
rol eax, 16 |
rol ebx, 16 |
add ax, cx |
add bx, dx |
mov esi, 1000000h |
call draw_rectangle.forced |
popad |
.exit: |
ret |
.popexit: |
pop edi esi edx ecx |
ret |
;--------------------------------------------------------------- |
sys_button_perform_handler: |
;--------------------------------------------------------------- |
;> eax = pack[8(process slot), 24(button id)] |
;> ebx = pack[16(button x coord), 16(button y coord)] |
;> cl = mouse button mask this system button was pressed with |
;--------------------------------------------------------------- |
shl eax, 8 |
mov al, cl |
movzx ebx, byte[BTN_COUNT] |
mov [BTN_BUFF + ebx * 4], eax |
inc bl |
mov [BTN_COUNT], bl |
ret |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
Added: svn:keywords |
+Rev |
\ No newline at end of property |
/kernel/branches/kolibri-ahci/gui/event.inc |
---|
0,0 → 1,622 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;; |
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; |
;; Distributed under terms of the GNU General Public License ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
$Revision$ |
WINDOW_MOVE_AND_RESIZE_FLAGS = \ |
mouse.WINDOW_RESIZE_N_FLAG + \ |
mouse.WINDOW_RESIZE_W_FLAG + \ |
mouse.WINDOW_RESIZE_S_FLAG + \ |
mouse.WINDOW_RESIZE_E_FLAG + \ |
mouse.WINDOW_MOVE_FLAG |
uglobal |
align 4 |
event_start dd ? |
event_end dd ? |
event_uid dd 0 |
endg |
EV_SPACE = 512 |
FreeEvents = event_start-EVENT.fd ; "virtual" event, only following field used: |
; FreeEvents.fd=event_start and FreeEvents.bk=event_end |
;----------------------------------------------------------------------------- |
align 4 |
init_events: ;; used from kernel.asm |
stdcall kernel_alloc, EV_SPACE*sizeof.EVENT |
or eax, eax |
jz .fail |
; eax - current event, ebx - previous event below |
mov ecx, EV_SPACE ; current - in allocated space |
mov ebx, FreeEvents ; previous - list beginning |
push ebx ; it will be the end later |
;-------------------------------------- |
align 4 |
@@: |
mov [ebx+EVENT.fd], eax |
mov [eax+EVENT.bk], ebx |
mov ebx, eax ; previos <- current |
add eax, sizeof.EVENT ; new current |
loop @b |
pop eax ; here it became the end |
mov [ebx+EVENT.fd], eax |
mov [eax+EVENT.bk], ebx |
;-------------------------------------- |
align 4 |
.fail: |
ret |
;----------------------------------------------------------------------------- |
EVENT_WATCHED = 0x10000000 ; bit 28 |
EVENT_SIGNALED = 0x20000000 ; bit 29 |
MANUAL_RESET = 0x40000000 ; bit 30 |
MANUAL_DESTROY = 0x80000000 ; bit 31 |
;----------------------------------------------------------------------------- |
align 4 |
create_event: ;; EXPORT use |
;info: |
; Move EVENT from the FreeEvents list to the ObjList list of the current slot; |
; EVENT.state is set from ecx, EVENT.code indirectly from esi (if esi <> 0) |
;param: |
; esi - event data |
; ecx - flags |
;retval: |
; eax - event (=0 => fail) |
; edx - uid |
;scratched: ebx,ecx,esi,edi |
mov ebx, [current_slot] |
add ebx, APP_OBJ_OFFSET |
mov edx, [TASK_BASE] |
mov edx, [edx+TASKDATA.pid] |
pushfd |
cli |
;-------------------------------------- |
align 4 |
set_event: ;; INTERNAL use !!! don't use for Call |
;info: |
; We take a new event from FreeEvents, fill its fields from ecx, edx, esi |
; and add it to the list, which specified in ebx. |
; Return event (to eax), and it's uid (to edx) |
;param: |
; ebx - start-chain "virtual" event for entry new event Right of him |
; ecx - flags (copied to EVENT.state) |
; edx - pid (copied to EVENT.pid) |
; esi - event data (copied to EVENT.code indirect, =0 => skip) |
;retval: |
; eax - event (=0 => fail) |
; edx - uid |
;scratched: ebx,ecx,esi,edi |
mov eax, FreeEvents |
cmp eax, [eax+EVENT.fd] |
jne @f ; not empty ??? |
pushad |
call init_events |
popad |
jz RemoveEventTo.break ; POPF+RET |
;-------------------------------------- |
align 4 |
@@: |
mov eax, [eax+EVENT.fd] |
mov [eax+EVENT.magic], 'EVNT' |
mov [eax+EVENT.destroy], destroy_event.internal |
mov [eax+EVENT.state], ecx |
mov [eax+EVENT.pid], edx |
inc [event_uid] |
mov edx, [event_uid] |
mov [eax+EVENT.id], edx |
or esi, esi |
jz RemoveEventTo |
lea edi, [eax+EVENT.code] |
mov ecx, (sizeof.EVENT -EVENT.code)/4 |
cld |
rep movsd |
;-------------------------------------- |
align 4 |
RemoveEventTo: ;; INTERNAL use !!! don't use for Call |
;param: |
; eax - pointer to event, WHICH we will insert |
; ebx - pointer to event, AFTER which we will insert |
;scratched: ebx,ecx |
mov ecx, eax ; ecx=eax=Self, ebx=NewLeft |
xchg ecx, [ebx+EVENT.fd] ; NewLeft.fd=Self, ecx=NewRight |
cmp eax, ecx ; stop, I think... |
je .break ; - am I not a fool? |
mov [ecx+EVENT.bk], eax ; NewRight.bk=Self |
xchg ebx, [eax+EVENT.bk] ; Self.bk=NewLeft, ebx=OldLeft |
xchg ecx, [eax+EVENT.fd] ; Self.fd=NewRight, ecx=OldRight |
mov [ebx+EVENT.fd], ecx ; OldLeft.fd=OldRight |
mov [ecx+EVENT.bk], ebx ; OldRight.bk=OldLeft |
;-------------------------------------- |
align 4 |
.break: |
popfd |
ret |
;----------------------------------------------------------------------------- |
align 4 |
NotDummyTest: ;; INTERNAL use (not returned for fail !!!) |
pop edi |
call DummyTest ; not returned for fail !!! |
mov ebx, eax |
mov eax, [ebx+EVENT.pid] |
push edi |
;-------------------------------------- |
align 4 |
.small: ; somehow ugly... |
pop edi |
pushfd |
cli |
call pid_to_slot ; saved all registers (eax - retval) |
shl eax, 8 |
jz RemoveEventTo.break ; POPF+RET |
jmp edi ; normal return |
;----------------------------------------------------------------------------- |
align 4 |
raise_event: ;; EXPORT use |
;info: |
; Setting up EVENT.code data |
; If is has flag EVENT_SIGNALED activated - nothing else |
; Otherwise: activate this flag, except when the EVENT_WATCHED flag is present in edx |
; In this case EVENT_SIGNALED will activated only if EVENT_WATCHED presents in the event itself |
;param: |
; eax - event |
; ebx - uid (for Dummy testing) |
; edx - flags |
; esi - event data (=0 => skip) |
;scratched: ebx,ecx,esi,edi |
call NotDummyTest ; not returned for fail !!! |
or esi, esi |
jz @f |
lea edi, [ebx+EVENT.code] |
mov ecx, (sizeof.EVENT -EVENT.code)/4 |
cld |
rep movsd |
;-------------------------------------- |
align 4 |
@@: |
test byte[ebx+EVENT.state+3], EVENT_SIGNALED shr 24 |
jnz RemoveEventTo.break ; POPF+RET |
bt edx, 28 ;EVENT_WATCHED |
jnc @f |
test byte[ebx+EVENT.state+3], EVENT_WATCHED shr 24 |
jz RemoveEventTo.break ; POPF+RET |
;-------------------------------------- |
align 4 |
@@: |
or byte[ebx+EVENT.state+3], EVENT_SIGNALED shr 24 |
add eax, SLOT_BASE+APP_EV_OFFSET |
xchg eax, ebx |
jmp RemoveEventTo |
;----------------------------------------------------------------------------- |
align 4 |
clear_event: ;; EXPORT use |
;info: |
; |
;param: |
; eax - event |
; ebx - uid (for Dummy testing) |
;scratched: ebx,ecx |
call NotDummyTest ; not returned for fail !!! |
add eax, SLOT_BASE+APP_OBJ_OFFSET |
and byte[ebx+EVENT.state+3], not((EVENT_SIGNALED+EVENT_WATCHED)shr 24) |
xchg eax, ebx |
jmp RemoveEventTo |
;----------------------------------------------------------------------------- |
align 4 |
send_event: ;; EXPORT use |
;info: |
; Creates a new EVENT (pulls from the FreeEvents list) in the EventList list |
; of target slot (eax=pid), with data from esi indirectly, and state=EVENT_SIGNALED |
;param: |
; eax - slots pid, to sending new event |
; esi - pointer to sending data (in code field of new event) |
;retval: |
; eax - event (=0 => fail) |
; edx - uid |
;warning: |
; may be used as CDECL with such prefix... |
; mov esi,[esp+8] |
; mov eax,[esp+4] |
; but not as STDCALL :( |
;scratched: ebx,ecx,esi,edi |
mov edx, eax |
call NotDummyTest.small ; not returned for fail !!! |
lea ebx, [eax+SLOT_BASE+APP_EV_OFFSET] |
mov ecx, EVENT_SIGNALED |
jmp set_event |
;----------------------------------------------------------------------------- |
align 4 |
DummyTest: ;; INTERNAL use (not returned for fail !!!) |
;param: |
; eax - event |
; ebx - uid (for Dummy testing) |
cmp [eax+EVENT.magic], 'EVNT' |
jne @f |
cmp [eax+EVENT.id], ebx |
je .ret |
;-------------------------------------- |
align 4 |
@@: |
pop eax |
xor eax, eax |
;-------------------------------------- |
align 4 |
.ret: |
ret |
;----------------------------------------------------------------------------- |
align 4 |
Wait_events: |
or ebx, -1; infinite timeout |
;-------------------------------------- |
align 4 |
Wait_events_ex: |
;info: |
; Waiting for an "abstract" event by moving the slot to the 5th position. |
; Abstractness lies in the fact, that the fact of an event is determined by the APPDATA.wait_test function, |
; which is set by the client and can be actually anything. |
; This allows the shed to reliably determine the fact of the event, and not make "idle" switches, |
; intended for showdowns like "friend / foe" within the problem. |
;param: |
; edx - wait_test, client testing function (code address) |
; ecx - wait_param, additional parameter, possibly needed for [wait_test] |
; ebx - wait_timeout |
;retval: |
; eax - call result [wait_test] (=0 => timeout) |
;scratched: esi |
mov esi, [current_slot] |
mov [esi+APPDATA.wait_param], ecx |
pushad |
mov ebx, esi ;now this is a question, what where to put.......... |
pushfd ; this is a consequence of the general concept: let the test function have |
cli ; the right to hope to disable interrupts, as when called from shed |
call edx |
popfd |
mov [esp+28], eax |
popad |
or eax, eax |
jnz @f ;RET |
mov [esi+APPDATA.wait_test], edx |
mov [esi+APPDATA.wait_timeout], ebx |
mov eax, [timer_ticks] |
mov [esi+APPDATA.wait_begin], eax |
mov eax, [TASK_BASE] |
mov [eax+TASKDATA.state], TSTATE_WAITING |
call change_task |
mov eax, [esi+APPDATA.wait_param] |
;-------------------------------------- |
align 4 |
@@: |
ret |
;----------------------------------------------------------------------------- |
align 4 |
wait_event: ;; EXPORT use |
;info: |
; Waiting for the EVENT_SIGNALED flag in a very specific Event |
; (set, presumably, via raise_event) |
; When the MANUAL_RESET flag is active, nothing else |
; Otherwise: the flags EVENT_SIGNALED and EVENT_WATCHED for the received event are cleared, |
; and, if MANUAL_DESTROY is active, it moves to the ObjList list of the current slot, |
; and if not active, it is destroyed normally (destroy_event.internal) |
;param: |
; eax - event |
; ebx - uid (for Dummy testing) |
;scratched: ecx,edx,esi |
call DummyTest |
mov ecx, eax ; wait_param |
mov edx, get_event_alone ; wait_test |
call Wait_events ; timeout ignored |
jmp wait_finish |
;----------------------------------------------------------------------------- |
align 4 |
wait_event_timeout: |
;param: |
; eax - event |
; ebx - uid (for Dummy testing) |
; ecx - timeout in timer ticks |
;retval: |
; eax - EVENT handle or 0 if timeout |
call DummyTest |
mov ebx, ecx |
mov ecx, eax ; wait_param |
mov edx, get_event_alone ; wait_test |
call Wait_events_ex |
test eax, eax |
jnz wait_finish |
ret |
;----------------------------------------------------------------------------- |
align 4 |
get_event_ex: ;; f68:14 |
;info: |
; Waiting for any event in the EventList of the current slot |
; Code event data - copied to application memory (indirectly by edi) |
; When the MANUAL_RESET flag is active, nothing else |
; Otherwise: the flags EVENT_SIGNALED and EVENT_WATCHED for the received event are cleared, |
; and, if MANUAL_DESTROY is active, it moves to the ObjList list of the current slot, |
; and if not active, it is destroyed normally (destroy_event.internal) |
;param: |
; edi - address in the application code to copy data from EVENT.code |
;retval: |
; eax - EVENT itself (we will call it a handle) |
;scratched: ebx,ecx,edx,esi,edi |
mov edx, get_event_queue ; wait_test |
call Wait_events ; timeout ignored |
lea esi, [eax+EVENT.code] |
mov ecx, (sizeof.EVENT-EVENT.code)/4 |
cld |
rep movsd |
mov byte[edi-(sizeof.EVENT-EVENT.code)+2], cl;clear priority field |
;-------------------------------------- |
align 4 |
wait_finish: |
test byte[eax+EVENT.state+3], MANUAL_RESET shr 24 |
jnz get_event_queue.ret ; RET |
and byte[eax+EVENT.state+3], not((EVENT_SIGNALED+EVENT_WATCHED)shr 24) |
test byte[eax+EVENT.state+3], MANUAL_DESTROY shr 24 |
jz destroy_event.internal |
mov ebx, [current_slot] |
add ebx, APP_OBJ_OFFSET |
pushfd |
cli |
jmp RemoveEventTo |
;----------------------------------------------------------------------------- |
align 4 |
destroy_event: ;; EXPORT use |
;info: |
; Move EVENT to the FreeEvents list, clear the magic, destroy, pid, id fields |
;param: |
; eax - event |
; ebx - uid (for Dummy testing) |
;retval: |
; eax - address of EVENT object (=0 => fail) |
;scratched: ebx,ecx |
call DummyTest ; not returned for fail !!! |
;-------------------------------------- |
align 4 |
.internal: |
xor ecx, ecx ; clear common header |
pushfd |
cli |
mov [eax+EVENT.magic], ecx |
mov [eax+EVENT.destroy], ecx |
mov [eax+EVENT.pid], ecx |
mov [eax+EVENT.id], ecx |
mov ebx, FreeEvents |
jmp RemoveEventTo |
;----------------------------------------------------------------------------- |
align 4 |
get_event_queue: |
;info: |
; client testing function for get_event_ex |
;warning: |
; -don't use [TASK_BASE],[current_slot],[current_slot_idx] - it is not for your slot |
; -may be assumed, that interrupt are disabled |
; -it is not restriction for scratched registers |
;param: |
; ebx - APPDATA address of testing slot |
;retval: |
; eax - address of EVENT object (=0 => fail) |
add ebx, APP_EV_OFFSET |
mov eax, [ebx+APPOBJ.bk] ; we choose from the end, according to the FIFO principle |
cmp eax, ebx ; empty ??? |
je get_event_alone.ret0 |
;-------------------------------------- |
align 4 |
.ret: |
ret |
;----------------------------------------------------------------------------- |
align 4 |
get_event_alone: |
;info: |
; client testing function for wait_event |
;warning: |
; -don't use [TASK_BASE],[current_slot],[current_slot_idx] - it is not for your slot |
; -may be assumed, that interrupt are disabled |
; -it is not restriction for scratched registers |
;param: |
; ebx - APPDATA address of testing slot |
;retval: |
; eax - address of EVENT object (=0 => fail) |
mov eax, [ebx+APPDATA.wait_param] |
test byte[eax+EVENT.state+3], EVENT_SIGNALED shr 24 |
jnz .ret |
or byte[eax+EVENT.state+3], EVENT_WATCHED shr 24 |
;-------------------------------------- |
align 4 |
.ret0: |
xor eax, eax; NO event!!! |
;-------------------------------------- |
align 4 |
.ret: |
ret |
;----------------------------------------------------------------------------- |
align 4 |
sys_sendwindowmsg: ;; f72 |
dec ebx |
jnz .ret ;subfunction==1 ? |
pushfd |
cli |
sub ecx, 2 |
je .sendkey |
dec ecx |
jnz .retf |
;-------------------------------------- |
align 4 |
.sendbtn: |
cmp byte[BTN_COUNT], 1 |
jae .result ;overflow |
inc byte[BTN_COUNT] |
shl edx, 8 |
mov [BTN_BUFF], edx |
jmp .result |
;-------------------------------------- |
align 4 |
.sendkey: |
movzx eax, byte[KEY_COUNT] |
cmp al, 120 |
jae .result ;overflow |
inc byte[KEY_COUNT] |
mov [KEY_BUFF+eax], dl |
; store empty scancode |
add eax, 120+2 |
mov [KEY_BUFF+eax], byte 0 |
sub eax, 120+2 |
;-------------------------------------- |
align 4 |
.result: |
setae byte[esp+32+4] ;we consider that initially was: dword[esp+32+4]==72 |
;-------------------------------------- |
align 4 |
.retf: |
popfd |
;-------------------------------------- |
align 4 |
.ret: |
ret |
;----------------------------------------------------------------------------- |
align 4 |
sys_getevent: ;; f11 |
mov ebx, [current_slot] ;now this is a question, what where to put...... |
pushfd ; this is a consequence of the general concept: let the test function have |
cli ; the right to hope to disable interrupts, as when called from shed |
call get_event_for_app |
popfd |
mov [esp+32], eax |
ret |
;----------------------------------------------------------------------------- |
align 4 |
sys_waitforevent: ;; f10 |
or ebx, -1; infinite timeout |
;-------------------------------------- |
align 4 |
sys_wait_event_timeout: ;; f23 |
call unprotect_from_terminate |
mov edx, get_event_for_app; wait_test |
call Wait_events_ex ; ebx - timeout |
mov [esp+32], eax |
call protect_from_terminate |
ret |
;----------------------------------------------------------------------------- |
align 4 |
get_event_for_app: ;; used from f10,f11,f23 |
;info: |
; client testing function for applications (f10,f23) |
;warning: |
; -don't use [TASK_BASE],[current_slot],[current_slot_idx] - it is not for your slot |
; -may be assumed, that interrupt are disabled |
; -it is not restriction for scratched registers |
;param: |
; ebx - APPDATA address of testing slot |
;retval: |
; eax - event number (=0 => no events) |
movzx edi, bh ; bh is assumed as [current_slot_idx] |
shl edi, 5 |
add edi, TASK_TABLE ; edi is assumed as [TASK_BASE] |
mov ecx, [edi+TASKDATA.event_mask] |
and ecx, 0x7FFFFFFF |
;-------------------------------------- |
align 4 |
.loop: ; until we run out all the bits of the mask |
bsr eax, ecx ; find a non-zero bit of the mask (31 -> 0) |
jz .no_events ; ran out all the bits of the mask but found nothing ??? |
btr ecx, eax ; clear the current checking bit of the mask |
; go to the handler of this (eax) bit |
cmp eax, 10 |
jae .loop ; eax=[10..31], ignored (event 11...32) |
cmp eax, 3 |
je .loop ; eax=3, ignored (event 4) |
cmp eax, 4 |
je .FlagAutoReset ; eax=4, retvals=eax+1 (event 5) |
cmp eax, 5 |
je .mouse_check ; eax=5, retvals=eax+1 (event 6) |
ja .FlagAutoReset ; eax=[6..9], retvals=eax+1 (event 7...10) |
cmp eax, 1 |
jae .BtKy ; eax=[1,2], retvals=eax+1 (event 2,3) |
;-------------------------------------- |
align 4 |
.WndRedraw: ; eax=0, retval WndRedraw=1 |
cmp [edi-twdw+WDATA.fl_redraw], al;al==0 |
jne .result |
jmp .loop |
;-------------------------------------- |
align 4 |
.no_events: |
xor eax, eax |
ret |
;-------------------------------------- |
align 4 |
.mouse_check: ; Mouse 5+1=6 |
push eax |
mov eax, [TASK_BASE] |
mov eax, [eax + TASKDATA.event_mask] |
test eax, 0x80000000 ; bit 31: active/inactive filter f.40 |
jz @f |
pop eax |
jmp .FlagAutoReset |
;-------------------------------------- |
align 4 |
@@: |
; If the window is captured and moved by the user, then no mouse events!!! |
mov al, [mouse.active_sys_window.action] |
and al, WINDOW_MOVE_AND_RESIZE_FLAGS |
test al, al |
pop eax |
jnz .loop |
;-------------------------------------- |
align 4 |
.FlagAutoReset: ; retvals: BgrRedraw=5, IPC=7, Stack=8, Debug=9 |
btr [ebx+APPDATA.occurred_events], eax |
jnc .loop |
;-------------------------------------- |
align 4 |
.result: ; retval = eax+1 |
inc eax |
ret |
;-------------------------------------- |
align 4 |
.BtKy: |
movzx edx, bh |
movzx edx, word[WIN_STACK+edx*2] |
je .Keys ; eax=1, retval Keys=2 |
;-------------------------------------- |
align 4 |
.Buttons: ; eax=2, retval Buttons=3 |
cmp byte[BTN_COUNT], 0 |
je .loop ; empty ??? |
cmp edx, [thread_count] |
jne .loop ; not Top ??? |
mov edx, [BTN_BUFF] |
shr edx, 8 |
cmp edx, 0xFFFF ;-ID for Minimize-Button of Form |
jne .result |
mov [window_minimize], 1 |
call wakeup_osloop |
dec byte[BTN_COUNT] |
jmp .loop |
;-------------------------------------- |
align 4 |
.Keys: ; eax==1 |
cmp edx, [thread_count] |
jne @f ; not Top ??? |
cmp [KEY_COUNT], al; al==1 |
jae .result ; not empty ??? |
;-------------------------------------- |
align 4 |
@@: |
mov edx, hotkey_buffer |
;-------------------------------------- |
align 4 |
@@: |
cmp [edx], bh ; bh - slot for testing |
je .result |
add edx, 8 |
cmp edx, hotkey_buffer+120*8 |
jb @b |
jmp .loop |
;end. |
;----------------------------------------------------------------------------- |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
Added: svn:keywords |
+Rev |
\ No newline at end of property |
/kernel/branches/kolibri-ahci/gui/skincode.inc |
---|
0,0 → 1,453 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; |
;; Distributed under terms of the GNU General Public License ;; |
;; ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
$Revision$ |
include "skindata.inc" |
;skin_data = 0x00778000 |
;----------------------------------------------------------------- |
align 4 |
read_skin_file: |
stdcall load_file, ebx |
test eax, eax |
jz .notfound |
cmp dword [eax], 'SKIN' |
jnz .noskin |
xchg eax, [skin_data] |
test eax, eax |
jz @f |
stdcall kernel_free, eax |
@@: |
call parse_skin_data |
xor eax, eax |
ret |
;-------------------------------------- |
align 4 |
.notfound: |
xor eax, eax |
inc eax |
ret |
;-------------------------------------- |
align 4 |
.noskin: |
stdcall kernel_free, eax |
mov eax, 2 |
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 rb 40 |
ends |
struct SKIN_BUTTONS |
type dd ? |
; position |
left dw ? |
top dw ? |
; size |
width dw ? |
height dw ? |
ends |
struct SKIN_BITMAPS |
kind dw ? |
type dw ? |
data dd ? |
ends |
;------------------------------------------------------------------------------ |
align 4 |
load_default_skin: |
mov [_skinh], 22 |
mov ebx, _skin_file_default |
call read_skin_file |
ret |
;------------------------------------------------------------------------------ |
align 4 |
parse_skin_data: |
mov ebp, [skin_data] |
cmp [ebp+SKIN_HEADER.ident], 'SKIN' |
jne .exit |
mov edi, skin_udata |
mov ecx, (skin_udata.end-skin_udata)/4 |
xor eax, eax |
cld |
rep stosd |
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, 255 |
rep movsb |
mov eax, dword[ebx+SKIN_PARAMS.margin.right] |
mov dword[_skinmargins+0], eax |
mov eax, dword[ebx+SKIN_PARAMS.margin.bottom] |
mov dword[_skinmargins+4], eax |
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 .next_bitmap |
mov edx, skin_inactive.left.data |
jmp .next_bitmap |
;-------------------------------------- |
align 4 |
.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 .next_bitmap |
mov edx, skin_inactive.oper.data |
jmp .next_bitmap |
;-------------------------------------- |
align 4 |
.not_oper: |
dec eax |
jnz .not_base |
mov eax, [skin_active.left.width] |
mov edx, skin_active.base.data |
or ecx, ecx |
jnz .next_bitmap |
mov eax, [skin_inactive.left.width] |
mov edx, skin_inactive.base.data |
jmp .next_bitmap |
;-------------------------------------- |
align 4 |
.not_base: |
add ebx, 8 |
jmp .lp1 |
;-------------------------------------- |
align 4 |
.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 |
;-------------------------------------- |
align 4 |
.end_bitmaps: |
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 |
;-------------------------------------- |
align 4 |
.not_close: |
dec eax |
jnz .not_minimize |
mov edx, skin_btn_minimize |
jmp .next_button |
;-------------------------------------- |
align 4 |
.not_minimize: |
add ebx, 12 |
jmp .lp2 |
;-------------------------------------- |
align 4 |
.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 |
;-------------------------------------- |
align 4 |
.end_buttons: |
.exit: |
ret |
;------------------------------------------------------------------------------ |
align 4 |
drawwindow_IV_caption: |
mov ebp, skin_active |
or al, al |
jnz @f |
mov ebp, skin_inactive |
@@: |
mov esi, [esp+4] |
mov eax, [esi+WDATA.box.width] ; window width |
mov edx, [ebp+SKIN_DATA.left.left] |
shl edx, 16 |
mov ecx, [ebp+SKIN_DATA.left.width] |
shl ecx, 16 |
add ecx, [_skinh] |
mov ebx, [ebp+SKIN_DATA.left.data] |
or ebx, ebx |
jz @f |
call sys_putimage.forced |
@@: |
mov esi, [esp+4] |
mov eax, [esi+WDATA.box.width] |
sub eax, [ebp+SKIN_DATA.left.width] |
sub eax, [ebp+SKIN_DATA.oper.width] |
cmp eax, [ebp+SKIN_DATA.base.left] |
jng .non_base |
xor edx, edx |
mov ecx, [ebp+SKIN_DATA.base.width] |
jecxz .non_base |
div ecx |
inc eax |
mov ebx, [ebp+SKIN_DATA.base.data] |
mov ecx, [ebp+SKIN_DATA.base.width] |
shl ecx, 16 |
add ecx, [_skinh] |
mov edx, [ebp+SKIN_DATA.base.left] |
sub edx, [ebp+SKIN_DATA.base.width] |
shl edx, 16 |
.baseskinloop: |
shr edx, 16 |
add edx, [ebp+SKIN_DATA.base.width] |
shl edx, 16 |
push eax ebx ecx edx |
or ebx, ebx |
jz @f |
call sys_putimage.forced |
@@: |
pop edx ecx ebx eax |
dec eax |
jnz .baseskinloop |
.non_base: |
mov esi, [esp+4] |
mov edx, [esi+WDATA.box.width] |
sub edx, [ebp+SKIN_DATA.oper.width] |
inc edx |
shl edx, 16 |
mov ebx, [ebp+SKIN_DATA.oper.data] |
mov ecx, [ebp+SKIN_DATA.oper.width] |
shl ecx, 16 |
add ecx, [_skinh] |
or ebx, ebx |
jz @f |
call sys_putimage.forced |
@@: |
ret |
;------------------------------------------------------------------------------ |
align 4 |
drawwindow_IV: |
;param1 - aw_yes |
pusha |
push edx |
mov edi, edx |
mov ebp, skin_active |
cmp byte [esp+32+4+4], 0 |
jne @f |
mov ebp, skin_inactive |
@@: |
mov eax, [edi+WDATA.box.left] |
shl eax, 16 |
mov ax, word [edi+WDATA.box.left] |
add ax, word [edi+WDATA.box.width] |
mov ebx, [edi+WDATA.box.top] |
shl ebx, 16 |
mov bx, word [edi+WDATA.box.top] |
add bx, word [edi+WDATA.box.height] |
mov esi, [ebp+SKIN_DATA.colors.outer] |
or esi, 1 shl 25 ; 0x02000000 used for draw_rectangle without top line |
ror ebx, 16 |
add ebx, [_skinh] |
sub bx, 1 |
rol ebx, 16 |
call draw_rectangle |
mov ecx, 3 |
_dw3l: |
add eax, 1*65536-1 |
add ebx, 0*65536-1 |
test ax, ax |
js no_skin_add_button |
test bx, bx |
js no_skin_add_button |
mov esi, [ebp+SKIN_DATA.colors.frame];[edi+24] |
or esi, 1 shl 25; 0x02000000 used for draw_rectangle without top line |
call draw_rectangle |
dec ecx |
jnz _dw3l |
mov esi, [ebp+SKIN_DATA.colors.inner] |
or esi, 1 shl 25; 0x02000000 used for draw_rectangle without top line |
add eax, 1*65536-1 |
add ebx, 0*65536-1 |
test ax, ax |
js no_skin_add_button |
test bx, bx |
js no_skin_add_button |
test [edi + WDATA.fl_wstate], WSTATE_ROLLEDUP |
jnz @f |
call draw_rectangle |
@@: |
mov eax, [skin_data] |
cmp [eax], dword 'SKIN' |
je @f |
xor eax, eax |
xor ebx, ebx |
mov esi, [esp] |
mov ecx, [esi+WDATA.box.width] |
inc ecx |
mov edx, [_skinh] |
mov edi, [common_colours+4]; standard grab color |
call vesa20_drawbar |
jmp draw_clientbar |
;-------------------------------------- |
align 4 |
@@: |
mov al, [esp+32+4+4] |
call drawwindow_IV_caption |
draw_clientbar: |
mov esi, [esp] |
mov edx, [esi+WDATA.box.top] ; WORK AREA |
add edx, 21+5 |
mov ebx, [esi+WDATA.box.top] |
add ebx, [esi+WDATA.box.height] |
cmp edx, ebx |
jg _noinside2 |
mov eax, 5 |
mov ebx, [_skinh] |
mov ecx, [esi+WDATA.box.width] |
mov edx, [esi+WDATA.box.height] |
sub ecx, 4 |
sub edx, 4 |
mov edi, [esi+WDATA.cl_workarea] |
test edi, 0x40000000 |
jnz _noinside2 |
call vesa20_drawbar |
_noinside2: |
mov eax, [skin_data] |
cmp [eax], dword 'SKIN' |
jne no_skin_add_button |
;* close button |
mov edi, [BTN_ADDR] |
movzx eax, word [edi] |
cmp eax, 1000 |
jge no_skin_add_button |
inc eax |
mov [edi], ax |
shl eax, 4 |
add eax, edi |
mov bx, word [current_slot_idx] |
mov [eax], bx |
mov word [eax+2], 1 ; button id |
xor ebx, ebx |
cmp [skin_btn_close.left], 0 |
jge @f |
mov ebx, [esp] |
mov ebx, [ebx+WDATA.box.width] |
inc ebx |
@@: |
add ebx, [skin_btn_close.left] |
mov word [eax+4], bx ; x start |
mov ebx, [skin_btn_close.width] |
dec ebx |
mov word [eax+6], bx ; x size |
mov ebx, [skin_btn_close.top] |
mov word [eax+8], bx ; y start |
mov ebx, [skin_btn_close.height] |
dec ebx |
mov word [eax+10], bx ; y size |
bts word [eax+12], 14 |
;* minimize button |
mov edi, [BTN_ADDR] |
movzx eax, word [edi] |
cmp eax, 1000 |
jge no_skin_add_button |
inc eax |
mov [edi], ax |
shl eax, 4 |
add eax, edi |
mov bx, word [current_slot_idx] |
mov [eax], bx |
mov word [eax+2], -1 ; button id |
xor ebx, ebx |
cmp [skin_btn_minimize.left], 0 |
jge @f |
mov ebx, [esp] |
mov ebx, [ebx+WDATA.box.width] |
inc ebx |
@@: |
add ebx, [skin_btn_minimize.left] |
mov word [eax+4], bx ; x start |
mov ebx, [skin_btn_minimize.width] |
dec ebx |
mov word [eax+6], bx ; x size |
mov ebx, [skin_btn_minimize.top] |
mov word [eax+8], bx ; y start |
mov ebx, [skin_btn_minimize.height] |
dec ebx |
mov word [eax+10], bx ; y size |
bts word [eax+12], 14 |
no_skin_add_button: |
pop edi |
popa |
ret 4 |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
Added: svn:keywords |
+Rev |
\ No newline at end of property |
/kernel/branches/kolibri-ahci/gui/charUni.mt |
---|
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/branches/kolibri-ahci/gui/font.inc |
---|
0,0 → 1,878 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; |
;; Distributed under terms of the GNU General Public License ;; |
;; ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
$Revision$ |
dtext: |
; edx -> string |
; esi = number of characters |
; ebx = output coordinates XXXXYYYY h |
; ecx = char color and flags flRRGGBB h |
; fl = ZBFFRSSS b |
; Z=1: edx -> zero terminated string, esi = ? |
; B=1: fill background with color eax |
; R=1: edi -> user area for redirect |
; FF=3: UTF-8 8x16, FF=2: UTF-16LE 8x16 |
; FF=1: cp866 8x16, FF=0: cp866 6x9 |
; SSS = (font multiplier)-1 |
; edi=1: force output |
; flag CF=1 means that we deal with asciiz but need to draw no more than esi symbols |
clc |
._: |
push ecx edx |
setc dl |
and eax, 0xFFFFFF |
and ecx, 1 shl 31 |
shl edx, 29 |
or eax, ecx |
or eax, edx |
pop edx ecx |
bt ecx, 30 |
jc @f |
or eax, 1 shl 30 |
@@: |
pushd 0 0 0 eax |
movsx eax, bx |
sar ebx, 16 |
push eax ebx edi |
bt ecx, 27 |
jc .redirect |
mov ebp, [_display.width] |
xor edi, edi |
jmp @f |
.ret: |
add esp, 28 |
ret |
.redirect: |
mov ebp, [edi] |
add edi, 8 |
@@: |
shl ebp, 2 |
imul eax, ebp |
shl ebx, 2 |
add eax, ebx |
js .ret |
add edi, eax |
mov eax, ecx |
mov ebx, ecx |
test ecx, ecx |
jns @f |
mov esi, 256 |
@@: |
shr ecx, 24 |
and cl, 7 |
inc ecx |
push ebp ecx esi |
mov esi, edx |
or eax, 0xFF000000 |
bt ebx, 27 |
jc .bufferReady |
mov eax, 9 |
test ebx, 0x30000000 |
jz @f |
add eax, 7 |
@@: |
imul eax, ecx |
mov [esp+32], eax |
imul ebp, eax |
stdcall kernel_alloc, ebp |
mov ecx, ebp |
shr ecx, 2 |
mov [esp+36], eax |
sub edi, eax |
mov edx, eax |
mov eax, [esp+24] |
test eax, 1 shl 30 |
jz @f |
or eax, -1 |
mov [esp+28], edi |
jmp .1 |
@@: |
and eax, 0x00ffffff |
.1: |
mov edi, edx |
rep stosd |
mov edi, edx |
mov eax, ebx |
and eax, 0xFFFFFF |
.bufferReady: |
mov ebp, eax |
mov eax, [esp+8] |
shr eax, 2 |
sub eax, [esp+16] |
shr eax, 3 |
xor edx, edx |
div dword[esp+4] |
mov ecx, [esp] |
cmp eax, ecx |
jnc @f |
mov [esp], eax |
@@: |
xor edx, edx |
bt ebx, 29 |
jc @f |
bt ebx, 28 |
jc .draw866toUni |
shl eax, 3 |
mov bx, 6 |
div bx |
xor edx, edx |
inc eax |
mov [esp], ecx |
cmp eax, ecx |
jnc .draw866 |
mov [esp], eax |
jmp .draw866 |
@@: |
bt ebx, 28 |
jc .drawUTF8 |
; ebp = font color |
; esi -> string |
; edi -> buffer |
; Stack map: |
; char counter +0 |
fontMultiplier = 4 |
widthX = 8 |
; edi +12 |
; X +16 |
; Y +20 |
; internal flags & background +24 |
deltaToScreen = 28 |
; temp buffer height +32 |
; temp buffer pointer +36 |
.drawUTF16: |
dec dword [esp] |
js .done |
movzx ebx, word [esi] |
test dword [esp + 24], 1 shl 31 |
jnz @f |
test dword [esp + 24], 1 shl 29 |
jz .u16Still |
@@: |
test ebx, ebx |
jz .done |
.u16Still: |
inc esi |
inc esi |
cmp bx, 1419 |
jc @f |
xor ebx, ebx |
@@: |
pushd esi edi 16 |
shl ebx, 4 |
add ebx, fontUni |
mov esi, [esp+12+fontMultiplier] |
call drawChar |
imul esi, 8*4 |
pop edi |
pop edi |
add edi, esi |
pop esi |
jmp .drawUTF16 |
.drawUTF8: |
dec dword [esp] |
js .done |
xor eax, eax |
call utf8to16 |
test dword [esp + 24], 1 shl 31 |
jnz @f |
test dword [esp + 24], 1 shl 29 |
jz .u8Still |
@@: |
test eax, eax |
jz .done |
.u8Still: |
cmp eax, 1419 |
jc @f |
xor eax, eax |
@@: |
shl eax, 4 |
lea ebx, [eax+fontUni] |
pushd esi edi 16 |
mov esi, [esp+12+fontMultiplier] |
call drawChar |
imul esi, 8*4 |
pop edi |
pop edi |
add edi, esi |
pop esi |
jmp .drawUTF8 |
.draw866: |
dec dword [esp] |
js .done |
movzx ebx, byte [esi] |
test dword [esp + 24], 1 shl 31 |
jnz @f |
test dword [esp + 24], 1 shl 29 |
jz .866Still |
@@: |
test ebx, ebx |
jz .done |
.866Still: |
inc esi |
pushd esi edi 9 |
lea ebx, [ebx*8+ebx+font1] |
mov esi, [esp+12+fontMultiplier] |
call drawChar |
imul esi, 6*4 |
pop edi |
pop edi |
add edi, esi |
pop esi |
jmp .draw866 |
.draw866toUni: |
dec dword [esp] |
js .done |
movzx eax, byte [esi] |
test dword [esp + 24], 1 shl 31 |
jnz @f |
test dword [esp + 24], 1 shl 29 |
jz .8662uStill |
@@: |
test eax, eax |
jz .done |
.8662uStill: |
call ansi2uni_char |
shl eax, 4 |
lea ebx, [eax+fontUni] |
inc esi |
pushd esi edi 16 |
mov esi, [esp+12+fontMultiplier] |
call drawChar |
imul esi, 8*4 |
pop edi |
pop edi |
add edi, esi |
pop esi |
jmp .draw866toUni |
.done: |
mov ecx, edi |
pop eax eax eax esi edx ebx ebp ebp ebp |
mov edi, [esp] |
test edi, edi |
jnz @f |
pop eax |
ret |
@@: ; redraw from buffer to screen |
push eax |
sub ecx, edi |
shr ecx, 2 |
add edx, ecx |
inc ecx |
push ecx |
push edi |
.drawPicture: |
mov eax, -1 |
repz scasd |
jecxz @f |
mov eax, edx |
sub eax, ecx |
push ecx |
mov ecx, [edi-4] |
xchg esi, edi |
call __sys_putpixel |
xchg esi, edi |
pop ecx |
jmp .drawPicture |
@@: |
pop edi |
mov ecx, [esp] |
add edi, [esp+4] |
inc ebx |
push edi |
dec ebp |
jnz .drawPicture |
add esp, 12 |
call kernel_free |
ret |
; scaling/smoothing algorithm |
drawChar: |
; ebp = font color |
; esi = font multiplier |
; edi -> buffer |
; ebx -> char data |
mov dl, [ebx] |
.raw: |
bsf eax, edx |
jz .nextRaw |
imul eax, esi |
shl eax, 2 |
push edi |
add edi, eax |
mov ecx, esi |
dec esi |
jnz .square |
mov [edi], ebp |
inc esi |
cmp [fontSmoothing], 0 |
jz .nextPixel |
.checkLeftSM: ; smoothing |
bsf eax, edx |
dec eax |
js .checkRightSM |
bt [ebx], eax |
jc .checkRightSM |
dec eax |
js .checkLeftDownSM |
bt [ebx], eax |
jc .checkRightSM |
.checkLeftDownSM: |
inc eax |
bt [ebx+1], eax |
jnc .checkLeftUpSM |
inc eax |
bt [ebx+1], eax |
jnc @f |
bt [ebx-1], eax |
jc .checkRightSM |
dec eax |
dec eax |
js @f |
bt [ebx+1], eax |
jnc @f |
inc eax |
.checkLeftUpSM: |
bt [ebx-1], eax |
jnc .checkRightSM |
inc eax |
bt [ebx-1], eax |
jnc @f |
bt [ebx+1], eax |
jc .checkRightSM |
dec eax |
dec eax |
js @f |
bt [ebx-1], eax |
jc .checkRightSM |
@@: |
mov ecx, [esp+20+deltaToScreen] |
mov eax, [edi-4] |
test ecx, ecx |
jz @f |
pusha |
lea ebx, [edi+ecx-4] |
shr ebx, 2 |
call syscall_getpixel |
popa |
@@: |
push ebx edx |
mov ebx, ebp |
xor ecx, ecx |
cmp [fontSmoothing], 1 |
jnz .subpixelLeft |
call antiAliasing |
jmp @f |
.subpixelLeft: |
mov cl, bl |
lea edx, [ecx*8+ecx] |
lea edx, [ecx*2+edx] |
mov cl, al |
lea ecx, [ecx*4+ecx] |
add edx, ecx |
shr edx, 4 |
mov al, dl |
xor ecx, ecx |
mov cl, ah |
lea edx, [ecx*8+ecx] |
lea edx, [ecx*2+edx] |
mov cl, bh |
lea ecx, [ecx*4+ecx] |
add edx, ecx |
shr edx, 4 |
mov ah, dl |
rol eax, 16 |
rol ebx, 16 |
xor ecx, ecx |
mov cl, al |
mov edx, ecx |
shl ecx, 3 |
sub ecx, edx |
mov dl, bl |
add ecx, edx |
shr ecx, 3 |
mov al, cl |
rol eax, 16 |
@@: |
mov [edi-4], eax |
pop edx ebx |
.checkRightSM: |
bsf eax, edx |
inc eax |
bt [ebx], eax |
jc .nextPixel |
inc eax |
bt [ebx], eax |
jc .nextPixel |
dec eax |
.checkRightDownSM: |
bt [ebx+1], eax |
jnc .checkRightUpSM |
dec eax |
bt [ebx+1], eax |
jnc @f |
bt [ebx-1], eax |
jc .nextPixel |
inc eax |
inc eax |
bt [ebx+1], eax |
jnc @f |
dec eax |
.checkRightUpSM: |
bt [ebx-1], eax |
jnc .nextPixel |
dec eax |
bt [ebx-1], eax |
jnc @f |
bt [ebx+1], eax |
jc .nextPixel |
inc eax |
inc eax |
bt [ebx-1], eax |
jc .nextPixel |
@@: |
mov ecx, [esp+20+deltaToScreen] |
mov eax, [edi+4] |
test ecx, ecx |
jz @f |
pusha |
lea ebx, [edi+ecx+4] |
shr ebx, 2 |
call syscall_getpixel |
popa |
@@: |
push ebx edx |
mov ebx, ebp |
xor ecx, ecx |
cmp [fontSmoothing], 1 |
jnz .subpixelRight |
call antiAliasing |
jmp @f |
.subpixelRight: |
mov cl, al |
mov edx, ecx |
shl ecx, 3 |
sub ecx, edx |
mov dl, bl |
add ecx, edx |
shr ecx, 3 |
mov al, cl |
xor ecx, ecx |
mov cl, ah |
lea edx, [ecx*8+ecx] |
lea edx, [ecx*2+edx] |
mov cl, bh |
lea ecx, [ecx*4+ecx] |
add edx, ecx |
shr edx, 4 |
mov ah, dl |
rol ebx, 16 |
rol eax, 16 |
xor ecx, ecx |
mov cl, bl |
lea edx, [ecx*8+ecx] |
lea edx, [ecx*2+edx] |
mov cl, al |
lea ecx, [ecx*4+ecx] |
add edx, ecx |
shr edx, 4 |
mov al, dl |
rol eax, 16 |
@@: |
mov [edi+4], eax |
pop edx ebx |
jmp .nextPixel |
.square: ; scaling |
mov eax, esi |
@@: |
mov [edi+eax*4], ebp |
dec eax |
jns @b |
add edi, [esp+20+widthX] |
dec ecx |
jnz .square |
inc esi |
mov edi, [esp] |
.checkLeft: |
bsf eax, edx |
dec eax |
js .checkRight |
bt [ebx], eax |
jc .checkRight |
.checkLeftDown: |
bt [ebx+1], eax |
jnc .checkLeftUp |
mov ecx, eax |
inc eax |
bt [ebx+1], eax |
jc @f |
bt [ebx-1], eax |
jnc .downRightLow |
bt [ebx-2], eax |
jc .downRightLow |
dec eax |
bt [ebx-1], eax |
jc .downRightLow |
dec eax |
js .downRightHigh |
bt [ebx-2], eax |
jc .downRightLow |
jmp .downRightHigh |
@@: |
bt [ebx-1], eax |
jc .checkLeftUp |
dec eax |
dec eax |
js .downRightLow |
bt [ebx+1], eax |
jc .checkLeftUp |
.downRightLow: |
imul ecx, esi |
shl ecx, 2 |
add edi, ecx |
dec esi |
mov eax, [esp+20+widthX] |
imul eax, esi |
add edi, eax |
add edi, 4 |
mov ecx, esi |
dec ecx |
.drawDownRight: |
mov eax, ecx |
@@: |
mov [edi+eax*4], ebp |
dec eax |
jns @b |
sub edi, [esp+20+widthX] |
add edi, 4 |
dec ecx |
jns .drawDownRight |
inc esi |
mov edi, [esp] |
jmp .checkLeftUp |
.downRightHigh: |
imul ecx, esi |
shl ecx, 2 |
add edi, ecx |
dec esi |
mov eax, [esp+20+widthX] |
imul eax, esi |
add edi, eax |
add edi, 4 |
mov ecx, esi |
dec ecx |
.drawDownRightHigh: |
mov eax, ecx |
@@: |
mov [edi+eax*4], ebp |
dec eax |
jns @b |
sub edi, [esp+20+widthX] |
mov eax, ecx |
@@: |
mov [edi+eax*4], ebp |
dec eax |
jns @b |
sub edi, [esp+20+widthX] |
add edi, 4 |
dec ecx |
jns .drawDownRightHigh |
inc esi |
mov edi, [esp] |
.checkLeftUp: |
bsf eax, edx |
dec eax |
bt [ebx-1], eax |
jnc .checkRight |
mov ecx, eax |
inc eax |
bt [ebx-1], eax |
jc @f |
bt [ebx+1], eax |
jnc .upRightLow |
bt [ebx+2], eax |
jc .upRightLow |
dec eax |
bt [ebx+1], eax |
jc .upRightLow |
dec eax |
js .upRightHigh |
bt [ebx+2], eax |
jc .upRightLow |
jmp .upRightHigh |
@@: |
bt [ebx+1], eax |
jc .checkRight |
dec eax |
dec eax |
js .upRightLow |
bt [ebx-1], eax |
jc .checkRight |
.upRightLow: |
imul ecx, esi |
shl ecx, 2 |
add edi, ecx |
add edi, 4 |
mov ecx, esi |
dec ecx |
dec ecx |
.drawUpRight: |
mov eax, ecx |
@@: |
mov [edi+eax*4], ebp |
dec eax |
jns @b |
add edi, [esp+20+widthX] |
add edi, 4 |
dec ecx |
jns .drawUpRight |
mov edi, [esp] |
jmp .checkRight |
.upRightHigh: |
imul ecx, esi |
shl ecx, 2 |
add edi, ecx |
add edi, 4 |
mov ecx, esi |
dec ecx |
dec ecx |
.drawUpRightHigh: |
mov eax, ecx |
@@: |
mov [edi+eax*4], ebp |
dec eax |
jns @b |
add edi, [esp+20+widthX] |
mov eax, ecx |
@@: |
mov [edi+eax*4], ebp |
dec eax |
jns @b |
add edi, [esp+20+widthX] |
add edi, 4 |
dec ecx |
jns .drawUpRightHigh |
mov edi, [esp] |
.checkRight: |
bsf eax, edx |
inc eax |
bt [ebx], eax |
jc .nextPixel |
.checkRightDown: |
bt [ebx+1], eax |
jnc .checkRightUp |
mov ecx, eax |
dec eax |
bt [ebx+1], eax |
jc @f |
bt [ebx-1], eax |
jnc .downLeftLow |
bt [ebx-2], eax |
jc .downLeftLow |
inc eax |
bt [ebx-1], eax |
jc .downLeftLow |
inc eax |
bt [ebx-2], eax |
jc .downLeftLow |
jmp .downLeftHigh |
@@: |
bt [ebx-1], eax |
jc .checkRightUp |
inc eax |
inc eax |
bt [ebx+1], eax |
jc .checkRightUp |
.downLeftLow: |
imul ecx, esi |
shl ecx, 2 |
add edi, ecx |
dec esi |
mov eax, [esp+20+widthX] |
imul eax, esi |
add edi, eax |
mov ecx, esi |
dec ecx |
.drawDownLeft: |
mov eax, ecx |
@@: |
mov [edi+eax*4], ebp |
dec eax |
jns @b |
sub edi, [esp+20+widthX] |
dec ecx |
jns .drawDownLeft |
inc esi |
mov edi, [esp] |
jmp .checkRightUp |
.downLeftHigh: |
imul ecx, esi |
shl ecx, 2 |
add edi, ecx |
dec esi |
mov eax, [esp+20+widthX] |
imul eax, esi |
add edi, eax |
mov ecx, esi |
dec ecx |
.drawDownLeftHigh: |
mov eax, ecx |
@@: |
mov [edi+eax*4], ebp |
dec eax |
jns @b |
sub edi, [esp+20+widthX] |
mov eax, ecx |
@@: |
mov [edi+eax*4], ebp |
dec eax |
jns @b |
sub edi, [esp+20+widthX] |
dec ecx |
jns .drawDownLeftHigh |
inc esi |
mov edi, [esp] |
.checkRightUp: |
bsf eax, edx |
inc eax |
bt [ebx-1], eax |
jnc .nextPixel |
mov ecx, eax |
dec eax |
bt [ebx-1], eax |
jc @f |
bt [ebx+1], eax |
jnc .upLeftLow |
bt [ebx+2], eax |
jc .upLeftLow |
inc eax |
bt [ebx+1], eax |
jc .upLeftLow |
inc eax |
bt [ebx+2], eax |
jc .upLeftLow |
jmp .upLeftHigh |
@@: |
bt [ebx+1], eax |
jc .nextPixel |
inc eax |
inc eax |
bt [ebx-1], eax |
jc .nextPixel |
.upLeftLow: |
imul ecx, esi |
shl ecx, 2 |
add edi, ecx |
mov ecx, esi |
dec ecx |
dec ecx |
.drawUpLeft: |
mov eax, ecx |
@@: |
mov [edi+eax*4], ebp |
dec eax |
jns @b |
add edi, [esp+20+widthX] |
dec ecx |
jns .drawUpLeft |
jmp .nextPixel |
.upLeftHigh: |
imul ecx, esi |
shl ecx, 2 |
add edi, ecx |
mov ecx, esi |
dec ecx |
dec ecx |
.drawUpLeftHigh: |
mov eax, ecx |
@@: |
mov [edi+eax*4], ebp |
dec eax |
jns @b |
add edi, [esp+20+widthX] |
mov eax, ecx |
@@: |
mov [edi+eax*4], ebp |
dec eax |
jns @b |
add edi, [esp+20+widthX] |
dec ecx |
jns .drawUpLeftHigh |
.nextPixel: |
bsf eax, edx |
btr edx, eax |
pop edi |
jmp .raw |
.nextRaw: |
inc ebx |
mov eax, [esp+16+widthX] |
imul eax, esi |
add edi, eax |
dec dword [esp+4] |
jnz drawChar |
ret |
antiAliasing: |
mov bp, 3 |
@@: |
mov cl, al |
mov dl, bl |
lea ecx, [ecx*2+ecx] |
add ecx, edx |
shr ecx, 2 |
mov al, cl |
ror eax, 8 |
ror ebx, 8 |
dec bp |
jnz @b |
ror eax, 8 |
ror ebx, 8 |
mov ebp, ebx |
ret |
iglobal |
fontSmoothing db 2 ; = 0, 1 or 2 |
fontSize db 0 ; user mode setting |
font1: |
if lang eq sp |
file 'gui/char_sp.mt' |
else if lang eq et |
file 'gui/char_et.mt' |
else |
file 'gui/char.mt' |
end if |
fontUni: |
file 'gui/charUni.mt' |
endg |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
Added: svn:keywords |
+Rev |
\ No newline at end of property |
/kernel/branches/kolibri-ahci/gui/char.mt |
---|
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/branches/kolibri-ahci/gui/skindata.inc |
---|
0,0 → 1,64 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; |
;; Distributed under terms of the GNU General Public License ;; |
;; ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
$Revision$ |
; |
; WINDOW SKIN DATA. |
; |
iglobal |
_skin_file_default db '/sys/DEFAULT.SKN',0 |
endg |
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 |
struct SKIN_BUTTON |
left dd ? |
top dd ? |
width dd ? |
height dd ? |
ends |
uglobal |
align 4 |
skin_udata: |
_skinh dd ? |
_skinmargins: ; rw 4 |
.right dw ? |
.left dw ? |
.bottom dw ? |
.top dw ? |
skin_btn_close SKIN_BUTTON |
skin_btn_minimize SKIN_BUTTON |
skin_active SKIN_DATA |
skin_inactive SKIN_DATA |
align 4 |
skin_udata.end: |
endg |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
Added: svn:keywords |
+Rev |
\ No newline at end of property |
/kernel/branches/kolibri-ahci/gui/mousepointer.inc |
---|
0,0 → 1,250 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; |
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; |
;; Distributed under terms of the GNU General Public License ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
$Revision$ |
iglobal |
align 4 |
mousepointer: |
db 0x00,0x00,0x00,0x74,0x74,0x74,0x6e,0x6e,0x6e,0x6f |
db 0x6f,0x6f,0x71,0x71,0x71,0x75,0x75,0x75,0x79,0x79 |
db 0x79,0x7c,0x7c,0x7c,0x7e,0x7e,0x7e,0x80,0x80,0x80 |
db 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 |
db 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 |
db 0x80,0x00,0x00,0x00,0x63,0x63,0x63,0x63,0x63,0x63 |
db 0x66,0x66,0x66,0x6c,0x6c,0x6c,0x72,0x72,0x72,0x78 |
db 0x78,0x78,0x7c,0x7c,0x7c,0x7e,0x7e,0x7e,0x80,0x80 |
db 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 |
db 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xc0 |
db 0xc0,0xc0,0x00,0x00,0x00,0x54,0x54,0x54,0x57,0x57 |
db 0x57,0x5f,0x5f,0x5f,0x68,0x68,0x68,0x71,0x71,0x71 |
db 0x77,0x77,0x77,0x7c,0x7c,0x7c,0x7e,0x7e,0x7e,0x80 |
db 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 |
db 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0xc0,0xc0,0xc0 |
db 0xc0,0xc0,0xc0,0x00,0x00,0x00,0x47,0x47,0x47,0x50 |
db 0x50,0x50,0x5b,0x5b,0x5b,0x67,0x67,0x67,0x70,0x70 |
db 0x70,0x77,0x77,0x77,0x7c,0x7c,0x7c,0x7e,0x7e,0x7e |
db 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 |
db 0x80,0x80,0x80,0x80,0x80,0xff,0xff,0xff,0xc0,0xc0 |
db 0xc0,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x3f,0x3f,0x3f |
db 0x4b,0x4b,0x4b,0x59,0x59,0x59,0x66,0x66,0x66,0x70 |
db 0x70,0x70,0x77,0x77,0x77,0x7c,0x7c,0x7c,0x7e,0x7e |
db 0x7e,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 |
db 0x80,0x80,0x80,0xff,0xff,0xff,0xc0,0xc0,0xc0,0xc0 |
db 0xc0,0xc0,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x3a,0x3a |
db 0x3a,0x49,0x49,0x49,0x59,0x59,0x59,0x66,0x66,0x66 |
db 0x70,0x70,0x70,0x77,0x77,0x77,0x7c,0x7c,0x7c,0x7e |
db 0x7e,0x7e,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 |
db 0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0xc0,0xc0 |
db 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x39 |
db 0x39,0x39,0x49,0x49,0x49,0x59,0x59,0x59,0x66,0x66 |
db 0x66,0x71,0x71,0x71,0x78,0x78,0x78,0x7c,0x7c,0x7c |
db 0x7e,0x7e,0x7e,0x80,0x80,0x80,0x80,0x80,0x80,0xff |
db 0xff,0xff,0xff,0xff,0xff,0xc0,0xc0,0xc0,0xc0,0xc0 |
db 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x00,0x00,0x00 |
db 0x39,0x39,0x39,0x4a,0x4a,0x4a,0x5a,0x5a,0x5a,0x68 |
db 0x68,0x68,0x72,0x72,0x72,0x79,0x79,0x79,0x7d,0x7d |
db 0x7d,0x7f,0x7f,0x7f,0x80,0x80,0x80,0xff,0xff,0xff |
db 0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0xc0,0xc0,0xc0 |
db 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x00,0x00 |
db 0x00,0x3c,0x3c,0x3c,0x4e,0x4e,0x4e,0x5e,0x5e,0x5e |
db 0x6b,0x6b,0x6b,0x75,0x75,0x75,0x7a,0x7a,0x7a,0x7e |
db 0x7e,0x7e,0x80,0x80,0x80,0xff,0xff,0xff,0xff,0xff |
db 0xff,0xff,0xff,0xff,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0 |
db 0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x00 |
db 0x00,0x00,0x43,0x43,0x43,0x55,0x55,0x55,0x64,0x64 |
db 0x64,0x70,0x70,0x70,0x78,0x78,0x78,0x7d,0x7d,0x7d |
db 0x80,0x80,0x80,0xff,0xff,0xff,0xff,0xff,0xff,0xc0 |
db 0xc0,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x4e,0x4e,0x4e,0x5f,0x5f,0x5f,0x6d |
db 0x6d,0x6d,0x76,0x76,0x76,0x7c,0x7c,0x7c,0x80,0x80 |
db 0x80,0xff,0xff,0xff,0xc0,0xc0,0xc0,0x00,0x00,0x00 |
db 0xff,0xff,0xff,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x14 |
db 0x14,0x14,0x1b,0x1b,0x1b,0x29,0x29,0x29,0x3a,0x3a |
db 0x3a,0x4c,0x4c,0x4c,0x5d,0x5d,0x5d,0x6c,0x6c,0x6c |
db 0x75,0x75,0x75,0x7b,0x7b,0x7b,0x80,0x80,0x80,0xc0 |
db 0xc0,0xc0,0x00,0x00,0x00,0x2f,0x2f,0x2f,0x80,0x80 |
db 0x80,0xff,0xff,0xff,0xc0,0xc0,0xc0,0x00,0x00,0x00 |
db 0x21,0x21,0x21,0x2e,0x2e,0x2e,0x40,0x40,0x40,0x52 |
db 0x52,0x52,0x62,0x62,0x62,0x6f,0x6f,0x6f,0x77,0x77 |
db 0x77,0x7c,0x7c,0x7c,0x80,0x80,0x80,0x00,0x00,0x00 |
db 0x47,0x47,0x47,0x3b,0x3b,0x3b,0x80,0x80,0x80,0xff |
db 0xff,0xff,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x25,0x25 |
db 0x25,0x30,0x30,0x30,0x42,0x42,0x42,0x54,0x54,0x54 |
db 0x64,0x64,0x64,0x70,0x70,0x70,0x78,0x78,0x78,0x7d |
db 0x7d,0x7d,0x00,0x00,0x00,0x62,0x62,0x62,0x52,0x52 |
db 0x52,0x4a,0x4a,0x4a,0x43,0x43,0x43,0x80,0x80,0x80 |
db 0xff,0xff,0xff,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x33 |
db 0x33,0x33,0x42,0x42,0x42,0x54,0x54,0x54,0x64,0x64 |
db 0x64,0x71,0x71,0x71,0x79,0x79,0x79,0x7d,0x7d,0x7d |
db 0x72,0x72,0x72,0x6b,0x6b,0x6b,0x5f,0x5f,0x5f,0x5a |
db 0x5a,0x5a,0x54,0x54,0x54,0x80,0x80,0x80,0xff,0xff |
db 0xff,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x35,0x35,0x35 |
db 0x41,0x41,0x41,0x53,0x53,0x53,0x63,0x63,0x63,0x70 |
db 0x70,0x70,0x78,0x78,0x78,0x7d,0x7d,0x7d,0x77,0x77 |
db 0x77,0x73,0x73,0x73,0x6c,0x6c,0x6c,0x68,0x68,0x68 |
db 0x62,0x62,0x62,0x5a,0x5a,0x5a,0x80,0x80,0x80,0xff |
db 0xff,0xff,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x41,0x41 |
db 0x41,0x52,0x52,0x52,0x62,0x62,0x62,0x6f,0x6f,0x6f |
db 0x78,0x78,0x78,0x7d,0x7d,0x7d,0x7b,0x7b,0x7b,0x79 |
db 0x79,0x79,0x74,0x74,0x74,0x72,0x72,0x72,0x6e,0x6e |
db 0x6e,0x66,0x66,0x66,0x80,0x80,0x80,0xc0,0xc0,0xc0 |
db 0xc0,0xc0,0xc0,0x00,0x00,0x00,0x44,0x44,0x44,0x52 |
db 0x52,0x52,0x62,0x62,0x62,0x6e,0x6e,0x6e,0x77,0x77 |
db 0x77,0x7c,0x7c,0x7c,0x7e,0x7e,0x7e,0x7c,0x7c,0x7c |
db 0x7a,0x7a,0x7a,0x79,0x79,0x79,0x75,0x75,0x75,0x6f |
db 0x6f,0x6f,0x65,0x65,0x65,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x48,0x48,0x48,0x4b,0x4b,0x4b,0x56,0x56,0x56 |
db 0x65,0x65,0x65,0x70,0x70,0x70,0x78,0x78,0x78,0x7d |
db 0x7d,0x7d,0x80,0x80,0x80,0x7f,0x7f,0x7f,0x7e,0x7e |
db 0x7e,0x7d,0x7d,0x7d,0x7a,0x7a,0x7a,0x76,0x76,0x76 |
db 0x6f,0x6f,0x6f,0x65,0x65,0x65,0x5c,0x5c,0x5c,0x56 |
db 0x56,0x56,0x58,0x58,0x58,0x60,0x60,0x60,0x6b,0x6b |
db 0x6b,0x73,0x73,0x73,0x7a,0x7a,0x7a,0x7d,0x7d,0x7d |
db 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x7f |
db 0x7f,0x7f,0x7d,0x7d,0x7d,0x7a,0x7a,0x7a,0x76,0x76 |
db 0x76,0x70,0x70,0x70,0x6a,0x6a,0x6a,0x66,0x66,0x66 |
db 0x66,0x66,0x66,0x6c,0x6c,0x6c,0x72,0x72,0x72,0x78 |
db 0x78,0x78,0x7c,0x7c,0x7c,0x7e,0x7e,0x7e,0x80,0x80 |
db 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 |
db 0x7f,0x7f,0x7f,0x7d,0x7d,0x7d,0x7b,0x7b,0x7b,0x77 |
db 0x77,0x77,0x73,0x73,0x73,0x71,0x71,0x71,0x71,0x71 |
db 0x71,0x74,0x74,0x74,0x78,0x78,0x78,0x7b,0x7b,0x7b |
db 0x7d,0x7d,0x7d,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80 |
db 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 |
db 0x80,0x7f,0x7f,0x7f,0x7d,0x7d,0x7d,0x7c,0x7c,0x7c |
db 0x7a,0x7a,0x7a,0x78,0x78,0x78,0x78,0x78,0x78,0x7a |
db 0x7a,0x7a,0x7c,0x7c,0x7c,0x7e,0x7e,0x7e,0x7f,0x7f |
db 0x7f,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 |
db 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 |
db 0x80,0x80,0x7f,0x7f,0x7f,0x7e,0x7e,0x7e,0x7e,0x7e |
db 0x7e,0x7d,0x7d,0x7d,0x7d,0x7d,0x7d,0x7e,0x7e,0x7e |
db 0x7e,0x7e,0x7e,0x7f,0x7f,0x7f,0x80,0x80,0x80,0x80 |
db 0x80,0x80 |
mousepointer1: |
db 0xff,0xff,0xff,0x06,0x06,0x06,0x0a,0x0a |
db 0x0a,0x08,0x08,0x08,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0xff,0xff,0xff,0xff,0xff,0xff,0x19,0x19,0x19,0x16 |
db 0x16,0x16,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff |
db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x2e,0x2e,0x2e |
db 0x23,0x23,0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff |
db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x3f,0x3f |
db 0x3f,0x29,0x29,0x29,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff |
db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x47 |
db 0x47,0x47,0x2c,0x2c,0x2c,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff |
db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff |
db 0x48,0x48,0x48,0x2c,0x2c,0x2c,0x16,0x16,0x16,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff |
db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff |
db 0xff,0x48,0x48,0x48,0x2c,0x2c,0x2c,0x16,0x16,0x16 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff |
db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff |
db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff |
db 0xff,0xff,0x48,0x48,0x48,0x2c,0x2c,0x2c,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff |
db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff |
db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff |
db 0xff,0xff,0xff,0x48,0x48,0x48,0x2c,0x2c,0x2c,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff |
db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff |
db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff |
db 0xff,0xff,0xff,0xff,0x47,0x47,0x47,0x29,0x29,0x29 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff |
db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff |
db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff |
db 0xff,0xff,0xff,0xff,0xff,0x40,0x40,0x40,0x23,0x23 |
db 0x23,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff |
db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff |
db 0xff,0xaa,0xaa,0xaa,0x9f,0x9f,0x9f,0x8c,0x8c,0x8c |
db 0x70,0x70,0x70,0x4f,0x4f,0x4f,0x30,0x30,0x30,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff |
db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x8f,0x8f,0x8f |
db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff |
db 0xff,0xff,0x9c,0x9c,0x9c,0x87,0x87,0x87,0x6c,0x6c |
db 0x6c,0x4f,0x4f,0x4f,0x32,0x32,0x32,0x19,0x19,0x19 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff |
db 0xff,0xff,0x69,0x69,0x69,0x84,0x84,0x84,0xff,0xff |
db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff |
db 0x92,0x92,0x92,0x79,0x79,0x79,0x59,0x59,0x59,0x3c |
db 0x3c,0x3c,0x24,0x24,0x24,0x11,0x11,0x11,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0x37,0x37,0x37 |
db 0x5d,0x5d,0x5d,0x70,0x70,0x70,0x76,0x76,0x76,0xff |
db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff |
db 0xff,0x75,0x75,0x75,0x51,0x51,0x51,0x31,0x31,0x31 |
db 0x19,0x19,0x19,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x16,0x16,0x16,0x2d,0x2d,0x2d,0x49,0x49 |
db 0x49,0x53,0x53,0x53,0x54,0x54,0x54,0xff,0xff,0xff |
db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x78 |
db 0x78,0x78,0x54,0x54,0x54,0x30,0x30,0x30,0x16,0x16 |
db 0x16,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x0f,0x0f,0x0f,0x1f,0x1f,0x1f,0x30,0x30,0x30,0x33 |
db 0x33,0x33,0x33,0x33,0x33,0x3b,0x3b,0x3b,0xff,0xff |
db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff |
db 0x62,0x62,0x62,0x3b,0x3b,0x3b,0x1c,0x1c,0x1c,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x08 |
db 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x24,0x24,0x24,0xff,0xff,0xff,0xff |
db 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x6e,0x6e |
db 0x6e,0x48,0x48,0x48,0x25,0x25,0x25,0x0e,0x0e,0x0e |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x04,0x00 |
db 0x00,0x00,0x0a,0x0a,0x0a,0x09,0x09,0x09,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x29,0x29,0x29,0xff,0xff,0xff |
db 0xff,0xff,0xff,0x7c,0x7c,0x7c,0x71,0x71,0x71,0x50 |
db 0x50,0x50,0x2b,0x2b,0x2b,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x02,0x02,0x02,0x04,0x04,0x04,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x36,0x36,0x36,0x56,0x56 |
db 0x56,0x69,0x69,0x69,0x64,0x64,0x64,0x4a,0x4a,0x4a |
db 0x28,0x28,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x05,0x05,0x05 |
db 0x00,0x00,0x00,0x21,0x21,0x21,0x39,0x39,0x39,0x49 |
db 0x49,0x49,0x48,0x48,0x48,0x35,0x35,0x35,0x1d,0x1d |
db 0x1d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x1d,0x1d,0x1d,0x27,0x27,0x27 |
db 0x27,0x27,0x27,0x1d,0x1d,0x1d,0x0f,0x0f,0x0f,0x06 |
db 0x06,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
db 0x00,0x00,0x00,0x00 |
endg |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
Added: svn:keywords |
+Rev |
\ No newline at end of property |
/kernel/branches/kolibri-ahci/gui/char_et.mt |
---|
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/branches/kolibri-ahci/gui/char_sp.mt |
---|
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/branches/kolibri-ahci/gui/. |
---|
Property changes: |
Added: svn:ignore |
+*.mnt |
+lang.inc |
+*.bat |
+out.txt |
+scin* |
+*.obj |