Commit Graph

83 Commits

Author SHA1 Message Date
Sven Neumann 41237259c9 In all files, changed the standard copyright notice to say "GIMP - The GNU
2006-12-09  Sven Neumann  <sven@gimp.org>

        * In all files, changed the standard copyright notice to say
        "GIMP - The GNU Image Manipulation Program".
2006-12-09 21:33:38 +00:00
Simon Budig d3543f1b06 load the channels in the proper order. fixes bug #378003. Thanks to Chris
2006-11-22  Simon Budig  <simon@gimp.org>

	* app/xcf/xcf-load.c: load the channels in the proper order.
	fixes bug #378003. Thanks to Chris Mohler for spotting this.
2006-11-22 10:19:53 +00:00
Michael Natterer b72ffb8b49 removed the "floating" flag and the floating/sink API.
2006-10-16  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpitem.[ch]: removed the "floating" flag and the
	floating/sink API.

	(gimp_item_init): call g_object_force_floating() instead.

	* app/core/gimpimage.c
	* app/core/gimplayer.c
	* app/xcf/xcf-load.c
	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/image.pdb: use combinations of
	g_object_ref_sink() and g_object_unref() instead of
	gimp_item_sink(). Use g_object_is_floating() instead of
	gimp_item_is_floating().

	* app/pdb/drawable_cmds.c
	* app/pdb/image_cmds.c: regenerated.
2006-10-16 17:09:17 +00:00
Raphael Quinet e6615a2bf7 workaround for bug #357809: avoid crashing when invalid offsets are read
2006-10-11  Raphael Quinet  <raphael@gimp.org>

	* app/xcf/xcf-load.c (xcf_load_tile_rle): workaround for bug
	#357809: avoid crashing when invalid offsets are read for a
	compressed tile in the XCF file.
2006-10-11 09:19:12 +00:00
Michael Natterer f5afb754a5 Added message severities and make sure all messages are routed through a
2006-10-09  Michael Natterer  <mitch@gimp.org>

	Added message severities and make sure all messages are routed
	through a central function, so redirecting to the error console or
	stderr work again:

	* app/core/core-enums.[ch]: added enum GimpMessageSeverity { INFO,
	WARNING, ERROR }.

	* app/core/gimp.[ch] (gimp_message)
	(gimp_message_valist): added severity parameter. Changed
	"GimpProgress *progress" parameter to "GObject *handler", where
	"handler" can be either a GimpProgress, a GtkWidget or NULL.

	* app/core/gimp-gui.[ch] (gimp_show_message): ditto. Honor
	--console-messages again. Always dispatch to the GUI message
	handler first if it exists.

	* app/gui/gui-message.[ch]: pass severity parameters around.

	(gui_message_error_dialog): if "handler" is a progress, dispatch
	the message to it first. If it is a widget (and *not* a progress),
	use a GtkMessageDialog on top of that widget's toplevel. Fall
	back to the usual GimpErrorDialog otherwise.

	* app/core/gimpprogress.[ch] (gimp_progress_message): added
	severity parameter. Also added boolean return value to the virtual
	function so it can decide to fail if it can't handle the message.

	* app/display/gimpdisplay.c: implement GimpProgress::message() and
	redirect the message to GimpDisplayShell.

	* app/display/gimpdisplayshell-progress.c: implement
	GimpProgress::message() and redirect the message to GimpStatusbar
	if it is not an error and if the status bar is visible.

	* app/display/gimpstatusbar.[ch]: implement GimpProgress::message(),
	but fail on messages that contain a newline. Show the right icons
	for the message severities (work in progress).

	* app/display/gimpdisplayshell.[ch]: removed
	gimp_display_shell_message() and its _valist() variant.

	* app/widgets/gimperrorconsole.[ch]: show the right icons for the
	message severities.

	* app/widgets/gimpthumbbox.c (gimp_thumb_box_progress_message):
	return TRUE to swallow all messages.

	* app/widgets/gimpwidgets-utils.[ch]: removed
	gimp_show_message_dialog(). Added gimp_get_message_stock_id().

	* app/errors.c
	* app/actions/edit-commands.c
	* app/actions/error-console-commands.c
	* app/actions/file-commands.c
	* app/actions/select-commands.c
	* app/actions/text-editor-commands.c
	* app/actions/vectors-commands.c
	* app/core/gimpimage-convert.c
	* app/core/gimpimagefile.c
	* app/dialogs/convert-dialog.c
	* app/dialogs/file-open-dialog.c
	* app/dialogs/file-open-location-dialog.c
	* app/dialogs/file-save-dialog.c
	* app/dialogs/palette-import-dialog.c
	* app/dialogs/stroke-dialog.c
	* app/display/gimpdisplayshell-dnd.c
	* app/pdb/gimppdb.c
	* app/plug-in/gimpplugin.c
	* app/tools/gimpimagemaptool.c
	* app/tools/gimptool.c
	* app/tools/gimpvectortool.c
	* app/widgets/gimpactionview.c
	* app/widgets/gimpcontrollerlist.c
	* app/widgets/gimppdbdialog.c
	* app/widgets/gimpvectorstreeview.c
	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c
	* app/xcf/xcf.c
	* tools/pdbgen/pdb/brush.pdb
	* tools/pdbgen/pdb/gradient.pdb
	* tools/pdbgen/pdb/image.pdb
	* tools/pdbgen/pdb/message.pdb
	* tools/pdbgen/pdb/palette.pdb: added severity parameter to
	gimp_message() calls. Convert all calls to
	gimp_show_message_dialog() and gimp_display_shell_message() to
	gimp_message(). Also converted some more g_message() calls.

	* app/pdb/brush_cmds.c
	* app/pdb/gradient_cmds.c
	* app/pdb/image_cmds.c
	* app/pdb/message_cmds.c
	* app/pdb/palette_cmds.c: regenerated.
