Commit Graph

21087 Commits

Author SHA1 Message Date
Tobias Ellinghaus c1e73b1cd4 Fix compile 2018-05-20 21:06:30 +02:00
Michael Natterer 241af754b9 app: get rid of some GtkTables in tools/ 2018-05-20 21:06:30 +02:00
Michael Natterer 4c5f0ff0de app: fix border width of GimpOverlayDialog 2018-05-20 21:06:30 +02:00
Michael Natterer 679ac0cb1e app: get rid of GtkArrow in GimpColorDialog 2018-05-20 21:06:30 +02:00
Michael Natterer f34b879a2d app: get rid of GtkHSeparator and GtkHScale 2018-05-20 21:06:30 +02:00
Michael Natterer 5ece7a8d1f Port a lot of stuff from GdkScreen/monitor_number to GdkMonitor
including some fixes for getting pointer coords, and needed
API changes in libgimpwidgets.
2018-05-20 21:06:30 +02:00
Michael Natterer 7bd6734a04 Get rid of all GtkAlignments, use GtkWidget align/margin instead 2018-05-20 21:06:30 +02:00
Michael Natterer 45d02a8e5f app: port GimpColorHistory to GtkGrid 2018-05-20 21:06:30 +02:00
Michael Natterer 901c3ddcf8 Get rid of the deprecated gtk_icon_size_lookup_for_settings()
and use gtk_icon_size_lookup() instead.
2018-05-20 21:06:30 +02:00
Michael Natterer 1b3135ca95 Get rid of using GtkMisc API globally 2018-05-20 21:06:30 +02:00
Michael Natterer f180a171cd pdb: remove all deprecated procedures 2018-05-20 21:06:29 +02:00
Michael Natterer 1671da428c libgimpbase: remove almost all deprecated compat cruft
Keep infrastructure for compat enums around because we will
mose definitely need it again.
2018-05-20 21:06:29 +02:00
Michael Natterer c50fb989c8 app: make GimpHighlightableButton build on GTK+ 3.x 2018-05-20 21:06:29 +02:00
Michael Natterer 30efaca5f9 app: port gimpwidgets-utils.c to GTK+ 3.x 2018-05-20 21:06:29 +02:00
Michael Natterer 717ba49c8c app: port GimpMeter to GTK+ 3.x 2018-05-20 21:06:29 +02:00
Michael Natterer a5b5eaebd3 libgimpwidgets, app: use GdkRGBA instead of GdkColor for cell backgrounds 2018-05-20 21:06:29 +02:00
Jehan 7b20173dc8 Bug 762279 - "Tip of the day" links opens two links.
Use the "activate-link" signal instead of "clicked" on tip links, so
that we can stop signal propagation.
Otherwise it opens "http://docs.gimp.org/" everytime.
2018-05-20 21:06:29 +02:00
Michael Natterer 52fe0dad60 Revert "Bug 762279 - "Tip of the day" links opens two links"
This reverts commit dc33afd95b.

That hack is not for gtk3...
2018-05-20 21:06:29 +02:00
Michael Natterer 895b544af2 app: port GimpContainerTreeView from style_set() to style_updated() 2018-05-20 21:06:29 +02:00
Michael Natterer 09e6313c14 app: use gimp_color_display_stack_get_filters() instead of stack->filters 2018-05-20 21:06:29 +02:00
Michael Natterer ab6f19438c app: remove GTK_OBJECT() case in GimpPopup 2018-05-20 21:06:29 +02:00
Michael Natterer 6b447c3643 app: port GimpCircle and subclasses to GTK+ 3 2018-05-20 21:06:29 +02:00
Jehan 5e9f450d24 Use GTK+3 gtk_get_locale_direction() function instead of current hack.
This new function is available from the released dev version 3.11.4. But
we don't want to require GTK+ master for the gtk3-port branch, so I
leave the old hack in a GTK_CHECK_VERSION() macro, to be removed later
when we update GTK+ required version.
2018-05-20 21:06:29 +02:00
Michael Natterer 922f55ab85 app: s/GtkObject/GtkAdjustment/ in gimpdisplayhsell-rotate-dialog.c 2018-05-20 21:06:29 +02:00
Michael Natterer 345ef9f0a9 app: port wilber drawing to GtkStyleContext 2018-05-20 21:06:29 +02:00
Michael Natterer b68e4a1401 app: don't use the deprecated GDK_EXTENSION_EVENTS_ALL 2018-05-20 21:06:29 +02:00
Michael Natterer 1fdc472c68 app: make the statusbar's progress label visible again
and remove setting of removed align properties. The label alignment is
broken now until that feature comes back to gtk+.
2018-05-20 21:06:29 +02:00
Michael Natterer cc010a4288 Incomplete notebook and tab theming commit, to be improved 2018-05-20 21:06:29 +02:00
Michael Natterer 820d6fbe95 app: don't use "size-request" for the toolbox' wilber, it's gone 2018-05-20 21:06:29 +02:00
Michael Natterer cf07fae3c6 app: implement GtkContainer::get_path_for_child() in GimpMessageBox
and handle our internal icon child ourselves.
2018-05-20 21:06:29 +02:00
Michael Natterer 8b8242947b app: GimpDock: port font size modification to GtkCssProvider 2018-05-20 21:06:29 +02:00
Michael Natterer 98dd27b776 app: port GimpTagPopup to GtkStyleContext
This doesn't look as it should at all, but is entirely useable and
undeprecated, and I really want to keep the diff to master small. Will
fix after we switch to GTK+ 3.0.
2018-05-20 21:06:29 +02:00
Michael Natterer 8bb1637013 app: port GimpNavigationEditor to GtkStyleContext 2018-05-20 21:06:29 +02:00
Michael Natterer bc7b35d2d6 app: port GimpHistogramView to gdk_device_grab()/ungrab() 2018-05-20 21:06:29 +02:00
Michael Natterer aa96d9629e app: port GimpGradientEditor to GtkSyleContext 2018-05-20 21:06:29 +02:00
Michael Natterer f8f42f0946 app: let the file dialog expand/collapse with the file type expander
Using the new gtk_expander_set_resize_toplevel().
2018-05-20 21:06:29 +02:00
Michael Natterer 3b00ba8f06 app: remove some forgotten #undef GSEAL_ENABLE 2018-05-20 21:06:29 +02:00
Michael Natterer e8f0c14491 app: use gdk_device_get_position() inetad of gdk_display_get_pointer() 2018-05-20 21:06:29 +02:00
Michael Natterer 76859c3c32 app: make input devices, grabs and therefore generally tools work again
- add new "device from event" apparatus that works on GTK+ 3.x
- fix the active device selection mechanism
- use the new device grabbing functions
- make sure we don't process events while we have a grab on
  another device
- compensate for some really obscure (and likely broken) behavior
  of XI2, it feels like we are the first real users...
