Commit graph

1420 commits

Author SHA1 Message Date
dolphin6k
46dd77fdb5 Reverted to mtw(). (MultiByteToWideChar() was not safe for the labels on other versions of Windows.) 2021-11-06 01:00:18 +09:00
dolphin6k
1efedfa191 Windows Recycle Bin support seems to be stable. / Replaced mtw() with MultiByteToWideChar(). 2021-11-06 00:29:10 +09:00
dolphin6k
5c669730a9 Re-defined iswprint() using GetStringTypeW on windows. 2021-11-05 16:55:23 +09:00
Bill Kendrick
0a529cea96 Avoid crashing on config file lines lacking =
Instead, emit a warning to stdout (though really we may want to
exit cleanly, like parse.gperf does when coming across an
unrecognized option).
2021-11-04 21:30:07 -07:00
dolphin6k
7c8f6bca80 Addressed warnings when compiling on MinGW/MSYS
Following warnings still remain so far.

src/tuxpaint.c:199:2: warning: #warning "Attempting to define strcasestr(); if errors, build with -DHAVE_STRCASESTR" [-Wcpp]
  199 | #warning "Attempting to define strcasestr(); if errors, build with -DHAVE_STRCASESTR"
      |  ^~~~~~~

src/parse.gperf: In function 'parse_one_option':
src/parse.gperf:306:45: warning: argument to 'sizeof' in 'memcpy' call is the same pointer type 'char *' as the destination; expected 'char' or an explicit length [-Wsizeof-pointer-memaccess]
  306 |   memcpy(offset+(char*)tmpcfg, &opt, sizeof(char*)); /* FIXME: This causes a warning; should it be 'sizeof(char)', or do we need to have the warning suppressed? -bjk 2021.10.14 */
      |                                             ^~~~

src/dirwalk.c: In function 'tp_ftw':
src/dirwalk.c:348:2: warning: #warning Failed to see DT_UNKNOWN [-Wcpp]
  348 | #warning Failed to see DT_UNKNOWN
      |  ^~~~~~~

src/get_fname.c: In function 'get_fname':
src/get_fname.c💯3: warning: 'dir' may be used uninitialized in this function [-Wmaybe-uninitialized]
  100 |   snprintf(f, sizeof(f),
      |   ^~~~~~~~~~~~~~~~~~~~~~
  101 |            "%s%c%s",
      |            ~~~~~~~~~
  102 |     dir, (*name) ? '/' : '\0', /* Some mkdir()'s don't like trailing slashes */
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  103 |     name);
      |     ~~~~~

magic/src/cartoon.c:178:99: warning: unused parameter 'last' [-Wunused-parameter]
  178 | static void do_cartoon(void *ptr, int which ATTRIBUTE_UNUSED, SDL_Surface * canvas, SDL_Surface * last, int x, int y)
      |                                                                                     ~~~~~~~~~~~~~~^~~~
2021-11-05 12:23:09 +09:00
Bill Kendrick
19db5e1b4a Avoid compile-time warnings re: wchar_t comparison
When assembling UTF-8 in render_text_w() (to send to SDL_Pango),
we assumed `wchar_t` could encompass the entirety of Unicode
(up to U+10FFFF); however, on Windows `wchar_t` is only 16-bits,
meaning the test for characters <= U+FFFF was always true.

This reworks the if/elseif/else block, via some "#ifndef WIN32"
tests, to avoid this warning.

In the end, we need to replace our internal use of `wchar_t`
with something 32-bit, to allow for higher Unicode code points
(e.g., to support Emoji via the Text and Label tools).

Additonally, some work will need to be done to ensure that
text stored as Labels within saved Tux Paint images (PNGs) continued
to work correctly, and could be traded between platforms.
(Untested, but right now I assume a picture drawn on Linux where
`wchar_t` is 32-bit would break if you attempt to load it on Windows,
and possibly vice-versa?)

