Commit 9072bf33 authored by Michael Natterer's avatar Michael Natterer 😴

app: rename GimpImageMapConfig to GimpSettings

It was misnamed from the beginning and has no relation to GimpImageMap
except that it happens to be used by GimpImageMapTools. Now it feels
less weird to potentially use it for other settings too.
parent 51181648
......@@ -252,8 +252,6 @@ libappcore_a_sources = \
gimpimagefile.h \
gimpimagemap.c \
gimpimagemap.h \
gimpimagemapconfig.c \
gimpimagemapconfig.h \
gimpitem.c \
gimpitem.h \
gimpitem-exclusive.c \
......@@ -335,6 +333,8 @@ libappcore_a_sources = \
gimpscanconvert.h \
gimpselection.c \
gimpselection.h \
gimpsettings.c \
gimpsettings.h \
gimpstrokeoptions.c \
gimpstrokeoptions.h \
gimpsubprogress.c \
......
......@@ -176,12 +176,12 @@ typedef struct _GimpGuide GimpGuide;
typedef struct _GimpHistogram GimpHistogram;
typedef struct _GimpIdTable GimpIdTable;
typedef struct _GimpImageMap GimpImageMap;
typedef struct _GimpImageMapConfig GimpImageMapConfig;
typedef struct _GimpImagefile GimpImagefile;
typedef struct _GimpInterpreterDB GimpInterpreterDB;
typedef struct _GimpParasiteList GimpParasiteList;
typedef struct _GimpPdbProgress GimpPdbProgress;
typedef struct _GimpProjection GimpProjection;
typedef struct _GimpSettings GimpSettings;
typedef struct _GimpSubProgress GimpSubProgress;
typedef struct _GimpTag GimpTag;
typedef struct _GimpTreeHandler GimpTreeHandler;
......
......@@ -31,8 +31,8 @@
#include "gimpdrawable.h"
#include "gimpdrawable-operation.h"
#include "gimpdrawable-shadow.h"
#include "gimpimagemapconfig.h"
#include "gimpprogress.h"
#include "gimpsettings.h"
/* public functions */
......@@ -87,7 +87,7 @@ gimp_drawable_apply_operation_by_name (GimpDrawable *drawable,
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
g_return_if_fail (undo_desc != NULL);
g_return_if_fail (operation_type != NULL);
g_return_if_fail (config == NULL || GIMP_IS_IMAGE_MAP_CONFIG (config));
g_return_if_fail (config == NULL || GIMP_IS_SETTINGS (config));
node = g_object_new (GEGL_TYPE_NODE,
"operation", operation_type,
......
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpimagemapconfig.c
* Copyright (C) 2008 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 <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <string.h>
#include <gegl.h>
#include "libgimpconfig/gimpconfig.h"
#include "core-types.h"
#include "gimpimagemapconfig.h"
enum
{
PROP_0,
PROP_TIME
};
static void gimp_image_map_config_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_image_map_config_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
G_DEFINE_TYPE (GimpImageMapConfig, gimp_image_map_config,
GIMP_TYPE_VIEWABLE)
#define parent_class gimp_image_map_config_parent_class
static void
gimp_image_map_config_class_init (GimpImageMapConfigClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->set_property = gimp_image_map_config_set_property;
object_class->get_property = gimp_image_map_config_get_property;
GIMP_CONFIG_INSTALL_PROP_UINT (object_class, PROP_TIME,
"time",
"Time of settings creation",
0, G_MAXUINT, 0, 0);
}
static void
gimp_image_map_config_init (GimpImageMapConfig *config)
{
}
static void
gimp_image_map_config_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
GimpImageMapConfig *config = GIMP_IMAGE_MAP_CONFIG (object);
switch (property_id)
{
case PROP_TIME:
g_value_set_uint (value, config->time);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static void
gimp_image_map_config_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
GimpImageMapConfig *config = GIMP_IMAGE_MAP_CONFIG (object);
switch (property_id)
{
case PROP_TIME:
config->time = g_value_get_uint (value);
if (config->time > 0)
{
time_t t;
struct tm tm;
gchar buf[64];
gchar *name;
t = config->time;
tm = *localtime (&t);
strftime (buf, sizeof (buf), "%Y-%m-%d %H:%M:%S", &tm);
name = g_locale_to_utf8 (buf, -1, NULL, NULL, NULL);
gimp_object_set_name (GIMP_OBJECT (config), name);
g_free (name);
}
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
/* public functions */
gint
gimp_image_map_config_compare (GimpImageMapConfig *a,
GimpImageMapConfig *b)
{
const gchar *name_a = gimp_object_get_name (a);
const gchar *name_b = gimp_object_get_name (b);
if (a->time > 0 && b->time > 0)
{
return - strcmp (name_a, name_b);
}
else if (a->time > 0)
{
return -1;
}
else if (b->time > 0)
{
return 1;
}
else if (name_a && name_b)
{
return strcmp (name_a, name_b);
}
else if (name_a)
{
return 1;
}
else if (name_b)
{
return -1;
}
return 0;
}
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpimagemapconfig.h
* Copyright (C) 2008 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 <http://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_IMAGE_MAP_CONFIG_H__
#define __GIMP_IMAGE_MAP_CONFIG_H__
#include "gimpviewable.h"
#define GIMP_TYPE_IMAGE_MAP_CONFIG (gimp_image_map_config_get_type ())
#define GIMP_IMAGE_MAP_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_IMAGE_MAP_CONFIG, GimpImageMapConfig))
#define GIMP_IMAGE_MAP_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_IMAGE_MAP_CONFIG, GimpImageMapConfigClass))
#define GIMP_IS_IMAGE_MAP_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_IMAGE_MAP_CONFIG))
#define GIMP_IS_IMAGE_MAP_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_IMAGE_MAP_CONFIG))
#define GIMP_IMAGE_MAP_CONFIG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_IMAGE_MAP_CONFIG, GimpImageMapConfigClass))
typedef struct _GimpImageMapConfigClass GimpImageMapConfigClass;
struct _GimpImageMapConfig
{
GimpViewable parent_instance;
guint time;
};
struct _GimpImageMapConfigClass
{
GimpViewableClass parent_class;
};
GType gimp_image_map_config_get_type (void) G_GNUC_CONST;
gint gimp_image_map_config_compare (GimpImageMapConfig *a,
GimpImageMapConfig *b);
#endif /* __GIMP_IMAGE_MAP_CONFIG_H__ */
......@@ -51,7 +51,7 @@ static void gimp_brightness_contrast_config_set_property (GObject *object
G_DEFINE_TYPE_WITH_CODE (GimpBrightnessContrastConfig,
gimp_brightness_contrast_config,
GIMP_TYPE_IMAGE_MAP_CONFIG,
GIMP_TYPE_SETTINGS,
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG, NULL))
#define parent_class gimp_brightness_contrast_config_parent_class
......
......@@ -22,7 +22,7 @@
#define __GIMP_BRIGHTNESS_CONTRAST_CONFIG_H__
#include "core/gimpimagemapconfig.h"
#include "core/gimpsettings.h"
#define GIMP_TYPE_BRIGHTNESS_CONTRAST_CONFIG (gimp_brightness_contrast_config_get_type ())
......@@ -37,15 +37,15 @@ typedef struct _GimpBrightnessContrastConfigClass GimpBrightnessContrastConfigCl
struct _GimpBrightnessContrastConfig
{
GimpImageMapConfig parent_instance;
GimpSettings parent_instance;
gdouble brightness;
gdouble contrast;
gdouble brightness;
gdouble contrast;
};
struct _GimpBrightnessContrastConfigClass
{
GimpImageMapConfigClass parent_class;
GimpSettingsClass parent_class;
};
......
......@@ -53,7 +53,7 @@ static void gimp_cage_config_compute_edges_normal (GimpCageConfig *gcc);
G_DEFINE_TYPE_WITH_CODE (GimpCageConfig, gimp_cage_config,
GIMP_TYPE_IMAGE_MAP_CONFIG,
GIMP_TYPE_SETTINGS,
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG,
NULL))
......
......@@ -21,7 +21,7 @@
#define __GIMP_CAGE_CONFIG_H__
#include "core/gimpimagemapconfig.h"
#include "core/gimpsettings.h"
struct _GimpCagePoint
......@@ -46,18 +46,18 @@ typedef struct _GimpCageConfigClass GimpCageConfigClass;
struct _GimpCageConfig
{
GimpImageMapConfig parent_instance;
GimpSettings parent_instance;
GArray *cage_points;
GArray *cage_points;
gdouble displacement_x;
gdouble displacement_y;
GimpCageMode cage_mode; /* Cage mode, used to commit displacement */
gdouble displacement_x;
gdouble displacement_y;
GimpCageMode cage_mode; /* Cage mode, used to commit displacement */
};
struct _GimpCageConfigClass
{
GimpImageMapConfigClass parent_class;
GimpSettingsClass parent_class;
};
......
......@@ -71,7 +71,7 @@ static gboolean gimp_color_balance_config_copy (GimpConfig *src,
G_DEFINE_TYPE_WITH_CODE (GimpColorBalanceConfig, gimp_color_balance_config,
GIMP_TYPE_IMAGE_MAP_CONFIG,
GIMP_TYPE_SETTINGS,
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG,
gimp_color_balance_config_iface_init))
......
......@@ -22,7 +22,7 @@
#define __GIMP_COLOR_BALANCE_CONFIG_H__
#include "core/gimpimagemapconfig.h"
#include "core/gimpsettings.h"
#define GIMP_TYPE_COLOR_BALANCE_CONFIG (gimp_color_balance_config_get_type ())
......@@ -37,20 +37,20 @@ typedef struct _GimpColorBalanceConfigClass GimpColorBalanceConfigClass;
struct _GimpColorBalanceConfig
{
GimpImageMapConfig parent_instance;
GimpSettings parent_instance;
GimpTransferMode range;
GimpTransferMode range;
gdouble cyan_red[3];
gdouble magenta_green[3];
gdouble yellow_blue[3];
gdouble cyan_red[3];
gdouble magenta_green[3];
gdouble yellow_blue[3];
gboolean preserve_luminosity;
gboolean preserve_luminosity;
};
struct _GimpColorBalanceConfigClass
{
GimpImageMapConfigClass parent_class;
GimpSettingsClass parent_class;
};
......
......@@ -52,7 +52,7 @@ static void gimp_colorize_config_set_property (GObject *object,
G_DEFINE_TYPE_WITH_CODE (GimpColorizeConfig, gimp_colorize_config,
GIMP_TYPE_IMAGE_MAP_CONFIG,
GIMP_TYPE_SETTINGS,
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG, NULL))
#define parent_class gimp_colorize_config_parent_class
......
......@@ -22,7 +22,7 @@
#define __GIMP_COLORIZE_CONFIG_H__
#include "core/gimpimagemapconfig.h"
#include "core/gimpsettings.h"
#define GIMP_TYPE_COLORIZE_CONFIG (gimp_colorize_config_get_type ())
......@@ -37,16 +37,16 @@ typedef struct _GimpColorizeConfigClass GimpColorizeConfigClass;
struct _GimpColorizeConfig
{
GimpImageMapConfig parent_instance;
GimpSettings parent_instance;
gdouble hue;
gdouble saturation;
gdouble lightness;
gdouble hue;
gdouble saturation;
gdouble lightness;
};
struct _GimpColorizeConfigClass
{
GimpImageMapConfigClass parent_class;
GimpSettingsClass parent_class;
};
......
......@@ -80,7 +80,7 @@ static void gimp_curves_config_curve_dirty (GimpCurve *curve,
G_DEFINE_TYPE_WITH_CODE (GimpCurvesConfig, gimp_curves_config,
GIMP_TYPE_IMAGE_MAP_CONFIG,
GIMP_TYPE_SETTINGS,
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG,
gimp_curves_config_iface_init))
......
......@@ -22,7 +22,7 @@
#define __GIMP_CURVES_CONFIG_H__
#include "core/gimpimagemapconfig.h"
#include "core/gimpsettings.h"
#define GIMP_TYPE_CURVES_CONFIG (gimp_curves_config_get_type ())
......@@ -37,7 +37,7 @@ typedef struct _GimpCurvesConfigClass GimpCurvesConfigClass;
struct _GimpCurvesConfig
{
GimpImageMapConfig parent_instance;
GimpSettings parent_instance;
GimpHistogramChannel channel;
......@@ -46,7 +46,7 @@ struct _GimpCurvesConfig
struct _GimpCurvesConfigClass
{
GimpImageMapConfigClass parent_class;
GimpSettingsClass parent_class;
};
......
......@@ -47,7 +47,7 @@ static void gimp_desaturate_config_set_property (GObject *object,
G_DEFINE_TYPE_WITH_CODE (GimpDesaturateConfig, gimp_desaturate_config,
GIMP_TYPE_IMAGE_MAP_CONFIG,
GIMP_TYPE_SETTINGS,
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG, NULL))
#define parent_class gimp_desaturate_config_parent_class
......
......@@ -22,7 +22,7 @@
#define __GIMP_DESATURATE_CONFIG_H__
#include "core/gimpimagemapconfig.h"
#include "core/gimpsettings.h"
#define GIMP_TYPE_DESATURATE_CONFIG (gimp_desaturate_config_get_type ())
......@@ -37,14 +37,14 @@ typedef struct _GimpDesaturateConfigClass GimpDesaturateConfigClass;
struct _GimpDesaturateConfig
{
GimpImageMapConfig parent_instance;
GimpSettings parent_instance;
GimpDesaturateMode mode;
};
struct _GimpDesaturateConfigClass
{
GimpImageMapConfigClass parent_class;
GimpSettingsClass parent_class;
};
......
......@@ -68,7 +68,7 @@ static gboolean gimp_hue_saturation_config_copy (GimpConfig *src,
G_DEFINE_TYPE_WITH_CODE (GimpHueSaturationConfig, gimp_hue_saturation_config,
GIMP_TYPE_IMAGE_MAP_CONFIG,
GIMP_TYPE_SETTINGS,
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG,
gimp_hue_saturation_config_iface_init))
......
......@@ -22,7 +22,7 @@
#define __GIMP_HUE_SATURATION_CONFIG_H__
#include "core/gimpimagemapconfig.h"
#include "core/gimpsettings.h"
#define GIMP_TYPE_HUE_SATURATION_CONFIG (gimp_hue_saturation_config_get_type ())
......@@ -37,20 +37,20 @@ typedef struct _GimpHueSaturationConfigClass GimpHueSaturationConfigClass;
struct _GimpHueSaturationConfig
{
GimpImageMapConfig parent_instance;
GimpSettings parent_instance;
GimpHueRange range;
GimpHueRange range;
gdouble hue[7];
gdouble saturation[7];
gdouble lightness[7];
gdouble hue[7];
gdouble saturation[7];
gdouble lightness[7];
gdouble overlap;
gdouble overlap;
};
struct _GimpHueSaturationConfigClass
{
GimpImageMapConfigClass parent_class;
GimpSettingsClass parent_class;
};
......
......@@ -83,7 +83,7 @@ static gboolean gimp_levels_config_copy (GimpConfig *src,
G_DEFINE_TYPE_WITH_CODE (GimpLevelsConfig, gimp_levels_config,
GIMP_TYPE_IMAGE_MAP_CONFIG,
GIMP_TYPE_SETTINGS,
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG,
gimp_levels_config_iface_init))
......
......@@ -22,7 +22,7 @@
#define __GIMP_LEVELS_CONFIG_H__
#include "core/gimpimagemapconfig.h"
#include "core/gimpsettings.h"
#define GIMP_TYPE_LEVELS_CONFIG (gimp_levels_config_get_type ())
......@@ -37,7 +37,7 @@ typedef struct _GimpLevelsConfigClass GimpLevelsConfigClass;
struct _GimpLevelsConfig
{
GimpImageMapConfig parent_instance;
GimpSettings parent_instance;
GimpHistogramChannel channel;
......@@ -52,7 +52,7 @@ struct _GimpLevelsConfig
struct _GimpLevelsConfigClass
{
GimpImageMapConfigClass parent_class;
GimpSettingsClass parent_class;
};
......
......@@ -47,7 +47,7 @@ static void gimp_posterize_config_set_property (GObject *object,
G_DEFINE_TYPE_WITH_CODE (GimpPosterizeConfig, gimp_posterize_config,
GIMP_TYPE_IMAGE_MAP_CONFIG,
GIMP_TYPE_SETTINGS,
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG, NULL))
#define parent_class gimp_posterize_config_parent_class
......
......@@ -22,7 +22,7 @@
#define __GIMP_POSTERIZE_CONFIG_H__
#include "core/gimpimagemapconfig.h"
#include "core/gimpsettings.h"
#define GIMP_TYPE_POSTERIZE_CONFIG (gimp_posterize_config_get_type ())
......@@ -37,14 +37,14 @@ typedef struct _GimpPosterizeConfigClass GimpPosterizeConfigClass;
struct _GimpPosterizeConfig
{
GimpImageMapConfig parent_instance;
GimpSettings parent_instance;
gint levels;
gint levels;
};
struct _GimpPosterizeConfigClass
{
GimpImageMapConfigClass parent_class;
GimpSettingsClass parent_class;
};
......
......@@ -48,7 +48,7 @@ static void gimp_threshold_config_set_property (GObject *object,
G_DEFINE_TYPE_WITH_CODE (GimpThresholdConfig, gimp_threshold_config,
GIMP_TYPE_IMAGE_MAP_CONFIG,
GIMP_TYPE_SETTINGS,
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG, NULL))
#define parent_class gimp_threshold_config_parent_class
......
......@@ -22,7 +22,7 @@
#define __GIMP_THRESHOLD_CONFIG_H__
#include "core/gimpimagemapconfig.h"
#include "core/gimpsettings.h"
#define GIMP_TYPE_THRESHOLD_CONFIG (gimp_threshold_config_get_type ())
......@@ -37,15 +37,15 @@ typedef struct _GimpThresholdConfigClass GimpThresholdConfigClass;
struct _GimpThresholdConfig
{
GimpImageMapConfig parent_instance;
GimpSettings parent_instance;
gdouble low;
gdouble high;
gdouble low;
gdouble high;
};
struct _GimpThresholdConfigClass
{
GimpImageMapConfigClass parent_class;
GimpSettingsClass parent_class;
};
......
......@@ -33,7 +33,6 @@
#include "core/gimp.h"
#include "core/gimpcontext.h"
#include "core/gimpimagemapconfig.h"
#include "core/gimplist.h"
#include "core/gimptoolinfo.h"
......
......@@ -44,11 +44,11 @@
#include "core/gimpimage.h"
#include "core/gimpimage-pick-color.h"
#include "core/gimpimagemap.h"
#include "core/gimpimagemapconfig.h"
#include "core/gimplist.h"
#include "core/gimppickable.h"
#include "core/gimpprogress.h"
#include "core/gimpprojection.h"
#include "core/gimpsettings.h"
#include "core/gimptoolinfo.h"
#include "widgets/gimpdialogfactory.h"
......@@ -195,9 +195,9 @@ gimp_image_map_tool_class_init (GimpImageMapToolClass *klass)
static void
gimp_image_map_tool_base_init (GimpImageMapToolClass *klass)
{
klass->recent_settings = gimp_list_new (GIMP_TYPE_IMAGE_MAP_CONFIG, TRUE);
klass->recent_settings = gimp_list_new (GIMP_TYPE_SETTINGS, TRUE);
gimp_list_set_sort_func (GIMP_LIST (klass->recent_settings),
(GCompareFunc) gimp_image_map_config_compare);
(GCompareFunc) gimp_settings_compare);
}
static void
......
......@@ -36,9 +36,9 @@
#include "core/gimperror.h"
#include "core/gimpimage.h"
#include "core/gimpimagemap.h"
#include "core/gimpimagemapconfig.h"
#include "core/gimplist.h"
#include "core/gimpparamspecs-duplicate.h"
#include "core/gimpsettings.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimppropwidgets.h"
......@@ -235,7 +235,7 @@ gimp_operation_tool_get_settings_ui (GimpImageMapTool *image_map_tool,
settings = gimp_gegl_get_config_container (type);
if (! gimp_list_get_sort_func (GIMP_LIST (settings)))
gimp_list_set_sort_func (GIMP_LIST (settings),
(GCompareFunc) gimp_image_map_config_compare);
(GCompareFunc) gimp_settings_compare);
basename = g_strconcat (G_OBJECT_TYPE_NAME (tool->config), ".settings", NULL);
filename = g_build_filename (gimp_directory (), "filters", basename, NULL);
......@@ -295,7 +295,7 @@ gimp_operation_tool_set_operation (GimpOperationTool *tool,
g_object_unref (tool->config);
tool->config = gimp_gegl_get_config_proxy (tool->operation,
GIMP_TYPE_IMAGE_MAP_CONFIG);
GIMP_TYPE_SETTINGS);
gimp_image_map_tool_get_operation (GIMP_IMAGE_MAP_TOOL (tool));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment