Main Page   File List   Globals  

FBlib.h

Go to the documentation of this file.
00001 
00009 /* This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  *   the Free Software Foundation; version 2 of the License. */
00012 
00013 #ifndef FBLIB_H
00014 #define FBLIB_H
00015 
00016 #include <sys/ioctl.h>
00017 #include <stdio.h>
00018 #include <stdlib.h>
00019 #include <linux/fb.h>
00020 #include <fcntl.h>
00021 #include <errno.h>
00022 #include <unistd.h>
00023 #include <sys/mman.h>
00024 #include <string.h>
00025 #include <linux/kd.h>
00026 #include <signal.h>
00027 #include <linux/vt.h>
00028 
00030 #include "keys.h"
00031 
00033 #ifndef DEFAULT_FONT
00034         #define DEFAULT_FONT "/usr/share/consolefonts/iso01.f14.psf.gz"
00035 #endif
00036 
00037 /* internal */
00038 #define DEBUG
00039 #define u_char unsigned char
00040 
00041 /* Error handling */
00042 #ifndef OK
00043 #define OK         0
00044 #endif
00045 #define PARAM_ERR -1
00046 #define IOCTL_ERR -2
00047 #define MMAP_ERR  -3
00048 
00049 /* Visuals */
00050 #define FB_VISUAL_MONO01             0
00051 #define FB_VISUAL_MONO10             1
00052 #define FB_VISUAL_TRUECOLOR          2
00053 #define FB_VISUAL_PSEUDOCOLOR        3
00054 #define FB_VISUAL_DIRECTCOLOR        4
00055 #define FB_VISUAL_STATIC_PSEUDOCOLOR 5
00056 
00057 /* Rotations */
00058 #define FB_ROTATE_NONE               0
00059 #define FB_ROTATE_90                 1
00060 #define FB_ROTATE_180                2
00061 #define FB_ROTATE_270                3
00062 
00063 typedef __u32 FB_pixel;
00064 
00066 extern int FB_visible;
00067 
00071 int FB_initlib(char *dev);  
00072 
00078 int FB_exit();   
00079 
00086 inline FB_pixel FB_makecol(u_char r,u_char g, u_char b, u_char t);
00087 
00090 void FB_clear_screen(FB_pixel color);
00091 
00096 inline void FB_putpixel(int x, int y, FB_pixel color);
00097 
00101 FB_pixel FB_getpixel(int x, int y);
00102 
00109 void FB_line(int sx, int sy, int ex, int ey, FB_pixel color);
00110 
00112 void FB_vline(int x, int sy, int ey, FB_pixel color);
00113 
00115 void FB_hline(int sx, int ex, int y, FB_pixel color);
00116 
00121 void FB_rect(int sx, int sy, int ex, int ey, FB_pixel color);
00122 
00124 void FB_rectfill(int sx, int sy, int ex, int ey, FB_pixel color);
00125 
00132 void FB_triangle(int x1,int y1,int x2,int y2,int x3,int y3,FB_pixel col);
00133 
00139 void FB_circle(int cx, int cy, int radius, FB_pixel color);
00140 
00150 int FB_getVisual();
00151 
00153 void FB_getres(int *x, int *y);
00154 
00156 int FB_getxres();
00157 
00159 int FB_getyres();
00160 
00162 int FB_getXVres();
00163 
00165 int FB_getYVres();
00166 
00168 int FB_getbpp();
00169 
00175 int FB_setbpp(int bpp);
00176 
00177 /* FBkeyb.c */
00179 int FB_kb_init();
00180 
00184 int FB_get_key();
00185 
00187 void FB_kb_end();
00188 
00189 /* FBfont.c */
00195 int FB_change_font(char *psf_file);
00196 
00204 int FB_putc(int c, int x, int y, FB_pixel col);
00205 
00213 int FB_printf(int x, int y, FB_pixel col, char *format, ...);
00214 
00215 /* Sets the framebuffer rotation, this only affects following operations
00216  * \param rotation one of FB_ROTATE_NONE,FB_ROTATE_90,FB_ROTATE_180,FB_ROTATE_270
00217  * \retval OK No error
00218  * \retval PARAM_ERR You did not use one of the defined rotations */
00219 int FB_setrotation(int rotation);
00220 
00221 /* Returns the current rotation state
00222  * \retval one of FB_ROTATE_NONE,FB_ROTATE_90,FB_ROTATE_180,FB_ROTATE_270 */
00223 int FB_getrotation();
00224 
00225 #endif /* FBLIB_H */
00226 

Generated on Sat Jul 5 09:04:51 2003 for LibFB by doxygen1.2.18