2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
1998-06-28 18:39:58 +08:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
1998-06-28 18:39:58 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
1998-06-28 18:39:58 +08:00
|
|
|
* (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
|
2018-07-12 05:27:07 +08:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
1998-06-28 18:39:58 +08:00
|
|
|
*/
|
2000-12-11 11:33:25 +08:00
|
|
|
|
2000-04-28 01:27:28 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
1998-09-01 01:31:19 +08:00
|
|
|
#include <string.h>
|
2004-10-06 07:42:35 +08:00
|
|
|
#include <time.h>
|
2000-04-28 01:27:28 +08:00
|
|
|
|
2011-04-28 21:50:39 +08:00
|
|
|
#include <cairo.h>
|
2012-05-03 09:36:22 +08:00
|
|
|
#include <gdk-pixbuf/gdk-pixbuf.h>
|
2013-10-15 07:58:39 +08:00
|
|
|
#include <gegl.h>
|
2013-10-20 00:38:01 +08:00
|
|
|
#include <gexiv2/gexiv2.h>
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2001-01-24 02:49:44 +08:00
|
|
|
#include "libgimpcolor/gimpcolor.h"
|
2001-01-24 07:56:18 +08:00
|
|
|
#include "libgimpmath/gimpmath.h"
|
2001-05-21 21:58:46 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
2005-01-26 03:11:26 +08:00
|
|
|
#include "libgimpconfig/gimpconfig.h"
|
2001-01-24 02:49:44 +08:00
|
|
|
|
2001-05-10 06:34:59 +08:00
|
|
|
#include "core-types.h"
|
|
|
|
|
2003-10-11 22:30:18 +08:00
|
|
|
#include "config/gimpcoreconfig.h"
|
2002-11-19 04:50:31 +08:00
|
|
|
|
2017-08-22 02:04:25 +08:00
|
|
|
#include "operations/layer-modes/gimp-layer-modes.h"
|
|
|
|
|
2012-04-22 06:02:10 +08:00
|
|
|
#include "gegl/gimp-babl.h"
|
2012-03-19 00:19:29 +08:00
|
|
|
|
2001-07-05 03:31:35 +08:00
|
|
|
#include "gimp.h"
|
2014-08-12 19:57:57 +08:00
|
|
|
#include "gimp-memsize.h"
|
2002-05-15 19:05:32 +08:00
|
|
|
#include "gimp-parasites.h"
|
2016-01-04 03:05:27 +08:00
|
|
|
#include "gimp-utils.h"
|
1999-10-27 02:27:27 +08:00
|
|
|
#include "gimpcontext.h"
|
2016-05-19 23:38:55 +08:00
|
|
|
#include "gimpdrawable-floating-selection.h"
|
2008-10-11 04:04:03 +08:00
|
|
|
#include "gimpdrawablestack.h"
|
2003-10-10 22:11:47 +08:00
|
|
|
#include "gimpgrid.h"
|
2008-11-12 18:56:06 +08:00
|
|
|
#include "gimperror.h"
|
2006-06-07 06:48:57 +08:00
|
|
|
#include "gimpguide.h"
|
2011-05-05 04:14:13 +08:00
|
|
|
#include "gimpidtable.h"
|
2000-12-29 23:22:01 +08:00
|
|
|
#include "gimpimage.h"
|
2015-08-03 04:18:43 +08:00
|
|
|
#include "gimpimage-color-profile.h"
|
2003-03-18 21:49:02 +08:00
|
|
|
#include "gimpimage-colormap.h"
|
2003-03-28 21:52:01 +08:00
|
|
|
#include "gimpimage-guides.h"
|
2014-06-16 03:40:05 +08:00
|
|
|
#include "gimpimage-item-list.h"
|
2013-10-20 00:38:01 +08:00
|
|
|
#include "gimpimage-metadata.h"
|
2005-03-05 00:34:59 +08:00
|
|
|
#include "gimpimage-sample-points.h"
|
2003-03-24 20:21:58 +08:00
|
|
|
#include "gimpimage-preview.h"
|
2010-02-04 03:31:25 +08:00
|
|
|
#include "gimpimage-private.h"
|
2005-09-19 20:44:06 +08:00
|
|
|
#include "gimpimage-quick-mask.h"
|
2016-01-28 02:13:17 +08:00
|
|
|
#include "gimpimage-symmetry.h"
|
2001-03-05 09:01:16 +08:00
|
|
|
#include "gimpimage-undo.h"
|
2003-02-14 22:14:29 +08:00
|
|
|
#include "gimpimage-undo-push.h"
|
2010-02-06 20:41:16 +08:00
|
|
|
#include "gimpitemtree.h"
|
2001-02-02 02:44:22 +08:00
|
|
|
#include "gimplayer.h"
|
2016-05-20 22:46:26 +08:00
|
|
|
#include "gimplayer-floating-selection.h"
|
2001-01-29 00:44:22 +08:00
|
|
|
#include "gimplayermask.h"
|
2017-05-09 04:02:37 +08:00
|
|
|
#include "gimplayerstack.h"
|
2001-01-10 08:36:54 +08:00
|
|
|
#include "gimpmarshal.h"
|
2001-07-10 03:48:30 +08:00
|
|
|
#include "gimpparasitelist.h"
|
2005-07-12 03:21:52 +08:00
|
|
|
#include "gimppickable.h"
|
2008-11-05 02:06:36 +08:00
|
|
|
#include "gimpprojectable.h"
|
2004-07-14 00:36:29 +08:00
|
|
|
#include "gimpprojection.h"
|
2007-01-30 18:34:59 +08:00
|
|
|
#include "gimpsamplepoint.h"
|
2003-09-03 07:07:40 +08:00
|
|
|
#include "gimpselection.h"
|
2016-01-28 02:13:17 +08:00
|
|
|
#include "gimpsymmetry.h"
|
2012-04-09 06:59:20 +08:00
|
|
|
#include "gimptempbuf.h"
|
2003-10-14 23:20:59 +08:00
|
|
|
#include "gimptemplate.h"
|
2001-03-05 09:01:16 +08:00
|
|
|
#include "gimpundostack.h"
|
2001-07-05 03:31:35 +08:00
|
|
|
|
2002-02-24 01:29:19 +08:00
|
|
|
#include "vectors/gimpvectors.h"
|
|
|
|
|
2014-06-16 03:40:05 +08:00
|
|
|
#include "gimp-log.h"
|
2003-03-26 00:38:19 +08:00
|
|
|
#include "gimp-intl.h"
|
2000-04-28 01:27:28 +08:00
|
|
|
|
1998-09-01 01:31:19 +08:00
|
|
|
|
comment typo fix, plus add %D* to default image-title-format string, so
Fri Oct 1 12:46:12 1999 Austin Donnelly <austin@gimp.org>
* gimprc.in: comment typo fix, plus add %D* to default
image-title-format string, so people get a '*' in the titlebar
if their image is dirty.
* app/fileops.c: initialise filename before using it.
* app/gdisplay.c: empty parameter list () is K&R - should be
stronger (void) in ANSI C.
* app/gimpdrawable.c: gimp_drawable_{dirty,clean} functions
removed - no one uses them anyway. Parasite undo type is
proper parasite undo type, not MISC_UNDO.
* app/gimpdrawableP.h: drawable dirty bit removed.
* app/gimpimage.c: don't change the resolution if there's no
difference from the old one. Call gdisplay_shrink_wrap() to
re-calculate scale factors and refresh the display on
resolution change. Layer undo doesn't have sub-types
anymore, uses main UndoType instead.
* app/layer.h: Remove LayerUndoType
* app/qmask.c: fix qmask undo so it actually works.
* app/undo.h: new types for undo_push_layer{,_mask} and
undo_push_qmask.
* app/undo.c: change way group boundaries are represented:
each Undo has a group_boundary boolean set to TRUE if this is
the start or the end of a group, and the type of the Undo is
the group's type. Within a group, each Undo keeps its own
type. This allows pop funcs and free funcs to do
type-specific things (eg needed by layer and channel stuff).
Don't maintain per-drawable dirty flags anymore. Floating
sel to layer and layer rename now uses meaningful undo types.
* app/undo_types.h: more specific undo types:
LAYER_{ADD,REMOVE}_UNDO, LAYER_MASK_{ADD,REMOVE}_UNDO,
LAYER_RENAME_UNDO, and PARASITE_{ATTACH,DETACH}_UNDO.
* app/undo_history.c: oops - undo stack was being placed into gtk
list in wrong order.
* app/edit_selection.c: push more descriptive LAYER_DISPLACE_UNDO
rather than MISC_UNDO.
* app/layers_dialog.c: better tagging of undo types
1999-10-02 02:43:24 +08:00
|
|
|
#ifdef DEBUG
|
2007-06-14 15:06:58 +08:00
|
|
|
#define TRC(x) g_printerr x
|
comment typo fix, plus add %D* to default image-title-format string, so
Fri Oct 1 12:46:12 1999 Austin Donnelly <austin@gimp.org>
* gimprc.in: comment typo fix, plus add %D* to default
image-title-format string, so people get a '*' in the titlebar
if their image is dirty.
* app/fileops.c: initialise filename before using it.
* app/gdisplay.c: empty parameter list () is K&R - should be
stronger (void) in ANSI C.
* app/gimpdrawable.c: gimp_drawable_{dirty,clean} functions
removed - no one uses them anyway. Parasite undo type is
proper parasite undo type, not MISC_UNDO.
* app/gimpdrawableP.h: drawable dirty bit removed.
* app/gimpimage.c: don't change the resolution if there's no
difference from the old one. Call gdisplay_shrink_wrap() to
re-calculate scale factors and refresh the display on
resolution change. Layer undo doesn't have sub-types
anymore, uses main UndoType instead.
* app/layer.h: Remove LayerUndoType
* app/qmask.c: fix qmask undo so it actually works.
* app/undo.h: new types for undo_push_layer{,_mask} and
undo_push_qmask.
* app/undo.c: change way group boundaries are represented:
each Undo has a group_boundary boolean set to TRUE if this is
the start or the end of a group, and the type of the Undo is
the group's type. Within a group, each Undo keeps its own
type. This allows pop funcs and free funcs to do
type-specific things (eg needed by layer and channel stuff).
Don't maintain per-drawable dirty flags anymore. Floating
sel to layer and layer rename now uses meaningful undo types.
* app/undo_types.h: more specific undo types:
LAYER_{ADD,REMOVE}_UNDO, LAYER_MASK_{ADD,REMOVE}_UNDO,
LAYER_RENAME_UNDO, and PARASITE_{ATTACH,DETACH}_UNDO.
* app/undo_history.c: oops - undo stack was being placed into gtk
list in wrong order.
* app/edit_selection.c: push more descriptive LAYER_DISPLACE_UNDO
rather than MISC_UNDO.
* app/layers_dialog.c: better tagging of undo types
1999-10-02 02:43:24 +08:00
|
|
|
#else
|
|
|
|
#define TRC(x)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2001-11-28 11:08:03 +08:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
MODE_CHANGED,
|
2012-04-25 22:46:58 +08:00
|
|
|
PRECISION_CHANGED,
|
2001-11-28 11:08:03 +08:00
|
|
|
ALPHA_CHANGED,
|
|
|
|
FLOATING_SELECTION_CHANGED,
|
|
|
|
ACTIVE_LAYER_CHANGED,
|
|
|
|
ACTIVE_CHANNEL_CHANGED,
|
2002-02-24 01:29:19 +08:00
|
|
|
ACTIVE_VECTORS_CHANGED,
|
2001-11-28 11:08:03 +08:00
|
|
|
COMPONENT_VISIBILITY_CHANGED,
|
|
|
|
COMPONENT_ACTIVE_CHANGED,
|
|
|
|
MASK_CHANGED,
|
|
|
|
RESOLUTION_CHANGED,
|
2008-08-03 19:35:53 +08:00
|
|
|
SIZE_CHANGED_DETAILED,
|
2001-11-28 11:08:03 +08:00
|
|
|
UNIT_CHANGED,
|
2005-09-19 20:44:06 +08:00
|
|
|
QUICK_MASK_CHANGED,
|
2010-10-10 02:23:05 +08:00
|
|
|
SELECTION_INVALIDATE,
|
2001-11-28 11:08:03 +08:00
|
|
|
CLEAN,
|
|
|
|
DIRTY,
|
2018-09-29 14:25:34 +08:00
|
|
|
SAVING,
|
2006-12-12 04:57:44 +08:00
|
|
|
SAVED,
|
2009-05-16 17:27:45 +08:00
|
|
|
EXPORTED,
|
2010-10-01 16:34:15 +08:00
|
|
|
GUIDE_ADDED,
|
|
|
|
GUIDE_REMOVED,
|
|
|
|
GUIDE_MOVED,
|
2005-04-03 23:48:03 +08:00
|
|
|
SAMPLE_POINT_ADDED,
|
|
|
|
SAMPLE_POINT_REMOVED,
|
2010-10-01 15:15:52 +08:00
|
|
|
SAMPLE_POINT_MOVED,
|
2006-10-25 15:31:04 +08:00
|
|
|
PARASITE_ATTACHED,
|
|
|
|
PARASITE_DETACHED,
|
2001-11-28 11:08:03 +08:00
|
|
|
COLORMAP_CHANGED,
|
|
|
|
UNDO_EVENT,
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
2004-07-14 20:12:50 +08:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
|
|
|
PROP_GIMP,
|
|
|
|
PROP_ID,
|
|
|
|
PROP_WIDTH,
|
|
|
|
PROP_HEIGHT,
|
2012-04-22 23:31:32 +08:00
|
|
|
PROP_BASE_TYPE,
|
2013-09-14 05:25:30 +08:00
|
|
|
PROP_PRECISION,
|
2013-10-20 00:38:01 +08:00
|
|
|
PROP_METADATA,
|
2016-01-28 02:13:17 +08:00
|
|
|
PROP_BUFFER,
|
|
|
|
PROP_SYMMETRY
|
2004-07-14 20:12:50 +08:00
|
|
|
};
|
|
|
|
|
2001-11-28 11:08:03 +08:00
|
|
|
|
|
|
|
/* local function prototypes */
|
|
|
|
|
2007-06-14 15:06:58 +08:00
|
|
|
static void gimp_color_managed_iface_init (GimpColorManagedInterface *iface);
|
2008-11-05 02:06:36 +08:00
|
|
|
static void gimp_projectable_iface_init (GimpProjectableInterface *iface);
|
2013-09-14 05:25:30 +08:00
|
|
|
static void gimp_pickable_iface_init (GimpPickableInterface *iface);
|
2007-06-14 15:06:58 +08:00
|
|
|
|
2011-01-13 05:53:58 +08:00
|
|
|
static void gimp_image_constructed (GObject *object);
|
2008-11-03 03:53:51 +08:00
|
|
|
static void gimp_image_set_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec);
|
|
|
|
static void gimp_image_get_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec);
|
|
|
|
static void gimp_image_dispose (GObject *object);
|
|
|
|
static void gimp_image_finalize (GObject *object);
|
|
|
|
|
|
|
|
static void gimp_image_name_changed (GimpObject *object);
|
|
|
|
static gint64 gimp_image_get_memsize (GimpObject *object,
|
|
|
|
gint64 *gui_size);
|
|
|
|
|
|
|
|
static gboolean gimp_image_get_size (GimpViewable *viewable,
|
|
|
|
gint *width,
|
|
|
|
gint *height);
|
|
|
|
static void gimp_image_size_changed (GimpViewable *viewable);
|
|
|
|
static gchar * gimp_image_get_description (GimpViewable *viewable,
|
|
|
|
gchar **tooltip);
|
2008-11-05 07:22:45 +08:00
|
|
|
|
|
|
|
static void gimp_image_real_mode_changed (GimpImage *image);
|
2012-04-25 22:46:58 +08:00
|
|
|
static void gimp_image_real_precision_changed(GimpImage *image);
|
2013-10-20 00:38:01 +08:00
|
|
|
static void gimp_image_real_resolution_changed(GimpImage *image);
|
2008-08-05 04:11:35 +08:00
|
|
|
static void gimp_image_real_size_changed_detailed
|
2008-11-03 03:53:51 +08:00
|
|
|
(GimpImage *image,
|
|
|
|
gint previous_origin_x,
|
|
|
|
gint previous_origin_y,
|
|
|
|
gint previous_width,
|
|
|
|
gint previous_height);
|
2013-10-20 00:38:01 +08:00
|
|
|
static void gimp_image_real_unit_changed (GimpImage *image);
|
2008-11-03 03:53:51 +08:00
|
|
|
static void gimp_image_real_colormap_changed (GimpImage *image,
|
|
|
|
gint color_index);
|
2008-11-05 02:06:36 +08:00
|
|
|
|
2014-03-17 06:49:02 +08:00
|
|
|
static const guint8 *
|
|
|
|
gimp_image_color_managed_get_icc_profile (GimpColorManaged *managed,
|
2008-11-05 02:06:36 +08:00
|
|
|
gsize *len);
|
2015-07-11 04:43:53 +08:00
|
|
|
static GimpColorProfile *
|
2015-05-26 14:05:25 +08:00
|
|
|
gimp_image_color_managed_get_color_profile (GimpColorManaged *managed);
|
2015-09-03 02:55:48 +08:00
|
|
|
static void
|
|
|
|
gimp_image_color_managed_profile_changed (GimpColorManaged *managed);
|
2008-11-05 02:06:36 +08:00
|
|
|
|
|
|
|
static void gimp_image_projectable_flush (GimpProjectable *projectable,
|
2008-11-03 03:53:51 +08:00
|
|
|
gboolean invalidate_preview);
|
2012-03-30 03:09:37 +08:00
|
|
|
static GeglNode * gimp_image_get_graph (GimpProjectable *projectable);
|
|
|
|
static GimpImage * gimp_image_get_image (GimpProjectable *projectable);
|
|
|
|
static const Babl * gimp_image_get_proj_format (GimpProjectable *projectable);
|
2008-11-03 03:53:51 +08:00
|
|
|
|
2013-09-14 05:25:30 +08:00
|
|
|
static void gimp_image_pickable_flush (GimpPickable *pickable);
|
|
|
|
static GeglBuffer * gimp_image_get_buffer (GimpPickable *pickable);
|
|
|
|
static gboolean gimp_image_get_pixel_at (GimpPickable *pickable,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
const Babl *format,
|
|
|
|
gpointer pixel);
|
|
|
|
static gdouble gimp_image_get_opacity_at (GimpPickable *pickable,
|
|
|
|
gint x,
|
|
|
|
gint y);
|
2018-05-19 02:57:19 +08:00
|
|
|
static void gimp_image_get_pixel_average (GimpPickable *pickable,
|
|
|
|
const GeglRectangle *rect,
|
|
|
|
const Babl *format,
|
|
|
|
gpointer pixel);
|
2016-05-23 05:28:31 +08:00
|
|
|
static void gimp_image_pixel_to_srgb (GimpPickable *pickable,
|
|
|
|
const Babl *format,
|
|
|
|
gpointer pixel,
|
|
|
|
GimpRGB *color);
|
2016-05-23 07:25:35 +08:00
|
|
|
static void gimp_image_srgb_to_pixel (GimpPickable *pickable,
|
|
|
|
const GimpRGB *color,
|
|
|
|
const Babl *format,
|
|
|
|
gpointer pixel);
|
2013-09-14 05:25:30 +08:00
|
|
|
|
2008-11-03 03:53:51 +08:00
|
|
|
static void gimp_image_mask_update (GimpDrawable *drawable,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
GimpImage *image);
|
|
|
|
static void gimp_image_layer_alpha_changed (GimpDrawable *drawable,
|
|
|
|
GimpImage *image);
|
|
|
|
static void gimp_image_channel_add (GimpContainer *container,
|
|
|
|
GimpChannel *channel,
|
|
|
|
GimpImage *image);
|
|
|
|
static void gimp_image_channel_remove (GimpContainer *container,
|
|
|
|
GimpChannel *channel,
|
|
|
|
GimpImage *image);
|
|
|
|
static void gimp_image_channel_name_changed (GimpChannel *channel,
|
|
|
|
GimpImage *image);
|
|
|
|
static void gimp_image_channel_color_changed (GimpChannel *channel,
|
|
|
|
GimpImage *image);
|
2010-02-08 02:57:46 +08:00
|
|
|
static void gimp_image_active_layer_notify (GimpItemTree *tree,
|
|
|
|
const GParamSpec *pspec,
|
|
|
|
GimpImage *image);
|
|
|
|
static void gimp_image_active_channel_notify (GimpItemTree *tree,
|
|
|
|
const GParamSpec *pspec,
|
|
|
|
GimpImage *image);
|
|
|
|
static void gimp_image_active_vectors_notify (GimpItemTree *tree,
|
|
|
|
const GParamSpec *pspec,
|
|
|
|
GimpImage *image);
|
To optimize duplicate and/or wrong image updates away, introduced new
2003-09-06 Michael Natterer <mitch@gimp.org>
To optimize duplicate and/or wrong image updates away, introduced
new policy that a child object must never explicitly update or
invalidate its parent object (just like the GUI is not updated
explicitly by the core):
* app/core/gimpdrawable.[ch]: added new signal
GimpDrawable::update(). Never update or invalidate the image when
the drawable is updated or invalidated.
(gimp_drawable_set_visible): don't gimp_drawable_update() the
drawable since its pixels have not changed.
* app/core/gimpimage.[ch]: connect to the "add" and "remove"
signals of the layers and channels containers. Also connect to the
"update" and "visibility_changed" signals of all drawables in
these containers (optimizes away updates issued by drawables which
are not yet added to the image and updates of the selection
mask). Also, don't propagate updates to the image if the emitting
drawable is invisible (optimizes away updates issued by invisible
drawables).
(gimp_image_add_layer,channel)
(gimp_image_remove_layer,channel): don't update the image since
that's done by our "add" and "remove" handlers now.
(gimp_image_position_layer,channel): update just the image, not
the drawable since its pixels have not changed.
(gimp_image_real_colormap_changed)
(gimp_image_set_component_visible): always call
gimp_image_update() *and* gimp_viewable_invalidate_preview() to
get everything updated, since update and invalidate of images are
not connected.
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): don't
update the drawable since (a) its pixels don't change and (b) the
image updates itself upon adding/removing now.
(undo_pop_layer_mod): replaced gimp_image_update() by
gimp_drawable_update() (just for consistency with other similar
functions).
* app/core/gimplayer.c: connect to "update" of the layer mask and
issue updates on the layer if the mask update has any effect on
the projection.
(gimp_layer_create_mask): don't set the mask's offsets here since
they may be different when we later add the mask to the layer.
* app/core/gimplayermask.c (gimp_layer_mask_set_layer): set the
mask offsets here instead.
* app/core/gimpchannel.c (gimp_channel_translate): update the
channel even if push_undo == FALSE.
* app/paint/gimppaintcore.c (gimp_paint_core_finish)
* app/tools/gimpinktool.c (ink_finish): invalidate both the
drawable and the image preview since invalidating the drawable
doesn't invalidate the image any more.
* app/text/gimptextlayer.c (gimp_text_layer_render_now): also
update the new extents of the text layer, not only the old one.
(gimp_text_layer_render_layout): don't update the drawable since
gimp_drawable_fill() already updated it.
2003-09-07 04:06:53 +08:00
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2007-06-14 15:06:58 +08:00
|
|
|
G_DEFINE_TYPE_WITH_CODE (GimpImage, gimp_image, GIMP_TYPE_VIEWABLE,
|
app, libgimp*, modules: don't use g_type_class_add_private() ...
... and G_TYPE_INSTANCE_GET_PRIVATE()
g_type_class_add_private() and G_TYPE_INSTANCE_GET_PRIVATE() were
deprecated in GLib 2.58. Instead, use
G_DEFINE_[ABSTRACT_]TYPE_WITH_PRIVATE(), and
G_ADD_PRIVATE[_DYNAMIC](), and the implictly-defined
foo_get_instance_private() functions, all of which are available in
the GLib versions we depend on.
This commit only covers types registered using one of the
G_DEFINE_FOO() macros (i.e., most types), but not types with a
custom registration function, of which we still have a few -- GLib
currently only provides a (non-deprecated) public API for adding a
private struct using the G_DEFINE_FOO() macros.
Note that this commit was 99% auto-generated (because I'm not
*that* crazy :), so if there are any style mismatches... we'll have
to live with them for now.
2018-09-19 00:09:39 +08:00
|
|
|
G_ADD_PRIVATE (GimpImage)
|
2007-06-14 15:06:58 +08:00
|
|
|
G_IMPLEMENT_INTERFACE (GIMP_TYPE_COLOR_MANAGED,
|
2008-11-05 02:06:36 +08:00
|
|
|
gimp_color_managed_iface_init)
|
|
|
|
G_IMPLEMENT_INTERFACE (GIMP_TYPE_PROJECTABLE,
|
2013-09-14 05:25:30 +08:00
|
|
|
gimp_projectable_iface_init)
|
|
|
|
G_IMPLEMENT_INTERFACE (GIMP_TYPE_PICKABLE,
|
|
|
|
gimp_pickable_iface_init))
|
1998-06-28 18:39:58 +08:00
|
|
|
|
2005-12-11 03:24:36 +08:00
|
|
|
#define parent_class gimp_image_parent_class
|
|
|
|
|
|
|
|
static guint gimp_image_signals[LAST_SIGNAL] = { 0 };
|
2000-12-04 05:34:38 +08:00
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
1998-06-28 18:39:58 +08:00
|
|
|
static void
|
|
|
|
gimp_image_class_init (GimpImageClass *klass)
|
|
|
|
{
|
2004-07-14 20:12:50 +08:00
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
|
|
|
GimpObjectClass *gimp_object_class = GIMP_OBJECT_CLASS (klass);
|
|
|
|
GimpViewableClass *viewable_class = GIMP_VIEWABLE_CLASS (klass);
|
1998-06-28 18:39:58 +08:00
|
|
|
|
2001-05-07 00:14:34 +08:00
|
|
|
gimp_image_signals[MODE_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("mode-changed",
|
2004-07-14 20:12:50 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, mode_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
2001-05-07 00:14:34 +08:00
|
|
|
|
2012-04-25 22:46:58 +08:00
|
|
|
gimp_image_signals[PRECISION_CHANGED] =
|
|
|
|
g_signal_new ("precision-changed",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, precision_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
|
|
|
|
2001-05-07 02:58:04 +08:00
|
|
|
gimp_image_signals[ALPHA_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("alpha-changed",
|
2004-07-14 20:12:50 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, alpha_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
2001-05-07 02:58:04 +08:00
|
|
|
|
2001-05-08 09:32:25 +08:00
|
|
|
gimp_image_signals[FLOATING_SELECTION_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("floating-selection-changed",
|
2004-07-14 20:12:50 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, floating_selection_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
2001-05-08 09:32:25 +08:00
|
|
|
|
2001-02-27 22:14:13 +08:00
|
|
|
gimp_image_signals[ACTIVE_LAYER_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("active-layer-changed",
|
2004-07-14 20:12:50 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, active_layer_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
2001-02-27 22:14:13 +08:00
|
|
|
|
|
|
|
gimp_image_signals[ACTIVE_CHANNEL_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("active-channel-changed",
|
2004-07-14 20:12:50 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, active_channel_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
2001-02-27 22:14:13 +08:00
|
|
|
|
2002-02-24 01:29:19 +08:00
|
|
|
gimp_image_signals[ACTIVE_VECTORS_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("active-vectors-changed",
|
2004-07-14 20:12:50 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, active_vectors_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
2002-02-24 01:29:19 +08:00
|
|
|
|
2001-05-03 20:26:05 +08:00
|
|
|
gimp_image_signals[COMPONENT_VISIBILITY_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("component-visibility-changed",
|
2004-07-14 20:12:50 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, component_visibility_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__ENUM,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
GIMP_TYPE_CHANNEL_TYPE);
|
2001-05-03 20:26:05 +08:00
|
|
|
|
|
|
|
gimp_image_signals[COMPONENT_ACTIVE_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("component-active-changed",
|
2004-07-14 20:12:50 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, component_active_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__ENUM,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
GIMP_TYPE_CHANNEL_TYPE);
|
2001-05-03 20:26:05 +08:00
|
|
|
|
2001-06-01 03:53:13 +08:00
|
|
|
gimp_image_signals[MASK_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("mask-changed",
|
2004-07-14 20:12:50 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, mask_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
2001-06-01 03:53:13 +08:00
|
|
|
|
2001-11-01 05:18:57 +08:00
|
|
|
gimp_image_signals[RESOLUTION_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("resolution-changed",
|
2004-07-14 20:12:50 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, resolution_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
2001-11-01 05:18:57 +08:00
|
|
|
|
2008-08-03 19:35:53 +08:00
|
|
|
gimp_image_signals[SIZE_CHANGED_DETAILED] =
|
|
|
|
g_signal_new ("size-changed-detailed",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, size_changed_detailed),
|
|
|
|
NULL, NULL,
|
2008-08-29 03:12:03 +08:00
|
|
|
gimp_marshal_VOID__INT_INT_INT_INT,
|
|
|
|
G_TYPE_NONE, 4,
|
|
|
|
G_TYPE_INT,
|
|
|
|
G_TYPE_INT,
|
2008-08-05 04:11:35 +08:00
|
|
|
G_TYPE_INT,
|
|
|
|
G_TYPE_INT);
|
2008-08-03 19:35:53 +08:00
|
|
|
|
2001-11-01 05:18:57 +08:00
|
|
|
gimp_image_signals[UNIT_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("unit-changed",
|
2004-07-14 20:12:50 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, unit_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
2001-11-01 05:18:57 +08:00
|
|
|
|
2005-09-19 20:44:06 +08:00
|
|
|
gimp_image_signals[QUICK_MASK_CHANGED] =
|
|
|
|
g_signal_new ("quick-mask-changed",
|
2004-07-14 20:12:50 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
2005-09-19 20:44:06 +08:00
|
|
|
G_STRUCT_OFFSET (GimpImageClass, quick_mask_changed),
|
2004-07-14 20:12:50 +08:00
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
2001-11-11 03:10:28 +08:00
|
|
|
|
2010-10-10 02:23:05 +08:00
|
|
|
gimp_image_signals[SELECTION_INVALIDATE] =
|
|
|
|
g_signal_new ("selection-invalidate",
|
2004-07-14 20:12:50 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
2010-10-10 02:23:05 +08:00
|
|
|
G_STRUCT_OFFSET (GimpImageClass, selection_invalidate),
|
2004-07-14 20:12:50 +08:00
|
|
|
NULL, NULL,
|
2010-10-10 02:23:05 +08:00
|
|
|
gimp_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
2001-09-26 01:44:03 +08:00
|
|
|
|
1999-08-23 22:34:58 +08:00
|
|
|
gimp_image_signals[CLEAN] =
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
g_signal_new ("clean",
|
2004-07-14 20:12:50 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, clean),
|
|
|
|
NULL, NULL,
|
2004-07-29 22:16:21 +08:00
|
|
|
gimp_marshal_VOID__FLAGS,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
GIMP_TYPE_DIRTY_MASK);
|
2001-01-10 08:36:54 +08:00
|
|
|
|
1998-06-28 18:39:58 +08:00
|
|
|
gimp_image_signals[DIRTY] =
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-25 05:27:11 +08:00
|
|
|
g_signal_new ("dirty",
|
2004-07-14 20:12:50 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, dirty),
|
|
|
|
NULL, NULL,
|
2004-07-29 22:16:21 +08:00
|
|
|
gimp_marshal_VOID__FLAGS,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
GIMP_TYPE_DIRTY_MASK);
|
2001-01-10 08:36:54 +08:00
|
|
|
|
2018-09-29 14:25:34 +08:00
|
|
|
gimp_image_signals[SAVING] =
|
|
|
|
g_signal_new ("saving",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, saving),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__VOID,
|
|
|
|
G_TYPE_NONE, 0);
|
|
|
|
|
2006-12-12 04:57:44 +08:00
|
|
|
gimp_image_signals[SAVED] =
|
|
|
|
g_signal_new ("saved",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, saved),
|
|
|
|
NULL, NULL,
|
2014-07-08 05:56:56 +08:00
|
|
|
gimp_marshal_VOID__OBJECT,
|
2006-12-12 04:57:44 +08:00
|
|
|
G_TYPE_NONE, 1,
|
2014-07-08 05:56:56 +08:00
|
|
|
G_TYPE_FILE);
|
2006-12-12 04:57:44 +08:00
|
|
|
|
2009-05-16 17:27:45 +08:00
|
|
|
gimp_image_signals[EXPORTED] =
|
|
|
|
g_signal_new ("exported",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, exported),
|
|
|
|
NULL, NULL,
|
2014-07-08 05:56:56 +08:00
|
|
|
gimp_marshal_VOID__OBJECT,
|
2009-05-16 17:27:45 +08:00
|
|
|
G_TYPE_NONE, 1,
|
2014-07-08 05:56:56 +08:00
|
|
|
G_TYPE_FILE);
|
2009-05-16 17:27:45 +08:00
|
|
|
|
2010-10-01 16:34:15 +08:00
|
|
|
gimp_image_signals[GUIDE_ADDED] =
|
|
|
|
g_signal_new ("guide-added",
|
2010-09-17 17:31:57 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
2010-10-01 16:34:15 +08:00
|
|
|
G_STRUCT_OFFSET (GimpImageClass, guide_added),
|
2010-09-17 17:31:57 +08:00
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__OBJECT,
|
|
|
|
G_TYPE_NONE, 1,
|
2010-10-01 16:34:15 +08:00
|
|
|
GIMP_TYPE_GUIDE);
|
|
|
|
|
|
|
|
gimp_image_signals[GUIDE_REMOVED] =
|
|
|
|
g_signal_new ("guide-removed",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, guide_removed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__OBJECT,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
GIMP_TYPE_GUIDE);
|
|
|
|
|
|
|
|
gimp_image_signals[GUIDE_MOVED] =
|
|
|
|
g_signal_new ("guide-moved",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, guide_moved),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__OBJECT,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
GIMP_TYPE_GUIDE);
|
2010-09-17 17:31:57 +08:00
|
|
|
|
2005-04-03 23:48:03 +08:00
|
|
|
gimp_image_signals[SAMPLE_POINT_ADDED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("sample-point-added",
|
2005-04-03 23:48:03 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, sample_point_added),
|
|
|
|
NULL, NULL,
|
2018-07-15 21:58:24 +08:00
|
|
|
gimp_marshal_VOID__OBJECT,
|
2005-04-03 23:48:03 +08:00
|
|
|
G_TYPE_NONE, 1,
|
2018-07-15 21:58:24 +08:00
|
|
|
GIMP_TYPE_SAMPLE_POINT);
|
2005-04-03 23:48:03 +08:00
|
|
|
|
|
|
|
gimp_image_signals[SAMPLE_POINT_REMOVED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("sample-point-removed",
|
2005-04-03 23:48:03 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, sample_point_removed),
|
|
|
|
NULL, NULL,
|
2018-07-15 21:58:24 +08:00
|
|
|
gimp_marshal_VOID__OBJECT,
|
2005-04-03 23:48:03 +08:00
|
|
|
G_TYPE_NONE, 1,
|
2018-07-15 21:58:24 +08:00
|
|
|
GIMP_TYPE_SAMPLE_POINT);
|
2005-04-03 23:48:03 +08:00
|
|
|
|
2010-10-01 15:15:52 +08:00
|
|
|
gimp_image_signals[SAMPLE_POINT_MOVED] =
|
|
|
|
g_signal_new ("sample-point-moved",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, sample_point_moved),
|
|
|
|
NULL, NULL,
|
2018-07-15 21:58:24 +08:00
|
|
|
gimp_marshal_VOID__OBJECT,
|
2010-10-01 15:15:52 +08:00
|
|
|
G_TYPE_NONE, 1,
|
2018-07-15 21:58:24 +08:00
|
|
|
GIMP_TYPE_SAMPLE_POINT);
|
2010-10-01 15:15:52 +08:00
|
|
|
|
2006-10-25 15:31:04 +08:00
|
|
|
gimp_image_signals[PARASITE_ATTACHED] =
|
|
|
|
g_signal_new ("parasite-attached",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, parasite_attached),
|
|
|
|
NULL, NULL,
|
|
|
|
g_cclosure_marshal_VOID__STRING,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
G_TYPE_STRING);
|
|
|
|
|
|
|
|
gimp_image_signals[PARASITE_DETACHED] =
|
|
|
|
g_signal_new ("parasite-detached",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, parasite_detached),
|
|
|
|
NULL, NULL,
|
|
|
|
g_cclosure_marshal_VOID__STRING,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
G_TYPE_STRING);
|
|
|
|
|
1999-01-08 03:53:05 +08:00
|
|
|
gimp_image_signals[COLORMAP_CHANGED] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("colormap-changed",
|
2004-07-14 20:12:50 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, colormap_changed),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__INT,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
G_TYPE_INT);
|
2001-01-10 08:36:54 +08:00
|
|
|
|
2003-08-25 18:49:33 +08:00
|
|
|
gimp_image_signals[UNDO_EVENT] =
|
2005-05-27 21:05:26 +08:00
|
|
|
g_signal_new ("undo-event",
|
2004-07-14 20:12:50 +08:00
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpImageClass, undo_event),
|
|
|
|
NULL, NULL,
|
|
|
|
gimp_marshal_VOID__ENUM_OBJECT,
|
|
|
|
G_TYPE_NONE, 2,
|
|
|
|
GIMP_TYPE_UNDO_EVENT,
|
2003-02-20 20:47:42 +08:00
|
|
|
GIMP_TYPE_UNDO);
|
2000-12-29 00:19:55 +08:00
|
|
|
|
2011-01-13 05:53:58 +08:00
|
|
|
object_class->constructed = gimp_image_constructed;
|
2004-07-14 20:12:50 +08:00
|
|
|
object_class->set_property = gimp_image_set_property;
|
|
|
|
object_class->get_property = gimp_image_get_property;
|
2001-08-12 03:53:35 +08:00
|
|
|
object_class->dispose = gimp_image_dispose;
|
|
|
|
object_class->finalize = gimp_image_finalize;
|
2000-12-29 00:19:55 +08:00
|
|
|
|
2001-05-03 20:26:05 +08:00
|
|
|
gimp_object_class->name_changed = gimp_image_name_changed;
|
2002-01-31 00:14:26 +08:00
|
|
|
gimp_object_class->get_memsize = gimp_image_get_memsize;
|
2001-01-14 11:55:56 +08:00
|
|
|
|
2014-05-07 07:01:56 +08:00
|
|
|
viewable_class->default_icon_name = "gimp-image";
|
2005-05-25 18:05:17 +08:00
|
|
|
viewable_class->get_size = gimp_image_get_size;
|
2001-06-18 21:10:03 +08:00
|
|
|
viewable_class->size_changed = gimp_image_size_changed;
|
2003-02-22 03:03:19 +08:00
|
|
|
viewable_class->get_preview_size = gimp_image_get_preview_size;
|
2003-02-27 21:59:41 +08:00
|
|
|
viewable_class->get_popup_size = gimp_image_get_popup_size;
|
2001-05-03 20:26:05 +08:00
|
|
|
viewable_class->get_new_preview = gimp_image_get_new_preview;
|
2016-04-15 23:52:25 +08:00
|
|
|
viewable_class->get_new_pixbuf = gimp_image_get_new_pixbuf;
|
2003-04-09 00:01:01 +08:00
|
|
|
viewable_class->get_description = gimp_image_get_description;
|
2001-02-05 06:10:54 +08:00
|
|
|
|
2008-11-05 07:22:45 +08:00
|
|
|
klass->mode_changed = gimp_image_real_mode_changed;
|
2012-04-25 22:46:58 +08:00
|
|
|
klass->precision_changed = gimp_image_real_precision_changed;
|
2001-05-07 02:58:04 +08:00
|
|
|
klass->alpha_changed = NULL;
|
2001-05-08 09:32:25 +08:00
|
|
|
klass->floating_selection_changed = NULL;
|
2001-05-03 20:26:05 +08:00
|
|
|
klass->active_layer_changed = NULL;
|
|
|
|
klass->active_channel_changed = NULL;
|
2002-02-24 01:29:19 +08:00
|
|
|
klass->active_vectors_changed = NULL;
|
2001-05-03 20:26:05 +08:00
|
|
|
klass->component_visibility_changed = NULL;
|
|
|
|
klass->component_active_changed = NULL;
|
2001-06-01 03:53:13 +08:00
|
|
|
klass->mask_changed = NULL;
|
2013-10-20 00:38:01 +08:00
|
|
|
klass->resolution_changed = gimp_image_real_resolution_changed;
|
2008-08-05 04:11:35 +08:00
|
|
|
klass->size_changed_detailed = gimp_image_real_size_changed_detailed;
|
2013-10-20 00:38:01 +08:00
|
|
|
klass->unit_changed = gimp_image_real_unit_changed;
|
2008-08-05 04:11:35 +08:00
|
|
|
klass->quick_mask_changed = NULL;
|
2010-10-10 02:23:05 +08:00
|
|
|
klass->selection_invalidate = NULL;
|
2001-05-07 01:56:10 +08:00
|
|
|
|
2001-05-03 20:26:05 +08:00
|
|
|
klass->clean = NULL;
|
|
|
|
klass->dirty = NULL;
|
2018-09-29 14:25:34 +08:00
|
|
|
klass->saving = NULL;
|
2006-12-12 04:57:44 +08:00
|
|
|
klass->saved = NULL;
|
2009-05-16 17:27:45 +08:00
|
|
|
klass->exported = NULL;
|
2010-10-01 16:34:15 +08:00
|
|
|
klass->guide_added = NULL;
|
|
|
|
klass->guide_removed = NULL;
|
|
|
|
klass->guide_moved = NULL;
|
2005-04-03 23:48:03 +08:00
|
|
|
klass->sample_point_added = NULL;
|
|
|
|
klass->sample_point_removed = NULL;
|
2010-10-01 15:15:52 +08:00
|
|
|
klass->sample_point_moved = NULL;
|
2006-10-25 15:31:04 +08:00
|
|
|
klass->parasite_attached = NULL;
|
|
|
|
klass->parasite_detached = NULL;
|
2001-05-15 19:25:25 +08:00
|
|
|
klass->colormap_changed = gimp_image_real_colormap_changed;
|
2001-05-03 20:26:05 +08:00
|
|
|
klass->undo_event = NULL;
|
2003-01-02 21:38:09 +08:00
|
|
|
|
2004-07-14 20:12:50 +08:00
|
|
|
g_object_class_install_property (object_class, PROP_GIMP,
|
|
|
|
g_param_spec_object ("gimp", NULL, NULL,
|
|
|
|
GIMP_TYPE_GIMP,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_READWRITE |
|
2004-07-14 20:12:50 +08:00
|
|
|
G_PARAM_CONSTRUCT_ONLY));
|
|
|
|
|
|
|
|
g_object_class_install_property (object_class, PROP_ID,
|
|
|
|
g_param_spec_int ("id", NULL, NULL,
|
|
|
|
0, G_MAXINT, 0,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_READABLE));
|
2004-07-14 20:12:50 +08:00
|
|
|
|
|
|
|
g_object_class_install_property (object_class, PROP_WIDTH,
|
|
|
|
g_param_spec_int ("width", NULL, NULL,
|
|
|
|
1, GIMP_MAX_IMAGE_SIZE, 1,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_READWRITE |
|
2004-07-14 20:12:50 +08:00
|
|
|
G_PARAM_CONSTRUCT));
|
|
|
|
|
|
|
|
g_object_class_install_property (object_class, PROP_HEIGHT,
|
|
|
|
g_param_spec_int ("height", NULL, NULL,
|
|
|
|
1, GIMP_MAX_IMAGE_SIZE, 1,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_READWRITE |
|
2004-07-14 20:12:50 +08:00
|
|
|
G_PARAM_CONSTRUCT));
|
|
|
|
|
|
|
|
g_object_class_install_property (object_class, PROP_BASE_TYPE,
|
|
|
|
g_param_spec_enum ("base-type", NULL, NULL,
|
|
|
|
GIMP_TYPE_IMAGE_BASE_TYPE,
|
|
|
|
GIMP_RGB,
|
2006-01-19 04:29:40 +08:00
|
|
|
GIMP_PARAM_READWRITE |
|
2004-07-14 20:12:50 +08:00
|
|
|
G_PARAM_CONSTRUCT));
|
|
|
|
|
2012-04-22 23:31:32 +08:00
|
|
|
g_object_class_install_property (object_class, PROP_PRECISION,
|
|
|
|
g_param_spec_enum ("precision", NULL, NULL,
|
|
|
|
GIMP_TYPE_PRECISION,
|
Initial space invasion commit in GIMP
All babl formats now have a space equivalent to a color profile,
determining the format's primaries and TRCs. This commit makes GIMP
aware of this.
libgimp:
- enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA
as deprecated aliases, add PERCEPTUAL values so we now have LINEAR,
NON_LINEAR and PERCPTUAL for each encoding, matching the babl
encoding variants RGB, R'G'B' and R~G~B~.
- gimp_color_transform_can_gegl_copy() now returns TRUE if both
profiles can return a babl space, increasing the amount of fast babl
color conversions significantly.
- TODO: no solution yet for getting libgimp drawable proxy buffers in
the right format with space.
plug-ins:
- follow the GimpPrecision change.
- TODO: everything else unchanged and partly broken or sub-optimal,
like setting a new image's color profile too late.
app:
- add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as
replacement for all "linear" booleans.
- change gimp-babl functions to take babl spaces and GimpTRCType
parameters and support all sorts of new perceptual ~ formats.
- a lot of places changed in the early days of goat invasion didn't
take advantage of gimp-babl utility functions and constructed
formats manually. They all needed revisiting and many now use much
simpler code calling gimp-babl API.
- change gimp_babl_format_get_color_profile() to really extract a
newly allocated color profile from the format, and add
gimp_babl_get_builtin_color_profile() which does the same as
gimp_babl_format_get_color_profile() did before. Visited all callers
to decide whether they are looking for the format's actual profile,
or for one of the builtin profiles, simplifying code that only needs
builtin profiles.
- drawables have a new get_space_api(), get_linear() is now get_trc().
- images now have a "layer space" and an API to get it,
gimp_image_get_layer_format() returns formats in that space.
- an image's layer space is created from the image's color profile,
change gimpimage-color-profile to deal with that correctly
- change many babl_format() calls to babl_format_with_space() and take
the space from passed formats or drawables
- add function gimp_layer_fix_format_space() which replaces the
layer's buffer with one that has the image's layer format, but
doesn't change pixel values
- use gimp_layer_fix_format_space() to make sure layers loaded from
XCF and created by plug-ins have the right space when added to the
image, because it's impossible to always assign the right space upon
layer creation
- "assign color profile" and "discard color profile" now require use
of gimp_layer_fix_format_space() too because the profile is now
embedded in all formats via the space. Add
gimp_image_assign_color_profile() which does all that and call it
instead of a simple gimp_image_set_color_profile(), also from the
PDB set-color-profile functions, which are essentially "assign" and
"discard" calls.
- generally, make sure a new image's color profile is set before
adding layers to it, gimp_image_set_color_profile() is more than
before considered know-what-you-are-doing API.
- take special precaution in all places that call
gimp_drawable_convert_type(), we now must pass a new_profile from
all callers that convert layers within the same image (such as
image_convert_type, image_convert_precision), because the layer's
new space can't be determined from the image's layer format during
the call.
- change all "linear" properties to "trc", in all config objects like
for levels and curves, in the histogram, in the widgets. This results
in some GUI that now has three choices instead of two.
TODO: we might want to reduce that back to two later.
- keep "linear" boolean properties around as compat if needed for file
pasring, but always convert the parsed parsed boolean to
GimpTRCType.
- TODO: the image's "enable color management" switch is currently
broken, will fix that in another commit.
2018-07-21 20:23:01 +08:00
|
|
|
GIMP_PRECISION_U8_NON_LINEAR,
|
2012-04-22 23:31:32 +08:00
|
|
|
GIMP_PARAM_READWRITE |
|
|
|
|
G_PARAM_CONSTRUCT));
|
|
|
|
|
2013-10-20 00:38:01 +08:00
|
|
|
g_object_class_install_property (object_class, PROP_METADATA,
|
|
|
|
g_param_spec_object ("metadata", NULL, NULL,
|
|
|
|
GEXIV2_TYPE_METADATA,
|
|
|
|
GIMP_PARAM_READABLE));
|
|
|
|
|
2013-09-14 05:25:30 +08:00
|
|
|
g_object_class_override_property (object_class, PROP_BUFFER, "buffer");
|
|
|
|
|
2016-01-28 02:13:17 +08:00
|
|
|
g_object_class_install_property (object_class, PROP_SYMMETRY,
|
2016-01-22 04:43:15 +08:00
|
|
|
g_param_spec_gtype ("symmetry",
|
|
|
|
NULL, _("Symmetry"),
|
|
|
|
GIMP_TYPE_SYMMETRY,
|
|
|
|
GIMP_PARAM_READWRITE |
|
|
|
|
G_PARAM_CONSTRUCT));
|
1998-06-28 18:39:58 +08:00
|
|
|
}
|
|
|
|
|
2007-06-14 15:06:58 +08:00
|
|
|
static void
|
|
|
|
gimp_color_managed_iface_init (GimpColorManagedInterface *iface)
|
|
|
|
{
|
2015-05-26 14:05:25 +08:00
|
|
|
iface->get_icc_profile = gimp_image_color_managed_get_icc_profile;
|
|
|
|
iface->get_color_profile = gimp_image_color_managed_get_color_profile;
|
2015-09-03 02:55:48 +08:00
|
|
|
iface->profile_changed = gimp_image_color_managed_profile_changed;
|
2007-06-14 15:06:58 +08:00
|
|
|
}
|
|
|
|
|
2008-11-05 02:06:36 +08:00
|
|
|
static void
|
|
|
|
gimp_projectable_iface_init (GimpProjectableInterface *iface)
|
|
|
|
{
|
2008-11-05 04:13:12 +08:00
|
|
|
iface->flush = gimp_image_projectable_flush;
|
|
|
|
iface->get_image = gimp_image_get_image;
|
2012-03-30 03:09:37 +08:00
|
|
|
iface->get_format = gimp_image_get_proj_format;
|
2008-11-06 04:10:51 +08:00
|
|
|
iface->get_size = (void (*) (GimpProjectable*, gint*, gint*)) gimp_image_get_size;
|
2008-11-05 04:13:12 +08:00
|
|
|
iface->get_graph = gimp_image_get_graph;
|
2008-11-06 04:10:51 +08:00
|
|
|
iface->invalidate_preview = (void (*) (GimpProjectable*)) gimp_viewable_invalidate_preview;
|
2008-11-05 02:06:36 +08:00
|
|
|
}
|
|
|
|
|
2013-09-14 05:25:30 +08:00
|
|
|
static void
|
|
|
|
gimp_pickable_iface_init (GimpPickableInterface *iface)
|
|
|
|
{
|
|
|
|
iface->flush = gimp_image_pickable_flush;
|
|
|
|
iface->get_image = (GimpImage * (*) (GimpPickable *pickable)) gimp_image_get_image;
|
|
|
|
iface->get_format = (const Babl * (*) (GimpPickable *pickable)) gimp_image_get_proj_format;
|
|
|
|
iface->get_format_with_alpha = (const Babl * (*) (GimpPickable *pickable)) gimp_image_get_proj_format;
|
|
|
|
iface->get_buffer = gimp_image_get_buffer;
|
|
|
|
iface->get_pixel_at = gimp_image_get_pixel_at;
|
|
|
|
iface->get_opacity_at = gimp_image_get_opacity_at;
|
2018-05-19 02:57:19 +08:00
|
|
|
iface->get_pixel_average = gimp_image_get_pixel_average;
|
2016-05-23 05:28:31 +08:00
|
|
|
iface->pixel_to_srgb = gimp_image_pixel_to_srgb;
|
2016-05-23 07:25:35 +08:00
|
|
|
iface->srgb_to_pixel = gimp_image_srgb_to_pixel;
|
2013-09-14 05:25:30 +08:00
|
|
|
}
|
|
|
|
|
2003-08-25 18:49:33 +08:00
|
|
|
static void
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_init (GimpImage *image)
|
1998-06-28 18:39:58 +08:00
|
|
|
{
|
app, libgimp*, modules: don't use g_type_class_add_private() ...
... and G_TYPE_INSTANCE_GET_PRIVATE()
g_type_class_add_private() and G_TYPE_INSTANCE_GET_PRIVATE() were
deprecated in GLib 2.58. Instead, use
G_DEFINE_[ABSTRACT_]TYPE_WITH_PRIVATE(), and
G_ADD_PRIVATE[_DYNAMIC](), and the implictly-defined
foo_get_instance_private() functions, all of which are available in
the GLib versions we depend on.
This commit only covers types registered using one of the
G_DEFINE_FOO() macros (i.e., most types), but not types with a
custom registration function, of which we still have a few -- GLib
currently only provides a (non-deprecated) public API for adding a
private struct using the G_DEFINE_FOO() macros.
Note that this commit was 99% auto-generated (because I'm not
*that* crazy :), so if there are any style mismatches... we'll have
to live with them for now.
2018-09-19 00:09:39 +08:00
|
|
|
GimpImagePrivate *private = gimp_image_get_instance_private (image);
|
2010-02-04 03:31:25 +08:00
|
|
|
gint i;
|
2004-01-15 21:58:27 +08:00
|
|
|
|
app, libgimp*, modules: don't use g_type_class_add_private() ...
... and G_TYPE_INSTANCE_GET_PRIVATE()
g_type_class_add_private() and G_TYPE_INSTANCE_GET_PRIVATE() were
deprecated in GLib 2.58. Instead, use
G_DEFINE_[ABSTRACT_]TYPE_WITH_PRIVATE(), and
G_ADD_PRIVATE[_DYNAMIC](), and the implictly-defined
foo_get_instance_private() functions, all of which are available in
the GLib versions we depend on.
This commit only covers types registered using one of the
G_DEFINE_FOO() macros (i.e., most types), but not types with a
custom registration function, of which we still have a few -- GLib
currently only provides a (non-deprecated) public API for adding a
private struct using the G_DEFINE_FOO() macros.
Note that this commit was 99% auto-generated (because I'm not
*that* crazy :), so if there are any style mismatches... we'll have
to live with them for now.
2018-09-19 00:09:39 +08:00
|
|
|
image->priv = private;
|
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
private->ID = 0;
|
2001-04-13 22:50:43 +08:00
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
private->load_proc = NULL;
|
|
|
|
private->save_proc = NULL;
|
2001-01-15 12:37:01 +08:00
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
private->width = 0;
|
|
|
|
private->height = 0;
|
|
|
|
private->xresolution = 1.0;
|
|
|
|
private->yresolution = 1.0;
|
|
|
|
private->resolution_unit = GIMP_UNIT_INCH;
|
|
|
|
private->base_type = GIMP_RGB;
|
Initial space invasion commit in GIMP
All babl formats now have a space equivalent to a color profile,
determining the format's primaries and TRCs. This commit makes GIMP
aware of this.
libgimp:
- enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA
as deprecated aliases, add PERCEPTUAL values so we now have LINEAR,
NON_LINEAR and PERCPTUAL for each encoding, matching the babl
encoding variants RGB, R'G'B' and R~G~B~.
- gimp_color_transform_can_gegl_copy() now returns TRUE if both
profiles can return a babl space, increasing the amount of fast babl
color conversions significantly.
- TODO: no solution yet for getting libgimp drawable proxy buffers in
the right format with space.
plug-ins:
- follow the GimpPrecision change.
- TODO: everything else unchanged and partly broken or sub-optimal,
like setting a new image's color profile too late.
app:
- add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as
replacement for all "linear" booleans.
- change gimp-babl functions to take babl spaces and GimpTRCType
parameters and support all sorts of new perceptual ~ formats.
- a lot of places changed in the early days of goat invasion didn't
take advantage of gimp-babl utility functions and constructed
formats manually. They all needed revisiting and many now use much
simpler code calling gimp-babl API.
- change gimp_babl_format_get_color_profile() to really extract a
newly allocated color profile from the format, and add
gimp_babl_get_builtin_color_profile() which does the same as
gimp_babl_format_get_color_profile() did before. Visited all callers
to decide whether they are looking for the format's actual profile,
or for one of the builtin profiles, simplifying code that only needs
builtin profiles.
- drawables have a new get_space_api(), get_linear() is now get_trc().
- images now have a "layer space" and an API to get it,
gimp_image_get_layer_format() returns formats in that space.
- an image's layer space is created from the image's color profile,
change gimpimage-color-profile to deal with that correctly
- change many babl_format() calls to babl_format_with_space() and take
the space from passed formats or drawables
- add function gimp_layer_fix_format_space() which replaces the
layer's buffer with one that has the image's layer format, but
doesn't change pixel values
- use gimp_layer_fix_format_space() to make sure layers loaded from
XCF and created by plug-ins have the right space when added to the
image, because it's impossible to always assign the right space upon
layer creation
- "assign color profile" and "discard color profile" now require use
of gimp_layer_fix_format_space() too because the profile is now
embedded in all formats via the space. Add
gimp_image_assign_color_profile() which does all that and call it
instead of a simple gimp_image_set_color_profile(), also from the
PDB set-color-profile functions, which are essentially "assign" and
"discard" calls.
- generally, make sure a new image's color profile is set before
adding layers to it, gimp_image_set_color_profile() is more than
before considered know-what-you-are-doing API.
- take special precaution in all places that call
gimp_drawable_convert_type(), we now must pass a new_profile from
all callers that convert layers within the same image (such as
image_convert_type, image_convert_precision), because the layer's
new space can't be determined from the image's layer format during
the call.
- change all "linear" properties to "trc", in all config objects like
for levels and curves, in the histogram, in the widgets. This results
in some GUI that now has three choices instead of two.
TODO: we might want to reduce that back to two later.
- keep "linear" boolean properties around as compat if needed for file
pasring, but always convert the parsed parsed boolean to
GimpTRCType.
- TODO: the image's "enable color management" switch is currently
broken, will fix that in another commit.
2018-07-21 20:23:01 +08:00
|
|
|
private->precision = GIMP_PRECISION_U8_NON_LINEAR;
|
2017-08-22 02:04:25 +08:00
|
|
|
private->new_layer_mode = -1;
|
2001-01-15 12:37:01 +08:00
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
private->colormap = NULL;
|
|
|
|
private->n_colors = 0;
|
2010-10-27 21:40:43 +08:00
|
|
|
private->palette = NULL;
|
2001-01-15 12:37:01 +08:00
|
|
|
|
2013-10-20 00:38:01 +08:00
|
|
|
private->metadata = NULL;
|
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
private->dirty = 1;
|
|
|
|
private->dirty_time = 0;
|
|
|
|
private->undo_freeze_count = 0;
|
2001-01-15 12:37:01 +08:00
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
private->export_dirty = 1;
|
2009-07-04 04:51:11 +08:00
|
|
|
|
2010-02-04 04:20:29 +08:00
|
|
|
private->instance_count = 0;
|
|
|
|
private->disp_count = 0;
|
2001-01-15 12:37:01 +08:00
|
|
|
|
2010-02-04 04:31:27 +08:00
|
|
|
private->tattoo_state = 0;
|
2001-01-15 12:37:01 +08:00
|
|
|
|
2010-02-04 04:46:09 +08:00
|
|
|
private->projection = gimp_projection_new (GIMP_PROJECTABLE (image));
|
2001-01-15 12:37:01 +08:00
|
|
|
|
2016-01-28 02:13:17 +08:00
|
|
|
private->symmetries = NULL;
|
2016-02-04 04:25:17 +08:00
|
|
|
private->active_symmetry = NULL;
|
2016-01-28 02:13:17 +08:00
|
|
|
|
2010-02-04 05:16:02 +08:00
|
|
|
private->guides = NULL;
|
|
|
|
private->grid = NULL;
|
|
|
|
private->sample_points = NULL;
|
2005-03-05 02:16:29 +08:00
|
|
|
|
2010-02-06 20:49:09 +08:00
|
|
|
private->layers = gimp_item_tree_new (image,
|
2017-05-09 04:02:37 +08:00
|
|
|
GIMP_TYPE_LAYER_STACK,
|
2010-02-06 20:41:16 +08:00
|
|
|
GIMP_TYPE_LAYER);
|
2010-02-06 20:49:09 +08:00
|
|
|
private->channels = gimp_item_tree_new (image,
|
|
|
|
GIMP_TYPE_DRAWABLE_STACK,
|
2010-02-06 20:41:16 +08:00
|
|
|
GIMP_TYPE_CHANNEL);
|
2010-02-06 20:49:09 +08:00
|
|
|
private->vectors = gimp_item_tree_new (image,
|
|
|
|
GIMP_TYPE_ITEM_STACK,
|
2010-02-06 20:41:16 +08:00
|
|
|
GIMP_TYPE_VECTORS);
|
2010-02-04 06:00:31 +08:00
|
|
|
private->layer_stack = NULL;
|
2001-01-15 12:37:01 +08:00
|
|
|
|
2010-02-08 02:57:46 +08:00
|
|
|
g_signal_connect (private->layers, "notify::active-item",
|
|
|
|
G_CALLBACK (gimp_image_active_layer_notify),
|
|
|
|
image);
|
|
|
|
g_signal_connect (private->channels, "notify::active-item",
|
|
|
|
G_CALLBACK (gimp_image_active_channel_notify),
|
|
|
|
image);
|
|
|
|
g_signal_connect (private->vectors, "notify::active-item",
|
|
|
|
G_CALLBACK (gimp_image_active_vectors_notify),
|
|
|
|
image);
|
|
|
|
|
2010-02-06 20:41:16 +08:00
|
|
|
g_signal_connect_swapped (private->layers->container, "update",
|
2009-08-26 19:06:55 +08:00
|
|
|
G_CALLBACK (gimp_image_invalidate),
|
2008-11-03 03:53:51 +08:00
|
|
|
image);
|
|
|
|
|
2010-02-04 06:05:49 +08:00
|
|
|
private->layer_alpha_handler =
|
2010-02-06 20:41:16 +08:00
|
|
|
gimp_container_add_handler (private->layers->container, "alpha-changed",
|
2004-03-16 00:38:49 +08:00
|
|
|
G_CALLBACK (gimp_image_layer_alpha_changed),
|
2006-03-29 01:08:36 +08:00
|
|
|
image);
|
2004-03-16 00:38:49 +08:00
|
|
|
|
2010-02-06 20:41:16 +08:00
|
|
|
g_signal_connect_swapped (private->channels->container, "update",
|
2009-08-26 19:06:55 +08:00
|
|
|
G_CALLBACK (gimp_image_invalidate),
|
2008-11-03 03:53:51 +08:00
|
|
|
image);
|
|
|
|
|
2010-02-04 06:05:49 +08:00
|
|
|
private->channel_name_changed_handler =
|
2010-02-06 20:41:16 +08:00
|
|
|
gimp_container_add_handler (private->channels->container, "name-changed",
|
2004-02-14 23:37:23 +08:00
|
|
|
G_CALLBACK (gimp_image_channel_name_changed),
|
2006-03-29 01:08:36 +08:00
|
|
|
image);
|
2010-02-04 06:05:49 +08:00
|
|
|
private->channel_color_changed_handler =
|
2010-02-06 20:41:16 +08:00
|
|
|
gimp_container_add_handler (private->channels->container, "color-changed",
|
2004-07-05 19:18:34 +08:00
|
|
|
G_CALLBACK (gimp_image_channel_color_changed),
|
2006-03-29 01:08:36 +08:00
|
|
|
image);
|
2004-02-14 23:37:23 +08:00
|
|
|
|
2010-02-06 20:41:16 +08:00
|
|
|
g_signal_connect (private->channels->container, "add",
|
2004-02-14 23:37:23 +08:00
|
|
|
G_CALLBACK (gimp_image_channel_add),
|
2006-03-29 01:08:36 +08:00
|
|
|
image);
|
2010-02-06 20:41:16 +08:00
|
|
|
g_signal_connect (private->channels->container, "remove",
|
2004-02-14 23:37:23 +08:00
|
|
|
G_CALLBACK (gimp_image_channel_remove),
|
2006-03-29 01:08:36 +08:00
|
|
|
image);
|
To optimize duplicate and/or wrong image updates away, introduced new
2003-09-06 Michael Natterer <mitch@gimp.org>
To optimize duplicate and/or wrong image updates away, introduced
new policy that a child object must never explicitly update or
invalidate its parent object (just like the GUI is not updated
explicitly by the core):
* app/core/gimpdrawable.[ch]: added new signal
GimpDrawable::update(). Never update or invalidate the image when
the drawable is updated or invalidated.
(gimp_drawable_set_visible): don't gimp_drawable_update() the
drawable since its pixels have not changed.
* app/core/gimpimage.[ch]: connect to the "add" and "remove"
signals of the layers and channels containers. Also connect to the
"update" and "visibility_changed" signals of all drawables in
these containers (optimizes away updates issued by drawables which
are not yet added to the image and updates of the selection
mask). Also, don't propagate updates to the image if the emitting
drawable is invisible (optimizes away updates issued by invisible
drawables).
(gimp_image_add_layer,channel)
(gimp_image_remove_layer,channel): don't update the image since
that's done by our "add" and "remove" handlers now.
(gimp_image_position_layer,channel): update just the image, not
the drawable since its pixels have not changed.
(gimp_image_real_colormap_changed)
(gimp_image_set_component_visible): always call
gimp_image_update() *and* gimp_viewable_invalidate_preview() to
get everything updated, since update and invalidate of images are
not connected.
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): don't
update the drawable since (a) its pixels don't change and (b) the
image updates itself upon adding/removing now.
(undo_pop_layer_mod): replaced gimp_image_update() by
gimp_drawable_update() (just for consistency with other similar
functions).
* app/core/gimplayer.c: connect to "update" of the layer mask and
issue updates on the layer if the mask update has any effect on
the projection.
(gimp_layer_create_mask): don't set the mask's offsets here since
they may be different when we later add the mask to the layer.
* app/core/gimplayermask.c (gimp_layer_mask_set_layer): set the
mask offsets here instead.
* app/core/gimpchannel.c (gimp_channel_translate): update the
channel even if push_undo == FALSE.
* app/paint/gimppaintcore.c (gimp_paint_core_finish)
* app/tools/gimpinktool.c (ink_finish): invalidate both the
drawable and the image preview since invalidating the drawable
doesn't invalidate the image any more.
* app/text/gimptextlayer.c (gimp_text_layer_render_now): also
update the new extents of the text layer, not only the old one.
(gimp_text_layer_render_layout): don't update the drawable since
gimp_drawable_fill() already updated it.
2003-09-07 04:06:53 +08:00
|
|
|
|
2010-02-04 06:24:18 +08:00
|
|
|
private->floating_sel = NULL;
|
|
|
|
private->selection_mask = NULL;
|
2001-01-15 12:37:01 +08:00
|
|
|
|
2010-02-04 06:42:32 +08:00
|
|
|
private->parasites = gimp_parasite_list_new ();
|
2001-01-15 12:37:01 +08:00
|
|
|
|
2004-01-15 21:58:27 +08:00
|
|
|
for (i = 0; i < MAX_CHANNELS; i++)
|
|
|
|
{
|
2010-02-04 16:08:50 +08:00
|
|
|
private->visible[i] = TRUE;
|
|
|
|
private->active[i] = TRUE;
|
2004-01-15 21:58:27 +08:00
|
|
|
}
|
|
|
|
|
2010-02-04 16:49:45 +08:00
|
|
|
private->quick_mask_state = FALSE;
|
|
|
|
private->quick_mask_inverted = FALSE;
|
|
|
|
gimp_rgba_set (&private->quick_mask_color, 1.0, 0.0, 0.0, 0.5);
|
2001-01-15 12:37:01 +08:00
|
|
|
|
2010-02-05 03:06:49 +08:00
|
|
|
private->undo_stack = gimp_undo_stack_new (image);
|
|
|
|
private->redo_stack = gimp_undo_stack_new (image);
|
|
|
|
private->group_count = 0;
|
|
|
|
private->pushing_undo_group = GIMP_UNDO_GROUP_NONE;
|
2001-01-15 12:37:01 +08:00
|
|
|
|
2010-02-05 16:13:25 +08:00
|
|
|
private->flush_accum.alpha_changed = FALSE;
|
|
|
|
private->flush_accum.mask_changed = FALSE;
|
|
|
|
private->flush_accum.floating_selection_changed = FALSE;
|
|
|
|
private->flush_accum.preview_invalidated = FALSE;
|
1998-06-28 18:39:58 +08:00
|
|
|
}
|
|
|
|
|
2011-01-13 05:53:58 +08:00
|
|
|
static void
|
|
|
|
gimp_image_constructed (GObject *object)
|
2004-07-14 20:12:50 +08:00
|
|
|
{
|
2011-01-13 05:53:58 +08:00
|
|
|
GimpImage *image = GIMP_IMAGE (object);
|
|
|
|
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (image);
|
2012-05-14 07:44:41 +08:00
|
|
|
GimpChannel *selection;
|
2010-02-04 03:31:25 +08:00
|
|
|
GimpCoreConfig *config;
|
2011-03-02 17:16:43 +08:00
|
|
|
GimpTemplate *template;
|
2004-07-14 20:12:50 +08:00
|
|
|
|
2012-11-13 04:51:22 +08:00
|
|
|
G_OBJECT_CLASS (parent_class)->constructed (object);
|
2004-07-14 20:12:50 +08:00
|
|
|
|
2018-02-12 05:23:10 +08:00
|
|
|
gimp_assert (GIMP_IS_GIMP (image->gimp));
|
2004-07-14 20:12:50 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
config = image->gimp->config;
|
2004-07-14 20:12:50 +08:00
|
|
|
|
2011-05-05 04:14:13 +08:00
|
|
|
private->ID = gimp_id_table_insert (image->gimp->image_table, image);
|
2004-07-14 20:12:50 +08:00
|
|
|
|
2011-03-02 17:16:43 +08:00
|
|
|
template = config->default_image;
|
|
|
|
|
|
|
|
private->xresolution = gimp_template_get_resolution_x (template);
|
|
|
|
private->yresolution = gimp_template_get_resolution_y (template);
|
|
|
|
private->resolution_unit = gimp_template_get_resolution_unit (template);
|
2004-07-14 20:12:50 +08:00
|
|
|
|
2010-02-04 05:16:02 +08:00
|
|
|
private->grid = gimp_config_duplicate (GIMP_CONFIG (config->default_grid));
|
2004-07-14 20:12:50 +08:00
|
|
|
|
2012-02-28 01:24:09 +08:00
|
|
|
private->quick_mask_color = config->quick_mask_color;
|
|
|
|
|
2010-10-27 21:40:43 +08:00
|
|
|
if (private->base_type == GIMP_INDEXED)
|
|
|
|
gimp_image_colormap_init (image);
|
2004-07-14 20:12:50 +08:00
|
|
|
|
2012-05-14 07:44:41 +08:00
|
|
|
selection = gimp_selection_new (image,
|
|
|
|
gimp_image_get_width (image),
|
|
|
|
gimp_image_get_height (image));
|
|
|
|
gimp_image_take_mask (image, selection);
|
2004-07-14 20:12:50 +08:00
|
|
|
|
|
|
|
g_signal_connect_object (config, "notify::transparency-type",
|
2008-11-07 03:44:51 +08:00
|
|
|
G_CALLBACK (gimp_item_stack_invalidate_previews),
|
2010-02-06 20:41:16 +08:00
|
|
|
private->layers->container, G_CONNECT_SWAPPED);
|
2004-07-14 20:12:50 +08:00
|
|
|
g_signal_connect_object (config, "notify::transparency-size",
|
2008-11-07 03:44:51 +08:00
|
|
|
G_CALLBACK (gimp_item_stack_invalidate_previews),
|
2010-02-06 20:41:16 +08:00
|
|
|
private->layers->container, G_CONNECT_SWAPPED);
|
2004-07-14 20:12:50 +08:00
|
|
|
g_signal_connect_object (config, "notify::layer-previews",
|
|
|
|
G_CALLBACK (gimp_viewable_size_changed),
|
2006-03-29 01:08:36 +08:00
|
|
|
image, G_CONNECT_SWAPPED);
|
2018-07-02 01:15:21 +08:00
|
|
|
g_signal_connect_object (config, "notify::group-layer-previews",
|
|
|
|
G_CALLBACK (gimp_viewable_size_changed),
|
|
|
|
image, G_CONNECT_SWAPPED);
|
2004-07-14 20:12:50 +08:00
|
|
|
|
2006-05-10 03:15:49 +08:00
|
|
|
gimp_container_add (image->gimp->images, GIMP_OBJECT (image));
|
2004-07-14 20:12:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_image_set_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
2010-02-04 03:31:25 +08:00
|
|
|
GimpImage *image = GIMP_IMAGE (object);
|
|
|
|
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (image);
|
2004-07-14 20:12:50 +08:00
|
|
|
|
|
|
|
switch (property_id)
|
|
|
|
{
|
|
|
|
case PROP_GIMP:
|
2006-03-29 01:08:36 +08:00
|
|
|
image->gimp = g_value_get_object (value);
|
2004-07-14 20:12:50 +08:00
|
|
|
break;
|
2016-07-25 06:04:12 +08:00
|
|
|
|
2004-07-14 20:12:50 +08:00
|
|
|
case PROP_WIDTH:
|
2010-02-04 03:31:25 +08:00
|
|
|
private->width = g_value_get_int (value);
|
2004-07-14 20:12:50 +08:00
|
|
|
break;
|
|
|
|
case PROP_HEIGHT:
|
2010-02-04 03:31:25 +08:00
|
|
|
private->height = g_value_get_int (value);
|
2004-07-14 20:12:50 +08:00
|
|
|
break;
|
2016-07-25 06:04:12 +08:00
|
|
|
|
2004-07-14 20:12:50 +08:00
|
|
|
case PROP_BASE_TYPE:
|
2010-02-04 03:31:25 +08:00
|
|
|
private->base_type = g_value_get_enum (value);
|
2016-07-25 06:04:12 +08:00
|
|
|
_gimp_image_free_color_transforms (image);
|
2004-07-14 20:12:50 +08:00
|
|
|
break;
|
2016-07-25 06:04:12 +08:00
|
|
|
|
2012-04-22 23:31:32 +08:00
|
|
|
case PROP_PRECISION:
|
|
|
|
private->precision = g_value_get_enum (value);
|
2016-07-25 06:04:12 +08:00
|
|
|
_gimp_image_free_color_transforms (image);
|
2012-04-22 23:31:32 +08:00
|
|
|
break;
|
2016-07-25 06:04:12 +08:00
|
|
|
|
2016-01-28 02:13:17 +08:00
|
|
|
case PROP_SYMMETRY:
|
|
|
|
{
|
2016-01-22 04:43:15 +08:00
|
|
|
GList *iter;
|
|
|
|
GType type = g_value_get_gtype (value);
|
2016-01-28 02:13:17 +08:00
|
|
|
|
2016-02-04 04:25:17 +08:00
|
|
|
if (private->active_symmetry)
|
|
|
|
g_object_set (private->active_symmetry,
|
2016-01-28 02:13:17 +08:00
|
|
|
"active", FALSE,
|
|
|
|
NULL);
|
2016-02-04 04:25:17 +08:00
|
|
|
private->active_symmetry = NULL;
|
2016-01-28 02:13:17 +08:00
|
|
|
|
2016-01-22 04:43:15 +08:00
|
|
|
for (iter = private->symmetries; iter; iter = g_list_next (iter))
|
2016-01-28 02:13:17 +08:00
|
|
|
{
|
2016-01-22 04:43:15 +08:00
|
|
|
GimpSymmetry *sym = iter->data;
|
2016-02-04 04:25:17 +08:00
|
|
|
|
2016-02-04 03:11:31 +08:00
|
|
|
if (type == G_TYPE_FROM_INSTANCE (sym))
|
2016-02-04 04:25:17 +08:00
|
|
|
private->active_symmetry = iter->data;
|
2016-01-22 04:43:15 +08:00
|
|
|
}
|
|
|
|
|
2016-02-04 04:25:17 +08:00
|
|
|
if (! private->active_symmetry &&
|
|
|
|
g_type_is_a (type, GIMP_TYPE_SYMMETRY))
|
2016-01-22 04:43:15 +08:00
|
|
|
{
|
2016-02-03 21:29:23 +08:00
|
|
|
GimpSymmetry *sym = gimp_image_symmetry_new (image, type);
|
2016-01-22 04:43:15 +08:00
|
|
|
|
|
|
|
gimp_image_symmetry_add (image, sym);
|
2016-02-05 03:58:00 +08:00
|
|
|
g_object_unref (sym);
|
|
|
|
|
2016-02-04 04:25:17 +08:00
|
|
|
private->active_symmetry = sym;
|
2016-01-28 02:13:17 +08:00
|
|
|
}
|
2016-02-03 21:29:23 +08:00
|
|
|
|
2016-02-04 04:25:17 +08:00
|
|
|
if (private->active_symmetry)
|
|
|
|
g_object_set (private->active_symmetry,
|
|
|
|
"active", TRUE,
|
|
|
|
NULL);
|
2016-01-28 02:13:17 +08:00
|
|
|
}
|
|
|
|
break;
|
2016-07-25 06:04:12 +08:00
|
|
|
|
|
|
|
case PROP_ID:
|
|
|
|
case PROP_METADATA:
|
|
|
|
case PROP_BUFFER:
|
2004-07-14 20:12:50 +08:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_image_get_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
2010-02-04 03:31:25 +08:00
|
|
|
GimpImage *image = GIMP_IMAGE (object);
|
|
|
|
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (image);
|
2004-07-14 20:12:50 +08:00
|
|
|
|
|
|
|
switch (property_id)
|
|
|
|
{
|
|
|
|
case PROP_GIMP:
|
2006-03-29 01:08:36 +08:00
|
|
|
g_value_set_object (value, image->gimp);
|
2004-07-14 20:12:50 +08:00
|
|
|
break;
|
|
|
|
case PROP_ID:
|
2010-02-04 03:31:25 +08:00
|
|
|
g_value_set_int (value, private->ID);
|
2004-07-14 20:12:50 +08:00
|
|
|
break;
|
|
|
|
case PROP_WIDTH:
|
2010-02-04 03:31:25 +08:00
|
|
|
g_value_set_int (value, private->width);
|
2004-07-14 20:12:50 +08:00
|
|
|
break;
|
|
|
|
case PROP_HEIGHT:
|
2010-02-04 03:31:25 +08:00
|
|
|
g_value_set_int (value, private->height);
|
2004-07-14 20:12:50 +08:00
|
|
|
break;
|
|
|
|
case PROP_BASE_TYPE:
|
2010-02-04 03:31:25 +08:00
|
|
|
g_value_set_enum (value, private->base_type);
|
2004-07-14 20:12:50 +08:00
|
|
|
break;
|
2012-04-22 23:31:32 +08:00
|
|
|
case PROP_PRECISION:
|
|
|
|
g_value_set_enum (value, private->precision);
|
|
|
|
break;
|
2013-10-20 00:38:01 +08:00
|
|
|
case PROP_METADATA:
|
|
|
|
g_value_set_object (value, gimp_image_get_metadata (image));
|
|
|
|
break;
|
2013-09-14 05:25:30 +08:00
|
|
|
case PROP_BUFFER:
|
|
|
|
g_value_set_object (value, gimp_image_get_buffer (GIMP_PICKABLE (image)));
|
|
|
|
break;
|
2016-01-28 02:13:17 +08:00
|
|
|
case PROP_SYMMETRY:
|
2016-01-22 04:43:15 +08:00
|
|
|
g_value_set_gtype (value,
|
2016-02-04 04:25:17 +08:00
|
|
|
private->active_symmetry ?
|
|
|
|
G_TYPE_FROM_INSTANCE (private->active_symmetry) :
|
|
|
|
G_TYPE_NONE);
|
2016-01-28 02:13:17 +08:00
|
|
|
break;
|
2004-07-14 20:12:50 +08:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-02-05 06:10:54 +08:00
|
|
|
static void
|
2001-08-12 03:53:35 +08:00
|
|
|
gimp_image_dispose (GObject *object)
|
|
|
|
{
|
2010-02-04 06:00:31 +08:00
|
|
|
GimpImage *image = GIMP_IMAGE (object);
|
|
|
|
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (image);
|
2001-08-12 03:53:35 +08:00
|
|
|
|
2010-10-27 21:40:43 +08:00
|
|
|
if (private->colormap)
|
|
|
|
gimp_image_colormap_dispose (image);
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_undo_free (image);
|
2001-08-12 03:53:35 +08:00
|
|
|
|
2010-02-06 20:41:16 +08:00
|
|
|
g_signal_handlers_disconnect_by_func (private->layers->container,
|
2009-08-26 19:06:55 +08:00
|
|
|
gimp_image_invalidate,
|
2008-11-03 03:53:51 +08:00
|
|
|
image);
|
|
|
|
|
2010-02-06 20:41:16 +08:00
|
|
|
gimp_container_remove_handler (private->layers->container,
|
2010-02-04 06:05:49 +08:00
|
|
|
private->layer_alpha_handler);
|
2004-03-16 00:38:49 +08:00
|
|
|
|
2010-02-06 20:41:16 +08:00
|
|
|
g_signal_handlers_disconnect_by_func (private->channels->container,
|
2009-08-26 19:06:55 +08:00
|
|
|
gimp_image_invalidate,
|
2008-11-03 03:53:51 +08:00
|
|
|
image);
|
|
|
|
|
2010-02-06 20:41:16 +08:00
|
|
|
gimp_container_remove_handler (private->channels->container,
|
2010-02-04 06:05:49 +08:00
|
|
|
private->channel_name_changed_handler);
|
2010-02-06 20:41:16 +08:00
|
|
|
gimp_container_remove_handler (private->channels->container,
|
2010-02-04 06:05:49 +08:00
|
|
|
private->channel_color_changed_handler);
|
2004-02-14 23:37:23 +08:00
|
|
|
|
2010-02-06 20:41:16 +08:00
|
|
|
g_signal_handlers_disconnect_by_func (private->channels->container,
|
2004-02-14 23:37:23 +08:00
|
|
|
gimp_image_channel_add,
|
2006-03-29 01:08:36 +08:00
|
|
|
image);
|
2010-02-06 20:41:16 +08:00
|
|
|
g_signal_handlers_disconnect_by_func (private->channels->container,
|
2004-02-14 23:37:23 +08:00
|
|
|
gimp_image_channel_remove,
|
2006-03-29 01:08:36 +08:00
|
|
|
image);
|
To optimize duplicate and/or wrong image updates away, introduced new
2003-09-06 Michael Natterer <mitch@gimp.org>
To optimize duplicate and/or wrong image updates away, introduced
new policy that a child object must never explicitly update or
invalidate its parent object (just like the GUI is not updated
explicitly by the core):
* app/core/gimpdrawable.[ch]: added new signal
GimpDrawable::update(). Never update or invalidate the image when
the drawable is updated or invalidated.
(gimp_drawable_set_visible): don't gimp_drawable_update() the
drawable since its pixels have not changed.
* app/core/gimpimage.[ch]: connect to the "add" and "remove"
signals of the layers and channels containers. Also connect to the
"update" and "visibility_changed" signals of all drawables in
these containers (optimizes away updates issued by drawables which
are not yet added to the image and updates of the selection
mask). Also, don't propagate updates to the image if the emitting
drawable is invisible (optimizes away updates issued by invisible
drawables).
(gimp_image_add_layer,channel)
(gimp_image_remove_layer,channel): don't update the image since
that's done by our "add" and "remove" handlers now.
(gimp_image_position_layer,channel): update just the image, not
the drawable since its pixels have not changed.
(gimp_image_real_colormap_changed)
(gimp_image_set_component_visible): always call
gimp_image_update() *and* gimp_viewable_invalidate_preview() to
get everything updated, since update and invalidate of images are
not connected.
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): don't
update the drawable since (a) its pixels don't change and (b) the
image updates itself upon adding/removing now.
(undo_pop_layer_mod): replaced gimp_image_update() by
gimp_drawable_update() (just for consistency with other similar
functions).
* app/core/gimplayer.c: connect to "update" of the layer mask and
issue updates on the layer if the mask update has any effect on
the projection.
(gimp_layer_create_mask): don't set the mask's offsets here since
they may be different when we later add the mask to the layer.
* app/core/gimplayermask.c (gimp_layer_mask_set_layer): set the
mask offsets here instead.
* app/core/gimpchannel.c (gimp_channel_translate): update the
channel even if push_undo == FALSE.
* app/paint/gimppaintcore.c (gimp_paint_core_finish)
* app/tools/gimpinktool.c (ink_finish): invalidate both the
drawable and the image preview since invalidating the drawable
doesn't invalidate the image any more.
* app/text/gimptextlayer.c (gimp_text_layer_render_now): also
update the new extents of the text layer, not only the old one.
(gimp_text_layer_render_layout): don't update the drawable since
gimp_drawable_fill() already updated it.
2003-09-07 04:06:53 +08:00
|
|
|
|
2019-03-06 05:39:07 +08:00
|
|
|
g_object_run_dispose (G_OBJECT (private->layers));
|
|
|
|
g_object_run_dispose (G_OBJECT (private->channels));
|
|
|
|
g_object_run_dispose (G_OBJECT (private->vectors));
|
2004-02-17 19:45:46 +08:00
|
|
|
|
2001-08-12 03:53:35 +08:00
|
|
|
G_OBJECT_CLASS (parent_class)->dispose (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_image_finalize (GObject *object)
|
1999-07-20 03:46:05 +08:00
|
|
|
{
|
2010-02-04 03:31:25 +08:00
|
|
|
GimpImage *image = GIMP_IMAGE (object);
|
|
|
|
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (image);
|
2001-04-13 22:50:43 +08:00
|
|
|
|
2017-07-16 00:38:01 +08:00
|
|
|
g_clear_object (&private->projection);
|
|
|
|
g_clear_object (&private->graph);
|
|
|
|
private->visible_mask = NULL;
|
2008-10-10 04:44:23 +08:00
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
if (private->colormap)
|
2010-10-27 21:40:43 +08:00
|
|
|
gimp_image_colormap_free (image);
|
2001-08-11 22:39:19 +08:00
|
|
|
|
2018-10-07 22:16:21 +08:00
|
|
|
_gimp_image_free_color_profile (image);
|
2015-08-17 01:38:11 +08:00
|
|
|
|
2017-07-16 00:38:01 +08:00
|
|
|
g_clear_object (&private->metadata);
|
|
|
|
g_clear_object (&private->file);
|
|
|
|
g_clear_object (&private->imported_file);
|
|
|
|
g_clear_object (&private->exported_file);
|
|
|
|
g_clear_object (&private->save_a_copy_file);
|
|
|
|
g_clear_object (&private->untitled_file);
|
|
|
|
g_clear_object (&private->layers);
|
|
|
|
g_clear_object (&private->channels);
|
|
|
|
g_clear_object (&private->vectors);
|
2014-07-08 06:03:08 +08:00
|
|
|
|
2010-02-04 06:00:31 +08:00
|
|
|
if (private->layer_stack)
|
2001-08-11 22:39:19 +08:00
|
|
|
{
|
2010-02-04 06:00:31 +08:00
|
|
|
g_slist_free (private->layer_stack);
|
|
|
|
private->layer_stack = NULL;
|
2001-08-11 22:39:19 +08:00
|
|
|
}
|
2001-02-05 06:10:54 +08:00
|
|
|
|
2017-07-16 00:38:01 +08:00
|
|
|
g_clear_object (&private->selection_mask);
|
|
|
|
g_clear_object (&private->parasites);
|
2001-03-05 09:01:16 +08:00
|
|
|
|
2010-02-04 05:16:02 +08:00
|
|
|
if (private->guides)
|
2001-08-11 22:39:19 +08:00
|
|
|
{
|
2011-03-08 00:10:18 +08:00
|
|
|
g_list_free_full (private->guides, (GDestroyNotify) g_object_unref);
|
2010-02-04 05:16:02 +08:00
|
|
|
private->guides = NULL;
|
2001-08-11 22:39:19 +08:00
|
|
|
}
|
2001-05-16 03:10:57 +08:00
|
|
|
|
2016-01-28 02:13:17 +08:00
|
|
|
if (private->symmetries)
|
|
|
|
{
|
|
|
|
g_list_free_full (private->symmetries, g_object_unref);
|
|
|
|
private->symmetries = NULL;
|
|
|
|
}
|
|
|
|
|
2017-07-16 00:38:01 +08:00
|
|
|
g_clear_object (&private->grid);
|
2005-03-05 02:16:29 +08:00
|
|
|
|
2010-02-04 05:16:02 +08:00
|
|
|
if (private->sample_points)
|
2005-03-05 08:10:40 +08:00
|
|
|
{
|
2011-03-08 00:10:18 +08:00
|
|
|
g_list_free_full (private->sample_points,
|
2018-07-15 21:58:24 +08:00
|
|
|
(GDestroyNotify) g_object_unref);
|
2010-02-04 05:16:02 +08:00
|
|
|
private->sample_points = NULL;
|
2005-03-05 08:10:40 +08:00
|
|
|
}
|
|
|
|
|
2017-07-16 00:38:01 +08:00
|
|
|
g_clear_object (&private->undo_stack);
|
|
|
|
g_clear_object (&private->redo_stack);
|
2001-08-11 22:39:19 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
if (image->gimp && image->gimp->image_table)
|
2004-07-27 23:10:41 +08:00
|
|
|
{
|
2011-05-05 04:14:13 +08:00
|
|
|
gimp_id_table_remove (image->gimp->image_table, private->ID);
|
2006-03-29 01:08:36 +08:00
|
|
|
image->gimp = NULL;
|
2004-07-27 23:10:41 +08:00
|
|
|
}
|
|
|
|
|
2017-07-16 00:38:01 +08:00
|
|
|
g_clear_pointer (&private->display_name, g_free);
|
|
|
|
g_clear_pointer (&private->display_path, g_free);
|
2012-07-18 04:52:49 +08:00
|
|
|
|
2001-08-12 03:53:35 +08:00
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
2001-02-05 06:10:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_image_name_changed (GimpObject *object)
|
|
|
|
{
|
2010-02-04 03:31:25 +08:00
|
|
|
GimpImage *image = GIMP_IMAGE (object);
|
|
|
|
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
const gchar *name;
|
2001-02-05 06:10:54 +08:00
|
|
|
|
|
|
|
if (GIMP_OBJECT_CLASS (parent_class)->name_changed)
|
|
|
|
GIMP_OBJECT_CLASS (parent_class)->name_changed (object);
|
|
|
|
|
2017-07-16 00:38:01 +08:00
|
|
|
g_clear_pointer (&private->display_name, g_free);
|
|
|
|
g_clear_pointer (&private->display_path, g_free);
|
2012-07-18 04:52:49 +08:00
|
|
|
|
2009-08-29 18:26:17 +08:00
|
|
|
/* We never want the empty string as a name, so change empty strings
|
|
|
|
* to NULL strings (without emitting the "name-changed" signal
|
|
|
|
* again)
|
|
|
|
*/
|
2004-02-17 19:45:46 +08:00
|
|
|
name = gimp_object_get_name (object);
|
2009-08-29 18:26:17 +08:00
|
|
|
if (name && strlen (name) == 0)
|
2014-07-08 05:56:56 +08:00
|
|
|
{
|
|
|
|
gimp_object_name_free (object);
|
|
|
|
name = NULL;
|
|
|
|
}
|
|
|
|
|
2017-07-16 00:38:01 +08:00
|
|
|
g_clear_object (&private->file);
|
2014-07-08 05:56:56 +08:00
|
|
|
|
|
|
|
if (name)
|
|
|
|
private->file = g_file_new_for_uri (name);
|
2001-02-05 06:10:54 +08:00
|
|
|
}
|
2001-01-10 08:36:54 +08:00
|
|
|
|
2003-11-17 01:51:36 +08:00
|
|
|
static gint64
|
2003-08-25 18:49:33 +08:00
|
|
|
gimp_image_get_memsize (GimpObject *object,
|
2003-11-17 01:51:36 +08:00
|
|
|
gint64 *gui_size)
|
2002-01-31 00:14:26 +08:00
|
|
|
{
|
2010-02-04 04:46:09 +08:00
|
|
|
GimpImage *image = GIMP_IMAGE (object);
|
|
|
|
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
gint64 memsize = 0;
|
2002-01-31 00:14:26 +08:00
|
|
|
|
2007-12-26 00:33:04 +08:00
|
|
|
if (gimp_image_get_colormap (image))
|
2003-03-18 21:49:02 +08:00
|
|
|
memsize += GIMP_IMAGE_COLORMAP_SIZE;
|
2002-01-31 00:14:26 +08:00
|
|
|
|
2010-10-27 21:40:43 +08:00
|
|
|
memsize += gimp_object_get_memsize (GIMP_OBJECT (private->palette),
|
|
|
|
gui_size);
|
|
|
|
|
2010-02-04 04:46:09 +08:00
|
|
|
memsize += gimp_object_get_memsize (GIMP_OBJECT (private->projection),
|
2007-11-17 02:19:30 +08:00
|
|
|
gui_size);
|
2002-01-31 00:14:26 +08:00
|
|
|
|
2007-12-26 01:09:04 +08:00
|
|
|
memsize += gimp_g_list_get_memsize (gimp_image_get_guides (image),
|
|
|
|
sizeof (GimpGuide));
|
2006-06-07 15:45:16 +08:00
|
|
|
|
2010-02-04 05:16:02 +08:00
|
|
|
memsize += gimp_object_get_memsize (GIMP_OBJECT (private->grid), gui_size);
|
2003-06-24 03:34:48 +08:00
|
|
|
|
2007-12-26 01:09:04 +08:00
|
|
|
memsize += gimp_g_list_get_memsize (gimp_image_get_sample_points (image),
|
2005-03-05 08:10:40 +08:00
|
|
|
sizeof (GimpSamplePoint));
|
|
|
|
|
2010-02-04 06:00:31 +08:00
|
|
|
memsize += gimp_object_get_memsize (GIMP_OBJECT (private->layers),
|
2003-08-25 18:49:33 +08:00
|
|
|
gui_size);
|
2010-02-04 06:00:31 +08:00
|
|
|
memsize += gimp_object_get_memsize (GIMP_OBJECT (private->channels),
|
2003-08-25 18:49:33 +08:00
|
|
|
gui_size);
|
2010-02-04 06:00:31 +08:00
|
|
|
memsize += gimp_object_get_memsize (GIMP_OBJECT (private->vectors),
|
2003-08-25 18:49:33 +08:00
|
|
|
gui_size);
|
2002-01-31 00:14:26 +08:00
|
|
|
|
2010-02-04 06:00:31 +08:00
|
|
|
memsize += gimp_g_slist_get_memsize (private->layer_stack, 0);
|
2002-01-31 00:14:26 +08:00
|
|
|
|
2010-02-04 06:24:18 +08:00
|
|
|
memsize += gimp_object_get_memsize (GIMP_OBJECT (private->selection_mask),
|
2007-11-17 02:19:30 +08:00
|
|
|
gui_size);
|
2002-01-31 00:14:26 +08:00
|
|
|
|
2010-02-04 06:42:32 +08:00
|
|
|
memsize += gimp_object_get_memsize (GIMP_OBJECT (private->parasites),
|
2003-08-25 18:49:33 +08:00
|
|
|
gui_size);
|
2002-01-31 00:14:26 +08:00
|
|
|
|
2010-02-05 03:06:49 +08:00
|
|
|
memsize += gimp_object_get_memsize (GIMP_OBJECT (private->undo_stack),
|
2003-08-25 18:49:33 +08:00
|
|
|
gui_size);
|
2010-02-05 03:06:49 +08:00
|
|
|
memsize += gimp_object_get_memsize (GIMP_OBJECT (private->redo_stack),
|
2003-08-25 18:49:33 +08:00
|
|
|
gui_size);
|
2002-01-31 00:14:26 +08:00
|
|
|
|
2003-08-25 18:49:33 +08:00
|
|
|
return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object,
|
|
|
|
gui_size);
|
2002-01-31 00:14:26 +08:00
|
|
|
}
|
|
|
|
|
2005-05-25 18:05:17 +08:00
|
|
|
static gboolean
|
|
|
|
gimp_image_get_size (GimpViewable *viewable,
|
|
|
|
gint *width,
|
|
|
|
gint *height)
|
|
|
|
{
|
|
|
|
GimpImage *image = GIMP_IMAGE (viewable);
|
|
|
|
|
2007-12-26 00:21:40 +08:00
|
|
|
*width = gimp_image_get_width (image);
|
|
|
|
*height = gimp_image_get_height (image);
|
2005-05-25 18:05:17 +08:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2001-06-18 21:10:03 +08:00
|
|
|
static void
|
|
|
|
gimp_image_size_changed (GimpViewable *viewable)
|
|
|
|
{
|
2019-06-20 22:13:19 +08:00
|
|
|
GimpImage *image = GIMP_IMAGE (viewable);
|
|
|
|
GList *all_items;
|
|
|
|
GList *list;
|
2001-06-18 21:10:03 +08:00
|
|
|
|
|
|
|
if (GIMP_VIEWABLE_CLASS (parent_class)->size_changed)
|
|
|
|
GIMP_VIEWABLE_CLASS (parent_class)->size_changed (viewable);
|
|
|
|
|
2009-08-02 05:07:07 +08:00
|
|
|
all_items = gimp_image_get_layer_list (image);
|
|
|
|
for (list = all_items; list; list = g_list_next (list))
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2003-03-24 20:21:58 +08:00
|
|
|
GimpLayerMask *mask = gimp_layer_get_mask (GIMP_LAYER (list->data));
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2009-08-02 05:07:07 +08:00
|
|
|
gimp_viewable_size_changed (GIMP_VIEWABLE (list->data));
|
|
|
|
|
2003-03-24 20:21:58 +08:00
|
|
|
if (mask)
|
|
|
|
gimp_viewable_size_changed (GIMP_VIEWABLE (mask));
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
2009-08-02 05:07:07 +08:00
|
|
|
g_list_free (all_items);
|
|
|
|
|
|
|
|
all_items = gimp_image_get_channel_list (image);
|
2011-03-08 00:10:18 +08:00
|
|
|
g_list_free_full (all_items, (GDestroyNotify) gimp_viewable_size_changed);
|
2009-08-02 05:07:07 +08:00
|
|
|
|
|
|
|
all_items = gimp_image_get_vectors_list (image);
|
2011-03-08 00:10:18 +08:00
|
|
|
g_list_free_full (all_items, (GDestroyNotify) gimp_viewable_size_changed);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_viewable_size_changed (GIMP_VIEWABLE (gimp_image_get_mask (image)));
|
2008-11-05 07:22:45 +08:00
|
|
|
|
2019-06-20 22:13:19 +08:00
|
|
|
gimp_image_metadata_update_pixel_size (image);
|
2013-10-20 00:38:01 +08:00
|
|
|
|
2008-11-05 07:22:45 +08:00
|
|
|
gimp_projectable_structure_changed (GIMP_PROJECTABLE (image));
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
|
|
|
|
2003-04-09 00:01:01 +08:00
|
|
|
static gchar *
|
|
|
|
gimp_image_get_description (GimpViewable *viewable,
|
|
|
|
gchar **tooltip)
|
|
|
|
{
|
2008-11-13 20:09:05 +08:00
|
|
|
GimpImage *image = GIMP_IMAGE (viewable);
|
2003-04-09 00:01:01 +08:00
|
|
|
|
|
|
|
if (tooltip)
|
2012-07-18 04:52:49 +08:00
|
|
|
*tooltip = g_strdup (gimp_image_get_display_path (image));
|
2003-04-09 00:01:01 +08:00
|
|
|
|
2008-11-13 20:09:05 +08:00
|
|
|
return g_strdup_printf ("%s-%d",
|
2016-11-25 07:04:04 +08:00
|
|
|
gimp_image_get_display_name (image),
|
|
|
|
gimp_image_get_ID (image));
|
2003-04-09 00:01:01 +08:00
|
|
|
}
|
|
|
|
|
2008-11-05 07:22:45 +08:00
|
|
|
static void
|
|
|
|
gimp_image_real_mode_changed (GimpImage *image)
|
|
|
|
{
|
|
|
|
gimp_projectable_structure_changed (GIMP_PROJECTABLE (image));
|
|
|
|
}
|
|
|
|
|
2012-04-25 22:46:58 +08:00
|
|
|
static void
|
|
|
|
gimp_image_real_precision_changed (GimpImage *image)
|
|
|
|
{
|
2019-06-20 22:13:19 +08:00
|
|
|
gimp_image_metadata_update_bits_per_sample (image);
|
2013-10-20 00:38:01 +08:00
|
|
|
|
2012-04-25 22:46:58 +08:00
|
|
|
gimp_projectable_structure_changed (GIMP_PROJECTABLE (image));
|
|
|
|
}
|
|
|
|
|
2013-10-20 00:38:01 +08:00
|
|
|
static void
|
|
|
|
gimp_image_real_resolution_changed (GimpImage *image)
|
|
|
|
{
|
2019-06-20 22:13:19 +08:00
|
|
|
gimp_image_metadata_update_resolution (image);
|
2013-10-20 00:38:01 +08:00
|
|
|
}
|
|
|
|
|
2008-08-05 04:11:35 +08:00
|
|
|
static void
|
|
|
|
gimp_image_real_size_changed_detailed (GimpImage *image,
|
|
|
|
gint previous_origin_x,
|
2008-08-29 03:12:03 +08:00
|
|
|
gint previous_origin_y,
|
|
|
|
gint previous_width,
|
|
|
|
gint previous_height)
|
2008-08-05 04:11:35 +08:00
|
|
|
{
|
2008-08-06 01:01:51 +08:00
|
|
|
/* Whenever GimpImage::size-changed-detailed is emitted, so is
|
|
|
|
* GimpViewable::size-changed. Clients choose what signal to listen
|
|
|
|
* to depending on how much info they need.
|
|
|
|
*/
|
2008-08-05 04:11:35 +08:00
|
|
|
gimp_viewable_size_changed (GIMP_VIEWABLE (image));
|
|
|
|
}
|
|
|
|
|
2013-10-20 00:38:01 +08:00
|
|
|
static void
|
|
|
|
gimp_image_real_unit_changed (GimpImage *image)
|
|
|
|
{
|
2019-06-20 22:13:19 +08:00
|
|
|
gimp_image_metadata_update_resolution (image);
|
2013-10-20 00:38:01 +08:00
|
|
|
}
|
|
|
|
|
2003-08-25 18:49:33 +08:00
|
|
|
static void
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_real_colormap_changed (GimpImage *image,
|
2004-07-14 20:12:50 +08:00
|
|
|
gint color_index)
|
2003-03-23 06:53:29 +08:00
|
|
|
{
|
2012-03-18 03:33:47 +08:00
|
|
|
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
2019-01-02 02:00:29 +08:00
|
|
|
gimp_image_colormap_update_formats (image);
|
2010-02-04 06:00:31 +08:00
|
|
|
|
2012-05-08 03:57:33 +08:00
|
|
|
if (gimp_image_get_base_type (image) == GIMP_INDEXED)
|
2012-03-18 03:33:47 +08:00
|
|
|
{
|
2003-03-23 06:53:29 +08:00
|
|
|
/* A colormap alteration affects the whole image */
|
2009-08-26 19:06:55 +08:00
|
|
|
gimp_image_invalidate (image,
|
|
|
|
0, 0,
|
|
|
|
gimp_image_get_width (image),
|
|
|
|
gimp_image_get_height (image));
|
2003-03-23 06:53:29 +08:00
|
|
|
|
2010-02-06 20:41:16 +08:00
|
|
|
gimp_item_stack_invalidate_previews (GIMP_ITEM_STACK (private->layers->container));
|
2003-03-23 06:53:29 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-11-05 02:06:36 +08:00
|
|
|
static const guint8 *
|
2014-03-17 06:49:02 +08:00
|
|
|
gimp_image_color_managed_get_icc_profile (GimpColorManaged *managed,
|
|
|
|
gsize *len)
|
2008-11-05 02:06:36 +08:00
|
|
|
{
|
2015-06-17 06:49:59 +08:00
|
|
|
return gimp_image_get_icc_profile (GIMP_IMAGE (managed), len);
|
2008-11-05 02:06:36 +08:00
|
|
|
}
|
|
|
|
|
2015-07-11 04:43:53 +08:00
|
|
|
static GimpColorProfile *
|
2015-05-26 14:05:25 +08:00
|
|
|
gimp_image_color_managed_get_color_profile (GimpColorManaged *managed)
|
|
|
|
{
|
2018-10-07 22:16:21 +08:00
|
|
|
GimpImage *image = GIMP_IMAGE (managed);
|
|
|
|
GimpColorProfile *profile;
|
2015-05-26 14:05:25 +08:00
|
|
|
|
2018-10-07 22:16:21 +08:00
|
|
|
profile = gimp_image_get_color_profile (image);
|
2015-05-26 14:05:25 +08:00
|
|
|
|
2015-12-15 06:23:25 +08:00
|
|
|
if (! profile)
|
2015-08-20 22:02:22 +08:00
|
|
|
profile = gimp_image_get_builtin_color_profile (image);
|
2015-05-26 14:05:25 +08:00
|
|
|
|
2015-09-03 07:36:02 +08:00
|
|
|
return profile;
|
2015-05-26 14:05:25 +08:00
|
|
|
}
|
|
|
|
|
2015-09-03 02:55:48 +08:00
|
|
|
static void
|
|
|
|
gimp_image_color_managed_profile_changed (GimpColorManaged *managed)
|
|
|
|
{
|
|
|
|
GimpImage *image = GIMP_IMAGE (managed);
|
|
|
|
GimpItemStack *layers = GIMP_ITEM_STACK (gimp_image_get_layers (image));
|
|
|
|
|
2019-06-20 22:13:19 +08:00
|
|
|
gimp_image_metadata_update_colorspace (image);
|
|
|
|
|
2019-05-27 21:20:15 +08:00
|
|
|
gimp_projectable_structure_changed (GIMP_PROJECTABLE (image));
|
2015-09-03 02:55:48 +08:00
|
|
|
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (image));
|
2015-09-03 06:19:05 +08:00
|
|
|
gimp_item_stack_profile_changed (layers);
|
2015-09-03 02:55:48 +08:00
|
|
|
}
|
|
|
|
|
2006-03-03 03:35:48 +08:00
|
|
|
static void
|
2008-11-05 02:06:36 +08:00
|
|
|
gimp_image_projectable_flush (GimpProjectable *projectable,
|
|
|
|
gboolean invalidate_preview)
|
2003-10-06 20:17:11 +08:00
|
|
|
{
|
2010-02-05 16:13:25 +08:00
|
|
|
GimpImage *image = GIMP_IMAGE (projectable);
|
|
|
|
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (image);
|
2008-11-05 02:06:36 +08:00
|
|
|
|
2010-02-05 16:13:25 +08:00
|
|
|
if (private->flush_accum.alpha_changed)
|
2004-03-16 00:38:49 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_alpha_changed (image);
|
2010-02-05 16:13:25 +08:00
|
|
|
private->flush_accum.alpha_changed = FALSE;
|
2004-03-16 00:38:49 +08:00
|
|
|
}
|
|
|
|
|
2010-02-05 16:13:25 +08:00
|
|
|
if (private->flush_accum.mask_changed)
|
2003-10-06 20:17:11 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_mask_changed (image);
|
2010-02-05 16:13:25 +08:00
|
|
|
private->flush_accum.mask_changed = FALSE;
|
2003-10-06 20:17:11 +08:00
|
|
|
}
|
2007-06-21 18:09:27 +08:00
|
|
|
|
2010-02-05 16:13:25 +08:00
|
|
|
if (private->flush_accum.floating_selection_changed)
|
2008-11-14 23:18:29 +08:00
|
|
|
{
|
|
|
|
gimp_image_floating_selection_changed (image);
|
2010-02-05 16:13:25 +08:00
|
|
|
private->flush_accum.floating_selection_changed = FALSE;
|
2008-11-14 23:18:29 +08:00
|
|
|
}
|
|
|
|
|
2010-02-05 16:13:25 +08:00
|
|
|
if (private->flush_accum.preview_invalidated)
|
2007-06-21 21:35:31 +08:00
|
|
|
{
|
2007-06-27 05:39:51 +08:00
|
|
|
/* don't invalidate the preview here, the projection does this when
|
|
|
|
* it is completely constructed.
|
|
|
|
*/
|
2010-02-05 16:13:25 +08:00
|
|
|
private->flush_accum.preview_invalidated = FALSE;
|
2007-06-21 21:35:31 +08:00
|
|
|
}
|
2003-10-06 20:17:11 +08:00
|
|
|
}
|
|
|
|
|
2008-11-05 02:06:36 +08:00
|
|
|
static GimpImage *
|
|
|
|
gimp_image_get_image (GimpProjectable *projectable)
|
|
|
|
{
|
|
|
|
return GIMP_IMAGE (projectable);
|
|
|
|
}
|
|
|
|
|
2012-03-30 03:09:37 +08:00
|
|
|
static const Babl *
|
|
|
|
gimp_image_get_proj_format (GimpProjectable *projectable)
|
2009-09-13 01:24:01 +08:00
|
|
|
{
|
2012-04-22 23:07:35 +08:00
|
|
|
GimpImage *image = GIMP_IMAGE (projectable);
|
|
|
|
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (image);
|
2009-09-13 01:24:01 +08:00
|
|
|
|
2012-03-30 03:09:37 +08:00
|
|
|
switch (private->base_type)
|
|
|
|
{
|
|
|
|
case GIMP_RGB:
|
|
|
|
case GIMP_INDEXED:
|
2012-07-30 22:00:02 +08:00
|
|
|
return gimp_image_get_format (image, GIMP_RGB,
|
Initial space invasion commit in GIMP
All babl formats now have a space equivalent to a color profile,
determining the format's primaries and TRCs. This commit makes GIMP
aware of this.
libgimp:
- enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA
as deprecated aliases, add PERCEPTUAL values so we now have LINEAR,
NON_LINEAR and PERCPTUAL for each encoding, matching the babl
encoding variants RGB, R'G'B' and R~G~B~.
- gimp_color_transform_can_gegl_copy() now returns TRUE if both
profiles can return a babl space, increasing the amount of fast babl
color conversions significantly.
- TODO: no solution yet for getting libgimp drawable proxy buffers in
the right format with space.
plug-ins:
- follow the GimpPrecision change.
- TODO: everything else unchanged and partly broken or sub-optimal,
like setting a new image's color profile too late.
app:
- add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as
replacement for all "linear" booleans.
- change gimp-babl functions to take babl spaces and GimpTRCType
parameters and support all sorts of new perceptual ~ formats.
- a lot of places changed in the early days of goat invasion didn't
take advantage of gimp-babl utility functions and constructed
formats manually. They all needed revisiting and many now use much
simpler code calling gimp-babl API.
- change gimp_babl_format_get_color_profile() to really extract a
newly allocated color profile from the format, and add
gimp_babl_get_builtin_color_profile() which does the same as
gimp_babl_format_get_color_profile() did before. Visited all callers
to decide whether they are looking for the format's actual profile,
or for one of the builtin profiles, simplifying code that only needs
builtin profiles.
- drawables have a new get_space_api(), get_linear() is now get_trc().
- images now have a "layer space" and an API to get it,
gimp_image_get_layer_format() returns formats in that space.
- an image's layer space is created from the image's color profile,
change gimpimage-color-profile to deal with that correctly
- change many babl_format() calls to babl_format_with_space() and take
the space from passed formats or drawables
- add function gimp_layer_fix_format_space() which replaces the
layer's buffer with one that has the image's layer format, but
doesn't change pixel values
- use gimp_layer_fix_format_space() to make sure layers loaded from
XCF and created by plug-ins have the right space when added to the
image, because it's impossible to always assign the right space upon
layer creation
- "assign color profile" and "discard color profile" now require use
of gimp_layer_fix_format_space() too because the profile is now
embedded in all formats via the space. Add
gimp_image_assign_color_profile() which does all that and call it
instead of a simple gimp_image_set_color_profile(), also from the
PDB set-color-profile functions, which are essentially "assign" and
"discard" calls.
- generally, make sure a new image's color profile is set before
adding layers to it, gimp_image_set_color_profile() is more than
before considered know-what-you-are-doing API.
- take special precaution in all places that call
gimp_drawable_convert_type(), we now must pass a new_profile from
all callers that convert layers within the same image (such as
image_convert_type, image_convert_precision), because the layer's
new space can't be determined from the image's layer format during
the call.
- change all "linear" properties to "trc", in all config objects like
for levels and curves, in the histogram, in the widgets. This results
in some GUI that now has three choices instead of two.
TODO: we might want to reduce that back to two later.
- keep "linear" boolean properties around as compat if needed for file
pasring, but always convert the parsed parsed boolean to
GimpTRCType.
- TODO: the image's "enable color management" switch is currently
broken, will fix that in another commit.
2018-07-21 20:23:01 +08:00
|
|
|
gimp_image_get_precision (image), TRUE,
|
|
|
|
gimp_image_get_layer_space (image));
|
2012-03-30 03:09:37 +08:00
|
|
|
|
|
|
|
case GIMP_GRAY:
|
2012-07-30 22:00:02 +08:00
|
|
|
return gimp_image_get_format (image, GIMP_GRAY,
|
Initial space invasion commit in GIMP
All babl formats now have a space equivalent to a color profile,
determining the format's primaries and TRCs. This commit makes GIMP
aware of this.
libgimp:
- enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA
as deprecated aliases, add PERCEPTUAL values so we now have LINEAR,
NON_LINEAR and PERCPTUAL for each encoding, matching the babl
encoding variants RGB, R'G'B' and R~G~B~.
- gimp_color_transform_can_gegl_copy() now returns TRUE if both
profiles can return a babl space, increasing the amount of fast babl
color conversions significantly.
- TODO: no solution yet for getting libgimp drawable proxy buffers in
the right format with space.
plug-ins:
- follow the GimpPrecision change.
- TODO: everything else unchanged and partly broken or sub-optimal,
like setting a new image's color profile too late.
app:
- add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as
replacement for all "linear" booleans.
- change gimp-babl functions to take babl spaces and GimpTRCType
parameters and support all sorts of new perceptual ~ formats.
- a lot of places changed in the early days of goat invasion didn't
take advantage of gimp-babl utility functions and constructed
formats manually. They all needed revisiting and many now use much
simpler code calling gimp-babl API.
- change gimp_babl_format_get_color_profile() to really extract a
newly allocated color profile from the format, and add
gimp_babl_get_builtin_color_profile() which does the same as
gimp_babl_format_get_color_profile() did before. Visited all callers
to decide whether they are looking for the format's actual profile,
or for one of the builtin profiles, simplifying code that only needs
builtin profiles.
- drawables have a new get_space_api(), get_linear() is now get_trc().
- images now have a "layer space" and an API to get it,
gimp_image_get_layer_format() returns formats in that space.
- an image's layer space is created from the image's color profile,
change gimpimage-color-profile to deal with that correctly
- change many babl_format() calls to babl_format_with_space() and take
the space from passed formats or drawables
- add function gimp_layer_fix_format_space() which replaces the
layer's buffer with one that has the image's layer format, but
doesn't change pixel values
- use gimp_layer_fix_format_space() to make sure layers loaded from
XCF and created by plug-ins have the right space when added to the
image, because it's impossible to always assign the right space upon
layer creation
- "assign color profile" and "discard color profile" now require use
of gimp_layer_fix_format_space() too because the profile is now
embedded in all formats via the space. Add
gimp_image_assign_color_profile() which does all that and call it
instead of a simple gimp_image_set_color_profile(), also from the
PDB set-color-profile functions, which are essentially "assign" and
"discard" calls.
- generally, make sure a new image's color profile is set before
adding layers to it, gimp_image_set_color_profile() is more than
before considered know-what-you-are-doing API.
- take special precaution in all places that call
gimp_drawable_convert_type(), we now must pass a new_profile from
all callers that convert layers within the same image (such as
image_convert_type, image_convert_precision), because the layer's
new space can't be determined from the image's layer format during
the call.
- change all "linear" properties to "trc", in all config objects like
for levels and curves, in the histogram, in the widgets. This results
in some GUI that now has three choices instead of two.
TODO: we might want to reduce that back to two later.
- keep "linear" boolean properties around as compat if needed for file
pasring, but always convert the parsed parsed boolean to
GimpTRCType.
- TODO: the image's "enable color management" switch is currently
broken, will fix that in another commit.
2018-07-21 20:23:01 +08:00
|
|
|
gimp_image_get_precision (image), TRUE,
|
|
|
|
gimp_image_get_layer_space (image));
|
2012-03-30 03:09:37 +08:00
|
|
|
}
|
2009-09-13 01:24:01 +08:00
|
|
|
|
2018-01-22 19:33:39 +08:00
|
|
|
g_return_val_if_reached (NULL);
|
2009-09-13 01:24:01 +08:00
|
|
|
}
|
|
|
|
|
2013-09-14 05:25:30 +08:00
|
|
|
static void
|
|
|
|
gimp_image_pickable_flush (GimpPickable *pickable)
|
|
|
|
{
|
|
|
|
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (pickable);
|
|
|
|
|
|
|
|
return gimp_pickable_flush (GIMP_PICKABLE (private->projection));
|
|
|
|
}
|
|
|
|
|
|
|
|
static GeglBuffer *
|
|
|
|
gimp_image_get_buffer (GimpPickable *pickable)
|
|
|
|
{
|
|
|
|
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (pickable);
|
|
|
|
|
|
|
|
return gimp_pickable_get_buffer (GIMP_PICKABLE (private->projection));
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gimp_image_get_pixel_at (GimpPickable *pickable,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
const Babl *format,
|
|
|
|
gpointer pixel)
|
|
|
|
{
|
|
|
|
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (pickable);
|
|
|
|
|
|
|
|
return gimp_pickable_get_pixel_at (GIMP_PICKABLE (private->projection),
|
|
|
|
x, y, format, pixel);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gdouble
|
|
|
|
gimp_image_get_opacity_at (GimpPickable *pickable,
|
|
|
|
gint x,
|
|
|
|
gint y)
|
|
|
|
{
|
|
|
|
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (pickable);
|
|
|
|
|
|
|
|
return gimp_pickable_get_opacity_at (GIMP_PICKABLE (private->projection),
|
|
|
|
x, y);
|
|
|
|
}
|
|
|
|
|
2018-05-19 02:57:19 +08:00
|
|
|
static void
|
|
|
|
gimp_image_get_pixel_average (GimpPickable *pickable,
|
|
|
|
const GeglRectangle *rect,
|
|
|
|
const Babl *format,
|
|
|
|
gpointer pixel)
|
|
|
|
{
|
|
|
|
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (pickable);
|
|
|
|
|
|
|
|
return gimp_pickable_get_pixel_average (GIMP_PICKABLE (private->projection),
|
|
|
|
rect, format, pixel);
|
|
|
|
}
|
|
|
|
|
2016-05-23 05:28:31 +08:00
|
|
|
static void
|
|
|
|
gimp_image_pixel_to_srgb (GimpPickable *pickable,
|
|
|
|
const Babl *format,
|
|
|
|
gpointer pixel,
|
|
|
|
GimpRGB *color)
|
|
|
|
{
|
|
|
|
gimp_image_color_profile_pixel_to_srgb (GIMP_IMAGE (pickable),
|
|
|
|
format, pixel, color);
|
|
|
|
}
|
|
|
|
|
2016-05-23 07:25:35 +08:00
|
|
|
static void
|
|
|
|
gimp_image_srgb_to_pixel (GimpPickable *pickable,
|
|
|
|
const GimpRGB *color,
|
|
|
|
const Babl *format,
|
|
|
|
gpointer pixel)
|
|
|
|
{
|
|
|
|
gimp_image_color_profile_srgb_to_pixel (GIMP_IMAGE (pickable),
|
|
|
|
color, format, pixel);
|
|
|
|
}
|
|
|
|
|
2008-11-05 02:06:36 +08:00
|
|
|
static GeglNode *
|
|
|
|
gimp_image_get_graph (GimpProjectable *projectable)
|
|
|
|
{
|
2012-10-07 05:58:46 +08:00
|
|
|
GimpImage *image = GIMP_IMAGE (projectable);
|
|
|
|
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
GeglNode *layers_node;
|
|
|
|
GeglNode *channels_node;
|
|
|
|
GeglNode *output;
|
|
|
|
GimpComponentMask mask;
|
2008-11-05 02:06:36 +08:00
|
|
|
|
2010-02-04 04:46:09 +08:00
|
|
|
if (private->graph)
|
|
|
|
return private->graph;
|
2008-11-05 02:06:36 +08:00
|
|
|
|
2010-02-04 04:46:09 +08:00
|
|
|
private->graph = gegl_node_new ();
|
2008-11-05 02:06:36 +08:00
|
|
|
|
|
|
|
layers_node =
|
2013-04-11 10:12:10 +08:00
|
|
|
gimp_filter_stack_get_graph (GIMP_FILTER_STACK (private->layers->container));
|
2008-11-05 02:06:36 +08:00
|
|
|
|
2010-02-04 04:46:09 +08:00
|
|
|
gegl_node_add_child (private->graph, layers_node);
|
2008-11-05 02:06:36 +08:00
|
|
|
|
2015-09-07 06:35:02 +08:00
|
|
|
mask = ~gimp_image_get_visible_mask (image) & GIMP_COMPONENT_MASK_ALL;
|
2012-10-07 05:58:46 +08:00
|
|
|
|
|
|
|
private->visible_mask =
|
|
|
|
gegl_node_new_child (private->graph,
|
|
|
|
"operation", "gimp:mask-components",
|
|
|
|
"mask", mask,
|
2019-06-01 01:02:51 +08:00
|
|
|
"alpha", 1.0,
|
2012-10-07 05:58:46 +08:00
|
|
|
NULL);
|
|
|
|
|
2018-11-05 02:18:08 +08:00
|
|
|
gegl_node_connect_to (layers_node, "output",
|
2012-10-07 05:58:46 +08:00
|
|
|
private->visible_mask, "input");
|
|
|
|
|
2018-11-05 02:18:08 +08:00
|
|
|
channels_node =
|
|
|
|
gimp_filter_stack_get_graph (GIMP_FILTER_STACK (private->channels->container));
|
|
|
|
|
|
|
|
gegl_node_add_child (private->graph, channels_node);
|
2008-11-05 02:06:36 +08:00
|
|
|
|
2012-10-07 05:58:46 +08:00
|
|
|
gegl_node_connect_to (private->visible_mask, "output",
|
2018-11-05 02:18:08 +08:00
|
|
|
channels_node, "input");
|
|
|
|
|
|
|
|
output = gegl_node_get_output_proxy (private->graph, "output");
|
|
|
|
|
|
|
|
gegl_node_connect_to (channels_node, "output",
|
|
|
|
output, "input");
|
2008-11-05 02:06:36 +08:00
|
|
|
|
2010-02-04 04:46:09 +08:00
|
|
|
return private->graph;
|
2008-11-05 02:06:36 +08:00
|
|
|
}
|
|
|
|
|
2003-10-06 20:17:11 +08:00
|
|
|
static void
|
|
|
|
gimp_image_mask_update (GimpDrawable *drawable,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
2006-03-29 01:08:36 +08:00
|
|
|
GimpImage *image)
|
2003-10-06 20:17:11 +08:00
|
|
|
{
|
2010-02-05 16:13:25 +08:00
|
|
|
GIMP_IMAGE_GET_PRIVATE (image)->flush_accum.mask_changed = TRUE;
|
2003-10-06 20:17:11 +08:00
|
|
|
}
|
|
|
|
|
2004-03-16 00:38:49 +08:00
|
|
|
static void
|
|
|
|
gimp_image_layer_alpha_changed (GimpDrawable *drawable,
|
2006-03-29 01:08:36 +08:00
|
|
|
GimpImage *image)
|
2004-03-16 00:38:49 +08:00
|
|
|
{
|
2010-02-04 06:00:31 +08:00
|
|
|
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
2010-02-06 20:41:16 +08:00
|
|
|
if (gimp_container_get_n_children (private->layers->container) == 1)
|
2010-02-05 16:13:25 +08:00
|
|
|
private->flush_accum.alpha_changed = TRUE;
|
2004-03-16 00:38:49 +08:00
|
|
|
}
|
|
|
|
|
2004-02-14 23:37:23 +08:00
|
|
|
static void
|
|
|
|
gimp_image_channel_add (GimpContainer *container,
|
|
|
|
GimpChannel *channel,
|
2006-03-29 01:08:36 +08:00
|
|
|
GimpImage *image)
|
2004-02-14 23:37:23 +08:00
|
|
|
{
|
2005-09-19 20:44:06 +08:00
|
|
|
if (! strcmp (GIMP_IMAGE_QUICK_MASK_NAME,
|
2009-09-01 04:47:18 +08:00
|
|
|
gimp_object_get_name (channel)))
|
2004-02-14 23:37:23 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_set_quick_mask_state (image, TRUE);
|
2004-02-14 23:37:23 +08:00
|
|
|
}
|
To optimize duplicate and/or wrong image updates away, introduced new
2003-09-06 Michael Natterer <mitch@gimp.org>
To optimize duplicate and/or wrong image updates away, introduced
new policy that a child object must never explicitly update or
invalidate its parent object (just like the GUI is not updated
explicitly by the core):
* app/core/gimpdrawable.[ch]: added new signal
GimpDrawable::update(). Never update or invalidate the image when
the drawable is updated or invalidated.
(gimp_drawable_set_visible): don't gimp_drawable_update() the
drawable since its pixels have not changed.
* app/core/gimpimage.[ch]: connect to the "add" and "remove"
signals of the layers and channels containers. Also connect to the
"update" and "visibility_changed" signals of all drawables in
these containers (optimizes away updates issued by drawables which
are not yet added to the image and updates of the selection
mask). Also, don't propagate updates to the image if the emitting
drawable is invisible (optimizes away updates issued by invisible
drawables).
(gimp_image_add_layer,channel)
(gimp_image_remove_layer,channel): don't update the image since
that's done by our "add" and "remove" handlers now.
(gimp_image_position_layer,channel): update just the image, not
the drawable since its pixels have not changed.
(gimp_image_real_colormap_changed)
(gimp_image_set_component_visible): always call
gimp_image_update() *and* gimp_viewable_invalidate_preview() to
get everything updated, since update and invalidate of images are
not connected.
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): don't
update the drawable since (a) its pixels don't change and (b) the
image updates itself upon adding/removing now.
(undo_pop_layer_mod): replaced gimp_image_update() by
gimp_drawable_update() (just for consistency with other similar
functions).
* app/core/gimplayer.c: connect to "update" of the layer mask and
issue updates on the layer if the mask update has any effect on
the projection.
(gimp_layer_create_mask): don't set the mask's offsets here since
they may be different when we later add the mask to the layer.
* app/core/gimplayermask.c (gimp_layer_mask_set_layer): set the
mask offsets here instead.
* app/core/gimpchannel.c (gimp_channel_translate): update the
channel even if push_undo == FALSE.
* app/paint/gimppaintcore.c (gimp_paint_core_finish)
* app/tools/gimpinktool.c (ink_finish): invalidate both the
drawable and the image preview since invalidating the drawable
doesn't invalidate the image any more.
* app/text/gimptextlayer.c (gimp_text_layer_render_now): also
update the new extents of the text layer, not only the old one.
(gimp_text_layer_render_layout): don't update the drawable since
gimp_drawable_fill() already updated it.
2003-09-07 04:06:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-02-14 23:37:23 +08:00
|
|
|
gimp_image_channel_remove (GimpContainer *container,
|
|
|
|
GimpChannel *channel,
|
2006-03-29 01:08:36 +08:00
|
|
|
GimpImage *image)
|
To optimize duplicate and/or wrong image updates away, introduced new
2003-09-06 Michael Natterer <mitch@gimp.org>
To optimize duplicate and/or wrong image updates away, introduced
new policy that a child object must never explicitly update or
invalidate its parent object (just like the GUI is not updated
explicitly by the core):
* app/core/gimpdrawable.[ch]: added new signal
GimpDrawable::update(). Never update or invalidate the image when
the drawable is updated or invalidated.
(gimp_drawable_set_visible): don't gimp_drawable_update() the
drawable since its pixels have not changed.
* app/core/gimpimage.[ch]: connect to the "add" and "remove"
signals of the layers and channels containers. Also connect to the
"update" and "visibility_changed" signals of all drawables in
these containers (optimizes away updates issued by drawables which
are not yet added to the image and updates of the selection
mask). Also, don't propagate updates to the image if the emitting
drawable is invisible (optimizes away updates issued by invisible
drawables).
(gimp_image_add_layer,channel)
(gimp_image_remove_layer,channel): don't update the image since
that's done by our "add" and "remove" handlers now.
(gimp_image_position_layer,channel): update just the image, not
the drawable since its pixels have not changed.
(gimp_image_real_colormap_changed)
(gimp_image_set_component_visible): always call
gimp_image_update() *and* gimp_viewable_invalidate_preview() to
get everything updated, since update and invalidate of images are
not connected.
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): don't
update the drawable since (a) its pixels don't change and (b) the
image updates itself upon adding/removing now.
(undo_pop_layer_mod): replaced gimp_image_update() by
gimp_drawable_update() (just for consistency with other similar
functions).
* app/core/gimplayer.c: connect to "update" of the layer mask and
issue updates on the layer if the mask update has any effect on
the projection.
(gimp_layer_create_mask): don't set the mask's offsets here since
they may be different when we later add the mask to the layer.
* app/core/gimplayermask.c (gimp_layer_mask_set_layer): set the
mask offsets here instead.
* app/core/gimpchannel.c (gimp_channel_translate): update the
channel even if push_undo == FALSE.
* app/paint/gimppaintcore.c (gimp_paint_core_finish)
* app/tools/gimpinktool.c (ink_finish): invalidate both the
drawable and the image preview since invalidating the drawable
doesn't invalidate the image any more.
* app/text/gimptextlayer.c (gimp_text_layer_render_now): also
update the new extents of the text layer, not only the old one.
(gimp_text_layer_render_layout): don't update the drawable since
gimp_drawable_fill() already updated it.
2003-09-07 04:06:53 +08:00
|
|
|
{
|
2005-09-19 20:44:06 +08:00
|
|
|
if (! strcmp (GIMP_IMAGE_QUICK_MASK_NAME,
|
2009-09-01 04:47:18 +08:00
|
|
|
gimp_object_get_name (channel)))
|
2004-02-14 23:37:23 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_set_quick_mask_state (image, FALSE);
|
2004-02-14 23:37:23 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_image_channel_name_changed (GimpChannel *channel,
|
2006-03-29 01:08:36 +08:00
|
|
|
GimpImage *image)
|
2004-02-14 23:37:23 +08:00
|
|
|
{
|
2005-09-19 20:44:06 +08:00
|
|
|
if (! strcmp (GIMP_IMAGE_QUICK_MASK_NAME,
|
2009-09-01 04:47:18 +08:00
|
|
|
gimp_object_get_name (channel)))
|
2004-02-14 23:37:23 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_set_quick_mask_state (image, TRUE);
|
2004-02-14 23:37:23 +08:00
|
|
|
}
|
2006-03-29 01:08:36 +08:00
|
|
|
else if (gimp_image_get_quick_mask_state (image) &&
|
|
|
|
! gimp_image_get_quick_mask (image))
|
2004-02-14 23:37:23 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_set_quick_mask_state (image, FALSE);
|
2004-02-14 23:37:23 +08:00
|
|
|
}
|
To optimize duplicate and/or wrong image updates away, introduced new
2003-09-06 Michael Natterer <mitch@gimp.org>
To optimize duplicate and/or wrong image updates away, introduced
new policy that a child object must never explicitly update or
invalidate its parent object (just like the GUI is not updated
explicitly by the core):
* app/core/gimpdrawable.[ch]: added new signal
GimpDrawable::update(). Never update or invalidate the image when
the drawable is updated or invalidated.
(gimp_drawable_set_visible): don't gimp_drawable_update() the
drawable since its pixels have not changed.
* app/core/gimpimage.[ch]: connect to the "add" and "remove"
signals of the layers and channels containers. Also connect to the
"update" and "visibility_changed" signals of all drawables in
these containers (optimizes away updates issued by drawables which
are not yet added to the image and updates of the selection
mask). Also, don't propagate updates to the image if the emitting
drawable is invisible (optimizes away updates issued by invisible
drawables).
(gimp_image_add_layer,channel)
(gimp_image_remove_layer,channel): don't update the image since
that's done by our "add" and "remove" handlers now.
(gimp_image_position_layer,channel): update just the image, not
the drawable since its pixels have not changed.
(gimp_image_real_colormap_changed)
(gimp_image_set_component_visible): always call
gimp_image_update() *and* gimp_viewable_invalidate_preview() to
get everything updated, since update and invalidate of images are
not connected.
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): don't
update the drawable since (a) its pixels don't change and (b) the
image updates itself upon adding/removing now.
(undo_pop_layer_mod): replaced gimp_image_update() by
gimp_drawable_update() (just for consistency with other similar
functions).
* app/core/gimplayer.c: connect to "update" of the layer mask and
issue updates on the layer if the mask update has any effect on
the projection.
(gimp_layer_create_mask): don't set the mask's offsets here since
they may be different when we later add the mask to the layer.
* app/core/gimplayermask.c (gimp_layer_mask_set_layer): set the
mask offsets here instead.
* app/core/gimpchannel.c (gimp_channel_translate): update the
channel even if push_undo == FALSE.
* app/paint/gimppaintcore.c (gimp_paint_core_finish)
* app/tools/gimpinktool.c (ink_finish): invalidate both the
drawable and the image preview since invalidating the drawable
doesn't invalidate the image any more.
* app/text/gimptextlayer.c (gimp_text_layer_render_now): also
update the new extents of the text layer, not only the old one.
(gimp_text_layer_render_layout): don't update the drawable since
gimp_drawable_fill() already updated it.
2003-09-07 04:06:53 +08:00
|
|
|
}
|
|
|
|
|
2004-07-05 19:18:34 +08:00
|
|
|
static void
|
|
|
|
gimp_image_channel_color_changed (GimpChannel *channel,
|
2006-03-29 01:08:36 +08:00
|
|
|
GimpImage *image)
|
2004-07-05 19:18:34 +08:00
|
|
|
{
|
2005-09-19 20:44:06 +08:00
|
|
|
if (! strcmp (GIMP_IMAGE_QUICK_MASK_NAME,
|
2009-09-01 04:47:18 +08:00
|
|
|
gimp_object_get_name (channel)))
|
2004-07-05 19:18:34 +08:00
|
|
|
{
|
2010-02-04 16:49:45 +08:00
|
|
|
GIMP_IMAGE_GET_PRIVATE (image)->quick_mask_color = channel->color;
|
2004-07-05 19:18:34 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-02-08 02:57:46 +08:00
|
|
|
static void
|
|
|
|
gimp_image_active_layer_notify (GimpItemTree *tree,
|
|
|
|
const GParamSpec *pspec,
|
|
|
|
GimpImage *image)
|
|
|
|
{
|
2010-02-08 17:39:44 +08:00
|
|
|
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
GimpLayer *layer = gimp_image_get_active_layer (image);
|
|
|
|
|
|
|
|
if (layer)
|
|
|
|
{
|
|
|
|
/* Configure the layer stack to reflect this change */
|
|
|
|
private->layer_stack = g_slist_remove (private->layer_stack, layer);
|
|
|
|
private->layer_stack = g_slist_prepend (private->layer_stack, layer);
|
|
|
|
}
|
2010-02-08 02:57:46 +08:00
|
|
|
|
|
|
|
g_signal_emit (image, gimp_image_signals[ACTIVE_LAYER_CHANGED], 0);
|
|
|
|
|
|
|
|
if (layer && gimp_image_get_active_channel (image))
|
|
|
|
gimp_image_set_active_channel (image, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_image_active_channel_notify (GimpItemTree *tree,
|
|
|
|
const GParamSpec *pspec,
|
|
|
|
GimpImage *image)
|
|
|
|
{
|
|
|
|
GimpChannel *channel = gimp_image_get_active_channel (image);
|
|
|
|
|
|
|
|
g_signal_emit (image, gimp_image_signals[ACTIVE_CHANNEL_CHANGED], 0);
|
|
|
|
|
|
|
|
if (channel && gimp_image_get_active_layer (image))
|
|
|
|
gimp_image_set_active_layer (image, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_image_active_vectors_notify (GimpItemTree *tree,
|
|
|
|
const GParamSpec *pspec,
|
|
|
|
GimpImage *image)
|
|
|
|
{
|
|
|
|
g_signal_emit (image, gimp_image_signals[ACTIVE_VECTORS_CHANGED], 0);
|
|
|
|
}
|
|
|
|
|
1998-06-28 18:39:58 +08:00
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
/* public functions */
|
1998-06-28 18:39:58 +08:00
|
|
|
|
|
|
|
GimpImage *
|
2001-07-05 03:31:35 +08:00
|
|
|
gimp_image_new (Gimp *gimp,
|
2004-07-14 20:12:50 +08:00
|
|
|
gint width,
|
|
|
|
gint height,
|
2012-04-22 23:31:32 +08:00
|
|
|
GimpImageBaseType base_type,
|
|
|
|
GimpPrecision precision)
|
1998-06-28 18:39:58 +08:00
|
|
|
{
|
2001-07-05 03:31:35 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
2018-07-07 01:00:35 +08:00
|
|
|
g_return_val_if_fail (gimp_babl_is_valid (base_type, precision), NULL);
|
2001-07-05 03:31:35 +08:00
|
|
|
|
2004-07-14 20:12:50 +08:00
|
|
|
return g_object_new (GIMP_TYPE_IMAGE,
|
|
|
|
"gimp", gimp,
|
|
|
|
"width", width,
|
|
|
|
"height", height,
|
|
|
|
"base-type", base_type,
|
2012-04-22 23:31:32 +08:00
|
|
|
"precision", precision,
|
2004-07-14 20:12:50 +08:00
|
|
|
NULL);
|
1998-06-28 18:39:58 +08:00
|
|
|
}
|
|
|
|
|
2014-06-16 03:40:05 +08:00
|
|
|
gint64
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_estimate_memsize (GimpImage *image,
|
2014-06-16 03:40:05 +08:00
|
|
|
GimpComponentType component_type,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
|
|
|
{
|
|
|
|
GList *drawables;
|
|
|
|
GList *list;
|
|
|
|
gint current_width;
|
|
|
|
gint current_height;
|
|
|
|
gint64 current_size;
|
|
|
|
gint64 scalable_size = 0;
|
|
|
|
gint64 scaled_size = 0;
|
|
|
|
gint64 new_size;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), 0);
|
|
|
|
|
|
|
|
current_width = gimp_image_get_width (image);
|
|
|
|
current_height = gimp_image_get_height (image);
|
|
|
|
current_size = gimp_object_get_memsize (GIMP_OBJECT (image), NULL);
|
|
|
|
|
|
|
|
/* the part of the image's memsize that scales linearly with the image */
|
2015-06-29 05:48:47 +08:00
|
|
|
drawables = gimp_image_item_list_get_list (image,
|
2014-06-16 03:40:05 +08:00
|
|
|
GIMP_ITEM_TYPE_LAYERS |
|
|
|
|
GIMP_ITEM_TYPE_CHANNELS,
|
|
|
|
GIMP_ITEM_SET_ALL);
|
|
|
|
|
2015-06-29 05:48:47 +08:00
|
|
|
gimp_image_item_list_filter (drawables);
|
2014-06-16 03:40:05 +08:00
|
|
|
|
|
|
|
drawables = g_list_prepend (drawables, gimp_image_get_mask (image));
|
|
|
|
|
|
|
|
for (list = drawables; list; list = g_list_next (list))
|
|
|
|
{
|
|
|
|
GimpDrawable *drawable = list->data;
|
|
|
|
gdouble drawable_width;
|
|
|
|
gdouble drawable_height;
|
|
|
|
|
|
|
|
drawable_width = gimp_item_get_width (GIMP_ITEM (drawable));
|
|
|
|
drawable_height = gimp_item_get_height (GIMP_ITEM (drawable));
|
|
|
|
|
|
|
|
scalable_size += gimp_drawable_estimate_memsize (drawable,
|
|
|
|
gimp_drawable_get_component_type (drawable),
|
|
|
|
drawable_width,
|
|
|
|
drawable_height);
|
|
|
|
|
|
|
|
scaled_size += gimp_drawable_estimate_memsize (drawable,
|
|
|
|
component_type,
|
|
|
|
drawable_width * width /
|
|
|
|
current_width,
|
|
|
|
drawable_height * height /
|
|
|
|
current_height);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_list_free (drawables);
|
|
|
|
|
|
|
|
scalable_size +=
|
|
|
|
gimp_projection_estimate_memsize (gimp_image_get_base_type (image),
|
|
|
|
gimp_image_get_component_type (image),
|
|
|
|
gimp_image_get_width (image),
|
|
|
|
gimp_image_get_height (image));
|
|
|
|
|
|
|
|
scaled_size +=
|
|
|
|
gimp_projection_estimate_memsize (gimp_image_get_base_type (image),
|
|
|
|
component_type,
|
|
|
|
width, height);
|
|
|
|
|
|
|
|
GIMP_LOG (IMAGE_SCALE,
|
|
|
|
"scalable_size = %"G_GINT64_FORMAT" scaled_size = %"G_GINT64_FORMAT,
|
|
|
|
scalable_size, scaled_size);
|
|
|
|
|
|
|
|
new_size = current_size - scalable_size + scaled_size;
|
|
|
|
|
|
|
|
return new_size;
|
|
|
|
}
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
GimpImageBaseType
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_base_type (GimpImage *image)
|
2001-04-13 22:50:43 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), -1);
|
2001-04-13 22:50:43 +08:00
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->base_type;
|
2001-04-13 22:50:43 +08:00
|
|
|
}
|
|
|
|
|
2013-06-23 22:51:24 +08:00
|
|
|
GimpComponentType
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_component_type (GimpImage *image)
|
2013-06-23 22:51:24 +08:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), -1);
|
|
|
|
|
|
|
|
return gimp_babl_component_type (GIMP_IMAGE_GET_PRIVATE (image)->precision);
|
|
|
|
}
|
|
|
|
|
2012-04-22 23:07:35 +08:00
|
|
|
GimpPrecision
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_precision (GimpImage *image)
|
2012-04-22 23:07:35 +08:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), -1);
|
|
|
|
|
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->precision;
|
|
|
|
}
|
|
|
|
|
2012-03-19 00:08:33 +08:00
|
|
|
const Babl *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_format (GimpImage *image,
|
2012-04-12 00:40:30 +08:00
|
|
|
GimpImageBaseType base_type,
|
2012-05-08 03:46:47 +08:00
|
|
|
GimpPrecision precision,
|
Initial space invasion commit in GIMP
All babl formats now have a space equivalent to a color profile,
determining the format's primaries and TRCs. This commit makes GIMP
aware of this.
libgimp:
- enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA
as deprecated aliases, add PERCEPTUAL values so we now have LINEAR,
NON_LINEAR and PERCPTUAL for each encoding, matching the babl
encoding variants RGB, R'G'B' and R~G~B~.
- gimp_color_transform_can_gegl_copy() now returns TRUE if both
profiles can return a babl space, increasing the amount of fast babl
color conversions significantly.
- TODO: no solution yet for getting libgimp drawable proxy buffers in
the right format with space.
plug-ins:
- follow the GimpPrecision change.
- TODO: everything else unchanged and partly broken or sub-optimal,
like setting a new image's color profile too late.
app:
- add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as
replacement for all "linear" booleans.
- change gimp-babl functions to take babl spaces and GimpTRCType
parameters and support all sorts of new perceptual ~ formats.
- a lot of places changed in the early days of goat invasion didn't
take advantage of gimp-babl utility functions and constructed
formats manually. They all needed revisiting and many now use much
simpler code calling gimp-babl API.
- change gimp_babl_format_get_color_profile() to really extract a
newly allocated color profile from the format, and add
gimp_babl_get_builtin_color_profile() which does the same as
gimp_babl_format_get_color_profile() did before. Visited all callers
to decide whether they are looking for the format's actual profile,
or for one of the builtin profiles, simplifying code that only needs
builtin profiles.
- drawables have a new get_space_api(), get_linear() is now get_trc().
- images now have a "layer space" and an API to get it,
gimp_image_get_layer_format() returns formats in that space.
- an image's layer space is created from the image's color profile,
change gimpimage-color-profile to deal with that correctly
- change many babl_format() calls to babl_format_with_space() and take
the space from passed formats or drawables
- add function gimp_layer_fix_format_space() which replaces the
layer's buffer with one that has the image's layer format, but
doesn't change pixel values
- use gimp_layer_fix_format_space() to make sure layers loaded from
XCF and created by plug-ins have the right space when added to the
image, because it's impossible to always assign the right space upon
layer creation
- "assign color profile" and "discard color profile" now require use
of gimp_layer_fix_format_space() too because the profile is now
embedded in all formats via the space. Add
gimp_image_assign_color_profile() which does all that and call it
instead of a simple gimp_image_set_color_profile(), also from the
PDB set-color-profile functions, which are essentially "assign" and
"discard" calls.
- generally, make sure a new image's color profile is set before
adding layers to it, gimp_image_set_color_profile() is more than
before considered know-what-you-are-doing API.
- take special precaution in all places that call
gimp_drawable_convert_type(), we now must pass a new_profile from
all callers that convert layers within the same image (such as
image_convert_type, image_convert_precision), because the layer's
new space can't be determined from the image's layer format during
the call.
- change all "linear" properties to "trc", in all config objects like
for levels and curves, in the histogram, in the widgets. This results
in some GUI that now has three choices instead of two.
TODO: we might want to reduce that back to two later.
- keep "linear" boolean properties around as compat if needed for file
pasring, but always convert the parsed parsed boolean to
GimpTRCType.
- TODO: the image's "enable color management" switch is currently
broken, will fix that in another commit.
2018-07-21 20:23:01 +08:00
|
|
|
gboolean with_alpha,
|
|
|
|
const Babl *space)
|
2012-03-19 00:08:33 +08:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
2012-04-12 00:40:30 +08:00
|
|
|
switch (base_type)
|
2012-04-07 06:15:48 +08:00
|
|
|
{
|
|
|
|
case GIMP_RGB:
|
|
|
|
case GIMP_GRAY:
|
Initial space invasion commit in GIMP
All babl formats now have a space equivalent to a color profile,
determining the format's primaries and TRCs. This commit makes GIMP
aware of this.
libgimp:
- enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA
as deprecated aliases, add PERCEPTUAL values so we now have LINEAR,
NON_LINEAR and PERCPTUAL for each encoding, matching the babl
encoding variants RGB, R'G'B' and R~G~B~.
- gimp_color_transform_can_gegl_copy() now returns TRUE if both
profiles can return a babl space, increasing the amount of fast babl
color conversions significantly.
- TODO: no solution yet for getting libgimp drawable proxy buffers in
the right format with space.
plug-ins:
- follow the GimpPrecision change.
- TODO: everything else unchanged and partly broken or sub-optimal,
like setting a new image's color profile too late.
app:
- add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as
replacement for all "linear" booleans.
- change gimp-babl functions to take babl spaces and GimpTRCType
parameters and support all sorts of new perceptual ~ formats.
- a lot of places changed in the early days of goat invasion didn't
take advantage of gimp-babl utility functions and constructed
formats manually. They all needed revisiting and many now use much
simpler code calling gimp-babl API.
- change gimp_babl_format_get_color_profile() to really extract a
newly allocated color profile from the format, and add
gimp_babl_get_builtin_color_profile() which does the same as
gimp_babl_format_get_color_profile() did before. Visited all callers
to decide whether they are looking for the format's actual profile,
or for one of the builtin profiles, simplifying code that only needs
builtin profiles.
- drawables have a new get_space_api(), get_linear() is now get_trc().
- images now have a "layer space" and an API to get it,
gimp_image_get_layer_format() returns formats in that space.
- an image's layer space is created from the image's color profile,
change gimpimage-color-profile to deal with that correctly
- change many babl_format() calls to babl_format_with_space() and take
the space from passed formats or drawables
- add function gimp_layer_fix_format_space() which replaces the
layer's buffer with one that has the image's layer format, but
doesn't change pixel values
- use gimp_layer_fix_format_space() to make sure layers loaded from
XCF and created by plug-ins have the right space when added to the
image, because it's impossible to always assign the right space upon
layer creation
- "assign color profile" and "discard color profile" now require use
of gimp_layer_fix_format_space() too because the profile is now
embedded in all formats via the space. Add
gimp_image_assign_color_profile() which does all that and call it
instead of a simple gimp_image_set_color_profile(), also from the
PDB set-color-profile functions, which are essentially "assign" and
"discard" calls.
- generally, make sure a new image's color profile is set before
adding layers to it, gimp_image_set_color_profile() is more than
before considered know-what-you-are-doing API.
- take special precaution in all places that call
gimp_drawable_convert_type(), we now must pass a new_profile from
all callers that convert layers within the same image (such as
image_convert_type, image_convert_precision), because the layer's
new space can't be determined from the image's layer format during
the call.
- change all "linear" properties to "trc", in all config objects like
for levels and curves, in the histogram, in the widgets. This results
in some GUI that now has three choices instead of two.
TODO: we might want to reduce that back to two later.
- keep "linear" boolean properties around as compat if needed for file
pasring, but always convert the parsed parsed boolean to
GimpTRCType.
- TODO: the image's "enable color management" switch is currently
broken, will fix that in another commit.
2018-07-21 20:23:01 +08:00
|
|
|
return gimp_babl_format (base_type, precision, with_alpha, space);
|
2012-04-07 06:15:48 +08:00
|
|
|
|
|
|
|
case GIMP_INDEXED:
|
Initial space invasion commit in GIMP
All babl formats now have a space equivalent to a color profile,
determining the format's primaries and TRCs. This commit makes GIMP
aware of this.
libgimp:
- enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA
as deprecated aliases, add PERCEPTUAL values so we now have LINEAR,
NON_LINEAR and PERCPTUAL for each encoding, matching the babl
encoding variants RGB, R'G'B' and R~G~B~.
- gimp_color_transform_can_gegl_copy() now returns TRUE if both
profiles can return a babl space, increasing the amount of fast babl
color conversions significantly.
- TODO: no solution yet for getting libgimp drawable proxy buffers in
the right format with space.
plug-ins:
- follow the GimpPrecision change.
- TODO: everything else unchanged and partly broken or sub-optimal,
like setting a new image's color profile too late.
app:
- add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as
replacement for all "linear" booleans.
- change gimp-babl functions to take babl spaces and GimpTRCType
parameters and support all sorts of new perceptual ~ formats.
- a lot of places changed in the early days of goat invasion didn't
take advantage of gimp-babl utility functions and constructed
formats manually. They all needed revisiting and many now use much
simpler code calling gimp-babl API.
- change gimp_babl_format_get_color_profile() to really extract a
newly allocated color profile from the format, and add
gimp_babl_get_builtin_color_profile() which does the same as
gimp_babl_format_get_color_profile() did before. Visited all callers
to decide whether they are looking for the format's actual profile,
or for one of the builtin profiles, simplifying code that only needs
builtin profiles.
- drawables have a new get_space_api(), get_linear() is now get_trc().
- images now have a "layer space" and an API to get it,
gimp_image_get_layer_format() returns formats in that space.
- an image's layer space is created from the image's color profile,
change gimpimage-color-profile to deal with that correctly
- change many babl_format() calls to babl_format_with_space() and take
the space from passed formats or drawables
- add function gimp_layer_fix_format_space() which replaces the
layer's buffer with one that has the image's layer format, but
doesn't change pixel values
- use gimp_layer_fix_format_space() to make sure layers loaded from
XCF and created by plug-ins have the right space when added to the
image, because it's impossible to always assign the right space upon
layer creation
- "assign color profile" and "discard color profile" now require use
of gimp_layer_fix_format_space() too because the profile is now
embedded in all formats via the space. Add
gimp_image_assign_color_profile() which does all that and call it
instead of a simple gimp_image_set_color_profile(), also from the
PDB set-color-profile functions, which are essentially "assign" and
"discard" calls.
- generally, make sure a new image's color profile is set before
adding layers to it, gimp_image_set_color_profile() is more than
before considered know-what-you-are-doing API.
- take special precaution in all places that call
gimp_drawable_convert_type(), we now must pass a new_profile from
all callers that convert layers within the same image (such as
image_convert_type, image_convert_precision), because the layer's
new space can't be determined from the image's layer format during
the call.
- change all "linear" properties to "trc", in all config objects like
for levels and curves, in the histogram, in the widgets. This results
in some GUI that now has three choices instead of two.
TODO: we might want to reduce that back to two later.
- keep "linear" boolean properties around as compat if needed for file
pasring, but always convert the parsed parsed boolean to
GimpTRCType.
- TODO: the image's "enable color management" switch is currently
broken, will fix that in another commit.
2018-07-21 20:23:01 +08:00
|
|
|
if (precision == GIMP_PRECISION_U8_NON_LINEAR)
|
2012-05-08 03:46:47 +08:00
|
|
|
{
|
|
|
|
if (with_alpha)
|
|
|
|
return gimp_image_colormap_get_rgba_format (image);
|
|
|
|
else
|
|
|
|
return gimp_image_colormap_get_rgb_format (image);
|
|
|
|
}
|
2012-04-07 06:15:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
g_return_val_if_reached (NULL);
|
|
|
|
}
|
|
|
|
|
Initial space invasion commit in GIMP
All babl formats now have a space equivalent to a color profile,
determining the format's primaries and TRCs. This commit makes GIMP
aware of this.
libgimp:
- enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA
as deprecated aliases, add PERCEPTUAL values so we now have LINEAR,
NON_LINEAR and PERCPTUAL for each encoding, matching the babl
encoding variants RGB, R'G'B' and R~G~B~.
- gimp_color_transform_can_gegl_copy() now returns TRUE if both
profiles can return a babl space, increasing the amount of fast babl
color conversions significantly.
- TODO: no solution yet for getting libgimp drawable proxy buffers in
the right format with space.
plug-ins:
- follow the GimpPrecision change.
- TODO: everything else unchanged and partly broken or sub-optimal,
like setting a new image's color profile too late.
app:
- add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as
replacement for all "linear" booleans.
- change gimp-babl functions to take babl spaces and GimpTRCType
parameters and support all sorts of new perceptual ~ formats.
- a lot of places changed in the early days of goat invasion didn't
take advantage of gimp-babl utility functions and constructed
formats manually. They all needed revisiting and many now use much
simpler code calling gimp-babl API.
- change gimp_babl_format_get_color_profile() to really extract a
newly allocated color profile from the format, and add
gimp_babl_get_builtin_color_profile() which does the same as
gimp_babl_format_get_color_profile() did before. Visited all callers
to decide whether they are looking for the format's actual profile,
or for one of the builtin profiles, simplifying code that only needs
builtin profiles.
- drawables have a new get_space_api(), get_linear() is now get_trc().
- images now have a "layer space" and an API to get it,
gimp_image_get_layer_format() returns formats in that space.
- an image's layer space is created from the image's color profile,
change gimpimage-color-profile to deal with that correctly
- change many babl_format() calls to babl_format_with_space() and take
the space from passed formats or drawables
- add function gimp_layer_fix_format_space() which replaces the
layer's buffer with one that has the image's layer format, but
doesn't change pixel values
- use gimp_layer_fix_format_space() to make sure layers loaded from
XCF and created by plug-ins have the right space when added to the
image, because it's impossible to always assign the right space upon
layer creation
- "assign color profile" and "discard color profile" now require use
of gimp_layer_fix_format_space() too because the profile is now
embedded in all formats via the space. Add
gimp_image_assign_color_profile() which does all that and call it
instead of a simple gimp_image_set_color_profile(), also from the
PDB set-color-profile functions, which are essentially "assign" and
"discard" calls.
- generally, make sure a new image's color profile is set before
adding layers to it, gimp_image_set_color_profile() is more than
before considered know-what-you-are-doing API.
- take special precaution in all places that call
gimp_drawable_convert_type(), we now must pass a new_profile from
all callers that convert layers within the same image (such as
image_convert_type, image_convert_precision), because the layer's
new space can't be determined from the image's layer format during
the call.
- change all "linear" properties to "trc", in all config objects like
for levels and curves, in the histogram, in the widgets. This results
in some GUI that now has three choices instead of two.
TODO: we might want to reduce that back to two later.
- keep "linear" boolean properties around as compat if needed for file
pasring, but always convert the parsed parsed boolean to
GimpTRCType.
- TODO: the image's "enable color management" switch is currently
broken, will fix that in another commit.
2018-07-21 20:23:01 +08:00
|
|
|
const Babl *
|
|
|
|
gimp_image_get_layer_space (GimpImage *image)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->layer_space;
|
|
|
|
}
|
|
|
|
|
2012-04-12 00:40:30 +08:00
|
|
|
const Babl *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_layer_format (GimpImage *image,
|
|
|
|
gboolean with_alpha)
|
2012-04-12 00:40:30 +08:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
|
|
|
return gimp_image_get_format (image,
|
2012-05-08 03:57:33 +08:00
|
|
|
gimp_image_get_base_type (image),
|
2012-05-08 03:46:47 +08:00
|
|
|
gimp_image_get_precision (image),
|
Initial space invasion commit in GIMP
All babl formats now have a space equivalent to a color profile,
determining the format's primaries and TRCs. This commit makes GIMP
aware of this.
libgimp:
- enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA
as deprecated aliases, add PERCEPTUAL values so we now have LINEAR,
NON_LINEAR and PERCPTUAL for each encoding, matching the babl
encoding variants RGB, R'G'B' and R~G~B~.
- gimp_color_transform_can_gegl_copy() now returns TRUE if both
profiles can return a babl space, increasing the amount of fast babl
color conversions significantly.
- TODO: no solution yet for getting libgimp drawable proxy buffers in
the right format with space.
plug-ins:
- follow the GimpPrecision change.
- TODO: everything else unchanged and partly broken or sub-optimal,
like setting a new image's color profile too late.
app:
- add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as
replacement for all "linear" booleans.
- change gimp-babl functions to take babl spaces and GimpTRCType
parameters and support all sorts of new perceptual ~ formats.
- a lot of places changed in the early days of goat invasion didn't
take advantage of gimp-babl utility functions and constructed
formats manually. They all needed revisiting and many now use much
simpler code calling gimp-babl API.
- change gimp_babl_format_get_color_profile() to really extract a
newly allocated color profile from the format, and add
gimp_babl_get_builtin_color_profile() which does the same as
gimp_babl_format_get_color_profile() did before. Visited all callers
to decide whether they are looking for the format's actual profile,
or for one of the builtin profiles, simplifying code that only needs
builtin profiles.
- drawables have a new get_space_api(), get_linear() is now get_trc().
- images now have a "layer space" and an API to get it,
gimp_image_get_layer_format() returns formats in that space.
- an image's layer space is created from the image's color profile,
change gimpimage-color-profile to deal with that correctly
- change many babl_format() calls to babl_format_with_space() and take
the space from passed formats or drawables
- add function gimp_layer_fix_format_space() which replaces the
layer's buffer with one that has the image's layer format, but
doesn't change pixel values
- use gimp_layer_fix_format_space() to make sure layers loaded from
XCF and created by plug-ins have the right space when added to the
image, because it's impossible to always assign the right space upon
layer creation
- "assign color profile" and "discard color profile" now require use
of gimp_layer_fix_format_space() too because the profile is now
embedded in all formats via the space. Add
gimp_image_assign_color_profile() which does all that and call it
instead of a simple gimp_image_set_color_profile(), also from the
PDB set-color-profile functions, which are essentially "assign" and
"discard" calls.
- generally, make sure a new image's color profile is set before
adding layers to it, gimp_image_set_color_profile() is more than
before considered know-what-you-are-doing API.
- take special precaution in all places that call
gimp_drawable_convert_type(), we now must pass a new_profile from
all callers that convert layers within the same image (such as
image_convert_type, image_convert_precision), because the layer's
new space can't be determined from the image's layer format during
the call.
- change all "linear" properties to "trc", in all config objects like
for levels and curves, in the histogram, in the widgets. This results
in some GUI that now has three choices instead of two.
TODO: we might want to reduce that back to two later.
- keep "linear" boolean properties around as compat if needed for file
pasring, but always convert the parsed parsed boolean to
GimpTRCType.
- TODO: the image's "enable color management" switch is currently
broken, will fix that in another commit.
2018-07-21 20:23:01 +08:00
|
|
|
with_alpha,
|
|
|
|
gimp_image_get_layer_space (image));
|
2012-04-12 00:40:30 +08:00
|
|
|
}
|
|
|
|
|
2012-04-08 04:45:25 +08:00
|
|
|
const Babl *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_channel_format (GimpImage *image)
|
2012-04-08 04:45:25 +08:00
|
|
|
{
|
Bug 791519 - Unexpected selection from channel
Storing selections and layer masks as linear grayscale, but channels
as whatever-the-layers-are caused severe problems in images with
gamma-corrected layers: when combining channels with the selection,
they would go thorugh a gamma conversion before being combined, giving
unexpected results.
This commit changes all channels to always be linear, except in 8-bit
images, where they continue to be "Y' u8", for compatibility with old
XCF files, and because linear 8-bit can't really be used in
compositing (channels can be visible too).
To fix channel -> selection combinations also for these images, add a
small hack to gimp_gegl_mask_combine_buffer() which makes sure the
to-be-combined channel's pixels are always read as-is, without any
gamma conversion. After changing channels to linear, this makes no
difference except in the 8-bit images where we need this hack.
2018-04-09 01:16:58 +08:00
|
|
|
GimpPrecision precision;
|
|
|
|
|
2012-04-08 04:45:25 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
Bug 791519 - Unexpected selection from channel
Storing selections and layer masks as linear grayscale, but channels
as whatever-the-layers-are caused severe problems in images with
gamma-corrected layers: when combining channels with the selection,
they would go thorugh a gamma conversion before being combined, giving
unexpected results.
This commit changes all channels to always be linear, except in 8-bit
images, where they continue to be "Y' u8", for compatibility with old
XCF files, and because linear 8-bit can't really be used in
compositing (channels can be visible too).
To fix channel -> selection combinations also for these images, add a
small hack to gimp_gegl_mask_combine_buffer() which makes sure the
to-be-combined channel's pixels are always read as-is, without any
gamma conversion. After changing channels to linear, this makes no
difference except in the 8-bit images where we need this hack.
2018-04-09 01:16:58 +08:00
|
|
|
precision = gimp_image_get_precision (image);
|
|
|
|
|
Initial space invasion commit in GIMP
All babl formats now have a space equivalent to a color profile,
determining the format's primaries and TRCs. This commit makes GIMP
aware of this.
libgimp:
- enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA
as deprecated aliases, add PERCEPTUAL values so we now have LINEAR,
NON_LINEAR and PERCPTUAL for each encoding, matching the babl
encoding variants RGB, R'G'B' and R~G~B~.
- gimp_color_transform_can_gegl_copy() now returns TRUE if both
profiles can return a babl space, increasing the amount of fast babl
color conversions significantly.
- TODO: no solution yet for getting libgimp drawable proxy buffers in
the right format with space.
plug-ins:
- follow the GimpPrecision change.
- TODO: everything else unchanged and partly broken or sub-optimal,
like setting a new image's color profile too late.
app:
- add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as
replacement for all "linear" booleans.
- change gimp-babl functions to take babl spaces and GimpTRCType
parameters and support all sorts of new perceptual ~ formats.
- a lot of places changed in the early days of goat invasion didn't
take advantage of gimp-babl utility functions and constructed
formats manually. They all needed revisiting and many now use much
simpler code calling gimp-babl API.
- change gimp_babl_format_get_color_profile() to really extract a
newly allocated color profile from the format, and add
gimp_babl_get_builtin_color_profile() which does the same as
gimp_babl_format_get_color_profile() did before. Visited all callers
to decide whether they are looking for the format's actual profile,
or for one of the builtin profiles, simplifying code that only needs
builtin profiles.
- drawables have a new get_space_api(), get_linear() is now get_trc().
- images now have a "layer space" and an API to get it,
gimp_image_get_layer_format() returns formats in that space.
- an image's layer space is created from the image's color profile,
change gimpimage-color-profile to deal with that correctly
- change many babl_format() calls to babl_format_with_space() and take
the space from passed formats or drawables
- add function gimp_layer_fix_format_space() which replaces the
layer's buffer with one that has the image's layer format, but
doesn't change pixel values
- use gimp_layer_fix_format_space() to make sure layers loaded from
XCF and created by plug-ins have the right space when added to the
image, because it's impossible to always assign the right space upon
layer creation
- "assign color profile" and "discard color profile" now require use
of gimp_layer_fix_format_space() too because the profile is now
embedded in all formats via the space. Add
gimp_image_assign_color_profile() which does all that and call it
instead of a simple gimp_image_set_color_profile(), also from the
PDB set-color-profile functions, which are essentially "assign" and
"discard" calls.
- generally, make sure a new image's color profile is set before
adding layers to it, gimp_image_set_color_profile() is more than
before considered know-what-you-are-doing API.
- take special precaution in all places that call
gimp_drawable_convert_type(), we now must pass a new_profile from
all callers that convert layers within the same image (such as
image_convert_type, image_convert_precision), because the layer's
new space can't be determined from the image's layer format during
the call.
- change all "linear" properties to "trc", in all config objects like
for levels and curves, in the histogram, in the widgets. This results
in some GUI that now has three choices instead of two.
TODO: we might want to reduce that back to two later.
- keep "linear" boolean properties around as compat if needed for file
pasring, but always convert the parsed parsed boolean to
GimpTRCType.
- TODO: the image's "enable color management" switch is currently
broken, will fix that in another commit.
2018-07-21 20:23:01 +08:00
|
|
|
if (precision == GIMP_PRECISION_U8_NON_LINEAR)
|
Bug 791519 - Unexpected selection from channel
Storing selections and layer masks as linear grayscale, but channels
as whatever-the-layers-are caused severe problems in images with
gamma-corrected layers: when combining channels with the selection,
they would go thorugh a gamma conversion before being combined, giving
unexpected results.
This commit changes all channels to always be linear, except in 8-bit
images, where they continue to be "Y' u8", for compatibility with old
XCF files, and because linear 8-bit can't really be used in
compositing (channels can be visible too).
To fix channel -> selection combinations also for these images, add a
small hack to gimp_gegl_mask_combine_buffer() which makes sure the
to-be-combined channel's pixels are always read as-is, without any
gamma conversion. After changing channels to linear, this makes no
difference except in the 8-bit images where we need this hack.
2018-04-09 01:16:58 +08:00
|
|
|
return gimp_image_get_format (image, GIMP_GRAY,
|
|
|
|
gimp_image_get_precision (image),
|
Initial space invasion commit in GIMP
All babl formats now have a space equivalent to a color profile,
determining the format's primaries and TRCs. This commit makes GIMP
aware of this.
libgimp:
- enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA
as deprecated aliases, add PERCEPTUAL values so we now have LINEAR,
NON_LINEAR and PERCPTUAL for each encoding, matching the babl
encoding variants RGB, R'G'B' and R~G~B~.
- gimp_color_transform_can_gegl_copy() now returns TRUE if both
profiles can return a babl space, increasing the amount of fast babl
color conversions significantly.
- TODO: no solution yet for getting libgimp drawable proxy buffers in
the right format with space.
plug-ins:
- follow the GimpPrecision change.
- TODO: everything else unchanged and partly broken or sub-optimal,
like setting a new image's color profile too late.
app:
- add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as
replacement for all "linear" booleans.
- change gimp-babl functions to take babl spaces and GimpTRCType
parameters and support all sorts of new perceptual ~ formats.
- a lot of places changed in the early days of goat invasion didn't
take advantage of gimp-babl utility functions and constructed
formats manually. They all needed revisiting and many now use much
simpler code calling gimp-babl API.
- change gimp_babl_format_get_color_profile() to really extract a
newly allocated color profile from the format, and add
gimp_babl_get_builtin_color_profile() which does the same as
gimp_babl_format_get_color_profile() did before. Visited all callers
to decide whether they are looking for the format's actual profile,
or for one of the builtin profiles, simplifying code that only needs
builtin profiles.
- drawables have a new get_space_api(), get_linear() is now get_trc().
- images now have a "layer space" and an API to get it,
gimp_image_get_layer_format() returns formats in that space.
- an image's layer space is created from the image's color profile,
change gimpimage-color-profile to deal with that correctly
- change many babl_format() calls to babl_format_with_space() and take
the space from passed formats or drawables
- add function gimp_layer_fix_format_space() which replaces the
layer's buffer with one that has the image's layer format, but
doesn't change pixel values
- use gimp_layer_fix_format_space() to make sure layers loaded from
XCF and created by plug-ins have the right space when added to the
image, because it's impossible to always assign the right space upon
layer creation
- "assign color profile" and "discard color profile" now require use
of gimp_layer_fix_format_space() too because the profile is now
embedded in all formats via the space. Add
gimp_image_assign_color_profile() which does all that and call it
instead of a simple gimp_image_set_color_profile(), also from the
PDB set-color-profile functions, which are essentially "assign" and
"discard" calls.
- generally, make sure a new image's color profile is set before
adding layers to it, gimp_image_set_color_profile() is more than
before considered know-what-you-are-doing API.
- take special precaution in all places that call
gimp_drawable_convert_type(), we now must pass a new_profile from
all callers that convert layers within the same image (such as
image_convert_type, image_convert_precision), because the layer's
new space can't be determined from the image's layer format during
the call.
- change all "linear" properties to "trc", in all config objects like
for levels and curves, in the histogram, in the widgets. This results
in some GUI that now has three choices instead of two.
TODO: we might want to reduce that back to two later.
- keep "linear" boolean properties around as compat if needed for file
pasring, but always convert the parsed parsed boolean to
GimpTRCType.
- TODO: the image's "enable color management" switch is currently
broken, will fix that in another commit.
2018-07-21 20:23:01 +08:00
|
|
|
FALSE, NULL);
|
Bug 791519 - Unexpected selection from channel
Storing selections and layer masks as linear grayscale, but channels
as whatever-the-layers-are caused severe problems in images with
gamma-corrected layers: when combining channels with the selection,
they would go thorugh a gamma conversion before being combined, giving
unexpected results.
This commit changes all channels to always be linear, except in 8-bit
images, where they continue to be "Y' u8", for compatibility with old
XCF files, and because linear 8-bit can't really be used in
compositing (channels can be visible too).
To fix channel -> selection combinations also for these images, add a
small hack to gimp_gegl_mask_combine_buffer() which makes sure the
to-be-combined channel's pixels are always read as-is, without any
gamma conversion. After changing channels to linear, this makes no
difference except in the 8-bit images where we need this hack.
2018-04-09 01:16:58 +08:00
|
|
|
|
|
|
|
return gimp_babl_mask_format (precision);
|
2012-04-08 04:45:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
const Babl *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_mask_format (GimpImage *image)
|
2012-04-08 04:45:25 +08:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
2012-09-28 05:50:20 +08:00
|
|
|
return gimp_babl_mask_format (gimp_image_get_precision (image));
|
2012-04-08 04:45:25 +08:00
|
|
|
}
|
|
|
|
|
2017-08-22 02:04:25 +08:00
|
|
|
GimpLayerMode
|
|
|
|
gimp_image_get_default_new_layer_mode (GimpImage *image)
|
|
|
|
{
|
|
|
|
GimpImagePrivate *private;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), GIMP_LAYER_MODE_NORMAL);
|
|
|
|
|
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
|
|
|
if (private->new_layer_mode == -1)
|
|
|
|
{
|
|
|
|
GList *layers = gimp_image_get_layer_list (image);
|
|
|
|
|
|
|
|
if (layers)
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
|
|
|
|
for (list = layers; list; list = g_list_next (list))
|
|
|
|
{
|
|
|
|
GimpLayer *layer = list->data;
|
|
|
|
GimpLayerMode mode = gimp_layer_get_mode (layer);
|
|
|
|
|
|
|
|
if (! gimp_layer_mode_is_legacy (mode))
|
|
|
|
{
|
|
|
|
/* any non-legacy layer switches the mode to non-legacy
|
|
|
|
*/
|
|
|
|
private->new_layer_mode = GIMP_LAYER_MODE_NORMAL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* only if all layers are legacy, the mode is also legacy
|
|
|
|
*/
|
|
|
|
if (! list)
|
|
|
|
private->new_layer_mode = GIMP_LAYER_MODE_NORMAL_LEGACY;
|
|
|
|
|
|
|
|
g_list_free (layers);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* empty images are never considered legacy
|
|
|
|
*/
|
|
|
|
private->new_layer_mode = GIMP_LAYER_MODE_NORMAL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return private->new_layer_mode;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_image_unset_default_new_layer_mode (GimpImage *image)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
|
|
|
|
|
|
|
GIMP_IMAGE_GET_PRIVATE (image)->new_layer_mode = -1;
|
|
|
|
}
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
gint
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_ID (GimpImage *image)
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), -1);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->ID;
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
GimpImage *
|
|
|
|
gimp_image_get_by_ID (Gimp *gimp,
|
2004-07-14 20:12:50 +08:00
|
|
|
gint image_id)
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
|
|
|
|
|
|
|
if (gimp->image_table == NULL)
|
|
|
|
return NULL;
|
|
|
|
|
2011-05-05 04:14:13 +08:00
|
|
|
return (GimpImage *) gimp_id_table_lookup (gimp->image_table, image_id);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2014-07-08 05:56:56 +08:00
|
|
|
gimp_image_set_file (GimpImage *image,
|
|
|
|
GFile *file)
|
1998-06-28 18:39:58 +08:00
|
|
|
{
|
2014-07-13 21:05:10 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2014-07-08 05:56:56 +08:00
|
|
|
g_return_if_fail (file == NULL || G_IS_FILE (file));
|
2001-08-11 22:39:19 +08:00
|
|
|
|
2014-07-13 21:05:10 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
|
|
|
if (private->file != file)
|
|
|
|
{
|
|
|
|
gimp_object_take_name (GIMP_OBJECT (image),
|
|
|
|
file ? g_file_get_uri (file) : NULL);
|
|
|
|
}
|
2001-01-14 11:55:56 +08:00
|
|
|
}
|
1998-06-28 18:39:58 +08:00
|
|
|
|
2011-01-27 01:32:17 +08:00
|
|
|
/**
|
2014-07-08 06:15:41 +08:00
|
|
|
* gimp_image_get_untitled_file:
|
2011-01-27 01:32:17 +08:00
|
|
|
*
|
2014-07-08 06:15:41 +08:00
|
|
|
* Returns: A #GFile saying "Untitled" for newly created images.
|
2011-01-27 01:32:17 +08:00
|
|
|
**/
|
2014-07-08 06:15:41 +08:00
|
|
|
GFile *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_untitled_file (GimpImage *image)
|
2011-01-27 01:32:17 +08:00
|
|
|
{
|
2014-07-08 06:15:41 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
|
|
|
if (! private->untitled_file)
|
|
|
|
private->untitled_file = g_file_new_for_uri (_("Untitled"));
|
|
|
|
|
|
|
|
return private->untitled_file;
|
2011-01-27 01:32:17 +08:00
|
|
|
}
|
|
|
|
|
2011-01-26 14:55:14 +08:00
|
|
|
/**
|
2014-07-08 06:15:41 +08:00
|
|
|
* gimp_image_get_file_or_untitled:
|
2011-01-26 14:55:14 +08:00
|
|
|
* @image: A #GimpImage.
|
|
|
|
*
|
2014-07-08 06:15:41 +08:00
|
|
|
* Get the file of the XCF image, or the "Untitled" file if there is no file.
|
2011-01-26 14:55:14 +08:00
|
|
|
*
|
2014-07-08 06:15:41 +08:00
|
|
|
* Returns: A #GFile.
|
2011-01-26 14:55:14 +08:00
|
|
|
**/
|
2014-07-08 06:15:41 +08:00
|
|
|
GFile *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_file_or_untitled (GimpImage *image)
|
2002-04-14 22:38:55 +08:00
|
|
|
{
|
2014-07-08 06:15:41 +08:00
|
|
|
GFile *file;
|
2002-04-14 22:38:55 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
2002-04-14 22:38:55 +08:00
|
|
|
|
2014-07-08 06:15:41 +08:00
|
|
|
file = gimp_image_get_file (image);
|
|
|
|
|
|
|
|
if (! file)
|
|
|
|
file = gimp_image_get_untitled_file (image);
|
2002-04-14 22:38:55 +08:00
|
|
|
|
2014-07-08 06:15:41 +08:00
|
|
|
return file;
|
2002-04-14 22:38:55 +08:00
|
|
|
}
|
|
|
|
|
2011-01-26 15:19:39 +08:00
|
|
|
/**
|
2014-07-08 05:56:56 +08:00
|
|
|
* gimp_image_get_file:
|
2011-01-26 15:19:39 +08:00
|
|
|
* @image: A #GimpImage.
|
|
|
|
*
|
2014-07-08 05:56:56 +08:00
|
|
|
* Get the file of the XCF image, or NULL if there is no file.
|
2011-01-26 15:19:39 +08:00
|
|
|
*
|
2014-07-08 05:56:56 +08:00
|
|
|
* Returns: The file, or NULL.
|
2011-01-26 15:19:39 +08:00
|
|
|
**/
|
2014-07-08 05:56:56 +08:00
|
|
|
GFile *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_file (GimpImage *image)
|
2011-01-26 15:19:39 +08:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
2014-07-08 05:56:56 +08:00
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->file;
|
2011-01-26 15:19:39 +08:00
|
|
|
}
|
|
|
|
|
2011-01-27 03:45:32 +08:00
|
|
|
/**
|
2014-07-08 05:56:56 +08:00
|
|
|
* gimp_image_get_imported_file:
|
2011-01-27 03:45:32 +08:00
|
|
|
* @image: A #GimpImage.
|
|
|
|
*
|
2014-07-08 05:56:56 +08:00
|
|
|
* Returns: The file of the imported image, or NULL if the image has
|
2011-01-27 03:45:32 +08:00
|
|
|
* been saved as XCF after it was imported.
|
|
|
|
**/
|
2014-07-08 05:56:56 +08:00
|
|
|
GFile *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_imported_file (GimpImage *image)
|
2011-01-27 03:45:32 +08:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
2014-07-08 05:56:56 +08:00
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->imported_file;
|
2011-01-27 03:45:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-07-08 05:56:56 +08:00
|
|
|
* gimp_image_get_exported_file:
|
2011-01-27 03:45:32 +08:00
|
|
|
* @image: A #GimpImage.
|
|
|
|
*
|
2014-07-08 05:56:56 +08:00
|
|
|
* Returns: The file of the image last exported from this XCF file, or
|
2011-01-27 03:45:32 +08:00
|
|
|
* NULL if the image has never been exported.
|
|
|
|
**/
|
2014-07-08 05:56:56 +08:00
|
|
|
GFile *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_exported_file (GimpImage *image)
|
2011-01-27 03:45:32 +08:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
2014-07-08 05:56:56 +08:00
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->exported_file;
|
2011-01-27 03:45:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-07-08 05:56:56 +08:00
|
|
|
* gimp_image_get_save_a_copy_file:
|
2011-01-27 03:45:32 +08:00
|
|
|
* @image: A #GimpImage.
|
|
|
|
*
|
|
|
|
* Returns: The URI of the last copy that was saved of this XCF file.
|
|
|
|
**/
|
2014-07-08 05:56:56 +08:00
|
|
|
GFile *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_save_a_copy_file (GimpImage *image)
|
2011-01-27 03:45:32 +08:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
2014-07-08 05:56:56 +08:00
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->save_a_copy_file;
|
2011-01-27 03:45:32 +08:00
|
|
|
}
|
|
|
|
|
2011-08-13 03:15:16 +08:00
|
|
|
/**
|
2014-07-08 05:56:56 +08:00
|
|
|
* gimp_image_get_any_file:
|
2011-08-13 03:15:16 +08:00
|
|
|
* @image: A #GimpImage.
|
|
|
|
*
|
2014-07-08 05:56:56 +08:00
|
|
|
* Returns: The XCF file, the imported file, or the exported file, in
|
|
|
|
* that order of precedence.
|
2011-08-13 03:15:16 +08:00
|
|
|
**/
|
2014-07-08 05:56:56 +08:00
|
|
|
GFile *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_any_file (GimpImage *image)
|
2011-08-13 03:15:16 +08:00
|
|
|
{
|
2014-07-08 05:56:56 +08:00
|
|
|
GFile *file;
|
2011-08-13 03:15:16 +08:00
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
2014-07-08 05:56:56 +08:00
|
|
|
file = gimp_image_get_file (image);
|
|
|
|
if (! file)
|
2011-08-13 03:15:16 +08:00
|
|
|
{
|
2014-07-08 05:56:56 +08:00
|
|
|
file = gimp_image_get_imported_file (image);
|
|
|
|
if (! file)
|
2011-08-13 03:15:16 +08:00
|
|
|
{
|
2014-07-08 05:56:56 +08:00
|
|
|
file = gimp_image_get_exported_file (image);
|
2011-08-13 03:15:16 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-07-08 05:56:56 +08:00
|
|
|
return file;
|
2011-08-13 03:15:16 +08:00
|
|
|
}
|
|
|
|
|
2011-01-27 03:45:32 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_set_imported_uri:
|
|
|
|
* @image: A #GimpImage.
|
2014-07-08 05:56:56 +08:00
|
|
|
* @file:
|
2011-01-27 03:45:32 +08:00
|
|
|
*
|
|
|
|
* Sets the URI this file was imported from.
|
|
|
|
**/
|
|
|
|
void
|
2014-07-08 05:56:56 +08:00
|
|
|
gimp_image_set_imported_file (GimpImage *image,
|
|
|
|
GFile *file)
|
2011-01-27 03:45:32 +08:00
|
|
|
{
|
2014-07-08 05:56:56 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
|
2011-01-27 03:45:32 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2014-07-08 05:56:56 +08:00
|
|
|
g_return_if_fail (file == NULL || G_IS_FILE (file));
|
2011-01-27 03:45:32 +08:00
|
|
|
|
2014-07-08 05:56:56 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
2011-03-18 03:23:09 +08:00
|
|
|
|
2018-06-01 18:59:52 +08:00
|
|
|
if (g_set_object (&private->imported_file, file))
|
2014-07-08 05:56:56 +08:00
|
|
|
{
|
|
|
|
gimp_object_name_changed (GIMP_OBJECT (image));
|
|
|
|
}
|
2011-01-27 03:45:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-07-08 05:56:56 +08:00
|
|
|
* gimp_image_set_exported_file:
|
2011-01-27 03:45:32 +08:00
|
|
|
* @image: A #GimpImage.
|
2014-07-08 05:56:56 +08:00
|
|
|
* @file:
|
2011-01-27 03:45:32 +08:00
|
|
|
*
|
2014-07-08 05:56:56 +08:00
|
|
|
* Sets the file this image was last exported to. Note that saving as
|
2011-01-27 03:45:32 +08:00
|
|
|
* XCF is not "exporting".
|
|
|
|
**/
|
|
|
|
void
|
2014-07-08 05:56:56 +08:00
|
|
|
gimp_image_set_exported_file (GimpImage *image,
|
|
|
|
GFile *file)
|
2011-01-27 03:45:32 +08:00
|
|
|
{
|
2014-07-08 05:56:56 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
|
2011-01-27 03:45:32 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2014-07-08 05:56:56 +08:00
|
|
|
g_return_if_fail (file == NULL || G_IS_FILE (file));
|
2011-01-27 03:45:32 +08:00
|
|
|
|
2014-07-08 05:56:56 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
2018-06-01 18:59:52 +08:00
|
|
|
if (g_set_object (&private->exported_file, file))
|
2014-07-08 05:56:56 +08:00
|
|
|
{
|
|
|
|
gimp_object_name_changed (GIMP_OBJECT (image));
|
|
|
|
}
|
2011-01-27 03:45:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-07-08 05:56:56 +08:00
|
|
|
* gimp_image_set_save_a_copy_file:
|
2011-01-27 03:45:32 +08:00
|
|
|
* @image: A #GimpImage.
|
|
|
|
* @uri:
|
|
|
|
*
|
|
|
|
* Set the URI to the last copy this XCF file was saved to through the
|
|
|
|
* "save a copy" action.
|
|
|
|
**/
|
|
|
|
void
|
2014-07-08 05:56:56 +08:00
|
|
|
gimp_image_set_save_a_copy_file (GimpImage *image,
|
|
|
|
GFile *file)
|
2011-01-27 03:45:32 +08:00
|
|
|
{
|
2014-07-08 05:56:56 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
|
2011-01-27 03:45:32 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2014-07-08 05:56:56 +08:00
|
|
|
g_return_if_fail (file == NULL || G_IS_FILE (file));
|
2011-01-27 03:45:32 +08:00
|
|
|
|
2014-07-08 05:56:56 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
2018-06-01 18:59:52 +08:00
|
|
|
g_set_object (&private->save_a_copy_file, file);
|
2011-01-27 03:45:32 +08:00
|
|
|
}
|
|
|
|
|
2012-07-18 04:52:49 +08:00
|
|
|
static gchar *
|
|
|
|
gimp_image_format_display_uri (GimpImage *image,
|
|
|
|
gboolean basename)
|
|
|
|
{
|
|
|
|
const gchar *uri_format = NULL;
|
|
|
|
const gchar *export_status = NULL;
|
2014-07-08 05:56:56 +08:00
|
|
|
GFile *file = NULL;
|
|
|
|
GFile *source = NULL;
|
|
|
|
GFile *dest = NULL;
|
|
|
|
GFile *display_file = NULL;
|
2012-07-18 04:52:49 +08:00
|
|
|
gboolean is_imported;
|
|
|
|
gboolean is_exported;
|
|
|
|
gchar *display_uri = NULL;
|
|
|
|
gchar *format_string;
|
2012-09-21 16:34:17 +08:00
|
|
|
gchar *tmp;
|
2012-07-18 04:52:49 +08:00
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
2014-07-08 05:56:56 +08:00
|
|
|
file = gimp_image_get_file (image);
|
|
|
|
source = gimp_image_get_imported_file (image);
|
|
|
|
dest = gimp_image_get_exported_file (image);
|
2012-07-18 04:52:49 +08:00
|
|
|
|
|
|
|
is_imported = (source != NULL);
|
|
|
|
is_exported = (dest != NULL);
|
|
|
|
|
2014-07-08 05:56:56 +08:00
|
|
|
if (file)
|
2012-07-18 04:52:49 +08:00
|
|
|
{
|
2014-10-07 21:22:49 +08:00
|
|
|
display_file = g_object_ref (file);
|
2014-07-08 05:56:56 +08:00
|
|
|
uri_format = "%s";
|
2012-07-18 04:52:49 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (is_imported)
|
2014-07-08 05:56:56 +08:00
|
|
|
display_file = source;
|
2012-07-18 04:52:49 +08:00
|
|
|
|
|
|
|
/* Calculate filename suffix */
|
|
|
|
if (! gimp_image_is_export_dirty (image))
|
|
|
|
{
|
|
|
|
if (is_exported)
|
|
|
|
{
|
2014-07-08 05:56:56 +08:00
|
|
|
display_file = dest;
|
2012-07-18 04:52:49 +08:00
|
|
|
export_status = _(" (exported)");
|
|
|
|
}
|
|
|
|
else if (is_imported)
|
|
|
|
{
|
|
|
|
export_status = _(" (overwritten)");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_warning ("Unexpected code path, Save+export implementation is buggy!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (is_imported)
|
|
|
|
{
|
|
|
|
export_status = _(" (imported)");
|
|
|
|
}
|
|
|
|
|
2014-07-08 05:56:56 +08:00
|
|
|
if (display_file)
|
2016-01-04 03:05:27 +08:00
|
|
|
display_file = gimp_file_with_new_extension (display_file, NULL);
|
2012-07-18 04:52:49 +08:00
|
|
|
|
|
|
|
uri_format = "[%s]";
|
|
|
|
}
|
|
|
|
|
2014-07-08 05:56:56 +08:00
|
|
|
if (! display_file)
|
2014-10-07 21:22:49 +08:00
|
|
|
display_file = g_object_ref (gimp_image_get_untitled_file (image));
|
2014-07-08 05:56:56 +08:00
|
|
|
|
|
|
|
if (basename)
|
|
|
|
display_uri = g_path_get_basename (gimp_file_get_utf8_name (display_file));
|
2012-07-18 04:52:49 +08:00
|
|
|
else
|
2014-07-08 05:56:56 +08:00
|
|
|
display_uri = g_strdup (gimp_file_get_utf8_name (display_file));
|
|
|
|
|
2014-10-07 21:22:49 +08:00
|
|
|
g_object_unref (display_file);
|
|
|
|
|
2012-07-18 04:52:49 +08:00
|
|
|
format_string = g_strconcat (uri_format, export_status, NULL);
|
2012-09-21 16:34:17 +08:00
|
|
|
|
|
|
|
tmp = g_strdup_printf (format_string, display_uri);
|
|
|
|
g_free (display_uri);
|
|
|
|
display_uri = tmp;
|
|
|
|
|
2012-07-18 04:52:49 +08:00
|
|
|
g_free (format_string);
|
|
|
|
|
|
|
|
return display_uri;
|
|
|
|
}
|
|
|
|
|
2008-11-13 20:09:05 +08:00
|
|
|
const gchar *
|
|
|
|
gimp_image_get_display_name (GimpImage *image)
|
|
|
|
{
|
2010-02-04 03:31:25 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
|
2008-11-13 20:09:05 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
|
|
|
if (! private->display_name)
|
2012-07-18 04:52:49 +08:00
|
|
|
private->display_name = gimp_image_format_display_uri (image, TRUE);
|
2008-11-13 20:09:05 +08:00
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
return private->display_name;
|
2008-11-13 20:09:05 +08:00
|
|
|
}
|
|
|
|
|
2012-07-18 04:52:49 +08:00
|
|
|
const gchar *
|
|
|
|
gimp_image_get_display_path (GimpImage *image)
|
|
|
|
{
|
|
|
|
GimpImagePrivate *private;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
|
|
|
if (! private->display_path)
|
|
|
|
private->display_path = gimp_image_format_display_uri (image, FALSE);
|
|
|
|
|
|
|
|
return private->display_path;
|
|
|
|
}
|
|
|
|
|
2007-09-21 05:23:05 +08:00
|
|
|
void
|
|
|
|
gimp_image_set_load_proc (GimpImage *image,
|
|
|
|
GimpPlugInProcedure *proc)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
GIMP_IMAGE_GET_PRIVATE (image)->load_proc = proc;
|
2007-09-21 05:23:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
GimpPlugInProcedure *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_load_proc (GimpImage *image)
|
2007-09-21 05:23:05 +08:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->load_proc;
|
2007-09-21 05:23:05 +08:00
|
|
|
}
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
void
|
2006-04-05 16:38:33 +08:00
|
|
|
gimp_image_set_save_proc (GimpImage *image,
|
|
|
|
GimpPlugInProcedure *proc)
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
GIMP_IMAGE_GET_PRIVATE (image)->save_proc = proc;
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
|
|
|
|
2006-04-05 16:38:33 +08:00
|
|
|
GimpPlugInProcedure *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_save_proc (GimpImage *image)
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->save_proc;
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
|
|
|
|
2014-07-02 20:24:02 +08:00
|
|
|
void
|
|
|
|
gimp_image_set_export_proc (GimpImage *image,
|
|
|
|
GimpPlugInProcedure *proc)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
|
|
|
|
|
|
|
GIMP_IMAGE_GET_PRIVATE (image)->export_proc = proc;
|
|
|
|
}
|
|
|
|
|
|
|
|
GimpPlugInProcedure *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_export_proc (GimpImage *image)
|
2014-07-02 20:24:02 +08:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->export_proc;
|
|
|
|
}
|
|
|
|
|
2014-09-28 02:38:43 +08:00
|
|
|
gint
|
|
|
|
gimp_image_get_xcf_version (GimpImage *image,
|
|
|
|
gboolean zlib_compression,
|
|
|
|
gint *gimp_version,
|
2018-06-07 05:08:33 +08:00
|
|
|
const gchar **version_string,
|
|
|
|
gchar **version_reason)
|
|
|
|
{
|
|
|
|
GList *layers;
|
|
|
|
GList *list;
|
|
|
|
GList *reasons = NULL;
|
|
|
|
gint version = 0; /* default to oldest */
|
|
|
|
const gchar *enum_desc;
|
|
|
|
|
|
|
|
#define ADD_REASON(_reason) \
|
|
|
|
if (version_reason) { \
|
|
|
|
gchar *tmp = _reason; \
|
|
|
|
if (g_list_find_custom (reasons, tmp, (GCompareFunc) strcmp)) \
|
|
|
|
g_free (tmp); \
|
|
|
|
else \
|
2018-08-04 18:54:07 +08:00
|
|
|
reasons = g_list_prepend (reasons, tmp); }
|
2014-09-28 02:38:43 +08:00
|
|
|
|
|
|
|
/* need version 1 for colormaps */
|
|
|
|
if (gimp_image_get_colormap (image))
|
|
|
|
version = 1;
|
|
|
|
|
2015-10-29 15:16:44 +08:00
|
|
|
layers = gimp_image_get_layer_list (image);
|
|
|
|
|
|
|
|
for (list = layers; list; list = g_list_next (list))
|
2014-09-28 02:38:43 +08:00
|
|
|
{
|
|
|
|
GimpLayer *layer = GIMP_LAYER (list->data);
|
|
|
|
|
|
|
|
switch (gimp_layer_get_mode (layer))
|
|
|
|
{
|
2017-02-21 01:31:21 +08:00
|
|
|
/* Modes that exist since ancient times */
|
2017-02-26 23:26:34 +08:00
|
|
|
case GIMP_LAYER_MODE_NORMAL_LEGACY:
|
2017-02-21 01:31:21 +08:00
|
|
|
case GIMP_LAYER_MODE_DISSOLVE:
|
|
|
|
case GIMP_LAYER_MODE_BEHIND_LEGACY:
|
|
|
|
case GIMP_LAYER_MODE_MULTIPLY_LEGACY:
|
|
|
|
case GIMP_LAYER_MODE_SCREEN_LEGACY:
|
|
|
|
case GIMP_LAYER_MODE_OVERLAY_LEGACY:
|
|
|
|
case GIMP_LAYER_MODE_DIFFERENCE_LEGACY:
|
|
|
|
case GIMP_LAYER_MODE_ADDITION_LEGACY:
|
|
|
|
case GIMP_LAYER_MODE_SUBTRACT_LEGACY:
|
|
|
|
case GIMP_LAYER_MODE_DARKEN_ONLY_LEGACY:
|
|
|
|
case GIMP_LAYER_MODE_LIGHTEN_ONLY_LEGACY:
|
|
|
|
case GIMP_LAYER_MODE_HSV_HUE_LEGACY:
|
|
|
|
case GIMP_LAYER_MODE_HSV_SATURATION_LEGACY:
|
2017-03-16 18:17:05 +08:00
|
|
|
case GIMP_LAYER_MODE_HSL_COLOR_LEGACY:
|
2017-02-21 01:31:21 +08:00
|
|
|
case GIMP_LAYER_MODE_HSV_VALUE_LEGACY:
|
|
|
|
case GIMP_LAYER_MODE_DIVIDE_LEGACY:
|
|
|
|
case GIMP_LAYER_MODE_DODGE_LEGACY:
|
|
|
|
case GIMP_LAYER_MODE_BURN_LEGACY:
|
|
|
|
case GIMP_LAYER_MODE_HARDLIGHT_LEGACY:
|
|
|
|
break;
|
|
|
|
|
2018-06-07 05:08:33 +08:00
|
|
|
/* Since 2.6 */
|
2017-01-09 08:27:20 +08:00
|
|
|
case GIMP_LAYER_MODE_SOFTLIGHT_LEGACY:
|
|
|
|
case GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY:
|
|
|
|
case GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY:
|
2017-03-09 02:06:46 +08:00
|
|
|
case GIMP_LAYER_MODE_COLOR_ERASE_LEGACY:
|
2018-06-07 05:08:33 +08:00
|
|
|
gimp_enum_get_value (GIMP_TYPE_LAYER_MODE,
|
|
|
|
gimp_layer_get_mode (layer),
|
|
|
|
NULL, NULL, &enum_desc, NULL);
|
|
|
|
ADD_REASON (g_strdup_printf (_("Layer mode '%s' was added in %s"),
|
|
|
|
enum_desc, "GIMP 2.6"));
|
2014-09-28 02:38:43 +08:00
|
|
|
version = MAX (2, version);
|
|
|
|
break;
|
|
|
|
|
2017-02-21 01:31:21 +08:00
|
|
|
/* Since 2.10 */
|
2017-01-09 06:00:19 +08:00
|
|
|
case GIMP_LAYER_MODE_OVERLAY:
|
|
|
|
case GIMP_LAYER_MODE_LCH_HUE:
|
|
|
|
case GIMP_LAYER_MODE_LCH_CHROMA:
|
|
|
|
case GIMP_LAYER_MODE_LCH_COLOR:
|
|
|
|
case GIMP_LAYER_MODE_LCH_LIGHTNESS:
|
2018-06-07 05:08:33 +08:00
|
|
|
gimp_enum_get_value (GIMP_TYPE_LAYER_MODE,
|
|
|
|
gimp_layer_get_mode (layer),
|
|
|
|
NULL, NULL, &enum_desc, NULL);
|
|
|
|
ADD_REASON (g_strdup_printf (_("Layer mode '%s' was added in %s"),
|
|
|
|
enum_desc, "GIMP 2.10"));
|
2015-04-28 05:48:00 +08:00
|
|
|
version = MAX (9, version);
|
|
|
|
break;
|
|
|
|
|
2017-02-21 01:31:21 +08:00
|
|
|
/* Since 2.10 */
|
2017-02-26 23:26:34 +08:00
|
|
|
case GIMP_LAYER_MODE_NORMAL:
|
2017-02-21 01:31:21 +08:00
|
|
|
case GIMP_LAYER_MODE_BEHIND:
|
|
|
|
case GIMP_LAYER_MODE_MULTIPLY:
|
|
|
|
case GIMP_LAYER_MODE_SCREEN:
|
|
|
|
case GIMP_LAYER_MODE_DIFFERENCE:
|
|
|
|
case GIMP_LAYER_MODE_ADDITION:
|
|
|
|
case GIMP_LAYER_MODE_SUBTRACT:
|
|
|
|
case GIMP_LAYER_MODE_DARKEN_ONLY:
|
|
|
|
case GIMP_LAYER_MODE_LIGHTEN_ONLY:
|
|
|
|
case GIMP_LAYER_MODE_HSV_HUE:
|
|
|
|
case GIMP_LAYER_MODE_HSV_SATURATION:
|
2017-03-16 07:30:01 +08:00
|
|
|
case GIMP_LAYER_MODE_HSL_COLOR:
|
2017-02-21 01:31:21 +08:00
|
|
|
case GIMP_LAYER_MODE_HSV_VALUE:
|
|
|
|
case GIMP_LAYER_MODE_DIVIDE:
|
|
|
|
case GIMP_LAYER_MODE_DODGE:
|
|
|
|
case GIMP_LAYER_MODE_BURN:
|
|
|
|
case GIMP_LAYER_MODE_HARDLIGHT:
|
|
|
|
case GIMP_LAYER_MODE_SOFTLIGHT:
|
|
|
|
case GIMP_LAYER_MODE_GRAIN_EXTRACT:
|
|
|
|
case GIMP_LAYER_MODE_GRAIN_MERGE:
|
|
|
|
case GIMP_LAYER_MODE_VIVID_LIGHT:
|
|
|
|
case GIMP_LAYER_MODE_PIN_LIGHT:
|
|
|
|
case GIMP_LAYER_MODE_LINEAR_LIGHT:
|
|
|
|
case GIMP_LAYER_MODE_HARD_MIX:
|
|
|
|
case GIMP_LAYER_MODE_EXCLUSION:
|
|
|
|
case GIMP_LAYER_MODE_LINEAR_BURN:
|
|
|
|
case GIMP_LAYER_MODE_LUMA_DARKEN_ONLY:
|
|
|
|
case GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY:
|
|
|
|
case GIMP_LAYER_MODE_LUMINANCE:
|
2017-03-09 02:06:46 +08:00
|
|
|
case GIMP_LAYER_MODE_COLOR_ERASE:
|
2017-03-11 03:35:46 +08:00
|
|
|
case GIMP_LAYER_MODE_ERASE:
|
2017-03-11 06:59:17 +08:00
|
|
|
case GIMP_LAYER_MODE_MERGE:
|
2017-03-11 07:28:40 +08:00
|
|
|
case GIMP_LAYER_MODE_SPLIT:
|
2017-04-22 01:38:22 +08:00
|
|
|
case GIMP_LAYER_MODE_PASS_THROUGH:
|
2018-06-07 05:08:33 +08:00
|
|
|
gimp_enum_get_value (GIMP_TYPE_LAYER_MODE,
|
|
|
|
gimp_layer_get_mode (layer),
|
|
|
|
NULL, NULL, &enum_desc, NULL);
|
|
|
|
ADD_REASON (g_strdup_printf (_("Layer mode '%s' was added in %s"),
|
|
|
|
enum_desc, "GIMP 2.10"));
|
2017-02-21 01:31:21 +08:00
|
|
|
version = MAX (10, version);
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Just here instead of default so we get compiler warnings */
|
|
|
|
case GIMP_LAYER_MODE_REPLACE:
|
|
|
|
case GIMP_LAYER_MODE_ANTI_ERASE:
|
|
|
|
case GIMP_LAYER_MODE_SEPARATOR:
|
2014-09-28 02:38:43 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* need version 3 for layer trees */
|
|
|
|
if (gimp_viewable_get_children (GIMP_VIEWABLE (layer)))
|
2018-02-06 02:54:21 +08:00
|
|
|
{
|
2018-06-07 05:08:33 +08:00
|
|
|
ADD_REASON (g_strdup_printf (_("Layer groups were added in %s"),
|
|
|
|
"GIMP 2.8"));
|
2018-02-06 02:54:21 +08:00
|
|
|
version = MAX (3, version);
|
|
|
|
|
|
|
|
/* need version 13 for group layers with masks */
|
|
|
|
if (gimp_layer_get_mask (layer))
|
2018-06-07 05:08:33 +08:00
|
|
|
{
|
|
|
|
ADD_REASON (g_strdup_printf (_("Masks on layer groups were "
|
|
|
|
"added in %s"), "GIMP 2.10"));
|
|
|
|
version = MAX (13, version);
|
|
|
|
}
|
2018-02-06 02:54:21 +08:00
|
|
|
}
|
2014-09-28 02:38:43 +08:00
|
|
|
}
|
|
|
|
|
2015-10-29 15:16:44 +08:00
|
|
|
g_list_free (layers);
|
|
|
|
|
2015-12-09 03:50:34 +08:00
|
|
|
/* version 6 for new metadata has been dropped since they are
|
|
|
|
* saved through parasites, which is compatible with older versions.
|
|
|
|
*/
|
2014-09-28 02:38:43 +08:00
|
|
|
|
2017-10-01 23:28:20 +08:00
|
|
|
/* need version 7 for != 8-bit gamma images */
|
Initial space invasion commit in GIMP
All babl formats now have a space equivalent to a color profile,
determining the format's primaries and TRCs. This commit makes GIMP
aware of this.
libgimp:
- enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA
as deprecated aliases, add PERCEPTUAL values so we now have LINEAR,
NON_LINEAR and PERCPTUAL for each encoding, matching the babl
encoding variants RGB, R'G'B' and R~G~B~.
- gimp_color_transform_can_gegl_copy() now returns TRUE if both
profiles can return a babl space, increasing the amount of fast babl
color conversions significantly.
- TODO: no solution yet for getting libgimp drawable proxy buffers in
the right format with space.
plug-ins:
- follow the GimpPrecision change.
- TODO: everything else unchanged and partly broken or sub-optimal,
like setting a new image's color profile too late.
app:
- add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as
replacement for all "linear" booleans.
- change gimp-babl functions to take babl spaces and GimpTRCType
parameters and support all sorts of new perceptual ~ formats.
- a lot of places changed in the early days of goat invasion didn't
take advantage of gimp-babl utility functions and constructed
formats manually. They all needed revisiting and many now use much
simpler code calling gimp-babl API.
- change gimp_babl_format_get_color_profile() to really extract a
newly allocated color profile from the format, and add
gimp_babl_get_builtin_color_profile() which does the same as
gimp_babl_format_get_color_profile() did before. Visited all callers
to decide whether they are looking for the format's actual profile,
or for one of the builtin profiles, simplifying code that only needs
builtin profiles.
- drawables have a new get_space_api(), get_linear() is now get_trc().
- images now have a "layer space" and an API to get it,
gimp_image_get_layer_format() returns formats in that space.
- an image's layer space is created from the image's color profile,
change gimpimage-color-profile to deal with that correctly
- change many babl_format() calls to babl_format_with_space() and take
the space from passed formats or drawables
- add function gimp_layer_fix_format_space() which replaces the
layer's buffer with one that has the image's layer format, but
doesn't change pixel values
- use gimp_layer_fix_format_space() to make sure layers loaded from
XCF and created by plug-ins have the right space when added to the
image, because it's impossible to always assign the right space upon
layer creation
- "assign color profile" and "discard color profile" now require use
of gimp_layer_fix_format_space() too because the profile is now
embedded in all formats via the space. Add
gimp_image_assign_color_profile() which does all that and call it
instead of a simple gimp_image_set_color_profile(), also from the
PDB set-color-profile functions, which are essentially "assign" and
"discard" calls.
- generally, make sure a new image's color profile is set before
adding layers to it, gimp_image_set_color_profile() is more than
before considered know-what-you-are-doing API.
- take special precaution in all places that call
gimp_drawable_convert_type(), we now must pass a new_profile from
all callers that convert layers within the same image (such as
image_convert_type, image_convert_precision), because the layer's
new space can't be determined from the image's layer format during
the call.
- change all "linear" properties to "trc", in all config objects like
for levels and curves, in the histogram, in the widgets. This results
in some GUI that now has three choices instead of two.
TODO: we might want to reduce that back to two later.
- keep "linear" boolean properties around as compat if needed for file
pasring, but always convert the parsed parsed boolean to
GimpTRCType.
- TODO: the image's "enable color management" switch is currently
broken, will fix that in another commit.
2018-07-21 20:23:01 +08:00
|
|
|
if (gimp_image_get_precision (image) != GIMP_PRECISION_U8_NON_LINEAR)
|
2018-06-07 05:08:33 +08:00
|
|
|
{
|
|
|
|
ADD_REASON (g_strdup_printf (_("High bit-depth images were added "
|
|
|
|
"in %s"), "GIMP 2.10"));
|
|
|
|
version = MAX (7, version);
|
|
|
|
}
|
2014-09-28 02:38:43 +08:00
|
|
|
|
2017-10-01 23:28:20 +08:00
|
|
|
/* need version 12 for > 8-bit images for proper endian swapping */
|
Initial space invasion commit in GIMP
All babl formats now have a space equivalent to a color profile,
determining the format's primaries and TRCs. This commit makes GIMP
aware of this.
libgimp:
- enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA
as deprecated aliases, add PERCEPTUAL values so we now have LINEAR,
NON_LINEAR and PERCPTUAL for each encoding, matching the babl
encoding variants RGB, R'G'B' and R~G~B~.
- gimp_color_transform_can_gegl_copy() now returns TRUE if both
profiles can return a babl space, increasing the amount of fast babl
color conversions significantly.
- TODO: no solution yet for getting libgimp drawable proxy buffers in
the right format with space.
plug-ins:
- follow the GimpPrecision change.
- TODO: everything else unchanged and partly broken or sub-optimal,
like setting a new image's color profile too late.
app:
- add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as
replacement for all "linear" booleans.
- change gimp-babl functions to take babl spaces and GimpTRCType
parameters and support all sorts of new perceptual ~ formats.
- a lot of places changed in the early days of goat invasion didn't
take advantage of gimp-babl utility functions and constructed
formats manually. They all needed revisiting and many now use much
simpler code calling gimp-babl API.
- change gimp_babl_format_get_color_profile() to really extract a
newly allocated color profile from the format, and add
gimp_babl_get_builtin_color_profile() which does the same as
gimp_babl_format_get_color_profile() did before. Visited all callers
to decide whether they are looking for the format's actual profile,
or for one of the builtin profiles, simplifying code that only needs
builtin profiles.
- drawables have a new get_space_api(), get_linear() is now get_trc().
- images now have a "layer space" and an API to get it,
gimp_image_get_layer_format() returns formats in that space.
- an image's layer space is created from the image's color profile,
change gimpimage-color-profile to deal with that correctly
- change many babl_format() calls to babl_format_with_space() and take
the space from passed formats or drawables
- add function gimp_layer_fix_format_space() which replaces the
layer's buffer with one that has the image's layer format, but
doesn't change pixel values
- use gimp_layer_fix_format_space() to make sure layers loaded from
XCF and created by plug-ins have the right space when added to the
image, because it's impossible to always assign the right space upon
layer creation
- "assign color profile" and "discard color profile" now require use
of gimp_layer_fix_format_space() too because the profile is now
embedded in all formats via the space. Add
gimp_image_assign_color_profile() which does all that and call it
instead of a simple gimp_image_set_color_profile(), also from the
PDB set-color-profile functions, which are essentially "assign" and
"discard" calls.
- generally, make sure a new image's color profile is set before
adding layers to it, gimp_image_set_color_profile() is more than
before considered know-what-you-are-doing API.
- take special precaution in all places that call
gimp_drawable_convert_type(), we now must pass a new_profile from
all callers that convert layers within the same image (such as
image_convert_type, image_convert_precision), because the layer's
new space can't be determined from the image's layer format during
the call.
- change all "linear" properties to "trc", in all config objects like
for levels and curves, in the histogram, in the widgets. This results
in some GUI that now has three choices instead of two.
TODO: we might want to reduce that back to two later.
- keep "linear" boolean properties around as compat if needed for file
pasring, but always convert the parsed parsed boolean to
GimpTRCType.
- TODO: the image's "enable color management" switch is currently
broken, will fix that in another commit.
2018-07-21 20:23:01 +08:00
|
|
|
if (gimp_image_get_component_type (image) > GIMP_COMPONENT_TYPE_U8)
|
|
|
|
{
|
|
|
|
ADD_REASON (g_strdup_printf (_("Encoding of high bit-depth images was "
|
|
|
|
"fixed in %s"), "GIMP 2.10"));
|
|
|
|
version = MAX (12, version);
|
|
|
|
}
|
2017-10-01 23:28:20 +08:00
|
|
|
|
2014-09-28 02:38:43 +08:00
|
|
|
/* need version 8 for zlib compression */
|
|
|
|
if (zlib_compression)
|
2018-09-11 00:53:50 +08:00
|
|
|
{
|
|
|
|
ADD_REASON (g_strdup_printf (_("Internal zlib compression was "
|
|
|
|
"added in %s"), "GIMP 2.10"));
|
|
|
|
version = MAX (8, version);
|
|
|
|
}
|
2014-09-28 02:38:43 +08:00
|
|
|
|
2017-03-23 21:17:56 +08:00
|
|
|
/* if version is 10 (lots of new layer modes), go to version 11 with
|
|
|
|
* 64 bit offsets right away
|
|
|
|
*/
|
|
|
|
if (version == 10)
|
|
|
|
version = 11;
|
|
|
|
|
|
|
|
/* use the image's in-memory size as an upper bound to estimate the
|
|
|
|
* need for 64 bit file offsets inside the XCF, this is a *very*
|
|
|
|
* conservative estimate and should never fail
|
|
|
|
*/
|
|
|
|
if (gimp_object_get_memsize (GIMP_OBJECT (image), NULL) >= ((gint64) 1 << 32))
|
2018-06-07 05:08:33 +08:00
|
|
|
{
|
|
|
|
ADD_REASON (g_strdup_printf (_("Support for image files larger than "
|
|
|
|
"4GB was added in %s"), "GIMP 2.10"));
|
|
|
|
version = MAX (11, version);
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef ADD_REASON
|
2017-03-23 21:17:56 +08:00
|
|
|
|
2014-09-28 02:38:43 +08:00
|
|
|
switch (version)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
case 1:
|
|
|
|
case 2:
|
|
|
|
if (gimp_version) *gimp_version = 206;
|
|
|
|
if (version_string) *version_string = "GIMP 2.6";
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 3:
|
|
|
|
if (gimp_version) *gimp_version = 208;
|
|
|
|
if (version_string) *version_string = "GIMP 2.8";
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 4:
|
|
|
|
case 5:
|
|
|
|
case 6:
|
|
|
|
case 7:
|
|
|
|
case 8:
|
2015-04-28 05:48:00 +08:00
|
|
|
case 9:
|
2017-02-21 01:31:21 +08:00
|
|
|
case 10:
|
2017-03-23 21:17:56 +08:00
|
|
|
case 11:
|
2017-10-01 23:28:20 +08:00
|
|
|
case 12:
|
2018-02-06 02:54:21 +08:00
|
|
|
case 13:
|
2014-09-28 02:38:43 +08:00
|
|
|
if (gimp_version) *gimp_version = 210;
|
|
|
|
if (version_string) *version_string = "GIMP 2.10";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2018-06-07 05:08:33 +08:00
|
|
|
if (version_reason && reasons)
|
|
|
|
{
|
|
|
|
GString *reason = g_string_new (NULL);
|
|
|
|
|
|
|
|
reasons = g_list_sort (reasons, (GCompareFunc) strcmp);
|
|
|
|
|
|
|
|
for (list = reasons; list; list = g_list_next (list))
|
|
|
|
{
|
|
|
|
g_string_append (reason, list->data);
|
|
|
|
if (g_list_next (list))
|
|
|
|
g_string_append_c (reason, '\n');
|
|
|
|
}
|
|
|
|
|
|
|
|
*version_reason = g_string_free (reason, FALSE);
|
|
|
|
}
|
2018-08-04 15:34:05 +08:00
|
|
|
if (reasons)
|
|
|
|
g_list_free_full (reasons, g_free);
|
2018-06-07 05:08:33 +08:00
|
|
|
|
2014-09-28 02:38:43 +08:00
|
|
|
return version;
|
|
|
|
}
|
|
|
|
|
2014-10-04 08:26:36 +08:00
|
|
|
void
|
2017-03-24 01:03:27 +08:00
|
|
|
gimp_image_set_xcf_compression (GimpImage *image,
|
|
|
|
gboolean compression)
|
2014-10-04 08:26:36 +08:00
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
|
|
|
|
2017-03-24 01:03:27 +08:00
|
|
|
GIMP_IMAGE_GET_PRIVATE (image)->xcf_compression = compression;
|
2014-10-04 08:26:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
2017-03-24 01:03:27 +08:00
|
|
|
gimp_image_get_xcf_compression (GimpImage *image)
|
2014-10-04 08:26:36 +08:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
|
|
|
|
2017-03-24 01:03:27 +08:00
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->xcf_compression;
|
2014-10-04 08:26:36 +08:00
|
|
|
}
|
|
|
|
|
1998-10-05 18:05:29 +08:00
|
|
|
void
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_set_resolution (GimpImage *image,
|
2004-07-14 20:12:50 +08:00
|
|
|
gdouble xresolution,
|
|
|
|
gdouble yresolution)
|
1998-10-05 18:05:29 +08:00
|
|
|
{
|
2010-02-04 03:31:25 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2001-08-11 22:39:19 +08:00
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
2000-01-08 20:42:53 +08:00
|
|
|
/* don't allow to set the resolution out of bounds */
|
|
|
|
if (xresolution < GIMP_MIN_RESOLUTION || xresolution > GIMP_MAX_RESOLUTION ||
|
|
|
|
yresolution < GIMP_MIN_RESOLUTION || yresolution > GIMP_MAX_RESOLUTION)
|
2000-01-08 18:55:05 +08:00
|
|
|
return;
|
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
if ((ABS (private->xresolution - xresolution) >= 1e-5) ||
|
|
|
|
(ABS (private->yresolution - yresolution) >= 1e-5))
|
2001-11-01 05:18:57 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_undo_push_image_resolution (image,
|
2010-06-08 19:24:11 +08:00
|
|
|
C_("undo-type", "Change Image Resolution"));
|
comment typo fix, plus add %D* to default image-title-format string, so
Fri Oct 1 12:46:12 1999 Austin Donnelly <austin@gimp.org>
* gimprc.in: comment typo fix, plus add %D* to default
image-title-format string, so people get a '*' in the titlebar
if their image is dirty.
* app/fileops.c: initialise filename before using it.
* app/gdisplay.c: empty parameter list () is K&R - should be
stronger (void) in ANSI C.
* app/gimpdrawable.c: gimp_drawable_{dirty,clean} functions
removed - no one uses them anyway. Parasite undo type is
proper parasite undo type, not MISC_UNDO.
* app/gimpdrawableP.h: drawable dirty bit removed.
* app/gimpimage.c: don't change the resolution if there's no
difference from the old one. Call gdisplay_shrink_wrap() to
re-calculate scale factors and refresh the display on
resolution change. Layer undo doesn't have sub-types
anymore, uses main UndoType instead.
* app/layer.h: Remove LayerUndoType
* app/qmask.c: fix qmask undo so it actually works.
* app/undo.h: new types for undo_push_layer{,_mask} and
undo_push_qmask.
* app/undo.c: change way group boundaries are represented:
each Undo has a group_boundary boolean set to TRUE if this is
the start or the end of a group, and the type of the Undo is
the group's type. Within a group, each Undo keeps its own
type. This allows pop funcs and free funcs to do
type-specific things (eg needed by layer and channel stuff).
Don't maintain per-drawable dirty flags anymore. Floating
sel to layer and layer rename now uses meaningful undo types.
* app/undo_types.h: more specific undo types:
LAYER_{ADD,REMOVE}_UNDO, LAYER_MASK_{ADD,REMOVE}_UNDO,
LAYER_RENAME_UNDO, and PARASITE_{ATTACH,DETACH}_UNDO.
* app/undo_history.c: oops - undo stack was being placed into gtk
list in wrong order.
* app/edit_selection.c: push more descriptive LAYER_DISPLACE_UNDO
rather than MISC_UNDO.
* app/layers_dialog.c: better tagging of undo types
1999-10-02 02:43:24 +08:00
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
private->xresolution = xresolution;
|
|
|
|
private->yresolution = yresolution;
|
comment typo fix, plus add %D* to default image-title-format string, so
Fri Oct 1 12:46:12 1999 Austin Donnelly <austin@gimp.org>
* gimprc.in: comment typo fix, plus add %D* to default
image-title-format string, so people get a '*' in the titlebar
if their image is dirty.
* app/fileops.c: initialise filename before using it.
* app/gdisplay.c: empty parameter list () is K&R - should be
stronger (void) in ANSI C.
* app/gimpdrawable.c: gimp_drawable_{dirty,clean} functions
removed - no one uses them anyway. Parasite undo type is
proper parasite undo type, not MISC_UNDO.
* app/gimpdrawableP.h: drawable dirty bit removed.
* app/gimpimage.c: don't change the resolution if there's no
difference from the old one. Call gdisplay_shrink_wrap() to
re-calculate scale factors and refresh the display on
resolution change. Layer undo doesn't have sub-types
anymore, uses main UndoType instead.
* app/layer.h: Remove LayerUndoType
* app/qmask.c: fix qmask undo so it actually works.
* app/undo.h: new types for undo_push_layer{,_mask} and
undo_push_qmask.
* app/undo.c: change way group boundaries are represented:
each Undo has a group_boundary boolean set to TRUE if this is
the start or the end of a group, and the type of the Undo is
the group's type. Within a group, each Undo keeps its own
type. This allows pop funcs and free funcs to do
type-specific things (eg needed by layer and channel stuff).
Don't maintain per-drawable dirty flags anymore. Floating
sel to layer and layer rename now uses meaningful undo types.
* app/undo_types.h: more specific undo types:
LAYER_{ADD,REMOVE}_UNDO, LAYER_MASK_{ADD,REMOVE}_UNDO,
LAYER_RENAME_UNDO, and PARASITE_{ATTACH,DETACH}_UNDO.
* app/undo_history.c: oops - undo stack was being placed into gtk
list in wrong order.
* app/edit_selection.c: push more descriptive LAYER_DISPLACE_UNDO
rather than MISC_UNDO.
* app/layers_dialog.c: better tagging of undo types
1999-10-02 02:43:24 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_resolution_changed (image);
|
2008-08-29 03:12:03 +08:00
|
|
|
gimp_image_size_changed_detailed (image,
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
gimp_image_get_width (image),
|
|
|
|
gimp_image_get_height (image));
|
2001-11-01 05:18:57 +08:00
|
|
|
}
|
1998-10-05 18:05:29 +08:00
|
|
|
}
|
|
|
|
|
1998-11-15 07:28:47 +08:00
|
|
|
void
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_resolution (GimpImage *image,
|
|
|
|
gdouble *xresolution,
|
|
|
|
gdouble *yresolution)
|
1998-10-05 18:05:29 +08:00
|
|
|
{
|
2010-02-04 03:31:25 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2008-11-06 05:48:06 +08:00
|
|
|
g_return_if_fail (xresolution != NULL && yresolution != NULL);
|
1999-08-22 19:45:31 +08:00
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
|
|
|
*xresolution = private->xresolution;
|
|
|
|
*yresolution = private->yresolution;
|
1998-10-05 18:05:29 +08:00
|
|
|
}
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
void
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_resolution_changed (GimpImage *image)
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_signal_emit (image, gimp_image_signals[RESOLUTION_CHANGED], 0);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
|
|
|
|
Add default to Cancel button, remove unset GTK_RECEIVES_DEFAULT from
Sat Feb 20 16:12:33 CST 1999 Shawn T. Amundson <amundson@gimp.org>
* app/tips_dialog.c: Add default to Cancel button, remove
unset GTK_RECEIVES_DEFAULT from prev/next buttons (they
are like toolbar buttons), changed abreviated prev to
previous, prev/next button are now same size, cancel button
is in a button box. Added vboxes where necessary to prevent
prev/next and check button from filling vertically.
* app/app_procs.c: when splashscreen dialog is larger than the
logo, (due to huge font), center logo.
* app/file_new_dialog.c: patch from Marco Lamb <lm@geocities.com>
disallows resizing, changes vertical expanding of widgets to
not occur
* app/palette.c: patch from Marco Lamb <lm@geocities.com>. Makes
+/- buttons for zoom pixmaps (eventually, these can be replaced
with a magnifying glass with a little +/- I think), so that they
no longer expand as they did before. I modified his patch so it
did not create a misused toolbar. I did some other stuff here too,
moved Close button to the left, made it the window's default,
and unset GTK_RECEIVES_DEFAULT off of the non-bottom buttons.
* app/actionarea.c: another patch from Marco Lamb <lm@geocities.com>.
This one changes buttons to be put in a button box which is right
justified. If we decide later that spread is better, we can
change this easy enough.
* app/tools/zoom_in.xpm, app/tools/zoom_out.xpm: + and - graphics.
* libgimp/gimpunit.h
libgimp/gimpunit.c: New files from Michael Natterer
<mitschel@cs.tu-berlin.de>, gimp_unit_* routines.
* app/gimage.h
app/gimpimage.h
app/gimpimage.c
app/gimpimageP.h
app/xcf.c: Patches from Michael Natterer <mitschel@cs.tu-berlin.de>,
which keep a unit assocated with an image.
1999-02-21 10:08:15 +08:00
|
|
|
void
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_set_unit (GimpImage *image,
|
2004-07-14 20:12:50 +08:00
|
|
|
GimpUnit unit)
|
Add default to Cancel button, remove unset GTK_RECEIVES_DEFAULT from
Sat Feb 20 16:12:33 CST 1999 Shawn T. Amundson <amundson@gimp.org>
* app/tips_dialog.c: Add default to Cancel button, remove
unset GTK_RECEIVES_DEFAULT from prev/next buttons (they
are like toolbar buttons), changed abreviated prev to
previous, prev/next button are now same size, cancel button
is in a button box. Added vboxes where necessary to prevent
prev/next and check button from filling vertically.
* app/app_procs.c: when splashscreen dialog is larger than the
logo, (due to huge font), center logo.
* app/file_new_dialog.c: patch from Marco Lamb <lm@geocities.com>
disallows resizing, changes vertical expanding of widgets to
not occur
* app/palette.c: patch from Marco Lamb <lm@geocities.com>. Makes
+/- buttons for zoom pixmaps (eventually, these can be replaced
with a magnifying glass with a little +/- I think), so that they
no longer expand as they did before. I modified his patch so it
did not create a misused toolbar. I did some other stuff here too,
moved Close button to the left, made it the window's default,
and unset GTK_RECEIVES_DEFAULT off of the non-bottom buttons.
* app/actionarea.c: another patch from Marco Lamb <lm@geocities.com>.
This one changes buttons to be put in a button box which is right
justified. If we decide later that spread is better, we can
change this easy enough.
* app/tools/zoom_in.xpm, app/tools/zoom_out.xpm: + and - graphics.
* libgimp/gimpunit.h
libgimp/gimpunit.c: New files from Michael Natterer
<mitschel@cs.tu-berlin.de>, gimp_unit_* routines.
* app/gimage.h
app/gimpimage.h
app/gimpimage.c
app/gimpimageP.h
app/xcf.c: Patches from Michael Natterer <mitschel@cs.tu-berlin.de>,
which keep a unit assocated with an image.
1999-02-21 10:08:15 +08:00
|
|
|
{
|
2010-02-04 03:31:25 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2004-06-02 06:04:20 +08:00
|
|
|
g_return_if_fail (unit > GIMP_UNIT_PIXEL);
|
2001-08-11 22:39:19 +08:00
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
|
|
|
if (private->resolution_unit != unit)
|
2001-11-01 05:18:57 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_undo_push_image_resolution (image,
|
2010-06-08 19:24:11 +08:00
|
|
|
C_("undo-type", "Change Image Unit"));
|
2001-11-01 05:18:57 +08:00
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
private->resolution_unit = unit;
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_unit_changed (image);
|
2001-11-01 05:18:57 +08:00
|
|
|
}
|
Add default to Cancel button, remove unset GTK_RECEIVES_DEFAULT from
Sat Feb 20 16:12:33 CST 1999 Shawn T. Amundson <amundson@gimp.org>
* app/tips_dialog.c: Add default to Cancel button, remove
unset GTK_RECEIVES_DEFAULT from prev/next buttons (they
are like toolbar buttons), changed abreviated prev to
previous, prev/next button are now same size, cancel button
is in a button box. Added vboxes where necessary to prevent
prev/next and check button from filling vertically.
* app/app_procs.c: when splashscreen dialog is larger than the
logo, (due to huge font), center logo.
* app/file_new_dialog.c: patch from Marco Lamb <lm@geocities.com>
disallows resizing, changes vertical expanding of widgets to
not occur
* app/palette.c: patch from Marco Lamb <lm@geocities.com>. Makes
+/- buttons for zoom pixmaps (eventually, these can be replaced
with a magnifying glass with a little +/- I think), so that they
no longer expand as they did before. I modified his patch so it
did not create a misused toolbar. I did some other stuff here too,
moved Close button to the left, made it the window's default,
and unset GTK_RECEIVES_DEFAULT off of the non-bottom buttons.
* app/actionarea.c: another patch from Marco Lamb <lm@geocities.com>.
This one changes buttons to be put in a button box which is right
justified. If we decide later that spread is better, we can
change this easy enough.
* app/tools/zoom_in.xpm, app/tools/zoom_out.xpm: + and - graphics.
* libgimp/gimpunit.h
libgimp/gimpunit.c: New files from Michael Natterer
<mitschel@cs.tu-berlin.de>, gimp_unit_* routines.
* app/gimage.h
app/gimpimage.h
app/gimpimage.c
app/gimpimageP.h
app/xcf.c: Patches from Michael Natterer <mitschel@cs.tu-berlin.de>,
which keep a unit assocated with an image.
1999-02-21 10:08:15 +08:00
|
|
|
}
|
|
|
|
|
2000-02-08 04:35:13 +08:00
|
|
|
GimpUnit
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_unit (GimpImage *image)
|
Add default to Cancel button, remove unset GTK_RECEIVES_DEFAULT from
Sat Feb 20 16:12:33 CST 1999 Shawn T. Amundson <amundson@gimp.org>
* app/tips_dialog.c: Add default to Cancel button, remove
unset GTK_RECEIVES_DEFAULT from prev/next buttons (they
are like toolbar buttons), changed abreviated prev to
previous, prev/next button are now same size, cancel button
is in a button box. Added vboxes where necessary to prevent
prev/next and check button from filling vertically.
* app/app_procs.c: when splashscreen dialog is larger than the
logo, (due to huge font), center logo.
* app/file_new_dialog.c: patch from Marco Lamb <lm@geocities.com>
disallows resizing, changes vertical expanding of widgets to
not occur
* app/palette.c: patch from Marco Lamb <lm@geocities.com>. Makes
+/- buttons for zoom pixmaps (eventually, these can be replaced
with a magnifying glass with a little +/- I think), so that they
no longer expand as they did before. I modified his patch so it
did not create a misused toolbar. I did some other stuff here too,
moved Close button to the left, made it the window's default,
and unset GTK_RECEIVES_DEFAULT off of the non-bottom buttons.
* app/actionarea.c: another patch from Marco Lamb <lm@geocities.com>.
This one changes buttons to be put in a button box which is right
justified. If we decide later that spread is better, we can
change this easy enough.
* app/tools/zoom_in.xpm, app/tools/zoom_out.xpm: + and - graphics.
* libgimp/gimpunit.h
libgimp/gimpunit.c: New files from Michael Natterer
<mitschel@cs.tu-berlin.de>, gimp_unit_* routines.
* app/gimage.h
app/gimpimage.h
app/gimpimage.c
app/gimpimageP.h
app/xcf.c: Patches from Michael Natterer <mitschel@cs.tu-berlin.de>,
which keep a unit assocated with an image.
1999-02-21 10:08:15 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), GIMP_UNIT_INCH);
|
2001-08-11 22:39:19 +08:00
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->resolution_unit;
|
Add default to Cancel button, remove unset GTK_RECEIVES_DEFAULT from
Sat Feb 20 16:12:33 CST 1999 Shawn T. Amundson <amundson@gimp.org>
* app/tips_dialog.c: Add default to Cancel button, remove
unset GTK_RECEIVES_DEFAULT from prev/next buttons (they
are like toolbar buttons), changed abreviated prev to
previous, prev/next button are now same size, cancel button
is in a button box. Added vboxes where necessary to prevent
prev/next and check button from filling vertically.
* app/app_procs.c: when splashscreen dialog is larger than the
logo, (due to huge font), center logo.
* app/file_new_dialog.c: patch from Marco Lamb <lm@geocities.com>
disallows resizing, changes vertical expanding of widgets to
not occur
* app/palette.c: patch from Marco Lamb <lm@geocities.com>. Makes
+/- buttons for zoom pixmaps (eventually, these can be replaced
with a magnifying glass with a little +/- I think), so that they
no longer expand as they did before. I modified his patch so it
did not create a misused toolbar. I did some other stuff here too,
moved Close button to the left, made it the window's default,
and unset GTK_RECEIVES_DEFAULT off of the non-bottom buttons.
* app/actionarea.c: another patch from Marco Lamb <lm@geocities.com>.
This one changes buttons to be put in a button box which is right
justified. If we decide later that spread is better, we can
change this easy enough.
* app/tools/zoom_in.xpm, app/tools/zoom_out.xpm: + and - graphics.
* libgimp/gimpunit.h
libgimp/gimpunit.c: New files from Michael Natterer
<mitschel@cs.tu-berlin.de>, gimp_unit_* routines.
* app/gimage.h
app/gimpimage.h
app/gimpimage.c
app/gimpimageP.h
app/xcf.c: Patches from Michael Natterer <mitschel@cs.tu-berlin.de>,
which keep a unit assocated with an image.
1999-02-21 10:08:15 +08:00
|
|
|
}
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
void
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_unit_changed (GimpImage *image)
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_signal_emit (image, gimp_image_signals[UNIT_CHANGED], 0);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
|
|
|
|
2000-12-29 00:19:55 +08:00
|
|
|
gint
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_width (GimpImage *image)
|
2000-12-29 00:19:55 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), 0);
|
2001-08-11 22:39:19 +08:00
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->width;
|
2000-12-29 00:19:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_height (GimpImage *image)
|
2000-12-29 00:19:55 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), 0);
|
2001-08-11 22:39:19 +08:00
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->height;
|
2000-12-29 00:19:55 +08:00
|
|
|
}
|
|
|
|
|
2002-02-01 00:47:20 +08:00
|
|
|
gboolean
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_has_alpha (GimpImage *image)
|
2002-02-01 00:47:20 +08:00
|
|
|
{
|
2010-02-04 06:00:31 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
GimpLayer *layer;
|
2002-02-01 00:47:20 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), TRUE);
|
2002-02-01 00:47:20 +08:00
|
|
|
|
2010-02-04 06:00:31 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
2010-02-06 20:41:16 +08:00
|
|
|
layer = GIMP_LAYER (gimp_container_get_first_child (private->layers->container));
|
2002-02-01 00:47:20 +08:00
|
|
|
|
2009-08-02 18:24:06 +08:00
|
|
|
return ((gimp_image_get_n_layers (image) > 1) ||
|
2002-02-01 00:47:20 +08:00
|
|
|
(layer && gimp_drawable_has_alpha (GIMP_DRAWABLE (layer))));
|
|
|
|
}
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
gboolean
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_is_empty (GimpImage *image)
|
1998-06-28 18:39:58 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), TRUE);
|
1998-06-28 18:39:58 +08:00
|
|
|
|
2010-02-06 20:41:16 +08:00
|
|
|
return gimp_container_is_empty (GIMP_IMAGE_GET_PRIVATE (image)->layers->container);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
2001-05-07 01:56:10 +08:00
|
|
|
|
2008-11-14 23:18:29 +08:00
|
|
|
void
|
|
|
|
gimp_image_set_floating_selection (GimpImage *image,
|
|
|
|
GimpLayer *floating_sel)
|
|
|
|
{
|
2010-02-04 06:24:18 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
|
2008-11-14 23:18:29 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
|
|
|
g_return_if_fail (floating_sel == NULL || GIMP_IS_LAYER (floating_sel));
|
|
|
|
|
2010-02-04 06:24:18 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
|
|
|
if (private->floating_sel != floating_sel)
|
2008-11-14 23:18:29 +08:00
|
|
|
{
|
2010-02-04 06:24:18 +08:00
|
|
|
private->floating_sel = floating_sel;
|
2008-11-14 23:18:29 +08:00
|
|
|
|
2010-02-05 16:13:25 +08:00
|
|
|
private->flush_accum.floating_selection_changed = TRUE;
|
2008-11-14 23:18:29 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
GimpLayer *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_floating_selection (GimpImage *image)
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
1999-01-11 07:36:29 +08:00
|
|
|
|
2010-02-04 06:24:18 +08:00
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->floating_sel;
|
1998-06-28 18:39:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_floating_selection_changed (GimpImage *image)
|
1998-06-28 18:39:58 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
1999-01-11 07:36:29 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_signal_emit (image, gimp_image_signals[FLOATING_SELECTION_CHANGED], 0);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
1998-06-28 18:39:58 +08:00
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
GimpChannel *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_mask (GimpImage *image)
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
2000-02-27 02:46:08 +08:00
|
|
|
|
2010-02-04 06:24:18 +08:00
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->selection_mask;
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
2001-01-29 10:45:02 +08:00
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
void
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_mask_changed (GimpImage *image)
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2001-11-17 01:08:41 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_signal_emit (image, gimp_image_signals[MASK_CHANGED], 0);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
1998-06-28 18:39:58 +08:00
|
|
|
|
2012-05-14 07:44:41 +08:00
|
|
|
void
|
|
|
|
gimp_image_take_mask (GimpImage *image,
|
|
|
|
GimpChannel *mask)
|
|
|
|
{
|
|
|
|
GimpImagePrivate *private;
|
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
|
|
|
g_return_if_fail (GIMP_IS_SELECTION (mask));
|
|
|
|
|
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
|
|
|
if (private->selection_mask)
|
|
|
|
g_object_unref (private->selection_mask);
|
|
|
|
|
|
|
|
private->selection_mask = g_object_ref_sink (mask);
|
|
|
|
|
|
|
|
g_signal_connect (private->selection_mask, "update",
|
|
|
|
G_CALLBACK (gimp_image_mask_update),
|
|
|
|
image);
|
|
|
|
}
|
|
|
|
|
2010-02-04 16:08:50 +08:00
|
|
|
|
|
|
|
/* image components */
|
|
|
|
|
2012-03-16 20:47:38 +08:00
|
|
|
const Babl *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_component_format (GimpImage *image,
|
2012-03-16 20:47:38 +08:00
|
|
|
GimpChannelType channel)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
|
|
|
switch (channel)
|
|
|
|
{
|
2017-01-10 02:40:30 +08:00
|
|
|
case GIMP_CHANNEL_RED:
|
2012-04-23 01:47:46 +08:00
|
|
|
return gimp_babl_component_format (GIMP_RGB,
|
|
|
|
gimp_image_get_precision (image),
|
|
|
|
RED);
|
|
|
|
|
2017-01-10 02:40:30 +08:00
|
|
|
case GIMP_CHANNEL_GREEN:
|
2012-04-23 01:47:46 +08:00
|
|
|
return gimp_babl_component_format (GIMP_RGB,
|
|
|
|
gimp_image_get_precision (image),
|
|
|
|
GREEN);
|
|
|
|
|
2017-01-10 02:40:30 +08:00
|
|
|
case GIMP_CHANNEL_BLUE:
|
2012-04-23 01:47:46 +08:00
|
|
|
return gimp_babl_component_format (GIMP_RGB,
|
|
|
|
gimp_image_get_precision (image),
|
|
|
|
BLUE);
|
|
|
|
|
2017-01-10 02:40:30 +08:00
|
|
|
case GIMP_CHANNEL_ALPHA:
|
2012-04-23 01:47:46 +08:00
|
|
|
return gimp_babl_component_format (GIMP_RGB,
|
|
|
|
gimp_image_get_precision (image),
|
|
|
|
ALPHA);
|
|
|
|
|
2017-01-10 02:40:30 +08:00
|
|
|
case GIMP_CHANNEL_GRAY:
|
2012-04-23 01:47:46 +08:00
|
|
|
return gimp_babl_component_format (GIMP_GRAY,
|
|
|
|
gimp_image_get_precision (image),
|
|
|
|
GRAY);
|
|
|
|
|
2017-01-10 02:40:30 +08:00
|
|
|
case GIMP_CHANNEL_INDEXED:
|
2012-04-30 07:22:49 +08:00
|
|
|
return babl_format ("Y u8"); /* will extract grayscale, the best
|
|
|
|
* we can do here */
|
2012-03-16 20:47:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2003-03-13 01:12:01 +08:00
|
|
|
gint
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_component_index (GimpImage *image,
|
2003-03-13 01:12:01 +08:00
|
|
|
GimpChannelType channel)
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), -1);
|
1998-06-28 18:39:58 +08:00
|
|
|
|
2003-03-13 01:12:01 +08:00
|
|
|
switch (channel)
|
1998-06-28 18:39:58 +08:00
|
|
|
{
|
2017-01-10 02:40:30 +08:00
|
|
|
case GIMP_CHANNEL_RED: return RED;
|
|
|
|
case GIMP_CHANNEL_GREEN: return GREEN;
|
|
|
|
case GIMP_CHANNEL_BLUE: return BLUE;
|
|
|
|
case GIMP_CHANNEL_GRAY: return GRAY;
|
|
|
|
case GIMP_CHANNEL_INDEXED: return INDEXED;
|
|
|
|
case GIMP_CHANNEL_ALPHA:
|
2012-05-08 03:57:33 +08:00
|
|
|
switch (gimp_image_get_base_type (image))
|
2004-07-14 20:12:50 +08:00
|
|
|
{
|
2008-10-19 21:47:09 +08:00
|
|
|
case GIMP_RGB: return ALPHA;
|
|
|
|
case GIMP_GRAY: return ALPHA_G;
|
|
|
|
case GIMP_INDEXED: return ALPHA_I;
|
2004-07-14 20:12:50 +08:00
|
|
|
}
|
2000-02-27 02:46:08 +08:00
|
|
|
}
|
1998-06-28 18:39:58 +08:00
|
|
|
|
2003-03-13 01:12:01 +08:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_set_component_active (GimpImage *image,
|
2004-07-14 20:12:50 +08:00
|
|
|
GimpChannelType channel,
|
|
|
|
gboolean active)
|
2003-03-13 01:12:01 +08:00
|
|
|
{
|
2010-02-04 16:08:50 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
gint index = -1;
|
2003-03-13 01:12:01 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2003-03-13 01:12:01 +08:00
|
|
|
|
2010-02-04 16:08:50 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
index = gimp_image_get_component_index (image, channel);
|
2003-03-13 01:12:01 +08:00
|
|
|
|
2010-02-04 16:08:50 +08:00
|
|
|
if (index != -1 && active != private->active[index])
|
2000-02-27 02:46:08 +08:00
|
|
|
{
|
2010-02-04 16:08:50 +08:00
|
|
|
private->active[index] = active ? TRUE : FALSE;
|
1998-06-28 18:39:58 +08:00
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
/* If there is an active channel and we mess with the components,
|
|
|
|
* the active channel gets unset...
|
|
|
|
*/
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_unset_active_channel (image);
|
1999-01-18 04:41:38 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_signal_emit (image,
|
2004-07-14 20:12:50 +08:00
|
|
|
gimp_image_signals[COMPONENT_ACTIVE_CHANGED], 0,
|
|
|
|
channel);
|
1999-01-18 04:41:38 +08:00
|
|
|
}
|
1998-06-28 18:39:58 +08:00
|
|
|
}
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
gboolean
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_component_active (GimpImage *image,
|
2004-07-14 20:12:50 +08:00
|
|
|
GimpChannelType channel)
|
2001-06-05 07:11:31 +08:00
|
|
|
{
|
2003-03-13 01:12:01 +08:00
|
|
|
gint index = -1;
|
2001-06-05 07:11:31 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
2003-03-13 01:12:01 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
index = gimp_image_get_component_index (image, channel);
|
2003-03-13 01:12:01 +08:00
|
|
|
|
|
|
|
if (index != -1)
|
2010-02-04 16:08:50 +08:00
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->active[index];
|
2001-06-05 07:11:31 +08:00
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
return FALSE;
|
1998-06-28 18:39:58 +08:00
|
|
|
}
|
|
|
|
|
2010-02-04 16:08:50 +08:00
|
|
|
void
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_active_array (GimpImage *image,
|
|
|
|
gboolean *components)
|
2010-02-04 16:08:50 +08:00
|
|
|
{
|
|
|
|
GimpImagePrivate *private;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
|
|
|
g_return_if_fail (components != NULL);
|
|
|
|
|
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
|
|
|
for (i = 0; i < MAX_CHANNELS; i++)
|
|
|
|
components[i] = private->active[i];
|
|
|
|
}
|
|
|
|
|
2012-04-26 05:23:31 +08:00
|
|
|
GimpComponentMask
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_active_mask (GimpImage *image)
|
2012-04-26 05:23:31 +08:00
|
|
|
{
|
|
|
|
GimpImagePrivate *private;
|
|
|
|
GimpComponentMask mask = 0;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), 0);
|
|
|
|
|
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
2012-05-08 03:57:33 +08:00
|
|
|
switch (gimp_image_get_base_type (image))
|
2012-04-26 05:23:31 +08:00
|
|
|
{
|
|
|
|
case GIMP_RGB:
|
2015-09-07 06:35:02 +08:00
|
|
|
mask |= (private->active[RED]) ? GIMP_COMPONENT_MASK_RED : 0;
|
|
|
|
mask |= (private->active[GREEN]) ? GIMP_COMPONENT_MASK_GREEN : 0;
|
|
|
|
mask |= (private->active[BLUE]) ? GIMP_COMPONENT_MASK_BLUE : 0;
|
|
|
|
mask |= (private->active[ALPHA]) ? GIMP_COMPONENT_MASK_ALPHA : 0;
|
2012-04-26 05:23:31 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_GRAY:
|
|
|
|
case GIMP_INDEXED:
|
2015-09-07 06:35:02 +08:00
|
|
|
mask |= (private->active[GRAY]) ? GIMP_COMPONENT_MASK_RED : 0;
|
|
|
|
mask |= (private->active[GRAY]) ? GIMP_COMPONENT_MASK_GREEN : 0;
|
|
|
|
mask |= (private->active[GRAY]) ? GIMP_COMPONENT_MASK_BLUE : 0;
|
|
|
|
mask |= (private->active[ALPHA_G]) ? GIMP_COMPONENT_MASK_ALPHA : 0;
|
2012-04-26 05:23:31 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return mask;
|
|
|
|
}
|
|
|
|
|
1998-06-28 18:39:58 +08:00
|
|
|
void
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_set_component_visible (GimpImage *image,
|
2004-07-14 20:12:50 +08:00
|
|
|
GimpChannelType channel,
|
|
|
|
gboolean visible)
|
1998-06-28 18:39:58 +08:00
|
|
|
{
|
2010-02-04 16:08:50 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
gint index = -1;
|
1998-06-28 18:39:58 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2001-08-11 22:39:19 +08:00
|
|
|
|
2010-02-04 16:08:50 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
index = gimp_image_get_component_index (image, channel);
|
1998-06-28 18:39:58 +08:00
|
|
|
|
2010-02-04 16:08:50 +08:00
|
|
|
if (index != -1 && visible != private->visible[index])
|
1998-06-28 18:39:58 +08:00
|
|
|
{
|
2010-02-04 16:08:50 +08:00
|
|
|
private->visible[index] = visible ? TRUE : FALSE;
|
1998-06-28 18:39:58 +08:00
|
|
|
|
2012-10-07 05:58:46 +08:00
|
|
|
if (private->visible_mask)
|
|
|
|
{
|
|
|
|
GimpComponentMask mask;
|
|
|
|
|
2015-09-07 06:35:02 +08:00
|
|
|
mask = ~gimp_image_get_visible_mask (image) & GIMP_COMPONENT_MASK_ALL;
|
2012-10-07 05:58:46 +08:00
|
|
|
|
|
|
|
gegl_node_set (private->visible_mask,
|
|
|
|
"mask", mask,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_signal_emit (image,
|
2004-07-14 20:12:50 +08:00
|
|
|
gimp_image_signals[COMPONENT_VISIBILITY_CHANGED], 0,
|
|
|
|
channel);
|
1998-06-28 18:39:58 +08:00
|
|
|
|
2009-08-26 19:06:55 +08:00
|
|
|
gimp_image_invalidate (image,
|
|
|
|
0, 0,
|
|
|
|
gimp_image_get_width (image),
|
|
|
|
gimp_image_get_height (image));
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
|
|
|
}
|
1998-06-28 18:39:58 +08:00
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
gboolean
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_component_visible (GimpImage *image,
|
2004-07-14 20:12:50 +08:00
|
|
|
GimpChannelType channel)
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2003-03-13 01:12:01 +08:00
|
|
|
gint index = -1;
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
2003-03-13 01:12:01 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
index = gimp_image_get_component_index (image, channel);
|
2003-03-13 01:12:01 +08:00
|
|
|
|
|
|
|
if (index != -1)
|
2010-02-04 16:08:50 +08:00
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->visible[index];
|
1998-06-28 18:39:58 +08:00
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
return FALSE;
|
|
|
|
}
|
1998-06-28 18:39:58 +08:00
|
|
|
|
2010-02-04 16:08:50 +08:00
|
|
|
void
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_visible_array (GimpImage *image,
|
|
|
|
gboolean *components)
|
2010-02-04 16:08:50 +08:00
|
|
|
{
|
|
|
|
GimpImagePrivate *private;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
|
|
|
g_return_if_fail (components != NULL);
|
|
|
|
|
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
|
|
|
for (i = 0; i < MAX_CHANNELS; i++)
|
|
|
|
components[i] = private->visible[i];
|
|
|
|
}
|
|
|
|
|
2012-10-07 05:58:46 +08:00
|
|
|
GimpComponentMask
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_visible_mask (GimpImage *image)
|
2012-10-07 05:58:46 +08:00
|
|
|
{
|
|
|
|
GimpImagePrivate *private;
|
|
|
|
GimpComponentMask mask = 0;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), 0);
|
|
|
|
|
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
|
|
|
switch (gimp_image_get_base_type (image))
|
|
|
|
{
|
|
|
|
case GIMP_RGB:
|
2015-09-07 06:35:02 +08:00
|
|
|
mask |= (private->visible[RED]) ? GIMP_COMPONENT_MASK_RED : 0;
|
|
|
|
mask |= (private->visible[GREEN]) ? GIMP_COMPONENT_MASK_GREEN : 0;
|
|
|
|
mask |= (private->visible[BLUE]) ? GIMP_COMPONENT_MASK_BLUE : 0;
|
|
|
|
mask |= (private->visible[ALPHA]) ? GIMP_COMPONENT_MASK_ALPHA : 0;
|
2012-10-07 05:58:46 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_GRAY:
|
|
|
|
case GIMP_INDEXED:
|
2015-09-07 06:35:02 +08:00
|
|
|
mask |= (private->visible[GRAY]) ? GIMP_COMPONENT_MASK_RED : 0;
|
|
|
|
mask |= (private->visible[GRAY]) ? GIMP_COMPONENT_MASK_GREEN : 0;
|
|
|
|
mask |= (private->visible[GRAY]) ? GIMP_COMPONENT_MASK_BLUE : 0;
|
|
|
|
mask |= (private->visible[ALPHA]) ? GIMP_COMPONENT_MASK_ALPHA : 0;
|
2012-10-07 05:58:46 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return mask;
|
|
|
|
}
|
|
|
|
|
2010-02-04 16:49:45 +08:00
|
|
|
|
|
|
|
/* emitting image signals */
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
void
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_mode_changed (GimpImage *image)
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
1998-06-28 18:39:58 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_signal_emit (image, gimp_image_signals[MODE_CHANGED], 0);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
1998-06-28 18:39:58 +08:00
|
|
|
|
2012-04-25 22:46:58 +08:00
|
|
|
void
|
|
|
|
gimp_image_precision_changed (GimpImage *image)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
|
|
|
|
|
|
|
g_signal_emit (image, gimp_image_signals[PRECISION_CHANGED], 0);
|
|
|
|
}
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
void
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_alpha_changed (GimpImage *image)
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
1998-06-28 18:39:58 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_signal_emit (image, gimp_image_signals[ALPHA_CHANGED], 0);
|
1998-06-28 18:39:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2009-08-26 19:06:55 +08:00
|
|
|
gimp_image_invalidate (GimpImage *image,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height)
|
1998-06-28 18:39:58 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2001-08-11 22:39:19 +08:00
|
|
|
|
2009-08-26 19:06:55 +08:00
|
|
|
gimp_projectable_invalidate (GIMP_PROJECTABLE (image),
|
|
|
|
x, y, width, height);
|
2007-06-21 21:35:31 +08:00
|
|
|
|
2010-02-05 16:13:25 +08:00
|
|
|
GIMP_IMAGE_GET_PRIVATE (image)->flush_accum.preview_invalidated = TRUE;
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
1998-06-28 18:39:58 +08:00
|
|
|
|
2010-09-17 17:31:57 +08:00
|
|
|
void
|
2010-10-01 16:34:15 +08:00
|
|
|
gimp_image_guide_added (GimpImage *image,
|
|
|
|
GimpGuide *guide)
|
2010-09-17 17:31:57 +08:00
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2010-10-01 16:34:15 +08:00
|
|
|
g_return_if_fail (GIMP_IS_GUIDE (guide));
|
2010-09-17 17:31:57 +08:00
|
|
|
|
2010-10-01 16:34:15 +08:00
|
|
|
g_signal_emit (image, gimp_image_signals[GUIDE_ADDED], 0,
|
|
|
|
guide);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_image_guide_removed (GimpImage *image,
|
|
|
|
GimpGuide *guide)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
|
|
|
g_return_if_fail (GIMP_IS_GUIDE (guide));
|
|
|
|
|
|
|
|
g_signal_emit (image, gimp_image_signals[GUIDE_REMOVED], 0,
|
|
|
|
guide);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_image_guide_moved (GimpImage *image,
|
|
|
|
GimpGuide *guide)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
|
|
|
g_return_if_fail (GIMP_IS_GUIDE (guide));
|
|
|
|
|
|
|
|
g_signal_emit (image, gimp_image_signals[GUIDE_MOVED], 0,
|
|
|
|
guide);
|
2010-09-17 17:31:57 +08:00
|
|
|
}
|
|
|
|
|
2005-04-03 23:48:03 +08:00
|
|
|
void
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_sample_point_added (GimpImage *image,
|
2005-04-03 23:48:03 +08:00
|
|
|
GimpSamplePoint *sample_point)
|
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2018-07-15 21:58:24 +08:00
|
|
|
g_return_if_fail (GIMP_IS_SAMPLE_POINT (sample_point));
|
2005-04-03 23:48:03 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_signal_emit (image, gimp_image_signals[SAMPLE_POINT_ADDED], 0,
|
2005-04-03 23:48:03 +08:00
|
|
|
sample_point);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_sample_point_removed (GimpImage *image,
|
2005-04-03 23:48:03 +08:00
|
|
|
GimpSamplePoint *sample_point)
|
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2018-07-15 21:58:24 +08:00
|
|
|
g_return_if_fail (GIMP_IS_SAMPLE_POINT (sample_point));
|
2005-04-03 23:48:03 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_signal_emit (image, gimp_image_signals[SAMPLE_POINT_REMOVED], 0,
|
2005-04-03 23:48:03 +08:00
|
|
|
sample_point);
|
|
|
|
}
|
|
|
|
|
2010-10-01 15:15:52 +08:00
|
|
|
void
|
|
|
|
gimp_image_sample_point_moved (GimpImage *image,
|
|
|
|
GimpSamplePoint *sample_point)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2018-07-15 21:58:24 +08:00
|
|
|
g_return_if_fail (GIMP_IS_SAMPLE_POINT (sample_point));
|
2010-10-01 15:15:52 +08:00
|
|
|
|
|
|
|
g_signal_emit (image, gimp_image_signals[SAMPLE_POINT_MOVED], 0,
|
|
|
|
sample_point);
|
|
|
|
}
|
|
|
|
|
2008-08-03 19:35:53 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_size_changed_detailed:
|
|
|
|
* @image:
|
|
|
|
* @previous_origin_x:
|
|
|
|
* @previous_origin_y:
|
|
|
|
*
|
|
|
|
* Emits the size-changed-detailed signal that is typically used to adjust the
|
|
|
|
* position of the image in the display shell on various operations,
|
|
|
|
* e.g. crop.
|
|
|
|
*
|
2008-08-05 04:11:35 +08:00
|
|
|
* This function makes sure that GimpViewable::size-changed is also emitted.
|
2008-08-03 19:35:53 +08:00
|
|
|
**/
|
|
|
|
void
|
|
|
|
gimp_image_size_changed_detailed (GimpImage *image,
|
2008-08-05 04:11:35 +08:00
|
|
|
gint previous_origin_x,
|
2008-08-29 03:12:03 +08:00
|
|
|
gint previous_origin_y,
|
|
|
|
gint previous_width,
|
|
|
|
gint previous_height)
|
2008-08-03 19:35:53 +08:00
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
|
|
|
|
|
|
|
g_signal_emit (image, gimp_image_signals[SIZE_CHANGED_DETAILED], 0,
|
|
|
|
previous_origin_x,
|
2008-08-29 03:12:03 +08:00
|
|
|
previous_origin_y,
|
|
|
|
previous_width,
|
|
|
|
previous_height);
|
2008-08-03 19:35:53 +08:00
|
|
|
}
|
|
|
|
|
2003-03-18 21:49:02 +08:00
|
|
|
void
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_colormap_changed (GimpImage *image,
|
2004-07-14 20:12:50 +08:00
|
|
|
gint color_index)
|
2003-03-18 21:49:02 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2010-02-04 03:31:25 +08:00
|
|
|
g_return_if_fail (color_index >= -1 &&
|
|
|
|
color_index < GIMP_IMAGE_GET_PRIVATE (image)->n_colors);
|
2003-03-18 21:49:02 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_signal_emit (image, gimp_image_signals[COLORMAP_CHANGED], 0,
|
2004-07-14 20:12:50 +08:00
|
|
|
color_index);
|
2003-03-18 21:49:02 +08:00
|
|
|
}
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
void
|
2010-10-10 02:23:05 +08:00
|
|
|
gimp_image_selection_invalidate (GimpImage *image)
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
1998-06-28 18:39:58 +08:00
|
|
|
|
2010-10-10 02:23:05 +08:00
|
|
|
g_signal_emit (image, gimp_image_signals[SELECTION_INVALIDATE], 0);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
1998-06-28 18:39:58 +08:00
|
|
|
|
2001-11-30 22:41:56 +08:00
|
|
|
void
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_quick_mask_changed (GimpImage *image)
|
2001-11-30 22:41:56 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2001-11-30 22:41:56 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_signal_emit (image, gimp_image_signals[QUICK_MASK_CHANGED], 0);
|
2001-11-30 22:41:56 +08:00
|
|
|
}
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
void
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_undo_event (GimpImage *image,
|
2004-07-14 20:12:50 +08:00
|
|
|
GimpUndoEvent event,
|
2003-02-20 20:47:42 +08:00
|
|
|
GimpUndo *undo)
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2003-11-26 00:12:53 +08:00
|
|
|
g_return_if_fail (((event == GIMP_UNDO_EVENT_UNDO_FREE ||
|
|
|
|
event == GIMP_UNDO_EVENT_UNDO_FREEZE ||
|
|
|
|
event == GIMP_UNDO_EVENT_UNDO_THAW) && undo == NULL) ||
|
|
|
|
GIMP_IS_UNDO (undo));
|
2003-02-20 20:47:42 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_signal_emit (image, gimp_image_signals[UNDO_EVENT], 0, event, undo);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-02-08 18:11:33 +08:00
|
|
|
/* dirty counters */
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
/* NOTE about the image->dirty counter:
|
2003-08-25 18:49:33 +08:00
|
|
|
* If 0, then the image is clean (ie, copy on disk is the same as the one
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
* in memory).
|
|
|
|
* If positive, then that's the number of dirtying operations done
|
|
|
|
* on the image since the last save.
|
|
|
|
* If negative, then user has hit undo and gone back in time prior
|
|
|
|
* to the saved copy. Hitting redo will eventually come back to
|
|
|
|
* the saved copy.
|
|
|
|
*
|
|
|
|
* The image is dirty (ie, needs saving) if counter is non-zero.
|
|
|
|
*
|
2008-01-24 17:38:44 +08:00
|
|
|
* If the counter is around 100000, this is due to undo-ing back
|
|
|
|
* before a saved version, then changing the image (thus destroying
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
* the redo stack). Once this has happened, it's impossible to get
|
|
|
|
* the image back to the state on disk, since the redo info has been
|
2008-01-24 17:38:44 +08:00
|
|
|
* freed. See gimpimage-undo.c for the gory details.
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* NEVER CALL gimp_image_dirty() directly!
|
|
|
|
*
|
|
|
|
* If your code has just dirtied the image, push an undo instead.
|
|
|
|
* Failing that, push the trivial undo which tells the user the
|
|
|
|
* command is not undoable: undo_push_cantundo() (But really, it would
|
|
|
|
* be best to push a proper undo). If you just dirty the image
|
|
|
|
* without pushing an undo then the dirty count is increased, but
|
|
|
|
* popping that many undo actions won't lead to a clean image.
|
|
|
|
*/
|
|
|
|
|
|
|
|
gint
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_dirty (GimpImage *image,
|
2004-07-29 22:16:21 +08:00
|
|
|
GimpDirtyMask dirty_mask)
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2010-02-04 03:31:25 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
private->dirty++;
|
|
|
|
private->export_dirty++;
|
|
|
|
|
|
|
|
if (! private->dirty_time)
|
|
|
|
private->dirty_time = time (NULL);
|
2004-10-06 07:42:35 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_signal_emit (image, gimp_image_signals[DIRTY], 0, dirty_mask);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
TRC (("dirty %d -> %d\n", private->dirty - 1, private->dirty));
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
return private->dirty;
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_clean (GimpImage *image,
|
2004-07-29 22:16:21 +08:00
|
|
|
GimpDirtyMask dirty_mask)
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2010-02-04 03:31:25 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
|
|
|
private->dirty--;
|
|
|
|
private->export_dirty--;
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_signal_emit (image, gimp_image_signals[CLEAN], 0, dirty_mask);
|
2003-08-25 18:49:33 +08:00
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
TRC (("clean %d -> %d\n", private->dirty + 1, private->dirty));
|
2003-08-25 18:49:33 +08:00
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
return private->dirty;
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_clean_all (GimpImage *image)
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2010-02-04 03:31:25 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
|
|
|
private->dirty = 0;
|
|
|
|
private->dirty_time = 0;
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2007-11-08 22:31:19 +08:00
|
|
|
g_signal_emit (image, gimp_image_signals[CLEAN], 0, GIMP_DIRTY_ALL);
|
2017-11-20 02:21:15 +08:00
|
|
|
|
|
|
|
gimp_object_name_changed (GIMP_OBJECT (image));
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
|
|
|
|
2009-07-04 04:51:11 +08:00
|
|
|
void
|
|
|
|
gimp_image_export_clean_all (GimpImage *image)
|
|
|
|
{
|
2010-02-04 03:31:25 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
|
2009-07-04 04:51:11 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
|
|
|
private->export_dirty = 0;
|
2009-07-04 04:51:11 +08:00
|
|
|
|
|
|
|
g_signal_emit (image, gimp_image_signals[CLEAN], 0, GIMP_DIRTY_ALL);
|
2017-11-20 02:21:15 +08:00
|
|
|
|
|
|
|
gimp_object_name_changed (GIMP_OBJECT (image));
|
2009-07-04 04:51:11 +08:00
|
|
|
}
|
|
|
|
|
2009-07-04 03:11:21 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_is_dirty:
|
|
|
|
* @image:
|
|
|
|
*
|
|
|
|
* Returns: True if the image is dirty, false otherwise.
|
|
|
|
**/
|
|
|
|
gint
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_is_dirty (GimpImage *image)
|
2009-07-04 03:11:21 +08:00
|
|
|
{
|
2010-02-04 03:31:25 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
|
|
|
|
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->dirty != 0;
|
2009-07-04 03:11:21 +08:00
|
|
|
}
|
|
|
|
|
2009-07-04 04:51:11 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_is_export_dirty:
|
|
|
|
* @image:
|
|
|
|
*
|
|
|
|
* Returns: True if the image export is dirty, false otherwise.
|
|
|
|
**/
|
|
|
|
gboolean
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_is_export_dirty (GimpImage *image)
|
2009-07-04 04:51:11 +08:00
|
|
|
{
|
2010-02-04 03:31:25 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
|
|
|
|
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->export_dirty != 0;
|
2009-07-04 04:51:11 +08:00
|
|
|
}
|
|
|
|
|
2014-08-25 16:04:17 +08:00
|
|
|
gint64
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_dirty_time (GimpImage *image)
|
2010-02-04 03:31:25 +08:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), 0);
|
|
|
|
|
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->dirty_time;
|
|
|
|
}
|
|
|
|
|
2018-09-29 14:25:34 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_saving:
|
|
|
|
* @image:
|
|
|
|
*
|
|
|
|
* Emits the "saving" signal, indicating that @image is about to be saved,
|
|
|
|
* or exported.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gimp_image_saving (GimpImage *image)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
|
|
|
|
|
|
|
g_signal_emit (image, gimp_image_signals[SAVING], 0);
|
|
|
|
}
|
|
|
|
|
2006-12-12 04:57:44 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_saved:
|
|
|
|
* @image:
|
2014-07-08 05:56:56 +08:00
|
|
|
* @file:
|
2006-12-12 04:57:44 +08:00
|
|
|
*
|
|
|
|
* Emits the "saved" signal, indicating that @image was saved to the
|
2014-07-08 05:56:56 +08:00
|
|
|
* location specified by @file.
|
2006-12-12 04:57:44 +08:00
|
|
|
*/
|
|
|
|
void
|
2014-07-08 05:56:56 +08:00
|
|
|
gimp_image_saved (GimpImage *image,
|
|
|
|
GFile *file)
|
2006-12-12 04:57:44 +08:00
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2014-07-08 05:56:56 +08:00
|
|
|
g_return_if_fail (G_IS_FILE (file));
|
2006-12-12 04:57:44 +08:00
|
|
|
|
2014-07-08 05:56:56 +08:00
|
|
|
g_signal_emit (image, gimp_image_signals[SAVED], 0, file);
|
2006-12-12 04:57:44 +08:00
|
|
|
}
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2009-05-16 17:27:45 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_exported:
|
|
|
|
* @image:
|
2014-07-08 05:56:56 +08:00
|
|
|
* @file:
|
2009-05-16 17:27:45 +08:00
|
|
|
*
|
|
|
|
* Emits the "exported" signal, indicating that @image was exported to the
|
2014-07-08 05:56:56 +08:00
|
|
|
* location specified by @file.
|
2009-05-16 17:27:45 +08:00
|
|
|
*/
|
|
|
|
void
|
2014-07-08 05:56:56 +08:00
|
|
|
gimp_image_exported (GimpImage *image,
|
|
|
|
GFile *file)
|
2009-05-16 17:27:45 +08:00
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2014-07-08 05:56:56 +08:00
|
|
|
g_return_if_fail (G_IS_FILE (file));
|
2009-05-16 17:27:45 +08:00
|
|
|
|
2014-07-08 05:56:56 +08:00
|
|
|
g_signal_emit (image, gimp_image_signals[EXPORTED], 0, file);
|
2009-05-16 17:27:45 +08:00
|
|
|
}
|
|
|
|
|
2010-02-08 18:11:33 +08:00
|
|
|
|
2002-05-09 01:48:24 +08:00
|
|
|
/* flush this image's displays */
|
|
|
|
|
|
|
|
void
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_flush (GimpImage *image)
|
2002-05-09 01:48:24 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2002-05-09 01:48:24 +08:00
|
|
|
|
2008-11-05 02:06:36 +08:00
|
|
|
gimp_projectable_flush (GIMP_PROJECTABLE (image),
|
2010-02-05 16:13:25 +08:00
|
|
|
GIMP_IMAGE_GET_PRIVATE (image)->flush_accum.preview_invalidated);
|
2002-05-09 01:48:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-02-04 04:20:29 +08:00
|
|
|
/* display / instance counters */
|
|
|
|
|
|
|
|
gint
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_display_count (GimpImage *image)
|
2010-02-04 04:20:29 +08:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), 0);
|
|
|
|
|
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->disp_count;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_image_inc_display_count (GimpImage *image)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
|
|
|
|
|
|
|
GIMP_IMAGE_GET_PRIVATE (image)->disp_count++;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_image_dec_display_count (GimpImage *image)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
|
|
|
|
|
|
|
GIMP_IMAGE_GET_PRIVATE (image)->disp_count--;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_instance_count (GimpImage *image)
|
2010-02-04 04:20:29 +08:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), 0);
|
|
|
|
|
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->instance_count;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gimp_image_inc_instance_count (GimpImage *image)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
|
|
|
|
|
|
|
GIMP_IMAGE_GET_PRIVATE (image)->instance_count++;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
/* parasites */
|
|
|
|
|
2006-04-02 23:37:25 +08:00
|
|
|
const GimpParasite *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_parasite_find (GimpImage *image,
|
|
|
|
const gchar *name)
|
1998-10-08 16:15:21 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
2000-03-09 19:58:03 +08:00
|
|
|
|
2010-02-04 06:42:32 +08:00
|
|
|
return gimp_parasite_list_find (GIMP_IMAGE_GET_PRIVATE (image)->parasites,
|
|
|
|
name);
|
1998-10-08 16:15:21 +08:00
|
|
|
}
|
|
|
|
|
1999-08-22 19:45:31 +08:00
|
|
|
static void
|
2003-08-25 18:49:33 +08:00
|
|
|
list_func (gchar *key,
|
2004-07-14 20:12:50 +08:00
|
|
|
GimpParasite *p,
|
|
|
|
gchar ***cur)
|
1999-02-14 02:19:44 +08:00
|
|
|
{
|
1999-08-22 19:45:31 +08:00
|
|
|
*(*cur)++ = (gchar *) g_strdup (key);
|
1999-02-14 02:19:44 +08:00
|
|
|
}
|
|
|
|
|
1999-08-22 19:45:31 +08:00
|
|
|
gchar **
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_parasite_list (GimpImage *image,
|
|
|
|
gint *count)
|
1999-02-14 02:19:44 +08:00
|
|
|
{
|
2010-02-04 06:42:32 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
gchar **list;
|
|
|
|
gchar **cur;
|
1999-02-14 02:19:44 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
2000-03-09 19:58:03 +08:00
|
|
|
|
2010-02-04 06:42:32 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
|
|
|
*count = gimp_parasite_list_length (private->parasites);
|
2007-05-29 17:23:34 +08:00
|
|
|
cur = list = g_new (gchar *, *count);
|
1999-02-14 02:19:44 +08:00
|
|
|
|
2010-02-04 06:42:32 +08:00
|
|
|
gimp_parasite_list_foreach (private->parasites, (GHFunc) list_func, &cur);
|
2003-08-25 18:49:33 +08:00
|
|
|
|
1999-02-14 02:19:44 +08:00
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
2014-03-22 07:11:15 +08:00
|
|
|
gboolean
|
|
|
|
gimp_image_parasite_validate (GimpImage *image,
|
|
|
|
const GimpParasite *parasite,
|
|
|
|
GError **error)
|
|
|
|
{
|
2014-03-24 02:46:09 +08:00
|
|
|
const gchar *name;
|
|
|
|
|
2014-03-22 07:11:15 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
|
|
|
g_return_val_if_fail (parasite != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
|
|
|
|
2014-03-24 02:46:09 +08:00
|
|
|
name = gimp_parasite_name (parasite);
|
|
|
|
|
|
|
|
if (strcmp (name, GIMP_ICC_PROFILE_PARASITE_NAME) == 0)
|
|
|
|
{
|
2015-08-17 16:37:55 +08:00
|
|
|
return gimp_image_validate_icc_parasite (image, parasite, NULL, error);
|
2014-03-24 02:46:09 +08:00
|
|
|
}
|
2016-05-31 00:56:29 +08:00
|
|
|
else if (strcmp (name, "gimp-comment") == 0)
|
|
|
|
{
|
2016-06-01 04:28:44 +08:00
|
|
|
const gchar *data = gimp_parasite_data (parasite);
|
|
|
|
gssize length = gimp_parasite_data_size (parasite);
|
2018-07-06 08:26:55 +08:00
|
|
|
gboolean valid = FALSE;
|
2016-06-01 04:28:44 +08:00
|
|
|
|
2018-07-06 08:26:55 +08:00
|
|
|
if (length > 0)
|
|
|
|
{
|
|
|
|
if (data[length - 1] == '\0')
|
|
|
|
valid = g_utf8_validate (data, -1, NULL);
|
|
|
|
else
|
|
|
|
valid = g_utf8_validate (data, length, NULL);
|
|
|
|
}
|
2016-06-01 04:28:44 +08:00
|
|
|
|
|
|
|
if (! valid)
|
2016-05-31 00:56:29 +08:00
|
|
|
{
|
|
|
|
g_set_error (error, GIMP_ERROR, GIMP_FAILED,
|
|
|
|
_("'gimp-comment' parasite validation failed: "
|
|
|
|
"comment contains invalid UTF-8"));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
2014-03-24 02:46:09 +08:00
|
|
|
|
2014-03-22 07:11:15 +08:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
1998-10-08 16:15:21 +08:00
|
|
|
void
|
2006-04-02 23:37:25 +08:00
|
|
|
gimp_image_parasite_attach (GimpImage *image,
|
2019-05-30 22:44:23 +08:00
|
|
|
const GimpParasite *parasite,
|
|
|
|
gboolean push_undo)
|
1998-10-08 16:15:21 +08:00
|
|
|
{
|
2015-08-17 02:38:36 +08:00
|
|
|
GimpImagePrivate *private;
|
2015-08-17 01:38:11 +08:00
|
|
|
GimpParasite copy;
|
2015-09-25 03:33:30 +08:00
|
|
|
const gchar *name;
|
2006-04-02 23:37:25 +08:00
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
|
|
|
g_return_if_fail (parasite != NULL);
|
|
|
|
|
2015-08-17 02:38:36 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
2015-08-17 01:38:11 +08:00
|
|
|
|
2015-09-25 03:33:30 +08:00
|
|
|
name = gimp_parasite_name (parasite);
|
|
|
|
|
2015-08-17 16:37:55 +08:00
|
|
|
/* this is so ugly and is only for the PDB */
|
2015-09-25 03:33:30 +08:00
|
|
|
if (strcmp (name, GIMP_ICC_PROFILE_PARASITE_NAME) == 0)
|
2015-08-17 16:37:55 +08:00
|
|
|
{
|
|
|
|
GimpColorProfile *profile;
|
|
|
|
GimpColorProfile *builtin;
|
|
|
|
|
|
|
|
profile =
|
|
|
|
gimp_color_profile_new_from_icc_profile (gimp_parasite_data (parasite),
|
|
|
|
gimp_parasite_data_size (parasite),
|
|
|
|
NULL);
|
|
|
|
builtin = gimp_image_get_builtin_color_profile (image);
|
|
|
|
|
|
|
|
if (gimp_color_profile_is_equal (profile, builtin))
|
2019-05-30 22:07:57 +08:00
|
|
|
{
|
|
|
|
/* setting the builtin profile is equal to removing the profile */
|
2019-05-30 22:44:23 +08:00
|
|
|
gimp_image_parasite_detach (image, GIMP_ICC_PROFILE_PARASITE_NAME,
|
|
|
|
push_undo);
|
2019-05-30 22:07:57 +08:00
|
|
|
g_object_unref (profile);
|
|
|
|
return;
|
|
|
|
}
|
2015-08-17 16:37:55 +08:00
|
|
|
|
|
|
|
g_object_unref (profile);
|
|
|
|
}
|
|
|
|
|
2007-05-29 17:57:13 +08:00
|
|
|
/* make a temporary copy of the GimpParasite struct because
|
2006-04-02 23:37:25 +08:00
|
|
|
* gimp_parasite_shift_parent() changes it
|
|
|
|
*/
|
2007-05-29 17:57:13 +08:00
|
|
|
copy = *parasite;
|
2000-03-09 19:58:03 +08:00
|
|
|
|
2007-06-14 15:06:58 +08:00
|
|
|
/* only set the dirty bit manually if we can be saved and the new
|
|
|
|
* parasite differs from the current one and we aren't undoable
|
|
|
|
*/
|
2019-05-30 22:44:23 +08:00
|
|
|
if (push_undo && gimp_parasite_is_undoable (©))
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_undo_push_image_parasite (image,
|
2010-06-08 19:24:11 +08:00
|
|
|
C_("undo-type", "Attach Parasite to Image"),
|
2007-05-29 17:23:34 +08:00
|
|
|
©);
|
2000-08-24 03:29:01 +08:00
|
|
|
|
2018-04-26 02:31:11 +08:00
|
|
|
/* We used to push a cantundo on the stack here. This made the undo stack
|
2007-06-14 15:06:58 +08:00
|
|
|
* unusable (NULL on the stack) and prevented people from undoing after a
|
|
|
|
* save (since most save plug-ins attach an undoable comment parasite).
|
|
|
|
* Now we simply attach the parasite without pushing an undo. That way
|
|
|
|
* it's undoable but does not block the undo system. --Sven
|
2000-12-04 05:34:38 +08:00
|
|
|
*/
|
2015-08-17 02:38:36 +08:00
|
|
|
gimp_parasite_list_add (private->parasites, ©);
|
1999-08-22 19:45:31 +08:00
|
|
|
|
2019-05-30 22:44:23 +08:00
|
|
|
if (push_undo && gimp_parasite_has_flag (©, GIMP_PARASITE_ATTACH_PARENT))
|
1999-08-22 19:45:31 +08:00
|
|
|
{
|
2007-05-29 17:23:34 +08:00
|
|
|
gimp_parasite_shift_parent (©);
|
|
|
|
gimp_parasite_attach (image->gimp, ©);
|
1999-08-22 19:45:31 +08:00
|
|
|
}
|
2006-04-02 23:37:25 +08:00
|
|
|
|
2015-09-25 03:33:30 +08:00
|
|
|
if (strcmp (name, GIMP_ICC_PROFILE_PARASITE_NAME) == 0)
|
2015-08-27 01:16:17 +08:00
|
|
|
_gimp_image_update_color_profile (image, parasite);
|
2019-05-30 22:44:23 +08:00
|
|
|
|
|
|
|
g_signal_emit (image, gimp_image_signals[PARASITE_ATTACHED], 0,
|
|
|
|
name);
|
1998-10-08 16:15:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_parasite_detach (GimpImage *image,
|
2019-05-30 22:44:23 +08:00
|
|
|
const gchar *name,
|
|
|
|
gboolean push_undo)
|
1998-10-08 16:15:21 +08:00
|
|
|
{
|
2010-02-04 06:42:32 +08:00
|
|
|
GimpImagePrivate *private;
|
2006-04-02 23:37:25 +08:00
|
|
|
const GimpParasite *parasite;
|
1999-07-20 03:46:05 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2006-04-02 23:37:25 +08:00
|
|
|
g_return_if_fail (name != NULL);
|
2000-03-09 19:58:03 +08:00
|
|
|
|
2010-02-04 06:42:32 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
|
|
|
if (! (parasite = gimp_parasite_list_find (private->parasites, name)))
|
1998-12-16 19:23:30 +08:00
|
|
|
return;
|
1999-08-22 19:45:31 +08:00
|
|
|
|
2019-05-30 22:44:23 +08:00
|
|
|
if (push_undo && gimp_parasite_is_undoable (parasite))
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_undo_push_image_parasite_remove (image,
|
2010-06-08 19:24:11 +08:00
|
|
|
C_("undo-type", "Remove Parasite from Image"),
|
2006-04-02 23:37:25 +08:00
|
|
|
name);
|
2000-08-24 03:29:01 +08:00
|
|
|
|
2010-02-04 06:42:32 +08:00
|
|
|
gimp_parasite_list_remove (private->parasites, name);
|
2006-10-25 15:31:04 +08:00
|
|
|
|
2014-03-17 06:49:02 +08:00
|
|
|
if (strcmp (name, GIMP_ICC_PROFILE_PARASITE_NAME) == 0)
|
2015-08-27 01:16:17 +08:00
|
|
|
_gimp_image_update_color_profile (image, NULL);
|
2019-05-30 22:44:23 +08:00
|
|
|
|
|
|
|
g_signal_emit (image, gimp_image_signals[PARASITE_DETACHED], 0,
|
|
|
|
name);
|
1998-10-08 16:15:21 +08:00
|
|
|
}
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
|
|
|
/* tattoos */
|
|
|
|
|
2001-08-17 22:27:31 +08:00
|
|
|
GimpTattoo
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_get_new_tattoo (GimpImage *image)
|
1998-10-14 10:54:02 +08:00
|
|
|
{
|
2010-02-04 04:31:27 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), 0);
|
2001-08-17 22:27:31 +08:00
|
|
|
|
2010-02-04 04:31:27 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
|
|
|
private->tattoo_state++;
|
2000-12-29 00:19:55 +08:00
|
|
|
|
2010-02-04 04:31:27 +08:00
|
|
|
if (G_UNLIKELY (private->tattoo_state == 0))
|
2004-05-12 16:13:33 +08:00
|
|
|
g_warning ("%s: Tattoo state corrupted (integer overflow).", G_STRFUNC);
|
2000-12-29 00:19:55 +08:00
|
|
|
|
2010-02-04 04:31:27 +08:00
|
|
|
return private->tattoo_state;
|
1998-10-14 10:54:02 +08:00
|
|
|
}
|
|
|
|
|
2001-08-17 22:27:31 +08:00
|
|
|
GimpTattoo
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_get_tattoo_state (GimpImage *image)
|
2000-02-16 07:49:03 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), 0);
|
2001-08-17 22:27:31 +08:00
|
|
|
|
2010-02-04 04:31:27 +08:00
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->tattoo_state;
|
2000-02-16 07:49:03 +08:00
|
|
|
}
|
|
|
|
|
2000-03-09 19:58:03 +08:00
|
|
|
gboolean
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_set_tattoo_state (GimpImage *image,
|
2004-07-14 20:12:50 +08:00
|
|
|
GimpTattoo val)
|
2000-02-16 07:49:03 +08:00
|
|
|
{
|
2009-08-02 05:07:07 +08:00
|
|
|
GList *all_items;
|
2004-01-14 19:34:15 +08:00
|
|
|
GList *list;
|
|
|
|
gboolean retval = TRUE;
|
|
|
|
GimpTattoo maxval = 0;
|
2000-02-16 07:49:03 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
2000-03-09 19:58:03 +08:00
|
|
|
|
2006-07-06 22:40:03 +08:00
|
|
|
/* Check that the layer tattoos don't overlap with channel or vector ones */
|
2009-08-02 05:07:07 +08:00
|
|
|
all_items = gimp_image_get_layer_list (image);
|
|
|
|
|
|
|
|
for (list = all_items; list; list = g_list_next (list))
|
2000-02-16 07:49:03 +08:00
|
|
|
{
|
2001-08-17 22:27:31 +08:00
|
|
|
GimpTattoo ltattoo;
|
2002-05-08 20:39:01 +08:00
|
|
|
|
2002-02-26 01:58:50 +08:00
|
|
|
ltattoo = gimp_item_get_tattoo (GIMP_ITEM (list->data));
|
2000-03-09 19:58:03 +08:00
|
|
|
if (ltattoo > maxval)
|
2004-07-14 20:12:50 +08:00
|
|
|
maxval = ltattoo;
|
2002-02-26 01:58:50 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
if (gimp_image_get_channel_by_tattoo (image, ltattoo))
|
2002-05-08 20:39:01 +08:00
|
|
|
retval = FALSE; /* Oopps duplicated tattoo in channel */
|
2000-02-16 07:49:03 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
if (gimp_image_get_vectors_by_tattoo (image, ltattoo))
|
2002-05-08 20:39:01 +08:00
|
|
|
retval = FALSE; /* Oopps duplicated tattoo in vectors */
|
2000-02-16 07:49:03 +08:00
|
|
|
}
|
|
|
|
|
2009-08-02 05:07:07 +08:00
|
|
|
g_list_free (all_items);
|
|
|
|
|
2002-05-08 20:39:01 +08:00
|
|
|
/* Now check that the channel and vectors tattoos don't overlap */
|
2009-08-02 05:07:07 +08:00
|
|
|
all_items = gimp_image_get_channel_list (image);
|
|
|
|
|
|
|
|
for (list = all_items; list; list = g_list_next (list))
|
2000-02-16 07:49:03 +08:00
|
|
|
{
|
2001-08-17 22:27:31 +08:00
|
|
|
GimpTattoo ctattoo;
|
|
|
|
|
2004-01-14 19:34:15 +08:00
|
|
|
ctattoo = gimp_item_get_tattoo (GIMP_ITEM (list->data));
|
2000-03-09 19:58:03 +08:00
|
|
|
if (ctattoo > maxval)
|
2004-07-14 20:12:50 +08:00
|
|
|
maxval = ctattoo;
|
2002-02-26 01:58:50 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
if (gimp_image_get_vectors_by_tattoo (image, ctattoo))
|
2002-05-08 20:39:01 +08:00
|
|
|
retval = FALSE; /* Oopps duplicated tattoo in vectors */
|
2000-02-16 07:49:03 +08:00
|
|
|
}
|
|
|
|
|
2009-08-02 05:07:07 +08:00
|
|
|
g_list_free (all_items);
|
|
|
|
|
2004-01-14 19:34:15 +08:00
|
|
|
/* Find the max tattoo value in the vectors */
|
2009-08-02 05:07:07 +08:00
|
|
|
all_items = gimp_image_get_vectors_list (image);
|
|
|
|
|
|
|
|
for (list = all_items; list; list = g_list_next (list))
|
2000-02-16 07:49:03 +08:00
|
|
|
{
|
2002-02-26 01:58:50 +08:00
|
|
|
GimpTattoo vtattoo;
|
2000-02-16 07:49:03 +08:00
|
|
|
|
2002-02-26 01:58:50 +08:00
|
|
|
vtattoo = gimp_item_get_tattoo (GIMP_ITEM (list->data));
|
|
|
|
if (vtattoo > maxval)
|
2004-07-14 20:12:50 +08:00
|
|
|
maxval = vtattoo;
|
2000-02-16 07:49:03 +08:00
|
|
|
}
|
|
|
|
|
2009-08-02 05:07:07 +08:00
|
|
|
g_list_free (all_items);
|
|
|
|
|
2000-03-10 06:41:19 +08:00
|
|
|
if (val < maxval)
|
2000-02-16 07:49:03 +08:00
|
|
|
retval = FALSE;
|
2002-05-08 20:39:01 +08:00
|
|
|
|
|
|
|
/* Must check if the state is valid */
|
2000-03-09 19:58:03 +08:00
|
|
|
if (retval == TRUE)
|
2010-02-04 04:31:27 +08:00
|
|
|
GIMP_IMAGE_GET_PRIVATE (image)->tattoo_state = val;
|
2000-02-16 07:49:03 +08:00
|
|
|
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2008-08-07 17:17:46 +08:00
|
|
|
/* projection */
|
|
|
|
|
|
|
|
GimpProjection *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_projection (GimpImage *image)
|
2008-08-07 17:17:46 +08:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
2010-02-04 04:46:09 +08:00
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->projection;
|
2008-08-07 17:17:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-05-22 01:38:14 +08:00
|
|
|
/* layers / channels / vectors */
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2010-02-06 23:17:23 +08:00
|
|
|
GimpItemTree *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_layer_tree (GimpImage *image)
|
2010-02-06 23:17:23 +08:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->layers;
|
|
|
|
}
|
|
|
|
|
|
|
|
GimpItemTree *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_channel_tree (GimpImage *image)
|
2010-02-06 23:17:23 +08:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->channels;
|
|
|
|
}
|
|
|
|
|
|
|
|
GimpItemTree *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_vectors_tree (GimpImage *image)
|
2010-02-06 23:17:23 +08:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->vectors;
|
|
|
|
}
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
GimpContainer *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_layers (GimpImage *image)
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2010-02-06 20:41:16 +08:00
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->layers->container;
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
GimpContainer *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_channels (GimpImage *image)
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2010-02-06 20:41:16 +08:00
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->channels->container;
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
|
|
|
|
2002-02-24 01:29:19 +08:00
|
|
|
GimpContainer *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_vectors (GimpImage *image)
|
2002-02-24 01:29:19 +08:00
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
2002-02-24 01:29:19 +08:00
|
|
|
|
2010-02-06 20:41:16 +08:00
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->vectors->container;
|
2002-02-24 01:29:19 +08:00
|
|
|
}
|
|
|
|
|
2009-08-02 18:12:01 +08:00
|
|
|
gint
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_n_layers (GimpImage *image)
|
2009-08-02 18:12:01 +08:00
|
|
|
{
|
2010-02-07 22:27:21 +08:00
|
|
|
GimpItemStack *stack;
|
2010-02-04 06:00:31 +08:00
|
|
|
|
2009-08-02 18:12:01 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), 0);
|
|
|
|
|
2010-02-07 22:27:21 +08:00
|
|
|
stack = GIMP_ITEM_STACK (gimp_image_get_layers (image));
|
2010-02-04 06:00:31 +08:00
|
|
|
|
2010-02-07 22:27:21 +08:00
|
|
|
return gimp_item_stack_get_n_items (stack);
|
2009-08-02 18:12:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_n_channels (GimpImage *image)
|
2009-08-02 18:12:01 +08:00
|
|
|
{
|
2010-02-07 22:27:21 +08:00
|
|
|
GimpItemStack *stack;
|
2010-02-04 06:00:31 +08:00
|
|
|
|
2009-08-02 18:12:01 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), 0);
|
|
|
|
|
2010-02-07 22:27:21 +08:00
|
|
|
stack = GIMP_ITEM_STACK (gimp_image_get_channels (image));
|
2010-02-04 06:00:31 +08:00
|
|
|
|
2010-02-07 22:27:21 +08:00
|
|
|
return gimp_item_stack_get_n_items (stack);
|
2009-08-02 18:12:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_n_vectors (GimpImage *image)
|
2009-08-02 18:12:01 +08:00
|
|
|
{
|
2010-02-07 22:27:21 +08:00
|
|
|
GimpItemStack *stack;
|
2010-02-04 06:00:31 +08:00
|
|
|
|
2009-08-02 18:12:01 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), 0);
|
|
|
|
|
2010-02-07 22:27:21 +08:00
|
|
|
stack = GIMP_ITEM_STACK (gimp_image_get_vectors (image));
|
2010-02-04 06:00:31 +08:00
|
|
|
|
2010-02-07 22:27:21 +08:00
|
|
|
return gimp_item_stack_get_n_items (stack);
|
2009-08-02 18:12:01 +08:00
|
|
|
}
|
|
|
|
|
2008-11-03 04:46:57 +08:00
|
|
|
GList *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_layer_iter (GimpImage *image)
|
2008-11-03 04:46:57 +08:00
|
|
|
{
|
2010-02-07 22:27:21 +08:00
|
|
|
GimpItemStack *stack;
|
2010-02-04 06:00:31 +08:00
|
|
|
|
2008-11-03 04:46:57 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
2010-02-07 22:27:21 +08:00
|
|
|
stack = GIMP_ITEM_STACK (gimp_image_get_layers (image));
|
2010-02-04 06:00:31 +08:00
|
|
|
|
2010-02-07 22:27:21 +08:00
|
|
|
return gimp_item_stack_get_item_iter (stack);
|
2008-11-03 04:46:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
GList *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_channel_iter (GimpImage *image)
|
2008-11-03 04:46:57 +08:00
|
|
|
{
|
2010-02-07 22:27:21 +08:00
|
|
|
GimpItemStack *stack;
|
2010-02-04 06:00:31 +08:00
|
|
|
|
2008-11-03 04:46:57 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
2010-02-07 22:27:21 +08:00
|
|
|
stack = GIMP_ITEM_STACK (gimp_image_get_channels (image));
|
2010-02-04 06:00:31 +08:00
|
|
|
|
2010-02-07 22:27:21 +08:00
|
|
|
return gimp_item_stack_get_item_iter (stack);
|
2008-11-03 04:46:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
GList *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_vectors_iter (GimpImage *image)
|
2008-11-03 04:46:57 +08:00
|
|
|
{
|
2010-02-07 22:27:21 +08:00
|
|
|
GimpItemStack *stack;
|
2010-02-04 06:00:31 +08:00
|
|
|
|
2008-11-03 04:46:57 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
2010-02-07 22:27:21 +08:00
|
|
|
stack = GIMP_ITEM_STACK (gimp_image_get_vectors (image));
|
2010-02-04 06:00:31 +08:00
|
|
|
|
2010-02-07 22:27:21 +08:00
|
|
|
return gimp_item_stack_get_item_iter (stack);
|
2008-11-03 04:46:57 +08:00
|
|
|
}
|
|
|
|
|
2009-08-02 03:59:45 +08:00
|
|
|
GList *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_layer_list (GimpImage *image)
|
2009-08-02 03:59:45 +08:00
|
|
|
{
|
2010-02-07 22:27:21 +08:00
|
|
|
GimpItemStack *stack;
|
2010-02-04 06:00:31 +08:00
|
|
|
|
2009-08-02 03:59:45 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
2010-02-07 22:27:21 +08:00
|
|
|
stack = GIMP_ITEM_STACK (gimp_image_get_layers (image));
|
2010-02-04 06:00:31 +08:00
|
|
|
|
2010-02-07 22:27:21 +08:00
|
|
|
return gimp_item_stack_get_item_list (stack);
|
2009-08-02 03:59:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
GList *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_channel_list (GimpImage *image)
|
2009-08-02 03:59:45 +08:00
|
|
|
{
|
2010-02-07 22:27:21 +08:00
|
|
|
GimpItemStack *stack;
|
2010-02-04 06:00:31 +08:00
|
|
|
|
2009-08-02 03:59:45 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
2010-02-07 22:27:21 +08:00
|
|
|
stack = GIMP_ITEM_STACK (gimp_image_get_channels (image));
|
2010-02-04 06:00:31 +08:00
|
|
|
|
2010-02-07 22:27:21 +08:00
|
|
|
return gimp_item_stack_get_item_list (stack);
|
2009-08-02 03:59:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
GList *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_vectors_list (GimpImage *image)
|
2009-08-02 03:59:45 +08:00
|
|
|
{
|
2010-02-07 22:27:21 +08:00
|
|
|
GimpItemStack *stack;
|
2010-02-04 06:00:31 +08:00
|
|
|
|
2009-08-02 03:59:45 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
2010-02-07 22:27:21 +08:00
|
|
|
stack = GIMP_ITEM_STACK (gimp_image_get_vectors (image));
|
2010-02-04 06:00:31 +08:00
|
|
|
|
2010-02-07 22:27:21 +08:00
|
|
|
return gimp_item_stack_get_item_list (stack);
|
2009-08-02 03:59:45 +08:00
|
|
|
}
|
|
|
|
|
2010-02-08 02:21:42 +08:00
|
|
|
|
|
|
|
/* active drawable, layer, channel, vectors */
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
GimpDrawable *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_active_drawable (GimpImage *image)
|
2000-12-29 00:19:55 +08:00
|
|
|
{
|
2010-02-04 06:12:22 +08:00
|
|
|
GimpImagePrivate *private;
|
2010-02-07 21:52:34 +08:00
|
|
|
GimpItem *active_channel;
|
|
|
|
GimpItem *active_layer;
|
2010-02-04 06:12:22 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
2000-12-29 00:19:55 +08:00
|
|
|
|
2010-02-04 06:12:22 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
2010-02-07 21:52:34 +08:00
|
|
|
active_channel = gimp_item_tree_get_active_item (private->channels);
|
|
|
|
active_layer = gimp_item_tree_get_active_item (private->layers);
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
/* If there is an active channel (a saved selection, etc.),
|
|
|
|
* we ignore the active layer
|
|
|
|
*/
|
2010-02-07 21:52:34 +08:00
|
|
|
if (active_channel)
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2010-02-07 21:52:34 +08:00
|
|
|
return GIMP_DRAWABLE (active_channel);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
2010-02-07 21:52:34 +08:00
|
|
|
else if (active_layer)
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2010-02-07 21:52:34 +08:00
|
|
|
GimpLayer *layer = GIMP_LAYER (active_layer);
|
2007-12-24 00:58:41 +08:00
|
|
|
GimpLayerMask *mask = gimp_layer_get_mask (layer);
|
2001-05-07 00:14:34 +08:00
|
|
|
|
2012-03-18 01:30:13 +08:00
|
|
|
if (mask && gimp_layer_get_edit_mask (layer))
|
2007-12-24 00:58:41 +08:00
|
|
|
return GIMP_DRAWABLE (mask);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
else
|
2004-07-14 20:12:50 +08:00
|
|
|
return GIMP_DRAWABLE (layer);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
2001-06-01 03:53:13 +08:00
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
return NULL;
|
2001-06-01 03:53:13 +08:00
|
|
|
}
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
GimpLayer *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_active_layer (GimpImage *image)
|
2001-11-01 05:18:57 +08:00
|
|
|
{
|
2010-02-07 22:27:21 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
2001-11-01 05:18:57 +08:00
|
|
|
|
2010-02-07 22:27:21 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
|
|
|
return GIMP_LAYER (gimp_item_tree_get_active_item (private->layers));
|
2001-11-01 05:18:57 +08:00
|
|
|
}
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
GimpChannel *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_active_channel (GimpImage *image)
|
2001-11-01 05:18:57 +08:00
|
|
|
{
|
2010-02-07 22:27:21 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
2001-11-01 05:18:57 +08:00
|
|
|
|
2010-02-07 22:27:21 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
|
|
|
return GIMP_CHANNEL (gimp_item_tree_get_active_item (private->channels));
|
2001-11-01 05:18:57 +08:00
|
|
|
}
|
|
|
|
|
2002-02-24 01:29:19 +08:00
|
|
|
GimpVectors *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_active_vectors (GimpImage *image)
|
2002-02-24 01:29:19 +08:00
|
|
|
{
|
2010-02-07 22:27:21 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
2002-02-24 01:29:19 +08:00
|
|
|
|
2010-02-07 22:27:21 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
|
|
|
return GIMP_VECTORS (gimp_item_tree_get_active_item (private->vectors));
|
2002-02-24 01:29:19 +08:00
|
|
|
}
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
GimpLayer *
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_set_active_layer (GimpImage *image,
|
2004-07-14 20:12:50 +08:00
|
|
|
GimpLayer *layer)
|
2001-11-11 03:10:28 +08:00
|
|
|
{
|
2010-02-04 06:00:31 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
GimpLayer *floating_sel;
|
2010-02-07 21:52:34 +08:00
|
|
|
GimpLayer *active_layer;
|
don't allow to select anything but the floating selection. Fixes bug
2004-01-18 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c (gimp_image_set_active_layer): don't allow
to select anything but the floating selection. Fixes bug #128025.
(gimp_image_set_active_layer,channel,vectors): allow to pass NULL
to unselect the active item. Removed the silly feature that
passing some random item of another image would select the first
item in the list (was unused anyway).
(gimp_image_unset_active_channel): use gimp_image_set_active_channel()
now that it accepts NULL.
(gimp_image_add_layer,channel,vectors): cleaned up / simplified.
(gimp_image_remove_layer,channel,vectors): cleanup,
simplification, use gimp_image_set_active_layer,channel,vectors()
now that they accept NULL, make sure the item next to the removed
item becomes the active one (and not the first in the list, which
was a severe usability problem in the dialogs).
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): pass
NULL to the set_active functions, cleanup.
* app/core/gimpimage-duplicate.c: attach the floating selection
before setting the active layer. Code relied on broken
gimp_image_set_active_layer() behaviour before.
* app/core/gimplayer-floating-sel.c: no need to set
gimage->floating_sel before calling gimp_image_add_layer(). The
weird GUI mentioned in the comment existed in 1.2 only.
* app/display/gimpdisplayshell-layer-select.c (layer_select_advance):
don't assume that setting the active_layer always succeeds.
* tools/pdbgen/pdb/image.pdb: behave as the documentation says
and return an execution error if setting the active layer or
channel failed.
Unrelated:
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/layer.pdb: removed leftover cruft from the old
guchar based color API.
* tools/pdbgen/pdb/channel.pdb: simplified code which handles the
channel's color.
* app/pdb/channel_cmds.c
* app/pdb/image_cmds.c: regenerated.
2004-01-18 20:16:44 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
don't allow to select anything but the floating selection. Fixes bug
2004-01-18 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c (gimp_image_set_active_layer): don't allow
to select anything but the floating selection. Fixes bug #128025.
(gimp_image_set_active_layer,channel,vectors): allow to pass NULL
to unselect the active item. Removed the silly feature that
passing some random item of another image would select the first
item in the list (was unused anyway).
(gimp_image_unset_active_channel): use gimp_image_set_active_channel()
now that it accepts NULL.
(gimp_image_add_layer,channel,vectors): cleaned up / simplified.
(gimp_image_remove_layer,channel,vectors): cleanup,
simplification, use gimp_image_set_active_layer,channel,vectors()
now that they accept NULL, make sure the item next to the removed
item becomes the active one (and not the first in the list, which
was a severe usability problem in the dialogs).
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): pass
NULL to the set_active functions, cleanup.
* app/core/gimpimage-duplicate.c: attach the floating selection
before setting the active layer. Code relied on broken
gimp_image_set_active_layer() behaviour before.
* app/core/gimplayer-floating-sel.c: no need to set
gimage->floating_sel before calling gimp_image_add_layer(). The
weird GUI mentioned in the comment existed in 1.2 only.
* app/display/gimpdisplayshell-layer-select.c (layer_select_advance):
don't assume that setting the active_layer always succeeds.
* tools/pdbgen/pdb/image.pdb: behave as the documentation says
and return an execution error if setting the active layer or
channel failed.
Unrelated:
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/layer.pdb: removed leftover cruft from the old
guchar based color API.
* tools/pdbgen/pdb/channel.pdb: simplified code which handles the
channel's color.
* app/pdb/channel_cmds.c
* app/pdb/image_cmds.c: regenerated.
2004-01-18 20:16:44 +08:00
|
|
|
g_return_val_if_fail (layer == NULL || GIMP_IS_LAYER (layer), NULL);
|
|
|
|
g_return_val_if_fail (layer == NULL ||
|
2009-08-02 07:03:58 +08:00
|
|
|
(gimp_item_is_attached (GIMP_ITEM (layer)) &&
|
|
|
|
gimp_item_get_image (GIMP_ITEM (layer)) == image),
|
|
|
|
NULL);
|
2001-11-11 03:10:28 +08:00
|
|
|
|
2010-02-04 06:00:31 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
2008-11-14 23:01:44 +08:00
|
|
|
floating_sel = gimp_image_get_floating_selection (image);
|
don't allow to select anything but the floating selection. Fixes bug
2004-01-18 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c (gimp_image_set_active_layer): don't allow
to select anything but the floating selection. Fixes bug #128025.
(gimp_image_set_active_layer,channel,vectors): allow to pass NULL
to unselect the active item. Removed the silly feature that
passing some random item of another image would select the first
item in the list (was unused anyway).
(gimp_image_unset_active_channel): use gimp_image_set_active_channel()
now that it accepts NULL.
(gimp_image_add_layer,channel,vectors): cleaned up / simplified.
(gimp_image_remove_layer,channel,vectors): cleanup,
simplification, use gimp_image_set_active_layer,channel,vectors()
now that they accept NULL, make sure the item next to the removed
item becomes the active one (and not the first in the list, which
was a severe usability problem in the dialogs).
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): pass
NULL to the set_active functions, cleanup.
* app/core/gimpimage-duplicate.c: attach the floating selection
before setting the active layer. Code relied on broken
gimp_image_set_active_layer() behaviour before.
* app/core/gimplayer-floating-sel.c: no need to set
gimage->floating_sel before calling gimp_image_add_layer(). The
weird GUI mentioned in the comment existed in 1.2 only.
* app/display/gimpdisplayshell-layer-select.c (layer_select_advance):
don't assume that setting the active_layer always succeeds.
* tools/pdbgen/pdb/image.pdb: behave as the documentation says
and return an execution error if setting the active layer or
channel failed.
Unrelated:
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/layer.pdb: removed leftover cruft from the old
guchar based color API.
* tools/pdbgen/pdb/channel.pdb: simplified code which handles the
channel's color.
* app/pdb/channel_cmds.c
* app/pdb/image_cmds.c: regenerated.
2004-01-18 20:16:44 +08:00
|
|
|
|
|
|
|
/* Make sure the floating_sel always is the active layer */
|
|
|
|
if (floating_sel && layer != floating_sel)
|
|
|
|
return floating_sel;
|
2001-11-11 03:10:28 +08:00
|
|
|
|
2010-02-07 21:52:34 +08:00
|
|
|
active_layer = gimp_image_get_active_layer (image);
|
|
|
|
|
|
|
|
if (layer != active_layer)
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
don't allow to select anything but the floating selection. Fixes bug
2004-01-18 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c (gimp_image_set_active_layer): don't allow
to select anything but the floating selection. Fixes bug #128025.
(gimp_image_set_active_layer,channel,vectors): allow to pass NULL
to unselect the active item. Removed the silly feature that
passing some random item of another image would select the first
item in the list (was unused anyway).
(gimp_image_unset_active_channel): use gimp_image_set_active_channel()
now that it accepts NULL.
(gimp_image_add_layer,channel,vectors): cleaned up / simplified.
(gimp_image_remove_layer,channel,vectors): cleanup,
simplification, use gimp_image_set_active_layer,channel,vectors()
now that they accept NULL, make sure the item next to the removed
item becomes the active one (and not the first in the list, which
was a severe usability problem in the dialogs).
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): pass
NULL to the set_active functions, cleanup.
* app/core/gimpimage-duplicate.c: attach the floating selection
before setting the active layer. Code relied on broken
gimp_image_set_active_layer() behaviour before.
* app/core/gimplayer-floating-sel.c: no need to set
gimage->floating_sel before calling gimp_image_add_layer(). The
weird GUI mentioned in the comment existed in 1.2 only.
* app/display/gimpdisplayshell-layer-select.c (layer_select_advance):
don't assume that setting the active_layer always succeeds.
* tools/pdbgen/pdb/image.pdb: behave as the documentation says
and return an execution error if setting the active layer or
channel failed.
Unrelated:
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/layer.pdb: removed leftover cruft from the old
guchar based color API.
* tools/pdbgen/pdb/channel.pdb: simplified code which handles the
channel's color.
* app/pdb/channel_cmds.c
* app/pdb/image_cmds.c: regenerated.
2004-01-18 20:16:44 +08:00
|
|
|
/* Don't cache selection info for the previous active layer */
|
2010-02-07 21:52:34 +08:00
|
|
|
if (active_layer)
|
|
|
|
gimp_drawable_invalidate_boundary (GIMP_DRAWABLE (active_layer));
|
don't allow to select anything but the floating selection. Fixes bug
2004-01-18 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c (gimp_image_set_active_layer): don't allow
to select anything but the floating selection. Fixes bug #128025.
(gimp_image_set_active_layer,channel,vectors): allow to pass NULL
to unselect the active item. Removed the silly feature that
passing some random item of another image would select the first
item in the list (was unused anyway).
(gimp_image_unset_active_channel): use gimp_image_set_active_channel()
now that it accepts NULL.
(gimp_image_add_layer,channel,vectors): cleaned up / simplified.
(gimp_image_remove_layer,channel,vectors): cleanup,
simplification, use gimp_image_set_active_layer,channel,vectors()
now that they accept NULL, make sure the item next to the removed
item becomes the active one (and not the first in the list, which
was a severe usability problem in the dialogs).
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): pass
NULL to the set_active functions, cleanup.
* app/core/gimpimage-duplicate.c: attach the floating selection
before setting the active layer. Code relied on broken
gimp_image_set_active_layer() behaviour before.
* app/core/gimplayer-floating-sel.c: no need to set
gimage->floating_sel before calling gimp_image_add_layer(). The
weird GUI mentioned in the comment existed in 1.2 only.
* app/display/gimpdisplayshell-layer-select.c (layer_select_advance):
don't assume that setting the active_layer always succeeds.
* tools/pdbgen/pdb/image.pdb: behave as the documentation says
and return an execution error if setting the active layer or
channel failed.
Unrelated:
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/layer.pdb: removed leftover cruft from the old
guchar based color API.
* tools/pdbgen/pdb/channel.pdb: simplified code which handles the
channel's color.
* app/pdb/channel_cmds.c
* app/pdb/image_cmds.c: regenerated.
2004-01-18 20:16:44 +08:00
|
|
|
|
2010-02-07 21:52:34 +08:00
|
|
|
gimp_item_tree_set_active_item (private->layers, GIMP_ITEM (layer));
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
|
|
|
|
2010-02-07 21:52:34 +08:00
|
|
|
return gimp_image_get_active_layer (image);
|
2001-07-08 06:49:01 +08:00
|
|
|
}
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
GimpChannel *
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_set_active_channel (GimpImage *image,
|
2004-07-14 20:12:50 +08:00
|
|
|
GimpChannel *channel)
|
2001-11-14 23:40:30 +08:00
|
|
|
{
|
2010-02-04 06:12:22 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
don't allow to select anything but the floating selection. Fixes bug
2004-01-18 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c (gimp_image_set_active_layer): don't allow
to select anything but the floating selection. Fixes bug #128025.
(gimp_image_set_active_layer,channel,vectors): allow to pass NULL
to unselect the active item. Removed the silly feature that
passing some random item of another image would select the first
item in the list (was unused anyway).
(gimp_image_unset_active_channel): use gimp_image_set_active_channel()
now that it accepts NULL.
(gimp_image_add_layer,channel,vectors): cleaned up / simplified.
(gimp_image_remove_layer,channel,vectors): cleanup,
simplification, use gimp_image_set_active_layer,channel,vectors()
now that they accept NULL, make sure the item next to the removed
item becomes the active one (and not the first in the list, which
was a severe usability problem in the dialogs).
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): pass
NULL to the set_active functions, cleanup.
* app/core/gimpimage-duplicate.c: attach the floating selection
before setting the active layer. Code relied on broken
gimp_image_set_active_layer() behaviour before.
* app/core/gimplayer-floating-sel.c: no need to set
gimage->floating_sel before calling gimp_image_add_layer(). The
weird GUI mentioned in the comment existed in 1.2 only.
* app/display/gimpdisplayshell-layer-select.c (layer_select_advance):
don't assume that setting the active_layer always succeeds.
* tools/pdbgen/pdb/image.pdb: behave as the documentation says
and return an execution error if setting the active layer or
channel failed.
Unrelated:
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/layer.pdb: removed leftover cruft from the old
guchar based color API.
* tools/pdbgen/pdb/channel.pdb: simplified code which handles the
channel's color.
* app/pdb/channel_cmds.c
* app/pdb/image_cmds.c: regenerated.
2004-01-18 20:16:44 +08:00
|
|
|
g_return_val_if_fail (channel == NULL || GIMP_IS_CHANNEL (channel), NULL);
|
|
|
|
g_return_val_if_fail (channel == NULL ||
|
2009-08-02 07:03:58 +08:00
|
|
|
(gimp_item_is_attached (GIMP_ITEM (channel)) &&
|
|
|
|
gimp_item_get_image (GIMP_ITEM (channel)) == image),
|
|
|
|
NULL);
|
2001-11-14 23:40:30 +08:00
|
|
|
|
2010-02-04 06:12:22 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
/* Not if there is a floating selection */
|
2008-11-14 23:01:44 +08:00
|
|
|
if (channel && gimp_image_get_floating_selection (image))
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
return NULL;
|
2001-11-14 23:40:30 +08:00
|
|
|
|
2010-02-08 08:10:21 +08:00
|
|
|
if (channel != gimp_image_get_active_channel (image))
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2010-02-07 21:52:34 +08:00
|
|
|
gimp_item_tree_set_active_item (private->channels, GIMP_ITEM (channel));
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
2001-01-29 00:44:22 +08:00
|
|
|
|
2010-02-07 21:52:34 +08:00
|
|
|
return gimp_image_get_active_channel (image);
|
2001-01-29 00:44:22 +08:00
|
|
|
}
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
GimpChannel *
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_unset_active_channel (GimpImage *image)
|
2001-02-27 22:14:13 +08:00
|
|
|
{
|
2010-02-04 06:00:31 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
GimpChannel *channel;
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
2001-02-27 22:14:13 +08:00
|
|
|
|
2010-02-04 06:00:31 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
2010-02-07 21:52:34 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
channel = gimp_image_get_active_channel (image);
|
2001-02-27 22:14:13 +08:00
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
if (channel)
|
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_set_active_channel (image, NULL);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2010-02-04 06:00:31 +08:00
|
|
|
if (private->layer_stack)
|
|
|
|
gimp_image_set_active_layer (image, private->layer_stack->data);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return channel;
|
2001-02-27 22:14:13 +08:00
|
|
|
}
|
|
|
|
|
2002-02-24 01:29:19 +08:00
|
|
|
GimpVectors *
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_set_active_vectors (GimpImage *image,
|
2004-07-14 20:12:50 +08:00
|
|
|
GimpVectors *vectors)
|
2002-02-24 01:29:19 +08:00
|
|
|
{
|
2010-02-04 06:12:22 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
don't allow to select anything but the floating selection. Fixes bug
2004-01-18 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c (gimp_image_set_active_layer): don't allow
to select anything but the floating selection. Fixes bug #128025.
(gimp_image_set_active_layer,channel,vectors): allow to pass NULL
to unselect the active item. Removed the silly feature that
passing some random item of another image would select the first
item in the list (was unused anyway).
(gimp_image_unset_active_channel): use gimp_image_set_active_channel()
now that it accepts NULL.
(gimp_image_add_layer,channel,vectors): cleaned up / simplified.
(gimp_image_remove_layer,channel,vectors): cleanup,
simplification, use gimp_image_set_active_layer,channel,vectors()
now that they accept NULL, make sure the item next to the removed
item becomes the active one (and not the first in the list, which
was a severe usability problem in the dialogs).
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): pass
NULL to the set_active functions, cleanup.
* app/core/gimpimage-duplicate.c: attach the floating selection
before setting the active layer. Code relied on broken
gimp_image_set_active_layer() behaviour before.
* app/core/gimplayer-floating-sel.c: no need to set
gimage->floating_sel before calling gimp_image_add_layer(). The
weird GUI mentioned in the comment existed in 1.2 only.
* app/display/gimpdisplayshell-layer-select.c (layer_select_advance):
don't assume that setting the active_layer always succeeds.
* tools/pdbgen/pdb/image.pdb: behave as the documentation says
and return an execution error if setting the active layer or
channel failed.
Unrelated:
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/layer.pdb: removed leftover cruft from the old
guchar based color API.
* tools/pdbgen/pdb/channel.pdb: simplified code which handles the
channel's color.
* app/pdb/channel_cmds.c
* app/pdb/image_cmds.c: regenerated.
2004-01-18 20:16:44 +08:00
|
|
|
g_return_val_if_fail (vectors == NULL || GIMP_IS_VECTORS (vectors), NULL);
|
|
|
|
g_return_val_if_fail (vectors == NULL ||
|
2009-08-02 07:03:58 +08:00
|
|
|
(gimp_item_is_attached (GIMP_ITEM (vectors)) &&
|
|
|
|
gimp_item_get_image (GIMP_ITEM (vectors)) == image),
|
|
|
|
NULL);
|
2002-02-24 01:29:19 +08:00
|
|
|
|
2010-02-04 06:12:22 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
2010-02-08 08:10:21 +08:00
|
|
|
if (vectors != gimp_image_get_active_vectors (image))
|
2002-02-24 01:29:19 +08:00
|
|
|
{
|
2010-02-07 21:52:34 +08:00
|
|
|
gimp_item_tree_set_active_item (private->vectors, GIMP_ITEM (vectors));
|
2002-02-24 01:29:19 +08:00
|
|
|
}
|
|
|
|
|
2010-02-07 21:52:34 +08:00
|
|
|
return gimp_image_get_active_vectors (image);
|
2002-02-24 01:29:19 +08:00
|
|
|
}
|
|
|
|
|
2010-02-08 02:21:42 +08:00
|
|
|
|
|
|
|
/* layer, channel, vectors by tattoo */
|
|
|
|
|
2006-08-04 17:26:45 +08:00
|
|
|
GimpLayer *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_layer_by_tattoo (GimpImage *image,
|
|
|
|
GimpTattoo tattoo)
|
2006-08-04 17:26:45 +08:00
|
|
|
{
|
2009-09-08 16:23:47 +08:00
|
|
|
GimpItemStack *stack;
|
|
|
|
|
2006-08-04 17:26:45 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
2010-02-07 22:27:21 +08:00
|
|
|
stack = GIMP_ITEM_STACK (gimp_image_get_layers (image));
|
2009-09-08 16:23:47 +08:00
|
|
|
|
|
|
|
return GIMP_LAYER (gimp_item_stack_get_item_by_tattoo (stack, tattoo));
|
2006-08-04 17:26:45 +08:00
|
|
|
}
|
|
|
|
|
2001-01-29 10:45:02 +08:00
|
|
|
GimpChannel *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_channel_by_tattoo (GimpImage *image,
|
|
|
|
GimpTattoo tattoo)
|
1998-10-14 10:54:02 +08:00
|
|
|
{
|
2009-09-08 16:23:47 +08:00
|
|
|
GimpItemStack *stack;
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
1998-10-14 10:54:02 +08:00
|
|
|
|
2010-02-07 22:27:21 +08:00
|
|
|
stack = GIMP_ITEM_STACK (gimp_image_get_channels (image));
|
2009-09-08 16:23:47 +08:00
|
|
|
|
|
|
|
return GIMP_CHANNEL (gimp_item_stack_get_item_by_tattoo (stack, tattoo));
|
1998-10-14 10:54:02 +08:00
|
|
|
}
|
|
|
|
|
2002-02-24 01:29:19 +08:00
|
|
|
GimpVectors *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_vectors_by_tattoo (GimpImage *image,
|
|
|
|
GimpTattoo tattoo)
|
2002-02-24 01:29:19 +08:00
|
|
|
{
|
2009-09-08 16:23:47 +08:00
|
|
|
GimpItemStack *stack;
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
2002-02-24 01:29:19 +08:00
|
|
|
|
2010-02-07 22:27:21 +08:00
|
|
|
stack = GIMP_ITEM_STACK (gimp_image_get_vectors (image));
|
2009-09-08 16:23:47 +08:00
|
|
|
|
|
|
|
return GIMP_VECTORS (gimp_item_stack_get_item_by_tattoo (stack, tattoo));
|
2009-08-02 06:21:31 +08:00
|
|
|
}
|
|
|
|
|
2010-02-08 02:21:42 +08:00
|
|
|
|
|
|
|
/* layer, channel, vectors by name */
|
|
|
|
|
2002-02-24 01:29:19 +08:00
|
|
|
GimpLayer *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_layer_by_name (GimpImage *image,
|
|
|
|
const gchar *name)
|
2002-02-24 01:29:19 +08:00
|
|
|
{
|
2010-02-07 23:34:44 +08:00
|
|
|
GimpItemTree *tree;
|
2009-09-08 16:23:47 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
2009-08-02 06:21:31 +08:00
|
|
|
g_return_val_if_fail (name != NULL, NULL);
|
2002-02-24 01:29:19 +08:00
|
|
|
|
2010-02-07 23:34:44 +08:00
|
|
|
tree = gimp_image_get_layer_tree (image);
|
2009-09-08 16:23:47 +08:00
|
|
|
|
2010-02-07 23:34:44 +08:00
|
|
|
return GIMP_LAYER (gimp_item_tree_get_item_by_name (tree, name));
|
2002-02-24 01:29:19 +08:00
|
|
|
}
|
|
|
|
|
2001-01-29 10:45:02 +08:00
|
|
|
GimpChannel *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_channel_by_name (GimpImage *image,
|
|
|
|
const gchar *name)
|
1999-07-07 11:18:54 +08:00
|
|
|
{
|
2010-02-07 23:34:44 +08:00
|
|
|
GimpItemTree *tree;
|
2009-09-08 16:23:47 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
2009-08-02 06:21:31 +08:00
|
|
|
g_return_val_if_fail (name != NULL, NULL);
|
1999-07-07 11:18:54 +08:00
|
|
|
|
2010-02-07 23:34:44 +08:00
|
|
|
tree = gimp_image_get_channel_tree (image);
|
2009-09-08 16:23:47 +08:00
|
|
|
|
2010-02-07 23:34:44 +08:00
|
|
|
return GIMP_CHANNEL (gimp_item_tree_get_item_by_name (tree, name));
|
2002-02-24 01:29:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
GimpVectors *
|
2016-05-20 05:51:44 +08:00
|
|
|
gimp_image_get_vectors_by_name (GimpImage *image,
|
|
|
|
const gchar *name)
|
2002-02-24 01:29:19 +08:00
|
|
|
{
|
2010-02-07 23:34:44 +08:00
|
|
|
GimpItemTree *tree;
|
2009-09-08 16:23:47 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
2009-08-02 06:21:31 +08:00
|
|
|
g_return_val_if_fail (name != NULL, NULL);
|
2002-02-24 01:29:19 +08:00
|
|
|
|
2010-02-07 23:34:44 +08:00
|
|
|
tree = gimp_image_get_vectors_tree (image);
|
2009-09-08 16:23:47 +08:00
|
|
|
|
2010-02-07 23:34:44 +08:00
|
|
|
return GIMP_VECTORS (gimp_item_tree_get_item_by_name (tree, name));
|
1999-07-07 11:18:54 +08:00
|
|
|
}
|
1999-08-22 19:45:31 +08:00
|
|
|
|
2010-02-08 02:21:42 +08:00
|
|
|
|
2010-07-09 00:08:13 +08:00
|
|
|
/* items */
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
gimp_image_reorder_item (GimpImage *image,
|
|
|
|
GimpItem *item,
|
|
|
|
GimpItem *new_parent,
|
|
|
|
gint new_index,
|
|
|
|
gboolean push_undo,
|
|
|
|
const gchar *undo_desc)
|
|
|
|
{
|
|
|
|
GimpItemTree *tree;
|
2018-04-22 15:18:37 +08:00
|
|
|
gboolean result;
|
2010-07-09 00:08:13 +08:00
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
|
|
|
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
|
|
|
|
g_return_val_if_fail (gimp_item_get_image (item) == image, FALSE);
|
|
|
|
|
|
|
|
tree = gimp_item_get_tree (item);
|
|
|
|
|
|
|
|
g_return_val_if_fail (tree != NULL, FALSE);
|
|
|
|
|
2018-04-22 15:18:37 +08:00
|
|
|
if (push_undo)
|
|
|
|
{
|
|
|
|
if (! undo_desc)
|
|
|
|
undo_desc = GIMP_ITEM_GET_CLASS (item)->reorder_desc;
|
|
|
|
|
|
|
|
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_ITEM_REORDER,
|
|
|
|
undo_desc);
|
|
|
|
}
|
|
|
|
|
|
|
|
gimp_item_start_move (item, push_undo);
|
2010-07-09 00:08:13 +08:00
|
|
|
|
|
|
|
/* item and new_parent are type-checked in GimpItemTree
|
|
|
|
*/
|
2018-04-22 15:18:37 +08:00
|
|
|
result = gimp_item_tree_reorder_item (tree, item,
|
|
|
|
new_parent, new_index,
|
|
|
|
push_undo, undo_desc);
|
|
|
|
|
|
|
|
gimp_item_end_move (item, push_undo);
|
|
|
|
|
|
|
|
if (push_undo)
|
|
|
|
gimp_image_undo_group_end (image);
|
|
|
|
|
|
|
|
return result;
|
2010-07-09 00:08:13 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
gimp_image_raise_item (GimpImage *image,
|
|
|
|
GimpItem *item,
|
|
|
|
GError **error)
|
|
|
|
{
|
|
|
|
gint index;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
|
|
|
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
|
|
|
|
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
|
|
|
|
|
|
|
index = gimp_item_get_index (item);
|
|
|
|
|
|
|
|
g_return_val_if_fail (index != -1, FALSE);
|
|
|
|
|
|
|
|
if (index == 0)
|
|
|
|
{
|
|
|
|
g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
|
2016-11-25 07:04:04 +08:00
|
|
|
GIMP_ITEM_GET_CLASS (item)->raise_failed);
|
2010-07-09 00:08:13 +08:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return gimp_image_reorder_item (image, item,
|
|
|
|
gimp_item_get_parent (item), index - 1,
|
|
|
|
TRUE, GIMP_ITEM_GET_CLASS (item)->raise_desc);
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
gimp_image_raise_item_to_top (GimpImage *image,
|
|
|
|
GimpItem *item)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
|
|
|
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
|
|
|
|
|
|
|
|
return gimp_image_reorder_item (image, item,
|
|
|
|
gimp_item_get_parent (item), 0,
|
|
|
|
TRUE, GIMP_ITEM_GET_CLASS (item)->raise_to_top_desc);
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
gimp_image_lower_item (GimpImage *image,
|
|
|
|
GimpItem *item,
|
|
|
|
GError **error)
|
|
|
|
{
|
|
|
|
GimpContainer *container;
|
|
|
|
gint index;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
|
|
|
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
|
|
|
|
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
|
|
|
|
|
|
|
container = gimp_item_get_container (item);
|
|
|
|
|
|
|
|
g_return_val_if_fail (container != NULL, FALSE);
|
|
|
|
|
|
|
|
index = gimp_item_get_index (item);
|
|
|
|
|
|
|
|
if (index == gimp_container_get_n_children (container) - 1)
|
|
|
|
{
|
|
|
|
g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
|
2016-11-25 07:04:04 +08:00
|
|
|
GIMP_ITEM_GET_CLASS (item)->lower_failed);
|
2010-07-09 00:08:13 +08:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return gimp_image_reorder_item (image, item,
|
|
|
|
gimp_item_get_parent (item), index + 1,
|
|
|
|
TRUE, GIMP_ITEM_GET_CLASS (item)->lower_desc);
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
gimp_image_lower_item_to_bottom (GimpImage *image,
|
|
|
|
GimpItem *item)
|
|
|
|
{
|
|
|
|
GimpContainer *container;
|
|
|
|
gint length;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
|
|
|
g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE);
|
|
|
|
|
|
|
|
container = gimp_item_get_container (item);
|
|
|
|
|
|
|
|
g_return_val_if_fail (container != NULL, FALSE);
|
|
|
|
|
|
|
|
length = gimp_container_get_n_children (container);
|
|
|
|
|
|
|
|
return gimp_image_reorder_item (image, item,
|
|
|
|
gimp_item_get_parent (item), length - 1,
|
|
|
|
TRUE, GIMP_ITEM_GET_CLASS (item)->lower_to_bottom_desc);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-02-08 02:21:42 +08:00
|
|
|
/* layers */
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
gboolean
|
2008-09-17 19:41:54 +08:00
|
|
|
gimp_image_add_layer (GimpImage *image,
|
|
|
|
GimpLayer *layer,
|
2009-08-04 01:21:51 +08:00
|
|
|
GimpLayer *parent,
|
2008-10-10 03:40:41 +08:00
|
|
|
gint position,
|
|
|
|
gboolean push_undo)
|
2001-05-07 00:14:34 +08:00
|
|
|
{
|
2010-02-04 06:00:31 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
gboolean old_has_alpha;
|
2002-08-28 22:09:14 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
2009-08-02 21:36:00 +08:00
|
|
|
|
2010-02-04 06:00:31 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
2010-02-10 00:47:08 +08:00
|
|
|
/* item and parent are type-checked in GimpItemTree
|
|
|
|
*/
|
|
|
|
if (! gimp_item_tree_get_insert_pos (private->layers,
|
|
|
|
(GimpItem *) layer,
|
|
|
|
(GimpItem **) &parent,
|
|
|
|
&position))
|
|
|
|
return FALSE;
|
2004-01-18 21:38:24 +08:00
|
|
|
|
2017-08-22 02:04:25 +08:00
|
|
|
gimp_image_unset_default_new_layer_mode (image);
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
/* If there is a floating selection (and this isn't it!),
|
|
|
|
* make sure the insert position is greater than 0
|
|
|
|
*/
|
2010-02-08 06:36:57 +08:00
|
|
|
if (parent == NULL && position == 0 &&
|
|
|
|
gimp_image_get_floating_selection (image))
|
don't allow to select anything but the floating selection. Fixes bug
2004-01-18 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c (gimp_image_set_active_layer): don't allow
to select anything but the floating selection. Fixes bug #128025.
(gimp_image_set_active_layer,channel,vectors): allow to pass NULL
to unselect the active item. Removed the silly feature that
passing some random item of another image would select the first
item in the list (was unused anyway).
(gimp_image_unset_active_channel): use gimp_image_set_active_channel()
now that it accepts NULL.
(gimp_image_add_layer,channel,vectors): cleaned up / simplified.
(gimp_image_remove_layer,channel,vectors): cleanup,
simplification, use gimp_image_set_active_layer,channel,vectors()
now that they accept NULL, make sure the item next to the removed
item becomes the active one (and not the first in the list, which
was a severe usability problem in the dialogs).
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): pass
NULL to the set_active functions, cleanup.
* app/core/gimpimage-duplicate.c: attach the floating selection
before setting the active layer. Code relied on broken
gimp_image_set_active_layer() behaviour before.
* app/core/gimplayer-floating-sel.c: no need to set
gimage->floating_sel before calling gimp_image_add_layer(). The
weird GUI mentioned in the comment existed in 1.2 only.
* app/display/gimpdisplayshell-layer-select.c (layer_select_advance):
don't assume that setting the active_layer always succeeds.
* tools/pdbgen/pdb/image.pdb: behave as the documentation says
and return an execution error if setting the active layer or
channel failed.
Unrelated:
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/layer.pdb: removed leftover cruft from the old
guchar based color API.
* tools/pdbgen/pdb/channel.pdb: simplified code which handles the
channel's color.
* app/pdb/channel_cmds.c
* app/pdb/image_cmds.c: regenerated.
2004-01-18 20:16:44 +08:00
|
|
|
position = 1;
|
2001-05-07 00:14:34 +08:00
|
|
|
|
2009-08-04 03:47:21 +08:00
|
|
|
old_has_alpha = gimp_image_has_alpha (image);
|
|
|
|
|
|
|
|
if (push_undo)
|
2010-06-08 19:24:11 +08:00
|
|
|
gimp_image_undo_push_layer_add (image, C_("undo-type", "Add Layer"),
|
2010-02-07 22:01:31 +08:00
|
|
|
layer,
|
|
|
|
gimp_image_get_active_layer (image));
|
2003-02-15 06:33:22 +08:00
|
|
|
|
2010-02-07 18:47:33 +08:00
|
|
|
gimp_item_tree_add_item (private->layers, GIMP_ITEM (layer),
|
|
|
|
GIMP_ITEM (parent), position);
|
2001-05-07 00:14:34 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_set_active_layer (image, layer);
|
2001-11-28 11:08:03 +08:00
|
|
|
|
2009-02-08 03:23:32 +08:00
|
|
|
/* If the layer is a floating selection, attach it to the drawable */
|
2008-11-14 23:18:29 +08:00
|
|
|
if (gimp_layer_is_floating_sel (layer))
|
2009-02-08 03:23:32 +08:00
|
|
|
gimp_drawable_attach_floating_sel (gimp_layer_get_floating_sel_drawable (layer),
|
|
|
|
layer);
|
2008-11-14 23:18:29 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
if (old_has_alpha != gimp_image_has_alpha (image))
|
2010-02-05 16:13:25 +08:00
|
|
|
private->flush_accum.alpha_changed = TRUE;
|
2002-08-28 22:09:14 +08:00
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
return TRUE;
|
2001-11-28 11:08:03 +08:00
|
|
|
}
|
|
|
|
|
2001-05-07 00:14:34 +08:00
|
|
|
void
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_remove_layer (GimpImage *image,
|
2008-10-10 03:40:41 +08:00
|
|
|
GimpLayer *layer,
|
|
|
|
gboolean push_undo,
|
|
|
|
GimpLayer *new_active)
|
2001-05-07 00:14:34 +08:00
|
|
|
{
|
2010-02-04 06:00:31 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
GimpLayer *active_layer;
|
|
|
|
gboolean old_has_alpha;
|
|
|
|
const gchar *undo_desc;
|
don't allow to select anything but the floating selection. Fixes bug
2004-01-18 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c (gimp_image_set_active_layer): don't allow
to select anything but the floating selection. Fixes bug #128025.
(gimp_image_set_active_layer,channel,vectors): allow to pass NULL
to unselect the active item. Removed the silly feature that
passing some random item of another image would select the first
item in the list (was unused anyway).
(gimp_image_unset_active_channel): use gimp_image_set_active_channel()
now that it accepts NULL.
(gimp_image_add_layer,channel,vectors): cleaned up / simplified.
(gimp_image_remove_layer,channel,vectors): cleanup,
simplification, use gimp_image_set_active_layer,channel,vectors()
now that they accept NULL, make sure the item next to the removed
item becomes the active one (and not the first in the list, which
was a severe usability problem in the dialogs).
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): pass
NULL to the set_active functions, cleanup.
* app/core/gimpimage-duplicate.c: attach the floating selection
before setting the active layer. Code relied on broken
gimp_image_set_active_layer() behaviour before.
* app/core/gimplayer-floating-sel.c: no need to set
gimage->floating_sel before calling gimp_image_add_layer(). The
weird GUI mentioned in the comment existed in 1.2 only.
* app/display/gimpdisplayshell-layer-select.c (layer_select_advance):
don't assume that setting the active_layer always succeeds.
* tools/pdbgen/pdb/image.pdb: behave as the documentation says
and return an execution error if setting the active layer or
channel failed.
Unrelated:
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/layer.pdb: removed leftover cruft from the old
guchar based color API.
* tools/pdbgen/pdb/channel.pdb: simplified code which handles the
channel's color.
* app/pdb/channel_cmds.c
* app/pdb/image_cmds.c: regenerated.
2004-01-18 20:16:44 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
g_return_if_fail (GIMP_IS_LAYER (layer));
|
2009-08-02 21:36:00 +08:00
|
|
|
g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (layer)));
|
|
|
|
g_return_if_fail (gimp_item_get_image (GIMP_ITEM (layer)) == image);
|
don't allow to select anything but the floating selection. Fixes bug
2004-01-18 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c (gimp_image_set_active_layer): don't allow
to select anything but the floating selection. Fixes bug #128025.
(gimp_image_set_active_layer,channel,vectors): allow to pass NULL
to unselect the active item. Removed the silly feature that
passing some random item of another image would select the first
item in the list (was unused anyway).
(gimp_image_unset_active_channel): use gimp_image_set_active_channel()
now that it accepts NULL.
(gimp_image_add_layer,channel,vectors): cleaned up / simplified.
(gimp_image_remove_layer,channel,vectors): cleanup,
simplification, use gimp_image_set_active_layer,channel,vectors()
now that they accept NULL, make sure the item next to the removed
item becomes the active one (and not the first in the list, which
was a severe usability problem in the dialogs).
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): pass
NULL to the set_active functions, cleanup.
* app/core/gimpimage-duplicate.c: attach the floating selection
before setting the active layer. Code relied on broken
gimp_image_set_active_layer() behaviour before.
* app/core/gimplayer-floating-sel.c: no need to set
gimage->floating_sel before calling gimp_image_add_layer(). The
weird GUI mentioned in the comment existed in 1.2 only.
* app/display/gimpdisplayshell-layer-select.c (layer_select_advance):
don't assume that setting the active_layer always succeeds.
* tools/pdbgen/pdb/image.pdb: behave as the documentation says
and return an execution error if setting the active layer or
channel failed.
Unrelated:
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/layer.pdb: removed leftover cruft from the old
guchar based color API.
* tools/pdbgen/pdb/channel.pdb: simplified code which handles the
channel's color.
* app/pdb/channel_cmds.c
* app/pdb/image_cmds.c: regenerated.
2004-01-18 20:16:44 +08:00
|
|
|
|
2010-02-04 06:00:31 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
2017-08-22 02:04:25 +08:00
|
|
|
gimp_image_unset_default_new_layer_mode (image);
|
|
|
|
|
app: add gimp_item_{start,end}_move()
Add gimp_item_{start,end}_move(), and corresponding
GimpItem::{start,end}_move() virtual functions, which should be
called before/after "moving" the item (i.e., translating, scaling,
resizing, flipping, rotating, or transforming the item). Moves
performed between the outermost pair of start/end calls are treated
atomically.
What exactly does "treated atomically" entail depends on the
subclasses -- GimpItem doesn't provide a default implementation for
these functions, so the current commit doesn't change any behavior.
The next commit, which adds layer-mask support for group layers,
uses the functions to avoid cropping the mask too early while a
child is moving.
GimpItem calls {start,end}_move() in the various "move" functions
(gimp_item_{translate,scale,...}(), before performing the actual
operation. Additionally we call the functions in the
gimp_image_item_list_foo() functions, for each participating item,
so that the items are moved as a unit. We call the functions in
the various gimp_image_remove_foo() functions, since removing an
item may affect the size of its ancestors, and is therefore akin to
moving. We also call the functions in GimpEditSelectionTool, so
that the move tool moves items atomically while dragging.
2018-02-05 23:59:28 +08:00
|
|
|
if (push_undo)
|
|
|
|
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_ITEM_REMOVE,
|
|
|
|
C_("undo-type", "Remove Layer"));
|
|
|
|
|
|
|
|
gimp_item_start_move (GIMP_ITEM (layer), push_undo);
|
|
|
|
|
2011-09-24 01:31:50 +08:00
|
|
|
if (gimp_drawable_get_floating_sel (GIMP_DRAWABLE (layer)))
|
2005-04-05 07:12:50 +08:00
|
|
|
{
|
2008-10-10 03:40:41 +08:00
|
|
|
if (! push_undo)
|
|
|
|
{
|
|
|
|
g_warning ("%s() was called from an undo function while the layer "
|
|
|
|
"had a floating selection. Please report this at "
|
2018-05-03 06:24:08 +08:00
|
|
|
"https://www.gimp.org/bugs/", G_STRFUNC);
|
2008-10-10 03:40:41 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-09-24 01:31:50 +08:00
|
|
|
gimp_image_remove_layer (image,
|
|
|
|
gimp_drawable_get_floating_sel (GIMP_DRAWABLE (layer)),
|
2008-11-10 02:45:16 +08:00
|
|
|
TRUE, NULL);
|
2005-04-05 07:12:50 +08:00
|
|
|
}
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
active_layer = gimp_image_get_active_layer (image);
|
2001-05-07 00:14:34 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
old_has_alpha = gimp_image_has_alpha (image);
|
2004-01-18 21:38:24 +08:00
|
|
|
|
2009-01-27 06:05:07 +08:00
|
|
|
if (gimp_layer_is_floating_sel (layer))
|
2008-11-10 02:45:16 +08:00
|
|
|
{
|
2010-06-08 19:24:11 +08:00
|
|
|
undo_desc = C_("undo-type", "Remove Floating Selection");
|
2008-11-10 02:45:16 +08:00
|
|
|
|
2011-09-24 01:31:50 +08:00
|
|
|
gimp_drawable_detach_floating_sel (gimp_layer_get_floating_sel_drawable (layer));
|
2008-11-10 02:45:16 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-06-08 19:24:11 +08:00
|
|
|
undo_desc = C_("undo-type", "Remove Layer");
|
2008-11-10 02:45:16 +08:00
|
|
|
}
|
|
|
|
|
2008-10-10 03:40:41 +08:00
|
|
|
if (push_undo)
|
2009-08-04 01:21:51 +08:00
|
|
|
gimp_image_undo_push_layer_remove (image, undo_desc, layer,
|
2010-02-07 20:46:46 +08:00
|
|
|
gimp_layer_get_parent (layer),
|
2010-02-07 18:47:33 +08:00
|
|
|
gimp_item_get_index (GIMP_ITEM (layer)),
|
|
|
|
active_layer);
|
2001-05-07 00:14:34 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_ref (layer);
|
2001-05-07 00:14:34 +08:00
|
|
|
|
2003-07-26 00:12:35 +08:00
|
|
|
/* Make sure we're not caching any old selection info */
|
don't allow to select anything but the floating selection. Fixes bug
2004-01-18 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c (gimp_image_set_active_layer): don't allow
to select anything but the floating selection. Fixes bug #128025.
(gimp_image_set_active_layer,channel,vectors): allow to pass NULL
to unselect the active item. Removed the silly feature that
passing some random item of another image would select the first
item in the list (was unused anyway).
(gimp_image_unset_active_channel): use gimp_image_set_active_channel()
now that it accepts NULL.
(gimp_image_add_layer,channel,vectors): cleaned up / simplified.
(gimp_image_remove_layer,channel,vectors): cleanup,
simplification, use gimp_image_set_active_layer,channel,vectors()
now that they accept NULL, make sure the item next to the removed
item becomes the active one (and not the first in the list, which
was a severe usability problem in the dialogs).
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): pass
NULL to the set_active functions, cleanup.
* app/core/gimpimage-duplicate.c: attach the floating selection
before setting the active layer. Code relied on broken
gimp_image_set_active_layer() behaviour before.
* app/core/gimplayer-floating-sel.c: no need to set
gimage->floating_sel before calling gimp_image_add_layer(). The
weird GUI mentioned in the comment existed in 1.2 only.
* app/display/gimpdisplayshell-layer-select.c (layer_select_advance):
don't assume that setting the active_layer always succeeds.
* tools/pdbgen/pdb/image.pdb: behave as the documentation says
and return an execution error if setting the active layer or
channel failed.
Unrelated:
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/layer.pdb: removed leftover cruft from the old
guchar based color API.
* tools/pdbgen/pdb/channel.pdb: simplified code which handles the
channel's color.
* app/pdb/channel_cmds.c
* app/pdb/image_cmds.c: regenerated.
2004-01-18 20:16:44 +08:00
|
|
|
if (layer == active_layer)
|
|
|
|
gimp_drawable_invalidate_boundary (GIMP_DRAWABLE (layer));
|
2003-07-26 00:12:35 +08:00
|
|
|
|
2010-02-04 06:00:31 +08:00
|
|
|
private->layer_stack = g_slist_remove (private->layer_stack, layer);
|
2001-11-01 05:18:57 +08:00
|
|
|
|
2009-08-28 04:10:36 +08:00
|
|
|
/* Also remove all children of a group layer from the layer_stack */
|
|
|
|
if (gimp_viewable_get_children (GIMP_VIEWABLE (layer)))
|
|
|
|
{
|
|
|
|
GimpContainer *stack = gimp_viewable_get_children (GIMP_VIEWABLE (layer));
|
|
|
|
GList *children;
|
|
|
|
GList *list;
|
|
|
|
|
|
|
|
children = gimp_item_stack_get_item_list (GIMP_ITEM_STACK (stack));
|
|
|
|
|
|
|
|
for (list = children; list; list = g_list_next (list))
|
|
|
|
{
|
2010-02-04 06:00:31 +08:00
|
|
|
private->layer_stack = g_slist_remove (private->layer_stack,
|
|
|
|
list->data);
|
2009-08-28 04:10:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
g_list_free (children);
|
|
|
|
}
|
|
|
|
|
2010-02-07 18:47:33 +08:00
|
|
|
new_active =
|
|
|
|
GIMP_LAYER (gimp_item_tree_remove_item (private->layers,
|
|
|
|
GIMP_ITEM (layer),
|
|
|
|
GIMP_ITEM (new_active)));
|
2009-08-02 21:36:00 +08:00
|
|
|
|
2009-02-08 03:23:32 +08:00
|
|
|
if (gimp_layer_is_floating_sel (layer))
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2009-02-08 03:23:32 +08:00
|
|
|
/* If this was the floating selection, activate the underlying drawable
|
2004-01-26 23:34:47 +08:00
|
|
|
*/
|
|
|
|
floating_sel_activate_drawable (layer);
|
|
|
|
}
|
2011-03-04 08:49:32 +08:00
|
|
|
else if (active_layer &&
|
|
|
|
(layer == active_layer ||
|
|
|
|
gimp_viewable_is_ancestor (GIMP_VIEWABLE (layer),
|
|
|
|
GIMP_VIEWABLE (active_layer))))
|
1998-06-28 18:39:58 +08:00
|
|
|
{
|
2010-02-07 18:47:33 +08:00
|
|
|
gimp_image_set_active_layer (image, new_active);
|
1998-06-28 18:39:58 +08:00
|
|
|
}
|
2001-05-07 00:14:34 +08:00
|
|
|
|
app: add gimp_item_{start,end}_move()
Add gimp_item_{start,end}_move(), and corresponding
GimpItem::{start,end}_move() virtual functions, which should be
called before/after "moving" the item (i.e., translating, scaling,
resizing, flipping, rotating, or transforming the item). Moves
performed between the outermost pair of start/end calls are treated
atomically.
What exactly does "treated atomically" entail depends on the
subclasses -- GimpItem doesn't provide a default implementation for
these functions, so the current commit doesn't change any behavior.
The next commit, which adds layer-mask support for group layers,
uses the functions to avoid cropping the mask too early while a
child is moving.
GimpItem calls {start,end}_move() in the various "move" functions
(gimp_item_{translate,scale,...}(), before performing the actual
operation. Additionally we call the functions in the
gimp_image_item_list_foo() functions, for each participating item,
so that the items are moved as a unit. We call the functions in
the various gimp_image_remove_foo() functions, since removing an
item may affect the size of its ancestors, and is therefore akin to
moving. We also call the functions in GimpEditSelectionTool, so
that the move tool moves items atomically while dragging.
2018-02-05 23:59:28 +08:00
|
|
|
gimp_item_end_move (GIMP_ITEM (layer), push_undo);
|
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_object_unref (layer);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
if (old_has_alpha != gimp_image_has_alpha (image))
|
2010-02-05 16:13:25 +08:00
|
|
|
private->flush_accum.alpha_changed = TRUE;
|
2005-04-05 07:12:50 +08:00
|
|
|
|
app: add gimp_item_{start,end}_move()
Add gimp_item_{start,end}_move(), and corresponding
GimpItem::{start,end}_move() virtual functions, which should be
called before/after "moving" the item (i.e., translating, scaling,
resizing, flipping, rotating, or transforming the item). Moves
performed between the outermost pair of start/end calls are treated
atomically.
What exactly does "treated atomically" entail depends on the
subclasses -- GimpItem doesn't provide a default implementation for
these functions, so the current commit doesn't change any behavior.
The next commit, which adds layer-mask support for group layers,
uses the functions to avoid cropping the mask too early while a
child is moving.
GimpItem calls {start,end}_move() in the various "move" functions
(gimp_item_{translate,scale,...}(), before performing the actual
operation. Additionally we call the functions in the
gimp_image_item_list_foo() functions, for each participating item,
so that the items are moved as a unit. We call the functions in
the various gimp_image_remove_foo() functions, since removing an
item may affect the size of its ancestors, and is therefore akin to
moving. We also call the functions in GimpEditSelectionTool, so
that the move tool moves items atomically while dragging.
2018-02-05 23:59:28 +08:00
|
|
|
if (push_undo)
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_undo_group_end (image);
|
1998-06-28 18:39:58 +08:00
|
|
|
}
|
|
|
|
|
2006-11-04 03:59:30 +08:00
|
|
|
void
|
|
|
|
gimp_image_add_layers (GimpImage *image,
|
|
|
|
GList *layers,
|
2009-08-04 01:21:51 +08:00
|
|
|
GimpLayer *parent,
|
2006-11-04 03:59:30 +08:00
|
|
|
gint position,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
const gchar *undo_desc)
|
|
|
|
{
|
2010-02-04 06:00:31 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
GList *list;
|
|
|
|
gint layers_x = G_MAXINT;
|
|
|
|
gint layers_y = G_MAXINT;
|
|
|
|
gint layers_width = 0;
|
|
|
|
gint layers_height = 0;
|
|
|
|
gint offset_x;
|
|
|
|
gint offset_y;
|
2006-11-04 03:59:30 +08:00
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
|
|
|
g_return_if_fail (layers != NULL);
|
|
|
|
|
2010-02-04 06:00:31 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
2010-02-10 00:47:08 +08:00
|
|
|
/* item and parent are type-checked in GimpItemTree
|
|
|
|
*/
|
|
|
|
if (! gimp_item_tree_get_insert_pos (private->layers,
|
|
|
|
(GimpItem *) layers->data,
|
|
|
|
(GimpItem **) &parent,
|
|
|
|
&position))
|
|
|
|
return;
|
2006-12-15 23:34:28 +08:00
|
|
|
|
2006-11-04 03:59:30 +08:00
|
|
|
for (list = layers; list; list = g_list_next (list))
|
|
|
|
{
|
|
|
|
GimpItem *item = GIMP_ITEM (list->data);
|
|
|
|
gint off_x, off_y;
|
|
|
|
|
2008-11-03 07:03:29 +08:00
|
|
|
gimp_item_get_offset (item, &off_x, &off_y);
|
2006-11-04 03:59:30 +08:00
|
|
|
|
|
|
|
layers_x = MIN (layers_x, off_x);
|
|
|
|
layers_y = MIN (layers_y, off_y);
|
|
|
|
|
|
|
|
layers_width = MAX (layers_width,
|
2008-11-03 08:09:01 +08:00
|
|
|
off_x + gimp_item_get_width (item) - layers_x);
|
2006-11-04 03:59:30 +08:00
|
|
|
layers_height = MAX (layers_height,
|
2008-11-03 08:09:01 +08:00
|
|
|
off_y + gimp_item_get_height (item) - layers_y);
|
2006-11-04 03:59:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
offset_x = x + (width - layers_width) / 2 - layers_x;
|
|
|
|
offset_y = y + (height - layers_height) / 2 - layers_y;
|
|
|
|
|
|
|
|
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_LAYER_ADD, undo_desc);
|
|
|
|
|
|
|
|
for (list = layers; list; list = g_list_next (list))
|
|
|
|
{
|
|
|
|
GimpItem *new_item = GIMP_ITEM (list->data);
|
|
|
|
|
|
|
|
gimp_item_translate (new_item, offset_x, offset_y, FALSE);
|
|
|
|
|
2009-08-04 01:21:51 +08:00
|
|
|
gimp_image_add_layer (image, GIMP_LAYER (new_item),
|
|
|
|
parent, position, TRUE);
|
2006-12-15 23:34:28 +08:00
|
|
|
position++;
|
2006-11-04 03:59:30 +08:00
|
|
|
}
|
|
|
|
|
2007-09-11 22:12:51 +08:00
|
|
|
if (layers)
|
|
|
|
gimp_image_set_active_layer (image, layers->data);
|
|
|
|
|
2006-11-04 03:59:30 +08:00
|
|
|
gimp_image_undo_group_end (image);
|
|
|
|
}
|
|
|
|
|
2010-02-08 02:21:42 +08:00
|
|
|
|
|
|
|
/* channels */
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
gboolean
|
2008-09-17 19:41:54 +08:00
|
|
|
gimp_image_add_channel (GimpImage *image,
|
|
|
|
GimpChannel *channel,
|
2009-08-04 01:21:51 +08:00
|
|
|
GimpChannel *parent,
|
2008-10-10 03:40:41 +08:00
|
|
|
gint position,
|
|
|
|
gboolean push_undo)
|
1998-06-28 18:39:58 +08:00
|
|
|
{
|
2010-02-04 06:00:31 +08:00
|
|
|
GimpImagePrivate *private;
|
don't allow to select anything but the floating selection. Fixes bug
2004-01-18 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c (gimp_image_set_active_layer): don't allow
to select anything but the floating selection. Fixes bug #128025.
(gimp_image_set_active_layer,channel,vectors): allow to pass NULL
to unselect the active item. Removed the silly feature that
passing some random item of another image would select the first
item in the list (was unused anyway).
(gimp_image_unset_active_channel): use gimp_image_set_active_channel()
now that it accepts NULL.
(gimp_image_add_layer,channel,vectors): cleaned up / simplified.
(gimp_image_remove_layer,channel,vectors): cleanup,
simplification, use gimp_image_set_active_layer,channel,vectors()
now that they accept NULL, make sure the item next to the removed
item becomes the active one (and not the first in the list, which
was a severe usability problem in the dialogs).
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): pass
NULL to the set_active functions, cleanup.
* app/core/gimpimage-duplicate.c: attach the floating selection
before setting the active layer. Code relied on broken
gimp_image_set_active_layer() behaviour before.
* app/core/gimplayer-floating-sel.c: no need to set
gimage->floating_sel before calling gimp_image_add_layer(). The
weird GUI mentioned in the comment existed in 1.2 only.
* app/display/gimpdisplayshell-layer-select.c (layer_select_advance):
don't assume that setting the active_layer always succeeds.
* tools/pdbgen/pdb/image.pdb: behave as the documentation says
and return an execution error if setting the active layer or
channel failed.
Unrelated:
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/layer.pdb: removed leftover cruft from the old
guchar based color API.
* tools/pdbgen/pdb/channel.pdb: simplified code which handles the
channel's color.
* app/pdb/channel_cmds.c
* app/pdb/image_cmds.c: regenerated.
2004-01-18 20:16:44 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
2009-08-02 21:36:00 +08:00
|
|
|
|
2010-02-04 06:00:31 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
2010-02-10 00:47:08 +08:00
|
|
|
/* item and parent are type-checked in GimpItemTree
|
|
|
|
*/
|
|
|
|
if (! gimp_item_tree_get_insert_pos (private->channels,
|
|
|
|
(GimpItem *) channel,
|
|
|
|
(GimpItem **) &parent,
|
|
|
|
&position))
|
|
|
|
return FALSE;
|
2009-08-04 03:47:21 +08:00
|
|
|
|
2008-10-10 03:40:41 +08:00
|
|
|
if (push_undo)
|
2010-06-08 19:24:11 +08:00
|
|
|
gimp_image_undo_push_channel_add (image, C_("undo-type", "Add Channel"),
|
2010-02-07 22:01:31 +08:00
|
|
|
channel,
|
|
|
|
gimp_image_get_active_channel (image));
|
don't allow to select anything but the floating selection. Fixes bug
2004-01-18 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c (gimp_image_set_active_layer): don't allow
to select anything but the floating selection. Fixes bug #128025.
(gimp_image_set_active_layer,channel,vectors): allow to pass NULL
to unselect the active item. Removed the silly feature that
passing some random item of another image would select the first
item in the list (was unused anyway).
(gimp_image_unset_active_channel): use gimp_image_set_active_channel()
now that it accepts NULL.
(gimp_image_add_layer,channel,vectors): cleaned up / simplified.
(gimp_image_remove_layer,channel,vectors): cleanup,
simplification, use gimp_image_set_active_layer,channel,vectors()
now that they accept NULL, make sure the item next to the removed
item becomes the active one (and not the first in the list, which
was a severe usability problem in the dialogs).
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): pass
NULL to the set_active functions, cleanup.
* app/core/gimpimage-duplicate.c: attach the floating selection
before setting the active layer. Code relied on broken
gimp_image_set_active_layer() behaviour before.
* app/core/gimplayer-floating-sel.c: no need to set
gimage->floating_sel before calling gimp_image_add_layer(). The
weird GUI mentioned in the comment existed in 1.2 only.
* app/display/gimpdisplayshell-layer-select.c (layer_select_advance):
don't assume that setting the active_layer always succeeds.
* tools/pdbgen/pdb/image.pdb: behave as the documentation says
and return an execution error if setting the active layer or
channel failed.
Unrelated:
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/layer.pdb: removed leftover cruft from the old
guchar based color API.
* tools/pdbgen/pdb/channel.pdb: simplified code which handles the
channel's color.
* app/pdb/channel_cmds.c
* app/pdb/image_cmds.c: regenerated.
2004-01-18 20:16:44 +08:00
|
|
|
|
2010-02-07 18:47:33 +08:00
|
|
|
gimp_item_tree_add_item (private->channels, GIMP_ITEM (channel),
|
|
|
|
GIMP_ITEM (parent), position);
|
2000-12-04 05:34:38 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_set_active_channel (image, channel);
|
2000-01-05 17:09:46 +08:00
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
return TRUE;
|
1998-06-28 18:39:58 +08:00
|
|
|
}
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
void
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_remove_channel (GimpImage *image,
|
2008-10-10 03:40:41 +08:00
|
|
|
GimpChannel *channel,
|
|
|
|
gboolean push_undo,
|
|
|
|
GimpChannel *new_active)
|
1998-06-28 18:39:58 +08:00
|
|
|
{
|
2010-02-07 18:47:33 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
GimpChannel *active_channel;
|
don't allow to select anything but the floating selection. Fixes bug
2004-01-18 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c (gimp_image_set_active_layer): don't allow
to select anything but the floating selection. Fixes bug #128025.
(gimp_image_set_active_layer,channel,vectors): allow to pass NULL
to unselect the active item. Removed the silly feature that
passing some random item of another image would select the first
item in the list (was unused anyway).
(gimp_image_unset_active_channel): use gimp_image_set_active_channel()
now that it accepts NULL.
(gimp_image_add_layer,channel,vectors): cleaned up / simplified.
(gimp_image_remove_layer,channel,vectors): cleanup,
simplification, use gimp_image_set_active_layer,channel,vectors()
now that they accept NULL, make sure the item next to the removed
item becomes the active one (and not the first in the list, which
was a severe usability problem in the dialogs).
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): pass
NULL to the set_active functions, cleanup.
* app/core/gimpimage-duplicate.c: attach the floating selection
before setting the active layer. Code relied on broken
gimp_image_set_active_layer() behaviour before.
* app/core/gimplayer-floating-sel.c: no need to set
gimage->floating_sel before calling gimp_image_add_layer(). The
weird GUI mentioned in the comment existed in 1.2 only.
* app/display/gimpdisplayshell-layer-select.c (layer_select_advance):
don't assume that setting the active_layer always succeeds.
* tools/pdbgen/pdb/image.pdb: behave as the documentation says
and return an execution error if setting the active layer or
channel failed.
Unrelated:
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/layer.pdb: removed leftover cruft from the old
guchar based color API.
* tools/pdbgen/pdb/channel.pdb: simplified code which handles the
channel's color.
* app/pdb/channel_cmds.c
* app/pdb/image_cmds.c: regenerated.
2004-01-18 20:16:44 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
g_return_if_fail (GIMP_IS_CHANNEL (channel));
|
2009-08-02 21:36:00 +08:00
|
|
|
g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (channel)));
|
|
|
|
g_return_if_fail (gimp_item_get_image (GIMP_ITEM (channel)) == image);
|
1999-01-11 07:36:29 +08:00
|
|
|
|
app: add gimp_item_{start,end}_move()
Add gimp_item_{start,end}_move(), and corresponding
GimpItem::{start,end}_move() virtual functions, which should be
called before/after "moving" the item (i.e., translating, scaling,
resizing, flipping, rotating, or transforming the item). Moves
performed between the outermost pair of start/end calls are treated
atomically.
What exactly does "treated atomically" entail depends on the
subclasses -- GimpItem doesn't provide a default implementation for
these functions, so the current commit doesn't change any behavior.
The next commit, which adds layer-mask support for group layers,
uses the functions to avoid cropping the mask too early while a
child is moving.
GimpItem calls {start,end}_move() in the various "move" functions
(gimp_item_{translate,scale,...}(), before performing the actual
operation. Additionally we call the functions in the
gimp_image_item_list_foo() functions, for each participating item,
so that the items are moved as a unit. We call the functions in
the various gimp_image_remove_foo() functions, since removing an
item may affect the size of its ancestors, and is therefore akin to
moving. We also call the functions in GimpEditSelectionTool, so
that the move tool moves items atomically while dragging.
2018-02-05 23:59:28 +08:00
|
|
|
if (push_undo)
|
|
|
|
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_ITEM_REMOVE,
|
|
|
|
C_("undo-type", "Remove Channel"));
|
|
|
|
|
|
|
|
gimp_item_start_move (GIMP_ITEM (channel), push_undo);
|
|
|
|
|
2011-09-24 01:31:50 +08:00
|
|
|
if (gimp_drawable_get_floating_sel (GIMP_DRAWABLE (channel)))
|
2005-04-05 07:12:50 +08:00
|
|
|
{
|
2008-10-10 03:40:41 +08:00
|
|
|
if (! push_undo)
|
|
|
|
{
|
|
|
|
g_warning ("%s() was called from an undo function while the channel "
|
|
|
|
"had a floating selection. Please report this at "
|
2018-05-03 06:24:08 +08:00
|
|
|
"https://www.gimp.org/bugs/", G_STRFUNC);
|
2008-10-10 03:40:41 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-09-24 01:31:50 +08:00
|
|
|
gimp_image_remove_layer (image,
|
|
|
|
gimp_drawable_get_floating_sel (GIMP_DRAWABLE (channel)),
|
2008-11-10 02:45:16 +08:00
|
|
|
TRUE, NULL);
|
2005-04-05 07:12:50 +08:00
|
|
|
}
|
|
|
|
|
2010-02-07 18:47:33 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
2009-08-02 21:36:00 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
active_channel = gimp_image_get_active_channel (image);
|
don't allow to select anything but the floating selection. Fixes bug
2004-01-18 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c (gimp_image_set_active_layer): don't allow
to select anything but the floating selection. Fixes bug #128025.
(gimp_image_set_active_layer,channel,vectors): allow to pass NULL
to unselect the active item. Removed the silly feature that
passing some random item of another image would select the first
item in the list (was unused anyway).
(gimp_image_unset_active_channel): use gimp_image_set_active_channel()
now that it accepts NULL.
(gimp_image_add_layer,channel,vectors): cleaned up / simplified.
(gimp_image_remove_layer,channel,vectors): cleanup,
simplification, use gimp_image_set_active_layer,channel,vectors()
now that they accept NULL, make sure the item next to the removed
item becomes the active one (and not the first in the list, which
was a severe usability problem in the dialogs).
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): pass
NULL to the set_active functions, cleanup.
* app/core/gimpimage-duplicate.c: attach the floating selection
before setting the active layer. Code relied on broken
gimp_image_set_active_layer() behaviour before.
* app/core/gimplayer-floating-sel.c: no need to set
gimage->floating_sel before calling gimp_image_add_layer(). The
weird GUI mentioned in the comment existed in 1.2 only.
* app/display/gimpdisplayshell-layer-select.c (layer_select_advance):
don't assume that setting the active_layer always succeeds.
* tools/pdbgen/pdb/image.pdb: behave as the documentation says
and return an execution error if setting the active layer or
channel failed.
Unrelated:
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/layer.pdb: removed leftover cruft from the old
guchar based color API.
* tools/pdbgen/pdb/channel.pdb: simplified code which handles the
channel's color.
* app/pdb/channel_cmds.c
* app/pdb/image_cmds.c: regenerated.
2004-01-18 20:16:44 +08:00
|
|
|
|
2008-10-10 03:40:41 +08:00
|
|
|
if (push_undo)
|
2010-06-08 19:24:11 +08:00
|
|
|
gimp_image_undo_push_channel_remove (image, C_("undo-type", "Remove Channel"), channel,
|
2010-02-07 20:46:46 +08:00
|
|
|
gimp_channel_get_parent (channel),
|
2010-02-07 18:47:33 +08:00
|
|
|
gimp_item_get_index (GIMP_ITEM (channel)),
|
|
|
|
active_channel);
|
2000-01-05 17:09:46 +08:00
|
|
|
|
2011-02-07 18:35:58 +08:00
|
|
|
g_object_ref (channel);
|
|
|
|
|
2010-02-07 18:47:33 +08:00
|
|
|
new_active =
|
|
|
|
GIMP_CHANNEL (gimp_item_tree_remove_item (private->channels,
|
|
|
|
GIMP_ITEM (channel),
|
|
|
|
GIMP_ITEM (new_active)));
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
|
2011-03-04 08:49:32 +08:00
|
|
|
if (active_channel &&
|
|
|
|
(channel == active_channel ||
|
|
|
|
gimp_viewable_is_ancestor (GIMP_VIEWABLE (channel),
|
|
|
|
GIMP_VIEWABLE (active_channel))))
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2008-10-10 03:40:41 +08:00
|
|
|
if (new_active)
|
2010-02-07 18:47:33 +08:00
|
|
|
gimp_image_set_active_channel (image, new_active);
|
2008-10-10 03:40:41 +08:00
|
|
|
else
|
|
|
|
gimp_image_unset_active_channel (image);
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
}
|
1999-01-11 07:36:29 +08:00
|
|
|
|
app: add gimp_item_{start,end}_move()
Add gimp_item_{start,end}_move(), and corresponding
GimpItem::{start,end}_move() virtual functions, which should be
called before/after "moving" the item (i.e., translating, scaling,
resizing, flipping, rotating, or transforming the item). Moves
performed between the outermost pair of start/end calls are treated
atomically.
What exactly does "treated atomically" entail depends on the
subclasses -- GimpItem doesn't provide a default implementation for
these functions, so the current commit doesn't change any behavior.
The next commit, which adds layer-mask support for group layers,
uses the functions to avoid cropping the mask too early while a
child is moving.
GimpItem calls {start,end}_move() in the various "move" functions
(gimp_item_{translate,scale,...}(), before performing the actual
operation. Additionally we call the functions in the
gimp_image_item_list_foo() functions, for each participating item,
so that the items are moved as a unit. We call the functions in
the various gimp_image_remove_foo() functions, since removing an
item may affect the size of its ancestors, and is therefore akin to
moving. We also call the functions in GimpEditSelectionTool, so
that the move tool moves items atomically while dragging.
2018-02-05 23:59:28 +08:00
|
|
|
gimp_item_end_move (GIMP_ITEM (channel), push_undo);
|
|
|
|
|
2011-02-07 18:35:58 +08:00
|
|
|
g_object_unref (channel);
|
|
|
|
|
app: add gimp_item_{start,end}_move()
Add gimp_item_{start,end}_move(), and corresponding
GimpItem::{start,end}_move() virtual functions, which should be
called before/after "moving" the item (i.e., translating, scaling,
resizing, flipping, rotating, or transforming the item). Moves
performed between the outermost pair of start/end calls are treated
atomically.
What exactly does "treated atomically" entail depends on the
subclasses -- GimpItem doesn't provide a default implementation for
these functions, so the current commit doesn't change any behavior.
The next commit, which adds layer-mask support for group layers,
uses the functions to avoid cropping the mask too early while a
child is moving.
GimpItem calls {start,end}_move() in the various "move" functions
(gimp_item_{translate,scale,...}(), before performing the actual
operation. Additionally we call the functions in the
gimp_image_item_list_foo() functions, for each participating item,
so that the items are moved as a unit. We call the functions in
the various gimp_image_remove_foo() functions, since removing an
item may affect the size of its ancestors, and is therefore akin to
moving. We also call the functions in GimpEditSelectionTool, so
that the move tool moves items atomically while dragging.
2018-02-05 23:59:28 +08:00
|
|
|
if (push_undo)
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_undo_group_end (image);
|
1998-06-28 18:39:58 +08:00
|
|
|
}
|
|
|
|
|
2010-02-08 02:21:42 +08:00
|
|
|
|
|
|
|
/* vectors */
|
|
|
|
|
2002-02-24 01:29:19 +08:00
|
|
|
gboolean
|
2008-09-17 19:41:54 +08:00
|
|
|
gimp_image_add_vectors (GimpImage *image,
|
|
|
|
GimpVectors *vectors,
|
2009-08-04 01:21:51 +08:00
|
|
|
GimpVectors *parent,
|
2008-10-10 03:40:41 +08:00
|
|
|
gint position,
|
|
|
|
gboolean push_undo)
|
2002-02-24 01:29:19 +08:00
|
|
|
{
|
2010-02-04 06:00:31 +08:00
|
|
|
GimpImagePrivate *private;
|
don't allow to select anything but the floating selection. Fixes bug
2004-01-18 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c (gimp_image_set_active_layer): don't allow
to select anything but the floating selection. Fixes bug #128025.
(gimp_image_set_active_layer,channel,vectors): allow to pass NULL
to unselect the active item. Removed the silly feature that
passing some random item of another image would select the first
item in the list (was unused anyway).
(gimp_image_unset_active_channel): use gimp_image_set_active_channel()
now that it accepts NULL.
(gimp_image_add_layer,channel,vectors): cleaned up / simplified.
(gimp_image_remove_layer,channel,vectors): cleanup,
simplification, use gimp_image_set_active_layer,channel,vectors()
now that they accept NULL, make sure the item next to the removed
item becomes the active one (and not the first in the list, which
was a severe usability problem in the dialogs).
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): pass
NULL to the set_active functions, cleanup.
* app/core/gimpimage-duplicate.c: attach the floating selection
before setting the active layer. Code relied on broken
gimp_image_set_active_layer() behaviour before.
* app/core/gimplayer-floating-sel.c: no need to set
gimage->floating_sel before calling gimp_image_add_layer(). The
weird GUI mentioned in the comment existed in 1.2 only.
* app/display/gimpdisplayshell-layer-select.c (layer_select_advance):
don't assume that setting the active_layer always succeeds.
* tools/pdbgen/pdb/image.pdb: behave as the documentation says
and return an execution error if setting the active layer or
channel failed.
Unrelated:
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/layer.pdb: removed leftover cruft from the old
guchar based color API.
* tools/pdbgen/pdb/channel.pdb: simplified code which handles the
channel's color.
* app/pdb/channel_cmds.c
* app/pdb/image_cmds.c: regenerated.
2004-01-18 20:16:44 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
2009-08-02 21:36:00 +08:00
|
|
|
|
2010-02-04 06:00:31 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
|
2010-02-10 00:47:08 +08:00
|
|
|
/* item and parent are type-checked in GimpItemTree
|
|
|
|
*/
|
|
|
|
if (! gimp_item_tree_get_insert_pos (private->vectors,
|
|
|
|
(GimpItem *) vectors,
|
|
|
|
(GimpItem **) &parent,
|
|
|
|
&position))
|
|
|
|
return FALSE;
|
2009-08-04 03:47:21 +08:00
|
|
|
|
2008-10-10 03:40:41 +08:00
|
|
|
if (push_undo)
|
2010-06-08 19:24:11 +08:00
|
|
|
gimp_image_undo_push_vectors_add (image, C_("undo-type", "Add Path"),
|
2010-02-07 22:01:31 +08:00
|
|
|
vectors,
|
|
|
|
gimp_image_get_active_vectors (image));
|
2002-02-24 01:29:19 +08:00
|
|
|
|
2010-02-07 18:47:33 +08:00
|
|
|
gimp_item_tree_add_item (private->vectors, GIMP_ITEM (vectors),
|
|
|
|
GIMP_ITEM (parent), position);
|
2002-02-24 01:29:19 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_set_active_vectors (image, vectors);
|
2002-02-24 01:29:19 +08:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_remove_vectors (GimpImage *image,
|
2008-10-10 03:40:41 +08:00
|
|
|
GimpVectors *vectors,
|
|
|
|
gboolean push_undo,
|
|
|
|
GimpVectors *new_active)
|
2002-02-24 01:29:19 +08:00
|
|
|
{
|
2010-02-07 18:47:33 +08:00
|
|
|
GimpImagePrivate *private;
|
|
|
|
GimpVectors *active_vectors;
|
don't allow to select anything but the floating selection. Fixes bug
2004-01-18 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c (gimp_image_set_active_layer): don't allow
to select anything but the floating selection. Fixes bug #128025.
(gimp_image_set_active_layer,channel,vectors): allow to pass NULL
to unselect the active item. Removed the silly feature that
passing some random item of another image would select the first
item in the list (was unused anyway).
(gimp_image_unset_active_channel): use gimp_image_set_active_channel()
now that it accepts NULL.
(gimp_image_add_layer,channel,vectors): cleaned up / simplified.
(gimp_image_remove_layer,channel,vectors): cleanup,
simplification, use gimp_image_set_active_layer,channel,vectors()
now that they accept NULL, make sure the item next to the removed
item becomes the active one (and not the first in the list, which
was a severe usability problem in the dialogs).
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): pass
NULL to the set_active functions, cleanup.
* app/core/gimpimage-duplicate.c: attach the floating selection
before setting the active layer. Code relied on broken
gimp_image_set_active_layer() behaviour before.
* app/core/gimplayer-floating-sel.c: no need to set
gimage->floating_sel before calling gimp_image_add_layer(). The
weird GUI mentioned in the comment existed in 1.2 only.
* app/display/gimpdisplayshell-layer-select.c (layer_select_advance):
don't assume that setting the active_layer always succeeds.
* tools/pdbgen/pdb/image.pdb: behave as the documentation says
and return an execution error if setting the active layer or
channel failed.
Unrelated:
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/layer.pdb: removed leftover cruft from the old
guchar based color API.
* tools/pdbgen/pdb/channel.pdb: simplified code which handles the
channel's color.
* app/pdb/channel_cmds.c
* app/pdb/image_cmds.c: regenerated.
2004-01-18 20:16:44 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2002-02-24 01:29:19 +08:00
|
|
|
g_return_if_fail (GIMP_IS_VECTORS (vectors));
|
2009-08-02 21:36:00 +08:00
|
|
|
g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (vectors)));
|
|
|
|
g_return_if_fail (gimp_item_get_image (GIMP_ITEM (vectors)) == image);
|
|
|
|
|
2010-02-07 18:47:33 +08:00
|
|
|
private = GIMP_IMAGE_GET_PRIVATE (image);
|
2009-08-02 21:36:00 +08:00
|
|
|
|
app: add gimp_item_{start,end}_move()
Add gimp_item_{start,end}_move(), and corresponding
GimpItem::{start,end}_move() virtual functions, which should be
called before/after "moving" the item (i.e., translating, scaling,
resizing, flipping, rotating, or transforming the item). Moves
performed between the outermost pair of start/end calls are treated
atomically.
What exactly does "treated atomically" entail depends on the
subclasses -- GimpItem doesn't provide a default implementation for
these functions, so the current commit doesn't change any behavior.
The next commit, which adds layer-mask support for group layers,
uses the functions to avoid cropping the mask too early while a
child is moving.
GimpItem calls {start,end}_move() in the various "move" functions
(gimp_item_{translate,scale,...}(), before performing the actual
operation. Additionally we call the functions in the
gimp_image_item_list_foo() functions, for each participating item,
so that the items are moved as a unit. We call the functions in
the various gimp_image_remove_foo() functions, since removing an
item may affect the size of its ancestors, and is therefore akin to
moving. We also call the functions in GimpEditSelectionTool, so
that the move tool moves items atomically while dragging.
2018-02-05 23:59:28 +08:00
|
|
|
if (push_undo)
|
|
|
|
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_ITEM_REMOVE,
|
|
|
|
C_("undo-type", "Remove Path"));
|
|
|
|
|
|
|
|
gimp_item_start_move (GIMP_ITEM (vectors), push_undo);
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
active_vectors = gimp_image_get_active_vectors (image);
|
don't allow to select anything but the floating selection. Fixes bug
2004-01-18 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c (gimp_image_set_active_layer): don't allow
to select anything but the floating selection. Fixes bug #128025.
(gimp_image_set_active_layer,channel,vectors): allow to pass NULL
to unselect the active item. Removed the silly feature that
passing some random item of another image would select the first
item in the list (was unused anyway).
(gimp_image_unset_active_channel): use gimp_image_set_active_channel()
now that it accepts NULL.
(gimp_image_add_layer,channel,vectors): cleaned up / simplified.
(gimp_image_remove_layer,channel,vectors): cleanup,
simplification, use gimp_image_set_active_layer,channel,vectors()
now that they accept NULL, make sure the item next to the removed
item becomes the active one (and not the first in the list, which
was a severe usability problem in the dialogs).
* app/core/gimpimage-undo-push.c (undo_pop_layer,channel): pass
NULL to the set_active functions, cleanup.
* app/core/gimpimage-duplicate.c: attach the floating selection
before setting the active layer. Code relied on broken
gimp_image_set_active_layer() behaviour before.
* app/core/gimplayer-floating-sel.c: no need to set
gimage->floating_sel before calling gimp_image_add_layer(). The
weird GUI mentioned in the comment existed in 1.2 only.
* app/display/gimpdisplayshell-layer-select.c (layer_select_advance):
don't assume that setting the active_layer always succeeds.
* tools/pdbgen/pdb/image.pdb: behave as the documentation says
and return an execution error if setting the active layer or
channel failed.
Unrelated:
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/layer.pdb: removed leftover cruft from the old
guchar based color API.
* tools/pdbgen/pdb/channel.pdb: simplified code which handles the
channel's color.
* app/pdb/channel_cmds.c
* app/pdb/image_cmds.c: regenerated.
2004-01-18 20:16:44 +08:00
|
|
|
|
2008-10-10 03:40:41 +08:00
|
|
|
if (push_undo)
|
2010-06-08 19:24:11 +08:00
|
|
|
gimp_image_undo_push_vectors_remove (image, C_("undo-type", "Remove Path"), vectors,
|
2010-02-07 20:46:46 +08:00
|
|
|
gimp_vectors_get_parent (vectors),
|
2010-02-07 18:47:33 +08:00
|
|
|
gimp_item_get_index (GIMP_ITEM (vectors)),
|
|
|
|
active_vectors);
|
2002-02-24 01:29:19 +08:00
|
|
|
|
2011-02-07 18:35:58 +08:00
|
|
|
g_object_ref (vectors);
|
|
|
|
|
2010-02-07 18:47:33 +08:00
|
|
|
new_active =
|
|
|
|
GIMP_VECTORS (gimp_item_tree_remove_item (private->vectors,
|
|
|
|
GIMP_ITEM (vectors),
|
|
|
|
GIMP_ITEM (new_active)));
|
2002-02-24 01:29:19 +08:00
|
|
|
|
2011-03-04 08:49:32 +08:00
|
|
|
if (active_vectors &&
|
|
|
|
(vectors == active_vectors ||
|
|
|
|
gimp_viewable_is_ancestor (GIMP_VIEWABLE (vectors),
|
|
|
|
GIMP_VIEWABLE (active_vectors))))
|
2011-02-14 08:25:45 +08:00
|
|
|
{
|
|
|
|
gimp_image_set_active_vectors (image, new_active);
|
|
|
|
}
|
2011-02-07 18:35:58 +08:00
|
|
|
|
app: add gimp_item_{start,end}_move()
Add gimp_item_{start,end}_move(), and corresponding
GimpItem::{start,end}_move() virtual functions, which should be
called before/after "moving" the item (i.e., translating, scaling,
resizing, flipping, rotating, or transforming the item). Moves
performed between the outermost pair of start/end calls are treated
atomically.
What exactly does "treated atomically" entail depends on the
subclasses -- GimpItem doesn't provide a default implementation for
these functions, so the current commit doesn't change any behavior.
The next commit, which adds layer-mask support for group layers,
uses the functions to avoid cropping the mask too early while a
child is moving.
GimpItem calls {start,end}_move() in the various "move" functions
(gimp_item_{translate,scale,...}(), before performing the actual
operation. Additionally we call the functions in the
gimp_image_item_list_foo() functions, for each participating item,
so that the items are moved as a unit. We call the functions in
the various gimp_image_remove_foo() functions, since removing an
item may affect the size of its ancestors, and is therefore akin to
moving. We also call the functions in GimpEditSelectionTool, so
that the move tool moves items atomically while dragging.
2018-02-05 23:59:28 +08:00
|
|
|
gimp_item_end_move (GIMP_ITEM (vectors), push_undo);
|
|
|
|
|
2011-02-07 18:35:58 +08:00
|
|
|
g_object_unref (vectors);
|
app: add gimp_item_{start,end}_move()
Add gimp_item_{start,end}_move(), and corresponding
GimpItem::{start,end}_move() virtual functions, which should be
called before/after "moving" the item (i.e., translating, scaling,
resizing, flipping, rotating, or transforming the item). Moves
performed between the outermost pair of start/end calls are treated
atomically.
What exactly does "treated atomically" entail depends on the
subclasses -- GimpItem doesn't provide a default implementation for
these functions, so the current commit doesn't change any behavior.
The next commit, which adds layer-mask support for group layers,
uses the functions to avoid cropping the mask too early while a
child is moving.
GimpItem calls {start,end}_move() in the various "move" functions
(gimp_item_{translate,scale,...}(), before performing the actual
operation. Additionally we call the functions in the
gimp_image_item_list_foo() functions, for each participating item,
so that the items are moved as a unit. We call the functions in
the various gimp_image_remove_foo() functions, since removing an
item may affect the size of its ancestors, and is therefore akin to
moving. We also call the functions in GimpEditSelectionTool, so
that the move tool moves items atomically while dragging.
2018-02-05 23:59:28 +08:00
|
|
|
|
|
|
|
if (push_undo)
|
|
|
|
gimp_image_undo_group_end (image);
|
2002-02-24 01:29:19 +08:00
|
|
|
}
|
|
|
|
|
2004-07-14 00:36:29 +08:00
|
|
|
gboolean
|
2006-06-03 23:41:40 +08:00
|
|
|
gimp_image_coords_in_active_pickable (GimpImage *image,
|
|
|
|
const GimpCoords *coords,
|
|
|
|
gboolean sample_merged,
|
|
|
|
gboolean selected_only)
|
2004-07-14 00:36:29 +08:00
|
|
|
{
|
2006-06-03 23:41:40 +08:00
|
|
|
gint x, y;
|
|
|
|
gboolean in_pickable = FALSE;
|
2004-07-14 00:36:29 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
2004-07-14 00:36:29 +08:00
|
|
|
|
2006-06-03 23:41:40 +08:00
|
|
|
x = floor (coords->x);
|
|
|
|
y = floor (coords->y);
|
2004-07-14 00:36:29 +08:00
|
|
|
|
2006-06-03 23:41:40 +08:00
|
|
|
if (sample_merged)
|
2004-07-14 00:36:29 +08:00
|
|
|
{
|
2007-12-26 00:21:40 +08:00
|
|
|
if (x >= 0 && x < gimp_image_get_width (image) &&
|
|
|
|
y >= 0 && y < gimp_image_get_height (image))
|
2006-06-03 23:41:40 +08:00
|
|
|
in_pickable = TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2007-07-19 22:59:51 +08:00
|
|
|
GimpDrawable *drawable = gimp_image_get_active_drawable (image);
|
2004-07-14 00:36:29 +08:00
|
|
|
|
2006-06-03 23:41:40 +08:00
|
|
|
if (drawable)
|
|
|
|
{
|
|
|
|
GimpItem *item = GIMP_ITEM (drawable);
|
|
|
|
gint off_x, off_y;
|
|
|
|
gint d_x, d_y;
|
|
|
|
|
2008-11-03 07:03:29 +08:00
|
|
|
gimp_item_get_offset (item, &off_x, &off_y);
|
2004-07-14 00:36:29 +08:00
|
|
|
|
2006-06-03 23:41:40 +08:00
|
|
|
d_x = x - off_x;
|
|
|
|
d_y = y - off_y;
|
2004-07-14 00:36:29 +08:00
|
|
|
|
2008-11-03 08:09:01 +08:00
|
|
|
if (d_x >= 0 && d_x < gimp_item_get_width (item) &&
|
|
|
|
d_y >= 0 && d_y < gimp_item_get_height (item))
|
2006-06-03 23:41:40 +08:00
|
|
|
in_pickable = TRUE;
|
|
|
|
}
|
|
|
|
}
|
2004-07-14 00:36:29 +08:00
|
|
|
|
2006-06-03 23:41:40 +08:00
|
|
|
if (in_pickable && selected_only)
|
|
|
|
{
|
|
|
|
GimpChannel *selection = gimp_image_get_mask (image);
|
2004-07-14 00:36:29 +08:00
|
|
|
|
2006-06-03 23:41:40 +08:00
|
|
|
if (! gimp_channel_is_empty (selection) &&
|
|
|
|
! gimp_pickable_get_opacity_at (GIMP_PICKABLE (selection),
|
|
|
|
x, y))
|
|
|
|
{
|
|
|
|
in_pickable = FALSE;
|
|
|
|
}
|
2004-07-14 00:36:29 +08:00
|
|
|
}
|
|
|
|
|
2006-06-03 23:41:40 +08:00
|
|
|
return in_pickable;
|
2004-07-14 00:36:29 +08:00
|
|
|
}
|
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
void
|
2008-11-06 04:48:59 +08:00
|
|
|
gimp_image_invalidate_previews (GimpImage *image)
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
{
|
2010-02-07 22:27:21 +08:00
|
|
|
GimpItemStack *layers;
|
|
|
|
GimpItemStack *channels;
|
2010-02-04 06:00:31 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2001-02-27 22:14:13 +08:00
|
|
|
|
2010-02-07 22:27:21 +08:00
|
|
|
layers = GIMP_ITEM_STACK (gimp_image_get_layers (image));
|
|
|
|
channels = GIMP_ITEM_STACK (gimp_image_get_channels (image));
|
2010-02-04 06:00:31 +08:00
|
|
|
|
2010-02-07 22:27:21 +08:00
|
|
|
gimp_item_stack_invalidate_previews (layers);
|
|
|
|
gimp_item_stack_invalidate_previews (channels);
|
1998-06-28 18:39:58 +08:00
|
|
|
}
|