Commit graph

4459 commits

Author SHA1 Message Date
Mikael Magnusson
c889e68d8d app: fix gimp_file_is_executable check to not return true for directories 2014-10-29 19:14:56 +01:00
Michael Natterer
9dc13116ae Bug 419256 - Optimize mask buffer size for VBR generated brushes
Change gimp_brush_generated_get_half_size() to get_size() and
calculate its exact size in float. This is really a minor change that
seems to work well.
2014-10-21 12:54:30 +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
5d8824f42e app: move all GimpBrush members to a private struct
Add and use accessors for width, height, x_axis and y_axis.
2014-10-12 01:16:32 +02:00
Michael Natterer
cd505dbd02 app: don't leak "display_file" in gimp_image_format_display_uri() 2014-10-07 15:22:49 +02:00
Michael Natterer
e6ce0dda9d app: free the default brush, pattern etc in gimp_finalize()
and print a warning if there are any contexts left in gimp->context_list.
2014-10-06 20:35:24 +02:00
Michael Natterer
849481a861 Clean up code around calls to g_file_replace()
- use G_FILE_CREATE_NONE instead of 0
- don't put "Could not open <file> for writing: <error>" around the
  returned error, the returned message is already verbose
2014-10-04 02:44:54 +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
Michael Natterer
1671955655 app: allow to change the affected channels on a running filter
Connect GimpImageMap to the GimpImage's "component-active-changed" signal
and update the channels affected by the filter.
2014-09-25 23:40:05 +02:00
Michael Natterer
0c33499b7b Bug 736437 - Ignore unknown file extensions when loading palettes and gradients
Don't try to load palettes and gradients with unknown extension. We
introduced extensions for these files a *lot* of years ago, so we're
dropping this legacy feature now, everybody can just rename their old
files to have the right extensions (the file formats have not
changed).
2014-09-14 23:29:58 +02:00
Michael Natterer
0bf1f22b01 app: add a "Playground" perfs page and a --show-playground command line option
The page is shown by default in unstable but needs --show-playground
in stable versions. There is nothing yet on that page. Also, the icon
needs improvement...
2014-09-14 01:08:25 +02:00
Michael Natterer
14978bfe5d Simplify calls to g_output_stream_write_all()
It returns TRUE only if all bytes were written, so there is no need to
get and check the bytes_written return value.
2014-09-07 20:30:14 +02:00
Mukund Sivaraman
1dc873b860 app: Fix return types 2014-09-03 09:09:00 +05:30
Michael Natterer
bda1cd049d Bug 735516 - Crop to content fails
Return a new enum GimpAutoShrink { SHRINK, EMPTY, UNSHRINKABLE } from
gimp_pickable_auto_shrink() because a simply boolean FALSE doesn't
distinguish between "not further shrinkable" and "no content". Change
the callers accordingly add a special "already cropped" message where
we only had a "no content" message before.
2014-08-31 17:41:54 +02:00
Hartmut Kuhse
50463d8d5a app: erroneously dereferencing paint_options
fixing commit 4d6640ff79
2014-08-31 15:27:12 +02:00
Michael Natterer
b6eb88dbf9 Bug 735513 - Fuzzy select (magic wand) freeze w/select transparent areas
gimp_pickable_contiguous_region_by_seed(): don't call
find_contiguous_region() with start coords outside the buffer, or it
will run into an infinite loop.
2014-08-27 21:12:46 +02:00
Mukund Sivaraman
a805f8426a app: Use gint64 for dirty_time 2014-08-25 19:55:29 +05:30
Michael Natterer
a0a7e713b4 Bug 706275 - "View/Snap to active path" doesn't snap to layer center...
...with the Move tool

Add the missing code to snap to the rectangle's center in
gimp_image_snap_rectangle().
2014-08-17 22:12:44 +02:00
Simon Budig
e0e29889b0 fix bogus use of g_strlcpy
Spotted by Andrey Karpov using static code analysis:
   http://www.viva64.com/en/b/0273/
2014-08-16 00:37:14 +02:00
Simon Budig
40c06ab685 fix some copy&paste errors
Spotted by Andrey Karpov using static code analysis:
   http://www.viva64.com/en/b/0273/
2014-08-16 00:37:13 +02:00
Simon Budig
99abc566d4 fix some precedence errors
Spotted by Andrey Karpov using static code analysis:
   http://www.viva64.com/en/b/0273/
