aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/evas/src/modules/engines/fb/evas_fb.h
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/evas/src/modules/engines/fb/evas_fb.h')
-rw-r--r--libraries/evas/src/modules/engines/fb/evas_fb.h93
1 files changed, 93 insertions, 0 deletions
diff --git a/libraries/evas/src/modules/engines/fb/evas_fb.h b/libraries/evas/src/modules/engines/fb/evas_fb.h
new file mode 100644
index 0000000..76ab30b
--- /dev/null
+++ b/libraries/evas/src/modules/engines/fb/evas_fb.h
@@ -0,0 +1,93 @@
1#ifndef _EVAS_FB_H
2#define _EVAS_FB_H 1
3
4/* -------------------------------------------------------------------- */
5/* LINUX FBCON FRAMEBUFFER UTILITY CODE */
6/* makes setting up the framebuffer easy. Also makes it eays to port to */
7/* some other system if needed. */
8/* Copyright (c) 1999 - Carsten Haitzler (The Rasterman) */
9/* -------------------------------------------------------------------- */
10
11#include <stdio.h>
12#include <stdlib.h>
13#include <string.h>
14#include <unistd.h>
15#include <fcntl.h>
16#include <termios.h>
17#include <errno.h>
18#include <sys/ioctl.h>
19#include <sys/mman.h>
20#include <sys/wait.h>
21#include <sys/stat.h>
22#include <linux/kd.h>
23#include <linux/vt.h>
24#include <linux/fb.h>
25
26typedef struct _fb_mode FB_Mode;
27
28struct _fb_mode
29{
30 unsigned int width;
31 unsigned int height;
32 unsigned int refresh;
33 unsigned int depth;
34 unsigned int bpp;
35 int fb_fd;
36 void *mem;
37 unsigned int mem_offset;
38 struct fb_var_screeninfo fb_var;
39};
40
41/* init a framebuffer (and switch to) vt number vt. If vt == 0 use current */
42/* vt */
43void fb_init(int vt, int device);
44/* call this afetr setting or getting the fb mode (whichever) to complete */
45/* the dsetup */
46int fb_postinit(FB_Mode *mode);
47/* console switching - if a switch was requested this with block if block */
48/* is 1, otherwise it will return 1 if current console is active or 0 if */
49/* the user has switched away in the meantime */
50int fb_await_switch(int block);
51/* list all current possible video modes listed in /etc/fb.modes */
52/* returns pointer to an aray of FB_Mode, and sets num_return to the number */
53/* of elements in the returned array */
54FB_Mode *fb_list_modes(unsigned int *num_return);
55/* sets the fb mode to the resolution width x height and the depth to depth. */
56/* and if refresh > 0 attempts to use a mode with a refresh rate (in Hz) of */
57/* that. If this fails it will return NULL - if it succeeds it will return */
58/* a pointer to the FB_Mode thatwas set. only modes in /etc/fb.modes will */
59/* be used. If refresh is 0 it uses the DEFAULT mode (the one with no */
60/* refresh rate at the end of its name (WIDTHxHEIGHT-REFRESH) */
61/* NB: in 8bpp you get a 332 palette. This is fixed so all modes are */
62/* "truecolor" - the only difference is how many bits bep red, green and */
63/* blue channel. This is for speed reasons */
64FB_Mode *fb_setmode(unsigned int width, unsigned int height, unsigned int depth, unsigned int refresh);
65/* returns the current fb mode being used in FB_Mode */
66FB_Mode *fb_getmode(void);
67/* changes the bit depth of the current fb mode to depth and returns a new */
68/* handle to a new fb mode with updated parameters. frees cur_mode for you. */
69FB_Mode *fb_changedepth(FB_Mode *cur_mode, unsigned int depth);
70/* changes resolution - retaining current depth of the current mode, */
71/* returning a handle to the new mode once done. frees cur_mode for you. */
72FB_Mode *fb_changeres(FB_Mode *cur_mode, unsigned int width, unsigned int height, unsigned int refresh);
73/* chnages both resolution and depth and returns a handle to the new mode */
74/* when done. frees cur_mode for you */
75FB_Mode *fb_changemode(FB_Mode *cur_mode, unsigned int width, unsigned int height, unsigned int depth, unsigned int refresh);
76
77/* ------------------------------------------------------------------------- */
78/* How to init: */
79/* (Example) */
80
81/* FB_Mode *mode; */
82/* int fb_fd = -1; */
83/* fb_init(0); */
84/* mode = fb_setmode(640, 480, 8, 0); */
85/* if (mode) */
86/* fb_fd = fb_postinit(mode); */
87/* if (fb_fd == -1) */
88/* { */
89/* fprintf(stderr, "Frambuffer init failed\n"); */
90/* exit(1); */
91/* } */
92/* .... code to play with the FB */
93#endif