pdb: allow file procedures to register themselves for handling URIs

and store the flag in pluginrc. There are no URIs passed to procedures
yet and no procedure registers as such, this is just preparation.
This commit is contained in:
Michael Natterer
2012-11-17 16:01:52 +01:00
parent c5f1fd1fda
commit 07f77e5ec8
11 changed files with 176 additions and 4 deletions

View File

@ -708,6 +708,7 @@ EXPORTS
gimp_read_expect_msg
gimp_rect_select
gimp_register_file_handler_mime
gimp_register_file_handler_uri
gimp_register_load_handler
gimp_register_magic_load_handler
gimp_register_save_handler

View File

@ -431,6 +431,40 @@ gimp_register_file_handler_mime (const gchar *procedure_name,
return success;
}
/**
* gimp_register_file_handler_uri:
* @procedure_name: The name of the procedure to enable URIs for.
*
* Registers a file handler procedure as capable of handling URIs.
*
* Registers a file handler procedure as capable of handling URIs. This
* allows GIMP to call the procecure directly for all kinds of URIs,
* and the 'filename' traditionally passed to file procesures turns
* into an URI.
*
* Returns: TRUE on success.
*
* Since: GIMP 2.10
**/
gboolean
gimp_register_file_handler_uri (const gchar *procedure_name)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp-register-file-handler-uri",
&nreturn_vals,
GIMP_PDB_STRING, procedure_name,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_register_thumbnail_loader:
* @load_proc: The name of the procedure the thumbnail loader with.

View File

@ -62,6 +62,7 @@ gboolean gimp_register_save_handler (const gchar *procedure_name,
const gchar *prefixes);
gboolean gimp_register_file_handler_mime (const gchar *procedure_name,
const gchar *mime_type);
gboolean gimp_register_file_handler_uri (const gchar *procedure_name);
gboolean gimp_register_thumbnail_loader (const gchar *load_proc,
const gchar *thumb_proc);