its G_BYTE_ORDER not G_ENDIAN.
[mikachu/openbox.git] / render / color.h
1 #ifndef __color_h
2 #define __color_h
3
4 #include <X11/Xlib.h>
5 #include <X11/Xutil.h>
6
7 #ifdef HAVE_STDINT_H 
8 #  include <stdint.h>
9 #else
10 #  ifdef HAVE_SYS_TYPES_H
11 #    include <sys/types.h>
12 #  endif   
13 #endif
14
15
16 #ifdef HAVE_STDINT_H
17 typedef uint32_t pixel32;
18 typedef uint16_t pixel16;
19 #else
20 typedef u_int32_t pixel32;  
21 typedef u_int16_t pixel16;   
22 #endif /* HAVE_STDINT_H */  
23
24 #if (G_BYTE_ORDER == G_BIG_ENDIAN)
25 #define default_red_shift 0
26 #define default_green_shift 8
27 #define default_blue_shift 16
28 #define endian MSBFirst  
29 #else
30 #define default_red_shift 16
31 #define default_green_shift 8
32 #define default_blue_shift 0
33 #define endian LSBFirst
34 #endif /* G_BYTE_ORDER == G_BIG_ENDIAN */
35
36
37 typedef struct color_rgb {
38     int r;
39     int g;
40     int b;
41     unsigned long pixel;
42     GC gc;
43 } color_rgb;
44
45 void color_allocate_gc(color_rgb *in);
46 XColor *pickColor(int r, int g, int b);
47 color_rgb *color_parse(char *colorname);
48 color_rgb *color_new(int r, int g, int b);
49 void color_free(color_rgb *in);
50 void reduce_depth(pixel32 *data, XImage *im);
51
52 extern int render_red_offset;
53 extern int render_green_offset;
54 extern int render_blue_offset;
55
56 extern int render_red_shift;
57 extern int render_green_shift;
58 extern int render_blue_shift;
59
60 extern int pseudo_bpc;
61 extern XColor *pseudo_colors;
62 #endif /* __color_h */