2018-05-20 21:06:29 +02:00
Michael Natterer 97df7535a1 app: gimp_device_info_get_device_coords(): workaround for XI2 b0rk
for the time being, use gdk_window_get_device_position() instead of
gdk_device_get_axis() for X and Y, which gets rid of subpixel
coordinates, but at least returns values != 0. Also, don't ask
keyboard devices for coordinates.
2018-05-20 21:06:29 +02:00
Michael Natterer 09b9263d5c app: gimp_print_event(): add the device to the event debug output. 2018-05-20 21:06:29 +02:00
Michael Natterer 0c00a72b17 app: remove gimp_rgb_get,set_gdk_color()
and inline the few lines into their only users.
2018-05-20 21:06:29 +02:00
Michael Natterer 4b322b8326 app: use GdkRGBA instead of GdkColor in some places 2018-05-20 21:06:29 +02:00
Michael Natterer e522c1dbf6 app: port GimpComboTagEntry to GtkStyleContext 2018-05-20 21:06:29 +02:00
Michael Natterer 107fc72237 app: define all GimpHistogramView colors via style properties and CSS 2018-05-20 21:06:28 +02:00
Michael Natterer bbf2c3947b app: port GimpCurveView to GtkStyleContext
reusing the new grid-color property added in the parent class.
2018-05-20 21:06:28 +02:00
Michael Natterer a4b8dafe61 app: add style property and default CSS for GimpHistogramView's grid-color 2018-05-20 21:06:28 +02:00
Michael Natterer 88a96cf3fb app: add gimp_get_style_color() to simplify GdkRGBA style property lookup 2018-05-20 21:06:28 +02:00
Michael Natterer c4d721e06d app: port GimpCellRendererDashes to GtkStyleContext 2018-05-20 21:06:28 +02:00
Michael Natterer 64d80e9aa4 Port cell renderers to gtk_cell_renderer_get_state() 2018-05-20 21:06:28 +02:00
Michael Natterer 9244cbe898 app: port GimpOverlayChild to GtkStyleContext 2018-05-20 21:06:28 +02:00
Michael Natterer f5c3bb00c2 app: remove call to gtk_widget_style_attach() from GimpOverlayBox 2018-05-20 21:06:28 +02:00
Michael Natterer 1cd367845d app: port GimpColorFrame away from GtkStyle, using a new style property 2018-05-20 21:06:28 +02:00
Michael Natterer dfa38fc26a app: remove obsolete device checks from GimpToolbox
The new code doesn't actually work properly, but the old one was
clearly bogus with GTK+ 3.x.
2018-05-20 21:06:28 +02:00
Michael Natterer 912128fe2e app: when checking for a device change, check the event's source device
because the events we receive always come from either master or
floating devices, but never from a slave source device.
2018-05-20 21:06:28 +02:00
Michael Natterer 9c9ba4895d app: always ask the master device for its axes or state 2018-05-20 21:06:28 +02:00
Michael Natterer 5d1ab3e5f9 app: port GimpTagEntry to GtkStyleContext 2018-05-20 21:06:28 +02:00
Michael Natterer 74564dfef3 app: port GimpHistogramView to GtkStyleContext
Locally added shade() and mix() utility functions which use
GtkSymbolicColor. Will move them to a better place once they are
needed elsewhere.
2018-05-20 21:06:28 +02:00
Michael Natterer f3d65fdb59 Implement GtkWidget::style_updated() instead of ::style_set() 2018-05-20 21:06:28 +02:00
Michael Natterer dcb991c6c7 app: port GimpThumbBox to GtkStyleContext 2018-05-20 21:06:28 +02:00
Michael Natterer afaa31bb33 app: use gtk_widget_override_font() instead of modify_font() 2018-05-20 21:06:28 +02:00
Michael Natterer dada25b14e app: port GimpToolEditor to GtkStyleContext 2018-05-20 21:06:28 +02:00
Michael Natterer 3b37a7a1c8 app: port GimpDockWindow to GtkStyleContext 2018-05-20 21:06:28 +02:00
Michael Natterer 3374e32264 app: port GimpPaletteView to GtkStyleContext 2018-05-20 21:06:28 +02:00
Michael Natterer 132485779e app: port GimpStrokeEditor to GtkStyleContext 2018-05-20 21:06:28 +02:00
Michael Natterer 72ad56006b app: don't use style->black and style->white 2018-05-20 21:06:28 +02:00
Michael Natterer 86603f30b9 libgimpwidgets: move all GimpColorSelection members to a private struct 2018-05-20 21:06:28 +02:00
Michael Natterer 0e35af2723 libgimpwidgets: move all GimpColorNotebook members to a private struct. 2018-05-20 21:06:28 +02:00
Michael Natterer c32681f4c3 libgimpwidgets: move all GimpColorDisplayStack members to a private struct 2018-05-20 21:06:28 +02:00
Michael Natterer aedd3e43de app: port GimpScaleButton to GtkStyleContext 2018-05-20 21:06:28 +02:00
Michael Natterer da0e45db60 app: port GimpOverlayFrame to GtkStyleContext 2018-05-20 21:06:28 +02:00
Michael Natterer 4a677c52fb app: port GimpOverlayBox to GtkStyleContext 2018-05-20 21:06:28 +02:00
Michael Natterer 3b8bcb1e4d app: use gtk_menu_shell_get_selected_item() 2018-05-20 21:06:28 +02:00
Michael Natterer ce2cd374ee Replace gdk_cursor_unref() with g_object_unref() 2018-05-20 21:06:28 +02:00
Michael Natterer 8c975484ab app: check whether child widgets exist in GtkWidget::style_updated()
because it is emitted repeatedly during widget construction, when not
everything is in place yet.
2018-05-20 21:06:28 +02:00
Michael Natterer 19528a61fe app: copy gimp.css instead of gtkrc to the user's gimp directory
Also, don't migrate gtkrc files from older gimp versions.
2018-05-20 21:06:28 +02:00
Michael Natterer af1bb43f37 Port theme and gtkrc file loading to CSS files using GtkCssProvider 2018-05-20 21:06:28 +02:00
Michael Natterer e713ad4a43 app: implement GtkWidget::style_updated() instead of style_set() 2018-05-20 21:06:28 +02:00
Michael Natterer ad7fe94d86 app: use gdk_drag_context_get_selected_action() instead of conect->action 2018-05-20 21:06:28 +02:00
Michael Natterer cfbec6b311 app: use gdk_drag_context_get_source_window()
instead of peeking into the struct
2018-05-20 21:06:28 +02:00
Michael Natterer de225a74a2 app: port the about dialog to GtkStyleContext 2018-05-20 21:06:28 +02:00
Michael Natterer 1d304ea273 app: s/gtk_widget_modify_font/gtk_widget_override_font/ 2018-05-20 21:06:27 +02:00
Michael Natterer eb312ed55a app: remove calls to gtk_widget_get,set_extension_events() 2018-05-20 21:06:27 +02:00
Michael Natterer 084a01abfe app: port GimpDashEditor to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer 2c10a7c95a app: port GimpContainerBox to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer 72d90394f5 app: port gimp_get_icon_size() to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer f69ca15573 app: port GimpFgBgView to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer f21ad702a2 app: port GimpFgBgEditor to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer a142c8916c app: port GimpComponentEditor to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer 200dbf96ce app: port GimpColormapEditor to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer 1138846d4e app: port GimpContainerTreeView to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer ed1d57a882 app: port GimpContainerIconView to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer 5c6d52c5f3 app: port GimpPanedBox to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer 5b3e3023cd app: port setting the canvas padding color to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer 2200ca2371 app: port GimpBlobEditor to GtkStyleContext
Also, add prelighting for the handle.
2018-05-20 21:06:27 +02:00
Michael Natterer 9e7d1206ac app: change the list of available devices to something that makes sense
Include the client pointer, its slaves, and all floating devices.
2018-05-20 21:06:27 +02:00
Michael Natterer fc440cc4d0 app: port the device sort function to GdkDeviceManager
Also make sure we don't pass around uninitialized keyvals and
modifiers of device keys.
2018-05-20 21:06:27 +02:00
Michael Natterer 9c84e15484 app: put the toolbox' areas into a box until we decided about a wrapping widget 2018-05-20 21:06:27 +02:00
Michael Natterer de3bd90f9a app: introduce struct GimpDeviceKey because GdkDeviceKey is gone 2018-05-20 21:06:27 +02:00
Michael Natterer 0f90d95ab4 app: use GdkDevice accessors 2018-05-20 21:06:27 +02:00
Michael Natterer 898df1c5c3 app: implement proper height-for-width in GimpToolPalette 2018-05-20 21:06:27 +02:00
Michael Natterer b9cfa11205 app: skip keyboard devices so the device list becomes reasonable 2018-05-20 21:06:27 +02:00
Michael Natterer 8c3a0d17f4 app: port GimpSpinScale to GTK+ 3.0 2018-05-20 21:06:27 +02:00
Michael Natterer 64cde17687 app: don't connect to "size-requst" because that's deprecated
Instead, connect to "style-set" and calculate the widget's size
request there. Also fix the label's offsets after whatever GTK+ text
drawing changes.
2018-05-20 21:06:27 +02:00
Michael Natterer ef80e1755c app: port GimpOverlayBox to GtkWidget::get_preferred_width/height() 2018-05-20 21:06:27 +02:00
Michael Natterer 4085ad0cbc app: fix GimpOverlayDialog's minimum height
and avoid some code duplication by using the parent class' size
negotiation code.
2018-05-20 21:06:27 +02:00
Michael Natterer 20627342ac app: port to the new size request API 2018-05-20 21:06:27 +02:00
Michael Natterer 2ffda5a25d app: remove GtkWrapBox 2018-05-20 21:06:27 +02:00
Michael Natterer 76d15851b1 app: port the colormap editor to GTK+ 3.0 2018-05-20 21:06:27 +02:00
Michael Natterer 1a82e4adce app: add ugly workaround to make the icon view adapt to view size changes 2018-05-20 21:06:27 +02:00
Michael Natterer 08cb6022c7 app: cairo_save()/restore() around chaining up in draw() 2018-05-20 21:06:27 +02:00
Michael Natterer 23e3ae8fbe app: use the new GtkScrollable API instead of deprecated tree view API 2018-05-20 21:06:27 +02:00
Michael Natterer 707131f695 app: GtkEntry turned into a no-window widget
Therefore, use the new get_area() functions to figure where to draw
from instead of the removed get_window() ones. Also adjust the tag
popup positioning code accordingly.
2018-05-20 21:06:27 +02:00
Michael Natterer 3b784075f3 app: port to GtkWidget::draw() 2018-05-20 21:06:27 +02:00
Michael Natterer c3b7cee99b app: forgot to remove a cairo_destroy() in draw() 2018-05-20 21:06:27 +02:00
Michael Natterer 5f2034451b app: port to GtkWidget::draw() 2018-05-20 21:06:27 +02:00
Michael Natterer fd7551bc19 app: don't translate to allocation.x,y 2018-05-20 21:06:27 +02:00
Michael Natterer b85f40b815 app: remove GimpContainerGridView from the build entirely
but leave it in the tree as reference for the time being.
2018-05-20 21:06:27 +02:00
Michael Natterer 5d2b26a101 app: port popup arrow drawing to cairo and get rid of the arrow_pixbuf 2018-05-20 21:06:27 +02:00
Michael Natterer 1e8b020ac7 app: passing -1 as width/height to gtk_paint_box() no longer works 2018-05-20 21:06:26 +02:00
Michael Natterer 40b9ba002a app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 27df9b617a app: didn't completely commit the display shell expose() -> draw() change 2018-05-20 21:06:26 +02:00
Michael Natterer 86e033d495 app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer f8ef0c71c2 app: can't set the scale combo entry's properties in init() any longer
Set them in constructed() instead.
2018-05-20 21:06:26 +02:00
Michael Natterer 1812012d59 app: port to GtkWidget::draw() but disable the code inside with #if 0 2018-05-20 21:06:26 +02:00
Michael Natterer 6494894334 app: port the tag entry to GTK+ 3.0 2018-05-20 21:06:26 +02:00
Michael Natterer a0a303bb42 app: remove call to gtk_statusbar_set_has_resize_grip() 2018-05-20 21:06:26 +02:00
Michael Natterer 9dfc455c12 app: port to GtkWidget::draw() (incompletely) 2018-05-20 21:06:26 +02:00
Michael Natterer 672e297219 app: use the container icon view, the grid view is not GTK+ 3.0-able 2018-05-20 21:06:26 +02:00
Michael Natterer 4ca9a5b33f app: port the overlay stuff to GTK+ 3.0 2018-05-20 21:06:26 +02:00
Michael Natterer bfa8831d62 app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer bb6c901364 app: port the splash to GTK+ 3.0 2018-05-20 21:06:26 +02:00
Michael Natterer 00cde1a499 app: remove calls to colormap functions, they are gone 2018-05-20 21:06:26 +02:00
Michael Natterer 2a01159f0e app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 172f607ac5 app: use GdkDeviceManager to list devices 2018-05-20 21:06:26 +02:00
Michael Natterer 27659afa7c app: pass the cairo_region_t to gdk_window_invalidate_region() directly 2018-05-20 21:06:26 +02:00
Michael Natterer c7baa65843 app: s/GtkObject/GtkAdjustment/ in app/dialogs/ 2018-05-20 21:06:26 +02:00
Michael Natterer 72bb4229fe app: port tools to GTK+ 3.0 (trivial changes only) 2018-05-20 21:06:26 +02:00
Michael Natterer df65b0bdcd app: use gtk_widget_get_preferred_size() instead of size_request() 2018-05-20 21:06:26 +02:00
Michael Natterer e888be6a9a app: port GimpScalComboBox to GTK+ 3.0 2018-05-20 21:06:26 +02:00
Michael Natterer 3c8d9a1de8 app: use gtk_widget_get_preferred_size() instead of size_request() 2018-05-20 21:06:26 +02:00
Michael Natterer 1a04428815 app: remove obsolete (GtkObject **) casts 2018-05-20 21:06:26 +02:00
Michael Natterer 5c720fa886 app: port device management to GdkDeviceManager 2018-05-20 21:06:26 +02:00
Michael Natterer 00b207a8d8 app: port call to gtk_paint_arrow() to GTK+ 3.0 2018-05-20 21:06:26 +02:00
Michael Natterer 04961e056d app: no need to alloc colors any longer, GdkColormap is gone 2018-05-20 21:06:26 +02:00
Michael Natterer bb3a98dab7 app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 99133bc271 app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer b16a564fd5 app: port GimpPaletteView to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer c872dfb140 app: port GimpNavigationView to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 0ba456bbd0 app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 232a168785 app: s/GtkObject/GtkAdjustment/ 2018-05-20 21:06:26 +02:00
Michael Natterer 8f8d62167d app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 691069947f app: port to GtkWidget::draw() and s/GtkObject/GtkAdjustment/ 2018-05-20 21:06:26 +02:00
Michael Natterer 18feaf6ce1 app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 94f1e6800d app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 04e9734685 app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 5ddb81272f app: port virtual functions to GTK+ 3.0 API 2018-05-20 21:06:26 +02:00
Michael Natterer 942eb89f19 app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 8c0265c525 app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 94d19047ac app: remove GTK_OBJECT() cast 2018-05-20 21:06:26 +02:00
Michael Natterer ace9ed91cb app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer bb0eb4a7c3 Revert "app: Fix on canvas widgets ignoring clicks from tablets - bug 614441"
This reverts commit a059c0e7eb.
2018-05-20 21:06:26 +02:00
Michael Natterer dbd9797a13 Switch to version 2.99/3.0 in a lot of places and depend on GTK+ 3.22
and lots of other newer libraries.
2018-05-20 21:06:26 +02:00
Michael Natterer 4591452007 app: remove the gimp-2-6 session compatibility test
It was unreliable and a huge pain, and 2.6 is really old shit.
2018-05-20 20:02:13 +02:00
Michael Natterer 68c774daab app: also special-case "undo-size" when generating default docs
and hardcode it to "1g", so properties of the dist machine don't leak
into the tarball.
2018-05-20 18:43:03 +02:00
Michael Natterer 9ebf36f873 configure.ac: require babl >= 0.1.50 2018-05-20 15:24:33 +02:00
Michael Natterer 5a6b00ea86 Revert "depend on babl-0.1.50"
This reverts commit 0aec661cda
which accidentially deleted the start of configure.ac
2018-05-20 15:23:23 +02:00
Øyvind Kolås 0aec661cda depend on babl-0.1.50 2018-05-20 10:56:36 +02:00
Michael Natterer 1d3bd593c1 app: nobody knows why this is needed, move along 2018-05-20 02:36:31 +02:00
Michael Natterer 2439ae3acf app: add new action "view-scroll-center" with shortcut Shift+J
The zoom focus discussion on IRC suggests that everybody is annoyed
about centering behavior (or lack thereof), so here is a way to
explicitly center the image witout zooming.
2018-05-19 18:06:49 +02:00
Michael Natterer ef2cf21f10 Bug 796252 - Mouse wheel zooming should center on cursor...
... _even at low zoom levels_

