2011-06-12 00:16:26 +02:00
|
|
|
;---------------------------------------------------------------------
|
|
|
|
k_background:
|
|
|
|
test dword [status],8
|
|
|
|
jnz still
|
|
|
|
or dword [status],8
|
|
|
|
|
2011-07-07 21:18:51 +02:00
|
|
|
call get_memory_for_thread_stack
|
2011-06-12 00:16:26 +02:00
|
|
|
mov [thread_stack_4],eax
|
|
|
|
mcall 51,1,thread4 ;, thread_stack_4
|
|
|
|
jmp still
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
thread4: ; start of bgrd thread
|
|
|
|
mcall 9, procinfo_threads, -1
|
|
|
|
mov eax,[ebx+30]
|
|
|
|
mov [PID4],eax
|
|
|
|
mcall 40, 0x27
|
|
|
|
.red:
|
|
|
|
call .draw_window
|
|
|
|
.still:
|
|
|
|
mov eax,10 ; wait here for event
|
|
|
|
mcall
|
|
|
|
|
|
|
|
cmp eax,1 ; redraw request ?
|
|
|
|
je .red
|
2011-07-07 21:18:51 +02:00
|
|
|
|
2011-06-12 00:16:26 +02:00
|
|
|
cmp eax,2 ; key in buffer ?
|
|
|
|
je .key
|
2011-07-07 21:18:51 +02:00
|
|
|
|
2011-06-12 00:16:26 +02:00
|
|
|
cmp eax,3 ; button in buffer ?
|
|
|
|
je .button
|
2011-07-07 21:18:51 +02:00
|
|
|
|
2011-06-12 00:16:26 +02:00
|
|
|
cmp eax,6 ; mouse in buffer ?
|
|
|
|
je .mouse
|
|
|
|
|
2011-07-07 21:18:51 +02:00
|
|
|
jmp .still
|
|
|
|
;---------------------------------------------------------------------
|
2011-06-12 00:16:26 +02:00
|
|
|
.mouse:
|
2011-09-15 23:49:56 +02:00
|
|
|
mov eax,option_group1
|
|
|
|
mov ecx,[eax]
|
2011-06-12 00:16:26 +02:00
|
|
|
push dword option_boxes_bcgr
|
|
|
|
call [option_box_mouse]
|
2011-09-15 23:49:56 +02:00
|
|
|
cmp ecx,[eax]
|
|
|
|
je .option_boxes_SCC
|
2011-06-12 00:16:26 +02:00
|
|
|
|
2011-09-15 23:49:56 +02:00
|
|
|
mov ebx,bgrmode
|
|
|
|
cmp [eax],dword op1
|
2011-06-12 00:16:26 +02:00
|
|
|
jne @f
|
2011-09-15 23:49:56 +02:00
|
|
|
mov [ebx],dword 1
|
|
|
|
jmp .option_group1_color_set
|
2011-07-07 21:18:51 +02:00
|
|
|
;---------------------------------------------------------------------
|
2011-06-12 00:16:26 +02:00
|
|
|
@@:
|
2011-09-15 23:49:56 +02:00
|
|
|
cmp [eax],dword op2
|
2011-09-07 18:34:44 +02:00
|
|
|
jne @f
|
2011-09-15 23:49:56 +02:00
|
|
|
mov [ebx],dword 2
|
|
|
|
jmp .option_group1_color_set
|
2011-07-07 21:18:51 +02:00
|
|
|
;---------------------------------------------------------------------
|
2011-09-07 18:34:44 +02:00
|
|
|
@@:
|
2011-09-15 23:49:56 +02:00
|
|
|
cmp [eax],dword op3
|
2011-09-07 18:34:44 +02:00
|
|
|
jne @f
|
2011-09-15 23:49:56 +02:00
|
|
|
mov [ebx],dword 3
|
|
|
|
jmp .option_group1_color_set
|
2011-09-07 18:34:44 +02:00
|
|
|
;---------------------------------------------------------------------
|
|
|
|
@@:
|
2011-09-15 23:49:56 +02:00
|
|
|
cmp [eax],dword op4
|
|
|
|
jne .option_boxes_SCC
|
|
|
|
mov [ebx],dword 4
|
|
|
|
.option_group1_color_set:
|
|
|
|
mov [bcgr_group_pointer],0
|
|
|
|
call .option_boxes_redraw
|
|
|
|
jmp .still
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
.option_boxes_SCC:
|
|
|
|
mov eax,[option_group3]
|
|
|
|
push dword option_boxes_SCC
|
|
|
|
call [option_box_mouse]
|
|
|
|
cmp eax,[option_group3]
|
|
|
|
je .still
|
|
|
|
|
|
|
|
call .convert_1
|
|
|
|
mov [bcgr_group_pointer],1
|
|
|
|
call .option_boxes_redraw
|
|
|
|
jmp .still
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
.tab:
|
|
|
|
mov al,[bcgr_group_pointer]
|
|
|
|
inc al
|
|
|
|
and al,1
|
|
|
|
mov [bcgr_group_pointer],al
|
|
|
|
call .option_boxes_redraw
|
2011-09-07 18:34:44 +02:00
|
|
|
jmp .still
|
|
|
|
;---------------------------------------------------------------------
|
2011-06-12 00:16:26 +02:00
|
|
|
.key:
|
|
|
|
mcall
|
|
|
|
cmp ah,27
|
|
|
|
je .close
|
2011-07-07 21:18:51 +02:00
|
|
|
|
2011-06-12 00:16:26 +02:00
|
|
|
cmp ah,13
|
|
|
|
je .kok
|
2011-07-07 21:18:51 +02:00
|
|
|
|
2011-09-15 23:49:56 +02:00
|
|
|
cmp ah,9
|
|
|
|
je .tab
|
|
|
|
|
|
|
|
cmp [bcgr_group_pointer],1
|
|
|
|
je .key_option_group3
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
.key_option_group1:
|
|
|
|
mov ebx,bgrmode
|
|
|
|
|
2011-06-12 00:16:26 +02:00
|
|
|
cmp ah,178 ;up
|
|
|
|
jne .nofup
|
2011-07-07 21:18:51 +02:00
|
|
|
|
2011-09-15 23:49:56 +02:00
|
|
|
cmp [ebx],dword 1
|
2011-06-12 00:16:26 +02:00
|
|
|
je .fdn
|
|
|
|
.fup:
|
2011-09-15 23:49:56 +02:00
|
|
|
dec dword [ebx]
|
2011-06-12 00:16:26 +02:00
|
|
|
jmp .flagcont
|
2011-09-15 23:49:56 +02:00
|
|
|
;--------------------------------------
|
2011-06-12 00:16:26 +02:00
|
|
|
.nofup:
|
|
|
|
cmp ah,177 ;down
|
|
|
|
jne .still
|
2011-07-07 21:18:51 +02:00
|
|
|
|
2011-09-15 23:49:56 +02:00
|
|
|
cmp [ebx],dword 4
|
2011-06-12 00:16:26 +02:00
|
|
|
je .fup
|
|
|
|
.fdn:
|
2011-09-15 23:49:56 +02:00
|
|
|
inc dword [ebx]
|
2011-06-12 00:16:26 +02:00
|
|
|
.flagcont:
|
2011-09-15 23:49:56 +02:00
|
|
|
mov eax,option_group1
|
|
|
|
cmp [ebx],dword 1
|
2011-06-12 00:16:26 +02:00
|
|
|
jne @f
|
2011-07-07 21:18:51 +02:00
|
|
|
|
2011-09-15 23:49:56 +02:00
|
|
|
mov [eax],dword op1
|
|
|
|
call .draw_opt_boxes_bcgr
|
2011-06-12 00:16:26 +02:00
|
|
|
jmp .still
|
2011-09-15 23:49:56 +02:00
|
|
|
;---------------------------------------
|
2011-06-12 00:16:26 +02:00
|
|
|
@@:
|
2011-09-15 23:49:56 +02:00
|
|
|
cmp [ebx],dword 2
|
2011-07-07 21:18:51 +02:00
|
|
|
jne @f
|
|
|
|
|
2011-09-15 23:49:56 +02:00
|
|
|
mov [eax],dword op2
|
|
|
|
call .draw_opt_boxes_bcgr
|
2011-06-12 00:16:26 +02:00
|
|
|
jmp .still
|
2011-09-15 23:49:56 +02:00
|
|
|
;----------------------------------------
|
2011-07-07 21:18:51 +02:00
|
|
|
@@:
|
2011-09-15 23:49:56 +02:00
|
|
|
cmp [ebx],dword 3
|
2011-07-07 21:18:51 +02:00
|
|
|
jne @f
|
|
|
|
|
2011-09-15 23:49:56 +02:00
|
|
|
mov [eax],dword op3
|
|
|
|
call .draw_opt_boxes_bcgr
|
|
|
|
jmp .still
|
|
|
|
;-----------------------------------------
|
|
|
|
@@:
|
|
|
|
mov [eax],dword op4
|
|
|
|
call .draw_opt_boxes_bcgr
|
2011-07-07 21:18:51 +02:00
|
|
|
jmp .still
|
|
|
|
;---------------------------------------------------------------------
|
2011-09-15 23:49:56 +02:00
|
|
|
.key_option_group3:
|
|
|
|
push eax
|
|
|
|
call .convert_1
|
|
|
|
pop eax
|
|
|
|
|
|
|
|
cmp ah,178 ;up
|
|
|
|
jne @f
|
|
|
|
|
|
|
|
dec word [ebx+2]
|
|
|
|
jmp .flagcont_1
|
|
|
|
;------------------------------------------
|
|
|
|
@@:
|
|
|
|
cmp ah,177 ;down
|
|
|
|
jne @f
|
|
|
|
|
|
|
|
inc word [ebx+2]
|
|
|
|
jmp .flagcont_1
|
|
|
|
;------------------------------------------
|
|
|
|
@@:
|
|
|
|
cmp ah,176 ;left
|
|
|
|
jne @f
|
|
|
|
|
|
|
|
dec word [ebx]
|
|
|
|
jmp .flagcont_1
|
|
|
|
;------------------------------------------
|
2011-07-07 21:18:51 +02:00
|
|
|
@@:
|
2011-09-15 23:49:56 +02:00
|
|
|
cmp ah,179 ;right
|
|
|
|
jne .still
|
|
|
|
|
|
|
|
inc word [ebx]
|
|
|
|
;------------------------------------------
|
|
|
|
.flagcont_1:
|
|
|
|
call .convert_2
|
|
|
|
call .convert_1 ;for additional check
|
|
|
|
call .draw_opt_boxes_SCC
|
2011-07-07 21:18:51 +02:00
|
|
|
jmp .still
|
|
|
|
;---------------------------------------------------------------------
|
2011-09-15 23:49:56 +02:00
|
|
|
.convert_1:
|
|
|
|
mov eax,option_group3
|
|
|
|
mov ebx,Stretch_Crop_Corner
|
|
|
|
cmp [eax],dword op_UL
|
|
|
|
jne @f
|
|
|
|
mov [ebx],dword 0 shl 16+0
|
|
|
|
jmp .option_group3_color_set
|
|
|
|
;----------------------------------------
|
|
|
|
@@:
|
|
|
|
cmp [eax],dword op_UC
|
|
|
|
jne @f
|
|
|
|
mov [ebx],dword 0 shl 16+1
|
|
|
|
jmp .option_group3_color_set
|
|
|
|
;-----------------------------------------
|
|
|
|
@@:
|
|
|
|
cmp [eax],dword op_UR
|
|
|
|
jne @f
|
|
|
|
mov [ebx],dword 0 shl 16+2
|
|
|
|
jmp .option_group3_color_set
|
|
|
|
;-----------------------------------------
|
|
|
|
@@:
|
|
|
|
cmp [eax],dword op_CL
|
|
|
|
jne @f
|
|
|
|
mov [ebx],dword 1 shl 16+0
|
|
|
|
jmp .option_group3_color_set
|
|
|
|
;------------------------------------------
|
|
|
|
@@:
|
|
|
|
cmp [eax],dword op_CC
|
|
|
|
jne @f
|
|
|
|
mov [ebx],dword 1 shl 16+1
|
|
|
|
jmp .option_group3_color_set
|
|
|
|
;-------------------------------------------
|
|
|
|
@@:
|
|
|
|
cmp [eax],dword op_CR
|
|
|
|
jne @f
|
|
|
|
mov [ebx],dword 1 shl 16+2
|
|
|
|
jmp .option_group3_color_set
|
|
|
|
;--------------------------------------------
|
|
|
|
@@:
|
|
|
|
cmp [eax],dword op_DL
|
|
|
|
jne @f
|
|
|
|
mov [ebx],dword 2 shl 16+0
|
|
|
|
jmp .option_group3_color_set
|
|
|
|
;--------------------------------------------
|
|
|
|
@@:
|
|
|
|
cmp [eax],dword op_DC
|
|
|
|
jne @f
|
|
|
|
mov [ebx],dword 2 shl 16+1
|
|
|
|
jmp .option_group3_color_set
|
|
|
|
;--------------------------------------------
|
|
|
|
@@:
|
|
|
|
cmp [eax],dword op_DR
|
|
|
|
jne .option_group3_color_set
|
|
|
|
mov [ebx],dword 2 shl 16+2
|
|
|
|
.option_group3_color_set:
|
|
|
|
ret
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
.convert_2:
|
|
|
|
mov eax,Stretch_Crop_Corner
|
|
|
|
mov ebx,option_group3
|
|
|
|
cmp [eax],dword 0 shl 16+0
|
|
|
|
jne @f
|
|
|
|
mov [ebx],dword op_UL
|
|
|
|
jmp .Stretch_Crop_Corner_set
|
|
|
|
;----------------------------------------
|
|
|
|
@@:
|
|
|
|
cmp [eax],dword 0 shl 16+1
|
|
|
|
jne @f
|
|
|
|
mov [ebx],dword op_UC
|
|
|
|
jmp .Stretch_Crop_Corner_set
|
|
|
|
;-----------------------------------------
|
|
|
|
@@:
|
|
|
|
cmp [eax],dword 0 shl 16+2
|
|
|
|
jne @f
|
|
|
|
mov [ebx],dword op_UR
|
|
|
|
jmp .Stretch_Crop_Corner_set
|
|
|
|
;-----------------------------------------
|
|
|
|
@@:
|
|
|
|
cmp [eax],dword 1 shl 16+0
|
|
|
|
jne @f
|
|
|
|
mov [ebx],dword op_CL
|
|
|
|
jmp .Stretch_Crop_Corner_set
|
|
|
|
;------------------------------------------
|
|
|
|
@@:
|
|
|
|
cmp [eax],dword 1 shl 16+1
|
|
|
|
jne @f
|
|
|
|
mov [ebx],dword op_CC
|
|
|
|
jmp .Stretch_Crop_Corner_set
|
|
|
|
;-------------------------------------------
|
|
|
|
@@:
|
|
|
|
cmp [eax],dword 1 shl 16+2
|
|
|
|
jne @f
|
|
|
|
mov [ebx],dword op_CR
|
|
|
|
jmp .Stretch_Crop_Corner_set
|
|
|
|
;--------------------------------------------
|
|
|
|
@@:
|
|
|
|
cmp [eax],dword 2 shl 16+0
|
|
|
|
jne @f
|
|
|
|
mov [ebx],dword op_DL
|
|
|
|
jmp .Stretch_Crop_Corner_set
|
|
|
|
;--------------------------------------------
|
|
|
|
@@:
|
|
|
|
cmp [eax],dword 2 shl 16+1
|
|
|
|
jne @f
|
|
|
|
mov [ebx],dword op_DC
|
|
|
|
jmp .Stretch_Crop_Corner_set
|
|
|
|
;--------------------------------------------
|
|
|
|
@@:
|
|
|
|
cmp [eax],dword 2 shl 16+2
|
|
|
|
jne .Stretch_Crop_Corner_set
|
|
|
|
mov [ebx],dword op_DR
|
|
|
|
.Stretch_Crop_Corner_set:
|
|
|
|
ret
|
|
|
|
;---------------------------------------------------------------------
|
2011-06-12 00:16:26 +02:00
|
|
|
.button: ; button
|
2011-09-15 23:49:56 +02:00
|
|
|
mcall 17 ; get id
|
2013-03-26 20:24:13 +01:00
|
|
|
cmp ah,4
|
|
|
|
je .kok
|
|
|
|
|
|
|
|
cmp ah,5
|
|
|
|
je .start_ColorDialog
|
|
|
|
; cmp ah,1 ; button id=1 ?
|
|
|
|
; jne .noclose
|
2011-06-12 00:16:26 +02:00
|
|
|
.close:
|
|
|
|
xor dword [status],8
|
|
|
|
xor eax,eax
|
|
|
|
mov [PID4],eax
|
|
|
|
|
|
|
|
mcall 68,13,[thread_stack_4]
|
|
|
|
mov eax,-1 ; close this program
|
|
|
|
mcall
|
|
|
|
.noclose:
|
|
|
|
.kok:
|
|
|
|
call background
|
|
|
|
jmp .close
|
2013-03-26 20:24:13 +01:00
|
|
|
;---------------------------------------------------------------------
|
|
|
|
.start_ColorDialog:
|
|
|
|
push dword ColorDialog_data
|
|
|
|
call [ColorDialog_Start]
|
|
|
|
call clear_control_key_flag
|
|
|
|
; 2 - use another method/not found program
|
|
|
|
cmp [ColorDialog_data.status],2
|
|
|
|
je .still
|
|
|
|
; 1 - OK, color selected
|
|
|
|
cmp [ColorDialog_data.status],1
|
|
|
|
jne .still
|
|
|
|
|
|
|
|
mov eax,[ColorDialog_data.color]
|
|
|
|
mov [background_color],eax
|
|
|
|
jmp .still
|
2011-07-07 21:18:51 +02:00
|
|
|
;---------------------------------------------------------------------
|
2011-06-12 00:16:26 +02:00
|
|
|
; *********************************************
|
|
|
|
; ******* WINDOW DEFINITIONS AND DRAW ********
|
|
|
|
; *********************************************
|
|
|
|
.draw_window:
|
|
|
|
mcall 12,1
|
2011-07-07 21:18:51 +02:00
|
|
|
xor eax,eax
|
|
|
|
xor esi,esi
|
2013-03-26 20:24:13 +01:00
|
|
|
mcall ,<100,300>,<100,170>,0x13909090,,labelt4
|
|
|
|
mcall 8,<60,40>,<120,20>,4,0xdddddd
|
|
|
|
mcall ,<220,40>,<120,20>,5,[background_color] ; 0xdddddd
|
|
|
|
mcall 4,<36,28>,0xffffff,bgrdtext,bgrdtext.size
|
|
|
|
push ebx
|
|
|
|
add ebx,170*65536
|
|
|
|
mcall ,,,scc_text,scc_text.size
|
|
|
|
pop ebx
|
|
|
|
add ebx,40*65536+98
|
2011-07-07 21:18:51 +02:00
|
|
|
xor ecx,ecx
|
|
|
|
mcall ,,,ok_btn,ok_btn.size
|
2013-03-26 20:24:13 +01:00
|
|
|
add ebx,40*65536
|
|
|
|
mcall ,,0xffffff,color_btn,color_btn.size
|
2011-09-15 23:49:56 +02:00
|
|
|
call .option_boxes_redraw
|
2011-07-07 21:18:51 +02:00
|
|
|
; mcall 47,0x80000,[PID4],<200, 5>,0xffffff
|
2011-06-12 00:16:26 +02:00
|
|
|
mcall 12,2
|
|
|
|
ret
|
|
|
|
;---------------------------------------------------------------------
|
2011-09-15 23:49:56 +02:00
|
|
|
.option_boxes_redraw:
|
|
|
|
call .draw_opt_boxes_bcgr
|
|
|
|
call .draw_opt_boxes_SCC
|
|
|
|
ret
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
.draw_opt_boxes_bcgr:
|
|
|
|
mov edx,0x13909090
|
|
|
|
cmp [bcgr_group_pointer],0
|
|
|
|
jne @f
|
|
|
|
|
|
|
|
mov edx,0xffff80
|
|
|
|
@@:
|
2013-03-26 20:24:13 +01:00
|
|
|
mcall 13,<59,14>,<44,59>,
|
2011-06-12 00:16:26 +02:00
|
|
|
push dword option_boxes_bcgr
|
|
|
|
call [option_box_draw]
|
2011-09-15 23:49:56 +02:00
|
|
|
ret
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
.draw_opt_boxes_SCC:
|
|
|
|
mov edx,0x13909090
|
|
|
|
cmp [bcgr_group_pointer],1
|
|
|
|
jne @f
|
|
|
|
|
|
|
|
mov edx,0xffff80
|
|
|
|
@@:
|
|
|
|
mcall 13,<198,70>,<38,70>,
|
|
|
|
push dword option_boxes_SCC
|
|
|
|
call [option_box_draw]
|
2011-06-12 00:16:26 +02:00
|
|
|
ret
|