diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2009-08-16 18:23:00 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2009-08-16 18:23:00 +0000 |
commit | 18a8e529b5d14413dce83cdb9103f3426db10708 (patch) | |
tree | 5ac9e53a987b6a48c92281b32aba9b6ca9bcab08 /apps/gui/skin_engine/skin_buffer.h | |
parent | eefe832785407c387e71aba476091e805eecc3f4 (diff) | |
download | rockbox-18a8e529b5d14413dce83cdb9103f3426db10708.tar.gz rockbox-18a8e529b5d14413dce83cdb9103f3426db10708.zip |
more wps->skin engine work..
start redoing memory management in the skins to use a single larger buffer instead of lots of arrays for things like images and progressbars.
This commit removes the limit on the amount of progressbars allowed on the screen, still 1 per viewport, but unlimited otherwise(!)
Also a larger buffer for remote targets, same size for non-remote targets but very easy to make it bigger (technically removed the 52(?) image limit in skins, except still limited to 1 char identifiers)
Unlimited "string" tokens now (limit was 1024 which was rediculously wasteful)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22350 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/skin_engine/skin_buffer.h')
-rw-r--r-- | apps/gui/skin_engine/skin_buffer.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/apps/gui/skin_engine/skin_buffer.h b/apps/gui/skin_engine/skin_buffer.h new file mode 100644 index 0000000000..779f575689 --- /dev/null +++ b/apps/gui/skin_engine/skin_buffer.h | |||
@@ -0,0 +1,51 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id: wps_parser.c 19880 2009-01-29 20:49:43Z mcuelenaere $ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Linus Nielsen Feltzing | ||
11 | * Copyright (C) 2009 Jonathan Gordon | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or | ||
14 | * modify it under the terms of the GNU General Public License | ||
15 | * as published by the Free Software Foundation; either version 2 | ||
16 | * of the License, or (at your option) any later version. | ||
17 | * | ||
18 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
19 | * KIND, either express or implied. | ||
20 | * | ||
21 | ****************************************************************************/ | ||
22 | |||
23 | #ifndef _SKIN_BUFFER_H_ | ||
24 | #define _SKIN_BUFFER_H_ | ||
25 | |||
26 | |||
27 | #include <stdio.h> | ||
28 | #include <string.h> | ||
29 | #include <stdlib.h> | ||
30 | |||
31 | /* int the global buffer */ | ||
32 | void skin_buffer_init(void); | ||
33 | |||
34 | /* get the number of bytes currently being used */ | ||
35 | size_t skin_buffer_usage(void); | ||
36 | |||
37 | /* Allocate size bytes from the buffer */ | ||
38 | void* skin_buffer_alloc(size_t size); | ||
39 | |||
40 | |||
41 | /* Get a pointer to the skin buffer and the count of how much is free | ||
42 | * used to do your own buffer management. | ||
43 | * Any memory used will be overwritten next time wps_buffer_alloc() | ||
44 | * is called unless skin_buffer_increment() is called first | ||
45 | */ | ||
46 | void* skin_buffer_grab(size_t *freespace); | ||
47 | |||
48 | /* Use after skin_buffer_grab() to specify how much buffer was used */ | ||
49 | void skin_buffer_increment(size_t used); | ||
50 | |||
51 | #endif /* _SKIN_BUFFER_H_ */ | ||