Advertisement
Guest User

Untitled

a guest
Apr 16th, 2010
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. Index: apps/gui/skin_engine/skin_parser.c
  2. ===================================================================
  3. --- apps/gui/skin_engine/skin_parser.c (revision 25643)
  4. +++ apps/gui/skin_engine/skin_parser.c (working copy)
  5. @@ -202,7 +202,7 @@
  6. { WPS_TOKEN_ALIGN_RIGHT_RTL, "aR", 0, NULL },
  7. { WPS_NO_TOKEN, "ax", 0, parse_languagedirection },
  8.  
  9. - { WPS_TOKEN_BATTERY_PERCENT, "bl", WPS_REFRESH_DYNAMIC, NULL },
  10. + { WPS_TOKEN_BATTERY_PERCENT, "bl", WPS_REFRESH_DYNAMIC, parse_progressbar },
  11. { WPS_TOKEN_BATTERY_VOLTS, "bv", WPS_REFRESH_DYNAMIC, NULL },
  12. { WPS_TOKEN_BATTERY_TIME, "bt", WPS_REFRESH_DYNAMIC, NULL },
  13. { WPS_TOKEN_BATTERY_SLEEPTIME, "bs", WPS_REFRESH_DYNAMIC, NULL },
  14. @@ -1164,7 +1164,7 @@
  15. pb->width = vp->width;
  16. pb->height = SYSFONT_HEIGHT-2;
  17. pb->y = -line_num - 1; /* Will be computed during the rendering */
  18. - if (token->type == WPS_TOKEN_VOLUME)
  19. + if (token->type == WPS_TOKEN_VOLUME || token->type == WPS_TOKEN_BATTERY_PERCENT)
  20. return 0; /* dont add it, let the regular token handling do the work */
  21. add_to_ll_chain(&wps_data->progressbars, item);
  22. return 0;
  23. @@ -1224,6 +1224,8 @@
  24. add_to_ll_chain(&wps_data->progressbars, item);
  25. if (token->type == WPS_TOKEN_VOLUME)
  26. token->type = WPS_TOKEN_VOLUMEBAR;
  27. + else if (token->type == WPS_TOKEN_BATTERY_PERCENT)
  28. + token->type = WPS_TOKEN_BATTERY_PERCENTBAR;
  29. pb->type = token->type;
  30.  
  31. return ptr+1-wps_bufptr;
  32. Index: apps/gui/skin_engine/skin_display.c
  33. ===================================================================
  34. --- apps/gui/skin_engine/skin_display.c (revision 25643)
  35. +++ apps/gui/skin_engine/skin_display.c (working copy)
  36. @@ -145,6 +145,11 @@
  37. length = maxvol-minvol;
  38. elapsed = global_settings.volume-minvol;
  39. }
  40. + else if (pb->type == WPS_TOKEN_BATTERY_PERCENTBAR)
  41. + {
  42. + length = 100;
  43. + elapsed = battery_level();
  44. + }
  45. else if (id3 && id3->length)
  46. {
  47. length = id3->length;
  48. Index: apps/gui/skin_engine/skin_tokens.h
  49. ===================================================================
  50. --- apps/gui/skin_engine/skin_tokens.h (revision 25643)
  51. +++ apps/gui/skin_engine/skin_tokens.h (working copy)
  52. @@ -59,6 +59,7 @@
  53. /* Battery */
  54. TOKEN_MARKER_BATTERY,
  55. WPS_TOKEN_BATTERY_PERCENT,
  56. + WPS_TOKEN_BATTERY_PERCENTBAR,
  57. WPS_TOKEN_BATTERY_VOLTS,
  58. WPS_TOKEN_BATTERY_TIME,
  59. WPS_TOKEN_BATTERY_CHARGER_CONNECTED,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement