psplash-omap3pandora: Add tweaks to psplash and the final logo for the OpenPandora...
[openembedded.git] / recipes / psplash / psplash-omap3pandora / configurability.patch
1 Index: psplash.c
2 ===================================================================
3 --- psplash.orig/psplash.c      (revision 423)
4 +++ psplash/psplash.c   (working copy)
5 @@ -46,15 +46,15 @@
6  
7    psplash_fb_draw_rect (fb, 
8                         0, 
9 -                       fb->height - (fb->height/6) - h, 
10 +                       fb->height - (fb->height/PSPLASH_TEXT_DIVIDER) - h, 
11                         fb->width,
12                         h,
13 -                       0xec, 0xec, 0xe1);
14 +                       PSPLASH_BACKGROUND_COLOR_R, PSPLASH_BACKGROUND_COLOR_G, PSPLASH_BACKGROUND_COLOR_B);
15  
16    psplash_fb_draw_text (fb,
17                         (fb->width-w)/2, 
18 -                       fb->height - (fb->height/6) - h,
19 -                       0x6d, 0x6d, 0x70,
20 +                       fb->height - (fb->height/PSPLASH_TEXT_DIVIDER) - h,
21 +                       PSPLASH_TEXT_COLOR_R, PSPLASH_TEXT_COLOR_G, PSPLASH_TEXT_COLOR_B,
22                         &radeon_font,
23                         msg);
24  }
25 @@ -66,8 +66,8 @@
26  
27    /* 4 pix border */
28    x      = ((fb->width  - BAR_IMG_WIDTH)/2) + 4 ;
29 -  y      = fb->height - (fb->height/6) + 4;
30 -  width  = BAR_IMG_WIDTH - 8; 
31 +  y      = fb->height - (fb->height/PSPLASH_PROGRESS_DIVIDER) + 4;
32 +  width  = BAR_IMG_WIDTH - 8;
33    height = BAR_IMG_HEIGHT - 8;
34  
35    if (value > 0)
36 @@ -75,19 +75,19 @@
37        barwidth = (CLAMP(value,0,100) * width) / 100;
38        psplash_fb_draw_rect (fb, x + barwidth, y, 
39                         width - barwidth, height,
40 -                       0xec, 0xec, 0xe1);
41 +                       PSPLASH_BACKGROUND_COLOR_R, PSPLASH_BACKGROUND_COLOR_G, PSPLASH_BACKGROUND_COLOR_B);
42        psplash_fb_draw_rect (fb, x, y, barwidth,
43 -                           height, 0x6d, 0x6d, 0x70);
44 +                           height, PSPLASH_PROGRESS_COLOR_R, PSPLASH_PROGRESS_COLOR_G, PSPLASH_PROGRESS_COLOR_B);
45      }
46    else
47      {
48        barwidth = (CLAMP(-value,0,100) * width) / 100;
49        psplash_fb_draw_rect (fb, x, y, 
50                         width - barwidth, height,
51 -                       0xec, 0xec, 0xe1);
52 +                       PSPLASH_BACKGROUND_COLOR_R, PSPLASH_BACKGROUND_COLOR_G, PSPLASH_BACKGROUND_COLOR_B);
53        psplash_fb_draw_rect (fb, x + width - barwidth,
54                             y, barwidth, height,
55 -                           0x6d, 0x6d, 0x70);
56 +                           PSPLASH_PROGRESS_COLOR_R, PSPLASH_PROGRESS_COLOR_G, PSPLASH_PROGRESS_COLOR_B);
57      }
58  
59    DBG("value: %i, width: %i, barwidth :%i\n", value, 
60 @@ -269,7 +269,7 @@
61    /* Draw the OH logo  */
62    psplash_fb_draw_image (fb, 
63                          (fb->width  - POKY_IMG_WIDTH)/2, 
64 -                        (fb->height - POKY_IMG_HEIGHT)/2, 
65 +                        (fb->height - POKY_IMG_HEIGHT)/2,
66                          POKY_IMG_WIDTH,
67                          POKY_IMG_HEIGHT,
68                          POKY_IMG_BYTES_PER_PIXEL,
69 @@ -278,7 +278,7 @@
70    /* Draw progress bar border */
71    psplash_fb_draw_image (fb, 
72                          (fb->width  - BAR_IMG_WIDTH)/2, 
73 -                        fb->height - (fb->height/6), 
74 +                        fb->height - (fb->height/PSPLASH_PROGRESS_DIVIDER), 
75                          BAR_IMG_WIDTH,
76                          BAR_IMG_HEIGHT,
77                          BAR_IMG_BYTES_PER_PIXEL,
78 @@ -286,7 +286,7 @@
79  
80    psplash_draw_progress (fb, 0);
81  
82 -  psplash_draw_msg (fb, MSG);
83 +  psplash_draw_msg (fb, MSG); /* draw initial progress */
84  
85    psplash_main (fb, pipe_fd, 0);
86  
87 Index: psplash.h
88 ===================================================================
89 --- psplash.orig/psplash.h      (revision 423)
90 +++ psplash/psplash.h   (working copy)
91 @@ -1,5 +1,5 @@
92 -/* 
93 - *  pslash - a lightweight framebuffer splashscreen for embedded devices. 
94 +/*
95 + *  pslash - a lightweight framebuffer splashscreen for embedded devices.
96   *
97   *  Copyright (c) 2006 Matthew Allum <mallum@o-hand.com>
98   *
99 @@ -55,6 +55,21 @@
100  #define TRUE 1
101  #endif
102  
103 +#define PSPLASH_BACKGROUND_COLOR_R    0x00
104 +#define PSPLASH_BACKGROUND_COLOR_G    0x00
105 +#define PSPLASH_BACKGROUND_COLOR_B    0x00
106 +
107 +#define PSPLASH_PROGRESS_COLOR_R    0x25
108 +#define PSPLASH_PROGRESS_COLOR_G    0x39
109 +#define PSPLASH_PROGRESS_COLOR_B    0x4d
110 +
111 +#define PSPLASH_TEXT_COLOR_R    0xff
112 +#define PSPLASH_TEXT_COLOR_G    0xff
113 +#define PSPLASH_TEXT_COLOR_B    0xff
114 +
115 +#define PSPLASH_PROGRESS_DIVIDER    7
116 +#define PSPLASH_TEXT_DIVIDER    3
117 +
118  #define PSPLASH_FIFO "psplash_fifo"
119  
120  #define CLAMP(x, low, high) \