Commit Graph

2243 Commits

Author SHA1 Message Date
d88a348c18 app: add public API for the "guide-style" and "sample-point-style" properties
of the guide and sample point canvas items. They are too obscure to
additionally hide them, and these items are used rarely enough to
justify the additional parameter to the new() functions.
2010-10-03 22:14:40 +02:00
96df3c2a08 app: formatting 2010-10-03 02:39:04 +02:00
0b4bb51750 app: need to actually set the extents of the pen, not only calculate them 2010-10-03 02:31:54 +02:00
f3450431a3 app: add a pen canvas item class and use it in the foreground select tool
Remove gimp_display_shell_draw_pen().
2010-10-03 02:26:40 +02:00
ba6aa8258e app: implement the "points" property using GimpArray
instead of poking into private from new(). This way the item is
properly subclassable.
2010-10-03 01:43:22 +02:00
dbce9d49d9 app: fix scrolling in of dashed lines
Before, the pattern offset was always relative to the widget, which
completely destroyed the stipples when the got scrolled in. Now we
simply set the shell's scroll offsets as cairo translation and
everything looks perfect.
2010-10-03 00:52:46 +02:00
3e69ae0039 app: add a layer boundary canvas item class
and use it to draw the layer boundary. Remove a lot of stuff
that was there only to draw the boundary before:

- remvoe all layer boundary stuff from the selection code
- remove gimp_display_shell_draw_layer()
- remove enum values GIMP_SELECTION_LAYER_ON,OFF from core-enums.h
- remove all lines calling gimp_image_selection_control() with
  the removed enum values
- remove gimp_layer_boundary()
2010-10-03 00:28:40 +02:00
dd4f27ed4f app: remove gimp_display_shell_set_cursor_style() 2010-10-02 22:11:52 +02:00
7ffa463273 app: remove obsolete includes 2010-10-02 22:07:31 +02:00
1d45f6295e app: add a software cursor canvas item
and use it to draw the sw cursor. Almost every aspect of the old code
was ugly and hard to read, this is so much nicer...
2010-10-02 21:56:36 +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
cad95533dd app: queue a draw on the canvas in gimp_canvas_set_bg_color()
Instead of doing it in gimp_display_shell_set_padding() from where
it's called.
2010-10-02 21:13:31 +02:00
502d7c815b app: add a canvas grid item class and use it to draw the grid
Remove gimp_display_shell_draw_grid().
2010-10-02 20:57:40 +02:00
2731a9c7b9 app: manage the stroking/filling state of child items correctly in all cases
It was correct only for the currently existing use cases.
2010-10-02 19:58:35 +02:00
b392ae6515 app: don't leak the changed region in gimp_canvas_item_end_change() 2010-10-02 19:57:41 +02:00
d6f343943b app: fix text cursor extents so it doesn't leave artifacts 2010-10-02 19:49:59 +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
26d0035be0 app: draw guides using GimpCanvasItems
- Add signals GimpImage::guide_added(), removed() and moved()
- Remove singal GimpImage::update_guide()
- Adapt core code to emit the new signals instead of update_guide()
- Have the shell connect to the new signals and update guide canvas
  items as needed
- Remove gimp_display_shell_draw_guides()
2010-10-01 10:34:15 +02:00
3b4f2ec94c app: add a GimpCanvasProxyGroup that will be used for guides 2010-10-01 10:33:39 +02:00
0c613ba87d app: port sample point drawing to GimpCanvasItems
- Add GimpImage signal "sample-point-moved" and emit it when needed
- Let the shell connect to the sample point add, remove and move signals
  and update the canvas items accordingly
- Remove gimp_display_shell_draw_sample_points()
2010-10-01 09:27:57 +02:00
0f73269484 app: remove "item" parameter from gimp_canvas_proxy_group_remove_item() 2010-10-01 09:27:57 +02:00
75b4c8096f app: add a proxy group which will keep sample point canvas items 2010-10-01 09:27:57 +02:00
f6314b4896 app: add GimpCanvasProxyGroup
which is a group that keeps a mapping between arbitrary pointers and
canvas items. No MVC whatsoever yet, just a simple hash table.
2010-10-01 09:27:57 +02:00
14f9074675 Remove unused code 2010-09-30 23:01:33 +05:30
bab2c37f48 app: don't include "core/gimpsamplepoint.h" 2010-09-30 13:28:04 +02:00
2a67bfcb10 app: document the new display title option 2010-09-30 10:14:43 +02:00
26f6f2992a app: remove GIMP_SAMPLE_POINT_DRAW_SIZE from gimpsamplepoint.h
and add it to gimpcanvassamplepoint.c, it doesn't need to be public
any longer.
2010-09-30 10:12:15 +02:00
f03cf53e0c Convert tabs to spaces in last commit 2010-09-30 12:54:26 +05:30
fee8f4008e Avoid overflow in expression 2010-09-30 12:47:19 +05:30
ad331d5626 app: minor cleanup in gimp_display_shell_expose_item() 2010-09-30 09:05:55 +02:00
7f1cadddd0 app: use temporary canvas items for exposing guides and sample points
and remove gimp_display_shell_expose_guide() and _sample_point().
2010-09-30 09:02:36 +02:00
aa47dd22f0 app: Support 'M' for 'megapixels' in image title format string 2010-09-30 08:07:20 +02:00
cbd1d8cd51 app: remove gimp_display_shell_draw_sample_point()
and draw all sample points in gimp_display_shell_draw_sample_points().
2010-09-30 01:37:28 +02:00
0d11be8fed app: add a canvas sample point item class
and use it in gimp_display_shell_draw_sample_point().
2010-09-30 01:14:23 +02:00
9d36984d37 app: remove the now obsolete gimp_display_shell_draw_guide()
and draw the guides in gimp_display_shell_draw_guides().
2010-09-30 00:23:06 +02:00
5a4bcb8c3d app: use a temporary GimpCanvasGuide to draw guides guides 2010-09-30 00:02:21 +02:00
50755d81f3 app: override GimpCanvasItem::stroke() and optionally stroke in guide style 2010-09-30 00:01:31 +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
1f8a835e40 app: fix GimpCanvasBoundary's extents 2010-09-29 23:24:01 +02:00
fe5b6eddc0 app: indentation 2010-09-29 22:20:02 +02:00
7edfa2ca54 app: start an infrastructure where the shell keeps around its canvas items
- Invalidate the proper area when an item gets added or removed.
- Draw the kept canvas items instead of calling a draw tool function.
- The draw tool now sets its item on the shell.
2010-09-29 22:12:01 +02:00
42e137fc74 app: rename gimp_display_shell_draw_area() to draw_image() 2010-09-29 20:58:13 +02:00
2ef259cd20 app: use GimpRGB as mask color
Instead of passing GimpChannelType as mask color to
gimp_display_shell_set_mask(), change that function to accept a
GimpRGB color.

Adapt GimpForegroundSelectTool, the only user of the display mask
feature, to this change.
2010-09-29 20:35:00 +02:00
a7413bd784 app/display: implement drawing of selection mask
Use cairo_mask_surface() to render the selection mask (as used by
the foreground selection tool).
2010-09-29 20:35:00 +02:00
1eb77f6360 app/display: refactor RenderInfo code 2010-09-29 20:34:59 +02:00