From dd7595a3475407a7fa96a97393bae8c5220e8762 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Wed, 4 Jan 2012 18:41:13 +1000 Subject: Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje. Note that embryo wont be used, but I'm not sure yet if you can build edje without it. --- libraries/evas/src/modules/engines/fb/evas_fb.h | 93 +++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 libraries/evas/src/modules/engines/fb/evas_fb.h (limited to 'libraries/evas/src/modules/engines/fb/evas_fb.h') 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 @@ +#ifndef _EVAS_FB_H +#define _EVAS_FB_H 1 + +/* -------------------------------------------------------------------- */ +/* LINUX FBCON FRAMEBUFFER UTILITY CODE */ +/* makes setting up the framebuffer easy. Also makes it eays to port to */ +/* some other system if needed. */ +/* Copyright (c) 1999 - Carsten Haitzler (The Rasterman) */ +/* -------------------------------------------------------------------- */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef struct _fb_mode FB_Mode; + +struct _fb_mode +{ + unsigned int width; + unsigned int height; + unsigned int refresh; + unsigned int depth; + unsigned int bpp; + int fb_fd; + void *mem; + unsigned int mem_offset; + struct fb_var_screeninfo fb_var; +}; + +/* init a framebuffer (and switch to) vt number vt. If vt == 0 use current */ +/* vt */ +void fb_init(int vt, int device); +/* call this afetr setting or getting the fb mode (whichever) to complete */ +/* the dsetup */ +int fb_postinit(FB_Mode *mode); +/* console switching - if a switch was requested this with block if block */ +/* is 1, otherwise it will return 1 if current console is active or 0 if */ +/* the user has switched away in the meantime */ +int fb_await_switch(int block); +/* list all current possible video modes listed in /etc/fb.modes */ +/* returns pointer to an aray of FB_Mode, and sets num_return to the number */ +/* of elements in the returned array */ +FB_Mode *fb_list_modes(unsigned int *num_return); +/* sets the fb mode to the resolution width x height and the depth to depth. */ +/* and if refresh > 0 attempts to use a mode with a refresh rate (in Hz) of */ +/* that. If this fails it will return NULL - if it succeeds it will return */ +/* a pointer to the FB_Mode thatwas set. only modes in /etc/fb.modes will */ +/* be used. If refresh is 0 it uses the DEFAULT mode (the one with no */ +/* refresh rate at the end of its name (WIDTHxHEIGHT-REFRESH) */ +/* NB: in 8bpp you get a 332 palette. This is fixed so all modes are */ +/* "truecolor" - the only difference is how many bits bep red, green and */ +/* blue channel. This is for speed reasons */ +FB_Mode *fb_setmode(unsigned int width, unsigned int height, unsigned int depth, unsigned int refresh); +/* returns the current fb mode being used in FB_Mode */ +FB_Mode *fb_getmode(void); +/* changes the bit depth of the current fb mode to depth and returns a new */ +/* handle to a new fb mode with updated parameters. frees cur_mode for you. */ +FB_Mode *fb_changedepth(FB_Mode *cur_mode, unsigned int depth); +/* changes resolution - retaining current depth of the current mode, */ +/* returning a handle to the new mode once done. frees cur_mode for you. */ +FB_Mode *fb_changeres(FB_Mode *cur_mode, unsigned int width, unsigned int height, unsigned int refresh); +/* chnages both resolution and depth and returns a handle to the new mode */ +/* when done. frees cur_mode for you */ +FB_Mode *fb_changemode(FB_Mode *cur_mode, unsigned int width, unsigned int height, unsigned int depth, unsigned int refresh); + +/* ------------------------------------------------------------------------- */ +/* How to init: */ +/* (Example) */ + +/* FB_Mode *mode; */ +/* int fb_fd = -1; */ +/* fb_init(0); */ +/* mode = fb_setmode(640, 480, 8, 0); */ +/* if (mode) */ +/* fb_fd = fb_postinit(mode); */ +/* if (fb_fd == -1) */ +/* { */ +/* fprintf(stderr, "Frambuffer init failed\n"); */ +/* exit(1); */ +/* } */ +/* .... code to play with the FB */ +#endif -- cgit v1.1