FS#12273 - use buflib for font storage. thanks to the testers :)
[maemo-rb.git] / apps / gui / skin_engine / skin_engine.h
blob310411bb1de030f49b183f923c3fd8f96910984e
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2007 Nicolas Pennequin
11 * Copyright (C) 2009 Jonathan Gordon
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.
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
21 ****************************************************************************/
23 #ifndef _SKIN_ENGINE_H
24 #define _SKIN_ENGINE_H
26 #ifndef PLUGIN
28 #include "tag_table.h"
30 #include "wps_internals.h" /* TODO: remove this line.. shoudlnt be needed */
32 enum skinnable_screens {
33 CUSTOM_STATUSBAR,
34 WPS,
35 #if CONFIG_TUNER
36 FM_SCREEN,
37 #endif
40 SKINNABLE_SCREENS_COUNT
44 #ifdef HAVE_LCD_BITMAP
46 #define SKIN_BUFFER_SIZE (WPS_MAX_TOKENS * \
47 (sizeof(struct wps_token) + (sizeof(struct skin_element))))
48 #endif
50 #ifdef HAVE_LCD_CHARCELLS
51 #define SKIN_BUFFER_SIZE (LCD_HEIGHT * LCD_WIDTH) * 64 + \
52 (WPS_MAX_TOKENS * \
53 (sizeof(struct wps_token) + (sizeof(struct skin_element))))
54 #endif
57 #ifdef HAVE_TOUCHSCREEN
58 int skin_get_touchaction(struct wps_data *data, int* edge_offset,
59 struct touchregion **retregion);
60 void skin_disarm_touchregions(struct wps_data *data);
61 #endif
63 /* Do a update_type update of the skinned screen */
64 void skin_update(enum skinnable_screens skin, enum screen_type screen,
65 unsigned int update_type);
68 * setup up the skin-data from a format-buffer (isfile = false)
69 * or from a skinfile (isfile = true)
71 bool skin_data_load(enum screen_type screen, struct wps_data *wps_data,
72 const char *buf, bool isfile);
74 /* call this in statusbar toggle handlers if needed */
75 void skin_statusbar_changed(struct gui_wps*);
77 bool skin_has_sbs(enum screen_type screen, struct wps_data *data);
80 /* load a backdrop into the skin buffer.
81 * reuse buffers if the file is already loaded */
82 char* skin_backdrop_load(char* backdrop, char *bmpdir, enum screen_type screen);
83 void skin_backdrop_init(void);
84 int skin_backdrop_assign(char* backdrop, char *bmpdir,
85 enum screen_type screen);
86 bool skin_backdrops_preload(void);
87 void skin_backdrop_show(int backdrop_id);
88 void skin_backdrop_load_setting(void);
89 void skin_backdrop_unload(int backdrop_id);
91 /* do the button loop as often as required for the peak meters to update
92 * with a good refresh rate.
93 * gwps is really gwps[NB_SCREENS]! don't wrap this in FOR_NB_SCREENS()
95 int skin_wait_for_action(enum skinnable_screens skin, int context, int timeout);
97 void skin_load(enum skinnable_screens skin, enum screen_type screen,
98 const char *buf, bool isfile);
99 struct gui_wps *skin_get_gwps(enum skinnable_screens skin, enum screen_type screen);
100 struct wps_state *skin_get_global_state(void);
101 void gui_sync_skin_init(void);
104 bool skin_do_full_update(enum skinnable_screens skin, enum screen_type screen);
105 void skin_request_full_update(enum skinnable_screens skin);
107 #endif /* !PLUGIN */
108 #endif