PK
uv.Q JPEG_file_loader/PK
uv.Q JPEG_file_loader/simulator/PK
uv.Q JPEG_file_loader/simulator/msvs/PK
uv.Qxl l 3 JPEG_file_loader/simulator/msvs/Application-std.sln
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Application-std", "Application-std.vcxproj", "{3C47683C-0505-487F-A1FD-75B8490BF72C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3C47683C-0505-487F-A1FD-75B8490BF72C}.Debug|Win32.ActiveCfg = Debug|Win32
{3C47683C-0505-487F-A1FD-75B8490BF72C}.Debug|Win32.Build.0 = Debug|Win32
{3C47683C-0505-487F-A1FD-75B8490BF72C}.Release|Win32.ActiveCfg = Release|Win32
{3C47683C-0505-487F-A1FD-75B8490BF72C}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
PK
uv.QisM8# 8# 7 JPEG_file_loader/simulator/msvs/Application-std.vcxproj
DebugWin32ReleaseWin32{3C47683C-0505-487F-A1FD-75B8490BF72C}Win32ProjApplicationApplicationtrueUnicodev110ApplicationfalsetrueUnicodev110true..\..\build\$(Configuration)\bin\..\..\build\$(Configuration)\obj\false..\..\build\$(Configuration)\bin\..\..\build\$(Configuration)\obj\Level3DisabledWIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGStrue4355;4457;4458;4459truefalse$(ApplicationRoot)\LibJPEG\include;%(AdditionalIncludeDirectories)Consoletruetrue4355;4457;4458;4459copy $(TouchGFXReleasePath)\lib\sdl\win32\SDL.dll $(OutDir)
copy $(TouchGFXReleasePath)\lib\sdl\win32\SDL_image.dll $(OutDir)
Level3MaxSpeedtruetrueWIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)trueConsoletruetruetruecopy $(TouchGFXReleasePath)\lib\sdl\win32\SDL.dll $(OutDir)
copy $(TouchGFXReleasePath)\lib\sdl\win32\SDL_image.dll $(OutDir)
PK
uv.QgH" " ? JPEG_file_loader/simulator/msvs/Application-std.vcxproj.filters
{2F3FC0AA-97C4-4366-9939-94A0FF4E028C}cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx{4D1BFFCC-9CEB-4ABF-A951-582870FE71FD}h;hpp;hxx;hm;inl;inc;xsd{92BBFF14-FBDB-4755-BA47-A830D863D92B}rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;ttf;otf;bdf;png;wav;xlsx;props;mfcribbon-ms{FDF8D7B8-1D54-4698-A928-F0B27046724A}{91E5C623-E149-4E90-A403-04BA79B0A166}{187A0EC4-E952-443B-9C35-2FBCBA33CEB3}{F57604AB-38F4-4078-8BB2-947A1AD5D409}{22817FFE-B9E5-4AEC-8121-A12B81B5D8DE}{66EFE5ED-89A2-499C-857A-9ABFF2415D01}{38D88E89-2644-4AED-A4FD-766DB5300628}{A5EB52C1-918E-4354-9719-951B3643800B}{C07B02A9-A55E-47AA-AD61-59A6AAD754E6}{7F4C29FB-179E-4202-82D4-83F937BD0C8B}{4d27fc3a-357d-4999-91ce-b19b4bd3169e}Source Files\commonSource Files\modelSource Files\template_screenSource Files\template_screenSource Files\simulatorSource Files\TouchGFXSource Files\TouchGFXSource Files\TouchGFXSource Files\TouchGFXSource Files\LibJPEGSource Files\LibJPEGSource Files\LibJPEGSource Files\LibJPEGSource Files\LibJPEGSource Files\LibJPEGSource Files\LibJPEGSource Files\LibJPEGSource Files\LibJPEGSource Files\LibJPEGSource Files\LibJPEGSource Files\LibJPEGSource Files\LibJPEGSource Files\LibJPEGSource Files\LibJPEGSource Files\LibJPEGSource Files\LibJPEGSource Files\LibJPEGSource Files\LibJPEGSource Files\LibJPEGSource Files\LibJPEGSource Files\LibJPEGSource Files\LibJPEGSource Files\LibJPEGSource Files\LibJPEGSource Files\LibJPEGSource Files\LibJPEGSource Files\commonSource Files\commonSource Files\commonResource Files\textsResource FilesHeader Files\commonHeader Files\commonHeader Files\modelHeader Files\modelHeader Files\template_screenHeader Files\template_screenHeader Files\TouchGFXHeader Files\TouchGFXResource FilesPK
uv.Q JPEG_file_loader/simulator/gcc/PK
uv.Q[85 5 ' JPEG_file_loader/simulator/gcc/Makefile###############################################################################
#
# @brief This file is part of the TouchGFX 4.8.0 evaluation distribution.
#
# @author Draupner Graphics A/S
#
###############################################################################
#
# @section Copyright
#
# This file is free software and is provided for example purposes. You may
# use, copy, and modify within the terms and conditions of the license
# agreement.
#
# This is licensed software for evaluation use, any use must strictly comply
# with the evaluation license agreement provided with delivery of the
# TouchGFX software.
#
# The evaluation license agreement can be seen on www.touchgfx.com
#
# @section Disclaimer
#
# DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Draupner Graphics A/S has
# no obligation to support this software. Draupner Graphics A/S is providing
# the software "AS IS", with no express or implied warranties of any kind,
# including, but not limited to, any implied warranties of merchantability
# or fitness for any particular purpose or warranties against infringement
# of any proprietary rights of a third party.
#
# Draupner Graphics A/S can not be held liable for any consequential,
# incidental, or special damages, or any other relief, or for any claim by
# any third party, arising from your use of this software.
#
###############################################################################
# Get name of this Makefile
makefile_name := $(lastword $(MAKEFILE_LIST))
# Get path of this Makefile
makefile_path := $(dir $(abspath $(makefile_name)))
# Get path where the Application is
application_path := $(abspath $(makefile_path)/../..)
# Change makefile_name to a relative path
makefile_name := $(patsubst $(application_path)/%,%,$(abspath $(makefile_name)))
# Get identification of this system
ifeq ($(OS),Windows_NT)
UNAME := MINGW32_NT-6.2
else
UNAME := $(shell uname -s)
endif
board_name := $(UNAME)
.PHONY: all clean assets
ifneq ($(words $(makefile_path))$(words $(MAKEFILE_LIST)),11)
all: $(filter clean,$(MAKECMDGOALS))
all clean assets:
@echo "************************************************"
@echo "** You cannot have spaces in your path, sorry **"
@echo "************************************************"
else
all: $(filter clean,$(MAKECMDGOALS))
all clean assets:
@cd $(application_path) && $(MAKE) -r -f $(makefile_name) -s $(MFLAGS) _$@_
# Directories containing application-specific source and header files.
# Additional components can be added to this list. make will look for
# source files recursively in comp_name/src and setup an include directive
# for comp_name/include.
components := gui simulator generated/gui_generated
# Location of folder containing bmp/png files.
asset_images_input := assets/images
# Location of folder to search for ttf font files
asset_fonts_input := assets/fonts
# Location of folder where the texts.xlsx is placed
asset_texts_input := assets/texts
build_root_path := build
object_output_path := $(build_root_path)/$(board_name)
binary_output_path := $(build_root_path)/bin
# Location of output folders where autogenerated code from assets is placed
asset_root_path := generated
asset_images_output := $(asset_root_path)/images
asset_fonts_output := $(asset_root_path)/fonts
asset_texts_output := $(asset_root_path)/texts
#include application specific configuration
-include $(application_path)/config/gcc/app.mk
### END OF USER SECTION. THE FOLLOWING SHOULD NOT BE MODIFIED ###
ifeq ($(UNAME), Linux)
-include $(touchgfx_path)/config/toolchain-linux.mk
library_path := $(touchgfx_path)/lib/sdl2/linux64 $(touchgfx_path)/lib/linux
libraries := touchgfx SDL2 SDL2_image rt m pthread dl
libstart := -Wl,--start-group
libend := -Wl,--end-group
libextra :=
library_includes += $(touchgfx_path)/framework/include/platform/hal/simulator/sdl2/vendor
linker_options_local := -Xlinker -rpath -Xlinker $(abspath $(touchgfx_path)/lib/sdl2/linux64/)
resource_file :=
imageconvert_executable := $(touchgfx_path)/framework/tools/imageconvert/build/linux/imageconvert.out
fontconvert_executable := $(touchgfx_path)/framework/tools/fontconvert/build/linux/fontconvert.out
simulator_executable := simulator.out
else
-include $(touchgfx_path)/config/toolchain-mingw32.mk
sdl_library_path := $(touchgfx_path)/lib/sdl2/win32
library_path := $(sdl_library_path) $(touchgfx_path)/lib/win/mingw32
libraries := touchgfx SDL2 SDL2_image m pthread mingw32
libstart := -Wl,--start-group
libend := -Wl,--end-group
libextra := -Wl,--subsystem,windows
library_includes += $(touchgfx_path)/framework/include/platform/hal/simulator/sdl2/vendor
resource_file := $(touchgfx_path)/config/touchgfx.res
imageconvert_executable := $(touchgfx_path)/framework/tools/imageconvert/build/win/imageconvert.out
fontconvert_executable := $(touchgfx_path)/framework/tools/fontconvert/build/win/fontconvert.out
simulator_executable := simulator.exe
#relax options to compile LibJPEG
c_compiler_options_local += -Wno-format-nonliteral
$(resource_file): $(resource_file:%.res=%.rc) $(resource_file:%.res=%.ico)
@echo Creating Windows resource file with program icon
@windres $(resource_file:%.res=%.rc) -O coff -o $@
endif
-include $(touchgfx_path)/config/toolchain-strict.mk
#include everything + specific vendor folders
framework_includes := $(touchgfx_path)/framework/include
#only take in the source we want to build for this sim
framework_files := $(touchgfx_path)/framework/source/platform/driver/touch/SDL2TouchController.cpp
framework_source := $(touchgfx_path)/framework/source/platform/hal/simulator/sdl2
#this needs to change when assset include folder changes.
all_components_except_images := $(components) \
$(asset_fonts_output) \
$(asset_texts_output)
all_components := $(all_components_except_images) \
$(asset_images_output)
#keep framework include and source out of this
include_paths := $(library_includes) $(foreach comp, $(all_components), $(comp)/include) $(framework_includes)
source_paths = $(foreach comp, $(all_components_except_images), $(comp)/src) $(framework_source) simulator
#include LibJPEG
include_paths += $(application_path)/LibJPEG/include
# Finds files that matches the specified pattern. The directory list
# is searched recursively. It is safe to invoke this function with an
# empty list of directories.
#
# Param $(1): List of directories to search
# Param $(2): The file pattern to search for
define find
$(foreach dir,$(1),$(foreach d,$(wildcard $(dir)/*),\
$(call find,$(d),$(2))) $(wildcard $(dir)/$(strip $(2))))
endef
unexport find
imageconvert_bmp_lower_files := $(call find, $(asset_images_input), *.bmp)
imageconvert_bmp_upper_files := $(call find, $(asset_images_input), *.BMP)
imageconvert_png_lower_files := $(call find, $(asset_images_input), *.png)
imageconvert_png_upper_files := $(call find, $(asset_images_input), *.PNG)
imageconvert_image_files := $(imageconvert_bmp_lower_files) \
$(imageconvert_bmp_upper_files) \
$(imageconvert_png_lower_files) \
$(imageconvert_png_upper_files)
imageconvert_cpp_files := $(imageconvert_bmp_lower_files:$(asset_images_input)/%.bmp=$(asset_images_output)/src/%.cpp) \
$(imageconvert_bmp_upper_files:$(asset_images_input)/%.BMP=$(asset_images_output)/src/%.cpp) \
$(imageconvert_png_lower_files:$(asset_images_input)/%.png=$(asset_images_output)/src/%.cpp) \
$(imageconvert_png_upper_files:$(asset_images_input)/%.PNG=$(asset_images_output)/src/%.cpp)
fontconvert_ttf_lower_files := $(call find, $(asset_fonts_input), *.ttf)
fontconvert_ttf_upper_files := $(call find, $(asset_fonts_input), *.TTF)
fontconvert_otf_lower_files := $(call find, $(asset_fonts_input), *.otf)
fontconvert_otf_upper_files := $(call find, $(asset_fonts_input), *.OTF)
fontconvert_bdf_lower_files := $(call find, $(asset_fonts_input), *.bdf)
fontconvert_bdf_upper_files := $(call find, $(asset_fonts_input), *.BDF)
fontconvert_font_files := $(fontconvert_ttf_lower_files) \
$(fontconvert_ttf_upper_files) \
$(fontconvert_otf_lower_files) \
$(fontconvert_otf_upper_files) \
$(fontconvert_bdf_lower_files) \
$(fontconvert_bdf_upper_files)
source_files := $(call find, $(source_paths),*.cpp) $(imageconvert_cpp_files) $(asset_images_output)/src/BitmapDatabase.cpp $(framework_files)
c_source_files := $(call find, $(source_paths),*.c) \
LibJPEG/source/jaricom.c \
LibJPEG/source/jcomapi.c \
LibJPEG/source/jdapimin.c \
LibJPEG/source/jdapistd.c \
LibJPEG/source/jdarith.c \
LibJPEG/source/jdatasrc.c \
LibJPEG/source/jdcoefct.c \
LibJPEG/source/jdcolor.c \
LibJPEG/source/jddctmgr.c \
LibJPEG/source/jdhuff.c \
LibJPEG/source/jdinput.c \
LibJPEG/source/jdmainct.c \
LibJPEG/source/jdmarker.c \
LibJPEG/source/jdmaster.c \
LibJPEG/source/jdmerge.c \
LibJPEG/source/jdpostct.c \
LibJPEG/source/jdsample.c \
LibJPEG/source/jdtrans.c \
LibJPEG/source/jerror.c \
LibJPEG/source/jidctflt.c \
LibJPEG/source/jidctfst.c \
LibJPEG/source/jidctint.c \
LibJPEG/source/jmemmgr.c \
LibJPEG/source/jmemnobs.c \
LibJPEG/source/jquant1.c \
LibJPEG/source/jquant2.c \
LibJPEG/source/jutils.c
object_files := $(source_files:$(touchgfx_path)/%.cpp=$(object_output_path)/touchgfx/%.o) $(c_source_files:$(touchgfx_path)/%.c=$(object_output_path)/touchgfx/%.o)
object_files := $(object_files:%.cpp=$(object_output_path)/%.o)
object_files := $(object_files:%.c=$(object_output_path)/%.o)
dependency_files := $(object_files:%.o=%.d)
textconvert_script_path := $(touchgfx_path)/framework/tools/textconvert
textconvert_executable := $(call find, $(textconvert_script_path), *.rb)
text_database := $(asset_texts_input)/texts.xlsx
.PHONY: _all_ _clean_ _assets_ generate_assets build_executable
# Force linking each time
.PHONY: $(binary_output_path)/$(simulator_executable)
_all_: generate_assets
generate_assets: _assets_
@$(MAKE) -f $(makefile_name) -r -s $(MFLAGS) build_executable
build_executable: $(binary_output_path)/$(simulator_executable)
# write object_files to a temp file used by the linker. This is necessary to avoid exceeding 32Kb limit in a mingw command line for large touchgfx projects
ifeq ($(MAKECMDGOALS),build_executable)
$(shell mkdir -p $(object_output_path))
ifeq ($(MAKE_VERSION),4.1)
$(file >$(build_root_path)/objects.tmp) $(foreach F,$(object_files),$(file >>$(build_root_path)/objects.tmp,$F))
else
$(shell echo "$(object_files)">$(build_root_path)/objects.tmp)
endif
endif
$(binary_output_path)/$(simulator_executable): $(object_files) $(resource_file)
@echo Linking $(@)
@mkdir -p $(@D)
@$(linker) \
$(linker_options) $(linker_options_local) \
$(patsubst %,-L%,$(library_path)) \
@$(build_root_path)/objects.tmp -o $@ $(resource_file) \
$(libstart) $(patsubst %,-l%,$(libraries)) $(libend) $(libextra)
@rm -f $(build_root_path)/objects.tmp
ifeq ($(UNAME), Linux)
@if [ -f $(application_path)/simulator/landscape.png ]; then cp $(application_path)/simulator/landscape.png $(binary_output_path); fi
@if [ -f $(application_path)/simulator/portrait.png ]; then cp $(application_path)/simulator/portrait.png $(binary_output_path); fi
@echo "To be able to run \"$(binary_output_path)/$(simulator_executable)\" type"
@echo " sudo ldconfig $(abspath $(touchgfx_path)/lib/sdl2/linux64)"
@echo "at the command prompt at least once."
else
@cp $(sdl_library_path)/SDL2.dll $(binary_output_path)
@cp $(sdl_library_path)/SDL2_image.dll $(binary_output_path)
@cp $(sdl_library_path)/libpng16-16.dll $(binary_output_path)
@cp $(sdl_library_path)/zlib1.dll $(binary_output_path)
@if [ -f $(application_path)/simulator/landscape.png ]; then cp $(application_path)/simulator/landscape.png $(binary_output_path); fi
@if [ -f $(application_path)/simulator/portrait.png ]; then cp $(application_path)/simulator/portrait.png $(binary_output_path); fi
endif
$(object_output_path)/touchgfx/%.o: $(touchgfx_path)/%.cpp $(application_path)/config/gcc/app.mk
@echo Compiling $<
@mkdir -p $(@D)
@$(cpp_compiler) \
-MMD -MP $(cpp_compiler_options) $(cpp_compiler_options_local) $(user_cflags) \
$(patsubst %,-I%,$(include_paths)) \
-c $< -o $@
$(object_output_path)/%.o: %.cpp $(application_path)/config/gcc/app.mk
@echo Compiling $<
@mkdir -p $(@D)
@$(cpp_compiler) \
-MMD -MP $(cpp_compiler_options) $(cpp_compiler_options_local) $(user_cflags) \
$(patsubst %,-I%,$(include_paths)) \
-c $< -o $@
$(object_output_path)/%.o: %.c $(application_path)/config/gcc/app.mk
@echo Compiling $<
@mkdir -p $(@D)
@$(c_compiler) \
-MMD -MP $(c_compiler_options) $(c_compiler_options_local) $(user_cflags) \
$(patsubst %,-I%,$(include_paths)) \
-c $< -o $@
ifeq ($(MAKECMDGOALS),build_executable)
$(firstword $(dependency_files)): $(application_path)/config/gcc/app.mk
@rm -rf $(object_output_path)
-include $(dependency_files)
endif
_assets_: $(asset_images_output)/include/BitmapDatabase.hpp $(asset_texts_output)/include/texts/TextKeysAndLanguages.hpp
ifeq ($(MAKECMDGOALS),$(filter $(MAKECMDGOALS),_all_ _assets_))
-include $(touchgfx_path)/config/gcc/convert-rules.mk
endif
_clean_:
@echo Cleaning
@rm -rf $(build_root_path)
# Do not remove gui_generated
@rm -rf $(asset_images_output)
@rm -rf $(asset_fonts_output)
@rm -rf $(asset_texts_output)
# Create directory to avoid error if it does not exist
@mkdir -p $(asset_root_path)
# Remove assets folder if it is empty (i.e. no gui_generated folder)
@rmdir --ignore-fail-on-non-empty $(asset_root_path)
endif
PK
uv.QHÎ* * + JPEG_file_loader/simulator/gcc/Makefile-std# Get name of this Makefile
makefile_name := $(lastword $(MAKEFILE_LIST))
# Get path of this Makefile
makefile_path := $(shell dirname "$(realpath $(makefile_name))")
# Get path where the Application is
application_path := $(realpath $(makefile_path)/../..)
# Change makefile_name to a relative path
makefile_name := $(patsubst $(application_path)/%,%,$(realpath $(makefile_name)))
# Get identification of this system
UNAME := $(shell uname -s)
board_name := $(UNAME)
.PHONY: all clean assets
ifneq ($(shell echo $(makefile_path) | wc -w | xargs echo),1)
all clean assets:
@echo "************************************************"
@echo "** You cannot have spaces in your path, sorry **"
@echo "************************************************"
else
all clean assets:
@cd $(application_path) && $(MAKE) -r -f $(makefile_name) -s $(MFLAGS) _$@_
# Directories containing application-specific source and header files.
# Additional components can be added to this list. make will look for
# source files recursively in comp_name/src and setup an include directive
# for comp_name/include.
components := gui simulator
# Location of folder containing bmp/png files.
asset_images_input := assets/images
# Location of folder to search for ttf font files
asset_fonts_input := assets/fonts
# Location of folder where the texts.xlsx is placed
asset_texts_input := assets/texts
build_root_path := build
object_output_path := $(build_root_path)/$(board_name)
binary_output_path := $(build_root_path)/bin
# Location of output folders where autogenerated code from assets is placed
asset_root_path := generated
asset_images_output := $(asset_root_path)/images
asset_fonts_output := $(asset_root_path)/fonts
asset_texts_output := $(asset_root_path)/texts
#include application specific configuration
include $(application_path)/config/gcc/app.mk
### END OF USER SECTION. THE FOLLOWING SHOULD NOT BE MODIFIED ###
ifeq ($(UNAME), Linux)
include $(application_path)/$(touchgfx_path)/config/toolchain-linux.mk
library_path := $(touchgfx_path)/lib/sdl/linux64 $(touchgfx_path)/lib/linux
libraries := touchgfx SDL SDL_image SDLmain caca webp m pthread dl
libstart := -Wl,--start-group
libend := -Wl,--end-group
library_includes += $(touchgfx_path)/framework/include/platform/hal/simulator/sdl/vendor/linux64
linker_options_local := -Xlinker -rpath -Xlinker $(realpath $(touchgfx_path)/lib/sdl/linux64/)
resource_file :=
imageconvert_executable := $(touchgfx_path)/framework/tools/imageconvert/build/linux/imageconvert.out
fontconvert_executable := $(touchgfx_path)/framework/tools/fontconvert/build/linux/fontconvert.out
simulator_executable := simulator.out
else
ifeq ($(UNAME), Darwin)
include $(application_path)/$(touchgfx_path)/config/toolchain-osx.mk
sdl_library_path := $(touchgfx_path)/lib/sdl/osx
library_path := $(sdl_library_path)
libraries := SDLmain SDL m pthread dl
libstart :=
libend :=
library_includes += $(touchgfx_path)/framework/include/platform/hal/simulator/sdl/vendor/osx
linker_options_local := -Wl,-framework,OpenGL -Wl,-framework,Cocoa -Wl,-framework,ApplicationServices -Wl,-framework,Carbon -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,IOKit
resource_file :=
imageconvert_executable := $(touchgfx_path)/framework/tools/imageconvert/build/osx/imageconvert.out
fontconvert_executable := $(touchgfx_path)/framework/tools/fontconvert/build/osx/fontconvert.out
simulator_executable := simulator.out
else
include $(application_path)/$(touchgfx_path)/config/toolchain-mingw32.mk
sdl_library_path := $(touchgfx_path)/lib/sdl/win32
library_path := $(sdl_library_path) $(touchgfx_path)/lib/win/mingw32
libraries := touchgfx SDL SDL_image SDLmain m pthread mingw32
libstart := -Wl,--start-group
libend := -Wl,--end-group
library_includes += $(touchgfx_path)/framework/include/platform/hal/simulator/sdl/vendor/win32 #include SDL libs, not touchgfx
resource_file := $(touchgfx_path)/config/touchgfx.res
imageconvert_executable := $(touchgfx_path)/framework/tools/imageconvert/build/win/imageconvert.out
fontconvert_executable := $(touchgfx_path)/framework/tools/fontconvert/build/win/fontconvert.out
simulator_executable := simulator.exe
$(resource_file): $(resource_file:%.res=%.rc) $(resource_file:%.res=%.ico)
@echo Creating Windows resource file with program icon
@windres $(resource_file:%.res=%.rc) -O coff -o $@
endif
endif
include $(application_path)/$(touchgfx_path)/config/toolchain-strict.mk
#include everything + specific vendor folders
framework_includes := $(touchgfx_path)/framework/include
#only take in the source we want to build for this sim
framework_source := $(touchgfx_path)/framework/source/platform/hal/simulator/sdl \
$(touchgfx_path)/framework/source/platform/driver/lcd
#this needs to change when assset include folder changes.
all_components_except_images := $(components) \
$(asset_fonts_output) \
$(asset_texts_output)
all_components := $(all_components_except_images) \
$(asset_images_output)
#keep framework include and source out of this
include_paths := $(library_includes) $(foreach comp, $(all_components), $(comp)/include) $(framework_includes)
source_paths = $(foreach comp, $(all_components_except_images), $(comp)/src) $(framework_source) simulator
# Finds files that matches the specified pattern. The directory list
# is searched recursively. It is safe to invoke this function with an
# empty list of directories.
#
# Param $(1): List of directories to search
# Param $(2): The file pattern to search for
define find
$(foreach dir,$(1),$(foreach d,$(wildcard $(dir)/*),\
$(call find,$(d),$(2))) $(wildcard $(dir)/$(strip $(2))))
endef
unexport find
imageconvert_bmp_lower_files := $(call find, $(asset_images_input), *.bmp)
imageconvert_bmp_upper_files := $(call find, $(asset_images_input), *.BMP)
imageconvert_png_lower_files := $(call find, $(asset_images_input), *.png)
imageconvert_png_upper_files := $(call find, $(asset_images_input), *.PNG)
imageconvert_image_files := $(imageconvert_bmp_lower_files) \
$(imageconvert_bmp_upper_files) \
$(imageconvert_png_lower_files) \
$(imageconvert_png_upper_files)
imageconvert_cpp_files := $(imageconvert_bmp_lower_files:$(asset_images_input)/%.bmp=$(asset_images_output)/src/%.cpp) \
$(imageconvert_bmp_upper_files:$(asset_images_input)/%.BMP=$(asset_images_output)/src/%.cpp) \
$(imageconvert_png_lower_files:$(asset_images_input)/%.png=$(asset_images_output)/src/%.cpp) \
$(imageconvert_png_upper_files:$(asset_images_input)/%.PNG=$(asset_images_output)/src/%.cpp)
fontconvert_ttf_lower_files := $(call find, $(asset_fonts_input), *.ttf)
fontconvert_ttf_upper_files := $(call find, $(asset_fonts_input), *.TTF)
fontconvert_otf_lower_files := $(call find, $(asset_fonts_input), *.otf)
fontconvert_otf_upper_files := $(call find, $(asset_fonts_input), *.OTF)
fontconvert_bdf_lower_files := $(call find, $(asset_fonts_input), *.bdf)
fontconvert_bdf_upper_files := $(call find, $(asset_fonts_input), *.BDF)
fontconvert_font_files := $(fontconvert_ttf_lower_files) \
$(fontconvert_ttf_upper_files) \
$(fontconvert_otf_lower_files) \
$(fontconvert_otf_upper_files) \
$(fontconvert_bdf_lower_files) \
$(fontconvert_bdf_upper_files)
source_files := $(call find, $(source_paths),*.cpp) $(imageconvert_cpp_files) $(asset_images_output)/src/BitmapDatabase.cpp $(touchgfx_path)/framework/source/platform/driver/touch/SDLTouchController.cpp
c_source_files := $(call find, $(source_paths),*.c)
object_files := $(source_files:%.cpp=$(object_output_path)/%.o) $(c_source_files:%.c=$(object_output_path)/%.o)
object_files := $(patsubst $(object_output_path)/$(touchgfx_path)/%,$(object_output_path)/touchgfx/%,$(object_files))
dependency_files := $(object_files:%.o=%.d)
textconvert_script_path := $(touchgfx_path)/framework/tools/textconvert
textconvert_executable := $(call find, $(textconvert_script_path), *.rb)
text_database := $(asset_texts_input)/texts.xlsx
.PHONY: _all_ _clean_ _assets_ generate_assets build_executable
# Force linking each time
.PHONY: $(binary_output_path)/$(simulator_executable)
_all_: generate_assets
generate_assets: _assets_
@$(MAKE) -f $(makefile_name) -r -s $(MFLAGS) build_executable
build_executable: $(binary_output_path)/$(simulator_executable)
# write object_files to a temp file used by the linker. This is necessary to avoid exceeding 32Kb limit in a mingw command line for large touchgfx projects
ifeq ($(MAKECMDGOALS),build_executable)
$(shell mkdir -p $(object_output_path))
ifeq ($(MAKE_VERSION),4.1)
$(file >$(object_output_path)/objects.tmp) $(foreach F,$(object_files),$(file >>$(object_output_path)/objects.tmp,$F))
else
$(shell echo "$(object_files)">$(object_output_path)/objects.tmp)
endif
endif
$(binary_output_path)/$(simulator_executable): $(object_files) $(resource_file)
@echo Linking $(@)
@mkdir -p $(@D)
@$(linker) \
$(linker_options) $(linker_options_local) \
$(patsubst %,-L%,$(library_path)) \
@$(object_output_path)/objects.tmp -o $@ $(resource_file) \
$(libstart) $(patsubst %,-l%,$(libraries)) $(libend)
@rm -f $(object_output_path)/objects.tmp
ifeq ($(UNAME), Linux)
@echo "To be able to run \"$(binary_output_path)/$(simulator_executable)\" type"
@echo " sudo ldconfig $(realpath $(touchgfx_path)/lib/sdl/linux64)"
@echo "at the command prompt at least once."
else
ifeq ($(UNAME), Darwin)
@cp -f $(sdl_library_path)/libSDL-1.2.0.dylib $(binary_output_path)
@install_name_tool -change /usr/local/opt/sdl/lib/libSDL-1.2.0.dylib @executable_path/libSDL-1.2.0.dylib $@
else
@cp $(sdl_library_path)/SDL.dll $(binary_output_path)
@cp $(sdl_library_path)/SDL_image.dll $(binary_output_path)
endif
endif
$(object_output_path)/touchgfx/%.o: $(touchgfx_path)/%.cpp
@echo Compiling $<
@mkdir -p $(@D)
@$(cpp_compiler) \
-MMD -MP $(cpp_compiler_options) $(cpp_compiler_options_local) $(user_cflags) \
$(patsubst %,-I%,$(include_paths)) \
-c $< -o $@
$(object_output_path)/%.o: %.cpp
@echo Compiling $<
@mkdir -p $(@D)
@$(cpp_compiler) \
-MMD -MP $(cpp_compiler_options) $(cpp_compiler_options_local) $(user_cflags) \
$(patsubst %,-I%,$(include_paths)) \
-c $< -o $@
$(object_output_path)/%.o: %.c
@echo Compiling $<
@mkdir -p $(@D)
@$(c_compiler) \
-MMD -MP $(c_compiler_options) $(c_compiler_options_local) $(user_cflags) \
$(patsubst %,-I%,$(include_paths)) \
-c $< -o $@
ifeq ($(MAKECMDGOALS),build_executable)
-include $(dependency_files)
endif
_assets_: $(asset_images_output)/include/BitmapDatabase.hpp $(asset_texts_output)/include/texts/TextKeysAndLanguages.hpp
include $(application_path)/$(touchgfx_path)/config/gcc/convert-rules.mk
_clean_:
@echo Cleaning
@rm -rf $(build_root_path)
@rm -rf $(asset_root_path)
endif
PK
uv.Q)z # JPEG_file_loader/simulator/main.cpp#include
#include
#include
#include
#if !defined(USE_BPP) || USE_BPP==16
#include
#elif USE_BPP==24
#include
#elif USE_BPP==1
#include
#endif
#include
using namespace touchgfx;
//allocate memory for bitmap cache 200 Kb can hold an 320x240 image
uint8_t bmpCache[300*1024];
int main(int argc, char** argv)
{
NoDMA dma; //For windows/linux, DMA transfers are simulated
#if !defined(USE_BPP) || USE_BPP==16
LCD16bpp lcd;
#elif USE_BPP==24
LCD24bpp lcd;
#elif USE_BPP==1
LCD1bpp lcd;
#endif
SDL2TouchController tc;
// Create hardware layer. Use a display size of 480x272. BMP cache with a single dynamic BMP
HAL& hal = touchgfx_generic_init(dma, lcd, tc, 480, 272, (uint16_t*)bmpCache, sizeof(bmpCache), 1);
// Initialize SDL
if (!dynamic_cast(hal).sdl_init(argc, argv))
{
return EXIT_FAILURE;
}
touchgfx::HAL::getInstance()->taskEntry(); //Never returns
return EXIT_SUCCESS;
}
PK
uv.Q JPEG_file_loader/platform/PK
uv.Q JPEG_file_loader/platform/os/PK
uv.Q$ $ - JPEG_file_loader/platform/os/FreeRTOSConfig.h/*
FreeRTOS V7.3.0 - Copyright (C) 2012 Real Time Engineers Ltd.
FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT
http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
***************************************************************************
* *
* FreeRTOS tutorial books are available in pdf and paperback. *
* Complete, revised, and edited pdf reference manuals are also *
* available. *
* *
* Purchasing FreeRTOS documentation will not only help you, by *
* ensuring you get running as quickly as possible and with an *
* in-depth knowledge of how to use FreeRTOS, it will also help *
* the FreeRTOS project to continue with its mission of providing *
* professional grade, cross platform, de facto standard solutions *
* for microcontrollers - completely free of charge! *
* *
* >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
* *
* Thank you for using FreeRTOS, and thank you for your support! *
* *
***************************************************************************
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
>>>NOTE<<< The modification to the GPL is included to allow you to
distribute a combined work that includes FreeRTOS without being obliged to
provide the source code for proprietary components outside of the FreeRTOS
kernel. FreeRTOS is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details. You should have received a copy of the GNU General Public
License and the FreeRTOS license exception along with FreeRTOS; if not it
can be viewed here: http://www.freertos.org/a00114.html and also obtained
by writing to Richard Barry, contact details for whom are available on the
FreeRTOS WEB site.
1 tab == 4 spaces!
***************************************************************************
* *
* Having a problem? Start by reading the FAQ "My application does *
* not run, what could be wrong?" *
* *
* http://www.FreeRTOS.org/FAQHelp.html *
* *
***************************************************************************
http://www.FreeRTOS.org - Documentation, training, latest versions, license
and contact details.
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
including FreeRTOS+Trace - an indispensable productivity tool.
Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell
the code with commercial support, indemnification, and middleware, under
the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also
provide a safety engineered and independently SIL3 certified version under
the SafeRTOS brand: http://www.SafeRTOS.com.
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
#ifdef __cplusplus
extern "C" {
#endif
/*-----------------------------------------------------------
* Application specific definitions.
*
* These definitions should be adjusted for your particular hardware and
* application requirements.
*
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
*
* See http://www.freertos.org/a00110.html.
*----------------------------------------------------------*/
/* Ensure stdint is only used by the compiler, and not the assembler. */
#if defined(__ICCARM__) || defined(__GNUC__) || defined(__ARMCC_VERSION)
#include
extern uint32_t SystemCoreClock;
#endif /* __ICCARM__ || __GNUC__ */
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 1
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( SystemCoreClock )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#ifdef USE_FREERTOS_8
#define configMAX_PRIORITIES ( 5 )
#define TASKCREATE_NAME_TYPE const char *
#else
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 )
#define TASKCREATE_NAME_TYPE signed char *
#endif
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 64 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 5500 ) )
#define configMAX_TASK_NAME_LEN ( 10 )
#define configUSE_TRACE_FACILITY 1
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
#define configUSE_MUTEXES 1
#define configQUEUE_REGISTRY_SIZE 8
#define configCHECK_FOR_STACK_OVERFLOW 2
#define configUSE_RECURSIVE_MUTEXES 1
#define configUSE_MALLOC_FAILED_HOOK 1
#ifdef SEMI_LOAD_MEASUREMENT
#define configUSE_APPLICATION_TASK_TAG 0
#else
#define configUSE_APPLICATION_TASK_TAG 1
#endif // SEMI_LOAD_MEASUREMENT
#define configUSE_COUNTING_SEMAPHORES 1
#define configGENERATE_RUN_TIME_STATS 0
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
/* Software timer definitions. */
#define configUSE_TIMERS 0
#define configTIMER_TASK_PRIORITY ( 2 )
#define configTIMER_QUEUE_LENGTH 5
#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 )
/* Set the following definitions to 1 to include the API function, or zero
to exclude the API function. */
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 1
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
/* Cortex-M specific definitions. */
#ifdef __NVIC_PRIO_BITS
/* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
#define configPRIO_BITS __NVIC_PRIO_BITS
#else
#define configPRIO_BITS 6 /* 63 priority levels */
#endif
/* The lowest interrupt priority that can be used in a call to a "set priority"
function. */
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0x3f
/* The highest interrupt priority that can be used by any interrupt service
routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
PRIORITY THAN THIS! (higher priorities are lower numeric values. */
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 0x50
/* Interrupt priorities used by the kernel port layer itself. These are generic
to all Cortex-M ports, and do not rely on any particular library functions. */
#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
/* Normal assert() semantics without relying on the provision of an assert.h
header file. */
#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
standard names. */
#define vPortSVCHandler SVC_Handler
#define xPortPendSVHandler PendSV_Handler
#ifdef USE_OS_SYSTICK
#define xPortSysTickHandler OS_SysTick
#else
#define xPortSysTickHandler SysTick_Handler
#endif
#ifndef SEMI_LOAD_MEASUREMENT
// To measure mcu load by measure time used in the dummy idle task
#define traceTASK_SWITCHED_OUT() xTaskCallApplicationTaskHook( pxCurrentTCB, (void*)1 )
#define traceTASK_SWITCHED_IN() xTaskCallApplicationTaskHook( pxCurrentTCB, (void*)0 )
#endif // SEMI_LOAD_MEASUREMENT
#ifdef __cplusplus
}
#endif
#endif /* FREERTOS_CONFIG_H */
PK
uv.Q JPEG_file_loader/gui/PK
uv.Q JPEG_file_loader/gui/src/PK
uv.Q ) JPEG_file_loader/gui/src/template_screen/PK
uv.Q$ > JPEG_file_loader/gui/src/template_screen/TemplatePresenter.cpp#include
#include
TemplatePresenter::TemplatePresenter(TemplateView& v)
: view(v)
{
}
void TemplatePresenter::activate()
{
}
void TemplatePresenter::deactivate()
{
}
PK
uv.Q%. . 9 JPEG_file_loader/gui/src/template_screen/TemplateView.cpp#include
#include
#include
#include
//buffer needed by LibJPEG when decoding
uint8_t lineBuffer[320*3];
void TemplateView::setupScreen()
{
FILE* f = fopen("image.jpg", "rb");
uint16_t width, height;
JPEGFileLoader::getJPEGDimensions(f, width, height);
BitmapId bmpId;
//create dynamic bitmap matching file dimensions and in format matching LCD
if (HAL::lcd().bitDepth() == 16)
{
bmpId = Bitmap::dynamicBitmapCreate(width, height, Bitmap::RGB565);
}
else
{
bmpId = Bitmap::dynamicBitmapCreate(width, height, Bitmap::RGB888);
}
if (bmpId != BITMAP_INVALID)
{
//Succesfully created, load JPEG file to bitmap
JPEGFileLoader::readJPEGFile(Bitmap(bmpId), f, lineBuffer);
}
//Image shall show the loaded bitmap
image.setBitmap(Bitmap(bmpId));
//Position image and add to View
image.setXY(20, 20);
add(image);
}
void TemplateView::tearDownScreen()
{
}
PK
uv.Q JPEG_file_loader/gui/src/model/PK
uv.Q( ( JPEG_file_loader/gui/src/model/Model.cpp#include
#include
Model::Model() : modelListener(0)
{
}
void Model::tick()
{
}
PK
uv.Q JPEG_file_loader/gui/src/common/PK
uv.Q 7 JPEG_file_loader/gui/src/common/FrontendApplication.cpp#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace touchgfx;
FrontendApplication::FrontendApplication(Model& m, FrontendHeap& heap)
: touchgfx::MVPApplication(),
transitionCallback(),
frontendHeap(heap),
model(m)
{
}
void FrontendApplication::gotoTemplateScreen()
{
transitionCallback = touchgfx::Callback< FrontendApplication >(this, &FrontendApplication::gotoTemplateScreenImpl);
pendingScreenTransitionCallback = &transitionCallback;
}
void FrontendApplication::gotoTemplateScreenImpl()
{
makeTransition< TemplateView, TemplatePresenter, touchgfx::NoTransition, Model >(¤tScreen, ¤tPresenter, frontendHeap, ¤tTransition, &model);
}
PK
uv.QS 2 JPEG_file_loader/gui/src/common/JPEGFileLoader.cpp#include
#include
#include "jinclude.h"
#include "jpeglib.h"
namespace
{
struct RGB
{
uint8_t R;
uint8_t G;
uint8_t B;
};
}
void JPEGFileLoader::getJPEGDimensions(fileinput::FileHdl fileHandle, uint16_t& width, uint16_t& height)
{
fileinput::seekFile(fileHandle, 0);
/* This struct contains the JPEG decompression parameters */
struct jpeg_decompress_struct cinfo;
/* This struct represents a JPEG error handler */
struct jpeg_error_mgr jerr;
/* Step 1: allocate and initialize JPEG decompression object */
cinfo.err = jpeg_std_error(&jerr);
/* Initialize the JPEG decompression object */
jpeg_create_decompress(&cinfo);
// setup to read from file
jpeg_stdio_src(&cinfo, (FILE*)fileHandle);
/* Step 3: read image parameters with jpeg_read_header() */
jpeg_read_header(&cinfo, TRUE);
/* Copy dimensions */
width = cinfo.image_width;
height = cinfo.image_height;
/* Step 7: Release JPEG decompression object */
jpeg_destroy_decompress(&cinfo);
}
void JPEGFileLoader::readJPEGFile(Bitmap bitmap, fileinput::FileHdl fileHandle, uint8_t* lineBuffer)
{
/* This struct contains the JPEG decompression parameters */
struct jpeg_decompress_struct cinfo;
/* This struct represents a JPEG error handler */
struct jpeg_error_mgr jerr;
JSAMPROW lines[2] = {lineBuffer, 0}; /* Output row buffer */
/* Step 0: Seek to start of file */
fileinput::seekFile(fileHandle, 0);
/* Step 1: allocate and initialize JPEG decompression object */
cinfo.err = jpeg_std_error(&jerr);
/* Initialize the JPEG decompression object */
jpeg_create_decompress(&cinfo);
// setup to read from file
jpeg_stdio_src(&cinfo, fileHandle);
/* Step 3: read image parameters with jpeg_read_header() */
jpeg_read_header(&cinfo, TRUE);
/* Step 4: set parameters for decompression */
cinfo.dct_method = JDCT_FLOAT;
/* Step 5: start decompressor */
jpeg_start_decompress(&cinfo);
const uint32_t bitmap_width = bitmap.getWidth();
const uint32_t bitmap_height = bitmap.getHeight();
const uint32_t output_width = MIN(bitmap_width, cinfo.image_width);
const uint32_t output_height = MIN(bitmap_height, cinfo.output_height);
const Bitmap::BitmapFormat format = bitmap.getFormat();
uint8_t* const buffer8 = Bitmap::dynamicBitmapGetAddress(bitmap.getId());
uint16_t* const buffer16 = (uint16_t*)buffer8;
switch (format)
{
case Bitmap::RGB565:
{
uint16_t *lineptr = buffer16;
while (cinfo.output_scanline < output_height)
{
(void) jpeg_read_scanlines(&cinfo, lines, 1);
RGB* RGB_matrix = (RGB*)lineBuffer;
//loop row
for(uint32_t counter = 0; counter < output_width; counter++)
{
const uint16_t pix = ((RGB_matrix[counter].R&0xF8) << 8) | ((RGB_matrix[counter].G&0xFC) << 3) | ((RGB_matrix[counter].B&0xF7)>>3);
*(lineptr + counter) = pix;
}
lineptr += bitmap_width; //move to next line
}
break;
}
case Bitmap::RGB888:
{
uint8_t* lineptr = buffer8;
while (cinfo.output_scanline < output_height)
{
(void) jpeg_read_scanlines(&cinfo, lines, 1);
RGB* RGB_matrix = (RGB*)lineBuffer;
//loop row
for(uint32_t counter = 0; counter < output_width; counter++)
{
*lineptr++ = RGB_matrix[counter].B;
*lineptr++ = RGB_matrix[counter].G;
*lineptr++ = RGB_matrix[counter].R;
}
//advance to next row in bitmap
if (output_width < bitmap_width)
{
lineptr += (bitmap_width - output_width)*3;
}
}
break;
}
default:
assert(!"Unsupported bitmap format in JPEGFileLoader!");
}
/* Step 6: Finish decompression */
jpeg_finish_decompress(&cinfo);
/* Step 7: Release JPEG decompression object */
jpeg_destroy_decompress(&cinfo);
}
PK
uv.Q-( ( 1 JPEG_file_loader/gui/src/common/JPEGFileInput.cpp#include
#include "jinclude.h"
//link LibJPEG file read operation to touchgfx::fileinput function.
extern "C"
{
size_t jpeg_read_file (FILE *file, uint8_t *buf, uint32_t sizeofbuf)
{
return touchgfx::fileinput::readFile(file, buf, sizeofbuf);
}
}
PK
uv.Q JPEG_file_loader/gui/include/PK
uv.Q ! JPEG_file_loader/gui/include/gui/PK
uv.Q 1 JPEG_file_loader/gui/include/gui/template_screen/PK
uv.QlW F JPEG_file_loader/gui/include/gui/template_screen/TemplatePresenter.hpp#ifndef TEMPLATE_PRESENTER_HPP
#define TEMPLATE_PRESENTER_HPP
#include
#include
using namespace touchgfx;
class TemplateView;
/**
* The Presenter for a template screen. In the MVP paradigm, the presenter acts upon
* events from the model and the view. By deriving from ModelListener, the presenter
* implements the interface which the model uses to inform the current presenter of
* events and model state changes. The presenter also contains a reference to the
* associated view, and uses this to update the view accordingly.
*
*/
class TemplatePresenter : public Presenter, public ModelListener
{
public:
TemplatePresenter(TemplateView& v);
/**
* The activate function is called automatically when this screen is "switched in"
* (ie. made active). Initialization logic can be placed here.
*/
virtual void activate();
/**
* The deactivate function is called automatically when this screen is "switched out"
* (ie. made inactive). Teardown functionality can be placed here.
*/
virtual void deactivate();
virtual ~TemplatePresenter() {};
private:
TemplatePresenter();
TemplateView& view;
};
#endif // TEMPLATE_PRESENTER_HPP
PK
uv.QͭfO 0 JPEG_file_loader/gui/src/common/StdFileInput.cpp#include
//Implementation of fileinput using standard libc functions
#include
namespace touchgfx
{
namespace fileinput
{
int readFile(fileinput::FileHdl hdl, uint8_t* const buffer, uint32_t length)
{
uint32_t r = fread(buffer, 1, length, (FILE*)hdl);
return (int)r;
}
void seekFile(FileHdl hdl, uint32_t offset)
{
fseek((FILE*)hdl, offset, SEEK_SET);
}
}
}
PK
uv.Qܦ A JPEG_file_loader/gui/include/gui/template_screen/TemplateView.hpp#ifndef TEMPLATE_VIEW_HPP
#define TEMPLATE_VIEW_HPP
#include
#include
#include
using namespace touchgfx;
/**
* The View for a template screen. In the MVP paradigm, the view is a
* passive interface that only displays the user interface and routes
* any events from the user interface to the presenter. Normally it is the
* responsibility of the presenter to act upon those events.
*
* By deriving from View, this class has a presenter pointer, which is configured
* automatically.
*/
class TemplateView : public View
{
public:
/**
* The view constructor. Note that the constructor runs before the new screen is
* completely initialized, so do not place code here that causes anything to be drawn.
* Use the setupScreen function instead.
*/
TemplateView()
{
}
virtual ~TemplateView() { }
/**
* This function is called automatically when the view is activated. This function
* should add widgets to the root container, configure widget sizes and event
* callbacks, et cetera.
*/
virtual void setupScreen();
/**
* This function is called automatically when transitioning to a different screen
* than this one. Can optionally be used to clean up.
*/
virtual void tearDownScreen();
private:
Image image;
};
#endif // TEMPLATE_VIEW_HPP
PK
uv.Q ' JPEG_file_loader/gui/include/gui/model/PK
uv.Q< 0 JPEG_file_loader/gui/include/gui/model/Model.hpp#ifndef MODEL_HPP
#define MODEL_HPP
class ModelListener;
/**
* The Model class defines the data model in the model-view-presenter paradigm.
* The Model is a singular object used across all presenters. The currently active
* presenter will have a pointer to the Model through deriving from ModelListener.
*
* The Model will typically contain UI state information that must be kept alive
* through screen transitions. It also usually provides the interface to the rest
* of the system (the backend). As such, the Model can receive events and data from
* the backend and inform the current presenter of such events through the modelListener
* pointer, which is automatically configured to point to the current presenter.
* Conversely, the current presenter can trigger events in the backend through the Model.
*/
class Model
{
public:
Model();
/**
* Sets the modelListener to point to the currently active presenter. Called automatically
* when switching screen.
*/
void bind(ModelListener* listener)
{
modelListener = listener;
}
/**
* This function will be called automatically every frame. Can be used to e.g. sample hardware
* peripherals or read events from the surrounding system and inject events to the GUI through
* the ModelListener interface.
*/
void tick();
protected:
/**
* Pointer to the currently active presenter.
*/
ModelListener* modelListener;
};
#endif /* MODEL_HPP */
PK
uv.QcM< < 8 JPEG_file_loader/gui/include/gui/model/ModelListener.hpp#ifndef MODELLISTENER_HPP
#define MODELLISTENER_HPP
#include
/**
* ModelListener is the interface through which the Model can inform the currently
* active presenter of events. All presenters should derive from this class.
* It also provides a model pointer for the presenter to interact with the Model.
*
* The bind function is called automatically.
*
* Add the virtual functions Model should be able to call on the active presenter to this class.
*/
class ModelListener
{
public:
ModelListener() : model(0) {}
virtual ~ModelListener() {}
/**
* Sets the model pointer to point to the Model object. Called automatically
* when switching screen.
*/
void bind(Model* m)
{
model = m;
}
protected:
Model* model;
};
#endif /* MODELLISTENER_HPP */
PK
uv.Q ( JPEG_file_loader/gui/include/gui/common/PK
uv.QCB" 5 JPEG_file_loader/gui/include/gui/common/FileInput.hpp#ifndef FILE_INPUT_HPP
#define FILE_INPUT_HPP
#include
namespace touchgfx
{
namespace fileinput
{
//type used for file handles
typedef void* FileHdl;
/**
* @fn int readFile(FileHdl hdl, uint8_t* const buffer, uint32_t length);
*
* @brief Read data from a file
*
* Read data from an open file.
*
* @param hdl Handle to file.
* @param buffer The buffer to data into.
* @param length The number of bytes to read.
*
* @return Actual number of bytes read.
*/
int readFile(FileHdl hdl, uint8_t* const buffer, uint32_t length);
/**
* @fn void seekFile(FileHdl hdl, uint32_t offset);
*
* @brief Seek in a file
*
* Seek in an open file. The offset is from the beginning
* of the file.
*
* @param hdl Handle to file.
* @param offset The offset to seek to.
*/
void seekFile(FileHdl hdl, uint32_t offset);
}
}
#endif
PK
uv.Q4a ? JPEG_file_loader/gui/include/gui/common/FrontendApplication.hpp#ifndef FRONTENDAPPLICATION_HPP
#define FRONTENDAPPLICATION_HPP
#include
#include
#include
using namespace touchgfx;
class FrontendHeap;
/**
* The FrontendApplication is the concrete implementation of an MVPApplication
* for a specific application. Its primary job is to provide functions for
* switching between screens (presenter/view pairs). By convention these functions
* are usually called gotoXXScreen().
*
* Note that the base class Application is a singleton. Switching screen can be done
* from anywhere (usually presenters) by e.g. the following:
* static_cast(Application::getInstance())->gotoXXScreen();
*/
class FrontendApplication : public MVPApplication
{
public:
FrontendApplication(Model& m, FrontendHeap& heap);
virtual ~FrontendApplication() { }
/**
* Request a transition to the "Template" screen. The actual switching will
* be done at next tick (by gotoTemplateScreenImpl).
*
* @note The reason for not switching immediately is that the new presenter and view
* reuse the same memory as the current ones, so the switch cannot occur instantaneously
* since that would cause memory corruption at the point of calling this function.
*/
void gotoTemplateScreen();
/**
* Called automatically every frame. Will call tick on the model and then delegate
* the tick event to the framework for further processing.
*/
virtual void handleTickEvent()
{
model.tick();
MVPApplication::handleTickEvent();
}
private:
Callback transitionCallback;
FrontendHeap& frontendHeap;
Model& model;
void gotoTemplateScreenImpl();
};
#endif /* FRONTENDAPPLICATION_HPP */
PK
uv.Qn[Q^ ^ 8 JPEG_file_loader/gui/include/gui/common/FrontendHeap.hpp#ifndef FRONTENDHEAP_HPP
#define FRONTENDHEAP_HPP
#include
#include
#include
#include
#include
#include
#include
#include
/**
* This class provides the memory that shall be used for memory allocations
* in the frontend. A single instance of the FrontendHeap is allocated once (in heap
* memory), and all other frontend objects such as views, presenters and data model are
* allocated within the scope of this FrontendHeap. As such, the RAM usage of the entire
* user interface is sizeof(FrontendHeap).
*
* @note The FrontendHeap reserves memory for the most memory-consuming presenter and
* view only. The largest of these classes are determined at compile-time using template
* magic. As such, it is important to add all presenters, views and transitions to the
* type lists in this class.
*
*/
class FrontendHeap : public MVPHeap
{
public:
/**
* A list of all view types. Must end with meta::Nil.
* @note All view types used in the application MUST be added to this list!
*/
typedef meta::TypeList< TemplateView,
meta::Nil
> ViewTypes;
/**
* Determine (compile time) the View type of largest size.
*/
typedef meta::select_type_maxsize< ViewTypes >::type MaxViewType;
/**
* A list of all presenter types. Must end with meta::Nil.
* @note All presenter types used in the application MUST be added to this list!
*/
typedef meta::TypeList< TemplatePresenter,
meta::Nil
> PresenterTypes;
/**
* Determine (compile time) the Presenter type of largest size.
*/
typedef meta::select_type_maxsize< PresenterTypes >::type MaxPresenterType;
/**
* A list of all transition types. Must end with meta::Nil.
* @note All transition types used in the application MUST be added to this list!
*/
typedef meta::TypeList< NoTransition,
meta::Nil
> TransitionTypes;
/**
* Determine (compile time) the Transition type of largest size.
*/
typedef meta::select_type_maxsize< TransitionTypes >::type MaxTransitionType;
static FrontendHeap& getInstance()
{
static FrontendHeap instance;
return instance;
}
Partition< PresenterTypes, 1 > presenters;
Partition< ViewTypes, 1 > views;
Partition< TransitionTypes, 1 > transitions;
FrontendApplication app;
Model model;
private:
FrontendHeap()
: MVPHeap(presenters, views, transitions, app),
presenters(),
views(),
transitions(),
app(model, *this)
{
// Goto start screen
app.gotoTemplateScreen();
}
};
#endif
PK
uv.QZ@P P : JPEG_file_loader/gui/include/gui/common/JPEGFileLoader.hpp#include
#include
#include
using namespace touchgfx;
namespace touchgfx
{
class JPEGFileLoader
{
public:
/**
* @fn static void getJPEGDimensions(fileinput::FileHdl fileHandle, uint16_t& width, uint16_t& height);
*
* @brief Reads width and height of JPEG image in a file
*
* Reads width and height of JPEG image in a file. The file must
* be open. The function will call fileinput::seekFile and
* fileinput::readFile.
*/
static void getJPEGDimensions(fileinput::FileHdl fileHandle, uint16_t& width, uint16_t& height);
/**
* @fn static void readJPEGFile(Bitmap bitmap, fileinput::FileHdl fileHandle, uint8_t* lineBuffer);
*
* @brief Reads JPEG image from a file to a dynamic bitmap.
*
* Reads JPEG image from a file to a dynamic bitmap. The file must
* be open. The function will call fileinput::seekFile and
* fileinput::readFile.
*/
static void readJPEGFile(Bitmap bitmap, fileinput::FileHdl fileHandle, uint8_t* lineBuffer);
};
}
PK
uv.Q JPEG_file_loader/config/PK
uv.Q JPEG_file_loader/config/msvs/PK
uv.QN4e e . JPEG_file_loader/config/msvs/Application.props
16false$(ProjectDir)..\..\..\..\..\touchgfxyesRGB565ARGB8888$(ProjectDir)..\..$(RotateImage90)$(TouchGFXReleasePath)$(AlphaDitherImage)$(OpaqueImageOutputFormat)$(NonOpaqueImageOutputFormat)$(TextDataFormat)
PK
uv.Q JPEG_file_loader/config/gcc/PK
uv.Q<* " JPEG_file_loader/config/gcc/app.mk# Relative location of the TouchGFX framework from root of application
touchgfx_path := ../../../touchgfx
# Optional additional compiler flags
user_cflags := -DUSE_BPP=24
# Settings for image converter output format
alpha_dither := yes
opaque_image_format := RGB565
non_opaque_image_format := ARGB8888
# Settings for image converter screen orientation (empty string = default value, -rotate90 rotates the image 90 degrees)
screen_orientation :=
#Settings for Hardware accelerated text rendering on STM32F4 and F7 devices. Must correspond to value of bitsPerPixel for font to have any effect.
#If A4 blitcap is enabled for target specific HAL the fontconverter must generate compliant data format, otherwise resulting in a DMA Controller Configuration Error.
text_data_format :=
PK
uv.Q JPEG_file_loader/assets/PK
uv.Q JPEG_file_loader/assets/texts/PK
uv.Q+xԡ[ [ ( JPEG_file_loader/assets/texts/texts.xlsxPK ! " [Content_Types].xml ( UN0#q[$PXT 7$VL{&. (j$Ċyl4fbE6w2/k )U,db(f&lm1
`pQĿ^KUW2wҀZ1AV5%k*Y+*X|A|0t>XPS>fs bPȝjFUʖQV=է#
ɳ
]kr2=541Di}?^FQBZ"pGt9{zJ"̑ mj0cT ='~e~bAjqD}Q~ny.{|zn7#AqM? PK ! U0# L _rels/.rels ( MO0HݐBKwAH!T~I$ݿ'TG~