2006-10-09 08:17:22 +00:00
William Skaggs 8e67a0649f Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/xcf/xcf-private.h
	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c: save sample points in xcf files,
	and load them.  Fixes bug #342480.
2006-08-10 17:10:12 +00:00
Sven Neumann 48d054e8d4 added new function gimp_message() as a replacement for g_message(). Part
2006-08-08  Sven Neumann  <sven@gimp.org>

	* app/core/gimp.[ch]: added new function gimp_message() as a
	replacement for g_message(). Part of the fix for bug #347214.

	* app/actions/data-commands.c
	* app/actions/documents-commands.c
	* app/actions/file-commands.c
	* app/actions/layers-commands.c
	* app/core/gimpimage-convert.c
	* app/core/gimpimagefile.c
	* app/core/gimpitem.c
	* app/core/gimplayer.c
	* app/dialogs/file-open-dialog.c
	* app/dialogs/file-open-location-dialog.c
	* app/dialogs/file-save-dialog.c
	* app/display/gimpdisplayshell-dnd.c
	* app/pdb/gimppdb.c
	* app/tools/gimpblendtool.c
	* app/tools/gimpbrightnesscontrasttool.c
	* app/tools/gimpcolorbalancetool.c
	* app/tools/gimpcolorizetool.c
	* app/tools/gimpcurvestool.c
	* app/tools/gimphuesaturationtool.c
	* app/tools/gimplevelstool.c
	* app/tools/gimpposterizetool.c
	* app/tools/gimpthresholdtool.c
	* app/widgets/gimpwidgets-utils.c
	* app/xcf/xcf-load.c
	* app/xcf/xcf-private.h
	* app/xcf/xcf-save.c
	* app/xcf/xcf.c
	* tools/pdbgen/pdb/brush.pdb
	* tools/pdbgen/pdb/gradient.pdb
	* tools/pdbgen/pdb/image.pdb
	* tools/pdbgen/pdb/palette.pdb: use gimp_message() instead of
	gimp_message() whenever we have a GimpProgress.

	* app/pdb/brush_cmds.c
	* app/pdb/gradient_cmds.c
	* app/pdb/image_cmds.c
	* app/pdb/palette_cmds.c: regenerated.
2006-08-08 21:06:36 +00:00
Sven Neumann 676c625c24 app/xcf/xcf-load.c app/xcf/xcf-private.h app/xcf/xcf-save.c do progress
2006-07-11  Sven Neumann  <sven@gimp.org>

	* app/xcf/xcf-load.c
	* app/xcf/xcf-private.h
	* app/xcf/xcf-save.c
	* app/xcf/xcf.c: do progress updates when loading/saving XCF
files.
2006-07-11 20:21:18 +00:00
Sven Neumann ce1352cf7f use a signed variable when attempting to skip over unknown properties and
2006-07-10  Sven Neumann  <sven@gimp.org>

	* app/xcf/xcf-load.c: use a signed variable when attempting to
	skip over unknown properties and check for EOF.  Fixes bug #345802.

	* app/xcf/xcf-read.c: cleanup, nothing really changed
