Commit Graph

3245 Commits

Author SHA1 Message Date
Jehan 3ac794816a Bug 724692 - Canvas rotation stuck with specific order of actions.
Commit b279c2d217 was breaking a specific use case, which I oversaw:
when space bar activates the move tool, you may want to release the
space bar while mouse button is pressed, and expect to still be able to
move the layer/selection/guide, but releasing space was stopping the
move immediately. The move tool must only be deactivated when both space
and button 1 are released, and the move itself must continue as long as
button 1 is pressed (when started while space was pressed).

As a nice side effect of this commit, panning and canvas rotation are
also improved since now they can be continued while releasing space
(respectively shift-space) if mouse button 1 was pressed, and up until
the mouse button is released. Pressing space again, then releasing the
mouse, back and forth, also work as expected (i.e. move tool stay
activated though the move stops; and panning or rotation continue).

Of course now we don't get anymore panning/rotation stuck while neither
space nor mouse buttons are pressed (which was the original bug). At
least one of these need to stay pressed for panning/rotation/move to
stay activated. And initial activation is obviously always through
(shift-)space only.
2018-04-14 15:36:08 +02:00
Ell 5430e7794c app: various fixes in GimpToolGyroscope
Invert zoom adjustment using the mouse or the keyboard when in
inverse mode.  Take zoom factor into account when panning using the
keyboard.  Fix motion cancelation.
2018-04-11 04:53:26 -04:00
Ell 6453b371a9 app: fix status message of GimpToolGyroscope 2018-04-10 11:08:37 -04:00
Ell 634d5ae57d app: add GimpToolGyroscope
GimpToolGyroscope is a tool widget providing canvas interaction for
3D rotation.  The widget doesn't preset a UI, but rather
facilitates panning, rotation, and zoom, by dragging the canvas, or
using the keyboard.

Rotation is expressed using yaw/pitch/roll angles (performed in
this order).  A zoom factor can be specified, which affects the
magnitude of the rotation per distance traveled.  The widget can
operate in inverse mode, performing an inverse transformation.
2018-04-10 10:18:48 -04:00
luz.paz 7fdb963e01 Bug 794996 - Misc. typo fixes in comments in app/
Found via `codespell -q 3 --skip="./po*"`
2018-04-08 21:25:56 +02:00
Ell db50c72c24 app: align display paint area to a coarse grid
Align rectangles added to the display paint area, in
gimp_display_paint_area(), to a coarse grid, to reduce the
complexity of ther overall area.  This is similar to commit
49285463e6, however the alignment
happens in display space, instead of image space.
2018-04-08 09:42:47 -04:00
Ell 6ebc3f1b09 Makefiles: don't use -xobjective-c when linking files on Mac
Last commit caused -xobjective-c to be passed during linking on
Mac, causing object files to be treated as source files.  Add a
-xnone flag to AM_LDFLAGS, canceling the effect of -xobjective-c.

Additinally, add a -xobjective-c++ flag to AM_CXXFLAGS, so that we
can use Objective-C in C++ files on Mac, if we ever need to.
2018-04-08 04:03:55 -04:00
Ell 06950be7f0 Makefiles: don't use -xobjective-c when compiling C++ files on Mac
On Mac, pass -xobjective-c to the compiler through AM_CFLAGS, not
AM_CPPFLAGS, so that it's only used for C sources, and not C++
sources.  In the latter case, it clashes with the -std=... flag,
spewing an error.  Thanks, Partha :)
2018-04-07 16:57:52 -04:00
Ell bea27171ad app: throttle statusbar progress updates
Statusbar progress updates that update the progress bar are
relatively expensive, slowing down operations that report progress
frequently.  Only update the progress bar if a certain amount of
time has passed since the last update, to counter that.
2018-04-07 12:05:59 -04:00
Michael Natterer 7230d5d777 Bug 794356 - Rulers always shown for subsequent image views
Remove the connect_after() hack from GimpImageWindow again and instead
add gimp_display_shell_canvas_realize_after() and restore the configured
ruler visibility there. Should work for all cases now.
2018-04-03 22:36:17 +02:00
Michael Natterer b46b9d8921 Bug 772126 - Make GimpColorFrame handle very long numbers
Add "ellipsize" property to GimpColorFrame and set it to
PANGO_ELLIPSIZE_END in the the pointer information dockable.

Better cut off long numbers than make them expand the dock.
2018-04-03 01:47:53 +02:00
Michael Natterer ea48b9f31c Bug 794356 - Rulers always shown for subsequent image views
gimp_image_window_constructed(): connect_after to the notebook's
"switch-page" signal so gimp_display_shell_appearance_update() is
called after gimp_display_shell_canvas_realize(). Just another hack
to fix the hack...
2018-04-02 22:21:41 +02:00
Massimo Valentini 2aa4426d4f app: improvements in code executed a lot while painting.
This keeps the same rectangle packing behaviour, so to behave exactly as
before for what concerns batching the updates, but should be lighter
when looping to find the first good rectangle to use.

In rtree_insert(), some conditions in the if tests are implied by
previous conditions. And therefore the 2 successive for loops are
actually identical.

In rtree_node_insert(), it is wrong/harmful to insert zero sized
rectangles in the tree because they can never be selected and just make
the list longer. So rtree_node_create() should just return NULL when w
or h are 0.

See bug 694917, comments 51 to 61.
2018-03-31 00:18:46 +02:00
Michael Natterer 69d5201d59 app: fix formatting in previous commit 2018-03-28 00:44:33 +02:00
Øyvind Kolås a7b0d55fc5 app: only create GeglBuffer wrapper for cairo-data when used
As suggested by massimo in bug #694917, move unconditional creation/destruction
of a wrapper GeglBuffer object from top-level scope of the function to the
single conditional scope where it is used.
2018-03-28 00:37:06 +02:00
Zhouyang a6fd24a953 Bug 793951 - Fix crashes when some external APIs fail
Check the return values of some functions and set errors or print
a message to stderr if they fail.
2018-03-26 21:27:42 +02:00
Michael Natterer 9a365eaf8b Bug 794378 - GIMP crashed while I was moving the image window
Use a weak pointer in GimpToolGui to not keep a dangling
private->viewable around.
2018-03-20 19:02:43 +01:00
Jehan 8aaf77ba11 app: return from gimp_display_shell_space_pressed() immediately when...
... scrolling in progress.
In particular, this could happen while panning with mouse middle click
and hitting space. This space should simply be ignored.
2018-03-16 19:52:16 +01:00
Jehan b279c2d217 Bug 724692 - Canvas rotation stuck with specific order of actions.
The bug was affecting actually both canvas rotation and panning when
done with space key. If the first mouse button was also clicked, then
released after the space key, we ended up in some stuck action. It could
only be unstuck by hitting/releasing space again.

I am actually unsure that this was not originally done on purpose,
especially since the code has these 2 status variables space_pressed and
space_release_pending, but really apart from looking at this code, the
behavior just looks very buggy and impracticable.
The new behavior is to just stop the canvas panning/rotation as soon as
space is released (which is also how it is documented in our manual, and
how everyone seems to use the feature). I only kept the variable
space_release_pending, which I use as was used space_pressed before.
2018-03-16 14:23:41 +01:00
Ell dc1852049e app: throttle GimpCanvasProgress updates
Avoid redrawing GimpCanvasProgress items upon
GimpProgress::set_value() if a minimal amount of time hasn't passed
since the last call.  This notably improves performance of
frequently-updated GimpCanvasProgress items.
2018-03-16 04:34:00 -04:00
Ell 1cc90e52bb app: fix indentation in gimpcanvasprogress.c 2018-03-16 04:34:00 -04:00
Ell efa8040780 app: rename gimp_cairo_foo() functions to follow cairo naming scheme
Really pedantic stuff :)  Rename the functions in gimp-cairo.h to
follow the naming scheme employed by cairo, so that they don't feel
out of place.
2018-03-07 06:18:20 -05:00
Ell 4a0cc01dfa Bug 793539 - Gimp stops each time you close a picture
Don't choke when calling gimp_tool_rectangle_set_constraint() while
there's no active image, or while the active image has no active
layer, which can happen when updating the default aspect ratio of
the crop tool.  This would previously result in CRITICALs.

Additionally, use weak pointers for the crop tool's current_image
and current_layer members, to avoid potential dangling pointers.
While not currently necessary, this makes the code less dependent
on the exact order of events.
2018-02-18 09:41:14 -05:00
Jehan 77ed476113 app: add GIMP_MESSAGE_BUG_WARNING + GIMP_MESSAGE_BUG_CRITICAL severity.
Since a few commits, I don't generate the traces anymore in errors.c but
delay this to gui-message.c and rely on the message severity to decide
whether or not generating traces.
Unfortunately none of the current severities are properly describing
this new type of messages. Even GIMP_MESSAGE_ERROR is used everywhere in
our code NOT for actual programming bug, but often for data errors
(which are not bugs but proper messages and should obviously not prompt
a debug trace).
2018-02-12 18:22:15 +01:00
Michael Natterer 539927ebfa app: replace all g_assert() by the newly added gimp_assert()
which is just a #define to g_assert for now, but can now easily be
turned into something that does some nicer debugging using our new
stack trace infrastructure. This commit also reverts all constructed()
functions to use assert again.
2018-02-11 22:23:10 +01:00
Ell 534e5971fc app: don't set properties of invisible handles in GimpToolTransformGrid
This avoids warnings when the handle positions the handle-transform
tool result in a matrix that transforms the TransformGrid's handles
(which are all invisible) to coordinates that are outside of the
corresponding properties' range.
2018-02-04 14:45:24 -05:00
Ell 275815c808 app: misc cleanup in gimpcoords-interpolate
Fix indentation, typos, style.  Use array parameters for the
control points, instead of using individual by-value parameters.
Use GArray* for the results, instead of GArray**.  Verify
arguments.

Adapt the rest of the code to the changes.
2018-02-03 05:58:42 -05:00
Ell 1cae93ac42 app: use gimp_transform_polygon() in GimpCanvasPolygon
... so that clipping is done properly.
2018-02-03 05:58:41 -05:00
Ell 5f58a7a260 app: pass near-plane z-coordinate to gegl:transform
... so that GEGL performs the same clipping we do.
2018-01-28 16:37:34 -05:00
Ell 258e60f1b7 app: use gimp_transform_polygon() in GimpCanvasBoundary
... so that clipping is done properly.
2018-01-28 16:37:34 -05:00
Ell 4626190ac7 app: use gimp_transform_polygon() in GimpCanvasTransformGuides
Add a "clip" property to GimpCavnasTransformGuides.  When set, use
gimp_transform_polygon() for transforming the guides and the
bounding box, so that they're properly clipped.

Add a corresponding "clip-guides" property to
GimpToolTransformGrid, and set it to TRUE in GimpToolHandleGrid, so
that the handle-transform tool's guides are clipped properly.
2018-01-28 16:37:34 -05:00
Ell 9900573345 app: use gimp_transform_polygon() in GimpCanvasTransformPreview
... so that clipping is done properly.
2018-01-28 16:37:34 -05:00
Michael Natterer 5da3bdb4ea app: fix GimpToolCompass for one perfectly vertical line
the angle arc and the small helper line were displayed on opposite
sides of the first point. Now they are on the same side, just like for
all other angles.
2018-01-28 15:24:29 +01:00
Ell 0334595cc1 app: port GimpHandleGrid from gimp_transform_matrix_handles() to ...
... gimp_transform_matrix_generic()

Replace the separate x/y coordinate arrays of GimpHandleGrid with
GimpVector2 arrays, and use gimp_transform_matrix_generic(),
instead of gimp_transform_matrix_handles(), when calculating the
matrix.  When the resulting matrix is invalid, hide the guides.
2018-01-27 07:30:29 -05:00
Ell 6a64f09681 app: add show-guides property to GimpToolTransformGrid
... which can be used to control the guides' visibility.

Will be used by the next commit, to hide the guides in
GimpToolHandleGrid when the tranformation is invalid.
2018-01-27 07:30:29 -05:00
Ell 5cd0ecc998 app: fix rotation pivot of GimpCanvasHandle
This fixes the erratic 1-pixel movement of transform-grid handles.
2018-01-27 07:30:28 -05:00
Jehan 8120694759 app: add include to fix a warning.
The build warning was:
> warning: implicit declaration of function ‘memcmp’ [-Wimplicit-function-declaration]
2018-01-21 17:31:57 +01:00
Michael Natterer a8bc8d202c Bug 784480 - Clicking on-canvas GUI with a tablet stylus crashes...
...if "Show rulers" is disabled

Add HACK to gimp_display_shell_canvas_realize() that makes sure the
rulers are always mapped once for each new GimpDisplayShell. This
seems to magically fix all the crashes.
2018-01-16 21:48:48 +01:00
Michael Natterer 3568f1cb3b app: reorder a line in gimp_display_shell_constructed()
just for consistency, no logic is changed.
2018-01-16 21:35:36 +01:00
Ell 7f56393138 app: use GEGL for transform-tools preview
Before you get too exceited -- no, this commit doesn't integrate
transform previews into the image graph :)  We still use a
separate canvas-item overlay, just like before, but instead of
using an impromptu implementation to render the preview, we use
gegl:transform.  We properly adjust the matrix passed to the op
according to the display scale, so that we still render only as
much as needed.

