Add gbs.conf
[profile/ivi/psplash.git] / psplash.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_H
19 #define _HAVE_PSPLASH_H
20
21 #define _GNU_SOURCE 1
22 #include <assert.h>
23 #include <errno.h>
24 #include <fcntl.h>
25 #include <limits.h>
26 #include <linux/fb.h>
27 #include <linux/kd.h>
28 #include <linux/vt.h>
29 #include <signal.h>
30 #include <stdarg.h>
31 #include <stdio.h>
32 #include <stdint.h>
33 #include <stdlib.h>
34 #include <string.h>
35 #if defined(__i386__) || defined(__alpha__)
36 #include <sys/io.h>
37 #endif
38 #include <sys/ioctl.h>
39 #include <sys/mman.h>
40 #include <sys/stat.h>
41 #include <sys/time.h>
42 #include <sys/types.h>
43 #include <termios.h>
44 #include <unistd.h>
45
46 typedef uint8_t  uint8;
47 typedef uint16_t uint16;
48 typedef int            bool;
49
50 #ifndef FALSE
51 #define FALSE 0
52 #endif
53
54 #ifndef TRUE
55 #define TRUE 1
56 #endif
57
58 #define PSPLASH_FIFO "psplash_fifo"
59
60 #define CLAMP(x, low, high) \
61    (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
62
63 #define DEBUG 0
64
65 #if DEBUG
66 #define DBG(x, a...) \
67    { printf ( __FILE__ ":%d,%s() " x "\n", __LINE__, __func__, ##a); }
68 #else
69 #define DBG(x, a...) do {} while (0)
70 #endif
71
72 typedef struct PSplashFont
73 {
74     char *name;                         /* Font name. */
75     int   height;                       /* Height in pixels. */
76     int   index_mask;                   /* ((1 << N) - 1). */
77     int  *offset;                       /* (1 << N) offsets into index. */
78     int  *index;
79     u_int32_t *content;
80 }
81 PSplashFont;
82
83
84 #include "psplash-fb.h"
85 #include "psplash-console.h"
86 #include "psplash-colors.h"
87
88 #endif