Pass GIMP_ZOOM_FOCUS_POINTER to gimp_display_shell_scale() when
wheel-scrolling, and change the scaling code to really honor
GIMP_ZOOM_FOCUS_POINTER and not apply magic image centering.

This keep the same point centered under the mouse for wheel-scrolling
and the zoom tool (== when the zooming is really triggered at a
certain mouse position).
2018-05-19 15:24:52 +02:00
Ell 25490b0251 app: implement GimpPickable::get_pixel_average() in various classes
Implement GimpPickable::get_pixel_average(), added in the previous
commit, in GimpDrawable, GimpImage, and GimpProjection, using
gimp_gegl_average_color(), added in the commit before last.  This
is significantly faster than the default implementation.
2018-05-18 15:07:32 -04:00
Ell b98a04aadc app: add GimpPickable::get_pixel_average() vfunc
... which calculates the average color of the pickable over a given
area.  Use this function in gimp_pickable_pick_color() when
sample_average is TRUE, and provide a default implementation which
calculates the average color using GimpPickable::get_pixel_at(), as
gimp_pickable_pick_color() did before.

The default implementation is rather slow; classes that implement
the GimpPickable interface can provide a faster specialized version
(see the next commit).
2018-05-18 15:07:32 -04:00
Ell d272368251 app: add gimp_gegl_average_color()
... which takes a GeglBuffer and calculates the average color over
a given area.
2018-05-18 15:07:32 -04:00
Øyvind Kolås 580576e702 configure/app: depend on GEGL 0.4.2 2018-05-16 23:26:44 +02:00
Michael Natterer 64954afa4b app: don't use the user context in GimpDeviceEditor's container view
GimpDeviceInfo is a GimpToolPreset now, and using the user context
would cause the device info selected in the dialog to be set globally
as tool preset. Use a temporary context instead, the container view
just needs it because.
2018-05-16 22:41:12 +02:00
Ell 23dab4311a Bug 796153 - Airbrush doesn't paint on timeout, and crashes with dynamics
gimp_airbrush_stamp(), which is called during the airbrush timeout
to periodically stamp the airbrush, assumes the saved symmetry's
origin is the same as during the original call to
gimp_airbrush_paint().  However, since commit
bc09c71818, we clear the symmetry's
origin at the end of gimp_paint_core_paint(), resulting in an empty
symmetry with a NULL origin during gimp_airbrush_stamp().  As a
result, no dab is painted, and we segfault if there's active
dynamics.

