head 1.41; access; symbols goocanvas-0-4:1.17.0.2 GOO_CANVAS_0_4_ANCHOR:1.17 V0_3:1.10 V0_2:1.1.1.1 DAMON:1.1.1; locks; strict; comment @# @; 1.41 date 2008.04.27.11.51.37; author damon; state Exp; branches; next 1.40; commitid SOILJRpOUq1p3K0t; 1.40 date 2008.03.27.14.08.54; author damon; state Exp; branches; next 1.39; commitid nw6pObMv6VEjOLWs; 1.39 date 2007.11.18.14.26.20; author damon; state Exp; branches; next 1.38; commitid MTDTacjSVNH354Gs; 1.38 date 2007.11.13.14.30.51; author damon; state Exp; branches; next 1.37; commitid Flt73BehcadTgqFs; 1.37 date 2007.06.20.12.59.48; author damon; state Exp; branches; next 1.36; 1.36 date 2007.06.19.11.22.53; author damon; state Exp; branches; next 1.35; 1.35 date 2007.05.15.14.01.51; author damon; state Exp; branches; next 1.34; 1.34 date 2007.05.14.09.51.25; author damon; state Exp; branches; next 1.33; 1.33 date 2007.05.11.16.30.46; author damon; state Exp; branches; next 1.32; 1.32 date 2007.04.30.21.09.45; author damon; state Exp; branches; next 1.31; 1.31 date 2007.04.25.11.08.25; author damon; state Exp; branches; next 1.30; 1.30 date 2007.04.03.09.58.05; author damon; state Exp; branches; next 1.29; 1.29 date 2007.02.27.14.45.07; author damon; state Exp; branches; next 1.28; 1.28 date 2007.02.25.17.37.56; author damon; state Exp; branches; next 1.27; 1.27 date 2007.02.20.22.54.46; author damon; state Exp; branches; next 1.26; 1.26 date 2007.02.20.14.22.03; author damon; state Exp; branches; next 1.25; 1.25 date 2007.02.19.11.16.14; author damon; state Exp; branches; next 1.24; 1.24 date 2007.02.17.13.48.35; author damon; state Exp; branches; next 1.23; 1.23 date 2007.02.15.14.18.50; author damon; state Exp; branches; next 1.22; 1.22 date 2007.02.13.12.32.44; author damon; state Exp; branches; next 1.21; 1.21 date 2007.02.09.13.41.03; author damon; state Exp; branches; next 1.20; 1.20 date 2007.02.04.18.02.30; author damon; state Exp; branches; next 1.19; 1.19 date 2007.02.01.01.19.04; author damon; state Exp; branches; next 1.18; 1.18 date 2006.12.09.12.08.38; author damon; state Exp; branches; next 1.17; 1.17 date 2006.08.27.12.20.40; author damon; state Exp; branches; next 1.16; 1.16 date 2006.08.24.08.06.22; author damon; state Exp; branches; next 1.15; 1.15 date 2006.07.26.15.45.42; author damon; state Exp; branches; next 1.14; 1.14 date 2006.06.08.08.45.26; author damon; state Exp; branches; next 1.13; 1.13 date 2006.06.01.09.59.24; author damon; state Exp; branches; next 1.12; 1.12 date 2006.05.27.18.27.05; author damon; state Exp; branches; next 1.11; 1.11 date 2006.05.12.14.42.10; author damon; state Exp; branches; next 1.10; 1.10 date 2006.04.22.19.17.28; author damon; state Exp; branches; next 1.9; 1.9 date 2006.04.18.15.43.07; author damon; state Exp; branches; next 1.8; 1.8 date 2006.04.11.13.33.19; author damon; state Exp; branches; next 1.7; 1.7 date 2006.04.08.13.14.17; author damon; state Exp; branches; next 1.6; 1.6 date 2006.04.03.11.24.02; author damon; state Exp; branches; next 1.5; 1.5 date 2006.03.24.17.32.22; author damon; state Exp; branches; next 1.4; 1.4 date 2006.03.24.16.55.44; author damon; state Exp; branches; next 1.3; 1.3 date 2006.03.23.16.58.48; author damon; state Exp; branches; next 1.2; 1.2 date 2006.03.22.23.49.44; author damon; state Exp; branches; next 1.1; 1.1 date 2005.12.15.15.32.00; author damon; state Exp; branches 1.1.1.1; next ; commitid 2dcb43a18c6f4567; 1.1.1.1 date 2005.12.15.15.32.00; author damon; state Exp; branches; next ; commitid 2dcb43a18c6f4567; desc @@ 1.41 log @0.10 release @ text @ NOTE: I am no longer actively developing GooCanvas, so no major new features will be added (unless a new maintainer takes over). I'll still try to fix any bugs that appear though, and may accept minor patches. Bugs: o I need to check the bounds are being calculated correctly so that they are correct for all zoom settings. Since cairo uses fixed point maths and I think only calculates up to a certain tolerance there might be slight errors in our gdouble results. So as the canvas is scaled this could eventually lead to the bounds being a pixel out, leading to painting errors. Maybe we should extend any bounds returned from cairo slightly to cover the maximum possible errors. o button press events are generating leave-notify and enter-notify signals. Seems to be a GTK+/X problem. o The GooCairo* types are used for some properties but aren't documented. Maybe we could point to the cairo docs. Features definitely needed: o API for modifying GooCanvasPath data. o Editable text item - a port of GtkTextView. o Tooltips - I have code to support tooltips using the new API in GTK+ 2.12. o Need a function to setup a given cairo context with the defaults settings of a GooCanvas, e.g. default line width. o Check canvas and all items can be completely configured with properties so that GtkBuilder can be used to load hierarchies of items/models. Add "root-item" and "root-item-model" properties? Will GtkBuilder be able to handle the tree of items/models like that? What about GUI builders? How can gradients be specified by object properties? Possible additional features: o Need a way to efficiently notify items about changes in canvas scale, if they request it. Could use something similar to the update flags. o Change GooCanvasStyle so it doesn't expose GValues in the API. Use get/set_boolean/int/double/boxed() instead. o Drag-and-Drop - probably copy all the GTK+ widget signals so items can implement their own behavior. o Caching of rendered items to improve performance. Items would have a cache option with choices like Never, Always and WhenVisible. o Sticky items that don't move at all as the canvas is scrolled & zoomed. o Filters like in SVG, to add graphical effects. o Support using the same item in different places, like SVG 'use'. o Support using system color names, like SVG, e.g. "ActiveBorder". This helps you write widget-like items that fit in with the rest of GTK+. o "scale-line-width" boolean property to specify if the line width scales with the canvas? The item bounds will change at different scale settings. o Arrows on path items, just like on polyline. Requests from GTK+ people: o Use separate GooCanvasContainer[Model] interfaces? May help bindings. o GooCanvasWidget width & height are redundant - use widget's requested size. o Make PathCommand and LineDash structs opaque. o Use floating flag and sink() for objects. o Use 1-byte integer percentage for xalign/yalign instead of doubles? o Make it easy to add a border and background to items. "border-width", "border-color" and "background-color" properties? Might also need "x-pad", "y-pad", "x-radius", "y-radius" etc. Maybe have a related border item. Note that we only have the bounds in device coords, so drawing a border of a rotated item would be awkward. (Maybe we store the user bounds somewhere.) o Link/URL item, or enable URLs in the markup of text items. o A button item, with different children displayed for different states, maybe with optional automatic prelighting. @ 1.40 log @2008-03-27 Damon Chaplin * src/goocanvasitem.c (goo_canvas_item_get_simple_transform): * src/goocanvasitemmodel.c (goo_canvas_item_model_get_simple_transform): new functions to do opposite of set_simple_transform(). * demo/mv-demo.c (test_simple_transforms): * demo/demo.c (test_simple_transforms): added some test code for above. @ text @d2 3 a4 5 For Next Release: o Document change/update/redraw architecture. o Document coordinate system - hierarchy of transformations + item properties. o Document creating new items better. @ 1.39 log @2007-11-18 Damon Chaplin * src/goocanvas.c: added support for "clear-background" property, patch from Grahame Bowland. @ text @d4 3 a6 2 o Function to return size of text in a GooCanvasText. o Document stuff needed for WYSIWYG - absolute font sizes & units. @ 1.38 log @2007-11-13 Murray Cumming * src/goocanvasitem.c: goo_canvas_item_add_child(): * src/goocanvasitemmodel.c: goo_canvas_item_model_add_child(): Add a debugging check to make sure the child is not the same as the parent, preventing an endless loop. 2007-11-13 Murray Cumming * src/goocanvasimage.c: goo_canvas_image_set_common_property(): Support setting the pixbuf property to NULL. 2007-11-13 Murray Cumming * src/goocanvas.c: goo_canvas_render(): Call goo_canvas_update() if necessary, as suggested by Damon, to fix a crash when rendering a GooCanvasTable that has never been shown on screen. @ text @a4 2 o Add "clear-background" patch? o Add similar function to gtk_container_child_set_property() for bindings. @ 1.37 log @2007-06-20 Damon Chaplin * src/goocanvas.c: added "automatic-bounds", "bounds-from-origin" and "bounds-padding" properties, used to calculate the canvas bounds automatically. * demo/demo.c (change_bounds_clicked): * demo/mv-demo.c (change_bounds_clicked): test the above. @ text @d2 9 a10 1 Bugs d28 1 @ 1.36 log @2007-06-19 Damon Chaplin * src/goocanvas.c: added "integer-layout" boolean property, to specify that all layout in the canvas (i.e. in GooCanvasTable) is done to the nearest integer. * src/goocanvastable.c: implement integer layout. * demo/table-demo.c: * demo/mv-table-demo.c: tests for integer layout. @ text @a58 4 o Implicit bounds - goo_canvas_set_bounds_implicit (gboolean from_origin, gdouble border_width); Also add properties like "implicit-bounds", "bounds-from-origin", "bounds-border". @ 1.35 log @2007-05-15 Damon Chaplin * src/goocanvas.c: added "scale-x" and "scale-y" properties to set the horizontal and vertical scale independently. Note that if items use the visibility threshold setting it will compare it to the minimum of scale_x and scale_y. * demo/demo.c: added "Scale X" and "Scale Y" spinbuttons. @ text @d15 2 a34 3 o "scale-line-width" boolean property to specify if the line width scales with the canvas? The item bounds will change at different scale settings. a37 3 o "integer-layout" property for GooCanvas so all containers like GooCanvasTable do layout in integers (i.e. on the pixel grid). d41 3 d51 3 @ 1.34 log @2007-05-14 Damon Chaplin * src/goocanvas.c (goo_canvas_set_property) (goo_canvas_set_bounds): queue a redraw of the widget. (goo_canvas_expose_event): clip to the canvas bounds if necessary. * demo/mv-demo.c (change_bounds_clicked): * demo/demo.c (change_bounds_clicked): test changing the bounds dynamically. @ text @a32 2 o "scale-x" and "scale-y" properties to allow setting different horizontal and vertical scales. We already seem to support this internally. @ 1.33 log @2007-05-11 Damon Chaplin * demo/demo-large-rect.c: * demo/demo-large-line.c: * demo/demo-large-items.c: new demo and items to show how to create a very large canvas and very large items. * src/goocanvasitemsimple.c (goo_canvas_item_simple_get_line_width): added utility function to get an item's line width. Also changed default line width property value to 2.0, and returned canvas line width setting if item's line width isn't set. * src/goocanvasrect.c (goo_canvas_rect_update): * src/goocanvaspolyline.c (goo_canvas_polyline_reconfigure_arrows): use the above function to get the line width. @ text @a11 3 o goo_canvas_set_bounds() doesn't update the display correctly. Currently you need to do something like goo_canvas_set_scale() afterwards. d70 2 @ 1.32 log @2007-04-30 Damon Chaplin * src/goocanvas.c (goo_canvas_create_cairo_context): if the GooCanvas isn't realized, use a temporary image surface to create the cairo_t. Hopefully that will result in exactly the same bounds of items. (goo_canvas_get_item): initialize item to NULL. @ text @d12 6 d27 6 d38 5 d47 3 d58 19 @ 1.31 log @2007-04-25 Damon Chaplin * demo/mv-scalability-demo.c: * demo/scalability-demo.c: instead of connecting signals to all items we just use a handler on the root item. Also added a switch to turn off the text items, to see the difference in performance (a lot). Without text items we can startup with 100,000 items in 1 second for a simple canvas, or 4 seconds for model-view (compared to 4 seconds and 7 seconds with text items). * src/goocanvasitemsimple.c (goo_canvas_item_simple_set_model): only setup the accessibility stuff if accessibility is enabled (as it is quite slow if you have lots of items). @ text @a3 6 o Currently the canvas widget must be placed in a GTK+ window before any calls are used that would cause a canvas update. This is because the canvas needs a window to create a cairo_t to do the position calculations. We may use a temporary image cairo_t in future to avoid this issue. d18 3 @ 1.30 log @2007-04-03 Damon Chaplin * Released GooCanvas 0.8 2007-04-03 Damon Chaplin * demo/mv-demo.c (create_canvas_primitives): * demo/demo.c (create_canvas_primitives): set the maximum scale to 50, since if we go above that we hit the cairo 16-bit limit and the large rectangle isn't painted correctly. * src/goocanvasitemsimple.c (goo_canvas_item_simple_install_common_properties): improved docs for fill/stroke properties. * src/goocanvaswidget.c (goo_canvas_widget_new) (goo_canvas_widget_set_widget): keep our own reference to the widget, rather than just relying on the canvas widget's reference. Otherwise once the widget is removed from the canvas we have an invalid pointer. @ text @a17 4 o GooCanvasImage - redrawing artifacts in demo when zoom>1. Seems to be a bug in cairo, introduced in 1.3.12. See http://bugs.freedesktop.org/show_bug.cgi?id=10508 d27 6 @ 1.29 log @2007-02-27 Damon Chaplin * Released GooCanvas 0.7 2007-02-27 Damon Chaplin * src/goocanvas.c (goo_canvas_get_items_in_area): new function to get items inside or outside a given area. * demo/demo.c: added little test for goo_canvas_get_items_at() and goo_canvas_get_items_in_area(). @ text @d4 17 a20 1 o There are no known bugs at present! d26 1 d31 1 a31 1 o Caching of rendered items to improved performance. Items would have a cache @ 1.28 log @2007-02-25 Damon Chaplin * src/*.c: checked over all finalize methods and moved code to dispose methods where appropriate. (Dispose methods should be used to unref any other objects.) This was done to help the Ruby bindings. It was a bit fiddly so it might cause a few bugs. * src/goocanvasutils.c (goo_cairo_matrix_copy) (goo_cairo_matrix_free): allocate and free with g_slice_new/free() as that is what was being used in GooCanvasItemSimple. * demo/scalability-demo.c: added a test for a very wide canvas, almost up to the 31-bit GDK window size limit. (It is slow to start though.) @ text @d4 1 @ 1.27 log @2007-02-20 Damon Chaplin * src/goocanvastable.c (goo_canvas_table_get_item_at) (goo_canvas_table_paint): if the table was shrunk below its requested size, clip the children if appropriate. * src/goocanvastable.c (goo_canvas_table_get_item_at) (goo_canvas_table_paint): * src/goocanvasgroup.c (goo_canvas_group_get_item_at) (goo_canvas_group_paint): check the bounds and handle the clip path. * demo/table-demo.c (create_demo_table): added parameters and created a second table of shapes, this time with the items shrunk and clipped. @ text @a3 1 o Demo text layout is changing when scale is changed. Maybe bug 341481. @ 1.26 log @2007-02-20 Damon Chaplin * src/goocanvastext.c (goo_canvas_text_create_layout): (goo_canvas_text_get_item_at): use the ink rect as well as the logical rect when calculating the bounds or doing hit-testing. * src/goocanvastable.c (goo_canvas_table_size_allocate_pass1): shrink homogeneous tables if appropriate. * src/goocanvaswidget.c (goo_canvas_widget_get_item_at): return the widget item if the point is within its bounds. * src/goocanvas.c (goo_canvas_render): if bounds are passed in set the clip path to the bounds. * demo/demo.c (write_pdf_clicked): added code to test clipped painting. @ text @d5 1 a5 1 o Table should clip children, if it had to shrink. @ 1.25 log @2007-02-19 Damon Chaplin * configure.in: * src/Makefile.am: rewrote the stuff that handles the autogeneration of goocanvasmarshal.[hc] and goocanvasenumtypes.[hc], copying what GTK+ does. It now has a --disable-rebuilds option to disable the autogeneration and it doesn't try autogeneration if Perl isn't available. @ text @a4 2 o Text item bounds should use ink rect, though layout maybe should use logical o Should clip in goo_canvas_paint() if bounds passed in? (e.g. for printing) @ 1.24 log @2007-02-17 Damon Chaplin * Released GooCanvas 0.6 2007-02-17 Damon Chaplin * src/goocanvasitemsimple.h (struct _GooCanvasItemSimpleClass): renamed create_path, update, paint and get_item_at class methods to simple_create_path, simple_update, simple_paint and simple_get_item_at. This avoids confusion with the GooCanvasItem interface methods with the same name (and may avoid problems with language bindings etc.) * src/goocanvasellipse.c (goo_canvas_ellipse_class_init): * src/goocanvasimage.c (goo_canvas_image_class_init): * src/goocanvaspath.c (goo_canvas_path_class_init): * src/goocanvaspolyline.c (goo_canvas_polyline_class_init): * src/goocanvasrect.c (goo_canvas_rect_class_init): * src/goocanvastext.c (goo_canvas_text_class_init): * src/goocanvaswidget.c (goo_canvas_widget_class_init): * demo/demo-item.c (goo_demo_item_class_init): * src/goocanvasitemsimple.c: updated use of above class methods. * src/goocanvasgroup.c (goo_canvas_group_update): handle children with empty bounds (i.e. ignore their bounds when computing the group's bounds). * src/goocanvastable.c (goo_canvas_table_paint) (goo_canvas_table_get_item_at): * src/goocanvasgroup.c (goo_canvas_group_get_item_at) (goo_canvas_group_paint): don't check the child bounds here. Leave it up to the children to do that. * src/goocanvasitemsimple.c (goo_canvas_item_simple_get_item_at) (goo_canvas_item_simple_paint): check the item's bounds here. @ text @a8 1 @ 1.23 log @2007-02-15 Damon Chaplin * src/goocanvasutils.c: * src/goocanvaspath.c: moved data structures and code for parsing and creating SVG paths from goocanvaspath.[hc] to goocanvasutils.[hc]. Added goo_canvas_parse_path_data() and goo_canvas_create_path() public functions. * src/goocanvasitemsimple.c: added "clip-path" and "clip-fill-rule" properties to specify the clip path and fill rule, and used these to calculate bounds, paint, and do hit testing. * src/goocanvasitemsimple.h (struct _GooCanvasItemSimpleData): added clip_path_commands and clip_fill_rule. * src/goocanvastext.c (goo_canvas_text_set_model): * src/goocanvasrect.c (goo_canvas_rect_set_model): * src/goocanvaspolyline.c (goo_canvas_polyline_set_model): * src/goocanvaspath.c (goo_canvas_path_set_model): * src/goocanvasimage.c (goo_canvas_image_set_model): * src/goocanvasgroup.c (goo_canvas_group_set_model): * src/goocanvasellipse.c (goo_canvas_ellipse_set_model): use goo_canvas_item_simple_set_model() rather than getting parent iface. (For GooCanvasTable this actually caused a crash as when it called the GooCanvasGroup function that got the parent iface which pointed to itself so it got into an infinite loop.) * demo/mv-demo-clipping.c: * demo/demo-clipping.c: new files for clipping demo pages. * demo/Makefile.am: * demo/mv-demo.c: * demo/demo.c: added clipping pages. @ text @d5 3 a7 3 o Text item bounds should use ink rect. o Should clip in goo_canvas_paint()? (e.g. for printing) o Table should clip children. @ 1.22 log @2007-02-13 Damon Chaplin * src/goocanvasitemmodel.c (goo_canvas_item_model_animate): * src/goocanvasitem.c (goo_canvas_item_animate): added "absolute" parameter, and rewrote the animation code, using the same code for GooCanvasItem and GooCanvasItemModel. * demo/demo-animation.c: * demo/mv-demo-animation.c: new files for animation demo pages. * demo/mv-demo.c: * demo/demo.c: added new animation pages and updated animation calls. @ text @d4 4 a7 2 o Demo text layout is changing when scale is 0.65. Maybe bug 341481. o Text item view bounds should use ink rect. a11 1 o Clip paths/masks for items. Also clip in paint()? @ 1.21 log @2007-02-09 Damon Chaplin * demo/demo-item.c (goo_demo_item_update): don't convert bounds to device space. * src/*.h: added padding to all *Class structs, to allow a bit of expansion without breaking backwards compatibility. * docs/*.xml: added example code to the introductory sections. Needs more explanation at some point. * configure.in: * src/Makefile.am: added libtool version numbers. @ text @a1 4 Better animation code - interpolate translation, scale & rotation separately and recalculate the transform at each step. a6 3 Plans for next release: @ 1.20 log @2007-02-04 Damon Chaplin * src/goocanvasitemsimple.c (goo_canvas_item_simple_check_style): fixed bug where if item was using its parent's style it wouldn't get updated. * */*: documented most of the other symbols. I just need to document the 2 main interfaces - GooCanvasItemIface and GooCanvasItemModelIface, check it all over for out-of-date docs, and document the optional model/view split a bit more. (And maybe a section on writing new items) @ text @a1 4 Do we need to make parts of GooCanvasItemSimple public, for subclasses? - things like canvas, parent, model, bounds, simple_data->style, simple_data->pointer_events are all needed for subclasses. a4 3 Add padding to class/object structs to allow a bit of extension in future without breaking backwards compatability. @ 1.19 log @2007-02-01 Damon Chaplin * src/goocanvastable.c: finished table item. I think the only API breakage this introduces is that GooCanvasItemSimple subclasses that override the update() class method must now return the bounds in user space rather than device space. (This is needed to do the table layout.) * demo/table-demo.c: added more test tables with various transforms and settings. * src/goocanvasitem.c (goo_canvas_item_get_requested_area) (goo_canvas_item_allocate_area) (goo_canvas_item_get_transform_for_child) : new functions and interface methods to support GooCanvasTable and other layout containers. * src/goocanvasitemsimple.c: added support for GOO_CANVAS_ITEM_HIDDEN, initialized the model's visibility setting to GOO_CANVAS_ITEM_VISIBLE. (goo_canvas_item_simple_update): split part of it out into goo_canvas_item_simple_update_internal and updated slightly. (goo_canvas_item_simple_get_requested_area) (goo_canvas_item_simple_allocate_area): new functions to support GooCanvasTable and other layout containers. (goo_canvas_item_simple_get_path_bounds): don't convert to device space as some code needs the bounds in user space. * src/goocanvas.c (goo_canvas_convert_to_item_space) (goo_canvas_convert_from_item_space): used the new goo_canvas_item_get_transform_for_child() function to get the transform for each item. * src/goocanvasutils.h: added GOO_CANVAS_ITEM_HIDDEN visibility setting which is used for items which are invisible and not allocated any space in containter items like GooCanvasTable. * src/goocanvasgroup.c (goo_canvas_group_get_item_at) (goo_canvas_group_paint): support GOO_CANVAS_ITEM_HIDDEN. * src/goocanvaspolyline.c (goo_canvas_polyline_compute_bounds): * src/goocanvasimage.c (goo_canvas_image_update): leave bounds in user space. * src/goocanvaswidget.c: updated to override the GooCanvasItemSimple update, paint & get_item_at methods instead of the interface methods, added support for GOO_CANVAS_ITEM_HIDDEN, and added goo_canvas_widget_allocate_area() implementation. * src/goocanvastext.c (goo_canvas_text_get_item_at): fixed bug that meant it didn't work for text items with no fill color/pattern set. @ text @d24 1 a24 1 o Clip paths/masks for items. @ 1.18 log @2006-12-09 Damon Chaplin * docs/goocanvas-sections.txt: * docs/goocanvas-docs.sgml: use separate sections for model objects, as gtk-doc doesn't support multiple objects per section. * docs/Makefile.am (SCANGOBJ_OPTIONS): added --query-child-properties argument to document child properties (needs cvs gtk-doc). * demo/table-demo.c: beginnings of demo for GooCanvasTable. @ text @d9 3 a19 3 o Support for containers similar to widgets like GtkTable. These would do a size-request/size-allocate procedure, and so would probably need changes to the current update methods. d24 1 d30 2 a32 1 o Clip paths/masks for items. @ 1.17 log @2006-08-27 Damon Chaplin * src/goocanvasview.c (goo_canvas_view_class_init): * src/goocanvasitemviewsimple.c (goo_canvas_item_view_simple_class_init) * src/goocanvasgroupview.c (goo_canvas_group_view_class_init): only register the accessible factories if accessibility is enabled (i.e. GtkWidget has registered a factory). * src/goocanvasitemviewsimple.c (goo_canvas_item_view_simple_setup_accessibility): * src/goocanvasgroupview.c (goo_canvas_group_view_set_group): only set the accessible title & description and connect the signal handlers if accessibility is enabled. (It would be better to not call atk_gobject_accessible_for_object() at all, as it isn't useful.) * demo/scalability-demo.c: start of new demo/test for scalability. We are currently hitting the cairo 16-bit limit (transformed coords can't be larger than 16-bit ints). A workaround would be nice. I also want to profile it and see if there are any major bottlenecks. (Creating canvases with thousands of items is very slow, though scrolling etc. is OK as long as the canvas is split into groups.) @ text @d2 8 a14 1 a16 1 o Support different units. Currently we assume everything is in pixels. @ 1.16 log @2006-08-24 Damon Chaplin * Released GooCanvas 0.4 2006-08-24 Damon Chaplin * src/*.c: updated docs to point to goo_canvas_view_get_item_view() as a simple alternative for setting up signal handlers. * src/goocanvasview.c (goo_canvas_view_pointer_ungrab): only call gdk_display_pointer_ungrab() if we have an active pointer grab. So maybe we can now use goo_canvas_view_pointer_ungrab() to ungrab passive grabs on canvas item views (need to test this though). @ text @d12 2 a13 2 a size-request/size-allocate procedure, and so would probably need to the current update methods. @ 1.15 log @2006-07-26 Damon Chaplin * src/goocanvasgroup.[hc]: added goo_canvas_group_set_model() function, to set the model of the root group. * src/goocanvasmodelsimple.c (goo_canvas_model_simple_init): use the above function. * src/goocanvas*view.c: support an optional transformation matrix for each view, which is combined with the underlying item's transform. (I'm not sure if this will overcomplicate things.) * src/goocanvasgroupview.c: support generic GooCanvasItems as the underlying group rather than just GooCanvasGroups. This allows us to use subclasses of GooCanvasGroupView easily. (goo_canvas_group_view_set_group): new function to set the underlying group item, creating child views and setting up signal handlers etc. @ text @d7 7 a13 4 o Emit item view signals on canvas view instead of item views? Currently setting up signal handlers is a bit awkward, and this would get rid of that. But the signal handler code would probably have to do a big switch {} on all the item views. (Just as the signal setup code does now.) d18 1 a18 2 o Support different units. Currently we assume everything is in pixels. o Editable text item. a23 1 o Layout containers, things like a GtkTable for canvas items. @ 1.14 log @2006-06-08 Damon Chaplin * src/goocanvasitemsimple.c (goo_canvas_item_simple_set_property): only create the item's style when needed. (goo_canvas_style_get_type): register boxed type (from Gustavo J. A. M. Carneiro). @ text @d6 5 a10 1 o I don't think we set the root group's model anywhere. @ 1.13 log @2006-06-01 Damon Chaplin * demo/demo.c: only add the "Output PDF" option if cairo has PDF support compiled in. @ text @d6 1 @ 1.12 log @2006-05-27 Damon Chaplin * autogen.sh: check for AC_CONFIG_HEADER as well as old AM_*. @ text @a5 1 o Remove ';' after G_DEFINE_TYPE* macros (see bug 341692). d10 1 @ 1.11 log @2006-05-12 Damon Chaplin * src/goocanvastextview.c (goo_canvas_text_view_create_layout): if there is no text return an empty layout rather than NULL. (goo_canvas_text_view_get_item_at): check if there is no text first. * src/goocanvasitemsimple.[hc]: rename operator to op since operator is a C++ keyword (reported by Yevgen Muntyan). @ text @d6 1 @ 1.10 log @2006-04-22 Damon Chaplin * src/goocanvasview.c: added support for keyboard focus navigation. (I still need to make it scroll to show the focused item if needed.) * demo/demo-focus.c: new demo page to test keyboard focus navigation. * src/goocanvasitemview.c: added "focus-in-event" & "focus-out-event" signals. * src/goocanvasitemsimple.c (goo_canvas_item_simple_get_path_bounds): make sure we do min/max over all points of bounds. * src/goocanvasview.c (goo_canvas_view_focus_out): emit "focus_out_event", not "focus_in_event". @ text @d2 6 @ 1.9 log @2006-04-18 Damon Chaplin * src/goocanvasview.c (goo_canvas_view_get_model): new function. (goo_canvas_view_adjustment_value_changed): emit "visible_data_changed" on accessible object. (goo_canvas_view_init): initialize default bounds, and create default adjustments. * src/goocanvasitemview.[hc]: added new is_visible() method, and "can-focus" property, and convenience find_child() function. * src/goocanvasitemviewsimple.c: implemented "can-focus" property and "is_visible" method. * src/goocanvasgroupview.c: implemented "can-focus" property and "is_visible" method, and used same flags field as GooCanvasItemViewSimple. * src/goocanvasatk.[c]: new files to support accessibility. Most of the code has been copied from foocanvas & libgnomecanvas, with slight changes to handler our model/view split. * src/goocanvasitemviewsimple.c (goo_canvas_item_view_simple_finalize): chain up to parent's finalize method. @ text @a3 7 o API docs - functions, properties, signals, enums, structs etc. o Accessibility - hopefully the GnomeCanvas/FooCanvas code can be reused. o Keyboard focus navigation - port GtkContainer focus_sort code. @ 1.8 log @2006-04-11 Damon Chaplin * src/goocanvaspathview.c: finished the elliptical arc and split up the create_path() function a bit. @ text @d4 2 a7 1 o Editable text item. d9 1 a9 1 o Keyboard focus navigation. d11 1 a11 1 o API docs - functions, properties, signals, enums, structs etc. @ 1.7 log @2006-04-08 Damon Chaplin * src/goocanvasitemsimple.[hc]: * src/goocanvasgroup.[hc]: added "pointer-events" property, like SVG. * src/goocanvasitemsimple.c (goo_canvas_item_simple_get_path_bounds): changed to include both the stroke and fill extents, even if they will not be painted. This is needed to handle the "pointer-events" property. * src/goocanvasitemsimple.c (goo_canvas_item_simple_check_in_path): added "pointer_events" argument, to specify which parts of the path to check. * src/goocanvasitemview.[hc]: change get_item_at() to take "is_pointer_event", "parent_visible", and "scale" properties, so we can handle the "pointer-events" property. * src/goocanvasgroupview.c (goo_canvas_group_view_get_item_at): * src/goocanvasellipseview.c (goo_canvas_ellipse_view_get_item_at): * src/goocanvasimageview.c (goo_canvas_image_view_get_item_at): * src/goocanvaspolylineview.c (goo_canvas_polyline_view_get_item_at): * src/goocanvasrectview.c (goo_canvas_rect_view_get_item_at): * src/goocanvastextview.c (goo_canvas_text_view_get_item_at): updated to support "pointer-events". * src/goocanvasutils.[hc]: added GooCanvasPointerEvents enum, and goo_cairo_line_dash_new(). * src/demo-events.c: new demo page to test "pointer-events" property. * src/goocanvastextview.c (goo_canvas_text_view_paint): if the fill pattern has been explicitly set to NULL, don't paint the text. @ text @a3 2 o GooCanvasPath item, as in SVG. @ 1.6 log @2006-04-03 Damon Chaplin * src/goocanvasview.c (goo_canvas_view_style_set) (goo_canvas_view_realize): use the base color for the background. * src/demo.c (create_canvas_primitives): use gtk_widget_modify_base() to test setting the background color. @ text @a3 4 o Event filter options, like "pointer-events" in SVG, specifying which parts of an item can be a target for events and if it has to be visible. o Sticky items that don't move at all as the canvas is scrolled & zoomed. a5 1 o Editable text item, with the layout remaining the same at all zoom levels. d7 3 d17 1 @ 1.5 log @2006-03-24 Damon Chaplin * src/goocanvasitemview.c (goo_canvas_item_view_ensure_updated): new convenience function to do an immediate update. * src/goocanvasview.c (goo_canvas_view_update): turned this into a public function for use by the above. * src/goocanvastextview.c (goo_canvas_text_view_get_bounds) (goo_canvas_text_view_get_item_at): * src/goocanvasrectview.c (goo_canvas_rect_view_get_bounds) (goo_canvas_rect_view_get_item_at): * src/goocanvaspolylineview.c (goo_canvas_polyline_view_get_bounds) (goo_canvas_polyline_view_get_item_at): * src/goocanvasgroupview.c (goo_canvas_group_view_get_bounds) (goo_canvas_group_view_get_item_at): * src/goocanvasimageview.c (goo_canvas_image_view_get_bounds) (goo_canvas_image_view_get_item_at): * src/goocanvasellipseview.c (goo_canvas_ellipse_view_get_bounds) (goo_canvas_ellipse_view_get_item_at): make sure the canvas is updated first, if needed. @ text @a6 2 o Background - probably default to white background, and add color setting. @ 1.4 log @2006-03-24 Damon Chaplin * src/goocanvasview.c (goo_canvas_view_render): new function to render all or part of the canvas to a given cairo context. * src/demo.c: added "Write PDF" test, that creates a pdf file containing the main canvas. * src/goocanvasview.[hc]: used a GooCanvasBounds rather than left, right, top, bottom for the bounds. Also renamed "pixels_per_unit" to "scale". * src/goocanvasitemview.[hc]: * src/goocanvastextview.c (goo_canvas_text_view_paint): * src/goocanvasgroupview.c (goo_canvas_group_view_paint): * src/goocanvasellipseview.c (goo_canvas_ellipse_view_paint): * src/goocanvasimageview.c (goo_canvas_image_view_paint): * src/goocanvaspolylineview.c (goo_canvas_polyline_view_paint): we now just pass the effective scale to the paint function rather than the GooCanvasView*, since when rendering to an arbitrary cairo_t we may not want to use a different effective scale (to determine which items are shown). (Also fixed some of the visibility checks.) @ text @a3 2 o get_bounds() should ensure item is updated. Check other functions as well. @ 1.3 log @2006-03-23 Damon Chaplin * src/goocanvasitem.c: added new "visibility" and "visibility-threshold" properties to specify when an item should be visible (always, never, or above a certain scale threshold). * src/goocanvasutils.[hc]: added GooCanvasItemVisibility enum stuff. * src/goocanvasitemsimple.[hc]: * src/goocanvasgroup.[hc]: implemented new properties. * src/goocanvasgroupview.c (goo_canvas_group_view_paint): * src/goocanvastextview.c (goo_canvas_text_view_paint): * src/goocanvasrectview.c (goo_canvas_rect_view_paint): * src/goocanvasimageview.c (goo_canvas_image_view_paint): * src/goocanvasellipseview.c (goo_canvas_ellipse_view_paint): check the visibility settings to see if the items should be painted. * src/demo.c (setup_invisible_texts): added test for visibility settings. * src/goocanvasitem.[hc] (goo_canvas_item_create_view): removed this as it is mainly an internal function and the interface can be used directly instead where needed. @ text @d4 2 d9 1 a9 2 o Function to render part/all of canvas to any cairo_t. o get_bounds() should ensure item is updated. Check other functions as well. @ 1.2 log @2006-03-22 Damon Chaplin * src/goocanvasview.[hc]: convert to a subclass of GtkContainer rather than GtkLayout, since the layout code didn't help much and just added to the confusion. (Getting scrolling/zooming to work smoothly is pretty difficult.) Added a goo_canvas_view_scroll_to() function to scroll to a desired position. Added an anchor setting to specify where to place the contents of the canvas if it is smaller than the allocated widget area. (Like the "center_scroll_region" setting in GnomeCanvas but a bit more general.) Mapped a temporary window above the canvas when zooming in/out to stop X from scrolling the canvas contents before it is redrawn. (Idea pinched from FooCanvas.) Though this could possibly cause problems with keyboard input in future, in which case I think we should drop the fancy window scrolling stuff and just scroll ourselves. Added an internal freeze_count like GtkLayout used to have. This is used while reconfiguring the scrollbars etc. so we don't scroll more than once (e.g. horizontally then vertically). Added coordinate conversion functions to convert between device units and canvas item units or pixels. * src/goocanvastextview.[hc]: create a cairo_font_options_t object in the class init function and use it for all created PangoLayouts. This ensures that text is layed out the same at any scale, which also avoids the problems with items not being redrawn properly (since the bounds were slightly wrong). Note that I was using cairo_set_font_options(cr) before, but that isn't picked up by Pango so didn't work. (Font options seem to be associated with surfaces and also with the graphics state which is confusing.) @ text @d4 2 a5 1 o Item visibility setting, combined with zoom level setting. @ 1.1 log @Initial revision @ text @d5 3 a7 3 o set_center_scroll_region() - keep the same point in the middle when zooming. o scroll_to() function. o Coordinate conversion helper functions (& use them in goocanvasview.c). d11 1 d25 2 a26 1 @ 1.1.1.1 log @Cairo canvas widget for GTK+ @ text @@