From da0d61770a1eaebf90f92d432cde7f6e602da7da Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 26 Sep 2012 11:59:00 +0200 Subject: [PATCH] gui: move gui file to include/gui and lib/gui Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD Signed-off-by: Sascha Hauer --- commands/Kconfig | 23 ++++++++++++------ commands/splash.c | 4 +-- drivers/video/sdl.c | 2 +- include/{ => gui}/graphic_utils.h | 0 include/gui/image.h | 20 +++++++++++++++ include/{ => gui}/image_renderer.h | 9 +------ lib/Kconfig | 36 +-------------------------- lib/Makefile | 6 +---- lib/gui/Kconfig | 39 ++++++++++++++++++++++++++++++ lib/gui/Makefile | 5 ++++ lib/{ => gui}/bmp.c | 4 +-- lib/{ => gui}/bmp_layout.h | 0 lib/{ => gui}/graphic_utils.c | 2 +- lib/{ => gui}/image_renderer.c | 2 +- lib/{ => gui}/lodepng.c | 0 lib/{ => gui}/lodepng.h | 0 lib/{ => gui}/picopng.c | 0 lib/{ => gui}/picopng.h | 0 lib/{ => gui}/png.c | 4 +-- lib/{ => gui}/png.h | 0 lib/{ => gui}/png_lode.c | 4 +-- lib/{ => gui}/png_pico.c | 4 +-- 22 files changed, 95 insertions(+), 69 deletions(-) rename include/{ => gui}/graphic_utils.h (100%) create mode 100644 include/gui/image.h rename include/{ => gui}/image_renderer.h (94%) create mode 100644 lib/gui/Kconfig create mode 100644 lib/gui/Makefile rename lib/{ => gui}/bmp.c (97%) rename lib/{ => gui}/bmp_layout.h (100%) rename lib/{ => gui}/graphic_utils.c (99%) rename lib/{ => gui}/image_renderer.c (98%) rename lib/{ => gui}/lodepng.c (100%) rename lib/{ => gui}/lodepng.h (100%) rename lib/{ => gui}/picopng.c (100%) rename lib/{ => gui}/picopng.h (100%) rename lib/{ => gui}/png.c (96%) rename lib/{ => gui}/png.h (100%) rename lib/{ => gui}/png_lode.c (96%) rename lib/{ => gui}/png_pico.c (96%) diff --git a/commands/Kconfig b/commands/Kconfig index cf4142008..e934f29d5 100644 --- a/commands/Kconfig +++ b/commands/Kconfig @@ -494,6 +494,21 @@ config CMD_MTEST_ALTERNATIVE endmenu +menu "video command " + +if VIDEO + +config CMD_SPLASH + bool + select IMAGE_RENDERER + prompt "splash" + help + show bmp files on framebuffer devices + +endif + +endmenu + config CMD_TIMEOUT tristate prompt "timeout" @@ -557,14 +572,6 @@ config CMD_LSMOD depends on MODULES prompt "lsmod" -config CMD_SPLASH - bool - depends on VIDEO - select IMAGE_RENDERER - prompt "splash" - help - show bmp files on framebuffer devices - config CMD_GPIO bool depends on GENERIC_GPIO diff --git a/commands/splash.c b/commands/splash.c index f40e3e1ec..615b1cbc0 100644 --- a/commands/splash.c +++ b/commands/splash.c @@ -7,8 +7,8 @@ #include #include #include -#include -#include +#include +#include static int do_splash(int argc, char *argv[]) { diff --git a/drivers/video/sdl.c b/drivers/video/sdl.c index 5031d7a7f..0021a0686 100644 --- a/drivers/video/sdl.c +++ b/drivers/video/sdl.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include static void sdlfb_enable(struct fb_info *info) { diff --git a/include/graphic_utils.h b/include/gui/graphic_utils.h similarity index 100% rename from include/graphic_utils.h rename to include/gui/graphic_utils.h diff --git a/include/gui/image.h b/include/gui/image.h new file mode 100644 index 000000000..ea423b259 --- /dev/null +++ b/include/gui/image.h @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2012 Jean-Christophe PLAGNIOL-VILLARD + * + * GPL v2 + */ + +#ifndef __GUI_IMAGE_H__ +#define __GUI_IMAGE_H__ + +struct image_renderer; + +struct image { + void *data; + struct image_renderer *ir; + int height; + int width; + int bits_per_pixel; +}; + +#endif /* __IMAGE_RENDERER_H__ */ diff --git a/include/image_renderer.h b/include/gui/image_renderer.h similarity index 94% rename from include/image_renderer.h rename to include/gui/image_renderer.h index 0b686e168..5ee996944 100644 --- a/include/image_renderer.h +++ b/include/gui/image_renderer.h @@ -12,14 +12,7 @@ #include #include #include - -struct image { - void *data; - struct image_renderer *ir; - int height; - int width; - int bits_per_pixel; -}; +#include struct image_renderer { enum filetype type; diff --git a/lib/Kconfig b/lib/Kconfig index 8b7373373..9882d2d6d 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -38,40 +38,6 @@ config BITREV config QSORT bool -config IMAGE_RENDERER - bool - depends on VIDEO - select FILETYPE - -if IMAGE_RENDERER - -config BMP - bool "bmp" - -config PNG - bool "png" - select ZLIB - -if PNG - -choice - prompt "PNG Lib" - -config LODEPNG - bool "lodePNG" - help - This PNG library supports most PNG formats. - -config PICOPNG - bool "picoPNG" - help - This PNG library only supports RGBA PNG8 but is much smaller - in binary size than lodepng. - -endchoice - -endif - -endif +source lib/gui/Kconfig endmenu diff --git a/lib/Makefile b/lib/Makefile index 7bce0e58c..41e6a0f92 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -34,8 +34,4 @@ obj-$(CONFIG_UNCOMPRESS) += uncompress.o obj-$(CONFIG_BCH) += bch.o obj-$(CONFIG_BITREV) += bitrev.o obj-$(CONFIG_QSORT) += qsort.o -obj-$(CONFIG_BMP) += bmp.o -obj-$(CONFIG_IMAGE_RENDERER) += image_renderer.o graphic_utils.o -obj-$(CONFIG_PNG) += png.o -obj-$(CONFIG_LODEPNG) += png_lode.o lodepng.o -obj-$(CONFIG_PICOPNG) += png_pico.o picopng.o +obj-y += gui/ diff --git a/lib/gui/Kconfig b/lib/gui/Kconfig new file mode 100644 index 000000000..8fd12fb60 --- /dev/null +++ b/lib/gui/Kconfig @@ -0,0 +1,39 @@ +menu "Library gui routines " + +config IMAGE_RENDERER + bool + depends on VIDEO + select FILETYPE + +if IMAGE_RENDERER + +config BMP + bool "bmp" + +config PNG + bool "png" + select ZLIB + +if PNG + +choice + prompt "PNG Lib" + +config LODEPNG + bool "lodePNG" + help + This PNG library supports most PNG formats. + +config PICOPNG + bool "picoPNG" + help + This PNG library only supports RGBA PNG8 but is much smaller + in binary size than lodepng. + +endchoice + +endif + +endif + +endmenu diff --git a/lib/gui/Makefile b/lib/gui/Makefile new file mode 100644 index 000000000..d4b26c47b --- /dev/null +++ b/lib/gui/Makefile @@ -0,0 +1,5 @@ +obj-$(CONFIG_BMP) += bmp.o +obj-$(CONFIG_IMAGE_RENDERER) += image_renderer.o graphic_utils.o +obj-$(CONFIG_PNG) += png.o +obj-$(CONFIG_LODEPNG) += png_lode.o lodepng.o +obj-$(CONFIG_PICOPNG) += png_pico.o picopng.o diff --git a/lib/bmp.c b/lib/gui/bmp.c similarity index 97% rename from lib/bmp.c rename to lib/gui/bmp.c index f5c19616d..86591edfd 100644 --- a/lib/bmp.c +++ b/lib/gui/bmp.c @@ -4,9 +4,9 @@ #include #include "bmp_layout.h" #include -#include +#include #include -#include +#include struct image *bmp_open(char *inbuf, int insize) { diff --git a/lib/bmp_layout.h b/lib/gui/bmp_layout.h similarity index 100% rename from lib/bmp_layout.h rename to lib/gui/bmp_layout.h diff --git a/lib/graphic_utils.c b/lib/gui/graphic_utils.c similarity index 99% rename from lib/graphic_utils.c rename to lib/gui/graphic_utils.c index a435bdd1e..bf42103b4 100644 --- a/lib/graphic_utils.c +++ b/lib/gui/graphic_utils.c @@ -1,6 +1,6 @@ #include #include -#include +#include static u32 get_pixel(struct fb_info *info, u32 color) { diff --git a/lib/image_renderer.c b/lib/gui/image_renderer.c similarity index 98% rename from lib/image_renderer.c rename to lib/gui/image_renderer.c index fff35bd12..99e4335d0 100644 --- a/lib/image_renderer.c +++ b/lib/gui/image_renderer.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff --git a/lib/lodepng.c b/lib/gui/lodepng.c similarity index 100% rename from lib/lodepng.c rename to lib/gui/lodepng.c diff --git a/lib/lodepng.h b/lib/gui/lodepng.h similarity index 100% rename from lib/lodepng.h rename to lib/gui/lodepng.h diff --git a/lib/picopng.c b/lib/gui/picopng.c similarity index 100% rename from lib/picopng.c rename to lib/gui/picopng.c diff --git a/lib/picopng.h b/lib/gui/picopng.h similarity index 100% rename from lib/picopng.h rename to lib/gui/picopng.h diff --git a/lib/png.c b/lib/gui/png.c similarity index 96% rename from lib/png.c rename to lib/gui/png.c index f71fc6abc..5d77c8ce5 100644 --- a/lib/png.c +++ b/lib/gui/png.c @@ -4,8 +4,8 @@ #include #include #include -#include -#include +#include +#include #include #include "png.h" diff --git a/lib/png.h b/lib/gui/png.h similarity index 100% rename from lib/png.h rename to lib/gui/png.h diff --git a/lib/png_lode.c b/lib/gui/png_lode.c similarity index 96% rename from lib/png_lode.c rename to lib/gui/png_lode.c index 4b57f6ad2..477704d97 100644 --- a/lib/png_lode.c +++ b/lib/gui/png_lode.c @@ -4,8 +4,8 @@ #include #include #include -#include -#include +#include +#include #include #include "lodepng.h" diff --git a/lib/png_pico.c b/lib/gui/png_pico.c similarity index 96% rename from lib/png_pico.c rename to lib/gui/png_pico.c index a0127f767..393a732bc 100644 --- a/lib/png_pico.c +++ b/lib/gui/png_pico.c @@ -4,8 +4,8 @@ #include #include #include -#include -#include +#include +#include #include #include "picopng.h"