Commit Graph

282 Commits

Author SHA1 Message Date
Michael Natterer 28e1a379e6 app: remove const qualifiers from all object parameters
They are unreliable because every type checking cast discards them,
they are useless anyway, visual clutter, added inconsistently, and
generally suck. Wanted to do this a long time ago, it was a bad idea
in the first place.
2016-05-19 23:54:14 +02:00
Michael Natterer 597a438f07 app: remove gimp_image_set_filename()
- gimp-image-set-filename PDB wrapper: implement the same there in
  a few lines
- xcf-load.c: use gimp_image_set_file() instead, and get rid of the
  last use of filename in xcf/ in favor of GFile
2015-07-13 22:43:22 +02:00
Michael Natterer 6e420bcdbb app: remove gimp_image_get_filename() 2015-07-13 03:53:29 +02:00
Michael Natterer 950f753ede Bug 736907 - Compat mode for XCF
- add gimp_image_get,get_xcf_compat_mode()
- add a compat toggle to GimpFileDialog which is shown and sensitive
  only for a save (not export), and if the image structure allows
  to save an old version at all. The button also has a tooltip
  which explains why it is sensitive and what it does
- add "gboolean xcf_compat" to file_save_dialog_save_image()
- in file_save_dialog_save_image(), call image_set_xcf_compat_mode(TRUE)
  only around the call to file_save() and set it to FALSE after saving
- in xcf_save_invoker(), honor the image's XCF compat flag and save an
  RLE-compressed XCF if possible

The above is very convoluted and doesn't pass the "xcf_compat" boolean
directly because we can't change the parameters of gimp-xcf-save, and
because the gimp-xcf-save might be called indirectly.
2014-10-20 22:54:11 +02:00
Michael Natterer 4fdfe10b29 app: move the XCF version logic to gimpimage.[ch]
Add gimp_image_get_xcf_version() and use it when saving XCFs. The
function also returns GIMP versions in integer (comparable) and string
form to be used by GUI logic that allows to save compatible files.
2014-09-27 20:38:43 +02:00
Mukund Sivaraman a805f8426a app: Use gint64 for dirty_time 2014-08-25 19:55:29 +05:30
Michael Natterer 7f966cad39 app: keep the image's "Untitled" string around as GFile too 2014-07-08 00:15:41 +02:00
Michael Natterer ff6ea69569 app: change the image's various URIs to GFiles
which gets rid of a lot of temporarily added GFile code again because
we don't need to convert between URI and GFile any longer.
2014-07-07 23:58:11 +02:00
Michael Natterer 3dbae5e4d9 Bug 727854 - Export file type should not be based on filename extension
Keep the export proc acound in the image (just as we keep around
the save proc), and use it when exporting again.
2014-07-02 14:24:02 +02:00
Michael Natterer 57ef7a2959 app: add gimp_image_estimate_memsize()
to be used to estimate an image's memory size at another precision or
size.
2014-06-15 21:40:05 +02:00
Michael Natterer 60f23afde2 app: add a small infrastructure to validate known parasites
when they are added to items, images or globally, from the PDF or an
XCF file. None of the validation functions does anything currently,
they simply return TRUE.
2014-03-22 00:18:48 +01:00
Michael Natterer caf73f5f35 Add support for both gamma-corrected and linear for all bit depths
- Add new enum GimpComponentType which contains u8, u16, u32 etc.
- Change GimpPrecision to be u8-linear, u8-gamma, u16-linear etc.
- Add all the needed formats to gimp-babl.c
- Bump the XCF version to 5 and make sure version 4 with the old
  GimpPrecision enum values is loaded correctly

This change blows up the precision enums in "New Image" and
Image->Precision so we can test all this stuff. It is undecided what
format will be user-visible options in 2.10.
2013-06-23 16:51:24 +02:00
Michael Natterer 6ddb977542 app: reimplement image component visibility using gimp:mask-components 2012-10-06 23:58:46 +02:00
Michael Natterer 220b28677b Bug 676566 - Window title becomes "Untitled" after exporting without saving
Fix this and other issues more globally by moving the logic that
formats the image's display name into the GimpImage object, and return
the properly formatted name, e.g. "Foo.xcf", or "[Foo] (imported)"
from gimp_image_get_display_name().

