Guest User

Untitled

a guest
Feb 25th, 2010
230
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Index: apps/gui/bitmap/list.c
  2. ===================================================================
  3. --- apps/gui/bitmap/list.c (revision 24916)
  4. +++ apps/gui/bitmap/list.c (working copy)
  5. -40,6 +40,7 @@
  6. #include "sound.h"
  7. #include "misc.h"
  8. #include "viewport.h"
  9. +#include "statusbar-skinned.h"
  10.  
  11. #define ICON_PADDING 1
  12.  
  13. -82,6 +83,8 @@
  14. int style = STYLE_DEFAULT;
  15. struct viewport *title_text_vp = &title_text[screen];
  16.  
  17. + if (sb_set_title_text(list->title, list->title_icon, screen))
  18. + return false; /* the sbs is handling the title */
  19. display->scroll_stop(title_text_vp);
  20. if (!list_display_title(list, screen))
  21. return false;
  22. Index: apps/gui/statusbar-skinned.c
  23. ===================================================================
  24. --- apps/gui/statusbar-skinned.c (revision 24916)
  25. +++ apps/gui/statusbar-skinned.c (working copy)
  26. -33,6 +33,7 @@
  27. #include "statusbar-skinned.h"
  28. #include "debug.h"
  29. #include "font.h"
  30. +#include "icon.h"
  31.  
  32.  
  33. /* currently only one wps_state is needed */
  34. -44,6 +45,25 @@
  35. /* initial setup of wps_data */
  36. static int update_delay = DEFAULT_UPDATE_DELAY;
  37.  
  38. +bool sb_set_title_text(char* title, enum themable_icons icon, enum screen_type screen)
  39. +{
  40. + int i;
  41. + bool retval = false;
  42. + for(i=0; i<sb_skin_data[screen].num_tokens; i++)
  43. + {
  44. + if (sb_skin_data[screen].tokens[i].type == WPS_TOKEN_LIST_TITLE_TEXT)
  45. + {
  46. + sb_skin_data[screen].tokens[i].value.data = title;
  47. + retval = true;
  48. + }
  49. + else if (sb_skin_data[screen].tokens[i].type == WPS_TOKEN_LIST_TITLE_ICON)
  50. + {
  51. + sb_skin_data[screen].tokens[i].value.i = icon;
  52. + }
  53. + }
  54. + return retval;
  55. +}
  56. +
  57.  
  58. void sb_skin_data_load(enum screen_type screen, const char *buf, bool isfile)
  59. {
  60. Index: apps/gui/statusbar-skinned.h
  61. ===================================================================
  62. --- apps/gui/statusbar-skinned.h (revision 24916)
  63. +++ apps/gui/statusbar-skinned.h (working copy)
  64. -29,6 +29,7 @@
  65. #include <string.h>
  66. #include <stdlib.h>
  67. #include "config.h"
  68. +#include "icon.h"
  69.  
  70.  
  71. void sb_skin_data_load(enum screen_type screen, const char *buf, bool isfile);
  72. -39,6 +40,7 @@
  73. void sb_skin_update(enum screen_type screen, bool force);
  74.  
  75. void sb_skin_set_update_delay(int delay);
  76. +bool sb_set_title_text(char* title, enum themable_icons icon, enum screen_type screen);
  77.  
  78. #if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)
  79. char* sb_get_backdrop(enum screen_type screen);
  80. Index: apps/gui/skin_engine/skin_parser.c
  81. ===================================================================
  82. --- apps/gui/skin_engine/skin_parser.c (revision 24916)
  83. +++ apps/gui/skin_engine/skin_parser.c (working copy)
  84. -366,6 +366,8 @@
  85. parse_viewport_display },
  86. #ifdef HAVE_LCD_BITMAP
  87. { WPS_VIEWPORT_CUSTOMLIST, "Vp", WPS_REFRESH_STATIC, parse_playlistview },
  88. + { WPS_TOKEN_LIST_TITLE_TEXT, "Lt", WPS_REFRESH_DYNAMIC, NULL },
  89. + { WPS_TOKEN_LIST_TITLE_ICON, "Li", WPS_REFRESH_DYNAMIC, NULL },
  90. #endif
  91. { WPS_NO_TOKEN, "V", 0, parse_viewport },
  92.  
  93. Index: apps/gui/skin_engine/skin_tokens.c
  94. ===================================================================
  95. --- apps/gui/skin_engine/skin_tokens.c (revision 24916)
  96. +++ apps/gui/skin_engine/skin_tokens.c (working copy)
  97. -416,6 +416,14 @@
  98. case WPS_TOKEN_PLAYLIST_ENTRIES:
  99. snprintf(buf, buf_size, "%d", playlist_amount());
  100. return buf;
  101. +
  102. + case WPS_TOKEN_LIST_TITLE_TEXT:
  103. + return (char*)token->value.data;
  104. + case WPS_TOKEN_LIST_TITLE_ICON:
  105. + if (intval)
  106. + *intval = token->value.i;
  107. + snprintf(buf, buf_size, "%d", token->value.i);
  108. + return buf;
  109.  
  110. case WPS_TOKEN_PLAYLIST_NAME:
  111. return playlist_name(NULL, buf, buf_size);
  112. Index: apps/gui/skin_engine/skin_tokens.h
  113. ===================================================================
  114. --- apps/gui/skin_engine/skin_tokens.h (revision 24916)
  115. +++ apps/gui/skin_engine/skin_tokens.h (working copy)
  116. -189,6 +189,8 @@
  117.  
  118. /* buttons */
  119. TOKEN_MARKER_MISC,
  120. + WPS_TOKEN_LIST_TITLE_TEXT,
  121. + WPS_TOKEN_LIST_TITLE_ICON,
  122. WPS_TOKEN_BUTTON_VOLUME,
  123. WPS_TOKEN_LASTTOUCH,
  124. #if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
  125. Index: apps/gui/list.c
  126. ===================================================================
  127. --- apps/gui/list.c (revision 24916)
  128. +++ apps/gui/list.c (working copy)
  129. -39,6 +39,7 @@
  130. #include "talk.h"
  131. #include "viewport.h"
  132. #include "appevents.h"
  133. +#include "statusbar-skinned.h"
  134.  
  135. /* The minimum number of pending button events in queue before starting
  136. * to limit list drawing interval.
  137. -397,8 +398,12 @@
  138. void gui_synclist_set_title(struct gui_synclist * gui_list,
  139. char * title, enum themable_icons icon)
  140. {
  141. + int i;
  142. gui_list->title = title;
  143. gui_list->title_icon = icon;
  144. + FOR_NB_SCREENS(i)
  145. + sb_set_title_text(title, icon, i);
  146. + send_event(GUI_EVENT_ACTIONUPDATE, (void*)1);
  147. }
  148.  
  149. void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items)
  150. -550,7 +555,6 @@
  151. #else
  152. static int next_item_modifier = 1;
  153. static int last_accel_tick = 0;
  154. -
  155. if (global_settings.list_accel_start_delay)
  156. {
  157. int start_delay = global_settings.list_accel_start_delay * (HZ/2);
  158. Index: apps/menu.c
  159. ===================================================================
  160. --- apps/menu.c (revision 24916)
  161. +++ apps/menu.c (working copy)
  162. -28,6 +28,7 @@
  163. #include "config.h"
  164. #include "system.h"
  165.  
  166. +#include "appevents.h"
  167. #include "lcd.h"
  168. #include "font.h"
  169. #include "file.h"
  170. -364,7 +365,7 @@
  171.  
  172. /* if hide_theme is true, assume parent has been fixed before passed into
  173. * this function, e.g. with viewport_set_defaults(parent, screen) */
  174. - init_menu_lists(menu, &lists, selected, true, parent);
  175. + init_menu_lists(menu, &lists, selected, true, parent);
  176. vps = *(lists.parent);
  177. in_stringlist = ((menu->flags&MENU_TYPE_MASK) == MT_RETURN_ID);
  178. /* load the callback, and only reload it if menu changes */
  179. -604,6 +605,7 @@
  180. case MT_SETTING_W_TEXT:
  181. {
  182. do_setting_from_menu(temp, vps);
  183. + send_event(GUI_EVENT_ACTIONUPDATE, (void*)1); /* force a redraw */
  184. break;
  185. }
  186. case MT_RETURN_ID:
RAW Paste Data