2019-08-10 20:25:37 +02:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2024-04-20 03:08:57 +00:00
|
|
|
* gimpexportprocedure.c
|
2019-08-10 20:25:37 +02:00
|
|
|
* Copyright (C) 2019 Michael Natterer <mitch@gimp.org>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include "gimp.h"
|
2019-08-11 13:21:55 +02:00
|
|
|
|
2023-10-15 16:34:11 +02:00
|
|
|
#include "libgimpbase/gimpwire.h" /* FIXME kill this include */
|
|
|
|
|
2019-09-10 21:24:09 +02:00
|
|
|
#include "gimppdb_pdb.h"
|
2023-10-15 16:34:11 +02:00
|
|
|
#include "gimpplugin-private.h"
|
2024-04-20 03:08:57 +00:00
|
|
|
#include "gimpexportprocedure.h"
|
2023-10-15 17:01:47 +02:00
|
|
|
#include "gimpprocedureconfig-private.h"
|
2019-08-10 20:25:37 +02:00
|
|
|
|
2023-08-14 05:34:03 +03:00
|
|
|
#include "libgimp-intl.h"
|
2019-08-10 20:25:37 +02:00
|
|
|
|
2024-04-24 16:02:08 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GimpExportProcedure:
|
|
|
|
*
|
|
|
|
* Export procedures implement image export.
|
|
|
|
*
|
|
|
|
* Registered export procedures will be automatically available in the export
|
|
|
|
* interfaces and functions of GIMP. The detection (to decide which file is
|
|
|
|
* redirected to which plug-in procedure) depends on the various methods set
|
|
|
|
* with [class@FileProcedure] API.
|
|
|
|
**/
|
|
|
|
|
2020-11-21 01:15:15 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
2024-05-06 18:38:12 +00:00
|
|
|
PROP_CAPABILITIES,
|
2020-11-21 01:15:15 +01:00
|
|
|
PROP_SUPPORTS_EXIF,
|
|
|
|
PROP_SUPPORTS_IPTC,
|
|
|
|
PROP_SUPPORTS_XMP,
|
|
|
|
PROP_SUPPORTS_PROFILE,
|
|
|
|
PROP_SUPPORTS_THUMBNAIL,
|
|
|
|
PROP_SUPPORTS_COMMENT,
|
|
|
|
N_PROPS
|
|
|
|
};
|
|
|
|
|
2024-07-10 15:03:15 +02:00
|
|
|
struct _GimpExportProcedure
|
2019-08-10 20:25:37 +02:00
|
|
|
{
|
2024-11-01 19:13:02 +01:00
|
|
|
GimpFileProcedure parent_instance;
|
2024-07-10 15:03:15 +02:00
|
|
|
|
2024-11-01 19:13:02 +01:00
|
|
|
GimpRunExportFunc run_func;
|
|
|
|
gpointer run_data;
|
|
|
|
GDestroyNotify run_data_destroy;
|
2024-04-20 03:08:57 +00:00
|
|
|
|
2024-11-01 19:13:02 +01:00
|
|
|
GimpExportCapabilities capabilities;
|
|
|
|
GimpExportGetCapabilitiesFunc get_capabilities_func;
|
|
|
|
gpointer get_capabilities_data;
|
|
|
|
GDestroyNotify get_capabilities_data_destroy;
|
2024-04-20 03:08:57 +00:00
|
|
|
|
2024-11-01 19:13:02 +01:00
|
|
|
gboolean supports_exif;
|
|
|
|
gboolean supports_iptc;
|
|
|
|
gboolean supports_xmp;
|
|
|
|
gboolean supports_profile;
|
|
|
|
gboolean supports_thumbnail;
|
|
|
|
gboolean supports_comment;
|
2024-05-06 18:38:12 +00:00
|
|
|
|
2024-11-01 19:13:02 +01:00
|
|
|
gboolean export_metadata;
|
2019-08-10 20:25:37 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2024-05-06 18:38:12 +00:00
|
|
|
static void gimp_export_procedure_constructed (GObject *object);
|
|
|
|
static void gimp_export_procedure_finalize (GObject *object);
|
|
|
|
static void gimp_export_procedure_set_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec);
|
|
|
|
static void gimp_export_procedure_get_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec);
|
2019-08-10 20:25:37 +02:00
|
|
|
|
2024-05-06 18:38:12 +00:00
|
|
|
static void gimp_export_procedure_install (GimpProcedure *procedure);
|
2019-08-10 20:25:37 +02:00
|
|
|
static GimpValueArray *
|
2024-05-06 18:38:12 +00:00
|
|
|
gimp_export_procedure_run (GimpProcedure *procedure,
|
|
|
|
const GimpValueArray *args);
|
2019-09-24 00:59:50 +02:00
|
|
|
static GimpProcedureConfig *
|
2024-05-06 18:38:12 +00:00
|
|
|
gimp_export_procedure_create_config (GimpProcedure *procedure,
|
|
|
|
GParamSpec **args,
|
|
|
|
gint n_args);
|
|
|
|
|
2025-01-20 17:54:51 +01:00
|
|
|
static gint gimp_export_procedure_add_metadata (GimpExportProcedure *export_procedure);
|
2019-08-10 20:25:37 +02:00
|
|
|
|
2024-05-06 18:38:12 +00:00
|
|
|
static void gimp_export_procedure_update_options (GimpProcedureConfig *config,
|
|
|
|
GParamSpec *param,
|
|
|
|
gpointer data);
|
2020-11-21 01:15:15 +01:00
|
|
|
|
2019-08-10 20:25:37 +02:00
|
|
|
|
2024-07-10 15:03:15 +02:00
|
|
|
G_DEFINE_TYPE (GimpExportProcedure, gimp_export_procedure, GIMP_TYPE_FILE_PROCEDURE)
|
2019-08-10 20:25:37 +02:00
|
|
|
|
2024-04-20 03:08:57 +00:00
|
|
|
#define parent_class gimp_export_procedure_parent_class
|
2019-08-10 20:25:37 +02:00
|
|
|
|
2020-11-21 01:15:15 +01:00
|
|
|
static GParamSpec *props[N_PROPS] = { NULL, };
|
2019-08-10 20:25:37 +02:00
|
|
|
|
|
|
|
static void
|
2024-04-20 03:08:57 +00:00
|
|
|
gimp_export_procedure_class_init (GimpExportProcedureClass *klass)
|
2019-08-10 20:25:37 +02:00
|
|
|
{
|
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
|
|
|
GimpProcedureClass *procedure_class = GIMP_PROCEDURE_CLASS (klass);
|
|
|
|
|
2024-04-20 03:08:57 +00:00
|
|
|
object_class->constructed = gimp_export_procedure_constructed;
|
|
|
|
object_class->finalize = gimp_export_procedure_finalize;
|
|
|
|
object_class->get_property = gimp_export_procedure_get_property;
|
|
|
|
object_class->set_property = gimp_export_procedure_set_property;
|
2019-08-10 20:25:37 +02:00
|
|
|
|
2024-04-20 03:08:57 +00:00
|
|
|
procedure_class->install = gimp_export_procedure_install;
|
|
|
|
procedure_class->run = gimp_export_procedure_run;
|
|
|
|
procedure_class->create_config = gimp_export_procedure_create_config;
|
2020-11-21 01:15:15 +01:00
|
|
|
|
2024-05-06 18:38:12 +00:00
|
|
|
/**
|
|
|
|
* GimpExportProcedure:capabilities:
|
|
|
|
*
|
|
|
|
* What #GimpExportCapabilities are supported
|
|
|
|
*
|
|
|
|
* Since: 3.0.0
|
|
|
|
*/
|
2024-11-01 19:13:02 +01:00
|
|
|
props[PROP_CAPABILITIES] = g_param_spec_flags ("capabilities",
|
|
|
|
"Supported image capabilities",
|
|
|
|
NULL,
|
|
|
|
GIMP_TYPE_EXPORT_CAPABILITIES,
|
|
|
|
0,
|
|
|
|
G_PARAM_CONSTRUCT |
|
|
|
|
GIMP_PARAM_READWRITE);
|
2024-05-06 18:38:12 +00:00
|
|
|
|
2020-11-21 01:15:15 +01:00
|
|
|
/**
|
2024-04-20 03:08:57 +00:00
|
|
|
* GimpExportProcedure:supports-exif:
|
2020-11-21 01:15:15 +01:00
|
|
|
*
|
2024-04-20 03:08:57 +00:00
|
|
|
* Whether the export procedure supports EXIF.
|
2020-11-21 01:15:15 +01:00
|
|
|
*
|
|
|
|
* Since: 3.0.0
|
|
|
|
*/
|
|
|
|
props[PROP_SUPPORTS_EXIF] = g_param_spec_boolean ("supports-exif",
|
|
|
|
"Supports EXIF metadata storage",
|
|
|
|
NULL,
|
|
|
|
FALSE,
|
|
|
|
G_PARAM_CONSTRUCT |
|
|
|
|
GIMP_PARAM_READWRITE);
|
|
|
|
/**
|
2024-04-20 03:08:57 +00:00
|
|
|
* GimpExportProcedure:supports-iptc:
|
2020-11-21 01:15:15 +01:00
|
|
|
*
|
2024-04-20 03:08:57 +00:00
|
|
|
* Whether the export procedure supports IPTC.
|
2020-11-21 01:15:15 +01:00
|
|
|
*
|
|
|
|
* Since: 3.0.0
|
|
|
|
*/
|
|
|
|
props[PROP_SUPPORTS_IPTC] = g_param_spec_boolean ("supports-iptc",
|
|
|
|
"Supports IPTC metadata storage",
|
|
|
|
NULL,
|
|
|
|
FALSE,
|
|
|
|
G_PARAM_CONSTRUCT |
|
|
|
|
GIMP_PARAM_READWRITE);
|
|
|
|
/**
|
2024-04-20 03:08:57 +00:00
|
|
|
* GimpExportProcedure:supports-xmp:
|
2020-11-21 01:15:15 +01:00
|
|
|
*
|
2024-04-20 03:08:57 +00:00
|
|
|
* Whether the export procedure supports XMP.
|
2020-11-21 01:15:15 +01:00
|
|
|
*
|
|
|
|
* Since: 3.0.0
|
|
|
|
*/
|
|
|
|
props[PROP_SUPPORTS_XMP] = g_param_spec_boolean ("supports-xmp",
|
|
|
|
"Supports XMP metadata storage",
|
|
|
|
NULL,
|
|
|
|
FALSE,
|
|
|
|
G_PARAM_CONSTRUCT |
|
|
|
|
GIMP_PARAM_READWRITE);
|
|
|
|
/**
|
2024-04-20 03:08:57 +00:00
|
|
|
* GimpExportProcedure:supports-profile:
|
2020-11-21 01:15:15 +01:00
|
|
|
*
|
2024-04-20 03:08:57 +00:00
|
|
|
* Whether the export procedure supports ICC color profiles.
|
2020-11-21 01:15:15 +01:00
|
|
|
*
|
|
|
|
* Since: 3.0.0
|
|
|
|
*/
|
|
|
|
props[PROP_SUPPORTS_PROFILE] = g_param_spec_boolean ("supports-profile",
|
|
|
|
"Supports color profile storage",
|
|
|
|
NULL,
|
|
|
|
FALSE,
|
|
|
|
G_PARAM_CONSTRUCT |
|
|
|
|
GIMP_PARAM_READWRITE);
|
|
|
|
/**
|
2024-04-20 03:08:57 +00:00
|
|
|
* GimpExportProcedure:supports-thumbnail:
|
2020-11-21 01:15:15 +01:00
|
|
|
*
|
2024-04-20 03:08:57 +00:00
|
|
|
* Whether the export procedure supports storing a thumbnail.
|
2020-11-21 01:15:15 +01:00
|
|
|
*
|
|
|
|
* Since: 3.0.0
|
|
|
|
*/
|
|
|
|
props[PROP_SUPPORTS_THUMBNAIL] = g_param_spec_boolean ("supports-thumbnail",
|
|
|
|
"Supports thumbnail storage",
|
|
|
|
NULL,
|
|
|
|
FALSE,
|
|
|
|
G_PARAM_CONSTRUCT |
|
|
|
|
GIMP_PARAM_READWRITE);
|
|
|
|
/**
|
2024-04-20 03:08:57 +00:00
|
|
|
* GimpExportProcedure:supports-comment:
|
2020-11-21 01:15:15 +01:00
|
|
|
*
|
2024-04-20 03:08:57 +00:00
|
|
|
* Whether the export procedure supports storing a comment.
|
2020-11-21 01:15:15 +01:00
|
|
|
*
|
|
|
|
* Since: 3.0.0
|
|
|
|
*/
|
|
|
|
props[PROP_SUPPORTS_COMMENT] = g_param_spec_boolean ("supports-comment",
|
|
|
|
"Supports comment storage",
|
|
|
|
NULL,
|
|
|
|
FALSE,
|
|
|
|
G_PARAM_CONSTRUCT |
|
|
|
|
GIMP_PARAM_READWRITE);
|
|
|
|
|
|
|
|
g_object_class_install_properties (object_class, N_PROPS, props);
|
2019-08-10 20:25:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2024-04-20 03:08:57 +00:00
|
|
|
gimp_export_procedure_init (GimpExportProcedure *procedure)
|
2019-08-10 20:25:37 +02:00
|
|
|
{
|
2024-07-10 15:03:15 +02:00
|
|
|
procedure->export_metadata = FALSE;
|
2024-05-06 18:38:12 +00:00
|
|
|
procedure->capabilities = 0;
|
2019-08-10 20:25:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2024-04-20 03:08:57 +00:00
|
|
|
gimp_export_procedure_constructed (GObject *object)
|
2019-08-10 20:25:37 +02:00
|
|
|
{
|
|
|
|
GimpProcedure *procedure = GIMP_PROCEDURE (object);
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->constructed (object);
|
|
|
|
|
2024-06-12 16:53:12 +00:00
|
|
|
gimp_procedure_add_image_argument (procedure, "image",
|
|
|
|
"Image",
|
|
|
|
"The image to export",
|
|
|
|
FALSE,
|
|
|
|
G_PARAM_READWRITE);
|
|
|
|
|
|
|
|
gimp_procedure_add_file_argument (procedure, "file",
|
|
|
|
"File",
|
|
|
|
"The file to export to",
|
2025-01-22 17:15:28 +01:00
|
|
|
GIMP_FILE_CHOOSER_ACTION_SAVE,
|
|
|
|
FALSE, NULL,
|
2024-06-12 16:53:12 +00:00
|
|
|
GIMP_PARAM_READWRITE);
|
2024-05-06 18:38:12 +00:00
|
|
|
|
|
|
|
_gimp_procedure_add_argument (procedure,
|
|
|
|
gimp_param_spec_export_options ("options", "Options",
|
2024-11-01 19:13:02 +01:00
|
|
|
"Export options",
|
2024-05-06 18:38:12 +00:00
|
|
|
G_PARAM_READWRITE));
|
2019-08-10 20:25:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2024-04-20 03:08:57 +00:00
|
|
|
gimp_export_procedure_finalize (GObject *object)
|
2019-08-10 20:25:37 +02:00
|
|
|
{
|
2024-04-20 03:08:57 +00:00
|
|
|
GimpExportProcedure *procedure = GIMP_EXPORT_PROCEDURE (object);
|
2019-08-10 20:25:37 +02:00
|
|
|
|
2024-07-10 15:03:15 +02:00
|
|
|
if (procedure->run_data_destroy)
|
|
|
|
procedure->run_data_destroy (procedure->run_data);
|
2019-08-10 20:25:37 +02:00
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
2020-11-21 01:15:15 +01:00
|
|
|
static void
|
2024-04-20 03:08:57 +00:00
|
|
|
gimp_export_procedure_set_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec)
|
2020-11-21 01:15:15 +01:00
|
|
|
{
|
2024-04-20 03:08:57 +00:00
|
|
|
GimpExportProcedure *procedure = GIMP_EXPORT_PROCEDURE (object);
|
2020-11-21 01:15:15 +01:00
|
|
|
|
|
|
|
switch (property_id)
|
|
|
|
{
|
2024-05-06 18:38:12 +00:00
|
|
|
case PROP_CAPABILITIES:
|
2024-11-01 19:13:02 +01:00
|
|
|
procedure->capabilities = g_value_get_flags (value);
|
2024-05-06 18:38:12 +00:00
|
|
|
break;
|
2020-11-21 01:15:15 +01:00
|
|
|
case PROP_SUPPORTS_EXIF:
|
2024-07-10 15:03:15 +02:00
|
|
|
procedure->supports_exif = g_value_get_boolean (value);
|
2020-11-21 01:15:15 +01:00
|
|
|
break;
|
|
|
|
case PROP_SUPPORTS_IPTC:
|
2024-07-10 15:03:15 +02:00
|
|
|
procedure->supports_iptc = g_value_get_boolean (value);
|
2020-11-21 01:15:15 +01:00
|
|
|
break;
|
|
|
|
case PROP_SUPPORTS_XMP:
|
2024-07-10 15:03:15 +02:00
|
|
|
procedure->supports_xmp = g_value_get_boolean (value);
|
2020-11-21 01:15:15 +01:00
|
|
|
break;
|
|
|
|
case PROP_SUPPORTS_PROFILE:
|
2024-07-10 15:03:15 +02:00
|
|
|
procedure->supports_profile = g_value_get_boolean (value);
|
2020-11-21 01:15:15 +01:00
|
|
|
break;
|
|
|
|
case PROP_SUPPORTS_THUMBNAIL:
|
2024-07-10 15:03:15 +02:00
|
|
|
procedure->supports_thumbnail = g_value_get_boolean (value);
|
2020-11-21 01:15:15 +01:00
|
|
|
break;
|
|
|
|
case PROP_SUPPORTS_COMMENT:
|
2024-07-10 15:03:15 +02:00
|
|
|
procedure->supports_comment = g_value_get_boolean (value);
|
2020-11-21 01:15:15 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2024-04-20 03:08:57 +00:00
|
|
|
gimp_export_procedure_get_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
2020-11-21 01:15:15 +01:00
|
|
|
{
|
2024-04-20 03:08:57 +00:00
|
|
|
GimpExportProcedure *procedure = GIMP_EXPORT_PROCEDURE (object);
|
2020-11-21 01:15:15 +01:00
|
|
|
|
|
|
|
switch (property_id)
|
|
|
|
{
|
2024-05-06 18:38:12 +00:00
|
|
|
case PROP_CAPABILITIES:
|
2024-11-01 19:13:02 +01:00
|
|
|
g_value_set_flags (value, procedure->capabilities);
|
2024-05-06 18:38:12 +00:00
|
|
|
break;
|
2020-11-21 01:15:15 +01:00
|
|
|
case PROP_SUPPORTS_EXIF:
|
2024-07-10 15:03:15 +02:00
|
|
|
g_value_set_boolean (value, procedure->supports_exif);
|
2020-11-21 01:15:15 +01:00
|
|
|
break;
|
|
|
|
case PROP_SUPPORTS_IPTC:
|
2024-07-10 15:03:15 +02:00
|
|
|
g_value_set_boolean (value, procedure->supports_iptc);
|
2020-11-21 01:15:15 +01:00
|
|
|
break;
|
|
|
|
case PROP_SUPPORTS_XMP:
|
2024-07-10 15:03:15 +02:00
|
|
|
g_value_set_boolean (value, procedure->supports_xmp);
|
2020-11-21 01:15:15 +01:00
|
|
|
break;
|
|
|
|
case PROP_SUPPORTS_PROFILE:
|
2024-07-10 15:03:15 +02:00
|
|
|
g_value_set_boolean (value, procedure->supports_profile);
|
2020-11-21 01:15:15 +01:00
|
|
|
break;
|
|
|
|
case PROP_SUPPORTS_THUMBNAIL:
|
2024-07-10 15:03:15 +02:00
|
|
|
g_value_set_boolean (value, procedure->supports_thumbnail);
|
2020-11-21 01:15:15 +01:00
|
|
|
break;
|
|
|
|
case PROP_SUPPORTS_COMMENT:
|
2024-07-10 15:03:15 +02:00
|
|
|
g_value_set_boolean (value, procedure->supports_comment);
|
2020-11-21 01:15:15 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-08-10 20:25:37 +02:00
|
|
|
static void
|
2024-04-20 03:08:57 +00:00
|
|
|
gimp_export_procedure_install (GimpProcedure *procedure)
|
2019-08-10 20:25:37 +02:00
|
|
|
{
|
|
|
|
GimpFileProcedure *file_proc = GIMP_FILE_PROCEDURE (procedure);
|
|
|
|
const gchar *mime_types;
|
|
|
|
gint priority;
|
|
|
|
|
2024-04-20 03:08:57 +00:00
|
|
|
gimp_export_procedure_add_metadata (GIMP_EXPORT_PROCEDURE (procedure));
|
2019-08-10 20:25:37 +02:00
|
|
|
GIMP_PROCEDURE_CLASS (parent_class)->install (procedure);
|
|
|
|
|
2025-01-21 17:18:48 +01:00
|
|
|
_gimp_pdb_set_file_proc_export_handler (gimp_procedure_get_name (procedure),
|
|
|
|
gimp_file_procedure_get_extensions (file_proc),
|
|
|
|
gimp_file_procedure_get_prefixes (file_proc));
|
2019-08-10 20:25:37 +02:00
|
|
|
|
2019-08-19 12:05:12 +02:00
|
|
|
if (gimp_file_procedure_get_handles_remote (file_proc))
|
2019-09-10 21:24:09 +02:00
|
|
|
_gimp_pdb_set_file_proc_handles_remote (gimp_procedure_get_name (procedure));
|
2019-08-10 20:25:37 +02:00
|
|
|
|
|
|
|
mime_types = gimp_file_procedure_get_mime_types (file_proc);
|
|
|
|
if (mime_types)
|
2019-09-10 21:24:09 +02:00
|
|
|
_gimp_pdb_set_file_proc_mime_types (gimp_procedure_get_name (procedure),
|
|
|
|
mime_types);
|
2019-08-10 20:25:37 +02:00
|
|
|
|
|
|
|
priority = gimp_file_procedure_get_priority (file_proc);
|
|
|
|
if (priority != 0)
|
2019-09-10 21:24:09 +02:00
|
|
|
_gimp_pdb_set_file_proc_priority (gimp_procedure_get_name (procedure),
|
|
|
|
priority);
|
2019-08-10 20:25:37 +02:00
|
|
|
}
|
|
|
|
|
2024-05-06 18:38:12 +00:00
|
|
|
#define ARG_OFFSET 4
|
2019-09-24 00:59:50 +02:00
|
|
|
|
2019-08-10 20:25:37 +02:00
|
|
|
static GimpValueArray *
|
2024-04-20 03:08:57 +00:00
|
|
|
gimp_export_procedure_run (GimpProcedure *procedure,
|
|
|
|
const GimpValueArray *args)
|
2019-08-10 20:25:37 +02:00
|
|
|
{
|
2023-10-15 16:34:11 +02:00
|
|
|
GimpPlugIn *plug_in;
|
2024-04-20 03:08:57 +00:00
|
|
|
GimpExportProcedure *export_proc = GIMP_EXPORT_PROCEDURE (procedure);
|
2023-07-22 23:49:47 +02:00
|
|
|
GimpValueArray *remaining;
|
|
|
|
GimpValueArray *return_values;
|
|
|
|
GimpProcedureConfig *config;
|
|
|
|
GimpRunMode run_mode;
|
|
|
|
GimpImage *image;
|
|
|
|
GFile *file;
|
|
|
|
GimpMetadata *metadata;
|
2024-05-06 18:38:12 +00:00
|
|
|
GimpExportOptions *options = NULL;
|
|
|
|
gchar *mimetype = NULL;
|
|
|
|
GimpPDBStatusType status = GIMP_PDB_EXECUTION_ERROR;
|
|
|
|
gboolean free_options = FALSE;
|
2019-08-10 20:25:37 +02:00
|
|
|
|
2024-04-30 13:50:24 +00:00
|
|
|
run_mode = GIMP_VALUES_GET_ENUM (args, 0);
|
|
|
|
image = GIMP_VALUES_GET_IMAGE (args, 1);
|
|
|
|
file = GIMP_VALUES_GET_FILE (args, 2);
|
2024-05-06 18:38:12 +00:00
|
|
|
options = g_value_get_object (gimp_value_array_index (args, 3));
|
2019-08-10 20:25:37 +02:00
|
|
|
|
2019-09-24 00:59:50 +02:00
|
|
|
remaining = gimp_value_array_new (gimp_value_array_length (args) - ARG_OFFSET);
|
2019-08-10 20:25:37 +02:00
|
|
|
|
2023-07-22 23:49:47 +02:00
|
|
|
for (gint i = ARG_OFFSET; i < gimp_value_array_length (args); i++)
|
2019-08-10 20:25:37 +02:00
|
|
|
{
|
|
|
|
GValue *value = gimp_value_array_index (args, i);
|
|
|
|
|
|
|
|
gimp_value_array_append (remaining, value);
|
|
|
|
}
|
|
|
|
|
2024-05-01 21:47:55 +02:00
|
|
|
config = _gimp_procedure_create_run_config (procedure);
|
2024-07-10 15:03:15 +02:00
|
|
|
if (export_proc->export_metadata)
|
2023-07-20 22:47:46 +02:00
|
|
|
{
|
2023-07-22 23:49:47 +02:00
|
|
|
mimetype = (gchar *) gimp_file_procedure_get_mime_types (GIMP_FILE_PROCEDURE (procedure));
|
|
|
|
if (mimetype == NULL)
|
|
|
|
{
|
2024-04-20 03:08:57 +00:00
|
|
|
g_printerr ("%s: ERROR: the GimpExportProcedureConfig object was created "
|
2023-07-22 23:49:47 +02:00
|
|
|
"with export_metadata but you didn't set any MimeType with gimp_file_procedure_set_mime_types()!\n",
|
|
|
|
G_STRFUNC);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
char *delim;
|
|
|
|
|
|
|
|
mimetype = g_strdup (mimetype);
|
|
|
|
mimetype = g_strstrip (mimetype);
|
|
|
|
delim = strstr (mimetype, ",");
|
|
|
|
if (delim)
|
|
|
|
*delim = '\0';
|
|
|
|
/* Though docs only writes about the list being comma-separated, our
|
|
|
|
* code apparently also split by spaces.
|
|
|
|
*/
|
|
|
|
delim = strstr (mimetype, " ");
|
|
|
|
if (delim)
|
|
|
|
*delim = '\0';
|
|
|
|
delim = strstr (mimetype, "\t");
|
|
|
|
if (delim)
|
|
|
|
*delim = '\0';
|
|
|
|
}
|
2023-07-20 22:47:46 +02:00
|
|
|
}
|
2023-10-15 17:01:47 +02:00
|
|
|
metadata = _gimp_procedure_config_begin_export (config, image, run_mode, remaining, mimetype);
|
2023-07-22 23:49:47 +02:00
|
|
|
g_free (mimetype);
|
|
|
|
|
2024-05-06 18:38:12 +00:00
|
|
|
/* GimpExportOptions may be null if called non-interactively from a script,
|
|
|
|
* so we'll make sure it's initialized */
|
|
|
|
if (options == NULL)
|
|
|
|
{
|
app, libgimp*, pdb, plug-ins: review and enhance MR !1549.
- Fix annotations for gimp_export_options_get_image() to make it
actually introspectable with the GimpImage being both input and
output. Even though the logic doesn't change much (the input image may
be overriden or not), it doesn't matter for introspection because
images are handled centrally by libgimp and therefore must not be
freed. Actually deleting the image from the central list of images
though remains a manual action depending on code logic, not some
automatic action to be handled by binding engines.
- Add G_GNUC_WARN_UNUSED_RESULT to gimp_export_options_get_image()
because ignoring the returned value is rarely a good idea (as you
usually want to delete the image).
- Remove gimp_export_options_new(): we don't need this constructor
because at this point, the best is to tell plug-in developers to just
pass NULL everywhere. This leaves us free to create a more useful
default constructor if needed, in the future. Main description for
GimpExportOptions has also been updated to say this.
- Add a data_destroy callback for the user data passed in
gimp_export_procedure_set_capabilities().
- Fixing annotations of 'export_options' object from pdb/pdb.pl: input
args would actually be (nullable) and would not transfer ownership
(calling code must still free the object). Return value's ownership on
the other hand is fully transfered.
- Add C and Python unit testing for GimpExportOptions and
gimp_export_options_get_image() in particular.
- Fix or improve various details.
Note that I have also considered for a long time changing the signature
of gimp_export_options_get_image() to return a boolean indicating
whether `image` had been replaced (hence needed deletion) or not. This
also meant getting rid of the GimpExportReturn enum. Right now it would
work because there are no third case, but I was considering the future
possibility that for instance we got some impossible conversion for some
future capability. I'm not sure it would ever happen; and for sure, this
is not desirable because it implies an export failure a bit late in the
workflow. But just in case, let's keep the enum return value. It does
not even make the using code that much more complicated (well just a
value comparison instead of a simple boolean test).
2024-08-17 15:06:27 +02:00
|
|
|
options = g_object_new (GIMP_TYPE_EXPORT_OPTIONS, NULL);
|
2024-05-06 18:38:12 +00:00
|
|
|
free_options = TRUE;
|
|
|
|
}
|
|
|
|
|
2024-11-01 19:13:02 +01:00
|
|
|
if (export_proc->get_capabilities_func != NULL)
|
2024-05-06 18:38:12 +00:00
|
|
|
{
|
2024-11-01 19:13:02 +01:00
|
|
|
GimpExportCapabilities capabilities;
|
|
|
|
|
|
|
|
capabilities = export_proc->get_capabilities_func (procedure, config, options,
|
|
|
|
export_proc->get_capabilities_data);
|
|
|
|
|
|
|
|
g_object_set (G_OBJECT (options),
|
|
|
|
"capabilities", capabilities,
|
|
|
|
NULL);
|
2024-05-06 18:38:12 +00:00
|
|
|
|
|
|
|
g_signal_connect_object (config, "notify",
|
|
|
|
G_CALLBACK (gimp_export_procedure_update_options),
|
|
|
|
options, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_object_set (options,
|
|
|
|
"capabilities", export_proc->capabilities,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
2024-07-10 15:03:15 +02:00
|
|
|
return_values = export_proc->run_func (procedure, run_mode, image,
|
2024-05-06 18:38:12 +00:00
|
|
|
file, options, metadata,
|
|
|
|
config, export_proc->run_data);
|
2023-07-22 23:49:47 +02:00
|
|
|
|
|
|
|
if (return_values != NULL &&
|
|
|
|
gimp_value_array_length (return_values) > 0 &&
|
|
|
|
G_VALUE_HOLDS_ENUM (gimp_value_array_index (return_values, 0)))
|
|
|
|
status = GIMP_VALUES_GET_ENUM (return_values, 0);
|
|
|
|
|
2023-10-15 17:01:47 +02:00
|
|
|
_gimp_procedure_config_end_export (config, image, file, status);
|
2023-07-22 23:49:47 +02:00
|
|
|
|
|
|
|
/* This is debug printing to help plug-in developers figure out best
|
|
|
|
* practices.
|
|
|
|
*/
|
2023-10-15 16:34:11 +02:00
|
|
|
plug_in = gimp_procedure_get_plug_in (procedure);
|
|
|
|
if (G_OBJECT (config)->ref_count > 1 &&
|
|
|
|
_gimp_plug_in_manage_memory_manually (plug_in))
|
2024-04-20 03:08:57 +00:00
|
|
|
g_printerr ("%s: ERROR: the GimpExportProcedureConfig object was refed "
|
2023-07-22 23:49:47 +02:00
|
|
|
"by plug-in, it MUST NOT do that!\n", G_STRFUNC);
|
|
|
|
|
2024-05-06 18:38:12 +00:00
|
|
|
if (free_options)
|
|
|
|
g_object_unref (options);
|
2023-07-22 23:49:47 +02:00
|
|
|
g_object_unref (config);
|
2019-08-10 20:25:37 +02:00
|
|
|
gimp_value_array_unref (remaining);
|
|
|
|
|
2024-11-01 19:13:02 +01:00
|
|
|
if (export_proc->get_capabilities_data_destroy && export_proc->get_capabilities_data)
|
|
|
|
export_proc->get_capabilities_data_destroy (export_proc->get_capabilities_data);
|
app, libgimp*, pdb, plug-ins: review and enhance MR !1549.
- Fix annotations for gimp_export_options_get_image() to make it
actually introspectable with the GimpImage being both input and
output. Even though the logic doesn't change much (the input image may
be overriden or not), it doesn't matter for introspection because
images are handled centrally by libgimp and therefore must not be
freed. Actually deleting the image from the central list of images
though remains a manual action depending on code logic, not some
automatic action to be handled by binding engines.
- Add G_GNUC_WARN_UNUSED_RESULT to gimp_export_options_get_image()
because ignoring the returned value is rarely a good idea (as you
usually want to delete the image).
- Remove gimp_export_options_new(): we don't need this constructor
because at this point, the best is to tell plug-in developers to just
pass NULL everywhere. This leaves us free to create a more useful
default constructor if needed, in the future. Main description for
GimpExportOptions has also been updated to say this.
- Add a data_destroy callback for the user data passed in
gimp_export_procedure_set_capabilities().
- Fixing annotations of 'export_options' object from pdb/pdb.pl: input
args would actually be (nullable) and would not transfer ownership
(calling code must still free the object). Return value's ownership on
the other hand is fully transfered.
- Add C and Python unit testing for GimpExportOptions and
gimp_export_options_get_image() in particular.
- Fix or improve various details.
Note that I have also considered for a long time changing the signature
of gimp_export_options_get_image() to return a boolean indicating
whether `image` had been replaced (hence needed deletion) or not. This
also meant getting rid of the GimpExportReturn enum. Right now it would
work because there are no third case, but I was considering the future
possibility that for instance we got some impossible conversion for some
future capability. I'm not sure it would ever happen; and for sure, this
is not desirable because it implies an export failure a bit late in the
workflow. But just in case, let's keep the enum return value. It does
not even make the using code that much more complicated (well just a
value comparison instead of a simple boolean test).
2024-08-17 15:06:27 +02:00
|
|
|
|
2019-08-10 20:25:37 +02:00
|
|
|
return return_values;
|
|
|
|
}
|
|
|
|
|
2019-09-24 00:59:50 +02:00
|
|
|
static GimpProcedureConfig *
|
2024-04-20 03:08:57 +00:00
|
|
|
gimp_export_procedure_create_config (GimpProcedure *procedure,
|
|
|
|
GParamSpec **args,
|
|
|
|
gint n_args)
|
2019-09-24 00:59:50 +02:00
|
|
|
{
|
2025-01-20 17:54:51 +01:00
|
|
|
gint new_n_args;
|
|
|
|
|
|
|
|
new_n_args = gimp_export_procedure_add_metadata (GIMP_EXPORT_PROCEDURE (procedure));
|
|
|
|
new_n_args += n_args;
|
|
|
|
|
|
|
|
/* gimp_export_procedure_add_metadata() may modify the args array so
|
|
|
|
* our pointer may become invalid (reallocated to a bigger size).
|
|
|
|
* We need to requery the new args.
|
|
|
|
*/
|
|
|
|
args = gimp_procedure_get_arguments (procedure, &n_args);
|
|
|
|
g_return_val_if_fail (new_n_args == n_args, NULL);
|
2020-11-21 01:15:15 +01:00
|
|
|
|
2019-09-24 00:59:50 +02:00
|
|
|
if (n_args > ARG_OFFSET)
|
|
|
|
{
|
|
|
|
args += ARG_OFFSET;
|
|
|
|
n_args -= ARG_OFFSET;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
args = NULL;
|
|
|
|
n_args = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return GIMP_PROCEDURE_CLASS (parent_class)->create_config (procedure,
|
|
|
|
args,
|
|
|
|
n_args);
|
|
|
|
}
|
|
|
|
|
2025-01-20 17:54:51 +01:00
|
|
|
static gint
|
2024-04-20 03:08:57 +00:00
|
|
|
gimp_export_procedure_add_metadata (GimpExportProcedure *export_procedure)
|
2020-11-21 01:15:15 +01:00
|
|
|
{
|
2024-04-20 03:08:57 +00:00
|
|
|
GimpProcedure *procedure = GIMP_PROCEDURE (export_procedure);
|
2021-04-04 01:23:48 +02:00
|
|
|
static gboolean ran_once = FALSE;
|
2025-01-20 17:54:51 +01:00
|
|
|
gint new_args = 0;
|
2021-04-04 01:23:48 +02:00
|
|
|
|
|
|
|
if (ran_once)
|
2025-01-20 17:54:51 +01:00
|
|
|
return new_args;
|
2020-11-21 01:15:15 +01:00
|
|
|
|
2024-07-10 15:03:15 +02:00
|
|
|
if (export_procedure->supports_exif)
|
2025-01-20 17:54:51 +01:00
|
|
|
{
|
|
|
|
gimp_procedure_add_boolean_argument (procedure, "include-exif",
|
|
|
|
_("Save _Exif"),
|
|
|
|
_("Save Exif (Exchangeable image file format) metadata"),
|
|
|
|
gimp_export_exif (),
|
|
|
|
G_PARAM_READWRITE);
|
|
|
|
new_args++;
|
|
|
|
}
|
2024-07-10 15:03:15 +02:00
|
|
|
if (export_procedure->supports_iptc)
|
2025-01-20 17:54:51 +01:00
|
|
|
{
|
|
|
|
gimp_procedure_add_boolean_argument (procedure, "include-iptc",
|
|
|
|
_("Save _IPTC"),
|
|
|
|
_("Save IPTC (International Press Telecommunications Council) metadata"),
|
|
|
|
gimp_export_iptc (),
|
|
|
|
G_PARAM_READWRITE);
|
|
|
|
new_args++;
|
|
|
|
}
|
2024-07-10 15:03:15 +02:00
|
|
|
if (export_procedure->supports_xmp)
|
2025-01-20 17:54:51 +01:00
|
|
|
{
|
|
|
|
gimp_procedure_add_boolean_argument (procedure, "include-xmp",
|
|
|
|
_("Save _XMP"),
|
|
|
|
_("Save XMP (Extensible Metadata Platform) metadata"),
|
|
|
|
gimp_export_xmp (),
|
|
|
|
G_PARAM_READWRITE);
|
|
|
|
new_args++;
|
|
|
|
}
|
2024-07-10 15:03:15 +02:00
|
|
|
if (export_procedure->supports_profile)
|
2025-01-20 17:54:51 +01:00
|
|
|
{
|
|
|
|
gimp_procedure_add_boolean_argument (procedure, "include-color-profile",
|
|
|
|
_("Save color _profile"),
|
|
|
|
_("Save the ICC color profile as metadata"),
|
|
|
|
gimp_export_color_profile (),
|
|
|
|
G_PARAM_READWRITE);
|
|
|
|
new_args++;
|
|
|
|
}
|
2024-07-10 15:03:15 +02:00
|
|
|
if (export_procedure->supports_thumbnail)
|
2025-01-20 17:54:51 +01:00
|
|
|
{
|
|
|
|
gimp_procedure_add_boolean_argument (procedure, "include-thumbnail",
|
|
|
|
_("Save _thumbnail"),
|
|
|
|
_("Save a smaller representation of the image as metadata"),
|
|
|
|
gimp_export_thumbnail (),
|
|
|
|
G_PARAM_READWRITE);
|
|
|
|
new_args++;
|
|
|
|
}
|
2024-07-10 15:03:15 +02:00
|
|
|
if (export_procedure->supports_comment)
|
2020-11-21 01:15:15 +01:00
|
|
|
{
|
2025-01-20 17:54:51 +01:00
|
|
|
gimp_procedure_add_boolean_argument (procedure, "include-comment",
|
|
|
|
_("Save c_omment"),
|
|
|
|
_("Save a comment as metadata"),
|
|
|
|
gimp_export_comment (),
|
|
|
|
G_PARAM_READWRITE);
|
2024-06-12 16:53:12 +00:00
|
|
|
gimp_procedure_add_string_aux_argument (procedure, "gimp-comment",
|
|
|
|
_("Comment"),
|
|
|
|
_("Image comment"),
|
|
|
|
gimp_get_default_comment (),
|
|
|
|
G_PARAM_READWRITE);
|
2020-11-21 01:15:15 +01:00
|
|
|
|
|
|
|
gimp_procedure_set_argument_sync (procedure, "gimp-comment",
|
|
|
|
GIMP_ARGUMENT_SYNC_PARASITE);
|
2025-01-20 17:54:51 +01:00
|
|
|
new_args++;
|
2020-11-21 01:15:15 +01:00
|
|
|
}
|
|
|
|
|
2021-04-04 01:23:48 +02:00
|
|
|
ran_once = TRUE;
|
2025-01-20 17:54:51 +01:00
|
|
|
|
|
|
|
return new_args;
|
2020-11-21 01:15:15 +01:00
|
|
|
}
|
|
|
|
|
2024-05-06 18:38:12 +00:00
|
|
|
static void
|
|
|
|
gimp_export_procedure_update_options (GimpProcedureConfig *config,
|
|
|
|
GParamSpec *param,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2024-11-01 19:13:02 +01:00
|
|
|
GimpProcedure *procedure;
|
|
|
|
GimpExportProcedure *export_proc;
|
|
|
|
GimpExportOptions *options = GIMP_EXPORT_OPTIONS (data);
|
|
|
|
GimpExportCapabilities capabilities;
|
|
|
|
|
2024-05-06 18:38:12 +00:00
|
|
|
|
|
|
|
procedure = gimp_procedure_config_get_procedure (config);
|
|
|
|
export_proc = GIMP_EXPORT_PROCEDURE (procedure);
|
|
|
|
|
2024-11-01 19:13:02 +01:00
|
|
|
capabilities = export_proc->get_capabilities_func (procedure, config, options,
|
|
|
|
export_proc->get_capabilities_data);
|
|
|
|
|
|
|
|
g_object_set (G_OBJECT (options),
|
|
|
|
"capabilities", capabilities,
|
|
|
|
NULL);
|
2024-05-06 18:38:12 +00:00
|
|
|
}
|
|
|
|
|
2019-08-10 20:25:37 +02:00
|
|
|
|
|
|
|
/* public functions */
|
|
|
|
|
2019-08-11 14:58:55 +02:00
|
|
|
/**
|
2024-04-20 03:08:57 +00:00
|
|
|
* gimp_export_procedure_new:
|
2019-08-11 14:58:55 +02:00
|
|
|
* @plug_in: a #GimpPlugIn.
|
|
|
|
* @name: the new procedure's name.
|
|
|
|
* @proc_type: the new procedure's #GimpPDBProcType.
|
2023-07-22 23:49:47 +02:00
|
|
|
* @export_metadata: whether GIMP should handle metadata exporting.
|
2019-08-11 14:58:55 +02:00
|
|
|
* @run_func: the run function for the new procedure.
|
|
|
|
* @run_data: user data passed to @run_func.
|
|
|
|
* @run_data_destroy: (nullable): free function for @run_data, or %NULL.
|
|
|
|
*
|
2024-04-20 03:08:57 +00:00
|
|
|
* Creates a new export procedure named @name which will call @run_func
|
2019-08-11 14:58:55 +02:00
|
|
|
* when invoked.
|
|
|
|
*
|
|
|
|
* See gimp_procedure_new() for information about @proc_type.
|
|
|
|
*
|
2024-04-20 03:08:57 +00:00
|
|
|
* #GimpExportProcedure is a #GimpProcedure subclass that makes it easier
|
|
|
|
* to write file export procedures.
|
2019-08-11 14:58:55 +02:00
|
|
|
*
|
|
|
|
* It automatically adds the standard
|
|
|
|
*
|
2024-05-06 18:38:12 +00:00
|
|
|
* (#GimpRunMode, #GimpImage, #GFile, #GimpExportOptions)
|
2019-08-11 14:58:55 +02:00
|
|
|
*
|
2024-04-20 03:08:57 +00:00
|
|
|
* arguments of an export procedure. It is possible to add additional
|
2019-08-11 14:58:55 +02:00
|
|
|
* arguments.
|
|
|
|
*
|
|
|
|
* When invoked via gimp_procedure_run(), it unpacks these standard
|
2024-04-20 03:08:57 +00:00
|
|
|
* arguments and calls @run_func which is a #GimpRunExportFunc. The
|
|
|
|
* #GimpProcedureConfig of #GimpRunExportFunc only contains additionally added
|
2023-07-22 23:49:47 +02:00
|
|
|
* arguments.
|
|
|
|
*
|
|
|
|
* If @export_metadata is TRUE, then the class will also handle the metadata
|
|
|
|
* export if the format is supported by our backend. This requires you to also
|
|
|
|
* set appropriate MimeType with gimp_file_procedure_set_mime_types().
|
2019-08-11 14:58:55 +02:00
|
|
|
*
|
|
|
|
* Returns: a new #GimpProcedure.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
2023-07-22 23:49:47 +02:00
|
|
|
GimpProcedure *
|
2024-04-20 03:08:57 +00:00
|
|
|
gimp_export_procedure_new (GimpPlugIn *plug_in,
|
|
|
|
const gchar *name,
|
|
|
|
GimpPDBProcType proc_type,
|
|
|
|
gboolean export_metadata,
|
|
|
|
GimpRunExportFunc run_func,
|
|
|
|
gpointer run_data,
|
|
|
|
GDestroyNotify run_data_destroy)
|
2019-08-10 20:25:37 +02:00
|
|
|
{
|
2024-04-20 03:08:57 +00:00
|
|
|
GimpExportProcedure *procedure;
|
2019-08-10 20:25:37 +02:00
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_PLUG_IN (plug_in), NULL);
|
|
|
|
g_return_val_if_fail (gimp_is_canonical_identifier (name), NULL);
|
2019-08-30 12:52:28 +02:00
|
|
|
g_return_val_if_fail (proc_type != GIMP_PDB_PROC_TYPE_INTERNAL, NULL);
|
2024-09-29 17:45:45 +02:00
|
|
|
g_return_val_if_fail (proc_type != GIMP_PDB_PROC_TYPE_PERSISTENT, NULL);
|
2019-08-10 20:25:37 +02:00
|
|
|
g_return_val_if_fail (run_func != NULL, NULL);
|
|
|
|
|
2024-04-20 03:08:57 +00:00
|
|
|
procedure = g_object_new (GIMP_TYPE_EXPORT_PROCEDURE,
|
2019-08-10 20:25:37 +02:00
|
|
|
"plug-in", plug_in,
|
|
|
|
"name", name,
|
|
|
|
"procedure-type", proc_type,
|
|
|
|
NULL);
|
|
|
|
|
2024-07-10 15:03:15 +02:00
|
|
|
procedure->run_func = run_func;
|
|
|
|
procedure->export_metadata = export_metadata;
|
|
|
|
procedure->run_data = run_data;
|
|
|
|
procedure->run_data_destroy = run_data_destroy;
|
2023-07-20 22:47:46 +02:00
|
|
|
|
|
|
|
return GIMP_PROCEDURE (procedure);
|
|
|
|
}
|
|
|
|
|
2024-05-06 18:38:12 +00:00
|
|
|
/**
|
|
|
|
* gimp_export_procedure_set_capabilities:
|
|
|
|
* @procedure: a #GimpProcedure.
|
2024-11-01 19:13:02 +01:00
|
|
|
* @capabilities: a #GimpExportCapabilities bitfield.
|
|
|
|
* @get_capabilities_func: (nullable): callback function to update export options
|
|
|
|
* @get_capabilities_data: (nullable): data for @get_capabilities_func
|
|
|
|
* @get_capabilities_data_destroy: (nullable): free function for @get_capabilities_data, or %NULL
|
2024-05-06 18:38:12 +00:00
|
|
|
*
|
|
|
|
* Sets default #GimpExportCapabilities for image export.
|
|
|
|
*
|
2024-11-01 19:13:02 +01:00
|
|
|
* @capabilities and @get_capabilities_func are overlapping arguments.
|
|
|
|
* Either set @capabilities if your format capabilities are stable or
|
|
|
|
* @get_capabilities_func if they depend on other options.
|
|
|
|
* If @get_capabilities_func is set, @capabilities must be 0.
|
|
|
|
*
|
|
|
|
* If set, @get_capabilities_func will be called every time an argument
|
|
|
|
* in the [class@Gimp.ProcedureConfig] is edited and it will be used to
|
|
|
|
* edit the export capabilities dynamically.
|
|
|
|
*
|
2024-05-06 18:38:12 +00:00
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
void
|
2024-11-01 19:13:02 +01:00
|
|
|
gimp_export_procedure_set_capabilities (GimpExportProcedure *procedure,
|
|
|
|
GimpExportCapabilities capabilities,
|
|
|
|
GimpExportGetCapabilitiesFunc get_capabilities_func,
|
|
|
|
gpointer get_capabilities_data,
|
|
|
|
GDestroyNotify get_capabilities_data_destroy)
|
2024-05-06 18:38:12 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_EXPORT_PROCEDURE (procedure));
|
2024-11-01 19:13:02 +01:00
|
|
|
g_return_if_fail (get_capabilities_func == NULL || capabilities == 0);
|
2024-05-06 18:38:12 +00:00
|
|
|
|
|
|
|
/* Assign default image capabilities */
|
|
|
|
g_object_set (procedure,
|
|
|
|
"capabilities", capabilities,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
/* TODO: Do more with this when we have user-specified callbacks for
|
|
|
|
* image capabilities */
|
2024-11-01 19:13:02 +01:00
|
|
|
if (get_capabilities_func != NULL)
|
2024-05-06 18:38:12 +00:00
|
|
|
{
|
2024-11-01 19:13:02 +01:00
|
|
|
procedure->get_capabilities_func = get_capabilities_func;
|
|
|
|
procedure->get_capabilities_data = get_capabilities_data;
|
|
|
|
procedure->get_capabilities_data_destroy = get_capabilities_data_destroy;
|
2024-05-06 18:38:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-21 01:15:15 +01:00
|
|
|
/**
|
2024-04-20 03:08:57 +00:00
|
|
|
* gimp_export_procedure_set_support_exif:
|
2020-11-21 01:15:15 +01:00
|
|
|
* @procedure: a #GimpProcedure.
|
|
|
|
* @supports: whether Exif metadata are supported.
|
|
|
|
*
|
2024-04-20 03:08:57 +00:00
|
|
|
* Determine whether @procedure supports exporting Exif data. By default,
|
2020-11-21 01:15:15 +01:00
|
|
|
* it won't (so there is usually no reason to run this function with
|
|
|
|
* %FALSE).
|
2021-12-29 11:21:19 +01:00
|
|
|
*
|
|
|
|
* This will have several consequences:
|
|
|
|
*
|
2025-01-20 17:54:51 +01:00
|
|
|
* - Automatically adds a standard argument "include-exif" in the
|
2020-11-21 01:15:15 +01:00
|
|
|
* end of the argument list of @procedure, with relevant blurb and
|
|
|
|
* description.
|
2024-04-20 03:08:57 +00:00
|
|
|
* - If used with other gimp_export_procedure_set_support_*() functions,
|
2020-11-21 01:15:15 +01:00
|
|
|
* they will always be ordered the same (the order of the calls don't
|
2024-04-20 03:08:57 +00:00
|
|
|
* matter), keeping all export procedures consistent.
|
|
|
|
* - Generated GimpExportProcedureDialog will contain the metadata
|
2020-11-21 01:15:15 +01:00
|
|
|
* options, once again always in the same order and with consistent
|
|
|
|
* GUI style across plug-ins.
|
2021-12-29 11:21:19 +01:00
|
|
|
* - API from [class@ProcedureConfig] will automatically process these
|
2024-04-20 03:08:57 +00:00
|
|
|
* properties to decide whether to export a given metadata or not.
|
2020-11-21 01:15:15 +01:00
|
|
|
*
|
2025-01-20 17:54:51 +01:00
|
|
|
* By default, the value will be [func@export_exif].
|
2021-12-29 11:21:19 +01:00
|
|
|
*
|
2020-11-21 01:15:15 +01:00
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
void
|
2024-04-20 03:08:57 +00:00
|
|
|
gimp_export_procedure_set_support_exif (GimpExportProcedure *procedure,
|
|
|
|
gboolean supports)
|
2020-11-21 01:15:15 +01:00
|
|
|
{
|
2024-04-20 03:08:57 +00:00
|
|
|
g_return_if_fail (GIMP_IS_EXPORT_PROCEDURE (procedure));
|
2020-11-21 01:15:15 +01:00
|
|
|
|
|
|
|
g_object_set (procedure,
|
|
|
|
"supports-exif", supports,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-04-20 03:08:57 +00:00
|
|
|
* gimp_export_procedure_set_support_iptc:
|
2020-11-21 01:15:15 +01:00
|
|
|
* @procedure: a #GimpProcedure.
|
|
|
|
* @supports: whether IPTC metadata are supported.
|
|
|
|
*
|
2024-04-20 03:08:57 +00:00
|
|
|
* Determine whether @procedure supports exporting IPTC data. By default,
|
2020-11-21 01:15:15 +01:00
|
|
|
* it won't (so there is usually no reason to run this function with
|
|
|
|
* %FALSE).
|
2021-12-29 11:21:19 +01:00
|
|
|
*
|
|
|
|
* This will have several consequences:
|
|
|
|
*
|
2025-01-20 17:54:51 +01:00
|
|
|
* - Automatically adds a standard argument "include-iptc" in the
|
2020-11-21 01:15:15 +01:00
|
|
|
* end of the argument list of @procedure, with relevant blurb and
|
|
|
|
* description.
|
2024-04-20 03:08:57 +00:00
|
|
|
* - If used with other gimp_export_procedure_set_support_*() functions,
|
2020-11-21 01:15:15 +01:00
|
|
|
* they will always be ordered the same (the order of the calls don't
|
2024-04-20 03:08:57 +00:00
|
|
|
* matter), keeping all export procedures consistent.
|
|
|
|
* - Generated GimpExportProcedureDialog will contain the metadata
|
2020-11-21 01:15:15 +01:00
|
|
|
* options, once again always in the same order and with consistent
|
|
|
|
* GUI style across plug-ins.
|
2021-12-29 11:21:19 +01:00
|
|
|
* - API from [class@ProcedureConfig] will automatically process these
|
2024-04-20 03:08:57 +00:00
|
|
|
* properties to decide whether to export a given metadata or not.
|
2020-11-21 01:15:15 +01:00
|
|
|
*
|
2025-01-20 17:54:51 +01:00
|
|
|
* By default, the value will be [func@export_iptc].
|
2021-12-29 11:21:19 +01:00
|
|
|
*
|
2020-11-21 01:15:15 +01:00
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
void
|
2024-04-20 03:08:57 +00:00
|
|
|
gimp_export_procedure_set_support_iptc (GimpExportProcedure *procedure,
|
|
|
|
gboolean supports)
|
2020-11-21 01:15:15 +01:00
|
|
|
{
|
2024-04-20 03:08:57 +00:00
|
|
|
g_return_if_fail (GIMP_IS_EXPORT_PROCEDURE (procedure));
|
2020-11-21 01:15:15 +01:00
|
|
|
|
|
|
|
g_object_set (procedure,
|
|
|
|
"supports-iptc", supports,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-04-20 03:08:57 +00:00
|
|
|
* gimp_export_procedure_set_support_xmp:
|
2020-11-21 01:15:15 +01:00
|
|
|
* @procedure: a #GimpProcedure.
|
|
|
|
* @supports: whether XMP metadata are supported.
|
|
|
|
*
|
2024-04-20 03:08:57 +00:00
|
|
|
* Determine whether @procedure supports exporting XMP data. By default,
|
2020-11-21 01:15:15 +01:00
|
|
|
* it won't (so there is usually no reason to run this function with
|
|
|
|
* %FALSE).
|
2021-12-29 11:21:19 +01:00
|
|
|
*
|
|
|
|
* This will have several consequences:
|
|
|
|
*
|
2025-01-20 17:54:51 +01:00
|
|
|
* - Automatically adds a standard argument "include-xmp" in the
|
2020-11-21 01:15:15 +01:00
|
|
|
* end of the argument list of @procedure, with relevant blurb and
|
|
|
|
* description.
|
2024-04-20 03:08:57 +00:00
|
|
|
* - If used with other gimp_export_procedure_set_support_*() functions,
|
2020-11-21 01:15:15 +01:00
|
|
|
* they will always be ordered the same (the order of the calls don't
|
2024-04-20 03:08:57 +00:00
|
|
|
* matter), keeping all export procedures consistent.
|
|
|
|
* - Generated GimpExportProcedureDialog will contain the metadata
|
2020-11-21 01:15:15 +01:00
|
|
|
* options, once again always in the same order and with consistent
|
|
|
|
* GUI style across plug-ins.
|
2021-12-29 11:21:19 +01:00
|
|
|
* - API from [class@ProcedureConfig] will automatically process these
|
2024-04-20 03:08:57 +00:00
|
|
|
* properties to decide whether to export a given metadata or not.
|
2020-11-21 01:15:15 +01:00
|
|
|
*
|
2025-01-20 17:54:51 +01:00
|
|
|
* By default, the value will be [func@export_xmp].
|
2021-12-29 11:21:19 +01:00
|
|
|
*
|
2020-11-21 01:15:15 +01:00
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
void
|
2024-04-20 03:08:57 +00:00
|
|
|
gimp_export_procedure_set_support_xmp (GimpExportProcedure *procedure,
|
|
|
|
gboolean supports)
|
2020-11-21 01:15:15 +01:00
|
|
|
{
|
2024-04-20 03:08:57 +00:00
|
|
|
g_return_if_fail (GIMP_IS_EXPORT_PROCEDURE (procedure));
|
2020-11-21 01:15:15 +01:00
|
|
|
|
|
|
|
g_object_set (procedure,
|
|
|
|
"supports-xmp", supports,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-04-20 03:08:57 +00:00
|
|
|
* gimp_export_procedure_set_support_profile:
|
2020-11-21 01:15:15 +01:00
|
|
|
* @procedure: a #GimpProcedure.
|
|
|
|
* @supports: whether color profiles can be stored.
|
|
|
|
*
|
2024-04-20 03:08:57 +00:00
|
|
|
* Determine whether @procedure supports exporting ICC color profiles. By
|
2020-11-21 01:15:15 +01:00
|
|
|
* default, it won't (so there is usually no reason to run this function
|
|
|
|
* with %FALSE).
|
2021-12-29 11:21:19 +01:00
|
|
|
*
|
|
|
|
* This will have several consequences:
|
|
|
|
*
|
2025-01-20 17:54:51 +01:00
|
|
|
* - Automatically adds a standard argument "include-color-profile" in
|
|
|
|
* the end of the argument list of @procedure, with relevant blurb and
|
|
|
|
* description.
|
2024-04-20 03:08:57 +00:00
|
|
|
* - If used with other gimp_export_procedure_set_support_*() functions,
|
2020-11-21 01:15:15 +01:00
|
|
|
* they will always be ordered the same (the order of the calls don't
|
2024-04-20 03:08:57 +00:00
|
|
|
* matter), keeping all export procedures consistent.
|
|
|
|
* - Generated GimpExportProcedureDialog will contain the metadata
|
2020-11-21 01:15:15 +01:00
|
|
|
* options, once again always in the same order and with consistent
|
|
|
|
* GUI style across plug-ins.
|
2021-12-29 11:21:19 +01:00
|
|
|
* - API from [class@ProcedureConfig] will automatically process these
|
2024-04-20 03:08:57 +00:00
|
|
|
* properties to decide whether to export a given metadata or not.
|
2020-11-21 01:15:15 +01:00
|
|
|
*
|
2025-01-20 17:54:51 +01:00
|
|
|
* By default, the value will be [func@export_color_profile].
|
2021-12-29 11:21:19 +01:00
|
|
|
*
|
2020-11-21 01:15:15 +01:00
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
void
|
2024-04-20 03:08:57 +00:00
|
|
|
gimp_export_procedure_set_support_profile (GimpExportProcedure *procedure,
|
|
|
|
gboolean supports)
|
2020-11-21 01:15:15 +01:00
|
|
|
{
|
2024-04-20 03:08:57 +00:00
|
|
|
g_return_if_fail (GIMP_IS_EXPORT_PROCEDURE (procedure));
|
2020-11-21 01:15:15 +01:00
|
|
|
|
|
|
|
g_object_set (procedure,
|
|
|
|
"supports-profile", supports,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-04-20 03:08:57 +00:00
|
|
|
* gimp_export_procedure_set_support_thumbnail:
|
2020-11-21 01:15:15 +01:00
|
|
|
* @procedure: a #GimpProcedure.
|
|
|
|
* @supports: whether a thumbnail can be stored.
|
|
|
|
*
|
2024-04-20 03:08:57 +00:00
|
|
|
* Determine whether @procedure supports exporting a thumbnail. By default,
|
2020-11-21 01:15:15 +01:00
|
|
|
* it won't (so there is usually no reason to run this function with
|
|
|
|
* %FALSE).
|
2021-12-29 11:21:19 +01:00
|
|
|
*
|
|
|
|
* This will have several consequences:
|
|
|
|
*
|
2025-01-20 17:54:51 +01:00
|
|
|
* - Automatically adds a standard argument "include-thumbnail" in the
|
|
|
|
* end of the argument list of @procedure, with relevant blurb
|
2020-11-21 01:15:15 +01:00
|
|
|
* and description.
|
2024-04-20 03:08:57 +00:00
|
|
|
* - If used with other gimp_export_procedure_set_support_*() functions,
|
2020-11-21 01:15:15 +01:00
|
|
|
* they will always be ordered the same (the order of the calls don't
|
2024-04-20 03:08:57 +00:00
|
|
|
* matter), keeping all export procedures consistent.
|
|
|
|
* - Generated GimpExportProcedureDialog will contain the metadata
|
2020-11-21 01:15:15 +01:00
|
|
|
* options, once again always in the same order and with consistent
|
|
|
|
* GUI style across plug-ins.
|
2021-12-29 11:21:19 +01:00
|
|
|
* - API from [class@ProcedureConfig] will automatically process these
|
2024-04-20 03:08:57 +00:00
|
|
|
* properties to decide whether to export a given metadata or not.
|
2020-11-21 01:15:15 +01:00
|
|
|
*
|
2025-01-20 17:54:51 +01:00
|
|
|
* By default, the value will be [func@export_thumbnail].
|
2021-12-29 11:21:19 +01:00
|
|
|
*
|
2020-11-21 01:15:15 +01:00
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
void
|
2024-04-20 03:08:57 +00:00
|
|
|
gimp_export_procedure_set_support_thumbnail (GimpExportProcedure *procedure,
|
|
|
|
gboolean supports)
|
2020-11-21 01:15:15 +01:00
|
|
|
{
|
2024-04-20 03:08:57 +00:00
|
|
|
g_return_if_fail (GIMP_IS_EXPORT_PROCEDURE (procedure));
|
2020-11-21 01:15:15 +01:00
|
|
|
|
|
|
|
g_object_set (procedure,
|
|
|
|
"supports-thumbnail", supports,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-04-20 03:08:57 +00:00
|
|
|
* gimp_export_procedure_set_support_comment:
|
2020-11-21 01:15:15 +01:00
|
|
|
* @procedure: a #GimpProcedure.
|
|
|
|
* @supports: whether a comment can be stored.
|
|
|
|
*
|
2024-04-20 03:08:57 +00:00
|
|
|
* Determine whether @procedure supports exporting a comment. By default,
|
2020-11-21 01:15:15 +01:00
|
|
|
* it won't (so there is usually no reason to run this function with
|
|
|
|
* %FALSE).
|
2021-12-29 11:21:19 +01:00
|
|
|
*
|
|
|
|
* This will have several consequences:
|
|
|
|
*
|
2025-01-20 17:54:51 +01:00
|
|
|
* - Automatically adds a standard argument "include-comment" in the end
|
|
|
|
* of the argument list of @procedure, with relevant blurb and
|
|
|
|
* description.
|
2024-04-20 03:08:57 +00:00
|
|
|
* - If used with other gimp_export_procedure_set_support_*() functions,
|
2020-11-21 01:15:15 +01:00
|
|
|
* they will always be ordered the same (the order of the calls don't
|
2024-04-20 03:08:57 +00:00
|
|
|
* matter), keeping all export procedures consistent.
|
|
|
|
* - Generated GimpExportProcedureDialog will contain the metadata
|
2020-11-21 01:15:15 +01:00
|
|
|
* options, once again always in the same order and with consistent
|
|
|
|
* GUI style across plug-ins.
|
2021-12-29 11:21:19 +01:00
|
|
|
* - API from [class@ProcedureConfig] will automatically process these
|
2024-04-20 03:08:57 +00:00
|
|
|
* properties to decide whether to export a given metadata or not.
|
2020-11-21 01:15:15 +01:00
|
|
|
*
|
2025-01-20 17:54:51 +01:00
|
|
|
* By default, the value will be [func@export_comment].
|
2021-12-29 11:21:19 +01:00
|
|
|
*
|
2020-11-21 01:15:15 +01:00
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
void
|
2024-04-20 03:08:57 +00:00
|
|
|
gimp_export_procedure_set_support_comment (GimpExportProcedure *procedure,
|
|
|
|
gboolean supports)
|
2020-11-21 01:15:15 +01:00
|
|
|
{
|
2024-04-20 03:08:57 +00:00
|
|
|
g_return_if_fail (GIMP_IS_EXPORT_PROCEDURE (procedure));
|
2020-11-21 01:15:15 +01:00
|
|
|
|
|
|
|
g_object_set (procedure,
|
|
|
|
"supports-comment", supports,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-04-20 03:08:57 +00:00
|
|
|
* gimp_export_procedure_get_support_exif:
|
2020-11-21 01:15:15 +01:00
|
|
|
* @procedure: a #GimpProcedure.
|
|
|
|
*
|
2024-04-20 03:08:57 +00:00
|
|
|
* Returns: %TRUE if @procedure supports Exif exporting.
|
2020-11-21 01:15:15 +01:00
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
2024-04-20 03:08:57 +00:00
|
|
|
gimp_export_procedure_get_support_exif (GimpExportProcedure *procedure)
|
2020-11-21 01:15:15 +01:00
|
|
|
{
|
2024-04-20 03:08:57 +00:00
|
|
|
g_return_val_if_fail (GIMP_IS_EXPORT_PROCEDURE (procedure), FALSE);
|
2020-11-21 01:15:15 +01:00
|
|
|
|
2024-07-10 15:03:15 +02:00
|
|
|
return procedure->supports_exif;
|
2020-11-21 01:15:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-04-20 03:08:57 +00:00
|
|
|
* gimp_export_procedure_get_support_iptc:
|
2020-11-21 01:15:15 +01:00
|
|
|
* @procedure: a #GimpProcedure.
|
|
|
|
*
|
2024-04-20 03:08:57 +00:00
|
|
|
* Returns: %TRUE if @procedure supports IPTC exporting.
|
2020-11-21 01:15:15 +01:00
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
2024-04-20 03:08:57 +00:00
|
|
|
gimp_export_procedure_get_support_iptc (GimpExportProcedure *procedure)
|
2020-11-21 01:15:15 +01:00
|
|
|
{
|
2024-04-20 03:08:57 +00:00
|
|
|
g_return_val_if_fail (GIMP_IS_EXPORT_PROCEDURE (procedure), FALSE);
|
2020-11-21 01:15:15 +01:00
|
|
|
|
2024-07-10 15:03:15 +02:00
|
|
|
return procedure->supports_iptc;
|
2020-11-21 01:15:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-04-20 03:08:57 +00:00
|
|
|
* gimp_export_procedure_get_support_xmp:
|
2020-11-21 01:15:15 +01:00
|
|
|
* @procedure: a #GimpProcedure.
|
|
|
|
*
|
2024-04-20 03:08:57 +00:00
|
|
|
* Returns: %TRUE if @procedure supports XMP exporting.
|
2020-11-21 01:15:15 +01:00
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
2024-04-20 03:08:57 +00:00
|
|
|
gimp_export_procedure_get_support_xmp (GimpExportProcedure *procedure)
|
2020-11-21 01:15:15 +01:00
|
|
|
{
|
2024-04-20 03:08:57 +00:00
|
|
|
g_return_val_if_fail (GIMP_IS_EXPORT_PROCEDURE (procedure), FALSE);
|
2020-11-21 01:15:15 +01:00
|
|
|
|
2024-07-10 15:03:15 +02:00
|
|
|
return procedure->supports_xmp;
|
2020-11-21 01:15:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-04-20 03:08:57 +00:00
|
|
|
* gimp_export_procedure_get_support_profile:
|
2020-11-21 01:15:15 +01:00
|
|
|
* @procedure: a #GimpProcedure.
|
|
|
|
*
|
2024-04-20 03:08:57 +00:00
|
|
|
* Returns: %TRUE if @procedure supports ICC color profile exporting.
|
2020-11-21 01:15:15 +01:00
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
2024-04-20 03:08:57 +00:00
|
|
|
gimp_export_procedure_get_support_profile (GimpExportProcedure *procedure)
|
2020-11-21 01:15:15 +01:00
|
|
|
{
|
2024-04-20 03:08:57 +00:00
|
|
|
g_return_val_if_fail (GIMP_IS_EXPORT_PROCEDURE (procedure), FALSE);
|
2020-11-21 01:15:15 +01:00
|
|
|
|
2024-07-10 15:03:15 +02:00
|
|
|
return procedure->supports_profile;
|
2020-11-21 01:15:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-04-20 03:08:57 +00:00
|
|
|
* gimp_export_procedure_get_support_thumbnail:
|
2020-11-21 01:15:15 +01:00
|
|
|
* @procedure: a #GimpProcedure.
|
|
|
|
*
|
2024-04-20 03:08:57 +00:00
|
|
|
* Returns: %TRUE if @procedure supports thumbnail exporting.
|
2020-11-21 01:15:15 +01:00
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
2024-04-20 03:08:57 +00:00
|
|
|
gimp_export_procedure_get_support_thumbnail (GimpExportProcedure *procedure)
|
2020-11-21 01:15:15 +01:00
|
|
|
{
|
2024-04-20 03:08:57 +00:00
|
|
|
g_return_val_if_fail (GIMP_IS_EXPORT_PROCEDURE (procedure), FALSE);
|
2020-11-21 01:15:15 +01:00
|
|
|
|
2024-07-10 15:03:15 +02:00
|
|
|
return procedure->supports_thumbnail;
|
2020-11-21 01:15:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-04-20 03:08:57 +00:00
|
|
|
* gimp_export_procedure_get_support_comment:
|
2020-11-21 01:15:15 +01:00
|
|
|
* @procedure: a #GimpProcedure.
|
|
|
|
*
|
2024-04-20 03:08:57 +00:00
|
|
|
* Returns: %TRUE if @procedure supports comment exporting.
|
2020-11-21 01:15:15 +01:00
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
**/
|
|
|
|
gboolean
|
2024-04-20 03:08:57 +00:00
|
|
|
gimp_export_procedure_get_support_comment (GimpExportProcedure *procedure)
|
2020-11-21 01:15:15 +01:00
|
|
|
{
|
2024-04-20 03:08:57 +00:00
|
|
|
g_return_val_if_fail (GIMP_IS_EXPORT_PROCEDURE (procedure), FALSE);
|
2020-11-21 01:15:15 +01:00
|
|
|
|
2024-07-10 15:03:15 +02:00
|
|
|
return procedure->supports_comment;
|
2020-11-21 01:15:15 +01:00
|
|
|
}
|