This is both notably faster than the current code, and, for
perspective transforms, more accurate.
2018-01-15 14:58:23 -05:00
N Ferreira 3f7afd5494 Bug 792439 - Status bar: Rotated angle is too close to zoom arrow. 2018-01-12 01:50:51 +01:00
Jehan 21cb905dad Revert "app: use FAST filter when painting xfer surface"
This reverts commit 36258a671a.
This commit was making the rotated canvas rendering quite horrible to
the point that I think it would make the canvas rotation feature barely
usable. See bug 759287, comments 13 to 18.
I think we will need to find other ways to accelerate rendering.
Compromise on quality is possible, but I think that in this case, this
was more than just a compromise. It was more like completely abandonning
quality. We could even see the lines "spiking" while you were rotating!
Like your drawing was alive!
2018-01-10 03:52:54 +01:00
Ell b95bb99e05 app: in compress_motion(), remove accidentally added "break", fix comment 2018-01-04 08:48:11 -05:00
Ell d3b45f1875 Bug 791689 - On-Canvas GUI broken with extended input device
Improve the disabling/enabling of extended input events for the
canvas during enter/leave-notify events, in particular, so that
enter-notify events that are a result of pointer ungrabbing don't
erroneously reeanble extended input events.
2018-01-04 06:11:38 -05:00
Ell fa18044392 Bug 791689 - On-Canvas GUI broken with extended input device
Something about the unqueueing and requeueing of the entire event
queue during motion compression fries GTK's brain w.r.t. extended
input events.  Instead, have gimp_display_shell_compress_motion()
return the first non-compressed event to the caller, making it
responsible for dispatching it after handling the motion event.
2018-01-04 06:11:37 -05:00
Massimo Valentini 423ce6fca3 Bug 770689 - Custom transparency controller for dark...
...outside area of Crop Tool -> Highlight option

Add "highlight-opacity" property and turn the controlling GUI into an
expanding toggle that reveals an opacity slider.
2018-01-02 14:33:27 +01:00
Ell 37a6620006 app: don't upscale preallocated display buffers by GIMP_DISPLAY_RENDER_MAX_SCALE
After commit 8029508fbe, we always
render the image in chunks that are at most
GIMP_DISPLAY_RENDER_BUF_WIDTH x GIMP_DISPLAY_RENDER_BUF_HEIGHT,
even when the window's scale factor is > 1.
2017-12-31 11:57:22 -05:00
Ell 09e1c7f9b5 app: fix mask overlay position when zoom != 100%
... and the mask offset != (0, 0)

Thanks tmanni!
2017-12-31 11:57:22 -05:00
Ell eded91e118 Bug 753412 - New Canvas rotation feature rotates brush.
Replace the "lock brush size to zoom" paint option with a "lock
brush to view" option, which links the entire brush transform to
the view transform, so that the brush remains invariant in display
space under scaling, rotation, and reflection.
2017-12-22 17:52:29 -05:00
Jehan 5f00c189e6 app: also show line info (distance, angle) when moving an endpoint.
When you move an endpoint in the Blend Tool, angle and distance
information are especially important, in case you want to draw a
gradient with specific values.
2017-12-22 23:41:40 +01:00
Jehan e1621c32d3 app: use gimp_display_shell_get_line_status() for GimpToolLine.
Currently Blend tool only shows the vector coordinates whose usefulness
is a bit of a question. Now it will also show distance (in current shell
unit) and angle!
2017-12-22 23:24:24 +01:00
Jehan 0116d7316a app: new gimp_display_shell_get_line_status().
Factorize the code to show status for tools needing to show line
information.
2017-12-22 23:24:24 +01:00
Ell fff57f84a0 app: add gimpdisplayshell-utils.[ch]
... should have been part of last commit.
2017-12-22 06:59:21 -05:00
Ell 984ed6cefd app: constrain line angles in display space, not image space
Add an offset_angle parameter to gimp_constrain_line(), which
offsets the radial lines by a given angle.

Add gimpdisplayshell-utils.[ch], with two new functions:

  - gimp_display_shell_get_constrained_line_offset_angle():
    Returns the offset angle to be passed to
    gimp_constrain_line(), in order to constrain line angles in
    display space, according to the shell's rotation angle and
    flip mode.

  - gimp_display_shell_constrain_line():  A convenience function
    which calls gimp_constrain_line() with the said offset angle.

Use the new functions in all instances where we constrain line
angles, so that angles are constrained in display space, rather
than image space.

The only exception is GimpEditSelectionTool, which keeps
constraining angles in image space, since it's not entirely obvious
that we want to constrain angles of dragged layers/selections in
display space.
2017-12-22 06:32:24 -05:00
Ell 2315784110 Bug 791741 - Transparent rectangles when image is drawn
Add gimp_display_shell_[un]transform_with_scale(), which are
similar to gimp_display_shell_[un]transform(), however, they
transform the bounding box to/from uniformly-scaled image space,
given the scale factor as a parameter.  These functions are more
accurate than using gimp_display_shell_[un]transform() and applying
the scaling separately, in particular, when the scale matches the
(horizontal or vertical) display scale.

Use these functions in gimp_display_shell_draw_image(), to avoid an
off-by-one error when transforming screen-space chunks to image-
space chunks, which leads to the symptoms described in the bug.

Fix another potential off-by-one error affecting non-uniformly
scaled images, and window scale factors other than 1.
2017-12-19 15:04:51 -05:00
Ell 36258a671a app: use FAST filter when painting xfer surface
Use CAIRO_FILTER_FAST when painting the xfer surface to the
screen.  This notably improves performance when the canvas is
rotated, at the cost of lower filtering quality.
2017-12-09 10:41:16 -05:00
Ell 6d19e9e860 app: another off-by-one chunking fix 2017-12-09 10:41:16 -05:00
Ell 709c929d4f app: fix off-by-one error in last commit 2017-12-09 05:30:02 -05:00
Ell 8029508fbe Bug 759287 - Canvas Tearing While in Rotated Canvas View
Based on a patch by Massimo.

Move the entire image-space/screen-space transformation logic from
gimp_display_shell_render() to gimp_display_shell_draw_image(), so
that the former works entirely in image space, and do the chunking
and clipping in screen-space, making sure that image-space chunks
are never larger than
GIMP_DISPLAY_RENDER_BUF_WIDTH x GIMP_DISPLAY_RENDER_BUF_HEIGHT,
even when the window's scale factor is greater than 1.

Add a GIMP_BRICK_WALL environment variable, which, when set, shows
the screen-space chunk bounds.
2017-12-09 05:01:30 -05:00
Michael Natterer d60c237805 Bug 785781 - Additional Free Selection step (hitting Enter)...
...is a regression in common cases

Commit the free select tool on double click inside the polygon.

Done by implementing GimpCanvasItem::hit() in GimpCanvasPolygon, using
ugly code.
2017-12-01 22:19:42 +01:00
Ell f7d6805ebb */Makefile.am: add abbreviations to generated enum files
Update the dprod production of generated enum files to include
abbreviated value descriptions, as per the previous commits.

Add a comment for translators above the abbreviated descriptions,
specifying the full description they abbreviate.
2017-11-30 03:10:14 -05:00
Jehan 80b04d06da Bug 789173 - Make canvas rotation information visible on the main window
Now add also flip information in the status bar so that one knows that
the canvas is flipped horizontally and/or vertically. Especially if you
often flip and rotate the canvas (or if you did it by mistake), at some
point, it may become confusing to remember whether this is the case. Now
it will be possible to check in a single glimpse at the status bar.
Similarly to what I previously did for the rotation information, hitting
the flip icons in status will allow to unflip easily without having to
go in menus or remember all shortcuts.
These information will be visible only when the canvas is flipped or
rotated.
2017-11-15 20:04:19 +01:00
Jehan 953a095563 Bug 789173 - Make canvas rotation information visible on the main window
The rotation angle is made visible in the status bar.
Clicking the angle label also opens the "Select Rotation Angle" dialog.
2017-11-15 20:02:54 +01:00
Ell 5d91657747 app: indentation fix to last commit 2017-11-14 11:34:32 -05:00
Ell 2e9ab59d19 app: use matrix to determine if doing perspective transform in preview
In GimpCanvasTransformPreview, use the transform matrix to
determine if we're doing a perspective transform, rather than
relying on a separate property, so that we don't use the slow
perspective path unnecessarily.

Consequently, remove the does_perspective member of
GimpTransformTool, since it's no longer used.
2017-11-14 11:24:56 -05:00
Jehan 788e04bddb app: GimpScaleComboBox resized appropriately with its contents.
Rather than having an oversized entry all the time, adapt it to the
visible zoom.
2017-11-14 05:08:02 +01:00
Jehan 864e3df7a9 app: fix comment typos. 2017-11-14 04:45:13 +01:00
Ell d591bf51f0 app: clear display filter stack when emptying a display 2017-11-12 12:11:30 -05:00
Ell 6ffa17bd33 app: avoid unnecessary work when all display filters are disabled
Return FALSE from gimp_display_shell_has_filter() when there are
filters, but they're all disabled, to avoid unnecessary extra
color conversions during rendering.
2017-11-05 09:03:04 -05:00
Ell 9cd8e7f9c6 app: apply display filters in sRGB, not monitor profile
When we have display filters, break the color profile transform in
two: first, convert from the image profile to sRGB, then apply the
filters, then convert from sRGB to the monitor profile.
2017-11-03 04:24:49 -04:00
Ell 5a726a028e app: use a propgui for display filters that return a NULL config widget
When a display filter's configure() function returns NULL, use a
propgui for the filter, instead of not showing a widget at all, to
spare filters the need to manually construct a configuration gui.
2017-11-02 16:12:33 -04:00
Ell a5a2b56850 app: use actual render area when processing display filters
When processing display filters, shift the filter buffer to the
top-left corner of the render area, and pass the actual render
area, instead of an area whose top-left coords are (0, 0), to the
display filter.  This allows for position-dependent display
filters.
2017-11-02 16:12:33 -04:00
Michael Natterer a5e1dd84fd app: implement GimpToolActiveModifiers in GimpTool
Change gimp_tool_set_active_modifier_state() to honor the new
GimpToolControlSetting. Explicitly set the mode to SEPARATE in
all tools that require modifier keys during a stroke.

And here comes the actual fix: change GimpTransformTool and
GimpToolTransformGrid to use SAME mode, and remove their
active_modifer_key() and hover_modifier() impls, so it makes no
difference whether a modifier is pressed before of after mouse button
press/release.
2017-10-29 16:42:53 +01:00
Ell b2bc33bdf1 app: blink the statusbar on warnings and errors
Statusbar messages are too easy to miss.  Blink the statusbar when
showing a warning or an error, to attract attention.
2017-10-28 10:08:10 -04:00
Ell c5b88702e6 app: allow specifying a callback function for propgui pickers
Allow propgui constructors to specify an (optional) callback function
when creating pickers, to be called when a color/coordinate is picked,
similarly to controller callbacks.

Implement picker callback support in GimpFilterTool.  When the active
picker has an associated callback function, call it instead of the
class's color_picked() function.

Add lots of "#include <gegl.h>" to .c files that miss it, which is
now necessary, since this commit adds a Babl* parameter in
propgui-types.h.
2017-10-16 12:38:37 -04:00
Ell 507bc43716 app: improve status messages of GimpToolLine
... to cover all the new stuff.
2017-10-09 12:48:50 -04:00
Ell dad521e334 app: add misc. parameters to GimpControllerSlider
Add parameters, controlling the behavior and appearance of sliders,
to GimpControllerSlider.  The macro GIMP_CONTROLLER_SLIDER_DEFAULT
expands to a nonmodifiable lvalue of type GimpControllerSlider,
whose members are initialized with the most common default values.

Handle the new parameters in GimpToolLine.  A slider using the new
"autohide" mode is only visible when selected, or when the cursor
is close enough to the line, between the slider's min and max
values, and no other handle is grabbed or hovered-over.
2017-10-09 12:48:50 -04:00
Ell 9e26d7ea5f app: add handle-clicked signal to GimpToolLine
... which is emitted when a handle is single/double/tripple clicked.

The signal handler returns a boolean value.  A return value of TRUE
stops further event processing, while a return value of FALSE allows
it.
2017-10-09 12:48:50 -04:00
Ell 50acb6690d app: add prepare-to-remove-slider signal to GimpToolLine
The signal is emitted when a slider is dragged away from the line,
and will be removed when the button is released, and when the
slider is dragged back to the vicinity of the line, and won't be
removed.  The last parameter of the signal is a boolean flag
differentiating between the two cases.

Note that a remove-slider signal may be emitted without a preceeding
prepare-to-remove-slider signal, however, is a prepare-to-remove-
slider signal is emitted with a TRUE last parameter, it must be
eventually followed by a remove-slider signal, or by another
prepare-to-remove-slider signal with a FALSE last parameter.
2017-10-09 12:48:49 -04:00
Ell bac7dac4ba app: allow adding and removing sliders to/from a GimpToolLine
Add support for adding and removing sliders to/from a GimpToolLine,
using three new signals:

  - can-add-slider:  Takes a double argument in the range [0,1],
    indicating a location along the line, and returns a boolean
    value, indicating whether a slider can be added at that
    location.

  - add-slider:  Takes a double argument in the range [0,1],
    indicating a location along the line, for which can-add-slider
    returned TRUE.  In response, should add a new slider at that
    location, and return its index, or a negative value if no
    slider was added.

  - remove-slider:  Takes a slider index.  In response, may remove
    the slider.

On the UI side, when the cursor is close enough to the line, but
not within the hit area of an existing handle, GimpToolLine checks
if a slider can be added at the cursor position, using can-add-
slider.  If a slider can be added, a dashed circle appears at the
cursor position along the line, indicating where a slider will be
added.  The cursor is added by clicking, which emits an add-slider
signal; if the signal returns a slider index, the new slider is
selected, and can be subsequently dragged.

