summaryrefslogtreecommitdiff
path: root/tools/checkwps
diff options
context:
space:
mode:
Diffstat (limited to 'tools/checkwps')
-rw-r--r--tools/checkwps/Makefile3
-rw-r--r--tools/checkwps/checkwps.c52
-rw-r--r--tools/checkwps/checkwps.h8
3 files changed, 57 insertions, 6 deletions
diff --git a/tools/checkwps/Makefile b/tools/checkwps/Makefile
index cde80b0dde..1bdf3580f9 100644
--- a/tools/checkwps/Makefile
+++ b/tools/checkwps/Makefile
@@ -27,9 +27,10 @@ COMMON=$(ROOT)/apps/gui/wps_parser.c \
27INCLUDE=-I $(ROOT)/apps/gui \ 27INCLUDE=-I $(ROOT)/apps/gui \
28 -I $(ROOT)/firmware/export \ 28 -I $(ROOT)/firmware/export \
29 -I $(ROOT)/apps \ 29 -I $(ROOT)/apps \
30 -I $(ROOT)/apps/recorder \
30 -I . 31 -I .
31 32
32CFLAGS = -g -D__PCTOOL__ -DDEBUG -DROCKBOX_DIR_LEN=9 -DWPS_DIR=\".\" 33CFLAGS = -g -D__PCTOOL__ -DDEBUG -DROCKBOX_DIR_LEN=9 -DWPS_DIR=\".\"
33 34
34all: 35all:
35 @echo To build, run the buildall.sh script 36 @echo To build, run the buildall.sh script
diff --git a/tools/checkwps/checkwps.c b/tools/checkwps/checkwps.c
index 2981303701..17098d2b06 100644
--- a/tools/checkwps/checkwps.c
+++ b/tools/checkwps/checkwps.c
@@ -25,14 +25,16 @@
25#include "config.h" 25#include "config.h"
26#include "gwps.h" 26#include "gwps.h"
27#include "checkwps.h" 27#include "checkwps.h"
28 28#include "resize.h"
29#define MIN(x,y) ((x) > (y) ? (y) : (x))
30 29
31bool debug_wps = true; 30bool debug_wps = true;
32int wps_verbose_level = 0; 31int wps_verbose_level = 0;
33 32
34int errno; 33int errno;
35 34
35const struct settings_list *settings;
36const int nb_settings = 0;
37
36/* static endianness conversion */ 38/* static endianness conversion */
37#define SWAP_16(x) ((typeof(x))(unsigned short)(((unsigned short)(x) >> 8) | \ 39#define SWAP_16(x) ((typeof(x))(unsigned short)(((unsigned short)(x) >> 8) | \
38 ((unsigned short)(x) << 8))) 40 ((unsigned short)(x) << 8)))
@@ -55,6 +57,20 @@ unsigned short letoh16(unsigned short x)
55 } 57 }
56} 58}
57 59
60unsigned short letoh32(unsigned short x)
61{
62 unsigned short n = 0x1234;
63 unsigned char* ch = (unsigned char*)&n;
64
65 if (*ch == 0x34)
66 {
67 /* Little-endian */
68 return x;
69 } else {
70 return SWAP_32(x);
71 }
72}
73
58unsigned int htole32(unsigned int x) 74unsigned int htole32(unsigned int x)
59{ 75{
60 unsigned short n = 0x1234; 76 unsigned short n = 0x1234;
@@ -109,6 +125,38 @@ bool load_remote_wps_backdrop(const char* filename)
109 return true; 125 return true;
110} 126}
111 127
128int recalc_dimension(struct dim *dst, struct dim *src)
129{
130 return 0;
131}
132
133int resize_on_load(struct bitmap *bm, bool dither, struct dim *src,
134 struct rowset *rset, unsigned char *buf, unsigned int len,
135 const struct custom_format *format,
136 struct img_part* (*store_part)(void *args),
137 void *args)
138{
139 return 0;
140}
141
142int audio_status(void)
143{
144 return 0;
145}
146
147struct mp3entry* audio_current_track(void)
148{
149 return NULL;
150}
151
152void audio_stop(void)
153{
154}
155
156void audio_play(long offset)
157{
158}
159
112static char pluginbuf[PLUGIN_BUFFER_SIZE]; 160static char pluginbuf[PLUGIN_BUFFER_SIZE];
113 161
114static unsigned dummy_func2(void) 162static unsigned dummy_func2(void)
diff --git a/tools/checkwps/checkwps.h b/tools/checkwps/checkwps.h
index fa3b425500..2ba8f5f59e 100644
--- a/tools/checkwps/checkwps.h
+++ b/tools/checkwps/checkwps.h
@@ -23,20 +23,22 @@
23#define _CHECKWPS_H_ 23#define _CHECKWPS_H_
24#include <stdio.h> 24#include <stdio.h>
25#include <stdlib.h> 25#include <stdlib.h>
26#include <stdbool.h>
26#include <fcntl.h> 27#include <fcntl.h>
27 28
28/* subset of global_settings needed to build checkwps. */ 29/* subset of global_settings needed to build checkwps. */
29struct user_settings { 30struct user_settings {
30 bool statusbar; 31 bool statusbar;
31#ifdef HAVE_LCD_COLOR
32 int bg_color; /* background color native format */ 32 int bg_color; /* background color native format */
33 int fg_color; /* foreground color native format */ 33 int fg_color; /* foreground color native format */
34#endif
35}; 34};
36 35
37extern struct user_settings global_settings; 36extern struct user_settings global_settings;
38 37
38#define FONT_SYSFIXED 0
39#define FONT_UI 1
40#define SYSFONT_HEIGHT 8
39 41
40 42#define MIN(x,y) ((x) > (y) ? (y) : (x))
41 43
42#endif 44#endif