Fix this by saving the symmetry's origin coords during
gimp_airbrush_paint(), and restoring them in gimp_airbrush_stamp().
2018-05-16 14:40:48 -04:00
Michael Natterer 320d23f964 app: make sure all devices loaded from devicerc have tool options
We rely on GimpDeviceInfo's tool-options being non-NULL, so make sure
this is the case and fix NULL options with the current tool's options
after loading devicerc.
2018-05-16 20:07:26 +02:00
Michael Natterer 2f629072f1 Bug 787919 - Tool options are lost when switching device
GimpDeviceInfo is the only way to store per-device settings like
color, brush etc. It used to be derived from GimpContext and therefore
limited to the context's properties, causing everything else (all
tool-individual options) to be lost on device change.

Derive it from GimpToolPreset instead, so it's capable of storing
arbitrary tool options.

Adapt things to the new class hierarchy and add a bunch of signal
handlers that make sure the active device's GimpDeviceInfo is updated
properly when the tool changes. Also change device switching
accordingly.

Change GimpDeviceStatus to only show the stuff that is relevant to
each device's tool.

And various small changes to make things work properly...
2018-05-16 02:09:19 +02:00
Michael Natterer d6e0ca5054 Bug 796090 - (wrong) true-color preview of GEGL filter ops, ...
...like gaussian blur in indexed mode

In GimpDrawable's source node, after the filter stack, insert a node
that converts the pixels back to the drawable's format if the drawable
is indexed.
2018-05-16 02:09:19 +02:00
Michael Natterer 918f60836d Bug 796073 - Zero-size selections affect movement of pasted content...
...in weird ways

In gimp_rectangle_tool_button_press(), when the press triggers a
GimpEditSelectionTool operation (like moving a floating selection),
make sure we don't call COMMIT on a zero-size rectangle, because that
would get special treatment by commit(). Instead, CANCEL a zero-size
rectangle so stuff behaves as if it has never been there.
2018-05-15 23:59:05 +02:00
Øyvind Kolås 55429df954 configure/app: depend on babl-0.1.48 2018-05-15 21:50:45 +02:00
Ell 5c7064fb9f app: make gimp-atomic parameters volatile 2018-05-15 12:58:38 -04:00
Ell 03141fc30a app: don't use mask sampler in gimp_pickable_contiguous_region_by_seed()
In gimp_pickable_contiguous_region_by_seed(), use gegl_buffer_get()
to sample the mask buffer, instead of using a sampler.  The sampler
is created at the beginning of the operation, and is subsequently
used after modifying the mask buffer, which should be avoided,
since the sampler may return outdated cached data.
2018-05-14 03:12:40 -04:00
Jehan 20f20dd7b1 configure, app: encourage packagers to set custom bug tracker.
We get a lot of packaging bugs for third-party builds in our tracker,
especially since our debug tool now opens directly our bug tracker.
It would be preferred if third-party packagers were to make a first
filtering of bugs and only reported once they knew for sure that the bug
is in core code, and not in packaging.

Our configure script will now propose a --with-bug-report-url option
allowing to set a different web address. This address will be the one
opening in the debug dialog.
2018-05-14 05:44:06 +02:00
Ell a6bee79e0d app: in gimp_pickable_contiguous_region_by_seed(), use sampler object ...
... instead of gegl_buffer_sample()

Ditto.
2018-05-13 19:40:46 -04:00
Ell 3c95928031 app: in GimpIScissorsTool, use sampler object ...
... instead of gegl_buffer_sample()

Ditto.
2018-05-13 19:40:46 -04:00
Ell b7d95ad503 app: in GimpOperationCageTransform, use sampler object ...
... instead of gegl_buffer_sample()

GEGL commit 26f13cbfe9aaaa8c176162e54fdbb8af6876538e got rid of the
per-buffer cached samplers, making gegl_buffer_sample() much more
expensive, suitable primarily for one-off samples.

Use a sampler object instead.
2018-05-13 19:40:46 -04:00
Michael Natterer e9f2e82cff Bug 796071 - Clicking outside of a selection frame creates a new, ...
...zero-size selection

Make sure that clicking outside any selection halts the rectangle
select tool. This fixes ellipse select too.
2018-05-13 23:00:36 +02:00
Jehan 6a10ad3416 app: "validate" has the wrong meaning.
That was an obvious faux ami with French.
Status changed to "press Enter to refine", with the requirement of
staying not too long (this is a status message, not documentation), and
that also announces what will be the next step.
2018-05-13 21:53:25 +02:00
Michael Natterer 93064f4b2b app: formatting in gimpfreeselecttool.h 2018-05-13 21:46:37 +02:00
Ell b296496a65 app: in gimp_atomic_slist_pop_head(), don't warn on empty list
Allow trying to pop the head of an empty GSList, and just return
NULL.
2018-05-13 15:33:15 -04:00
Ell 5b7806e13c app: in GimpHistogramEditor, clear update timeout after validating
In gimp_histogram_editor_validate(), clear the update timeout, so
that if we validate the histogram before the timeout (in
particular, if editor->histogram itself is clear) we don't end up
unnecessarily re-validating it at the timeout.
2018-05-13 15:21:28 -04:00
Ell 5ed79b65bb app: in GimpHistogram, parallelize histogram calculation
Use gimp_parallel_distribute_area() to parallelize the histogram
calculation, which seems to scale very well.
2018-05-13 15:21:28 -04:00
Ell 398474ff58 app: add gimp-atomic
... which provides a set of higher-level lock-free atomic
operations.

Currently, the only two operations are
gimp_atomic_slist_push_head() and gimp_atomic_slist_pop_head(),
which atomically push/pop the first element of a GSList.
2018-05-13 15:21:28 -04:00
Ell 16a24ff081 app: various GimpAsync improvements
Code cleanup.

Improve function descriptions.

Improve function precondition checks.

Make sure the main thread is properly synced with the async thread
before calling the completion callbacks in the idle function.

Guarantee that all callbacks are called in FIFO order, even
callbacks added during the execution of other callbacks.
2018-05-13 15:21:28 -04:00
Jehan a89dc87aec Bug 795950 - Foreground selection tool requires use of the Enter key.
It is not obvious that you have to hit Enter to validate the first step
of Foreground Selection tool, i.e. the rough free selection. Adding this
information in status message.