Removing a slider is done by either selecting the slider and
pressing backspace (or delete, although we don't actually forward
it to the tool atm,) or by "tearing" the slider: when dragging
the slider, if the cursor is far enough from the liner, a dashed
circle appears around the slider, and releasing the mouse removes
the slider.
2017-10-09 12:48:49 -04:00
Ell 86954037de app: add dashed canvas handle types
Add DASHED variants for GIMP_HANDLE_{SQUARE,CIRCLE,DIAMOND}.
2017-10-09 12:48:49 -04:00
Ell 63ccbc4fb0 app: add keyboard control to GimpToolLine
Add support for moving the selected handle using the arrow keys,
with the same modifiers as GimpToolPath.
2017-10-09 12:48:49 -04:00
Ell d4cb1623ea app: add persistent handle selection to GimpToolLine
En route to on-canvas gradient editing, add support for persistent
handle selection to GimpToolLine (a handle being either an endpoint
or a slider).  Handles are selected through clicking, however,
unlike before, the selection persists after the mouse is released.
A new "selection" property specifies the currently-selected handle
(who knows, maybe in the future we'll add multi-selection), and a
new "selection-changed" signal is emitted when the selection changes.

The visual feedback has been changed to better suit the new behavior,
and the behaviors yet to be added:  The selected handle is marked
using highlighting; the highlighting doesn't change while hovering
over other handles.  Only the hit-test circle is used as hover
indication, however, we use a fixed-size circle, and only show the
circle for the currently hovered-over handle -- no more trippy
expanding circles :)

A few minor changes along the way:

  - The selected handle is now the (first) one that's closest to the
    cursor, instead of the first one to pass hit-testing.

  - We don't move the selectd handle upon button-press, only upon
    motion, so that handles can be selected without moving them.

  - Show a MOVE cursor modifier when hovering over a handle.
2017-10-09 12:48:49 -04:00
Ell 042650e18c app: rename slider-value variables in GimpToolLine
Rename the "t" variables, representing slider values, to "value".
2017-10-09 12:48:49 -04:00
Ell fb31a592c6 app: add gimp_tool_line_get_slider()
... and use it instead of using g_array_index() on the slider array
directly.
2017-10-09 12:48:48 -04:00
Michael Natterer a7620b08aa Bug 788399 - Corrupted display of sample points
In gimp_canvas_sample_point_get_extents(), use the drawn number's
actual size instead of some random constant that was good enough for
my own font size.
2017-10-01 19:39:56 +02:00
Ell 0d9a85a207 Bug 784643 - Crash when using transform tools
Fix buffer overflow in gimp_tool_transform_grid_get_cursor().
2017-09-11 15:09:35 -04:00
Ell 1773cd91a2 app: in GimpCursorView, move cursor info update to an idle function
Updating the cursor information involves sampling the active image/
drawable, which can be expensive, especially if there are filters
active that also respond to cursor motion, e.g., while using the
warp tool.

Move the actual updating to an idle function.  This dramatically
improves responsiveness in these situations.
2017-09-08 11:23:06 -04:00
Ell 58fdaae3ad enums: add intermediate generated enum files to .gitignore 2017-08-24 15:35:27 -04:00
Michael Natterer e16c8a2352 Move the new "default_new_layer_mode" APIs to the image...
...in both the core and libgimp.

Images now know what the default mode for new layers is:

- NORMAL for empty images
- NORMAL for images with any non-legacy layer
- NORMAL_LEGAVY for images with only legacy layers

This changes behavior when layers are created from the UI, but *also*
when created by plug-ins (yes there is a compat issue here):

- Most (all?) single-layer file importers now create NORMAL layers
- Screenshot, Webpage etc also create NORMAL layers

Scripts that create images from scratch (logos etc) should not be
affected because they usually have NORMAL_LEGACY hardcoded.

3rd party plug-ins and scripts will also behave old-style unless they
get ported to gimp_image_get_default_new_layer_mode().
2017-08-21 20:18:00 +02:00
Michael Natterer 7ce77c47cc app: stop hardcoding NORMAL_LEGACY for new layers/images
Use GimpCoreConfig::default-new-layer-mode instead.
2017-08-20 15:02:46 +02:00
Michael Natterer 58a68f5e98 app: add a missing case to a switch in GimpToolRectangle
The case's code was there but unreachable. This fix probably makes no
difference, but it was broken.
2017-08-19 20:05:00 +02:00
Ell 1c68617302 app: use {begin,end}_render() and GimpTileHandlerProjectable ...
... in GimpProjection and gimp_display_shell_render() (the latter
is not really necessary, but whatever.)
2017-08-08 15:39:27 -04:00
Ell 2d11d29157 app: improve GimpToolLine slider motion clamping/constraint
During constrained motion, round the slider value before clamping
it, so that the slider limits are always enforced.  Additionally,
snap the slider to 1/12-ths of the line length, rather than
1/24-ths.

Make sure that sliders can never have negative-zero values, which
can result in a -inf base for spiral.
2017-07-30 14:03:03 -04:00
Michael Natterer d227a0d71f app: disable gimp_display_shell_profile_update() debug output 2017-07-28 22:34:41 +02:00
Michael Natterer 4208aceafe app: make GimpToolTransformGrid handle modifiers itself
and update the grid as soon as a constraint is changed, not only on
the next motion. Change GimpTransformTool to forward the events to the
widget if it exists, but still handle them if it doesn't (yes this
code duplication is ugly, but the widget can hardly handle events if
it doesn't exist...).
2017-07-15 19:34:08 +02:00
Michael Natterer 0cb3e75f79 app: use a lot of g_clear_object() and g_clear_pointer()
More than 2000 lines of code less in app/, instead of

if (instance->member)
  {
    g_object_unref/g_free/g_whatever (instance->member);
    instance->member = NULL;
  }

we now simply use

g_clear_object/pointer (&instance->member);
2017-07-15 18:42:44 +02:00
Michael Natterer afb9941c80 app: allow to close a GimpToolPolygon without committing it
so we can edit a complete shape, and reopen it to continue editing,
instead of immediately selecting when the first point is clicked.
2017-07-09 19:26:19 +02:00
Michael Natterer 23ae146d95 Bug 777485 - Move unified transform tool shear handles to places...
...corresponding to the spec
2017-07-08 18:21:33 +02:00
Michael Natterer 16cfcf1bde app: remove some #if 0'ed code from GimpToolPolygon 2017-07-06 12:32:36 +02:00
Michael Natterer e21be2f3d9 app: rename GimpToolInfo's "blurb" and "help" members
to "label" and "tooltip". More standard names, less confusion.
2017-07-04 21:58:11 +02:00
Ell bfb51b0782 app: don't compute slider values for 0-length lines while dragging
... to avoid getting NaNs.
2017-07-04 10:43:01 -04:00
Ell 04b407a019 app: s/slider_count/n_sliders/ in GimpToolLine and firends
Yep yep yep.
2017-07-03 18:10:30 -04:00
Ell 60586a8817 app: add sliders to GimpToolLine; add slider-line controller
Add supprt for placing sliders on a GimpToolLine -- handles that can
be dragged over the line.  The sliders are accesible through a new
"sliders" property, and via the gimp_tool_line_{get,set}_sliders()
functions.

Add a slider-line controller, which works like a line controller,
but whose callback also supplies/takes an array of sliders.

