2006-09-28 Matthew Allum <mallum@openedhand.com>
[profile/ivi/psplash.git] / psplash-fb.h
1 /* 
2  *  pslash - a lightweight framebuffer splashscreen for embedded devices. 
3  *
4  *  Copyright (c) 2006 Matthew Allum <mallum@o-hand.com>
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2, or (at your option)
9  *  any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  */
17
18 #ifndef _HAVE_PSPLASH_FB_H
19 #define _HAVE_PSPLASH_FB_H
20
21 typedef struct PSplashFB
22 {
23   int            fd;                    
24   struct termios save_termios;          
25   int            type;                  
26   int            visual;                
27   int            width, height;
28   int            bpp;
29   int            stride;
30   char          *data;
31   char          *base;
32
33 }
34 PSplashFB;
35
36 void
37 psplash_fb_destroy (PSplashFB *fb);
38
39 PSplashFB*
40 psplash_fb_new (void);
41
42 inline void
43 psplash_fb_plot_pixel (PSplashFB    *fb, 
44                        int          x, 
45                        int          y, 
46                        uint8        red,
47                        uint8        green,
48                        uint8        blue);
49
50 void
51 psplash_fb_draw_rect (PSplashFB    *fb, 
52                       int          x, 
53                       int          y, 
54                       int          width, 
55                       int          height,
56                       uint8        red,
57                       uint8        green,
58                       uint8        blue);
59
60 void
61 psplash_fb_draw_image (PSplashFB    *fb, 
62                        int          x, 
63                        int          y, 
64                        int          img_width, 
65                        int          img_height,
66                        int          img_bytes_pre_pixel,
67                        uint8       *rle_data);
68
69 void
70 psplash_fb_text_size (PSplashFB          *fb,
71                       int                *width, 
72                       int                *height,
73                       const PSplashFont  *font,
74                       const char         *text);
75
76 void
77 psplash_fb_draw_text (PSplashFB         *fb, 
78                       int                x, 
79                       int                y, 
80                       uint8              red,
81                       uint8              green,
82                       uint8              blue,
83                       const PSplashFont *font,
84                       const char        *text);
85
86
87 #endif