Commit Graph

21 Commits

Author SHA1 Message Date
60d24b4c04 app: get rid of #ifdef USE_CAIRO_REGION almost everywhere
get replaced by GDK region functions and use the cairo region
functions unconditionally all over the place.
2010-10-22 19:58:11 +02:00
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
cfa17dc744 app: fix last fix for the region leak...
The fix was bogusly destroying a region that is still needed
for the last end_change() if the change count is > 1.
2010-10-02 21:52:42 +02:00
b392ae6515 app: don't leak the changed region in gimp_canvas_item_end_change() 2010-10-02 19:57:41 +02:00
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
f0d01f611c app: don't bother to emit an "update" region if no handler is connected
because constructing the region can be expensive. Also make sure not
to use g_object_set() if nothing would change to further reduce
"update" emissions.
2010-10-01 17:43:41 +02:00
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
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
201bfe3e25 app: add a "shell" property to GimpCanvasItem
and pass it to all constructors. The GimpDisplayShell is needed
because items are going to become more powerful soon.
2010-10-01 14:13:45 +02:00
238683e7d6 app: add gimp_canvas_item_get_highlight() 2010-09-29 23:46:36 +02:00
7b5316825c app: turn GimpCanvasItem's stroke() and fill() into virtual functions 2010-09-29 23:40:45 +02:00
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
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
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
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
5f349c352f app: nicer fill style for canvas items
Let's see if this works for anything else but filled handles
2010-09-23 00:11:49 +02:00
ddcd5a6983 app: workaround warning about empty private struct 2010-09-22 23:38:08 +02:00
d0f6846ff5 app: remove premature canvas item extents caching optimization again 2010-09-22 10:33:41 +02:00
f17cc0093d app: minor cleanup and fixes 2010-09-19 23:46:06 +02:00
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
69a898cc9f app: some cairo tool drawing infrastructure for review, please have a look 2010-09-19 19:45:51 +02:00