From 15e56098eb583ee0fb6270929c5a7ef856ac7f48 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Fri, 14 May 2010 17:30:06 +0200 Subject: [PATCH] Move button and lcd files to the target tree. uisimulator/sdl has no code anymore --- firmware/SOURCES | 10 ++++ .../target/hosted/sdl/button-sdl.c | 11 +++- .../target/hosted}/sdl/button-sdl.h | 15 ++--- firmware/target/hosted/sdl/kernel-sdl.c | 1 - .../target/hosted}/sdl/lcd-bitmap.c | 2 +- .../target/hosted}/sdl/lcd-bitmap.h | 0 .../target/hosted}/sdl/lcd-charcells.c | 2 +- .../target/hosted}/sdl/lcd-charcells.h | 0 .../target/hosted}/sdl/lcd-remote-bitmap.c | 2 +- .../target/hosted}/sdl/lcd-remote-bitmap.h | 0 .../target/hosted}/sdl/lcd-sdl.c | 3 +- .../target/hosted}/sdl/lcd-sdl.h | 0 .../target/hosted/sdl/sim-ui-defines.h | 2 +- firmware/target/hosted/sdl/system-sdl.c | 2 +- uisimulator/sdl/Makefile | 64 ---------------------- uisimulator/sdl/README | 6 -- uisimulator/sdl/SOURCES | 10 ---- uisimulator/uisimulator.make | 1 - 18 files changed, 30 insertions(+), 101 deletions(-) rename uisimulator/sdl/button.c => firmware/target/hosted/sdl/button-sdl.c (99%) rename {uisimulator => firmware/target/hosted}/sdl/button-sdl.h (83%) rename {uisimulator => firmware/target/hosted}/sdl/lcd-bitmap.c (99%) rename {uisimulator => firmware/target/hosted}/sdl/lcd-bitmap.h (100%) rename {uisimulator => firmware/target/hosted}/sdl/lcd-charcells.c (99%) rename {uisimulator => firmware/target/hosted}/sdl/lcd-charcells.h (100%) rename {uisimulator => firmware/target/hosted}/sdl/lcd-remote-bitmap.c (99%) rename {uisimulator => firmware/target/hosted}/sdl/lcd-remote-bitmap.h (100%) rename {uisimulator => firmware/target/hosted}/sdl/lcd-sdl.c (98%) rename {uisimulator => firmware/target/hosted}/sdl/lcd-sdl.h (100%) rename uisimulator/sdl/uisdl.h => firmware/target/hosted/sdl/sim-ui-defines.h (99%) delete mode 100644 uisimulator/sdl/Makefile delete mode 100644 uisimulator/sdl/README delete mode 100644 uisimulator/sdl/SOURCES diff --git a/firmware/SOURCES b/firmware/SOURCES index b9611e0cb..2d6528019 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -19,7 +19,17 @@ thread.c timer.c #endif /* SIMULATOR */ #ifdef HAVE_SDL +target/hosted/sdl/button-sdl.c target/hosted/sdl/kernel-sdl.c +#ifdef HAVE_LCD_BITMAP +target/hosted/sdl/lcd-bitmap.c +#elif defined(HAVE_LCD_CHARCELLS) +target/hosted/sdl/lcd-charcells.c +#endif +#ifdef HAVE_REMOTE_LCD +target/hosted/sdl/lcd-remote-bitmap.c +#endif +target/hosted/sdl/lcd-sdl.c target/hosted/sdl/system-sdl.c target/hosted/sdl/thread-sdl.c target/hosted/sdl/timer-sdl.c diff --git a/uisimulator/sdl/button.c b/firmware/target/hosted/sdl/button-sdl.c similarity index 99% rename from uisimulator/sdl/button.c rename to firmware/target/hosted/sdl/button-sdl.c index d54a1e6c7..a32872d68 100644 --- a/uisimulator/sdl/button.c +++ b/firmware/target/hosted/sdl/button-sdl.c @@ -20,7 +20,7 @@ ****************************************************************************/ #include -#include "uisdl.h" +#include "sim-ui-defines.h" #include "lcd-charcells.h" #include "lcd-remote.h" #include "config.h" @@ -62,6 +62,8 @@ int remote_type(void) } #endif +static int xy2button(int x, int y); + struct event_queue button_queue; static int btn = 0; /* Hopefully keeps track of currently pressed keys... */ @@ -1546,6 +1548,10 @@ void button_init_device(void) /* Run sim with --mapping to get coordinates */ /* or --debugbuttons to check */ /* The First matching button is returned */ +struct button_map { + int button, x, y, radius; + char *description; +}; #ifdef SANSA_FUZE struct button_map bm[] = { @@ -1997,7 +2003,8 @@ struct button_map bm[] = { }; #endif -int xy2button( int x, int y) { +static int xy2button( int x, int y) +{ int i; extern bool debug_buttons; diff --git a/uisimulator/sdl/button-sdl.h b/firmware/target/hosted/sdl/button-sdl.h similarity index 83% rename from uisimulator/sdl/button-sdl.h rename to firmware/target/hosted/sdl/button-sdl.h index ab9d7563a..75a68c49b 100644 --- a/uisimulator/sdl/button-sdl.h +++ b/firmware/target/hosted/sdl/button-sdl.h @@ -20,20 +20,13 @@ ****************************************************************************/ -#ifndef _BUTTON_SDL_H_ -#define _BUTTON_SDL_H_ +#ifndef __BUTTON_SDL_H__ +#define __BUTTON_SDL_H__ #include #include "config.h" -#include "button-target.h" -#undef HAVE_LCD_FLIP -struct button_map { - int button, x, y, radius; - char *description; -}; - -int xy2button( int x, int y); bool button_hold(void); void button_init_device(void); -#endif + +#endif /* __BUTTON_SDL_H__ */ diff --git a/firmware/target/hosted/sdl/kernel-sdl.c b/firmware/target/hosted/sdl/kernel-sdl.c index 0de209d75..d796921e3 100644 --- a/firmware/target/hosted/sdl/kernel-sdl.c +++ b/firmware/target/hosted/sdl/kernel-sdl.c @@ -25,7 +25,6 @@ #include #include "memory.h" #include "system-sdl.h" -#include "uisdl.h" #include "thread-sdl.h" #include "kernel.h" #include "thread.h" diff --git a/uisimulator/sdl/lcd-bitmap.c b/firmware/target/hosted/sdl/lcd-bitmap.c similarity index 99% rename from uisimulator/sdl/lcd-bitmap.c rename to firmware/target/hosted/sdl/lcd-bitmap.c index 298086d9d..6dfbffff3 100644 --- a/uisimulator/sdl/lcd-bitmap.c +++ b/firmware/target/hosted/sdl/lcd-bitmap.c @@ -20,7 +20,7 @@ ****************************************************************************/ #include "debug.h" -#include "uisdl.h" +#include "sim-ui-defines.h" #include "system.h" #include "lcd-sdl.h" #include "screendump.h" diff --git a/uisimulator/sdl/lcd-bitmap.h b/firmware/target/hosted/sdl/lcd-bitmap.h similarity index 100% rename from uisimulator/sdl/lcd-bitmap.h rename to firmware/target/hosted/sdl/lcd-bitmap.h diff --git a/uisimulator/sdl/lcd-charcells.c b/firmware/target/hosted/sdl/lcd-charcells.c similarity index 99% rename from uisimulator/sdl/lcd-charcells.c rename to firmware/target/hosted/sdl/lcd-charcells.c index 05513ab26..8b73ff772 100644 --- a/uisimulator/sdl/lcd-charcells.c +++ b/firmware/target/hosted/sdl/lcd-charcells.c @@ -29,7 +29,7 @@ #include #include "lcd-playersim.h" -#include "uisdl.h" +#include "sim-ui-defines.h" #include "lcd-sdl.h" /* can't include file.h here */ diff --git a/uisimulator/sdl/lcd-charcells.h b/firmware/target/hosted/sdl/lcd-charcells.h similarity index 100% rename from uisimulator/sdl/lcd-charcells.h rename to firmware/target/hosted/sdl/lcd-charcells.h diff --git a/uisimulator/sdl/lcd-remote-bitmap.c b/firmware/target/hosted/sdl/lcd-remote-bitmap.c similarity index 99% rename from uisimulator/sdl/lcd-remote-bitmap.c rename to firmware/target/hosted/sdl/lcd-remote-bitmap.c index c44e47628..30811cfc2 100644 --- a/uisimulator/sdl/lcd-remote-bitmap.c +++ b/firmware/target/hosted/sdl/lcd-remote-bitmap.c @@ -19,7 +19,7 @@ * ****************************************************************************/ -#include "uisdl.h" +#include "sim-ui-defines.h" #include "lcd-sdl.h" #include "lcd-remote-bitmap.h" #include "screendump.h" diff --git a/uisimulator/sdl/lcd-remote-bitmap.h b/firmware/target/hosted/sdl/lcd-remote-bitmap.h similarity index 100% rename from uisimulator/sdl/lcd-remote-bitmap.h rename to firmware/target/hosted/sdl/lcd-remote-bitmap.h diff --git a/uisimulator/sdl/lcd-sdl.c b/firmware/target/hosted/sdl/lcd-sdl.c similarity index 98% rename from uisimulator/sdl/lcd-sdl.c rename to firmware/target/hosted/sdl/lcd-sdl.c index f1ffe8a76..15e4ba95c 100644 --- a/uisimulator/sdl/lcd-sdl.c +++ b/firmware/target/hosted/sdl/lcd-sdl.c @@ -19,8 +19,9 @@ * ****************************************************************************/ +#include #include "lcd-sdl.h" -#include "uisdl.h" +#include "sim-ui-defines.h" #include "system.h" /* for MIN() and MAX() */ int display_zoom = 1; diff --git a/uisimulator/sdl/lcd-sdl.h b/firmware/target/hosted/sdl/lcd-sdl.h similarity index 100% rename from uisimulator/sdl/lcd-sdl.h rename to firmware/target/hosted/sdl/lcd-sdl.h diff --git a/uisimulator/sdl/uisdl.h b/firmware/target/hosted/sdl/sim-ui-defines.h similarity index 99% rename from uisimulator/sdl/uisdl.h rename to firmware/target/hosted/sdl/sim-ui-defines.h index cb20bae4b..567a618fc 100644 --- a/uisimulator/sdl/uisdl.h +++ b/firmware/target/hosted/sdl/sim-ui-defines.h @@ -397,7 +397,7 @@ #define UI_LCD_POSX 101 #define UI_LCD_POSY 195 -#else +#elif defined(SIMULATOR) #error no UI defines #endif diff --git a/firmware/target/hosted/sdl/system-sdl.c b/firmware/target/hosted/sdl/system-sdl.c index c4e5d85d6..693e8d1b5 100644 --- a/firmware/target/hosted/sdl/system-sdl.c +++ b/firmware/target/hosted/sdl/system-sdl.c @@ -25,7 +25,7 @@ #include #include "system-sdl.h" #include "thread-sdl.h" -#include "uisdl.h" +#include "sim-ui-defines.h" #include "lcd-sdl.h" #ifdef HAVE_LCD_BITMAP #include "lcd-bitmap.h" diff --git a/uisimulator/sdl/Makefile b/uisimulator/sdl/Makefile deleted file mode 100644 index dc76b35d6..000000000 --- a/uisimulator/sdl/Makefile +++ /dev/null @@ -1,64 +0,0 @@ -############################################################################ -# __________ __ ___. -# Open \______ \ ____ ____ | | _\_ |__ _______ ___ -# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / -# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < -# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ -# \/ \/ \/ \/ \/ -# $Id$ -# -# Copyright (C) 2002, 2008 by Daniel Stenberg -# -# All files in this archive are subject to the GNU General Public License. -# See the file COPYING in the source tree root for full license agreement. -# -# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY -# KIND, either express or implied. -# -############################################################################ - -SIMCOMMON = ../common - -DEPFILE = $(OBJDIR)/dep-sim - -RM = rm -f -DEBUG = -g - -# Use this for simulator-only files -INCLUDES = -I. -I$(SIMCOMMON) -I$(OBJDIR) $(TARGET_INC) -I$(FIRMDIR)/export \ --I$(APPSDIR) -I$(BUILDDIR) - -# This sets up 'SRC' based on the files mentioned in SOURCES -include $(TOOLSDIR)/makesrc.inc - -OBJS := $(SRC:%.c=$(OBJDIR)/%.o) - -DEFINES := -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \ -$(TARGET) -DAPPSVERSION=\"$(VERSION)\" -DMEM=${MEMORYSIZE} $(EXTRA_DEFINES) - -SOURCES = $(SRC) - -DIRS = . - -CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) $(GCCOPTS) -W -Wall - -OUTFILE = $(BUILDDIR)/libsim.a - -all: $(OUTFILE) - -include $(TOOLSDIR)/make.inc - -$(OUTFILE): $(OBJS) $(BUILDDIR)/UI256.bmp - $(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $(OBJS) >/dev/null 2>&1 - $(SILENT)$(RANLIB) $@ - -clean: - $(call PRINTS,cleaning sim)$(RM) $(OBJS) *~ core $(OUTFILE) $(DEPFILE) \ - $(BUILDDIR)/UI256.bmp $(DEPFILE) - $(SILENT)$(MAKE) -C $(SIMCOMMON) clean - -################## Specific dependencies ################## -$(BUILDDIR)/UI256.bmp: UI-$(MODELNAME).bmp - $(call PRINTS,UI)cp $< $@ - --include $(DEPFILE) diff --git a/uisimulator/sdl/README b/uisimulator/sdl/README deleted file mode 100644 index 0a293f6ad..000000000 --- a/uisimulator/sdl/README +++ /dev/null @@ -1,6 +0,0 @@ -To build: - - $ ../tools/configure - [answer questions] - $ make - $ ./rockboxui diff --git a/uisimulator/sdl/SOURCES b/uisimulator/sdl/SOURCES deleted file mode 100644 index 19d97181d..000000000 --- a/uisimulator/sdl/SOURCES +++ /dev/null @@ -1,10 +0,0 @@ -button.c -#ifdef HAVE_LCD_BITMAP -lcd-bitmap.c -#elif defined(HAVE_LCD_CHARCELLS) -lcd-charcells.c -#endif -#ifdef HAVE_REMOTE_LCD -lcd-remote-bitmap.c -#endif -lcd-sdl.c diff --git a/uisimulator/uisimulator.make b/uisimulator/uisimulator.make index 05b973f60..86fcb2a3d 100644 --- a/uisimulator/uisimulator.make +++ b/uisimulator/uisimulator.make @@ -12,7 +12,6 @@ INCLUDES += -I$(ROOTDIR)/uisimulator/sdl -I$(ROOTDIR)/uisimulator/common \ SIMFLAGS += $(INCLUDES) $(DEFINES) -DHAVE_CONFIG_H $(GCCOPTS) -SIMSRC += $(call preprocess, $(ROOTDIR)/uisimulator/sdl/SOURCES) SIMSRC += $(call preprocess, $(ROOTDIR)/uisimulator/common/SOURCES) SIMOBJ = $(call c2obj,$(SIMSRC)) OTHER_SRC += $(SIMSRC) -- 2.11.4.GIT