mirror of https://github.com/GNOME/gimp.git
app: remove plug_in_icc_profile_info() and _file_info()
because they are unused now.
This commit is contained in:
parent
ed13993aff
commit
89fe232735
|
@ -43,15 +43,6 @@
|
|||
|
||||
|
||||
#define ICC_PROFILE_APPLY_RGB_PROC "plug-in-icc-profile-apply-rgb"
|
||||
#define ICC_PROFILE_INFO_PROC "plug-in-icc-profile-info"
|
||||
#define ICC_PROFILE_FILE_INFO_PROC "plug-in-icc-profile-file-info"
|
||||
|
||||
|
||||
static void
|
||||
plug_in_icc_profile_info_return (GimpValueArray *return_vals,
|
||||
gchar **name,
|
||||
gchar **desc,
|
||||
gchar **info);
|
||||
|
||||
|
||||
gboolean
|
||||
|
@ -145,151 +136,3 @@ plug_in_icc_profile_apply_rgb (GimpImage *image,
|
|||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
plug_in_icc_profile_info (GimpImage *image,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
gchar **name,
|
||||
gchar **desc,
|
||||
gchar **info,
|
||||
GError **error)
|
||||
{
|
||||
Gimp *gimp;
|
||||
GimpProcedure *procedure;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
||||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE);
|
||||
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), FALSE);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||
|
||||
gimp = image->gimp;
|
||||
|
||||
procedure = gimp_pdb_lookup_procedure (gimp->pdb, ICC_PROFILE_INFO_PROC);
|
||||
|
||||
if (procedure &&
|
||||
procedure->num_args >= 1 &&
|
||||
GIMP_IS_PARAM_SPEC_IMAGE_ID (procedure->args[0]))
|
||||
{
|
||||
GimpValueArray *return_vals;
|
||||
GimpPDBStatusType status;
|
||||
|
||||
return_vals =
|
||||
gimp_pdb_execute_procedure_by_name (gimp->pdb, context, progress, error,
|
||||
ICC_PROFILE_INFO_PROC,
|
||||
GIMP_TYPE_IMAGE_ID,
|
||||
gimp_image_get_ID (image),
|
||||
G_TYPE_NONE);
|
||||
|
||||
status = g_value_get_enum (gimp_value_array_index (return_vals, 0));
|
||||
|
||||
switch (status)
|
||||
{
|
||||
case GIMP_PDB_SUCCESS:
|
||||
plug_in_icc_profile_info_return (return_vals, name, desc, info);
|
||||
break;
|
||||
|
||||
default:
|
||||
if (error && *error == NULL)
|
||||
g_set_error (error, GIMP_PLUG_IN_ERROR, GIMP_PLUG_IN_FAILED,
|
||||
_("Error running '%s'"), ICC_PROFILE_INFO_PROC);
|
||||
break;
|
||||
}
|
||||
|
||||
gimp_value_array_unref (return_vals);
|
||||
|
||||
return (status == GIMP_PDB_SUCCESS);
|
||||
}
|
||||
|
||||
g_set_error (error, GIMP_PLUG_IN_ERROR, GIMP_PLUG_IN_FAILED,
|
||||
_("Plug-In missing (%s)"), ICC_PROFILE_INFO_PROC);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
plug_in_icc_profile_file_info (Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const gchar *filename,
|
||||
gchar **name,
|
||||
gchar **desc,
|
||||
gchar **info,
|
||||
GError **error)
|
||||
{
|
||||
GimpProcedure *procedure;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
|
||||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE);
|
||||
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), FALSE);
|
||||
g_return_val_if_fail (filename != NULL, FALSE);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||
|
||||
procedure = gimp_pdb_lookup_procedure (gimp->pdb, ICC_PROFILE_FILE_INFO_PROC);
|
||||
|
||||
if (procedure &&
|
||||
procedure->num_args >= 1 &&
|
||||
GIMP_IS_PARAM_SPEC_STRING (procedure->args[0]))
|
||||
{
|
||||
GimpValueArray *return_vals;
|
||||
GimpPDBStatusType status;
|
||||
|
||||
return_vals =
|
||||
gimp_pdb_execute_procedure_by_name (gimp->pdb, context, progress, error,
|
||||
ICC_PROFILE_FILE_INFO_PROC,
|
||||
G_TYPE_STRING, filename,
|
||||
G_TYPE_NONE);
|
||||
|
||||
status = g_value_get_enum (gimp_value_array_index (return_vals, 0));
|
||||
|
||||
switch (status)
|
||||
{
|
||||
case GIMP_PDB_SUCCESS:
|
||||
plug_in_icc_profile_info_return (return_vals, name, desc, info);
|
||||
break;
|
||||
|
||||
default:
|
||||
if (error && *error == NULL)
|
||||
g_set_error (error, GIMP_PLUG_IN_ERROR, GIMP_PLUG_IN_FAILED,
|
||||
_("Error running '%s'"), ICC_PROFILE_FILE_INFO_PROC);
|
||||
break;
|
||||
}
|
||||
|
||||
gimp_value_array_unref (return_vals);
|
||||
|
||||
return (status == GIMP_PDB_SUCCESS);
|
||||
}
|
||||
|
||||
g_set_error (error, GIMP_PLUG_IN_ERROR, GIMP_PLUG_IN_FAILED,
|
||||
_("Plug-In missing (%s)"), ICC_PROFILE_FILE_INFO_PROC);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
plug_in_icc_profile_info_return (GimpValueArray *return_vals,
|
||||
gchar **name,
|
||||
gchar **desc,
|
||||
gchar **info)
|
||||
{
|
||||
if (name)
|
||||
{
|
||||
GValue *value = gimp_value_array_index (return_vals, 1);
|
||||
|
||||
*name = G_VALUE_HOLDS_STRING (value) ? g_value_dup_string (value) : NULL;
|
||||
}
|
||||
|
||||
if (desc)
|
||||
{
|
||||
GValue *value = gimp_value_array_index (return_vals, 2);
|
||||
|
||||
*desc = G_VALUE_HOLDS_STRING (value) ? g_value_dup_string (value) : NULL;
|
||||
}
|
||||
|
||||
if (info)
|
||||
{
|
||||
GValue *value = gimp_value_array_index (return_vals, 3);
|
||||
|
||||
*info = G_VALUE_HOLDS_STRING (value) ? g_value_dup_string (value) : NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,22 +28,5 @@ gboolean plug_in_icc_profile_apply_rgb (GimpImage *image,
|
|||
GimpRunMode run_mode,
|
||||
GError **error);
|
||||
|
||||
gboolean plug_in_icc_profile_info (GimpImage *image,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
gchar **name,
|
||||
gchar **desc,
|
||||
gchar **info,
|
||||
GError **error);
|
||||
|
||||
gboolean plug_in_icc_profile_file_info (Gimp *gimp,
|
||||
GimpContext *context,
|
||||
GimpProgress *progress,
|
||||
const gchar *filename,
|
||||
gchar **name,
|
||||
gchar **desc,
|
||||
gchar **info,
|
||||
GError **error);
|
||||
|
||||
|
||||
#endif /* __PLUG_IN_ICC_PROFILE_H__ */
|
||||
|
|
Loading…
Reference in New Issue