move Test_XXX/Load_XXX/Save_XXX functions prototypes to fileformats.h

This commit is contained in:
Thomas Bernard 2018-03-12 00:17:31 +01:00
parent ebaccbab3e
commit b039977f5f
5 changed files with 147 additions and 113 deletions

View File

@ -22,7 +22,7 @@ $(OBJDIR)/factory.o: factory.c brush.h struct.h const.h buttons.h loadsave.h \
readline.h sdlscreen.h windows.h palette.h input.h help.h realpath.h \ readline.h sdlscreen.h windows.h palette.h input.h help.h realpath.h \
setup.h tiles.h setup.h tiles.h
$(OBJDIR)/fileformats.o: fileformats.c errors.h global.h struct.h const.h \ $(OBJDIR)/fileformats.o: fileformats.c errors.h global.h struct.h const.h \
loadsave.h misc.h io.h pages.h windows.h loadsave.h misc.h io.h pages.h windows.h fileformats.h
$(OBJDIR)/filesel.o: filesel.c const.h struct.h global.h misc.h errors.h io.h \ $(OBJDIR)/filesel.o: filesel.c const.h struct.h global.h misc.h errors.h io.h \
windows.h sdlscreen.h loadsave.h mountlist.h engine.h readline.h input.h \ windows.h sdlscreen.h loadsave.h mountlist.h engine.h readline.h input.h \
help.h unicode.h filesel.h help.h unicode.h filesel.h
@ -49,7 +49,8 @@ $(OBJDIR)/loadrecoil.o: loadrecoil.c struct.h const.h global.h loadsave.h io.h \
errors.h recoil.h errors.h recoil.h
$(OBJDIR)/loadsave.o: loadsave.c buttons.h struct.h const.h loadsave.h errors.h \ $(OBJDIR)/loadsave.o: loadsave.c buttons.h struct.h const.h loadsave.h errors.h \
global.h io.h misc.h graph.h op_c.h colorred.h pages.h palette.h \ global.h io.h misc.h graph.h op_c.h colorred.h pages.h palette.h \
sdlscreen.h windows.h engine.h brush.h setup.h filesel.h unicode.h sdlscreen.h windows.h engine.h brush.h setup.h filesel.h unicode.h \
fileformats.h
$(OBJDIR)/main.o: main.c const.h struct.h global.h graph.h misc.h init.h buttons.h \ $(OBJDIR)/main.o: main.c const.h struct.h global.h graph.h misc.h init.h buttons.h \
loadsave.h engine.h pages.h sdlscreen.h errors.h readini.h saveini.h \ loadsave.h engine.h pages.h sdlscreen.h errors.h readini.h saveini.h \
io.h text.h setup.h windows.h brush.h palette.h realpath.h input.h \ io.h text.h setup.h windows.h brush.h palette.h realpath.h input.h \
@ -59,7 +60,7 @@ $(OBJDIR)/misc.o: misc.c struct.h const.h sdlscreen.h global.h errors.h buttons.
graph.h pages.h graph.h pages.h
$(OBJDIR)/miscfileformats.o: miscfileformats.c engine.h struct.h const.h errors.h \ $(OBJDIR)/miscfileformats.o: miscfileformats.c engine.h struct.h const.h errors.h \
global.h io.h libraw2crtc.h loadsave.h misc.h sdlscreen.h windows.h \ global.h io.h libraw2crtc.h loadsave.h misc.h sdlscreen.h windows.h \
oldies.h oldies.h fileformats.h
$(OBJDIR)/mountlist.o: mountlist.c mountlist.h $(OBJDIR)/mountlist.o: mountlist.c mountlist.h
$(OBJDIR)/oldies.o: oldies.c struct.h const.h global.h errors.h misc.h palette.h \ $(OBJDIR)/oldies.o: oldies.c struct.h const.h global.h errors.h misc.h palette.h \
pages.h windows.h layers.h pages.h windows.h layers.h

View File

@ -68,6 +68,7 @@
#include "io.h" #include "io.h"
#include "pages.h" #include "pages.h"
#include "windows.h" // Best_color() #include "windows.h" // Best_color()
#include "fileformats.h"
#ifndef __no_pnglib__ #ifndef __no_pnglib__
static void Load_PNG_Sub(T_IO_Context * context, FILE * file); static void Load_PNG_Sub(T_IO_Context * context, FILE * file);

140
src/fileformats.h Normal file
View File

