Commit graph

1475 commits

Author SHA1 Message Date
Bill Kendrick
07e338d717 Text/Label paste: Word-wrap on space (eaten) or dash 2024-12-25 13:42:25 -08:00
Bill Kendrick
f9728edd05 Getting On-Screen Keyboard "Paste" button to work
I THINK I've got it.  I admit I don't understand the OSK code _at all_.
2024-12-25 10:39:49 -08:00
Bill Kendrick
9103b783ce Improving commentary for text_label_tool_enter() 2024-12-25 10:15:14 -08:00
Bill Kendrick
79bc5b2df4 WIP Adding "Paste" button to On Screen Keyboard
Appears, but does not yet actually invoke a paste event.
Does not have an icon.
2024-12-20 12:32:41 -08:00
Bill Kendrick
4de111df25 WIP - Text/Label tools: Ability to paste text clipboard
Lots still to do, but the basic functionality is there
(thanks to SDL2's clipboard functions).

For https://sourceforge.net/p/tuxpaint/feature-requests/95/
2024-12-20 01:36:08 -08:00
Bill Kendrick
199f11ce31 Less stdout noise when running Tux Paint
Avoid warnings when we cannot load non-existent SVGs by checking for file existence first.
(h/t Thomas K)

Add some "Info" and "Warning" labels to some output; improve some messages.

Free gerror that rsvg_handle_new_from_file() allocates.
2024-12-20 00:13:59 -08:00
Bill Kendrick
3d2dab5fc2 Improved color picker behavior
Better behavior when clicking/tapping and dragging hue/saturation box
and value slider.
2024-11-15 00:59:46 -08:00
Bill Kendrick
c88616e13e Don't Magic switch-out & -in on pointless Ctrl-R/Z
h/t Pere for a correction for Ctrl-R (I also applied to Ctlr-Z)
and Miyagi for reporting the issue

Closes https://sourceforge.net/p/tuxpaint/bugs/294/
2024-10-23 20:55:13 -07:00
Bill Kendrick
849cc46d10 New "Impasto" brush
Sneaking in before 0.9.34 final >:-)
2024-10-20 23:47:01 -07:00
Bill Kendrick
44d7d0ee5d Re-run indent.sh under GNU indent 2.2.13
Slight change to its default behavior re: pointer variables
(before: "type * var"; now seems to prefer: "type *var").
2024-10-20 11:22:30 -07:00
Bill Kendrick
b40665b2fe Avoid alpha appearing as black in multi-frame rotated brushes
See reopened https://sourceforge.net/p/tuxpaint/bugs/259/
2024-10-11 00:50:44 -07:00
Bill Kendrick
aa8db6c27d Rotated brush: always send 32-bit surface to rotozoomSurface() 2024-10-11 00:30:15 -07:00
Bill Kendrick
776301620e Didn't mean to leave scale at 2.0 in rotozoom calls 2024-10-10 23:53:37 -07:00
Bill Kendrick
e62db79e8f Watercolor splotches brush; mended rotated brush position
also, new "chaotic" brush option (used by watercolor splotches)
(TODO - document this).
2024-10-10 23:38:36 -07:00
Bill Kendrick
380728fb33 Register our own SDL event for Stamp descr. playback
Sometimes wasn't working.  See https://sourceforge.net/p/tuxpaint/bugs/293/

Committing on behalf of Pere.
2024-10-02 21:25:58 -07:00
Bill Kendrick
c9f978b1ca WIP ASCII art Magic tools; code working! 2024-09-26 00:35:01 -07:00
Bill Kendrick
be4827cd03 Mend bug: Eraser choices turning white...
...when a prompt came up.

h/t Pere; https://sourceforge.net/p/tuxpaint/bugs/292/
2024-09-25 20:01:01 -07:00
Bill Kendrick
dbbc8df6c2 When warning about Magic tool orders, show names too 2024-09-23 22:03:07 -07:00
Bill Kendrick
d94e85e26e Sound pause/unpause Magic API functions...
...plus documenting them.
...plus using them in new "Comic Dots" Magic tool.
2024-09-17 22:11:32 -07:00
Bill Kendrick
fed69f534d New "Eraser" flood fill mode
...to expose the background (solid color, or template or starter
background).

Closes https://sourceforge.net/p/tuxpaint/feature-requests/258/
2024-09-16 20:52:26 -07:00
Pere Pujal i Carabantes
1cfde8e518 Quitting when Android asks to do so to recover resources, previously a phone with Tux Paint running unatended in the background and asked to quit by Android, greated the user with an "Are you sure" sound but the user was unable to interact with Tux Paint anymore. 2024-09-15 16:54:01 +02:00
Bill Kendrick
8ba9fb85e1 More tweaks to try & get Haiku Trash working
h/t Jérôme for all the hand-holding for Luc & me
2024-06-07 00:50:29 -07:00
Bill Kendrick
cce95a7274 Also extern "C" haiku_print()
h/t Jérôme
2024-06-07 00:36:33 -07:00
Bill Kendrick
3c5303563a WIP Dropping in code for Haiku trash can support
h/t Jérôme Duval <https://github.com/korli> for pointing us to this
(see https://github.com/haikuports/haikuports/issues/10568)
Code used is copyright (c) 2004, Francois Revol <revol@free.fr>,
provided under the MIT licence.

(Also, ran `indent.sh`)
2024-06-06 23:06:07 -07:00
Bill Kendrick
33db4c16f5 WIP Changes to support building for OS/2
+ WIP Makefile updates to support building for OS/2
   - TODO: Makefile needs SYSNAME test to detect OS/2 (Bill has asked Elbert)
 + Added "__declspec(dllexport)" (via new "TX_EXTERN" #define'd in
   `tp_magic_api.h`) to public function definitions in Magic tools
   - WIP: So far just "Mirror/Flip" plugin
   - TODO: Add "TX_EXTERN" prefix to all other public Magic tool functions
 + Renamed long Magic tool source files to have shorter filenames
   - WIP: So far just "Mirror/Flip" (`mirror_flip.c` -> `mirror_f.c`)
   - TODO: Rename all other magic tool source files.

h/t Elbert Pol for providing info and some diffs!
2024-06-06 00:40:42 -07:00
Bill Kendrick
8b4c78bf4e Show names of export files; place in clipboard
Name of exported picture is shown, and placed in clipboard
(copy/paste buffer) after exporting a drawing (via Open dialog)
or animated GIF (via Open->Slideshow).
2024-06-02 23:09:57 -07:00
Bill Kendrick
552b30a3e9 Removed textdir() function
Closes https://sourceforge.net/p/tuxpaint/tasks/33/
2024-06-02 22:41:46 -07:00
Bill Kendrick
5c7c1b6083 Remove lang_use_right_to_left_word stuff; it's unused
For https://sourceforge.net/p/tuxpaint/tasks/33/`
Next step: remove `textdir()` completely.
2024-06-02 22:29:55 -07:00
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