2014-08-16 00:37:13 +02:00
Michael Natterer
b663b8058f Bug 734705 - v2.9.1 crashes when scaling an image in indexed colors mode
Use gimp_image_get_format() instead of gimp_babl_format() in
gimp_drawable_real_estimate_memsize() because the latter can't handle
indexed formats and returns NULL.
2014-08-15 09:23:02 +02:00
Michael Natterer
980ba7f85a app: move memsize functions into their own files gimp-memsize.[ch] 2014-08-12 13:57:57 +02:00
Michael Natterer
9bb3aee163 app: add gimp_file_is_executable() to gimp-utils.[ch]
including PATHEXT magic for windows.
2014-08-04 02:38:24 +02:00
Michael Natterer
6209b1f571 libgimpbase, app: move gimp_file_has_extension() to libgimpbase
and use it in GimpModuleDB.
2014-08-03 20:47:37 +02:00
Simon Budig
8af3fec689 app: use the new distance-transform operation in the blend tool 2014-08-03 20:12:01 +02:00
Michael Natterer
a0b9e5c702 libgimpmodule, app: port GimpModuleDB to GFileEnumerator
this implies passing the UTF-8 encoded raw module path from gimprc to
gimp_module_db_load() and gimp_module_db_refresh(), which is strictly
speaking an API break, but I seriously doubt that anyone but GIMP is
actually using libgimpmodule.
2014-08-03 18:30:02 +02:00
Michael Natterer
da26597467 app: add gimp_file_has_extension() and use it in GimpDataFactory 2014-08-02 23:29:00 +02:00
Michael Natterer
ab2afa0c1f app: don't check for a writable dir for each loaded GimpData
Instead, do the check once for each element of the data path, and pass
the result to the load functions.
2014-08-02 15:09:33 +02:00
Michael Natterer
2b1735f784 app: move gimp_file_compare() to gimp-utils.[ch]
It's a GCompareFunc to be used for finding GFiles in lists.
2014-08-02 15:07:26 +02:00
Michael Natterer
6821eb298c app: port GimpDataFactory file loading to GFileEnumerator
Also slightly change the semantics of gimp_data_set_folder_tags()
to be less complicated.
2014-08-01 20:30:45 +02:00
Jehan
2567a2d1fd app: typo s/fomat/format/ 2014-08-01 18:38:25 +00:00
Michael Natterer
1155b9c7a7 app: more GFile stuff in gimp_get_temp_file() 2014-07-29 16:32:29 +02:00
Michael Natterer
9a90bfa26a app: more gimp_directory() -> gimp_directory_file() 2014-07-29 11:56:49 +02:00
Michael Natterer
3e85deefb5 app: manage the system and user gimprc paths as GFiles 2014-07-28 15:03:06 +02:00
Michael Natterer
6b6ba7b456 app: port gimptagcache.c to GIO 2014-07-28 12:22:52 +02:00
Michael Natterer
afc469446f app: port gimp_tags_user_install() to GIO 2014-07-28 12:12:21 +02:00
Michael Natterer
b03d69dd40 libgimpbase, app: add variants of gimp_$foo_directory() which return GFiles
gimp_directory_file(), gimp_data_directory_file() etc. The new
functions take a variable list of path elements to the file,
the list has to be NULL-terminated. Remove the newly added
gimp_personal_rc_gfile(). Start using the new functions in app/.
2014-07-28 02:04:01 +02:00
Michael Natterer
b328bd3087 app: don't leak a GFileInfo in gimp_data_set_file() 2014-07-26 16:52:56 +02:00
Michael Natterer
58c3b7661f app: port gimp_data_create_filename() to GFile
implies also porting gimp_data_factory_get_save_dir().
2014-07-26 16:37:30 +02:00
Michael Natterer
1aa5a85d2a app: don't drop the last reference to "file" in gimp_data_set_file(), argh
also improve precondition check in gimp_data_save().
2014-07-26 16:33:40 +02:00
Michael Natterer
e618a2866c app: simplify handling of a GimpDataFactory's writable_path
Simply keep it around in GimpDataLoadContext during loading, instead
of g_object_set/getting it on the factory.
2014-07-26 14:21:39 +02:00
Michael Natterer
7e7c22fc32 app: separate the mount logic from uploading/downloading
We need to mount every non-native GFile's volume, regardless of
whether the file procedure uses GIO directly or needs file-remote to
download/upload the file. Move the entire mount logic to a new
file-remote function and change gimp-gui.c and gui-vtable.c to only
return a GMountOperation. Try to mount every non-native file in
file-open.c and file-save.c and bail out if mounting fails. Simplify
the uploading and downloading code accordingly.
2014-07-23 21:37:13 +02:00
Michael Henning
7bdc3cba14 app: Relax preconditions on gimp_gradient_get_color_at
The context can now be null unless the gradient specifically needs
the foreground/background colors, in which case
gimp_context_get_{foreground,background} will do the check and warn.
2014-07-22 13:13:46 -04:00
Michael Natterer
328e4eff18 app: add gimp_progress_set_text_literal()
and use it instead of set_text (progress, "%s", literal_message);
2014-07-20 23:32:19 +02:00
Michael Natterer
93c19c20d4 app: fix a bunch of valgrind-found leaks 2014-07-20 21:40:57 +02:00
Michael Natterer
14c39816d8 app: keep the theme directories around a GFiles
and change gimp_get_theme_dir() to return a GFile.
2014-07-20 17:09:25 +02:00
Michael Natterer
6694f6be1a app: don't create gimp->documents twice (broke that in the last commit)
Also, clean up gimp_init() to not zero-initialize stuff, which makes
it much more readable.
2014-07-15 00:22:43 +02:00
Michael Natterer
9d3418ef1c app: make sure --verbose gets passed to the Gimp instance's members
Add CONSTRUCT_ONLY property "verbose" and create the members which get
a "gimp" pointer passed in constructed() instead of init().
2014-07-15 00:09:15 +02:00
Michael Natterer
83f69aa9fb app: don't set the same GFile again in gimp_imagefile_set_file()
I don't think this can happen, but better safe than sorry.
2014-07-13 19:13:11 +02:00