@ -0,0 +1,140 @@
/* vim:expandtab:ts=2 sw=2:
*/
/* Grafx2 - The Ultimate 256-color bitmap paint program
Copyright 2018 Thomas Bernard
Copyright 1996-2001 Sunset Design (Guillaume Dorme & Karl Maritaud)
Grafx2 is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2
of the License.
Grafx2 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
along with Grafx2; if not, see <http://www.gnu.org/licenses/>
*/
///@file fileformats.h
/// Saving and loading different picture formats.
#ifndef FILEFORMATS_H_INCLUDED
#define FILEFORMATS_H_INCLUDED
#include "loadsave.h"
// -- PKM -------------------------------------------------------------------
void Test_PKM(T_IO_Context *);
void Load_PKM(T_IO_Context *);
void Save_PKM(T_IO_Context *);
// -- IFF -------------------------------------------------------------------
void Test_LBM(T_IO_Context *);
void Test_PBM(T_IO_Context *);
void Test_ACBM(T_IO_Context *);
void Load_IFF(T_IO_Context *);
void Save_IFF(T_IO_Context *);
// -- GIF -------------------------------------------------------------------
void Test_GIF(T_IO_Context *);
void Load_GIF(T_IO_Context *);
void Save_GIF(T_IO_Context *);
// -- PCX -------------------------------------------------------------------
void Test_PCX(T_IO_Context *);
void Load_PCX(T_IO_Context *);
void Save_PCX(T_IO_Context *);
// -- BMP -------------------------------------------------------------------
void Test_BMP(T_IO_Context *);
void Load_BMP(T_IO_Context *);
void Save_BMP(T_IO_Context *);
// -- IMG -------------------------------------------------------------------
void Test_IMG(T_IO_Context *);
void Load_IMG(T_IO_Context *);
void Save_IMG(T_IO_Context *);
// -- SCx -------------------------------------------------------------------
void Test_SCx(T_IO_Context *);
void Load_SCx(T_IO_Context *);
void Save_SCx(T_IO_Context *);
// -- CEL -------------------------------------------------------------------
void Test_CEL(T_IO_Context *);
void Load_CEL(T_IO_Context *);
void Save_CEL(T_IO_Context *);
// -- KCF -------------------------------------------------------------------
void Test_KCF(T_IO_Context *);
void Load_KCF(T_IO_Context *);
void Save_KCF(T_IO_Context *);
// -- PAL -------------------------------------------------------------------
void Test_PAL(T_IO_Context *);
void Load_PAL(T_IO_Context *);
void Save_PAL(T_IO_Context *);
// -- GPL -------------------------------------------------------------------
void Test_GPL(T_IO_Context *);
void Load_GPL(T_IO_Context *);
void Save_GPL(T_IO_Context *);
// -- PI1 -------------------------------------------------------------------
void Test_PI1(T_IO_Context *);
void Load_PI1(T_IO_Context *);
void Save_PI1(T_IO_Context *);
// -- PC1 -------------------------------------------------------------------
void Test_PC1(T_IO_Context *);
void Load_PC1(T_IO_Context *);
void Save_PC1(T_IO_Context *);
// -- NEO -------------------------------------------------------------------
void Test_NEO(T_IO_Context *);
void Load_NEO(T_IO_Context *);
void Save_NEO(T_IO_Context *);
// -- C64 -------------------------------------------------------------------
void Test_C64(T_IO_Context *);
void Load_C64(T_IO_Context *);
void Save_C64(T_IO_Context *);
// -- SCR (Amstrad CPC)
void Save_SCR(T_IO_Context *);
// -- CM5 (Amstrad CPC)
void Test_CM5(T_IO_Context *);
void Load_CM5(T_IO_Context *);
void Save_CM5(T_IO_Context *);
// -- PPH (Amstrad CPC)
void Test_PPH(T_IO_Context *);
void Load_PPH(T_IO_Context *);
void Save_PPH(T_IO_Context *);
// -- XPM (X PixMap)
// Loading is done through SDL_Image
void Save_XPM(T_IO_Context*);
// -- ICO (Windows ICO)
void Test_ICO(T_IO_Context *);
void Load_ICO(T_IO_Context *);
void Save_ICO(T_IO_Context *);
// -- PNG -------------------------------------------------------------------
#ifndef __no_pnglib__
void Test_PNG(T_IO_Context *);
void Load_PNG(T_IO_Context *);
void Save_PNG(T_IO_Context *);
#endif
// -- INFO (Amiga ICONS) ----------------------------------------------------
void Test_INFO(T_IO_Context *);
void Load_INFO(T_IO_Context *);
#endif

View File

