After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 124394 - ScriptFu text should support multiline input
ScriptFu text should support multiline input
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Script-Fu
1.x
Other All
: Normal enhancement
: 2.2
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2003-10-11 21:06 UTC by Dov Grobgeld
Modified: 2004-09-23 18:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to script-fu-scripts.c to provide multiline input for SF_STRING (3.42 KB, patch)
2003-10-14 08:25 UTC, Dov Grobgeld
none Details | Review
Patch to add multi-line text and SF-TEXT argument type for scripts (7.09 KB, patch)
2004-09-23 16:46 UTC, Kevin Cozens
none Details | Review

Description Dov Grobgeld 2003-10-11 21:06:17 UTC
As PangoLayout support multiline layout there is no reason for ScriptFu to
limit text input to single line. By changing the input box for the ScriptFu
Text type entry from a GtkEntry to a GtkTextViewer it is possible to
support multi line input. Of course there is a question of what alignment
to request from the PangoLayout. Ultimately I would have liked to add an
alignment field to each script fu script that has an alignment input, but
since this is not possible without breaking the API, I suggest that the
alignment is set to center. Once named parameters are introduced, then the
alignment should be made into a parameter.

Another possibility might be to change ScriptFu text to actually refer to
two different inputs, the entry widget and an associated alignment. But
that would break just much...
Comment 1 Dov Grobgeld 2003-10-14 08:25:50 UTC
Created attachment 20686 [details] [review]
Patch to script-fu-scripts.c to provide multiline input for SF_STRING
Comment 2 Dov Grobgeld 2003-10-14 08:35:37 UTC
I just provided a patch to script-fu-scripts.c to make the input
fields for SF_TEXT be GtkTextView instead of GtkEntry. This is enough
for providing multiline input for most of the script fu label scripts.
But with a few exceptions:

- The pango alignment for the text tool is currently set to be
PANGO_ALIGN_LEFT. For most labels the most natural is to have the 
alignment CENTER. Currently there is no API that supports setting the
alignment. this should be changed.

- Yosh believes that multi-line should be another SF type. Such a type
should also provide an alignment object.

[I realized yesterday that it might actually be possible to get even
more fancy by supporting the full power of PangoMarkup. This would
mean creating a widget that supports editing PangoMarkups regarding
font sizes etc. Unfortunately PangoMarkup currently lacks paragraph
control... Either PangoMarkup may be extended or another method may be
 specified for that functionality.]
Comment 3 Michael Natterer 2004-01-21 12:10:34 UTC
Multiline text in Script-Fu would be so useful that we
should IMHO add this feature in 2.2
Comment 4 Sven Neumann 2004-09-16 19:27:57 UTC
IMHO we should add a new parameter type to Script-Fu that allows for multiline
strings. It could be called SF-TEXT and the implementation could be based on the
patch already provided here.
Comment 5 Kevin Cozens 2004-09-23 16:46:45 UTC
Created attachment 31878 [details] [review]
Patch to add multi-line text and SF-TEXT argument type for scripts

This patch adds an SF-TEXT argument type for use in Script-Fu scripts. The
SF-TEXT type allows for input of multiple-lines of text where the still
existing SF-STRING argument type only allows for a single line of input.
Comment 6 Sven Neumann 2004-09-23 18:20:00 UTC
Applied. Will do some further modification but wanted to commit the patch first.

2004-09-23  Sven Neumann  <sven@gimp.org>

	* plug-ins/script-fu/script-fu-enums.h
	* plug-ins/script-fu/script-fu-interface.c
	* plug-ins/script-fu/script-fu-scripts.c
	* plug-ins/script-fu/siod-wrapper.c: applied a patch by Kevin
	Cozens, based on a patch by Dov Grobgeld. Implements multi-line
	text input in Script-Fu (bug #124394).

	* plug-ins/script-fu/scripts/test-sphere.scm: test the new SF-TEXT
	parameter.