Commit Graph

21 Commits

Author SHA1 Message Date
Ell 23617c943b app: add gimp_canvas_item_untransform_viewport()
... which untransforms the viewport from display space to the
item's coordinate space (i.e., scaled and translated image space).
2019-09-04 20:51:43 +03:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +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 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 0add37a6cc app: remove GimpDisplayShell parameters from all GimpCanvasItem vfuncs
and get the shell from gimp_canvas_item_get_shell() if needed.  Remove
some cairo_translate() that didn't have any effect and were leftovers
from a very early canvas item code.
2013-04-18 16:46:01 +02:00
Michael Natterer 64c929a1d1 app: add an own GimpCanvasItem API for transforming coords
and use it in all subclasses. Removes all gimpdisplayshell-transform
dependency from all item implementations.
2013-04-18 16:46:00 +02:00
Michael Natterer e03a25caeb app: add virtual function gboolean GimpCanvasItem::hit()
and implement it for GimpCanvasHandle and GimpCanvasGroup.
2011-03-28 18:54:02 +02:00
Michael Natterer 479082075b app: use cairo_region_t for canvas items if cairo >= 1.10 is available
This is a gross hack that typedefs around between GdkRegion and
cairo_region_t and has some evil #ifdefs. This is going to die
immeditately once we can depend on cairo 1.10.
2010-10-18 20:01:05 +02:00
Michael Natterer 10111126ae app: add a "visible" property and API to GimpCanvasItem
and use it to set visibility of guides and sample points, so this
reression is fixed.

- return NULL extents for invisible items and never draw them
- do nothing for invisible items in more places, like the group

While hacking this, it turned out that it was a braino to collect an
item's region before and after a change in
dispatch_properties_changed(), so a new update had to be devised:

- add a "change count" and new API begin_change()/end_change()
- in begin_change(), remember the item's extents before the change
- in end_change(), combine old and current extents and emit "update"
- add some protected function to emit "update", and to figure if
  it makes sense at all to emit "update" on an item.
2010-10-01 20:41:27 +02:00
Michael Natterer d9cd9f8a07 app: add an "update" signal to GimpCanvasItem
which gets emitted when the item wants to be redrawn:

- Emit "update" it when any item property changes
- Groups connect to their children and forward "update" for them
- The shell connects to its group of canvas items and exposed
  the affected area
- Remove gimp_display_shell_expose_item()
- Move all the shell's item group code into gimpdisplayshell-items.c
2010-10-01 17:13:00 +02:00
Michael Natterer d3f19baf0d app: remove "shell" parameter from GimpCanvasItem's public APIs
because each item has a shell now. Keep the parameter in the virtual
functions though because that saves a lot of code in the subclasses.
2010-10-01 14:54:53 +02:00
Michael Natterer 238683e7d6 app: add gimp_canvas_item_get_highlight() 2010-09-29 23:46:36 +02:00
Michael Natterer 7b5316825c app: turn GimpCanvasItem's stroke() and fill() into virtual functions 2010-09-29 23:40:45 +02:00
Michael Natterer d7cb20b0d5 app: add group filling support to GimpCanvasItem and GimpCanvasGroup
The code is almost identical to the group stroking feature.
2010-09-27 22:59:36 +02:00
Michael Natterer b0a22bc285 app: change the default item line cap to round
but add and API to configure it and set it to suare for handles which
are always axis-aligned.
2010-09-26 17:40:10 +02:00
Michael Natterer e6ce564de4 app: add an infrastructure that allows to stroke multiple items at once
In order to avoid visually overlapping lines:

- GimpCanvasItem got a "suspend_stroking" API that allows to skip
  stroking and instead starts a new sub-path
- GimpCanvasGroup got a "group_stroking" API that sets suspend_stroking
  on all its children and does one stroke after calling all items'
  draw().
2010-09-26 14:12:54 +02:00
Michael Natterer e074d4d151 app: move the GimpCanvasItem typedef to display-types.h 2010-09-25 17:17:02 +02:00
Michael Natterer d1d89e0dde app: add a "highlight" mode for the tool FG style
such a hack, but looks better than dashed lines
2010-09-23 19:25:22 +02:00
Michael Natterer d0f6846ff5 app: remove premature canvas item extents caching optimization again 2010-09-22 10:33:41 +02:00
Michael Natterer 96bdf1fec5 app: refactor the canvas items to return a GdkRegion as extents
instead of invalidating the canvas themselves.
2010-09-19 23:20:36 +02:00
Michael Natterer 69a898cc9f app: some cairo tool drawing infrastructure for review, please have a look 2010-09-19 19:45:51 +02:00