Note that the data type for individual sliders is called
GimpControllerSlider (in particular, it's not line specific), so
that we may use it with other controller/tool-widget types in the
future.
2017-07-03 15:10:47 -04:00
Michael Natterer e8ee5475b7 app: move all propgui files from app/widgets/ to new folder app/propgui/
We are getting more and app/widgets/ is already too large.
2017-07-03 12:29:41 +02:00
Michael Natterer 2da59e7ba3 app: add a "status-title" string property to GimpToolLine
which defaults to "Line: ". Set it to "Blend: " in the blend tool.
2017-07-03 01:02:23 +02:00
Piotr Drąg ddee27f6d4 Fix typos in translatable strings 2017-07-02 17:47:08 +02:00
Michael Natterer e8c6382302 app: re-enable GimpRectangleTool's "suppress_updates" keyboard moving hack
so a handle can be moved with the cursor keys even if it moves away
from under the mouse pointer.
2017-06-29 22:02:48 +02:00
Michael Natterer 56d87724a3 app: don't base GimpToolRectangle's new "is_first" on rectangle extents
they also get set externally so are broken to use. Instead, simply set
"is_first" to TRUE in init() and to FALSE in button_release().
2017-06-29 20:48:41 +02:00
Michael Natterer 2aff5b0a5a app: add new string property "status-title" to GimpToolRectangle
and use it for the statusbar message instead of just always "Rectangle: ".
2017-06-29 20:37:17 +02:00
Michael Natterer c9abe09440 app: improve GimpToolRectangle's statusbar messages 2017-06-29 20:21:02 +02:00
Michael Natterer 9dc6d4f515 app: improve button release behavior or GimpToolRectangle a lot
- introduce new state "boolean is_first" which tracks if the currently
  drawn rectangle is the first with this instance
- cancel the widget if there was no movement when creating the first
  rectangle
- undo to the previous rectangle if the user created a zero-extent
  rectangle
- also undo to the previous rectangle if a newly drawn rectangle is
  canceled with button-3 release
2017-06-29 20:01:08 +02:00
Michael Natterer 5c8c30112a app: treat a NO_MOTION release like NORMAL one in GimpToolRectangle
which stops unexpected behavior that was there even before the new
code (like a rectangle without a selection).
2017-06-29 16:48:02 +02:00
Michael Natterer e7964e499c app: we were leaking a reference in gimp_tool_rectangle_button_release()
because of bailing out early after emitting "response". Instead, don't
ref the object around this function, and move the "response" emission
to the end of the function.
2017-06-29 15:04:13 +02:00
Michael Natterer a562860eed app: add boolean property "force-narrow-mode" to GimpToolRectangle
which allows to force outside handles without resorting to hacks.
2017-06-28 14:23:51 +02:00
Michael Natterer 719f96d89a app: fix gimp_tool_rectangle_frame_item()
it was setting double properties from integers, boom.
2017-06-28 14:13:10 +02:00
Michael Natterer 94bb1a78c1 app: some cleanup and fixes in GimpToolRectangle
- unset "rect_adjusting" before bailing out on button_release()
- update the integer rectangle when the double properties change
- don't try to show handles with a size of < 3
- remove unused members
- shorten some variable names
2017-06-27 17:46:47 +02:00
Michael Natterer 8a1d782b42 app: add optional round corners to GimpToolRectangle 2017-06-27 14:19:18 +02:00
Michael Natterer 75871cfa64 app: add the options to draw an ellipse within GimpToolRectangle 2017-06-27 00:46:55 +02:00
Michael Natterer 9d042e4de9 app: add gimp_canvas_arc_set() 2017-06-27 00:46:24 +02:00
Michael Natterer c07a5f0a61 app: add gimp_tool_widget_add_arc() 2017-06-27 00:45:45 +02:00
Michael Natterer 3a0aab71b6 app: gimp_tool_widget_get_cursor(): rename "cursor_modifier" to just "modifier"
The same in all subclasses.
2017-06-26 22:13:00 +02:00
Michael Natterer a3acb7422d app: move status message setting from GimpBlendTool to GimpToolLine 2017-06-26 21:48:43 +02:00
Michael Natterer 068f850c03 app: dispatch to the right vfunc in gimp_tool_widget_hover_modifier()
it was copy-paste dispatching to motion_modifier().
2017-06-26 21:39:51 +02:00
Michael Natterer be63a4a836 app: add new GimpToolWidget subclass GimpToolRectangle
which is a replacement for GimpRectangleTool. It's a massive piece of
code and I'm not sure everyting works as it should, but it seems to do
crop stuff without any glitches.
2017-06-26 19:19:16 +02:00
Michael Natterer 1ebf905ed3 app: change gimp_tool_widget_add_corner() to take x, y, width, height
instead of x1, y1, x2, y2.
2017-06-26 19:19:16 +02:00
Michael Natterer 00ea73f29a app: add a generic GimpToolWidget::response() signal
and a default key_press() handler that emits CONFIRM, CANCEL and RESET
responses. Remove code with the same purpose from all subclasses.

Change tools feed key_press() to the widget and connect to its
"response" instead of implementing key_press() themselves. This will
only be better and less code after the tool side of this is done
generically.
2017-06-25 23:23:27 +02:00
Michael Natterer d27359cca2 app: add gimp_tool_widget_add_rectangle(), _rectangle_guides(), _corner() 2017-06-25 21:07:24 +02:00
Michael Natterer 84e1f757ce app: store the snap offsets in GimpToolWidget
Rename gimp_tool_widget_snap_offsets() to set_snap_offsets(),
and add gimp_tool_widget_get_snap_offsets().

Also rename gimp_tool_widget_status() to set_status(), and
add new function and signal set_status_coords().
2017-06-24 21:09:18 +02:00
Michael Natterer d089aa629b app: rename enum GimpRectangleToolFixedRule to GimpRectangleFixedRule 2017-06-24 19:48:09 +02:00
Michael Natterer 6e2e8a6f08 app: move the rectangle tool enums from tools-enums to display-enums 2017-06-24 19:48:09 +02:00
Michael Natterer 9c3a2b5021 app: add gimp_canvas_corner_set() which sets everything except the anchor 2017-06-24 19:48:09 +02:00
Michael Natterer 2192f520da app: add new GimpToolWidget subclass GimpToolPolygon
which is the free select curve.
2017-06-23 01:57:21 +02:00
Michael Natterer 9e2a3c7aee app: add gimp_tool_widget_add_polygon() and add_polygon_from_coords() 2017-06-23 01:44:56 +02:00
Michael Natterer 9d8f94375e app: add gimp_canvas_polygon_set_points()
and allow NULL points in both this function and new().
2017-06-23 01:40:35 +02:00
Michael Natterer 3ab92c7290 app: add GimpToolWidget subclass GimpToolPath, a complete vectors editor 2017-06-21 23:27:20 +02:00
Michael Natterer c4d5693903 app: add various handle and vectors hit tests to gimpcanvasitems-utils.[ch]
1:1 copies of the same functions in gimpdrawtool.[ch].
2017-06-21 23:21:26 +02:00
Michael Natterer 1aca558867 app: forgot to #include "gimptoolpath.h" in gimptoolwidget.c 2017-06-21 02:16:11 +02:00
Michael Natterer 82e2fa2e5e app: add gimp_tool_widget_add_path(), not used yet 2017-06-21 00:32:14 +02:00
Michael Natterer 91deb61475 app: add virtual functions GimpToolWidget::key_press() and ::key_release()
and api to call them. Not used anywhere yet.
2017-06-20 23:01:18 +02:00
Michael Natterer d2bfbfb748 app: some more cleanup in GimpToolLine
it was already working perfectly, but it's so simple I'd like to make
it "perfect" as a GimpToolWidget implementation example.
2017-06-20 19:07:24 +02:00
Michael Natterer 625ec4b773 app: add utility function gimp_canvas_handle_calc_size()
which is the code that calculates handle size based on pointer
proximity. Use the new function in GimpToolHandleGrid and
GimpToolLine, and clean up some stuff in GimpToolLine.
2017-06-20 01:02:23 +02:00
Michael Natterer 6560e3895b app: clear GimpToolTransformGrid's status when we leave proximity 2017-06-20 00:23:25 +02:00
Michael Natterer 77d516b588 app: another copy/paste error broke moving in GimpToolHandleGrid 2017-06-19 23:45:35 +02:00
Michael Natterer 055ca325f2 app: manage the preview opacity with an object binding too 2017-06-19 23:39:37 +02:00
Michael Natterer 0411801765 app: manage the transform tools' grid properties in GimpTransformTool
Simply use g_object_bind_property() to connect the grid properties of
GimpTransformOoptions and GimpToolTransformGrid and remove all other
grid property setting code.
2017-06-19 23:06:39 +02:00
Michael Natterer 96da8c1505 app: add status message to the handle transform tool
and fix a few glitches from tool widget porting.
2017-06-19 22:53:30 +02:00
Michael Natterer 546bbe1e14 app: add a transform matrix to GimpCanvasPolygon and all API using it 2017-06-19 21:53:49 +02:00
Michael Natterer 3ddfd107b9 app: add some newlines in gimpcanvasboundary.c 2017-06-19 21:53:20 +02:00
Michael Natterer b1dddcdc8f app: add #defines of standard handle sizes to gimpcanvashandle.h
The same values as in gimpdrawtool.h, tool widgets in display/ must
not include the draw tool header from tools/.
2017-06-19 10:46:05 +02:00
Michael Natterer 3b21c08b41 app: add proximity-sensitive handles to the handle transform tool
as known from the blend tool.
2017-06-19 08:02:12 +02:00
Michael Natterer 6bd316e070 app: add new GimpToolTransformGrid subclass GimpToolHandleGrid
which implents the handle transform tool's interaction.
2017-06-19 01:21:06 +02:00
Michael Natterer 457f6bf952 app: add GimpToolTransformGrid, GimpToolRotateGrid and GimpToolShearGrid
which do all transform tools' (except handle transform) canvas GUI and
their interaction.
2017-06-17 03:04:06 +02:00
Michael Natterer 44d33bfd3b app: change return value of GimpToolWidget::button_press() from gboolean to gint
so widgets can return which handle was clicked. The values boolean
semantics stay the same so if(retval) gives the same result. This is
useful for the upcoming transform tool widgets.
2017-06-16 20:55:02 +02:00
Michael Natterer 1bc52dad71 app: return FALSE from gimp_canvas_item_hit() when the item is invisible 2017-06-14 00:16:09 +02:00
Michael Natterer 013bb4d81f app: add signal GimpToolWidget::snap_offsets() and API to emit it
so widgets can notify their handling tool of snap offsets.
2017-06-14 00:16:09 +02:00
Michael Natterer 495f90e6e2 app: allow to set an angle on a GimpCanvasHandle in GIMP_HANDLE_CROSS mode 2017-06-14 00:16:09 +02:00
Michael Natterer ad660a3c88 app: add gimp_tool_widget_add_transform_guides() 2017-06-14 00:16:09 +02:00
Michael Natterer 7082fc8b9e app: add x1,y1,x2,y2 parameters to gimp_canvas_transform_guides_set() 2017-06-14 00:16:09 +02:00
Ell b737463a3b app: fix event reordering during motion compression
... due to commit 5543a9da4f
2017-06-11 18:54:29 -04:00
Michael Natterer 18fe8f61a5 app: add GimpToolCompass, which is the entire canvas GUI of the measure tool 2017-06-11 23:38:55 +02:00
Michael Natterer e05ba83453 app: add signal GimpToolWidget::status() and API to emit it
for subclasses to set status messages.
2017-06-11 23:18:47 +02:00
Ell 5543a9da4f app: compress tool motion evnets more conservatively
When compressing tool motion events, only compress motion events
at the front of the event queue, targeted at the same widget as,
and having similar characteristics to, the initial motion event;
stop compressing upon the first mismatched event.

Previously, all pending motion events targeted at the canvas were
compressed, stopping only at a button-release event targeted at the
canvas.  As a result, when adding a guide by dragging from a ruler,
there could be a situation where a pending button-release event
targeted at the ruler would be followed by motion events targeted at
the canvas, with a cleared state mask.  These motion events would
get compressed to the initial motion event targeted at the ruler,
resulting in a motion event with a cleared state mask being processed
before the said button-release event.  This, in turn, would cause the
guide tool's cursor_update function to be called, while the tool is
still active, emitting a CRITICAL.  Sheesh.

The moral of the story is: let's play it safe.
2017-06-11 15:08:19 -04:00
Michael Natterer 3c5d7075c1 app: add gimp_canvas_handle_set_size() and use it in GimpToolLine 2017-06-11 18:46:30 +02:00
Michael Natterer b92d98857c app: add gimp_tool_widget_get_shell(), and implement get_property("item")
forgot the latter in the initial version.
2017-06-11 18:26:37 +02:00
Michael Natterer 6fe578f269 app: add GimpToolLine, an subclass of GimpToolWidet
Implements the "line with handles" known from the blend tool, behind a
simple "x1, y1, x2, y2" interface.
2017-06-10 23:51:06 +02:00
Michael Natterer b026689e20 app: add new base class GimpToolWidget
which encapsulates a bunch of GimpCanvasItems plus their interaction,
using GimpTool-like virtual functions like button_press(),
button_release() motion() etc. Also has GimpDrawTool-like API to
manage the canvas items of its subclasses.
2017-06-10 23:47:54 +02:00
Michael Natterer d6587795c3 app: properly remove the children when a GimpCanvasGroup gets destroyed
Call gimp_canvas_group_remove_item() and don't just unref them, so
their state gets restored and signals get disconnected. They may not
be owned by the group, or have other external references.
2017-06-10 22:08:09 +02:00
Michael Natterer 2e209ac440 app: keep GimpCanvasItem from emitting "update" during destruction
Simply increase its change_count in dispose(). There is really no
reason to build expensive update regions and emitting signals when we
are about to go away.
2017-06-10 22:00:38 +02:00
Michael Natterer a4d2acac38 app: add gimp_canvas_item_transform_distance() and transform_distance_square()
to allow items to measure distances, exactly like the identical
GimpDrawTool API.
2017-06-10 21:55:40 +02:00
Michael Natterer 53a84bc6ea app: move enums GimpButtonPressType and GimpButtonReleaseType
from tools-enums.h to display-enums.h, will need them there soon.
2017-06-10 12:25:16 +02:00
Ell 3ca48a0b30 enums: don't use comments in generated enum recipes
Works in bash, but apparently not portable.
2017-06-02 11:15:43 -04:00
Ell 5bcde32caf enums: run gimp-mkenums from the build dir
Commit 1e6acbd4e1 modified the
generated enum recipes to run gimp-mkenums from the source
directory, instead of the build directory, so that only the
basenames of the corresponding header files would appear in
the comment at the top of the generated files.  This was a
mistake -- $(GIMP_MKENUMS) is expecting to be invoked from the
build directory.

Switch back to running gimp-mkenums from the build directory.  To
avoid including the relative path from the build directory to the
source directory in the generated file, add a @basename@ production
variable to gimp-mkenums, which exapnds to the basename of the
input file, and use it instead of @filename@ in the recipes for the
generated enum files.
2017-05-22 20:29:18 -04:00
Ell f9fa0d1b18 enums: don't write generated enum files to src-dir if unchanged
When regenerating an enum file, don't copy it back to the source
directory if it hasn't actually changed.  This allows using a read-
only source directory where the enum header is newer than the
generated file, as long as they're not really out of sync.

OTOH, *do* touch the generated source-dir file even when unchanged,
in order to avoid re-running its recipe on the next build, however,
allow this to silently fail (which is harmless).
2017-05-22 17:58:04 -04:00
Michael Natterer 8f2471b112 Bug 772667 - instant freeze on rotate
Limit the number of lines drawn in the transform tool canvas grid to
one line every 5 image pixels. This should probably be done in display
pixels, didn't change that yet.
2017-05-14 22:28:51 +02:00
Michael Natterer 465eba3260 app: factor out button-2-motion handling code in GimpDisplayShell
less code in the huge gimp_display_shell_canvas_tool_events().
Also fix the rotating cursor in gimp_display_shell_start_scrolling().
2017-05-11 21:31:41 +02:00
Ell 1e6acbd4e1 enums: generate enum files in source dir
We check them into git, so this makes it easier to keep them in
sync when using a separate build directory.

Case in point -- this commit also syncs a few enum files that went
out-of-sync with their headers.
2017-05-06 17:26:16 -04:00
Jehan 8c814a24d3 app: use gimp_unit_get_scaled_digits() in the Pointer Information dock.
gimp_unit_get_digits() won't return relevant information when using
higher resolution. gimp_unit_get_scaled_digits() will provide the right
amount of details relatively to the actual print resolution of the
active image.
2017-05-06 22:57:43 +02:00
Thomas Manni 3c7a54829d app: call the active vectors handler at the end of gimp_display_shell_connect
This enables correct display of the active path (in red color instead of blue)
when xcf files containing paths are opened.
2017-05-02 18:24:51 +02:00
Michael Natterer 4f5bd08b9e app: remove unused includes from gimpdisplayshell-dnd.c 2017-05-01 19:09:00 +02:00
Michael Natterer 536cc8531a app: keep the src image's resolution and unit in copied/cut GimpBuffers
and use them for the new image in "Paste as new image". We were using
the resolution and unit of the image the paste command was invoked
from, which is entirely random and useless.
2017-05-01 18:39:13 +02:00
Ell c97209ba4a app: fix abbreviated commit hashes
The abbreviated commit hash we show in the shell and the about
dialog is currently just the last 7 characters of 'git describe',
based on the assumption that abbreviated hashes are always 7-digits
long.  When the hash is longer than that, we're just showing a
nonsense commit.

This was never a good idea, since users can override this, and
since disambiguation can result in longer hashes, but since git
2.11, the default abbreviated hash length is determined based on
the size of the repository, which currently results in 10 digits
for us.

Let's just do it right.
2017-03-21 23:05:42 -04:00
Michael Natterer 157d70e396 Bug 768066 - Color picker tool should indicate pick position
Add optional coordinate display to GimpColorFrame, and enable it for
the color picker tool and the sample point dockable.
2017-03-11 00:01:01 +01:00
Michael Natterer dda54c1df8 Deprecate stock items for good and change all icon defines to GIMP_ICON_*
Try to sort all GIMP_ICON_* defines into FDO categories like in
https://specifications.freedesktop.org/icon-naming-spec/latest/ar01s04.html

Add defines for all icons we override, rename some icons to their FDO
standard names, and mark the ones we duplicate with a comment so we
don't forget to rename those to standard names in 3.0.
2017-03-05 16:01:59 +01:00
Ell d545b460d9 app: defer image menu updates to an idle function
In DEs which use a global menu, such as Unity, updating the menu
can be expensive.  This particularly affects canvas scaling and
rotation, for which updating the menu synchronously causes notable
lag.
2017-03-01 03:53:18 -05:00
Michael Natterer 3cf423f0cd *: rename NORMAL to NORMAL_LEGACY and NORMAL_LINEAR to NORMAL
and make NORMAL_LEGACY immutable.
2017-02-26 16:26:34 +01:00
Ell c11c955ef5 app: fix comment typo in previous commit 2017-02-23 05:39:46 -05:00
Ell 4c5f6a8e5b Bug 778966 - severe input lag with ruler and one window mode ...
.. due to gdk_pixbuf_scale() with themes using the pixbuf engine

Make GimpDisplayShell a subclass of GtkEventBox, so that it gets its
own window, isolating its events from those of its ancestors.

In particular, the "expose" event handler of GtkNotebook, which the
shell is a child of in SWM, is particularly slow with themes that
use the pixbuf engine.  If the notebook and the shell use the same
window, this can cause notable, and somtimes severe, lag when the
rulers or scrollbars are updated frequently, such as when rapidly
moving the cursor.
2017-02-22 18:46:10 -05:00
Ell f34ef2ab35 app: annhilate <math.h> from the face of last commit 2017-02-19 18:48:18 -05:00
Ell 1572bccc9f app: add support for subpixel image grids
In particular, this enables grids whose points of intersection
are at the middle of the image's pixels, which is useful for
undistorted painting with odd-sized brushes using tools other than
the pencil.

This commit also changes the grid visibility behavior, so that the
the visibiltiy of horizontal and vertical grid lines (depending on
the zoom level) is independent.
2017-02-19 18:13:41 -05:00
Michael Natterer 7da7bab09c app: get rid of icons in dialog buttons (use labels not stock IDs)
Nobody has them anymore, and they are deprecated in GTK+ 3.x. This
also fixes all conflicting mnemonics except those I missed, but we can
fix them now.
2017-02-12 16:18:54 +01:00
Jehan f44fb1ece4 app: more gimp_unit_get_scaled_digits() usage.
The print size displayed in image property and title format should use
gimp_unit_get_scaled_digits() instead of gimp_unit_get_digits() and
adding 1, which is quite random or magic number-y.
2017-01-24 00:28:33 +01:00
Jehan 2762662ca9 app: use gimp_unit_get_accurate_digits() in a few places. 2017-01-23 20:59:28 +01:00
Michael Natterer dba909a9fa Bug 776370 - Changing active layer breaks the GEGL operation dialog
We can't just switch to a GimpOperationTool by using the normal
gimp_context_set_tool() or gimp_context_tool_changed() because it
needs additional initialization like setting an operation at all.

In gimp_gegl_procedure_execute_async(), g_object_set_data() the used
procedure on the newly created tool.

In gimp_display_shell_initialize_tool(), when we re-create the active
tool because of a drawable change, check for the procedure and invoke
it again, instead of simply creating an empty operation tool by
calling gimp_context_tool_changed().
2017-01-23 00:05:18 +01:00
Jehan f836892314 Bug 763734 - better decimal places for physical units.
Compute the ideal decimal precision for cursor position and length
status so that you get the best precision on physical units depending
on the current resolution, yet avoiding over-precision (which can be
misleading). The unit's "digits" value is now used as a minimum
precision only.
2017-01-20 00:40:27 +01:00
Michael Natterer 66060e3307 app, libgimp*, plug-ins: replace enum GimpLayerModeEffects by GimpLayerMode
with proper value names. Mark most values as _BROKEN because they use
weird alpha compositing that has to die. Move GimpLayerModeEffects to
libgimpbase, deprecate it, and set it as compat enum for GimpLayerMode.
Add the GimpLayerModeEffects values as compat constants to script-fu
and pygimp.
2017-01-08 23:00:19 +01:00
Michael Natterer 237d83dc7f Bug 773462 - Color Picker should support range...
...regardless of image color precision

Split enum value GIMP_COLOR_FRAME_MODE_RGB into RGB_PERCENT and RGB_U8,
which display the current % values, and values in a range of 0..255.
2017-01-03 01:20:30 +01:00
Jehan 3fa016fb4b app: clean out tab indentations. 2016-12-21 04:05:32 +01:00
Michael Natterer 2e63533602 app: add GimpDockContainer::get_dialog_factory()
and use it where possible instead of gimp_dialog_factory_get_singleton().
Also reduce using this function in some other places.
2016-11-25 13:26:08 +01:00
Michael Natterer a3c65e6d17 app: get rid of including menus/ stuff from widgets/ and other places
Add GimpMenuFactory can always be found in a GimpDialogManager, use
gimp_dialog_factory_get_menu_factory() where we have a dialog factory
instead of accessing "global_menu_factory" or redundantly passing a
menu factory around where we already pass around a dialog factory.
2016-11-23 19:38:44 +01:00
Michael Natterer b1ca8a161c app: allow to zoom with middle mouse button + control + drag up/down 2016-11-16 14:41:30 +01:00
Michael Natterer be6b6c7ba4 Bug 642565 - Use private pointer instead GET_PRIVATE macro in GimpCanvasItem
Do as the but title says, based on a patch from Javier Jardón.
2016-11-07 14:14:16 +01:00
Michael Natterer f5ecc53f3e Fix a lot of warnings all over the place
Deprecated stuff, unused variables. Includes parts of a patch from
Shlomi Fish from bug #768855.
2016-10-31 01:36:35 +01:00
Michael Natterer f9170b667e Bug 647957 - GimpColorFrame's CMYK mode is not color managed
Convert GimpRGB to CMYK using a color transform to the configured CMYK
profile instead of the naive gimp_rgb_to_cmyk().

Add gimp_color_frame_set_color_config() and call it on all color
frames in the GUI (color picker tool, cursor info, sample point view).
Keep a GimpColorTransform around that does the conversion.

Also color manages the frame's color area now (visible in the sample
point view), which was forgotten earlier. Addresses bug #467930.
2016-10-18 22:48:04 +02:00
Michael Natterer 151b44e4bb Bug 759939 - Ghost brush outline in FG Select tool
Fix the check that keeps events on overlay widgets from entering the
tool event mechanism, they have no business there.

