Remove the second "raw-filename"/"raw-uri" parameter from file procedures
It's an ancient concept from ancient times when we didn't have URIs and only filenames (not to speak of GFile), and actually even from before the ancient time before that ancient time when we first had ones and zeros, and only had zeros.
This commit is contained in:
@ -814,7 +814,7 @@ file_revert_confirm_response (GtkWidget *dialog,
|
||||
|
||||
new_image = file_open_image (gimp, gimp_get_user_context (gimp),
|
||||
GIMP_PROGRESS (display),
|
||||
file, file, FALSE, NULL,
|
||||
file, FALSE, NULL,
|
||||
GIMP_RUN_INTERACTIVE,
|
||||
&status, NULL, &error);
|
||||
|
||||
|
@ -488,7 +488,6 @@ gimp_imagefile_create_thumbnail (GimpImagefile *imagefile,
|
||||
* from actual thumbnail saving
|
||||
*/
|
||||
image = file_open_image (private->gimp, context, progress,
|
||||
private->file,
|
||||
private->file,
|
||||
FALSE, NULL, GIMP_RUN_NONINTERACTIVE,
|
||||
&status, &mime_type, NULL);
|
||||
|
@ -217,7 +217,7 @@ file_open_dialog_open_image (GtkWidget *dialog,
|
||||
image = file_open_with_proc_and_display (gimp,
|
||||
gimp_get_user_context (gimp),
|
||||
GIMP_PROGRESS (dialog),
|
||||
file, file, FALSE,
|
||||
file, FALSE,
|
||||
load_proc,
|
||||
G_OBJECT (gimp_widget_get_monitor (dialog)),
|
||||
&status, &error);
|
||||
|
@ -196,12 +196,6 @@ file_open_location_response (GtkDialog *dialog,
|
||||
|
||||
if (file)
|
||||
{
|
||||
GFile *entered_file = g_file_new_for_uri (text);
|
||||
|
||||
/* should not fail but does, see issue #3093 */
|
||||
if (! entered_file)
|
||||
entered_file = g_object_ref (file);
|
||||
|
||||
gtk_widget_show (box);
|
||||
|
||||
gtk_editable_set_editable (GTK_EDITABLE (entry), FALSE);
|
||||
@ -210,16 +204,13 @@ file_open_location_response (GtkDialog *dialog,
|
||||
image = file_open_with_proc_and_display (gimp,
|
||||
gimp_get_user_context (gimp),
|
||||
GIMP_PROGRESS (box),
|
||||
file, entered_file,
|
||||
FALSE, NULL,
|
||||
file, FALSE, NULL,
|
||||
G_OBJECT (gimp_widget_get_monitor (entry)),
|
||||
&status, &error);
|
||||
|
||||
gtk_dialog_set_response_sensitive (dialog, GTK_RESPONSE_OK, TRUE);
|
||||
gtk_editable_set_editable (GTK_EDITABLE (entry), TRUE);
|
||||
|
||||
g_object_unref (entered_file);
|
||||
|
||||
if (image == NULL && status != GIMP_PDB_CANCEL)
|
||||
{
|
||||
gimp_message (gimp, G_OBJECT (box), GIMP_MESSAGE_ERROR,
|
||||
|
@ -96,14 +96,6 @@ file_data_init (Gimp *gimp)
|
||||
TRUE, FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("raw-uri",
|
||||
"Raw URI",
|
||||
"The URI of the file "
|
||||
"to load",
|
||||
TRUE, FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_image ("image",
|
||||
@ -177,14 +169,6 @@ file_data_init (Gimp *gimp)
|
||||
FALSE, FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("raw-uri",
|
||||
"Raw URI",
|
||||
"The URI of the file "
|
||||
"to export",
|
||||
FALSE, FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_int ("spacing",
|
||||
"spacing",
|
||||
@ -248,14 +232,6 @@ file_data_init (Gimp *gimp)
|
||||
TRUE, FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("raw-uri",
|
||||
"Raw URI",
|
||||
"The URI of the file "
|
||||
"to load",
|
||||
TRUE, FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_image ("image",
|
||||
@ -329,14 +305,6 @@ file_data_init (Gimp *gimp)
|
||||
FALSE, FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("raw-uri",
|
||||
"Raw URI",
|
||||
"The URI of the file "
|
||||
"to export",
|
||||
FALSE, FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
g_param_spec_int ("spacing",
|
||||
"spacing",
|
||||
@ -407,14 +375,6 @@ file_data_init (Gimp *gimp)
|
||||
TRUE, FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("raw-uri",
|
||||
"Raw URI",
|
||||
"The URI of the file "
|
||||
"to load",
|
||||
TRUE, FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_image ("image",
|
||||
"Image",
|
||||
@ -487,14 +447,6 @@ file_data_init (Gimp *gimp)
|
||||
FALSE, FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("raw-uri",
|
||||
"Raw URI",
|
||||
"The URI of the file "
|
||||
"to export",
|
||||
FALSE, FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("name",
|
||||
@ -551,14 +503,6 @@ file_data_init (Gimp *gimp)
|
||||
TRUE, FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("raw-uri",
|
||||
"Raw URI",
|
||||
"The URI of the file "
|
||||
"to load",
|
||||
TRUE, FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_string ("extension-id",
|
||||
|
@ -71,7 +71,6 @@ file_open_image (Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GFile *file,
|
||||
GFile *entered_file,
|
||||
gboolean as_new,
|
||||
GimpPlugInProcedure *file_proc,
|
||||
GimpRunMode run_mode,
|
||||
@ -83,7 +82,6 @@ file_open_image (Gimp *gimp,
|
||||
GimpImage *image = NULL;
|
||||
GFile *local_file = NULL;
|
||||
gchar *uri = NULL;
|
||||
gchar *entered_uri = NULL;
|
||||
gboolean mounted = TRUE;
|
||||
GError *my_error = NULL;
|
||||
|
||||
@ -91,7 +89,6 @@ file_open_image (Gimp *gimp,
|
||||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL);
|
||||
g_return_val_if_fail (G_IS_FILE (file), NULL);
|
||||
g_return_val_if_fail (G_IS_FILE (entered_file), NULL);
|
||||
g_return_val_if_fail (status != NULL, NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
|
||||
@ -211,11 +208,6 @@ file_open_image (Gimp *gimp,
|
||||
if (! uri)
|
||||
uri = g_file_get_uri (file);
|
||||
|
||||
entered_uri = g_file_get_uri (entered_file);
|
||||
|
||||
if (! entered_uri)
|
||||
entered_uri = g_strdup (uri);
|
||||
|
||||
if (progress)
|
||||
g_object_add_weak_pointer (G_OBJECT (progress), (gpointer) &progress);
|
||||
|
||||
@ -225,14 +217,12 @@ file_open_image (Gimp *gimp,
|
||||
gimp_object_get_name (file_proc),
|
||||
GIMP_TYPE_RUN_MODE, run_mode,
|
||||
G_TYPE_STRING, uri,
|
||||
G_TYPE_STRING, entered_uri,
|
||||
G_TYPE_NONE);
|
||||
|
||||
if (progress)
|
||||
g_object_remove_weak_pointer (G_OBJECT (progress), (gpointer) &progress);
|
||||
|
||||
g_free (uri);
|
||||
g_free (entered_uri);
|
||||
|
||||
*status = g_value_get_enum (gimp_value_array_index (return_vals, 0));
|
||||
|
||||
@ -489,7 +479,7 @@ file_open_with_display (Gimp *gimp,
|
||||
GError **error)
|
||||
{
|
||||
return file_open_with_proc_and_display (gimp, context, progress,
|
||||
file, file, as_new, NULL,
|
||||
file, as_new, NULL,
|
||||
monitor,
|
||||
status, error);
|
||||
}
|
||||
@ -499,7 +489,6 @@ file_open_with_proc_and_display (Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GFile *file,
|
||||
GFile *entered_file,
|
||||
gboolean as_new,
|
||||
GimpPlugInProcedure *file_proc,
|
||||
GObject *monitor,
|
||||
@ -513,13 +502,11 @@ file_open_with_proc_and_display (Gimp *gimp,
|
||||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL);
|
||||
g_return_val_if_fail (G_IS_FILE (file), NULL);
|
||||
g_return_val_if_fail (G_IS_FILE (entered_file), NULL);
|
||||
g_return_val_if_fail (monitor == NULL || G_IS_OBJECT (monitor), NULL);
|
||||
g_return_val_if_fail (status != NULL, NULL);
|
||||
|
||||
image = file_open_image (gimp, context, progress,
|
||||
file,
|
||||
entered_file,
|
||||
as_new,
|
||||
file_proc,
|
||||
GIMP_RUN_INTERACTIVE,
|
||||
@ -619,7 +606,7 @@ file_open_layers (Gimp *gimp,
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
|
||||
new_image = file_open_image (gimp, context, progress,
|
||||
file, file, FALSE,
|
||||
file, FALSE,
|
||||
file_proc,
|
||||
run_mode,
|
||||
status, &mime_type, error);
|
||||
|
@ -25,7 +25,6 @@ GimpImage * file_open_image (Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GFile *file,
|
||||
GFile *entered_file,
|
||||
gboolean as_new,
|
||||
GimpPlugInProcedure *file_proc,
|
||||
GimpRunMode run_mode,
|
||||
@ -57,7 +56,6 @@ GimpImage * file_open_with_proc_and_display (Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
GFile *file,
|
||||
GFile *entered_file,
|
||||
gboolean as_new,
|
||||
GimpPlugInProcedure *file_proc,
|
||||
GObject *monitor,
|
||||
|
@ -195,7 +195,6 @@ file_save (Gimp *gimp,
|
||||
GIMP_TYPE_IMAGE, image,
|
||||
GIMP_TYPE_DRAWABLE, drawable,
|
||||
G_TYPE_STRING, uri,
|
||||
G_TYPE_STRING, uri,
|
||||
G_TYPE_NONE);
|
||||
|
||||
status = g_value_get_enum (gimp_value_array_index (return_vals, 0));
|
||||
|
@ -88,10 +88,7 @@ file_load_invoker (GimpProcedure *procedure,
|
||||
g_value_take_string (gimp_value_array_index (new_args, 1),
|
||||
g_file_get_uri (file));
|
||||
|
||||
g_value_transform (gimp_value_array_index (args, 2),
|
||||
gimp_value_array_index (new_args, 2));
|
||||
|
||||
for (i = 3; i < proc->num_args; i++)
|
||||
for (i = 2; i < proc->num_args; i++)
|
||||
if (G_IS_PARAM_SPEC_STRING (proc->args[i]))
|
||||
g_value_set_static_string (gimp_value_array_index (new_args, i), "");
|
||||
|
||||
@ -301,10 +298,7 @@ file_save_invoker (GimpProcedure *procedure,
|
||||
g_value_take_string (gimp_value_array_index (new_args, 3),
|
||||
g_file_get_uri (file));
|
||||
|
||||
g_value_transform (gimp_value_array_index (args, 4),
|
||||
gimp_value_array_index (new_args, 4));
|
||||
|
||||
for (i = 5; i < proc->num_args; i++)
|
||||
for (i = 4; i < proc->num_args; i++)
|
||||
if (G_IS_PARAM_SPEC_STRING (proc->args[i]))
|
||||
g_value_set_static_string (gimp_value_array_index (new_args, i), "");
|
||||
|
||||
@ -430,13 +424,6 @@ register_file_procs (GimpPDB *pdb)
|
||||
TRUE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("raw-filename",
|
||||
"raw filename",
|
||||
"The name as entered by the user",
|
||||
TRUE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_image ("image",
|
||||
"image",
|
||||
@ -582,13 +569,6 @@ register_file_procs (GimpPDB *pdb)
|
||||
TRUE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("raw-filename",
|
||||
"raw filename",
|
||||
"The name as entered by the user",
|
||||
TRUE, FALSE, FALSE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_pdb_register_procedure (pdb, procedure);
|
||||
g_object_unref (procedure);
|
||||
|
||||
|
@ -291,17 +291,23 @@ gimp_plug_in_set_file_proc_load_handler (GimpPlugIn *plug_in,
|
||||
|
||||
procedure = GIMP_PROCEDURE (proc);
|
||||
|
||||
if (((procedure->num_args < 3) ||
|
||||
if (((procedure->num_args < 2) ||
|
||||
(procedure->num_values < 1) ||
|
||||
! GIMP_IS_PARAM_SPEC_RUN_MODE (procedure->args[0]) ||
|
||||
! G_IS_PARAM_SPEC_STRING (procedure->args[1]) ||
|
||||
! G_IS_PARAM_SPEC_STRING (procedure->args[2]) ||
|
||||
(! proc->generic_file_proc &&
|
||||
! GIMP_IS_PARAM_SPEC_IMAGE (procedure->values[0]))))
|
||||
{
|
||||
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_FAILED,
|
||||
"load handler \"%s\" does not take the standard "
|
||||
"load handler args", proc_name);
|
||||
"Plug-in \"%s\"\n(%s)\n"
|
||||
"attempted to register procedure \"%s\" "
|
||||
"as load handler which does not take the standard "
|
||||
"load procedure arguments: "
|
||||
"(GimpRunMode, String) -> (GimpImage)",
|
||||
gimp_object_get_name (plug_in),
|
||||
gimp_file_get_utf8_name (plug_in->file),
|
||||
proc_name);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -344,16 +350,22 @@ gimp_plug_in_set_file_proc_save_handler (GimpPlugIn *plug_in,
|
||||
|
||||
procedure = GIMP_PROCEDURE (proc);
|
||||
|
||||
if ((procedure->num_args < 5) ||
|
||||
if ((procedure->num_args < 4) ||
|
||||
! GIMP_IS_PARAM_SPEC_RUN_MODE (procedure->args[0]) ||
|
||||
! GIMP_IS_PARAM_SPEC_IMAGE (procedure->args[1]) ||
|
||||
! GIMP_IS_PARAM_SPEC_DRAWABLE (procedure->args[2]) ||
|
||||
! G_IS_PARAM_SPEC_STRING (procedure->args[3]) ||
|
||||
! G_IS_PARAM_SPEC_STRING (procedure->args[4]))
|
||||
! G_IS_PARAM_SPEC_STRING (procedure->args[3]))
|
||||
{
|
||||
g_set_error (error, GIMP_PDB_ERROR, GIMP_PDB_ERROR_FAILED,
|
||||
"save handler \"%s\" does not take the standard "
|
||||
"save handler args", proc_name);
|
||||
"Plug-in \"%s\"\n(%s)\n"
|
||||
"attempted to register procedure \"%s\" "
|
||||
"as save handler which does not take the standard "
|
||||
"save procedure arguments: "
|
||||
"(GimpRunMode, GimpImage, GimpDrawable, String)",
|
||||
gimp_object_get_name (plug_in),
|
||||
gimp_file_get_utf8_name (plug_in->file),
|
||||
proc_name);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -453,7 +453,6 @@ gimp_plug_in_procedure_validate_args (GimpPlugInProcedure *proc,
|
||||
(procedure->num_values >= 1) &&
|
||||
GIMP_IS_PARAM_SPEC_RUN_MODE (procedure->args[0]) &&
|
||||
G_IS_PARAM_SPEC_STRING (procedure->args[1]) &&
|
||||
G_IS_PARAM_SPEC_STRING (procedure->args[2]) &&
|
||||
GIMP_IS_PARAM_SPEC_IMAGE (procedure->values[0]))
|
||||
{
|
||||
uri_value = gimp_value_array_index (args, 1);
|
||||
@ -462,8 +461,7 @@ gimp_plug_in_procedure_validate_args (GimpPlugInProcedure *proc,
|
||||
GIMP_IS_PARAM_SPEC_RUN_MODE (procedure->args[0]) &&
|
||||
GIMP_IS_PARAM_SPEC_IMAGE (procedure->args[1]) &&
|
||||
GIMP_IS_PARAM_SPEC_DRAWABLE (procedure->args[2]) &&
|
||||
G_IS_PARAM_SPEC_STRING (procedure->args[3]) &&
|
||||
G_IS_PARAM_SPEC_STRING (procedure->args[4]))
|
||||
G_IS_PARAM_SPEC_STRING (procedure->args[3]))
|
||||
{
|
||||
uri_value = gimp_value_array_index (args, 3);
|
||||
}
|
||||
|
@ -164,14 +164,6 @@ xcf_init (Gimp *gimp)
|
||||
TRUE, FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("raw-filename",
|
||||
"Raw filename",
|
||||
"The basename of the "
|
||||
"file, in UTF-8",
|
||||
FALSE, FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_plug_in_manager_add_procedure (gimp->plug_in_manager, proc);
|
||||
g_object_unref (procedure);
|
||||
|
||||
@ -226,14 +218,6 @@ xcf_init (Gimp *gimp)
|
||||
TRUE, FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("raw-filename",
|
||||
"Raw filename",
|
||||
"The basename of the "
|
||||
"file, in UTF-8",
|
||||
FALSE, FALSE, TRUE,
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE));
|
||||
|
||||
gimp_procedure_add_return_value (procedure,
|
||||
gimp_param_spec_image ("image",
|
||||
|
@ -38,7 +38,6 @@
|
||||
* gimp_file_load:
|
||||
* @run_mode: The run mode.
|
||||
* @filename: The name of the file to load.
|
||||
* @raw_filename: The name as entered by the user.
|
||||
*
|
||||
* Loads an image file by invoking the right load handler.
|
||||
*
|
||||
@ -54,8 +53,7 @@
|
||||
**/
|
||||
GimpImage *
|
||||
gimp_file_load (GimpRunMode run_mode,
|
||||
const gchar *filename,
|
||||
const gchar *raw_filename)
|
||||
const gchar *filename)
|
||||
{
|
||||
GimpValueArray *args;
|
||||
GimpValueArray *return_vals;
|
||||
@ -64,7 +62,6 @@ gimp_file_load (GimpRunMode run_mode,
|
||||
args = gimp_value_array_new_from_types (NULL,
|
||||
GIMP_TYPE_RUN_MODE, run_mode,
|
||||
G_TYPE_STRING, filename,
|
||||
G_TYPE_STRING, raw_filename,
|
||||
G_TYPE_NONE);
|
||||
|
||||
return_vals = gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
||||
@ -185,7 +182,6 @@ gimp_file_load_layers (GimpRunMode run_mode,
|
||||
* @image: Input image.
|
||||
* @drawable: Drawable to save.
|
||||
* @filename: The name of the file to save the image in.
|
||||
* @raw_filename: The name as entered by the user.
|
||||
*
|
||||
* Saves a file by extension.
|
||||
*
|
||||
@ -203,8 +199,7 @@ gboolean
|
||||
gimp_file_save (GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
const gchar *filename,
|
||||
const gchar *raw_filename)
|
||||
const gchar *filename)
|
||||
{
|
||||
GimpValueArray *args;
|
||||
GimpValueArray *return_vals;
|
||||
@ -215,7 +210,6 @@ gimp_file_save (GimpRunMode run_mode,
|
||||
GIMP_TYPE_IMAGE, image,
|
||||
GIMP_TYPE_DRAWABLE, drawable,
|
||||
G_TYPE_STRING, filename,
|
||||
G_TYPE_STRING, raw_filename,
|
||||
G_TYPE_NONE);
|
||||
|
||||
return_vals = gimp_pdb_run_procedure_array (gimp_get_pdb (),
|
||||
|
@ -33,8 +33,7 @@ G_BEGIN_DECLS
|
||||
|
||||
|
||||
GimpImage* gimp_file_load (GimpRunMode run_mode,
|
||||
const gchar *filename,
|
||||
const gchar *raw_filename);
|
||||
const gchar *filename);
|
||||
GimpLayer* gimp_file_load_layer (GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
const gchar *filename);
|
||||
@ -45,8 +44,7 @@ GimpLayer** gimp_file_load_layers (GimpRunMode run_mode,
|
||||
gboolean gimp_file_save (GimpRunMode run_mode,
|
||||
GimpImage *image,
|
||||
GimpDrawable *drawable,
|
||||
const gchar *filename,
|
||||
const gchar *raw_filename);
|
||||
const gchar *filename);
|
||||
gboolean gimp_file_save_thumbnail (GimpImage *image,
|
||||
const gchar *filename);
|
||||
|
||||
|
@ -84,12 +84,6 @@ gimp_load_procedure_constructed (GObject *object)
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE);
|
||||
|
||||
GIMP_PROC_ARG_STRING (procedure, "raw-uri",
|
||||
"Raw URI",
|
||||
"The URI of the file to load",
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE);
|
||||
|
||||
GIMP_PROC_VAL_IMAGE (procedure, "image",
|
||||
"Image",
|
||||
"Output image",
|
||||
@ -160,13 +154,12 @@ gimp_load_procedure_run (GimpProcedure *procedure,
|
||||
|
||||
run_mode = GIMP_VALUES_GET_ENUM (args, 0);
|
||||
uri = GIMP_VALUES_GET_STRING (args, 1);
|
||||
/* raw_uri = GIMP_VALUES_GET_STRING (args, 2); */
|
||||
|
||||
file = g_file_new_for_uri (uri);
|
||||
|
||||
remaining = gimp_value_array_new (gimp_value_array_length (args) - 3);
|
||||
remaining = gimp_value_array_new (gimp_value_array_length (args) - 2);
|
||||
|
||||
for (i = 3; i < gimp_value_array_length (args); i++)
|
||||
for (i = 2; i < gimp_value_array_length (args); i++)
|
||||
{
|
||||
GValue *value = gimp_value_array_index (args, i);
|
||||
|
||||
@ -207,7 +200,7 @@ gimp_load_procedure_run (GimpProcedure *procedure,
|
||||
*
|
||||
* It automatically adds the standard
|
||||
*
|
||||
* (run-mode, uri, raw-uri)
|
||||
* (run-mode, uri)
|
||||
*
|
||||
* arguments and the standard
|
||||
*
|
||||
|
@ -92,12 +92,6 @@ gimp_save_procedure_constructed (GObject *object)
|
||||
"The URI of the file to save to",
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE);
|
||||
|
||||
GIMP_PROC_ARG_STRING (procedure, "raw-uri",
|
||||
"Raw URI",
|
||||
"The URI of the file to save to",
|
||||
NULL,
|
||||
GIMP_PARAM_READWRITE);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -156,13 +150,12 @@ gimp_save_procedure_run (GimpProcedure *procedure,
|
||||
image = GIMP_VALUES_GET_IMAGE (args, 1);
|
||||
drawable = GIMP_VALUES_GET_DRAWABLE (args, 2);
|
||||
uri = GIMP_VALUES_GET_STRING (args, 3);
|
||||
/* raw_uri = GIMP_VALUES_GET_STRING (args, 4); */
|
||||
|
||||
file = g_file_new_for_uri (uri);
|
||||
|
||||
remaining = gimp_value_array_new (gimp_value_array_length (args) - 5);
|
||||
remaining = gimp_value_array_new (gimp_value_array_length (args) - 4);
|
||||
|
||||
for (i = 5; i < gimp_value_array_length (args); i++)
|
||||
for (i = 4; i < gimp_value_array_length (args); i++)
|
||||
{
|
||||
GValue *value = gimp_value_array_index (args, i);
|
||||
|
||||
@ -204,7 +197,7 @@ gimp_save_procedure_run (GimpProcedure *procedure,
|
||||
*
|
||||
* It automatically adds the standard
|
||||
*
|
||||
* (run-mode, image-id, drawable-id, uri, raw-uri)
|
||||
* (run-mode, image-id, drawable-id, uri)
|
||||
*
|
||||
* arguments of a save procedure. It is possible to add additional
|
||||
* arguments.
|
||||
|
@ -37,9 +37,7 @@ HELP
|
||||
type => 'enum GimpRunMode (no GIMP_RUN_WITH_LAST_VALS)',
|
||||
desc => 'The run mode' },
|
||||
{ name => 'filename', type => 'string', allow_non_utf8 => 1,
|
||||
desc => 'The name of the file to load' },
|
||||
{ name => 'raw_filename', type => 'string', allow_non_utf8 => 1,
|
||||
desc => 'The name as entered by the user' }
|
||||
desc => 'The name of the file to load' }
|
||||
);
|
||||
|
||||
@outargs = (
|
||||
@ -88,10 +86,7 @@ HELP
|
||||
g_value_take_string (gimp_value_array_index (new_args, 1),
|
||||
g_file_get_uri (file));
|
||||
|
||||
g_value_transform (gimp_value_array_index (args, 2),
|
||||
gimp_value_array_index (new_args, 2));
|
||||
|
||||
for (i = 3; i < proc->num_args; i++)
|
||||
for (i = 2; i < proc->num_args; i++)
|
||||
if (G_IS_PARAM_SPEC_STRING (proc->args[i]))
|
||||
g_value_set_static_string (gimp_value_array_index (new_args, i), "");
|
||||
|
||||
@ -274,9 +269,7 @@ HELP
|
||||
{ name => 'drawable', type => 'drawable',
|
||||
desc => 'Drawable to save' },
|
||||
{ name => 'filename', type => 'string', allow_non_utf8 => 1,
|
||||
desc => 'The name of the file to save the image in' },
|
||||
{ name => 'raw_filename', type => 'string', allow_non_utf8 => 1,
|
||||
desc => 'The name as entered by the user' }
|
||||
desc => 'The name of the file to save the image in' }
|
||||
);
|
||||
|
||||
%invoke = (
|
||||
@ -330,10 +323,7 @@ HELP
|
||||
g_value_take_string (gimp_value_array_index (new_args, 3),
|
||||
g_file_get_uri (file));
|
||||
|
||||
g_value_transform (gimp_value_array_index (args, 4),
|
||||
gimp_value_array_index (new_args, 4));
|
||||
|
||||
for (i = 5; i < proc->num_args; i++)
|
||||
for (i = 4; i < proc->num_args; i++)
|
||||
if (G_IS_PARAM_SPEC_STRING (proc->args[i]))
|
||||
g_value_set_static_string (gimp_value_array_index (new_args, i), "");
|
||||
|
||||
|
@ -450,7 +450,6 @@ save_image (const CompressorEntry *compressor,
|
||||
if (! (gimp_file_save (run_mode,
|
||||
image,
|
||||
drawable,
|
||||
tmpname,
|
||||
tmpname) && valid_file (tmpname)))
|
||||
{
|
||||
g_unlink (tmpname);
|
||||
@ -516,7 +515,7 @@ load_image (const CompressorEntry *compressor,
|
||||
|
||||
/* now that we uncompressed it, load the temp file */
|
||||
|
||||
image = gimp_file_load (run_mode, tmpname, tmpname);
|
||||
image = gimp_file_load (run_mode, tmpname);
|
||||
|
||||
g_unlink (tmpname);
|
||||
g_free (tmpname);
|
||||
|
@ -187,7 +187,7 @@ load_image (GFile *file,
|
||||
value = g_key_file_get_value (key_file,
|
||||
group, G_KEY_FILE_DESKTOP_KEY_URL, &error);
|
||||
if (value)
|
||||
image = gimp_file_load (run_mode, value, value);
|
||||
image = gimp_file_load (run_mode, value);
|
||||
|
||||
out:
|
||||
if (error)
|
||||
|
@ -273,7 +273,6 @@ gbr_save (GimpProcedure *procedure,
|
||||
GIMP_TYPE_IMAGE, image,
|
||||
GIMP_TYPE_DRAWABLE, drawable,
|
||||
G_TYPE_STRING, uri,
|
||||
G_TYPE_STRING, uri,
|
||||
G_TYPE_INT, info.spacing,
|
||||
G_TYPE_STRING, info.description,
|
||||
G_TYPE_NONE);
|
||||
|
@ -431,7 +431,6 @@ gih_save (GimpProcedure *procedure,
|
||||
GIMP_TYPE_IMAGE, image,
|
||||
GIMP_TYPE_DRAWABLE, drawable,
|
||||
G_TYPE_STRING, uri,
|
||||
G_TYPE_STRING, uri,
|
||||
G_TYPE_INT, info.spacing,
|
||||
G_TYPE_STRING, info.description,
|
||||
G_TYPE_STRING, paramstring,
|
||||
|
@ -236,7 +236,6 @@ pat_save (GimpProcedure *procedure,
|
||||
GIMP_TYPE_IMAGE, image,
|
||||
GIMP_TYPE_DRAWABLE, drawable,
|
||||
G_TYPE_STRING, uri,
|
||||
G_TYPE_STRING, uri,
|
||||
G_TYPE_STRING, description,
|
||||
G_TYPE_NONE);
|
||||
|
||||
|
@ -353,7 +353,6 @@ send_image (const gchar *filename,
|
||||
if (! (gimp_file_save (run_mode,
|
||||
image,
|
||||
drawable,
|
||||
tmpname,
|
||||
tmpname) && valid_file (tmpname)))
|
||||
{
|
||||
goto error;
|
||||
|
@ -444,7 +444,7 @@ load_image (const gchar *filename,
|
||||
NULL,
|
||||
error))
|
||||
{
|
||||
image = gimp_file_load (run_mode, filename_out, filename_out);
|
||||
image = gimp_file_load (run_mode, filename_out);
|
||||
if (image)
|
||||
gimp_image_set_filename (image, filename);
|
||||
}
|
||||
@ -535,9 +535,7 @@ load_thumbnail_image (const gchar *filename,
|
||||
{
|
||||
gimp_progress_update (0.5);
|
||||
|
||||
image = gimp_file_load (GIMP_RUN_NONINTERACTIVE,
|
||||
filename_out,
|
||||
filename_out);
|
||||
image = gimp_file_load (GIMP_RUN_NONINTERACTIVE, filename_out);
|
||||
if (image)
|
||||
{
|
||||
/* the size reported by raw files isn't precise,
|
||||
|
@ -362,7 +362,7 @@ load_image (const gchar *filename,
|
||||
NULL,
|
||||
error))
|
||||
{
|
||||
image = gimp_file_load (run_mode, filename_out, filename_out);
|
||||
image = gimp_file_load (run_mode, filename_out);
|
||||
if (image)
|
||||
gimp_image_set_filename (image, filename);
|
||||
}
|
||||
@ -481,9 +481,7 @@ load_thumbnail_image (const gchar *filename,
|
||||
{
|
||||
gimp_progress_update (0.5);
|
||||
|
||||
image = gimp_file_load (GIMP_RUN_NONINTERACTIVE,
|
||||
filename_out,
|
||||
filename_out);
|
||||
image = gimp_file_load (GIMP_RUN_NONINTERACTIVE, filename_out);
|
||||
if (image)
|
||||
{
|
||||
/* is this needed for thumbnails? */
|
||||
|
@ -103,8 +103,7 @@ screenshot_freedesktop_dbus_signal (GDBusProxy *proxy,
|
||||
GFile *file = g_file_new_for_uri (uri);
|
||||
gchar *path = g_file_get_path (file);
|
||||
|
||||
*image = gimp_file_load (GIMP_RUN_NONINTERACTIVE,
|
||||
path, path);
|
||||
*image = gimp_file_load (GIMP_RUN_NONINTERACTIVE, path);
|
||||
gimp_image_set_filename (*image, "screenshot.png");
|
||||
|
||||
/* Delete the actual file. */
|
||||
|
@ -176,8 +176,7 @@ screenshot_gnome_shell_shoot (ScreenshotValues *shootvals,
|
||||
{
|
||||
GimpColorProfile *profile;
|
||||
|
||||
*image = gimp_file_load (GIMP_RUN_NONINTERACTIVE,
|
||||
filename, filename);
|
||||
*image = gimp_file_load (GIMP_RUN_NONINTERACTIVE, filename);
|
||||
gimp_image_set_filename (*image, "screenshot.png");
|
||||
|
||||
profile = gimp_monitor_get_color_profile (monitor);
|
||||
|
@ -168,8 +168,7 @@ screenshot_kwin_shoot (ScreenshotValues *shootvals,
|
||||
{
|
||||
GimpColorProfile *profile;
|
||||
|
||||
*image = gimp_file_load (GIMP_RUN_NONINTERACTIVE,
|
||||
filename, filename);
|
||||
*image = gimp_file_load (GIMP_RUN_NONINTERACTIVE, filename);
|
||||
gimp_image_set_filename (*image, "screenshot.png");
|
||||
|
||||
/* This is very wrong in multi-display setups since we have no
|
||||
|
Reference in New Issue
Block a user