Subversion Repositories Kolibri OS

Rev

Rev 4198 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4140 eAndrew 1
n_main:
9530 leency 2
    mov     dword[nwin.w], 67
3
    mov     dword[nwin.h], 16
4157 eAndrew 4
 
5
    mov     dword[nwin.bgwidth], 66
6
    mov     dword[nwin.bgheight], 1
7
 
4140 eAndrew 8
    cmp     dword[dock_items.location], 1
9530 leency 9
    je      .top
4140 eAndrew 10
    cmp     dword[dock_items.location], 4
9530 leency 11
    je      .right
4140 eAndrew 12
    cmp     dword[dock_items.location], 3
9530 leency 13
    je      .bottom
4140 eAndrew 14
    jmp     .left
4157 eAndrew 15
 
4140 eAndrew 16
 .top:
9530 leency 17
    mov     eax, [win.h_opn]
4140 eAndrew 18
    mov     [nwin.y], eax
4157 eAndrew 19
 
20
    mov     dword[nwin.bgx], 1
21
 
4140 eAndrew 22
    jmp     @f
4157 eAndrew 23
 
24
 .left:
9530 leency 25
    mov     eax, [win.w_opn]
4140 eAndrew 26
    mov     [nwin.x], eax
4157 eAndrew 27
 
28
    mov     dword[nwin.bgy], 1
29
    mov     dword[nwin.bgwidth], 1
9530 leency 30
    mov     eax, [nwin.h]
4157 eAndrew 31
    dec     eax
32
    mov     dword[nwin.bgheight], eax
33
 
4140 eAndrew 34
    jmp     @f
4157 eAndrew 35
 
4140 eAndrew 36
 .bottom:
37
    mov     eax, [win.y_opn]
4198 eAndrew 38
    sub     eax, 17
4140 eAndrew 39
    mov     [nwin.y], eax
4157 eAndrew 40
 
41
    mov     dword[nwin.bgx], 1
9530 leency 42
    mov     eax, [nwin.h]
4198 eAndrew 43
 
9530 leency 44
    mov     eax, [nwin.h]
4157 eAndrew 45
    mov     [nwin.bgy], eax
46
 
4140 eAndrew 47
    jmp     @f
4157 eAndrew 48
 
49
 .right:
50
    mov     eax, [win.x_opn]
4198 eAndrew 51
    sub     eax, 68
4140 eAndrew 52
    mov     [nwin.x], eax
4157 eAndrew 53
 
9530 leency 54
    mov     eax, [nwin.w]
4157 eAndrew 55
    mov     [nwin.bgx], eax
56
    mov     dword[nwin.bgy], 1
57
    mov     dword[nwin.bgwidth], 1
9530 leency 58
    mov     eax, [nwin.h]
4157 eAndrew 59
    dec     eax
60
    mov     dword[nwin.bgheight], eax
61
 
4140 eAndrew 62
  @@:
63
 
64
    mcall   40, 1b
65
 
66
    mcall   9, win.procinfo, -1
67
    mov     ecx, [win.procinfo + 30]
68
    mcall   18, 21
69
    and     eax, 0xFFFF
70
    mov     [nwin.sid], eax
71
;-------------------------------------------------------------------------------
72
n_main_loop:
73
    mcall   23, 1
74
 
75
    cmp     eax, EV_IDLE
9530 leency 76
    je      n_event_idle
4140 eAndrew 77
    cmp     eax, EV_REDRAW
9530 leency 78
    je      n_event_redraw
4140 eAndrew 79
 
80
    jmp     n_main_loop
81
;-------------------------------------------------------------------------------
82
n_event_idle:
83
    cmp     byte[nwin.close], 1
84
    jne     @f
85
 
9530 leency 86
    mcall   13, <0, [win.w]>, <[win.h], 1>, [sc.work_dark]
4195 eAndrew 87
 
4140 eAndrew 88
    mov     byte[nwin.close], 0
89
    mcall   -1
90
 
91
  @@:
9530 leency 92
    cmp     byte[win.btn_index], 100
4140 eAndrew 93
    jne     @f
94
 
95
    mcall   67, 0, 0, 0, 0
96
    jmp     .end
97
 
98
  @@:
9530 leency 99
    cmp     byte[nwin.swap_shape], 1
4140 eAndrew 100
    jne     .end
101
 
9530 leency 102
    mov     byte[nwin.swap_shape], 0
103
    mcall   67, [nwin.x], [nwin.y], [nwin.w], [nwin.h]
4140 eAndrew 104
 
105
 .end:
106
    jmp     n_main_loop
107
;-------------------------------------------------------------------------------
108
n_event_redraw:
109
    mcall   12, 1
110
 
9530 leency 111
    mcall   0, <[nwin.x], [nwin.w]>, <[nwin.y], [nwin.h]>, [sc.work], [sc.work], [sc.work_dark]
4140 eAndrew 112
 
9530 leency 113
    mcall   13, <[nwin.bgx], [nwin.bgwidth]>, <[nwin.bgy], [nwin.bgheight]>, [sc.work]
4140 eAndrew 114
 
9530 leency 115
    mov     edx, [win.btn_index]
4140 eAndrew 116
    imul    edx, 16
117
    add     edx, dock_items.name
118
 
119
    mov     eax, 0
120
  @@:
121
    inc     eax
122
    cmp     byte[edx+eax], 0
123
    jne     @b
124
 
125
    imul    eax, 3
126
    mov     ebx, 34
127
    sub     ebx, eax
4157 eAndrew 128
    add     ebx, 1
4140 eAndrew 129
    shl     ebx, 16
4157 eAndrew 130
    add     ebx, 5
4140 eAndrew 131
 
9530 leency 132
    mcall   4, , [sc.work_text]
4140 eAndrew 133
 
134
    mcall   12, 2
135
 
4195 eAndrew 136
    mcall   18, 3, [nwin.sid]
137
 
4140 eAndrew 138
    jmp     n_main_loop