gimp_overlay_child_realize(): set the embedding widget's event mask on
all overlay children, so their windows will be used as event window,
so their events become distinguishable from events on the parent (the
canvas).

gimp_display_shell_canvas_tool_events(): fix the check for events on
overlays, and skip them for real this time.
2016-10-14 22:14:11 +02:00
Michael Natterer aa0afe0d01 app: invoke the right action when the quick mask button is clicked
instead of implementing the toggling in display/. One more bit
moved to actiona/.
2016-10-01 01:06:02 +02:00
Michael Natterer beb3279bf2 Bug 320447 - fast switching between "color managed display" and "softproof"
Add a SELECT_SOFTPROOF_PROFILE mode to the color profile dialog and
use it to select a profile from a newly added "Soft-Proofing Profile..."
menu item in view -> color management.
2016-09-30 20:56:04 +02:00
Michael Natterer 88ff45eb05 app: keep the statusbar progress from drawing over the right docks
In a blocking operation we don't give the main loop time to lay out
the statusbar correctly after showing the progress bar. Force a size
on the progress bar using gtk_widget_size_allocate(). This sucks.
2016-09-28 00:44:14 +02:00
Michael Natterer c5957f146b app: remove the "filters_dialog" member from GimpDisplayShell
and attach the dialog using dialogs_attach_dialog().
2016-09-25 01:06:13 +02:00
Michael Natterer 3f1104b626 app: remove the "grid_dialog" member from GimpDisplayShell
and attach the dialog to the image, just like other dialogs.
2016-09-24 14:49:43 +02:00
Massimo Valentini 5037ff35ca Bug 771444: Tablet stylus misbehaves when crossing...
the edge of a dock in multi-window-mode

when the pointer is grabbed do not process a
motion-notify-event having the wrong 'device' member.

This avoids a harmful device change.
2016-09-22 18:18:40 +02:00
Michael Natterer 67863dabf9 Bug 637313 - Should be possible to copy/paste whole layers in a single step
Use the newly added clipboard for entire images to copy/paste layers
(we only create single-layer clipboard images, and use only the first
layer of any recieved image, the layers can be arbitrarily complex
though):

- change gimp_edit_copy,cut,paste() to return/take a GimpObject
  that can be a GimpImage or GimpBuffer
- cut/copy the whole layer if there is no selection
- always paste layers as new layers, not floating selections
- always paste news layers on top of the active layer, where
  we would attach a floating selection
- add enum GimpPasteType { FLOATING, FLOATING_INTO, NEW_LAYER }
- add GimpPasteType parameter to gimp_edit_paste() and handle all
  three cases there because there is now a lot of common code
  involved
- change all callers accordingly, use only legacy buffer pasting
  from the PDB for now
2016-09-20 00:20:07 +02:00
Michael Natterer 4df9a1d568 Get rid of gtk_misc_set_alignment(label) and use gtk_label_set_x,yalign() 2016-09-08 19:11:20 +02:00
Jehan 6c674e973c app, libgimp*, plug-ins, icons: revert icon names into freedesktop...
... standard icon names and GTK+ icon names as second choice.
We should only use GIMP specific icon names as last resort, when there
is no standard or GTK+ names dedicated to the function.
This is made possible thanks to commit 3cc77b0.

s/gimp-document-recent/document-open-recent/
s/gimp-indent/format-indent-more/
s/gimp-next/go-next/
s/gimp-previous/go-previous/
s/gimp-save/document-save/
s/gimp-save-as/document-save-as/
s/gimp-revert/document-revert/
s/gimp-open/document-open/
s/gimp-document-recent/document-open-recent/
s/gimp-quit/window-close/ ou s/gimp-quit/application-exit/
s/gimp-warning/dialog-warning/
s/gimp-edit-clear/edit-clear/

s/gimp-justify-.*/gtk-justify-.*/
s/gimp-font/gtk-select-font/
s/gimp-color-palette/gtk-select-color/
s/gimp-cancel/gtk-cancel/
2016-09-03 15:49:29 +02:00
Ell 26b978d2a8 app: avoid expensive rotated scale calculation when scale_x == scale_y
Ditto for the rulers' resolution calculation.
2016-08-09 22:28:21 +00:00
Ell 5663daa6e7 app: code layout/typo fixes
The sort of things that only become visible *after* pushing.
2016-08-09 21:55:19 +00:00
Ell 5bdb20c839 app: make rulers rotation aware
Place the rulers' origin at the top-left corner of the canvas
(screen space) bounding box, and set their scale to the image-
space scale along the screen-space horizontal/vertical directions
(in other words, measuring a distance using the rulers should
give the same results as the measure tool; note that rotation
comes into play here only when the horizontal and vertical
image or screen resolutions are different, since otherwise the
scale is direction invariant.)

Make scrollbar step match ruler step under the new behavior.
2016-08-09 21:31:07 +00:00
Ell 720b73ca86 app: fix a few canvas scroll/scale rounding inconsistencies
Apply rounding more consistently across some of the scroll/scale
functions, to avoid annoying one-pixel-off scrollbar size/position
issues.
2016-08-09 21:31:06 +00:00
Ell e384d533e7 app: don't round results of gimp_display_shell_transform_bounds()
The rounding causes some one-pixel-off errors in the canvas scaling
code; the rest of its callers shouldn't be affected.
2016-08-09 21:31:06 +00:00
Michael Natterer 4ea518fee3 Bug 768736 - Button order differs in "Quit GIMP" and "Close View"...
...dialogs with modified images

Move the "Discard Changes" button to the right (affirmative) position
in gimp_display_shell_close_dialog().
2016-07-24 23:55:35 +02:00
Ell cd767505fc app: make GimpNavigationView rotation aware
Rotate the viewport marker to correctly reflect the visible part
of the image.
2016-07-21 21:25:49 +00:00
Ell 168b935d43 app: make scale_{to_rectangle,fit_in,fill,shrink_wrap} rotation aware
Use the (screen space) bounding box of the rectangle/canvas for these
functions.
2016-07-21 21:24:06 +00:00
Ell 3fbd47eb2e Bug 768726 - Canvas rotation, flipping applied in image space ...
... not screen space

Flip and rotate the canvas around the center of the viewport,
instead of the center of the image.  Scroll the display as
necessary to keep the center of the viewport fixed during
these operations.  This applies to both the corresponding
menu items, and rotation using Shift+Space.

Likewise, flip the canvas across the designated axis in
screen space, instead of image space.  Rotate the display as
necessary, such that the reflection appears to happen in
screen space, regardless of the current rotation angle of the
canvas.
2016-07-21 21:24:06 +00:00
Ell bfba49d203 app: make scrollbar limits and scroll-offset clamping rotation aware
Limit the scrollbars by the (screen space) bounding box of the canvas.
Scroll offsets are clamped to 1.5 that.
2016-07-21 21:22:49 +00:00
Ell 3183b894df app: fix gimp_display_shell_untransform_viewport() ...
... when the canvas is rotated.

Use gimp_display_shell_untransform_bounds() instead of transforming
the two endpoints independently.
2016-07-21 21:20:53 +00:00
Ell 1663675031 app: fix gimp_display_shell_un{rotate,transform}_xy() ...
... when the canvas is rotated.

s/fy/fx/ in one of the arguments to cairo_matrix_transform_point().
2016-07-21 21:20:53 +00:00
klausstaedtler 8b1ea3cc13 icons: Bug 759904
add
gimp-cancel
gimp-save

patch
gimpstatusbar.c
fil-pdf-save.c
gimpicons.c
gimpicons.h
2016-06-10 13:50:45 +02:00
Michael Natterer 8abf1aab5e libgimpconfig: add getters for all GimpColorConfig members
and use them instead of peeking the public object struct.
2016-06-05 23:58:02 +02:00
Michael Natterer e33b2e77a7 app: remove gimp_display_shell_profile_convert_buffer()
It's exactly the same as calling gimp_color_transform_process_buffer()
directly.
2016-05-30 01:26:50 +02:00
Michael Natterer 710ba9bef3 app: make display color management work with the transform cache
Need to connect_after() to the shell's GimpColorConfig "notify" so the
profile transform cache in gimp_widget_get_color_transform() is
already invalidated when we call gimp_color_managed_profile_changed()
in the shell's notify callback.

This is a hack. Actually the shell should create its transform only on
demand, and a config change should simply get rid of the previous
transform, just as all other widgets are doing it.
2016-05-30 01:16:07 +02:00
Ell 513446a85b app: fix initial display state when dot-for-dot is off by default
... and image_resolution != screen_resolution.

Partially revert commit 26ea7a3530.