Also add gimp_image_get_display_path() which returns the full path
instead. Use the two functions for formatting the image title, and
apply various other fixes that make sure the UI always uses the same
string to identify the image.

Call gimp_object_name_changed() whenever the save/export status
changes, so the image's cached display name and path get cleared.
2012-07-17 22:52:49 +02:00
Michael Natterer 06c59973d3 app: remove the entire legacy composition code 2012-05-19 00:41:43 +02:00
Michael Natterer 20f3cba2b6 app: rename gimp_image_base_type() to gimp_image_get_base_type() 2012-05-07 21:57:33 +02:00
Michael Natterer 94da46c373 app: add precision argument to gimp_image_get_format()
and use it instead of gimp_babl_format() in some places where indexed
formats can occur. Also fix some places using gimp_babl_format() to
special case indexed formats correctly.
2012-05-07 21:46:47 +02:00
Michael Natterer d81ea1315e app: implement active, affected components in GEGL
Add GimpOperationMaskComponents, enum GimpComponentMask, and image and
drawable infrastructure to get the right mask, and plug the mask
operation into gimp_gegl_create_apply_buffer_node().
2012-05-02 17:51:17 +02:00
Michael Natterer b4580e74e6 app: implement converting images between precisions, including menu items 2012-05-02 17:51:16 +02:00
Michael Natterer c07325a005 app: add "precision" argument to gimp_image_new() 2012-05-02 17:51:09 +02:00
Michael Natterer 678255604d app: add a GimpPrecision enum that for now contains GIMP_PRECISION_U8
Add gimp_image_get_precision(), and a "precision" argument to
gimp_babl_format(). Change code accordingly and do some more format
related cleanups.
2012-05-02 17:51:09 +02:00
Michael Natterer 95cb77edc9 app: change gimp_image_get_format() to take a base_type and a with_alpha boolean
which kills almost all remaining use of GimpImageType.
2012-05-02 17:51:03 +02:00
Michael Natterer 9bac5b8837 app: add gimp_image_get_channel_format() and get_mask_format()
which for now return the same thing (Y' u8) and need to be used
in more places before becoming useful.
2012-05-02 17:50:58 +02:00
Michael Natterer 3ddfa42c80 app: remove the remaining image_type macro junk from gimpimage.h 2012-05-02 17:50:58 +02:00
Michael Natterer afe8eaf256 app: remove GimpImageType based API and macro junk 2012-05-02 17:50:57 +02:00
Michael Natterer ef638faf82 app: add gimp_image_get_layer_format() 2012-05-02 17:50:56 +02:00
Michael Natterer ca7ee8400e app: remove gimp_image_transform_temp_buf() 2012-05-02 17:50:46 +02:00
Michael Natterer 50d7242b87 app: remove gimp_image_transform_rgb()
and use gimp_rgba_get_pixel() instead.
2012-05-02 17:50:43 +02:00
Michael Natterer 7f437d7d53 app: remove gimp_image_get_foreground,background()
and use gimp_context_get_foreground,background_pixel() instead.
2012-05-02 17:50:43 +02:00
Michael Natterer 23370d9fad app: remove gimp_image_get_color() 2012-05-02 17:50:39 +02:00
Michael Natterer 4ba37eacd8 app: remove gimp_image_transform_color()
and port to gimp_image_transform_rgb() to babl_process()
2012-05-02 17:46:00 +02:00
Michael Natterer 906176831d app: add image API to get Babl formats based on GimpImageType
because we often have only a type and an image, but no drawable
(yet) to ask for its types.
2012-05-02 17:46:00 +02:00
Michael Natterer 5d1474c17e app: use GEGL to extract an image's component into a channel
Add gimp_image_get_component_format() for that purpose.
2012-05-02 17:45:53 +02:00
Michael Natterer dc8d6a3977 app: use gimp_image_transform_rgb() instead of transform_color()
instead of fiddling with gimp_rgb_get_uchar() manually.
2012-05-02 17:45:52 +02:00
Michael Natterer f086e27846 app: add macro GIMP_IMAGE_TYPE_FROM_BYTES() (ignoring indexed mode) 2012-05-02 17:45:47 +02:00
Eric Grivel da37e9ff3e Bug 596410 - gimp-image-get-filename returns NULL for imported files
Make gimp_image_get_uri() and gimp_image_get_filename() behave as in
the GIMP 2.6 days. Add new functions gimp_image_get_xcf_uri(),
gimp_image_get_exported_uri() and gimp_image_get_imported_uri().
2011-08-12 21:15:16 +02:00
Martin Nordholts 366cddc856 app: gimp_image_get/set_imported/exported/save_a_copy_uri()
Add more proper core API for GimpImage URI management.
2011-02-02 22:28:46 +01:00
Martin Nordholts d449317501 app: Add and use gimp_image_get_string_untitled() 2011-02-02 22:28:46 +01:00
Martin Nordholts 480d6e0cf2 app: Add and use gimp_image_get_uri() 2011-01-26 08:19:39 +01:00
Martin Nordholts ac773489e4 app: gimp_image_get_uri() -> gimp_image_get_uri_or_untitled() 2011-01-26 07:55:14 +01:00
Michael Natterer f8d6821790 app: get rid of selection_control() in core/ and display/
- replace gimp_display_shell_selection_control() by undraw() and restart()
  which actually say what they are doing
- remove enum GimpSelectionControl
- replace GimpImage::selection_control() by ::selection_invalidate()
  because none of the other enum values was used any longer
2010-10-09 20:28:37 +02:00
Michael Natterer 55f01bf6f3 app: remove gimp_display_shell_draw_vectors()
which is the last bit of non-item drawing of stuff that is not
somehow the image itself... wheee!

This involves reverting commit
6bce0641d4 and adding back all the
vectors handlers that were in gimpdisplayshell-callbacks.c before.
Change the callbacks to manage proxy items for all the image's
vectors.
2010-10-08 01:03:56 +02:00
Michael Natterer 26d0035be0 app: draw guides using GimpCanvasItems
- Add signals GimpImage::guide_added(), removed() and moved()
- Remove singal GimpImage::update_guide()
- Adapt core code to emit the new signals instead of update_guide()
- Have the shell connect to the new signals and update guide canvas
  items as needed
- Remove gimp_display_shell_draw_guides()
2010-10-01 10:34:15 +02:00
Michael Natterer 07051535da app: remove GimpImage signal "update-sample-point" 2010-10-01 09:27:57 +02:00
Michael Natterer 0c613ba87d app: port sample point drawing to GimpCanvasItems
- Add GimpImage signal "sample-point-moved" and emit it when needed
- Let the shell connect to the sample point add, remove and move signals
  and update the canvas items accordingly
- Remove gimp_display_shell_draw_sample_points()
2010-10-01 09:27:57 +02:00
Michael Natterer 6bce0641d4 app: add signal GimpImage::update_vectors() and have the image manage updates
...just as we do for drawables. Connect to adding, removing, modifying
and toggling visibility of all vectors and emit "update-vectors"
accordingly. Add an update-vectors signal handler to GimpDisplayShell
and remove all other vectors handlers.
2010-09-17 11:31:57 +02:00
Michael Natterer 314a6ab926 app: merge the layer, channel and vectors repositioning APIs
into an API based on GimpItem.
2010-07-08 18:08:13 +02:00
Michael Natterer 6650693d29 app: move gimp_image_pick_layer() to its own file
and add a (still unused) text layer picking function.
2010-03-07 01:55:31 +01:00
Michael Natterer 9a561646c2 Move the undo disable/freeze APIs to gimpimage-undo.[ch] 2010-02-09 22:32:48 +01:00
Michael Natterer 804e692c86 Add some item tree infrastructure that will be needed later
- add gimp_image_get_layer_tree(), channel_tree() and vectors_tree()
- change GimpItem::get_container() to GimpItem::get_tree()
- implement gimp_item_get_container() using gimp_item_get_tree()
2010-02-06 16:17:23 +01:00