Since Enter would only work once the free selection is closed or that
you have at least 3 points (then Enter closes the selection for you), I
also add gimp_free_select_tool_get_n_points() so that we can know how
many points were created from the Foreground Select tool, and only
update the status message when relevant.
2018-05-13 19:27:26 +02:00
Ell 4c767b4f03 app: fix gimp-parallel shutdown
Some leftover from an earlier version.  Caused gimp_parallel_exit()
to hang, although we could only notice that in GIMP_UNSTABLE
builds.
2018-05-13 11:55:16 -04:00
Michael Natterer 5b2dd00fab app: put the call to gimp_gui_ungrab() back in gimp_eek()
It got lost while improving our error handling.
2018-05-13 13:49:33 +02:00
luz.paz 69b2e84924 Source and trivial typos
Found via `codespell` and `grep`
2018-05-12 23:44:47 +02:00
Ell 1139c00721 app: in GimpHistogramEditor, avoid calculating histogram of detached layers
... which results in CRITICALs.  This can evidentially happen during
gimp_image_remove_layer() under certain circumstances (see comment
in the patch.)
2018-05-12 09:29:11 -04:00
Ell d5b0b08431 app: cancel async histogram calculation in gimp_histogram_clear_values()
Cancel any on-going asynchronous histogram calculation, started
through gimp_histogram_calculate_async(), upon calling
gimp_histogram_clear_values().
2018-05-12 09:29:11 -04:00
Ell 729240db34 app: improve GimpAsync description 2018-05-12 09:29:11 -04:00
Ell 44ffbe74df app: always update GimpHistogramView bins when changing histograms
... and not only when histogram != NULL, since the bin count may
change in either case.
2018-05-11 21:42:56 -04:00
Ell 4ad72cfc77 app: connect GimpHistogramView to bg-histogram "notify" signal
In GimpHistogramView, connect the view to the bg-histogram's
"notify" signal, and update the view in response.  Previously, we
only updated the view in response to the main histogram's "notify"
signal.

The curves tool only uses the bg-histogram, and after the switch to
asynchronous histogram calculation, in commit
49382e53d5, it failed to update the
histogram view after the calculation was complete.
2018-05-11 21:31:16 -04:00
Ell 49382e53d5 app: in GimpCurvesTool, calculate histogram asynchronously
In GimpCurvesTool, calculate the histogram of the target drawable
asynchronously, rather than synchronously, to avoid blocking the UI
while the histogram is calculated.
2018-05-11 14:01:42 -04:00
Ell b0ce645fe2 app: in GimpLevelsTool, calculate histogram asynchronously
In GimpLevelsTool, calculate the histogram of the target drawable
asynchronously, rather than synchronously, to avoid blocking the UI
while the histogram is calculated.
2018-05-11 14:01:42 -04:00
Ell 4af6fb5944 app: in GimpThresholdTool, calculate histogram asynchronously
In GimpThresholdTool, calculate the histogram of the target
drawable asynchronously, rather than synchronously, to avoid
blocking the UI while the histogram is calculated.

Additionally, fix the initial "low" threshold value for > 8bpc
images (127/255 => 0.5).
2018-05-11 14:01:42 -04:00
Ell d0b7fe6f52 app: in GimpHistogramEditor, calculate histogram asynchronously
In GimpHistogramEditor, calculate the histogram of the active
drawable asynchronously, rather than synchronously, to avoid
blocking the UI (and the execution of PDB calls) while the
histogram is calculated.  For large images, this can notably
improve responsiveness, as well as plug-in execution speed, while
the histogram dialog is mapped.
2018-05-11 14:01:42 -04:00
Ell 1923fa8b44 app: add gimp_drawable_calculate_histogram_async()
... which is similar to gimp_drawable_calculate_histogram(),
calculating the histogram asynchronously on a separate thread.

Note that when calculating the histogram of the drawable's source
node, the node is rendered synchronously on the main thread (if
necessary), and the histogram of the result is calculated
asynchronously on a separate thread.
2018-05-11 14:01:42 -04:00
Ell 9ea560d4a9 app: add gimp_histogram_calculate_async()
... which is similar to gimp_histogram_calculate(), calculating the
histogram asynchronously on a separate thread.
2018-05-11 14:01:42 -04:00
Ell 1b646804ea app: add gimp_parallel_run_async()
... which runs a user-provided function asynchronously, returning a
corresponding GimpAsync object.  This can be used to execute code
off the main thread, using the GimpAsync object to synchronize as
necessary.

Note that while the code allows for running multiple asynchronous
functions in parallel in a thread pool, we currently limit the pool
to a single thread, queueing overlapping async function, since we
have no use for parallel asynchronous functions at the moment.
2018-05-11 14:01:42 -04:00
Ell e1d15feff7 app: add GimpAsync
GimpAsync represents an asynchronous task, running without blocking
the main thread.  It provides functions that allow waiting for
completion, queueing completion callbacks, and requesting
calcelation.  See the code for more details.

The interface and the implementation are intentionally limited for
the time being, to keep things simple, and are geared toward
asynchronous tasks executed on a separate thread (see the next
commit).  The public interface is relatively general, however, and
we may extend the implementation to support other kinds of tasks at
some point, who knows...
2018-05-11 14:01:42 -04:00
Jehan 66db143502 Bug 796014 - Cannot open some older .xcf files made with 2.8.22 in 2.10.
To avoid an infinite loop, gimp_item_linked_is_locked() was temporarily
unlinking items before calling gimp_item_is_position_locked(). This
worked only based on gimp_item_real_is_position_locked() code which
called gimp_item_linked_is_locked() only when it was linked. It did not
take into account the fact that it was an abstract method which could
have other implementations. In particular the group layer implementation
would call in turn gimp_item_is_position_locked() on each child layer.

Basically temporarily unsetting the link was anyway a very ugly hack.
The point is simply that we are only interested by the value of the
`lock_position` flag for this item, without further "intelligence". For
this, use gimp_item_get_lock_position() instead.
2018-05-11 18:04:31 +02:00
Michael Natterer f741cacc28 app: fix last commit: identify displays by name not by pointer
Not so sure any more this belongs here at all, but it doesn't hurt
either...
2018-05-10 17:32:58 +02:00
Michael Natterer 3ced1e18f4 app: fix GimpDeviceManager to not add the same display twice
Displays can be opened multiple times, which caused the device manager
to try to add their devices multiple times (which gets prevented with
warnings), and then remove the devices prematurely when the
multiple-opened display gets closed the first time (which is even
worse).

Add a simple hash that keeps track of how often displays are open, and
only add/remove their devices on first open and last close.

This actually happened with gtk-inspector on the gtk3-port branch, but
there is no reason this can't also happen in stable.
2018-05-10 14:18:59 +02:00
Jehan 962b8496fc Bug 795899 - "Some fonts failed to load" error when missing fonts/...
... directory in the configuration folder.
This subfolder should have been created already. Just in case it is not
(for any reason), just recreate it rather than popping up an error.
2018-05-09 14:27:22 +02:00
Michael Natterer 0d74264c4d app: rename argument in gimpprefsbox.h too 2018-05-09 13:54:16 +02:00
Michael Natterer 384b116c15 app: clean up GimpPrefsBox and the prefs dialog a bit
Better API for getting properties of the current page, add missing
help IDs, fix the icon of the resolution calibrate dialog, ...
2018-05-09 01:47:23 +02:00
Michael Natterer fa0a02125c app: make the splash texts dynamic, so they are larger on larger splashes
and position the lower text roughly in the middle between the upper
text and the progress bar. This gives better spacing that the previous
logic.
2018-05-08 22:54:53 +02:00
Ell cb045c3e63 Bug 795911 - GIMP crashed while I was undoing a gradient
In the gradient-tool editor, when responding to an endpoint size-
entry "changed" signal, make sure there is a selected handle, and
bail otherwise.  We can receive a "changed" signal without a
selected handle, if the endpoint is deselected while a change to
the size-entry's value is in progress, causing the the tool GUI to
be unmapped, and the changed value to be committed.
2018-05-08 11:42:42 -04:00
Ell 3d9bc96423 app: improve gimp_eraser_tool_is_alpha_only()
When in anti-erase mode, always return TRUE, since it's only
effective when the drawable has an alpha channel.

Also, remove an unnecessary #include in gimp_ink_tool.c.
2018-05-08 10:50:46 -04:00
Ell bc09c71818 Bug 795909 - Multiple images opened with floating selection ...
... closing one of them crashes GIMP

GimpSymmetry keeps a strong reference to the drawable passed to
gimp_symmetry_set_origin() until the next call to set_origin(), or
until it's destroyed.  This can unnecessarily extend the lifetime
of the drawable.  In particular, it can extend the lifetime of a
floating selection past the destruction of the image mask, during
image destruction, which results in a NULL mask pointer in
gimp_layer_invalidate_boundary(), called when detaching the
floating selection as part of its destructor.

