ScriptFu: fix 8463 obsolete SF-VALUE

Any third-party scripts using SF-VALUE will need porting.
This commit is contained in:
lloyd konneker
2024-09-27 06:41:29 -04:00
parent 98b2216244
commit 4ffc99b75d
6 changed files with 9 additions and 38 deletions

View File

@ -128,7 +128,6 @@ static const NamedConstant script_constants[] =
{ "SF-VECTORS", SF_VECTORS },
{ "SF-COLOR", SF_COLOR },
{ "SF-TOGGLE", SF_TOGGLE },
{ "SF-VALUE", SF_VALUE },
{ "SF-STRING", SF_STRING },
{ "SF-FILENAME", SF_FILENAME },
{ "SF-DIRNAME", SF_DIRNAME },

View File

@ -66,12 +66,6 @@
* While Scheme speakers understand Scheme uses "numeric" for both float and int,
* this might be confusing to script authors using other programming languages.
*
* SF_VALUE probably should be obsoleted.
* Search ChangeLog for mention of "SF_VALUE"
* See below, the only difference is that one get string escaped.
* Otherwise, SF_VALUE is identical to SF_STRING.
* Probably SF_VALUE still exists just for backward compatibility.
*
* SFArgType denotes not only a C type, but also a Scheme type.
* For example, SF_ADJUSTMENT denotes the C type "float"
* and the Scheme type "numeric" (which encompasses float and int.)
@ -119,7 +113,6 @@ script_fu_arg_free (SFArg *arg)
sf_resource_arg_free (arg);
break;
case SF_VALUE:
case SF_STRING:
case SF_TEXT:
g_free (arg->default_value.sfa_value);
@ -201,7 +194,6 @@ script_fu_arg_reset (SFArg *arg, gboolean should_reset_ids)
value->sfa_toggle = default_value->sfa_toggle;
break;
case SF_VALUE:
case SF_STRING:
case SF_TEXT:
g_free (value->sfa_value);
@ -411,7 +403,6 @@ script_fu_arg_add_argument (SFArg *arg,
/* FUTURE special widgets for multiline text.
* script-fu-interface does, but GimpProcedureDialog does not.
*/
case SF_VALUE:
case SF_STRING:
case SF_TEXT:
gimp_procedure_add_string_argument (procedure, name,
@ -597,10 +588,6 @@ script_fu_arg_append_repr_from_gvalue (SFArg *arg,
g_string_append (result_string, (g_value_get_boolean (gvalue) ? "TRUE" : "FALSE"));
break;
case SF_VALUE:
g_string_append (result_string, g_value_get_string (gvalue));
break;
case SF_STRING:
case SF_TEXT:
append_scheme_repr_of_c_string (g_value_get_string (gvalue), result_string);
@ -741,10 +728,6 @@ script_fu_arg_append_repr_from_self (SFArg *arg,
g_string_append (result_string, arg_value->sfa_toggle ? "TRUE" : "FALSE");
break;
case SF_VALUE:
g_string_append (result_string, arg_value->sfa_value);
break;
case SF_STRING:
case SF_TEXT:
append_scheme_repr_of_c_string (arg_value->sfa_value, result_string);
@ -857,10 +840,6 @@ script_fu_arg_generate_name_and_nick (SFArg *arg,
name = "toggle";
break;
case SF_VALUE:
name = "value";
break;
case SF_STRING:
name = "string";
break;

View File

@ -32,7 +32,6 @@ typedef enum
SF_VECTORS,
SF_COLOR,
SF_TOGGLE,
SF_VALUE,
SF_STRING,
SF_ADJUSTMENT,
SF_FONT,

View File

@ -300,7 +300,6 @@ script_fu_interface_dialog (SFScript *script,
&arg->value.sfa_toggle);
break;
case SF_VALUE:
case SF_STRING:
widget = gtk_entry_new ();
gtk_widget_set_size_request (widget, TEXT_WIDTH, -1);
@ -740,7 +739,6 @@ script_fu_update_models (SFScript *script)
switch (script->args[i].type)
{
case SF_VALUE:
case SF_STRING:
g_free (arg_value->sfa_value);
arg_value->sfa_value =
@ -857,7 +855,6 @@ script_fu_reset (SFScript *script)
value->sfa_toggle);
break;
case SF_VALUE:
case SF_STRING:
gtk_entry_set_text (GTK_ENTRY (widget), value->sfa_value);
break;

View File

@ -238,14 +238,6 @@ script_fu_parse_default_spec (scheme *sc,
return registration_error (sc, "toggle default must yield an integer, #t, or #f");
break;
case SF_VALUE:
if (!sc->vptr->is_string (default_spec))
return registration_error (sc, "value defaults must be strings");
arg->default_value.sfa_value =
g_strdup (sc->vptr->string_value (default_spec));
break;
case SF_STRING:
case SF_TEXT:
if (!sc->vptr->is_string (default_spec))

View File

@ -3,14 +3,19 @@
;
; ----------------------------------------------------------------------
; SF-ADJUSTMENT
; is only useful in interactive mode, if you call a script from
; the console, it acts just like a normal SF-VALUE
; In interactive mode it creates an adjustment widget in the dialog.
; Creates a GtkAdjustment widget in the dialog.
; The widget will let the user enter a number, either an integer,
; or a float, depending on "digits."
;
; The argument in Scheme is numeric, an integer or float.
; The argument in the PDB is an integer or a float.
; As specified by "digits" meaning digits after a decimal point.
;
; Usage:
; SF-ADJUSTMENT "label" '(value lower upper step_inc page_inc digits type)
;
; type is one of: SF-SLIDER(0), SF-SPINNER(1)
; The widget will be a Slider or Spinner, depending on
; "type", which is one of: SF-SLIDER(0), SF-SPINNER(1)
;
; ----------------------------------------------------------------------
; SF-COLOR