Updating to master 2019/6/6
This commit is contained in:
commit
4d3ef642da
22 changed files with 2104 additions and 1960 deletions
|
|
@ -2,13 +2,13 @@ CHANGES.txt for Tux Paint
|
|||
|
||||
Tux Paint - A simple drawing program for children.
|
||||
|
||||
Copyright (c) 2002-2018
|
||||
Copyright (c) 2002-2019
|
||||
Various contributors (see below, and AUTHORS.txt)
|
||||
http://www.tuxpaint.org/
|
||||
|
||||
$Id$
|
||||
|
||||
2018.Dec.18 (0.9.24)
|
||||
2019.Apr.3 (0.9.24)
|
||||
* Bug Fixes
|
||||
---------
|
||||
* Correct issue that prevented Tux Paint from lauching on Mac OS X 10.7.
|
||||
|
|
@ -34,6 +34,14 @@ $Id$
|
|||
Use "--newcolorslast" option.
|
||||
(Suggested by Bernard Verhaeghe)
|
||||
|
||||
* Recognize signals (SIGUSR1 and SIGUSR2) on POSIX systems,
|
||||
which causes Tux Paint to quit, first saving the current drawing
|
||||
(if unsaved) (like "--autosave"), either saving a new image
|
||||
(like "--saveovernew") (via SIGUSR1), or overwritting the current
|
||||
drawing (like "--saveover") (via SIGUSR2).
|
||||
(Thanks to Flavio Airundo for the idea; closes
|
||||
https://sourceforge.net/p/tuxpaint/feature-requests/188/)
|
||||
|
||||
* Documentation updates
|
||||
---------------------
|
||||
* Mended link to MinGW/MSYS instructions at John Popplewell's website.
|
||||
|
|
@ -41,6 +49,10 @@ $Id$
|
|||
|
||||
* Improved and expanded usage info (e.g., "tuxpaint --help" output)
|
||||
|
||||
* Documentation on POSIX signals recognized by Tux Paint (e.g.,
|
||||
the new "SIGUSR1" & "SIGUSR2") added to a new doc file,
|
||||
"SIGNALS.txt".
|
||||
|
||||
* Misc
|
||||
----
|
||||
* Verbose debugging, and "DEBUG_PRINTF()" macro now available;
|
||||
|
|
|
|||
|
|
@ -3,22 +3,22 @@
|
|||
|
||||
A simple drawing program for children
|
||||
|
||||
Copyright 2002-2018 by various contributors; see AUTHORS.txt
|
||||
Copyright 2002-2019 by various contributors; see AUTHORS.txt
|
||||
http://www.tuxpaint.org/
|
||||
|
||||
June 14, 2002 - December 18, 2018
|
||||
June 14, 2002 - April 3, 2019
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
+------------------------------------------------------------------------+
|
||||
+-------------------------------------------+
|
||||
|Table of Contents |
|
||||
|------------------------------------------------------------------------|
|
||||
|-------------------------------------------|
|
||||
| * About |
|
||||
| * Using Tux Paint |
|
||||
| * Loading Other Pictures into Tux Paint |
|
||||
| * Further Reading |
|
||||
| * How to Get Help |
|
||||
+------------------------------------------------------------------------+
|
||||
+-------------------------------------------+
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
|
|
@ -876,6 +876,8 @@ Doing it Manually
|
|||
Notes on creating PNG format bitmapped images for use in Tux Paint.
|
||||
* SVG.txt
|
||||
Notes on creating SVG format vector images for use in Tux Paint.
|
||||
* SIGNALS.txt
|
||||
Information about POSIX signals Tux Paint responds to.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
50
docs/en/SIGNALS.txt
Normal file
50
docs/en/SIGNALS.txt
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
SIGNALS.txt for Tux Paint
|
||||
|
||||
Tux Paint - A simple drawing program for children.
|
||||
|
||||
Copyright 2019 by Bill Kendrick and others
|
||||
bill@newbreedsoftware.com
|
||||
http://www.tuxpaint.org/
|
||||
|
||||
April 3, 2019
|
||||
|
||||
Tux Paint responds to the following signals (which can be
|
||||
sent to the program's process via `kill` or `killall`, for
|
||||
example).
|
||||
|
||||
* SIGTERM (also, [Ctrl]+[C] from a terminal running "tuxpaint")
|
||||
|
||||
Tux Paint responds as if the "Quit" button were pressed,
|
||||
or the desktop environment was told to close Tux Paint
|
||||
(e.g., by clicking a window close button, or pressing
|
||||
[Alt]+[F4] on most systems).
|
||||
|
||||
From the main interface, Tux Paint will prompt whether or
|
||||
not you wish to quit, and (unless overridden by "--autosave")
|
||||
if you'd like to save the current drawing (if unsaved),
|
||||
and if so, and it's a modified version of an existing drawing
|
||||
(unless overridden by "--saveover" or "--saveovernew"),
|
||||
whether or not to overwrite the existing drawing, or save
|
||||
to a new file.
|
||||
|
||||
From other parts of the interface, the signal is currently
|
||||
interpreted as a request to go back (e.g., from the
|
||||
"New" dialog back to the main interface), as if a "Back"
|
||||
button in Tux Paint were clicked, or the [Esc] key pressed.
|
||||
|
||||
* SIGUSR1 & SIGUSR2
|
||||
|
||||
Tux Paint responds by setting its "--autosave" option, and either
|
||||
"--saveovernew" (for SIGUSR1) or "--saveover" (for SIGUSR2),
|
||||
and sending itself a SIGTERM signal.
|
||||
|
||||
So, from the main interface, Tux Paint should quit almost immediately,
|
||||
with no questions asked.
|
||||
|
||||
From other parts of the interface, unfortunately, Tux Paint
|
||||
will go back one level in the interface. Therefore, at this time,
|
||||
it may be necessary to send this signal to Tux Paint a few times,
|
||||
for it to quit completely.
|
||||
|
||||
e.g., `killall -s SIGUSR1 tuxpaint`
|
||||
|
||||
|
|
@ -17,12 +17,12 @@ version
|
|||
</h1>
|
||||
<h3>A simple drawing program for children</h3>
|
||||
|
||||
<p>Copyright 2002-2018 by various contributors; see AUTHORS.txt<br>
|
||||
<p>Copyright 2002-2019 by various contributors; see AUTHORS.txt<br>
|
||||
<a href="http://www.tuxpaint.org/">http://www.tuxpaint.org/</a></p>
|
||||
|
||||
<p>June 14, 2002 -
|
||||
|
||||
December 18, 2018</p>
|
||||
April 3, 2019</p>
|
||||
|
||||
</center>
|
||||
|
||||
|
|
@ -1159,6 +1159,9 @@ version
|
|||
<li><a href="../SVG.txt">SVG.txt</a><br>
|
||||
Notes on creating SVG format vector images for use in Tux Paint.
|
||||
|
||||
<li><a href="../SIGNALS.txt">SIGNALS.txt</a><br>
|
||||
Information about POSIX signals Tux Paint responds to.
|
||||
|
||||
</ul>
|
||||
</blockquote>
|
||||
|
||||
|
|
|
|||
1
magic/docs/.indent.pro
vendored
Symbolic link
1
magic/docs/.indent.pro
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../src/.indent.pro
|
||||
|
|
@ -303,7 +303,8 @@ void example_shutdown(magic_api * api)
|
|||
|
||||
// Affect the canvas on click:
|
||||
|
||||
void example_click(magic_api * api, int which, int mode,
|
||||
void
|
||||
example_click(magic_api * api, int which, int mode,
|
||||
SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
// In our case, a single click (which is also the start of a drag!)
|
||||
|
|
@ -319,7 +320,8 @@ void example_click(magic_api * api, int which, int mode,
|
|||
|
||||
// Affect the canvas on drag:
|
||||
|
||||
void example_drag(magic_api * api, int which, SDL_Surface * canvas,
|
||||
void
|
||||
example_drag(magic_api * api, int which, SDL_Surface * canvas,
|
||||
SDL_Surface * snapshot, int ox, int oy, int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
// Call Tux Paint's "line()" function.
|
||||
|
|
@ -380,7 +382,8 @@ void example_drag(magic_api * api, int which, SDL_Surface * canvas,
|
|||
|
||||
// Affect the canvas on release:
|
||||
|
||||
void example_release(magic_api * api, int which,
|
||||
void
|
||||
example_release(magic_api * api, int which,
|
||||
SDL_Surface * canvas, SDL_Surface * snapshot, int x, int y, SDL_Rect * update_rect)
|
||||
{
|
||||
// Neither of our effects do anything special when the mouse is released
|
||||
|
|
|
|||
1
osk/.indent.pro
vendored
Symbolic link
1
osk/.indent.pro
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../src/.indent.pro
|
||||
|
|
@ -1324,11 +1324,11 @@ SOFTWARE.
|
|||
|
||||
#ifdef XK_TECHNICAL
|
||||
#define XK_leftradical 0x08a1 /* U+23B7 RADICAL SYMBOL BOTTOM */
|
||||
#define XK_topleftradical 0x08a2 /*(U+250C BOX DRAWINGS LIGHT DOWN AND RIGHT)*/
|
||||
#define XK_horizconnector 0x08a3 /*(U+2500 BOX DRAWINGS LIGHT HORIZONTAL)*/
|
||||
#define XK_topleftradical 0x08a2 /*(U+250C BOX DRAWINGS LIGHT DOWN AND RIGHT) */
|
||||
#define XK_horizconnector 0x08a3 /*(U+2500 BOX DRAWINGS LIGHT HORIZONTAL) */
|
||||
#define XK_topintegral 0x08a4 /* U+2320 TOP HALF INTEGRAL */
|
||||
#define XK_botintegral 0x08a5 /* U+2321 BOTTOM HALF INTEGRAL */
|
||||
#define XK_vertconnector 0x08a6 /*(U+2502 BOX DRAWINGS LIGHT VERTICAL)*/
|
||||
#define XK_vertconnector 0x08a6 /*(U+2502 BOX DRAWINGS LIGHT VERTICAL) */
|
||||
#define XK_topleftsqbracket 0x08a7 /* U+23A1 LEFT SQUARE BRACKET UPPER CORNER */
|
||||
#define XK_botleftsqbracket 0x08a8 /* U+23A3 LEFT SQUARE BRACKET LOWER CORNER */
|
||||
#define XK_toprightsqbracket 0x08a9 /* U+23A4 RIGHT SQUARE BRACKET UPPER CORNER */
|
||||
|
|
@ -1425,7 +1425,7 @@ SOFTWARE.
|
|||
#define XK_hairspace 0x0aa8 /* U+200A HAIR SPACE */
|
||||
#define XK_emdash 0x0aa9 /* U+2014 EM DASH */
|
||||
#define XK_endash 0x0aaa /* U+2013 EN DASH */
|
||||
#define XK_signifblank 0x0aac /*(U+2423 OPEN BOX)*/
|
||||
#define XK_signifblank 0x0aac /*(U+2423 OPEN BOX) */
|
||||
#define XK_ellipsis 0x0aae /* U+2026 HORIZONTAL ELLIPSIS */
|
||||
#define XK_doubbaselinedot 0x0aaf /* U+2025 TWO DOT LEADER */
|
||||
#define XK_onethird 0x0ab0 /* U+2153 VULGAR FRACTION ONE THIRD */
|
||||
|
|
@ -1438,21 +1438,21 @@ SOFTWARE.
|
|||
#define XK_fivesixths 0x0ab7 /* U+215A VULGAR FRACTION FIVE SIXTHS */
|
||||
#define XK_careof 0x0ab8 /* U+2105 CARE OF */
|
||||
#define XK_figdash 0x0abb /* U+2012 FIGURE DASH */
|
||||
#define XK_leftanglebracket 0x0abc /*(U+27E8 MATHEMATICAL LEFT ANGLE BRACKET)*/
|
||||
#define XK_decimalpoint 0x0abd /*(U+002E FULL STOP)*/
|
||||
#define XK_rightanglebracket 0x0abe /*(U+27E9 MATHEMATICAL RIGHT ANGLE BRACKET)*/
|
||||
#define XK_leftanglebracket 0x0abc /*(U+27E8 MATHEMATICAL LEFT ANGLE BRACKET) */
|
||||
#define XK_decimalpoint 0x0abd /*(U+002E FULL STOP) */
|
||||
#define XK_rightanglebracket 0x0abe /*(U+27E9 MATHEMATICAL RIGHT ANGLE BRACKET) */
|
||||
#define XK_marker 0x0abf
|
||||
#define XK_oneeighth 0x0ac3 /* U+215B VULGAR FRACTION ONE EIGHTH */
|
||||
#define XK_threeeighths 0x0ac4 /* U+215C VULGAR FRACTION THREE EIGHTHS */
|
||||
#define XK_fiveeighths 0x0ac5 /* U+215D VULGAR FRACTION FIVE EIGHTHS */
|
||||
#define XK_seveneighths 0x0ac6 /* U+215E VULGAR FRACTION SEVEN EIGHTHS */
|
||||
#define XK_trademark 0x0ac9 /* U+2122 TRADE MARK SIGN */
|
||||
#define XK_signaturemark 0x0aca /*(U+2613 SALTIRE)*/
|
||||
#define XK_signaturemark 0x0aca /*(U+2613 SALTIRE) */
|
||||
#define XK_trademarkincircle 0x0acb
|
||||
#define XK_leftopentriangle 0x0acc /*(U+25C1 WHITE LEFT-POINTING TRIANGLE)*/
|
||||
#define XK_rightopentriangle 0x0acd /*(U+25B7 WHITE RIGHT-POINTING TRIANGLE)*/
|
||||
#define XK_emopencircle 0x0ace /*(U+25CB WHITE CIRCLE)*/
|
||||
#define XK_emopenrectangle 0x0acf /*(U+25AF WHITE VERTICAL RECTANGLE)*/
|
||||
#define XK_leftopentriangle 0x0acc /*(U+25C1 WHITE LEFT-POINTING TRIANGLE) */
|
||||
#define XK_rightopentriangle 0x0acd /*(U+25B7 WHITE RIGHT-POINTING TRIANGLE) */
|
||||
#define XK_emopencircle 0x0ace /*(U+25CB WHITE CIRCLE) */
|
||||
#define XK_emopenrectangle 0x0acf /*(U+25AF WHITE VERTICAL RECTANGLE) */
|
||||
#define XK_leftsinglequotemark 0x0ad0 /* U+2018 LEFT SINGLE QUOTATION MARK */
|
||||
#define XK_rightsinglequotemark 0x0ad1 /* U+2019 RIGHT SINGLE QUOTATION MARK */
|
||||
#define XK_leftdoublequotemark 0x0ad2 /* U+201C LEFT DOUBLE QUOTATION MARK */
|
||||
|
|
@ -1462,23 +1462,23 @@ SOFTWARE.
|
|||
#define XK_seconds 0x0ad7 /* U+2033 DOUBLE PRIME */
|
||||
#define XK_latincross 0x0ad9 /* U+271D LATIN CROSS */
|
||||
#define XK_hexagram 0x0ada
|
||||
#define XK_filledrectbullet 0x0adb /*(U+25AC BLACK RECTANGLE)*/
|
||||
#define XK_filledlefttribullet 0x0adc /*(U+25C0 BLACK LEFT-POINTING TRIANGLE)*/
|
||||
#define XK_filledrighttribullet 0x0add /*(U+25B6 BLACK RIGHT-POINTING TRIANGLE)*/
|
||||
#define XK_emfilledcircle 0x0ade /*(U+25CF BLACK CIRCLE)*/
|
||||
#define XK_emfilledrect 0x0adf /*(U+25AE BLACK VERTICAL RECTANGLE)*/
|
||||
#define XK_enopencircbullet 0x0ae0 /*(U+25E6 WHITE BULLET)*/
|
||||
#define XK_enopensquarebullet 0x0ae1 /*(U+25AB WHITE SMALL SQUARE)*/
|
||||
#define XK_openrectbullet 0x0ae2 /*(U+25AD WHITE RECTANGLE)*/
|
||||
#define XK_opentribulletup 0x0ae3 /*(U+25B3 WHITE UP-POINTING TRIANGLE)*/
|
||||
#define XK_opentribulletdown 0x0ae4 /*(U+25BD WHITE DOWN-POINTING TRIANGLE)*/
|
||||
#define XK_openstar 0x0ae5 /*(U+2606 WHITE STAR)*/
|
||||
#define XK_enfilledcircbullet 0x0ae6 /*(U+2022 BULLET)*/
|
||||
#define XK_enfilledsqbullet 0x0ae7 /*(U+25AA BLACK SMALL SQUARE)*/
|
||||
#define XK_filledtribulletup 0x0ae8 /*(U+25B2 BLACK UP-POINTING TRIANGLE)*/
|
||||
#define XK_filledtribulletdown 0x0ae9 /*(U+25BC BLACK DOWN-POINTING TRIANGLE)*/
|
||||
#define XK_leftpointer 0x0aea /*(U+261C WHITE LEFT POINTING INDEX)*/
|
||||
#define XK_rightpointer 0x0aeb /*(U+261E WHITE RIGHT POINTING INDEX)*/
|
||||
#define XK_filledrectbullet 0x0adb /*(U+25AC BLACK RECTANGLE) */
|
||||
#define XK_filledlefttribullet 0x0adc /*(U+25C0 BLACK LEFT-POINTING TRIANGLE) */
|
||||
#define XK_filledrighttribullet 0x0add /*(U+25B6 BLACK RIGHT-POINTING TRIANGLE) */
|
||||
#define XK_emfilledcircle 0x0ade /*(U+25CF BLACK CIRCLE) */
|
||||
#define XK_emfilledrect 0x0adf /*(U+25AE BLACK VERTICAL RECTANGLE) */
|
||||
#define XK_enopencircbullet 0x0ae0 /*(U+25E6 WHITE BULLET) */
|
||||
#define XK_enopensquarebullet 0x0ae1 /*(U+25AB WHITE SMALL SQUARE) */
|
||||
#define XK_openrectbullet 0x0ae2 /*(U+25AD WHITE RECTANGLE) */
|
||||
#define XK_opentribulletup 0x0ae3 /*(U+25B3 WHITE UP-POINTING TRIANGLE) */
|
||||
#define XK_opentribulletdown 0x0ae4 /*(U+25BD WHITE DOWN-POINTING TRIANGLE) */
|
||||
#define XK_openstar 0x0ae5 /*(U+2606 WHITE STAR) */
|
||||
#define XK_enfilledcircbullet 0x0ae6 /*(U+2022 BULLET) */
|
||||
#define XK_enfilledsqbullet 0x0ae7 /*(U+25AA BLACK SMALL SQUARE) */
|
||||
#define XK_filledtribulletup 0x0ae8 /*(U+25B2 BLACK UP-POINTING TRIANGLE) */
|
||||
#define XK_filledtribulletdown 0x0ae9 /*(U+25BC BLACK DOWN-POINTING TRIANGLE) */
|
||||
#define XK_leftpointer 0x0aea /*(U+261C WHITE LEFT POINTING INDEX) */
|
||||
#define XK_rightpointer 0x0aeb /*(U+261E WHITE RIGHT POINTING INDEX) */
|
||||
#define XK_club 0x0aec /* U+2663 BLACK CLUB SUIT */
|
||||
#define XK_diamond 0x0aed /* U+2666 BLACK DIAMOND SUIT */
|
||||
#define XK_heart 0x0aee /* U+2665 BLACK HEART SUIT */
|
||||
|
|
@ -1506,23 +1506,23 @@ SOFTWARE.
|
|||
*/
|
||||
|
||||
#ifdef XK_APL
|
||||
#define XK_leftcaret 0x0ba3 /*(U+003C LESS-THAN SIGN)*/
|
||||
#define XK_rightcaret 0x0ba6 /*(U+003E GREATER-THAN SIGN)*/
|
||||
#define XK_downcaret 0x0ba8 /*(U+2228 LOGICAL OR)*/
|
||||
#define XK_upcaret 0x0ba9 /*(U+2227 LOGICAL AND)*/
|
||||
#define XK_overbar 0x0bc0 /*(U+00AF MACRON)*/
|
||||
#define XK_leftcaret 0x0ba3 /*(U+003C LESS-THAN SIGN) */
|
||||
#define XK_rightcaret 0x0ba6 /*(U+003E GREATER-THAN SIGN) */
|
||||
#define XK_downcaret 0x0ba8 /*(U+2228 LOGICAL OR) */
|
||||
#define XK_upcaret 0x0ba9 /*(U+2227 LOGICAL AND) */
|
||||
#define XK_overbar 0x0bc0 /*(U+00AF MACRON) */
|
||||
#define XK_downtack 0x0bc2 /* U+22A4 DOWN TACK */
|
||||
#define XK_upshoe 0x0bc3 /*(U+2229 INTERSECTION)*/
|
||||
#define XK_upshoe 0x0bc3 /*(U+2229 INTERSECTION) */
|
||||
#define XK_downstile 0x0bc4 /* U+230A LEFT FLOOR */
|
||||
#define XK_underbar 0x0bc6 /*(U+005F LOW LINE)*/
|
||||
#define XK_underbar 0x0bc6 /*(U+005F LOW LINE) */
|
||||
#define XK_jot 0x0bca /* U+2218 RING OPERATOR */
|
||||
#define XK_quad 0x0bcc /* U+2395 APL FUNCTIONAL SYMBOL QUAD */
|
||||
#define XK_uptack 0x0bce /* U+22A5 UP TACK */
|
||||
#define XK_circle 0x0bcf /* U+25CB WHITE CIRCLE */
|
||||
#define XK_upstile 0x0bd3 /* U+2308 LEFT CEILING */
|
||||
#define XK_downshoe 0x0bd6 /*(U+222A UNION)*/
|
||||
#define XK_rightshoe 0x0bd8 /*(U+2283 SUPERSET OF)*/
|
||||
#define XK_leftshoe 0x0bda /*(U+2282 SUBSET OF)*/
|
||||
#define XK_downshoe 0x0bd6 /*(U+222A UNION) */
|
||||
#define XK_rightshoe 0x0bd8 /*(U+2283 SUPERSET OF) */
|
||||
#define XK_leftshoe 0x0bda /*(U+2282 SUBSET OF) */
|
||||
#define XK_lefttack 0x0bdc /* U+22A3 LEFT TACK */
|
||||
#define XK_righttack 0x0bfc /* U+22A2 RIGHT TACK */
|
||||
#endif /* XK_APL */
|
||||
|
|
@ -1794,7 +1794,7 @@ SOFTWARE.
|
|||
#define XK_Hangul_J_YeorinHieuh 0x0efa
|
||||
|
||||
/* Korean currency symbol */
|
||||
#define XK_Korean_Won 0x0eff /*(U+20A9 WON SIGN)*/
|
||||
#define XK_Korean_Won 0x0eff /*(U+20A9 WON SIGN) */
|
||||
|
||||
#endif /* XK_KOREAN */
|
||||
|
||||
|
|
@ -2467,8 +2467,8 @@ SOFTWARE.
|
|||
#define XK_Sinh_e2 0x1000dd9 /* U+0DD9 SINHALA KOMBUVA */
|
||||
#define XK_Sinh_ee2 0x1000dda /* U+0DDA SINHALA DIGA KOMBUVA */
|
||||
#define XK_Sinh_ai2 0x1000ddb /* U+0DDB SINHALA KOMBU DEKA */
|
||||
#define XK_Sinh_o2 0x1000ddc /* U+0DDC SINHALA KOMBUVA HAA AELA-PILLA*/
|
||||
#define XK_Sinh_oo2 0x1000ddd /* U+0DDD SINHALA KOMBUVA HAA DIGA AELA-PILLA*/
|
||||
#define XK_Sinh_o2 0x1000ddc /* U+0DDC SINHALA KOMBUVA HAA AELA-PILLA */
|
||||
#define XK_Sinh_oo2 0x1000ddd /* U+0DDD SINHALA KOMBUVA HAA DIGA AELA-PILLA */
|
||||
#define XK_Sinh_au2 0x1000dde /* U+0DDE SINHALA KOMBUVA HAA GAYANUKITTA */
|
||||
#define XK_Sinh_lu2 0x1000ddf /* U+0DDF SINHALA GAYANUKITTA */
|
||||
#define XK_Sinh_ruu2 0x1000df2 /* U+0DF2 SINHALA DIGA GAETTA-PILLA */
|
||||
|
|
|
|||
|
|
@ -36,40 +36,40 @@
|
|||
#include "string.h"
|
||||
|
||||
|
||||
class PrintView : public BView
|
||||
class PrintView:public BView
|
||||
{
|
||||
public:
|
||||
PrintView( BBitmap *bitmap)
|
||||
: BView( bitmap->Bounds(), "TuxPaint Print", B_FOLLOW_NONE, B_WILL_DRAW)
|
||||
public:
|
||||
PrintView(BBitmap * bitmap):BView(bitmap->Bounds(), "TuxPaint Print", B_FOLLOW_NONE, B_WILL_DRAW)
|
||||
{
|
||||
b = bitmap;
|
||||
};
|
||||
|
||||
~PrintView()
|
||||
{
|
||||
delete b;
|
||||
};
|
||||
void Draw( BRect updateRect)
|
||||
void Draw(BRect updateRect)
|
||||
{
|
||||
DrawBitmap( b);
|
||||
DrawBitmap(b);
|
||||
}
|
||||
private:
|
||||
BBitmap *b;
|
||||
private:
|
||||
BBitmap * b;
|
||||
};
|
||||
|
||||
|
||||
BBitmap *SurfaceToBBitmap( SDL_Surface *surf)
|
||||
BBitmap *SurfaceToBBitmap(SDL_Surface * surf)
|
||||
{
|
||||
BBitmap *bitmap = new BBitmap( BRect( 0, 0, surf->w, surf->h), B_RGBA32);
|
||||
BBitmap *bitmap = new BBitmap(BRect(0, 0, surf->w, surf->h), B_RGBA32);
|
||||
SDL_PixelFormat pixfmt;
|
||||
SDL_Surface *surf32;
|
||||
Uint8 *src,*dst;
|
||||
Uint8 *src, *dst;
|
||||
Uint32 linesize;
|
||||
int i;
|
||||
|
||||
memset( &pixfmt, 0, sizeof(pixfmt) );
|
||||
memset(&pixfmt, 0, sizeof(pixfmt));
|
||||
pixfmt.palette = NULL;
|
||||
pixfmt.BitsPerPixel = 32;
|
||||
pixfmt.BytesPerPixel= 4;
|
||||
pixfmt.BytesPerPixel = 4;
|
||||
pixfmt.Rmask = 0x00FF0000;
|
||||
pixfmt.Gmask = 0x0000FF00;
|
||||
pixfmt.Bmask = 0x000000FF;
|
||||
|
|
@ -85,68 +85,73 @@ BBitmap *SurfaceToBBitmap( SDL_Surface *surf)
|
|||
pixfmt.colorkey = 0;
|
||||
pixfmt.alpha = 0;
|
||||
|
||||
surf32 = SDL_ConvertSurface( surf, &pixfmt, SDL_SWSURFACE );
|
||||
surf32 = SDL_ConvertSurface(surf, &pixfmt, SDL_SWSURFACE);
|
||||
|
||||
linesize = surf32->w*sizeof(Uint32);
|
||||
dst = (Uint8*)bitmap->Bits();
|
||||
src = (Uint8*)surf32->pixels;
|
||||
for ( i = 0; i < surf32->h; i++ )
|
||||
linesize = surf32->w * sizeof(Uint32);
|
||||
dst = (Uint8 *) bitmap->Bits();
|
||||
src = (Uint8 *) surf32->pixels;
|
||||
for (i = 0; i < surf32->h; i++)
|
||||
{
|
||||
memcpy( dst, src, linesize );
|
||||
src += surf32->pitch-4;
|
||||
memcpy(dst, src, linesize);
|
||||
src += surf32->pitch - 4;
|
||||
dst += linesize;
|
||||
}
|
||||
|
||||
SDL_FreeSurface( surf32 ); /* Free temp surface */
|
||||
SDL_FreeSurface(surf32); /* Free temp surface */
|
||||
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
|
||||
int IsPrinterAvailable( void )
|
||||
int IsPrinterAvailable(void)
|
||||
{
|
||||
// this code is a little hack, i don't like such hardcoded things
|
||||
// but i have no choice ;]
|
||||
DIR *d;
|
||||
struct dirent *f = NULL;
|
||||
int num_files = 0;
|
||||
|
||||
d = opendir("/boot/home/config/settings/printers");
|
||||
if( d != NULL)
|
||||
if (d != NULL)
|
||||
{
|
||||
while( (f = readdir(d)) != NULL)
|
||||
while ((f = readdir(d)) != NULL)
|
||||
num_files++;
|
||||
closedir( d);
|
||||
if( num_files > 2)
|
||||
closedir(d);
|
||||
if (num_files > 2)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int SurfacePrint( SDL_Surface *surf )
|
||||
int SurfacePrint(SDL_Surface * surf)
|
||||
{
|
||||
BWindow *window = new BWindow( BRect( 0, 0, surf->w, surf->h), "TuxPaint Print", B_NO_BORDER_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, B_NOT_MOVABLE | B_NOT_CLOSABLE | B_NOT_ZOOMABLE | B_NOT_RESIZABLE | B_AVOID_FRONT | B_AVOID_FOCUS);
|
||||
PrintView *view = new PrintView( SurfaceToBBitmap( surf));
|
||||
BWindow *window =
|
||||
new BWindow(BRect(0, 0, surf->w, surf->h), "TuxPaint Print", B_NO_BORDER_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
|
||||
B_NOT_MOVABLE | B_NOT_CLOSABLE | B_NOT_ZOOMABLE | B_NOT_RESIZABLE | B_AVOID_FRONT | B_AVOID_FOCUS);
|
||||
PrintView *view = new PrintView(SurfaceToBBitmap(surf));
|
||||
|
||||
window->AddChild(view);
|
||||
window->Run();
|
||||
|
||||
BPrintJob job("TuxPaint");
|
||||
if( job.ConfigPage() == B_OK)
|
||||
|
||||
if (job.ConfigPage() == B_OK)
|
||||
{
|
||||
if( job.ConfigJob() == B_OK)
|
||||
if (job.ConfigJob() == B_OK)
|
||||
{
|
||||
job.BeginJob();
|
||||
if( job.CanContinue())
|
||||
if (job.CanContinue())
|
||||
{
|
||||
job.DrawView(view, BRect( 0, 0, surf->w, surf->h), BPoint( 0, 0));
|
||||
job.DrawView(view, BRect(0, 0, surf->w, surf->h), BPoint(0, 0));
|
||||
job.SpoolPage();
|
||||
}
|
||||
if( job.CanContinue())
|
||||
if (job.CanContinue())
|
||||
job.CommitJob();
|
||||
}
|
||||
}
|
||||
|
||||
BMessenger( window).SendMessage( B_QUIT_REQUESTED);
|
||||
BMessenger(window).SendMessage(B_QUIT_REQUESTED);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@
|
|||
#define DEBUG_PRINTF(...)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#include <android/log.h>
|
||||
#define LOG_TAG "TuxPaint"
|
||||
|
|
|
|||
|
|
@ -1003,7 +1003,9 @@ static void mysetenv(const char *name, const char *value)
|
|||
* @param loc Locale
|
||||
* @return The Y-nudge value for font rendering in the language.
|
||||
*/
|
||||
/* *INDENT-OFF* */
|
||||
static int set_current_language(const char *restrict locale_choice) MUST_CHECK;
|
||||
/* *INDENT-ON* */
|
||||
|
||||
static int set_current_language(const char *restrict loc)
|
||||
{
|
||||
|
|
|
|||
32
src/macos.c
32
src/macos.c
|
|
@ -12,17 +12,20 @@
|
|||
/**
|
||||
* FIXME
|
||||
*/
|
||||
const char* macos_fontsPath()
|
||||
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);
|
||||
|
||||
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;
|
||||
|
|
@ -32,17 +35,20 @@ const char* macos_fontsPath()
|
|||
/**
|
||||
* FIXME
|
||||
*/
|
||||
const char* macos_preferencesPath()
|
||||
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);
|
||||
|
||||
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;
|
||||
|
|
@ -52,7 +58,7 @@ const char* macos_preferencesPath()
|
|||
/**
|
||||
* FIXME
|
||||
*/
|
||||
const char* macos_globalPreferencesPath()
|
||||
const char *macos_globalPreferencesPath()
|
||||
{
|
||||
return MACOS_GLOBAL_PREFERENCES_PATH;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
#ifndef __MACOS_H__
|
||||
#define __MACOS_H__
|
||||
|
||||
const char* macos_fontsPath();
|
||||
const char* macos_preferencesPath();
|
||||
const char* macos_globalPreferencesPath();
|
||||
const char *macos_fontsPath();
|
||||
const char *macos_preferencesPath();
|
||||
const char *macos_globalPreferencesPath();
|
||||
|
||||
|
||||
#endif /* __MACOS_H__ */
|
||||
|
|
|
|||
|
|
@ -55,7 +55,8 @@ 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]);
|
||||
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))
|
||||
|
|
@ -96,7 +97,7 @@ void playsound(SDL_Surface * screen, int chan, int s, int override, int x, int y
|
|||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("Panning of sound #%d in channel %d, left=%d, right=%d\n", s, chan, left, (255-dist)-left);
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -306,8 +306,10 @@ int do_ps_save(FILE * fi,
|
|||
child_pid = pclose(fi);
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("pclose returned %d\n", child_pid); fflush(stdout);
|
||||
printf("errno = %d\n", errno); fflush(stdout);
|
||||
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))
|
||||
|
|
@ -324,14 +326,25 @@ int do_ps_save(FILE * fi,
|
|||
w = waitpid(child_pid, &status, 0);
|
||||
|
||||
#ifdef DEBUG
|
||||
if (w == -1) { perror("waitpid"); exit(EXIT_FAILURE); }
|
||||
if (WIFEXITED(status)) {
|
||||
if (w == -1)
|
||||
{
|
||||
perror("waitpid");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (WIFEXITED(status))
|
||||
{
|
||||
printf("exited, status=%d\n", WEXITSTATUS(status));
|
||||
} else if (WIFSIGNALED(status)) {
|
||||
}
|
||||
else if (WIFSIGNALED(status))
|
||||
{
|
||||
printf("killed by signal %d\n", WTERMSIG(status));
|
||||
} else if (WIFSTOPPED(status)) {
|
||||
}
|
||||
else if (WIFSTOPPED(status))
|
||||
{
|
||||
printf("stopped by signal %d\n", WSTOPSIG(status));
|
||||
} else if (WIFCONTINUED(status)) {
|
||||
}
|
||||
else if (WIFCONTINUED(status))
|
||||
{
|
||||
printf("continued\n");
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
106
src/tuxpaint.c
106
src/tuxpaint.c
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
Tux Paint - A simple drawing program for children.
|
||||
|
||||
Copyright (c) 2002-2018
|
||||
Copyright (c) 2002-2019
|
||||
by various contributors; see AUTHORS.txt
|
||||
http://www.tuxpaint.org/
|
||||
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
June 14, 2002 - December 18, 2018
|
||||
June 14, 2002 - April 3, 2019
|
||||
*/
|
||||
|
||||
|
||||
|
|
@ -38,6 +38,8 @@
|
|||
|
||||
/* Color depth for Tux Paint to run in, and store canvases in: */
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
|
||||
#if defined(NOKIA_770)
|
||||
#define VIDEO_BPP 16
|
||||
#endif
|
||||
|
|
@ -50,19 +52,16 @@
|
|||
/*# define VIDEO_BPP 15 *//* saves memory */
|
||||
/*# define VIDEO_BPP 16 *//* causes discoloration */
|
||||
/*# define VIDEO_BPP 24 *//* compromise */
|
||||
#define VIDEO_BPP 32 /* might be fastest, if conversion funcs removed */
|
||||
#define VIDEO_BPP 32 /* might be fastest, if conversion funcs removed */
|
||||
#endif
|
||||
|
||||
|
||||
/* #define CORNER_SHAPES *//* need major work! */
|
||||
|
||||
/* #define CORNER_SHAPES *//* need major work! */
|
||||
|
||||
/* Method for printing images: */
|
||||
|
||||
#define PRINTMETHOD_PS /* Direct to PostScript */
|
||||
/*#define PRINTMETHOD_PNM_PS *//* Output PNM, assuming it gets printed */
|
||||
/*#define PRINTMETHOD_PNG_PNM_PS *//* Output PNG, assuming it gets printed */
|
||||
|
||||
/*#define PRINTMETHOD_PNM_PS *//* Output PNM, assuming it gets printed */
|
||||
/*#define PRINTMETHOD_PNG_PNM_PS *//* Output PNG, assuming it gets printed */
|
||||
|
||||
#define MAX_PATH 256
|
||||
|
||||
|
|
@ -111,6 +110,8 @@
|
|||
#define TPAINT_AMASK 0x000000ff
|
||||
#endif
|
||||
|
||||
/* *INDENT-ON* */
|
||||
|
||||
static unsigned draw_colors(unsigned action);
|
||||
|
||||
|
||||
|
|
@ -579,7 +580,9 @@ static void mtw(wchar_t * wtok, char *tok)
|
|||
int TP_EventFilter(void *data, const SDL_Event * event);
|
||||
|
||||
|
||||
/* #define fmemopen_alternative *//* Uncomment this to test the fmemopen alternative in systems were fmemopen exists */
|
||||
/* *INDENT-OFF* */
|
||||
/* #define fmemopen_alternative *//* Uncomment this to test the fmemopen alternative in systems were fmemopen exists */
|
||||
/* *INDENT-ON* */
|
||||
|
||||
#if defined (WIN32) || defined (__APPLE__) || defined(__NetBSD__) || defined(__sun) || defined(__ANDROID__) /* MINGW/MSYS, NetBSD, and MacOSX need it, at least for now */
|
||||
#define fmemopen_alternative
|
||||
|
|
@ -707,7 +710,10 @@ typedef struct
|
|||
Uint8 rows, cols;
|
||||
} grid_dims;
|
||||
|
||||
/* static SDL_Rect r_screen; *//* was 640x480 @ 0,0 -- but this isn't so useful */
|
||||
/* *INDENT-OFF* */
|
||||
/* static SDL_Rect r_screen; *//* was 640x480 @ 0,0 -- but this isn't so useful */
|
||||
/* *INDENT-ON* */
|
||||
|
||||
static SDL_Rect r_canvas; /* was 448x376 @ 96,0 */
|
||||
static SDL_Rect r_tools; /* was 96x336 @ 0,40 */
|
||||
static SDL_Rect r_sfx;
|
||||
|
|
@ -734,7 +740,9 @@ static grid_dims gd_tools; /* was 2x7 */
|
|||
static grid_dims gd_sfx;
|
||||
static grid_dims gd_toolopt; /* was 2x7 */
|
||||
|
||||
/* static grid_dims gd_open; *//* was 4x4 */
|
||||
/* *INDENT-OFF* */
|
||||
/* static grid_dims gd_open; *//* was 4x4 */
|
||||
/* *INDENT-ON* */
|
||||
static grid_dims gd_colors; /* was 17x1 */
|
||||
|
||||
#define HEIGHTOFFSET (((WINDOW_HEIGHT - 480) / 48) * 48)
|
||||
|
|
@ -1287,6 +1295,7 @@ static int disable_save;
|
|||
static int ok_to_use_lockfile = 1;
|
||||
static int start_blank;
|
||||
static int autosave_on_quit;
|
||||
static int no_prompt_on_quit = 0;
|
||||
|
||||
static int dont_do_xor;
|
||||
static int dont_load_stamps;
|
||||
|
|
@ -2060,7 +2069,8 @@ static void get_new_file_id(void);
|
|||
static int do_quit(int tool);
|
||||
static int do_open(void);
|
||||
static int do_new_dialog(void);
|
||||
static int do_new_dialog_add_colors(SDL_Surface * * thumbs, int num_files, int * d_places, char * * d_names, char * * d_exts, int * white_in_palette);
|
||||
static int do_new_dialog_add_colors(SDL_Surface * *thumbs, int num_files, int *d_places, char * *d_names,
|
||||
char * *d_exts, int *white_in_palette);
|
||||
static int do_color_picker(void);
|
||||
static int do_color_sel(void);
|
||||
static int do_slideshow(void);
|
||||
|
|
@ -6672,6 +6682,7 @@ void show_usage(int exitcode)
|
|||
{
|
||||
FILE *f = exitcode ? stderr : stdout;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
fprintf(f,
|
||||
"\n"
|
||||
"Usage: %s {--usage | --help | --version | --verbose-version | --copying}\n"
|
||||
|
|
@ -6757,6 +6768,7 @@ void show_usage(int exitcode)
|
|||
/* FIXME: "--joystick-btn-help" to list available commands, like "--lang help" */
|
||||
"\n",
|
||||
progname);
|
||||
/* *INDENT-ON* */
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -7822,7 +7834,8 @@ static void loadstamp_callback(SDL_Surface * screen,
|
|||
* Showing the progress bar across the screen can be CPU-intensive, so
|
||||
* update infrequently.
|
||||
*/
|
||||
if((i % 32) == 0) show_progress_bar(screen);
|
||||
if ((i % 32) == 0)
|
||||
show_progress_bar(screen);
|
||||
|
||||
if (dotext > files[i].str && !strcasecmp(dotext, ext)
|
||||
&& (dotext - files[i].str + 1 + dirlen < (int)(sizeof fname))
|
||||
|
|
@ -8019,13 +8032,23 @@ 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;
|
||||
// It is not legal to call printf or most other functions here!
|
||||
if (sig == SIGUSR1 || sig == SIGUSR2)
|
||||
{
|
||||
autosave_on_quit = 1;
|
||||
no_prompt_on_quit = 1;
|
||||
if (sig == SIGUSR1)
|
||||
{
|
||||
promptless_save = SAVE_OVER_NO;
|
||||
}
|
||||
else
|
||||
{
|
||||
promptless_save = SAVE_OVER_ALWAYS;
|
||||
}
|
||||
raise(SIGTERM);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -12218,11 +12241,13 @@ static int do_prompt_image_flash_snd(const char *const text,
|
|||
int valhat_x, valhat_y, hatmotioner;
|
||||
|
||||
#ifdef DEBUG
|
||||
if(snd >= 0) {
|
||||
if (snd >= 0)
|
||||
{
|
||||
printf("Prompt and play sound #%d: %s\n", snd, sound_fnames[snd]);
|
||||
fflush(stdout);
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
printf("Prompt without sound\n");
|
||||
fflush(stdout);
|
||||
}
|
||||
|
|
@ -13939,12 +13964,11 @@ static void do_png_embed_data(png_structp png_ptr)
|
|||
for (x = 0; x < current_node->save_width; x++)
|
||||
for (y = 0; y < current_node->save_height; y++)
|
||||
{
|
||||
pix =
|
||||
getpixels[current_node->label_node_surface->format->BytesPerPixel] (current_node->
|
||||
label_node_surface, x, y);
|
||||
/* *INDENT-OFF* */
|
||||
pix = getpixels[current_node->label_node_surface->format->BytesPerPixel](current_node->label_node_surface, x, y);
|
||||
/* *INDENT-ON* */
|
||||
SDL_GetRGBA(pix, current_label_node->label_node_surface->format, &r, &g, &b, &a);
|
||||
fwrite(&a, alpha_size, 1, lfi);
|
||||
|
||||
}
|
||||
SDL_UnlockSurface(current_node->label_node_surface);
|
||||
fprintf(lfi, "\n\n");
|
||||
|
|
@ -14179,9 +14203,16 @@ static int do_quit(int tool)
|
|||
{
|
||||
int done, tmp_tool;
|
||||
|
||||
if (!no_prompt_on_quit)
|
||||
{
|
||||
done = do_prompt_snd(PROMPT_QUIT_TXT,
|
||||
PROMPT_QUIT_YES, PROMPT_QUIT_NO, SND_AREYOUSURE,
|
||||
(TOOL_QUIT % 2) * 48 + 24, (TOOL_QUIT / 2) * 48 + 40 + 24);
|
||||
}
|
||||
else
|
||||
{
|
||||
done = 1;
|
||||
}
|
||||
|
||||
if (done && !been_saved && !disable_save)
|
||||
{
|
||||
|
|
@ -19017,7 +19048,7 @@ static int do_new_dialog(void)
|
|||
int last_click_which, last_click_button;
|
||||
int places_to_look;
|
||||
int tot;
|
||||
int first_starter, first_template;
|
||||
int first_color, first_starter, first_template;
|
||||
int white_in_palette;
|
||||
int val_x, val_y, motioner;
|
||||
int valhat_x, valhat_y, hatmotioner;
|
||||
|
|
@ -19159,7 +19190,9 @@ static int do_new_dialog(void)
|
|||
|
||||
white_in_palette = -1;
|
||||
|
||||
if (!new_colors_last) {
|
||||
if (!new_colors_last)
|
||||
{
|
||||
first_color = 0;
|
||||
num_files = do_new_dialog_add_colors(thumbs, num_files, d_places, d_names, d_exts, &white_in_palette);
|
||||
}
|
||||
|
||||
|
|
@ -19466,7 +19499,9 @@ static int do_new_dialog(void)
|
|||
|
||||
/* Throw the color palette at the end (alternative option): */
|
||||
|
||||
if (new_colors_last) {
|
||||
if (new_colors_last)
|
||||
{
|
||||
first_color = num_files;
|
||||
num_files = do_new_dialog_add_colors(thumbs, num_files, d_places, d_names, d_exts, &white_in_palette);
|
||||
}
|
||||
|
||||
|
|
@ -19474,6 +19509,8 @@ static int do_new_dialog(void)
|
|||
#ifdef DEBUG
|
||||
printf("%d files and colors were found!\n", num_files);
|
||||
#endif
|
||||
printf("first_color = %d\nfirst_starter = %d\nfirst_template = %d\nnum_files = %d\n\n", first_color, first_starter,
|
||||
first_template, num_files);
|
||||
|
||||
|
||||
/* Let user choose a color or image: */
|
||||
|
|
@ -19931,7 +19968,8 @@ static int do_new_dialog(void)
|
|||
label_node_to_edit = NULL;
|
||||
have_to_rec_label_node = FALSE;
|
||||
|
||||
if (which >= first_starter && (first_template == -1 || which < first_template))
|
||||
if (which >= first_starter && (first_template == -1 || which < first_template)
|
||||
&& (!new_colors_last || which < first_color))
|
||||
{
|
||||
/* Load a starter: */
|
||||
|
||||
|
|
@ -19990,7 +20028,7 @@ static int do_new_dialog(void)
|
|||
SDL_BlitSurface(img_starter, NULL, canvas, NULL);
|
||||
}
|
||||
}
|
||||
else if (first_template != -1 && which >= first_template)
|
||||
else if (first_template != -1 && which >= first_template && (!new_colors_last || which < first_color))
|
||||
{
|
||||
/* Load a template: */
|
||||
|
||||
|
|
@ -20055,6 +20093,8 @@ static int do_new_dialog(void)
|
|||
starter_personal = 0;
|
||||
starter_modified = 0;
|
||||
|
||||
which = which - first_color;
|
||||
|
||||
/* Launch color picker if they chose that: */
|
||||
|
||||
if (which == NUM_COLORS - 1)
|
||||
|
|
@ -20134,7 +20174,9 @@ static int do_new_dialog(void)
|
|||
normally appears at the beginning (above Starts & Templates),
|
||||
but may be placed at the end with the "--newcolorslast" option.
|
||||
*/
|
||||
static int do_new_dialog_add_colors(SDL_Surface * * thumbs, int num_files, int * d_places, char * * d_names, char * * d_exts, int * white_in_palette) {
|
||||
static int do_new_dialog_add_colors(SDL_Surface * *thumbs, int num_files, int *d_places, char * *d_names,
|
||||
char * *d_exts, int *white_in_palette)
|
||||
{
|
||||
int j;
|
||||
int added;
|
||||
Uint8 r, g, b;
|
||||
|
|
@ -24835,6 +24877,10 @@ static void setup(void)
|
|||
instead of 'Ok') */
|
||||
|
||||
signal(SIGPIPE, signal_handler);
|
||||
|
||||
/* Set up signal for no-questions-asked remote closing of app */
|
||||
signal(SIGUSR1, signal_handler);
|
||||
signal(SIGUSR2, signal_handler);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,11 +42,12 @@
|
|||
* @param pSpec Path of directory to open
|
||||
* @return Opened directory, or NULL on failure
|
||||
*/
|
||||
DIR * opendir(const char *pSpec)
|
||||
DIR *opendir(const char *pSpec)
|
||||
{
|
||||
char pathname[MAX_PATH + 2];
|
||||
|
||||
DIR * pDir = calloc(1, sizeof(DIR));
|
||||
DIR *pDir = calloc(1, sizeof(DIR));
|
||||
|
||||
if (!pDir)
|
||||
return NULL;
|
||||
strcpy(pathname, pSpec);
|
||||
|
|
@ -146,7 +147,7 @@ static int addToList(int i, struct dirent ***namelist, struct dirent *entry)
|
|||
*/
|
||||
int scandir(const char *dir, struct dirent ***namelist, selectCB select, comparCB compar)
|
||||
{
|
||||
DIR * pDir;
|
||||
DIR *pDir;
|
||||
int count;
|
||||
struct dirent *entry;
|
||||
|
||||
|
|
|
|||
|
|
@ -72,5 +72,3 @@ typedef int (*selectCB) (const struct dirent *);
|
|||
typedef int (*comparCB) (const void *, const void *);
|
||||
extern int alphasort(const void *a, const void *b);
|
||||
extern int scandir(const char *dir, struct dirent ***namelist, selectCB select, comparCB compar);
|
||||
|
||||
|
||||
|
|
|
|||
1
win32/.indent.pro
vendored
Symbolic link
1
win32/.indent.pro
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../src/.indent.pro
|
||||
Loading…
Add table
Add a link
Reference in a new issue