Get checkwps working again

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19880 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Maurus Cuelenaere 2009-01-29 20:49:43 +00:00
parent d4b99fdfe0
commit 36c71a60ca
7 changed files with 66 additions and 21 deletions

View file

@ -22,7 +22,6 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include "gwps.h"
#include "file.h" #include "file.h"
#include "misc.h" #include "misc.h"
#include "plugin.h" #include "plugin.h"
@ -32,30 +31,24 @@
#include "proxy.h" #include "proxy.h"
#include "settings.h" #include "settings.h"
#include "sysfont.h" #include "sysfont.h"
#include "gwps.h"
#include "font.h"
#include "bmp.h"
#include "backdrop.h"
#include "ctype.h"
#else #else
#include "checkwps.h" #include "checkwps.h"
#define SYSFONT_HEIGHT 8 #include "audio.h"
#define DEBUGF printf #define DEBUGF printf
#endif /*WPSEDITOR*/ #endif /*WPSEDITOR*/
#define FONT_SYSFIXED 0
#define FONT_UI 1
#else #else
#include "debug.h" #include "debug.h"
#endif /*__PCTOOL__*/ #endif /*__PCTOOL__*/
#ifndef __PCTOOL__
#include <ctype.h> #include <ctype.h>
#include <stdbool.h> #include <stdbool.h>
#include <string.h> #include <string.h>
#include "font.h" #include "font.h"
#include "gwps.h" #include "gwps.h"
#ifndef __PCTOOL__
#include "settings.h" #include "settings.h"
#endif
#include "settings_list.h" #include "settings_list.h"
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
@ -64,8 +57,6 @@
#include "backdrop.h" #include "backdrop.h"
#endif
#define WPS_DEFAULTCFG WPS_DIR "/rockbox_default.wps" #define WPS_DEFAULTCFG WPS_DIR "/rockbox_default.wps"
#define RWPS_DEFAULTCFG WPS_DIR "/rockbox_default.rwps" #define RWPS_DEFAULTCFG WPS_DIR "/rockbox_default.rwps"

View file

@ -47,6 +47,7 @@
#endif #endif
#include "lcd.h" #include "lcd.h"
#include "file.h" #include "file.h"
#include "bmp.h"
#ifdef HAVE_REMOTE_LCD #ifdef HAVE_REMOTE_LCD
#include "lcd-remote.h" #include "lcd-remote.h"
#endif #endif
@ -58,9 +59,9 @@
#ifndef __PCTOOL__ #ifndef __PCTOOL__
#include "config.h" #include "config.h"
#include "system.h" #include "system.h"
#include "bmp.h"
#include "resize.h" #include "resize.h"
#else #else
#include "checkwps.h"
#undef DEBUGF #undef DEBUGF
#define DEBUGF(...) #define DEBUGF(...)
#endif #endif

View file

@ -68,11 +68,11 @@ int button_apply_acceleration(const unsigned int data);
#define BUTTON_TOUCHSCREEN 0x08000000 #define BUTTON_TOUCHSCREEN 0x08000000
#ifdef HAVE_TOUCHSCREEN #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_TOPRIGHT) || !defined(BUTTON_MIDLEFT) \
|| !defined(BUTTON_CENTER) || !defined(BUTTON_MIDRIGHT) \ || !defined(BUTTON_CENTER) || !defined(BUTTON_MIDRIGHT) \
|| !defined(BUTTON_BOTTOMLEFT) || !defined(BUTTON_BOTTOMMIDDLE) \ || !defined(BUTTON_BOTTOMLEFT) || !defined(BUTTON_BOTTOMMIDDLE) \
|| !defined(BUTTON_BOTTOMRIGHT) || !defined(BUTTON_BOTTOMRIGHT)) && !defined(__PCTOOL__)
#error Touchscreen button mode BUTTON_* defines not set up correctly #error Touchscreen button mode BUTTON_* defines not set up correctly
#endif #endif
enum touchscreen_mode { enum touchscreen_mode {

View file

@ -62,11 +62,13 @@
* must be available at system startup. * must be available at system startup.
* Fonts are specified in firmware/font.c. * Fonts are specified in firmware/font.c.
*/ */
#ifndef __PCTOOL__
enum { enum {
FONT_SYSFIXED, /* system fixed pitch font*/ FONT_SYSFIXED, /* system fixed pitch font*/
FONT_UI, /* system porportional font*/ FONT_UI, /* system porportional font*/
MAXFONTS MAXFONTS
}; };
#endif
/* /*
* .fnt loadable font file format definition * .fnt loadable font file format definition

View file

@ -27,6 +27,7 @@ COMMON=$(ROOT)/apps/gui/wps_parser.c \
INCLUDE=-I $(ROOT)/apps/gui \ INCLUDE=-I $(ROOT)/apps/gui \
-I $(ROOT)/firmware/export \ -I $(ROOT)/firmware/export \
-I $(ROOT)/apps \ -I $(ROOT)/apps \
-I $(ROOT)/apps/recorder \
-I . -I .
CFLAGS = -g -D__PCTOOL__ -DDEBUG -DROCKBOX_DIR_LEN=9 -DWPS_DIR=\".\" CFLAGS = -g -D__PCTOOL__ -DDEBUG -DROCKBOX_DIR_LEN=9 -DWPS_DIR=\".\"

View file

@ -25,14 +25,16 @@
#include "config.h" #include "config.h"
#include "gwps.h" #include "gwps.h"
#include "checkwps.h" #include "checkwps.h"
#include "resize.h"
#define MIN(x,y) ((x) > (y) ? (y) : (x))
bool debug_wps = true; bool debug_wps = true;
int wps_verbose_level = 0; int wps_verbose_level = 0;
int errno; int errno;
const struct settings_list *settings;
const int nb_settings = 0;
/* static endianness conversion */ /* static endianness conversion */
#define SWAP_16(x) ((typeof(x))(unsigned short)(((unsigned short)(x) >> 8) | \ #define SWAP_16(x) ((typeof(x))(unsigned short)(((unsigned short)(x) >> 8) | \
((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 int htole32(unsigned int x)
{ {
unsigned short n = 0x1234; unsigned short n = 0x1234;
@ -109,6 +125,38 @@ bool load_remote_wps_backdrop(const char* filename)
return true; 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 char pluginbuf[PLUGIN_BUFFER_SIZE];
static unsigned dummy_func2(void) static unsigned dummy_func2(void)

View file

@ -23,20 +23,22 @@
#define _CHECKWPS_H_ #define _CHECKWPS_H_
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdbool.h>
#include <fcntl.h> #include <fcntl.h>
/* subset of global_settings needed to build checkwps. */ /* subset of global_settings needed to build checkwps. */
struct user_settings { struct user_settings {
bool statusbar; bool statusbar;
#ifdef HAVE_LCD_COLOR
int bg_color; /* background color native format */ int bg_color; /* background color native format */
int fg_color; /* foreground color native format */ int fg_color; /* foreground color native format */
#endif
}; };
extern struct user_settings global_settings; 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 #endif