Commit graph

1447 commits

Author SHA1 Message Date
Bill Kendrick
aed818f1b1 Update places that mentioned "--fullscreen" with no args
Since `parse.gperf` was added long ago, the ability to run Tux Paint
with "--fullscreen" command-line, or simply "fullscreen" in the
config. file, no longer exists.

It must be `--fullscreen=yes` (or `--fullscreen=native` as an
alternative to `--fullscreen=yes --native`).  It can also accept
`--fullscreen=no` as an alternative to `--windowed`.

Updating the following places

 * BASH tab completion
 * `tuxpaint --help` output
 * FAQ

h/t Karl for reporting

Closes https://sourceforge.net/p/tuxpaint/bugs/289/
2024-06-02 11:48:51 -07:00
Bill Kendrick
8db84be008 Drop button_label_y_nudge; no longer needed
`button_label_y_nudge`, used in `tuxpaint.c` to nudge button
label text down, was only ever used with Khmer language and is no
longer necessary (the text was actually appearing _too_ low now).

Removing that, as well the `lang_y_nudge[]` look-up table, and
use of the values (`setup_i18n()` and `set_current_language()`)
inside `i18n.c`.
2024-06-02 11:04:43 -07:00
Bill Kendrick
4ba6063423 Tweaks to button label size/position
Word-wrap when text is [still] >= 1.3 * button width
(rather than 1.5).  h/t Karl (who suggested 1.4)

Draw button label text slightly lower (to avoid touching button
icons as often).

Use #defines for the magic multiplier numbers used here.
2024-06-02 11:00:45 -07:00
Bill Kendrick
c1ff0efad1 Word wrap button labels on soft hypens
If the UTF-8 sequence for the Unicode Soft Hyphen ("Non-printable U+00AD")
occurs in the text to be used as the label of a button, and the label
is still too wide after any wrapping done based on either space and/or a
visible hyphen ("-", U+002D), a visible hyphen will be introduced and
the label will be wrapped.

e.g. Norwegian Nynorsk "Regnbogesyklus"

Regnboge-
syklus

(rather than all crammed on one line and impossible to read)

h/t Karl for the idea.

Closes https://sourceforge.net/p/tuxpaint/bugs/288/
2024-06-01 21:26:45 -07:00
Bill Kendrick
217e653d3a Word wrap button labels on hypens/dashes (-)
e.g. Norwegian Nynorsk "ROGGBIF-regnboge" will appear as

  ROGGBIF-
  regnboge

rather than all crammed on one line and impossible to read.

h/t Karl for the idea.  (Next up: support soft-hyphens)

For https://sourceforge.net/p/tuxpaint/bugs/288/
2024-06-01 20:57:39 -07:00
Bill Kendrick
3cf3af76aa Ran indent.sh 2024-06-01 02:12:00 -07:00
Bill Kendrick
01afb5846c api->retract_undo() added to Magic API; used by Filled Polygon
New API function which rolls back the Undo buffer (which is snapshotted
upon a mousedown event ahead of calling the Magic tool's `_click()`
function.)  Dangerous; use sparingly!

Filled Polygon uses this to prevent partially-created (aka unfinished
aka incomplete) polygons -- the preview lines and control points -- from
being recorded and wasting space in the Undo history, or reappearing
upon Redo.

TODO - Other tools (e.g., Clone) would certainly benefit from this.
TODO - Needs more testing to help identify any bugs/issues introduced
by this!
TODO - Magic API docs need updating.

This is probably a sufficient solution that will make
https://sourceforge.net/p/tuxpaint/feature-requests/246/,
'"Overlay" surface in Magic API', unnecessary.
2024-06-01 01:35:50 -07:00
Bill Kendrick
4256d81278 Mend issue of rotating brushes not drawing on single click
Rotating brushes would not draw anything if you simply
click and release with no motion in between (unless brush
spacing was set to the minimum).  It will now draw the
default "up" direction of the brush in that situation.
(h/t Pere for reporting)

Implemented by using a boolean that tracks whether there has
been any motion since a click; if not, the `brush_counter` is
forced to reset (to 999), to insist on `brush_draw()` blitting
something.  (It used to always ignore if a rotational brush,
to avoid accidentally drawing in the wrong direction on release.)
2024-05-25 11:50:17 -07:00
Bill Kendrick
4a79060f26 Ran indent 2024-05-14 23:37:12 -07:00
Bill Kendrick
79d5cb5cea Don't call rsvg_handle_close(); it's deprecated
Borrowing from 825fa1c,

- rsvg_handle_close() is deprecated from librsvg 2.46, together with
  rsvg_handle_write()
- rsvg_handle_close() is only needed to be called after
  rsvg_handle_write()
- rsvg_handle_close() isn't needed to be called after
  rsvg_handle_new_from_file() [1]

1: https://gnome.pages.gitlab.gnome.org/librsvg/Rsvg-2.0/method.Handle.close.html

Shrug!