2006-07-10 16:40:26 +00:00
Sven Neumann 51753404f0 applied a patch from Henning Makholm that introduces a sanity check on the
2006-07-06  Sven Neumann  <sven@gimp.org>

	* app/xcf/xcf-load.c (xcf_load_vector): applied a patch from
	Henning Makholm that introduces a sanity check on the number of
	axes (bug #346742).
2006-07-06 12:42:34 +00:00
Sven Neumann 049872b361 app/*.[ch] converted tabs to spaces.
2006-04-12  Sven Neumann  <sven@gimp.org>

	* app/*.[ch]
	* app/*/*.[ch]: converted tabs to spaces.
2006-04-12 12:49:29 +00:00
Michael Natterer 5fb387ea1b removed the return value again.
2006-04-02  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpparasitelist.[ch] (gimp_parasite_list_add): removed
	the return value again.

	(gimp_parasite_list_find): return a const parasite.

	* app/core/gimp-parasites.[ch]
	* app/core/gimpimage.[ch]
	* app/core/gimpitem.[ch] (*_parasite_attach): take a const
	parasite. Make a local copy of the parasite struct because
	gimp_parasite_shift_parent() changes it.

	(*_parasite_find): return a const parasite.

	* app/core/gimptemplate.c
	* app/text/gimptextlayer-xcf.c
	* app/xcf/xcf-load.c: changed accordingly.
2006-04-02 15:37:25 +00:00
Sven Neumann 905fdfcbed did a global gimage -> image substitution.
2006-03-28  Sven Neumann  <sven@gimp.org>

	* app/*: did a global gimage -> image substitution.
2006-03-28 17:08:36 +00:00
Sven Neumann f2ecfca131 disable undo while the image is being loaded.
2005-08-05  Sven Neumann  <sven@gimp.org>

	* app/xcf/xcf-load.c (xcf_load_image): disable undo while the
	image is being loaded.

	* app/core/gimpitem.c (gimp_item_parasite_attach): don't try to
	push an undo step if undo is disabled. Gets rid of warnings while
	loading an XCF file with undoable drawable parasites.
2005-08-05 14:13:10 +00:00
Sven Neumann b9e77caa44 app/vectors/gimpvectors-compat.[ch] app/xcf/xcf-load.c fixed signedness
2005-08-03  Sven Neumann  <sven@gimp.org>

	* app/vectors/gimpvectors-compat.[ch]
	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c: fixed signedness warnings.
2005-08-03 13:48:40 +00:00
Michael Natterer 20b4769cf5 app/actions/layers-actions.c app/actions/layers-commands.[ch]
2005-07-10  Michael Natterer  <mitch@gimp.org>

	* app/actions/layers-actions.c
	* app/actions/layers-commands.[ch]
	* app/core/core-enums.[ch]
	* app/core/gimpimage-undo-push.[ch]
	* app/core/gimplayer-floating-sel.c
	* app/core/gimplayer.[ch]
	* app/text/gimptextlayer-xcf.c
	* app/widgets/gimphelp-ids.h
	* app/widgets/gimplayertreeview.[ch]
	* app/xcf/xcf-load.c
	* app/xcf/xcf-private.h
	* app/xcf/xcf-save.c
	* tools/pdbgen/pdb/layer.pdb
	* menus/image-menu.xml.in
	* libgimp/gimp.def: did a global s/preserve_trans/lock_alpha/ in
	preparation for more layer locking flags.

	* app/pdb/procedural_db.c
	* libgimp/gimplayer.[ch]: added compat stuff for preserve_trans.

	* app/pdb/layer_cmds.c
	* libgimp/gimplayer_pdb.[ch]: regenerated.

	* plug-ins/common/colortoalpha.c
	* plug-ins/common/iwarp.c
	* plug-ins/common/psd.c
	* plug-ins/common/psd_save.c
	* plug-ins/common/psp.c
	* plug-ins/common/rotate.c
	* plug-ins/common/threshold_alpha.c
	* plug-ins/common/vpropagate.c
	* plug-ins/script-fu/scripts/3d-outline.scm
	* plug-ins/script-fu/scripts/alien-glow-bar.scm
	* plug-ins/script-fu/scripts/alien-glow-bullet.scm
	* plug-ins/script-fu/scripts/alien-glow-logo.scm
	* plug-ins/script-fu/scripts/basic1-logo.scm
	* plug-ins/script-fu/scripts/basic2-logo.scm
	* plug-ins/script-fu/scripts/beveled-pattern-button.scm
	* plug-ins/script-fu/scripts/blend-anim.scm
	* plug-ins/script-fu/scripts/blended-logo.scm
	* plug-ins/script-fu/scripts/bovinated-logo.scm
	* plug-ins/script-fu/scripts/burn-in-anim.scm
	* plug-ins/script-fu/scripts/carved-logo.scm
	* plug-ins/script-fu/scripts/chalk.scm
	* plug-ins/script-fu/scripts/chip-away.scm
	* plug-ins/script-fu/scripts/comic-logo.scm
	* plug-ins/script-fu/scripts/coolmetal-logo.scm
	* plug-ins/script-fu/scripts/crystal-logo.scm
	* plug-ins/script-fu/scripts/drop-shadow.scm
	* plug-ins/script-fu/scripts/gimp-headers.scm
	* plug-ins/script-fu/scripts/gimp-labels.scm
	* plug-ins/script-fu/scripts/glowing-logo.scm
	* plug-ins/script-fu/scripts/gradient-bevel-logo.scm
	* plug-ins/script-fu/scripts/image-structure.scm
	* plug-ins/script-fu/scripts/neon-logo.scm
	* plug-ins/script-fu/scripts/perspective-shadow.scm
	* plug-ins/script-fu/scripts/starburst-logo.scm
	* plug-ins/script-fu/scripts/starscape-logo.scm
	* plug-ins/script-fu/scripts/textured-logo.scm
	* plug-ins/script-fu/scripts/title-header.scm
	* plug-ins/script-fu/scripts/waves-anim.scm
	* plug-ins/xjt/xjt.c: changed accordingly.
2005-07-10 21:17:22 +00:00
Michael Natterer 652bdb7f4a initialize text_layer_flags with 0 so it doesn't contain random garbage if
2005-04-20  Michael Natterer  <mitch@gimp.org>

	* app/xcf/xcf-load.c (xcf_load_layer): initialize text_layer_flags
	with 0 so it doesn't contain random garbage if the text layer
	flags in the XCF have default values (are not saved at all). Fixes
	bug #301028. Initialize other stuff too for the sake of sanity.
2005-04-19 23:19:51 +00:00
Michael Natterer c568322c43 app/display/gimpscalecombobox.c (gimp_scale_combo_box_mru_remove_last)
2004-11-03  Michael Natterer  <mitch@gimp.org>

	* app/display/gimpscalecombobox.c
	(gimp_scale_combo_box_mru_remove_last)
	* app/widgets/gimpeditor.c (gimp_editor_add_action_button)
	* app/xcf/xcf-load.c (xcf_load_old_path): plugged some small leaks.
2004-11-03 11:50:37 +00:00
Øyvind Kolås 9c444166f2 discard loaded colormap for non indexed images 2004-11-01 18:33:09 +00:00
Sven Neumann ab6c609ce1 renamed struct member "unit" to "resolution_unit".
2004-10-12  Sven Neumann  <sven@gimp.org>

	* app/core/gimpimage.[ch]: renamed struct member "unit" to
	"resolution_unit".

	* app/actions/image-commands.c
	* app/core/gimp-edit.c
	* app/core/gimpimage-duplicate.c
	* app/core/gimpimage-undo-push.c
	* app/dialogs/info-window.c
	* app/vectors/gimpvectors-export.c
	* app/widgets/gimptoolbox-dnd.c:
	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c: changed accordingly. Use gimp_image_get_unit()
	where appropriate.

	* app/core/gimptemplate.c (gimp_template_set_from_image): fixed
	unit handling. Don't touch the template unit, it is used as the
	initial display unit. This will need further changes...
2004-10-12 21:28:53 +00:00
Sven Neumann 17679a610b added a missing call to gimp_image_flush().
2004-03-18  Sven Neumann  <sven@gimp.org>

	* app/display/gimpdisplayshell-dnd.c (gimp_display_shell_bucket_fill):
	added a missing call to gimp_image_flush().

	* app/tools/gimptexttool.c: propagate text changes to the tool
	options.

	* app/text/gimptextlayer.c: made "text", "auto-rename" and
	"modified" properties of the text layer and copy them when
	duplicating a text layer.

	* app/text/gimptextlayer-xcf.[ch]: added utility functions to
	convert the new properties to flags to be saved in the XCF file.

	* app/xcf/xcf-load.c
	* app/xcf/xcf-private.h
	* app/xcf/xcf-save.c: load and save text layer properties.
	Disabled warnings about unknown properties for stable branches.
2004-03-18 15:27:23 +00:00
Simon Budig 0119e6e8f8 make the path-loading debug output conditional.
2004-03-03  Simon Budig  <simon@gimp.org>

	* app/xcf/xcf-load.c: make the path-loading debug output conditional.
2004-03-03 15:54:19 +00:00
Michael Natterer 25b81b1570 Fixed lots of QuickMask brokenness by letting the image adjust its
2004-02-14  Michael Natterer  <mitch@gimp.org>

	Fixed lots of QuickMask brokenness by letting the image adjust
	its qmask_state automatically:

	* app/core/gimpimage-qmask.h: #define GIMP_IMAGE_QMASK_NAME "Qmask".
	Use the define in all files below.

	* app/core/gimpimage.[ch]: split gimp_image_drawable_add,_remove()
	into separate handlers for layers and channels. Added a
	"name_changed" handler for all channels. In the channel "add",
	"remove" and "name_changed" handlers, check if it was a channel
	named "Qmask" that was added, removed or renamed and call
	gimp_image_set_qmask_state() accordingly.

	* app/core/core-enums.[ch]
	* app/core/gimpimage-undo-push.[ch]
	* app/core/gimpundo.c: removed all Qmask undo code because the image
	does the right thing without undo interaction now.

	* app/core/gimpimage-qmask.c (gimp_image_set_qmask_state): set
	gimage->qmask_state early so we can return early when called
	recursively. Removed calls to gimp_image_undo_push_image_qmask().
	Returned "removed" callback (it was utterly broken the way it was
	implemented).

	* app/display/gimpdisplayshell-callbacks.c
	(gimp_display_shell_qmask_toggled): check if the image's
	qmask state needs to be changed before changing it.

	* app/xcf/xcf-load.c (xcf_load_channel): removed code which
	recognized the qmask. GimpImage does this automatically now.

	* app/gui/qmask-commands.c: cleanup.

	* app/widgets/gimpimagedock.c (gimp_image_dock_constructor):
	destroy the "/Select/By Color" and "/Select/Toggle QuickMask" menu
	items.

	* app/widgets/image-menu.c (image_menu_update): changed accordingly.
2004-02-14 15:37:23 +00:00
Michael Natterer dc2e81ca52 no need to set the layer mask's offsets, gimp_layer_add_mask() does this
2004-02-01  Michael Natterer  <mitch@gimp.org>

	* app/xcf/xcf-load.c (xcf_load_layer): no need to set the layer
	mask's offsets, gimp_layer_add_mask() does this for us. Simplified
	mask property assignments.
2004-02-01 19:01:28 +00:00
Michael Natterer dc3ac41965 add the layer to the image before pasting to it. Fixes bug #132504.
2004-01-26  Michael Natterer  <mitch@gimp.org>

	* plug-ins/script-fu/scripts/unsharp-mask.scm: add the layer to
	the image before pasting to it. Fixes bug #132504.

	Fixed the underlying problem: make it impossible to attach
	floating selections to drawables which are not currently part of
	the image's layer or channel stacks.
	Also cleaned up image <-> floating_sel interaction:

	* app/core/gimplayer-floating-sel.[ch] (floating_sel_attach):
	added assertion that the drawable is part of the image (see below).
	Don't call gimp_image_floating_selection_changed(), it's emitted
	by gimp_image_add_layer() now.

	(floating_sel_remove)
	(floating_sel_anchor): don't emit "floating_selection_changed",
	it's emitted by gimp_image_remove_layer() now.

	(floating_sel_anchor): removed the fix for bug #132162 because
	gimp_image_remove_layer() behaves correctly now (see below).

	Renamed floating_sel_reset() to floating_sel_activate_drawable().
	Added g_return_if_fail() all over the place.

	* app/core/gimpimage.[ch]: added new function gimp_image_owns_item()
	which return TRUE if the passed item is part of the image.

	(gimp_image_add_layer): emit "floating_selection_changed" here if
	needed.

	(gimp_image_remove_layer): emit "floating_selection_changed" if
	needed, don't try to activate a layer if we called
	floating_sel_activate_drawable().
	This is the real fix for bug #132162.

	* app/core/gimpimage-undo-push.c (undo_pop_layer): apply the same
	fixes as to gimp_image_add,remove_layer(). Don't call
	gimp_drawable_invalidate_preview() on the previously active layer
	because that's done by gimp_image_set_active_layer() now.

	* app/xcf/xcf-load.c: remember the "floating_sel_drawable" in the
	XcfInfo struct and attach it *after* all layers and channels are
	loaded to avoid attaching the floating selection to an
	out-of-image drawable.

	* app/core/gimp-edit.c (gimp_edit_paste)
	* app/core/gimpdrawable-transform.c (gimp_drawable_transform_affine,
	gimp_drawable_transform_flip, gimp_drawable_transform_rotate)
	* app/core/gimpselection.c (gimp_selection_float)
	* app/text/gimptext-compat.c (text_render): added checks for
	gimp_image_owns_item() in all functions which can produce
	floating selections.

	* tools/pdbgen/pdb/edit.pdb
	* tools/pdbgen/pdb/floating_sel.pdb
	* tools/pdbgen/pdb/selection.pdb
	* tools/pdbgen/pdb/text_tool.pdb
	* tools/pdbgen/pdb/transform_tools.pdb: added checks for
	gimp_item_owns_image() and return an execution error if invoked
	with a drawable which is not part of the image.

	* app/pdb/edit_cmds.c
	* app/pdb/floating_sel_cmds.c
	* app/pdb/selection_cmds.c
	* app/pdb/text_tool_cmds.c
	* app/pdb/transform_tools_cmds.c: regenerated.
2004-01-26 15:34:47 +00:00
Manish Singh d3c82f39e8 use memcpy instead of casted assignment for storing HSV values in
2004-01-26  Manish Singh  <yosh@gimp.org>

        * app/core/gimpdrawable-blend.c (gradient_fill_region): use memcpy
        instead of casted assignment for storing HSV values in rbd.fg/bg,
        for C99 aliasing compliance.

        * app/xcf/xcf-load.c (xcf_load_layer_mask): use a GimpChannel *
        explictly for xcf_load_channel_props, for the above reason.

        * app/xcf/xcf-save.c (xcf_save_prop): use a temporary guint32 for
        saving property types, for the above reason.

        * app/core/gimpparasitelist.c (gimp_parasite_list_deserialize): plug
        a memory leak, since data is copied on parasite creation.
2004-01-26 09:22:06 +00:00
Michael Natterer d9b7d7ee06 app/vectors/gimpstroke.c use the GIMP_TYPE_FOO macros instead of
2004-01-18  Michael Natterer  <mitch@gimp.org>

	* app/vectors/gimpstroke.c
	* app/xcf/xcf-load.c: use the GIMP_TYPE_FOO macros instead of
	gimp_foo_get_type(). Minor cleanups.
2004-01-18 17:41:29 +00:00
Michael Natterer 1cc434fa6e Fixed memory management of layers and channels which were created using
2003-12-09  Michael Natterer  <mitch@gimp.org>

	Fixed memory management of layers and channels which were created
	using the PDB:

	* app/core/gimpitem.[ch]: added "gboolean floating" flag to
	GimpItem. Items are created with floating == TRUE. Added
	gimp_item_sink() which resets the floating flag and unrefs the
	item if it was TRUE.  Added gimp_item_is_floating() accessor.

	* app/core/gimpimage.c (gimp_image_add_layer,channel,vectors):
	g_object_ref()/gimp_item_sink() added items to take ownership of
	them.

	* app/core/gimplayer.c (gimp_layer_add_mask):
	g_object_ref()/gimp_item_sink() the mask.

	* app/gui/layers-commands.c
	* app/xcf/xcf-load.c: don't unref layer masks after adding them to
	the layer.

	* tools/pdbgen/pdb/drawable.pdb (drawable_delete):
	gimp_item_sink() the drawable if it's floating and fail if it's
	not. Fixes bug #128881.

	* tools/pdbgen/pdb/layer.pdb (layer_create_mask): fixed docs.

	* app/pdb/drawable_cmds.c
	* app/pdb/layer_cmds.c
	* libgimp/gimplayer_pdb.c: regenerated.
2003-12-09 18:59:35 +00:00
Michael Natterer 26a68a58d9 added "GimpTattoo tattoo_state" to the XcfInfo struct.
2003-12-06  Michael Natterer  <mitch@gimp.org>

	* app/xcf/xcf-private.h: added "GimpTattoo tattoo_state" to the
	XcfInfo struct.

	* app/xcf/xcf.c (xcf_load_invoker): initialize it to 0.

	* app/xcf/xcf-load.c (xcf_load_image_props): remember PROP_TATTOO
	in info->tattoo_state instead of setting it directly in the
	GimpImage struct.

	(xcf_load_image): set the remembered tattoo_state after all items
	are created.

	(Fixes the regression that "open -> don't modify -> save" didn't
	result in 100% identical XCF files).
2003-12-06 15:53:26 +00:00
Sven Neumann c0ebe2a8a3 app/text/Makefile.am new files that load and save text layers to/from XCF.
2003-10-27  Sven Neumann  <sven@gimp.org>

	* app/text/Makefile.am
	* app/text/gimptextlayer-xcf.[ch]: new files that load and save
	text layers to/from XCF.

	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c
	* app/text/gimptextlayer.c: removed that code here and use the new
	functions instead.

	* app/text/gimptext-parasite.[ch] (gimp_text_from_parasite): added
	a GError parameter.

	* app/text/gimptextlayer.[ch]: store the name of the parasite that
	the text layer was created from (if read from XCF). Remove the
	parasite when the text layer is edited. If a text layer wasn't
	touched, the original parasite is written back to the XCF file.

	* app/text/gimptextlayout.c (gimp_text_layout_new): handle a NULL
	text string.

	* app/tools/gimptextoptions.c: implement GimpToolOptions::reset
	and save the text across a reset.
2003-10-27 21:50:41 +00:00
Sven Neumann 737da42437 removed gimp_config_copy_properties() and added the more intelligent
2003-10-14  Sven Neumann  <sven@gimp.org>

	* app/config/gimpconfig-utils.[ch]: removed
	gimp_config_copy_properties() and added the more intelligent
	gimp_config_sync() instead.

	* app/config/Makefile.am
	* app/config/config-types.h
	* app/config/gimpcoreconfig.[ch]
	* app/config/gimprc-blurbs.h: replaced default image properties
	with a single GimpTemplate object property. Changed the
	set_property function to not replace aggregate objects but call
	gimp_config_sync() instead.

	* app/tools/gimptextoptions.c (gimp_text_options_set_property):
	same change here.

	* app/config/gimpconfig.[ch]: changed return value of
	gimp_config_duplicate() to gpointer to avoid some casts that only
	made the code harder to read.

	* app/widgets/gimptemplateeditor.[ch]: don't keep an internal copy
	here but edit the GimpTemplate passed when the editor was
	constructed.

	* app/gui/preferences-dialog.c: use a GimpTemplateEditor to allow
	editing of the default image paramaters.

	* app/config/gimprc.c
	* app/core/core-types.h
	* app/core/gimp.c
	* app/core/gimpimage-duplicate.c
	* app/core/gimpimage-grid.c
	* app/core/gimpimage-new.c
	* app/core/gimpimage-undo-push.c
	* app/core/gimpimage.c
	* app/core/gimptemplate.[ch]
	* app/gui/file-new-dialog.c
	* app/gui/grid-dialog.c
	* app/gui/info-window.c
	* app/gui/resize-dialog.c
	* app/gui/templates-commands.[ch]
	* app/gui/tool-options-commands.c
	* app/text/gimptextlayer.c
	* app/text/gimptextlayer.c
	* app/tools/gimptexttool.c
	* app/widgets/gimptemplateview.c
	* app/xcf/xcf-load.c: changed accordingly.
2003-10-14 15:20:59 +00:00
Henrik Brix Andersen 4ac8c82501 removed the grid parasite related functions from here ...
2003-10-10 Henrik Brix Andersen <brix@gimp.org>

* app/core/gimpimage-grid.[ch]: removed the grid parasite related
functions from here ...

* app/core/gimpgrid.[ch]: ... and added them here. While I was at
it I also changed PROP_TYPE to PROP_STYLE and added blurbs to the
properties

* app/xcf/xcf-load.c
* app/display/gimpdisplayshell.c: changed accordingly

* app/widgets/Makefile.am
* po/POTFILES.in
* app/widgets/widgets-types.h
* app/widgets/gimpgrideditor.[ch]: added a new GimpGridEditor
widget - with a work-around for the fact that
gimp_prop_coordinated_new() doesn't accept boundaries

* app/gui/grid-dialog.h
* app/gui/grid-dialog.c (grid_dialog_new): use the new
GimpGridEditor widget, take a GimpImage as function parameter,
assume GimpImages always have a GimpGrid. This simplifies the grid
dialog.

* app/gui/image-commands.c
(image_configure_grid_cmd_callback): changed accordingly

* app/core/core-types.h: moved typedef GimpGrid from here ...

* app/config/config-types.h: ... to here to be able to use it in
GimpCoreConfig

* app/config/gimprc-blurbs.h
* app/config/gimpcoreconfig.[ch]: added default_grid member

* app/widgets/gimphelp-ids.h
* themes/Default/images/preferences/Makefile.am
* themes/Default/images/default-grid.png
* app/gui/preferences-dialog.c: added UI for specifying default
image grid

* app/core/gimpimage.c (gimp_image_new): create a GimpGrid from
core_config->default_grid

* app/gui/image-menu.c (image_menu_update): the grid/guide entries
in <Image>/View/ should always be sensitive ...

* app/display/gimpdisplayshell.c (gimp_display_shell_init):
... but the grid entries should be disabled by default
2003-10-10 14:11:47 +00:00
Michael Natterer 7cf4eb467a removed "visible" and all its API...
2003-09-11  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawable.[ch]: removed "visible" and all its API...

	* app/core/gimpitem.[ch]: ...and added it here.

	* app/core/core-enums.[ch]
	* app/core/gimpimage-undo-push.[ch]: changed the drawable
	visibility undo to be an item visibility undo.

	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c: save it in PROP_VECTORS and changed channel
	and layer loading/saving accordingly.

	* app/core/gimpimage-merge.c
	* app/core/gimpimage-preview.c
	* app/core/gimpimage-projection.c
	* app/core/gimpimage.c
	* app/core/gimplayer-floating-sel.c
	* app/core/gimplayer.c
	* app/core/gimpselection.c
	* app/text/gimptextlayer.c
	* app/gui/channels-commands.c
	* tools/pdbgen/pdb/channel.pdb
	* tools/pdbgen/pdb/layer.pdb: changed accordingly.

	* app/pdb/channel_cmds.c
	* app/pdb/layer_cmds.c: regenerated.

	* app/widgets/gimpdrawabletreeview.[ch]: removed the eye icon...

	* app/widgets/gimpitemtreeview.[ch]: ...and added it here.
2003-09-11 19:52:29 +00:00
Michael Natterer b724e662ff enabled error checking for GimpParasite saving and factored
2003-09-10  Michael Natterer  <mitch@gimp.org>

	* app/xcf/xcf-save.c: enabled error checking for GimpParasite
	saving and factored GimpParasiteList saving out to a new
	function. Cleaned up the (still disabled) PROP_VECTORS saving
	code and save the vector's parasites.

	* app/xcf/xcf-load.c: changed PROP_VECTORS loading accordingly.

	Note that the PROP_VECTORS changes are completely untested since
	Simon can judge its correctness much better than myself.
2003-09-10 16:22:33 +00:00
Michael Natterer 17bce42486 app/xcf/xcf-load.c app/xcf/xcf-read.c app/xcf/xcf-save.c
2003-09-10  Michael Natterer  <mitch@gimp.org>

	* app/xcf/xcf-load.c
	* app/xcf/xcf-read.c
	* app/xcf/xcf-save.c
	* app/xcf/xcf-seek.c
	* app/xcf/xcf-write.c
	* app/xcf/xcf.c: whitespace cleanup.
2003-09-10 10:40:57 +00:00
Simon Budig a0cc73de42 Made gimp_vectors_compat_get_points accept more paths gracefully. It now
2003-09-09  Simon Budig  <simon@gimp.org>

	* app/vectors/gimpvectors-compat.[ch]: Made
	gimp_vectors_compat_get_points accept more paths gracefully. It
	now is sufficient if there is up to one open stroke in the
	vectors object - it does not have to be the last one.

	Added function to determine if all vectors can be saved in
	compatibility mode.

	* app/vectors/gimpanchor.[ch]: Made GimpAnchor a boxed type.
	* app/vectors/gimpstroke.[ch]: Add two properties to gimpstroke:
	"closed" and "control-points" (the latter is
	G_PARAM_CONSTRUCT_ONLY). Added functions to get the points that
	determine the shape of the stroke - necessary for proper saving.

	* app/xcf/xcf-private.h: added new PROP_VECTORS and XcfStrokeType.

	* app/xcf/xcf-load.c: Be able to load PROP_VECTORS, make loading
	of PROP_PATHS ignore empty paths.

	* app/xcf/xcf-save.c: Added code for saving PROP_VECTORS,
	disabled by default. Define NEW_SAVE_CODE if you want to test
	it. No guarantees are made about the forward compatibility of
	the format used.
2003-09-09 15:46:59 +00:00
Michael Natterer 420d17d286 made all functions which push an undo step virtual and added them all as
2003-09-03  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpchannel.[ch]: made all functions which push an
	undo step virtual and added them all as default implementations.

	* app/core/Makefile.am
	* app/core/core-types.h
	* app/core/gimpselection.[ch]: new object which is a GimpChannel
	subclass and implements all of its virtual functions, pushes
	an image_mask undo and chains up with "push_undo = FALSE".

	* app/core/gimpimage-mask.[ch]: made most functions simple
	wrappers like gimp_channel_invert(gimp_image_get_mask(gimage));
	so the API stays the same for now.

	* app/core/gimpimage.[ch]: create a GimpSelection object
	as gimage->selection_mask. Removed "gboolean mask_stroking"
	since it is in GimpSelection now.

	* app/xcf/xcf-load.c (xcf_load_channel_props): added an evil hack
	which turns a GimpChannel into a GimpSelection once we figured the
	loaded channel is the selection.

	* app/core/gimplayer.c (gimp_layer_create_mask):
	gimp_channel_clear() takes an additional "const gchar *undo_desc"
	parameter now.

	* app/core/gimpscanconvert.c (gimp_scan_convert_to_channel): set
	mask->bounds_known to FALSE before returning the new channel

	* app/tools/gimpiscissorstool.c (iscissors_convert): no need to
	call gimp_channel_invalidate_boundary() on the channel returned by
	the above function.

	* app/core/gimpchannel.[ch]: removed
	gimp_channel_invalidate_boundary() since it is no longer needed.
2003-09-02 23:07:40 +00:00
Sven Neumann a176b8993c removed excessive path debugging output.
2003-09-01  Sven Neumann  <sven@gimp.org>

	* app/xcf/xcf-load.c: removed excessive path debugging output.

	* app/text/gimptext-vectors.c: always close strokes created from
	text outlines.
2003-08-31 23:46:05 +00:00
Sven Neumann 616a367bc8 don't ignore the delete event on the splash screen, but quit gimp
2003-07-08  Sven Neumann  <sven@gimp.org>

	* app/gui/splash.c (splash_create): don't ignore the delete event
	on the splash screen, but quit gimp immidiately by calling exit().

	* app/xcf/xcf-load.c (xcf_load_layer): reduced code duplication.
2003-07-08 10:38:13 +00:00
Henrik Brix Andersen 5943f03135 Added persistent storage of image grid in XCF files.
2003-07-04 Henrik Brix Andersen <brix@gimp.org>

Added persistent storage of image grid in XCF files.

* app/core/gimpimage.[ch]: removed gimp_image_get_grid() and
gimp_image_set_grid() ...

* app/core/Makefile.am
* app/core/gimpimage-grid.[ch]: ... and added them to these new
files. Added gimp_grid_parasite_name(), gimp_grid_to_parasite()
and gimp_grid_from_parasite() functions.

* app/core/gimpimage-snap.c
* app/gui/grid-dialog.c: #include "gimpimage-grid.h"

* app/core/gimpimage-undo-push.c: #include "gimpimage-grid.h".
(gimp_image_undo_push_image_grid) mark image as dirty.

* app/xcf/xcf-save.c (xcf_save_image_props): save GimpGrid object
as a parasite.

* app/xcf/xcf-load.c (xcf_load_image): load GimpGrid from
parasite.

* devel-docs/parasites.txt: documented the new "gimp-image-grid"
parasite.
2003-07-04 19:55:58 +00:00
Sven Neumann 7a6a908ad2 added new function gimp_config_serialize_to_fd() for the sake of
2003-06-24  Sven Neumann  <sven@gimp.org>

	* app/config/gimpconfig.[ch]: added new function
	gimp_config_serialize_to_fd() for the sake of completeness and
	since it's a nice way to generate debugging output.

	* app/text/Makefile.am
	* app/text/gimptext-xlfd.[ch]: new files with routines to handle X
	Logical Font Descriptions in an attempt to improve backwards
	compatibility.

	* app/text/gimptext-parasite.[ch]
	* app/xcf/xcf-load.c: promote layers with GDynText parasite to
	GimpTextLayer. Work in progress, we need to improve font matching.
2003-06-24 19:45:55 +00:00
Sven Neumann 35a57d0148 broken pipe in the middle of the last commit...
* app/xcf/xcf-save.c: when saving a text layer, store an extra
	parasite that holds all information about the text.

	* app/xcf/xcf-load.c: if a "gimp-text-layer" parasite is found and
	it can be successfully deserialized to a GimpText object, convert
	the layer to a text layer and remove the parasite.

	* devel-docs/parasites.txt: documented the new "gimp-text-layer"
	parasite.
2003-06-24 13:59:36 +00:00
Michael Natterer f7351b0bbb app/vectors/Makefile.am new files implementing a compatibility API for
2003-05-22  Michael Natterer  <mitch@gimp.org>

	* app/vectors/Makefile.am
	* app/vectors/gimpvectors-compat.[ch]: new files implementing a
	compatibility API for converting old XCF and PDB point arrays
	to GimpVectors and vice versa.

	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c
	* tools/pdbgen/pdb/paths.pdb: use the new functions instead of
	having slightly different, but equally ugly code twice.

	* app/xcf/xcf-load.c: cleaned up path loading a lot. Removed the
	path_point loading utility functions.

	* app/pdb/paths_cmds.c: regenerated.

	* app/Makefile.am: link vectors/libappvectors.a after
	xcf/libappxcf.a so the compat functions (which are not needed in
	vectors/) are found.  Also reverted an accidentially checked in
	change to the libgimpwidgets link order.
2003-05-22 19:02:38 +00:00
Michael Natterer 487f71ba05 Removed the old paths and the remaining legacy stuff it needed. Fixes bug
2003-05-21  Michael Natterer  <mitch@gimp.org>

	Removed the old paths and the remaining legacy stuff it needed.
	Fixes bug #104471.

	* Makefile.am
	* configure.in
	* pixmaps/*: removed the pixmaps/ directory.

	* app/ops_buttons.[ch]
	* app/path.[ch]
	* app/pathP.h
	* app/path_transform.h
	* app/gui/paths-dialog.[ch]
	* app/tools/gimpbezierselecttool.[ch]: removed these files.

	* app/Makefile.am
	* app/gui/Makefile.am
	* app/tools/Makefile.am: changed accordingly.

	* app/core/core-types.h: removed the Path* types.

	* app/core/gimpimage.[ch]
	* app/core/gimpimage-duplicate.c: removed gimage->paths.

	* app/gui/about-dialog.c: inline wilber2_xpm for now.

	* app/gui/dialogs-constructors.c
	* app/gui/dialogs-menu.c
	* app/gui/dialogs.c
	* app/gui/menus.c: removed the old paths dialog.

	* app/gui/gui.c: removed gui_rotate_the_shield_harmonics() hack
	which was broken anyway.

	* app/tools/gimptransformtool.c: #if 0 path_transform preview stuff.

	* app/tools/gimpiscissorstool.c: removed useless include.

	* app/tools/tools.c: removed the bezier select tool.

	* app/vectors/gimpvectors.c (gimp_vectors_real_stroke_add): use
	g_list_append(), not g_list_prepend() so some ugly side conditions
	of legacy path loading are honored.

	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c: load and save only GimpVectors.
2003-05-21 17:38:14 +00:00
Michael Natterer a354e7f45e set gimage->qmask_state to TRUE if a channel's name is "Qmask". Fixes bug
2003-05-19  Michael Natterer  <mitch@gimp.org>

	* app/xcf/xcf-load.c (xcf_load_channel): set gimage->qmask_state
	to TRUE if a channel's name is "Qmask". Fixes bug #113240.
2003-05-18 22:07:36 +00:00
Michael Natterer 146a51c55f changed to expect all points (also the first one) in "H, A, H" order.
2003-05-18  Michael Natterer  <mitch@gimp.org>

	* app/vectors/gimpbezierstroke.[ch]
	(gimp_bezier_stroke_new_from_coords): changed to expect all points
	(also the first one) in "H, A, H" order.  Ignore the first coord
	in the array for now. Added "gboolean closed" parameter.

	* app/xcf/xcf-load.c
	* tools/pdbgen/pdb/paths.pdb: shuffle the legacy path point arrays
	around before creating strokes so they match the new order.

	* app/pdb/paths_cmds.c: regenerated.
2003-05-18 16:36:10 +00:00
Michael Natterer 1589a20644 the old paths actually *do* support multiple strokes, they are just all in
2003-05-15  Michael Natterer  <mitch@gimp.org>

	* app/xcf/xcf-load.c (xcf_load_old_path): the old paths actually
	*do* support multiple strokes, they are just all in one curve.
	Added support for loading them as separate GimpBezierStrokes.
2003-05-15 12:32:53 +00:00
Michael Natterer a5ddcd73e5 load the old paths into new GimpVectors objects. Old paths are still
2003-05-14  Michael Natterer  <mitch@gimp.org>

	* app/xcf/xcf-load.c: load the old paths into new GimpVectors
	objects. Old paths are still created because new vectors can't be
	saved yet. Renamed all old path loading functions to
	xcf_load_old_path*(). Added prototypes for them and reordered them
	to match the order of the rest of the file. Changed their
	signatures to match the rest of the file and indented them.
2003-05-14 19:21:42 +00:00
Michael Natterer 85f5206d59 app/xcf/xcf-load.c (xcf_load_channel_props) store the channel's "linked"
2003-05-13  Michael Natterer  <mitch@gimp.org>

	* app/xcf/xcf-load.c (xcf_load_channel_props)
	* app/xcf/xcf-save.c (xcf_save_channel_props): store the channel's
	"linked" state in the XCF. Older GIMPs will complain, but still
	load the file as if the new property was not there.
2003-05-13 18:30:15 +00:00
Michael Natterer 33b7d779d6 removed "linked" member and API...
2003-05-08  Michael Natterer  <mitch@gimp.org>

	* app/core/gimplayer.[ch]: removed "linked" member and API...

	* app/core/gimpitem.[ch]: ...and added it here.

	* app/core/core-enums.[ch]
	* app/core/gimpimage-undo-push.[ch]: changed layer_linked undo
	types and functions to be item_linked ones.

	* app/tools/gimpeditselectiontool.c
	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c
	* tools/pdbgen/pdb/layer.pdb: changed accordingly.

	* app/pdb/layer_cmds.c: regenerated.

	* app/widgets/gimplayertreeview.[ch]: removed "linked" icon and
	functions...

	* app/widgets/gimpitemtreeview.[ch]: and added them here. Setting
	channels or vectors to "linked" does nothing yet.
2003-05-08 20:26:01 +00:00