mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-03 17:33:25 +00:00
150 lines
4.3 KiB
C
150 lines
4.3 KiB
C
![]() |
/* GIMP - The GNU Image Manipulation Program
|
||
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||
|
*
|
||
|
* gimpexportoptions.h
|
||
|
* Copyright (C) 2024 Alx Sa.
|
||
|
*
|
||
|
* 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 <gegl.h>
|
||
|
|
||
|
#include "gimpbasetypes.h"
|
||
|
|
||
|
#include "gimpexportoptions.h"
|
||
|
|
||
|
enum
|
||
|
{
|
||
|
PROP_0,
|
||
|
PROP_CAPABILITIES,
|
||
|
N_PROPS
|
||
|
};
|
||
|
|
||
|
struct _GimpExportOptions
|
||
|
{
|
||
|
GObject parent_instance;
|
||
|
|
||
|
GimpExportCapabilities capabilities;
|
||
|
};
|
||
|
|
||
|
|
||
|
static void gimp_export_options_finalize (GObject *object);
|
||
|
static void gimp_export_options_set_property (GObject *object,
|
||
|
guint property_id,
|
||
|
const GValue *value,
|
||
|
GParamSpec *pspec);
|
||
|
static void gimp_export_options_get_property (GObject *object,
|
||
|
guint property_id,
|
||
|
GValue *value,
|
||
|
GParamSpec *pspec);
|
||
|
|
||
|
|
||
|
G_DEFINE_TYPE (GimpExportOptions, gimp_export_options, G_TYPE_OBJECT)
|
||
|
|
||
|
#define parent_class gimp_export_options_parent_class
|
||
|
|
||
|
static GParamSpec *props[N_PROPS] = { NULL, };
|
||
|
|
||
|
static void
|
||
|
gimp_export_options_class_init (GimpExportOptionsClass *klass)
|
||
|
{
|
||
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||
|
|
||
|
object_class->finalize = gimp_export_options_finalize;
|
||
|
object_class->get_property = gimp_export_options_get_property;
|
||
|
object_class->set_property = gimp_export_options_set_property;
|
||
|
|
||
|
/**
|
||
|
* GimpExportProcedure:capabilities:
|
||
|
*
|
||
|
* What #GimpExportCapabilities are supported
|
||
|
*
|
||
|
* Since: 3.0.0
|
||
|
*/
|
||
|
props[PROP_CAPABILITIES] = g_param_spec_int ("capabilities",
|
||
|
"Supported image capabilities",
|
||
|
NULL,
|
||
|
0, G_MAXINT, 0,
|
||
|
G_PARAM_CONSTRUCT |
|
||
|
G_PARAM_READWRITE);
|
||
|
|
||
|
g_object_class_install_properties (object_class, N_PROPS, props);
|
||
|
}
|
||
|
|
||
|
static void
|
||
|
gimp_export_options_init (GimpExportOptions *options)
|
||
|
{
|
||
|
options->capabilities = 0;
|
||
|
}
|
||
|
|
||
|
static void
|
||
|
gimp_export_options_finalize (GObject *object)
|
||
|
{
|
||
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||
|
}
|
||
|
|
||
|
static void
|
||
|
gimp_export_options_set_property (GObject *object,
|
||
|
guint property_id,
|
||
|
const GValue *value,
|
||
|
GParamSpec *pspec)
|
||
|
{
|
||
|
GimpExportOptions *options = GIMP_EXPORT_OPTIONS (object);
|
||
|
|
||
|
switch (property_id)
|
||
|
{
|
||
|
case PROP_CAPABILITIES:
|
||
|
options->capabilities = g_value_get_int (value);
|
||
|
break;
|
||
|
|
||
|
default:
|
||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
static void
|
||
|
gimp_export_options_get_property (GObject *object,
|
||
|
guint property_id,
|
||
|
GValue *value,
|
||
|
GParamSpec *pspec)
|
||
|
{
|
||
|
GimpExportOptions *options = GIMP_EXPORT_OPTIONS (object);
|
||
|
|
||
|
switch (property_id)
|
||
|
{
|
||
|
case PROP_CAPABILITIES:
|
||
|
g_value_set_int (value, options->capabilities);
|
||
|
break;
|
||
|
|
||
|
default:
|
||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* public functions */
|
||
|
|
||
|
GimpExportOptions *
|
||
|
gimp_export_options_new (void)
|
||
|
{
|
||
|
GimpExportOptions *options;
|
||
|
|
||
|
options = g_object_new (GIMP_TYPE_EXPORT_OPTIONS, NULL);
|
||
|
|
||
|
return options;
|
||
|
}
|