@ -63,116 +63,7 @@
#include "setup.h" #include "setup.h"
#include "filesel.h" #include "filesel.h"
#include "unicode.h" #include "unicode.h"
#include "fileformats.h"
// -- PKM -------------------------------------------------------------------
void Test_PKM(T_IO_Context *);
void Load_PKM(T_IO_Context *);
void Save_PKM(T_IO_Context *);
// -- IFF -------------------------------------------------------------------
void Test_LBM(T_IO_Context *);
void Test_PBM(T_IO_Context *);
void Test_ACBM(T_IO_Context *);
void Load_IFF(T_IO_Context *);
void Save_IFF(T_IO_Context *);
// -- GIF -------------------------------------------------------------------
void Test_GIF(T_IO_Context *);
void Load_GIF(T_IO_Context *);
void Save_GIF(T_IO_Context *);
// -- PCX -------------------------------------------------------------------
void Test_PCX(T_IO_Context *);
void Load_PCX(T_IO_Context *);
void Save_PCX(T_IO_Context *);
// -- BMP -------------------------------------------------------------------
void Test_BMP(T_IO_Context *);
void Load_BMP(T_IO_Context *);
void Save_BMP(T_IO_Context *);
// -- IMG -------------------------------------------------------------------
void Test_IMG(T_IO_Context *);
void Load_IMG(T_IO_Context *);
void Save_IMG(T_IO_Context *);
// -- SCx -------------------------------------------------------------------
void Test_SCx(T_IO_Context *);
void Load_SCx(T_IO_Context *);
void Save_SCx(T_IO_Context *);
// -- CEL -------------------------------------------------------------------
void Test_CEL(T_IO_Context *);
void Load_CEL(T_IO_Context *);
void Save_CEL(T_IO_Context *);
// -- KCF -------------------------------------------------------------------
void Test_KCF(T_IO_Context *);
void Load_KCF(T_IO_Context *);
void Save_KCF(T_IO_Context *);
// -- PAL -------------------------------------------------------------------
void Test_PAL(T_IO_Context *);
void Load_PAL(T_IO_Context *);
void Save_PAL(T_IO_Context *);
// -- GPL -------------------------------------------------------------------
void Test_GPL(T_IO_Context *);
void Load_GPL(T_IO_Context *);
void Save_GPL(T_IO_Context *);
// -- PI1 -------------------------------------------------------------------
void Test_PI1(T_IO_Context *);
void Load_PI1(T_IO_Context *);
void Save_PI1(T_IO_Context *);
// -- PC1 -------------------------------------------------------------------
void Test_PC1(T_IO_Context *);
void Load_PC1(T_IO_Context *);
void Save_PC1(T_IO_Context *);
// -- NEO -------------------------------------------------------------------
void Test_NEO(T_IO_Context *);
void Load_NEO(T_IO_Context *);
void Save_NEO(T_IO_Context *);
// -- C64 -------------------------------------------------------------------
void Test_C64(T_IO_Context *);
void Load_C64(T_IO_Context *);
void Save_C64(T_IO_Context *);
// -- SCR (Amstrad CPC)
void Save_SCR(T_IO_Context *);
// -- CM5 (Amstrad CPC)
void Test_CM5(T_IO_Context *);
void Load_CM5(T_IO_Context *);
void Save_CM5(T_IO_Context *);
// -- PPH (Amstrad CPC)
void Test_PPH(T_IO_Context *);
void Load_PPH(T_IO_Context *);
void Save_PPH(T_IO_Context *);
// -- XPM (X PixMap)
// Loading is done through SDL_Image
void Save_XPM(T_IO_Context*);
// -- ICO (Windows ICO)
void Test_ICO(T_IO_Context *);
void Load_ICO(T_IO_Context *);
void Save_ICO(T_IO_Context *);
// -- PNG -------------------------------------------------------------------
#ifndef __no_pnglib__
void Test_PNG(T_IO_Context *);
void Load_PNG(T_IO_Context *);
void Save_PNG(T_IO_Context *);
#endif
// -- INFO (Amiga ICONS) ----------------------------------------------------
void Test_INFO(T_IO_Context *);
void Load_INFO(T_IO_Context *);
// -- SDL_Image ------------------------------------------------------------- // -- SDL_Image -------------------------------------------------------------
// (TGA, BMP, PNM, XPM, XCF, PCX, GIF, JPG, TIF, IFF, PNG, ICO) // (TGA, BMP, PNM, XPM, XCF, PCX, GIF, JPG, TIF, IFF, PNG, ICO)

View File

@ -41,6 +41,7 @@
#include "struct.h" #include "struct.h"
#include "windows.h" #include "windows.h"
#include "oldies.h" #include "oldies.h"
#include "fileformats.h"
//////////////////////////////////// PAL //////////////////////////////////// //////////////////////////////////// PAL ////////////////////////////////////
// //