blob: 5496b09037282b834e74dd0e883a590ac4ef172b [file] [log] [blame]
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -08001/*
2 * Copyright (C) 2007 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef _MINUI_H_
18#define _MINUI_H_
19
20typedef void* gr_surface;
21typedef unsigned short gr_pixel;
22
23int gr_init(void);
24void gr_exit(void);
25
26int gr_fb_width(void);
27int gr_fb_height(void);
28gr_pixel *gr_fb_data(void);
29void gr_flip(void);
30
31void gr_color(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
32void gr_fill(int x, int y, int w, int h);
33int gr_text(int x, int y, const char *s);
34int gr_measure(const char *s);
Dima Zavin3c7f00e2011-08-30 11:58:24 -070035void gr_font_size(int *x, int *y);
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080036
37void gr_blit(gr_surface source, int sx, int sy, int w, int h, int dx, int dy);
38unsigned int gr_get_width(gr_surface surface);
39unsigned int gr_get_height(gr_surface surface);
40
41// input event structure, include <linux/input.h> for the definition.
42// see http://www.mjmwired.net/kernel/Documentation/input/ for info.
43struct input_event;
44
The Android Open Source Projectc24a8e62009-03-03 19:28:42 -080045int ev_init(void);
46void ev_exit(void);
47int ev_get(struct input_event *ev, unsigned dont_wait);
48
49// Resources
50
51// Returns 0 if no error, else negative.
52int res_create_surface(const char* name, gr_surface* pSurface);
53void res_free_surface(gr_surface surface);
54
55#endif