Also, reset shell->dot_for_dot in gimp_display_shell_fill(), so that new
images that use the first display don't inherit the dot-for-dot state of the
previous image that used the same display.
2016-05-29 19:57:35 +00:00
Jehan d13ed2a42b Bug 575043 - GIMP ignores 'Maximized' windows hints on startup.
Now the max parameter from Windows is taken into account and takes
precedence over the saved session state if set.
This can be applied either through the "run" property of a shortcut,
or by command line: `start /max gimp-2.9.exe`.
There is a start for min handling as well but I can clearly see the
window being minimized and immediately re-raised. There must be a call
later which deiconifies the window. This will have to be fixed.
2016-05-29 17:48:09 +02:00
Michael Natterer 0bfa402c1a Argh, this was meant to be squashed into the previous commit... 2016-05-26 22:18:50 +02:00
Michael Natterer cc92887908 libgimpcolor: add new object GimpColorTransform
which encapsulates a cmsHTRANSFORM and does all the pixel format
conversion magic. It has API to create transforms and proofing
transforms, and to convert pixels arrays and GeglBuffers.

Before, each place which has a transform had to keep around the
transform and its input and output Babl formats, and had to implement
lots of stuff itself. Now all that lives in GimpColorTransform,
removing lots of logic from many places, and pretty much removing lcms
from the public API entirely.

This removes including <lcms2.h>, LCMS_LIBS and LCMS_CFLAGS from
almost all directories and potentially allows to replace lcms by
something else.
2016-05-26 22:15:54 +02:00
Michael Natterer dcf5c526e7 Bug 320447 - fast switching between "color managed display" and "softproof"
Replace the 3-state "off", "display" and "softproof" radio items by
two toggles "enable" and "softproof". Also add separate controls for
display and softproof options.
2016-05-21 21:38:47 +02:00
Michael Natterer 2ef8719cbe app: rename more stuff from "floating sel" to "floating selection" 2016-05-20 16:46:26 +02:00
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 a28778475f Bug 320447 - fast switching between "color managed display" and "softproof"
Add rendering intent, black point compensation and gammut warning menu
items to View -> Color Management. They set the respective values of
the active color management mode, so both "color managed display" and
"print simulation" are almost completely configurable per-display
now. Setting the simulation profile is still missing.
2016-05-16 13:27:59 +02:00
Michael Natterer a942b771fb app: add gimp_display_shell_set_action_sensitive() 2016-05-16 13:00:27 +02:00
Michael Natterer 406d1b9c65 Bug 320447 - fast switching between "color managed display" and "softproof"
Add a View -> Color Management submenu that allows to change
the color management mode per-display.

Internally, keep a GimpColorConfig object around per-display that
is synchronized with the global config except for the properties
that have a per-display GUI (currently the mode).

Also provide an "As in Preferences" menu item to follow the global
settings again.
2016-05-14 23:50:58 +02:00
Michael Natterer 388bf5d4ca app: add gimpdisplayshell-actions.[ch]
which contains functions to update shell-related actions in the "view"
group. Took the code out of gimpdisplayshell-appearance.c.
2016-05-14 22:54:11 +02:00
Michael Natterer af976a75c3 app: add a GimpColorConfig to GimpDisplayShell
Use the shell's color config for color managing the display and
various auxiliary widgets attached to it, like the notebook tab widget
and navigation popup.

The config is currently just a reference to the global prefs config,
so no behavior changed.
2016-05-14 00:56:26 +02:00
Ell 48c2038951 Bug 765326 - Status bar progress messages aren't always updated
Keep GimpStatusbar progress messages at the front of the list.

Previously, gimp_statusbar_push() and friends would push progress
messages behind temporary messages, and would push normal messages,
added after a progress had started, in front of progress messages.
This resulted in the progress bar text not being updated if a
temporary message was active at the time the progress started, or
if a normal message was pushed after the progress started.

This commit fixes this by always keeping progress messages at the
front of the message list.
2016-05-08 22:33:08 +00:00
Ell ce8cbe6540 app: update GimpStatusbar message icon even when the text is unchanged
Probably just academic.
2016-05-08 22:32:28 +00:00
Ell bb4d04dce5 app: refactor GimpStatusbar message pushing/popping code
... to reduce duplication, and make less assumptions about the
position of messages on the list.

In preperation for some bug fixes.
2016-05-08 22:32:28 +00:00
Michael Natterer e69bb90197 app: show the image's "is color managed" state in the window title string
Instead of the profile name, print "(not color managed)".
2016-05-08 19:53:16 +02:00
Massimo Valentini a41b4a0436 Bug 765205 - GIMP crashes dropping the fg color on a text layer
Pass the GimpRGB's address again to gimp_text_layer_set(), not
the entire struct.
2016-04-18 12:52:56 +01:00
Kristian Rietveld cdc7542d46 Bug 756178 - Crash on new layer creation in fullscreen mode
Disable "new-style" fullscreen mode on OS X, we need support in
GTK+ in order for this to work properly. The currently available
fullscreen option in View > Fullscreen works fine and we plan to
migrate to the "new-style" fullscreen support in the future.
2016-04-17 00:39:40 +01:00
Michael Natterer 5f8b6ce8da app: s/gimp_babl_get_description/gimp_babl_format_get_description/ 2016-04-15 19:19:09 +01:00
Michael Natterer 2120742cb9 app: don't unconditionally call tool_manager_modifier_state_active()
Only call it if the display is the active tool's focus display.
2016-04-15 11:28:13 +01:00
Michael Natterer 2a31b96f4b Bug 732160 - menu activation with alt-somekey makes tools stay...
...in "alt-pressed" mode

Menu activation doesn't cause a focus-out becaus menu keyboard
grabbing is implemented with a simple gtk_grab_add() (the menu popup
never gets the focus). Therefore, the canvas never gets a focus-out
event and the pressed modifiers are stuck.

Fixed by connecting to "grab-notify" on the canvas, and artificially
releasing all modifiers when the canvas is shadowed by a grab.
2016-04-15 00:22:25 +01:00
Michael Natterer 8984df028f app: add a canvas style for "split view" guides 2016-04-04 22:12:33 +02:00
Michael Natterer 7889ec08f7 Bug 668016 - Accidentally clicking ruler loses active tool's state
Add two new tools, GimpGuideTool and GimpSamplePointTool. They are
one-trick-ponies and can only create new or move existing guides and
sample points. They can't be selected from the toolbox, only
temporarily pushed as active tools on top of any active tool using
their public start() APIs.

Use that API to enable them when the rulers are clicked, and replace
the entire guide and sample point moving code in GimpMoveTool and
GimpColorTool by simple calls to that API.

This might look like overkill but can easily be used for other
features like moving guides from within the paint tools (mirror
painting) or gegl filters (preview curtain).
2016-04-03 16:41:42 +02:00
Michael Natterer e76f7174fc Bug 761270 - layer boundary not re-drawn correctly on scrolling
Pass the display scroll offset down to gimp_cairo_stipple_pattern_create()
and set it as offset on the created cairo pattern, so stipple patterns
look the same no matter how the display is scrolled.
2016-03-26 22:50:10 +01:00
Michael Natterer c09a724bda app: change parameters of gimp_fill_options_new()
to be the same as of gimp_stroke_options_new() because it's about to
be needed for the same purposes.
2016-03-15 20:10:16 +01:00
Michael Natterer 34913f49a5 app: clean up the color and pattern dropping code in gimpdisplayshell-dnd.c 2016-03-14 00:33:15 +01:00
Michael Natterer 7b7b8f5d03 app: remove some #includes 2016-03-11 22:45:15 +01:00
Michael Natterer e1e77f88fa app: change gimp_edit_fill() to take a GimpFillOptions
instead of a long list of parameters. Get rid of gimp_edit_fill_full().
2016-03-11 19:55:50 +01:00
Michael Natterer f2d581a536 Bug 761170 - Warnings building with clang
Fix a bunch of clang warnings.
2016-02-12 22:49:47 +01:00
Jehan 710455b71c Revert "app: create pango font description of statusbar zoom field only once..."
This reverts commit 6878b49491.
I didn't take into consideration that different themes could apply
various fonts, font sizes or label-scale for the widget. So the font
description needs to be reinitialized at every theme change.
2016-02-06 15:53:43 +01:00
Jehan 6878b49491 app: create pango font description of statusbar zoom field only once...
... instead of recreating it all the time the same.
Small improvement of commit 3f2889e.
2016-02-06 01:19:43 +01:00
Michael Natterer 46da951b85 app: add an offset to GimpDisplayShell's mask
and set that offset in GimpRegionSelectTool when not in sample_merged
mode. Fixes live selection mask display for layers with a non-zero
offset.
2016-02-05 21:21:52 +01:00
Jehan ec98b57bc4 app: GimpGuideStyle is not in display-enums anymore. 2016-02-03 20:53:21 +01:00
Jehan e01d56969d app: move all guide styling to gimpcanvas-style. 2016-02-03 19:38:32 +01:00
Michael Natterer 3415d22e58 app: some cleanup in the new symmetry code, mostly harmless 2016-02-03 14:29:23 +01:00
Jehan 76f573c981 Bug 648776 - mirror symmetries.
You can now set any paint tool to mirror painting relatively
horizontal/vertical axis or a central point (any combination of these 3
symmetries).
This has been implemented as a new multi-stroke core, where every stroke
is actually handled as a multi-stroke (default of size 1).
This is also the first usage of custom guides for symmetry guiding.
Current version has to be activated in the playground.
2016-02-02 21:15:13 +01:00
Jehan b8fadf3ad7 app: add a "custom" guide concept.
With gimp_guide_custom_new(), you can create a custom guide with a different
style on canvas (other pattern/color/width). A custom guide won't be saved
and could be used, for instance, for specific GEGL op guiding.
2016-02-02 21:15:13 +01:00
Jonathan Tait 3f2889e030 Bug 761340 - on changing theme/icon theme, statusbar zoom field shrinks.
Apply label-scale once only.
2016-02-01 14:42:14 +01:00
Massimo Valentini 6cf8bda49b Bug 735810 - performance shrinkage of Paths tool
In gimp_display_shell_expose_region(), invalidate each rect rather
than rebuilding the cairo_region_t as GdkRegion and then invalidating
the entire GdkRegion. Improves performance for tools that invalidate
complex regions.
2016-01-24 00:59:33 +01:00
Michael Natterer 4920033c42 Bug 735810 - performance shrinkage of Paths tool
Use a GQueue instead of a GList in GimpCanvasGroup, so adding items
takes constant time instead of O(n). Also, removing items was
traversing the list twice. This should generally speed up tools with
lots of canvas items.

Also, add a private pointer to the instance struct instead of using a
GET_PRIVATE() macro.
2016-01-24 00:57:16 +01:00
Michael Natterer bd9e59a9f0 app: add "title", "icon_name" and "help_id" to gimp_tool_gui_new()
so things are the same at the API and the inside, which makes
GimpImageMapTool's use of GimpToolGui a little more obvious.
2016-01-22 23:41:45 +01:00
Michael Natterer 06a5b2fa3f app: bring dialog titles and help IDs to GEGL filter dialogs
Add "title" and "help_id" parameters and members/properties to
GimpToolDialog, GimpToolGui, GimpOperationTool. Also make the order of
parameters more consistent.
2016-01-17 20:17:07 +01:00
Michael Natterer 359c00a722 Bug 760658 - on rotated convas, marching ants are re-drawn incorrectly
selection_zoom_segs(): if the canvas is rotated, don't optimize
segment drawing by clamping it to the canvas widget boundaries.
2016-01-16 01:56:57 +01:00
Michael Natterer dd1809bc21 app: simplify gimp_display_shell_scale_get_zoom_focus()
The logic should be exactly as before, just less convoluted.
2016-01-14 23:57:40 +01:00
Michael Natterer 2560ad60fa app: fix image position when entering/leaving fullscreen mode
Call the suspend()/resume() from the previous commit around
gimp_display_shell_appearance_update() so the cancas is not
repositioned for each individual widget configuration.
2016-01-11 01:55:14 +01:00
Michael Natterer cbf2311134 app: make new images jump around much less
Implement a mechanism to suspend/resume GimpImageWindow's "keep canvas
pos" logic which is used to keep the image in place across widget
changed such as show/hide rulers.

gimp_display_shell_fill(): call suspend()/resume() around
gimp_display_shell_appearance_update(), and center the image after
calculating the initial scale factor, so the image jumping at least
starts at the approximately right position.
2016-01-11 01:50:29 +01:00
Michael Natterer 26ea7a3530 app: remove (hopefully) redundant calls to gimp_display_shell_scale_update()
because this should happen generically in the zoom model's "zoomed"
callback, and is done explicitly in a few special cases. The removed
calls should all be redundant.
2016-01-10 23:05:41 +01:00
Michael Natterer 86cbc2f7a7 Bug 760402 - Zoom in (with "Resize window on zoom") displays wrong...
...several different zooms tiled together

In gimp_display_shell_scale() don't shortcut things in the case where
we resize the window, but call gimp_display_shell_scale_resize() like
all other scaling functions do in the end.
2016-01-10 20:32:17 +01:00
Michael Natterer 83fbd31f12 app: disable "Resize windows on zoom/resize" in single-window mode
They only make sense if the image is by itself in multi-window mode.
2016-01-10 20:09:28 +01:00
Michael Natterer 51b7dd86e7 app: fix broken formatting in gimpcanvasprogress.c 2016-01-08 22:32:43 +01:00
Michael Natterer 73a9ac967c app: add gimp_display_shell_scrollbars_update_steppers()
for the code from gimp_display_shell_scroll_clamp_and_update() that
sets the scrollbar stepper sensitivity.
2016-01-05 20:53:34 +01:00
Michael Natterer 5521ce0883 app: fix gimp_display_shell_scroll() again to work right with rotation
Call gimp_display_shell_scrolled() before gimp_overlay_box_scroll()
so the rotate transform is updated before the actual scrolling.

