1 /* 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 20 int gr_init(void); 21 void gr_exit(void); 22 23 int gr_fb_width(void); 24 int gr_fb_height(void); 25 void gr_flip(void); 26 27 void gr_color(unsigned char r, unsigned char g, unsigned char b); 28 void gr_fill(int x, int y, int w, int h); 29 int gr_text(int x, int y, const char *s); 30 int gr_measure(const char *s); 31 32 33 typedef struct event event; 34 35 struct event 36 { 37 unsigned type; 38 unsigned code; 39 unsigned value; 40 }; 41 42 int ev_init(void); 43 void ev_exit(void); 44 45 int ev_get(event *ev, unsigned dont_wait); 46 47 #define TYPE_KEY 1 48 49 #define KEY_UP 103 50 #define KEY_DOWN 108 51 #define KEY_LEFT 105 52 #define KEY_RIGHT 106 53 #define KEY_CENTER 232 54 #define KEY_ENTER 28 55 56 #endif 57