Closes https://sourceforge.net/p/tuxpaint/bugs/278/
2024-05-14 23:28:50 -07:00
Bill Kendrick
73f66294f4 Warn when 2 magic tools in a group w/ identical order 2024-05-14 23:00:17 -07:00
Bill Kendrick
5bdbc2766b Ran indent.sh to re-indent all source files 2024-05-10 00:26:10 -07:00
Bill Kendrick
850b733f4b Activate [un]groupmagictools option 2024-04-10 23:03:17 -07:00
Bill Kendrick
554c6145fc WIP Ability to ungroup Magic tools
Put them in a big long list, without left/right pagination buttons,
like pre-0.9.27 Tux Paint.

Code is in place, but no way of activating it.

For https://sourceforge.net/p/tuxpaint/feature-requests/229/
2024-04-08 22:15:23 -07:00
Bill Kendrick
4fc34ebd83 Load & display brush descriptions. 2024-03-25 21:21:14 -07:00
Bill Kendrick
f85e2c3519 Transparent erasers
Added round erasers that only expose 25% of the background each
time you click and apply the eraser.

Reworked how erasers are handled in the code to make it easier
to add this.

Reworked how eraser icons are drawn in the selector on the right.
(Squares and non-fuzzy, non-transparent circles are solid;
fuzzy circles are solid in the center with a dithered edge;
transparent circles are entirely dithered.)

TODO
 * Document the new eraser type
 * Remove a visual artfact (XOR outline) when using Ctrl-Z to Undo
 * Eraser icons turn from black to white when temporarily switching
   to certain other tools (e.g., after prompts like Quit or Print,
   or after using Save)