Add gimp_symmetry_clear_origin(), which clears the origin set using
gimp_symmetry_set_origin(), dropping the reference to the drawable,
and call it in gimp_paint_core_paint() after painting.  This avoids
extending the lifetime of the drawable, and fixes the bug.
2018-05-08 10:22:46 -04:00
Ell 084cbc3102 app: fix pass-through group histograms (proactively)
In gimp_drawable_calculate_histogram(), when including the
drawable's filters in the histogram (i.e., when calculating the
histogram of the drawable's source node, rather than its buffer),
if the drawable is a projectable, call
gimp_projectable_{begin,end}_render() before/after calculating the
histogram, respectively.  This is necessary for pass-through
groups, whose {begin,end}_render() functions disconnect/reconnect
the group's backdrop from/to the group's layer stack.  If we fail
to do this, the backdrop is erroneously included in the histogram.

Note that currently layer groups can't have any filters applied to
them, so we never run into this situation, but once we have non-
destructive editing we probably will.
2018-05-08 03:43:49 -04:00
Ell b775437561 app: #include "core/gimpdrawable.h" in gimperasertool.c
... for gimp_drawable_has_alpha().
2018-05-07 17:13:08 -04:00
Ell 1910ff8b1a app: warn when alpha-only painting has no effect
Add a GimpPaintTool::is_alpha_only() virtual function, which
subclasses can override to indicate whether painting only affects
the alpha channel (assuming FALSE by default).  Override the
function in Gimp{PaintBrush,Ink,Clone}Tool, returning TRUE when the
current paint mode only affects the alpha (as per
gimp_layer_mode_is_alpha_only(); see the previous commit,) and in
GimpEraserTool, returning TRUE when the target drawable has an
alpha channel.

When the function returns TRUE, and the target drawable doesn't
have an alpha channel, or the alpha channel is locked, show a BAD
cursor modifier, and raise an appropriate warning when attempting
to paint.
2018-05-07 16:53:29 -04:00
Ell 2c58598172 app: add gimp_layer_mode_is_alpha_only()
... which determines if a layer mode's blend function only affects
the alpha, maintaining the backdrop's color.  This is currently
true only for ERASE, SPLIT, and ANTI_ERASE modes.
2018-05-07 16:53:29 -04:00
Ell 2e68088c35 app: use gimp:normal instead of gegl:over in gimp_gegl_apply_cached_operation()
When the operation doesn't have an input pad, composite it over the
input using gimp:normal, instead of gegl:over, for consistency with
the rest of our compositing code (although the result should be the
same).
2018-05-07 14:38:53 -04:00
Ell f3febfe343 Bug 795866 - Transparent gradient on transparent layer ...
... drifts/sharpens when applying additional gradients

In GimpDrawableFilter, don't use gegl:over for operations without
an input pad, since this only works if the filter's mode is
REPLACE.  If the filter's mode is different, in particular, if it's
NORMAL, we end up compositing the operation's output against the
input twice: once in gegl:over, and again in the filter's
applicator.  Notably, this happens for the gradient tool.

Instead, revert commit 5b80d3d3be
(with some additions to avoid constructing unnecessary nodes when
the operation has no input) and simply change the applicator's mode
to NORMAL if the oepration doesn't have an input, and the filter's
mode is REPLACE.
2018-05-07 14:35:40 -04:00
Michael Natterer 7e1df2c8c6 app: add layers/channels/vectors freeze/thaw to gimpplugin-cleanup
so plug-ins cannot thaw what they haven't frozen, and the code
can clean up frozen stuff left behind by crashed or broken plug-ins.

Also redo the cleanup code so it only keeps track of the undo group
counts and freeze counts of what *this* GimpPlugInProcFrame did
itself. That should make it even stricter against broken code that
could mess up internals.
2018-05-07 20:09:07 +02:00
Michael Natterer d87259ccf9 app: fix gimp_gegl_apply_operation() for source OPs
Blend them on top of the source buffer using gegl:over like
GimpDrawableFilter does interactively. Fixes "Repeat Last" and
probably some other stuff for source OPs.
2018-05-07 14:26:26 +02:00
Michael Natterer 29cf157f69 app: add +gimp_container_freeze_count() which returns the freeze_count 2018-05-07 10:25:45 +02:00
Michael Natterer 1950eda8ab app: fix rendering of the bg_histogram in GimpHistogramView
gimp_histogram_view_draw_spike(): we were shifting the bg_histogram to
the right by accidentially offsetting the 'i' variable, use a local
variable for the loop instead.
2018-05-07 10:17:19 +02:00
Ell 40e3406b91 pdb: add gimp-image-{freeze,thaw}-{layers,channels,vectors}
These procedures freeze/thaw the corresponding containers of the
image, allowing plug-ins that perform many changes affecting any of
these containers to suppress updates to the corresponding dialogs,
significantly improving performance.
2018-05-07 02:56:10 -04:00
Ell 88c63420e8 app: ignore gimp_container_view_{select,activate,context}_item() ...
... while the container is frozen

In GimpContainerView, do nothing in response to a
gimp_container_view_{select,activate,context}_item() call while the
view's container is frozen.  While the container is frozen the view
is empty, and these functions can segfault.
2018-05-07 02:56:10 -04:00
Ell f5ecc9f859 app, menus: add gegl:spherize to the menus 2018-05-06 07:13:08 -04:00
Ell cdd129110c app, menus: add gegl:recursive-transform to the menus 2018-05-06 07:13:00 -04:00
Jehan 33a92e2447 app: get rid of gimp_get_backtrace().
It is not used anywhere anymore and can be replaced by the more powerful
gimp_stack_trace_print() (which can also allocate a string containing
the backtrace, hence is a proper replacement call).
2018-05-05 20:18:25 +02:00
Jehan 47a036f750 Bug 795814 - Error saving VERY large file.
g_alloca() is not very advisable, especially when it might be used to
allocate a big chunk of memory at once. It is better to allocate dynamic
memory with malloc(), or in particular with g_try_malloc() which won't
abort the program on failure.
This might be slightly slower (one of the advantages of memory on the
stack, though not even an absolute truth) but probably not by much, if
at all, and it's better to be safe anyway.
2018-05-05 20:13:27 +02:00
Jehan 98a575370c app: add a check on not-NULL string before g_utf8_validate().
Still looking for possible crash case during gimp_font_list_load_names()
(cf. bug 795650). g_utf8_validate() segfaults if called with NULL.
Though looking at pango_font_description_to_string() implementation, it
doesn't look like it would ever return NULL. Yet it is worth
double-checking. We don't load font every second anyway.
2018-05-05 15:55:30 +02:00
Jehan d58f131b59 Bug 795650 - Gimp crashes on start in Windows.
Add more assertion checks (similar to commit d094ab7e56).

