Advertisement
Guest User

Untitled

a guest
Oct 11th, 2011
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.87 KB | None | 0 0
  1. diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c
  2. index b4ecd79..7df85e9 100644
  3. --- a/apps/gui/bitmap/list.c
  4. +++ b/apps/gui/bitmap/list.c
  5. @@ -312,7 +312,7 @@ void list_draw(struct screen *display, struct gui_synclist *list)
  6. if (item_offset> item_width - (list_text_vp->width - text_pos))
  7. {
  8. /* don't scroll */
  9. - display->puts_style_xyoffset(0, line, entry_name,
  10. + display->putsxy_style_xyoffset(0, line*h, entry_name,
  11. style, item_offset, draw_offset);
  12. }
  13. else
  14. @@ -327,7 +327,7 @@ void list_draw(struct screen *display, struct gui_synclist *list)
  15. display->puts_scroll_style_xyoffset(0, line, entry_name,
  16. style, item_offset, draw_offset);
  17. else
  18. - display->puts_style_xyoffset(0, line, entry_name,
  19. + display->putsxy_style_xyoffset(0, line*h, entry_name,
  20. style, item_offset, draw_offset);
  21. }
  22. /* do the icon */
  23. diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c
  24. index f7a0888..1269398 100644
  25. --- a/apps/gui/skin_engine/skin_display.c
  26. +++ b/apps/gui/skin_engine/skin_display.c
  27. @@ -596,9 +596,10 @@ void write_line(struct screen *display, struct align_pos *format_align,
  28. else
  29. {
  30. #ifdef HAVE_LCD_BITMAP
  31. + int ypos = line * string_height;
  32. /* clear the line first */
  33. display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
  34. - display->fillrect(left_xpos, line*string_height, display->getwidth(), string_height);
  35. + display->fillrect(left_xpos, ypos, display->getwidth(), string_height);
  36. display->set_drawmode(DRMODE_SOLID);
  37. #endif
  38.  
  39. @@ -609,18 +610,18 @@ void write_line(struct screen *display, struct align_pos *format_align,
  40. /* print aligned strings */
  41. if (left_width != 0)
  42. {
  43. - display->puts_style_xyoffset(left_xpos/space_width, line,
  44. + display->putsxy_style_xyoffset(left_xpos, ypos,
  45. (unsigned char *)format_align->left, style, 0, 0);
  46.  
  47. }
  48. if (center_width != 0)
  49. {
  50. - display->puts_style_xyoffset(center_xpos/space_width, line,
  51. + display->putsxy_style_xyoffset(center_xpos, ypos,
  52. (unsigned char *)format_align->center, style, 0, 0);
  53. }
  54. if (right_width != 0)
  55. {
  56. - display->puts_style_xyoffset(right_xpos/space_width, line,
  57. + display->putsxy_style_xyoffset(right_xpos, ypos,
  58. (unsigned char *)format_align->right, style, 0, 0);
  59. }
  60. #else
  61. diff --git a/apps/plugin.h b/apps/plugin.h
  62. index e0ee951..b9d7daf 100644
  63. --- a/apps/plugin.h
  64. +++ b/apps/plugin.h
  65. @@ -147,12 +147,12 @@ void* plugin_get_buffer(size_t *buffer_size);
  66. #define PLUGIN_MAGIC 0x526F634B /* RocK */
  67.  
  68. /* increase this every time the api struct changes */
  69. -#define PLUGIN_API_VERSION 212
  70. +#define PLUGIN_API_VERSION 213
  71.  
  72. /* update this to latest version if a change to the api struct breaks
  73. backwards compatibility (and please take the opportunity to sort in any
  74. new function which are "waiting" at the end of the function table) */
  75. -#define PLUGIN_MIN_API_VERSION 210
  76. +#define PLUGIN_MIN_API_VERSION 213
  77.  
  78. /* plugin return codes */
  79. /* internal returns start at 0x100 to make exit(1..255) work */
  80. diff --git a/apps/screen_access.c b/apps/screen_access.c
  81. index 01fdebe..b8cf8fa 100644
  82. --- a/apps/screen_access.c
  83. +++ b/apps/screen_access.c
  84. @@ -186,10 +186,8 @@ struct screen screens[NB_SCREENS] =
  85. .vline=&lcd_vline,
  86. .hline=&lcd_hline,
  87. .scroll_step=&lcd_scroll_step,
  88. - .puts_style_offset=&lcd_puts_style_offset,
  89. - .puts_style_xyoffset=&lcd_puts_style_xyoffset,
  90. + .putsxy_style_xyoffset=&lcd_putsxy_style_xyoffset,
  91. .puts_scroll_style=&lcd_puts_scroll_style,
  92. - .puts_scroll_style_offset=&lcd_puts_scroll_style_offset,
  93. .puts_scroll_style_xyoffset=&lcd_puts_scroll_style_xyoffset,
  94. #endif /* HAVE_LCD_BITMAP */
  95.  
  96. @@ -205,9 +203,7 @@ struct screen screens[NB_SCREENS] =
  97. .putsxy=&lcd_putsxy,
  98. .puts=&lcd_puts,
  99. .putsf=&lcd_putsf,
  100. - .puts_offset=&lcd_puts_offset,
  101. .puts_scroll=&lcd_puts_scroll,
  102. - .puts_scroll_offset=&lcd_puts_scroll_offset,
  103. .scroll_speed=&lcd_scroll_speed,
  104. .scroll_delay=&lcd_scroll_delay,
  105. .stop_scroll=&lcd_stop_scroll,
  106. @@ -279,10 +275,8 @@ struct screen screens[NB_SCREENS] =
  107. .vline=&lcd_remote_vline,
  108. .hline=&lcd_remote_hline,
  109. .scroll_step=&lcd_remote_scroll_step,
  110. - .puts_style_offset=&lcd_remote_puts_style_offset,
  111. - .puts_style_xyoffset=&lcd_remote_puts_style_xyoffset,
  112. + .putsxy_style_xyoffset=&lcd_remote_putsxy_style_xyoffset,
  113. .puts_scroll_style=&lcd_remote_puts_scroll_style,
  114. - .puts_scroll_style_offset=&lcd_remote_puts_scroll_style_offset,
  115. .puts_scroll_style_xyoffset=&lcd_remote_puts_scroll_style_xyoffset,
  116. #endif /* 1 */
  117.  
  118. @@ -296,9 +290,7 @@ struct screen screens[NB_SCREENS] =
  119. .putsxy=&lcd_remote_putsxy,
  120. .puts=&lcd_remote_puts,
  121. .putsf=&lcd_remote_putsf,
  122. - .puts_offset=&lcd_remote_puts_offset,
  123. .puts_scroll=&lcd_remote_puts_scroll,
  124. - .puts_scroll_offset=&lcd_remote_puts_scroll_offset,
  125. .scroll_speed=&lcd_remote_scroll_speed,
  126. .scroll_delay=&lcd_remote_scroll_delay,
  127. .stop_scroll=&lcd_remote_stop_scroll,
  128. diff --git a/apps/screen_access.h b/apps/screen_access.h
  129. index 31ec34f..3c3a5eb 100644
  130. --- a/apps/screen_access.h
  131. +++ b/apps/screen_access.h
  132. @@ -78,14 +78,10 @@ struct screen
  133. int (*getfont)(void);
  134.  
  135. void (*scroll_step)(int pixels);
  136. - void (*puts_style_offset)(int x, int y, const unsigned char *str,
  137. - int style, int x_offset);
  138. - void (*puts_style_xyoffset)(int x, int y, const unsigned char *str,
  139. + void (*putsxy_style_xyoffset)(int x, int y, const unsigned char *str,
  140. int style, int x_offset, int y_offset);
  141. void (*puts_scroll_style)(int x, int y, const unsigned char *string,
  142. int style);
  143. - void (*puts_scroll_style_offset)(int x, int y, const unsigned char *string,
  144. - int style, int x_offset);
  145. void (*puts_scroll_style_xyoffset)(int x, int y, const unsigned char *string,
  146. int style, int x_offset, int y_offset);
  147. void (*mono_bitmap)(const unsigned char *src,
  148. @@ -139,10 +135,7 @@ struct screen
  149. void (*putsxy)(int x, int y, const unsigned char *str);
  150. void (*puts)(int x, int y, const unsigned char *str);
  151. void (*putsf)(int x, int y, const unsigned char *str, ...);
  152. - void (*puts_offset)(int x, int y, const unsigned char *str, int offset);
  153. void (*puts_scroll)(int x, int y, const unsigned char *string);
  154. - void (*puts_scroll_offset)(int x, int y, const unsigned char *string,
  155. - int x_offset);
  156. void (*scroll_speed)(int speed);
  157. void (*scroll_delay)(int ms);
  158. void (*stop_scroll)(void);
  159. diff --git a/firmware/drivers/lcd-bitmap-common.c b/firmware/drivers/lcd-bitmap-common.c
  160. index fc84fdd..fea17d7 100644
  161. --- a/firmware/drivers/lcd-bitmap-common.c
  162. +++ b/firmware/drivers/lcd-bitmap-common.c
  163. @@ -306,29 +306,26 @@ static void LCDFN(putsxyofs_style)(int xpos, int ypos,
  164. /*** Line oriented text output ***/
  165.  
  166. /* put a string at a given char position */
  167. -void LCDFN(puts_style_xyoffset)(int x, int y, const unsigned char *str,
  168. +void LCDFN(putsxy_style_xyoffset)(int x, int y, const unsigned char *str,
  169. int style, int x_offset, int y_offset)
  170. {
  171. int xpos, ypos, w, h;
  172. - LCDFN(scroll_stop_line)(current_vp, y);
  173. + LCDFN(getstringsize)(" ", NULL, &h);
  174. + LCDFN(scroll_stop_line)(current_vp, y/h);
  175. if(!str)
  176. return;
  177.  
  178. LCDFN(getstringsize)(str, &w, &h);
  179. - xpos = x * LCDFN(getstringsize)(" ", NULL, NULL);
  180. - ypos = y * h + y_offset;
  181. + xpos = x;
  182. + ypos = y + y_offset;
  183. LCDFN(putsxyofs_style)(xpos, ypos, str, style, w, h, x_offset);
  184. }
  185.  
  186. -void LCDFN(puts_style_offset)(int x, int y, const unsigned char *str,
  187. - int style, int x_offset)
  188. -{
  189. - LCDFN(puts_style_xyoffset)(x, y, str, style, x_offset, 0);
  190. -}
  191. -
  192. void LCDFN(puts)(int x, int y, const unsigned char *str)
  193. {
  194. - LCDFN(puts_style_offset)(x, y, str, STYLE_DEFAULT, 0);
  195. + int w, h;
  196. + LCDFN(getstringsize)(" ", &w, &h);
  197. + LCDFN(putsxyofs)(x*w, y*h, 0, str);
  198. }
  199.  
  200. /* Formatting version of LCDFN(puts) */
  201. @@ -344,17 +341,14 @@ void LCDFN(putsf)(int x, int y, const unsigned char *fmt, ...)
  202.  
  203. void LCDFN(puts_style)(int x, int y, const unsigned char *str, int style)
  204. {
  205. - LCDFN(puts_style_offset)(x, y, str, style, 0);
  206. -}
  207. -
  208. -void LCDFN(puts_offset)(int x, int y, const unsigned char *str, int offset)
  209. -{
  210. - LCDFN(puts_style_offset)(x, y, str, STYLE_DEFAULT, offset);
  211. + int w, h;
  212. + LCDFN(getstringsize)(" ", &w, &h);
  213. + LCDFN(putsxy_style_xyoffset)(x*w, y*h, str, style, 0, 0);
  214. }
  215.  
  216. /*** scrolling ***/
  217.  
  218. -void LCDFN(puts_scroll_style_xyoffset)(int x, int y, const unsigned char *string,
  219. +void LCDFN(putsxy_scroll_style_xyoffset)(int x, int y, const unsigned char *string,
  220. int style, int x_offset, int y_offset)
  221. {
  222. struct scrollinfo* s;
  223. @@ -366,12 +360,13 @@ void LCDFN(puts_scroll_style_xyoffset)(int x, int y, const unsigned char *string
  224. return;
  225.  
  226. /* remove any previously scrolling line at the same location */
  227. - LCDFN(scroll_stop_line)(current_vp, y);
  228. + LCDFN(getstringsize)(" ", NULL, &h);
  229. + LCDFN(scroll_stop_line)(current_vp, y/h);
  230.  
  231. if (LCDFN(scroll_info).lines >= LCDM(SCROLLABLE_LINES)) return;
  232. if (!string)
  233. return;
  234. - LCDFN(puts_style_xyoffset)(x, y, string, style, x_offset, y_offset);
  235. + LCDFN(putsxy_style_xyoffset)(x, y, string, style, x_offset, y_offset);
  236.  
  237. LCDFN(getstringsize)(string, &w, &h);
  238.  
  239. @@ -410,7 +405,7 @@ void LCDFN(puts_scroll_style_xyoffset)(int x, int y, const unsigned char *string
  240. s->vp = current_vp;
  241. s->y = y;
  242. s->offset = x_offset;
  243. - s->startx = x * LCDFN(getstringsize)(" ", NULL, NULL);
  244. + s->startx = x;
  245. s->y_offset = y_offset;
  246. s->backward = false;
  247.  
  248. @@ -425,13 +420,7 @@ void LCDFN(puts_scroll)(int x, int y, const unsigned char *string)
  249. void LCDFN(puts_scroll_style)(int x, int y, const unsigned char *string,
  250. int style)
  251. {
  252. - LCDFN(puts_scroll_style_offset)(x, y, string, style, 0);
  253. -}
  254. -
  255. -void LCDFN(puts_scroll_offset)(int x, int y, const unsigned char *string,
  256. - int offset)
  257. -{
  258. - LCDFN(puts_scroll_style_offset)(x, y, string, STYLE_DEFAULT, offset);
  259. + LCDFN(puts_scroll_style_xyoffset)(x, y, string, style, 0, 0);
  260. }
  261.  
  262. void LCDFN(scroll_fn)(void)
  263. @@ -495,9 +484,3 @@ void LCDFN(scroll_fn)(void)
  264. }
  265. LCDFN(set_viewport)(old_vp);
  266. }
  267. -
  268. -void LCDFN(puts_scroll_style_offset)(int x, int y, const unsigned char *string,
  269. - int style, int x_offset)
  270. -{
  271. - LCDFN(puts_scroll_style_xyoffset)(x, y, string, style, x_offset, 0);
  272. -}
  273. diff --git a/firmware/export/lcd-remote.h b/firmware/export/lcd-remote.h
  274. index e2f2ab1..46dba7e 100644
  275. --- a/firmware/export/lcd-remote.h
  276. +++ b/firmware/export/lcd-remote.h
  277. @@ -124,11 +124,7 @@ extern void lcd_remote_puts(int x, int y, const unsigned char *str);
  278. extern void lcd_remote_putsf(int x, int y, const unsigned char *fmt, ...);
  279. extern void lcd_remote_puts_style(int x, int y, const unsigned char *str,
  280. int style);
  281. -extern void lcd_remote_puts_offset(int x, int y, const unsigned char *str,
  282. - int offset);
  283. -extern void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str,
  284. - int style, int offset);
  285. -extern void lcd_remote_puts_style_xyoffset(int x, int y, const unsigned char *str,
  286. +extern void lcd_remote_putsxy_style_xyoffset(int x, int y, const unsigned char *str,
  287. int style, int x_offset, int y_offset);
  288. extern void lcd_remote_putc(int x, int y, unsigned short ch);
  289. extern void lcd_remote_stop_scroll(void);
  290. @@ -137,11 +133,6 @@ extern void lcd_remote_scroll_delay(int ms);
  291. extern void lcd_remote_puts_scroll(int x, int y, const unsigned char *str);
  292. extern void lcd_remote_puts_scroll_style(int x, int y, const unsigned char *str,
  293. int style);
  294. -extern void lcd_remote_puts_scroll_offset(int x, int y,
  295. - const unsigned char *str, int offset);
  296. -extern void lcd_remote_puts_scroll_style_offset(int x, int y,
  297. - const unsigned char *string,
  298. - int style, int offset);
  299. extern void lcd_remote_puts_scroll_style_xyoffset(int x, int y,
  300. const unsigned char *string,
  301. int style, int x_offset,
  302. diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
  303. index e6e19b1..4d5d050 100644
  304. --- a/firmware/export/lcd.h
  305. +++ b/firmware/export/lcd.h
  306. @@ -197,9 +197,6 @@ extern void lcd_putsxy_style_offset(int x, int y, const unsigned char *str,
  307. extern void lcd_puts(int x, int y, const unsigned char *string);
  308. extern void lcd_putsf(int x, int y, const unsigned char *fmt, ...);
  309. extern void lcd_puts_style(int x, int y, const unsigned char *string, int style);
  310. -extern void lcd_puts_offset(int x, int y, const unsigned char *str, int offset);
  311. -extern void lcd_puts_scroll_offset(int x, int y, const unsigned char *string,
  312. - int offset);
  313. extern void lcd_putc(int x, int y, unsigned long ucs);
  314. extern void lcd_stop_scroll(void);
  315. extern void lcd_bidir_scroll(int threshold);
  316. @@ -481,12 +478,8 @@ extern int lcd_get_drawmode(void);
  317. extern void lcd_setfont(int font);
  318. extern int lcd_getfont(void);
  319.  
  320. -extern void lcd_puts_style_offset(int x, int y, const unsigned char *str,
  321. - int style, int x_offset);
  322. -extern void lcd_puts_style_xyoffset(int x, int y, const unsigned char *str,
  323. +extern void lcd_putsxy_style_xyoffset(int x, int y, const unsigned char *str,
  324. int style, int x_offset, int y_offset);
  325. -extern void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string,
  326. - int style, int x_offset);
  327. extern void lcd_puts_scroll_style_xyoffset(int x, int y, const unsigned char *string,
  328. int style, int x_offset, int y_offset);
  329.  
  330.  
  331.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement