Subversion Repositories Kolibri OS

Rev

Rev 4195 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4140 eAndrew 1
n_main:
4157 eAndrew 2
    mov     dword[nwin.width], 67
3
    mov     dword[nwin.height], 16
4
 
5
    mov     dword[nwin.bgwidth], 66
6
    mov     dword[nwin.bgheight], 1
7
 
4140 eAndrew 8
    cmp     dword[dock_items.location], 1
9
    je	    .top
10
    cmp     dword[dock_items.location], 4
11
    je	    .right
12
    cmp     dword[dock_items.location], 3
13
    je	    .bottom
14
    jmp     .left
4157 eAndrew 15
 
4140 eAndrew 16
 .top:
17
    mov     eax, [win.height_opn]
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:
25
    mov     eax, [win.width_opn]
4140 eAndrew 26
    mov     [nwin.x], eax
4157 eAndrew 27
 
28
    mov     dword[nwin.bgy], 1
29
    mov     dword[nwin.bgwidth], 1
30
    mov     eax, [nwin.height]
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
42
    mov     eax, [nwin.height]
4198 eAndrew 43
 
44
    mov     eax, [nwin.height]
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
 
54
    mov     eax, [nwin.width]
55
    mov     [nwin.bgx], eax
56
    mov     dword[nwin.bgy], 1
57
    mov     dword[nwin.bgwidth], 1
58
    mov     eax, [nwin.height]
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
76
    je	    n_event_idle
77
    cmp     eax, EV_REDRAW
78
    je	    n_event_redraw
79
 
80
    jmp     n_main_loop
81
;-------------------------------------------------------------------------------
82
n_event_idle:
83
    cmp     byte[nwin.close], 1
84
    jne     @f
85
 
4195 eAndrew 86
    mcall   13, <0, [win.width]>, <[win.height], 1>, [color.frame]
87
 
4140 eAndrew 88
    mov     byte[nwin.close], 0
89
    mcall   -1
90
 
91
  @@:
92
    cmp     byte[win.button_index], 100
93
    jne     @f
94
 
95
    mcall   67, 0, 0, 0, 0
96
    jmp     .end
97
 
98
  @@:
99
    cmp     byte[nwin.change_shape], 1
100
    jne     .end
101
 
102
    mov     byte[nwin.change_shape], 0
103
    mcall   67, [nwin.x], [nwin.y], [nwin.width], [nwin.height]
104
 
105
 .end:
106
    jmp     n_main_loop
107
;-------------------------------------------------------------------------------
108
n_event_redraw:
109
    mcall   12, 1
110
 
111
    mcall   0, <[nwin.x], [nwin.width]>, <[nwin.y], [nwin.height]>, [color.bg], [color.bg], [color.frame]
112
 
4157 eAndrew 113
    mcall   13, <[nwin.bgx], [nwin.bgwidth]>, <[nwin.bgy], [nwin.bgheight]>, [color.bg]
4140 eAndrew 114
 
115
    mov     edx, [win.button_index]
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
 
132
    mcall   4, , [color.text]
133
 
134
    mcall   12, 2
135
 
4195 eAndrew 136
    mcall   18, 3, [nwin.sid]
137
 
4140 eAndrew 138
    jmp     n_main_loop