This is still not a fix per-se, but at least would make the code a bit
more robust. In particular FcObjectSetDestroy() could crash if somehow
FcObjectSetBuild() had returned a NULL pointer. And obviously
dereferencing a NULL fontset would crash as well.
Now if any of these happened, no fonts would be loaded. But at least
GIMP would not crash.
2018-05-05 15:26:26 +02:00
Ell 07c81abf01 app: fix propgui random seed generation
After the switch of random-seed properties from INT to UINT, their
upper bound results in a negative value when converted to a
gint32, causing a CRITICAL in the call to g_random_int_range().
Use g_random_double_range() instead, which has enough precision to
accurately represent all values in the range, and round the result.
2018-05-04 13:41:55 -04:00
Michael Natterer 48f6d1b8ee app: avoid scaling GimpCanvasArc to zero, it causes a non-invertable matrix 2018-05-04 11:48:44 +02:00
Ell 2e643e6270 app: cleanly remove log handlers on exit
Remove the log handlers registered in errors_init(), in
errors_exit(), and call errors_exit() before destroying the Gimp
instance, since the log handlers depend on it.  This avoids
segfaulting if a message is logged after destroying the Gimp
instance.
2018-05-03 15:50:29 -04:00
Michael Natterer 62279047b1 Bug 795763 - Update gimp.org links to https://
Update links to https:// in "About". the "Help" menu, and several
user-visible error messages.
2018-05-03 00:27:29 +02:00
Ell 6be0bb1358 app: always set text-tool image when starting the editor
In GimpTextTool, when starting the editor in response to a button
press, always set the text tool's image first, so that the style
editor picks the correct resolution for the text-size entry.
Currently the image is only set when clicking inside the active
drawable's bounds.
2018-05-01 17:08:23 -04:00
Jehan d094ab7e56 app: add some g_return_if_fail() in gimp_font_list_load_names().
Some crash happens inside this function (cf. bug 795650) on Windows.
Because of very inaccurate trace on this OS, it is hard to determine the
exact issue. Let's at least add some basic check on function parameters.
This won't fix any core issue, but may make things a bit more robust and
bugs easier to detect.
2018-05-01 03:41:37 +02:00
Jehan e796e3a50a app: popup error at startup when some fonts fail to load.
As proposed on IRC. This will allow people to debug their fonts (for
instance when there are permission issues or whatnot) by knowing the
list of problematic fonts in an error dialog at startup (and not only on
terminal).
2018-05-01 03:25:58 +02:00
Jehan 55d1ea5cf0 app: check that the font path is not NULL.
This is for Windows where we apparently need to call
g_win32_locale_filename_from_utf8() before feeding the path to
FcConfigAppFontAddFile().
Unfortunately as we discovered earlier (cf. commit ba06a0fe86), this
can sometimes return NULL. So we absolutely need to check for the path
not being NULL first.
2018-04-30 22:05:11 +02:00
Jehan 69f864d5f5 app: use a GFileEnumerator to loop through font files. 2018-04-30 21:58:19 +02:00
Jehan 3de1f33702 app: font loading output a GError.
This GError will either specify the font which failed to load (if
unique) or a vague message about fonts which fail to load.
Unfortunately right now, this message also goes to terminal because the
GUI is not ready yet.
2018-04-29 19:47:44 +02:00
Jehan 00dcd50a6c Bug 748553 - GIMP crash if a font does not have read permission.
Do not use FcConfigAppFontAddDir() because it seems to be half-loading
some fonts, even when they are not actually readable. On the other hand,
FcConfigAppFontAddFile() properly fails and does not leave the font list
in unstable state.
2018-04-29 17:34:13 +02:00
Ell 151eeb9761 app: use gimp_item_{start,end}_transform() in GimpEditSelectionTool
... instead of gimp_item_{start,end}_move().

This should have been part of commit
37742a9fee.
2018-04-29 08:30:37 -04:00
Ell 741c78ec9e app: serialize "draw mask" option of region-select tools 2018-04-29 07:21:07 -04:00
Michael Natterer 4cc8481b66 app: get rid of a few forgotten stock-ids and new_from_stock() 2018-04-29 04:50:17 +02:00
Jehan 0fce8fdb3c app: expand/unexpand locale paths in pluginrc.
It doesn't look like it is actually much of a problem, but anyway it's
better to have non-absolute paths in config files when possible.

Thanks to jtojnar on IRC for reporting these (and MyPaint brush paths
from my previous commit).
2018-04-29 02:20:58 +02:00
Jehan f6b586237c app: identifier of MyPaint brush GimpData using ${mypaint_brushes_dir}.
Absolute paths not to be used in $XDG_CONFIG/GIMP/{version}/tags.xml.
These are actually only an identifier, and not used as a path at all
anyway. Moreover MyPaint brushes even generate checksum (which allows
to remap the GimpData appropriately even if the paths are changing).
But anyway it's better not to have absolute paths when we can prevent
so.
2018-04-29 00:40:26 +02:00
Michael Natterer a007ad4b98 app: remove debug output from gimp_image_create_color_transforms() 2018-04-28 16:42:01 +02:00
Michael Natterer 8265b2425b app: s/GtkObject/GObject/ in gui-message.c, and minor reordering 2018-04-28 02:18:44 +02:00
Michael Natterer 8be9b12e78 configure.ac: require GEGL >= 0.4.1 2018-04-27 17:22:54 +02:00
Ell f6a56fac51 app: move exclusion and linear-burn modes to a more logical position
... in the layer-mode menu (this only affects UI.)
2018-04-26 16:08:55 -04:00
Øyvind Kolås f1db670f19 configure,app: depend on GEGL-0.4.0 2018-04-26 14:59:12 +02:00
Michael Natterer a44e1500fa app: fix rectangle select tool cursor after committing/halting
gimp_rectangle_select_tool_cursor_update(): always set a cursor and
cursor modifier even if no GimpToolRectangle widget exists, so we are
not stuck with the last set cursor after committing or halting the
tool.
2018-04-26 13:00:18 +02:00
Ell 2d19848277 app: don't invalidate gradient cache upon gradient-type changes
In GimpOperationGradient, since we no longer avoid using the
gradient cache for conical gradients, the gradient type doesn't
affect the cache.
2018-04-26 05:34:58 -04:00
luz.paz 4a77ff2d3d Bug 795557 - Misc. typo fixes in source, comments and doxygen (pt3)
Found via `codespell` and grep.
2018-04-25 23:49:06 +02:00
Ell 6e87ceb896 app: use half the cache size for symmetric conical gradients
Symmetric conical gradients only span half a revolution (unlike
assymetric ones, which span an entire revolution), and therefore
require only half the cache size.
2018-04-25 17:42:52 -04:00
Ell d6a7302678 app: crop GimpDrawableFilter output
Add a crop node to the GimpDrawableFilter graph, applied after the
filter's output, cropping the output to the filter area (the same
area used for the input crop node).  If we fail to do this, filters
whose op's bounding box is bigger than the input region can affect
areas outside the drawable, when the filter is rendered as part of
the image graph (in contrast to being comitted).  This is
particularly relevant to source ops, that may have an infinite
bounding box.

We probably didn't notice this until now, since before the recent
GimpProjection update-area changes, only the drawable's area would
get invalidated in response to changes in the filter, so regions
outside the drawable wouldn't normally get rendered.  However, this
could still have been triggered by causing regions outside the
drawable to be invalidated by other means.
2018-04-25 15:58:24 -04:00
Ell 5970046e25 app: use gradient cache for conical gradients
Add gimp_drawable_gradient_adjust_coords(), which adjusts the
gradient segment coords according to the gradient type, so that, in
cases where the gradient span is unrelated to the segment length,
the gradient cache (in GimpOperationGradient) is big enough not to
produce banding.  Use the new function in gimp_drawable_gradient()
and in the gradient tool, instead of duplicating the logic.

Move the shapreburst coordinate-adjustment logic to the new
function, and add appropriate logic for conical gradients.

Remove the code that avoids using the gradient cache for conical
gradients from GimpOperationGradient.
2018-04-25 14:05:19 -04:00
Ell 38ba45cf31 app: in GimpOperationGradient, move cache generation back to process()
Undo the part of commit fa9a4108c3
that moved cache generation from process() to prepare().  prepare()
is called after each property change, in order to calculate the
op's bounding box for invalidation.  Since we only need the cache
for actual processing, generating it in process() avoids that
overhead.
2018-04-25 14:05:19 -04:00
Michael Natterer ef5bd98e99 app: protect GimpContext's "parent" pointer against dangling
with a weak ref and call set_parent(NULL) in dispose().
2018-04-25 19:20:12 +02:00
Ell 45be8b2591 app: use paint composite-mode, instead of AUTO, in more places
In the various types of fill operations, and in fade operations,
use the paint composite-mode of the current paint mode, which is
the composite mode we use during painting, instead of AUTO, which
results in the default mode we use for layer compositing.  This
effectively means that filling using any non-legacy, non-
subtractive mode can paint over transparent areas, rather than
being limited to nontransparent areas.
2018-04-25 11:20:48 -04:00
Ell 95921427d5 app: remove multithreading warning from the preferences dialog
Since we're prepping for a release, it's a about time we've done
that.  I hereby pronounce multithreading support fit for general
use!
2018-04-25 10:55:11 -04:00
Ell fa9a4108c3 app: various improvements to GimpOperationGradient
Invalidate the gradient cache while setting relevant properties,
and validate it, reconstructing if necessary, during prepare(),
rather than process(), to avoid the need to use a mutex.

Make sure the cache has at least two elements, corresponding to
the initial and final colors of the gradient, since both colors
might be needed, and to avoid division by zero.

Avoid using a cache if its necessary size is too big, or if the
gradient type is conical, since the necessary cache size for
conical gradients is unrelated to the gradient line length.

Improve index rounding during cache lookup.

