diff --git a/.gitignore b/.gitignore
index 5347b89c7..3f829341b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,8 @@ src/tp_magic_api.h
tp-magic-config
trans/
*~
+TuxPaint.app
+TuxPaint.dmg
+*.dylib
+*.dylib.dSYM
+.DS_Store
diff --git a/Makefile b/Makefile
index d3fee32c3..cdada6912 100644
--- a/Makefile
+++ b/Makefile
@@ -1,46 +1,50 @@
# Tux Paint - A simple drawing program for children.
-# Copyright (c) 2002-2017 by Bill Kendrick and others
-# bill@newbreedsoftware.com
+# Copyright (c) 2002-2018
+# Various contributors (see AUTHORS.txt)
# http://www.tuxpaint.org/
-# June 14, 2002 - December 30, 2017
+# June 14, 2002 - August 19, 2018
# The version number, for release:
VER_VERSION:=0.9.23
-VER_DATE:=$(shell date +"%Y-%m-%d")
+ifdef SOURCE_DATE_EPOCH
+ VER_DATE=$(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+%Y-%m-%d" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+%Y-%m-%d" 2>/dev/null || date -u "+%Y-%m-%d")
+else
+ VER_DATE=$(shell date "+%Y-%m-%d")
+endif
MAGIC_API_VERSION:=0x00000003
# Need to know the OS
SYSNAME:=$(shell uname -s)
ifeq ($(findstring MINGW32, $(SYSNAME)),MINGW32)
-OS:=windows
-GPERF:=/usr/bin/gperf
+ OS:=windows
+ GPERF:=/usr/bin/gperf
else
-ifeq ($(SYSNAME),Darwin)
-OS:=osx
-GPERF:=/usr/bin/gperf
-else
-ifeq ($(SYSNAME),BeOS)
-OS:=beos
-GPERF:=$(shell finddir B_USER_BIN_DIRECTORY)/gperf
-else
-ifeq ($(SYSNAME),Haiku)
-OS:=beos
-GPERF:=$(shell finddir B_SYSTEM_BIN_DIRECTORY)/gperf
-STDC_LIB:=-lstdc++
-ifeq ($(shell gcc --version | cut -c 1-6),2.95.3)
-STDC_LIB:=-lstdc++.r4
-endif
-else
-OS:=linux
-GPERF:=/usr/bin/gperf
-endif
-endif
-endif
+ ifeq ($(SYSNAME),Darwin)
+ OS:=osx
+ GPERF:=/usr/bin/gperf
+ else
+ ifeq ($(SYSNAME),BeOS)
+ OS:=beos
+ GPERF:=$(shell finddir B_USER_BIN_DIRECTORY)/gperf
+ else
+ ifeq ($(SYSNAME),Haiku)
+ OS:=beos
+ GPERF:=$(shell finddir B_SYSTEM_BIN_DIRECTORY)/gperf
+ STDC_LIB:=-lstdc++
+ ifeq ($(shell gcc --version | cut -c 1-6),2.95.3)
+ STDC_LIB:=-lstdc++.r4
+ endif
+ else
+ OS:=linux
+ GPERF:=/usr/bin/gperf
+ endif
+ endif
+ endif
endif
# change to sdl-console to build a console version on Windows
@@ -92,7 +96,7 @@ linux_ARCH_LIBS:=obj/postscript_print.o
ARCH_LIBS:=$($(OS)_ARCH_LIBS)
windows_ARCH_CFLAGS:=
-osx_ARCH_CFLAGS:=-isystem /opt/local/include -DHAVE_STRCASESTR -w -headerpad_max_install_names
+osx_ARCH_CFLAGS:=-mmacosx-version-min=10.7 -isystem /opt/local/include -DHAVE_STRCASESTR -w -headerpad_max_install_names
beos_ARCH_CFLAGS:=
linux_ARCH_CFLAGS:=
ARCH_CFLAGS:=$($(OS)_ARCH_CFLAGS)
@@ -136,11 +140,11 @@ PREFIX:=$($(OS)_PREFIX)
# macOS is set up as a bundle, with all files under 'Contents'.
# "TuxPaint-1" is the OLPC XO name. Installing to ./ is bad!
ifeq ($(OS),osx)
-DESTDIR:=$(BUNDLE)/Contents/
+ DESTDIR:=$(BUNDLE)/Contents/
else ifeq ($(PREFIX),./)
-DESTDIR:=TuxPaint-1
+ DESTDIR:=TuxPaint-1
else
-DESTDIR:=$(PKG_ROOT)
+ DESTDIR:=$(PKG_ROOT)
endif
# Program:
@@ -160,12 +164,11 @@ LIBDIR=$(PREFIX)
# Magic Tool plug-ins
INCLUDE_PREFIX:=$(DESTDIR)$(PREFIX)/include
-MAGIC_PREFIX:=$(DESTDIR)$(LIBDIR)/lib/tuxpaint/plugins
-
+MAGIC_PREFIX:=$(DESTDIR)$(LIBDIR)/lib$(LIBDIRSUFFIX)/tuxpaint/plugins
# Docs and man page:
-DOC_PREFIX:=$(DESTDIR)$(PREFIX)/share/doc/tuxpaint
-DEVDOC_PREFIX:=$(DESTDIR)$(PREFIX)/share/doc/tuxpaint-dev
+DOC_PREFIX:=$(DESTDIR)$(PREFIX)/share/doc/tuxpaint-$(VER_VERSION)
+DEVDOC_PREFIX:=$(DESTDIR)$(PREFIX)/share/doc/tuxpaint-$(VER_VERSION)/tuxpaint-dev
MAN_PREFIX:=$(DESTDIR)$(PREFIX)/share/man
DEVMAN_PREFIX:=$(DESTDIR)$(PREFIX)/share/man
@@ -185,10 +188,10 @@ endif
# Icons and launchers:
ICON_PREFIX:=$(DESTDIR)$(PREFIX)/share/pixmaps
-X11_ICON_PREFIX:=$(DESTDIR)$(PREFIX)/X11R6/include/X11/pixmaps
-GNOME_PREFIX:=$(shell gnome-config --prefix 2> /dev/null)
-KDE_PREFIX:=$(shell kde-config --install apps --expandvars 2> /dev/null)
-KDE_ICON_PREFIX:=$(shell kde-config --install icon --expandvars 2> /dev/null)
+X11_ICON_PREFIX:=$(DESTDIR)$(PREFIX)/share/pixmaps
+
+KDE_PREFIX:=$(shell kde-config --install xdgdata-apps --expandvars 2> /dev/null)
+KDE_ICON_PREFIX:=$(shell kde4-config --install icon --expandvars 2> /dev/null)
# Maemo flag
MAEMOFLAG:=
@@ -458,9 +461,9 @@ trans:
######
windows_ARCH_INSTALL:=
-osx_ARCH_INSTALL:=install-bundlefiles
+osx_ARCH_INSTALL:=install-macbundle TuxPaint.dmg
beos_ARCH_INSTALL:=install-haiku
-linux_ARCH_INSTALL:=install-gnome install-kde install-kde-icons
+linux_ARCH_INSTALL:=install-kde install-kde-icons
ARCH_INSTALL:=$($(OS)_ARCH_INSTALL)
# "make install" installs all of the various parts
@@ -482,7 +485,8 @@ install: install-bin install-data install-man install-doc \
@echo
@if [ "x$(OS)" == "xosx" ]; then \
echo "All done! Now you can double click $(BUNDLE) to run the"; \
- echo "program!!!"; \
+ echo "program!!! TuxPaint.dmg has also been created for"; \
+ echo "distribution."; \
echo; \
echo "For more information, see $(DOC_PREFIX)/README.txt"; \
else \
@@ -591,7 +595,7 @@ clean:
@-rm -f templates/.thumbs/*.png
@if [ -d templates/.thumbs ]; then rmdir templates/.thumbs; fi
@-if [ "x$(BUNDLE)" != "x" ]; then rm -rf $(BUNDLE); fi
- @-rm -f TuxPaint.dmg
+ @-rm -f TuxPaint.dmg temp.dmg; rm -rf magic/*.dSYM
@echo
# "make uninstall" should remove the various parts from their
@@ -599,15 +603,10 @@ clean:
# are the same as they were when you installed, of course!!!
.PHONY: uninstall
uninstall: uninstall-i18n
- -if [ "x$(GNOME_PREFIX)" != "x" ]; then \
- rm $(GNOME_PREFIX)/share/applications/tuxpaint.desktop; \
- rm $(GNOME_PREFIX)/share/pixmaps/tuxpaint.png; \
- else \
- rm /usr/share/applications/tuxpaint.desktop; \
- rm /usr/share/pixmaps/tuxpaint.png; \
- fi
+ -rm /usr/share/applications/tuxpaint.desktop; \
+ -rm /usr/share/pixmaps/tuxpaint.png; \
-if [ "x$(KDE_PREFIX)" != "x" ]; then \
- rm $(KDE_PREFIX)/Graphics/tuxpaint.desktop; \
+ rm $(KDE_PREFIX)/tuxpaint.desktop; \
fi
-rm $(ICON_PREFIX)/tuxpaint.png
-rm $(X11_ICON_PREFIX)/tuxpaint.xpm
@@ -752,21 +751,6 @@ echo-install-example-templates:
install-example-templates: echo-install-example-templates install-example-template-dirs $(INSTALLED_TEMPLATES)
-# Install a launcher icon in the Gnome menu
-.PHONY: install-gnome
-install-gnome:
- @echo
- @echo "...Installing launcher icon into GNOME..."
- @if [ "x$(GNOME_PREFIX)" != "x" ]; then \
- install -d $(DESTDIR)$(GNOME_PREFIX)/share/pixmaps; \
- cp data/images/icon.png $(DESTDIR)/$(GNOME_PREFIX)/share/pixmaps/tuxpaint.png; \
- chmod 644 $(DESTDIR)$(GNOME_PREFIX)/share/pixmaps/tuxpaint.png; \
- install -d $(DESTDIR)$(GNOME_PREFIX)/share/applications; \
- cp src/tuxpaint.desktop $(DESTDIR)$(GNOME_PREFIX)/share/applications/; \
- chmod 644 $(DESTDIR)$(GNOME_PREFIX)/share/applications/tuxpaint.desktop; \
- fi
-
-
# Install a launcher icon for the Nokia 770.
.PHONY: install-nokia770
install-nokia770:
@@ -798,10 +782,11 @@ install-kde:
@echo
@echo "...Installing launcher icon into KDE..."
@if [ "x$(KDE_PREFIX)" != "x" ]; then \
- install -d $(DESTDIR)$(KDE_PREFIX)/Graphics; \
- cp src/tuxpaint.desktop $(DESTDIR)$(KDE_PREFIX)/Graphics/; \
- chmod 644 $(DESTDIR)$(KDE_PREFIX)/Graphics/tuxpaint.desktop; \
+ install -d $(DESTDIR)$(KDE_PREFIX); \
+ cp src/tuxpaint.desktop $(DESTDIR)$(KDE_PREFIX)/; \
+ chmod 644 $(DESTDIR)$(KDE_PREFIX)/tuxpaint.desktop; \
fi
+ kbuildsycoca4
.PHONY: install-kde-icons
install-kde-icons:
@@ -846,10 +831,8 @@ install-kde-icons:
fi
-# Install the PNG icon (for GNOME, KDE, etc.)
+# Install the PNG icon (for KDE desktop, etc.)
# and the 24-color 32x32 XPM (for other Window managers):
-
-# FIXME: Should this also use $(DESTDIR)?
.PHONY: install-icon
install-icon:
@echo
@@ -1014,8 +997,8 @@ install-man:
# Install the support files for macOS application bundle
-.PHONY: install-bundlefiles
-install-bundlefiles:
+.PHONY: install-macbundle
+install-macbundle:
@echo
@echo "...Installing App Bundle Support Files..."
@install -d -m 755 $(BUNDLE)/Contents/MacOS
@@ -1026,7 +1009,13 @@ install-bundlefiles:
@install -m 644 macos/Info.plist $(BUNDLE)/Contents
@install -m 644 macos/tuxpaint.icns $(BUNDLE)/Contents/Resources
@custom/macos.sh
- @hdiutil create -volname "Tux Paint $(VER_VERSION)" -srcfolder $(BUNDLE) -ov -format UDBZ -o TuxPaint.dmg
+
+
+# Create DMG for macOS
+TuxPaint.dmg:
+ @echo
+ @echo "...Creating DMG Distribution File..."
+ @custom/macos-mkdmg.sh
# Build the program!
diff --git a/Resources/README.txt b/Resources/README.txt
new file mode 100644
index 000000000..03e7c34e5
--- /dev/null
+++ b/Resources/README.txt
@@ -0,0 +1,24 @@
+This folder exists to ease testing under macOS. Please ignore but do not
+delete. More details are below.
+
+macOS requires all files in an application have a specific folder structure.
+We create this structure under the folder "TuxPaint.app" when `make install` is
+run. But `make install` takes a long time to run under macOS due to the large
+number of files that need to be copied, as well as all the processing we do to
+those files (see custom/macos.sh for what we need to do.) This makes testing
+even a small code change time consuming.
+
+That's the problem this folder solves: Instead of creating the folder
+structure under TuxPaint.app every time to test a code change to be able to run
+the application, we pre-build the folder structure around the tuxpaint binary
+so the binary can be executed directly without re-creating the folder structure
+every time. Luckily for us, this only require that we only have a single
+folder "Resources" in the root folder of the tuxpaint source code (with some
+subfolders and symlinks underneath the Resources folder.)
+
+I hope my fellow Tux Paint contributors will forgive me for taking up yet
+another whole folder for use by a single platform, let alone almost empty, in
+the root folder of the source code distribution meant for multiple platforms.
+
+Mark Kim
+2018.06.27
diff --git a/Resources/share/tuxpaint b/Resources/share/tuxpaint
new file mode 120000
index 000000000..e67b45590
--- /dev/null
+++ b/Resources/share/tuxpaint
@@ -0,0 +1 @@
+../../data
\ No newline at end of file
diff --git a/custom/macos-mkdmg.sh b/custom/macos-mkdmg.sh
new file mode 100755
index 000000000..878764029
--- /dev/null
+++ b/custom/macos-mkdmg.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+##############################################################################
+# Script to generate TuxPaint.dmg from TuxPaint.app.
+#
+# Generating a pretty DMG file programmatically is a bit of an art. Many
+# thanks to the appdmg project for showing how:
+# (https://github.com/LinusU/node-appdmg)
+#
+
+BUNDLE=TuxPaint.app
+TEMP_DMG=temp.dmg
+TEMP_DMG_SIZE=`expr \`du -sm "$BUNDLE" | cut -f1\` \* 15 / 10`m
+FINAL_DMG=TuxPaint.dmg
+VOLNAME="Tux Paint"
+ICON="macos/tuxpaint.icns"
+BACKGROUND="macos/background.png"
+
+
+echo " * Creating the temporary image..."
+hdiutil create "$TEMP_DMG" -ov -fs HFS+ -size "$TEMP_DMG_SIZE" -volname "$VOLNAME" \
+&& VOLUME=`hdiutil attach "$TEMP_DMG" -nobrowse -noverify -noautoopen | grep Apple_HFS | sed 's/^.*Apple_HFS[[:blank:]]*//'` \
+|| exit 1
+
+echo " * Adding the image background..."
+mkdir "$VOLUME/.background" \
+&& tiffutil -cathidpicheck "$BACKGROUND" -out "$VOLUME/.background/background.tiff" \
+|| exit 1
+
+echo " * Setting the folder icon..."
+cp "$ICON" "$VOLUME/.VolumeIcon.icns" \
+&& xattr -wx com.apple.FinderInfo '00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' "$VOLUME" \
+|| exit 1
+
+echo " * Copying the contents..."
+ln -s "/Applications" "$VOLUME" \
+&& cp -a "$BUNDLE" "$VOLUME" \
+&& cp -a "macos/DS_Store" "$VOLUME/.DS_Store" \
+|| exit 1
+
+echo " * Configuring the folder to open upon mount..."
+bless --folder "$VOLUME" --openfolder "$VOLUME" \
+|| exit 1
+
+echo " * Unmounting the temporary image..."
+hdiutil detach "$VOLUME"
+
+echo " * Creating the final image..."
+hdiutil convert "$TEMP_DMG" -ov -format "UDBZ" -imagekey "zlib-level=9" -o "$FINAL_DMG"
+
+echo " * Deleting the temporary image..."
+rm -f "$TEMP_DMG"
+
diff --git a/docs/AUTHORS.txt b/docs/AUTHORS.txt
index 29be5cdaa..f503cac34 100644
--- a/docs/AUTHORS.txt
+++ b/docs/AUTHORS.txt
@@ -2,12 +2,12 @@ AUTHORS.txt for Tux Paint
Tux Paint - A simple drawing program for children.
-Copyright (c) 2002-2018 by Bill Kendrick and others
-bill@newbreedsoftware.com
+Copyright (c) 2002-2018
+Various contributors (see below, and CHANGES.txt)
http://www.tuxpaint.org/
-June 17, 2002 - February 24, 2018
+June 17, 2002 - August 18, 2018
$Id$
@@ -151,7 +151,7 @@ $Id$
DEALINGS IN THE SOFTWARE.
Pere Pujal i Carabantes Copyright 2002-2016 by Bill Kendrick and others Copyright (c) 2002-2018 by various contributors; see AUTHORS.txt June 14, 2002 - December 11, 2016 June 14, 2002 - August 28, 2018
Extending Tux Paint
-
-New Breed Software
http://www.tuxpaint.org/
@@ -495,7 +492,7 @@ effect.
Depending on the contents of your stamp, you might want to - have Tux Paint use one of a numer of methods when tinting it. + have Tux Paint use one of a number of methods when tinting it. Add one of the following lines to the stamp's data file:
diff --git a/docs/en/html/FAQ.html b/docs/en/html/FAQ.html index aad8e53bf..d78d8516c 100644 --- a/docs/en/html/FAQ.html +++ b/docs/en/html/FAQ.html @@ -16,13 +16,10 @@ version
Frequently Asked Questions -Copyright 2002-2017 by Bill Kendrick and others
- -
-New Breed SoftwareCopyright (c) 2002-2018 by various contributors; see AUTHORS.txt
-
http://www.tuxpaint.org/September 14, 2002 - December, 2017
+September 14, 2002 - August 28, 2018
Drawing-related
diff --git a/docs/en/html/OPTIONS.html b/docs/en/html/OPTIONS.html index 6089fde73..6a2266a5b 100644 --- a/docs/en/html/OPTIONS.html +++ b/docs/en/html/OPTIONS.html @@ -16,13 +16,10 @@ versionOptions Documentation
-Copyright 2002-2016 by Bill Kendrick and others
- -
-New Breed SoftwareCopyright (c) 2002-2018 by various contributors; see AUTHORS.txt
-
http://www.tuxpaint.org/December 11, 2016
+August 28, 2018
diff --git a/docs/en/html/README.html b/docs/en/html/README.html index bd3200de2..1b85c9eab 100644 --- a/docs/en/html/README.html +++ b/docs/en/html/README.html @@ -17,16 +17,12 @@ versionA simple drawing program for children
-Copyright 2002-2017 by Bill Kendrick and others
- -
-New Breed Software & -Tux4KidsCopyright 2002-2018 by various contributors; see AUTHORS.txt
http://www.tuxpaint.org/June 14, 2002 - - December 3, 2017
+ August 28, 2018 diff --git a/macos/DS_Store b/macos/DS_Store new file mode 100644 index 000000000..3ef8d934e Binary files /dev/null and b/macos/DS_Store differ diff --git a/macos/Info.plist b/macos/Info.plist index 2d098809c..e876c304a 100644 --- a/macos/Info.plist +++ b/macos/Info.plist @@ -7,7 +7,7 @@CFBundleExecutable tuxpaint CFBundleGetInfoString -0.9.23, Copyright 2009-2017, Tux Paint Development Team +0.9.23, Copyright 2009-2018, Tux Paint Development Team CFBundleIconFile tuxpaint.icns CFBundleIdentifier @@ -23,6 +23,6 @@CFBundleSignature TXPT CFBundleVersion -2017-11-27 +2018-06-27 diff --git a/macos/README.txt b/macos/README.txt index ffc297167..fc1c457b3 100644 --- a/macos/README.txt +++ b/macos/README.txt @@ -7,11 +7,14 @@ Starting with 0.9.23, however, Tux Paint for macOS is built as though it were a Linux application. -REQUIREMENTS ------------- -Although Tux Paint is run without the XCode IDE, XCode itself is still required -to build Tux Paint. Download it from the App Store, and launch it once to -accept its license agreements. +PREREQUISITES +------------- +Although Tux Paint is built without the XCode IDE, XCode itself is still required +to build Tux Paint. Download it from the App Store, and launch it once to +accept its license agreements. Also install XCode command line tools using the +command: + + xcode-select --install Building Tux Paint also requires various libraries from MacPorts. Install them to the default /opt/local path according to the instructions found on their @@ -23,7 +26,7 @@ As of this writing, the required libraries are: cairo fribidi - pkgconfig + lbzip2 libpaper libpng librsvg @@ -54,5 +57,70 @@ Simply, run: % make install ... to create the TuxPaint.app application bundle that can be run in-place or -copied to /Applications. Zip it up for distribution. +copied to /Applications. It also creates TuxPaint.dmg for distribution. + +KNOWN BUGS +---------- +On macOS 10.13 High Sierra: +- The mouse cursor appears with an invert-transparent background due to an + issue with SDL1 on macOS 10.13. A patch to SDL has been issued on May 16, + 2018 to fix this issue. Until this patch is officially relased and becomes a + part of the MacPorts package, SDL will need to be built from the source code + that includes the patch to display the mouse cursor correctly under macOS 10.13. + Here are more details: + + Patch - https://github.com/kanjitalk755/SDL/commit/0296d5e601a5deb5ce2f540a8eafd64dd22dbe69 + Source + patch - https://github.com/kanjitalk755/SDL/tree/forHighSierra + Full discussion - https://bugzilla.libsdl.org/show_bug.cgi?id=4076 + + +BACKWARD COMPATIBILITY +---------------------- +Broadly speaking, a Mac binary built on macOS 10.12 Sierra (for example) runs +only on macOS 10.12 and later. To compile a binary that can also execute on an +earlier version of macOS (say, 10.7 Lion and later), one of the following must +be done: + + (A) Pass the flag -mmacosx-version-min=10.7 to the compiler. + (B) Or set the environment variable MACOSX_DEPLOYMENT_TARGET to 10.7 + +Tux Paint binary itself is built by doing (A) in the Makefile (by passing the +parameter to osx_ARCH_CFLAGS). However, the MacPorts libraries used by Tux +Paint are not, so Tux Paint package itself will not run on any version of macOS +earlier than the macOS on which it is built. + +To build the Tux Paint package that can run on earlier versions of macOS, the +MacPorts libraries also need to be built with either #1 or #2. This is done by +configuring MacPorts to install all packages from their sources and build them +to run on macOS 10.7 and later: + + 1. Install the MacPorts base normally. + 2. Before installing any MacPorts package, add the following settings to + /opt/local/etc/macports/macports.conf: + + buildfromsource always + macosx_deployment_target 10.7 + + 3. Install all packages normally. + +... then build Tux Paint normally. + +Please note building MacPorts packages from the source takes significantly +longer than installing the prebuilt packages. + +If you have already installed MacPorts' prebuilt packages, it is possible to +uninstall them, add the above configuration from step #2, then install them +again from the source. The MacPorts webpage on migration explains how uninstall +packages and reinstall them after making system changes: + + https://trac.macports.org/wiki/Migration + +Even when Tux Paint and MacPorts are built to run on a specific version of +macOS, it is possible Tux Paint will not compile for or run on that version of +macOS. As of this writing, 10.7 is the oldest version of macOS that can be +targetted without errors when compiling the sources of MacPorts libraries +required by Tux Paint. + +21st May 2018 +Mark K. Kimdiff --git a/macos/background.png b/macos/background.png new file mode 100644 index 000000000..c50906308 Binary files /dev/null and b/macos/background.png differ diff --git a/src/cursor.c b/src/cursor.c index 949d2286a..bfe9cd54d 100644 --- a/src/cursor.c +++ b/src/cursor.c @@ -49,6 +49,11 @@ int no_fancy_cursors = 1; int no_fancy_cursors; #endif +/** + * Set the current cursor shape. + * + * @param c The cursor shape to use. + */ void do_setcursor(SDL_Cursor * c) { /* Shut GCC up over the fact that the XBMs are #included within cursor.h @@ -81,6 +86,11 @@ void do_setcursor(SDL_Cursor * c) SDL_SetCursor(c); } +/** + * Free (deallocate) a cursor. + * + * @param cursor Pointer to a cursor to free; will be set to point to NULL afterwards. + */ void free_cursor(SDL_Cursor ** cursor) { if (*cursor) diff --git a/src/dirwalk.c b/src/dirwalk.c index abaec8458..b09f123a5 100644 --- a/src/dirwalk.c +++ b/src/dirwalk.c @@ -44,9 +44,9 @@ #endif /* - The following section renames global variables defined in SDL_Pango.h to avoid errors during linking. - It is okay to rename these variables because they are constants. - SDL_Pang.h is included by fonts.h. + The following section renames global variables defined in SDL_Pango.h to avoid errors during linking. + It is okay to rename these variables because they are constants. + SDL_Pang.h is included by fonts.h. */ #define _MATRIX_WHITE_BACK _MATRIX_WHITE_BACK1 #define MATRIX_WHITE_BACK MATRIX_WHITE_BACK1 @@ -68,8 +68,14 @@ -///////////////// directory walking callers and callbacks ////////////////// +/* Directory walking callers and callbacks */ +/** + * Callback to invoke when loading fonts + * + * @param screen Screen surface, for animating progress bar. + * FIXME + */ void loadfont_callback(SDL_Surface * screen, SDL_Texture * texture, SDL_Renderer * renderer, const char *restrict const dir, unsigned dirlen, tp_ftw_str * files, unsigned i, const char *restrict const locale) @@ -257,15 +263,35 @@ void loadfont_callback(SDL_Surface * screen, SDL_Texture * texture, SDL_Renderer } -// For qsort() +/** + * Callback for comparing filenames + * + * @param v1 Filename #1 + * @param v2 Filename #2 + * @return An integer less than, equal to, or greater than zero if the + * filename of dir entry 'v1' is found, respectively, to be less than, + * to match, or be greater than that of 'v2'. + */ int compare_ftw_str(const void *v1, const void *v2) { const char *restrict const s1 = ((tp_ftw_str *) v1)->str; const char *restrict const s2 = ((tp_ftw_str *) v2)->str; - return -strcmp(s1, s2); /* FIXME: Should we try strcasecmp, to group things together despite uppercase/lowercase in filenames (e.g., Jigsaw* vs jigsaw* Starters)??? -bjk 2009.10.11 */ + return -strcmp(s1, s2); + /* FIXME: Should we try strcasecmp, to group things together despite uppercase/lowercase in filenames (e.g., Jigsaw* vs jigsaw* Starters)??? -bjk 2009.10.11 */ } +/** + * Process a directory full of files, using a callback function to + * deal with the files. (For loading fonts, brushes, and stamps) + * + * @param screen Screen surface, for updating progress bar. + * @param dir Directory to Process + * @param dirlen Size of directory to process + * @param rsrc Dealing with resources? (FIXME: better explanation) + * @param fn Callback function to invoke + * @param locale Locale, to pass to callback function when applicable (i.e., for fonts), else NULL + */ void tp_ftw(SDL_Surface * screen, SDL_Texture * texture, SDL_Renderer * renderer, char *restrict const dir, unsigned dirlen, int rsrc, void (*fn) (SDL_Surface * screen, SDL_Texture * texture, SDL_Renderer * renderer, const char *restrict const dir, unsigned dirlen, tp_ftw_str * files, diff --git a/src/fonts.c b/src/fonts.c index 856f8012d..acd851fac 100644 --- a/src/fonts.c +++ b/src/fonts.c @@ -161,29 +161,6 @@ static void reliable_read(int fd, void *buf, size_t count); #endif -/* This doesn't actually ever get used; see load_locale_font() - -bjk 2017.10.15 */ -/* -#ifndef NO_SDLPANGO -static TuxPaint_Font *try_alternate_font(int size) -{ - char str[128]; - char prefix[64]; - char *p; - - strcpy(prefix, lang_prefix); - if ((p = strrchr(prefix, '_')) != NULL) - { - *p = 0; - snprintf(str, sizeof(str), "%sfonts/locale/%s.ttf", DATA_PREFIX, prefix); - - return TuxPaint_Font_OpenFont("", str, size); - } - return NULL; -} -#endif -*/ - #ifdef NO_SDLPANGO TuxPaint_Font *load_locale_font(TuxPaint_Font * fallback, int size) { @@ -923,7 +900,7 @@ static void groupfonts(void) qsort(user_font_families, num_font_families, sizeof user_font_families[0], compar_fontscore); //printf("groupfonts() qsort(user_font_families 2...)\n"); //fflush(stdout); - if (user_font_families[0]->score < 0) + if (num_font_families > 0 && user_font_families[0]->score < 0) printf("sorted the wrong way, or all fonts were unusable\n"); #if 0 // THREADED_FONTS @@ -1035,8 +1012,18 @@ static void loadfonts(SDL_Surface * screen, SDL_Texture * texture, SDL_Renderer free(homedirdir); #endif +#ifdef DEBUG + printf("Grouping fonts...\n"); + fflush(stdout); +#endif + groupfonts(); +#ifdef DEBUG + printf("Finished loading the fonts\n"); + fflush(stdout); +#endif + font_thread_done = 1; waiting_for_fonts = 0; // FIXME: need a memory barrier here diff --git a/src/get_fname.c b/src/get_fname.c index 8d113233b..2e5f14ee3 100644 --- a/src/get_fname.c +++ b/src/get_fname.c @@ -30,22 +30,22 @@ #include "debug.h" #include "compiler.h" - /* DIR_SAVE: Where is the user's saved directory? - This is where their saved files are stored - and where the "current_id.txt" file is saved. +/* DIR_SAVE: Where is the user's saved directory? + This is where their saved files are stored + and where the "current_id.txt" file is saved. - Windows predefines "savedir" as: - "C:\Documents and Settings\%USERNAME%\Application Data\TuxPaint" - though it may get overridden with "--savedir" option + Windows predefines "savedir" as: + "C:\Documents and Settings\%USERNAME%\Application Data\TuxPaint" + though it may get overridden with "--savedir" option - BeOS similarly predefines "savedir" as "./userdata"... + BeOS similarly predefines "savedir" as "./userdata"... - Macintosh: It's under ~/Library/Application Support/TuxPaint + Macintosh: It's under ~/Library/Application Support/TuxPaint - Linux & Unix: It's under ~/.tuxpaint + Linux & Unix: It's under ~/.tuxpaint - DIR_DATA: Where is the user's data directory? - This is where local fonts, brushes and stamps can be found. */ + DIR_DATA: Where is the user's data directory? + This is where local fonts, brushes and stamps can be found. */ const char *savedir; @@ -57,6 +57,14 @@ const char *datadir; // for caller-provided space, and maybe callee strdup. // That's at most 4 functions per Tux Paint thread. +/** + * Construct a filepath, given a filename, and what kind of file + * (data file, or saved images?) + * + * @param name Filaneme + * @param kind What kind of file? (DIR_SAVE or DIR_DATA?) + * @return Full fillpath + */ char *get_fname(const char *const name, int kind) { char f[512]; diff --git a/src/i18n.c b/src/i18n.c index 7df4df410..195f4dc2c 100644 --- a/src/i18n.c +++ b/src/i18n.c @@ -76,6 +76,10 @@ static char *android_locale() static int langint = LANG_EN; +/* Strings representing each language's ISO 639 (-1 or -2) codes. + * Should map to the 'enum' of possible languages ("LANG_xxx") + * found in "i18n.h" (where "NUM_LANGS" is found, as the final + * entry in the 'enum' list). */ const char *lang_prefixes[NUM_LANGS] = { "ach", "af", @@ -209,7 +213,7 @@ const char *lang_prefixes[NUM_LANGS] = { }; -// languages which don't use the default font +/* Languages which don't use the default font */ static int lang_use_own_font[] = { LANG_AR, LANG_BO, @@ -227,6 +231,7 @@ static int lang_use_own_font[] = { -1 }; +/* Languages which are written right-to-left */ static int lang_use_right_to_left[] = { LANG_AR, LANG_FA, @@ -237,6 +242,7 @@ static int lang_use_right_to_left[] = { -1 }; +/* FIXME: */ static int lang_use_right_to_left_word[] = { #ifdef NO_SDLPANGO LANG_HE, @@ -244,6 +250,8 @@ static int lang_use_right_to_left_word[] = { -1 }; +/* Languages which require a vertical 'nudge' in + * text rendering, and by how much? */ static int lang_y_nudge[][2] = { {LANG_KM, 4}, {-1, -1} @@ -258,6 +266,13 @@ const char *lang_prefix, *short_lang_prefix; int num_wished_langs = 0; w_langs wished_langs[255]; +/* Mappings from human-readable language names (found in + * config files, or command-line arguments) to the precise + * local code to use. Some locales appear multiple times, + * (e.g. "de_DE.UTF-8" is represented by both "german" + * (the English name of the language) and "deutsch" + * (the German name of the language)). + */ static const language_to_locale_struct language_to_locale_array[] = { {"english", "C"}, {"american-english", "C"}, @@ -446,13 +461,20 @@ static const language_to_locale_struct language_to_locale_array[] = { {"zulu", "zu_ZA.UTF-8"} }; -/* FIXME: All this should REALLY be array-based!!! */ -/* Show available languages: */ + +/** + * Show available languages + * + * @param exitcode Exit code; also determines whether STDERR or STDOUT used. + * (e.g., is this output of "--lang help" (STDOUT & exit 0), + * or complaint of an inappropriate "--lang" argument (STDERR & exit 1)?) + */ static void show_lang_usage(int exitcode) { FILE *f = exitcode ? stderr : stdout; const char *const prg = "tuxpaint"; + /* FIXME: All this should REALLY be array-based!!! */ fprintf(f, "\n" "Usage: %s [--lang LANGUAGE]\n" "\n" "LANGUAGE may be one of:\n" /* C */ " english american-english\n" /* ach */ " acholi acoli\n" @@ -588,10 +610,15 @@ static void show_lang_usage(int exitcode) } -/* FIXME: Add accented characters to the descriptions */ -/* Show available locales: */ +/** + * Show available locales as a "usage" output + * + * @param f File descriptor to write to (e.g., STDOUT or STDERR) + * @param prg Program name (e.g., "tuxpaint" or "tuxpaint.exe") + */ static void show_locale_usage(FILE * f, const char *const prg) { + /* FIXME: Add accented characters to the descriptions */ fprintf(f, "\n" "Usage: %s [--locale LOCALE]\n" @@ -725,13 +752,23 @@ static void show_locale_usage(FILE * f, const char *const prg) " xh_ZA (Xhosa)\n" " zam (Zapoteco-Miahuatlan)\n" " zu_ZA (Zulu)\n" "\n", prg); } - +/** + * Return the current language + * + * @return The current language (one of the LANG_xxx enums) + */ int get_current_language(void) { return langint; } - +/** + * Search an array of ints for a given int + * + * @param l The int to search for + * @param array The array of ints to search, terminated by -1 + * @return 1 if "l" is found in "array", 0 otherwise + */ static int search_int_array(int l, int *array) { int i; @@ -745,12 +782,16 @@ static int search_int_array(int l, int *array) return 0; } -// This is to ensure that iswprint() works beyond ASCII, -// even if the locale wouldn't normally support that. +/** + * Ensures that iswprint() works beyond ASCII, + * even if the locale wouldn't normally support that. + * Tries fallback locales until one works. + * Emits an error message to STDERR if none work. + */ static void ctype_utf8(void) { #ifndef _WIN32 - /* FIXME: should this iterate over more locales? + /* FIXME: should this iterate over more locales? A zapotec speaker may have es_MX.UTF-8 available but not have en_US.UTF-8 for example */ const char *names[] = { "en_US.UTF8", "en_US.UTF-8", "UTF8", "UTF-8", "C.UTF-8" }; int i = sizeof(names) / sizeof(names[0]); @@ -768,7 +809,12 @@ static void ctype_utf8(void) #endif } - +/** + * For a given language, return its local, or exit with a usage error. + * + * @param langstr Name of language (e.g., "german") + * @return Locale (e.g., "de_DE.UTF-8") + */ static const char *language_to_locale(const char *langstr) { int i = sizeof language_to_locale_array / sizeof language_to_locale_array[0]; @@ -785,6 +831,12 @@ static const char *language_to_locale(const char *langstr) return NULL; } +/** + * Set language ("langint" global) based on a given locale; + * will try a few ways of checking, is case-insensitive, etc. + * + * @param loc Locale (e.g., "pt_BR.UTF-8", "pt_BR", "pt_br", etc.) + */ static void set_langint_from_locale_string(const char *restrict loc) { char *baseloc = strdup(loc); @@ -893,10 +945,10 @@ static void set_langint_from_locale_string(const char *restrict loc) } } -/* Last resource, we should never arrive here, this check depends - on the right order in lang_prefixes[] - Languages sharing the same starting letters must be ordered - from longest to shortest, like currently are pt_BR and pt */ + /* Last resort, we should never arrive here, this check depends + on the right order in lang_prefixes[] + Languages sharing the same starting letters must be ordered + from longest to shortest, like currently are pt_BR and pt */ // if (found == 0) // printf("Language still not found: loc= %s Trying reverse check as last resource...\n", loc); @@ -923,6 +975,14 @@ static void set_langint_from_locale_string(const char *restrict loc) #undef HAVE_SETENV #endif + +/** + * Set an environment variable. + * (Wrapper for setenv() or putenv(), depending on OS) + * + * @param name Variable to set + * @param value Value to set the variable to + */ static void mysetenv(const char *name, const char *value) { #ifdef HAVE_SETENV @@ -937,8 +997,15 @@ static void mysetenv(const char *name, const char *value) } +/** + * Attempt to set Tux Paint's UI language. + * + * @param loc Locale + * @return The Y-nudge value for font rendering in the language. + */ static int set_current_language(const char *restrict locale_choice) MUST_CHECK; - static int set_current_language(const char *restrict loc) + +static int set_current_language(const char *restrict loc) { int i; int y_nudge = 0; @@ -1112,6 +1179,17 @@ static int set_current_language(const char *restrict locale_choice) MUST_CHECK; return wished_langs[0].lang_y_nudge; } + +/** + * Given a locale (e.g., "de_DE.UTF-8" or a language name (e.g., "german"), + * attempt to set Tux Paint's UI language. Show help, and exit, + * if asked (either 'locale' or 'lang' are "help"), or if the + * given input is not recognized. + * + * @param lang Language name (or NULL) + * @param locale Locale (or NULL) + * @return Y-nudge + */ int setup_i18n(const char *restrict lang, const char *restrict locale) { #ifdef DEBUG @@ -1142,6 +1220,9 @@ int setup_i18n(const char *restrict lang, const char *restrict locale) } #ifdef NO_SDLPANGO +/** + * FIXME + */ int smash_i18n(void) { return set_current_language("C"); diff --git a/src/macos.c b/src/macos.c index 349add956..1cb2a7f58 100644 --- a/src/macos.c +++ b/src/macos.c @@ -1,3 +1,6 @@ +/* + * FIXME + */ #include #include "macos.h" @@ -6,43 +9,50 @@ #define MACOS_GLOBAL_PREFERENCES_PATH "/Library/Application Support/TuxPaint" +/** + * FIXME + */ const char* macos_fontsPath() { - static char* p = NULL; + static char* p = NULL; - if(!p) { - const char* home = getenv("HOME"); + if(!p) { + const char* home = getenv("HOME"); - p = malloc(strlen(home) + strlen(MACOS_FONTS_PATH) + 1); + p = malloc(strlen(home) + strlen(MACOS_FONTS_PATH) + 1); - if(p) sprintf(p, MACOS_FONTS_PATH, getenv("HOME")); - else perror("macos_fontsPath"); - } + if(p) sprintf(p, MACOS_FONTS_PATH, getenv("HOME")); + else perror("macos_fontsPath"); + } - return p; + return p; } +/** + * FIXME + */ const char* macos_preferencesPath() { - static char* p = NULL; + static char* p = NULL; - if(!p) { - const char* home = getenv("HOME"); + if(!p) { + const char* home = getenv("HOME"); - p = malloc(strlen(home) + strlen(MACOS_PREFERENCES_PATH) + 1); + p = malloc(strlen(home) + strlen(MACOS_PREFERENCES_PATH) + 1); - if(p) sprintf(p, MACOS_PREFERENCES_PATH, getenv("HOME")); - else perror("macos_preferencesPath"); - } + if(p) sprintf(p, MACOS_PREFERENCES_PATH, getenv("HOME")); + else perror("macos_preferencesPath"); + } - return p; + return p; } +/** + * FIXME + */ const char* macos_globalPreferencesPath() { - return MACOS_GLOBAL_PREFERENCES_PATH; + return MACOS_GLOBAL_PREFERENCES_PATH; } - - diff --git a/src/manpage/tuxpaint.1 b/src/manpage/tuxpaint.1 index 5e99d4eb9..4d53d2847 100644 --- a/src/manpage/tuxpaint.1 +++ b/src/manpage/tuxpaint.1 @@ -1,5 +1,5 @@ -.\" tuxpaint.1 - 2016.12.11 -.TH TUXPAINT 1 "11 December 2016" "0.9.23" "Tux Paint" +.\" tuxpaint.1 - 2018.08.19 +.TH TUXPAINT 1 "19 August 2018" "0.9.23" "Tux Paint" .SH NAME tuxpaint -- "Tux Paint", a drawing program for young children. diff --git a/src/playsound.c b/src/playsound.c index 3bed4d732..b5bbe0db4 100644 --- a/src/playsound.c +++ b/src/playsound.c @@ -33,6 +33,20 @@ int mute; int use_sound = 1; static int old_sound[4] = { -1, -1, -1, -1 }; +/** + * Play a sound. + * + * @param screen Screen surface (for dealing with panning & volume) + * @param chan Channel to play on (-1 for first free unused channel) + * @param s Which sound to play (integer index of `sounds[]` array) + * @param override 1 to override an already-playing sound, 0 otherwise + * @param x X coordinate within the screen surface, for left/right panning + * effect; or SNDPOS_LEFT, SNDPOS_CENTER, or SNDPOS_RIGHT for + * far left, center, or far right panning, respectively. + * @param y Y coordinate within the screen surface, for volume control + * (low values, near the top of the window, are quieter), or + * SNDDIST_NEAR for full volume + */ void playsound(SDL_Surface * screen, int chan, int s, int override, int x, int y) { #ifndef NOSOUND @@ -40,6 +54,10 @@ void playsound(SDL_Surface * screen, int chan, int s, int override, int x, int y if (!mute && use_sound && s != SND_NONE) { +#ifdef DEBUG + printf("playsound #%d in channel %d, pos (%d,%d), %soverride, ptr=%p\n", s, chan, x, y, override ? "" : "no ", sounds[s]); + fflush(stdout); +#endif if (override || !Mix_Playing(chan)) { Mix_PlayChannel(chan, sounds[s], 0); @@ -77,8 +95,10 @@ void playsound(SDL_Surface * screen, int chan, int s, int override, int x, int y left = ((255 - dist) * ((screen->w - 1) - x)) / (screen->w - 1); } - - +#ifdef DEBUG + printf("Panning of sound #%d in channel %d, left=%d, right=%d\n", s, chan, left, (255-dist)-left); + fflush(stdout); +#endif Mix_SetPanning(chan, left, (255 - dist) - left); } } diff --git a/src/po/eu.po b/src/po/eu.po index 92f9177fc..6018acca2 100644 --- a/src/po/eu.po +++ b/src/po/eu.po @@ -11,7 +11,7 @@ msgstr "" "Project-Id-Version: eu\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-07-29 15:48+0200\n" -"PO-Revision-Date: 2018-01-20 18:19+0100\n" +"PO-Revision-Date: 2018-08-09 11:17+0200\n" "Last-Translator: Alexander Gabilondo \n" "Language-Team: librezale@librezale.org\n" "Language: eu\n" @@ -19,7 +19,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 2.0.4\n" +"X-Generator: Poedit 2.0.6\n" #. Response to Black (0, 0, 0) color selected #: ../colors.h:86 @@ -150,10 +150,8 @@ msgstr ",.?!" #. uncommon punctuation (e.g., '@', '#', '*', etc.) #: ../dirwalk.c:201 -#, fuzzy -#| msgid "`\\%_@$~#{<(^&*" msgid "`%_@$~#{<(^&*" -msgstr "`\\%_@$~#{}<>^&*" +msgstr "`%_@$~#{}<>^&*" #. digits (e.g., '0', '1' and '7') #: ../dirwalk.c:204 @@ -302,7 +300,7 @@ msgstr "Zirkuluaren puntu guztiek distatzia berdina daukate erdiraino." #. Description of an ellipse #: ../shapes.h:304 ../shapes.h:305 msgid "An ellipse is a stretched circle." -msgstr "Elipsea zirkulu zapaldua da" +msgstr "Elipsea zirkulu zapaldua da." #. Description of a triangle #: ../shapes.h:308 ../shapes.h:309 @@ -318,7 +316,7 @@ msgstr "Pentagonoak bost alde ditu." msgid "A rhombus has four equal sides, and opposite sides are parallel." msgstr "" "Erronboaren lau aldeak berdinak dira, eta aurrez aurre daudenak paraleloak " -"dira" +"dira." #: ../shapes.h:323 ../shapes.h:325 msgid "An octagon has eight equal sides." @@ -640,7 +638,7 @@ msgstr "Bai, ezabatu!" #: ../tuxpaint.c:2103 msgid "No, don’t erase it!" -msgstr "Ez, ez ezabatu" +msgstr "Ez, ez ezabatu!" #. Reminder that Mouse Button 1 is the button to use in Tux Paint #: ../tuxpaint.c:2106 @@ -650,12 +648,12 @@ msgstr "Gogora ezazu saguaren ezkerreko botoia erabiltzea!" #. Sound has been muted (silenced) via keyboard shortcut #: ../tuxpaint.c:2314 msgid "Sound muted." -msgstr "Soinurik gabe" +msgstr "Soinurik gabe." #. Sound has been unmuted (unsilenced) via keyboard shortcut #: ../tuxpaint.c:2319 msgid "Sound unmuted." -msgstr "Soinua gaituta" +msgstr "Soinua gaituta." #. Wait while Text tool finishes loading fonts #: ../tuxpaint.c:3072 @@ -717,26 +715,27 @@ msgstr "Bai, zaharra ordeztu!" #. (like a 'File:Save As...' action in other applications) #: ../tuxpaint.c:12803 msgid "No, save a new file!" -msgstr "Ez, artxibo berria gorde" +msgstr "Ez, artxibo berria gorde!" #: ../tuxpaint.c:14048 msgid "Choose the picture you want, then click “Open”." msgstr "" -"Aukera ezazu ireki nahi duzun irudia. Ondoren klik egin ‘Ireki’ botoian" +"Aukera ezazu ireki nahi duzun irudia. Ondoren klik egin “Ireki“ botoian." #. Let user choose images: #. Instructions for Slideshow file dialog (FIXME: Make a #define) #: ../tuxpaint.c:15079 ../tuxpaint.c:15407 -msgid "Choose the pictures you want, then click “Play”." -msgstr "Aukera ezazu ireki nahi duzun irudia. Ondoren klik egin ‘Hasi’ botoian" +msgid "Choose the pictures you want, then click “Play“." +msgstr "" +"Aukera ezazu ireki nahi duzun irudia. Ondoren klik egin “Hasi“ botoian." #: ../tuxpaint.c:22873 msgid "Select a color from your drawing." -msgstr "Hautatu zure marrazkiaren kolore bat" +msgstr "Hautatu zure marrazkiaren kolore bat." #: ../tuxpaint.c:22885 msgid "Pick a color." -msgstr "Hautatu kolore bat" +msgstr "Hautatu kolore bat." #: ../tuxpaint.desktop.in.h:1 msgid "Tux Paint" @@ -748,7 +747,7 @@ msgstr "Marrazketa programa" #: ../tuxpaint.desktop.in.h:3 msgid "A drawing program for children." -msgstr "Umeentzako marrazketa programa" +msgstr "Umeentzako marrazketa programa." #: ../../magic/src/alien.c:64 msgid "Color Shift" @@ -761,7 +760,7 @@ msgstr "" #: ../../magic/src/alien.c:68 msgid "Click to change the colors in your entire picture." -msgstr "Klik egin irudi osoaren koloreak aldatzeko" +msgstr "Klik egin irudi osoaren koloreak aldatzeko." #: ../../magic/src/blind.c:117 msgid "Blind" @@ -788,15 +787,10 @@ msgid "Drip" msgstr "Busti" #: ../../magic/src/blocks_chalk_drip.c:150 -#, fuzzy -#| msgid "Click and move the mouse around to make the picture blocky." msgid "Click and drag the mouse around to make the picture blocky." -msgstr "Klik egin eta mugi ezazu sagua irudia laukitxotan marrazteko." +msgstr "Klik egin eta mugi ezazu sagua irudia pixalizatzeko." #: ../../magic/src/blocks_chalk_drip.c:153 -#, fuzzy -#| msgid "" -#| "Click and move the mouse around to turn the picture into a chalk drawing." msgid "" "Click and drag the mouse around to turn the picture into a chalk drawing." msgstr "" @@ -812,14 +806,12 @@ msgid "Blur" msgstr "Desenfokatu" #: ../../magic/src/blur.c:83 -#, fuzzy -#| msgid "Click and move the mouse around to blur the image." msgid "Click and drag the mouse around to blur the image." -msgstr "Klik egin eta mugi ezazu sagua irudia desenfokatzeko." +msgstr "Klik egin eta mugi ezazu sagua irudia desfokuratzeko." #: ../../magic/src/blur.c:84 msgid "Click to blur the entire image." -msgstr "Klik egin irudi osoa desenfokatzeko" +msgstr "Klik egin irudi osoa desfokuratzeko." #. Both are named "Bricks", at the moment: #: ../../magic/src/bricks.c:124 @@ -827,14 +819,10 @@ msgid "Bricks" msgstr "Adreiluak" #: ../../magic/src/bricks.c:131 -#, fuzzy -#| msgid "Click and move to draw large bricks." msgid "Click and drag to draw large bricks." msgstr "Egin klik eta mugitu adreilu handiak marrazteko." #: ../../magic/src/bricks.c:133 -#, fuzzy -#| msgid "Click and move to draw small bricks." msgid "Click and drag to draw small bricks." msgstr "Egin klik eta mugitu adreilu txikiak marrazteko." @@ -843,8 +831,6 @@ msgid "Calligraphy" msgstr "Kaligrafia" #: ../../magic/src/calligraphy.c:134 -#, fuzzy -#| msgid "Click and move the mouse around to draw in calligraphy." msgid "Click and drag the mouse around to draw in calligraphy." msgstr "Klik egin eta mugitu sagua kaligrafia eran marrazteko." @@ -853,10 +839,8 @@ msgid "Cartoon" msgstr "Bineta" #: ../../magic/src/cartoon.c:113 -#, fuzzy -#| msgid "Click and move the mouse around to turn the picture into a cartoon." msgid "Click and drag the mouse around to turn the picture into a cartoon." -msgstr "Klik egin eta mugi ezazu sagua irudia bineta bihurtzeko." +msgstr "Klik egin eta mugi ezazu sagua irudia komikia bihurtzeko." #: ../../magic/src/confetti.c:85 msgid "Confetti" @@ -880,7 +864,7 @@ msgstr "Bozelketa" #: ../../magic/src/emboss.c:109 msgid "Click and drag the mouse to emboss the picture." -msgstr "Klik egin eta mugitu sagua irudia bozeltzeko" +msgstr "Klik egin eta mugitu sagua irudia bozeltzeko." #: ../../magic/src/fade_darken.c:121 msgid "Lighten" @@ -896,7 +880,7 @@ msgstr "Klik egin eta mugi ezazu sagua irudiaren parte batzuk argitzeko." #: ../../magic/src/fade_darken.c:136 msgid "Click to lighten your entire picture." -msgstr "Klik egin irudi osoa argitzeko" +msgstr "Klik egin irudi osoa argitzeko." #: ../../magic/src/fade_darken.c:141 msgid "Click and drag the mouse to darken parts of your picture." @@ -930,8 +914,8 @@ msgstr "Lorea" #: ../../magic/src/flower.c:156 msgid "Click and drag to draw a flower stalk. Let go to finish the flower." msgstr "" -"Klik egin eta arrastatu lore zuirton bat marrazteko. Jarraitu lorea amaitu " -"arte" +"Klik egin eta arrastatu lore zurtoin bat marrazteko. Jarraitu lorea amaitu " +"arte." #: ../../magic/src/foam.c:121 msgid "Foam" @@ -950,7 +934,7 @@ msgstr "Tolestu" msgid "" "Choose a background color and click to turn the corner of the page over." msgstr "" -"Hautatu atzeko-planoaren kolorea eta klik egin orrialdearen txokoa tolesteko" +"Hautatu atzeko-planoaren kolorea eta klik egin orrialdearen txokoa tolesteko." #: ../../magic/src/fretwork.c:176 msgid "Fretwork" @@ -958,7 +942,7 @@ msgstr "Sareta" #: ../../magic/src/fretwork.c:180 msgid "Click and drag to draw repetitive patterns. " -msgstr "Klik egin eta arrastatu sare artistiko korapilatsua marrazteko." +msgstr "Klik egin eta arrastatu ereduak errepikatzeko." #: ../../magic/src/fretwork.c:182 msgid "Click to surround your picture with repetitive patterns." @@ -983,10 +967,8 @@ msgid "Grass" msgstr "Belarra" #: ../../magic/src/grass.c:118 -#, fuzzy -#| msgid "Click and move to draw grass. Don’t forget the dirt!" msgid "Click and drag to draw grass. Don’t forget the dirt!" -msgstr "Egin klik eta mugi ezazu belarra marrazteko. Ez ahaztu lokatza!" +msgstr "Egin klik eta mugi ezazu belarra marrazteko. Ez ahaztu lokatza!" #: ../../magic/src/halftone.c:34 msgid "Halftone" @@ -1038,16 +1020,12 @@ msgid "Click and drag the mouse to draw a pattern across the picture." msgstr "Klik egin eta mugitu sagua diseinua marrazteko irudian zehar." #: ../../magic/src/kalidescope.c:142 -#, fuzzy -#| msgid "" -#| "Click and drag the mouse to draw a pattern plus its symmetric across the " -#| "picture." msgid "" "Click and drag the mouse to draw a pattern that is symmetric across the " "picture." msgstr "" -"Klikatu eta arrastatu sagua beste diseinu bat marrazteko. Simetrikoa izango " -"da irudian zehar." +"Klikatu eta arrastatu sagua beste eredu bat marrazteko. Simetrikoa izango da " +"irudian zehar." #. KAL_BOTH #: ../../magic/src/kalidescope.c:144 @@ -1082,20 +1060,17 @@ msgstr "Irauli" #: ../../magic/src/mirror_flip.c:130 msgid "Click to make a mirror image." -msgstr "Egin klik irudiaren isla sortzeko!" +msgstr "Egin klik irudiaren isla sortzeko." #: ../../magic/src/mirror_flip.c:133 msgid "Click to flip the picture upside-down." -msgstr "Klik egin eta irudia goitik-behera irauliko da!" +msgstr "Klik egin eta irudia goitik-behera irauliko da." #: ../../magic/src/mosaic.c:100 msgid "Mosaic" msgstr "Mosaikoa" #: ../../magic/src/mosaic.c:103 -#, fuzzy -#| msgid "" -#| "Click and move the mouse to add a mosaic effect to parts of your picture." msgid "" "Click and drag the mouse to add a mosaic effect to parts of your picture." msgstr "" @@ -1119,9 +1094,6 @@ msgid "Irregular Mosaic" msgstr "Mosaiko irregularra" #: ../../magic/src/mosaic_shaped.c:148 -#, fuzzy -#| msgid "" -#| "Click and move the mouse to add a square mosaic to parts of your picture." msgid "" "Click and drag the mouse to add a square mosaic to parts of your picture." msgstr "" @@ -1133,10 +1105,6 @@ msgid "Click to add a square mosaic to your entire picture." msgstr "Egin klik irudi osoari mosaiko efektua emateko." #: ../../magic/src/mosaic_shaped.c:153 -#, fuzzy -#| msgid "" -#| "Click and move the mouse to add a hexagonal mosaic to parts of your " -#| "picture." msgid "" "Click and drag the mouse to add a hexagonal mosaic to parts of your picture." msgstr "" @@ -1148,10 +1116,6 @@ msgid "Click to add a hexagonal mosaic to your entire picture." msgstr "Egin klik irudi osoari mosaiko hexagonal efektua emateko." #: ../../magic/src/mosaic_shaped.c:158 -#, fuzzy -#| msgid "" -#| "Click and move the mouse to add an irregular mosaic to parts of your " -#| "picture." msgid "" "Click and drag the mouse to add an irregular mosaic to parts of your picture." msgstr "" @@ -1167,8 +1131,6 @@ msgid "Negative" msgstr "Negatiboa" #: ../../magic/src/negative.c:106 -#, fuzzy -#| msgid "Click and move the mouse around to make your painting negative." msgid "Click and drag the mouse around to make your painting negative." msgstr "Klik egin eta mugi ezazu sagua irudiaren negatiboa marrazteko." @@ -1181,8 +1143,6 @@ msgid "Noise" msgstr "Zarata" #: ../../magic/src/noise.c:66 -#, fuzzy -#| msgid "Click and move the mouse to add noise to parts of your picture." msgid "Click and drag the mouse to add noise to parts of your picture." msgstr "" "Klik egin eta mugi ezazu sagua irudiaren parte batzuei zarata gehitzeko." @@ -1217,7 +1177,7 @@ msgstr "Klik egin irudiaren parte batean puzzle efektua sortzeko." #: ../../magic/src/puzzle.c:113 msgid "Click to make a puzzle in fullscreen mode." -msgstr "Egin klik puzzle efektua pantaila osoan sortzeko!" +msgstr "Egin klik puzzle efektua pantaila osoan sortzeko." #: ../../magic/src/rails.c:131 msgid "Rails" @@ -1225,7 +1185,7 @@ msgstr "Trenbidea" #: ../../magic/src/rails.c:133 msgid "Click and drag to draw train track rails on your picture." -msgstr "Klik egin eta mugitu irudiaren gainean trenbidea marrazteko" +msgstr "Klik egin eta mugitu irudiaren gainean trenbidea marrazteko." #: ../../magic/src/rainbow.c:139 msgid "Rainbow" @@ -1241,7 +1201,7 @@ msgstr "Euria" #: ../../magic/src/rain.c:68 msgid "Click to place a rain drop onto your picture." -msgstr "Egin klik irudiaren gainean euri tanta bat kokatzeko" +msgstr "Egin klik irudiaren gainean euri tanta bat kokatzeko." #: ../../magic/src/rain.c:69 msgid "Click to cover your picture with rain drops." @@ -1300,19 +1260,15 @@ msgid "Silhouette" msgstr "Silueta" #: ../../magic/src/sharpen.c:78 -#, fuzzy -#| msgid "Click and move the mouse to trace edges in parts of your picture." msgid "Click and drag the mouse to trace edges in parts of your picture." msgstr "" "Klik egin eta mugitu sagua irudiaren eremu batzuetan ertzak marrazteko." #: ../../magic/src/sharpen.c:79 msgid "Click to trace edges in your entire picture." -msgstr "Klik egin irudi osoan ertzak marrazteko" +msgstr "Klik egin irudi osoan ertzak marrazteko." #: ../../magic/src/sharpen.c:80 -#, fuzzy -#| msgid "Click and move the mouse to sharpen parts of your picture." msgid "Click and drag the mouse to sharpen parts of your picture." msgstr "Klik egin eta mugitu sagua irudiaren eremu batzuk zorrozteko." @@ -1321,8 +1277,6 @@ msgid "Click to sharpen the entire picture." msgstr "Egin klik irudi osoa zorrozteko." #: ../../magic/src/sharpen.c:82 -#, fuzzy -#| msgid "Click and move the mouse to create a black and white silhouette." msgid "Click and drag the mouse to create a black and white silhouette." msgstr "Klik egin eta mugitu sagua zuri eta beltzeko silueta sortzeko." @@ -1348,15 +1302,11 @@ msgid "Wet Paint" msgstr "Pintura bustia" #: ../../magic/src/smudge.c:115 -#, fuzzy -#| msgid "Click and move the mouse around to smudge the picture." msgid "Click and drag the mouse around to smudge the picture." msgstr "Klik egin eta mugi ezazu sagua irudia zirriborratzeko." #. if (which == 1) #: ../../magic/src/smudge.c:117 -#, fuzzy -#| msgid "Click and move the mouse around to draw with wet, smudgy paint." msgid "Click and drag the mouse around to draw with wet, smudgy paint." msgstr "Klik egin eta mugi ezazu sagua pintura bustiaz zirriborratzeko." @@ -1423,10 +1373,6 @@ msgid "Click to change the color of your entire picture." msgstr "Klik egin irudi osoaren kolorea aldatzeko." #: ../../magic/src/tint.c:77 -#, fuzzy -#| msgid "" -#| "Click and move the mouse around to turn parts of your picture into white " -#| "and a color you choose." msgid "" "Click and drag the mouse around to turn parts of your picture into white and " "a color you choose." @@ -1504,8 +1450,8 @@ msgstr "Xor koloreak" #: ../../magic/src/xor.c:101 msgid "Click and drag to draw a XOR effect" -msgstr "Klik egin eta arrastatu XOR efektua marrazteko." +msgstr "Klik egin eta arrastatu XOR efektua marrazteko" #: ../../magic/src/xor.c:103 msgid "Click to draw a XOR effect on the whole picture" -msgstr "Egizu klik XOR efektua irudi osoan marrazteko." +msgstr "Egizu klik XOR efektua irudi osoan marrazteko" diff --git a/src/po/gd.po b/src/po/gd.po index 5e61abe27..33c953173 100644 --- a/src/po/gd.po +++ b/src/po/gd.po @@ -26,12 +26,12 @@ msgstr "Dubh!" #. Response to Dark grey (128, 128, 128) color selected #: ../colors.h:89 msgid "Dark grey! Some people spell it “dark gray”." -msgstr "Dorch-liath! No \"dorch-ghlas\"." +msgstr "Dorch-liath! No “dorch-ghlas”." #. Response to Light grey (192, 192, 192) color selected #: ../colors.h:92 msgid "Light grey! Some people spell it “light gray”." -msgstr "Soilleir-liath! No \"soilleir-ghlas\"." +msgstr "Soilleir-liath! No “soilleir-ghlas”." #. Response to White (255, 255, 255) color selected #: ../colors.h:95 @@ -283,8 +283,7 @@ msgstr "Rionnag" #. Description of a square #: ../shapes.h:290 ../shapes.h:291 msgid "A square is a rectangle with four equal sides." -msgstr "" -"’S e ceart-chearnach le ceithir taobhan co-ionnan a th’ anns a’ cheàrnag." +msgstr "’S e ceart-cheàrnach le ceithir taobhan co-ionnan a th’ anns a’ cheàrnag." #. Description of a rectangle #: ../shapes.h:294 ../shapes.h:295 @@ -294,9 +293,7 @@ msgstr "Tha ceithir taobhan is ceithir ceàrnan cearta aig ceàrnag." #: ../shapes.h:299 ../shapes.h:301 msgid "" "A circle is a curve where all points have the same distance from the center." -msgstr "" -"’S e lùb a th’ anns a’ chearcall far a bheil an aon astar on mheadhan aig " -"gach puing." +msgstr "’S e lùb a th’ anns a’ chearcall far a bheil an aon astar on mheadhan aig gach puing." #. Description of an ellipse #: ../shapes.h:304 ../shapes.h:305 @@ -315,13 +312,11 @@ msgstr "Tha còig taobhan aig còig-cheàrnach." #: ../shapes.h:317 ../shapes.h:319 msgid "A rhombus has four equal sides, and opposite sides are parallel." -msgstr "" -"Tha ceithir taobhan dhen aon fhaide aig rombas, is tha na taobhan mu " -"choinneamh co-shìnte." +msgstr "Tha ceithir taobhan dhen aon fhaide aig rombas, is tha na taobhan mu choinneamh co-shìnte." #: ../shapes.h:323 ../shapes.h:325 msgid "An octagon has eight equal sides." -msgstr "Tha ochd taobhan de dh'fhaid co-ionnann aig ochd-cheàrnach." +msgstr "Tha ochd taobhan de dh’fhaid co-ionnann aig ochd-cheàrnach." #: ../shapes.h:327 ../shapes.h:328 msgid "A star with 3 points." @@ -457,30 +452,21 @@ msgstr "Tagh dealbh gus stampadh mu thimcheall an deilbh agad." #. Line tool instructions #: ../tools.h:121 msgid "Click to start drawing a line. Let go to complete it." -msgstr "" -"Briog gus tòiseachadh air loidhne a pheantadh. Leig às gus crìoch a chur " -"oirre." +msgstr "Briog gus tòiseachadh air loidhne a pheantadh. Leig às gus crìoch a chur oirre." #. Shape tool instructions #: ../tools.h:124 msgid "" "Pick a shape. Click to pick the center, drag, then let go when it is the " "size you want. Move around to rotate it, and click to draw it." -msgstr "" -"Tagh cumadh. Briog gus am meadhan a thaghadh, slaod, is leig às nuair a " -"bhios am meud air a thogras tu. Gluais mu thimcheall gus car a chur air, is " -"briog nuair a bhios tu deiseil." +msgstr "Tagh cumadh. Briog gus am meadhan a thaghadh, slaod, is leig às nuair a bhios am meud air a thogras tu. Gluais mu thimcheall gus car a chur air, is briog nuair a bhios tu deiseil." #. Text tool instructions #: ../tools.h:127 msgid "" "Choose a style of text. Click on your drawing and you can start typing. " "Press [Enter] or [Tab] to complete the text." -msgstr "" -"Tagh seòrsa de theacsa. Briog air an dealbh agad gus tòiseachadh air " -"sgrìobhadh. Brùth air [Enter] no [Taba] nuair a bhios tu deiseil. Gus " -"fuaimreag le stràc fhaighinn (à è ì ò ù), brùth an iuchair san oisean clì " -"air a' bharr an toiseach agus A, E, I, O no U an uairsin." +msgstr "Tagh seòrsa de theacsa. Briog air an dealbh agad gus tòiseachadh air sgrìobhadh. Brùth air [Enter] no [Taba] nuair a bhios tu deiseil. Gus fuaimreag le stràc fhaighinn (à è ì ò ù), brùth an iuchair san oisean clì air a’ bharr an toiseach agus A, E, I, O no U an uairsin." #. Label tool instructions #: ../tools.h:130 @@ -489,11 +475,7 @@ msgid "" "Press [Enter] or [Tab] to complete the text. By using the selector button " "and clicking an existing label, you can move it, edit it and change its text " "style." -msgstr "" -"Tagh seòrsa de theacsa. Briog air an dealbh agad agus sgrìobh. Brùth air " -"[Enter] no [Taba] nuair a bhios tu deiseil. Ma chleachdas tu am putain-" -"taghaidh is ma bhriogas tu air leubail a tha ann mar-thà, ’s urrainn dhut a " -"ghluasad, a dheasachadh is stoidhle an teacsa atharrachadh." +msgstr "Tagh seòrsa de theacsa. Briog air an dealbh agad agus sgrìobh. Brùth air [Enter] no [Taba] nuair a bhios tu deiseil. Ma chleachdas tu am putan-taghaidh is ma bhriogas tu air leubail a tha ann mar-thà, ’s urrainn dhut a ghluasad, a dheasachadh is stoidhle an teacsa atharrachadh." #. Magic tool instruction #: ../tools.h:136 @@ -533,7 +515,7 @@ msgstr "Chaidh an dealbh agad a shàbhaladh!" #. Response to 'print' action (while printing, or print dialog is being used) #: ../tools.h:157 msgid "Printing…" -msgstr "'Ga chlò-bhualadh…" +msgstr "’Ga chlò-bhualadh…" #. Response to 'quit' (exit) action #: ../tools.h:160 @@ -548,17 +530,17 @@ msgstr "Leig às dhan phutan gus crìoch a chur air an loidhne." #. Instruction while using Shape tool (after first click, before release) #: ../tools.h:167 msgid "Hold the button to stretch the shape." -msgstr "Fuirich air a' phutan gus an cumadh a shìneadh." +msgstr "Fuirich air a’ phutan gus an cumadh a shìneadh." #. Instruction while finishing Shape tool (after release, during rotation step before second click) #: ../tools.h:170 msgid "Move the mouse to rotate the shape. Click to draw it." -msgstr "Gluais an luchag gus car a chur air a' chumadh. Briog gus a pheantadh." +msgstr "Gluais an luchag gus car a chur air a’ chumadh. Briog gus a pheantadh." #. Notification that 'New' action was aborted (current image would have been lost) #: ../tools.h:173 msgid "OK then… Let’s keep drawing this one!" -msgstr "Ceart ma-thà… Cumaidh sinn oirnn a' peantadh an fhir seo!" +msgstr "Ceart ma-thà… Cumaidh sinn oirnn a’ peantadh an fhir seo!" #. Prompt to confirm user wishes to quit #: ../tuxpaint.c:2054 @@ -578,7 +560,7 @@ msgstr "Cha bu mhiann, thoir air ais mi!" #. Current picture is not saved; user is quitting #: ../tuxpaint.c:2064 msgid "If you quit, you’ll lose your picture! Save it?" -msgstr "Ma dh'fhàgas tu an seo, caillidh tu an dealbh agad! An sàbhail sinn e?" +msgstr "Ma dh’fhàgas tu an seo, caillidh tu an dealbh agad! An sàbhail sinn e?" #: ../tuxpaint.c:2065 ../tuxpaint.c:2070 msgid "Yes, save it!" @@ -626,7 +608,7 @@ msgstr "Chlò-bhuail mi an dealbh agad!" #. We got an error printing #: ../tuxpaint.c:2094 msgid "Sorry! Your picture could not be printed!" -msgstr "Tha mi duilich! Cha b' urrainn dhomh an dealbh agad a chlò-bhualadh!" +msgstr "Tha mi duilich! Cha b’ urrainn dhomh an dealbh agad a chlò-bhualadh!" #. Notification that it's too soon to print again (--printdelay option is in effect) #: ../tuxpaint.c:2097 @@ -659,7 +641,7 @@ msgstr "Fuaim air a mùchadh." #. Sound has been unmuted (unsilenced) via keyboard shortcut #: ../tuxpaint.c:2319 msgid "Sound unmuted." -msgstr "Fuaim air a neo-mhùchadh." +msgstr "Fuaim air a dhì-mhùchadh." #. Wait while Text tool finishes loading fonts #: ../tuxpaint.c:3072 @@ -715,7 +697,7 @@ msgstr "An cuir mi na h-atharraichean agad an àite an deilbh?" #. (like a 'File:Save' action in other applications) #: ../tuxpaint.c:12799 msgid "Yes, replace the old one!" -msgstr "Cuiridh, cuir an aite an t-seann fhir e!" +msgstr "Cuiridh, cuir an àite an t-seann fhir e!" #. Negative response to saving over old version (saves a new image) #. (like a 'File:Save As...' action in other applications) @@ -725,13 +707,13 @@ msgstr "Cha chuir, sàbhail ann am faidhle ùr e!" #: ../tuxpaint.c:14048 msgid "Choose the picture you want, then click “Open”." -msgstr "Tagh an dealbh a tha thu ag iarraidh is briog air \"Fosgail\"." +msgstr "Tagh an dealbh a tha thu ag iarraidh is briog air “Fosgail”." #. Let user choose images: #. Instructions for Slideshow file dialog (FIXME: Make a #define) #: ../tuxpaint.c:15079 ../tuxpaint.c:15407 msgid "Choose the pictures you want, then click “Play”." -msgstr "Tagh na dealbhan a tha thu ag iarraidh is briog air \"Cluich\"." +msgstr "Tagh na dealbhan a tha thu ag iarraidh is briog air “Cluich”." #: ../tuxpaint.c:22873 msgid "Select a color from your drawing." @@ -751,7 +733,7 @@ msgstr "Prògram peantaidh" #: ../tuxpaint.desktop.in.h:3 msgid "A drawing program for children." -msgstr "Prògram peantaidh do chloinn." +msgstr "Prògram peantaidh don chloinn." #: ../../magic/src/alien.c:64 msgid "Color Shift" @@ -759,9 +741,7 @@ msgstr "Mùthadh datha" #: ../../magic/src/alien.c:67 msgid "Click and drag the mouse to change the colors in parts of your picture." -msgstr "" -"Briog is slaod an luchag gus car a chur air na dathan ann am pàirt dhen " -"dealbh agad." +msgstr "Briog is slaod an luchag gus car a chur air na dathan ann am pàirt dhen dealbh agad." #: ../../magic/src/alien.c:68 msgid "Click to change the colors in your entire picture." @@ -775,9 +755,7 @@ msgstr "Sgàil" msgid "" "Click towards the edge of your picture to pull window blinds over it. Move " "perpendicularly to open or close the blinds." -msgstr "" -"Briog faisg air oir an deilbh agad gus sgàilean-uinneig a shlaodadh thairis. " -"Gluais gu dìreach gus an sgàilean fhosgladh is a dhùnadh." +msgstr "Briog faisg air oir an deilbh agad gus sgàilean-uinneig a shlaodadh thairis. Gluais gu dìreach gus an sgàilean fhosgladh is a dhùnadh." #: ../../magic/src/blocks_chalk_drip.c:136 msgid "Blocks" @@ -793,21 +771,16 @@ msgstr "Sil" #: ../../magic/src/blocks_chalk_drip.c:150 msgid "Click and drag the mouse around to make the picture blocky." -msgstr "" -"Briog is slaod an luchag mu thimcheall gus an tèid an dealbh 'na " -"bhlocaichean." +msgstr "Briog is slaod an luchag mu thimcheall gus an tèid an dealbh ’na bhlocaichean." #: ../../magic/src/blocks_chalk_drip.c:153 msgid "" "Click and drag the mouse around to turn the picture into a chalk drawing." -msgstr "" -"Briog is slaod an luchag mu thimcheall gus an tèid an dealbh 'na dhealbh " -"cailce." +msgstr "Briog is slaod an luchag mu thimcheall gus an tèid an dealbh ’na dhealbh cailce." #: ../../magic/src/blocks_chalk_drip.c:156 msgid "Click and drag the mouse around to make the picture drip." -msgstr "" -"Briog is slaod an luchag mu thimcheall gus sileadh a thoirt air an dealbh." +msgstr "Briog is slaod an luchag mu thimcheall gus sileadh a thoirt air an dealbh." #: ../../magic/src/blur.c:80 msgid "Blur" @@ -828,15 +801,11 @@ msgstr "Breigichean" #: ../../magic/src/bricks.c:131 msgid "Click and drag to draw large bricks." -msgstr "" -"Briog is slaod an luchag mu thimcheall gus an tèid an dealbh 'na " -"bhreigichean mòra." +msgstr "Briog is slaod an luchag mu thimcheall gus an tèid an dealbh ’na bhreigichean mòra." #: ../../magic/src/bricks.c:133 msgid "Click and drag to draw small bricks." -msgstr "" -"Briog is slaod an luchag mu thimcheall gus tèid an dealbh 'na bhreigichean " -"beaga." +msgstr "Briog is slaod an luchag mu thimcheall gus tèid an dealbh ’na bhreigichean beaga." #: ../../magic/src/calligraphy.c:127 msgid "Calligraphy" @@ -844,8 +813,7 @@ msgstr "Snas-sgrìobhadh" #: ../../magic/src/calligraphy.c:134 msgid "Click and drag the mouse around to draw in calligraphy." -msgstr "" -"Briog is slaod an luchag mu thimcheall gus peantadh ann an stoidhle snasail." +msgstr "Briog is slaod an luchag mu thimcheall gus peantadh ann an stoidhle snasail." #: ../../magic/src/cartoon.c:106 msgid "Cartoon" @@ -853,8 +821,7 @@ msgstr "Cartùn" #: ../../magic/src/cartoon.c:113 msgid "Click and drag the mouse around to turn the picture into a cartoon." -msgstr "" -"Briog is slaod an luchag mu thimcheall gus an tèid an dealbh 'na chartùn." +msgstr "Briog is slaod an luchag mu thimcheall gus an tèid an dealbh ’na chartùn." #: ../../magic/src/confetti.c:85 msgid "Confetti" @@ -890,23 +857,19 @@ msgstr "Dorch" #: ../../magic/src/fade_darken.c:134 msgid "Click and drag the mouse to lighten parts of your picture." -msgstr "" -"Briog is slaod an luchag gus pàirt dhen dealbh agad a dhèanamh nas soilleire." +msgstr "Briog is slaod an luchag gus pàirt dhen dealbh agad a dhèanamh nas soilleire." #: ../../magic/src/fade_darken.c:136 msgid "Click to lighten your entire picture." -msgstr "" -"Briog is gluais an luchag gus an dealbh gu lèir a dhèanamh nas soilleire." +msgstr "Briog is gluais an luchag gus an dealbh gu lèir a dhèanamh nas soilleire." #: ../../magic/src/fade_darken.c:141 msgid "Click and drag the mouse to darken parts of your picture." -msgstr "" -"Briog is slaod an luchag gus pàirt dhen dealbh agad a dhèanamh nas duirche." +msgstr "Briog is slaod an luchag gus pàirt dhen dealbh agad a dhèanamh nas duirche." #: ../../magic/src/fade_darken.c:143 msgid "Click to darken your entire picture." -msgstr "" -"Briog is gluais an luchag gus an dealbh gu lèir a dhèanamh nas duirche." +msgstr "Briog is gluais an luchag gus an dealbh gu lèir a dhèanamh nas duirche." #: ../../magic/src/fill.c:108 msgid "Fill" @@ -923,8 +886,7 @@ msgstr "Sùil èisg" #. Needs better name #: ../../magic/src/fisheye.c:106 msgid "Click on part of your picture to create a fisheye effect." -msgstr "" -"Briog air pàirt dhen dealbh agad gus èifeachd sùil èisg a chruthachadh." +msgstr "Briog air pàirt dhen dealbh agad gus èifeachd sùil èisg a chruthachadh." #: ../../magic/src/flower.c:150 msgid "Flower" @@ -932,9 +894,7 @@ msgstr "Flùr" #: ../../magic/src/flower.c:156 msgid "Click and drag to draw a flower stalk. Let go to finish the flower." -msgstr "" -"Briog is slaod gus cuiseag flùir a pheantadh. Leig às gus am flùr a " -"choileanadh." +msgstr "Briog is slaod gus cuiseag flùir a pheantadh. Leig às gus am flùr a choileanadh." #: ../../magic/src/foam.c:121 msgid "Foam" @@ -942,8 +902,7 @@ msgstr "Cop" #: ../../magic/src/foam.c:127 msgid "Click and drag the mouse to cover an area with foamy bubbles." -msgstr "" -"Briog is slaod an luchag gus roinn a chòmhdachadh le builgeanan copach." +msgstr "Briog is slaod an luchag gus roinn a chòmhdachadh le builgeanan copach." #: ../../magic/src/fold.c:105 msgid "Fold" @@ -972,15 +931,11 @@ msgstr "Leac ghlainne" #: ../../magic/src/glasstile.c:114 msgid "Click and drag the mouse to put glass tile over your picture." -msgstr "" -"Briog is slaod an luchag gus pàirt dhen dealbh agad a chòmhdachadh le " -"leacagan glainne." +msgstr "Briog is slaod an luchag gus pàirt dhen dealbh agad a chòmhdachadh le leacagan glainne." #: ../../magic/src/glasstile.c:116 msgid "Click to cover your entire picture in glass tiles." -msgstr "" -"Briog is slaod an luchag gus an dealbh gu lèir a chòmhdachadh le leacagan " -"glainne." +msgstr "Briog is slaod an luchag gus an dealbh gu lèir a chòmhdachadh le leacagan glainne." #: ../../magic/src/grass.c:112 msgid "Grass" @@ -1017,23 +972,19 @@ msgstr "Leacagan" #. KAL_BOTH #: ../../magic/src/kalidescope.c:128 msgid "Kaleidoscope" -msgstr "Kaleidoskop" +msgstr "Cailèideasgop" #: ../../magic/src/kalidescope.c:136 msgid "" "Click and drag the mouse to draw with two brushes that are symmetric across " "the left and right of your picture." -msgstr "" -"Briog is slaod an luchag gus peantadh le dà bhruis a tha co-chothromach a " -"dh'ionnsaigh taobh deas is clì an deilbh agad." +msgstr "Briog is slaod an luchag gus peantadh le dà bhruis a tha co-chothromach a dh’ionnsaigh taobh deas is clì an deilbh agad." #: ../../magic/src/kalidescope.c:138 msgid "" "Click and drag the mouse to draw with two brushes that are symmetric across " "the top and bottom of your picture." -msgstr "" -"Briog is slaod an luchag gus peantadh le dà bhruis a tha co-chothromach a " -"dh'ionnsaigh bàrr is bonn an deilbh agad." +msgstr "Briog is slaod an luchag gus peantadh le dà bhruis a tha co-chothromach a dh’ionnsaigh bàrr is bonn an deilbh agad." #: ../../magic/src/kalidescope.c:140 msgid "Click and drag the mouse to draw a pattern across the picture." @@ -1043,17 +994,13 @@ msgstr "Briog is slaod an luchag gus pàtran a chur thairis air an dealbh." msgid "" "Click and drag the mouse to draw a pattern that is symmetric across the " "picture." -msgstr "" -"Briog is slaod an luchag gus pàtran co-chothromach a pheantadh thairis air " -"an dealbh." +msgstr "Briog is slaod an luchag gus pàtran co-chothromach a pheantadh thairis air an dealbh." #. KAL_BOTH #: ../../magic/src/kalidescope.c:144 msgid "" "Click and drag the mouse to draw with symmetric brushes (a kaleidoscope)." -msgstr "" -"Briog is slaod an luchag gus peantadh le dà bhruis a tha co-chothromach " -"(kaleidoscop)." +msgstr "Briog is slaod an luchag gus peantadh le dà bhruis a tha co-chothromach (cailèideasgop)." #: ../../magic/src/light.c:107 msgid "Light" @@ -1094,14 +1041,11 @@ msgstr "Mosàig" #: ../../magic/src/mosaic.c:103 msgid "" "Click and drag the mouse to add a mosaic effect to parts of your picture." -msgstr "" -"Briog is slaod an luchag gus èifeachd mosàig a chur ri pàirt dhen dealbh " -"agad." +msgstr "Briog is slaod an luchag gus èifeachd mosàig a chur ri pàirt dhen dealbh agad." #: ../../magic/src/mosaic.c:104 msgid "Click to add a mosaic effect to your entire picture." -msgstr "" -"Briog is slaod an luchag gus èifeachd mosàig a chur ris an dealbh gu lèir." +msgstr "Briog is slaod an luchag gus èifeachd mosàig a chur ris an dealbh gu lèir." #: ../../magic/src/mosaic_shaped.c:139 msgid "Square Mosaic" @@ -1118,41 +1062,29 @@ msgstr "Mosàig neo-riaghailteach" #: ../../magic/src/mosaic_shaped.c:148 msgid "" "Click and drag the mouse to add a square mosaic to parts of your picture." -msgstr "" -"Briog is slaod an luchag gus èifeachd mosàig cheàrnach a chur ri pàirt dhen " -"dealbh agad." +msgstr "Briog is slaod an luchag gus èifeachd mosàig cheàrnach a chur ri pàirt dhen dealbh agad." #: ../../magic/src/mosaic_shaped.c:149 msgid "Click to add a square mosaic to your entire picture." -msgstr "" -"Briog is slaod an luchag gus èifeachd mosàig cheàrnach a chur ris an dealbh " -"gu lèir." +msgstr "Briog is slaod an luchag gus èifeachd mosàig cheàrnach a chur ris an dealbh gu lèir." #: ../../magic/src/mosaic_shaped.c:153 msgid "" "Click and drag the mouse to add a hexagonal mosaic to parts of your picture." -msgstr "" -"Briog is slaod an luchag gus èifeachd mosàig sia-cheàrnach a chur ri pàirt " -"dhen dealbh agad." +msgstr "Briog is slaod an luchag gus èifeachd mosàig sia-cheàrnach a chur ri pàirt dhen dealbh agad." #: ../../magic/src/mosaic_shaped.c:154 msgid "Click to add a hexagonal mosaic to your entire picture." -msgstr "" -"Briog is slaod an luchag gus èifeachd mosàig shia-cheàrnach a chur ris an " -"dealbh gu lèir." +msgstr "Briog is slaod an luchag gus èifeachd mosàig shia-cheàrnach a chur ris an dealbh gu lèir." #: ../../magic/src/mosaic_shaped.c:158 msgid "" "Click and drag the mouse to add an irregular mosaic to parts of your picture." -msgstr "" -"Briog is slaod an luchag gus èifeachd mosàig neo-riaghailteach a chur ri " -"pàirt dhen dealbh agad." +msgstr "Briog is slaod an luchag gus èifeachd mosàig neo-riaghailteach a chur ri pàirt dhen dealbh agad." #: ../../magic/src/mosaic_shaped.c:159 msgid "Click to add an irregular mosaic to your entire picture." -msgstr "" -"Briog is slaod an luchag gus èifeachd mosàig neo-riaghailteach a chur ris an " -"dealbh gu lèir." +msgstr "Briog is slaod an luchag gus èifeachd mosàig neo-riaghailteach a chur ris an dealbh gu lèir." #: ../../magic/src/negative.c:98 msgid "Negative" @@ -1160,14 +1092,11 @@ msgstr "Ais-thionndaidh" #: ../../magic/src/negative.c:106 msgid "Click and drag the mouse around to make your painting negative." -msgstr "" -"Briog is slaod an luchag gus na dathan ann am pàirt dhen dealbh agad ais-" -"thionndadh." +msgstr "Briog is slaod an luchag gus na dathan ann am pàirt dhen dealbh agad ais-thionndadh." #: ../../magic/src/negative.c:109 msgid "Click to turn your painting into its negative." -msgstr "" -"Briog is slaod an luchag gus na dathan san dealbh gu lèir ais-thionndadh." +msgstr "Briog is slaod an luchag gus na dathan san dealbh gu lèir ais-thionndadh." #: ../../magic/src/noise.c:63 msgid "Noise" @@ -1175,8 +1104,7 @@ msgstr "Riasladh" #: ../../magic/src/noise.c:66 msgid "Click and drag the mouse to add noise to parts of your picture." -msgstr "" -"Briog is slaod an luchag gus riasladh a thoirt air pàirt dhen dealbh agad." +msgstr "Briog is slaod an luchag gus riasladh a thoirt air pàirt dhen dealbh agad." #: ../../magic/src/noise.c:67 msgid "Click to add noise to your entire picture." @@ -1192,15 +1120,11 @@ msgstr "Sùm" #: ../../magic/src/perspective.c:151 msgid "Click on the corners and drag where you want to stretch the picture." -msgstr "" -"Briog air na h-oisean is slaod iad gu far a bheil thu ag iarraidh an dealbh " -"a shìneadh." +msgstr "Briog air na h-oisean is slaod iad gu far a bheil thu ag iarraidh an dealbh a shìneadh." #: ../../magic/src/perspective.c:154 msgid "Click and drag up to zoom in or drag down to zoom out the picture." -msgstr "" -"Briog is slaod suas airson sùmadh a-steach dhan dealbh no sìos airson sùmadh " -"a-mach às an dealbh." +msgstr "Briog is slaod suas airson sùmadh a-steach dhan dealbh no sìos airson sùmadh a-mach às an dealbh." #: ../../magic/src/puzzle.c:105 msgid "Puzzle" @@ -1220,8 +1144,7 @@ msgstr "Rèilean" #: ../../magic/src/rails.c:133 msgid "Click and drag to draw train track rails on your picture." -msgstr "" -"Briog is slaod gus rèilean rathaid-iarainn a pheantadh air an dealbh agad." +msgstr "Briog is slaod gus rèilean rathaid-iarainn a pheantadh air an dealbh agad." #: ../../magic/src/rainbow.c:139 msgid "Rainbow" @@ -1229,7 +1152,7 @@ msgstr "Dathan bogha-froise" #: ../../magic/src/rainbow.c:146 msgid "You can draw in rainbow colors!" -msgstr "'S urrainn dhut peantadh le dathan na bogha-froise!" +msgstr "’S urrainn dhut peantadh le dathan na bogha-froise!" #: ../../magic/src/rain.c:65 msgid "Rain" @@ -1255,9 +1178,7 @@ msgstr "Bogha-froise" msgid "" "Click where you want your rainbow to start, drag to where you want it to " "end, and then let go to draw a rainbow." -msgstr "" -"Briog gus bogha-froise a thòiseachadh, slaod gu far a bheil thu ag iarraidh " -"a chrìochnachadh is leig às." +msgstr "Briog gus bogha-froise a thòiseachadh, slaod gu far a bheil thu ag iarraidh a chrìochnachadh is leig às." #: ../../magic/src/ripples.c:106 msgid "Ripples" @@ -1281,7 +1202,7 @@ msgstr "Briog is slaod gus cruth ròis a pheantadh." #: ../../magic/src/rosette.c:123 msgid "You can draw just like Picasso!" -msgstr "'S urrainn dhut peantadh mar Phicasso!" +msgstr "’S urrainn dhut peantadh mar Phicasso!" #: ../../magic/src/sharpen.c:73 msgid "Edges" @@ -1317,7 +1238,7 @@ msgstr "Briog is slaod an luchag gus sgàil-riochd dubh is geal a chruthachadh." #: ../../magic/src/sharpen.c:83 msgid "Click to create a black and white silhouette of your entire picture." -msgstr "Briog gus an tèid an dealbh gu lèir 'na sgàil-riochd." +msgstr "Briog gus an tèid an dealbh gu lèir ’na sgàil-riochd." #: ../../magic/src/shift.c:109 msgid "Shift" @@ -1325,8 +1246,7 @@ msgstr "Gluais" #: ../../magic/src/shift.c:115 msgid "Click and drag to shift your picture around on the canvas." -msgstr "" -"Briog is slaod gus an dealbh agad a ghluasad mu thimcheall a' chanabhais." +msgstr "Briog is slaod gus an dealbh agad a ghluasad mu thimcheall a’ chanabhais." #: ../../magic/src/smudge.c:106 msgid "Smudge" @@ -1344,9 +1264,7 @@ msgstr "Briog is slaod an luchag mu thimcheall gus an dealbh a smalachadh." #. if (which == 1) #: ../../magic/src/smudge.c:117 msgid "Click and drag the mouse around to draw with wet, smudgy paint." -msgstr "" -"Briog is slaod an luchag mu thimcheall gus peantadh le peant fliuch is " -"smeurach." +msgstr "Briog is slaod an luchag mu thimcheall gus peantadh le peant fliuch is smeurach." #: ../../magic/src/snow.c:68 msgid "Snow Ball" @@ -1366,28 +1284,25 @@ msgstr "Briog gus bleideagan sneachda a chur ris an dealbh agad." #: ../../magic/src/string.c:123 msgid "String edges" -msgstr "Teud - oir" +msgstr "Teud – oir" #: ../../magic/src/string.c:126 msgid "String corner" -msgstr "Teud - oisean" +msgstr "Teud – oisean" #: ../../magic/src/string.c:129 msgid "String 'V'" -msgstr "Teud - saighead" +msgstr "Teud – saighead" #: ../../magic/src/string.c:137 msgid "" "Click and drag to draw string art. Drag top-bottom to draw less or more " "lines, left or right to make a bigger hole." -msgstr "" -"Briog is slaod gus ealain teuda a pheantadh. Slaod suas is sìos airson " -"barrachd no nas lugha de loidhnichean, is gu clì no deas airson toll nas " -"motha no nas lugha." +msgstr "Briog is slaod gus ealain teuda a pheantadh. Slaod suas is sìos airson barrachd no nas lugha de loidhnichean, is gu clì no deas airson toll nas motha no nas lugha." #: ../../magic/src/string.c:140 msgid "Click and drag to draw arrows made of string art." -msgstr "Briog is slaod gus saigheadan de dh'ealain teuda a pheantadh." +msgstr "Briog is slaod gus saigheadan de dh’ealain teuda a pheantadh." #: ../../magic/src/string.c:143 msgid "Draw string art arrows with free angles." @@ -1404,9 +1319,7 @@ msgstr "Dath ⁊ geal" #: ../../magic/src/tint.c:75 msgid "" "Click and drag the mouse around to change the color of parts of your picture." -msgstr "" -"Briog is slaod an luchag mu thimcheall gus na dathan ann am pàirt dhen " -"dealbh agad atharrachadh." +msgstr "Briog is slaod an luchag mu thimcheall gus na dathan ann am pàirt dhen dealbh agad atharrachadh." #: ../../magic/src/tint.c:76 msgid "Click to change the color of your entire picture." @@ -1416,14 +1329,11 @@ msgstr "Briog gus an dath atharrachadh san dealbh gu lèir." msgid "" "Click and drag the mouse around to turn parts of your picture into white and " "a color you choose." -msgstr "" -"Briog is slaod an luchag mu thimcheall gus pàirt dhen dealbh agad a " -"thionndadh gu geal is an dath a thaghas tu." +msgstr "Briog is slaod an luchag mu thimcheall gus pàirt dhen dealbh agad a thionndadh gu geal is an dath a thaghas tu." #: ../../magic/src/tint.c:78 msgid "Click to turn your entire picture into white and a color you choose." -msgstr "" -"Briog gus an dealbh gu lèir a thionndadh gu geal is an dath a thaghas tu." +msgstr "Briog gus an dealbh gu lèir a thionndadh gu geal is an dath a thaghas tu." #: ../../magic/src/toothpaste.c:65 msgid "Toothpaste" @@ -1440,8 +1350,7 @@ msgstr "Cuairt-ghaoth" # Is the word "lainnir" appropriate/common? #: ../../magic/src/tornado.c:163 msgid "Click and drag to draw a tornado funnel on your picture." -msgstr "" -"Briog is slaod gus fuineall cuairt-ghaoithe a pheantadh air an dealbh agad." +msgstr "Briog is slaod gus fuineall cuairt-ghaoithe a pheantadh air an dealbh agad." #: ../../magic/src/tv.c:100 msgid "TV" @@ -1451,15 +1360,11 @@ msgstr "TBh" msgid "" "Click and drag to make parts of your picture look like they are on " "television." -msgstr "" -"Briog is slaod gus coltas a thoirt air pàirt dhen dealbh agad nam b' ann air " -"an tbh a bhiodh iad." +msgstr "Briog is slaod gus coltas a thoirt air pàirt dhen dealbh agad nam b’ ann air an tbh a bhiodh iad." #: ../../magic/src/tv.c:108 msgid "Click to make your picture look like it's on television." -msgstr "" -"Briog gus coltas a thoirt air an dealbh agad nam b' ann air an tbh a bhiodh " -"e." +msgstr "Briog gus coltas a thoirt air an dealbh agad nam b’ ann air an tbh a bhiodh e." #: ../../magic/src/waves.c:103 msgid "Waves" @@ -1474,20 +1379,14 @@ msgid "" "Click to make the picture horizontally wavy. Click toward the top for " "shorter waves, the bottom for taller waves, the left for small waves, and " "the right for long waves." -msgstr "" -"Briog gus an tèid an dealbh agad 'na thonnan còmhnard. Briog mun bhàrr " -"airson thonnan as giorra, mun bhonn airson thonnan as àirde, mu chlì airson " -"thonnan as lugha, is mu dheas airson thonnan as fhaide." +msgstr "Briog gus an tèid an dealbh agad ’na thonnan còmhnard. Briog mun bhàrr airson thonnan as giorra, mun bhonn airson thonnan as àirde, mu chlì airson thonnan as lugha, is mu dheas airson thonnan as fhaide." #: ../../magic/src/waves.c:112 msgid "" "Click to make the picture vertically wavy. Click toward the top for shorter " "waves, the bottom for taller waves, the left for small waves, and the right " "for long waves." -msgstr "" -"Briog gus an tèid an dealbh agad 'na thonnan inghearach. Briog mun bhàrr " -"airson thonnan as giorra, mun bhonn airson thonnan as àirde, mu chlì airson " -"thonnan as lugha, is mu dheas airson thonnan as fhaide." +msgstr "Briog gus an tèid an dealbh agad ’na thonnan inghearach. Briog mun bhàrr airson thonnan as giorra, mun bhonn airson thonnan as àirde, mu chlì airson thonnan as lugha, is mu dheas airson thonnan as fhaide." #: ../../magic/src/xor.c:95 msgid "Xor Colors" @@ -1499,5 +1398,4 @@ msgstr "Briog is slaod gus èifeachd XOR a pheantadh." #: ../../magic/src/xor.c:103 msgid "Click to draw a XOR effect on the whole picture" -msgstr "" -"Briog is slaod an luchag gus èifeachd XOR a chur ris an dealbh gu lèir." +msgstr "Briog is slaod an luchag gus èifeachd XOR a chur ris an dealbh gu lèir." diff --git a/src/postscript_print.c b/src/postscript_print.c index 39d3f441c..e54594364 100644 --- a/src/postscript_print.c +++ b/src/postscript_print.c @@ -3,7 +3,7 @@ For Tux Paint PostScript(r) printing routine. - (for non-Windows, non-Mac OS X, non-BeOS platforms, e.g. Linux) + (for non-Windows, non-BeOS platforms, e.g. Linux and macOS) (moved from tuxpaint.c in 0.9.17) Copyright (c) 2009 by Bill Kendrick and others @@ -51,6 +51,7 @@ #include #include #include +#include "debug.h" #ifndef PAPER_H #error "---------------------------------------------------" @@ -296,13 +297,18 @@ int do_ps_save(FILE * fi, pid_t child_pid, w; int status; +#ifdef __APPLE__ + /* macOS does not always reset errno so Tux Paint thinks print never + * succeeds - let's reset before calling pclose() on macOS */ + errno = 0; +#endif + child_pid = pclose(fi); -/* debug */ -/* +#ifdef DEBUG printf("pclose returned %d\n", child_pid); fflush(stdout); printf("errno = %d\n", errno); fflush(stdout); -*/ +#endif if (child_pid < 0 || (errno != 0 && errno != EAGAIN)) { /* FIXME: This right? */ @@ -317,8 +323,7 @@ int do_ps_save(FILE * fi, { w = waitpid(child_pid, &status, 0); -/* debug */ -/* +#ifdef DEBUG if (w == -1) { perror("waitpid"); exit(EXIT_FAILURE); } if (WIFEXITED(status)) { printf("exited, status=%d\n", WEXITSTATUS(status)); @@ -329,7 +334,7 @@ int do_ps_save(FILE * fi, } else if (WIFCONTINUED(status)) { printf("continued\n"); } -*/ +#endif } while (w != -1 && !WIFEXITED(status) && !WIFSIGNALED(status)); diff --git a/src/progressbar.c b/src/progressbar.c index dede73fcd..43f5c1ef5 100644 --- a/src/progressbar.c +++ b/src/progressbar.c @@ -34,6 +34,11 @@ SDL_Surface *img_progress; int progress_bar_disabled, prog_bar_ctr; +/** + * Draw & animate (as function is called repeatedly) the progress bar. + * + * @param screen Screen surface + */ void show_progress_bar_(SDL_Surface * screen, SDL_Texture * texture, SDL_Renderer * renderer) { SDL_Rect dest, src, r; diff --git a/src/rgblinear.c b/src/rgblinear.c index e915e895f..e3b5d18c9 100644 --- a/src/rgblinear.c +++ b/src/rgblinear.c @@ -30,6 +30,13 @@ #include "rgblinear.h" #include "debug.h" +/** + * Return sRGB mapping (0-255 byte) of a linear (0.0 to 1.0) value + * (see rgblinear.h) + * + * @param linear Linear (float) value + * @return sRGB (byte) value + */ unsigned char linear_to_sRGB(float linear) { unsigned slot; diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 67b898e87..082c74c48 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -3,8 +3,8 @@ Tux Paint - A simple drawing program for children. - Copyright (c) 2002-2017 by Bill Kendrick and others; see AUTHORS.txt - bill@newbreedsoftware.com + Copyright (c) 2002-2018 + by various contributors; see AUTHORS.txt http://www.tuxpaint.org/ This program is free software; you can redistribute it and/or modify @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - June 14, 2002 - October 15, 2017 + June 14, 2002 - August 28, 2018 */ @@ -332,6 +332,9 @@ typedef struct safer_dirent #define mkdir(path,access) _mkdir(path) +/** + * FIXME + */ static void mtw(wchar_t * wtok, char *tok) { /* workaround using iconv to get a functionallity somewhat approximate as mbstowcs() */ @@ -574,6 +577,15 @@ int TP_EventFilter(void *data, const SDL_Event * event); FILE *my_fmemopen(unsigned char *data, size_t size, const char *mode); +/** + * Open memory as a stream. Some platforms do not support + * fmemopen(), so this simply dumps data to a temp file, + * then opens it back up and returns the FILE pointer. + * + * @param data Data to perform I/O on. + * @param size Size of the data + * @param mode I/O mode (as in fopen(3)) + */ FILE *my_fmemopen(unsigned char *data, size_t size, const char *mode) { unsigned int i; @@ -652,6 +664,11 @@ static char **color_names; /* Show debugging stuff: */ +/** + * Echos debug info to STDERR, if debugging (DEBUG #define) is set. + * + * @param str text to echo + */ static void debug(const char *const str) { #ifndef DEBUG @@ -731,6 +748,11 @@ static void magic_putpixel(SDL_Surface * surface, int x, int y, Uint32 pixel); static Uint32 magic_getpixel(SDL_Surface * surface, int x, int y); +/** + * Sets a variety of screen layout globals, based on the + * size of the window/screen Tux Paint is being displayed on + * (WINDOW_WIDTH & WINDOW_HEIGHT). + */ static void setup_normal_screen_layout(void) { int buttons_tall; @@ -810,26 +832,45 @@ static void setup_normal_screen_layout(void) r_toolopt.y = r_ttoolopt.h + r_ttoolopt.y; /* TODO: dialog boxes */ - } #ifdef DEBUG +/** + * Debug output that shows a layout rectangle's position & dimensions + * (Used as a #define macro, by print_layout(), below) + * + * @param r The rectange + * @param name The name of the rect object + */ static void debug_rect(SDL_Rect * r, char *name) { + /* FIXME: Send to stderr, not stdout? */ printf("%-12s %dx%d @ %d,%d\n", name, r->w, r->h, r->x, r->y); } #define DR(x) debug_rect(&x, #x) +/** + * Debug output that shows a layout grid's dimensions + * (Used as a #define macro, by print_layout(), below) + * + * @param g The grid + * @param name The name of the grid object + */ static void debug_dims(grid_dims * g, char *name) { + /* FIXME: Send to stderr, not stdout? */ printf("%-12s %dx%d\n", name, g->cols, g->rows); } #define DD(x) debug_dims(&x, #x) +/** + * Debug output that shows Tux Paint's layout + */ static void print_layout(void) { + /* FIXME: Send to stderr, not stdout? */ printf("\n--- layout ---\n"); DR(r_canvas); DR(r_tools); @@ -842,6 +883,7 @@ static void print_layout(void) DD(gd_tools); DD(gd_toolopt); DD(gd_colors); + /* FIXME: Send to stderr, not stdout? */ printf("buttons are %dx%d\n", button_w, button_h); printf("color buttons are %dx%d\n", color_button_w, color_button_h); } @@ -850,6 +892,10 @@ static void print_layout(void) #undef DR #endif +/** + * Set up (and display, if debugging is enabled), the + * position, size, and layout of Tux Paint's UI + */ static void setup_screen_layout(void) { /* can do right-to-left, colors at the top, extra tool option columns, etc. */ @@ -930,7 +976,17 @@ static void show_progress_bar(SDL_Surface * screen) } -/* Update a rect. based on two x/y coords (not necessarly in order): */ + +/** + * Update a rect. based on two x/y coords (not necessarly in order) + * (calls SDL_UpdateRect()) + * + * @param x1 X of first coordinate + * @param y1 Y of first coordinate + * @param x2 X of second coordinate + * @param y2 Y of second coordinate + */ + static void update_screen(int x1, int y1, int x2, int y2) { int tmp; @@ -977,11 +1033,26 @@ static void update_screen(int x1, int y1, int x2, int y2) } +/** + * Update a rect. area of the screen + * (calls SDL_UpdateRect()) + * + * @param r The rect + */ static void update_screen_rect(SDL_Rect * r) { SDL_UpdateRect(screen, r->x, r->y, r->w, r->h); } + +/** + * Test whether an x/y coordinate is within a given rect. + * + * @param r The rect + * @param x X coordinate + * @param y Y coordinate + * @return true if a hit, else false + */ static int hit_test(const SDL_Rect * const r, unsigned x, unsigned y) { /* note the use of unsigned math: no need to check for negative */ @@ -991,30 +1062,15 @@ static int hit_test(const SDL_Rect * const r, unsigned x, unsigned y) #define HIT(r) hit_test(&(r), event.button.x, event.button.y) -/* "#if"ing out, since unused; bjk 2005.01.09 */ - -#if 0 - -/* x,y are pixel-wise screen-relative (mouse location), not grid-wise - w,h are the size of a grid item - Return the grid box. - NOTE: grid items must fill full SDL_Rect width exactly */ -static int grid_hit_wh(const SDL_Rect * const r, unsigned x, unsigned y, unsigned w, unsigned h) -{ - return (x - r->x) / w + (y - r->y) / h * (r->w / w); -} - -/* test an SDL_Rect r containing an array of WxH items for a grid location */ -#define GRIDHIT_WH(r,W,H) grid_hit_wh(&(r), event.button.x, event.button.y, W,H) - -#endif - -/* test an SDL_Rect r containing an array of SDL_Surface surf for a grid location */ -#define GRIDHIT_SURF(r,surf) grid_hit_wh(&(r), event.button.x, event.button.y, (surf)->w, (surf)->h) - -/* x,y are pixel-wise screen-relative (mouse location), not grid-wise - Return the grid box. - NOTE: returns -1 if hit is below or to the right of the grid */ +/** + * Returns which item in a grid was clicked, if any. + * + * @param r The rectangle containing the grid on the scren + * @param x X coordinate (mouse location) of a click + * @param y Y coordinate (mouse location) of a click + * @param gd The grid of items + * @returns The item clicked, or -1 if click was outside the grid. + */ static int grid_hit_gd(const SDL_Rect * const r, unsigned x, unsigned y, grid_dims * gd) { unsigned item_w = r->w / gd->cols; @@ -1023,6 +1079,7 @@ static int grid_hit_gd(const SDL_Rect * const r, unsigned x, unsigned y, grid_di unsigned row = (y - r->y) / item_h; #ifdef DEBUG + /* FIXME: Send to stderr, not stdout? */ printf("%d,%d resolves to %d,%d in a %dx%d grid, index is %d\n", x, y, col, row, gd->cols, gd->rows, col + row * gd->cols); #endif @@ -1042,7 +1099,19 @@ static int disable_label = 1; static int disable_label; #endif -/* Update the contents of a region */ +/** + * Update the contents of a rectangular region of the drawing canvas. + * If overlaying Starter Image exists, and/or Labels are in + * the image, draw them over the picture. + * + * FIXME: Subtly different from update_canvas_ex(), below. + * + * @param x1 Left side of area to update + * @param y1 Top side of area to update + * @param x2 Right side of area to update + * @param y2 Bottom side of area to update + * @param screen_too If true, show updated canvas on the screen + */ static void update_canvas_ex_r(int x1, int y1, int x2, int y2, int screen_too) { SDL_Rect src, dest; @@ -1078,6 +1147,19 @@ static void update_canvas_ex_r(int x1, int y1, int x2, int y2, int screen_too) update_screen(x1 + 96, y1, x2 + 96, y2); } +/** + * Update the contents of a rectangular region of the drawing canvas. + * If overlaying Starter Image exists, and/or Labels are in + * the image, draw them over the picture. + * + * FIXME: Subtly different from update_canvas_ex_r(), above. + * + * @param x1 Left side of area to update + * @param y1 Top side of area to update + * @param x2 Right side of area to update + * @param y2 Bottom side of area to update + * @param screen_too If true, show updated canvas on the screen + */ static void update_canvas_ex(int x1, int y1, int x2, int y2, int screen_too) { SDL_Rect src, dest; @@ -1111,7 +1193,15 @@ static void update_canvas_ex(int x1, int y1, int x2, int y2, int screen_too) update_screen(x1 + 96, y1, x2 + 96, y2); } -/* Update the screen with the new canvas: */ +/** + * Update the screen with the new canvas. + * (Wrapper for update_canvas_ex(), above, with `screen_too` = true) + * + * @param x1 Left side of area to update + * @param y1 Top side of area to update + * @param x2 Right side of area to update + * @param y2 Bottom side of area to update + */ static void update_canvas(int x1, int y1, int x2, int y2) { update_canvas_ex(x1, y1, x2, y2, 1); @@ -1440,7 +1530,14 @@ static SDL_Surface *zoom(SDL_Surface * src, int new_x, int new_y); #endif - +/** + * Render some text (char's) as a bitmap + * + * @param font The font to use + * @param str The string of text to render + * @param color The color to draw it in + * @return A new surface, containing the rendered text + */ static SDL_Surface *render_text(TuxPaint_Font * restrict font, const char *restrict str, SDL_Color color) { SDL_Surface *ret = NULL; @@ -1502,10 +1599,17 @@ static SDL_Surface *render_text(TuxPaint_Font * restrict font, const char *restr } -/* This conversion is required on platforms where Uint16 doesn't match wchar_t. - On Windows, wchar_t is 16-bit, elsewhere it is 32-bit. - Mismatch caused by the use of Uint16 for unicode characters by SDL, SDL_ttf. - I guess wchar_t is really only suitable for internal use ... */ +/** + * Convert a wide-character string to string of Uint16's. + * + * This conversion is required on platforms where Uint16 doesn't match wchar_t. + * On Windows, wchar_t is 16-bit, elsewhere it is 32-bit. + * Mismatch caused by the use of Uint16 for unicode characters by SDL, SDL_ttf. + * I guess wchar_t is really only suitable for internal use ... + * + * @param str The wide-character string + * @return The string, as Uint16 characters. + */ static Uint16 *wcstou16(const wchar_t * str) { unsigned int i, len = wcslen(str); @@ -1525,6 +1629,14 @@ static Uint16 *wcstou16(const wchar_t * str) } +/** + * Render some text (wide-characters) as a bitmap + * + * @param font The font to use + * @param str The string of text to render + * @param color The color to draw it in + * @return A new surface, containing the rendered text + */ static SDL_Surface *render_text_w(TuxPaint_Font * restrict font, const wchar_t * restrict str, SDL_Color color) { SDL_Surface *ret = NULL; @@ -1687,20 +1799,30 @@ static stamp_type **stamp_data[MAX_STAMP_GROUPS]; static SDL_Surface *active_stamp; -/* Returns whether a particular stamp can be colored: */ + +/** + * Returns whether a particular stamp can be colored. + * + * @param stamp Which stamp? + * @return True/false + */ static int stamp_colorable(int stamp) { return stamp_data[stamp_group][stamp]->colorable; } -/* Returns whether a particular stamp can be tinted: */ +/** + * Returns whether a particular stamp can be tinted. + * + * @param stamp Which stamp? + * @return True/false + */ static int stamp_tintable(int stamp) { return stamp_data[stamp_group][stamp]->tintable; } - #define SHAPE_BRUSH_NAME "aa_round_03.png" static int num_brushes, num_brushes_max, shape_brush = 0; static SDL_Surface **img_brushes; @@ -1750,7 +1872,6 @@ static int brush_counter, brush_frame; #define ERASER_MAX 128 - static unsigned cur_color; static int cur_tool, cur_brush, old_tool; static int cur_stamp[MAX_STAMP_GROUPS]; @@ -2014,8 +2135,11 @@ int file_exists(char *path); static int bypass_splash_wait; -/* Wait for a keypress or mouse click. - counter is in 1/10 second units */ +/** + * Wait for a keypress or mouse click. + * + * @param counter How long to wait (in 1/10th of seconds) + */ static void do_wait(int counter) { SDL_Event event; @@ -2057,57 +2181,6 @@ static void do_wait(int counter) } -/* This lets us exit quickly; perhaps the system is swapping to death - or the user started Tux Paint by accident. It also lets the user - more easily bypass the splash screen wait. */ - -/* Was used in progressbar.c, but is currently commented out! - -bjk 2006.06.02 */ - -#if 0 -static void eat_sdl_events(void) -{ - SDL_Event event; - - while (SDL_PollEvent(&event)) - { - if (event.type == SDL_QUIT) - { - SDL_Quit(); - exit(0); /* can't safely use do_quit during start-up */ - } - else if (event.type == SDL_WINDOWEVENT) - handle_active(&event); - else if (event.type == SDL_KEYDOWN) - { - SDLKey key = event.key.keysym.sym; - SDLMod ctrl = event.key.keysym.mod & KMOD_CTRL; - SDLMod alt = event.key.keysym.mod & KMOD_ALT; - - if ((key == SDLK_c && ctrl) || (key == SDLK_F4 && alt)) - { - SDL_Quit(); - exit(0); - } - else if (key == SDLK_ESCAPE && waiting_for_fonts) - { - /* abort font loading! */ - - printf("Aborting font load!\n"); - - font_thread_aborted = 1; - /* waiting_for_fonts = 0; */ - } - else - bypass_splash_wait = 1; - } - else if (event.type == SDL_MOUSEBUTTONDOWN) - bypass_splash_wait = 1; - } -} -#endif - - /* Prompt to confirm user wishes to quit */ #define PROMPT_QUIT_TXT gettext_noop("Do you really want to quit?") @@ -2177,8 +2250,9 @@ int brushflag, xnew, ynew, eraflag, lineflag, magicflag, keybd_flag, keybd_posit ide, activeflag, old_x, old_y; int cur_thing; -/* --- MAIN LOOP! --- */ - +/** + * --- MAIN LOOP! --- + */ static void mainloop(void) { int done, val_x, val_y, valhat_x, valhat_y, new_x, new_y, @@ -5627,7 +5701,10 @@ static void mainloop(void) while (!done); } -/* Draw using the text entry cursor/caret: */ +/** + * Hide the blinking text entry cursor (caret), + * if it was visible. + */ static void hide_blinking_cursor(void) { if (cur_toggle_count & 1) @@ -5636,6 +5713,11 @@ static void hide_blinking_cursor(void) } } +/** + * Draw & hide the blinking text entry cursor (caret), + * via XOR. (Also keeps track of whether the cursor + * is currently visible; used by hide_blinking_cursor(), above.) + */ static void draw_blinking_cursor(void) { cur_toggle_count++; @@ -5649,8 +5731,15 @@ static void draw_blinking_cursor(void) cursor_y + r_canvas.y + TuxPaint_Font_FontHeight(getfonthandle(cur_font))); } -/* Draw using the current brush: */ - +/** + * Draw a line on the canvas using the current paint brush. + * + * @param x1 Starting X coordinate + * @param y1 Starting Y coordinate + * @param x2 Ending X coordinate + * @param y2 Ending Y coordinate + * @param update Update the screen afterwards? + */ static void brush_draw(int x1, int y1, int x2, int y2, int update) { int dx, dy, y, frame_w, w, h; @@ -5755,14 +5844,29 @@ static void brush_draw(int x1, int y1, int x2, int y2, int update) } } + +/** + * Reset the brush counter, such that the next + * attempt to draw something is guaranteed to + * do so, regardless of the brushe's spacing. + */ void reset_brush_counter(void) { brush_counter = 999; } -/* Draw the current brush in the current color: */ - +/** + * Draw into the canvas using the current paint brush. + * Adheres to: + * - brush spacing (used by some brushes to avoid smearing) + * - brush animation + * - drawing direction + * + * @param x X coordinate + * @param y Y coordinate + * @param direction BRUSH_DIRECTION_... being drawn + */ static void blit_brush(int x, int y, int direction) { SDL_Rect src, dest; @@ -5862,6 +5966,9 @@ typedef struct multichan #define v0_prime ( (9.0 * Y0) / (X0 + 15.0*Y0 + 3.0*Z0) ) +/** + * FIXME + */ static void fill_multichan(multichan * mc, double *up, double *vp) { double X, Y, Z, u, v; @@ -5895,6 +6002,9 @@ static void fill_multichan(multichan * mc, double *up, double *vp) } +/** + * FIXME + */ static double tint_part_1(multichan * work, SDL_Surface * in) { int xx, yy; @@ -5936,6 +6046,9 @@ static double tint_part_1(multichan * work, SDL_Surface * in) } +/** + * FIXME + */ static void change_colors(SDL_Surface * out, multichan * work, double hue_range, multichan * key_color_ptr) { double lower_hue_1, upper_hue_1, lower_hue_2, upper_hue_2; @@ -6041,6 +6154,9 @@ static void change_colors(SDL_Surface * out, multichan * work, double hue_range, } +/** + * FIXME + */ static multichan *find_most_saturated(double initial_hue, multichan * work, unsigned num, double *hue_range_ptr) { /* find the most saturated pixel near the initial hue guess */ @@ -6115,6 +6231,9 @@ hue_range_retry:; } +/** + * FIXME + */ static void vector_tint_surface(SDL_Surface * out, SDL_Surface * in) { int xx, yy; @@ -6148,6 +6267,12 @@ static void vector_tint_surface(SDL_Surface * out, SDL_Surface * in) } +/** + * Tint a surface (e.g., a stamp) using the currently-selected color. + * + * @param tmp_surf Destination surface + * @param surf_ptr Source surface + */ static void tint_surface(SDL_Surface * tmp_surf, SDL_Surface * surf_ptr) { unsigned width = surf_ptr->w; @@ -6165,12 +6290,14 @@ static void tint_surface(SDL_Surface * tmp_surf, SDL_Surface * surf_ptr) initial_hue = tint_part_1(work, surf_ptr); #ifdef DEBUG + /* FIXME: To stderr, not stdout? */ printf("initial_hue = %f\n", initial_hue); #endif key_color_ptr = find_most_saturated(initial_hue, work, width * height, &hue_range); #ifdef DEBUG + /* FIXME: To stderr, not stdout? */ printf("key_color_ptr = %d\n", (int)(intptr_t) key_color_ptr); //EP added (intptr_t) to avoid warning on x64 #endif @@ -6194,15 +6321,19 @@ static void tint_surface(SDL_Surface * tmp_surf, SDL_Surface * surf_ptr) /* Failed! Fall back: */ - fprintf(stderr, "Falling back to tinter=vector, " "this should be in the *.dat file\n"); + fprintf(stderr, "Falling back to tinter=vector, this should be in the *.dat file\n"); vector_tint_surface(tmp_surf, surf_ptr); } -/* Draw using the current stamp: */ - +/** + * Draw the current stamp onto the canvas. + * + * @param x X coordinate + * @param y Y coordinate + */ static void stamp_draw(int x, int y) { SDL_Rect dest; @@ -6323,8 +6454,9 @@ static void stamp_draw(int x, int y) } -/* Store canvas or label into undo buffer: */ - +/** + * Store canvas or label into undo buffer + */ static void rec_undo_buffer(void) { int wanna_update_toolbar; @@ -6344,6 +6476,7 @@ static void rec_undo_buffer(void) newest_undo = cur_undo; #ifdef DEBUG + /* FIXME: Stderr instead of stdout? */ printf("DRAW: Current=%d Oldest=%d Newest=%d\n", cur_undo, oldest_undo, newest_undo); #endif @@ -6370,7 +6503,12 @@ static void rec_undo_buffer(void) } -/* Show program version: */ +/** + * Show program version, build date, and (optionally) details, + * to stdout + * + * @param details Show details? + */ void show_version(int details) { printf("\nTux Paint\n"); @@ -6501,8 +6639,12 @@ void show_version(int details) } -/* Show usage display: */ - +/** + * Show usage display and exit. + * + * @param exitcode What exit() code to give; + * also determines stdout (0) vs stderr (non-zero) for output + */ void show_usage(int exitcode) { FILE *f = exitcode ? stderr : stdout; @@ -6583,12 +6725,19 @@ void show_usage(int exitcode) } -/* The original Tux Paint canvas was 448x376. The canvas can be - other sizes now, but many old stamps are sized for the small - canvas. So, with larger canvases, we must choose a good scale - factor to compensate. As the canvas size grows, the user will - want a balance of "more stamps on the screen" and "stamps not - getting tiny". This will calculate the needed scale factor. */ +/** + * Compute default scale factor for stamps. + * + * The original Tux Paint canvas was 448x376. The canvas can be + * other sizes now, but many old stamps are sized for the small + * canvas. So, with larger canvases, we must choose a good scale + * factor to compensate. As the canvas size grows, the user will + * want a balance of "more stamps on the screen" and "stamps not + * getting tiny". This will calculate the needed scale factor. + * + * @param ratio FIXME + * @return FIXME + */ static unsigned compute_default_scale_factor(double ratio) { double old_diag = sqrt(448 * 448 + 376 * 376); @@ -6610,8 +6759,16 @@ static unsigned compute_default_scale_factor(double ratio) } -/* directory walking... */ - +/** + * Callback for directory walking while loading brushes + * + * @param screen Screen/window surface, for drawing progress bar animation + * @param dir Directory path + * @param dirlen Length of directory path string (ignored) + * @param files List of files (being collected) + * @param i Counter + * @param locale UI's locale, for loading localized text (ignored) + */ static void loadbrush_callback(SDL_Surface * screen, SDL_Texture * texture, SDL_Renderer * renderer, @@ -6699,7 +6856,9 @@ static void loadbrush_callback(SDL_Surface * screen, } - +/** + * FIXME + */ static void load_brush_dir(SDL_Surface * screen, const char *restrict const dir) { char buf[TP_FTW_PATHSIZE]; @@ -6709,6 +6868,9 @@ static void load_brush_dir(SDL_Surface * screen, const char *restrict const dir) tp_ftw(screen, texture, renderer, buf, dirlen, 0, loadbrush_callback, NULL); } +/** + * FIXME + */ SDL_Surface *mirror_surface(SDL_Surface * s) { SDL_Surface *new_surf; @@ -6746,6 +6908,9 @@ SDL_Surface *mirror_surface(SDL_Surface * s) } } +/** + * FIXME + */ SDL_Surface *flip_surface(SDL_Surface * s) { SDL_Surface *new_surf; @@ -6785,6 +6950,9 @@ SDL_Surface *flip_surface(SDL_Surface * s) static unsigned default_stamp_size; +/** + * FIXME + */ static void loadstamp_finisher(stamp_type * sd, unsigned w, unsigned h, double ratio) { unsigned int upper = HARD_MAX_STAMP_SIZE; @@ -6921,6 +7089,9 @@ static void loadstamp_finisher(stamp_type * sd, unsigned w, unsigned h, double r } +/** + * FIXME + */ /* Note: must have read the *.dat file before calling this */ static void set_active_stamp(void) { @@ -7165,6 +7336,9 @@ static void set_active_stamp(void) #endif } +/** + * FIXME + */ static void get_stamp_thumb(stamp_type * sd) { SDL_Surface *bigimg = NULL; @@ -7505,6 +7679,16 @@ static void get_stamp_thumb(stamp_type * sd) } +/** + * Callback for directory walking while loading stamps + * + * @param screen Screen/window surface, for drawing progress bar animation + * @param dir Directory path + * @param dirlen Length of directory path string + * @param files List of files (being collected) + * @param i Counter + * @param locale UI's locale, for loading localized text (ignored) + */ static void loadstamp_callback(SDL_Surface * screen, SDL_Texture * texture, SDL_Renderer * renderer, @@ -7513,6 +7697,7 @@ static void loadstamp_callback(SDL_Surface * screen, { (void)locale; #ifdef DEBUG + /* FIXME: Stderr instead of stdout? */ printf("loadstamp_callback: %s\n", dir); #endif @@ -7538,12 +7723,14 @@ static void loadstamp_callback(SDL_Surface * screen, { stamp_group++; #ifdef DEBUG + /* FIXME: Stderr instead of stdout? */ printf("\n...counts as a new group! now: %d\n", stamp_group); #endif } else { #ifdef DEBUG + /* FIXME: Stderr instead of stdout? */ printf("...is still part of group %d\n", stamp_group); #endif } @@ -7634,8 +7821,9 @@ static void loadstamp_callback(SDL_Surface * screen, free(files); } - - +/** + * FIXME + */ static void load_stamp_dir(SDL_Surface * screen, const char *const dir) { char buf[TP_FTW_PATHSIZE]; @@ -7646,7 +7834,9 @@ static void load_stamp_dir(SDL_Surface * screen, const char *const dir) tp_ftw(screen, texture, renderer, buf, dirlen, 0, loadstamp_callback, NULL); } - +/** + * FIXME + */ static void load_stamps(SDL_Surface * screen) { char *homedirdir = get_fname("stamps", DIR_DATA); @@ -7680,6 +7870,9 @@ static void load_stamps(SDL_Surface * screen) } #ifndef FORKED_FONTS +/** + * FIXME + */ static int load_user_fonts_stub(void *vp) { return load_user_fonts(screen, texture, renderer, vp, NULL); @@ -7689,6 +7882,9 @@ static int load_user_fonts_stub(void *vp) #ifndef NO_SDLPANGO volatile long fontconfig_thread_done = 0; +/** + * FIXME + */ int generate_fontconfig_cache_spinner(SDL_Surface * screen) { SDL_Event event; @@ -7714,6 +7910,9 @@ int generate_fontconfig_cache_spinner(SDL_Surface * screen) return (0); } +/** + * FIXME + */ static int generate_fontconfig_cache_real(void) { TuxPaint_Font *tmp_font; @@ -7768,6 +7967,9 @@ static int generate_fontconfig_cache_real(void) return (0); } +/** + * FIXME + */ static int generate_fontconfig_cache(void *vp) { return generate_fontconfig_cache_real(); @@ -7779,6 +7981,9 @@ static int generate_fontconfig_cache(void *vp) ((c) >= 'a' && (c) <= 'f') ? ((c) - 'a' + 10) : 0) #ifndef WIN32 +/** + * FIXME + */ static void signal_handler(int sig) { (void)sig; @@ -7786,6 +7991,9 @@ static void signal_handler(int sig) } #endif +/** + * FIXME + */ /* Render a button label using the appropriate string/font: */ static SDL_Surface *do_render_button_label(const char *const label) { @@ -7807,6 +8015,9 @@ static SDL_Surface *do_render_button_label(const char *const label) return surf; } +/** + * FIXME + */ static void create_button_labels(void) { int i; @@ -7842,6 +8053,9 @@ static void create_button_labels(void) } +/** + * FIXME + */ static void seticon(void) { #ifndef WIN32 @@ -7896,8 +8110,10 @@ static void seticon(void) } +/** + * FIXME + */ /* Load a mouse pointer (cursor) shape: */ - static SDL_Cursor *get_cursor(unsigned char *bits, unsigned char *mask_bits, unsigned int width, unsigned int height, unsigned int x, unsigned int y) { @@ -7936,16 +8152,20 @@ static SDL_Cursor *get_cursor(unsigned char *bits, unsigned char *mask_bits, } +/** + * FIXME + */ /* Load an image (with errors): */ - static SDL_Surface *loadimage(const char *const fname) { return (do_loadimage(fname, 1)); } +/** + * FIXME + */ /* Load an image: */ - static SDL_Surface *do_loadimage(const char *const fname, int abort_on_error) { SDL_Surface *s, *disp_fmt_s; @@ -8003,8 +8223,10 @@ static SDL_Surface *do_loadimage(const char *const fname, int abort_on_error) } +/** + * FIXME + */ /* Draw the toolbar: */ - static void draw_toolbar(void) { int i, off_y, max, most, tool; @@ -8111,8 +8333,10 @@ static void draw_toolbar(void) } +/** + * FIXME + */ /* Draw magic controls: */ - static void draw_magic(void) { int magic, i, max, off_y; @@ -8250,10 +8474,12 @@ static void draw_magic(void) } -/* Draw color selector: */ - static unsigned colors_state = COLORSEL_ENABLE | COLORSEL_CLOBBER; +/** + * FIXME + */ +/* Draw color selector: */ static unsigned draw_colors(unsigned action) { unsigned i; @@ -8332,8 +8558,10 @@ static unsigned draw_colors(unsigned action) } +/** + * FIXME + */ /* Draw brushes: */ - static void draw_brushes(void) { int i, off_y, max, brush; @@ -8426,6 +8654,9 @@ static void draw_brushes(void) } +/** + * FIXME + */ /* Draw fonts: */ static void draw_fonts(void) { @@ -8733,8 +8964,10 @@ static void draw_fonts(void) } +/** + * FIXME + */ /* Draw stamps: */ - static void draw_stamps(void) { int i, off_y, max, stamp, most; @@ -9029,8 +9262,10 @@ static void draw_stamps(void) } +/** + * FIXME + */ /* Draw the shape selector: */ - static void draw_shapes(void) { int i, shape, max, off_y; @@ -9112,8 +9347,10 @@ static void draw_shapes(void) } +/** + * FIXME + */ /* Draw the eraser selector: */ - static void draw_erasers(void) { int i, x, y, sz; @@ -9218,8 +9455,10 @@ static void draw_erasers(void) } +/** + * FIXME + */ /* Draw no selectables: */ - static void draw_none(void) { int i; @@ -9238,15 +9477,18 @@ static void draw_none(void) } } - - +/** + * FIXME + */ /* Create a thumbnail: */ - static SDL_Surface *thumbnail(SDL_Surface * src, int max_x, int max_y, int keep_aspect) { return (thumbnail2(src, max_x, max_y, keep_aspect, 1)); } +/** + * FIXME + */ static SDL_Surface *thumbnail2(SDL_Surface * src, int max_x, int max_y, int keep_aspect, int keep_alpha) { int x, y; @@ -9415,9 +9657,11 @@ static SDL_Surface *thumbnail2(SDL_Surface * src, int max_x, int max_y, int keep #ifndef NO_BILINEAR +/** + * FIXME + */ /* Based on code from: http://www.codeproject.com/cs/media/imageprocessing4.asp copyright 2002 Christian Graus */ - static SDL_Surface *zoom(SDL_Surface * src, int new_w, int new_h) { SDL_Surface *s; @@ -9576,6 +9820,9 @@ static SDL_Surface *zoom(SDL_Surface * src, int new_w, int new_h) #endif +/** + * FIXME + */ /* XOR must show up on black, white, 0x7f grey, and 0x80 grey. XOR must be exactly 100% perfectly reversable. */ static void xorpixel(int x, int y) @@ -9614,8 +9861,10 @@ static void xorpixel(int x, int y) } +/** + * FIXME + */ /* Undo! */ - static void do_undo(void) { int wanna_update_toolbar; @@ -9681,8 +9930,10 @@ static void do_undo(void) } +/** + * FIXME + */ /* Redo! */ - static void do_redo(void) { if (cur_undo != newest_undo) @@ -9731,8 +9982,10 @@ static void do_redo(void) } +/** + * FIXME + */ /* Create the current brush in the current color: */ - static void render_brush(void) { Uint32 amask; @@ -9823,8 +10076,10 @@ static void render_brush(void) } +/** + * FIXME + */ /* Draw a XOR line: */ - static void line_xor(int x1, int y1, int x2, int y2) { int dx, dy, y, num_drawn; @@ -9901,8 +10156,10 @@ static void line_xor(int x1, int y1, int x2, int y2) } +/** + * FIXME + */ /* Draw a XOR rectangle: */ - static void rect_xor(int x1, int y1, int x2, int y2) { if (x1 < 0) @@ -9936,8 +10193,10 @@ static void rect_xor(int x1, int y1, int x2, int y2) } +/** + * FIXME + */ /* Erase at the cursor! */ - static void do_eraser(int x, int y) { SDL_Rect dest; @@ -10044,8 +10303,10 @@ static void do_eraser(int x, int y) } +/** + * FIXME + */ /* Reset available tools (for new image / starting out): */ - static void reset_avail_tools(void) { int i; @@ -10127,8 +10388,10 @@ static void reset_avail_tools(void) } +/** + * FIXME + */ /* Save and disable available tools (for Open-Dialog) */ - static void disable_avail_tools(void) { int i; @@ -10141,8 +10404,10 @@ static void disable_avail_tools(void) } } +/** + * FIXME + */ /* Restore and enable available tools (for End-Of-Open-Dialog) */ - static void enable_avail_tools(void) { int i; @@ -10154,8 +10419,10 @@ static void enable_avail_tools(void) } +/** + * FIXME + */ /* For qsort() call in do_open()... */ - static int compare_dirent2s(struct dirent2 *f1, struct dirent2 *f2) { #ifdef DEBUG @@ -10169,8 +10436,10 @@ static int compare_dirent2s(struct dirent2 *f1, struct dirent2 *f2) } +/** + * FIXME + */ /* Draw tux's text on the screen: */ - static void draw_tux_text(int which_tux, const char *const str, int want_right_to_left) { draw_tux_text_ex(which_tux, str, want_right_to_left, 0); @@ -10181,11 +10450,17 @@ static const char *latest_tux_text; static int latest_r2l; static Uint8 latest_locale_text; +/** + * FIXME + */ static void redraw_tux_text(void) { draw_tux_text_ex(latest_tux, latest_tux_text, latest_r2l, latest_locale_text); } +/** + * FIXME + */ static void draw_tux_text_ex(int which_tux, const char *const str, int want_right_to_left, Uint8 locale_text) { SDL_Rect dest; @@ -10272,11 +10547,17 @@ static void draw_tux_text_ex(int which_tux, const char *const str, int want_righ } +/** + * FIXME + */ static void wordwrap_text(const char *const str, SDL_Color color, int left, int top, int right, int want_right_to_left) { wordwrap_text_ex(str, color, left, top, right, want_right_to_left, 0); } +/** + * FIXME + */ static void wordwrap_text_ex(const char *const str, SDL_Color color, int left, int top, int right, int want_right_to_left, Uint8 locale_text) { @@ -10684,6 +10965,9 @@ static void wordwrap_text_ex(const char *const str, SDL_Color color, #ifndef NOSOUND +/** + * FIXME + */ static void playstampdesc(int chan) { static SDL_Event playsound_event; @@ -10707,6 +10991,9 @@ static void playstampdesc(int chan) #ifndef NOSOUND +/** + * FIXME + */ static Mix_Chunk *loadsound_extra(const char *const fname, const char *extra) { char *snd_fname; @@ -10802,11 +11089,17 @@ static Mix_Chunk *loadsound_extra(const char *const fname, const char *extra) } +/** + * FIXME + */ static Mix_Chunk *loadsound(const char *const fname) { return (loadsound_extra(fname, "")); } +/** + * FIXME + */ static Mix_Chunk *loaddescsound(const char *const fname) { return (loadsound_extra(fname, "_desc")); @@ -10817,6 +11110,9 @@ static Mix_Chunk *loaddescsound(const char *const fname) /* Strip any trailing spaces: */ +/** + * FIXME + */ static void strip_trailing_whitespace(char *buf) { unsigned i = strlen(buf); @@ -10832,6 +11128,9 @@ static void strip_trailing_whitespace(char *buf) /* Load a file's description: */ +/** + * FIXME + */ static char *loaddesc(const char *const fname, Uint8 * locale_text) { char *txt_fname, *extptr; @@ -10947,6 +11246,9 @@ static char *loaddesc(const char *const fname, Uint8 * locale_text) } +/** + * FIXME + */ /* Load a *.dat file */ static double loadinfo(const char *const fname, stamp_type * inf) { @@ -11059,6 +11361,9 @@ static double loadinfo(const char *const fname, stamp_type * inf) } +/** + * FIXME + */ static int SDLCALL NondefectiveBlit(SDL_Surface * src, SDL_Rect * srcrect, SDL_Surface * dst, SDL_Rect * dstrect) { int dstx = 0; @@ -11121,6 +11426,9 @@ static int SDLCALL NondefectiveBlit(SDL_Surface * src, SDL_Rect * srcrect, SDL_S } +/** + * FIXME + */ /* For the 3rd arg, pass either NondefectiveBlit or SDL_BlitSurface. */ static void autoscale_copy_smear_free(SDL_Surface * src, SDL_Surface * dst, int SDLCALL(*blit) (SDL_Surface * src, @@ -11199,6 +11507,9 @@ static void autoscale_copy_smear_free(SDL_Surface * src, SDL_Surface * dst, } +/** + * FIXME + */ static void load_starter_id(char *saved_id, FILE * fil) { char *rname; @@ -11288,6 +11599,9 @@ static void load_starter_id(char *saved_id, FILE * fil) } +/** + * FIXME + */ static SDL_Surface *load_starter_helper(char *path_and_basename, char *extension, SDL_Surface * (*load_func) (char *)) { char *ext; @@ -11315,6 +11629,9 @@ static SDL_Surface *load_starter_helper(char *path_and_basename, char *extension } +/** + * FIXME + */ static void load_starter(char *img_id) { char *dirname; @@ -11501,6 +11818,9 @@ static void load_starter(char *img_id) } +/** + * FIXME + */ static void load_template(char *img_id) { char *dirname; @@ -11575,9 +11895,6 @@ static void load_template(char *img_id) free(dirname); } - - - /* Determine the current picture's ID: */ static void determine_id(void) { char *fname; @@ -11610,7 +11927,9 @@ static void determine_id(void) free(fname); } - +/** + * FIXME + */ /* Load current (if any) image: */ static void load_current(void) @@ -11719,8 +12038,10 @@ static void load_current(void) } +/** + * FIXME + */ /* Make sure we have a 'path' directory */ - static int make_directory(const char *path, const char *errmsg) { char *fname; @@ -11739,8 +12060,10 @@ static int make_directory(const char *path, const char *errmsg) return 1; } +/** + * FIXME + */ /* Save the current image to disk: */ - static void save_current(void) { char *fname; @@ -11773,20 +12096,27 @@ static void save_current(void) } +/** + * FIXME + */ /* Prompt the user with a yes/no question: */ - static int do_prompt(const char *const text, const char *const btn_yes, const char *const btn_no, int ox, int oy) { return (do_prompt_image(text, btn_yes, btn_no, NULL, NULL, NULL, ox, oy)); } - +/** + * FIXME + */ static int do_prompt_snd(const char *const text, const char *const btn_yes, const char *const btn_no, int snd, int ox, int oy) { return (do_prompt_image_flash_snd(text, btn_yes, btn_no, NULL, NULL, NULL, 0, snd, ox, oy)); } +/** + * FIXME + */ static int do_prompt_image(const char *const text, const char *const btn_yes, const char *const btn_no, SDL_Surface * img1, SDL_Surface * img2, SDL_Surface * img3, int ox, int oy) @@ -11794,6 +12124,9 @@ static int do_prompt_image(const char *const text, const char *const btn_yes, return (do_prompt_image_snd(text, btn_yes, btn_no, img1, img2, img3, SND_NONE, ox, oy)); } +/** + * FIXME + */ static int do_prompt_image_snd(const char *const text, const char *const btn_yes, const char *const btn_no, SDL_Surface * img1, @@ -11802,6 +12135,9 @@ static int do_prompt_image_snd(const char *const text, return (do_prompt_image_flash_snd(text, btn_yes, btn_no, img1, img2, img3, 0, snd, ox, oy)); } +/** + * FIXME + */ static int do_prompt_image_flash(const char *const text, const char *const btn_yes, const char *const btn_no, SDL_Surface * img1, @@ -11813,6 +12149,9 @@ static int do_prompt_image_flash(const char *const text, #define PROMPT_LEFT 96 #define PROMPT_W 440 +/** + * FIXME + */ static int do_prompt_image_flash_snd(const char *const text, const char *const btn_yes, const char *const btn_no, @@ -11840,6 +12179,17 @@ static int do_prompt_image_flash_snd(const char *const text, int val_x, val_y, motioner; int valhat_x, valhat_y, hatmotioner; +#ifdef DEBUG + if(snd >= 0) { + printf("Prompt and play sound #%d: %s\n", snd, sound_fnames[snd]); + fflush(stdout); + } + else { + printf("Prompt without sound\n"); + fflush(stdout); + } +#endif + val_x = val_y = motioner = 0; valhat_x = valhat_y = hatmotioner = 0; emulate_button_pressed = 0; @@ -12244,8 +12594,10 @@ static int do_prompt_image_flash_snd(const char *const text, } +/** + * FIXME + */ /* Free memory and prepare to quit: */ - static void cleanup(void) { int i, j; @@ -12571,6 +12923,9 @@ static void cleanup(void) } +/** + * FIXME + */ static void free_surface(SDL_Surface ** surface_array) { if (surface_array) //EP added this line to avoid app crash @@ -12582,6 +12937,9 @@ static void free_surface(SDL_Surface ** surface_array) } +/** + * FIXME + */ static void free_surface_array(SDL_Surface * surface_array[], int count) { int i; @@ -12594,8 +12952,10 @@ static void free_surface_array(SDL_Surface * surface_array[], int count) } +/** + * FIXME + */ /* Draw a shape! */ - static void do_shape(int cx, int cy, int ox, int oy, int rotn, int use_brush) { int side, angle_skip, init_ang, rx, ry, rmax, x1, y1, x2, y2, xp, yp, xv, yv, old_brush, step; @@ -12879,8 +13239,10 @@ static void do_shape(int cx, int cy, int ox, int oy, int rotn, int use_brush) } +/** + * FIXME + */ /* What angle is the mouse away from the center of a shape? */ - static int shape_rotation(int ctr_x, int ctr_y, int ox, int oy) { int deg; @@ -12905,8 +13267,10 @@ static int shape_rotation(int ctr_x, int ctr_y, int ox, int oy) } +/** + * FIXME + */ /* What angle is the mouse away from a brush drag or line draw? */ - static int brush_rotation(int ctr_x, int ctr_y, int ox, int oy) { int deg; @@ -12929,9 +13293,13 @@ static int brush_rotation(int ctr_x, int ctr_y, int ox, int oy) #define PROMPT_SAVE_OVER_NO gettext_noop("No, save a new file!") +/** + * FIXME + */ /* Save the current image: */ static int do_save(int tool, int dont_show_success_results, int autosave) + { char *fname; char tmp[1024]; @@ -13156,6 +13524,9 @@ static int do_save(int tool, int dont_show_success_results, int autosave) return 1; } +/** + * FIXME + */ static void set_chunk_data(unsigned char **chunk_data, size_t * chunk_data_len, size_t uncompressed_size, Bytef * data, size_t dataLen) { @@ -13188,6 +13559,9 @@ static void set_chunk_data(unsigned char **chunk_data, size_t * chunk_data_len, free(headers); } +/** + * FIXME + */ static void do_png_embed_data(png_structp png_ptr) { @@ -13619,6 +13993,9 @@ static void do_png_embed_data(png_structp png_ptr) } } +/** + * FIXME + */ /* Actually save the PNG data to the file stream: */ static int do_png_save(FILE * fi, const char *const fname, SDL_Surface * surf, int embed) { @@ -13738,6 +14115,9 @@ static int do_png_save(FILE * fi, const char *const fname, SDL_Surface * surf, i return 0; } +/** + * FIXME + */ /* Pick a new file ID: */ static void get_new_file_id(void) { @@ -13753,8 +14133,10 @@ static void get_new_file_id(void) } +/** + * FIXME + */ /* Handle quitting (and prompting to save, if necessary!) */ - static int do_quit(int tool) { int done, tmp_tool; @@ -13814,7 +14196,9 @@ static int do_quit(int tool) /* FIXME: This, do_slideshow() and do_new_dialog() should be combined and modularized! */ - +/** + * FIXME + */ static int do_open(void) { SDL_Surface *img, *img1, *img2, *org_surf; @@ -14902,8 +15286,10 @@ static int do_open(void) /* FIXME: This, do_open() and do_new_dialog() should be combined and modularized! */ +/** + * FIXME + */ /* Slide Show Selection Screen: */ - static int do_slideshow(void) { SDL_Surface *img, *img1, *img2; @@ -15676,6 +16062,9 @@ static int do_slideshow(void) } +/** + * FIXME + */ static void play_slideshow(int *selected, int num_selected, char *dirname, char **d_names, char **d_exts, int speed) { int i, which, next, done; @@ -15917,8 +16306,10 @@ static void play_slideshow(int *selected, int num_selected, char *dirname, char +/** + * FIXME + */ /* Draws large, bitmap digits over thumbnails in slideshow selection screen: */ - static void draw_selection_digits(int right, int bottom, int n) { SDL_Rect src, dest; @@ -15967,8 +16358,10 @@ static void draw_selection_digits(int right, int bottom, int n) } +/** + * FIXME + */ /* Let sound effects (e.g., "Save" sfx) play out before quitting... */ - static void wait_for_sfx(void) { #ifndef NOSOUND @@ -16013,6 +16406,9 @@ static char stiple[] = static unsigned char *stamp_outline_data; static int stamp_outline_w, stamp_outline_h; +/** + * FIXME + */ static void update_stamp_xor(void) { int xx, yy, rx, ry; @@ -16103,6 +16499,9 @@ static void update_stamp_xor(void) free(alphabits); } +/** + * FIXME + */ static void stamp_xor(int x, int y) { int xx, yy, sx, sy; @@ -16126,6 +16525,9 @@ static void stamp_xor(int x, int y) #endif +/** + * FIXME + */ static void rgbtohsv(Uint8 r8, Uint8 g8, Uint8 b8, float *h, float *s, float *v) { float rgb_min, rgb_max, delta, r, g, b; @@ -16166,6 +16568,9 @@ static void rgbtohsv(Uint8 r8, Uint8 g8, Uint8 b8, float *h, float *s, float *v) } +/** + * FIXME + */ static void hsvtorgb(float h, float s, float v, Uint8 * r8, Uint8 * g8, Uint8 * b8) { int i; @@ -16232,6 +16637,9 @@ static void hsvtorgb(float h, float s, float v, Uint8 * r8, Uint8 * g8, Uint8 * *b8 = (Uint8) (b * 255); } +/** + * FIXME + */ static void print_image(void) { int cur_time; @@ -16269,6 +16677,9 @@ static void print_image(void) } } +/** + * FIXME + */ void do_print(void) { /* Assemble drawing plus any labels: */ @@ -16366,6 +16777,9 @@ void do_print(void) #endif } +/** + * FIXME + */ static void do_render_cur_text(int do_blit) { int w, h; @@ -16585,8 +16999,10 @@ static void do_render_cur_text(int do_blit) } +/** + * FIXME + */ /* Return string as uppercase if that option is set: */ - static char *uppercase(const char *restrict const str) { unsigned int i, n; @@ -16617,6 +17033,9 @@ static char *uppercase(const char *restrict const str) return ustr; } +/** + * FIXME + */ static wchar_t *uppercase_w(const wchar_t * restrict const str) { unsigned n = wcslen(str) + 1; @@ -16639,8 +17058,10 @@ static wchar_t *uppercase_w(const wchar_t * restrict const str) } +/** + * FIXME + */ /* Return string in right-to-left mode, if necessary: */ - static char *textdir(const char *const str) { unsigned char *dstr; @@ -16706,8 +17127,10 @@ static char *textdir(const char *const str) } +/** + * FIXME + */ /* Scroll Timer */ - static Uint32 scrolltimer_callback(Uint32 interval, void *param) { /* printf("scrolltimer_callback(%d) -- ", interval); */ @@ -16725,8 +17148,10 @@ static Uint32 scrolltimer_callback(Uint32 interval, void *param) } +/** + * FIXME + */ /* Controls the Text-Timer - interval == 0 removes the timer */ - static void control_drawtext_timer(Uint32 interval, const char *const text, Uint8 locale_text) { static int activated = 0; @@ -16759,8 +17184,10 @@ static void control_drawtext_timer(Uint32 interval, const char *const text, Uint } +/** + * FIXME + */ /* Drawtext Timer */ - static Uint32 drawtext_callback(Uint32 interval, void *param) { (void)interval; @@ -16770,9 +17197,10 @@ static Uint32 drawtext_callback(Uint32 interval, void *param) } - - #ifdef DEBUG +/** + * FIXME + */ static char *debug_gettext(const char *str) { if (strcmp(str, dgettext(NULL, str)) == 0) @@ -16787,6 +17215,9 @@ static char *debug_gettext(const char *str) #endif +/** + * FIXME + */ static const char *great_str(void) { return (great_strs[rand() % (sizeof(great_strs) / sizeof(char *))]); @@ -16794,6 +17225,9 @@ static const char *great_str(void) #ifdef DEBUG +/** + * FIXME + */ static int charsize(Uint16 c) { Uint16 str[2]; @@ -16808,6 +17242,9 @@ static int charsize(Uint16 c) } #endif +/** + * FIXME + */ static void draw_image_title(int t, SDL_Rect dest) { SDL_BlitSurface(img_title_on, NULL, screen, &dest); @@ -16818,7 +17255,9 @@ static void draw_image_title(int t, SDL_Rect dest) } - +/** + * FIXME + */ /* Handle keyboard events to control the mouse: */ /* Move as many pixels as bigsteps outside the areas, in the areas and 5 pixels around, move 1 pixel at a time */ @@ -17001,6 +17440,9 @@ static void handle_keymouse(SDLKey key, Uint32 updown, int steps, SDL_Rect * are } } +/** + * FIXME + */ /* A subset of keys that will move one button at a time and jump between r_canvas<->r_tools<->r_colors */ static void handle_keymouse_buttons(SDLKey key, int *whicht, int *whichc, SDL_Rect real_r_tools) { @@ -17109,8 +17551,10 @@ static void handle_keymouse_buttons(SDLKey key, int *whicht, int *whichc, SDL_Re } } +/** + * FIXME + */ /* Unblank screen in fullscreen mode, if needed: */ - static void handle_active(SDL_Event * event) { if (event->window.event == SDL_WINDOWEVENT_EXPOSED || SDL_WINDOWEVENT_RESTORED) @@ -17136,9 +17580,11 @@ static void handle_active(SDL_Event * event) } +/** + * FIXME + */ /* For right-to-left languages, when word-wrapping, we need to make sure the text doesn't end up going from bottom-to-top, too! */ - #ifdef NO_SDLPANGO static void anti_carriage_return(int left, int right, int cur_top, int new_top, int cur_bot, int line_width) { @@ -17170,6 +17616,9 @@ static void anti_carriage_return(int left, int right, int cur_top, int new_top, #endif +/** + * FIXME + */ static SDL_Surface *duplicate_surface(SDL_Surface * orig) { /* @@ -17191,6 +17640,9 @@ static SDL_Surface *duplicate_surface(SDL_Surface * orig) return (SDL_DisplayFormatAlpha(orig)); } +/** + * FIXME + */ static void mirror_starter(void) { SDL_Surface *orig; @@ -17258,6 +17710,9 @@ static void mirror_starter(void) } +/** + * FIXME + */ static void flip_starter(void) { SDL_Surface *orig; @@ -17325,6 +17780,9 @@ static void flip_starter(void) } +/** + * FIXME + */ static int valid_click(Uint8 button) { if (button == 1 || ((button == 2 || button == 3) && no_button_distinction)) @@ -17334,6 +17792,9 @@ static int valid_click(Uint8 button) } +/** + * FIXME + */ static int in_circle_rad(int x, int y, int rad) { if ((x * x) + (y * y) - (rad * rad) < 0) @@ -17343,6 +17804,9 @@ static int in_circle_rad(int x, int y, int rad) } +/** + * FIXME + */ static int paintsound(int size) { if (SND_PAINT1 + (size / 12) >= SND_PAINT4) @@ -17356,10 +17820,12 @@ static int paintsound(int size) #ifdef OLD_SVG +/** + * FIXME + */ /* Old libcairo1, svg and svg-cairo based code Based on cairo-demo/sdl/main.c from Cairo (GPL'd, (c) 2004 Eric Windisch): */ - static SDL_Surface *load_svg(char *file) { svg_cairo_t *scr; @@ -17515,6 +17981,9 @@ static SDL_Surface *load_svg(char *file) #else +/** + * FIXME + */ /* New libcairo2, rsvg and rsvg-cairo based code */ static SDL_Surface *load_svg(char *file) { @@ -17686,6 +18155,9 @@ static SDL_Surface *load_svg(char *file) #endif +/** + * FIXME + */ static float pick_best_scape(unsigned int orig_w, unsigned int orig_h, unsigned int max_w, unsigned int max_h) { float aspect, scale, wscale, hscale; @@ -17759,6 +18231,9 @@ static float pick_best_scape(unsigned int orig_w, unsigned int orig_h, unsigned #endif +/** + * FIXME + */ /* FIXME: we can remove this after SDL folks fix their bug at http://bugzilla.libsdl.org/show_bug.cgi?id=1485 */ /* Try to load an image with IMG_Load(), if it fails, then try with RWops() */ static SDL_Surface *myIMG_Load_RWops(char *file) @@ -17788,6 +18263,9 @@ static SDL_Surface *myIMG_Load_RWops(char *file) return (surf); } +/** + * FIXME + */ /* Load an image; call load_svg() (above, to call Cairo and SVG-Cairo funcs) if we notice it's an SVG file (if available!); call load_kpx() if we notice it's a KPX file (JPEG with wrapper); @@ -17810,6 +18288,9 @@ static SDL_Surface *myIMG_Load(char *file) } } +/** + * FIXME + */ static SDL_Surface *load_kpx(char *file) { SDL_RWops *data; @@ -17838,6 +18319,9 @@ static SDL_Surface *load_kpx(char *file) } +/** + * FIXME + */ static void load_magic_plugins(void) { int res, n, i, plc; @@ -18229,6 +18713,9 @@ static void load_magic_plugins(void) +/** + * FIXME + */ static int magic_sort(const void *a, const void *b) { magic_t *am = (magic_t *) a; @@ -18238,11 +18725,17 @@ static int magic_sort(const void *a, const void *b) } +/** + * FIXME + */ static void update_progress_bar(void) { show_progress_bar(screen); } +/** + * FIXME + */ static void magic_line_func(void *mapi, int which, SDL_Surface * canvas, SDL_Surface * last, int x1, int y1, int x2, int y2, int step, @@ -18321,9 +18814,11 @@ static void magic_line_func(void *mapi, } +/** + * FIXME + */ /* Handle special things that some magic tools do that need to affect more than just the current canvas: */ - static void special_notify(int flags) { int tmp_int; @@ -18357,6 +18852,9 @@ static void special_notify(int flags) } } +/** + * FIXME + */ static void magic_stopsound(void) { #ifndef NOSOUND @@ -18367,6 +18865,9 @@ static void magic_stopsound(void) #endif } +/** + * FIXME + */ static void magic_playsound(Mix_Chunk * snd, int left_right, int up_down) { #ifndef NOSOUND @@ -18409,28 +18910,42 @@ static void magic_playsound(Mix_Chunk * snd, int left_right, int up_down) #endif } +/** + * FIXME + */ static Uint8 magic_linear_to_sRGB(float lin) { return (linear_to_sRGB(lin)); } +/** + * FIXME + */ static float magic_sRGB_to_linear(Uint8 srgb) { return (sRGB_to_linear_table[srgb]); } +/** + * FIXME + */ static int magic_button_down(void) { return (button_down || emulate_button_pressed); } +/** + * FIXME + */ static SDL_Surface *magic_scale(SDL_Surface * surf, int w, int h, int aspect) { return (thumbnail2(surf, w, h, aspect, 1)); } +/** + * FIXME + */ /* FIXME: This, do_open() and do_slideshow() should be combined and modularized! */ - static int do_new_dialog(void) { SDL_Surface *img, *img1, *img2; @@ -19614,8 +20129,10 @@ static int do_new_dialog(void) return (which != -1); } +/** + * FIXME + */ /* FIXME: Use a bitmask! */ - static void reset_touched(void) { int x, y; @@ -19629,6 +20146,9 @@ static void reset_touched(void) } } +/** + * FIXME + */ static Uint8 magic_touched(int x, int y) { Uint8 res; @@ -19642,6 +20162,9 @@ static Uint8 magic_touched(int x, int y) return (res); } +/** + * FIXME + */ static int do_color_sel(void) { #ifndef NO_PROMPT_SHADOWS @@ -20053,6 +20576,9 @@ static int do_color_sel(void) return (chose); } +/** + * FIXME + */ static int do_color_picker(void) { #ifndef NO_PROMPT_SHADOWS @@ -20492,17 +21018,26 @@ static int do_color_picker(void) } +/** + * FIXME + */ static void magic_putpixel(SDL_Surface * surface, int x, int y, Uint32 pixel) { putpixels[surface->format->BytesPerPixel] (surface, x, y, pixel); } +/** + * FIXME + */ static Uint32 magic_getpixel(SDL_Surface * surface, int x, int y) { return (getpixels[surface->format->BytesPerPixel] (surface, x, y)); } +/** + * FIXME + */ static void magic_switchout(SDL_Surface * last) { int was_clicking = 0; @@ -20532,6 +21067,9 @@ static void magic_switchout(SDL_Surface * last) } } +/** + * FIXME + */ static void magic_switchin(SDL_Surface * last) { if (cur_tool == TOOL_MAGIC) @@ -20548,6 +21086,9 @@ static void magic_switchin(SDL_Surface * last) } } +/** + * FIXME + */ static int magic_modeint(int mode) { if (mode == MODE_PAINT || mode == MODE_ONECLICK || mode == MODE_PAINT_WITH_PREVIEW) @@ -20558,6 +21099,9 @@ static int magic_modeint(int mode) return 0; } +/** + * FIXME + */ static void add_label_node(int w, int h, Uint16 x, Uint16 y, SDL_Surface * label_node_surface) { struct label_node *new_node = malloc(sizeof(struct label_node)); @@ -20630,6 +21174,9 @@ static void add_label_node(int w, int h, Uint16 x, Uint16 y, SDL_Surface * label } +/** + * FIXME + */ static struct label_node *search_label_list(struct label_node **ref_head, Uint16 x, Uint16 y, int hover) { struct label_node *current_node; @@ -20746,6 +21293,9 @@ static struct label_node *search_label_list(struct label_node **ref_head, Uint16 return NULL; } +/** + * FIXME + */ static void rec_undo_label(void) { if (first_label_node_in_redo_stack != NULL) @@ -20784,6 +21334,9 @@ static void rec_undo_label(void) } } +/** + * FIXME + */ static void do_undo_label_node() { if (text_undo[(cur_undo + 1) % NUM_UNDO_BUFS] == 1) @@ -20808,6 +21361,9 @@ static void do_undo_label_node() highlighted_label_node = current_label_node; } +/** + * FIXME + */ static void do_redo_label_node() { if ((text_undo[cur_undo] == 1) && (first_label_node_in_redo_stack != NULL)) @@ -20835,9 +21391,11 @@ static void do_redo_label_node() } +/** + * FIXME + */ static void simply_render_node(struct label_node *node) { - SDL_Surface *tmp_surf; SDL_Rect dest, src; wchar_t *str; @@ -20912,6 +21470,9 @@ static void simply_render_node(struct label_node *node) } } +/** + * FIXME + */ static void render_all_nodes_starting_at(struct label_node **node) { struct label_node *current_node; @@ -20932,6 +21493,9 @@ static void render_all_nodes_starting_at(struct label_node **node) } } +/** + * FIXME + */ /* FIXME: This should search for the top-down of the overlaping labels and only re-render from it */ static void derender_node(struct label_node **ref_head) { @@ -20947,6 +21511,9 @@ static void derender_node(struct label_node **ref_head) render_all_nodes_starting_at(&start_label_node); } +/** + * FIXME + */ static void delete_label_list(struct label_node **ref_head) { struct label_node *current = *ref_head; @@ -20966,6 +21533,9 @@ static void delete_label_list(struct label_node **ref_head) *ref_head = NULL; } +/** + * FIXME + */ /* A custom bliter that allows to put two transparent layers toghether without having to deal with colorkeys or SDL_SRCALPHA I am always reinventing the wheel. Hope this one is not squared. Pere */ static void myblit(SDL_Surface * src_surf, SDL_Rect * src_rect, SDL_Surface * dest_surf, SDL_Rect * dest_rect) @@ -21007,6 +21577,9 @@ static void myblit(SDL_Surface * src_surf, SDL_Rect * src_rect, SDL_Surface * de } } +/** + * FIXME + */ static void load_info_about_label_surface(FILE * lfi) { struct label_node *new_node; @@ -21209,6 +21782,9 @@ static void load_info_about_label_surface(FILE * lfi) set_label_fonts(); } +/** + * FIXME + */ static void set_label_fonts() { struct label_node *node; @@ -21217,7 +21793,6 @@ static void set_label_fonts() node = current_label_node; while (node != NULL) - { for (i = 0; i < num_font_families; i++) { @@ -21263,11 +21838,13 @@ static void set_label_fonts() free(node->save_font_type); /* Not needed anymore */ node->save_font_type = NULL; node = node->next_to_down_label_node; - } } +/** + * FIXME + */ static void tmp_apply_uncommited_text() { have_to_rec_label_node_back = have_to_rec_label_node; @@ -21310,6 +21887,9 @@ static void tmp_apply_uncommited_text() } } +/** + * FIXME + */ static void undo_tmp_applied_text() { struct label_node *aux_label_node; @@ -21345,6 +21925,9 @@ static void undo_tmp_applied_text() } +/** + * FIXME + */ /* Painting on the screen surface to avoid unnecessary complexity */ static void highlight_label_nodes() { @@ -21421,6 +22004,9 @@ static void highlight_label_nodes() } } +/** + * FIXME + */ static void cycle_highlighted_label_node() { struct label_node *aux_node; @@ -21445,6 +22031,9 @@ static void cycle_highlighted_label_node() } +/** + * FIXME + */ static int are_labels() { struct label_node *aux_node; @@ -21462,6 +22051,9 @@ static int are_labels() return (FALSE); } +/** + * FIXME + */ int chunk_is_valid(const char *chunk_name, png_unknown_chunk unknown) { unsigned int count, fields; @@ -21530,6 +22122,9 @@ int chunk_is_valid(const char *chunk_name, png_unknown_chunk unknown) return (FALSE); } +/** + * FIXME + */ Bytef *get_chunk_data(FILE * fp, char *fname, png_structp png_ptr, png_infop info_ptr, const char *chunk_name, png_unknown_chunk unknown, int *unc_size) { @@ -21630,6 +22225,9 @@ Bytef *get_chunk_data(FILE * fp, char *fname, png_structp png_ptr, } +/** + * FIXME + */ void load_embedded_data(char *fname, SDL_Surface * org_surf) { FILE *fi, *fp; @@ -21985,6 +22583,9 @@ void load_embedded_data(char *fname, SDL_Surface * org_surf) /* ================================================================================== */ #if !defined(WIN32) && !defined(__BEOS__) && !defined(__HAIKU__) && !defined(__ANDROID__) +/** + * FIXME + */ static void show_available_papersizes(int exitcode) { FILE *fi = exitcode ? stderr : stdout; @@ -22019,6 +22620,9 @@ static void show_available_papersizes(int exitcode) /* ================================================================================== */ +/** + * FIXME + */ static void parse_file_options(struct cfginfo *restrict tmpcfg, const char *filename) { char str[256]; @@ -22072,6 +22676,9 @@ static void parse_file_options(struct cfginfo *restrict tmpcfg, const char *file tmpcfg->parsertmp_lang = PARSE_CLOBBER; } +/** + * FIXME + */ static void parse_argv_options(struct cfginfo *restrict tmpcfg, char *argv[]) { char *str, *arg; @@ -22146,6 +22753,9 @@ static void parse_argv_options(struct cfginfo *restrict tmpcfg, char *argv[]) tmpcfg->parsertmp_lang = PARSE_CLOBBER; } +/** + * FIXME + */ /* merge two configs, with the winner taking priority */ static void tmpcfg_merge(struct cfginfo *loser, const struct cfginfo *winner) { @@ -22162,6 +22772,9 @@ static void tmpcfg_merge(struct cfginfo *loser, const struct cfginfo *winner) } } +/** + * FIXME + */ static void setup_config(char *argv[]) { char str[128]; @@ -22710,11 +23323,12 @@ static void setup_config(char *argv[]) { promptless_save = SAVE_OVER_ALWAYS; } - - } +/** + * FIXME + */ static void chdir_to_binary(char *argv0) { /* @@ -22780,6 +23394,9 @@ static void chdir_to_binary(char *argv0) /* ================================================================================== */ +/** + * FIXME + */ static void setup_colors(void) { FILE *fi; @@ -22940,6 +23557,9 @@ static void setup_colors(void) /* ================================================================================== */ +/** + * FIXME + */ static void do_lock_file(void) { FILE *fi; @@ -23020,6 +23640,9 @@ static void do_lock_file(void) } int TP_EventFilter(void *data, const SDL_Event * event) +/** + * FIXME + */ { if (event->type == SDL_QUIT || event->type == SDL_WINDOWEVENT || @@ -23047,6 +23670,9 @@ int TP_EventFilter(void *data, const SDL_Event * event) /* ================================================================================== */ +/** + * FIXME + */ static void setup(void) { int i; @@ -23181,6 +23807,10 @@ static void setup(void) #ifndef NOSOUND +#ifdef DEBUG + printf("Initializing sound...\n"); + fflush(stdout); +#endif #ifndef WIN32 if (use_sound && Mix_OpenAudio(44100, AUDIO_S16SYS, 2, 1024) < 0) #else @@ -23209,9 +23839,17 @@ static void setup(void) #endif +#ifdef DEBUG + printf("Enabling key repeat...\n"); + fflush(stdout); +#endif /* Set-up Key-Repeat: */ // SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); +#ifdef DEBUG + printf("Initializing TTF...\n"); + fflush(stdout); +#endif /* Init TTF stuff: */ if (TTF_Init() < 0) { @@ -23224,6 +23862,10 @@ static void setup(void) } +#ifdef DEBUG + printf("Setting up colors...\n"); + fflush(stdout); +#endif setup_colors(); /* Set window icon and caption: */ @@ -23587,7 +24229,7 @@ static void setup(void) printf("%s\n", tmp_str); #endif - snprintf(tmp_str, sizeof(tmp_str), "© 2002–2014 Bill Kendrick et al."); + snprintf(tmp_str, sizeof(tmp_str), "© 2002–2018 Bill Kendrick et al."); tmp_surf = render_text(medium_font, tmp_str, black); dest.x = 10; dest.y = WINDOW_HEIGHT - img_progress->h - (tmp_surf->h * 2); @@ -24126,6 +24768,9 @@ static void setup(void) /* ================================================================================== */ +/** + * FIXME + */ static void claim_to_be_ready(void) { SDL_Rect dest; @@ -24226,6 +24871,9 @@ static void claim_to_be_ready(void) /* ================================================================================== */ +/** + * FIXME + */ int main(int argc, char *argv[]) { #ifdef DEBUG @@ -24329,10 +24977,11 @@ int main(int argc, char *argv[]) } - - /* Moves a file to the trashcan (or deletes it) */ +/** + * FIXME + */ static int trash(char *path) { #ifdef UNLINK_ONLY @@ -24503,6 +25152,9 @@ static int trash(char *path) #endif /* UNLINK_ONLY */ } +/** + * FIXME + */ int file_exists(char *path) { struct stat buf; @@ -24512,6 +25164,9 @@ int file_exists(char *path) return (res == 0); } +/** + * FIXME + */ /* Don't move the mouse here as this is only called when an event triggers it and the joystick can be holded withouth sending any event. */ static void handle_joyaxismotion(SDL_Event event, int *motioner, int *val_x, int *val_y) @@ -24555,6 +25210,9 @@ static void handle_joyaxismotion(SDL_Event event, int *motioner, int *val_x, int } } +/** + * FIXME + */ static void handle_joyhatmotion(SDL_Event event, int oldpos_x, int oldpos_y, int *valhat_x, int *valhat_y, int *hatmotioner, Uint32 * old_hat_ticks) { @@ -24606,6 +25264,9 @@ static void handle_joyhatmotion(SDL_Event event, int oldpos_x, int oldpos_y, int *old_hat_ticks = SDL_GetTicks(); } +/** + * FIXME + */ static void handle_joyballmotion(SDL_Event event, int oldpos_x, int oldpos_y) { int val_x, val_y; @@ -24618,7 +25279,9 @@ static void handle_joyballmotion(SDL_Event event, int oldpos_x, int oldpos_y) SDL_WarpMouse(oldpos_x + val_x, oldpos_y + val_y); } - +/** + * FIXME + */ static void handle_motioners(int oldpos_x, int oldpos_y, int motioner, int hatmotioner, int old_hat_ticks, int val_x, int val_y, int valhat_x, int valhat_y) { @@ -24647,11 +25310,17 @@ static void handle_motioners(int oldpos_x, int oldpos_y, int motioner, int hatmo } +/** + * FIXME + */ static void handle_joybuttonupdown(SDL_Event event, int oldpos_x, int oldpos_y) { handle_joybuttonupdownscl(event, oldpos_x, oldpos_y, r_tools); } +/** + * FIXME + */ static void handle_joybuttonupdownscl(SDL_Event event, int oldpos_x, int oldpos_y, SDL_Rect real_r_tools) { int i, ignore = 0; diff --git a/src/win32_dirent.c b/src/win32_dirent.c index 5a4f1756f..bba2992d2 100644 --- a/src/win32_dirent.c +++ b/src/win32_dirent.c @@ -35,7 +35,14 @@ #include "win32_dirent.h" #include "debug.h" - DIR * opendir(const char *pSpec) + +/** + * Open a directory for reading + * + * @param pSpec Path of directory to open + * @return Opened directory, or NULL on failure + */ +DIR * opendir(const char *pSpec) { char pathname[MAX_PATH + 2]; @@ -46,7 +53,6 @@ strcat(pathname, "/*"); pDir->hFind = FindFirstFile(pathname, &pDir->wfd); if (pDir->hFind == INVALID_HANDLE_VALUE) - { free(pDir); pDir = NULL; @@ -54,11 +60,24 @@ return pDir; } +/** + * Close an opened directory + * + * @param pDir Opened directory to close. + */ void closedir(DIR * pDir) { assert(pDir != NULL); free(pDir); -} struct dirent *readdir(struct DIR *pDir) +} + +/** + * Read an entry from an opened directory. + * + * @param pDir Opened directory from which to read. + * @return The next entry from the directory + */ +struct dirent *readdir(struct DIR *pDir) { assert(pDir != NULL); if (pDir->hFind) @@ -76,10 +95,30 @@ void closedir(DIR * pDir) return NULL; } +/** + * Callback for sorting directory entries by filenames. + * + * @param a Directory entry #1 + * @param b Directory entry #2 + * @return An integer less than, equal to, or greater than zero if the + * filename of dir entry 'a' is found, respectively, to be less than, + * to match, or be greater than that of 'b'. + */ int alphasort(const void *a, const void *b) { return (strcmp((*(const struct dirent **)a)->d_name, (*(const struct dirent **)b)->d_name)); -} static int addToList(int i, struct dirent ***namelist, struct dirent *entry) +} + +/** + * Add directory entry filenames into a list. + * + * @param i Incoming count of items + * @param namelist Pointer to an array of directory entries, which will + * be resized as items are added + * @param entry The directory entry to add to 'namelist' + * @return New count of items, or -1 on error (e.g., failed malloc()) + */ +static int addToList(int i, struct dirent ***namelist, struct dirent *entry) { int size; struct dirent *block; @@ -96,6 +135,15 @@ int alphasort(const void *a, const void *b) return ++i; } +/** + * Scan a directory + * + * @param dir Path to the directory to be scanned. + * @param namelist Pointer to an array of directory entries, to be filled. + * @param select Callback function for selecting items to add to the list. + * @param compar Callback for sorting items in the list (via qsort()). + * @return Count of items, or -1 on error. + */ int scandir(const char *dir, struct dirent ***namelist, selectCB select, comparCB compar) { DIR * pDir; @@ -108,7 +156,6 @@ int scandir(const char *dir, struct dirent ***namelist, selectCB select, comparC return -1; count = 0; while ((entry = readdir(pDir)) != NULL) - { if (select == NULL || (select != NULL && select(entry))) if ((count = addToList(count, namelist, entry)) < 0) @@ -121,5 +168,3 @@ int scandir(const char *dir, struct dirent ***namelist, selectCB select, comparC qsort((void *)(*namelist), (size_t) count, sizeof(struct dirent *), compar); return count; } - - diff --git a/src/win32_print.c b/src/win32_print.c index 74dfcd76e..0b5c989ed 100644 --- a/src/win32_print.c +++ b/src/win32_print.c @@ -37,6 +37,9 @@ static HDC hDCprinter = NULL; +/** + * FIXME + */ static SDL_Surface *make24bitDIB(SDL_Surface * surf) { SDL_PixelFormat pixfmt; @@ -84,6 +87,9 @@ static SDL_Surface *make24bitDIB(SDL_Surface * surf) return surfDIB; } +/** + * FIXME + */ /* returns 0 if failed */ static int GetDefaultPrinterStrings(char *device, char *driver, char *output) { @@ -115,6 +121,9 @@ static int GetDefaultPrinterStrings(char *device, char *driver, char *output) #define dmDeviceNameSize 32 +/** + * FIXME + */ static HANDLE LoadCustomPrinterHDEVMODE(HWND hWnd, const char *filepath) { char device[MAX_PATH]; @@ -179,7 +188,9 @@ err_exit: return NULL; } - +/** + * FIXME + */ static int SaveCustomPrinterHDEVMODE(HWND hWnd, const char *filepath, HANDLE hDevMode) { FILE *fp = NULL; @@ -202,6 +213,12 @@ static int SaveCustomPrinterHDEVMODE(HWND hWnd, const char *filepath, HANDLE hDe return 0; } +/** + * Returns whether or not a given file exists. + * + * @param filepath Path to the file + * @return 1 if file exists, 0 otherwise + */ static int FileExists(const char *filepath) { FILE *fp; @@ -214,6 +231,10 @@ static int FileExists(const char *filepath) return 0; } + +/** + * FIXME + */ static int GetCustomPrinterDC(HWND hWnd, const char *printcfg, int show) { PRINTDLG pd = { @@ -254,6 +275,9 @@ static int GetCustomPrinterDC(HWND hWnd, const char *printcfg, int show) } +/** + * FIXME + */ static HDC GetDefaultPrinterDC(void) { char device[MAX_PATH], driver[MAX_PATH], output[MAX_PATH]; @@ -264,6 +288,10 @@ static HDC GetDefaultPrinterDC(void) return NULL; } + +/** + * FIXME + */ static int GetPrinterDC(HWND hWnd, const char *printcfg, int show) { hDCprinter = NULL; @@ -277,6 +305,9 @@ static int GetPrinterDC(HWND hWnd, const char *printcfg, int show) } +/** + * FIXME + */ int IsPrinterAvailable(void) { return (GetDefaultPrinterStrings(NULL, NULL, NULL) != 0); @@ -285,6 +316,10 @@ int IsPrinterAvailable(void) #define STRETCH_TO_FIT 0 #define SCALE_TO_FIT 1 + +/** + * FIXME + */ const char *SurfacePrint(SDL_Surface * surf, const char *printcfg, int showdialog) { const char *res = NULL; @@ -472,6 +507,10 @@ error: return res; } + +/** + * FIXME + */ /* Read access to Windows Registry */ @@ -494,9 +533,12 @@ err_exit: return HRESULT_FROM_WIN32(res); } -/* - Removes a single '\' or '/' from end of path -*/ +/** + * Removes a single '\' or '/' from end of path + * + * @param path Directory path + * @return the path argument, contents of which may have been modified + */ static char *remove_slash(char *path) { int len = strlen(path); @@ -533,10 +575,13 @@ char *GetDefaultSaveDir(const char *suffix) return strdup("userdata"); } -/* - Returns heap string containing system font directory. - E.g. 'C:\Windows\Fonts' -*/ +/** + * + * Returns heap string containing system font directory. + * (e.g. 'C:\Windows\Fonts') + * + * @return system font dir + */ char *GetSystemFontDir(void) { char path[MAX_PATH]; @@ -567,6 +612,12 @@ static char *GetUserTempDir(void) return strdup(temp); } +/** + * Get path of a file in a temp directory + * + * @param name Filename for temp file + * @return full path to the temp file + */ char *get_temp_fname(const char *const name) { char f[512]; @@ -584,6 +635,9 @@ char *get_temp_fname(const char *const name) static HHOOK g_hKeyboardHook = NULL; static int g_bWindowActive = 0; +/** + * FIXME + */ LRESULT CALLBACK LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam) { int bEatKeystroke = 0; @@ -607,6 +661,9 @@ LRESULT CALLBACK LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam) return CallNextHookEx(g_hKeyboardHook, nCode, wParam, lParam); } +/** + * FIXME + */ int InstallKeyboardHook(void) { if (g_hKeyboardHook) @@ -615,6 +672,9 @@ int InstallKeyboardHook(void) return g_hKeyboardHook ? 0 : -2; } +/** + * FIXME + */ int RemoveKeyboardHook(void) { if (!g_hKeyboardHook) @@ -624,6 +684,9 @@ int RemoveKeyboardHook(void) return 0; } +/** + * FIXME + */ void SetActivationState(int state) { g_bWindowActive = state; diff --git a/tuxpaint.spec b/tuxpaint.spec index 73a2918b1..17b4cfa6b 100644 --- a/tuxpaint.spec +++ b/tuxpaint.spec @@ -1,6 +1,6 @@ Summary: A drawing program for young children Name: tuxpaint -Version: 0.9.22 +Version: 0.9.23 Release: 1 Epoch: 1 License: GPL @@ -89,6 +89,9 @@ rm -rf $RPM_BUILD_ROOT %{_prefix}/bin/tp-magic-config %changelog +* Sun Aug 19 2018 - +- Set version number 0.9.23 + * Mon Aug 20 2012 - - Corrected 'Requires' and 'BuildRequires'