summaryrefslogtreecommitdiff
path: root/apps/gui/list.h
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2011-09-06 13:49:41 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2011-09-06 13:49:41 +0000
commit9b6ac01c7b55691b62aab15c3302a46f61972197 (patch)
tree8868026c013cddc6c6722597724006eef911c554 /apps/gui/list.h
parent77a82ad56ab8aa923f47c908ac10b167c8051cf3 (diff)
downloadrockbox-9b6ac01c7b55691b62aab15c3302a46f61972197.tar.gz
rockbox-9b6ac01c7b55691b62aab15c3302a46f61972197.zip
Lists can now be completly draw using the skin engine!
due to lack of user feedback the actual tags may change, hopefully not though. The way it works is the skin specifies a rectangle and a viewport label. For each item in the list that is being displayed all viewports with the specified label are drawn. However, instead of the viewport x/y position being offset from the top left corner like normal they are offset from the rectangle position in the list (so think of them as child-viewports of the rectangle which moves). Normally the rectangle will move down the screen to show a normal list, this can be changed to move across the screen in a grid pattern. The UI viewport is used to bound the items (i.e %Vi() ) Scrolling is completly disabled in all items except the currently selected item. This works well in combination with the %cs tag to show differently styled lists based on the current screen :) New tags: %LT - Get the current items text %LI - Get the current items icon number %Lc - Use as a conditional to determine if the current item is the selected item %LB - BAR TAG to show the scroll bar, params/options like other bar types. It still needs a bit of work though. Use as a conditional to find out if the bar is actually needed %Lb(viewport, width, height [,tile]) - specify the viewport label to draw for each item and the size of each item. if the last param is 'tile' it will form a grid instead of a list example.sbs: %?cs<%Lb(a,100,20)|> %V(0,0,10,-,1)%Vf(aabbcc) %?LB<%LB(0,0,10,185, invert)> %Vi(-,10,0,-,-35,1) %Vl(a,5,5,160,12,1) %s%?Lc<%Vg(00ffaa, ff0000, 000000)%Vs(gradient)%>%>%>%ac>zzzzzzz %LT zzzzz%s%?Lc<%ar%<%<%<> %V(0,185,-,-,1) %s%LT git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30461 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/list.h')
-rw-r--r--apps/gui/list.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/apps/gui/list.h b/apps/gui/list.h
index 38d7e95f8d..b54e7d7f5b 100644
--- a/apps/gui/list.h
+++ b/apps/gui/list.h
@@ -25,6 +25,7 @@
25#include "config.h" 25#include "config.h"
26#include "icon.h" 26#include "icon.h"
27#include "screen_access.h" 27#include "screen_access.h"
28#include "skin_engine/skin_engine.h"
28 29
29#define SCROLLBAR_WIDTH global_settings.scrollbar_width 30#define SCROLLBAR_WIDTH global_settings.scrollbar_width
30 31
@@ -173,6 +174,27 @@ extern bool gui_synclist_item_is_onscreen(struct gui_synclist *lists,
173extern bool gui_synclist_do_button(struct gui_synclist * lists, 174extern bool gui_synclist_do_button(struct gui_synclist * lists,
174 int *action, 175 int *action,
175 enum list_wrap); 176 enum list_wrap);
177#if defined(HAVE_LCD_BITMAP) && !defined(PLUGIN)
178struct listitem_viewport_cfg {
179 struct wps_data *data;
180 char* label;
181 int width;
182 int height;
183 int xmargin;
184 int ymargin;
185 bool tile;
186 struct skin_viewport selected_item_vp;
187};
188bool skinlist_draw(struct screen *display, struct gui_synclist *list);
189bool skinlist_is_selected_item(void);
190void skinlist_set_cfg(enum screen_type screen,
191 struct listitem_viewport_cfg *cfg);
192const char* skinlist_get_item_text(void);
193enum themable_icons skinlist_get_item_icon(void);
194bool skinlist_needs_scrollbar(enum screen_type screen);
195void skinlist_get_scrollbar(int* nb_item, int* first_shown, int* last_shown);
196int skinlist_get_line_count(enum screen_type screen, struct gui_synclist *list);
197#endif
176 198
177#if defined(HAVE_TOUCHSCREEN) 199#if defined(HAVE_TOUCHSCREEN)
178/* this needs to be fixed if we ever get more than 1 touchscreen on a target */ 200/* this needs to be fixed if we ever get more than 1 touchscreen on a target */