Subversion Repositories Kolibri OS

Rev

Rev 2349 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2349 Rev 2415
Line 5... Line 5...
5
typedef unsigned int count_t;
5
typedef unsigned int count_t;
6
 
6
 
Line 7... Line 7...
7
typedef struct
7
typedef struct
8
{
8
{
9
    int  left;
-
 
10
    int  top;
-
 
11
    int  right;
-
 
12
    int  bottom;
-
 
13
}rect_t;
-
 
14
 
-
 
15
typedef struct
-
 
16
{
-
 
17
    uint32_t    width;
9
    uint32_t    width;
18
    uint32_t    height;
10
    uint32_t    height;
19
    uint32_t    pitch;
11
    uint32_t    pitch;
20
    uint32_t    handle;
12
    uint32_t    handle;
21
    uint8_t    *data;
13
    uint8_t    *data;
22
}bitmap_t;
14
}bitmap_t;
Line 23... Line 15...
23
 
15
 
Line -... Line 16...
-
 
16
typedef struct render  render_t;
-
 
17
 
-
 
18
#define HAS_LEFT        (1<<0)
-
 
19
#define HAS_TOP         (1<<1)
-
 
20
#define HAS_RIGHT       (1<<2)
24
typedef struct render  render_t;
21
#define HAS_BOTTOM      (1<<3)
25
 
22
 
26
struct render
23
struct render
27
{
24
{
28
    uint32_t   caps;
25
    uint32_t   caps;
29
    uint32_t   ctx_width;
26
    uint32_t   ctx_width;
30
    uint32_t   ctx_height;
27
    uint32_t   ctx_height;
Line -... Line 28...
-
 
28
    uint32_t   win_width;
-
 
29
    uint32_t   win_height;
-
 
30
 
-
 
31
    rect_t     rc_client;
-
 
32
    rect_t     rcvideo;
-
 
33
    rect_t     rcleft;
-
 
34
    rect_t     rctop;
-
 
35
    rect_t     rcright;
31
    uint32_t   win_width;
36
    rect_t     rcbottom;
32
    uint32_t   win_height;
37
 
33
 
38
    uint32_t   layout;
-
 
39
    bitmap_t   bitmap[4];
-
 
40
    uint32_t   ctx_format;
34
    bitmap_t   bitmap[4];
41
    int        target;
35
    uint32_t   ctx_format;
42
    
36
    int        target;
-
 
37
    enum{
-
 
38
      EMPTY, INIT }state;
43
    window_t   *win;
Line 39... Line 44...
39
    enum{
44
    enum{
40
      NORMAL, MINIMIZED, ROLLED
45
      EMPTY, INIT }state;
Line 41... Line 46...
41
    }win_state;
46
    enum win_state win_state;
Line 88... Line 93...
88
render_t *create_render(uint32_t width, uint32_t height,
93
render_t *create_render(uint32_t width, uint32_t height,
89
                        uint32_t ctx_format, uint32_t flags);
94
                        uint32_t ctx_format, uint32_t flags);
Line 90... Line 95...
90
 
95
 
-
 
96
int init_render(render_t *render, int width, int height);
-
 
97
void render_adjust_size(render_t *render, window_t *win);
91
int init_render(render_t *render, int width, int height);
98
int render_set_size(render_t *render, int width, int height);
-
 
99
void render_draw_client(render_t *render);
Line 92... Line 100...
92
void render_adjust_size(render_t *render);
100
 
93
 
101
 
Line 94... Line 102...
94
int init_audio(int format);
102
int init_audio(int format);
Line 118... Line 126...
118
    "int $0x40"
126
    "int $0x40"
119
    ::"a"(68),"b"(14),"c"(event));
127
    ::"a"(68),"b"(14),"c"(event));
120
}
128
}
121
 
129
 
Line 122... Line -...
122
static inline uint32_t check_os_event()
-
 
123
{
-
 
124
    uint32_t val;
-
 
125
    __asm__ __volatile__(
-
 
126
    "int $0x40"
-
 
127
    :"=a"(val)
-
 
128
    :"a"(11));
-
 
129
    return val;
-
 
130
};
-
 
131
 
-
 
132
static inline uint32_t get_os_button()
130
static inline uint32_t get_os_button()
133
{
131
{
134
    uint32_t val;
132
    uint32_t val;
135
    __asm__ __volatile__(
133
    __asm__ __volatile__(
136
    "int $0x40"
134
    "int $0x40"
Line 152... Line 150...
152
    "int $0x40"
150
    "int $0x40"
153
    ::"a"(5), "b"(time));
151
    ::"a"(5), "b"(time));
154
};
152
};
155
 
153
 
Line 156... Line -...
156
static inline draw_bitmap(void *bitmap, int x, int y, int w, int h)
-
 
157
{
-
 
158
    __asm__ __volatile__(
-
 
159
    "int $0x40"
-
 
160
    ::"a"(7), "b"(bitmap),
-
 
161
      "c"((w << 16) | h),
-
 
162
      "d"((x << 16) | y));
-
 
163
}
-
 
Line 164... Line -...
164
 
-
 
165
static inline void BeginDraw(void)
-
 
166
{
-
 
167
    __asm__ __volatile__(
-
 
168
    "int $0x40" ::"a"(12),"b"(1));
-
 
169
};
-
 
170
 
-
 
171
static inline void EndDraw(void)
-
 
172
{
-
 
173
    __asm__ __volatile__(
-
 
174
    "int $0x40" ::"a"(12),"b"(2));
-
 
175
};
-
 
176
 
-
 
177
 
-
 
178
static inline void DrawWindow(int x, int y, int w, int h, char *name,
-
 
179
                       color_t workcolor, uint32_t style)
-
 
180
{
-
 
181
 
-
 
182
    __asm__ __volatile__(
-
 
183
    "int $0x40"
-
 
184
    ::"a"(0),
-
 
185
      "b"((x << 16) | (w & 0xFFFF)),
-
 
186
      "c"((y << 16) | (h & 0xFFFF)),
-
 
187
      "d"((style << 24) | (workcolor & 0xFFFFFF)),
-
 
188
      "D"(name));
-
 
Line 189... Line -...
189
};
-
 
190
 
-
 
191
static inline void get_proc_info(char *info)
-
 
192
{
-
 
193
    __asm__ __volatile__(
-
 
194
    "int $0x40"
-
 
195
    ::"a"(9), "b"(info), "c"(-1)
-
 
Line 196... Line 154...
196
    :"memory");
154
 
197
}
155
 
198
 
156
 
Line 199... Line 157...
199
#define HW_BIT_BLIT         (1<<0)      /* BGRX blitter             */
157
#define HW_BIT_BLIT         (1<<0)      /* BGRX blitter             */
Line 200... Line 158...
200
#define HW_TEX_BLIT         (1<<1)      /* stretch blit             */
158
#define HW_TEX_BLIT         (1<<1)      /* stretch blit             */
-
 
159
#define HW_VID_BLIT         (1<<2)      /* planar and packed video  */
201
#define HW_VID_BLIT         (1<<2)      /* planar and packed video  */
160
 
202
 
161
uint32_t InitPixlib(uint32_t flags);
203
uint32_t InitPixlib(uint32_t flags);
162