rockbox/apps/gui/skin_engine/skin_buffer.h
Jonathan Gordon 18a8e529b5 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
2009-08-16 18:23:00 +00:00

51 lines
1.8 KiB
C

/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id: wps_parser.c 19880 2009-01-29 20:49:43Z mcuelenaere $
*
* Copyright (C) 2002 by Linus Nielsen Feltzing
* Copyright (C) 2009 Jonathan Gordon
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef _SKIN_BUFFER_H_
#define _SKIN_BUFFER_H_
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
/* int the global buffer */
void skin_buffer_init(void);
/* get the number of bytes currently being used */
size_t skin_buffer_usage(void);
/* Allocate size bytes from the buffer */
void* skin_buffer_alloc(size_t size);
/* Get a pointer to the skin buffer and the count of how much is free
* used to do your own buffer management.
* Any memory used will be overwritten next time wps_buffer_alloc()
* is called unless skin_buffer_increment() is called first
*/
void* skin_buffer_grab(size_t *freespace);
/* Use after skin_buffer_grab() to specify how much buffer was used */
void skin_buffer_increment(size_t used);
#endif /* _SKIN_BUFFER_H_ */