2024-03-15 18:53:13 -07:00
Mark Kim
c1b2811bbf Make screen refresh more snappy on macOS 2024-02-03 21:45:14 -05:00
Bill Kendrick
f8a3eabd9d Start in first Magic tool group containing any tools
i.e., if MAGIC_TYPE_DISTORTS (0) is empty, try
MAGIC_TYPE_COLOR_FILTERS (1), etc.
2024-01-16 20:39:47 -08:00
Bill Kendrick
ff9eff4e60 Sort magic tools by ..._get_order() value, when possible
Tools in n_pt_persp plugin provide orders.  (More coming!)
2024-01-16 20:33:58 -08:00
Bill Kendrick
4cad1200b1 Address some warnings under gcc 11.4 w/ -O2
* In function ‘get_starter_template_options’:
   "warning: dereferencing type-punned pointer will break strict-aliasing
   rules [-Wstrict-aliasing]":
     (short unsigned int *)&(opts->bkgd_color[0]), [...etc.]

 * In function ‘strncpy’,
   inlined from ‘safe_strncpy’ at src/tuxpaint.c:32022:9,
   inlined from ‘trash’ at src/tuxpaint.c:30690:3:
   "warning: ‘__builtin_strncpy’ output may be truncated copying
   255 bytes from a string of length 255 [-Wstringop-truncation]":
     return __builtin___strncpy_chk (__dest, __src, __len,
2024-01-14 13:57:21 -08:00
Bill Kendrick
f585c6e897 Bump (c) date on splash screen to 2024 2024-01-13 11:51:21 -08:00
Bill Kendrick
24d84731ff Wrapped up tuxpaint side of complexity tool
Need to work more on N-Point Perspective tools.
(Also need to add configuration UI to `tuxpaint-config`)
2023-12-29 16:43:51 -08:00
Bill Kendrick
a0f90185a5 Sync docs re: forthcoming complexity option 2023-12-29 16:25:37 -08:00
Bill Kendrick
972195e38b Magic complexity header tweaks
Novice=0, Advanced=2, so we can test "complexity >= SOME_LEVEL"
if a tool works in both Beginner and Advanced modes (vs. "<=" which
seemed backwards).

Add some print-able string names for the complexity levels.

When a Magic plugin fails to init (e.g., now the Clone tool does,
in "novice" mode), show the message as "Notice", not "Error",
and helpfully remind us of the complexity level.

Provide a "_DEFAULT" #define that tuxpaint.c can use, rather than
hard-coding "_ADVANCED", in case things change in the future.
2023-12-29 15:44:17 -08:00
Bill Kendrick
0bc54921d9 WIP - Extending Magic plugin API to support complexity
For https://sourceforge.net/p/tuxpaint/feature-requests/247/
2023-12-29 14:20:07 -08:00
Bill Kendrick
f68909c70e Avoid potential crash using HSV color from New dialog 2023-12-17 11:46:19 -08:00
dolphin6k
d46b3431b4 Revert "Load plugins only from global plugin directory on Windows."
This reverts commit 44c8efc115.
2023-11-13 22:15:26 +09:00
dolphin6k
44c8efc115 Load plugins only from global plugin directory on Windows.
This prevent the crash when "datadir" is set to the program directory.
2023-11-12 22:51:21 +09:00
dolphin6k
848517dbe4 Force log files to go under AppData 2023-11-12 18:41:30 +09:00
dolphin6k
9eb8fcff43 Added build arc to version output and relocated. 2023-10-28 18:57:04 +09:00
dolphin6k
10a0a34b1b Output Version of Tux Paint and Windows
This enables to know the user's environment easily.
2023-10-28 17:55:38 +09:00
Pere Pujal i Carabantes
9cc26e6ed6 Subdirs in Android assets are not browsable. Listing all of them, additionally, a script to download, join and order the stamps is being commited at the Tuxpaint-Android source. 2023-10-16 01:31:08 +02:00
Bill Kendrick
b94044f557 Text/Label tools: Show font info in instructions at the bottom 2023-10-14 00:17:18 -07:00
Bill Kendrick
90ef703403 Ensure hand pointer appears when hovering over tool controls
...e.g. size controls in Magic, flip/mirror, size, and rotate
controls in Stamps, text style controls in Text and Label, etc.
2023-10-13 23:58:04 -07:00
Bill Kendrick
e43c506d20 Mend scroll-down arrow bug Stamps selector...
...when stamp controls were disabled.
2023-10-13 23:18:00 -07:00
Bill Kendrick
b71a4d2987 Avoid stamp & eraser XOR garbage when using quick eraser
(Click+[X])
2023-07-19 00:49:16 -07:00
Bill Kendrick
fbda2c26a1 Avoid Cairo-scaling stamps under new RSVG library
It was causing SVG-based stamps to appear corrupted (a zoomed in
and cropped view of the top-left corner of the shape, rather than
the entire shape).
2023-07-08 10:27:23 -07:00
Shinichi TOYAMA
d43f10c5f2 rsvg_handle_render_document() is not available before librsvg 2.46
https://gnome.pages.gitlab.gnome.org/librsvg/Rsvg-2.0/method.Handle.render_document.html
2023-07-08 20:50:06 +09:00
dolphin6k
5081340f2e Trial to make listing locale fonts shipped with Tux Paint by --listfonts 2023-07-02 18:07:58 +09:00
dolphin6k
17a0a59a50 Trial to make ui font fallback enable when no config option specified. 2023-07-02 18:05:42 +09:00
Bill Kendrick
e98daa5a62 Fill -> Linear Gradient: Show angle while dragging
When using the Linear Gradient fill tool, the angle of the
gradient is now is shown (in the instructions at the bottom).

h/t Miyagi Andel for the idea
2023-07-01 01:21:10 -07:00
Pere Pujal i Carabantes
580572892f Typo? 2023-06-29 23:49:41 +02:00
Pere Pujal i Carabantes
a303908aa9 Redirecting stdout to a more appropiate place for newer Androids. 2023-06-29 20:10:49 +02:00
Bill Kendrick
d073d41eed Avoid a pair of double free()'s!
h/t Shin-ichi for reporting two of these

  warning: pointer 'unc_buff' used after 'free' [-Wuse-after-free]
2023-06-21 22:47:52 -07:00
Bill Kendrick
9199174dca Cast TTF_FontFaceFamilyName from const char * ...
...to char *

Trying to avoid warning Shin-ichi reported

  warning: assignment discards 'const' qualifier from pointer target type
2023-06-21 22:43:52 -07:00
Bill Kendrick
04d0116ae5 Mend magic .sizes treated as a bool, instead of array
h/t Shin-ichi for reporting seeing warnings about

  warning: the comparison will always evaluate as 'true' for the address of 'sizes' will never be NULL

Magic tool ".sizes" was recently turned into an array (per-mode of the
Magic tool), but a few references forgot to account for that.

Corrected like so

e.g., from
  if (magics[magic_group][cur_thing].sizes)
to
  if (magics[magic_group][cur_thing].sizes[magic_modeint(magics[magic_group][cur_thing].mode)])
2023-06-21 22:39:21 -07:00
Bill Kendrick
a094ec850d Use rsvg_handle_get_dimensions() again, sometimes
If RSVG is < 2.52.x, go back to using rsvg_handle_get_dimensions()
(which is deprecated these days) instead of the newer
rsvg_handle_get_intrinsic_size_in_pixels() that replaced it.
(Shin-ichi reports that function is not available on Rocky Linux 9.)

Note - I also recently replaced rsvg_handle_render_cairo() with
rsvg_handle_render_document(), but Shin-ichi didn't report problems
with that; it's been available since 2.46.

See https://sourceforge.net/p/tuxpaint/bugs/278/
2023-06-21 22:26:01 -07:00
Bill Kendrick
23976aa651 New style for color picker (HSV palette) button
Also mend a rendering issue with paint wells on the three
dynamic color buttons.
2023-06-19 12:28:48 -07:00
Bill Kendrick
d4869ac062 Mend color picker on label change; drop LOW_QUALITY_COLOR_SELECTOR
When selecting a label that has a color not found in the built-ins,
we change to the color picker; however, when rendering its button,
it looked wrong and would not fit to the right size (had 48x48
hard-coder in there, still!)  Instead, using `render_color_button()`
to just re-render it.

Also, dropping LOW_QUALITY_COLOR_SELECTOR which had been used by
some embedded platforms we don't seem to support any more (Nokia Maemo
and OLPC XO-1).
2023-06-19 12:05:17 -07:00
Bill Kendrick
20d45409ce Stop using rsvg_handle_render_cairo
It is deprecated.  Using rsvg_handle_render_document() instead.
2023-06-18 13:31:19 -07:00