Rev 546 | Rev 585 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
546 | diamond | 1 | SYSTEM FUNCTIONS of OS Kolibri 0.7.0.0 |
114 | mikedld | 2 | |
3 | Number of the function is located in the register eax. |
||
118 | diamond | 4 | The call of the system function is executed by "int 0x40" command. |
5 | All registers except explicitly declared in the returned value, |
||
6 | including eflags, are preserved. |
||
114 | mikedld | 7 | |
8 | |||
9 | ====================================================================== |
||
10 | ============== Function 0 - define and draw the window. ============== |
||
11 | ====================================================================== |
||
12 | Defines an application window. Draws a frame of the window, header and |
||
133 | diamond | 13 | working area. For skinned windows defines standard close and minimize |
14 | buttons. |
||
114 | mikedld | 15 | Parameters: |
118 | diamond | 16 | * eax = 0 - function number |
114 | mikedld | 17 | * ebx = [coordinate on axis x]*65536 + [size on axis x] |
18 | * ecx = [coordinate on axis y]*65536 + [size on axis y] |
||
19 | * edx = 0xXYRRGGBB, where: |
||
20 | * Y = style of the window: |
||
131 | diamond | 21 | * Y=0 - type I - fixed-size window |
118 | diamond | 22 | * Y=1 - only define window area, draw nothing |
131 | diamond | 23 | * Y=2 - type II - variable-size window |
24 | * Y=3 - skinned window |
||
549 | spraid | 25 | * Y=4 - skinned window with fixed sizes |
118 | diamond | 26 | * other possible values (from 4 up to 15) are reserved, |
114 | mikedld | 27 | function call with such Y is ignored |
118 | diamond | 28 | * RR, GG, BB = accordingly red, green, blue components of a color |
29 | of the working area of the window (are ignored for style Y=2) |
||
114 | mikedld | 30 | * X = DCBA (bits) |
118 | diamond | 31 | * A = 1 - window has caption; for style Y=3 caption string |
32 | must be passed in edi, for other styles use |
||
33 | subfunction 1 of function 71 |
||
34 | * B = 1 - coordinates of all graphics primitives are relative to |
||
35 | window client area |
||
303 | mikedld | 36 | * C = 1 - don't fill working area on window draw |
118 | diamond | 37 | * D = 0 - normal filling of the working area, 1 - gradient |
38 | The following parameters are intended for windows |
||
39 | of a type I and II, and ignored for styles Y=1,3: |
||
40 | * esi = 0xXYRRGGBB - color of the header |
||
41 | * RR, GG, BB define color |
||
114 | mikedld | 42 | * Y=0 - usual window, Y=1 - unmovable window |
118 | diamond | 43 | * X defines a gradient of header: X=0 - no gradient, |
114 | mikedld | 44 | X=8 - usual gradient, |
45 | for windows of a type II X=4 - negative gradient |
||
118 | diamond | 46 | * other values of X and Y are reserved |
47 | * edi = 0x00RRGGBB - color of the frame |
||
114 | mikedld | 48 | Returned value: |
49 | * function does not return value |
||
50 | Remarks: |
||
118 | diamond | 51 | * Position and sizes of the window are installed by the first |
52 | call of this function and are ignored at subsequent; to change |
||
53 | position and/or sizes of already created window use function 67. |
||
54 | * For windows with style Y=3 and caption (A=1) caption string is set |
||
55 | by the first call of this function and is ignored at subsequent |
||
56 | (strictly speaking, is ignored after a call to subfunction 2 |
||
57 | of function 12 - end redraw); to change caption of already created |
||
58 | window use subfunction 1 of function 71. |
||
59 | * If the window has appropriate styles, position and/or sizes can be |
||
60 | changed by user. Current position and sizes can be obtained |
||
61 | by function 9. |
||
62 | * The window must fit on the screen. If the transferred |
||
63 | coordinates and sizes do not satisfy to this condition, |
||
64 | appropriate coordinate (or, probably, both) is considered as zero, |
||
131 | diamond | 65 | and if it does not help too, the appropriate size |
118 | diamond | 66 | (or, probably, both) is installed in a size of the screen. |
114 | mikedld | 67 | |
131 | diamond | 68 | Further let us designate xpos,ypos,xsize,ysize - values passed |
69 | in ebx,ecx. The coordinates are resulted concerning |
||
118 | diamond | 70 | the left upper corner of the window, which, thus, is set as (0,0), |
71 | coordinates of the right lower corner essence (xsize,ysize). |
||
72 | * The sizes of the window are understood in sence of coordinates |
||
73 | of the right lower corner. This concerns all other functions too. |
||
74 | It means, that the real sizes are on 1 pixel more. |
||
75 | * The window of type I looks as follows: |
||
76 | * draw external frame of color indicated in edi, 1 pixel in width |
||
77 | * draw header - rectangle with the left upper corner (1,1) and |
||
78 | right lower (xsize-1,min(25,ysize)) color indicated in esi |
||
79 | (taking a gradient into account) |
||
80 | * if ysize>=26, fill the working area of the window - |
||
81 | rectangle with the left upper corner (1,21) and right lower |
||
82 | (xsize-1,ysize-1) (sizes (xsize-1)*(ysize-21)) with color |
||
83 | indicated in edx (taking a gradient into account) |
||
84 | * if A=1 and caption has been already set by subfunction 1 |
||
85 | of function 71, it is drawn in the corresponding place of header |
||
86 | * The window of style Y=1 looks as follows: |
||
114 | mikedld | 87 | * completely defined by the application |
118 | diamond | 88 | * The window of type II looks as follows: |
89 | * draw external frame of width 1 pixel with the "shaded" color |
||
90 | edi (all components of the color decrease twice) |
||
91 | * draw intermediate frame of width 3 pixels with color edi |
||
92 | * draw internal frame of width 1 pixel with the "shaded" color edi |
||
114 | mikedld | 93 | * draw header - rectangle with the left upper corner (4,4) |
118 | diamond | 94 | and right lower (xsize-4,min(20,ysize)) color, indicated in esi |
95 | (taking a gradient into account) |
||
96 | * if ysize>=26, fill the working area of the window - |
||
114 | mikedld | 97 | rectangle with the left upper corner (5,20) and right lower |
118 | diamond | 98 | (xsize-5,ysize-5) with color indicated in edx |
99 | (taking a gradient into account) |
||
100 | * if A=1 and caption has been already set by subfunction 1 |
||
101 | of function 71, it is drawn in the corresponding place of header |
||
102 | * The skinned window looks as follows: |
||
114 | mikedld | 103 | * draw external frame of width 1 pixel |
118 | diamond | 104 | with color 'outer' from the skin |
105 | * draw intermediate frame of width 3 pixel |
||
106 | with color 'frame' from the skin |
||
107 | * draw internal frame of width 1 pixel |
||
108 | with color 'inner' from the skin |
||
109 | * draw header (on bitmaps from the skin) in a rectangle |
||
114 | mikedld | 110 | (0,0) - (xsize,_skinh-1) |
118 | diamond | 111 | * if ysize>=26, fill the working area of the window - |
112 | rectangle with the left upper corner (5,_skinh) and right lower |
||
113 | (xsize-5,ysize-5) with color indicated in edx |
||
114 | (taking a gradient into account) |
||
133 | diamond | 115 | * define two standard buttons: close and minimize |
114 | mikedld | 116 | (see function 8) |
118 | diamond | 117 | * if A=1 and edi contains (nonzero) pointer to caption string, |
118 | it is drawn in place in header defined in the skin |
||
119 | * value _skinh is accessible as the result of call |
||
120 | subfunction 4 of function 48 |
||
114 | mikedld | 121 | |
122 | ====================================================================== |
||
118 | diamond | 123 | ================ Function 1 - put pixel in the window. =============== |
114 | mikedld | 124 | ====================================================================== |
125 | Parameters: |
||
118 | diamond | 126 | * eax = 1 - function number |
127 | * ebx = x-coordinate (relative to the window) |
||
128 | * ecx = y-coordinate (relative to the window) |
||
129 | * edx = 0x00RRGGBB - color of a pixel |
||
130 | edx = 0x01xxxxxx - invert color of a pixel |
||
131 | (low 24 bits are ignored) |
||
114 | mikedld | 132 | Returned value: |
133 | * function does not return value |
||
134 | |||
135 | ====================================================================== |
||
118 | diamond | 136 | ============ Function 2 - get the code of the pressed key. =========== |
114 | mikedld | 137 | ====================================================================== |
138 | Takes away the code of the pressed key from the buffer. |
||
139 | Parameters: |
||
118 | diamond | 140 | * eax = 2 - function number |
114 | mikedld | 141 | Returned value: |
118 | diamond | 142 | * if the buffer is empty, function returns eax=1 |
143 | * if the buffer is not empty, function returns al=0, |
||
144 | ah=code of the pressed key, high word of eax is zero |
||
145 | * if there is "hotkey", function returns al=2, |
||
146 | ah=scancode of the pressed key (0 for control keys), |
||
147 | high word of eax contains a status of control keys at the moment |
||
148 | of pressing a hotkey |
||
114 | mikedld | 149 | Remarks: |
118 | diamond | 150 | * There is a common system buffer of the pressed keys |
151 | by a size of 120 bytes, organized as queue. |
||
152 | * There is one more common system buffer on 120 "hotkeys". |
||
153 | * If the application with the inactive window calls this function, |
||
154 | the buffer of the pressed keys is considered to be empty. |
||
155 | * By default this function returns ASCII-codes; to switch |
||
156 | to the scancodes mode (and back) use function 66. |
||
157 | However, hotkeys are always notificated as scancodes. |
||
158 | * To find out, what keys correspond to what codes, start |
||
159 | the application keyascii and scancode. |
||
160 | * Scancodes come directly from keyboard and are fixed; |
||
161 | ASCII-codes turn out with usage of the conversion tables, |
||
162 | which can be set by subfunction 2 of function 21 |
||
163 | and get by subfunction 2 of function 26. |
||
164 | * As a consequence, ASCII-codes take into account current |
||
165 | keyboard layout (rus/en) as opposed to scancodes. |
||
166 | * This function notifies only about those hotkeys, which were |
||
167 | defined by this thread by subfunction 4 of function 66. |
||
114 | mikedld | 168 | |
169 | ====================================================================== |
||
118 | diamond | 170 | ==================== Function 3 - get system time. =================== |
114 | mikedld | 171 | ====================================================================== |
172 | Parameters: |
||
118 | diamond | 173 | * eax = 3 - function number |
114 | mikedld | 174 | Returned value: |
175 | * eax = 0x00SSMMHH, where HH:MM:SS = Hours:Minutes:Seconds |
||
118 | diamond | 176 | * each item is BCD-number, for example, |
177 | for time 23:59:59 function returns 0x00595923 |
||
114 | mikedld | 178 | Remarks: |
118 | diamond | 179 | * See also subfunction 9 of function 26 - get time from |
180 | the moment of start of the system; it is more convenient, because |
||
181 | returns simply DWORD-value of the time counter. |
||
182 | * System time can be set by function 22. |
||
114 | mikedld | 183 | |
184 | ====================================================================== |
||
118 | diamond | 185 | ============ Function 4 - draw text string in the window. ============ |
114 | mikedld | 186 | ====================================================================== |
187 | Parameters: |
||
118 | diamond | 188 | * eax = 4 - function number |
114 | mikedld | 189 | * ebx = [coordinate on axis x]*65536 + [coordinate on axis y] |
190 | * ecx = 0xX0RRGGBB, where |
||
118 | diamond | 191 | * RR, GG, BB specify text color |
139 | diamond | 192 | * X=ABnn (bits): |
185 | heavyiron | 193 | * nn specifies the used font: 0=system monospaced, |
194 | 1=system font of variable width |
||