diff options
Diffstat (limited to 'apps/plugins/lib/gray_position_display.c')
-rw-r--r-- | apps/plugins/lib/gray_position_display.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/apps/plugins/lib/gray_position_display.c b/apps/plugins/lib/gray_position_display.c new file mode 100644 index 0000000000..4ec13ee730 --- /dev/null +++ b/apps/plugins/lib/gray_position_display.c | |||
@@ -0,0 +1,57 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Grayscale framework | ||
11 | * gray_position_display() function | ||
12 | * | ||
13 | * This is a generic framework to use grayscale display within Rockbox | ||
14 | * plugins. It obviously does not work for the player. | ||
15 | * | ||
16 | * Copyright (C) 2004 Jens Arnold | ||
17 | * | ||
18 | * All files in this archive are subject to the GNU General Public License. | ||
19 | * See the file COPYING in the source tree root for full license agreement. | ||
20 | * | ||
21 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
22 | * KIND, either express or implied. | ||
23 | * | ||
24 | ****************************************************************************/ | ||
25 | |||
26 | #ifndef SIMULATOR /* not for simulator by now */ | ||
27 | #include "plugin.h" | ||
28 | |||
29 | #ifdef HAVE_LCD_BITMAP /* and also not for the Player */ | ||
30 | #include "gray.h" | ||
31 | |||
32 | /*--------------------------------------------------------------------------- | ||
33 | Set position of the top left corner of the grayscale overlay | ||
34 | ---------------------------------------------------------------------------- | ||
35 | x = left margin in pixels | ||
36 | by = top margin in 8-pixel units | ||
37 | |||
38 | You may set this in a way that the overlay spills across the right or | ||
39 | bottom display border. In this case it will simply be clipped by the | ||
40 | LCD controller. You can even set negative values, this will clip at the | ||
41 | left or top border. I did not test it, but the limits may be +127 / -128 | ||
42 | |||
43 | If you use this while the grayscale overlay is running, the now-freed area | ||
44 | will be restored. | ||
45 | */ | ||
46 | void gray_position_display(int x, int by) | ||
47 | { | ||
48 | _graybuf->x = x; | ||
49 | _graybuf->by = by; | ||
50 | |||
51 | if (_graybuf->flags & _GRAY_RUNNING) | ||
52 | _graybuf->flags |= _GRAY_DEFERRED_UPDATE; | ||
53 | } | ||
54 | |||
55 | #endif // #ifdef HAVE_LCD_BITMAP | ||
56 | #endif // #ifndef SIMULATOR | ||
57 | |||