The explicit call to gimp_display_shell_rotate_update_transform() got
lost during the last commits, but this solution is cleaner and less
redundant anyway.
2016-01-05 20:29:54 +01:00
Michael Natterer 117800063e app: pause/resume the shell in gimp_display_shell_scale_to()
around calls to scale() and scroll().
2016-01-05 20:24:18 +01:00
Michael Natterer 9391cd390f app: reorder an rename stuff in gimpdisplayshell-scale.[ch]
Rename gimp_display_shell_scale_handle_zoom_revert() to
gimp_display_shell_scale_save_revert_values() because the old name was
completely unclear.
2016-01-05 19:20:23 +01:00
Michael Natterer c80f0136ba app: make gimp_display_shell_calculate_scale_x_and_y() private 2016-01-05 18:52:03 +01:00
Michael Natterer 095eea6532 app: move gimp_display_shell_scale_changed() to gimpdisplayshell-scale.[ch]
and rename it to gimp_display_shell_scale_update().
2016-01-05 18:48:22 +01:00
Michael Natterer b0ce294f8f app: make gimp_display_shell_scale_get_image_size_for_scale() private 2016-01-05 18:36:37 +01:00
Michael Natterer d64ca7222e app make gimp_display_shell_get_screen_resolution() private 2016-01-05 18:30:15 +01:00
Michael Natterer 2f26016a47 app: move the code to update scrollbars and rulers to their own files
so they are gone from the "scale" and "scroll" namespaces because they
belong to neither and both. And because the files are way too large.
2016-01-05 18:05:38 +01:00
Michael Natterer d228493320 app: remove gimp_display_shell_scroll_clamp_offsets()
and merge it into gimp_display_shell_scroll_clamp_and_update(), the
removed function is not any longer needed separately.
2016-01-05 17:38:56 +01:00
Michael Natterer 18bd9c39c3 app: clean up gimp_display_shell_scroll() a bit
and document the difference to gimp_display_shell_scroll_set_offset()
and why we need both.
2016-01-05 17:34:23 +01:00
Michael Natterer 32104b116d app: some cleanup in gimpdisplayshell-scroll.[ch]
Use more proper transform functions, formatting, make stuff static and
shorten function names.
2016-01-05 15:50:09 +01:00
Michael Natterer 51d41b2d61 app: fix GimpNavigationView and GimpNavigationEditor for rotated canvases
by changing it to always deal with the center of the viewport instead of
its upper-left corner.

Fix gimp_display_shell_scroll_center_image_coordinate() to use the
proper transform functions like in the last commit.
2016-01-05 15:14:08 +01:00
Michael Natterer 211d05d1d7 Bug 759288 - Unfocused Zoom In/Out in Rotated Canvas View
gimp_display_shell_scale_to(): calculate the point that should not
move with GimpDisplayShell's untransform/transform functions before
and after scaling, then scroll to the right point. Just using the
scale functions doesn't work any longer when a rotation is
active. Other functions are affected too, but this most important
issue can be fixed by fixing just this function.
2016-01-05 14:01:57 +01:00
Michael Natterer 2a43ab240b app: don't access GimpSamplePoint members directly
Use the new accessors instead. Clean up guide and sample point code in
image crop and resize a bit.
2016-01-04 22:06:27 +01:00
Alexia Death fa46ef11f1 app: add the point of code removed in previous commit back in 2015-12-28 23:06:04 +02:00
Alexia Death a5fbe2d33a app: remove some pointless code 2015-12-28 22:23:35 +02:00
Michael Natterer 1b786f6479 app: typo in debug output in gimp_display_shell_profile_update() 2015-12-14 23:19:58 +01:00
Michael Natterer 0ad8c786b5 app: use the image's projectable format for profile conversion
which is RGB for RGB and INDEXED images, and GRAY for GRAY images.
2015-12-14 23:02:31 +01:00
Michael Natterer 4656ead4b3 app: make sure the image stays in place when showing/hiding docks
also when it's rotated or flipped.
2015-11-14 00:05:23 +01:00
Michael Natterer c6b6031f31 Bug 758049 - Please add canvas flipping
Enable flipping in the canvas rotate transform matrix, and add some
menu items to control it. Rename the "Rotate" menu to "Flip & Rotate".
2015-11-13 18:51:32 +01:00
Michael Natterer 10085b118a Bug 757739 - GIMP crashes closing undocked pointer dialog
Keep a reference to GimpCursorView's context around as long as the
widget is alive.
2015-11-07 21:14:40 +01:00
Michael Natterer e00c28ec71 app: use the new icons 2015-10-26 08:14:05 +01:00
Michael Natterer 917a63d189 app: move the image thumbnail bottom-left in the window icon
the wilber is already to-right, it just needs better images for this
purpose.
2015-10-26 02:13:22 +01:00
Michael Natterer cece88ba95 app: fix call to gdk_pixbuf_composite() when rendering the window icon 2015-10-26 01:58:00 +01:00
Michael Natterer 19b984e1df app: fix the image window's thumbnail size and shape
and render a wilber on top of it, yay! Step one, this can still be
nicer...
2015-10-26 01:09:08 +01:00
Michael Natterer 5bc9ad947a app: fix gimp_display_shell_scale_to_rectangle() to also do only scrolling
which means: also scroll to the rectangle if the scale doesn't change.
2015-10-18 15:18:23 +02:00
Michael Natterer ded7c8f585 app: add gimp_display_shell_scale_to_rectangle()
and move the magnify tool's rectangle zoom logic to the new function.
2015-10-18 14:59:30 +02:00
Michael Natterer b7f471b1a3 app: change some integers in gimpdisplayshell-scale.c to gdouble
which does not have any effect by itself, but is needed for fixing
viewport calculation for rotated canvases.
2015-10-18 14:40:19 +02:00
Michael Natterer 526a3a6020 Bug 755363 - Non-void function should return a value
Use g_return_val_if_fail() in function returning non-void.
2015-09-21 20:37:29 +02:00
Michael Natterer 29fee56914 app: fix visibility of the color picker tools info window
Since commit 867b1f7e the window did always pop if it was set to
visible once, even if closed and "Use info window" disabled.

Fix this by adapting the show logic to the fact that we now keep the
widget alive across images/displays.
2015-09-20 00:37:05 +02:00
Michael Natterer 396bc89e56 app: better temporary debug output in gimp_display_shell_profile_update() 2015-09-09 21:09:31 +02:00
Michael Natterer df2a485907 Bug 754713 - On-canvas dialog of color picker tool always displays...
...in initially active tab

gimp_tool_gui_update_shell(): implement the "overlay" case and hide the
gui on the previous shell, then show it on the new one.
2015-09-08 21:53:24 +02:00
Michael Natterer b45d31072b app, libgimpcolor: refactor GimpColorManaged::get_color_profile()
to not return a reference that has to be dropped. Also allow NULL to
be returned if the managed cannot have a profile. If it can have one,
get_color_profile() still always returns a profile (either the
assigned one, or a generated built-in one).
2015-09-03 01:36:02 +02:00
Michael Natterer 9775b2083b app: simplify display update when the color management config changes
gimp_image_constructed(): connect to "notify" on GimpColorConfig
and call gimp_color_managed_profile_changed() on the image.

Remove the "notify" handler on GimpColorConfig from
gimpdisplayshell-handlers.c because it already connects to the
image's "profile-changed" signal.

Additionally, implement GimpColorManaged::profile_changed() in
GimpImage and invalidate the image and all layer previews. One step
closer to color managing image and layer previews.
2015-09-02 21:01:17 +02:00
Michael Natterer fd0203ce80 libgimpwidgets: change parameters of gimp_widget_get_color_transform()
Change GimpColorManaged to GimpColorProfile.
2015-09-01 23:40:57 +02:00
Mukund Sivaraman 74bc034638 app: Clarify message shown in unstable builds 2015-08-31 18:49:37 +05:30
Michael Natterer 8c80ee14ff Bug 748749 - picked colors don't match image colors...
...when a color profile is active

This commit doesn't fix anything, but it prepares the code to do the
right thing:

It passes the actual raw image pixels through the entire color picking
mechanism to the widgets which display colors, particularly
GimpColorFrame.

This is needed for GimpColorFrame's "Pixel" mode (as opposed to its
RGB, HSV etc. modes) which is supposed to show the raw pixel values
from the image.

Before this commit, it was recreating the raw pixel values from the
GimpRGB value it knows, which will become impossible when we correctly
pick color managed GimpRGB values soon.
2015-08-25 00:05:59 +02:00
Alexander Larsson 0e10349711 GimpImageWindow: Chain up from constructed
https://bugzilla.gnome.org/show_bug.cgi?id=751507
2015-08-17 11:35:57 +02:00
Michael Natterer cafc3b3c3e app: fix a double semikolon in gimpdisplayshell.c 2015-08-14 22:37:52 +02:00
Michael Natterer c102dde92b libgimpcolor, *: change GimpColorProfile to be a GObject
it used to be a typedef to gpointer and actually was a cmsHPROFILE.

Change its API to be more "standard", remove the public close()
function. The object caches both the cmsHPROFILE and the data/length
ICC blob, so conversions between the two become obsolete (simply call
get_lcms_profile() or get_icc_profile()).

Adapt everything to the new API, but port it in a naive way for now,
the code doesn't take advantage of the new possibilities yet (like
refcounting).
2015-07-10 22:53:59 +02:00
Michael Natterer c04c3950ee app: use gimp_item_bounds() in GimpCursorView, and simplify the code 2015-07-03 19:38:07 +02:00
Michael Natterer af1e86827f app: make gimp_display_shell_mask_bounds() use x, y, width, height
instead of x1, y1, x2, y2, and use gimp_item_bounds() instead of
gimp_channel_bounds().
2015-07-03 19:38:07 +02:00
Michael Natterer 2ed749fd26 app: use gimp_display_shell_transform_bounds()
instead of manually doing the same in gimp_display_shell_mask_bounds().
2015-07-03 19:38:07 +02:00
Michael Natterer e669c6dd05 Bug 750874 - Displayed colors look clipped after profile conversion...
...but they aren't clipped

gimp_display_shell_profile_can_convert_to_u8(): allow the shortcut of
converting directly to 8-bit for display only for GIMP_COMPONENT_TYPE_U8.

This might be an lcms bug, the code can be enabled again for U16 and
U32 if it's indeed an lcms bug and it gets fixed.
2015-06-29 10:22:22 +02:00
Michael Natterer db09d0f3d3 app: move functions to create layers to new files gimplayer-new.[ch] 2015-06-17 13:21:01 +02:00
Michael Natterer c876e281b1 Bug 750874 - Displayed colors look clipped after profile conversion...
but they aren't clipped

Add gimp_display_shell_profile_can_convert_to_u8() which returns
whether the lcms transform can safely write directly into an u8 buffer
without destroying out-of-gammut pixel values, which we assume is the
case for all integer formats. If the function returns FALSE, always
convert via the R'G'B'A float filter_buffer.

Also connect to the image's "precision-changed" signal and update the
profile transform when it's emitted.
2015-06-13 00:27:21 +02:00
Michael Natterer 5cdbf6ae33 app: always use an RGB format as source format for display color management 2015-06-12 20:15:19 +02:00
Michael Natterer 4910c28957 libgimpcolor: rename the gimp_lcms_*() functions to gimp_color_profile_*()
because it doesn't make sense to call the typedef GimpColorProfile
but the function namespace gimp_lcms_*().
2015-06-03 09:41:23 +02:00
Michael Natterer 460948e068 app: add member GimpDisplayShell.filter_format
and use it where we used to hardcode "R'G'B'A float".
2015-06-02 00:01:28 +02:00
Michael Natterer 08545ad549 app: switch gimpdisplayshell-render.c to the new profile filter code
- disable auto-adding of the lcms display filter module

- change profile convert dest formats to be always R'G'B'A, a display
  profile transform outputs something that can be displayed directly,
  so no additional gamma transform must happen when the pixels are
  copied to a cairo-ARGB32 buffer

- add a medium forest of if() branches to gimpdisplayshell-filter.c
  which cover all combinations of profile and display filter
  transforms

- all of this is still very broken when changing an image to linear,
  because the configured RGB profile from prefs will do horrible
  nonsense (things work fine though with a per-image profile that is
  for linear data)
