Commit graph

3753 commits

Author SHA1 Message Date
Bill Kendrick
4ec43dcff2 Address fscanf eating space at beginning of Labels
When reading label text (on non-Windows, at least), fscanf("%lc")
was being used.  It seemed to be skipping the initial space,
causing strings to be shifted left one, and end up with garbage
bytes at the far right.

Fixes https://sourceforge.net/p/tuxpaint/bugs/247/ I hope!
2022-02-10 02:28:50 -08:00
Bill Kendrick
ce4b8b9040 POT/PO refresh after more work on Label tool 2022-02-10 01:02:39 -08:00
Bill Kendrick
5d064297d4 WIP: More work on Apply Label functionality
"Apply Label" mode of Label tool can be activated/deactivated,
though it doesn't currently do the work yet.

Also

* Modularized routine to select a Label (via click or [Enter] key):
   `select_label_node()`

 * Starting routine for applying a Label to the canvas
   (via click or [Enter] key): `apply_label_node()`

 * Modularized routine for repositioning the on-screen keyboard based on
   where we're typing: `reposition_onscreen_keyboard()`

Seems likely that I broke some things.
2022-02-10 01:01:40 -08:00
Bill Kendrick
e0922a14e1 WIP Apply label: Show apply label button 2022-02-09 23:25:46 -08:00
Bill Kendrick
d682044ce0 Commentary for text input handling routines
Also, sound effect when deleting a Label (select existing label (node),
[Backspace] to delete every character, then [Enter] or [Tab] to commit).
2022-02-09 22:58:54 -08:00
Bill Kendrick
f787cb0f75 WIP Label "apply" option
Starting work towards
https://sourceforge.net/p/tuxpaint/feature-requests/213/

The ability to 'apply' a label to the canvas, making it permanent
(as if added using the "Text" tool instead).

Removed unused "label rotate" option's code (and hence addressed
a bug we didn't relalize when choosing the "Label" tool while in
in "--nostampcontrols" mode; the unused "rotate" button would appear).
2022-02-09 22:41:13 -08:00
Bill Kendrick
b60a4ec4d1 Mend compile-time warnings in locale_to_closest_locale
Also, not currently used except for macOS, so wrapping in #ifdef
to avoid "defined but not used" warning.
2022-02-09 22:06:14 -08:00
dolphin6k
110cdeaa6a Documented stdout/stderr redirection for windows. 2022-02-10 12:29:37 +09:00
dolphin6k
d0699bdbc9 Redirect stdout and stderror to User's save directory. 2022-02-10 12:24:46 +09:00
dolphin6k
b71955c150 Use "<dynamic full path of current dir>\\locale" to bindtextdomain() only for the target "bdist-win32" 2022-02-09 23:12:12 +09:00
Bill Kendrick
e9fdbe9373 POT/PO update for brush tips
(Also catching a Label tool tip edit.)
2022-02-09 02:15:30 -08:00
Bill Kendrick
9f9a25f98a Brush tips - show when anim/rotate/dir, and spacing
Show tips when choosing brushes, to remind the user when they
are animated, and or rotational/directional.

Show tips when brush spacing is changed, specifying the approximate
spacing.  Output is fuzzy, to avoid being overly technical (e.g., it
will never say "2 345/1000 times as big as" or "1/103 the size of")
2022-02-09 02:12:40 -08:00
Bill Kendrick
5330fea44c Doc'ing Label tool improvement in CHANGES.txt 2022-02-07 23:59:37 -08:00
Bill Kendrick
7313f269ac Show tips & play sound effects w/ Label selector
Closes https://sourceforge.net/p/tuxpaint/bugs/245/
2022-02-07 23:57:36 -08:00
dolphin6k
f1519a2a39 Better way to install dll files and .mo files for tpconf only for the target "bdist-win32" 2022-02-07 22:26:54 +09:00
Mark Kim
9994847ea3 small macOS cleanup
- Need to use __MACOS__ instead of __APPLE__ when #including "macos.h".
- Need to include "platform.h" for this to work.
2022-02-06 21:26:21 -05:00
Mark Kim
e1ecf80e26 Fix random crashes in Korean, Japanese, and some other languages
Occasionally running Tux Paint in Korean, Japanese, and possibly other
languages would cause Tux Paint to crash.  This commit fixes it.

