Subversion Repositories Kolibri OS

Rev

Rev 4140 | 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]
4157 eAndrew 38
    sub     eax, 16
4140 eAndrew 39
    mov     [nwin.y], eax
4157 eAndrew 40
 
41
    mov     dword[nwin.bgx], 1
42
    mov     eax, [nwin.height]
43
    mov     [nwin.bgy], eax
44
 
4140 eAndrew 45
    jmp     @f
4157 eAndrew 46
 
47
 .right:
48
    mov     eax, [win.x_opn]
49
    sub     eax, 67
4140 eAndrew 50
    mov     [nwin.x], eax
4157 eAndrew 51
 
52
    mov     eax, [nwin.width]
53
    mov     [nwin.bgx], eax
54
    mov     dword[nwin.bgy], 1
55
    mov     dword[nwin.bgwidth], 1
56
    mov     eax, [nwin.height]
57
    dec     eax
58
    mov     dword[nwin.bgheight], eax
59
 
4140 eAndrew 60
  @@:
61
 
62
    mcall   40, 1b
63
 
64
    mcall   9, win.procinfo, -1
65
    mov     ecx, [win.procinfo + 30]
66
    mcall   18, 21
67
    and     eax, 0xFFFF
68
    mov     [nwin.sid], eax
69
;-------------------------------------------------------------------------------
70
n_main_loop:
71
    mcall   23, 1
72
 
73
    cmp     eax, EV_IDLE
74
    je	    n_event_idle
75
    cmp     eax, EV_REDRAW
76
    je	    n_event_redraw
77
 
78
    jmp     n_main_loop
79
;-------------------------------------------------------------------------------
80
n_event_idle:
81
    cmp     byte[nwin.close], 1
82
    jne     @f
83
 
84
    mov     byte[nwin.close], 0
85
    mcall   -1
86
 
87
  @@:
88
    cmp     byte[win.button_index], 100
89
    jne     @f
90
 
91
    mcall   67, 0, 0, 0, 0
92
    jmp     .end
93
 
94
  @@:
95
    cmp     byte[nwin.change_shape], 1
96
    jne     .end
97
 
98
    mov     byte[nwin.change_shape], 0
99
    mcall   67, [nwin.x], [nwin.y], [nwin.width], [nwin.height]
100
 
101
 .end:
102
    jmp     n_main_loop
103
;-------------------------------------------------------------------------------
104
n_event_redraw:
105
    mcall   12, 1
106
 
107
    mcall   0, <[nwin.x], [nwin.width]>, <[nwin.y], [nwin.height]>, [color.bg], [color.bg], [color.frame]
108
 
4157 eAndrew 109
    mcall   13, <[nwin.bgx], [nwin.bgwidth]>, <[nwin.bgy], [nwin.bgheight]>, [color.bg]
4140 eAndrew 110
 
111
    mov     edx, [win.button_index]
112
    imul    edx, 16
113
    add     edx, dock_items.name
114
 
115
    mov     eax, 0
116
  @@:
117
    inc     eax
118
    cmp     byte[edx+eax], 0
119
    jne     @b
120
 
121
    imul    eax, 3
122
    mov     ebx, 34
123
    sub     ebx, eax
4157 eAndrew 124
    add     ebx, 1
4140 eAndrew 125
    shl     ebx, 16
4157 eAndrew 126
    add     ebx, 5
4140 eAndrew 127
 
128
    mcall   4, , [color.text]
129
 
130
    mcall   12, 2
131
 
132
    jmp     n_main_loop