Commit ec78557f authored by Sven Neumann's avatar Sven Neumann

Changed most of the scripts to make use of the new argument type SF-STRING .


--Sven
parent 7f6178b4
Wed Aug 5 23:31:54 MEST 1998 Sven Neumann <sven@gimp.org>
* plug-ins/script-fu/scripts/*.scm (well, almost): Changed all
scripts to make use of the new SF-STRING argument type where
appropriate.
Wed Aug 5 21:39:59 MEST 1998 Sven Neumann <sven@gimp.org>
* plug-ins/script-fu/script-fu-enums.h
......
......@@ -4,3 +4,4 @@ Makefile
_libs
.libs
script-fu
convert-script
......@@ -32,6 +32,8 @@
#define COLOR_SAMPLE_WIDTH 100
#define COLOR_SAMPLE_HEIGHT 15
#define MAX_STRING_LENGTH 4096
typedef struct
{
GtkWidget *preview;
......@@ -574,7 +576,7 @@ script_fu_script_proc (char *name,
gint err_msg;
char *text = NULL;
char *command, *c;
char buffer[32];
char buffer[MAX_STRING_LENGTH];
int length;
int i;
......@@ -637,7 +639,7 @@ script_fu_script_proc (char *name,
text = params[i + 1].data.d_string;
break;
case SF_STRING:
sprintf (buffer, "\"%s\"", params[i + 1].data.d_string);
g_snprintf (buffer, MAX_STRING_LENGTH, "\"%s\"", params[i + 1].data.d_string);
text = buffer;
break;
default:
......@@ -1037,7 +1039,7 @@ script_fu_ok_callback (GtkWidget *widget,
gint err_msg;
char *text = NULL;
char *command, *c;
char buffer[32];
char buffer[MAX_STRING_LENGTH];
int length;
int i;
......@@ -1102,7 +1104,7 @@ script_fu_ok_callback (GtkWidget *widget,
break;
case SF_STRING:
text = gtk_entry_get_text (GTK_ENTRY (script->args_widgets[i]));
sprintf (buffer, "\"%s\"", text);
g_snprintf (buffer, MAX_STRING_LENGTH, "\"%s\"", text);
text = buffer;
break;
default:
......
......@@ -32,6 +32,8 @@
#define COLOR_SAMPLE_WIDTH 100
#define COLOR_SAMPLE_HEIGHT 15
#define MAX_STRING_LENGTH 4096
typedef struct
{
GtkWidget *preview;
......@@ -574,7 +576,7 @@ script_fu_script_proc (char *name,
gint err_msg;
char *text = NULL;
char *command, *c;
char buffer[32];
char buffer[MAX_STRING_LENGTH];
int length;
int i;
......@@ -637,7 +639,7 @@ script_fu_script_proc (char *name,
text = params[i + 1].data.d_string;
break;
case SF_STRING:
sprintf (buffer, "\"%s\"", params[i + 1].data.d_string);
g_snprintf (buffer, MAX_STRING_LENGTH, "\"%s\"", params[i + 1].data.d_string);
text = buffer;
break;
default:
......@@ -1037,7 +1039,7 @@ script_fu_ok_callback (GtkWidget *widget,
gint err_msg;
char *text = NULL;
char *command, *c;
char buffer[32];
char buffer[MAX_STRING_LENGTH];
int length;
int i;
......@@ -1102,7 +1104,7 @@ script_fu_ok_callback (GtkWidget *widget,
break;
case SF_STRING:
text = gtk_entry_get_text (GTK_ENTRY (script->args_widgets[i]));
sprintf (buffer, "\"%s\"", text);
g_snprintf (buffer, MAX_STRING_LENGTH, "\"%s\"", text);
text = buffer;
break;
default:
......
......@@ -81,10 +81,10 @@
"Hrvoje Horvat"
"07 April, 1998"
""
SF-VALUE "Text Pattern" "\"Parque #1\""
SF-VALUE "Text String" "\"The Gimp\""
SF-STRING "Text Pattern" "Parque #1"
SF-STRING "Text String" "The Gimp"
SF-VALUE "Font Size (in pixels)" "100"
SF-VALUE "Font" "\"Roostheavy\""
SF-STRING "Font" "Roostheavy"
SF-VALUE "Outline blur radius" "5"
SF-VALUE "Shadow blur radius" "10"
SF-VALUE "Bump-map (alpha layer) blur radius" "5"
......
......@@ -151,14 +151,14 @@
"Adrian Likins"
"July 1997"
""
SF-VALUE "Text" "\"Hello world!\""
SF-STRING "Text" "Hello world!"
SF-VALUE "Size" "22"
SF-VALUE "Foundry" "\"*\""
SF-VALUE "Family" "\"futura_poster\""
SF-VALUE "Weight" "\"*\""
SF-VALUE "Slant" "\"*\""
SF-VALUE "Set width" "\"*\""
SF-VALUE "Spacing" "\"*\""
SF-STRING "Foundry" "*"
SF-STRING "Family" "futura_poster"
SF-STRING "Weight" "*"
SF-STRING "Slant" "*"
SF-STRING "Set width" "*"
SF-STRING "Spacing" "*"
SF-COLOR "Text color" '(0 0 0)
SF-COLOR "Glow Color" '(63 252 0)
SF-COLOR "Background Color" '(0 0 0)
......
......@@ -44,7 +44,7 @@
"Spencer Kimball"
"1997"
""
SF-VALUE "Text String" "\"ALIEN\""
SF-STRING "Text String" "ALIEN"
SF-VALUE "Font Size (in pixels)" "150"
SF-VALUE "Font" "\"futura_poster\""
SF-STRING "Font" "futura_poster"
SF-COLOR "Glow Color" '(63 252 0))
......@@ -242,8 +242,8 @@
"8th April 1998"
"Chris Gutteridge / ECS @ University of Southampton, England"
"bar"
SF-VALUE "File Name:" "\"afile\""
SF-VALUE "Font:" "\"Charter\""
SF-STRING "File Name:" "afile"
SF-STRING "Font:" "Charter"
SF-VALUE "Font size:" "45"
SF-COLOR "Text Color:" '(0 0 0)
SF-TOGGLE "Transparent BG?" FALSE
......@@ -262,8 +262,8 @@
"bar"
SF-IMAGE "Image" 0
SF-DRAWABLE "Layer" 0
SF-VALUE "File Name:" "\"afile\""
SF-VALUE "Font:" "\"Charter\""
SF-STRING "File Name:" "afile"
SF-STRING "Font:" "Charter"
SF-VALUE "Font size:" "45"
SF-COLOR "Text Color:" '(0 0 0)
SF-TOGGLE "Flatten Image?" TRUE
......
......@@ -41,8 +41,8 @@
"Spencer Kimball"
"1996"
""
SF-VALUE "Text String" "\"The Gimp\""
SF-STRING "Text String" "The Gimp"
SF-VALUE "Font Size (in pixels)" "100"
SF-VALUE "Font" "\"Dragonwick\""
SF-STRING "Font" "Dragonwick"
SF-COLOR "Background Color" '(255 255 255)
SF-COLOR "Text Color" '(6 6 206))
......@@ -57,8 +57,8 @@
"Spencer Kimball"
"1996"
""
SF-VALUE "Text String" "\"SCRIPT-FU\""
SF-STRING "Text String" "SCRIPT-FU"
SF-VALUE "Font Size (in pixels)" "150"
SF-VALUE "Font" "\"futura_poster\""
SF-STRING "Font" "futura_poster"
SF-COLOR "Background Color" '(255 255 255)
SF-COLOR "Text Color" '(206 6 50))
......@@ -169,14 +169,14 @@
"Federico Mena Quintero"
"June 1997"
""
SF-VALUE "Text" "\"Hello world!\""
SF-STRING "Text" "Hello world!"
SF-VALUE "Size" "16"
SF-VALUE "Foundry" "\"adobe\""
SF-VALUE "Family" "\"helvetica\""
SF-VALUE "Weight" "\"bold\""
SF-VALUE "Slant" "\"r\""
SF-VALUE "Set width" "\"normal\""
SF-VALUE "Spacing" "\"p\""
SF-STRING "Foundry" "adobe"
SF-STRING "Family" "helvetica"
SF-STRING "Weight" "bold"
SF-STRING "Slant" "r"
SF-STRING "Set width" "normal"
SF-STRING "Spacing" "p"
SF-COLOR "Upper-left color" '(0 255 127)
SF-COLOR "Lower-right color" '(0 127 255)
SF-COLOR "Text color" '(0 0 0)
......
......@@ -142,4 +142,4 @@
""
SF-VALUE "Size" "32"
SF-VALUE "Orientation" "'right"
SF-VALUE "Pattern" "\"Wood\"")
SF-STRING "Pattern" "Wood")
......@@ -81,5 +81,5 @@
"July 1997"
""
SF-VALUE "Diameter" "16"
SF-VALUE "Pattern" "\"Wood\""
SF-STRING "Pattern" "Wood"
SF-TOGGLE "Transparent background" FALSE)
......@@ -116,14 +116,14 @@
"Federico Mena Quintero"
"July 1997"
""
SF-VALUE "Text" "\"Hello world!\""
SF-STRING "Text" "Hello world!"
SF-VALUE "Text size" "32"
SF-VALUE "Foundry" "\"adobe\""
SF-VALUE "Family" "\"utopia\""
SF-VALUE "Weight" "\"bold\""
SF-VALUE "Slant" "\"r\""
SF-VALUE "Set width" "\"normal\""
SF-VALUE "Spacing" "\"p\""
SF-STRING "Foundry" "adobe"
SF-STRING "Family" "utopia"
SF-STRING "Weight" "bold"
SF-STRING "Slant" "r"
SF-STRING "Set width" "normal"
SF-STRING "Spacing" "p"
SF-COLOR "Text color" '(0 0 0)
SF-VALUE "Pattern" "\"Wood\""
SF-STRING "Pattern" "Wood"
SF-TOGGLE "Pressed?" FALSE)
......@@ -94,13 +94,13 @@
"Federico Mena Quintero"
"July 1997"
""
SF-VALUE "Text" "\"Hello world!\""
SF-STRING "Text" "Hello world!"
SF-VALUE "Text size" "72"
SF-VALUE "Foundry" "\"adobe\""
SF-VALUE "Family" "\"utopia\""
SF-VALUE "Weight" "\"bold\""
SF-VALUE "Slant" "\"r\""
SF-VALUE "Set width" "\"normal\""
SF-VALUE "Spacing" "\"p\""
SF-VALUE "Pattern" "\"Wood\""
SF-STRING "Foundry" "adobe"
SF-STRING "Family" "utopia"
SF-STRING "Weight" "bold"
SF-STRING "Slant" "r"
SF-STRING "Set width" "normal"
SF-STRING "Spacing" "p"
SF-STRING "Pattern" "Wood"
SF-TOGGLE "Transparent background" FALSE)
......@@ -71,4 +71,4 @@
""
SF-VALUE "Width" "480"
SF-VALUE "Height" "16"
SF-VALUE "Pattern" "\"Wood\"")
SF-STRING "Pattern" "Wood")
......@@ -81,9 +81,9 @@
"1996"
""
SF-VALUE "Blend Mode" "FG-BG-RGB"
SF-VALUE "Text String" "\"The GIMP\""
SF-STRING "Text String" "The GIMP"
SF-VALUE "Font Size (in pixels)" "150"
SF-VALUE "Font" "\"Crillee\""
SF-STRING "Font" "Crillee"
SF-COLOR "Background Color" '(255 255 255)
SF-COLOR "Text Color" '(124 174 255)
SF-COLOR "Starting Blend" '(22 9 129)
......
......@@ -75,6 +75,6 @@
"Brian McFee"
"April 1998"
""
SF-VALUE "Text String" "\"Fear the Cow\""
SF-STRING "Text String" "Fear the Cow"
SF-VALUE "Font Size (in pixels)" "80"
SF-VALUE "Font" "\"roostheavy\"")
SF-STRING "Font" "roostheavy")
......@@ -157,8 +157,8 @@
"Spencer Kimball"
"1997"
""
SF-VALUE "Text String" "\"Marble\""
SF-STRING "Text String" "Marble"
SF-VALUE "Font Size (in pixels)" "100"
SF-VALUE "Font" "\"Engraver\""
SF-VALUE "Background Img" (string-append "\"" gimp-data-dir "/scripts/texture3.jpg\"")
SF-STRING "Font" "Engraver"
SF-STRING "Background Img" (string-append "" gimp-data-dir "/scripts/texture3.jpg")
SF-TOGGLE "Carve Raised Text" FALSE)
......@@ -73,8 +73,8 @@
"Manish Singh"
"October 1997"
""
SF-VALUE "Text String" "\"CHALK\""
SF-STRING "Text String" "CHALK"
SF-VALUE "Font Size (in pixels)" "150"
SF-VALUE "Font" "\"Cooper\""
SF-STRING "Font" "Cooper"
SF-COLOR "Background Color" '(0 0 0)
SF-COLOR "Chalk Color" '(255 255 255))
......@@ -119,8 +119,8 @@
"Adrian Likins <adrian@gimp.org>"
"1997"
""
SF-VALUE "Text String" "\"Sloth\""
SF-VALUE "Font" "\"roostheavy\""
SF-STRING "Text String" "Sloth"
SF-STRING "Font" "roostheavy"
SF-VALUE "Font size" "200"
SF-VALUE "Chip Amount" "30"
SF-VALUE "Blur Amount" "3"
......@@ -129,6 +129,6 @@
SF-TOGGLE "Keep Bump layer?" FALSE
SF-TOGGLE "Fill bg with pattern?" TRUE
SF-TOGGLE "Keep Background?" TRUE
SF-VALUE "Pattern" "\"Burlwood\"")
SF-STRING "Pattern" "Burlwood")
......@@ -193,7 +193,7 @@
SF-VALUE "Chrome Saturation" "-80"
SF-VALUE "Chrome Lightness" "-47"
SF-VALUE "Chrome Factor" "0.75"
SF-VALUE "Environment Map" (string-append "\"" gimp-data-dir "/scripts/beavis.jpg\"")
SF-STRING "Environment Map" (string-append "" gimp-data-dir "/scripts/beavis.jpg")
SF-COLOR "Highlight Balance" '(211 95 0)
SF-COLOR "Chrome Balance" '(0 0 0)
SF-TOGGLE "Chrome White Areas" TRUE)
......@@ -73,7 +73,7 @@
"Spencer Kimball & Peter Mattis"
"1997"
""
SF-VALUE "Text String" "\"The GIMP\""
SF-STRING "Text String" "The GIMP"
SF-VALUE "Font Size (in pixels)" "100"
SF-VALUE "Font" "\"Bodoni\""
SF-STRING "Font" "Bodoni"
SF-COLOR "Background Color" '(191 191 191))
......@@ -85,8 +85,8 @@
"Brian McFee"
"April 1998"
""
SF-VALUE "Text String" "\"Moo\""
SF-STRING "Text String" "Moo"
SF-VALUE "Font Size (in pixels)" "85"
SF-VALUE "Font" "\"tribeca\""
SF-VALUE "Gradient" "\"Incandescent\""
SF-STRING "Font" "tribeca"
SF-STRING "Gradient" "Incandescent"
SF-VALUE "Outline width" "5")
......@@ -106,8 +106,8 @@
"Spencer Kimball & Rob Malda"
"1997"
""
SF-VALUE "Text String" "\"Cool Metal\""
SF-STRING "Text String" "Cool Metal"
SF-VALUE "Font Size (in pixels)" "100"
SF-VALUE "Font" "\"Crillee\""
SF-STRING "Font" "Crillee"
SF-COLOR "Background Color" '(255 255 255)
SF-TOGGLE "Seascape" FALSE)
......@@ -194,8 +194,8 @@
"1997"
""
SF-VALUE "Chrome Factor" "1.0"
SF-VALUE "Text String" "\"Crystal\""
SF-STRING "Text String" "Crystal"
SF-VALUE "Font Size (in pixels)" "150"
SF-VALUE "Font" "\"Engraver\""
SF-VALUE "Background Img" (string-append "\"" gimp-data-dir "/scripts/texture1.jpg\"")
SF-VALUE "Environment Map" (string-append "\"" gimp-data-dir "/scripts/beavis.jpg\""))
SF-STRING "Font" "Engraver"
SF-STRING "Background Img" (string-append "" gimp-data-dir "/scripts/texture1.jpg")
SF-STRING "Environment Map" (string-append "" gimp-data-dir "/scripts/beavis.jpg"))
......@@ -82,7 +82,7 @@
"Spencer Kimball & Ed Mackey"
"1997"
""
SF-VALUE "Text String" "\"The GIMP\""
SF-STRING "Text String" "The GIMP"
SF-VALUE "Font Size (in pixels)" "100"
SF-VALUE "Font" "\"Becker\""
SF-STRING "Font" "Becker"
SF-COLOR "Background Color" '(255 255 255))
......@@ -134,8 +134,8 @@
"Adrian Likins & Jens Lautenbacher"
"1997"
""
SF-VALUE "Text String" "\"gimp.org\""
SF-VALUE "Font" "\"times\""
SF-STRING "Text String" "gimp.org"
SF-STRING "Font" "times"
SF-VALUE "Font size" "50"
SF-COLOR "Text Color" '(82 108 159)
SF-COLOR "Higlight Color" '(190 220 250)
......@@ -153,8 +153,8 @@
"Adrian Likins & Jens Lautenbacher"
"1997"
""
SF-VALUE "Text String" "\"gimp.org\""
SF-VALUE "Font" "\"helvetica\""
SF-STRING "Text String" "gimp.org"
SF-STRING "Font" "helvetica"
SF-VALUE "Font size" "24"
SF-COLOR "Text Color" '(135 220 220)
SF-COLOR "Higlight Color" '(210 240 245)
......
......@@ -105,7 +105,7 @@
"Adrian Likins & Jens Lautenbacher"
"1997"
""
SF-VALUE "Text String" "\"?\""
SF-STRING "Text String" "?"
SF-TOGGLE "Remove Background" TRUE
SF-TOGGLE "Index Image" TRUE)
......@@ -116,7 +116,7 @@
"Adrian Likins & Jens Lautenbacher"
"1997"
""
SF-VALUE "Text String" "\"?\""
SF-STRING "Text String" "?"
SF-TOGGLE "Remove Background" TRUE
SF-TOGGLE "Index Image" TRUE)
......@@ -127,7 +127,7 @@
"Adrian Likins & Jens Lautenbacher"
"1997"
""
SF-VALUE "Text String" "\"?\""
SF-STRING "Text String" "?"
SF-TOGGLE "Remove Background" TRUE
SF-TOGGLE "Index Image" TRUE)
......@@ -139,12 +139,12 @@
"Adrian Likins & Jens Lautenbacher"
"1997"
""
SF-VALUE "Text String" "\"Gimp.Org\""
SF-VALUE "Font" "\"helvetica\""
SF-STRING "Text String" "Gimp.Org"
SF-STRING "Font" "helvetica"
SF-VALUE "Font Size" "18"
SF-VALUE "Weight" "\"medium\""
SF-VALUE "Slant" "\"r\""
SF-VALUE "Width" "\"normal\""
SF-STRING "Weight" "medium"
SF-STRING "Slant" "r"
SF-STRING "Width" "normal"
SF-COLOR "Text Color" '(130 165 235)
SF-COLOR "Shadow Color" '(0 0 0)
SF-COLOR "Background Color" '(255 255 255)
......
......@@ -125,19 +125,19 @@
"Hrvoje Horvat"
"14/04/1998"
""
SF-VALUE "Text String" "\"Galaxy\""
SF-STRING "Text String" "Galaxy"
SF-VALUE "Font Size (in pixels)" "100"
SF-VALUE "Font" "\"Eras\""
SF-VALUE "Blend Gradient (text)" "\"Shadows_2\""
SF-VALUE "Blend Gradient (outline)" "\"Shadows_2\""
SF-STRING "Font" "Eras"
SF-STRING "Blend Gradient (text)" "Shadows_2"
SF-STRING "Blend Gradient (outline)" "Shadows_2"
SF-VALUE "How big outline?" "5"
SF-COLOR "Background Color" '(255 255 255)
SF-TOGGLE "Use pattern for text instead of gradient" FALSE
SF-VALUE "Pattern (text)" "\"Electric Blue\""
SF-STRING "Pattern (text)" "Electric Blue"
SF-TOGGLE "Use pattern for outline instead of gradient" FALSE
SF-VALUE "Pattern (outline)" "\"Electric Blue\""
SF-STRING "Pattern (outline)" "Electric Blue"
SF-TOGGLE "Use pattern overlay" FALSE
SF-VALUE "Pattern (overlay)" "\"Parque #1\""
SF-STRING "Pattern (overlay)" "Parque #1"
SF-TOGGLE "Default bump-map settings" TRUE
SF-TOGGLE "Shadow?" TRUE
SF-VALUE "Shadow X offset" "8"
......
......@@ -64,7 +64,7 @@
"Spencer Kimball"
"1997"
""
SF-VALUE "Text String" "\"GLOWING\""
SF-STRING "Text String" "GLOWING"
SF-VALUE "Font Size (in pixels)" "150"
SF-VALUE "Font" "\"Slogan\""
SF-STRING "Font" "Slogan"
SF-COLOR "Background Color" '(7 0 20))
......@@ -77,8 +77,8 @@
"Brian McFee"
"April 1998"
""
SF-VALUE "Text String" "\"Moo\""
SF-STRING "Text String" "Moo"
SF-VALUE "Font Size (in pixels)" "90"
SF-VALUE "Font" "\"futura_poster\""
SF-STRING "Font" "futura_poster"
SF-VALUE "Bevel Height (sharpness)" "40"
SF-VALUE "Bevel Width" "2.5")
......@@ -86,10 +86,10 @@
"Shuji Narazaki"
"1997"
""
SF-VALUE "Text" "\"The GIMP\""
SF-STRING "Text" "The GIMP"
SF-COLOR "Text Color" '(255 0 0)
SF-COLOR "Frame Color" '(0 34 255)
SF-VALUE "Font" "\"Becker\""
SF-STRING "Font" "Becker"
SF-VALUE "Font Size" "100"
SF-VALUE "Frame Size" "2")
......
......@@ -110,7 +110,7 @@
SF-VALUE "Seed" "2"
SF-VALUE "Size" "10"
SF-VALUE "Roughness" "7"
SF-VALUE "Gradient" "\"German_flag_smooth\""
SF-STRING "Gradient" "German_flag_smooth"
SF-TOGGLE "Keep Selection?" TRUE
SF-TOGGLE "Seperate Layer?" TRUE
SF-TOGGLE "Use current Gradient?" FALSE)
......
......@@ -83,7 +83,7 @@
"Seth Burgess"
"1997"
""
SF-VALUE "Description" "\"Rectangle\""
SF-STRING "Description" "Rectangle"
SF-VALUE "Width" "20"
SF-VALUE "Height" "20"
SF-VALUE "Spacing" "20"
......@@ -161,7 +161,7 @@
"Seth Burgess"
"1997"
""
SF-VALUE "Description" "\"Rectangle\""
SF-STRING "Description" "Rectangle"
SF-VALUE "Width" "20"
SF-VALUE "Height" "20"
SF-VALUE "Feathering" "4"
......@@ -232,7 +232,7 @@
"Seth Burgess"
"1997"
""
SF-VALUE "Description" "\"Ellipse\""
SF-STRING "Description" "Ellipse"
SF-VALUE "Width" "20"
SF-VALUE "Height" "20"
SF-VALUE "Spacing" "25"
......@@ -312,7 +312,7 @@
"Seth Burgess"
"1997"
""
SF-VALUE "Description" "\"Ellipse\""
SF-STRING "Description" "Ellipse"
SF-VALUE "Width" "20"
SF-VALUE "Height" "20"
SF-VALUE "Feathering" "4"
......
......@@ -158,9 +158,9 @@
"Spencer Kimball"
"1997"
""
SF-VALUE "Text String" "\"NEON\""
SF-STRING "Text String" "NEON"
SF-VALUE "Font Size (in pixels)" "150"
SF-VALUE "Font" "\"Blippo\""
SF-STRING "Font" "Blippo"
SF-COLOR "Background Color" '(0 0 0)
SF-COLOR "Glow Color" '(38 211 255)
SF-TOGGLE "Create Shadow" FALSE)
......@@ -214,14 +214,14 @@
"Arturo Espinosa & Federico Mena Quintero"