This bug was previously mentioned as the possible cause of these
previously reported crashes, though they were determined to be
unrelated:

  https://sourceforge.net/p/tuxpaint/mailman/message/37364981/
  https://sourceforge.net/p/tuxpaint/mailman/message/37376574/

The cause of the crash turned out to be in the function that loads the
input method map (*.im).  Some languages that use more than one
keystroke to produce one unicode character use this mapfile to track, in
a state machine, what keys have been pressed and what unicode character
should be output.  This state machine's memory is increased dynamically
as needed when the input method map file is loaded.  There was a line of
code that references the old memory that could have moved by the memory
increase.  This line of code has been moved to prior to the memory
increase to avoid accessing memory that may have moved.
2022-02-06 21:02:06 -05:00
Mark Kim
c9e195549f macOS system language detection.
It appears the system language detection doesn't work on [some versions
of?] macOS.  Fixed.

Strangely, querying the Cocoa API for the system locale on a system in
US with the preferred language set to Korean produces the invalid locale
"ko-US" instead of the expected "ko-KR".  This behavior of returning the
language with a invalid region qualifier for the language appears to
happen only with languages where macOS does not have regional variants
(this issue does not seem to occur with Canadian English, en-CA, for
example.)  A fuzzy matching locale function has been added to handle
this issue.
2022-02-06 20:26:50 -05:00
Mark Kim
c2ab6d461c merge macos.c and macos.m, update ios.*
* Merged macos.c into macos.m.
* Updated ios.h and ios.c to be compatible with the macos.* changes.
* Renamed ios.c to ios.m.
2022-02-06 11:29:19 -05:00
Mark Kim
d697d3faca better korean translations 2022-02-06 11:21:01 -05:00
Mark Kim
ab2d76d0b9 Update some Korean translations 2022-02-06 08:23:20 -05:00
Bill Kendrick
e7d81ef63f Clean up some compile-time warnings/errors
Under Xcode with clang, Mark Kim was getting an error:

  src/tuxpaint.c:23125:44: error: use of undeclared identifier 'i'
                   SDL_MapRGB(img_color_btns[i]->format,
                                             ^

Oddly, I was not getting errors no matter what nonsense I put
in there (e.g., changing "->format" to "->formatXYZ"), under
"gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)"
2022-02-05 16:59:59 -08:00
Bill Kendrick
36968b0abf Doc'ing unset HOME bugfix for macOS
h/t Mark Kim

(Also, reorganized build stuff)
2022-02-05 16:47:29 -08:00
Bill Kendrick
4dbaa0b320 Doc'ing and POT-izing macOS menu translation
h/t Mark Kim (for https://sourceforge.net/p/tuxpaint/bugs/183/)
2022-02-05 16:42:02 -08:00
Mark Kim
7aa000b68a Tux Paint for macOS can localize menus (feature request #183)
Tux Paint for macOS can now localize the macOS menubar.  Translation
files (*.po) will be required for the actual translations to show.
2022-02-05 18:40:36 -05:00
Mark Kim
aa4c72d4ed macOS path handling is more robust
When looking up paths of fonts, preferences, etc., macOS searches two
places, the system paths and the user paths under $HOME.

This change handles rare scenario where HOME is not set.  If HOME is not
set, now the application just searches the system path twice instead of
searching the system path followed by going into an undefined behavior
(possibly segfault.)
2022-02-05 12:12:37 -05:00
dolphin6k
8ece611f8c Corrected Japanese translation for color mixer. 2022-02-04 17:08:20 +09:00
Bill Kendrick
ab01926c27 Oops, left some debug printf() in there 2022-02-03 23:03:02 -08:00
Bill Kendrick
5203c16d34 Forgot to gettext() color mixer tip text fmt str
Forgot to wrap the color mixer's tip text printf() format string
in gettext(), which caused the static part of the text
("Your color is...") to not be translated.  h/t to Shin-ichi for
pointing it out.
2022-02-03 22:42:19 -08:00
Bill Kendrick
00b2751cdd Doc'ing Japanese translation update
h/t Shin-ichi
2022-02-03 22:20:51 -08:00
dolphin6k
61d8f8cee0 Japanese translation for color mixer. 2022-02-04 11:15:47 +09:00
dolphin6k
4c42cf8daa Updated Japanese translation 2022-02-04 08:55:32 +09:00
Bill Kendrick
29a4094b6e Doc'ing some of Pere's contrib's to 0.9.28 so far 2022-02-03 01:46:29 -08:00
Bill Kendrick
5ee27b3bdb Denote when Bill made changes in CHANGES.txt 2022-02-03 01:39:38 -08:00
Bill Kendrick
89809983e8 Doc'ing Win32 bindtextdomain() change by Shin-ichi 2022-02-03 01:24:15 -08:00
dolphin6k
c965c2fad2 Pass the full path of locale directory to bindtextdomain().
Workaround to the issue that gettext() can not find translation files
after the update of MinGW/MSYS2 in January 2022.
2022-02-02 22:34:30 +09:00
Bill Kendrick
c106c61214 Syncing docs for new Tile Zoom magic tool 2022-01-30 02:27:32 -08:00
Bill Kendrick
c1a5ca7fb8 New Magic tool: "Tile Zoom" 2022-01-30 02:23:01 -08:00
dolphin6k
c0bac21beb Target directory for install-dlls and install-tpconf-i18n were missing. 2022-01-28 23:35:14 +09:00
Bill Kendrick
e46226cfcc Refresh POT/PO after more Color Mixer coding 2022-01-28 02:17:26 -08:00
Bill Kendrick
964416f476 Color mixer: Showing simplified fractions, too
Say a color is a mix of 5 red, 4 blue, and 1 black.
It will show "5/10 (1/2) red, 4/10 (2/5) blue, 1/10 black."

Also, when adding multiple contributions of only one color (so far),
it will say, e.g., "entirely (3/3) red".
2022-01-28 02:16:33 -08:00
Bill Kendrick
c50fddd604 Color mixer: Undo/Redo seems to be working! 2022-01-28 01:32:29 -08:00
Bill Kendrick
4ae07338bf Color mixer: Break color average calculation out
Needs to be a function that we can also call on Undo & Redo
actions.
2022-01-28 01:00:36 -08:00
Bill Kendrick
3e28289db2 Color mixer: WIP: Undo/Redo feature 2022-01-28 00:55:23 -08:00
Bill Kendrick
336c7cc342 Color mixer: Some better Red/Yellow/Blue primaries
Using HSV values of some subtractive CMYK colors.
2022-01-28 00:24:27 -08:00
Bill Kendrick
a8beb74abe Color mixer: Mixing colors properly
Rather than having a "current color" and averaging it with
the newly-added color, averaging the entire set of colors each time.

Before, if you added R + Y + B, you'd get a different color
than R + B + Y, or Y + B + R, etc.

Now, it starts fresh every time and averages the hues (when applicable),
saturations, and values of each color that's been added to the mix.

R + Y + B (combined in any order) currently always comes out a brownish
orange, as expected.
2022-01-27 23:56:56 -08:00
Bill Kendrick
42ca74df86 Update POT/PO to add new Color Mixer UI elements 2022-01-27 22:54:50 -08:00
Bill Kendrick
4d93bd3177 Color mixer: Display color proportions as you mix
Show the color proportions (e.g., "entirely red", or "1/2 yellow and 1/2 green",
or "1/5 red, 2/5 blue, and 2/5 black") in the Tux tips area.  Show the full
instructions again when the color is reset with the clear button.

(Also, label clear (trash) button with the word "Clear".)
2022-01-27 22:37:13 -08:00
Bill Kendrick
150e524867 Color mixer: Undo/Redo appear properly; color tweaks
Adjust HSV values for Red/Yellow/Blue. When drawing color,
drop V value very slightly (so white appears off-white).

Undo & Redo now have black icons/text if available, else grey.
2022-01-27 21:25:04 -08:00
Bill Kendrick
268d063f71 Color Mixer: Show Undo/Redo & handle cursor shape
Undo/Redo don't do anything yet. Other buttons now cause mouse
to change to 'hand' (vs 'arrow') shape when hovering over them.
2022-01-27 21:07:19 -08:00