From 36c71a60ca82f9777fbdd239f63f62ccf68cf3f5 Mon Sep 17 00:00:00 2001 From: Maurus Cuelenaere Date: Thu, 29 Jan 2009 20:49:43 +0000 Subject: [PATCH] Get checkwps working again git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19880 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/wps_parser.c | 15 +++-------- apps/recorder/bmp.c | 3 ++- firmware/export/button.h | 4 +-- firmware/export/font.h | 2 ++ tools/checkwps/Makefile | 3 ++- tools/checkwps/checkwps.c | 52 +++++++++++++++++++++++++++++++++++++-- tools/checkwps/checkwps.h | 8 +++--- 7 files changed, 66 insertions(+), 21 deletions(-) diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c index acf161b6bb..0cc3ced06a 100644 --- a/apps/gui/wps_parser.c +++ b/apps/gui/wps_parser.c @@ -22,7 +22,6 @@ #include #include #include -#include "gwps.h" #include "file.h" #include "misc.h" #include "plugin.h" @@ -32,30 +31,24 @@ #include "proxy.h" #include "settings.h" #include "sysfont.h" -#include "gwps.h" -#include "font.h" -#include "bmp.h" -#include "backdrop.h" -#include "ctype.h" #else #include "checkwps.h" -#define SYSFONT_HEIGHT 8 +#include "audio.h" #define DEBUGF printf #endif /*WPSEDITOR*/ -#define FONT_SYSFIXED 0 -#define FONT_UI 1 #else #include "debug.h" #endif /*__PCTOOL__*/ -#ifndef __PCTOOL__ #include #include #include #include "font.h" #include "gwps.h" +#ifndef __PCTOOL__ #include "settings.h" +#endif #include "settings_list.h" #ifdef HAVE_LCD_BITMAP @@ -64,8 +57,6 @@ #include "backdrop.h" -#endif - #define WPS_DEFAULTCFG WPS_DIR "/rockbox_default.wps" #define RWPS_DEFAULTCFG WPS_DIR "/rockbox_default.rwps" diff --git a/apps/recorder/bmp.c b/apps/recorder/bmp.c index d6d836a6c5..3fb8a4d6c1 100644 --- a/apps/recorder/bmp.c +++ b/apps/recorder/bmp.c @@ -47,6 +47,7 @@ #endif #include "lcd.h" #include "file.h" +#include "bmp.h" #ifdef HAVE_REMOTE_LCD #include "lcd-remote.h" #endif @@ -58,9 +59,9 @@ #ifndef __PCTOOL__ #include "config.h" #include "system.h" -#include "bmp.h" #include "resize.h" #else +#include "checkwps.h" #undef DEBUGF #define DEBUGF(...) #endif diff --git a/firmware/export/button.h b/firmware/export/button.h index 0b4c8fd2b0..ebfc1272cb 100644 --- a/firmware/export/button.h +++ b/firmware/export/button.h @@ -68,11 +68,11 @@ int button_apply_acceleration(const unsigned int data); #define BUTTON_TOUCHSCREEN 0x08000000 #ifdef HAVE_TOUCHSCREEN -#if !defined(BUTTON_TOPLEFT) || !defined(BUTTON_TOPMIDDLE) \ +#if (!defined(BUTTON_TOPLEFT) || !defined(BUTTON_TOPMIDDLE) \ || !defined(BUTTON_TOPRIGHT) || !defined(BUTTON_MIDLEFT) \ || !defined(BUTTON_CENTER) || !defined(BUTTON_MIDRIGHT) \ || !defined(BUTTON_BOTTOMLEFT) || !defined(BUTTON_BOTTOMMIDDLE) \ - || !defined(BUTTON_BOTTOMRIGHT) + || !defined(BUTTON_BOTTOMRIGHT)) && !defined(__PCTOOL__) #error Touchscreen button mode BUTTON_* defines not set up correctly #endif enum touchscreen_mode { diff --git a/firmware/export/font.h b/firmware/export/font.h index 75b012d722..d17fa18b8b 100644 --- a/firmware/export/font.h +++ b/firmware/export/font.h @@ -62,11 +62,13 @@ * must be available at system startup. * Fonts are specified in firmware/font.c. */ +#ifndef __PCTOOL__ enum { FONT_SYSFIXED, /* system fixed pitch font*/ FONT_UI, /* system porportional font*/ MAXFONTS }; +#endif /* * .fnt loadable font file format definition 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 \ INCLUDE=-I $(ROOT)/apps/gui \ -I $(ROOT)/firmware/export \ -I $(ROOT)/apps \ + -I $(ROOT)/apps/recorder \ -I . -CFLAGS = -g -D__PCTOOL__ -DDEBUG -DROCKBOX_DIR_LEN=9 -DWPS_DIR=\".\" +CFLAGS = -g -D__PCTOOL__ -DDEBUG -DROCKBOX_DIR_LEN=9 -DWPS_DIR=\".\" all: @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 @@ #include "config.h" #include "gwps.h" #include "checkwps.h" - -#define MIN(x,y) ((x) > (y) ? (y) : (x)) +#include "resize.h" bool debug_wps = true; int wps_verbose_level = 0; int errno; +const struct settings_list *settings; +const int nb_settings = 0; + /* static endianness conversion */ #define SWAP_16(x) ((typeof(x))(unsigned short)(((unsigned short)(x) >> 8) | \ ((unsigned short)(x) << 8))) @@ -55,6 +57,20 @@ unsigned short letoh16(unsigned short x) } } +unsigned short letoh32(unsigned short x) +{ + unsigned short n = 0x1234; + unsigned char* ch = (unsigned char*)&n; + + if (*ch == 0x34) + { + /* Little-endian */ + return x; + } else { + return SWAP_32(x); + } +} + unsigned int htole32(unsigned int x) { unsigned short n = 0x1234; @@ -109,6 +125,38 @@ bool load_remote_wps_backdrop(const char* filename) return true; } +int recalc_dimension(struct dim *dst, struct dim *src) +{ + return 0; +} + +int resize_on_load(struct bitmap *bm, bool dither, struct dim *src, + struct rowset *rset, unsigned char *buf, unsigned int len, + const struct custom_format *format, + struct img_part* (*store_part)(void *args), + void *args) +{ + return 0; +} + +int audio_status(void) +{ + return 0; +} + +struct mp3entry* audio_current_track(void) +{ + return NULL; +} + +void audio_stop(void) +{ +} + +void audio_play(long offset) +{ +} + static char pluginbuf[PLUGIN_BUFFER_SIZE]; static 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 @@ #define _CHECKWPS_H_ #include #include +#include #include /* subset of global_settings needed to build checkwps. */ struct user_settings { bool statusbar; -#ifdef HAVE_LCD_COLOR int bg_color; /* background color native format */ int fg_color; /* foreground color native format */ -#endif }; extern struct user_settings global_settings; +#define FONT_SYSFIXED 0 +#define FONT_UI 1 +#define SYSFONT_HEIGHT 8 - +#define MIN(x,y) ((x) > (y) ? (y) : (x)) #endif