See https://sourceforge.net/p/tuxpaint/feature-requests/210/
2021-11-03 22:16:24 -07:00
Bill Kendrick
f46df76736 Clean up comment formatting re: UTF-8 stuff 2021-11-03 21:28:03 -07:00
dolphin6k
6145fb8bc2 Addressed some compile time warnings. 2021-11-03 22:04:24 +09:00
dolphin6k
2a6b55e3c2 "Move to recycle bin" for Windows is now ready for the tests. 2021-10-31 17:18:16 +09:00
dolphin6k
b667aa7d79 win32_trash() is still quite unstable. 2021-10-31 02:34:24 +09:00
Bill Kendrick
022e7cd4eb Remove FIXME re: Windows trash support
...since Shin-ichi is adding it :)
2021-10-29 16:25:09 -07:00
dolphin6k
8d23668589 UNLINK_ONLY macro to work correctly for windows. 2021-10-30 07:34:30 +09:00
dolphin6k
87ed5bc991 tweak for win32_trash() 2021-10-29 23:37:19 +09:00
dolphin6k
61ce0798d9 Initial implimentation of win32_trash() 2021-10-28 22:47:32 +09:00
Bill Kendrick
2e231b5adc switchout/switchin when changing Magic groups
Also, doc'ing Cartoon full-image mode
2021-10-27 22:56:29 -07:00
Bill Kendrick
af1bd0850e Lines/Shapes: Display angles in Tux tip text
When drawing lines or rotating a shape, the angle of rotation
is shown (in the instructions at the bottom).
2021-10-25 23:23:28 -07:00
Pere Pujal i Carabantes
e6cd8d7b30 Input Method working again in the sdl2.0 branch. 2021-10-24 12:12:53 +02:00
Pere Pujal i Carabantes
9cf77f684c Merge branch 'master' into sdl2.0
There are problems with im that should be investigated...
2021-10-24 11:47:54 +02:00
Bill Kendrick
80150c30a5 Further work to remove compiler warnings 2021-10-24 00:44:53 -07:00
Bill Kendrick
ccb061144a Remove redundant cur_tool == TOOL_FILL test
h/t dcb ("dcb314" on SourceForge)
Closes https://sourceforge.net/p/tuxpaint/bugs/237/
2021-10-20 22:49:49 -07:00
Bill Kendrick
71da1f1a6a Mend swapped args to draw_brush_fill() 2021-10-19 00:31:01 -07:00
Bill Kendrick
dcdebe9882 New Fill tool mode: Brush
Similar to solid fill (classic mode), but allows freehand
filling of an area.

Closes https://sourceforge.net/p/tuxpaint/feature-requests/207/
2021-10-19 00:26:26 -07:00
dolphin6k
d7f0a47e37 Missing format specifier and wrong maximum length for swprintf(). 2021-10-17 21:08:39 +09:00
dolphin6k
90baae6dfe Fixed crash bug regarding onscreen_keyboard and labels.
Every version after when onscreen-keyboard implimented has this bug,
which first became apparent in Windows 10. (Because of more strict
memory handling or something?)
Recommend every windows user to upgrade to 0.9.26-5.
2021-10-17 08:43:44 +09:00
dolphin6k
20bd72e75c Also removed old windows specific code mtw() from tuxpaint.c 2021-10-10 17:50:18 +09:00
Pere Pujal i Carabantes
16f56ae9cd SDL2 also for Windows, by TOYAMA Shin-ichi 2021-09-29 20:25:56 +02:00
Pere Pujal i Carabantes
6891266eee SDL(2)_gfxBlitRGBA() is not available in the SDL2_gfx library. 2021-09-28 00:59:01 +02:00
Pere Pujal i Carabantes
b6b0636eb5 Merge branch 'master' into sdl2.0 2021-09-27 23:32:48 +02:00
Bill Kendrick
d248b7041a Avoid crashing if Magic returns NULL icon img
Was blindly calling thumbnail() on what came back
(which would be NULL if the image failed to load).