2015-06-01 23:30:03 +02:00
Michael Natterer 1b9a8b71ba app: add gimp_display_shell_has_filter()
which checks if there are any filters active on the display.
2015-06-01 08:16:12 +02:00
Michael Natterer 2e07e938f4 app, libgimpcolor: never return NULL in GimpColorManaged::get_color_profile() 2015-05-30 22:23:25 +02:00
Michael Natterer 281a529b0c app: use gimp_color_managed_get_color_profile()
instead of gimp_image_get_color_profile() and remove all fallback
code, GimpColorManaged always returns a profile.
2015-05-30 00:58:22 +02:00
Michael Natterer e06a620d11 app: rename gimp_image_get_profile() to _get_color_profile() 2015-05-30 00:47:13 +02:00
Michael Natterer 8b824305a0 app: update the display profile transform when the color config changes 2015-05-27 12:30:32 +02:00
Michael Natterer 8ded5c40e3 app: update the display profile transform when display filter change
because they will share buffers.
2015-05-27 12:29:42 +02:00
Michael Natterer 3267218143 app: add gimpdisplayshell-profile.[ch]
which will take over display color management from the display
filter module. This is WIP, the code is still unused.
2015-05-27 12:28:33 +02:00
Michael Natterer 6b0b774302 libgimpwidgets: add gimpwidgetsutils.[ch]
Move some functions from libgimpwidgets/gimpwidgets.[ch]
and from app/widgets/gimpwidgets-utils.[ch]. Newly add
gimp_widget_get_color_profile() which is extracted from
modules/display-filter-lcms.c.
2015-05-06 22:15:30 +02:00
Michael Natterer 072cb068b2 app: add a "detach" button to all on-canvas tool dialogs
which turns them from being automatically attached/detached (depending
on canvas size) into always being a separate window.
2015-05-01 18:00:05 -04:00
Michael Natterer 4ea6f6dd28 app: minor formatting cleanup in gimpdisplayshell-tool-events.c 2015-04-18 08:40:31 +02:00
Michael Natterer 6f104ff2ac Bug 747224 - Too easy to accidentially close an image tab
Show the close button only on the active tab, so it's not
accidentially hit when changing between images.
2015-04-03 20:28:57 +02:00
Michael Natterer 2e316a342e app: change the image window icon size from 32x32 to 64x64, because it's 2015 2015-03-29 21:50:34 +02:00
Mukund Sivaraman 2c80affe4c app: Include commit hash in display shell message 2015-03-12 12:07:45 +05:30
Michael Natterer ce29043315 app: some cleanup in GimpCanvasBufferPreview 2015-03-01 00:18:10 +01:00
Marek Dvoroznak 10255eddbb app: npd-tool: add option to apply or cancel the deformation 2015-02-27 20:21:52 +01:00
Marek Dvoroznak 781f0b79f8 app: add canvas buffer preview
It is used by n-point deformation tool to preview a deformation process.
2015-02-27 20:21:52 +01:00
Joao S. O. Bueno 2746544328 Add new codes for title bar: '%e' for offsets, '%r' for rotation 2015-01-29 11:06:54 -02:00
Kristian Rietveld cea42c73d8 app: fix implicit enum casting
Silences clang.
2015-01-10 00:02:28 +01:00
Michael Natterer c17e8b0412 app: add crosshair drawing to GimpCanvasAnchor and use it in GimpPaintTool
instead of drawing the crosshair cursor manually.
2014-11-18 23:06:43 +01:00
Alexia Death 7c00dcd71d app: use variable buffer length for a more stable direction 2014-11-17 21:36:06 +02:00
Alexia Death b161253939 app: refactor all motion managment to use scale factors passed with coords 2014-11-17 00:03:13 +02:00
Alexia Death 9a953a9239 app: locking brush size to zoom 2014-11-17 00:03:10 +02:00
Michael Natterer 225a0ce27c Bug 567333 - Using tab to toggle docked "utility windows" does not...
...bring focus back to GIMP image window

When showing docks in multi-window-mode, try to set the keyboard focus
back to the active display because it might have been stolen by a dock.
2014-10-29 23:34:41 +01:00
Michael Natterer c5ed3e56c9 Bug 735505 - Weird Characters in Zoom Button
On windows, use a normal space instead of U+2009 THIN SPACE for
separating the scale percentage from the percent sign.
2014-09-27 23:48:39 +02:00
Michael Natterer 53f4dda3b4 Bug 735894 - Option to display the image ICC profile...
...on the title bar and status bar

Implement %o for the title and status format strings, which expands
to the image profile's label.
2014-09-03 22:20:36 +02:00
Mukund Sivaraman a805f8426a app: Use gint64 for dirty_time 2014-08-25 19:55:29 +05:30
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 a6601d563b app: some GimpProgress cleanup
- change start() and set_text() to use "format" and "..." instead of
  "message", allowing to format progress messages in place
- s/cancelable/cancellable/
- move "cancellable" to be the second argument of start()
2014-07-12 23:45:20 +02:00
Michael Natterer d0a6d95dad app: remove a bunch of file-utils.h includes 2014-07-08 00:23:34 +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 0f8d84d5e9 app: port all file_open() and file_save() functions to GFile 2014-07-07 23:58:11 +02:00
Michael Natterer 52032961c2 app: add (disabled) code that blits the image directly from the graph
bypassing the projection buffer.
2014-07-03 20:52:02 +02:00
Michael Natterer c88800e840 app: add gimp-priorities.h and keep the most important priorities there
also add comments with all predefined priorities as documentation.
2014-07-02 04:47:24 +02:00
Michael Natterer 2d2bdbd48f app: implement GimpCanvasItem::hit() in GimpCanvasProgress
Allow hits only on the progress text. Hackish proof-of-concept hack.
2014-06-30 03:40:34 +02:00
Michael Natterer 2ac5ab7dc3 app: don't use the projection in gimpdisplayshell-render.c
The image implements the GimpPickable interface too.
2014-06-29 23:11:53 +02:00
Michael Natterer 34dd127ace app: don't include gimpprojection.h in gimpdisplayshell-scroll.c
It's not needed.
2014-06-29 23:11:12 +02:00
Michael Henning 2e3e4597ef app: Slight cleanup in gimpdisplayshell-rotate-dialog.c 2014-06-29 14:58:12 -04:00
Michael Natterer 78bc7ac94e app: improve and clean up the canvas rotation dialog
Make the action area buttons behave less unexpected, and add and angle
dial.
2014-06-26 13:48:12 +02:00
Michael Natterer a665c30823 app: gimp_spin_button_new() -> gtk_spin_button_new() 2014-06-21 22:39:37 +02:00
Michael Natterer 921bd34495 app: fix GimpCanvasProgress' extents for short progress texts 2014-06-19 23:29:00 +02:00
Michael Natterer 3af1fff5af app: make the first image jump to the center of the canvas before rendering
Make GIMP_DISPLAY_SHELL_FILL_IDLE_PRIORITY a bit higher than
GIMP_PROJECTION_IDLE_PRIORITY which is the priority of chunk
rendering.
2014-06-17 23:29:24 +02:00
Michael Natterer 21a8f9c96b app: add boolean "mask_inverted" to GimpDisplayShell
and to gimp_display_shell_set_mask(). It allows to choose whether the
mask is drawn inverted, instead of always drawing it inverted.
2014-06-11 21:33:57 +02:00
Michael Natterer cd479ce04e app: add an "auto overlay" API to GimpToolGui
which makes tool dialogs auto-overlay if the canvas is large
enough. Set all tools dialogs except GimpImageMapTool's dialog to
auto.
2014-06-09 03:08:43 +02:00
Michael Natterer 17bd4d2c28 app: make GimpOverlayDialog's title and icon-name settable after construction 2014-06-09 01:42:09 +02:00
Michael Natterer 8e948d29e0 app: properly disconnect from the old shell in gimp_tool_dialog_set_shell()
Also clean up the function a bit.
2014-06-05 22:19:23 +02:00
Øyvind Kolås 69b7cda375 app: fix projection and display render chunk-size envvars 2014-06-04 02:07:08 +02:00
Michael Natterer 2c4d5e4391 app: make projection chunk size and display render chunk size configurable
Set the GIMP_PROJECTION_CHUNK_SIZE and GIMP_DISPLAY_RENDER_BUF_SIZE
environment variables to "WIDTHxHEIGHT".
2014-06-04 01:23:41 +02:00
Michael Natterer c78d82a43c app: render/update the visible part of the image first
Set the active display's viewport as priority rectangle on the image.

Update the rectangle in the default implementations of
GimpDisplayShell::scaled(), ::scrolled() and ::rotated(), which isn't
entirely correct yet but much better than before, and the only "bad"
thing that can happen with a bogus priority rectangle is that the
image is updated as out-of-viewport as before, just differently.
2014-05-31 02:36:25 +02:00
Michael Natterer 9b341d05bb app: remove GimpArea and use cairo_region_t instead
This may or may not remove some logic that avoids drawing tiny update
regions, and may or may not improve things or make them worse. Will
add code that actually tile-aligns update areas later.
2014-05-31 01:26:06 +02:00
Michael Natterer bb8d65bcee Bug 730862 - Preview frozen while dragging selection tools...
...(crop, rectangle, etc) in large image zoomed-to-fit

Introduce a hash of the last 16 used icons in GimpStatusbar, it was
loading icons at a very high frequency. Found by Massimo.
2014-05-30 19:40:11 +02:00
Michael Natterer dd0098524f app: add a little hint about reporting bugs against unstable git 2014-05-27 21:58:10 +02:00
Michael Henning 6923f49b0d app: Fix broken header guards. 2014-05-25 20:50:56 -04:00
Michael Natterer 453882c81e app: add gimp_tool_gui_set_icon_name() 2014-05-22 23:29:24 +02:00
Michael Natterer d3966c2c90 app: add more accessors to GimpGrid and use them instead of grid->foo 2014-05-21 21:44:28 +02:00
Michael Natterer 5e2ded5020 app: add gimp_grid_get_spacing() and gimp_grid_get_offset()
and do the rounding to integer there instead of in several places.
2014-05-21 21:25:41 +02:00
Michael Natterer 08c6aefa23 Bug 588512 - Grid Spacing errors depending on unit
Always round grid spacings and offsets to integer precision when
using them for snapping and grid drawing. While we might *want* to
have subpixel precision grids, all the UI is pretending it to be
on pixel boundaries. Make that pretense an fact.
2014-05-21 20:43:05 +02:00
Michael Natterer bbf01ebabf libgimpwidgets, app: add gdk_screen_get_monitor_workarea()
to the gimp3migration hack and use it where appropriate, so in the
gtk3-port branch windows will not overlap with docks, panels etc.
2014-05-19 14:37:32 +02:00
Michael Natterer 65a65947d9 app, libgimp: replace GTK_STOCK_FOO by icon names
unless it's a stock ID used for an action button, will address that
later.
2014-05-11 22:49:22 +02:00
Michael Natterer 7d0b326359 app: add gimp_widget_load_icon() as replacement for gtk_widget_render_icon()
...and use it instead.
2014-05-08 09:11:31 +02:00
Michael Natterer 0d2d1c3752 app: port most of app's GUI from stock IDs to icon names
There is still quite some stock ID rendering around, stay tuned...
2014-05-07 15:30:38 +02:00
Michael Natterer 23037b5230 app: convert all stock IDs kept around by the core by icon names
Particularly GimpViewable's stock_id. Make sure old config files
containing stock IDs are still properly parsed.
2014-05-07 01:01:56 +02:00
Michael Natterer 4202d29347 app: update GimpDisplayShell's monitor resolution when changing monitors
so the image size adapts when dot-for-dot is off.
2014-05-03 17:19:10 +02:00
Michael Natterer c7f8ccb4e1 app: make sure image windows end up on the intended monitor
In gimp_image_window_new(), place the window on the right
monitor manually if we are not in single-window-mode.

In gimp_image_window_switch_page(), make sure we don't use an
unrealized new window's monitor for updating the session info, because
the monitor of an unrealized window is always where the pointer is.
2014-05-03 09:40:54 +02:00
Michael Natterer 8356003fa2 app: pass the startup monitor to displays opened from the copmmand line
Change gimp_get_display_name() to also return the screen, and its
implementation in the GUI to return the initial monitor during
startup. Retrieve that information in app.c using a weird callback
construct and pass the monitor to file_open_from_command_line().

Half-related, add screen and monitor parameters to GimpDisplayShell
and use these initial values for calculating the canvas's initial
extents.

The image windows still don't position themselves correctly though
because we have no mechanism for that whatsoever just yet, but we now
at least pass the needed monitor information to the right objects.
2014-05-03 00:54:20 +02:00
Michael Natterer 7cdede6dec app: rename gimp_get_screen_resolution() to get_monitor_resolution()
Add a "monitor" parameter and return something reasonable, instead
of a useless resolution average of all the screen's monitors. Also
require a screen to be passed now.
2014-05-02 23:58:14 +02:00
Michael Natterer 7f23fbec34 app: add screen and monitor to all display and image window constructors
so they appear on the proper monitor as well.
2014-05-02 20:21:41 +02:00
Michael Natterer 843866e7e7 app: make things behave more reasonable with multiple monitors
There is now a preference option that determines whether windows
should be opened on the same monitor as before. It should be disabled
when the machine gets monitors plugged/unplugged dynamically ("laptop")
and enabled when there is a static multi-monitor setup ("wokstation").
This is merely the current simplistic policy on top of the newly added
underlying infrastructure:

- pass integer monitor numbers around in all places where we already
  pass around a GdkScreen. Pass the "current" monitor to these changed
  APIs, where "current" is either the monitor where the action-triggering
  widget is, or if that is unavailable the monitor where the mouse is.

- add gimp_widget_get_monitor() in order to easily get to the monitor,
  just like gtk_widget_get_screen().

- add screen and monitor parameters in some places that were missed
  before.

- in sessionrc, save all window positions relative to the window's
  monitor, and save the monitor separately, if it's not the screen's
  primary monitor.

- when restoring window positions, use the stored monitor when the new
  prefs options says so (use the screen's primary monitor if there is
  no stored monitor), otherwise use current monitor that is now passed
  around.
2014-05-02 03:01:23 +02:00
Michael Natterer f04b2d4a19 app: remove GimpBucketFillMode from gimp_display_shell_dnd_bucket_fill()
because it's not used any longer, and rename the function to
gimp_display_shell_dnd_fill().
2014-04-29 00:25:02 +02:00
Michael Natterer 2088c3efdf app: move some more stuff out of the "now" part of gimp_display_shell_flush()
so it's not needlessly called during painting.
2014-04-21 23:57:57 +02:00