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). 2006-08-23 Damon Chaplin * src/goocanvasview.c: keep an item_to_view hash table so apps can get the view for particular items (e.g. as an easy alternative for setting up signal handlers). (goo_canvas_view_get_item_view): new function to get the item view for a given item. (goo_canvas_view_unregister_item_view): new function that implementors of GooCanvasItemView should call in their finalize method to unregister the view (so the GooCanvasView removes it from the hash table.) (goo_canvas_view_create_item_view): add the new item view to the item_to_view hash table. * src/goocanvasitemviewsimple.c (goo_canvas_item_view_simple_finalize): * src/goocanvasgroupview.c (goo_canvas_group_view_finalize): unregister the item view. (goo_canvas_group_view_set_parent_view): don't change the canvas view here any more, since we don't support that. * demo/simple-demo.c: updated to use simple signal handler setup. 2006-08-22 Damon Chaplin * src/goocanvasview.c (goo_canvas_view_class_init): 2 minor fixes for the docs (from Gian Mario Tagliaretti). 2006-08-15 Damon Chaplin * src/goocanvasutils.h: moved GOO_TYPE_CAIRO_PATTERN stuff here, so bindings can use it. Also renamed goo_cairo_line_dash stuff to goo_canvas_line_dash for consistency. * src/goocanvasutils.c (goo_canvas_line_dash_newv): new non-varargs variant of function of goo_canvas_line_dash_new() for bindings. (from Gustavo J. A. M. Carneiro.) 2006-08-14 Damon Chaplin * Makefile.am: require automake 1.7, since it is needed for glib-genmarshal (from Gian Mario Tagliaretti). 2006-08-08 Damon Chaplin * src/goocanvastextview.c (goo_canvas_text_view_update): * src/goocanvaspolylineview.c (goo_canvas_polyline_view_update): * src/goocanvasitemviewsimple.c (goo_canvas_item_view_simple_update): * src/goocanvasimageview.c (goo_canvas_image_view_update): * src/goocanvasgroupview.c (goo_canvas_group_view_update): rewrote the update methods to make sure the bounds is always set and returned correctly. 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. 2006-07-21 Damon Chaplin * src/goocanvas*view.c: renamed get_item_at() methods to get_item_view_at(). * src/goocanvasview.c (goo_canvas_view_get_root_view): new function to return the root view. (goo_canvas_view_get_item_view_at): new function to return the item view at a given point. 2006-07-19 Damon Chaplin * src/goocanvasatk.c: * src/goocanvasgroupview.c: * src/goocanvasimageview.c: * src/goocanvasitemview.c: * src/goocanvasitemview.h: * src/goocanvasitemviewsimple.c: * src/goocanvaspolylineview.c: * src/goocanvastextview.c: * src/goocanvasview.c: changed item view update() and get_bounds() methods to take a GooCanvasBounds* to fill in, rather than returning a pointer to a static GooCanvasBounds. This makes it easier for language bindings. 2006-07-19 Damon Chaplin * src/goocanvasview.c (goo_canvas_view_scroll): handle scroll events ourselves, in case we aren't placed directly in a scrolled window. * src/goocanvasitem.c (goo_canvas_item_get_transform): if the item doesn't support this method just return NULL. * demo/demo-fifteen.c: use generic goo_canvas_item_view_get_item() method to get the item rather than private struct members. * configure.in: depend on glib 2.10.0 (from Gian Mario Tagliaretti). * src/goocanvasutils.c (goo_canvas_pointer_events_get_type): use a flags type rather than an enum type (from Gustavo J. A. M. Carneiro). * src/goocanvasitem.c (goo_canvas_item_base_init): * src/goocanvasitemsimple.c: * src/goocanvasgroup.c: updated to use the flags type for "pointer-events" instead of enum. * src/goocanvasprivate.h: * src/goocanvasutils.h: The type GOO_TYPE_CAIRO_MATRIX is used in a public interface (a property in the GooCanvasItem interface), therefore it has to be public (from Gustavo J. A. M. Carneiro). 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). 2006-06-01 Damon Chaplin * demo/demo.c: only add the "Output PDF" option if cairo has PDF support compiled in. 2006-05-27 Damon Chaplin * src/*.c: removed ';' after all G_DEFINE_TYPE* macros. 2006-05-27 Damon Chaplin * autogen.sh: check for AC_CONFIG_HEADER as well as old AM_*. 2006-05-16 Damon Chaplin * goocanvas.pc.in: * Makefile.am: * configure.in: added .pc file (patch from Gian Mario Tagliaretti). 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). 2006-04-24 Damon Chaplin * Released GooCanvas 0.3 2006-04-24 Damon Chaplin * src/goocanvasview.c: added "model", "scale", "anchor", "x1", "y1", "x2", "y2" properties, and goo_canvas_view_get_bounds() and goo_canvas_view_get_scale() accessors. Removed goo_canvas_view_set_anchor() as the property should be enough. (I think we should only have accessor functions for major properties.) * src/goocanvasitemview.c (goo_canvas_item_view_is_visible) (goo_canvas_item_view_get_item_at): removed scale argument. We get it from the canvas view now, to make the API a little simpler. * src/goocanvasitemviewsimple.h (struct _GooCanvasItemViewSimple): added pointer to the canvas view. * src/*view.[hc]: added canvas view argument to all view creation functions. 2006-04-23 Damon Chaplin * src/goocanvasview.c (goo_canvas_view_focus): scroll to show the new focused item if necessary. (goo_canvas_view_set_model): set need_update to TRUE. (goo_canvas_view_focus_check_is_best): try to avoid wild jumps when moving around with the cursor keys. 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". 2006-04-19 Damon Chaplin * src/goocanvasitem.c (goo_canvas_item_base_init): added "title" and "description" properties for accessibility. Note that we only support per-item settings for the standard canvas items, though more complex items may want to support per-view settings. * src/goocanvasitemsimple.c: * src/goocanvasgroup.c: implemented "title" and "description" properties. * src/goocanvas*view.c: set the accessible name & description based on the item's settings, and update them if changed. * src/goocanvasatk.c (goo_canvas_item_view_accessible_ref_child): return the accessible rather than the item view. 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 handle our model/view split. * src/goocanvasitemviewsimple.c (goo_canvas_item_view_simple_finalize): chain up to parent's finalize method. 2006-04-16 Damon Chaplin * src/goocanvasview.c (propagate_event, emit_pointer_event): ref views and check they are still valid. * src/*view.[hc]: made views hold reference on items, to ensure we never use invalid pointers. 2006-04-16 Damon Chaplin * demo/simple-demo.c: new very simple demo, also used in docs. * src/goocanvasitemviewsimple.[hc]: new base class for item views, so we can share a lot of the common code. * src/*view.[hc]: updated item views to be a subclass of above. * src/*.c: removed lots of unused debugging code. * src/goocanvasitem.c: * src/goocanvasitemsimple.c: * src/goocanvasgroup.c: moved "pointer-events" and "transform" properties, and the "changed" signal to the GooCanvasItem interface. * src/*.[hc]: updated use of above. 2006-04-14 Damon Chaplin * src/goocanvasview.c: documented GooCanvasView, though it needs an overview and demo code. * src/*.[hc]: documented most of the core objects. * src/goocanvasutils.h: renamed goo_cairo_dash* to goo_canvas_dash* for consistency. * src/goocanvasprivate.h: new header to contain private declarations that we don't install. * src/*.[hc]: documented enums & structs on the types page. 2006-04-13 Damon Chaplin * src/*.[hc]: documented views for standard items. * src/*.[hc]: documented standard items. 2006-04-12 Damon Chaplin * configure.in: updated to use newer forms of macros. * COPYING: added LGPL license. * src/Makefile.am (libgoocanvasincludedir): install headers into $(includedir)/goocanvas-1.0 rather than $(includedir)/libgoocanvas-1.0. * demo/*: moved all the demo code here. * src/goocanvas.h: new main header to include all the public headers. * autogen.sh: * configure.in: * Makefile.am: setup to use gtk-doc. * src/Makefile.am: build libgoocanvas as a library now, so we can document it with gtk-doc. The demo will be moved to a separate directory. * src/goocanvastext.h: * src/goocanvasitem.h: rename a few parameters to match the sources, since gtk-doc complains if they are different. 2006-04-11 Damon Chaplin * src/demo-paths.c (create_paths): added more arc tests. * src/goocanvaspathview.c: finished the elliptical arc and split up the create_path() function a bit. 2006-04-10 Damon Chaplin * src/goocanvaspathview.[hc]: * src/goocanvaspath.[hc]: new path item and view, that uses the same path spec strings as SVG. I think everything works, except the elliptical arc, which I haven't finished yet. * src/demo-paths.c: new demo page to test paths. 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. 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. 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. 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.) 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. 2006-03-23 Damon Chaplin * src/goocanvasview.c (goo_canvas_view_scroll_to): freeze the canvas while setting the adjustments so we don't redraw twice. 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.)