Advertisement
Guest User

Untitled

a guest
Feb 17th, 2010
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. switch (viewer->lines[line].tokens[j])
  2. {
  3. case WPS_TOKEN_ALIGN_CENTER:
  4. case WPS_TOKEN_ALIGN_LEFT:
  5. case WPS_TOKEN_ALIGN_LEFT_RTL:
  6. case WPS_TOKEN_ALIGN_RIGHT:
  7. case WPS_TOKEN_ALIGN_RIGHT_RTL:
  8. alignment = viewer->lines[line].tokens[j];
  9. break;
  10. case WPS_TOKEN_STRING:
  11. case WPS_TOKEN_CHARACTER:
  12. snprintf(tempbuf, sizeof(tempbuf), "%s",
  13. viewer->lines[line].strings[cur_string]);
  14. cur_string++;
  15. break;
  16. case WPS_TOKEN_PLAYLIST_POSITION:
  17. snprintf(tempbuf, sizeof(tempbuf), "%d", i);
  18. break;
  19. case WPS_TOKEN_FILE_NAME:
  20. get_dir(tempbuf, sizeof(tempbuf), filename, 0);
  21. break;
  22. case WPS_TOKEN_FILE_PATH:
  23. snprintf(tempbuf, sizeof(tempbuf), "%s", filename);
  24. break;
  25. default:
  26. tempbuf[0] = '\0';
  27. break;
  28. }
  29. if (tempbuf[0])
  30. {
  31. snprintf(&buf[buf_used], sizeof(buf)-buf_used, "%s", tempbuf);
  32. buf_used += strlen(tempbuf);
  33. }
  34. j++;
  35. }
  36.  
  37. if (viewer->lines[line].scroll)
  38. {
  39. gwps->display->puts_scroll(0, (i-start_item), buf );
  40. }
  41. else
  42. {
  43. int vpwidth = viewer->vp->width;
  44. length = gwps->display->getstringsize(bufm NULL, NULL);
  45. if (length >= vpwidth)
  46. x = 0;
  47. else
  48. {
  49. switch (alignment)
  50. {
  51. case WPS_TOKEN_ALIGN_CENTER:
  52. x = (vpwidth-length)/2;
  53. break;
  54. case WPS_TOKEN_ALIGN_LEFT:
  55. x = 0;
  56. break;
  57. case WPS_TOKEN_ALIGN_LEFT_RTL:
  58. case WPS_TOKEN_ALIGN_RIGHT:
  59. x = width = length;
  60. break;
  61. case WPS_TOKEN_ALIGN_RIGHT_RTL:
  62. }
  63. }
  64. gwps->display->putsxy(x, (i-start_item)*line_height, buf );
  65. }
  66. }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement