WIP Changes to support building for OS/2
+ WIP Makefile updates to support building for OS/2 - TODO: Makefile needs SYSNAME test to detect OS/2 (Bill has asked Elbert) + Added "__declspec(dllexport)" (via new "TX_EXTERN" #define'd in `tp_magic_api.h`) to public function definitions in Magic tools - WIP: So far just "Mirror/Flip" plugin - TODO: Add "TX_EXTERN" prefix to all other public Magic tool functions + Renamed long Magic tool source files to have shorter filenames - WIP: So far just "Mirror/Flip" (`mirror_flip.c` -> `mirror_f.c`) - TODO: Rename all other magic tool source files. h/t Elbert Pol for providing info and some diffs!
This commit is contained in:
parent
609e7cec58
commit
33db4c16f5
7 changed files with 85 additions and 52 deletions
15
Makefile
15
Makefile
|
|
@ -150,6 +150,7 @@ macos_RAD_CMD:=[[ ! -d Resources/share ]] && mkdir -p Resources/share && ln -s .
|
||||||
RAD_CMD:=$($(OS)_RAD_CMD)
|
RAD_CMD:=$($(OS)_RAD_CMD)
|
||||||
|
|
||||||
windows_SO_TYPE:=dll
|
windows_SO_TYPE:=dll
|
||||||
|
os2_SO_TYPE:=dll
|
||||||
macos_SO_TYPE:=dylib
|
macos_SO_TYPE:=dylib
|
||||||
ios_SO_TYPE:=dylib
|
ios_SO_TYPE:=dylib
|
||||||
beos_SO_TYPE:=so
|
beos_SO_TYPE:=so
|
||||||
|
|
@ -160,6 +161,7 @@ windows_LIBMINGW:=-L/usr/local/lib -lmingw32
|
||||||
LIBMINGW:=$($(OS)_LIBMINGW)
|
LIBMINGW:=$($(OS)_LIBMINGW)
|
||||||
|
|
||||||
windows_EXE_EXT:=.exe
|
windows_EXE_EXT:=.exe
|
||||||
|
os2_EXE_EXT:=.exe
|
||||||
EXE_EXT:=$($(OS)_EXE_EXT)
|
EXE_EXT:=$($(OS)_EXE_EXT)
|
||||||
|
|
||||||
macos_BUNDLE:=./TuxPaint-$(ARCHS).app
|
macos_BUNDLE:=./TuxPaint-$(ARCHS).app
|
||||||
|
|
@ -167,6 +169,7 @@ ios_BUNDLE:=./TuxPaint-$(SDK).app
|
||||||
BUNDLE:=$($(OS)_BUNDLE)
|
BUNDLE:=$($(OS)_BUNDLE)
|
||||||
|
|
||||||
windows_ARCH_LIBS:=obj/win32_print.o obj/resource.o obj/win32_trash.o obj/win32_version.o
|
windows_ARCH_LIBS:=obj/win32_print.o obj/resource.o obj/win32_trash.o obj/win32_version.o
|
||||||
|
os2_ARCH_LIBS:=obj/postscript_print.o
|
||||||
macos_ARCH_LIBS:=src/macos_print.m obj/macos.o
|
macos_ARCH_LIBS:=src/macos_print.m obj/macos.o
|
||||||
ios_ARCH_LIBS:=src/ios_print.m obj/ios.o
|
ios_ARCH_LIBS:=src/ios_print.m obj/ios.o
|
||||||
beos_ARCH_LIBS:=obj/BeOS_print.o
|
beos_ARCH_LIBS:=obj/BeOS_print.o
|
||||||
|
|
@ -174,6 +177,7 @@ linux_ARCH_LIBS:=obj/postscript_print.o
|
||||||
ARCH_LIBS:=$($(OS)_ARCH_LIBS)
|
ARCH_LIBS:=$($(OS)_ARCH_LIBS)
|
||||||
|
|
||||||
windows_ARCH_CFLAGS:=
|
windows_ARCH_CFLAGS:=
|
||||||
|
os2_ARCH_CFLAGS:=
|
||||||
macos_ARCH_CFLAGS:=-isysroot $(SDKROOT) -I$(SDKROOT)/usr/include -I$(HOSTROOT)/include -mmacosx-version-min=$(MINVER) -arch $(subst $() $(), -arch ,$(ARCHS)) -w -headerpad_max_install_names -DHAVE_STRCASESTR
|
macos_ARCH_CFLAGS:=-isysroot $(SDKROOT) -I$(SDKROOT)/usr/include -I$(HOSTROOT)/include -mmacosx-version-min=$(MINVER) -arch $(subst $() $(), -arch ,$(ARCHS)) -w -headerpad_max_install_names -DHAVE_STRCASESTR
|
||||||
ios_ARCH_CFLAGS:=-isysroot $(SDKROOT) -I$(SDKROOT)/usr/include -I$(HOSTROOT)/include $(MINVEROPT) -arch $(subst $() $(), -arch ,$(ARCHS)) -w -fPIC -DHAVE_STRCASESTR -DUNLINK_ONLY
|
ios_ARCH_CFLAGS:=-isysroot $(SDKROOT) -I$(SDKROOT)/usr/include -I$(HOSTROOT)/include $(MINVEROPT) -arch $(subst $() $(), -arch ,$(ARCHS)) -w -fPIC -DHAVE_STRCASESTR -DUNLINK_ONLY
|
||||||
beos_ARCH_CFLAGS:=
|
beos_ARCH_CFLAGS:=
|
||||||
|
|
@ -181,6 +185,7 @@ linux_ARCH_CFLAGS:=
|
||||||
ARCH_CFLAGS:=$($(OS)_ARCH_CFLAGS)
|
ARCH_CFLAGS:=$($(OS)_ARCH_CFLAGS)
|
||||||
|
|
||||||
windows_ARCH_LDFLAGS:=
|
windows_ARCH_LDFLAGS:=
|
||||||
|
os2_ARCH_LDFLAGS:=-Zomf -Zmap -Zargs-wild -D__ST_MT_ERRNO__
|
||||||
macos_ARCH_LDFLAGS:=-isysroot $(SDKROOT) -L$(HOSTROOT)/lib -mmacosx-version-min=$(MINVER) -arch $(subst $() $(), -arch ,$(ARCHS))
|
macos_ARCH_LDFLAGS:=-isysroot $(SDKROOT) -L$(HOSTROOT)/lib -mmacosx-version-min=$(MINVER) -arch $(subst $() $(), -arch ,$(ARCHS))
|
||||||
ios_ARCH_LDFLAGS:=-isysroot $(SDKROOT) -L$(HOSTROOT)/lib $(MINVEROPT) -arch $(subst $() $(), -arch ,$(ARCHS))
|
ios_ARCH_LDFLAGS:=-isysroot $(SDKROOT) -L$(HOSTROOT)/lib $(MINVEROPT) -arch $(subst $() $(), -arch ,$(ARCHS))
|
||||||
beos_ARCH_LDFLAGS:=
|
beos_ARCH_LDFLAGS:=
|
||||||
|
|
@ -188,7 +193,11 @@ linux_ARCH_LDFLAGS:=
|
||||||
ARCH_LDFLAGS:=$($(OS)_ARCH_LDFLAGS)
|
ARCH_LDFLAGS:=$($(OS)_ARCH_LDFLAGS)
|
||||||
LDFLAGS:=$(ARCH_LDFLAGS)
|
LDFLAGS:=$(ARCH_LDFLAGS)
|
||||||
|
|
||||||
|
ifeq ($(OS), os2)
|
||||||
|
PAPER_LIB:=$(call linktest,,-lpaper_dll,)
|
||||||
|
else
|
||||||
PAPER_LIB:=$(call linktest,,-lpaper,)
|
PAPER_LIB:=$(call linktest,,-lpaper,)
|
||||||
|
endif
|
||||||
PNG:=$(call linktest,libpng,-lpng,)
|
PNG:=$(call linktest,libpng,-lpng,)
|
||||||
PNG:=$(if $(PNG),$(PNG),$(call linktest,,-lpng12,))
|
PNG:=$(if $(PNG),$(PNG),$(call linktest,,-lpng12,))
|
||||||
|
|
||||||
|
|
@ -196,6 +205,7 @@ FRIBIDI_LIB:=$(shell $(PKG_CONFIG) --libs fribidi)
|
||||||
FRIBIDI_CFLAGS:=$(shell $(PKG_CONFIG) --cflags fribidi)
|
FRIBIDI_CFLAGS:=$(shell $(PKG_CONFIG) --cflags fribidi)
|
||||||
|
|
||||||
windows_ARCH_LINKS:=-lgdi32 -lcomdlg32 $(PNG) -lz -lwinspool -lshlwapi $(FRIBIDI_LIB) -liconv -limagequant -mwindows
|
windows_ARCH_LINKS:=-lgdi32 -lcomdlg32 $(PNG) -lz -lwinspool -lshlwapi $(FRIBIDI_LIB) -liconv -limagequant -mwindows
|
||||||
|
os2_ARCH_LINKS:=$(PAPER_LIB) $(FRIBIDI_LIB) -limagequant
|
||||||
macos_ARCH_LINKS:=$(FRIBIDI_LIB) -limagequant -lSDLmain -Wl,-framework,AppKit -Wl,-framework,Cocoa $(shell $(PKG_CONFIG) --libs pangoft2)
|
macos_ARCH_LINKS:=$(FRIBIDI_LIB) -limagequant -lSDLmain -Wl,-framework,AppKit -Wl,-framework,Cocoa $(shell $(PKG_CONFIG) --libs pangoft2)
|
||||||
ios_ARCH_LINKS=$(FRIBIDI_LIB) -limagequant -ljpeg -lbz2 $(shell $(PKG_CONFIG) --libs freetype2 libtiff-4 libwebp libffi harfbuzz libmpg123 ogg vorbisenc vorbisidec libxml-2.0 pangoft2 libpcre)
|
ios_ARCH_LINKS=$(FRIBIDI_LIB) -limagequant -ljpeg -lbz2 $(shell $(PKG_CONFIG) --libs freetype2 libtiff-4 libwebp libffi harfbuzz libmpg123 ogg vorbisenc vorbisidec libxml-2.0 pangoft2 libpcre)
|
||||||
beos_ARCH_LINKS:=-lintl $(PNG) -lz -lbe -lnetwork -liconv $(FRIBIDI_LIB) $(PAPER_LIB) $(STDC_LIB) -limagequant
|
beos_ARCH_LINKS:=-lintl $(PNG) -lz -lbe -lnetwork -liconv $(FRIBIDI_LIB) $(PAPER_LIB) $(STDC_LIB) -limagequant
|
||||||
|
|
@ -203,6 +213,7 @@ linux_ARCH_LINKS:=$(PAPER_LIB) $(FRIBIDI_LIB) -limagequant
|
||||||
ARCH_LINKS:=$($(OS)_ARCH_LINKS)
|
ARCH_LINKS:=$($(OS)_ARCH_LINKS)
|
||||||
|
|
||||||
windows_ARCH_HEADERS:=src/win32_print.h
|
windows_ARCH_HEADERS:=src/win32_print.h
|
||||||
|
os2_ARCH_HEADERS:=
|
||||||
macos_ARCH_HEADERS:=src/macos.h
|
macos_ARCH_HEADERS:=src/macos.h
|
||||||
beos_ARCH_HEADERS:=src/BeOS_print.h
|
beos_ARCH_HEADERS:=src/BeOS_print.h
|
||||||
linux_ARCH_HEADERS:=
|
linux_ARCH_HEADERS:=
|
||||||
|
|
@ -211,6 +222,7 @@ ARCH_HEADERS:=$($(OS)_ARCH_HEADERS)
|
||||||
# Where things will go when ultimately installed:
|
# Where things will go when ultimately installed:
|
||||||
# For macOS and iOS, the prefix is relative to DESTDIR.
|
# For macOS and iOS, the prefix is relative to DESTDIR.
|
||||||
windows_PREFIX:=/usr/local
|
windows_PREFIX:=/usr/local
|
||||||
|
os2_PREFIX:=c:/extras/tuxpaint
|
||||||
macos_PREFIX:=Resources
|
macos_PREFIX:=Resources
|
||||||
ios_PREFIX:=.
|
ios_PREFIX:=.
|
||||||
linux_PREFIX:=/usr/local
|
linux_PREFIX:=/usr/local
|
||||||
|
|
@ -1433,6 +1445,7 @@ MAGIC_SDL_CPPFLAGS:=$(shell $(PKG_CONFIG) $(SDL_PCNAME) --cflags)
|
||||||
|
|
||||||
# FIXME: Expose SDL_rotozoom to Magic API? -bjk 2021.09.06
|
# FIXME: Expose SDL_rotozoom to Magic API? -bjk 2021.09.06
|
||||||
windows_MAGIC_SDL_LIBS:=-L/usr/local/lib $(LIBMINGW) $(shell $(PKG_CONFIG) $(SDL_PCNAME) --libs) -lSDL2_image -lSDL2_ttf $(SDL_MIXER_LIB)
|
windows_MAGIC_SDL_LIBS:=-L/usr/local/lib $(LIBMINGW) $(shell $(PKG_CONFIG) $(SDL_PCNAME) --libs) -lSDL2_image -lSDL2_ttf $(SDL_MIXER_LIB)
|
||||||
|
os2_MAGIC_SDL_LIBS:=-L/@unixroot/usr/lib $(shell $(PKG_CONFIG) $(SDL_PCNAME) --libs) -lSDL2_image -lSDL2_ttf $(SDL_MIXER_LIB)
|
||||||
macos_MAGIC_SDL_LIBS:=-L/usr/local/lib $(shell $(PKG_CONFIG) $(SDL_PCNAME) --libs) -lSDL2_image -lSDL2_ttf $(SDL_MIXER_LIB)
|
macos_MAGIC_SDL_LIBS:=-L/usr/local/lib $(shell $(PKG_CONFIG) $(SDL_PCNAME) --libs) -lSDL2_image -lSDL2_ttf $(SDL_MIXER_LIB)
|
||||||
ios_MAGIC_SDL_LIBS:=$(shell $(PKG_CONFIG) $(SDL_PCNAME) --libs) -lSDL2_image -lSDL2_ttf $(SDL_MIXER_LIB)
|
ios_MAGIC_SDL_LIBS:=$(shell $(PKG_CONFIG) $(SDL_PCNAME) --libs) -lSDL2_image -lSDL2_ttf $(SDL_MIXER_LIB)
|
||||||
beos_MAGIC_SDL_LIBS:=-L/usr/local/lib $(shell $(PKG_CONFIG) $(SDL_PCNAME) --libs) -lSDL2_image -lSDL2_ttf $(SDL_MIXER_LIB)
|
beos_MAGIC_SDL_LIBS:=-L/usr/local/lib $(shell $(PKG_CONFIG) $(SDL_PCNAME) --libs) -lSDL2_image -lSDL2_ttf $(SDL_MIXER_LIB)
|
||||||
|
|
@ -1440,6 +1453,7 @@ linux_MAGIC_SDL_LIBS:=-L/usr/local/lib $(shell $(PKG_CONFIG) $(SDL_PCNAME) --lib
|
||||||
MAGIC_SDL_LIBS:=$($(OS)_MAGIC_SDL_LIBS)
|
MAGIC_SDL_LIBS:=$($(OS)_MAGIC_SDL_LIBS)
|
||||||
|
|
||||||
windows_MAGIC_ARCH_LINKS=-lintl $(PNG)
|
windows_MAGIC_ARCH_LINKS=-lintl $(PNG)
|
||||||
|
os2_MAGIC_ARCH_LINKS=-lint_dll $(PNG)
|
||||||
macos_MAGIC_ARCH_LINKS=-lintl $(PNG)
|
macos_MAGIC_ARCH_LINKS=-lintl $(PNG)
|
||||||
ios_MAGIC_ARCH_LINKS=-lintl -ljpeg $(PNG) $(shell $(PKG_CONFIG) --libs libtiff-4 libwebp libmpg123 ogg vorbisenc vorbisidec)
|
ios_MAGIC_ARCH_LINKS=-lintl -ljpeg $(PNG) $(shell $(PKG_CONFIG) --libs libtiff-4 libwebp libmpg123 ogg vorbisenc vorbisidec)
|
||||||
beos_MAGIC_ARCH_LINKS:=-lintl $(PNG)
|
beos_MAGIC_ARCH_LINKS:=-lintl $(PNG)
|
||||||
|
|
@ -1447,6 +1461,7 @@ linux_MAGIC_ARCH_LINKS:=-lintl $(PNG)
|
||||||
MAGIC_ARCH_LINKS:=$($(OS)_MAGIC_ARCH_LINKS)
|
MAGIC_ARCH_LINKS:=$($(OS)_MAGIC_ARCH_LINKS)
|
||||||
|
|
||||||
windows_PLUGIN_LIBS:=$(MAGIC_SDL_LIBS) $(MAGIC_ARCH_LINKS)
|
windows_PLUGIN_LIBS:=$(MAGIC_SDL_LIBS) $(MAGIC_ARCH_LINKS)
|
||||||
|
os2_PLUGIN_LIBS:=-lsdl2 -lsdl2_mixer -lSDL2_image
|
||||||
macos_PLUGIN_LIBS:=$(MAGIC_SDL_LIBS) $(MAGIC_ARCH_LINKS)
|
macos_PLUGIN_LIBS:=$(MAGIC_SDL_LIBS) $(MAGIC_ARCH_LINKS)
|
||||||
ios_PLUGIN_LIBS:=$(MAGIC_SDL_LIBS) $(MAGIC_ARCH_LINKS)
|
ios_PLUGIN_LIBS:=$(MAGIC_SDL_LIBS) $(MAGIC_ARCH_LINKS)
|
||||||
beos_PLUGIN_LIBS:="$(MAGIC_SDL_LIBS) $(MAGIC_ARCH_LINKS) $(MAGIC_SDL_CPPFLAGS)"
|
beos_PLUGIN_LIBS:="$(MAGIC_SDL_LIBS) $(MAGIC_ARCH_LINKS) $(MAGIC_SDL_CPPFLAGS)"
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ Copyright (c) 2002-2024
|
||||||
Various contributors (see below, and AUTHORS.txt)
|
Various contributors (see below, and AUTHORS.txt)
|
||||||
https://tuxpaint.org/
|
https://tuxpaint.org/
|
||||||
|
|
||||||
2024.June.4 (0.9.33)
|
2024.June.6 (0.9.33)
|
||||||
* New Magic Tools:
|
* New Magic Tools:
|
||||||
----------------
|
----------------
|
||||||
* Dither & Dither (Keep Color): Replaces all or part of a drawing
|
* Dither & Dither (Keep Color): Replaces all or part of a drawing
|
||||||
|
|
@ -110,6 +110,19 @@ https://tuxpaint.org/
|
||||||
manually to build the universal bundle.
|
manually to build the universal bundle.
|
||||||
Mark Kim <markuskimius@gmail.com>
|
Mark Kim <markuskimius@gmail.com>
|
||||||
|
|
||||||
|
* WIP Changes to support building for OS/2
|
||||||
|
+ WIP Makefile updates to support building for OS/2
|
||||||
|
- TODO: Makefile needs SYSNAME test to detect OS/2 (Bill has asked Elbert)
|
||||||
|
+ Added "__declspec(dllexport)" (via new "TX_EXTERN" #define'd in
|
||||||
|
`tp_magic_api.h`) to public function definitions in Magic tools
|
||||||
|
- WIP: So far just "Mirror/Flip" plugin
|
||||||
|
- TODO: Add "TX_EXTERN" prefix to all other public Magic tool functions
|
||||||
|
+ Renamed long Magic tool source files to have shorter filenames
|
||||||
|
- WIP: So far just "Mirror/Flip" (`mirror_flip.c` -> `mirror_f.c`)
|
||||||
|
- TODO: Rename all other magic tool source files.
|
||||||
|
Elbert Pol <tellie@elbertpol.nl>
|
||||||
|
(with support from Bill Kendrick)
|
||||||
|
|
||||||
* Updates to appdata metadata file for Appstream 1.0
|
* Updates to appdata metadata file for Appstream 1.0
|
||||||
(https://sourceforge.net/p/tuxpaint/tuxpaint/merge-requests/19/)
|
(https://sourceforge.net/p/tuxpaint/tuxpaint/merge-requests/19/)
|
||||||
Will Thompson <https://sourceforge.net/u/wjjjjt/profile/>
|
Will Thompson <https://sourceforge.net/u/wjjjjt/profile/>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
mirror_flip.c
|
mirror_f.c
|
||||||
|
|
||||||
Mirror and Flip Magic Tools Plugin
|
Mirror and Flip Magic Tools Plugin
|
||||||
Tux Paint - A simple drawing program for children.
|
Tux Paint - A simple drawing program for children.
|
||||||
|
|
@ -44,31 +44,31 @@ enum
|
||||||
static Mix_Chunk *snd_effects[NUM_TOOLS];
|
static Mix_Chunk *snd_effects[NUM_TOOLS];
|
||||||
|
|
||||||
/* Prototypes */
|
/* Prototypes */
|
||||||
int mirror_flip_init(magic_api *, Uint8 disabled_features, Uint8 complexity_level);
|
TX_EXTERN int mirror_f_init(magic_api *, Uint8 disabled_features, Uint8 complexity_level);
|
||||||
Uint32 mirror_flip_api_version(void);
|
TX_EXTERN Uint32 mirror_f_api_version(void);
|
||||||
int mirror_flip_get_tool_count(magic_api *);
|
TX_EXTERN int mirror_f_get_tool_count(magic_api *);
|
||||||
SDL_Surface *mirror_flip_get_icon(magic_api *, int);
|
TX_EXTERN SDL_Surface *mirror_f_get_icon(magic_api *, int);
|
||||||
char *mirror_flip_get_name(magic_api *, int);
|
TX_EXTERN char *mirror_f_get_name(magic_api *, int);
|
||||||
int mirror_flip_get_group(magic_api *, int);
|
TX_EXTERN int mirror_f_get_group(magic_api *, int);
|
||||||
int mirror_flip_get_order(int);
|
TX_EXTERN int mirror_f_get_order(int);
|
||||||
char *mirror_flip_get_description(magic_api *, int, int);
|
TX_EXTERN char *mirror_f_get_description(magic_api *, int, int);
|
||||||
void mirror_flip_drag(magic_api *, int, SDL_Surface *, SDL_Surface *, int, int, int, int, SDL_Rect *);
|
TX_EXTERN void mirror_f_drag(magic_api *, int, SDL_Surface *, SDL_Surface *, int, int, int, int, SDL_Rect *);
|
||||||
void mirror_flip_release(magic_api *, int, SDL_Surface *, SDL_Surface *, int, int, int, int, SDL_Rect *);
|
TX_EXTERN void mirror_f_release(magic_api *, int, SDL_Surface *, SDL_Surface *, int, int, int, int, SDL_Rect *);
|
||||||
void mirror_flip_click(magic_api *, int, int, SDL_Surface *, SDL_Surface *, int, int, SDL_Rect *);
|
TX_EXTERN void mirror_f_click(magic_api *, int, int, SDL_Surface *, SDL_Surface *, int, int, SDL_Rect *);
|
||||||
void mirror_flip_shutdown(magic_api *);
|
TX_EXTERN void mirror_f_shutdown(magic_api *);
|
||||||
void mirror_flip_set_color(magic_api * api, int which, SDL_Surface * canvas,
|
TX_EXTERN void mirror_f_set_color(magic_api * api, int which, SDL_Surface * canvas,
|
||||||
SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect);
|
SDL_Surface * last, Uint8 r, Uint8 g, Uint8 b, SDL_Rect * update_rect);
|
||||||
int mirror_flip_requires_colors(magic_api *, int);
|
TX_EXTERN int mirror_f_requires_colors(magic_api *, int);
|
||||||
void mirror_flip_switchin(magic_api *, int, int, SDL_Surface *);
|
TX_EXTERN void mirror_f_switchin(magic_api *, int, int, SDL_Surface *);
|
||||||
void mirror_flip_switchout(magic_api *, int, int, SDL_Surface *);
|
TX_EXTERN void mirror_f_switchout(magic_api *, int, int, SDL_Surface *);
|
||||||
int mirror_flip_modes(magic_api *, int);
|
TX_EXTERN int mirror_f_modes(magic_api *, int);
|
||||||
Uint8 mirror_flip_accepted_sizes(magic_api * api, int which, int mode);
|
TX_EXTERN Uint8 mirror_f_accepted_sizes(magic_api * api, int which, int mode);
|
||||||
Uint8 mirror_flip_default_size(magic_api * api, int which, int mode);
|
TX_EXTERN Uint8 mirror_f_default_size(magic_api * api, int which, int mode);
|
||||||
void mirror_flip_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
TX_EXTERN void mirror_f_set_size(magic_api * api, int which, int mode, SDL_Surface * canvas, SDL_Surface * last, Uint8 size,
|
||||||
SDL_Rect * update_rect);
|
SDL_Rect * update_rect);
|
||||||
|
|
||||||
// No setup required:
|
// No setup required:
|
||||||
int mirror_flip_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED)
|
TX_EXTERN int mirror_f_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED, Uint8 complexity_level ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
char fname[1024];
|
char fname[1024];
|
||||||
|
|
||||||
|
|
@ -81,19 +81,19 @@ int mirror_flip_init(magic_api * api, Uint8 disabled_features ATTRIBUTE_UNUSED,
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
Uint32 mirror_flip_api_version(void)
|
TX_EXTERN Uint32 mirror_f_api_version(void)
|
||||||
{
|
{
|
||||||
return (TP_MAGIC_API_VERSION);
|
return (TP_MAGIC_API_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
// We have multiple tools:
|
// We have multiple tools:
|
||||||
int mirror_flip_get_tool_count(magic_api * api ATTRIBUTE_UNUSED)
|
TX_EXTERN int mirror_f_get_tool_count(magic_api * api ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
return (NUM_TOOLS);
|
return (NUM_TOOLS);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load our icons:
|
// Load our icons:
|
||||||
SDL_Surface *mirror_flip_get_icon(magic_api * api, int which)
|
TX_EXTERN SDL_Surface *mirror_f_get_icon(magic_api * api, int which)
|
||||||
{
|
{
|
||||||
char fname[1024];
|
char fname[1024];
|
||||||
|
|
||||||
|
|
@ -110,7 +110,7 @@ SDL_Surface *mirror_flip_get_icon(magic_api * api, int which)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return our names, localized:
|
// Return our names, localized:
|
||||||
char *mirror_flip_get_name(magic_api * api ATTRIBUTE_UNUSED, int which)
|
TX_EXTERN char *mirror_f_get_name(magic_api * api ATTRIBUTE_UNUSED, int which)
|
||||||
{
|
{
|
||||||
if (which == TOOL_MIRROR)
|
if (which == TOOL_MIRROR)
|
||||||
return (strdup(gettext_noop("Mirror")));
|
return (strdup(gettext_noop("Mirror")));
|
||||||
|
|
@ -121,19 +121,19 @@ char *mirror_flip_get_name(magic_api * api ATTRIBUTE_UNUSED, int which)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return our group (the same):
|
// Return our group (the same):
|
||||||
int mirror_flip_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED)
|
TX_EXTERN int mirror_f_get_group(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
return MAGIC_TYPE_PICTURE_WARPS;
|
return MAGIC_TYPE_PICTURE_WARPS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return our order:
|
// Return our order:
|
||||||
int mirror_flip_get_order(int which)
|
int mirror_f_get_order(int which)
|
||||||
{
|
{
|
||||||
return 100 + which;
|
return 100 + which;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return our descriptions, localized:
|
// Return our descriptions, localized:
|
||||||
char *mirror_flip_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED)
|
TX_EXTERN char *mirror_f_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, int mode ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
if (which == TOOL_MIRROR)
|
if (which == TOOL_MIRROR)
|
||||||
return (strdup(gettext_noop("Click to make a mirror image.")));
|
return (strdup(gettext_noop("Click to make a mirror image.")));
|
||||||
|
|
@ -144,7 +144,7 @@ char *mirror_flip_get_description(magic_api * api ATTRIBUTE_UNUSED, int which, i
|
||||||
}
|
}
|
||||||
|
|
||||||
// We affect the whole canvas, so only do things on click, not drag:
|
// We affect the whole canvas, so only do things on click, not drag:
|
||||||
void mirror_flip_drag(magic_api * api ATTRIBUTE_UNUSED,
|
TX_EXTERN void mirror_f_drag(magic_api * api ATTRIBUTE_UNUSED,
|
||||||
int which ATTRIBUTE_UNUSED,
|
int which ATTRIBUTE_UNUSED,
|
||||||
SDL_Surface * canvas ATTRIBUTE_UNUSED,
|
SDL_Surface * canvas ATTRIBUTE_UNUSED,
|
||||||
SDL_Surface * last ATTRIBUTE_UNUSED,
|
SDL_Surface * last ATTRIBUTE_UNUSED,
|
||||||
|
|
@ -154,7 +154,7 @@ void mirror_flip_drag(magic_api * api ATTRIBUTE_UNUSED,
|
||||||
// No-op
|
// No-op
|
||||||
}
|
}
|
||||||
|
|
||||||
void mirror_flip_release(magic_api * api ATTRIBUTE_UNUSED,
|
TX_EXTERN void mirror_f_release(magic_api * api ATTRIBUTE_UNUSED,
|
||||||
int which ATTRIBUTE_UNUSED,
|
int which ATTRIBUTE_UNUSED,
|
||||||
SDL_Surface * canvas ATTRIBUTE_UNUSED,
|
SDL_Surface * canvas ATTRIBUTE_UNUSED,
|
||||||
SDL_Surface * last ATTRIBUTE_UNUSED,
|
SDL_Surface * last ATTRIBUTE_UNUSED,
|
||||||
|
|
@ -165,7 +165,7 @@ void mirror_flip_release(magic_api * api ATTRIBUTE_UNUSED,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Affect the canvas on click:
|
// Affect the canvas on click:
|
||||||
void mirror_flip_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED,
|
TX_EXTERN void mirror_f_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED,
|
||||||
SDL_Surface * canvas, SDL_Surface * last,
|
SDL_Surface * canvas, SDL_Surface * last,
|
||||||
int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect)
|
int x ATTRIBUTE_UNUSED, int y ATTRIBUTE_UNUSED, SDL_Rect * update_rect)
|
||||||
{
|
{
|
||||||
|
|
@ -216,7 +216,7 @@ void mirror_flip_click(magic_api * api, int which, int mode ATTRIBUTE_UNUSED,
|
||||||
}
|
}
|
||||||
|
|
||||||
// No setup happened:
|
// No setup happened:
|
||||||
void mirror_flip_shutdown(magic_api * api ATTRIBUTE_UNUSED)
|
TX_EXTERN void mirror_f_shutdown(magic_api * api ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
if (snd_effects[0] != NULL)
|
if (snd_effects[0] != NULL)
|
||||||
Mix_FreeChunk(snd_effects[0]);
|
Mix_FreeChunk(snd_effects[0]);
|
||||||
|
|
@ -225,7 +225,7 @@ void mirror_flip_shutdown(magic_api * api ATTRIBUTE_UNUSED)
|
||||||
}
|
}
|
||||||
|
|
||||||
// We don't use colors:
|
// We don't use colors:
|
||||||
void mirror_flip_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
TX_EXTERN void mirror_f_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
||||||
SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED,
|
SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED,
|
||||||
Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED,
|
Uint8 r ATTRIBUTE_UNUSED, Uint8 g ATTRIBUTE_UNUSED, Uint8 b ATTRIBUTE_UNUSED,
|
||||||
SDL_Rect * update_rect ATTRIBUTE_UNUSED)
|
SDL_Rect * update_rect ATTRIBUTE_UNUSED)
|
||||||
|
|
@ -233,39 +233,39 @@ void mirror_flip_set_color(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE
|
||||||
}
|
}
|
||||||
|
|
||||||
// We don't use colors:
|
// We don't use colors:
|
||||||
int mirror_flip_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED)
|
TX_EXTERN int mirror_f_requires_colors(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void mirror_flip_switchin(magic_api * api ATTRIBUTE_UNUSED,
|
TX_EXTERN void mirror_f_switchin(magic_api * api ATTRIBUTE_UNUSED,
|
||||||
int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED)
|
int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void mirror_flip_switchout(magic_api * api ATTRIBUTE_UNUSED,
|
TX_EXTERN void mirror_f_switchout(magic_api * api ATTRIBUTE_UNUSED,
|
||||||
int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED)
|
int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED, SDL_Surface * canvas ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
int mirror_flip_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED)
|
TX_EXTERN int mirror_f_modes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
return (MODE_FULLSCREEN);
|
return (MODE_FULLSCREEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Uint8 mirror_flip_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
TX_EXTERN Uint8 mirror_f_accepted_sizes(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED,
|
||||||
int mode ATTRIBUTE_UNUSED)
|
int mode ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Uint8 mirror_flip_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED)
|
TX_EXTERN Uint8 mirror_f_default_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void mirror_flip_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED,
|
TX_EXTERN void mirror_f_set_size(magic_api * api ATTRIBUTE_UNUSED, int which ATTRIBUTE_UNUSED, int mode ATTRIBUTE_UNUSED,
|
||||||
SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED,
|
SDL_Surface * canvas ATTRIBUTE_UNUSED, SDL_Surface * last ATTRIBUTE_UNUSED,
|
||||||
Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED)
|
Uint8 size ATTRIBUTE_UNUSED, SDL_Rect * update_rect ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
(See COPYING.txt)
|
(See COPYING.txt)
|
||||||
|
|
||||||
Last modified: June 29, 2023
|
Last modified: June 6, 2024
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
@ -101,7 +101,7 @@ static const char *problemFontExtensions[] = {
|
||||||
#include <sys/poll.h>
|
#include <sys/poll.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
|
||||||
#ifdef _POSIX_PRIORITY_SCHEDULING
|
#if defined(_POSIX_PRIORITY_SCHEDULING) && !defined(__OS2__)
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
#else
|
#else
|
||||||
#define sched_yield()
|
#define sched_yield()
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
(See COPYING.txt)
|
(See COPYING.txt)
|
||||||
|
|
||||||
Last updated: June 13, 2023
|
Last updated: June 6, 2024
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef FONTS_H
|
#ifndef FONTS_H
|
||||||
|
|
@ -28,10 +28,7 @@
|
||||||
// plan to rip this out as soon as it is considered stable
|
// plan to rip this out as soon as it is considered stable
|
||||||
//#define THREADED_FONTS
|
//#define THREADED_FONTS
|
||||||
#define FORKED_FONTS
|
#define FORKED_FONTS
|
||||||
#if defined(WIN32) || defined(__BEOS__)
|
#if defined(WIN32) || defined(__BEOS__) || defined (__OS2__) || defined(__ANDROID__)
|
||||||
#undef FORKED_FONTS
|
|
||||||
#endif
|
|
||||||
#ifdef __ANDROID__
|
|
||||||
#undef FORKED_FONTS
|
#undef FORKED_FONTS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,12 @@
|
||||||
#define gettext_noop(String) String
|
#define gettext_noop(String) String
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __OS2__
|
||||||
|
# define TX_EXTERN __declspec(dllexport)
|
||||||
|
#else
|
||||||
|
# define TX_EXTERN
|
||||||
|
#endif
|
||||||
|
|
||||||
/* min() and max() variable comparisons: */
|
/* min() and max() variable comparisons: */
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
(See COPYING.txt)
|
(See COPYING.txt)
|
||||||
|
|
||||||
June 14, 2002 - June 2, 2024
|
June 14, 2002 - June 6, 2024
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
@ -652,7 +652,7 @@ int TP_EventFilter(void *data, EVENT_FILTER_EVENT_TYPE * event);
|
||||||
/* #define fmemopen_alternative *//* Uncomment this to test the fmemopen alternative in systems were fmemopen exists */
|
/* #define fmemopen_alternative *//* Uncomment this to test the fmemopen alternative in systems were fmemopen exists */
|
||||||
/* *INDENT-ON* */
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
#if defined (WIN32) || defined (__APPLE__) || defined(__NetBSD__) || defined(__sun) || defined(__ANDROID__) /* MINGW/MSYS, NetBSD, and MacOSX need it, at least for now */
|
#if defined (WIN32) || defined (__APPLE__) || defined(__NetBSD__) || defined(__sun) || defined(__OS2__) || defined(__ANDROID__) /* MINGW/MSYS, NetBSD, and MacOSX need it, at least for now */
|
||||||
#define fmemopen_alternative
|
#define fmemopen_alternative
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -8029,6 +8029,8 @@ void show_version(int details)
|
||||||
printf(" Built for Maemo (NOKIA_770)\n");
|
printf(" Built for Maemo (NOKIA_770)\n");
|
||||||
#elif OLPC_XO
|
#elif OLPC_XO
|
||||||
printf(" Built for XO (OLPC_XO)\n");
|
printf(" Built for XO (OLPC_XO)\n");
|
||||||
|
#elif OS2
|
||||||
|
printf(" Built for OS2 (OS2)\n");
|
||||||
#elif __ANDROID__
|
#elif __ANDROID__
|
||||||
printf(" Built for Android (__ANDROID__)\n");
|
printf(" Built for Android (__ANDROID__)\n");
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue