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
|
2009-01-18 06:28:01 +08:00
|
|
|
* along with this program. If not, see <http://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>
|
2008-10-10 04:24:04 +08:00
|
|
|
#include <gegl.h>
|
2012-05-03 09:36:22 +08:00
|
|
|
#include <gdk-pixbuf/gdk-pixbuf.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
|
|
|
|
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"
|
2002-05-15 19:05:32 +08:00
|
|
|
#include "gimp-parasites.h"
|
2003-11-25 20:53:29 +08:00
|
|
|
#include "gimp-utils.h"
|
1999-10-27 02:27:27 +08:00
|
|
|
#include "gimpcontext.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"
|
2003-03-18 21:49:02 +08:00
|
|
|
#include "gimpimage-colormap.h"
|
2003-03-28 21:52:01 +08:00
|
|
|
#include "gimpimage-guides.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"
|
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"
|
2002-02-22 06:19:45 +08:00
|
|
|
#include "gimplayer-floating-sel.h"
|
2001-01-29 00:44:22 +08:00
|
|
|
#include "gimplayermask.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"
|
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-04-14 22:38:55 +08:00
|
|
|
#include "file/file-utils.h"
|
|
|
|
|
2002-02-24 01:29:19 +08:00
|
|
|
#include "vectors/gimpvectors.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
|
|
|
|
|
2011-01-27 03:45:32 +08:00
|
|
|
/* Data keys for GimpImage */
|
|
|
|
#define GIMP_FILE_EXPORT_URI_KEY "gimp-file-export-uri"
|
|
|
|
#define GIMP_FILE_SAVE_A_COPY_URI_KEY "gimp-file-save-a-copy-uri"
|
|
|
|
#define GIMP_FILE_IMPORT_SOURCE_URI_KEY "gimp-file-import-source-uri"
|
|
|
|
|
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
|
|
|
|
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,
|
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,
|
|
|
|
PROP_PRECISION
|
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);
|
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);
|
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);
|
|
|
|
static void gimp_image_real_colormap_changed (GimpImage *image,
|
|
|
|
gint color_index);
|
2008-11-05 02:06:36 +08:00
|
|
|
|
|
|
|
static const guint8 * gimp_image_get_icc_profile (GimpColorManaged *managed,
|
|
|
|
gsize *len);
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
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,
|
|
|
|
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,
|
|
|
|
gimp_projectable_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
|
|
|
|
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,
|
|
|
|
gimp_marshal_VOID__STRING,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
G_TYPE_STRING);
|
|
|
|
|
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,
|
|
|
|
gimp_marshal_VOID__STRING,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
G_TYPE_STRING);
|
|
|
|
|
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,
|
|
|
|
gimp_marshal_VOID__POINTER,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
G_TYPE_POINTER);
|
|
|
|
|
|
|
|
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,
|
|
|
|
gimp_marshal_VOID__POINTER,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
G_TYPE_POINTER);
|
|
|
|
|
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,
|
|
|
|
gimp_marshal_VOID__POINTER,
|
|
|
|
G_TYPE_NONE, 1,
|
|
|
|
G_TYPE_POINTER);
|
|
|
|
|
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
|
|
|
|
2003-03-24 22:31:59 +08:00
|
|
|
viewable_class->default_stock_id = "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;
|
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;
|
2008-08-05 04:11:35 +08:00
|
|
|
klass->resolution_changed = NULL;
|
|
|
|
klass->size_changed_detailed = gimp_image_real_size_changed_detailed;
|
|
|
|
klass->unit_changed = NULL;
|
|
|
|
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;
|
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,
|
|
|
|
GIMP_PRECISION_U8,
|
|
|
|
GIMP_PARAM_READWRITE |
|
|
|
|
G_PARAM_CONSTRUCT));
|
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
g_type_class_add_private (klass, sizeof (GimpImagePrivate));
|
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)
|
|
|
|
{
|
|
|
|
iface->get_icc_profile = gimp_image_get_icc_profile;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
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
|
|
|
{
|
2010-02-04 03:31:25 +08:00
|
|
|
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
gint i;
|
2004-01-15 21:58:27 +08:00
|
|
|
|
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;
|
2012-04-22 23:07:35 +08:00
|
|
|
private->precision = GIMP_PRECISION_U8;
|
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
|
|
|
|
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
|
|
|
|
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,
|
|
|
|
GIMP_TYPE_DRAWABLE_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
|
|
|
|
2011-01-13 05:53:58 +08:00
|
|
|
if (G_OBJECT_CLASS (parent_class)->constructed)
|
|
|
|
G_OBJECT_CLASS (parent_class)->constructed (object);
|
2004-07-14 20:12:50 +08:00
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
g_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);
|
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;
|
|
|
|
case PROP_ID:
|
|
|
|
g_assert_not_reached ();
|
|
|
|
break;
|
|
|
|
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;
|
|
|
|
case PROP_BASE_TYPE:
|
2010-02-04 03:31:25 +08:00
|
|
|
private->base_type = g_value_get_enum (value);
|
2004-07-14 20:12:50 +08:00
|
|
|
break;
|
2012-04-22 23:31:32 +08:00
|
|
|
case PROP_PRECISION:
|
|
|
|
private->precision = g_value_get_enum (value);
|
|
|
|
break;
|
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;
|
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
|
|
|
|
2010-02-06 20:41:16 +08:00
|
|
|
gimp_container_foreach (private->layers->container,
|
|
|
|
(GFunc) gimp_item_removed, NULL);
|
|
|
|
gimp_container_foreach (private->channels->container,
|
|
|
|
(GFunc) gimp_item_removed, NULL);
|
|
|
|
gimp_container_foreach (private->vectors->container,
|
|
|
|
(GFunc) gimp_item_removed, NULL);
|
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
|
|
|
|
2010-02-04 04:46:09 +08:00
|
|
|
if (private->projection)
|
2004-07-14 00:36:29 +08:00
|
|
|
{
|
2010-02-04 04:46:09 +08:00
|
|
|
g_object_unref (private->projection);
|
|
|
|
private->projection = NULL;
|
2004-07-14 00:36:29 +08:00
|
|
|
}
|
2001-08-11 22:39:19 +08:00
|
|
|
|
2010-02-04 04:46:09 +08:00
|
|
|
if (private->graph)
|
2008-10-10 04:44:23 +08:00
|
|
|
{
|
2010-02-04 04:46:09 +08:00
|
|
|
g_object_unref (private->graph);
|
|
|
|
private->graph = 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
|
|
|
|
2010-02-04 06:00:31 +08:00
|
|
|
if (private->layers)
|
2001-08-11 22:39:19 +08:00
|
|
|
{
|
2010-02-04 06:00:31 +08:00
|
|
|
g_object_unref (private->layers);
|
|
|
|
private->layers = NULL;
|
2001-08-11 22:39:19 +08:00
|
|
|
}
|
2010-02-04 06:00:31 +08:00
|
|
|
if (private->channels)
|
2001-08-11 22:39:19 +08:00
|
|
|
{
|
2010-02-04 06:00:31 +08:00
|
|
|
g_object_unref (private->channels);
|
|
|
|
private->channels = NULL;
|
2001-08-11 22:39:19 +08:00
|
|
|
}
|
2010-02-04 06:00:31 +08:00
|
|
|
if (private->vectors)
|
2002-02-24 01:29:19 +08:00
|
|
|
{
|
2010-02-04 06:00:31 +08:00
|
|
|
g_object_unref (private->vectors);
|
|
|
|
private->vectors = NULL;
|
2002-02-24 01:29:19 +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
|
|
|
|
2010-02-04 06:24:18 +08:00
|
|
|
if (private->selection_mask)
|
2001-08-11 22:39:19 +08:00
|
|
|
{
|
2010-02-04 06:24:18 +08:00
|
|
|
g_object_unref (private->selection_mask);
|
|
|
|
private->selection_mask = NULL;
|
2001-08-11 22:39:19 +08:00
|
|
|
}
|
2001-01-10 08:36:54 +08:00
|
|
|
|
2010-02-04 06:42:32 +08:00
|
|
|
if (private->parasites)
|
2001-08-11 22:39:19 +08:00
|
|
|
{
|
2010-02-04 06:42:32 +08:00
|
|
|
g_object_unref (private->parasites);
|
|
|
|
private->parasites = NULL;
|
2001-08-11 22:39:19 +08:00
|
|
|
}
|
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
|
|
|
|
2010-02-04 05:16:02 +08:00
|
|
|
if (private->grid)
|
2005-03-05 02:16:29 +08:00
|
|
|
{
|
2010-02-04 05:16:02 +08:00
|
|
|
g_object_unref (private->grid);
|
|
|
|
private->grid = NULL;
|
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,
|
|
|
|
(GDestroyNotify) gimp_sample_point_unref);
|
2010-02-04 05:16:02 +08:00
|
|
|
private->sample_points = NULL;
|
2005-03-05 08:10:40 +08:00
|
|
|
}
|
|
|
|
|
2010-02-05 03:06:49 +08:00
|
|
|
if (private->undo_stack)
|
2001-08-11 22:39:19 +08:00
|
|
|
{
|
2010-02-05 03:06:49 +08:00
|
|
|
g_object_unref (private->undo_stack);
|
|
|
|
private->undo_stack = NULL;
|
2001-08-11 22:39:19 +08:00
|
|
|
}
|
2010-02-05 03:06:49 +08:00
|
|
|
if (private->redo_stack)
|
2001-08-11 22:39:19 +08:00
|
|
|
{
|
2010-02-05 03:06:49 +08:00
|
|
|
g_object_unref (private->redo_stack);
|
|
|
|
private->redo_stack = NULL;
|
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
|
|
|
}
|
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
if (private->display_name)
|
2008-11-13 20:09:05 +08:00
|
|
|
{
|
2010-02-04 03:31:25 +08:00
|
|
|
g_free (private->display_name);
|
|
|
|
private->display_name = NULL;
|
2008-11-13 20:09:05 +08:00
|
|
|
}
|
|
|
|
|
2012-07-18 04:52:49 +08:00
|
|
|
if (private->display_path)
|
|
|
|
{
|
|
|
|
g_free (private->display_path);
|
|
|
|
private->display_path = NULL;
|
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
if (private->display_name)
|
2008-11-13 20:09:05 +08:00
|
|
|
{
|
2010-02-04 03:31:25 +08:00
|
|
|
g_free (private->display_name);
|
|
|
|
private->display_name = NULL;
|
2008-11-13 20:09:05 +08:00
|
|
|
}
|
|
|
|
|
2012-07-18 04:52:49 +08:00
|
|
|
if (private->display_path)
|
|
|
|
{
|
|
|
|
g_free (private->display_path);
|
|
|
|
private->display_path = NULL;
|
|
|
|
}
|
|
|
|
|
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)
|
|
|
|
gimp_object_name_free (object);
|
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)
|
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
GimpImage *image = GIMP_IMAGE (viewable);
|
2009-08-02 05:07:07 +08:00
|
|
|
GList *all_items;
|
2003-03-24 20:21:58 +08:00
|
|
|
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
|
|
|
|
|
|
|
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",
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
gimp_projectable_structure_changed (GIMP_PROJECTABLE (image));
|
|
|
|
}
|
|
|
|
|
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));
|
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
if (private->colormap)
|
2003-03-23 06:53:29 +08:00
|
|
|
{
|
2012-03-18 03:33:47 +08:00
|
|
|
babl_palette_set_palette (private->babl_palette_rgb,
|
2012-04-22 23:07:35 +08:00
|
|
|
gimp_babl_format (GIMP_RGB,
|
|
|
|
private->precision, FALSE),
|
2012-03-18 03:33:47 +08:00
|
|
|
private->colormap,
|
|
|
|
private->n_colors);
|
|
|
|
babl_palette_set_palette (private->babl_palette_rgba,
|
2012-04-22 23:07:35 +08:00
|
|
|
gimp_babl_format (GIMP_RGB,
|
|
|
|
private->precision, FALSE),
|
2012-03-18 03:33:47 +08:00
|
|
|
private->colormap,
|
|
|
|
private->n_colors);
|
|
|
|
}
|
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 *
|
|
|
|
gimp_image_get_icc_profile (GimpColorManaged *managed,
|
|
|
|
gsize *len)
|
|
|
|
{
|
|
|
|
const GimpParasite *parasite;
|
|
|
|
|
|
|
|
parasite = gimp_image_parasite_find (GIMP_IMAGE (managed), "icc-profile");
|
|
|
|
|
|
|
|
if (parasite)
|
|
|
|
{
|
|
|
|
gsize data_size = gimp_parasite_data_size (parasite);
|
|
|
|
|
|
|
|
if (data_size > 0)
|
|
|
|
{
|
|
|
|
*len = data_size;
|
|
|
|
|
|
|
|
return gimp_parasite_data (parasite);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
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,
|
|
|
|
gimp_image_get_precision (image), TRUE);
|
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,
|
|
|
|
gimp_image_get_precision (image), TRUE);
|
2012-03-30 03:09:37 +08:00
|
|
|
}
|
2009-09-13 01:24:01 +08:00
|
|
|
|
2012-03-30 03:09:37 +08:00
|
|
|
g_assert_not_reached ();
|
|
|
|
|
|
|
|
return NULL;
|
2009-09-13 01:24:01 +08:00
|
|
|
}
|
|
|
|
|
2008-11-05 02:06:36 +08:00
|
|
|
static GeglNode *
|
|
|
|
gimp_image_get_graph (GimpProjectable *projectable)
|
|
|
|
{
|
2010-02-04 04:46:09 +08:00
|
|
|
GimpImage *image = GIMP_IMAGE (projectable);
|
|
|
|
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (image);
|
|
|
|
GeglNode *layers_node;
|
|
|
|
GeglNode *channels_node;
|
|
|
|
GeglNode *blend_node;
|
|
|
|
GeglNode *output;
|
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 =
|
2010-02-06 20:41:16 +08:00
|
|
|
gimp_drawable_stack_get_graph (GIMP_DRAWABLE_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
|
|
|
|
|
|
|
channels_node =
|
2010-02-06 20:41:16 +08:00
|
|
|
gimp_drawable_stack_get_graph (GIMP_DRAWABLE_STACK (private->channels->container));
|
2008-11-05 02:06:36 +08:00
|
|
|
|
2010-02-04 04:46:09 +08:00
|
|
|
gegl_node_add_child (private->graph, channels_node);
|
2008-11-05 02:06:36 +08:00
|
|
|
|
2010-02-04 04:46:09 +08:00
|
|
|
blend_node = gegl_node_new_child (private->graph,
|
2009-11-28 04:11:26 +08:00
|
|
|
"operation", "gegl:over",
|
2008-11-05 02:06:36 +08:00
|
|
|
NULL);
|
|
|
|
|
|
|
|
gegl_node_connect_to (layers_node, "output",
|
|
|
|
blend_node, "input");
|
|
|
|
gegl_node_connect_to (channels_node, "output",
|
|
|
|
blend_node, "aux");
|
|
|
|
|
2010-02-04 04:46:09 +08:00
|
|
|
output = gegl_node_get_output_proxy (private->graph, "output");
|
2008-11-05 02:06:36 +08:00
|
|
|
|
|
|
|
gegl_node_connect_to (blend_node, "output",
|
|
|
|
output, "input");
|
|
|
|
|
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);
|
2012-04-25 21:24:32 +08:00
|
|
|
g_return_val_if_fail (base_type != GIMP_INDEXED ||
|
2012-04-29 00:21:37 +08:00
|
|
|
precision == GIMP_PRECISION_U8, 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
|
|
|
}
|
|
|
|
|
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
|
2012-05-08 03:57:33 +08:00
|
|
|
gimp_image_get_base_type (const 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
|
|
|
}
|
|
|
|
|
2012-04-22 23:07:35 +08:00
|
|
|
GimpPrecision
|
|
|
|
gimp_image_get_precision (const GimpImage *image)
|
|
|
|
{
|
|
|
|
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 *
|
2012-04-12 00:40:30 +08:00
|
|
|
gimp_image_get_format (const GimpImage *image,
|
|
|
|
GimpImageBaseType base_type,
|
2012-05-08 03:46:47 +08:00
|
|
|
GimpPrecision precision,
|
2012-04-12 00:40:30 +08:00
|
|
|
gboolean with_alpha)
|
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:
|
2012-05-08 03:46:47 +08:00
|
|
|
return gimp_babl_format (base_type, precision, with_alpha);
|
2012-04-07 06:15:48 +08:00
|
|
|
|
|
|
|
case GIMP_INDEXED:
|
2012-05-08 03:46:47 +08:00
|
|
|
if (precision == GIMP_PRECISION_U8)
|
|
|
|
{
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2012-04-12 00:40:30 +08:00
|
|
|
const Babl *
|
|
|
|
gimp_image_get_layer_format (const GimpImage *image,
|
|
|
|
gboolean with_alpha)
|
|
|
|
{
|
|
|
|
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),
|
2012-04-12 00:40:30 +08:00
|
|
|
with_alpha);
|
|
|
|
}
|
|
|
|
|
2012-04-08 04:45:25 +08:00
|
|
|
const Babl *
|
|
|
|
gimp_image_get_channel_format (const GimpImage *image)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
2012-05-08 03:46:47 +08:00
|
|
|
return gimp_image_get_format (image, GIMP_GRAY,
|
|
|
|
gimp_image_get_precision (image),
|
|
|
|
FALSE);
|
2012-04-08 04:45:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
const Babl *
|
|
|
|
gimp_image_get_mask_format (const GimpImage *image)
|
|
|
|
{
|
|
|
|
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
|
|
|
}
|
|
|
|
|
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_get_ID (const 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
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_set_uri (GimpImage *image,
|
2002-04-14 22:38:55 +08:00
|
|
|
const gchar *uri)
|
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
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_object_set_name (GIMP_OBJECT (image), uri);
|
2001-01-14 11:55:56 +08:00
|
|
|
}
|
1998-06-28 18:39:58 +08:00
|
|
|
|
2007-01-19 19:48:48 +08:00
|
|
|
static void
|
|
|
|
gimp_image_take_uri (GimpImage *image,
|
|
|
|
gchar *uri)
|
|
|
|
{
|
|
|
|
gimp_object_take_name (GIMP_OBJECT (image), uri);
|
|
|
|
}
|
|
|
|
|
2011-01-27 01:32:17 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_get_untitled_string:
|
|
|
|
*
|
|
|
|
* Returns: The (translated) "Untitled" string for newly created
|
|
|
|
* images.
|
|
|
|
**/
|
|
|
|
const gchar *
|
|
|
|
gimp_image_get_string_untitled (void)
|
|
|
|
{
|
|
|
|
return _("Untitled");
|
|
|
|
}
|
|
|
|
|
2011-01-26 14:55:14 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_get_uri_or_untitled:
|
|
|
|
* @image: A #GimpImage.
|
|
|
|
*
|
|
|
|
* Get the URI of the XCF image, or "Untitled" if there is no URI.
|
|
|
|
*
|
|
|
|
* Returns: The URI, or "Untitled".
|
|
|
|
**/
|
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
|
|
|
const gchar *
|
2011-01-26 14:55:14 +08:00
|
|
|
gimp_image_get_uri_or_untitled (const GimpImage *image)
|
2002-04-14 22:38:55 +08:00
|
|
|
{
|
|
|
|
const gchar *uri;
|
|
|
|
|
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
|
|
|
|
2011-01-26 15:19:39 +08:00
|
|
|
uri = gimp_image_get_uri (image);
|
2002-04-14 22:38:55 +08:00
|
|
|
|
2011-01-27 01:32:17 +08:00
|
|
|
return uri ? uri : gimp_image_get_string_untitled ();
|
2002-04-14 22:38:55 +08:00
|
|
|
}
|
|
|
|
|
2011-01-26 15:19:39 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_get_uri:
|
|
|
|
* @image: A #GimpImage.
|
|
|
|
*
|
|
|
|
* Get the URI of the XCF image, or NULL if there is no URI.
|
|
|
|
*
|
|
|
|
* Returns: The URI, or NULL.
|
|
|
|
**/
|
|
|
|
const gchar *
|
|
|
|
gimp_image_get_uri (const GimpImage *image)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
|
|
|
return gimp_object_get_name (image);
|
|
|
|
}
|
|
|
|
|
2002-04-14 22:38:55 +08:00
|
|
|
void
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_set_filename (GimpImage *image,
|
2002-04-14 22:38:55 +08:00
|
|
|
const gchar *filename)
|
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
2002-04-14 22:38:55 +08:00
|
|
|
|
2003-05-17 23:35:57 +08:00
|
|
|
if (filename && strlen (filename))
|
2002-04-14 22:38:55 +08:00
|
|
|
{
|
2007-01-19 19:48:48 +08:00
|
|
|
gimp_image_take_uri (image,
|
|
|
|
file_utils_filename_to_uri (image->gimp,
|
|
|
|
filename,
|
|
|
|
NULL));
|
2002-04-14 22:38:55 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_set_uri (image, NULL);
|
2002-04-14 22:38:55 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-27 03:45:32 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_get_imported_uri:
|
|
|
|
* @image: A #GimpImage.
|
|
|
|
*
|
|
|
|
* Returns: The URI of the imported image, or NULL if the image has
|
|
|
|
* been saved as XCF after it was imported.
|
|
|
|
**/
|
|
|
|
const gchar *
|
|
|
|
gimp_image_get_imported_uri (const GimpImage *image)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
|
|
|
return g_object_get_data (G_OBJECT (image),
|
|
|
|
GIMP_FILE_IMPORT_SOURCE_URI_KEY);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_image_get_exported_uri:
|
|
|
|
* @image: A #GimpImage.
|
|
|
|
*
|
|
|
|
* Returns: The URI of the image last exported from this XCF file, or
|
|
|
|
* NULL if the image has never been exported.
|
|
|
|
**/
|
|
|
|
const gchar *
|
|
|
|
gimp_image_get_exported_uri (const GimpImage *image)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
|
|
|
return g_object_get_data (G_OBJECT (image),
|
|
|
|
GIMP_FILE_EXPORT_URI_KEY);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_image_get_save_a_copy_uri:
|
|
|
|
* @image: A #GimpImage.
|
|
|
|
*
|
|
|
|
* Returns: The URI of the last copy that was saved of this XCF file.
|
|
|
|
**/
|
|
|
|
const gchar *
|
|
|
|
gimp_image_get_save_a_copy_uri (const GimpImage *image)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
|
|
|
return g_object_get_data (G_OBJECT (image),
|
|
|
|
GIMP_FILE_SAVE_A_COPY_URI_KEY);
|
|
|
|
}
|
|
|
|
|
2011-08-13 03:15:16 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_get_any_uri:
|
|
|
|
* @image: A #GimpImage.
|
|
|
|
*
|
|
|
|
* Returns: The XCF file URI, the imported file URI, or the exported
|
2012-07-18 04:52:49 +08:00
|
|
|
* file URI, in that order of precedence.
|
2011-08-13 03:15:16 +08:00
|
|
|
**/
|
|
|
|
const gchar *
|
|
|
|
gimp_image_get_any_uri (const GimpImage *image)
|
|
|
|
{
|
|
|
|
const gchar *uri;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
|
|
|
uri = gimp_image_get_uri (image);
|
|
|
|
if (! uri)
|
|
|
|
{
|
|
|
|
uri = gimp_image_get_imported_uri (image);
|
|
|
|
if (! uri)
|
|
|
|
{
|
|
|
|
uri = gimp_image_get_exported_uri (image);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return uri;
|
|
|
|
}
|
|
|
|
|
2011-01-27 03:45:32 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_set_imported_uri:
|
|
|
|
* @image: A #GimpImage.
|
|
|
|
* @uri:
|
|
|
|
*
|
|
|
|
* Sets the URI this file was imported from.
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gimp_image_set_imported_uri (GimpImage *image,
|
|
|
|
const gchar *uri)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
|
|
|
|
2011-03-18 03:23:09 +08:00
|
|
|
if (gimp_image_get_imported_uri (image) == uri)
|
|
|
|
return;
|
|
|
|
|
2011-01-27 03:45:32 +08:00
|
|
|
g_object_set_data_full (G_OBJECT (image), GIMP_FILE_IMPORT_SOURCE_URI_KEY,
|
|
|
|
g_strdup (uri), (GDestroyNotify) g_free);
|
2012-07-18 04:52:49 +08:00
|
|
|
|
|
|
|
gimp_object_name_changed (GIMP_OBJECT (image));
|
2011-01-27 03:45:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_image_set_exported_uri:
|
|
|
|
* @image: A #GimpImage.
|
|
|
|
* @uri:
|
|
|
|
*
|
|
|
|
* Sets the URI this file was last exported to. Note that saving as
|
|
|
|
* XCF is not "exporting".
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gimp_image_set_exported_uri (GimpImage *image,
|
|
|
|
const gchar *uri)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
|
|
|
|
2011-03-18 03:23:09 +08:00
|
|
|
if (gimp_image_get_exported_uri (image) == uri)
|
|
|
|
return;
|
|
|
|
|
2011-01-27 03:45:32 +08:00
|
|
|
g_object_set_data_full (G_OBJECT (image),
|
|
|
|
GIMP_FILE_EXPORT_URI_KEY,
|
|
|
|
g_strdup (uri), (GDestroyNotify) g_free);
|
2012-07-18 04:52:49 +08:00
|
|
|
|
|
|
|
gimp_object_name_changed (GIMP_OBJECT (image));
|
2011-01-27 03:45:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_image_set_save_a_copy_uri:
|
|
|
|
* @image: A #GimpImage.
|
|
|
|
* @uri:
|
|
|
|
*
|
|
|
|
* Set the URI to the last copy this XCF file was saved to through the
|
|
|
|
* "save a copy" action.
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gimp_image_set_save_a_copy_uri (GimpImage *image,
|
|
|
|
const gchar *uri)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
|
|
|
|
2011-03-18 03:23:09 +08:00
|
|
|
if (gimp_image_get_save_a_copy_uri (image) == uri)
|
|
|
|
return;
|
|
|
|
|
2011-01-27 03:45:32 +08:00
|
|
|
g_object_set_data_full (G_OBJECT (image),
|
|
|
|
GIMP_FILE_SAVE_A_COPY_URI_KEY,
|
|
|
|
g_strdup (uri), (GDestroyNotify) g_free);
|
|
|
|
}
|
|
|
|
|
2002-04-14 22:38:55 +08:00
|
|
|
gchar *
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_get_filename (const 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
|
|
|
{
|
2002-04-14 22:38:55 +08:00
|
|
|
const gchar *uri;
|
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
|
|
|
|
2011-01-26 15:19:39 +08:00
|
|
|
uri = gimp_image_get_uri (image);
|
2002-04-14 22:38:55 +08:00
|
|
|
|
2002-05-07 20:23:40 +08:00
|
|
|
if (! uri)
|
|
|
|
return 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
|
|
|
|
2002-04-14 22:38:55 +08:00
|
|
|
return g_filename_from_uri (uri, NULL, 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
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
const gchar *uri;
|
|
|
|
const gchar *source;
|
|
|
|
const gchar *dest;
|
|
|
|
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);
|
|
|
|
|
|
|
|
uri = gimp_image_get_uri (image);
|
|
|
|
source = gimp_image_get_imported_uri (image);
|
|
|
|
dest = gimp_image_get_exported_uri (image);
|
|
|
|
|
|
|
|
is_imported = (source != NULL);
|
|
|
|
is_exported = (dest != NULL);
|
|
|
|
|
|
|
|
if (uri)
|
|
|
|
{
|
|
|
|
display_uri = g_strdup (uri);
|
|
|
|
uri_format = "%s";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (is_imported)
|
|
|
|
display_uri = g_strdup (source);
|
|
|
|
|
|
|
|
/* Calculate filename suffix */
|
|
|
|
if (! gimp_image_is_export_dirty (image))
|
|
|
|
{
|
|
|
|
if (is_exported)
|
|
|
|
{
|
|
|
|
display_uri = g_strdup (dest);
|
|
|
|
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)");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (display_uri)
|
|
|
|
{
|
|
|
|
gchar *tmp = file_utils_uri_with_new_ext (display_uri, NULL);
|
|
|
|
g_free (display_uri);
|
|
|
|
display_uri = tmp;
|
|
|
|
}
|
|
|
|
|
|
|
|
uri_format = "[%s]";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (! display_uri)
|
|
|
|
{
|
|
|
|
display_uri = g_strdup (gimp_image_get_string_untitled ());
|
|
|
|
}
|
|
|
|
else if (basename)
|
|
|
|
{
|
2012-09-21 16:34:17 +08:00
|
|
|
tmp = file_utils_uri_display_basename (display_uri);
|
2012-07-18 04:52:49 +08:00
|
|
|
g_free (display_uri);
|
|
|
|
display_uri = tmp;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-09-21 16:34:17 +08:00
|
|
|
tmp = file_utils_uri_display_name (display_uri);
|
2012-07-18 04:52:49 +08:00
|
|
|
g_free (display_uri);
|
|
|
|
display_uri = tmp;
|
|
|
|
}
|
|
|
|
|
|
|
|
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 *
|
|
|
|
gimp_image_get_load_proc (const GimpImage *image)
|
|
|
|
{
|
|
|
|
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 *
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_get_save_proc (const 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
|
|
|
}
|
|
|
|
|
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
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_get_resolution (const 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));
|
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
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_get_unit (const 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
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_get_width (const 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
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_get_height (const 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
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_has_alpha (const 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
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_is_empty (const 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 *
|
2008-11-14 23:01:44 +08:00
|
|
|
gimp_image_get_floating_selection (const 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 *
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_get_mask (const 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 *
|
|
|
|
gimp_image_get_component_format (const GimpImage *image,
|
|
|
|
GimpChannelType channel)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
|
|
|
switch (channel)
|
|
|
|
{
|
2012-04-23 01:47:46 +08:00
|
|
|
case GIMP_RED_CHANNEL:
|
|
|
|
return gimp_babl_component_format (GIMP_RGB,
|
|
|
|
gimp_image_get_precision (image),
|
|
|
|
RED);
|
|
|
|
|
|
|
|
case GIMP_GREEN_CHANNEL:
|
|
|
|
return gimp_babl_component_format (GIMP_RGB,
|
|
|
|
gimp_image_get_precision (image),
|
|
|
|
GREEN);
|
|
|
|
|
|
|
|
case GIMP_BLUE_CHANNEL:
|
|
|
|
return gimp_babl_component_format (GIMP_RGB,
|
|
|
|
gimp_image_get_precision (image),
|
|
|
|
BLUE);
|
|
|
|
|
|
|
|
case GIMP_ALPHA_CHANNEL:
|
|
|
|
return gimp_babl_component_format (GIMP_RGB,
|
|
|
|
gimp_image_get_precision (image),
|
|
|
|
ALPHA);
|
|
|
|
|
|
|
|
case GIMP_GRAY_CHANNEL:
|
|
|
|
return gimp_babl_component_format (GIMP_GRAY,
|
|
|
|
gimp_image_get_precision (image),
|
|
|
|
GRAY);
|
|
|
|
|
|
|
|
case GIMP_INDEXED_CHANNEL:
|
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
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_get_component_index (const 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
|
|
|
{
|
2008-10-19 21:47:09 +08:00
|
|
|
case GIMP_RED_CHANNEL: return RED;
|
|
|
|
case GIMP_GREEN_CHANNEL: return GREEN;
|
|
|
|
case GIMP_BLUE_CHANNEL: return BLUE;
|
|
|
|
case GIMP_GRAY_CHANNEL: return GRAY;
|
|
|
|
case GIMP_INDEXED_CHANNEL: return INDEXED;
|
2001-12-14 04:19:41 +08:00
|
|
|
case GIMP_ALPHA_CHANNEL:
|
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
|
|
|
{
|
2008-11-14 23:01:44 +08:00
|
|
|
GimpLayer *floating_sel = gimp_image_get_floating_selection (image);
|
2006-05-31 05:22:34 +08:00
|
|
|
|
2010-02-04 16:08:50 +08:00
|
|
|
private->active[index] = active ? TRUE : FALSE;
|
1998-06-28 18:39:58 +08:00
|
|
|
|
2006-05-31 05:22:34 +08:00
|
|
|
if (floating_sel)
|
2008-11-10 00:49:37 +08:00
|
|
|
gimp_drawable_update (GIMP_DRAWABLE (floating_sel),
|
|
|
|
0, 0,
|
|
|
|
gimp_item_get_width (GIMP_ITEM (floating_sel)),
|
|
|
|
gimp_item_get_height (GIMP_ITEM (floating_sel)));
|
2006-05-31 05:22:34 +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
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_get_component_active (const 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
|
|
|
|
gimp_image_get_active_array (const GimpImage *image,
|
|
|
|
gboolean *components)
|
|
|
|
{
|
|
|
|
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
|
|
|
|
gimp_image_get_active_mask (const GimpImage *image)
|
|
|
|
{
|
|
|
|
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:
|
|
|
|
mask |= (private->active[RED]) ? GIMP_COMPONENT_RED : 0;
|
|
|
|
mask |= (private->active[GREEN]) ? GIMP_COMPONENT_GREEN : 0;
|
|
|
|
mask |= (private->active[BLUE]) ? GIMP_COMPONENT_BLUE : 0;
|
|
|
|
mask |= (private->active[ALPHA]) ? GIMP_COMPONENT_ALPHA : 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case GIMP_GRAY:
|
|
|
|
case GIMP_INDEXED:
|
|
|
|
mask |= (private->active[GRAY]) ? GIMP_COMPONENT_RED : 0;
|
|
|
|
mask |= (private->active[GRAY]) ? GIMP_COMPONENT_GREEN : 0;
|
|
|
|
mask |= (private->active[GRAY]) ? GIMP_COMPONENT_BLUE : 0;
|
|
|
|
mask |= (private->active[ALPHA]) ? GIMP_COMPONENT_ALPHA : 0;
|
|
|
|
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
|
|
|
|
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
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_get_component_visible (const 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
|
|
|
|
gimp_image_get_visible_array (const GimpImage *image,
|
|
|
|
gboolean *components)
|
|
|
|
{
|
|
|
|
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];
|
|
|
|
}
|
|
|
|
|
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));
|
2005-04-03 23:48:03 +08:00
|
|
|
g_return_if_fail (sample_point != NULL);
|
|
|
|
|
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));
|
2005-04-03 23:48:03 +08:00
|
|
|
g_return_if_fail (sample_point != NULL);
|
|
|
|
|
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));
|
|
|
|
g_return_if_fail (sample_point != NULL);
|
|
|
|
|
|
|
|
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);
|
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);
|
|
|
|
}
|
|
|
|
|
2009-07-04 03:11:21 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_is_dirty:
|
|
|
|
* @image:
|
|
|
|
*
|
|
|
|
* Returns: True if the image is dirty, false otherwise.
|
|
|
|
**/
|
|
|
|
gint
|
|
|
|
gimp_image_is_dirty (const GimpImage *image)
|
|
|
|
{
|
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
|
|
|
|
gimp_image_is_export_dirty (const GimpImage *image)
|
|
|
|
{
|
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
|
|
|
}
|
|
|
|
|
2010-02-04 03:31:25 +08:00
|
|
|
gint
|
|
|
|
gimp_image_get_dirty_time (const GimpImage *image)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), 0);
|
|
|
|
|
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->dirty_time;
|
|
|
|
}
|
|
|
|
|
2006-12-12 04:57:44 +08:00
|
|
|
/**
|
|
|
|
* gimp_image_saved:
|
|
|
|
* @image:
|
|
|
|
* @uri:
|
|
|
|
*
|
|
|
|
* Emits the "saved" signal, indicating that @image was saved to the
|
|
|
|
* location specified by @uri.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gimp_image_saved (GimpImage *image,
|
|
|
|
const gchar *uri)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
|
|
|
g_return_if_fail (uri != NULL);
|
|
|
|
|
|
|
|
g_signal_emit (image, gimp_image_signals[SAVED], 0, uri);
|
|
|
|
}
|
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:
|
|
|
|
* @uri:
|
|
|
|
*
|
|
|
|
* Emits the "exported" signal, indicating that @image was exported to the
|
|
|
|
* location specified by @uri.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gimp_image_exported (GimpImage *image,
|
|
|
|
const gchar *uri)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
|
|
|
g_return_if_fail (uri != NULL);
|
|
|
|
|
|
|
|
g_signal_emit (image, gimp_image_signals[EXPORTED], 0, uri);
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
gimp_image_get_display_count (const GimpImage *image)
|
|
|
|
{
|
|
|
|
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
|
|
|
|
gimp_image_get_instance_count (const GimpImage *image)
|
|
|
|
{
|
|
|
|
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 *
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_parasite_find (const GimpImage *image,
|
2004-07-14 20:12:50 +08:00
|
|
|
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 **
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_parasite_list (const GimpImage *image,
|
2004-07-14 20:12:50 +08:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
1998-10-08 16:15:21 +08:00
|
|
|
void
|
2006-04-02 23:37:25 +08:00
|
|
|
gimp_image_parasite_attach (GimpImage *image,
|
|
|
|
const GimpParasite *parasite)
|
1998-10-08 16:15:21 +08:00
|
|
|
{
|
2007-05-29 17:23:34 +08:00
|
|
|
GimpParasite copy;
|
2006-04-02 23:37:25 +08:00
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_IMAGE (image));
|
|
|
|
g_return_if_fail (parasite != NULL);
|
|
|
|
|
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
|
|
|
|
*/
|
2007-05-29 17:23:34 +08:00
|
|
|
if (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
|
|
|
|
|
|
|
/* We used to push an cantundo on te 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
|
|
|
*/
|
2010-02-04 06:42:32 +08:00
|
|
|
gimp_parasite_list_add (GIMP_IMAGE_GET_PRIVATE (image)->parasites, ©);
|
1999-08-22 19:45:31 +08:00
|
|
|
|
2007-05-29 17:23:34 +08:00
|
|
|
if (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
|
|
|
|
2006-10-25 15:31:04 +08:00
|
|
|
g_signal_emit (image, gimp_image_signals[PARASITE_ATTACHED], 0,
|
|
|
|
parasite->name);
|
2007-06-14 15:06:58 +08:00
|
|
|
|
|
|
|
if (strcmp (parasite->name, "icc-profile") == 0)
|
|
|
|
gimp_color_managed_profile_changed (GIMP_COLOR_MANAGED (image));
|
1998-10-08 16:15:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_parasite_detach (GimpImage *image,
|
2006-04-02 23:37:25 +08:00
|
|
|
const gchar *name)
|
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
|
|
|
|
2006-04-02 23:37:25 +08:00
|
|
|
if (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
|
|
|
|
|
|
|
g_signal_emit (image, gimp_image_signals[PARASITE_DETACHED], 0,
|
|
|
|
name);
|
2007-06-14 15:06:58 +08:00
|
|
|
|
|
|
|
if (strcmp (name, "icc-profile") == 0)
|
|
|
|
gimp_color_managed_profile_changed (GIMP_COLOR_MANAGED (image));
|
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 *
|
|
|
|
gimp_image_get_projection (const GimpImage *image)
|
|
|
|
{
|
|
|
|
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 *
|
|
|
|
gimp_image_get_layer_tree (const GimpImage *image)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->layers;
|
|
|
|
}
|
|
|
|
|
|
|
|
GimpItemTree *
|
|
|
|
gimp_image_get_channel_tree (const GimpImage *image)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
|
|
|
|
|
|
|
return GIMP_IMAGE_GET_PRIVATE (image)->channels;
|
|
|
|
}
|
|
|
|
|
|
|
|
GimpItemTree *
|
|
|
|
gimp_image_get_vectors_tree (const GimpImage *image)
|
|
|
|
{
|
|
|
|
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 *
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_get_layers (const 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 *
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_get_channels (const 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 *
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_get_vectors (const 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
|
|
|
|
gimp_image_get_n_layers (const GimpImage *image)
|
|
|
|
{
|
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
|
|
|
|
gimp_image_get_n_channels (const GimpImage *image)
|
|
|
|
{
|
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
|
|
|
|
gimp_image_get_n_vectors (const GimpImage *image)
|
|
|
|
{
|
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 *
|
|
|
|
gimp_image_get_layer_iter (const GimpImage *image)
|
|
|
|
{
|
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 *
|
|
|
|
gimp_image_get_channel_iter (const GimpImage *image)
|
|
|
|
{
|
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 *
|
|
|
|
gimp_image_get_vectors_iter (const GimpImage *image)
|
|
|
|
{
|
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 *
|
|
|
|
gimp_image_get_layer_list (const GimpImage *image)
|
|
|
|
{
|
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 *
|
|
|
|
gimp_image_get_channel_list (const GimpImage *image)
|
|
|
|
{
|
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 *
|
|
|
|
gimp_image_get_vectors_list (const GimpImage *image)
|
|
|
|
{
|
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 *
|
2007-07-19 22:59:51 +08:00
|
|
|
gimp_image_get_active_drawable (const 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 *
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_get_active_layer (const 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 *
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_get_active_channel (const 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 *
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_get_active_vectors (const 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 *
|
|
|
|
gimp_image_get_layer_by_tattoo (const GimpImage *image,
|
|
|
|
GimpTattoo tattoo)
|
|
|
|
{
|
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 *
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_get_channel_by_tattoo (const GimpImage *image,
|
2004-07-14 20:12:50 +08:00
|
|
|
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 *
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_get_vectors_by_tattoo (const GimpImage *image,
|
2004-07-14 20:12:50 +08:00
|
|
|
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 *
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_get_layer_by_name (const GimpImage *image,
|
2002-02-24 01:29:19 +08:00
|
|
|
const gchar *name)
|
|
|
|
{
|
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 *
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_get_channel_by_name (const GimpImage *image,
|
2004-07-14 20:12:50 +08:00
|
|
|
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 *
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_get_vectors_by_name (const GimpImage *image,
|
2004-07-14 20:12:50 +08:00
|
|
|
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;
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
if (push_undo && ! undo_desc)
|
|
|
|
undo_desc = GIMP_ITEM_GET_CLASS (item)->reorder_desc;
|
|
|
|
|
|
|
|
/* item and new_parent are type-checked in GimpItemTree
|
|
|
|
*/
|
|
|
|
return gimp_item_tree_reorder_item (tree, item,
|
|
|
|
new_parent, new_index,
|
|
|
|
push_undo, undo_desc);
|
|
|
|
}
|
|
|
|
|
|
|
|
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,
|
|
|
|
GIMP_ITEM_GET_CLASS (item)->raise_failed);
|
|
|
|
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,
|
|
|
|
GIMP_ITEM_GET_CLASS (item)->lower_failed);
|
|
|
|
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
|
|
|
|
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;
|
|
|
|
gboolean undo_group = FALSE;
|
|
|
|
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);
|
|
|
|
|
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 "
|
|
|
|
"http://www.gimp.org/bugs/", G_STRFUNC);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_ITEM_REMOVE,
|
2010-06-08 19:24:11 +08:00
|
|
|
C_("undo-type", "Remove Layer"));
|
2005-04-05 07:12:50 +08:00
|
|
|
undo_group = TRUE;
|
|
|
|
|
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
|
|
|
if (! new_active && private->layer_stack)
|
|
|
|
new_active = private->layer_stack->data;
|
|
|
|
|
|
|
|
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
|
|
|
|
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
|
|
|
|
|
|
|
if (undo_group)
|
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;
|
|
|
|
gboolean undo_group = FALSE;
|
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
|
|
|
|
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 "
|
|
|
|
"http://www.gimp.org/bugs/", G_STRFUNC);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2006-03-29 01:08:36 +08:00
|
|
|
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_ITEM_REMOVE,
|
2010-06-08 19:24:11 +08:00
|
|
|
C_("undo-type", "Remove Channel"));
|
2005-04-05 07:12:50 +08:00
|
|
|
undo_group = TRUE;
|
|
|
|
|
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
|
|
|
|
2011-02-07 18:35:58 +08:00
|
|
|
g_object_unref (channel);
|
|
|
|
|
2005-04-05 07:12:50 +08:00
|
|
|
if (undo_group)
|
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
|
|
|
|
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
|
|
|
|
|
|
|
g_object_unref (vectors);
|
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
|
|
|
}
|