Also, mend bug where magic group arrays were being cleared
at the same time as stamp group ones; the latter is larger.
2021-09-25 23:48:45 -07:00
Bill Kendrick
786dbed777 Magic group change: mend problem w/ color options 2021-09-23 00:39:15 -07:00
Bill Kendrick
e3d1f85ac9 Magic tool pagination now possible 2021-09-23 00:15:27 -07:00
Bill Kendrick
901230c710 Storing Magic tools within groups
Still a WIP; no way to paginate yet.  (So now, only able to
access group #0 (MAGIC_TYPE_DISTORTS) magic tools)
2021-09-23 00:00:31 -07:00
Bill Kendrick
3963d74f43 Show Magic tool group pagination buttons
Make room for them, but they don't do anything yet.
2021-09-20 23:36:19 -07:00
Bill Kendrick
3eece8635c WIP Working on Magic tool grouping
Fretwork is in one group; Blocks, Chalk, and Drip in another.
The rest do not currently report (so will not load!).
No UI change to the Magic tool interface yet.
2021-09-20 23:09:33 -07:00
Bill Kendrick
f1e297260a Mend undo buffer surface dimensions bug
Undo buffer canvases were not always the same dimensions
as the drawing surface, if buttonsize was adjusted.
(Adversely affected "Shift" magic tool.)
2021-09-20 22:05:33 -07:00
Bill Kendrick
3487236f93 Animated brushes can rotate now
Takes advantage of SDL_gfxBlitRGBA(), also from SDL_gfx.
2021-09-08 00:53:47 -07:00
Pere Pujal i Carabantes
10baa371dd September 8th
Merge branch 'master' into sdl2.0
Many changes and improvements by Bill
2021-09-08 00:10:35 +02:00
Bill Kendrick
a3080eef18 WIP Rotational brushes now supported
Unlike "directional" brushes, in which a 3x3 grid representing the
8 cardinal directions (45 degree steps) is used, only a single brush
image is required, and Tux Paint will rotate it between 0 and 360 degrees,
depending on the direction the mouse is going.

The brush's ".dat" file should contain a line consisting of the word
"rotate".

Note: This adds a dependency on "SDL_gfx" library (Homepage:
https://www.ferzkopp.net/wordpress/2016/01/02/sdl_gfx-sdl2_gfx/
SourceForge project page: https://sourceforge.net/projects/sdlgfx/)
as this feature use it's "rotozoom" functionality.

WIP -- Doesn't handle animated brushes correctly yet!

Closes https://sourceforge.net/p/tuxpaint/feature-requests/122/
2021-09-06 23:45:35 -07:00
Bill Kendrick
8a97e83a7b Always show the appropriate tips for Fill/Shapes
Always show the appropriate instructions at the bottom when the
"Fill" (depends on which sub-tool chosen) and "Shapes" (depends
on whether "simpleshapes" option is set) tools are selected
(e.g., when returning from the "Open" dialog).

Closes https://sourceforge.net/p/tuxpaint/feature-requests/186/
2021-09-06 22:07:37 -07:00
Bill Kendrick
664cfe4c5a Randomly animated brushes didn't get their icon
Mended
2021-09-05 23:21:05 -07:00
Bill Kendrick
2ee0080ffd Icons denoting animated/directional on brushes
Closes https://sourceforge.net/p/tuxpaint/bugs/183/
2021-09-05 23:16:20 -07:00
Bill Kendrick
9c2fa458b8 Ensure command-line options covered more places
Ensured Tux Paint's built-in help ("tuxpaint --help"),
Unix manual ("man page"), and command-line option
tab-completion list all cover the full set of Tux Paint
options.  Some were missing in a few places.
2021-08-08 00:22:05 -07:00
Pere Pujal i Carabantes
4d27837af0 Fill crash solved and some translations Merge branch 'master' into sdl2.0 2021-05-09 18:02:11 +02:00
Pere Pujal i Carabantes
a4c22ad2e7 Make use of fill_tips strings and translations. 2021-05-07 21:41:48 +02:00
Pere Pujal i Carabantes
8c0bf052bf Changes in buttonsize, Merge branch 'master' into sdl2.0 2021-04-25 07:39:01 +02:00
Bill Kendrick
fa62a91d4f More info on buttonsize in CHANGES.txt
Also bump dates in CHANGES.txt and src/tuxpaint.c
2021-04-19 00:07:32 -07:00
Pere Pujal i Carabantes
fc8310ba03 Don't quit if the user asks for a too big button size, just run with the maximum supported button size. 2021-04-19 01:15:09 +02:00
Mark Kim
c46bd2ce51 stamps installer support for ios
stamps installer now works with ios.
2021-03-26 22:54:15 -04:00
Mark Kim
8e9362a550 stamps installer support for ios
stamps installer now works with ios.
2021-03-26 22:53:19 -04:00
Mark Kim
8db052c9d3 fix attempt to free non-freeable memory 2021-03-23 22:29:41 -04:00