wiki_info.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright (c) 2009 Openmoko Inc.
  3. *
  4. * Authors Holger Hans Peter Freyther <zecke@openmoko.org>
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef WIKI_INFO_H
  20. #define WIKI_INFO_H
  21. #include "lcd_buf_draw.h"
  22. #define MAX_WIKIS 8
  23. #define MAX_WIKIS_PER_DEVICE 8
  24. #define MAX_LINKS_IN_LICENSE_TEXT 4
  25. #define LICENSE_LINK_START '['
  26. #define LICENSE_LINK_END ']'
  27. #define NLS_TEXT_REPLACEMENT_START '<'
  28. #define NLS_TEXT_REPLACEMENT_END '>'
  29. #define MAX_LICENSE_TEXT_LEN 1024
  30. #define MAX_LICENSE_TEXT_PIXEL_LINES 512
  31. typedef struct _WIKI_LIST {
  32. int wiki_id;
  33. char wiki_folder[10];
  34. } WIKI_LIST;
  35. typedef struct _WIKI_LICENSE_DRAW {
  36. char *buf;
  37. int lines;
  38. int link_count;
  39. ARTICLE_LINK links[MAX_LINKS_IN_LICENSE_TEXT];
  40. } WIKI_LICENSE_DRAW;
  41. extern int nCurrentWiki;
  42. void init_wiki_info(void);
  43. int get_wiki_count(void);
  44. unsigned char *get_nls_text(char *key);
  45. char *get_wiki_file_path(int nWikiIdx, char *file_name);
  46. char *get_wiki_name(int idx);
  47. void wiki_selection(void);
  48. void set_wiki(int idx);
  49. int get_wiki_idx_from_id(int wiki_id);
  50. int get_wiki_id_from_idx(int wiki_idx);
  51. WIKI_LICENSE_DRAW *wiki_license_draw(void);
  52. #endif