Lots of indentation fixes.
2018-04-25 09:48:02 -04:00
Ell 4fce5d2518 Bug 793714 - Error when merging layer group with Pass through mode
When merging a pass-through group, change its mode to NORMAL first,
to avoid a critical when duplicating the group as a regular layer.
Preserve the group's blend/composite space/mode while changing its
mode (note that only the composite space currently matters, since
the other parmaeters are immutable for pass-through groups.)
2018-04-25 08:43:57 -04:00
Michael Natterer 8696c05855 app: disable the "Use Applicator" toggle in paint options 2018-04-25 00:55:41 +02:00
Simon Budig 44a931e16c ripple: put the compat code in the proper place, fix up POTFILES.in 2018-04-24 14:26:39 +02:00
Michael Natterer dcefc10eca app: make setting of layer mode on new layers smarter in layers-commands.c
If the mode remembered in GimpDialogConfig is NORMAL or NORMAL_LEGACY,
use the image's default new layer mode instead.
2018-04-24 14:00:34 +02:00
Michael Natterer 1c91cdabc8 app: change the default new layer mode in GimpDialogConfig
to GIMP_LAYER_MODE_NORMAL.
2018-04-24 14:00:34 +02:00
Michael Natterer 9ac34bda70 app: change the default paint mode in GimpContext to GIMP_LAYER_MODE_NORMAL 2018-04-24 14:00:34 +02:00
Simon Budig e6de783b3c remove the ripple plugin, provide compat PDB-API 2018-04-24 13:05:58 +02:00
Michael Natterer 8d54476457 Bug 795493 - Warning when removing a text layer
In gimp_text_tool_connect(), when auto-removing empty text layers upon
text layer or tool change, make sure we don't try to remove a layer
that has already been removed, which can happen if this function is
reached *because* somehow the layer was removed externally (e.g. by
the user in the layers dialog).
2018-04-24 02:49:03 +02:00
Michael Natterer db227148f0 pdb: finally deprecate gimp-color-balance
Since nobody can tell me how the new gimp-drawable-color-balance can
be improved, it's going to be identical, just with a namespace.
2018-04-23 18:20:05 +02:00
Michael Natterer a9fb4f9a39 pdb: make all item-transform procedures honor the "linked" flag
and improve their documentation.
2018-04-23 17:10:46 +02:00
Michael Natterer b80036e14f pdb: deprecated gimp-layer-translate
and port all plug-ins/scripts to gimp-item-transform-translate.
2018-04-23 15:49:23 +02:00
Michael Natterer acbdc4d5b4 pdb: add gimp-item-transform-translate procedure
We were only able to translate selections and layers (bot not channels
and paths) via the PDB, this new procedure fixes that. Deprecation of
old API and some more transform consistency to follow...
2018-04-23 03:06:23 +02:00
Michael Natterer 5b80d3d3be app: fix source operations on layers with alpha
They are not supposed to completely overwrite the layer's alpha
channel. Instead, composite them on top of the layer using gegl:over.
2018-04-23 02:59:35 +02:00
Simon Budig 6ffa19d595 fix internal name of the filter-grid help-id 2018-04-23 01:53:49 +02:00
Michael Natterer a31ee3ec22 app: fix outer border color of GimpSpinScale to look OK on all themes
it used to be "text" which is almost always too extreme; use "text_aa"
instead which is half way between "text" and "base" and always gives a
reasonable contrast.
2018-04-23 01:28:09 +02:00
Michael Natterer 7256f18447 app: change offsets parameters of GimpItem::translate() from int to double
so we can use it to precisely position paths; use SIGNED_ROUND() in
channel, layer etc. to snap to pixels.
2018-04-23 01:27:56 +02:00
Michael Natterer b1a36b044b app: cast another argument to g_object_ref() in gimp_tool_info_new() 2018-04-23 01:25:17 +02:00
Jehan 33d9336083 app: gimp_get_temp_file() / gimp_temp_name() should create tmp/ if...
... it doesn't exist.
The tmp/ dir in the config folder should already be created by GIMP, but
just in case it is not there, try and create it, since all code calling
these assumes that it exists.
2018-04-23 00:35:01 +02:00
Ell a6a8147b19 app: fix indentation of GimpUndoType enum descriptions 2018-04-22 04:05:36 -04:00
Ell 37742a9fee Bug 795410 - Deleting a layer group and then undoing the deletion ...
... raises a CRITICAL

gimp_item_{start,end}_move() currently serves two different
purposes:  It is used by GimpLayer to suspend/resume mask resizing
of the layer's ancestors; this is necessary whenever an operation
on a layer might affect the size of its ancestors.  It is also used
by GimpGroupLayer to suspend/resume its own mask resizing; this, on
the other hand, is only necessary before applying one of the
transformation functions to the group, so that mask modification is
handled by GimpLayer.  In other words, the effects of
gimp_item_{start,end}_move() on group layers are only necessary in
a subset of the cases in which these functions are used.

While in itself this isn't a problem, it does cause issues when
removing a group layer:  gimp_image_remove_layer() calls
gimp_item_start_move() before removing the layer, and
gimp_item_end_move() afterwards.  While the former function is
called while the layer is still attached to the image, the latter
function is called after the layer is no longer attached.  Since
GimpGroupLayer pushes an undo step in response to these calls, only
the call to start_move() results in an undo step, while the call to
end_move() doesn't, resulting in an unbalanced
GIMP_UNDO_GROUP_LAYER_START_MOVE undo step on the stack.  This
causes problems when undoing the operation.

Add gimp_item_{start,end}_transform() functions, and corresponding
GimpItem::{start,end}_transform() virtual functions, which are more
specialized versions of gimp_item_{start,end}_move(), which should
be used instead of the former before/after transforming an item; in
other cases, such as when removing ot reordering an item,
gimp_item_{start,end}_move() should still be used.  The default
implementation of GimpItem::{start,end}_transform() calls
gimp_item_{start,end}_move(), respectively, so subclasses that
override these functions don't have to do that themselves.

In GimpGroupLayer, override GimpItem::{start,end}_transform(),
instead of GimpItem::{start,end}_move(), for the same purpose of
suspending mask resize.  This avoids these functions from being
called when removing a layer group, fixing the bug.
2018-04-22 04:05:36 -04:00
Ell eeae5b48ca app: avoid pushing undo for nested gimp_group_layer_{suspend,resume}_mask()
... in order not to overshoot the undo-stack estimated memory-
usage.  See comment in the code.
2018-04-22 04:05:36 -04:00
Ell 577e17032a app: fix undo when moving a group-layer child outside the group
In gimp_image_reorder_item(), call gimp_item_start/end_move()
before/after reordering the item (and use an undo group, so that
the resulting undo actions are grouped together with the reordering
undo action,) so that if the item is a child of a group layer, and
reordering moves it out of the group in a way that causes the
group's mask to be resized, the mask will be properly restored when
undoing the operation.
2018-04-22 04:05:35 -04:00
Jehan 4d6cba0cfb app: make --show-playground visible in --help.
After Alexandre Prokoudine's insistent demand! :-)
I am still not sure how wise this is, since this should be really
considered a "developer-only" option. Basically these tools are really
too buggy and unstable and we should not shine too much light on these.
The counter-argument is that doing so will favor the bitrot.

Well ok. At least let's add a big warning message at the top of the
Playground page, to make it very clear (if that were not already the
case) that basically this is not to be considered a secret feature, but
really more a "we are looking for contributors" option.
2018-04-21 15:48:22 +02:00
Michael Natterer 8be37da012 Bug 795418 - Gimp 'critical error' when running luminosity masks script
In the gimp-channel-combine-masks PDB wrapper, only push an undo step
if the modified channel is attached to an image. It's a completely
reasonable use case to combine unattached channels.
2018-04-21 10:41:29 +02:00
Jehan 38a2887802 app, pdb: s/gimp_pdb_item_is_modifyable/gimp_pdb_item_is_modifiable/
Fix proper English.
2018-04-20 23:34:01 +02:00
Michael Natterer a1081bd595 app: fix gimp_pdb_item_is_modifyable() for channels
When a channel is position-locked, it is also implicitly
content-locked because we translate channels by modifying their
pixels.
2018-04-20 19:17:01 +02:00
Michael Natterer e4f327eca8 Bug 795385 - Segmentation fault when using gradient tool
We don't currently use GimpOperationGradient multi-threaded, but
protect cache initialization in process() with a mutex anyway in cae
we ever do.
2018-04-20 12:31:04 +02:00